vendor: 6,236 bytes, lines 1-9
1var zS=t=>{throw TypeError(t)};var Uy=(t,e,n)=>e.has(t)||zS("Cannot "+n);var P=(t,e,n)=>(Uy(t,e,"read from private field"),n?n.call(t):e.get(t)),Re=(t,e,n)=>e.has(t)?zS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),pe=(t,e,n,r)=>(Uy(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Qe=(t,e,n)=>(Uy(t,e,"access private method"),n);var rf=(t,e,n,r)=>({set _(s){pe(t,e,s,n)},get _(){return P(t,e,r)}});function t4(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var n4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var dE={exports:{}},kg={},hE={exports:{}},Ke={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Mh=Symbol.for("react.element"),r4=Symbol.for("react.portal"),s4=Symbol.for("react.fragment"),i4=Symbol.for("react.strict_mode"),o4=Symbol.for("react.profiler"),a4=Symbol.for("react.provider"),l4=Symbol.for("react.context"),c4=Symbol.for("react.forward_ref"),u4=Symbol.for("react.suspense"),d4=Symbol.for("react.memo"),h4=Symbol.for("react.lazy"),FS=Symbol.iterator;function f4(t){return t===null||typeof t!="object"?null:(t=FS&&t[FS]||t["@@iterator"],typeof t=="function"?t:null)}var fE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},pE=Object.assign,mE={};function Jc(t,e,n){this.props=t,this.context=e,this.refs=mE,this.updater=n||fE}Jc.prototype.isReactComponent={};Jc.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Jc.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function gE(){}gE.prototype=Jc.prototype;function Xw(t,e,n){this.props=t,this.context=e,this.refs=mE,this.updater=n||fE}var Zw=Xw.prototype=new gE;Zw.constructor=Xw;pE(Zw,Jc.prototype);Zw.isPureReactComponent=!0;var US=Array.isArray,yE=Object.prototype.hasOwnProperty,e0={current:null},vE={key:!0,ref:!0,__self:!0,__source:!0};function xE(t,e,n){var r,s={},i=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)yE.call(e,r)&&!vE.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Mh,type:t,key:i,ref:o,props:s,_owner:e0.current}}function p4(t,e){return{$$typeof:Mh,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function t0(t){return typeof t=="object"&&t!==null&&t.$$typeof===Mh}function m4(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var VS=/\/+/g;function Vy(t,e){return typeof t=="object"&&t!==null&&t.key!=null?m4(""+t.key):e.toString(36)}function np(t,e,n,r,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Mh:case r4:o=!0}}if(o)return o=t,s=s(o),t=r===""?"."+Vy(o,0):r,US(s)?(n="",t!=null&&(n=t.replace(VS,"$&/")+"/"),np(s,e,n,"",function(u){return u})):s!=null&&(t0(s)&&(s=p4(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(VS,"$&/")+"/")+t)),e.push(s)),1;if(o=0,r=r===""?".":r+":",US(t))for(var a=0;a<t.length;a++){i=t[a];var c=r+Vy(i,a);o+=np(i,e,n,c,s)}else if(c=f4(t),typeof c=="function")for(t=c.call(t),a=0;!(i=t.next()).done;)i=i.value,c=r+Vy(i,a++),o+=np(i,e,n,c,s);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function sf(t,e,n){if(t==null)return t;var r=[],s=0;return np(t,r,"","",function(i){return e.call(n,i,s++)}),r}function g4(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var tr={current:null},rp={transition:null},y4={ReactCurrentDispatcher:tr,ReactCurrentBatchConfig:rp,ReactCurrentOwner:e0};function bE(){throw Error("act(...) is not supported in production builds of React.")}Ke.Children={map:sf,forEach:function(t,e,n){sf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return sf(t,function(){e++}),e},toArray:function(t){return sf(t,function(e){return e})||[]},only:function(t){if(!t0(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ke.Component=Jc;Ke.Fragment=s4;Ke.Profiler=o4;Ke.PureComponent=Xw;Ke.StrictMode=i4;Ke.Suspense=u4;
vendor: 4,811 bytes, lines 9-25
9Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=y4;Ke.act=bE;Ke.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=pE({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=e0.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(c in e)yE.call(e,c)&&!vE.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&a!==void 0?a[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Mh,type:t.type,key:s,ref:i,props:r,_owner:o}};Ke.createContext=function(t){return t={$$typeof:l4,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:a4,_context:t},t.Consumer=t};Ke.createElement=xE;Ke.createFactory=function(t){var e=xE.bind(null,t);return e.type=t,e};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(t){return{$$typeof:c4,render:t}};Ke.isValidElement=t0;Ke.lazy=function(t){return{$$typeof:h4,_payload:{_status:-1,_result:t},_init:g4}};Ke.memo=function(t,e){return{$$typeof:d4,type:t,compare:e===void 0?null:e}};Ke.startTransition=function(t){var e=rp.transition;rp.transition={};try{t()}finally{rp.transition=e}};Ke.unstable_act=bE;Ke.useCallback=function(t,e){return tr.current.useCallback(t,e)};Ke.useContext=function(t){return tr.current.useContext(t)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(t){return tr.current.useDeferredValue(t)};Ke.useEffect=function(t,e){return tr.current.useEffect(t,e)};Ke.useId=function(){return tr.current.useId()};Ke.useImperativeHandle=function(t,e,n){return tr.current.useImperativeHandle(t,e,n)};Ke.useInsertionEffect=function(t,e){return tr.current.useInsertionEffect(t,e)};Ke.useLayoutEffect=function(t,e){return tr.current.useLayoutEffect(t,e)};Ke.useMemo=function(t,e){return tr.current.useMemo(t,e)};Ke.useReducer=function(t,e,n){return tr.current.useReducer(t,e,n)};Ke.useRef=function(t){return tr.current.useRef(t)};Ke.useState=function(t){return tr.current.useState(t)};Ke.useSyncExternalStore=function(t,e,n){return tr.current.useSyncExternalStore(t,e,n)};Ke.useTransition=function(){return tr.current.useTransition()};Ke.version="18.3.1";hE.exports=Ke;var y=hE.exports;const V=wg(y),n0=t4({__proto__:null,default:V},[y]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var v4=y,x4=Symbol.for("react.element"),b4=Symbol.for("react.fragment"),w4=Object.prototype.hasOwnProperty,k4=v4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S4={key:!0,ref:!0,__self:!0,__source:!0};function wE(t,e,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)w4.call(e,r)&&!S4.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:x4,type:t,key:i,ref:o,props:s,_owner:k4.current}}kg.Fragment=b4;kg.jsx=wE;kg.jsxs=wE;dE.exports=kg;var l=dE.exports,kE={exports:{}},Ar={},SE={exports:{}},CE={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(t){function e(I,T){var U=I.length;I.push(T);e:for(;0<U;){var M=U-1>>>1,$=I[M];if(0<s($,T))I[M]=T,I[U]=$,U=M;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var T=I[0],U=I.pop();if(U!==T){I[0]=U;e:for(var M=0,$=I.length,B=$>>>1;M<B;){var G=2*(M+1)-1,X=I[G],oe=G+1,K=I[oe];if(0>s(X,U))oe<$&&0>s(K,X)?(I[M]=K,I[oe]=U,M=oe):(I[M]=X,I[G]=U,M=G);else if(oe<$&&0>s(K,U))I[M]=K,I[oe]=U,M=oe;else break e}}return T}function s(I,T){var U=I.sortIndex-T.sortIndex;return U!==0?U:I.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],u=[],d=1,h=null,p=3,f=!1,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(I){for(var T=n(u);T!==null;){if(T.callback===null)r(u);else if(T.startTime<=I)r(u),T.sortIndex=T.expirationTime,e(c,T);else break;T=n(u)}}
vendor: 9,390 bytes, lines 25-34
25function k(I){if(m=!1,w(I),!g)if(n(c)!==null)g=!0,F(j);else{var T=n(u);T!==null&&H(k,T.startTime-I)}}function j(I,T){g=!1,m&&(m=!1,x(S),S=-1),f=!0;var U=p;try{for(w(T),h=n(c);h!==null&&(!(h.expirationTime>T)||I&&!R());){var M=h.callback;if(typeof M=="function"){h.callback=null,p=h.priorityLevel;var $=M(h.expirationTime<=T);T=t.unstable_now(),typeof $=="function"?h.callback=$:h===n(c)&&r(c),w(T)}else r(c);h=n(c)}if(h!==null)var B=!0;else{var G=n(u);G!==null&&H(k,G.startTime-T),B=!1}return B}finally{h=null,p=U,f=!1}}var E=!1,N=null,S=-1,C=5,_=-1;function R(){return!(t.unstable_now()-_<C)}function O(){if(N!==null){var I=t.unstable_now();_=I;var T=!0;try{T=N(!0,I)}finally{T?L():(E=!1,N=null)}}else E=!1}var L;if(typeof b=="function")L=function(){b(O)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,z=A.port2;A.port1.onmessage=O,L=function(){z.postMessage(null)}}else L=function(){v(O,0)};function F(I){N=I,E||(E=!0,L())}function H(I,T){S=v(function(){I(t.unstable_now())},T)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_continueExecution=function(){g||f||(g=!0,F(j))},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(I){switch(p){case 1:case 2:case 3:var T=3;break;default:T=p}var U=p;p=T;try{return I()}finally{p=U}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(I,T){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var U=p;p=I;try{return T()}finally{p=U}},t.unstable_scheduleCallback=function(I,T,U){var M=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?M+U:M):U=M,I){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=U+$,I={id:d++,callback:T,priorityLevel:I,startTime:U,expirationTime:$,sortIndex:-1},U>M?(I.sortIndex=U,e(u,I),n(c)===null&&I===n(u)&&(m?(x(S),S=-1):m=!0,H(k,U-M))):(I.sortIndex=$,e(c,I),g||f||(g=!0,F(j))),I},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(I){var T=p;return function(){var U=p;p=T;try{return I.apply(this,arguments)}finally{p=U}}}})(CE);SE.exports=CE;var C4=SE.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var j4=y,Nr=C4;function te(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var jE=new Set,Rd={};function ll(t,e){Cc(t,e),Cc(t+"Capture",e)}function Cc(t,e){for(Rd[t]=e,t=0;t<e.length;t++)jE.add(e[t])}var bi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wx=Object.prototype.hasOwnProperty,N4=/^[: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]*$/,HS={},WS={};function _4(t){return wx.call(WS,t)?!0:wx.call(HS,t)?!1:N4.test(t)?WS[t]=!0:(HS[t]=!0,!1)}function E4(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T4(t,e,n,r){if(e===null||typeof e>"u"||E4(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function nr(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var Pn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Pn[t]=new nr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Pn[e]=new nr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Pn[t]=new nr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Pn[t]=new nr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Pn[t]=new nr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Pn[t]=new nr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Pn[t]=new nr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Pn[t]=new nr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Pn[t]=new nr(t,5,!1,t.toLowerCase(),null,!1,!1)});var r0=/[\-:]([a-z])/g;function s0(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(r0,s0);Pn[e]=new nr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(r0,s0);Pn[e]=new nr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(r0,s0);Pn[e]=new nr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Pn[t]=new nr(t,1,!1,t.toLowerCase(),null,!1,!1)});Pn.xlinkHref=new nr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Pn[t]=new nr(t,1,!1,t.toLowerCase(),null,!0,!0)});function i0(t,e,n,r){var s=Pn.hasOwnProperty(e)?Pn[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(T4(e,n,s,r)&&(n=null),r||s===null?_4(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):s.mustUseProperty?t[s.propertyName]=n===null?s.type===3?!1:"":n:(e=s.attributeName,r=s.attributeNamespace,n===null?t.removeAttribute(e):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Ti=j4.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,of=Symbol.for("react.element"),Bl=Symbol.for("react.portal"),zl=Symbol.for("react.fragment"),o0=Symbol.for("react.strict_mode"),kx=Symbol.for("react.profiler"),NE=Symbol.for("react.provider"),_E=Symbol.for("react.context"),a0=Symbol.for("react.forward_ref"),Sx=Symbol.for("react.suspense"),Cx=Symbol.for("react.suspense_list"),l0=Symbol.for("react.memo"),Yi=Symbol.for("react.lazy"),EE=Symbol.for("react.offscreen"),qS=Symbol.iterator;function yu(t){return t===null||typeof t!="object"?null:(t=qS&&t[qS]||t["@@iterator"],typeof t=="function"?t:null)}var Mt=Object.assign,Hy;function Bu(t){if(Hy===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Hy=e&&e[1]||""}return` 34`+Hy+t}var Wy=!1;function qy(t,e){if(!t||Wy)return"";Wy=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}
vendor: 5,499 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(` 35`),i=r.stack.split(` 36`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var c=` 37`+s[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{Wy=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Bu(t):""}function R4(t){switch(t.tag){case 5:return Bu(t.type);case 16:return Bu("Lazy");case 13:return Bu("Suspense");case 19:return Bu("SuspenseList");case 0:case 2:case 15:return t=qy(t.type,!1),t;case 11:return t=qy(t.type.render,!1),t;case 1:return t=qy(t.type,!0),t;default:return""}}function jx(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case zl:return"Fragment";case Bl:return"Portal";case kx:return"Profiler";case o0:return"StrictMode";case Sx:return"Suspense";case Cx:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case _E:return(t.displayName||"Context")+".Consumer";case NE:return(t._context.displayName||"Context")+".Provider";case a0:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case l0:return e=t.displayName||null,e!==null?e:jx(t.type)||"Memo";case Yi:e=t._payload,t=t._init;try{return jx(t(e))}catch{}}return null}function A4(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return jx(e);case 8:return e===o0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Uo(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function TE(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function O4(t){var e=TE(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function af(t){t._valueTracker||(t._valueTracker=O4(t))}function RE(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=TE(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Ep(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Nx(t,e){var n=e.checked;return Mt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function KS(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Uo(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function AE(t,e){e=e.checked,e!=null&&i0(t,"checked",e,!1)}function _x(t,e){AE(t,e);var n=Uo(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Ex(t,e.type,n):e.hasOwnProperty("defaultValue")&&Ex(t,e.type,Uo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function GS(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Ex(t,e,n){(e!=="number"||Ep(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var zu=Array.isArray;function Xl(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s<n.length;s++)e["$"+n[s]]=!0;for(n=0;n<t.length;n++)s=e.hasOwnProperty("$"+t[n].value),t[n].selected!==s&&(t[n].selected=s),s&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Uo(n),e=null,s=0;s<t.length;s++){if(t[s].value===n){t[s].selected=!0,r&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Tx(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(te(91));return Mt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function YS(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(te(92));
vendor: 11,269 bytes, line 37
37if(zu(n)){if(1<n.length)throw Error(te(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Uo(n)}}function OE(t,e){var n=Uo(e.value),r=Uo(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function JS(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function PE(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rx(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?PE(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var lf,ME=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,s){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(lf=lf||document.createElement("div"),lf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=lf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ad(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ed={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},P4=["Webkit","ms","Moz","O"];Object.keys(ed).forEach(function(t){P4.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ed[e]=ed[t]})});function IE(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ed.hasOwnProperty(t)&&ed[t]?(""+e).trim():e+"px"}function DE(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=IE(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var M4=Mt({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 Ax(t,e){if(e){if(M4[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(te(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(te(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(te(61))}if(e.style!=null&&typeof e.style!="object")throw Error(te(62))}}function Ox(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Px=null;function c0(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Mx=null,Zl=null,ec=null;function QS(t){if(t=Lh(t)){if(typeof Mx!="function")throw Error(te(280));var e=t.stateNode;e&&(e=_g(e),Mx(t.stateNode,t.type,e))}}function LE(t){Zl?ec?ec.push(t):ec=[t]:Zl=t}function $E(){if(Zl){var t=Zl,e=ec;if(ec=Zl=null,QS(t),e)for(t=0;t<e.length;t++)QS(e[t])}}function BE(t,e){return t(e)}function zE(){}var Ky=!1;function FE(t,e,n){if(Ky)return t(e,n);Ky=!0;try{return BE(t,e,n)}finally{Ky=!1,(Zl!==null||ec!==null)&&(zE(),$E())}}function Od(t,e){var n=t.stateNode;if(n===null)return null;var r=_g(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(te(231,e,typeof n));return n}var Ix=!1;if(bi)try{var vu={};Object.defineProperty(vu,"passive",{get:function(){Ix=!0}}),window.addEventListener("test",vu,vu),window.removeEventListener("test",vu,vu)}catch{Ix=!1}function I4(t,e,n,r,s,i,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var td=!1,Tp=null,Rp=!1,Dx=null,D4={onError:function(t){td=!0,Tp=t}};function L4(t,e,n,r,s,i,o,a,c){td=!1,Tp=null,I4.apply(D4,arguments)}function $4(t,e,n,r,s,i,o,a,c){if(L4.apply(this,arguments),td){if(td){var u=Tp;td=!1,Tp=null}else throw Error(te(198));Rp||(Rp=!0,Dx=u)}}function cl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function UE(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function XS(t){if(cl(t)!==t)throw Error(te(188))}function B4(t){var e=t.alternate;if(!e){if(e=cl(t),e===null)throw Error(te(188));return e!==t?null:t}for(var n=t,r=e;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return XS(s),t;if(i===r)return XS(s),e;i=i.sibling}throw Error(te(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(te(189))}}if(n.alternate!==r)throw Error(te(190))}if(n.tag!==3)throw Error(te(188));return n.stateNode.current===n?t:e}function VE(t){return t=B4(t),t!==null?HE(t):null}function HE(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=HE(t);if(e!==null)return e;t=t.sibling}return null}var WE=Nr.unstable_scheduleCallback,ZS=Nr.unstable_cancelCallback,z4=Nr.unstable_shouldYield,F4=Nr.unstable_requestPaint,Yt=Nr.unstable_now,U4=Nr.unstable_getCurrentPriorityLevel,u0=Nr.unstable_ImmediatePriority,qE=Nr.unstable_UserBlockingPriority,Ap=Nr.unstable_NormalPriority,V4=Nr.unstable_LowPriority,KE=Nr.unstable_IdlePriority,Sg=null,Hs=null;function H4(t){if(Hs&&typeof Hs.onCommitFiberRoot=="function")try{Hs.onCommitFiberRoot(Sg,t,void 0,(t.current.flags&128)===128)}catch{}}var vs=Math.clz32?Math.clz32:K4,W4=Math.log,q4=Math.LN2;function K4(t){return t>>>=0,t===0?32:31-(W4(t)/q4|0)|0}var cf=64,uf=4194304;function Fu(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Op(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Fu(a):(i&=o,i!==0&&(r=Fu(i)))}else o=n&~s,o!==0?r=Fu(o):i!==0&&(r=Fu(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-vs(e),s=1<<n,r|=t[n],e&=~s;return r}function G4(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Y4(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-vs(i),a=1<<o,c=s[o];c===-1?(!(a&n)||a&r)&&(s[o]=G4(a,e)):c<=e&&(t.expiredLanes|=a),i&=~a}}function Lx(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function GE(){var t=cf;return cf<<=1,!(cf&4194240)&&(cf=64),t}function Gy(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ih(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-vs(e),t[e]=n}function J4(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var s=31-vs(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function d0(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-vs(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var ct=0;function YE(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var JE,h0,QE,XE,ZE,$x=!1,df=[],jo=null,No=null,_o=null,Pd=new Map,Md=new Map,no=[],Q4="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 e1(t,e){switch(t){case"focusin":case"focusout":jo=null;break;case"dragenter":case"dragleave":No=null;break;case"mouseover":case"mouseout":_o=null;break;case"pointerover":case"pointerout":Pd.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Md.delete(e.pointerId)}}function xu(t,e,n,r,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},e!==null&&(e=Lh(e),e!==null&&h0(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function X4(t,e,n,r,s){switch(e){case"focusin":return jo=xu(jo,t,e,n,r,s),!0;case"dragenter":return No=xu(No,t,e,n,r,s),!0;case"mouseover":return _o=xu(_o,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return Pd.set(i,xu(Pd.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Md.set(i,xu(Md.get(i)||null,t,e,n,r,s)),!0}return!1}function eT(t){var e=va(t.target);if(e!==null){var n=cl(e);if(n!==null){if(e=n.tag,e===13){if(e=UE(n),e!==null){t.blockedOn=e,ZE(t.priority,function(){QE(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function sp(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Bx(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Px=r,n.target.dispatchEvent(r),Px=null}else return e=Lh(n),e!==null&&h0(e),t.blockedOn=n,!1;e.shift()}return!0}function t1(t,e,n){sp(t)&&n.delete(e)}function Z4(){$x=!1,jo!==null&&sp(jo)&&(jo=null),No!==null&&sp(No)&&(No=null),_o!==null&&sp(_o)&&(_o=null),Pd.forEach(t1),Md.forEac
vendor: 11,826 bytes, line 37
37h(t1)}function bu(t,e){t.blockedOn===e&&(t.blockedOn=null,$x||($x=!0,Nr.unstable_scheduleCallback(Nr.unstable_NormalPriority,Z4)))}function Id(t){function e(s){return bu(s,t)}if(0<df.length){bu(df[0],t);for(var n=1;n<df.length;n++){var r=df[n];r.blockedOn===t&&(r.blockedOn=null)}}for(jo!==null&&bu(jo,t),No!==null&&bu(No,t),_o!==null&&bu(_o,t),Pd.forEach(e),Md.forEach(e),n=0;n<no.length;n++)r=no[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<no.length&&(n=no[0],n.blockedOn===null);)eT(n),n.blockedOn===null&&no.shift()}var tc=Ti.ReactCurrentBatchConfig,Pp=!0;function e$(t,e,n,r){var s=ct,i=tc.transition;tc.transition=null;try{ct=1,f0(t,e,n,r)}finally{ct=s,tc.transition=i}}function t$(t,e,n,r){var s=ct,i=tc.transition;tc.transition=null;try{ct=4,f0(t,e,n,r)}finally{ct=s,tc.transition=i}}function f0(t,e,n,r){if(Pp){var s=Bx(t,e,n,r);if(s===null)sv(t,e,r,Mp,n),e1(t,r);else if(X4(s,t,e,n,r))r.stopPropagation();else if(e1(t,r),e&4&&-1<Q4.indexOf(t)){for(;s!==null;){var i=Lh(s);if(i!==null&&JE(i),i=Bx(t,e,n,r),i===null&&sv(t,e,r,Mp,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else sv(t,e,r,null,n)}}var Mp=null;function Bx(t,e,n,r){if(Mp=null,t=c0(r),t=va(t),t!==null)if(e=cl(t),e===null)t=null;else if(n=e.tag,n===13){if(t=UE(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Mp=t,null}function tT(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(U4()){case u0:return 1;case qE:return 4;case Ap:case V4:return 16;case KE:return 536870912;default:return 16}default:return 16}}var yo=null,p0=null,ip=null;function nT(){if(ip)return ip;var t,e=p0,n=e.length,r,s="value"in yo?yo.value:yo.textContent,i=s.length;for(t=0;t<n&&e[t]===s[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===s[i-r];r++);return ip=s.slice(t,1<r?1-r:void 0)}function op(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function hf(){return!0}function n1(){return!1}function Or(t){function e(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?hf:n1,this.isPropagationStopped=n1,this}return Mt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=hf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hf)},persist:function(){},isPersistent:hf}),e}var Qc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},m0=Or(Qc),Dh=Mt({},Qc,{view:0,detail:0}),n$=Or(Dh),Yy,Jy,wu,Cg=Mt({},Dh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:g0,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==wu&&(wu&&t.type==="mousemove"?(Yy=t.screenX-wu.screenX,Jy=t.screenY-wu.screenY):Jy=Yy=0,wu=t),Yy)},movementY:function(t){return"movementY"in t?t.movementY:Jy}}),r1=Or(Cg),r$=Mt({},Cg,{dataTransfer:0}),s$=Or(r$),i$=Mt({},Dh,{relatedTarget:0}),Qy=Or(i$),o$=Mt({},Qc,{animationName:0,elapsedTime:0,pseudoElement:0}),a$=Or(o$),l$=Mt({},Qc,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),c$=Or(l$),u$=Mt({},Qc,{data:0}),s1=Or(u$),d$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},h$={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"},f$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p$(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=f$[t])?!!e[t]:!1}function g0(){return p$}var m$=Mt({},Dh,{key:function(t){if(t.key){var e=d$[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=op(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?h$[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:g0,charCode:function(t){return t.type==="keypress"?op(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?op(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),g$=Or(m$),y$=Mt({},Cg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i1=Or(y$),v$=Mt({},Dh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:g0}),x$=Or(v$),b$=Mt({},Qc,{propertyName:0,elapsedTime:0,pseudoElement:0}),w$=Or(b$),k$=Mt({},Cg,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),S$=Or(k$),C$=[9,13,27,32],y0=bi&&"CompositionEvent"in window,nd=null;bi&&"documentMode"in document&&(nd=document.documentMode);var j$=bi&&"TextEvent"in window&&!nd,rT=bi&&(!y0||nd&&8<nd&&11>=nd),o1=" ",a1=!1;function sT(t,e){switch(t){case"keyup":return C$.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iT(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fl=!1;function N$(t,e){switch(t){case"compositionend":return iT(e);case"keypress":return e.which!==32?null:(a1=!0,o1);case"textInput":return t=e.data,t===o1&&a1?null:t;default:return null}}function _$(t,e){if(Fl)return t==="compositionend"||!y0&&sT(t,e)?(t=nT(),ip=p0=yo=null,Fl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return rT&&e.locale!=="ko"?null:e.data;default:return null}}var E$={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 l1(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!E$[t.type]:e==="textarea"}function oT(t,e,n,r){LE(r),e=Ip(e,"onChange"),0<e.length&&(n=new m0("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var rd=null,Dd=null;function T$(t){yT(t,0)}function jg(t){var e=Hl(t);if(RE(e))return t}function R$(t,e){if(t==="change")return e}var aT=!1;if(bi){var Xy;if(bi){var Zy="oninput"in document;if(!Zy){var c1=document.createElement("div");c1.setAttribute("oninput","return;"),Zy=typeof c1.oninput=="function"}Xy=Zy}else Xy=!1;aT=Xy&&(!document.documentMode||9<document.documentMode)}function u1(){rd&&(rd.detachEvent("onpropertychange",lT),Dd=rd=null)}function lT(t){if(t.propertyName==="value"&&jg(Dd)){var e=[];oT(e,Dd,t,c0(t)),FE(T$,e)}}function A$(t,e,n){t==="focusin"?(u1(),rd=e,Dd=n,rd.attachEvent("onpropertychange",lT)):t==="focusout"&&u1()}function O$(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return jg(Dd)}function P$(t,e){if(t==="click")return jg(e)}function M$(t,e){if(t==="input"||t==="change")return jg(e)}function I$(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ws=typeof Object.is=="function"?Object.is:I$;function Ld(t,e){if(ws(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!wx.call(e,s)||!ws(t[s],e[s]))return!1}return!0}function d1(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function h1(t,e){var n=d1(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=d1(n)}}function cT(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?cT(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function uT(){for(var t=window,e=Ep();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ep(t.document)}return e}function v0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function D$(t){var e=uT(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&cT(n.ownerDocument.documentElement,n)){if(r!==null&&v0(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=h1(n,i);var o=h1(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var L$=bi&&"documentMode"in document&&11>=document.documentMode,Ul=null,zx=null,sd=null,Fx=!1;function f1(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fx||Ul==null||Ul!==Ep(r)||(r=Ul,"selectionStart"in r&&v0(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),sd&&Ld(sd,r)||(sd=r,r=Ip(zx,"onSelect"),0<r.length&&(e=new m0("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Ul)))}function ff(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Vl={animationend:ff("Animation","AnimationEnd"),animationiteration:ff("Animation","AnimationIteration"),animationstart:ff("Animation","AnimationStart"),transitionend:ff("Transition","TransitionEnd")},ev={},dT={};bi&&(dT=document.createElement("div").style,"AnimationEvent"in window||(delete Vl.animationend.animation,delete Vl.animationiteration.animation,delete Vl.animationstart.animation),"TransitionEvent"in window||delete Vl.transitionend.transition);function Ng(t){if(ev[t])return ev[t];if(!Vl[t])return t;var e=Vl[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in dT)return ev[t]=e[n];return t}var hT=Ng("animationend"),fT=Ng("animationiteration"),pT=Ng("animationstart"),mT=Ng("transitionend"),gT=new Map,p1="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 Jo(t,e){gT.set(t,e),ll(e,[t])}for(var tv=0;tv<p1.length;tv++){var nv=p1[tv],$$=nv.toLowerCase(),B$=nv[0].toUpperCase()+nv.slice(1);Jo($$,"on"+B$)}Jo(hT,"onAnimationEnd");Jo(fT,"onAnimationIteration");Jo(pT,"onAnimationStart");Jo("dblclick","onDoubleClick");Jo("focusin","onFocus");Jo("focusout","onBlur");Jo(mT,"onTransitionEnd");Cc("onMouseEnter",["mouseout","mouseover"]);Cc("onMouseLeave",["mouseout","mouseover"]);Cc("onPointerEnter",["pointerout","pointerover"]);Cc("onPointerLeave",["pointerout","pointerover"]);ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ll("onBeforeInput",["compositionend","keypress","textInput","paste"]);ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uu="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(" "),z$=new Set("cancel close invalid load scroll toggle".split(" ").concat(Uu));function m1(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,$4(r,e,void 0,t),t.currentTarget=null}function yT(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],s=r.event;r=r.listeners;e:{var i=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;m1(s,a,u),i=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;m1(s,a,u),i=c}}}if(Rp)throw t=Dx,Rp=!1,Dx=null,t}function xt(t,e){var n=e[qx];n===void 0&&(n=e[qx]=new Set);var r=t+"__bubble";n.has(r)||(vT(e,t,2,!1),n.add(r))}function rv(t,e,n){var r=0;e&&(r|=4),vT(n,t,r,e)}var pf="_reactListening"+Math.random().toString(36).slice(2);function $d(t){if(!t[pf]){t[pf]=!0,jE.forEach(function(n){n!=="selectionchange"&&(z$.has(n)||rv(n,!1,t),rv(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[pf]||(e[pf]=!0,rv("selectionchange",!1,e))}}function vT(t,e,n,r){switch(tT(e)){case 1:var s=e$;break;case 4:s=t$;break;default:s=f0}n=s.bind(null,e,n,t),s=void 0,!Ix||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),r?s!==void 0?t.addEventListener(e,n,{capture:!0,passive:s}):t.addEventListener(e,n,!0):s!==void 0?t.addEventListener(e,n,{passive:s}):t.addEventListener(e,n,!1)}function sv(t,e,n,r,s){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;
vendor: 5,317 bytes, lines 37-38
37if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;a!==null;){if(o=va(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}FE(function(){var u=i,d=c0(n),h=[];e:{var p=gT.get(t);if(p!==void 0){var f=m0,g=t;switch(t){case"keypress":if(op(n)===0)break e;case"keydown":case"keyup":f=g$;break;case"focusin":g="focus",f=Qy;break;case"focusout":g="blur",f=Qy;break;case"beforeblur":case"afterblur":f=Qy;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=r1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=s$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=x$;break;case hT:case fT:case pT:f=a$;break;case mT:f=w$;break;case"scroll":f=n$;break;case"wheel":f=S$;break;case"copy":case"cut":case"paste":f=c$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=i1}var m=(e&4)!==0,v=!m&&t==="scroll",x=m?p!==null?p+"Capture":null:p;m=[];for(var b=u,w;b!==null;){w=b;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,x!==null&&(k=Od(b,x),k!=null&&m.push(Bd(b,k,w)))),v)break;b=b.return}0<m.length&&(p=new f(p,g,null,n,d),h.push({event:p,listeners:m}))}}if(!(e&7)){e:{if(p=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",p&&n!==Px&&(g=n.relatedTarget||n.fromElement)&&(va(g)||g[wi]))break e;if((f||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,f?(g=n.relatedTarget||n.toElement,f=u,g=g?va(g):null,g!==null&&(v=cl(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(f=null,g=u),f!==g)){if(m=r1,k="onMouseLeave",x="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(m=i1,k="onPointerLeave",x="onPointerEnter",b="pointer"),v=f==null?p:Hl(f),w=g==null?p:Hl(g),p=new m(k,b+"leave",f,n,d),p.target=v,p.relatedTarget=w,k=null,va(d)===u&&(m=new m(x,b+"enter",g,n,d),m.target=w,m.relatedTarget=v,k=m),v=k,f&&g)t:{for(m=f,x=g,b=0,w=m;w;w=yl(w))b++;for(w=0,k=x;k;k=yl(k))w++;for(;0<b-w;)m=yl(m),b--;for(;0<w-b;)x=yl(x),w--;for(;b--;){if(m===x||x!==null&&m===x.alternate)break t;m=yl(m),x=yl(x)}m=null}else m=null;f!==null&&g1(h,p,f,m,!1),g!==null&&v!==null&&g1(h,v,g,m,!0)}}e:{if(p=u?Hl(u):window,f=p.nodeName&&p.nodeName.toLowerCase(),f==="select"||f==="input"&&p.type==="file")var j=R$;else if(l1(p))if(aT)j=M$;else{j=O$;var E=A$}else(f=p.nodeName)&&f.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(j=P$);if(j&&(j=j(t,u))){oT(h,j,n,d);break e}E&&E(t,p,u),t==="focusout"&&(E=p._wrapperState)&&E.controlled&&p.type==="number"&&Ex(p,"number",p.value)}switch(E=u?Hl(u):window,t){case"focusin":(l1(E)||E.contentEditable==="true")&&(Ul=E,zx=u,sd=null);break;case"focusout":sd=zx=Ul=null;break;case"mousedown":Fx=!0;break;case"contextmenu":case"mouseup":case"dragend":Fx=!1,f1(h,n,d);break;case"selectionchange":if(L$)break;case"keydown":case"keyup":f1(h,n,d)}var N;if(y0)e:{switch(t){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Fl?sT(t,n)&&(S="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(rT&&n.locale!=="ko"&&(Fl||S!=="onCompositionStart"?S==="onCompositionEnd"&&Fl&&(N=nT()):(yo=d,p0="value"in yo?yo.value:yo.textContent,Fl=!0)),E=Ip(u,S),0<E.length&&(S=new s1(S,t,null,n,d),h.push({event:S,listeners:E}),N?S.data=N:(N=iT(n),N!==null&&(S.data=N)))),(N=j$?N$(t,n):_$(t,n))&&(u=Ip(u,"onBeforeInput"),0<u.length&&(d=new s1("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=N))}yT(h,e)})}function Bd(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Ip(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Od(t,n),i!=null&&r.unshift(Bd(t,i,s)),i=Od(t,e),i!=null&&r.push(Bd(t,i,s))),t=t.return}return r}function yl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function g1(t,e,n,r,s){for(var i=e._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&u!==null&&(a=u,s?(c=Od(n,i),c!=null&&o.unshift(Bd(n,c,a))):s||(c=Od(n,i),c!=null&&o.push(Bd(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var F$=/\r\n?/g,U$=/\u0000|\uFFFD/g;function y1(t){return(typeof t=="string"?t:""+t).replace(F$,` 38`).replace(U$,"")}function mf(t,e,n){if(e=y1(e),y1(t)!==e&&n)throw Error(te(425))}function Dp(){}var Ux=null,Vx=null;function Hx(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Wx=typeof setTimeout=="function"?setTimeout:void 0,V$=typeof clearTimeout=="function"?clearTimeout:void 0,v1=typeof Promise=="function"?Promise:void 0,H$=typeof queueMicrotask=="function"?queueMicrotask:typeof v1<"u"?function(t){return v1.resolve(null).then(t).cat
vendor: 4,832 bytes, line 38
38ch(W$)}:Wx;function W$(t){setTimeout(function(){throw t})}function iv(t,e){var n=e,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){t.removeChild(s),Id(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Id(e)}function Eo(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function x1(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Xc=Math.random().toString(36).slice(2),zs="__reactFiber$"+Xc,zd="__reactProps$"+Xc,wi="__reactContainer$"+Xc,qx="__reactEvents$"+Xc,q$="__reactListeners$"+Xc,K$="__reactHandles$"+Xc;function va(t){var e=t[zs];if(e)return e;for(var n=t.parentNode;n;){if(e=n[wi]||n[zs]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=x1(t);t!==null;){if(n=t[zs])return n;t=x1(t)}return e}t=n,n=t.parentNode}return null}function Lh(t){return t=t[zs]||t[wi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Hl(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(te(33))}function _g(t){return t[zd]||null}var Kx=[],Wl=-1;function Qo(t){return{current:t}}function wt(t){0>Wl||(t.current=Kx[Wl],Kx[Wl]=null,Wl--)}function gt(t,e){Wl++,Kx[Wl]=t.current,t.current=e}var Vo={},Vn=Qo(Vo),ur=Qo(!1),Va=Vo;function jc(t,e){var n=t.type.contextTypes;if(!n)return Vo;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function dr(t){return t=t.childContextTypes,t!=null}function Lp(){wt(ur),wt(Vn)}function b1(t,e,n){if(Vn.current!==Vo)throw Error(te(168));gt(Vn,e),gt(ur,n)}function xT(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(te(108,A4(t)||"Unknown",s));return Mt({},n,r)}function $p(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Vo,Va=Vn.current,gt(Vn,t),gt(ur,ur.current),!0}function w1(t,e,n){var r=t.stateNode;if(!r)throw Error(te(169));n?(t=xT(t,e,Va),r.__reactInternalMemoizedMergedChildContext=t,wt(ur),wt(Vn),gt(Vn,t)):wt(ur),gt(ur,n)}var hi=null,Eg=!1,ov=!1;function bT(t){hi===null?hi=[t]:hi.push(t)}function G$(t){Eg=!0,bT(t)}function Xo(){if(!ov&&hi!==null){ov=!0;var t=0,e=ct;try{var n=hi;for(ct=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}hi=null,Eg=!1}catch(s){throw hi!==null&&(hi=hi.slice(t+1)),WE(u0,Xo),s}finally{ct=e,ov=!1}}return null}var ql=[],Kl=0,Bp=null,zp=0,Br=[],zr=0,Ha=null,pi=1,mi="";function da(t,e){ql[Kl++]=zp,ql[Kl++]=Bp,Bp=t,zp=e}function wT(t,e,n){Br[zr++]=pi,Br[zr++]=mi,Br[zr++]=Ha,Ha=t;var r=pi;t=mi;var s=32-vs(r)-1;r&=~(1<<s),n+=1;var i=32-vs(e)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,pi=1<<32-vs(e)+s|n<<s|r,mi=i+t}else pi=1<<i|n<<s|r,mi=t}function x0(t){t.return!==null&&(da(t,1),wT(t,1,0))}function b0(t){for(;t===Bp;)Bp=ql[--Kl],ql[Kl]=null,zp=ql[--Kl],ql[Kl]=null;for(;t===Ha;)Ha=Br[--zr],Br[zr]=null,mi=Br[--zr],Br[zr]=null,pi=Br[--zr],Br[zr]=null}var Cr=null,Sr=null,Ct=!1,ms=null;function kT(t,e){var n=Ur(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function k1(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Cr=t,Sr=Eo(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Cr=t,Sr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ha!==null?{id:pi,overflow:mi}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Ur(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Cr=t,Sr=null,!0):!1;default:return!1}}function Gx(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Yx(t){if(Ct){var e=Sr;if(e){var n=e;if(!k1(t,e)){if(Gx(t))throw Error(te(418));e=Eo(n.nextSibling);var r=Cr;e&&k1(t,e)?kT(r,n):(t.flags=t.flags&-4097|2,Ct=!1,Cr=t)}}else{if(Gx(t))throw Error(te(418));t.flags=t.flags&-4097|2,Ct=!1,Cr=t}}}function S1(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Cr=t}function gf(t){if(t!==Cr)return!1;if(!Ct)return S1(t),Ct=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Hx(t.type,t.memoizedProps)),e&&(e=Sr)){if(Gx(t))throw ST(),Error(te(418));for(;e;)kT(t,e),e=Eo(e.nextSibling)}if(S1(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(te(317));e:{for(t=t.nextSibling,e=0;t;
vendor: 25,899 bytes, lines 38-40
38){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Sr=Eo(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Sr=null}}else Sr=Cr?Eo(t.stateNode.nextSibling):null;return!0}function ST(){for(var t=Sr;t;)t=Eo(t.nextSibling)}function Nc(){Sr=Cr=null,Ct=!1}function w0(t){ms===null?ms=[t]:ms.push(t)}var Y$=Ti.ReactCurrentBatchConfig;function ku(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(te(309));var r=n.stateNode}if(!r)throw Error(te(147,t));var s=r,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(te(284));if(!n._owner)throw Error(te(290,t))}return t}function yf(t,e){throw t=Object.prototype.toString.call(e),Error(te(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function C1(t){var e=t._init;return e(t._payload)}function CT(t){function e(x,b){if(t){var w=x.deletions;w===null?(x.deletions=[b],x.flags|=16):w.push(b)}}function n(x,b){if(!t)return null;for(;b!==null;)e(x,b),b=b.sibling;return null}function r(x,b){for(x=new Map;b!==null;)b.key!==null?x.set(b.key,b):x.set(b.index,b),b=b.sibling;return x}function s(x,b){return x=Oo(x,b),x.index=0,x.sibling=null,x}function i(x,b,w){return x.index=w,t?(w=x.alternate,w!==null?(w=w.index,w<b?(x.flags|=2,b):w):(x.flags|=2,b)):(x.flags|=1048576,b)}function o(x){return t&&x.alternate===null&&(x.flags|=2),x}function a(x,b,w,k){return b===null||b.tag!==6?(b=fv(w,x.mode,k),b.return=x,b):(b=s(b,w),b.return=x,b)}function c(x,b,w,k){var j=w.type;return j===zl?d(x,b,w.props.children,k,w.key):b!==null&&(b.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Yi&&C1(j)===b.type)?(k=s(b,w.props),k.ref=ku(x,b,w),k.return=x,k):(k=fp(w.type,w.key,w.props,null,x.mode,k),k.ref=ku(x,b,w),k.return=x,k)}function u(x,b,w,k){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=pv(w,x.mode,k),b.return=x,b):(b=s(b,w.children||[]),b.return=x,b)}function d(x,b,w,k,j){return b===null||b.tag!==7?(b=La(w,x.mode,k,j),b.return=x,b):(b=s(b,w),b.return=x,b)}function h(x,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=fv(""+b,x.mode,w),b.return=x,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case of:return w=fp(b.type,b.key,b.props,null,x.mode,w),w.ref=ku(x,null,b),w.return=x,w;case Bl:return b=pv(b,x.mode,w),b.return=x,b;case Yi:var k=b._init;return h(x,k(b._payload),w)}if(zu(b)||yu(b))return b=La(b,x.mode,w,null),b.return=x,b;yf(x,b)}return null}function p(x,b,w,k){var j=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:a(x,b,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case of:return w.key===j?c(x,b,w,k):null;case Bl:return w.key===j?u(x,b,w,k):null;case Yi:return j=w._init,p(x,b,j(w._payload),k)}if(zu(w)||yu(w))return j!==null?null:d(x,b,w,k,null);yf(x,w)}return null}function f(x,b,w,k,j){if(typeof k=="string"&&k!==""||typeof k=="number")return x=x.get(w)||null,a(b,x,""+k,j);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case of:return x=x.get(k.key===null?w:k.key)||null,c(b,x,k,j);case Bl:return x=x.get(k.key===null?w:k.key)||null,u(b,x,k,j);case Yi:var E=k._init;return f(x,b,w,E(k._payload),j)}if(zu(k)||yu(k))return x=x.get(w)||null,d(b,x,k,j,null);yf(b,k)}return null}function g(x,b,w,k){for(var j=null,E=null,N=b,S=b=0,C=null;N!==null&&S<w.length;S++){N.index>S?(C=N,N=null):C=N.sibling;var _=p(x,N,w[S],k);if(_===null){N===null&&(N=C);break}t&&N&&_.alternate===null&&e(x,N),b=i(_,b,S),E===null?j=_:E.sibling=_,E=_,N=C}if(S===w.length)return n(x,N),Ct&&da(x,S),j;if(N===null){for(;S<w.length;S++)N=h(x,w[S],k),N!==null&&(b=i(N,b,S),E===null?j=N:E.sibling=N,E=N);return Ct&&da(x,S),j}for(N=r(x,N);S<w.length;S++)C=f(N,x,S,w[S],k),C!==null&&(t&&C.alternate!==null&&N.delete(C.key===null?S:C.key),b=i(C,b,S),E===null?j=C:E.sibling=C,E=C);return t&&N.forEach(function(R){return e(x,R)}),Ct&&da(x,S),j}function m(x,b,w,k){var j=yu(w);if(typeof j!="function")throw Error(te(150));if(w=j.call(w),w==null)throw Error(te(151));for(var E=j=null,N=b,S=b=0,C=null,_=w.next();N!==null&&!_.done;S++,_=w.next()){N.index>S?(C=N,N=null):C=N.sibling;var R=p(x,N,_.value,k);if(R===null){N===null&&(N=C);break}t&&N&&R.alternate===null&&e(x,N),b=i(R,b,S),E===null?j=R:E.sibling=R,E=R,N=C}if(_.done)return n(x,N),Ct&&da(x,S),j;if(N===null){for(;!_.done;S++,_=w.next())_=h(x,_.value,k),_!==null&&(b=i(_,b,S),E===null?j=_:E.sibling=_,E=_);return Ct&&da(x,S),j}for(N=r(x,N);!_.done;S++,_=w.next())_=f(N,x,S,_.value,k),_!==null&&(t&&_.alternate!==null&&N.delete(_.key===null?S:_.key),b=i(_,b,S),E===null?j=_:E.sibling=_,E=_);return t&&N.forEach(function(O){return e(x,O)}),Ct&&da(x,S),j}function v(x,b,w,k){if(typeof w=="object"&&w!==null&&w.type===zl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case of:e:{for(var j=w.key,E=b;E!==null;){if(E.key===j){if(j=w.type,j===zl){if(E.tag===7){n(x,E.sibling),b=s(E,w.props.children),b.return=x,x=b;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Yi&&C1(j)===E.type){n(x,E.sibling),b=s(E,w.props),b.ref=ku(x,E,w),b.return=x,x=b;break e}n(x,E);break}else e(x,E);E=E.sibling}w.type===zl?(b=La(w.props.children,x.mode,k,w.key),b.return=x,x=b):(k=fp(w.type,w.key,w.props,null,x.mode,k),k.ref=ku(x,b,w),k.return=x,x=k)}return o(x);case Bl:e:{for(E=w.key;b!==null;){if(b.key===E)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(x,b.sibling),b=s(b,w.children||[]),b.return=x,x=b;break e}else{n(x,b);break}else e(x,b);b=b.sibling}b=pv(w,x.mode,k),b.return=x,x=b}return o(x);case Yi:return E=w._init,v(x,b,E(w._payload),k)}if(zu(w))return g(x,b,w,k);if(yu(w))return m(x,b,w,k);yf(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(x,b.sibling),b=s(b,w),b.return=x,x=b):(n(x,b),b=fv(w,x.mode,k),b.return=x,x=b),o(x)):n(x,b)}return v}var _c=CT(!0),jT=CT(!1),Fp=Qo(null),Up=null,Gl=null,k0=null;function S0(){k0=Gl=Up=null}function C0(t){var e=Fp.current;wt(Fp),t._currentValue=e}function Jx(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function nc(t,e){Up=t,k0=Gl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(cr=!0),t.firstContext=null)}function Gr(t){var e=t._currentValue;if(k0!==t)if(t={context:t,memoizedValue:e,next:null},Gl===null){if(Up===null)throw Error(te(308));Gl=t,Up.dependencies={lanes:0,firstContext:t}}else Gl=Gl.next=t;return e}var xa=null;function j0(t){xa===null?xa=[t]:xa.push(t)}function NT(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,j0(e)):(n.next=s.next,s.next=n),e.interleaved=n,ki(t,r)}function ki(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Ji=!1;function N0(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _T(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function yi(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function To(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,et&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,ki(t,n)}return s=r.interleaved,s===null?(e.next=e,j0(r)):(e.next=s.next,s.next=e),r.interleaved=e,ki(t,n)}function ap(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,d0(t,n)}}function j1(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Vp(t,e,n,r){var s=t.updateQueue;Ji=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=c))}if(i!==null){var h=s.baseState;o=0,d=u=c=null,a=i;do{var p=a.lane,f=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=t,m=a;switch(p=e,f=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){h=g.call(f,h,p);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,p=typeof g=="function"?g.call(f,h,p):g,p==null)break e;h=Mt({},h,p);break e;case 2:Ji=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else f={eventTime:f,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=f,c=h):d=d.next=f,o|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(d===null&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);qa|=o,t.lanes=o,t.memoizedState=h}}function N1(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(te(191,s));s.call(r)}}}var $h={},Ws=Qo($h),Fd=Qo($h),Ud=Qo($h);function ba(t){if(t===$h)throw Error(te(174));return t}function _0(t,e){switch(gt(Ud,e),gt(Fd,t),gt(Ws,$h),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Rx(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Rx(e,t)}wt(Ws),gt(Ws,e)}function Ec(){wt(Ws),wt(Fd),wt(Ud)}function ET(t){ba(Ud.current);var e=ba(Ws.current),n=Rx(e,t.type);e!==n&&(gt(Fd,t),gt(Ws,n))}function E0(t){Fd.current===t&&(wt(Ws),wt(Fd))}var Tt=Qo(0);function Hp(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var av=[];function T0(){for(var t=0;t<av.length;t++)av[t]._workInProgressVersionPrimary=null;av.length=0}var lp=Ti.ReactCurrentDispatcher,lv=Ti.ReactCurrentBatchConfig,Wa=0,Pt=null,ln=null,pn=null,Wp=!1,id=!1,Vd=0,J$=0;function $n(){throw Error(te(321))}function R0(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ws(t[n],e[n]))return!1;return!0}function A0(t,e,n,r,s,i){if(Wa=i,Pt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,lp.current=t===null||t.memoizedState===null?e3:t3,t=n(r,s),id){i=0;do{if(id=!1,Vd=0,25<=i)throw Error(te(301));i+=1,pn=ln=null,e.updateQueue=null,lp.current=n3,t=n(r,s)}while(id)}if(lp.current=qp,e=ln!==null&&ln.next!==null,Wa=0,pn=ln=Pt=null,Wp=!1,e)throw Error(te(300));return t}function O0(){var t=Vd!==0;return Vd=0,t}function As(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?Pt.memoizedState=pn=t:pn=pn.next=t,pn}function Yr(){if(ln===null){var t=Pt.alternate;t=t!==null?t.memoizedState:null}else t=ln.next;var e=pn===null?Pt.memoizedState:pn.next;if(e!==null)pn=e,ln=t;else{if(t===null)throw Error(te(310));ln=t,t={memoizedState:ln.memoizedState,baseState:ln.baseState,baseQueue:ln.baseQueue,queue:ln.queue,next:null},pn===null?Pt.memoizedState=pn=t:pn=pn.next=t}return pn}function Hd(t,e){return typeof e=="function"?e(t):e}function cv(t){var e=Yr(),n=e.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=t;var r=ln,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,c=null,u=i;do{var d=u.lane;if((Wa&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:t(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=h,o=r):c=c.next=h,Pt.lanes|=d,qa|=d}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=a,ws(r,e.memoizedState)||(cr=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){s=t;do i=s.lane,Pt.lanes|=i,qa|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function uv(t){var e=Yr(),n=e.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=t;var r=n.dispatch,s=n.pending,i=e.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=t(i,o.action),o=o.next;while(o!==s);ws(i,e.memoizedState)||(cr=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function TT(){}function RT(t,e){var n=Pt,r=Yr(),s=e(),i=!ws(r.memoizedState,s);if(i&&(r.memoizedState=s,cr=!0),r=r.queue,P0(PT.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||pn!==null&&pn.memoizedState.tag&1){if(n.flags|=2048,Wd(9,OT.bind(null,n,r,s,e),void 0,null),yn===null)throw Error(te(349));Wa&30||AT(n,e,s)}return s}function AT(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Pt.updateQueue,e===null?(e={lastEffect:null,stores:null},Pt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function OT(t,e,n,r){e.value=n,e.getSnapshot=r,MT(e)&&IT(t)}function PT(t,e,n){return n(function(){MT(e)&&IT(t)})}function MT(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ws(t,n)}catch{return!0}}function IT(t){var e=ki(t,1);e!==null&&xs(e,t,1,-1)}function _1(t){var e=As();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hd,lastRenderedState:t},e.queue=t,t=t.dispatch=Z$.bind(null,Pt,t),[e.memoizedState,t]}function Wd(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Pt.updateQueue,e===null?(e={lastEffect:null,stores:null},Pt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function DT(){return Yr().memoizedState}function cp(t,e,n,r){var s=As();Pt.flags|=t,s.memoizedState=Wd(1|e,n,void 0,r===void 0?null:r)}function Tg(t,e,n,r){var s=Yr();r=r===void 0?null:r;var i=void 0;if(ln!==null){var o=ln.memoizedState;if(i=o.destroy,r!==null&&R0(r,o.deps)){s.memoizedState=Wd(e,n,i,r);return}}Pt.flags|=t,s.memoizedState=Wd(1|e,n,i,r)}function E1(t,e){return cp(8390656,8,t,e)}function P0(t,e){return Tg(2048,8,t,e)}function LT(t,e){return Tg(4,2,t,e)}function $T(t,e){return Tg(4,4,t,e)}function BT(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function zT(t,e,n){return n=n!=null?n.concat([t]):null,Tg(4,4,BT.bind(null,e,t),n)}function M0(){}function FT(t,e){var n=Yr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&R0(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function UT(t,e){var n=Yr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&R0(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function VT(t,e,n){return Wa&21?(ws(n,e)||(n=GE(),Pt.lanes|=n,qa|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,cr=!0),t.memoizedState=n)}function Q$(t,e){var n=ct;ct=n!==0&&4>n?n:4,t(!0);var r=lv.transition;lv.transition={};try{t(!1),e()}finally{ct=n,lv.transition=r}}function HT(){return Yr().memoizedState}function X$(t,e,n){var r=Ao(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},WT(t))qT(e,n);else if(n=NT(t,e,n,r),n!==null){var s=Xn();xs(n,t,r,s),KT(n,e,r)}}function Z$(t,e,n){var r=Ao(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(WT(t))qT(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,ws(a,o)){var c=e.interleaved;c===null?(s.next=s,j0(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}n=NT(t,e,s,r),n!==null&&(s=Xn(),xs(n,t,r,s),KT(n,e,r))}}function WT(t){var e=t.alternate;return t===Pt||e!==null&&e===Pt}function qT(t,e){id=Wp=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function KT(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,d0(t,n)}}var qp={readContext:Gr,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useInsertionEffect:$n,useLayoutEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useMutableSource:$n,useSyncExternalStore:$n,useId:$n,unstable_isNewReconciler:!1},e3={readContext:Gr,useCallback:function(t,e){return As().memoizedState=[t,e===void 0?null:e],t},useContext:Gr,useEffect:E1,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,cp(4194308,4,BT.bind(null,e,t),n)},useLayoutEffect:function(t,e){return cp(4194308,4,t,e)},useInsertionEffect:function(t,e){return cp(4,2,t,e)},useMemo:function(t,e){var n=As();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=As();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=X$.bind(null,Pt,t),[r.memoizedState,t]},useRef:function(t){var e=As();return t={current:t},e.memoizedState=t},useState:_1,useDebugValue:M0,useDeferredValue:function(t){return As().memoizedState=t},useTransition:function(){var t=_1(!1),e=t[0];return t=Q$.bind(null,t[1]),As().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Pt,s=As();if(Ct){if(n===void 0)throw Error(te(407));n=n()}else{if(n=e(),yn===null)throw Error(te(349));Wa&30||AT(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,E1(PT.bind(null,r,i,t),[t]),r.flags|=2048,Wd(9,OT.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=As(),e=yn.identifierPrefix;if(Ct){var n=mi,r=pi;n=(r&~(1<<32-vs(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Vd++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=J$++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},t3={readContext:Gr,useCallback:FT,useContext:Gr,useEffect:P0,useImperativeHandle:zT,useInsertionEffect:LT,useLayoutEffect:$T,useMemo:UT,useReducer:cv,useRef:DT,useState:function(){return cv(Hd)},useDebugValue:M0,useDeferredValue:function(t){var e=Yr();return VT(e,ln.memoizedState,t)},useTransition:function(){var t=cv(Hd)[0],e=Yr().memoizedState;return[t,e]},useMutableSource:TT,useSyncExternalStore:RT,useId:HT,unstable_isNewReconciler:!1},n3={readContext:Gr,useCallback:FT,useContext:Gr,useEffect:P0,useImperativeHandle:zT,useInsertionEffect:LT,useLayoutEffect:$T,useMemo:UT,useReducer:uv,useRef:DT,useState:function(){return uv(Hd)},useDebugValue:M0,useDeferredValue:function(t){var e=Yr();return ln===null?e.memoizedState=t:VT(e,ln.memoizedState,t)},useTransition:function(){var t=uv(Hd)[0],e=Yr().memoizedState;return[t,e]},useMutableSource:TT,useSyncExternalStore:RT,useId:HT,unstable_isNewReconciler:!1};function us(t,e){if(t&&t.defaultProps){e=Mt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Qx(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Mt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Rg={isMounted:function(t){return(t=t._reactInternals)?cl(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Xn(),s=Ao(t),i=yi(r,s);i.payload=e,n!=null&&(i.callback=n),e=To(t,i,s),e!==null&&(xs(e,t,s,r),ap(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Xn(),s=Ao(t),i=yi(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=To(t,i,s),e!==null&&(xs(e,t,s,r),ap(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Xn(),r=Ao(t),s=yi(n,r);s.tag=2,e!=null&&(s.callback=e),e=To(t,s,r),e!==null&&(xs(e,t,r,n),ap(e,t,r))}};function T1(t,e,n,r,s,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,o):e.prototype&&e.prototype.isPureReactComponent?!Ld(n,r)||!Ld(s,i):!0}function GT(t,e,n){var r=!1,s=Vo,i=e.contextType;return typeof i=="object"&&i!==null?i=Gr(i):(s=dr(e)?Va:Vn.current,r=e.contextTypes,i=(r=r!=null)?jc(t,s):Vo),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Rg,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function R1(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Rg.enqueueReplaceState(e,e.state,null)}function Xx(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},N0(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=Gr(i):(i=dr(e)?Va:Vn.current,s.context=jc(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Qx(t,e,i,n),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&Rg.enqueueReplaceState(s,s.state,null),Vp(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function Tc(t,e){try{var n="",r=e;do n+=R4(r),r=r.return;while(r);var s=n}catch(i){s=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:t,source:e,stack:s,digest:null}}function dv(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Zx(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var r3=typeof WeakMap=="function"?WeakMap:Map;function YT(t,e,n){n=yi(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Gp||(Gp=!0,cb=r),Zx(t,e)},n}function JT(t,e,n){n=yi(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var s=e.value;n.payload=function(){return r(s)},n.callback=function(){Zx(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Zx(t,e),typeof r!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function A1(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new r3;var s=new Set;r.set(e,s)}else s=r.get(e),s===void 0&&(s=new Set,r.set(e,s));s.has(n)||(s.add(n),t=y3.bind(null,t,e,n),e.then(t,t))}function O1(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function P1(t,e,n,r,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=yi(-1,1),e.tag=2,To(n,e,1))),n.lanes|=1),t)}var s3=Ti.ReactCurrentOwner,cr=!1;function Jn(t,e,n,r){e.child=t===null?jT(e,null,n,r):_c(e,t.child,n,r)}function M1(t,e,n,r,s){n=n.render;var i=e.ref;return nc(e,s),r=A0(t,e,n,r,i,s),n=O0(),t!==null&&!cr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Si(t,e,s)):(Ct&&n&&x0(e),e.flags|=1,Jn(t,e,r,s),e.child)}function I1(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!U0(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,QT(t,e,i,r,s)):(t=fp(n.type,null,r,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ld,n(o,r)&&t.ref===e.ref)return Si(t,e,s)}return e.flags|=1,t=Oo(i,r),t.ref=e.ref,t.return=e,e.child=t}function QT(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(Ld(i,r)&&t.ref===e.ref)if(cr=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(cr=!0);else return e.lanes=t.lanes,Si(t,e,s)}return eb(t,e,n,r,s)}function XT(t,e,n){var r=e.pendingProps,s=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(Jl,xr),xr|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,gt(Jl,xr),xr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,gt(Jl,xr),xr|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,gt(Jl,xr),xr|=r;return Jn(t,e,s,n),e.child}function ZT(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function eb(t,e,n,r,s){var i=dr(n)?Va:Vn.current;return i=jc(e,i),nc(e,s),n=A0(t,e,n,r,i,s),r=O0(),t!==null&&!cr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Si(t,e,s)):(Ct&&r&&x0(e),e.flags|=1,Jn(t,e,n,s),e.child)}function D1(t,e,n,r,s){if(dr(n)){var i=!0;$p(e)}else i=!1;
vendor: 7,740 bytes, line 40
40if(nc(e,s),e.stateNode===null)up(t,e),GT(e,n,r),Xx(e,n,r,s),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Gr(u):(u=dr(n)?Va:Vn.current,u=jc(e,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==u)&&R1(e,o,r,u),Ji=!1;var p=e.memoizedState;o.state=p,Vp(e,r,o,s),c=e.memoizedState,a!==r||p!==c||ur.current||Ji?(typeof d=="function"&&(Qx(e,n,d,r),c=e.memoizedState),(a=Ji||T1(e,n,a,r,p,c,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),o.props=r,o.state=c,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,_T(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:us(e.type,a),o.props=u,h=e.pendingProps,p=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Gr(c):(c=dr(n)?Va:Vn.current,c=jc(e,c));var f=n.getDerivedStateFromProps;(d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||p!==c)&&R1(e,o,r,c),Ji=!1,p=e.memoizedState,o.state=p,Vp(e,r,o,s);var g=e.memoizedState;a!==h||p!==g||ur.current||Ji?(typeof f=="function"&&(Qx(e,n,f,r),g=e.memoizedState),(u=Ji||T1(e,n,u,r,p,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return tb(t,e,n,r,i,s)}function tb(t,e,n,r,s,i){ZT(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return s&&w1(e,n,!1),Si(t,e,i);r=e.stateNode,s3.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=_c(e,t.child,null,i),e.child=_c(e,null,a,i)):Jn(t,e,a,i),e.memoizedState=r.state,s&&w1(e,n,!0),e.child}function eR(t){var e=t.stateNode;e.pendingContext?b1(t,e.pendingContext,e.pendingContext!==e.context):e.context&&b1(t,e.context,!1),_0(t,e.containerInfo)}function L1(t,e,n,r,s){return Nc(),w0(s),e.flags|=256,Jn(t,e,n,r),e.child}var nb={dehydrated:null,treeContext:null,retryLane:0};function rb(t){return{baseLanes:t,cachePool:null,transitions:null}}function tR(t,e,n){var r=e.pendingProps,s=Tt.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(s&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),gt(Tt,s&1),t===null)return Yx(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,i?(r=e.mode,i=e.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Pg(o,r,0,null),t=La(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=rb(n),e.memoizedState=nb,t):I0(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return i3(t,e,o,r,a,s,n);if(i){i=r.fallback,o=e.mode,s=t.child,a=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=Oo(s,c),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Oo(a,i):(i=La(i,o,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,o=t.child.memoizedState,o=o===null?rb(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=nb,r}return i=t.child,t=i.sibling,r=Oo(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function I0(t,e){return e=Pg({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function vf(t,e,n,r){return r!==null&&w0(r),_c(e,t.child,null,n),t=I0(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function i3(t,e,n,r,s,i,o){if(n)return e.flags&256?(e.flags&=-257,r=dv(Error(te(422))),vf(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=Pg({mode:"visible",children:r.children},s,0,null),i=La(i,s,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&_c(e,t.child,null,o),e.child.memoizedState=rb(o),e.memoizedState=nb,i);if(!(e.mode&1))return vf(t,e,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(te(419)),r=dv(i,r,void 0),vf(t,e,o,r)}if(a=(o&t.childLanes)!==0,cr||a){if(r=yn,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,ki(t,s),xs(r,t,s,-1))}return F0(),r=dv(Error(te(421))),vf(t,e,o,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=v3.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,Sr=Eo(s.nextSibling),Cr=e,Ct=!0,ms=null,t!==null&&(Br[zr++]=pi,Br[zr++]=mi,Br[zr++]=Ha,pi=t.id,mi=t.overflow,Ha=e),e=I0(e,r.children),e.flags|=4096,e)}function $1(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Jx(t.return,e,n)}function hv(t,e,n,r,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function nR(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(Jn(t,e,r.children,n),r=Tt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$1(t,n,e);else if(t.tag===19)$1(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(gt(Tt,r),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(n=e.child,s=null;n!==null;)t=n.alternate,t!==null&&Hp(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),hv(e,!1,s,n,i);break;case"backwards":for(n=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&Hp(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}hv(e,!0,n,null,i);break;case"together":hv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function up(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}
vendor: 4,905 bytes, line 40
40function Si(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),qa|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(te(153));if(e.child!==null){for(t=e.child,n=Oo(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Oo(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function o3(t,e,n){switch(e.tag){case 3:eR(e),Nc();break;case 5:ET(e);break;case 1:dr(e.type)&&$p(e);break;case 4:_0(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;gt(Fp,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(gt(Tt,Tt.current&1),e.flags|=128,null):n&e.child.childLanes?tR(t,e,n):(gt(Tt,Tt.current&1),t=Si(t,e,n),t!==null?t.sibling:null);gt(Tt,Tt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return nR(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),gt(Tt,Tt.current),r)break;return null;case 22:case 23:return e.lanes=0,XT(t,e,n)}return Si(t,e,n)}var rR,sb,sR,iR;rR=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sb=function(){};sR=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,ba(Ws.current);var i=null;switch(n){case"input":s=Nx(t,s),r=Nx(t,r),i=[];break;case"select":s=Mt({},s,{value:void 0}),r=Mt({},r,{value:void 0}),i=[];break;case"textarea":s=Tx(t,s),r=Tx(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Dp)}Ax(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Rd.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(a=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Rd.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&xt("scroll",t),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};iR=function(t,e,n,r){n!==r&&(e.flags|=4)};function Su(t,e){if(!Ct)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Bn(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function a3(t,e,n){var r=e.pendingProps;switch(b0(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bn(e),null;case 1:return dr(e.type)&&Lp(),Bn(e),null;case 3:return r=e.stateNode,Ec(),wt(ur),wt(Vn),T0(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(gf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ms!==null&&(hb(ms),ms=null))),sb(t,e),Bn(e),null;case 5:E0(e);var s=ba(Ud.current);if(n=e.type,t!==null&&e.stateNode!=null)sR(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(te(166));return Bn(e),null}if(t=ba(Ws.current),gf(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[zs]=e,r[zd]=i,t=(e.mode&1)!==0,n){case"dialog":xt("cancel",r),xt("close",r);break;case"iframe":case"object":case"embed":xt("load",r);break;case"video":case"audio":for(s=0;s<Uu.length;s++)xt(Uu[s],r);break;case"source":xt("error",r);break;case"img":case"image":case"link":xt("error",r),xt("load",r);break;case"details":xt("toggle",r);break;case"input":KS(r,i),xt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},xt("invalid",r);break;case"textarea":YS(r,i),xt("invalid",r)}Ax(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];
vendor: 31,373 bytes, line 40
40o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&mf(r.textContent,a,t),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&mf(r.textContent,a,t),s=["children",""+a]):Rd.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&xt("scroll",r)}switch(n){case"input":af(r),GS(r,i,!0);break;case"textarea":af(r),JS(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Dp)}r=s,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=PE(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[zs]=e,t[zd]=r,rR(t,e,!1,!1),e.stateNode=t;e:{switch(o=Ox(n,r),n){case"dialog":xt("cancel",t),xt("close",t),s=r;break;case"iframe":case"object":case"embed":xt("load",t),s=r;break;case"video":case"audio":for(s=0;s<Uu.length;s++)xt(Uu[s],t);s=r;break;case"source":xt("error",t),s=r;break;case"img":case"image":case"link":xt("error",t),xt("load",t),s=r;break;case"details":xt("toggle",t),s=r;break;case"input":KS(t,r),s=Nx(t,r),xt("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=Mt({},r,{value:void 0}),xt("invalid",t);break;case"textarea":YS(t,r),s=Tx(t,r),xt("invalid",t);break;default:s=r}Ax(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?DE(t,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&ME(t,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ad(t,c):typeof c=="number"&&Ad(t,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Rd.hasOwnProperty(i)?c!=null&&i==="onScroll"&&xt("scroll",t):c!=null&&i0(t,i,c,o))}switch(n){case"input":af(t),GS(t,r,!1);break;case"textarea":af(t),JS(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Uo(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?Xl(t,!!r.multiple,i,!1):r.defaultValue!=null&&Xl(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=Dp)}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&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Bn(e),null;case 6:if(t&&e.stateNode!=null)iR(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(te(166));if(n=ba(Ud.current),ba(Ws.current),gf(e)){if(r=e.stateNode,n=e.memoizedProps,r[zs]=e,(i=r.nodeValue!==n)&&(t=Cr,t!==null))switch(t.tag){case 3:mf(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&mf(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[zs]=e,e.stateNode=r}return Bn(e),null;case 13:if(wt(Tt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Ct&&Sr!==null&&e.mode&1&&!(e.flags&128))ST(),Nc(),e.flags|=98560,i=!1;else if(i=gf(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(te(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(te(317));i[zs]=e}else Nc(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Bn(e),i=!1}else ms!==null&&(hb(ms),ms=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Tt.current&1?un===0&&(un=3):F0())),e.updateQueue!==null&&(e.flags|=4),Bn(e),null);case 4:return Ec(),sb(t,e),t===null&&$d(e.stateNode.containerInfo),Bn(e),null;case 10:return C0(e.type._context),Bn(e),null;case 17:return dr(e.type)&&Lp(),Bn(e),null;case 19:if(wt(Tt),i=e.memoizedState,i===null)return Bn(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)Su(i,!1);else{if(un!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Hp(t),o!==null){for(e.flags|=128,Su(i,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)i=n,t=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return gt(Tt,Tt.current&1|2),e.child}t=t.sibling}i.tail!==null&&Yt()>Rc&&(e.flags|=128,r=!0,Su(i,!1),e.lanes=4194304)}else{if(!r)if(t=Hp(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Su(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ct)return Bn(e),null}else 2*Yt()-i.renderingStartTime>Rc&&n!==1073741824&&(e.flags|=128,r=!0,Su(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Yt(),e.sibling=null,n=Tt.current,gt(Tt,r?n&1|2:n&1),e):(Bn(e),null);case 22:case 23:return z0(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?xr&1073741824&&(Bn(e),e.subtreeFlags&6&&(e.flags|=8192)):Bn(e),null;case 24:return null;case 25:return null}throw Error(te(156,e.tag))}function l3(t,e){switch(b0(e),e.tag){case 1:return dr(e.type)&&Lp(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ec(),wt(ur),wt(Vn),T0(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return E0(e),null;case 13:if(wt(Tt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(te(340));Nc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wt(Tt),null;case 4:return Ec(),null;case 10:return C0(e.type._context),null;case 22:case 23:return z0(),null;case 24:return null;default:return null}}var xf=!1,Un=!1,c3=typeof WeakSet=="function"?WeakSet:Set,he=null;function Yl(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vt(t,e,r)}else n.current=null}function ib(t,e,n){try{n()}catch(r){Vt(t,e,r)}}var B1=!1;function u3(t,e){if(Ux=Pp,t=uT(),v0(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,u=0,d=0,h=t,p=null;t:for(;;){for(var f;h!==n||s!==0&&h.nodeType!==3||(a=o+s),h!==i||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(f=h.firstChild)!==null;)p=h,h=f;for(;;){if(h===t)break t;if(p===n&&++u===s&&(a=o),p===i&&++d===r&&(c=o),(f=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=f}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Vx={focusedElem:t,selectionRange:n},Pp=!1,he=e;he!==null;)if(e=he,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,he=t;else for(;he!==null;){e=he;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,v=g.memoizedState,x=e.stateNode,b=x.getSnapshotBeforeUpdate(e.elementType===e.type?m:us(e.type,m),v);x.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(k){Vt(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,he=t;break}he=e.return}return g=B1,B1=!1,g}function od(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&ib(e,n,i)}s=s.next}while(s!==r)}}function Ag(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function ob(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function oR(t){var e=t.alternate;e!==null&&(t.alternate=null,oR(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[zs],delete e[zd],delete e[qx],delete e[q$],delete e[K$])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function aR(t){return t.tag===5||t.tag===3||t.tag===4}function z1(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||aR(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ab(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Dp));else if(r!==4&&(t=t.child,t!==null))for(ab(t,e,n),t=t.sibling;t!==null;)ab(t,e,n),t=t.sibling}function lb(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(lb(t,e,n),t=t.sibling;t!==null;)lb(t,e,n),t=t.sibling}var Nn=null,ps=!1;function Fi(t,e,n){for(n=n.child;n!==null;)lR(t,e,n),n=n.sibling}function lR(t,e,n){if(Hs&&typeof Hs.onCommitFiberUnmount=="function")try{Hs.onCommitFiberUnmount(Sg,n)}catch{}switch(n.tag){case 5:Un||Yl(n,e);case 6:var r=Nn,s=ps;Nn=null,Fi(t,e,n),Nn=r,ps=s,Nn!==null&&(ps?(t=Nn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Nn.removeChild(n.stateNode));break;case 18:Nn!==null&&(ps?(t=Nn,n=n.stateNode,t.nodeType===8?iv(t.parentNode,n):t.nodeType===1&&iv(t,n),Id(t)):iv(Nn,n.stateNode));break;case 4:r=Nn,s=ps,Nn=n.stateNode.containerInfo,ps=!0,Fi(t,e,n),Nn=r,ps=s;break;case 0:case 11:case 14:case 15:if(!Un&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&ib(n,e,o),s=s.next}while(s!==r)}Fi(t,e,n);break;case 1:if(!Un&&(Yl(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Vt(n,e,a)}Fi(t,e,n);break;case 21:Fi(t,e,n);break;case 22:n.mode&1?(Un=(r=Un)||n.memoizedState!==null,Fi(t,e,n),Un=r):Fi(t,e,n);break;default:Fi(t,e,n)}}function F1(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new c3),e.forEach(function(r){var s=x3.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ss(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Nn=a.stateNode,ps=!1;break e;case 3:Nn=a.stateNode.containerInfo,ps=!0;break e;case 4:Nn=a.stateNode.containerInfo,ps=!0;break e}a=a.return}if(Nn===null)throw Error(te(160));lR(i,o,s),Nn=null,ps=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){Vt(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)cR(e,t),e=e.sibling}function cR(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(ss(e,t),Ts(t),r&4){try{od(3,t,t.return),Ag(3,t)}catch(m){Vt(t,t.return,m)}try{od(5,t,t.return)}catch(m){Vt(t,t.return,m)}}break;case 1:ss(e,t),Ts(t),r&512&&n!==null&&Yl(n,n.return);break;case 5:if(ss(e,t),Ts(t),r&512&&n!==null&&Yl(n,n.return),t.flags&32){var s=t.stateNode;try{Ad(s,"")}catch(m){Vt(t,t.return,m)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&AE(s,i),Ox(a,o);var u=Ox(a,i);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?DE(s,h):d==="dangerouslySetInnerHTML"?ME(s,h):d==="children"?Ad(s,h):i0(s,d,h,u)}switch(a){case"input":_x(s,i);break;case"textarea":OE(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var f=i.value;f!=null?Xl(s,!!i.multiple,f,!1):p!==!!i.multiple&&(i.defaultValue!=null?Xl(s,!!i.multiple,i.defaultValue,!0):Xl(s,!!i.multiple,i.multiple?[]:"",!1))}s[zd]=i}catch(m){Vt(t,t.return,m)}}break;case 6:if(ss(e,t),Ts(t),r&4){if(t.stateNode===null)throw Error(te(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(m){Vt(t,t.return,m)}}break;case 3:if(ss(e,t),Ts(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Id(e.containerInfo)}catch(m){Vt(t,t.return,m)}break;case 4:ss(e,t),Ts(t);break;case 13:ss(e,t),Ts(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||($0=Yt())),r&4&&F1(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(Un=(u=Un)||d,ss(e,t),Un=u):ss(e,t),Ts(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(he=t,d=t.child;d!==null;){for(h=he=d;he!==null;){switch(p=he,f=p.child,p.tag){case 0:case 11:case 14:case 15:od(4,p,p.return);break;case 1:Yl(p,p.return);var g=p.stateNode;if(typeof g.componentWillUnmount=="function"){r=p,n=p.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(m){Vt(r,n,m)}}break;case 5:Yl(p,p.return);break;case 22:if(p.memoizedState!==null){V1(h);continue}}f!==null?(f.return=p,he=f):V1(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{s=h.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=IE("display",o))}catch(m){Vt(t,t.return,m)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){Vt(t,t.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:ss(e,t),Ts(t),r&4&&F1(t);break;case 21:break;default:ss(e,t),Ts(t)}}function Ts(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(aR(n)){var r=n;break e}n=n.return}throw Error(te(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ad(s,""),r.flags&=-33);var i=z1(t);lb(t,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=z1(t);ab(t,a,o);break;default:throw Error(te(161))}}catch(c){Vt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function d3(t,e,n){he=t,uR(t)}function uR(t,e,n){for(var r=(t.mode&1)!==0;he!==null;){var s=he,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||xf;if(!o){var a=s.alternate,c=a!==null&&a.memoizedState!==null||Un;a=xf;var u=Un;if(xf=o,(Un=c)&&!u)for(he=s;he!==null;)o=he,c=o.child,o.tag===22&&o.memoizedState!==null?H1(s):c!==null?(c.return=o,he=c):H1(s);for(;i!==null;)he=i,uR(i),i=i.sibling;he=s,xf=a,Un=u}U1(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,he=i):U1(t)}}function U1(t){for(;he!==null;){var e=he;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Un||Ag(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Un)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:us(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&N1(e,i,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}N1(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var c=e.memoizedProps;switch(e.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(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&Id(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(te(163))}Un||e.flags&512&&ob(e)}catch(p){Vt(e,e.return,p)}}if(e===t){he=null;break}if(n=e.sibling,n!==null){n.return=e.return,he=n;break}he=e.return}}function V1(t){for(;he!==null;){var e=he;if(e===t){he=null;break}var n=e.sibling;if(n!==null){n.return=e.return,he=n;break}he=e.return}}function H1(t){for(;he!==null;){var e=he;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Ag(4,e)}catch(c){Vt(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(c){Vt(e,s,c)}}var i=e.return;try{ob(e)}catch(c){Vt(e,i,c)}break;case 5:var o=e.return;try{ob(e)}catch(c){Vt(e,o,c)}}}catch(c){Vt(e,e.return,c)}if(e===t){he=null;break}var a=e.sibling;if(a!==null){a.return=e.return,he=a;break}he=e.return}}var h3=Math.ceil,Kp=Ti.ReactCurrentDispatcher,D0=Ti.ReactCurrentOwner,Hr=Ti.ReactCurrentBatchConfig,et=0,yn=null,rn=null,On=0,xr=0,Jl=Qo(0),un=0,qd=null,qa=0,Og=0,L0=0,ad=null,ar=null,$0=0,Rc=1/0,li=null,Gp=!1,cb=null,Ro=null,bf=!1,vo=null,Yp=0,ld=0,ub=null,dp=-1,hp=0;function Xn(){return et&6?Yt():dp!==-1?dp:dp=Yt()}function Ao(t){return t.mode&1?et&2&&On!==0?On&-On:Y$.transition!==null?(hp===0&&(hp=GE()),hp):(t=ct,t!==0||(t=window.event,t=t===void 0?16:tT(t.type)),t):1}function xs(t,e,n,r){if(50<ld)throw ld=0,ub=null,Error(te(185));Ih(t,n,r),(!(et&2)||t!==yn)&&(t===yn&&(!(et&2)&&(Og|=n),un===4&&ro(t,On)),hr(t,r),n===1&&et===0&&!(e.mode&1)&&(Rc=Yt()+500,Eg&&Xo()))}function hr(t,e){var n=t.callbackNode;Y4(t,e);var r=Op(t,t===yn?On:0);if(r===0)n!==null&&ZS(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&ZS(n),e===1)t.tag===0?G$(W1.bind(null,t)):bT(W1.bind(null,t)),H$(function(){!(et&6)&&Xo()}),n=null;else{switch(YE(r)){case 1:n=u0;break;case 4:n=qE;break;case 16:n=Ap;break;case 536870912:n=KE;break;default:n=Ap}n=vR(n,dR.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function dR(t,e){if(dp=-1,hp=0,et&6)throw Error(te(327));var n=t.callbackNode;if(rc()&&t.callbackNode!==n)return null;var r=Op(t,t===yn?On:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Jp(t,r);else{e=r;var s=et;et|=2;var i=fR();(yn!==t||On!==e)&&(li=null,Rc=Yt()+500,Da(t,e));do try{m3();break}catch(a){hR(t,a)}while(!0);S0(),Kp.current=i,et=s,rn!==null?e=0:(yn=null,On=0,e=un)}if(e!==0){if(e===2&&(s=Lx(t),s!==0&&(r=s,e=db(t,s))),e===1)throw n=qd,Da(t,0),ro(t,r),hr(t,Yt()),n;if(e===6)ro(t,r);else{if(s=t.current.alternate,!(r&30)&&!f3(s)&&(e=Jp(t,r),e===2&&(i=Lx(t),i!==0&&(r=i,e=db(t,i))),e===1))throw n=qd,Da(t,0),ro(t,r),hr(t,Yt()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(te(345));case 2:ha(t,ar,li);break;case 3:if(ro(t,r),(r&130023424)===r&&(e=$0+500-Yt(),10<e)){if(Op(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){Xn(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=Wx(ha.bind(null,t,ar,li),e);break}ha(t,ar,li);break;case 4:if(ro(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var o=31-vs(r);i=1<<o,o=e[o],o>s&&(s=o),r&=~i}if(r=s,r=Yt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*h3(r/1960))-r,10<r){t.timeoutHandle=Wx(ha.bind(null,t,ar,li),r);break}ha(t,ar,li);break;case 5:ha(t,ar,li);break;default:throw Error(te(329))}}}return hr(t,Yt()),t.callbackNode===n?dR.bind(null,t):null}function db(t,e){var n=ad;return t.current.memoizedState.isDehydrated&&(Da(t,e).flags|=256),t=Jp(t,e),t!==2&&(e=ar,ar=n,e!==null&&hb(e)),t}function hb(t){ar===null?ar=t:ar.push.apply(ar,t)}function f3(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!ws(i(),s))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ro(t,e){for(e&=~L0,e&=~Og,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-vs(e),r=1<<n;t[n]=-1,e&=~r}}function W1(t){if(et&6)throw Error(te(327));rc();var e=Op(t,0);if(!(e&1))return hr(t,Yt()),null;var n=Jp(t,e);if(t.tag!==0&&n===2){var r=Lx(t);r!==0&&(e=r,n=db(t,r))}if(n===1)throw n=qd,Da(t,0),ro(t,e),hr(t,Yt()),n;if(n===6)throw Error(te(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ha(t,ar,li),hr(t,Yt()),null}function B0(t,e){var n=et;et|=1;try{return t(e)}finally{et=n,et===0&&(Rc=Yt()+500,Eg&&Xo())}}function Ka(t){vo!==null&&vo.tag===0&&!(et&6)&&rc();var e=et;et|=1;var n=Hr.transition,r=ct;try{if(Hr.transition=null,ct=1,t)return t()}finally{ct=r,Hr.transition=n,et=e,!(et&6)&&Xo()}}function z0(){xr=Jl.current,wt(Jl)}function Da(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,V$(n)),rn!==null)for(n=rn.return;n!==null;){var r=n;switch(b0(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Lp();break;case 3:Ec(),wt(ur),wt(Vn),T0();break;case 5:E0(r);break;case 4:Ec();break;case 13:wt(Tt);break;case 19:wt(Tt);break;case 10:C0(r.type._context);break;case 22:case 23:z0()}n=n.return}if(yn=t,rn=t=Oo(t.current,null),On=xr=e,un=0,qd=null,L0=Og=qa=0,ar=ad=null,xa!==null){for(e=0;e<xa.length;e++)if(n=xa[e],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}xa=null}return t}function hR(t,e){do{var n=rn;try{if(S0(),lp.current=qp,Wp){for(var r=Pt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Wp=!1}if(Wa=0,pn=ln=Pt=null,id=!1,Vd=0,D0.current=null,n===null||n.return===null){un=1,qd=e,rn=null;break}e:{var i=t,o=n.return,a=n,c=e;if(e=On,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=a,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=O1(o);if(f!==null){f.flags&=-257,P1(f,o,a,i,e),f.mode&1&&A1(i,u,e),e=f,c=u;var g=e.updateQueue;if(g===null){var m=new Set;m.add(c),e.updateQueue=m}else g.add(c);break e}else{if(!(e&1)){A1(i,u,e),F0();break e}c=Error(te(426))}}else if(Ct&&a.mode&1){var v=O1(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),P1(v,o,a,i,e),w0(Tc(c,a));break e}}i=c=Tc(c,a),un!==4&&(un=2),ad===null?ad=[i]:ad.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var x=YT(i,c,e);j1(i,x);break e;case 1:a=c;var b=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ro===null||!Ro.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var k=JT(i,a,e);j1(i,k);break e}}i=i.return}while(i!==null)}mR(n)}catch(j){e=j,rn===n&&n!==null&&(rn=n=n.return);continue}break}while(!0)}function fR(){var t=Kp.current;return Kp.current=qp,t===null?qp:t}function F0(){(un===0||un===3||un===2)&&(un=4),yn===null||!(qa&268435455)&&!(Og&268435455)||ro(yn,On)}function Jp(t,e){var n=et;et|=2;var r=fR();(yn!==t||On!==e)&&(li=null,Da(t,e));do try{p3();break}catch(s){hR(t,s)}while(!0);if(S0(),et=n,Kp.current=r,rn!==null)throw Error(te(261));return yn=null,On=0,un}function p3(){for(;rn!==null;)pR(rn)}function m3(){for(;rn!==null&&!z4();)pR(rn)}function pR(t){var e=yR(t.alternate,t,xr);t.memoizedProps=t.pendingProps,e===null?mR(t):rn=e,D0.current=null}function mR(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=l3(n,e),n!==null){n.flags&=32767,rn=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{un=6,rn=null;return}}else if(n=a3(n,e,xr),n!==null){rn=n;return}if(e=e.sibling,e!==null){rn=e;return}rn=e=t}while(e!==null);un===0&&(un=5)}function ha(t,e,n){var r=ct,s=Hr.transition;try{Hr.transition=null,ct=1,g3(t,e,n,r)}finally{Hr.transition=s,ct=r}return null}function g3(t,e,n,r){do rc();while(vo!==null);if(et&6)throw Error(te(327));n=t.finishedWork;var s=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(te(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(J4(t,i),t===yn&&(rn=yn=null,On=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||bf||(bf=!0,vR(Ap,function(){return rc(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Hr.transition,Hr.transition=null;var o=ct;ct=1;var a=et;et|=4,D0.current=null,u3(t,n),cR(n,t),D$(Vx),Pp=!!Ux,Vx=Ux=null,t.current=n,d3(n),F4(),et=a,ct=o,Hr.transition=i}else t.current=n;if(bf&&(bf=!1,vo=t,Yp=s),i=t.pendingLanes,i===0&&(Ro=null),H4(n.stateNode),hr(t,Yt()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)s=e[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Gp)throw Gp=!1,t=cb,cb=null,t;return Yp&1&&t.tag!==0&&rc(),i=t.pendingLanes,i&1?t===ub?ld++:(ld=0,ub=t):ld=0,Xo(),null}function rc(){if(vo!==null){var t=YE(Yp),e=Hr.transition,n=ct;try{if(Hr.transition=null,ct=16>t?16:t,vo===null)var r=!1;else{if(t=vo,vo=null,Yp=0,et&6)throw Error(te(331));var s=et;for(et|=4,he=t.current;he!==null;){var i=he,o=i.child;if(he.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(he=u;he!==null;){var d=he;switch(d.tag){case 0:case 11:case 15:od(8,d,i)}var h=d.child;if(h!==null)h.return=d,he=h;else for(;he!==null;){d=he;var p=d.sibling,f=d.return;if(oR(d),d===u){he=null;break}if(p!==null){p.return=f,he=p;break}he=f}}}var g=i.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==null)}}he=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,he=o;else e:for(;he!==null;){if(i=he,i.flags&2048)switch(i.tag){case 0:case 11:case 15:od(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,he=x;break e}he=i.return}}var b=t.current;for(he=b;he!==null;){o=he;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,he=w;else e:for(o=b;he!==null;){if(a=he,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ag(9,a)}}catch(j){Vt(a,a.return,j)}if(a===o){he=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,he=k;break e}he=a.return}}if(et=s,Xo(),Hs&&typeof Hs.onPostCommitFiberRoot=="function")try{Hs.onPostCommitFiberRoot(Sg,t)}catch{}r=!0}return r}finally{ct=n,Hr.transition=e}}return!1}function q1(t,e,n){e=Tc(n,e),e=YT(t,e,1),t=To(t,e,1),e=Xn(),t!==null&&(Ih(t,1,e),hr(t,e))}function Vt(t,e,n){if(t.tag===3)q1(t,t,n);else for(;e!==null;){if(e.tag===3){q1(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ro===null||!Ro.has(r))){t=Tc(n,t),t=JT(e,t,1),e=To(e,t,1),t=Xn(),e!==null&&(Ih(e,1,t),hr(e,t));break}}e=e.return}}function y3(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Xn(),t.pingedLanes|=t.suspendedLanes&n,yn===t&&(On&n)===n&&(un===4||un===3&&(On&130023424)===On&&500>Yt()-$0?Da(t,0):L0|=n),hr(t,e)}function gR(t,e){e===0&&(t.mode&1?(e=uf,uf<<=1,!(uf&130023424)&&(uf=4194304)):e=1);var n=Xn();t=ki(t,e),t!==null&&(Ih(t,e,n),hr(t,n))}function v3(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),gR(t,n)}function x3(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(e),gR(t,n)}var yR;yR=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ur.current)cr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return cr=!1,o3(t,e,n);cr=!!(t.flags&131072)}else cr=!1,Ct&&e.flags&1048576&&wT(e,zp,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;up(t,e),t=e.pendingProps;var s=jc(e,Vn.current);nc(e,n),s=A0(null,e,r,t,s,n);var i=O0();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,dr(r)?(i=!0,$p(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,N0(e),s.updater=Rg,e.stateNode=s,s._reactInternals=e,Xx(e,r,t,n),e=tb(null,e,r,!0,i,n)):(e.tag=0,Ct&&i&&x0(e),Jn(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(up(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=w3(r),t=us(r,t),s){case 0:e=eb(null,e,r,t,n);break e;case 1:e=D1(null,e,r,t,n);break e;case 11:e=M1(null,e,r,t,n);break e;case 14:e=I1(null,e,r,us(r.type,t),n);break e}throw Error(te(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:us(r,s),eb(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:us(r,s),D1(t,e,r,s,n);case 3:e:{if(eR(e),t===null)throw Error(te(387));r=e.pendingProps,i=e.memoizedState,s=i.element,_T(t,e),Vp(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Tc(Error(te(423)),e),e=L1(t,e,r,n,s);break e}else if(r!==s){s=Tc(Error(te(424)),e),e=L1(t,e,r,n,s);break e}else for(Sr=Eo(e.stateNode.containerInfo.firstChild),Cr=e,Ct=!0,ms=null,n=jT(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Nc(),r===s){e=Si(t,e,n);break e}Jn(t,e,r,n)}e=e.child}return e;case 5:return ET(e),t===null&&Yx(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,Hx(r,s)?o=null:i!==null&&Hx(r,i)&&(e.flags|=32),ZT(t,e),Jn(t,e,o,n),e.child;case 6:return t===null&&Yx(e),null;case 13:return tR(t,e,n);case 4:return _0(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=_c(e,null,r,n):Jn(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:us(r,s),M1(t,e,r,s,n);case 7:return Jn(t,e,e.pendingProps,n),e.child;case 8:return Jn(t,e,e.pendingProps.children,n),e.child;case 12:return Jn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,gt(Fp,r._currentValue),r._currentValue=o,i!==null)if(ws(i.value,o)){if(i.children===s.children&&!ur.current){e=Si(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=yi(-1,n&-n),c.tag=2;var u=i.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}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Jx(i.return,n,e),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(te(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Jx(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Jn(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,nc(e,n),s=Gr(s),r=r(s),e.flags|=1,Jn(t,e,r,n),e.child;case 14:return r=e.type,s=us(r,e.pendingProps),s=us(r.type,s),I1(t,e,r,s,n);
vendor: 6,262 bytes, line 40
40case 15:return QT(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:us(r,s),up(t,e),e.tag=1,dr(r)?(t=!0,$p(e)):t=!1,nc(e,n),GT(e,r,s),Xx(e,r,s,n),tb(null,e,r,!0,t,n);case 19:return nR(t,e,n);case 22:return XT(t,e,n)}throw Error(te(156,e.tag))};function vR(t,e){return WE(t,e)}function b3(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(t,e,n,r){return new b3(t,e,n,r)}function U0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function w3(t){if(typeof t=="function")return U0(t)?1:0;if(t!=null){if(t=t.$$typeof,t===a0)return 11;if(t===l0)return 14}return 2}function Oo(t,e){var n=t.alternate;return n===null?(n=Ur(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function fp(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")U0(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case zl:return La(n.children,s,i,e);case o0:o=8,s|=8;break;case kx:return t=Ur(12,n,e,s|2),t.elementType=kx,t.lanes=i,t;case Sx:return t=Ur(13,n,e,s),t.elementType=Sx,t.lanes=i,t;case Cx:return t=Ur(19,n,e,s),t.elementType=Cx,t.lanes=i,t;case EE:return Pg(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case NE:o=10;break e;case _E:o=9;break e;case a0:o=11;break e;case l0:o=14;break e;case Yi:o=16,r=null;break e}throw Error(te(130,t==null?t:typeof t,""))}return e=Ur(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function La(t,e,n,r){return t=Ur(7,t,r,e),t.lanes=n,t}function Pg(t,e,n,r){return t=Ur(22,t,r,e),t.elementType=EE,t.lanes=n,t.stateNode={isHidden:!1},t}function fv(t,e,n){return t=Ur(6,t,null,e),t.lanes=n,t}function pv(t,e,n){return e=Ur(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function k3(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gy(0),this.expirationTimes=Gy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gy(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function V0(t,e,n,r,s,i,o,a,c){return t=new k3(t,e,n,a,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Ur(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},N0(i),t}function S3(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Bl,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function xR(t){if(!t)return Vo;t=t._reactInternals;e:{if(cl(t)!==t||t.tag!==1)throw Error(te(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(dr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(te(171))}if(t.tag===1){var n=t.type;if(dr(n))return xT(t,n,e)}return e}function bR(t,e,n,r,s,i,o,a,c){return t=V0(n,r,!0,t,s,i,o,a,c),t.context=xR(null),n=t.current,r=Xn(),s=Ao(n),i=yi(r,s),i.callback=e??null,To(n,i,s),t.current.lanes=s,Ih(t,s,r),hr(t,r),t}function Mg(t,e,n,r){var s=e.current,i=Xn(),o=Ao(s);return n=xR(n),e.context===null?e.context=n:e.pendingContext=n,e=yi(i,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=To(s,e,o),t!==null&&(xs(t,s,o,i),ap(t,s,o)),o}function Qp(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function K1(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function H0(t,e){K1(t,e),(t=t.alternate)&&K1(t,e)}function C3(){return null}var wR=typeof reportError=="function"?reportError:function(t){console.error(t)};function W0(t){this._internalRoot=t}Ig.prototype.render=W0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(te(409));Mg(t,e,null,null)};Ig.prototype.unmount=W0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ka(function(){Mg(null,t,null,null)}),e[wi]=null}};function Ig(t){this._internalRoot=t}Ig.prototype.unstable_scheduleHydration=function(t){if(t){var e=XE();t={blockedOn:null,target:t,priority:e};for(var n=0;n<no.length&&e!==0&&e<no[n].priority;n++);no.splice(n,0,t),n===0&&eT(t)}};function q0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Dg(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function G1(){}function j3(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=Qp(o);i.call(u)}}var o=bR(e,r,t,0,null,!1,!1,"",G1);return t._reactRootContainer=o,t[wi]=o.current,$d(t.nodeType===8?t.parentNode:t),Ka(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var u=Qp(c);a.call(u)}}var c=V0(t,0,!1,null,null,!1,!1,"",G1);return t._reactRootContainer=c,t[wi]=c.current,$d(t.nodeType===8?t.parentNode:t),Ka(function(){Mg(e,c,n,r)}),c}function Lg(t,e,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var c=Qp(o);a.call(c)}}Mg(e,o,t,s)}else o=j3(n,e,t,s,r);return Qp(o)}JE=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Fu(e.pendingLanes);
40n!==0&&(d0(e,n|1),hr(e,Yt()),!(et&6)&&(Rc=Yt()+500,Xo()))}break;case 13:Ka(function(){var r=ki(t,1);if(r!==null){var s=Xn();xs(r,t,1,s)}}),H0(t,1)}};h0=function(t){if(t.tag===13){var e=ki(t,134217728);if(e!==null){var n=Xn();xs(e,t,134217728,n)}H0(t,134217728)}};QE=function(t){if(t.tag===13){var e=Ao(t),n=ki(t,e);if(n!==null){var r=Xn();xs(n,t,e,r)}H0(t,e)}};XE=function(){return ct};ZE=function(t,e){var n=ct;try{return ct=t,e()}finally{ct=n}};Mx=function(t,e,n){switch(e){case"input":if(_x(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var s=_g(r);if(!s)throw Error(te(90));RE(r),_x(r,s)}}}break;case"textarea":OE(t,n);break;case"select":e=n.value,e!=null&&Xl(t,!!n.multiple,e,!1)}};BE=B0;zE=Ka;var N3={usingClientEntryPoint:!1,Events:[Lh,Hl,_g,LE,$E,B0]},Cu={findFiberByHostInstance:va,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_3={bundleType:Cu.bundleType,version:Cu.version,rendererPackageName:Cu.rendererPackageName,rendererConfig:Cu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ti.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=VE(t),t===null?null:t.stateNode},findFiberByHostInstance:Cu.findFiberByHostInstance||C3,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 wf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wf.isDisabled&&wf.supportsFiber)try{Sg=wf.inject(_3),Hs=wf}catch{}}Ar.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N3;Ar.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!q0(e))throw Error(te(200));return S3(t,e,null,n)};Ar.createRoot=function(t,e){if(!q0(t))throw Error(te(299));var n=!1,r="",s=wR;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=V0(t,1,!1,null,null,n,!1,r,s),t[wi]=e.current,$d(t.nodeType===8?t.parentNode:t),new W0(e)};Ar.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(te(188)):(t=Object.keys(t).join(","),Error(te(268,t)));return t=VE(e),t=t===null?null:t.stateNode,t};Ar.flushSync=function(t){return Ka(t)};Ar.hydrate=function(t,e,n){if(!Dg(e))throw Error(te(200));return Lg(null,t,e,!0,n)};Ar.hydrateRoot=function(t,e,n){if(!q0(t))throw Error(te(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=wR;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=bR(e,null,t,1,n??null,s,!1,i,o),t[wi]=e.current,$d(t),r)for(t=0;t<r.length;t++)n=r[t],s=n._getVersion,s=s(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,s]:e.mutableSourceEagerHydrationData.push(n,s);return new Ig(e)};Ar.render=function(t,e,n){if(!Dg(e))throw Error(te(200));return Lg(null,t,e,!1,n)};Ar.unmountComponentAtNode=function(t){if(!Dg(t))throw Error(te(40));return t._reactRootContainer?(Ka(function(){Lg(null,null,t,!1,function(){t._reactRootContainer=null,t[wi]=null})}),!0):!1};Ar.unstable_batchedUpdates=B0;Ar.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Dg(n))throw Error(te(200));if(t==null||t._reactInternals===void 0)throw Error(te(38));return Lg(t,e,n,!1,r)};Ar.version="18.3.1-next-f1338f8080-20240426";function kR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kR)}catch(t){console.error(t)}}kR(),kE.exports=Ar;var Vr=kE.exports;const K0=wg(Vr);var SR,Y1=Vr;SR=Y1.createRoot,Y1.hydrateRoot;var Bh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ga=typeof window>"u"||"Deno"in globalThis;function or(){}function E3(t,e){return typeof t=="function"?t(e):t}function fb(t){return typeof t=="number"&&t>=0&&t!==1/0}function CR(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Po(t,e){return typeof t=="function"?t(e):t}function Dr(t,e){return typeof t=="function"?t(e):t}function J1(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==G0(o,e.options))return!1}else if(!Gd(e.queryKey,o))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function Q1(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Kd(e.options.mutationKey)!==Kd(i))return!1}else if(!Gd(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function G0(t,e){return((e==null?void 0:e.queryKeyHashFn)||Kd)(t)}function Kd(t){return JSON.stringify(t,(e,n)=>mb(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Gd(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Gd(t[n],e[n])):!1}function jR(t,e){if(t===e)return t;const n=X1(t)&&X1(e);if(n||mb(t)&&mb(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),o=i.length,a=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<o;d++){const h=n?d:i[d];(!n&&c.has(h)||n)&&t[h]===void 0&&e[h]===void 0?(a[h]=void 0,u++):(a[h]=jR(t[h],e[h]),a[h]===t[h]&&t[h]!==void 0&&u++)}return s===o&&u===s?t:a}return e}function pb(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function X1(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function mb(t){if(!Z1(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Z1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Z1(t){return Object.prototype.toString.call(t)==="[object Object]"}function T3(t){return new Promise(e=>{setTimeout(e,t)})}function gb(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?jR(t,e):e}function R3(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function A3(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Y0=Symbol();function NR(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Y0?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function O3(t,e){return typeof t=="function"?t(...e):!!t}var _a,lo,hc,nE,P3=(nE=class extends Bh{constructor(){super();Re(this,_a);Re(this,lo);Re(this,hc);pe(this,hc,e=>{if(!Ga&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,lo)||this.setEventListener(P(this,hc))}onUnsubscribe(){var e;this.hasListeners()||((e=P(this,lo))==null||e.call(this),pe(this,lo,void 0))}setEventListener(e){var n;pe(this,hc,e),(n=P(this,lo))==null||n.call(this),pe(this,lo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){P(this,_a)!==e&&(pe(this,_a,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 4,924 bytes, line 40
40this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof P(this,_a)=="boolean"?P(this,_a):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},_a=new WeakMap,lo=new WeakMap,hc=new WeakMap,nE),J0=new P3,fc,co,pc,rE,M3=(rE=class extends Bh{constructor(){super();Re(this,fc,!0);Re(this,co);Re(this,pc);pe(this,pc,e=>{if(!Ga&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,co)||this.setEventListener(P(this,pc))}onUnsubscribe(){var e;this.hasListeners()||((e=P(this,co))==null||e.call(this),pe(this,co,void 0))}setEventListener(e){var n;pe(this,pc,e),(n=P(this,co))==null||n.call(this),pe(this,co,e(this.setOnline.bind(this)))}setOnline(e){P(this,fc)!==e&&(pe(this,fc,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return P(this,fc)}},fc=new WeakMap,co=new WeakMap,pc=new WeakMap,rE),Xp=new M3;function yb(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function I3(t){return Math.min(1e3*2**t,3e4)}function _R(t){return(t??"online")==="online"?Xp.isOnline():!0}var ER=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function mv(t){return t instanceof ER}function TR(t){let e=!1,n=0,r=!1,s;const i=yb(),o=m=>{var v;r||(p(new ER(m)),(v=t.abort)==null||v.call(t))},a=()=>{e=!0},c=()=>{e=!1},u=()=>J0.isFocused()&&(t.networkMode==="always"||Xp.isOnline())&&t.canRun(),d=()=>_R(t.networkMode)&&t.canRun(),h=m=>{var v;r||(r=!0,(v=t.onSuccess)==null||v.call(t,m),s==null||s(),i.resolve(m))},p=m=>{var v;r||(r=!0,(v=t.onError)==null||v.call(t,m),s==null||s(),i.reject(m))},f=()=>new Promise(m=>{var v;s=x=>{(r||u())&&m(x)},(v=t.onPause)==null||v.call(t)}).then(()=>{var m;s=void 0,r||(m=t.onContinue)==null||m.call(t)}),g=()=>{if(r)return;let m;const v=n===0?t.initialPromise:void 0;try{m=v??t.fn()}catch(x){m=Promise.reject(x)}Promise.resolve(m).then(h).catch(x=>{var E;if(r)return;const b=t.retry??(Ga?0:3),w=t.retryDelay??I3,k=typeof w=="function"?w(n,x):w,j=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,x);if(e||!j){p(x);return}n++,(E=t.onFail)==null||E.call(t,n,x),T3(k).then(()=>u()?void 0:f()).then(()=>{e?p(x):g()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?g():f().then(g),i)}}var D3=t=>setTimeout(t,0);function L3(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=D3;const i=a=>{e?t.push(a):s(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var En=L3(),Ea,sE,RR=(sE=class{constructor(){Re(this,Ea)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fb(this.gcTime)&&pe(this,Ea,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ga?1/0:5*60*1e3))}clearGcTimeout(){P(this,Ea)&&(clearTimeout(P(this,Ea)),pe(this,Ea,void 0))}},Ea=new WeakMap,sE),mc,Ta,Ir,Ra,zn,Rh,Aa,hs,oi,iE,$3=(iE=class extends RR{constructor(e){super();Re(this,hs);Re(this,mc);Re(this,Ta);Re(this,Ir);Re(this,Ra);Re(this,zn);Re(this,Rh);Re(this,Aa);pe(this,Aa,!1),pe(this,Rh,e.defaultOptions),this.setOptions(e.options),this.observers=[],pe(this,Ra,e.client),pe(this,Ir,P(this,Ra).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,pe(this,mc,B3(this.options)),this.state=e.state??P(this,mc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=P(this,zn))==null?void 0:e.promise}setOptions(e){this.options={...P(this,Rh),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,Ir).remove(this)}setData(e,n){const r=gb(this.state.data,e,this.options);return Qe(this,hs,oi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Qe(this,hs,oi).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=P(this,zn))==null?void 0:r.promise;return(s=P(this,zn))==null||s.cancel(e),n?n.then(or).catch(or):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,mc))}isActive(){return this.observers.some(e=>Dr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Y0||this.state.dataUpdateCount+this.state.errorUpdate
40Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Po(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!CR(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=P(this,zn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=P(this,zn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),P(this,Ir).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(P(this,zn)&&(P(this,Aa)?P(this,zn).cancel({revert:!0}):P(this,zn).cancelRetry()),this.scheduleGc()),P(this,Ir).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Qe(this,hs,oi).call(this,{type:"invalidate"})}fetch(e,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(P(this,zn))return P(this,zn).continueRetry(),P(this,zn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(f=>f.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(pe(this,Aa,!0),r.signal)})},i=()=>{const p=NR(this.options,n),g=(()=>{const m={client:P(this,Ra),queryKey:this.queryKey,meta:this.meta};return s(m),m})();return pe(this,Aa,!1),this.options.persister?this.options.persister(p,g,this):p(g)},a=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,Ra),state:this.state,fetchFn:i};return s(p),p})();(u=this.options.behavior)==null||u.onFetch(a,this),pe(this,Ta,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Qe(this,hs,oi).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const c=p=>{var f,g,m,v;mv(p)&&p.silent||Qe(this,hs,oi).call(this,{type:"error",error:p}),mv(p)||((g=(f=P(this,Ir).config).onError)==null||g.call(f,p,this),(v=(m=P(this,Ir).config).onSettled)==null||v.call(m,this.state.data,p,this)),this.scheduleGc()};return pe(this,zn,TR({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var f,g,m,v;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){c(x);return}(g=(f=P(this,Ir).config).onSuccess)==null||g.call(f,p,this),(v=(m=P(this,Ir).config).onSettled)==null||v.call(m,p,this.state.error,this),this.scheduleGc()},onError:c,onFail:(p,f)=>{Qe(this,hs,oi).call(this,{type:"failed",failureCount:p,error:f})},onPause:()=>{Qe(this,hs,oi).call(this,{type:"pause"})},onContinue:()=>{Qe(this,hs,oi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),P(this,zn).start()}},mc=new WeakMap,Ta=new WeakMap,Ir=new WeakMap,Ra=new WeakMap,zn=new WeakMap,Rh=new WeakMap,Aa=new WeakMap,hs=new WeakSet,oi=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...AR(r.data,this.options),fetchMeta:e.meta??null};case"success":return pe(this,Ta,void 0),{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return mv(s)&&s.revert&&P(this,Ta)?{...P(this,Ta),fetchStatus:"idle"}
vendor: 19,093 bytes, line 40
40:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),En.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,Ir).notify({query:this,type:"updated",action:e})})},iE);function AR(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_R(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function B3(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,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 Ds,oE,z3=(oE=class extends Bh{constructor(e={}){super();Re(this,Ds);this.config=e,pe(this,Ds,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??G0(s,n);let o=this.get(i);return o||(o=new $3({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){P(this,Ds).has(e.queryHash)||(P(this,Ds).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=P(this,Ds).get(e.queryHash);n&&(e.destroy(),n===e&&P(this,Ds).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){En.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return P(this,Ds).get(e)}getAll(){return[...P(this,Ds).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>J1(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>J1(e,r)):n}notify(e){En.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){En.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){En.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ds=new WeakMap,oE),Ls,Gn,Oa,$s,qi,aE,F3=(aE=class extends RR{constructor(e){super();Re(this,$s);Re(this,Ls);Re(this,Gn);Re(this,Oa);this.mutationId=e.mutationId,pe(this,Gn,e.mutationCache),pe(this,Ls,[]),this.state=e.state||U3(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){P(this,Ls).includes(e)||(P(this,Ls).push(e),this.clearGcTimeout(),P(this,Gn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){pe(this,Ls,P(this,Ls).filter(n=>n!==e)),this.scheduleGc(),P(this,Gn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){P(this,Ls).length||(this.state.status==="pending"?this.scheduleGc():P(this,Gn).remove(this))}continue(){var e;return((e=P(this,Oa))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,c,u,d,h,p,f,g,m,v,x,b,w,k,j,E,N,S;const n=()=>{Qe(this,$s,qi).call(this,{type:"continue"})};pe(this,Oa,TR({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(C,_)=>{Qe(this,$s,qi).call(this,{type:"failed",failureCount:C,error:_})},onPause:()=>{Qe(this,$s,qi).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,Gn).canRun(this)}));const r=this.state.status==="pending",s=!P(this,Oa).canStart();try{if(r)n();else{Qe(this,$s,qi).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=P(this,Gn).config).onMutate)==null?void 0:o.call(i,e,this));const _=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,e));_!==this.state.context&&Qe(this,$s,qi).call(this,{type:"pending",context:_,variables:e,isPaused:s})}const C=await P(this,Oa).start();return await((d=(u=P(this,Gn).config).onSuccess)==null?void 0:d.call(u,C,e,this.state.context,this)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,C,e,this.state.context)),await((g=(f=P(this,Gn).config).onSettled)==null?void 0:g.call(f,C,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,C,null,e,this.state.context)),Qe(this,$s,qi).call(this,{type:"success",data:C}),C}catch(C){try{throw await((b=(x=P(this,Gn).config).onError)==null?void 0:b.call(x,C,e,this.state.context,this)),await((k=(w=this.options).onError)==null?void 0:k.call(w,C,e,this.state.context)),await((E=(j=P(this,Gn).config).onSettled)==null?void 0:E.call(j,void 0,C,this.state.variables,this.state.context,this)),await((S=(N=this.options).onSettled)==null?void 0:S.call(N,void 0,C,e,this.state.context)),C}finally{Qe(this,$s,qi).call(this,{type:"error",error:C})}}finally{P(this,Gn).runNext(this)}}},Ls=new WeakMap,Gn=new WeakMap,Oa=new WeakMap,$s=new WeakSet,qi=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),En.batch(()=>{P(this,Ls).forEach(r=>{r.onMutationUpdate(e)}),P(this,Gn).notify({mutation:this,type:"updated",action:e})})},aE);function U3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fi,fs,Ah,lE,V3=(lE=class extends Bh{constructor(e={}){super();Re(this,fi);Re(this,fs);Re(this,Ah);this.config=e,pe(this,fi,new Set),pe(this,fs,new Map),pe(this,Ah,0)}build(e,n,r){const s=new F3({mutationCache:this,mutationId:++rf(this,Ah)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){P(this,fi).add(e);const n=kf(e);if(typeof n=="string"){const r=P(this,fs).get(n);r?r.push(e):P(this,fs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(P(this,fi).delete(e)){const n=kf(e);if(typeof n=="string"){const r=P(this,fs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&P(this,fs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=kf(e);if(typeof n=="string"){const r=P(this,fs).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=kf(e);if(typeof n=="string"){const s=(r=P(this,fs).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){En.batch(()=>{P(this,fi).forEach(e=>{this.notify({type:"removed",mutation:e})}),P(this,fi).clear(),P(this,fs).clear()})}getAll(){return Array.from(P(this,fi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Q1(n,r))}findAll(e={}){return this.getAll().filter(n=>Q1(e,n))}notify(e){En.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return En.batch(()=>Promise.all(e.map(n=>n.continue().catch(or))))}},fi=new WeakMap,fs=new WeakMap,Ah=new WeakMap,lE);function kf(t){var e;return(e=t.options.scope)==null?void 0:e.id}function eC(t){return{onFetch:(e,n)=>{var d,h,p,f,g;const r=e.options,s=(p=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,i=((f=e.state.data)==null?void 0:f.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},x=NR(e.options,e.fetchOptions),b=async(w,k,j)=>{if(m)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const N=(()=>{const R={client:e.client,queryKey:e.queryKey,pageParam:k,direction:j?"backward":"forward",meta:e.options.meta};return v(R),R})(),S=await x(N),{maxPages:C}=e.options,_=j?A3:R3;return{pages:_(w.pages,S,C),pageParams:_(w.pageParams,k,C)}};if(s&&i.length){const w=s==="backward",k=w?H3:tC,j={pages:i,pageParams:o},E=k(r,j);a=await b(j,E,w)}else{const w=t??i.length;do{const k=c===0?o[0]??r.initialPageParam:tC(r,a);if(c>0&&k==null)break;a=await b(a,k),c++}while(c<w)}return a};e.options.persister?e.fetchFn=()=>{var m,v;return(v=(m=e.options).persister)==null?void 0:v.call(m,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function tC(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function H3(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var zt,uo,ho,gc,yc,fo,vc,xc,cE,W3=(cE=class{constructor(t={}){Re(this,zt);Re(this,uo);Re(this,ho);Re(this,gc);Re(this,yc);Re(this,fo);Re(this,vc);Re(this,xc);pe(this,zt,t.queryCache||new z3),pe(this,uo,t.mutationCache||new V3),pe(this,ho,t.defaultOptions||{}),pe(this,gc,new Map),pe(this,yc,new Map),pe(this,fo,0)}mount(){rf(this,fo)._++,P(this,fo)===1&&(pe(this,vc,J0.subscribe(async t=>{t&&(await this.resumePausedMutations(),P(this,zt).onFocus())})),pe(this,xc,Xp.subscribe(async t=>{t&&(await this.resumePausedMutations(),P(this,zt).onOnline())})))}unmount(){var t,e;rf(this,fo)._--,P(this,fo)===0&&((t=P(this,vc))==null||t.call(this),pe(this,vc,void 0),(e=P(this,xc))==null||e.call(this),pe(this,xc,void 0))}isFetching(t){return P(this,zt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return P(this,uo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=P(this,zt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=P(this,zt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Po(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return P(this,zt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=P(this,zt).get(r.queryHash),i=s==null?void 0:s.state.data,o=E3(e,i);if(o!==void 0)return P(this,zt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return En.batch(()=>P(this,zt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=P(this,zt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=P(this,zt);En.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=P(this,zt);return En.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=En.batch(()=>P(this,zt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(or).catch(or)}invalidateQueries(t,e={}){return En.batch(()=>(P(this,zt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=En.batch(()=>P(this,zt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(or)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(or)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=P(this,zt).build(this,e);return n.isStaleByTime(Po(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(or).catch(or)}fetchInfiniteQuery(t){return t.behavior=eC(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(or).catch(or)}ensureInfiniteQueryData(t){return t.behavior=eC(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Xp.isOnline()?P(this,uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,zt)}getMutationCache(){return P(this,uo)}getDefaultOptions(){return P(this,ho)}setDefaultOptions(t){pe(this,ho,t)}setQueryDefaults(t,e){P(this,gc).set(Kd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...P(this,gc).values()],n={};return e.forEach(r=>{Gd(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){P(this,yc).set(Kd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...P(this,yc).values()],n={};return e.forEach(r=>{Gd(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...P(this,ho).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=G0(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Y0&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...P(this,ho).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){P(this,zt).clear(),P(this,uo).clear()}},zt=new WeakMap,uo=new WeakMap,ho=new WeakMap,gc=new WeakMap,yc=new WeakMap,fo=new WeakMap,vc=new WeakMap,xc=new WeakMap,cE),sr,Xe,Oh,Yn,Pa,bc,po,mo,Ph,wc,kc,Ma,Ia,go,Sc,it,Vu,vb,xb,bb,wb,kb,Sb,Cb,OR,uE,q3=(uE=class extends Bh{constructor(e,n){super();Re(this,it);Re(this,sr);Re(this,Xe);Re(this,Oh);Re(this,Yn);Re(this,Pa);Re(this,bc);Re(this,po);Re(this,mo);Re(this,Ph);Re(this,wc);Re(this,kc);Re(this,Ma);Re(this,Ia);Re(this,go);Re(this,Sc,new Set);this.options=n,pe(this,sr,e),pe(this,mo,null),pe(this,po,yb()),this.options.experimental_prefetchInRender||P(this,po).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&&(P(this,Xe).addObserver(this),nC(P(this,Xe),this.options)?Qe(this,it,Vu).call(this):this.updateResult(),Qe(this,it,wb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jb(P(this,Xe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jb(P(this,Xe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Qe(this,it,kb).call(this),Qe(this,it,Sb).call(this),P(this,Xe).removeObserver(this)}setOptions(e){const n=this.options,r=P(this,Xe);if(this.options=P(this,sr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dr(this.options.enabled,P(this,Xe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Qe(this,it,Cb).call(this),P(this,Xe).setOptions(this.options),n._defaulted&&!pb(this.options,n)&&P(this,sr).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Xe),observer:this});const s=this.hasListeners();s&&rC(P(this,Xe),r,this.options,n)&&Qe(this,it,Vu).call(this),this.updateResult(),s&&(P(this,Xe)!==r||Dr(this.options.enabled,P(this,Xe))!==Dr(n.enabled,P(this,Xe))||Po(this.options.staleTime,P(this,Xe))!==Po(n.staleTime,P(this,Xe)))&&Qe(this,it,vb).call(this);const i=Qe(this,it,xb).call(this);s&&(P(this,Xe)!==r||Dr(this.options.enabled,P(this,Xe))!==Dr(n.enabled,P(this,Xe))||i!==P(this,go))&&Qe(this,it,bb).call(this,i)}getOptimisticResult(e){const n=P(this,sr).getQueryCache().build(P(this,sr),e),r=this.createResult(n,e);return G3(this,r)&&(pe(this,Yn,r),pe(this,bc,this.options),pe(this,Pa,P(this,Xe).state)),r}getCurrentResult(){return P(this,Yn)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){P(this,Sc).add(e)}getCurrentQuery(){return P(this,Xe)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=P(this,sr).defaultQueryOptions(e),r=P(this,sr).getQueryCache().build(P(this,sr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Qe(this,it,Vu).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Yn)))}createResult(e,n){var C;const r=P(this,Xe),s=this.options,i=P(this,Yn),o=P(this,Pa),a=P(this,bc),u=e!==r?e.state:P(this,Oh),{state:d}=e;let h={...d},p=!1,f;if(n._optimisticResults){const _=this.hasListeners(),R=!_&&nC(e,n),O=_&&rC(e,r,n,s);(R||O)&&(h={...h,...AR(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:v}=h;f=h.data;let x=!1;if(n.placeholderData!==void 0&&f===void 0&&v==="pending"){let _;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(_=i.data,x=!0):_=typeof n.placeholderData=="function"?n.placeholderData((C=P(this,kc))==null?void 0:C.state.data,P(this,kc)):n.placeholderData,_!==void 0&&(v="success",f=gb(i==null?void 0:i.data,_,n),p=!0)}if(n.select&&f!==void 0&&!x)if(i&&f===(o==null?void 0:o.data)&&n.select===P(this,Ph))f=P(this,wc);else try{pe(this,Ph,n.select),f=n.select(f),f=gb(i==null?void 0:i.data,f,n),pe(this,wc,f),pe(this,mo,null)}catch(_){pe(this,mo,_)}P(this,mo)&&(g=P(this,mo),f=P(this,wc),m=Date.now(),v="error");const b=h.fetchStatus==="fetching",w=v==="pending",k=v==="error",j=w&&b,E=f!==void 0,S={status:v,fetchStatus:h.fetchStatus,isPending:w,isSuccess:v==="success",isError:k,isInitialLoading:j,isLoading:j,data:f,dataUpdatedAt:h.dataUpdatedAt,error:g,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:b,isRefetching:b&&!w,isLoadingError:k&&!E,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:k&&E,isStale:Q0(e,n),refetch:this.refetch,promise:P(this,po),isEnabled:Dr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const _=L=>{S.status==="error"?L.reject(S.error):S.data!==void 0&&L.resolve(S.data)},R=()=>{const L=pe(this,po,S.promise=yb());_(L)},O=P(this,po);switch(O.status){case"pending":e.queryHash===r.queryHash&&_(O);break;case"fulfilled":(S.status==="error"||S.data!==O.value)&&R();break;case"rejected":(S.status!=="error"||S.error!==O.reason)&&R();break}}return S}updateResult(){const e=P(this,Yn),n=this.createResult(P(this,Xe),this.options);if(pe(this,Pa,P(this,Xe).state),pe(this,bc,this.options),P(this,Pa).data!==void 0&&pe(this,kc,P(this,Xe)),pb(n,e))return;pe(this,Yn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;
40if(i==="all"||!i&&!P(this,Sc).size)return!0;const o=new Set(i??P(this,Sc));return this.options.throwOnError&&o.add("error"),Object.keys(P(this,Yn)).some(a=>{const c=a;return P(this,Yn)[c]!==e[c]&&o.has(c)})};Qe(this,it,OR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Qe(this,it,wb).call(this)}},sr=new WeakMap,Xe=new WeakMap,Oh=new WeakMap,Yn=new WeakMap,Pa=new WeakMap,bc=new WeakMap,po=new WeakMap,mo=new WeakMap,Ph=new WeakMap,wc=new WeakMap,kc=new WeakMap,Ma=new WeakMap,Ia=new WeakMap,go=new WeakMap,Sc=new WeakMap,it=new WeakSet,Vu=function(e){Qe(this,it,Cb).call(this);let n=P(this,Xe).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(or)),n},vb=function(){Qe(this,it,kb).call(this);const e=Po(this.options.staleTime,P(this,Xe));if(Ga||P(this,Yn).isStale||!fb(e))return;const r=CR(P(this,Yn).dataUpdatedAt,e)+1;pe(this,Ma,setTimeout(()=>{P(this,Yn).isStale||this.updateResult()},r))},xb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Xe)):this.options.refetchInterval)??!1},bb=function(e){Qe(this,it,Sb).call(this),pe(this,go,e),!(Ga||Dr(this.options.enabled,P(this,Xe))===!1||!fb(P(this,go))||P(this,go)===0)&&pe(this,Ia,setInterval(()=>{(this.options.refetchIntervalInBackground||J0.isFocused())&&Qe(this,it,Vu).call(this)},P(this,go)))},wb=function(){Qe(this,it,vb).call(this),Qe(this,it,bb).call(this,Qe(this,it,xb).call(this))},kb=function(){P(this,Ma)&&(clearTimeout(P(this,Ma)),pe(this,Ma,void 0))},Sb=function(){P(this,Ia)&&(clearInterval(P(this,Ia)),pe(this,Ia,void 0))},Cb=function(){const e=P(this,sr).getQueryCache().build(P(this,sr),this.options);if(e===P(this,Xe))return;const n=P(this,Xe);pe(this,Xe,e),pe(this,Oh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},OR=function(e){En.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(P(this,Yn))}),P(this,sr).getQueryCache().notify({query:P(this,Xe),type:"observerResultsUpdated"})})},uE);function K3(t,e){return Dr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function nC(t,e){return K3(t,e)||t.state.data!==void 0&&jb(t,e,e.refetchOnMount)}function jb(t,e,n){if(Dr(e.enabled,t)!==!1&&Po(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Q0(t,e)}return!1}function rC(t,e,n,r){return(t!==e||Dr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Q0(t,n)}function Q0(t,e){return Dr(e.enabled,t)!==!1&&t.isStaleByTime(Po(e.staleTime,t))}function G3(t,e){return!pb(t.getCurrentResult(),e)}var PR=y.createContext(void 0),Y3=t=>{const e=y.useContext(PR);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},J3=({client:t,children:e})=>(y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),l.jsx(PR.Provider,{value:t,children:e})),MR=y.createContext(!1),Q3=()=>y.useContext(MR);MR.Provider;function X3(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Z3=y.createContext(X3()),eB=()=>y.useContext(Z3),tB=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},nB=t=>{y.useEffect(()=>{t.clearReset()},[t])},rB=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||O3(n,[t.error,r])),sB=t=>{if(t.suspense){const e=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>e(n(...r)):e(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},iB=(t,e)=>t.isLoading&&t.isFetching&&!e,oB=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,sC=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function aB(t,e,n){var h,p,f,g,m;const r=Q3(),s=eB(),i=Y3(),o=i.defaultQueryOptions(t);(p=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,o),o._optimisticResults=r?"isRestoring":"optimistic",sB(o),tB(o,s),nB(s);const a=!i.getQueryCache().get(o.queryHash),[c]=y.useState(()=>new e(i,o)),u=c.getOptimisticResult(o),d=!r&&t.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(v=>{const x=d?c.subscribe(En.batchCalls(v)):or;return c.updateResult(),x},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),y.useEffect(()=>{c.setOptions(o)},[o,c]),oB(o,u))throw sC(o,c,s);if(rB({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((g=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||g.call(f,o,u),o.experimental_prefetchInRender&&!Ga&&iB(u,r)){const v=a?sC(o,c,s):(m=i.getQueryCache().get(o.queryHash))==null?void 0:m.promise;v==null||v.catch(or).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function iC(t,e){return aB(t,q3)}/** 41 * @remix-run/router v1.23.0 42 * 43 * Copyright (c) Remix Software Inc. 44 * 45 * This source code is licensed under the MIT license found in the 46 * LICENSE.md file in the root directory of this source tree. 47 * 48 * @license MIT 49 */function Yd(){return Yd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Yd.apply(this,arguments)}var xo;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(xo||(xo={}));const oC="popstate";function lB(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:o,hash:a}=r.location;return Nb("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Zp(s)}return uB(e,n,null,t)}function Wt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function IR(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function cB(){return Math.random().toString(36).substr(2,8)}function aC(t,e){return{usr:t.state,key:t.key,idx:e}}function Nb(t,e,n,r){return n===void 0&&(n=null),Yd({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Zc(e):e,{state:n,key:e&&e.key||r||cB()})}function Zp(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Zc(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function uB(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=xo.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Yd({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){a=xo.Pop;let v=d(),x=v==null?null:v-u;u=v,c&&c({action:a,location:m.location,delta:x})}function p(v,x){a=xo.Push;let b=Nb(m.location,v,x);u=d()+1;let w=aC(b,u),k=m.createHref(b);try{o.pushState(w,"",k)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(k)}i&&c&&c({action:a,location:m.location,delta:1})}function f(v,x){a=xo.Replace;let b=Nb(m.location,v,x);u=d();let w=aC(b,u),k=m.createHref(b);o.replaceState(w,"",k),i&&c&&c({action:a,location:m.location,delta:0})}function g(v){let x=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof v=="string"?v:Zp(v);return b=b.replace(/ $/,"%20"),Wt(x,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,x)}let m={get action(){return a},get location(){return t(s,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(oC,h),c=v,()=>{s.removeEventListener(oC,h),c=null}},createHref(v){return e(s,v)},createURL:g,encodeLocation(v){let x=g(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:f,go(v){return o.go(v)}};return m}var lC;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(lC||(lC={}));function dB(t,e,n){return n===void 0&&(n="/"),hB(t,e,n,!1)}function hB(t,e,n,r){let s=typeof e=="string"?Zc(e):e,i=Ac(s.pathname||"/",n);if(i==null)return null;let o=DR(t);fB(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let u=CB(i);a=kB(o[c],u,r)}return a}function DR(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Wt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
49id. 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=Mo([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Wt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),DR(i.children,e,d,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:bB(u,i.index),routesMeta:d})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let c of LR(i.path))s(i,o,c)}),e}function LR(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=LR(r.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>t.startsWith("/")&&c===""?"/":c)}function fB(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:wB(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const pB=/^:[\w-]+$/,mB=3,gB=2,yB=1,vB=10,xB=-2,cC=t=>t==="*";function bB(t,e){let n=t.split("/"),r=n.length;return n.some(cC)&&(r+=xB),e&&(r+=gB),n.filter(s=>!cC(s)).reduce((s,i)=>s+(pB.test(i)?mB:i===""?yB:vB),r)}function wB(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function kB(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],u=a===r.length-1,d=i==="/"?e:e.slice(i.length)||"/",h=em({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),p=c.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=em({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;
vendor: 7,044 bytes, lines 49-58
49Object.assign(s,h.params),o.push({params:s,pathname:Mo([i,h.pathname]),pathnameBase:EB(Mo([i,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(i=Mo([i,h.pathnameBase]))}return o}function em(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=SB(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:p,isOptional:f}=d;if(p==="*"){let m=a[h]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const g=a[h];return f&&!g?u[p]=void 0:u[p]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function SB(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),IR(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function CB(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return IR(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Ac(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function jB(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?Zc(t):t;return{pathname:n?n.startsWith("/")?n:NB(n,e):e,search:TB(r),hash:RB(s)}}function NB(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function gv(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` 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 _B(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function $R(t,e){let n=_B(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function BR(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=Zc(t):(s=Yd({},t),Wt(!s.pathname||!s.pathname.includes("?"),gv("?","pathname","search",s)),Wt(!s.pathname||!s.pathname.includes("#"),gv("#","pathname","hash",s)),Wt(!s.search||!s.search.includes("#"),gv("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let h=e.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),h-=1;s.pathname=p.join("/")}a=h>=0?e[h]:"/"}let c=jB(s,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Mo=t=>t.join("/").replace(/\/\/+/g,"/"),EB=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),TB=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,RB=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function AB(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const zR=["post","put","patch","delete"];new Set(zR);const OB=["get",...zR];new Set(OB);/** 50 * React Router v6.30.1 51 * 52 * Copyright (c) Remix Software Inc. 53 * 54 * This source code is licensed under the MIT license found in the 55 * LICENSE.md file in the root directory of this source tree. 56 * 57 * @license MIT 58 */function Jd(){return Jd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Jd.apply(this,arguments)}const $g=y.createContext(null),FR=y.createContext(null),Zo=y.createContext(null),Bg=y.createContext(null),Ri=y.createContext({outlet:null,matches:[],isDataRoute:!1}),UR=y.createContext(null);function PB(t,e){let{relative:n}=e===void 0?{}:e;zh()||Wt(!1);let{basename:r,navigator:s}=y.useContext(Zo),{hash:i,pathname:o,search:a}=zg(t,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Mo([r,o])),s.createHref({pathname:c,search:a,hash:i})}function zh(){return y.useContext(Bg)!=null}function Ai(){return zh()||Wt(!1),y.useContext(Bg).location}function VR(t){y.useContext(Zo).static||y.useLayoutEffect(t)}function In(){let{isDataRoute:t}=y.useContext(Ri);return t?GB():MB()}function MB(){zh()||Wt(!1);let t=y.useContext($g),{basename:e,future:n,navigator:r}=y.useContext(Zo),{matches:s}=y.useContext(Ri),{pathname:i}=Ai(),o=JSON.stringify($R(s,n.v7_relativeSplatPath)),a=y.useRef(!1);return VR(()=>{a.current=!0}),y.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let h=BR(u,JSON.parse(o),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Mo([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,o,i,t])}const IB=y.createContext(null);function DB(t){let e=y.useContext(Ri).outlet;return e&&y.createElement(IB.Provider,{value:t},e)}function ea(){let{matches:t}=y.useContext(Ri),e=t[t.length-1];return e?e.params:{}}function zg(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=y.useContext(Zo),{matches:s}=y.useContext(Ri),{pathname:i}=Ai(),o=JSON.stringify($R(s,r.v7_relativeSplatPath));return y.useMemo(()=>BR(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function LB(t,e){return $B(t,e)}function $B(t,e,n,r){zh()||Wt(!1);let{navigator:s}=y.useContext(Zo),{matches:i}=y.useContext(Ri),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Ai(),d;if(e){var h;let v=typeof e=="string"?Zc(e):e;c==="/"||(h=v.pathname)!=null&&h.startsWith(c)||Wt(!1),d=v}else d=u;let p=d.pathname||"/",f=p;if(c!=="/"){let v=c.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=dB(t,{pathname:f}),m=VB(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Mo([c,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Mo([c,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,r);return e&&m?y.createElement(Bg.Provider,{value:{location:Jd({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:xo.Pop}},m):m}function BB(){let t=KB(),e=AB(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application
58Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},e),n?y.createElement("pre",{style:s},n):null,null)}const zB=y.createElement(BB,null);class FB extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?y.createElement(Ri.Provider,{value:this.props.routeContext},y.createElement(UR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UB(t){let{routeContext:e,match:n,children:r}=t,s=y.useContext($g);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Ri.Provider,{value:e},r)}function VB(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);d>=0||Wt(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:p,errors:f}=n,g=h.route.loader&&p[h.route.id]===void 0&&(!f||f[h.route.id]===void 0);if(h.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,p)=>{let f,g=!1,m=null,v=null;n&&(f=a&&h.route.id?a[h.route.id]:void 0,m=h.route.errorElement||zB,c&&(u<0&&p===0?(g=!0,v=null):u===p&&(g=!0,v=h.route.hydrateFallbackElement||null)));let x=e.concat(o.slice(0,p+1)),b=()=>{let w;return f?w=m:g?w=v:h.route.Component?w=y.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=d,y.createElement(UB,{match:h,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:w})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?y.createElement(FB,{location:n.location,revalidation:n.revalidation,component:m,error:f,children:b(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):b()},null)}var HR=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(HR||{}),tm=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(tm||{});function HB(t){let e=y.useContext($g);return e||Wt(!1),e}function WB(t){let e=y.useContext(FR);return e||Wt(!1),e}function qB(t){let e=y.useContext(Ri);return e||Wt(!1),e}function WR(t){let e=qB(),n=e.matches[e.matches.length-1];return n.route.id||Wt(!1),n.route.id}function KB(){var t;let e=y.useContext(UR),n=WB(tm.UseRouteError),r=WR(tm.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function GB(){let{router:t}=HB(HR.UseNavigateStable),e=WR(tm.UseNavigateStable),n=y.useRef(!1);return VR(()=>{n.current=!0}),y.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,Jd({fromRouteId:e},i)))},[t,e])}function YB(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function JB(t){return DB(t.context)}function Te(t){Wt(!1)}function QB(t){let{basename:e="/",children:n=null,location:r,navigationType:s=xo.Pop,navigator:i,static:o=!1,future:a}=t;zh()&&Wt(!1);let c=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:c,navigator:i,static:o,future:Jd({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof r=="string"&&(r=Zc(r));let{pathname:d="/",search:h="",hash:p="",state:f=null,key:g="default"}=r,m=y.useMemo(()=>{let v=Ac(d,c);return v==null?null:{location:{pathname:v,search:h,hash:p,state:f,key:g},navigationType:s}},[c,d,h,p,f,g,s]);return m==null?null:y.createElement(Zo.Provider,{value:u},y.createElement(Bg.Provider,{children:n,value:m}))}function XB(t){let{children:e,location:n}=t;return LB(_b(e),n)}new Promise(()=>{});function _b(t,e){e===void 0&&(e=[]);let n=[];
58return y.Children.forEach(t,(r,s)=>{if(!y.isValidElement(r))return;let i=[...e,s];if(r.type===y.Fragment){n.push.apply(n,_b(r.props.children,i));return}r.type!==Te&&Wt(!1),!r.props.index||!r.props.children||Wt(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=_b(r.props.children,i)),n.push(o)}),n}/** 59 * React Router DOM v6.30.1 60 * 61 * Copyright (c) Remix Software Inc. 62 * 63 * This source code is licensed under the MIT license found in the 64 * LICENSE.md file in the root directory of this source tree. 65 * 66 * @license MIT 67 */function nm(){return nm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nm.apply(this,arguments)}function qR(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function ZB(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function ez(t,e){return t.button===0&&(!e||e==="_self")&&!ZB(t)}function Eb(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function tz(t,e){let n=Eb(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const nz=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],rz=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],sz="6";try{window.__reactRouterVersion=sz}catch{}const iz=y.createContext({isTransitioning:!1}),oz="startTransition",uC=n0[oz];function az(t){let{basename:e,children:n,future:r,window:s}=t,i=y.useRef();i.current==null&&(i.current=lB({window:s,v5Compat:!0}));let o=i.current,[a,c]=y.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=y.useCallback(h=>{u&&uC?uC(()=>c(h)):c(h)},[c,u]);return y.useLayoutEffect(()=>o.listen(d),[o,d]),y.useEffect(()=>YB(r),[r]),y.createElement(QB,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const lz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Be=y.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:c,to:u,preventScrollReset:d,viewTransition:h}=e,p=qR(e,nz),{basename:f}=y.useContext(Zo),g,m=!1;if(typeof u=="string"&&cz.test(u)&&(g=u,lz))try{let w=new URL(window.location.href),k=u.startsWith("//")?new URL(w.protocol+u):new URL(u),j=Ac(k.pathname,f);k.origin===w.origin&&j!=null?u=j+k.search+k.hash:m=!0}catch{}let v=PB(u,{relative:s}),x=hz(u,{replace:o,state:a,target:c,preventScrollReset:d,relative:s,viewTransition:h});function b(w){r&&r(w),w.defaultPrevented||x(w)}return y.createElement("a",nm({},p,{href:g||v,onClick:m||i?r:b,ref:n,target:c}))}),uz=y.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:c,viewTransition:u,children:d}=e,h=qR(e,rz),p=zg(c,{relative:h.relative}),f=Ai(),g=y.useContext(FR),{navigator:m,basename:v}=y.useContext(Zo),x=g!=null&&fz(p)&&u===!0,b=m.encodeLocation?m.encodeLocation(p).pathname:p.pathname,w=f.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;s||(w=w.toLowerCase(),k=k?k.toLowerCase():null,b=b.toLowerCase()),k&&v&&(k=Ac(k,v)||k);const j=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let E=w===b||!o&&w.startsWith(b)&&w.charAt(j)==="/",N=k!=null&&(k===b||!o&&k.startsWith(b)&&k.charAt(b.length)==="/"),S={isActive:E,isPending:N,isTransitioning:x},C=E?r:void 0,_;typeof i=="function"?_=i(S):_=[i,E?"active":null,N?"pending":null,x?"transitioning":null].filter(
67Boolean).join(" ");let R=typeof a=="function"?a(S):a;return y.createElement(Be,nm({},h,{"aria-current":C,className:_,ref:n,style:R,to:c,viewTransition:u}),typeof d=="function"?d(S):d)});var Tb;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Tb||(Tb={}));var dC;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(dC||(dC={}));function dz(t){let e=y.useContext($g);return e||Wt(!1),e}function hz(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,c=In(),u=Ai(),d=zg(t,{relative:o});return y.useCallback(h=>{if(ez(h,n)){h.preventDefault();let p=r!==void 0?r:Zp(u)===Zp(d);c(t,{replace:p,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,c,d,r,s,n,t,i,o,a])}function X0(t){let e=y.useRef(Eb(t)),n=y.useRef(!1),r=Ai(),s=y.useMemo(()=>tz(r.search,n.current?null:e.current),[r.search]),i=In(),o=y.useCallback((a,c)=>{const u=Eb(typeof a=="function"?a(s):a);n.current=!0,i("?"+u,c)},[i,s]);return[s,o]}function fz(t,e){e===void 0&&(e={});let n=y.useContext(iz);n==null&&Wt(!1);let{basename:r}=dz(Tb.useViewTransitionState),s=zg(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=Ac(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ac(n.nextLocation.pathname,r)||n.nextLocation.pathname;return em(s.pathname,o)!=null||em(s.pathname,i)!=null}var hC=["light","dark"],pz="(prefers-color-scheme: dark)",mz=y.createContext(void 0),gz={setTheme:t=>{},themes:[]},yz=()=>{var t;return(t=y.useContext(mz))!=null?t:gz};y.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:c})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=s?hC.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(g,m=!1,v=!0)=>{let x=o?o[g]:g,b=m?g+"|| ''":`'${x}'`,w="";return s&&v&&!m&&hC.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?m||x?w+=`c.add(${b})`:w+="null":x&&(w+=`d[s](n,${b})`),w},f=t?`!function(){${d}${p(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${pz}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}${u?"":"else{"+p(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${h}}catch(t){}}();`;return y.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var vz=t=>{switch(t){case"success":return wz;case"info":return Sz;case"warning":return kz;case"error":return Cz;default:return null}},xz=Array(12).fill(0),bz=({visible:t,className:e})=>V.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},V.createElement("div",{className:"sonner-spinner"},xz.map((n,r)=>V.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),wz=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),kz=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},V.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"})),Sz=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),Cz=V.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},V.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"})),jz=V.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"},V.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),V.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Nz=()=>{let[t,e]=V.useState(document.hidden);return V.useEffect(()=>{let n=()=>{e(document.hidden)};
67return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},Rb=1,_z=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:Rb++,i=this.toasts.find(a=>a.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:n}),{...a,...t,id:s,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),s=n!==void 0,i,o=r.then(async c=>{if(i=["resolve",c],V.isValidElement(c))s=!1,this.create({id:n,type:"default",message:c});else if(Tz(c)&&!c.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${c.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${c.status}`):e.description;this.create({id:n,type:"error",message:u,description:d})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(c):e.success,d=typeof e.description=="function"?await e.description(c):e.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(i=["reject",c],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(c):e.error,d=typeof e.description=="function"?await e.description(c):e.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;s&&(this.dismiss(n),n=void 0),(c=e.finally)==null||c.call(e)}),a=()=>new Promise((c,u)=>o.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||Rb++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ir=new _z,Ez=(t,e)=>{let n=(e==null?void 0:e.id)||Rb++;return ir.addToast({title:t,...e,id:n}),n},Tz=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Rz=Ez,Az=()=>ir.toasts,Oz=()=>ir.getActiveToasts(),bo=Object.assign(Rz,{success:ir.success,info:ir.info,warning:ir.warning,error:ir.error,custom:ir.custom,message:ir.message,promise:ir.promise,dismiss:ir.dismiss,loading:ir.loading},{getHistory:Az,getToasts:Oz});function Pz(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}Pz(`: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;
67left: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}
67: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%);
67--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%)} 68`);function Sf(t){return t.label!==void 0}var Mz=3,Iz="32px",Dz="16px",fC=4e3,Lz=356,$z=14,Bz=20,zz=200;function is(...t){return t.filter(Boolean).join(" ")}function Fz(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var Uz=t=>{var e,n,r,s,i,o,a,c,u,d,h;let{invert:p,toast:f,unstyled:g,interacting:m,setHeights:v,visibleToasts:x,heights:b,index:w,toasts:k,expanded:j,removeToast:E,defaultRichColors:N,closeButton:S,style:C,cancelButtonStyle:_,actionButtonStyle:R,className:O="",descriptionClassName:L="",duration:A,position:z,gap:F,loadingIcon:H,expandByDefault:I,classNames:T,icons:U,closeButtonAriaLabel:M="Close toast",pauseWhenPageIsHidden:$}=t,[B,G]=V.useState(null),[X,oe]=V.useState(null),[K,Z]=V.useState(!1),[ie,Q]=V.useState(!1),[Y,W]=V.useState(!1),[ce,de]=V.useState(!1),[xe,me]=V.useState(!1),[qe,Oe]=V.useState(0),[Ie,He]=V.useState(0),_t=V.useRef(f.duration||A||fC),Dt=V.useRef(null),Zt=V.useRef(null),kt=w===0,wn=w+1<=x,Je=f.type,st=f.dismissible!==!1,en=f.className||"",qn=f.descriptionClassName||"",kn=V.useMemo(()=>b.findIndex(ke=>ke.toastId===f.id)||0,[b,f.id]),Kt=V.useMemo(()=>{var ke;return(ke=f.closeButton)!=null?ke:S},[f.closeButton,S]),tn=V.useMemo(()=>f.duration||A||fC,[f.duration,A]),Dn=V.useRef(0),yr=V.useRef(0),Bi=V.useRef(0),rs=V.useRef(null),[fu,pl]=z.split("-"),aa=V.useMemo(()=>b.reduce((ke,De,Fe)=>Fe>=kn?ke:ke+De.height,0),[b,kn]),ml=Nz(),gl=f.invert||p,Et=Je==="loading";yr.current=V.useMemo(()=>kn*F+aa,[kn,aa]),V.useEffect(()=>{_t.current=tn},[tn]),V.useEffect(()=>{Z(!0)},[]),V.useEffect(()=>{let ke=Zt.current;if(ke){let De=ke.getBoundingClientRect().height;return He(De),v(Fe=>[{toastId:f.id,height:De,position:f.position},...Fe]),()=>v(Fe=>Fe.filter(Lt=>Lt.toastId!==f.id))}},[v,f.id]),V.useLayoutEffect(()=>{if(!K)return;let ke=Zt.current,De=ke.style.height;ke.style.height="auto";let Fe=ke.getBoundingClientRect().height;ke.style.height=De,He(Fe),v(Lt=>Lt.find(hn=>hn.toastId===f.id)?Lt.map(hn=>hn.toastId===f.id?{...hn,height:Fe}:hn):[{toastId:f.id,height:Fe,position:f.position},...Lt])},[K,f.title,f.description,v,f.id]);let yt=V.useCallback(()=>{Q(!0),Oe(yr.current),v(ke=>ke.filter(De=>De.toastId!==f.id)),setTimeout(()=>{E(f)},zz)},[f,E,v,yr]);V.useEffect(()=>{if(f.promise&&Je==="loading"||f.duration===1/0||f.type==="loading")return;let ke;return j||m||$&&ml?(()=>{if(Bi.current<Dn.current){let De=new Date().getTime()-Dn.current;_t.current=_t.current-De}
68Bi.current=new Date().getTime()})():_t.current!==1/0&&(Dn.current=new Date().getTime(),ke=setTimeout(()=>{var De;(De=f.onAutoClose)==null||De.call(f,f),yt()},_t.current)),()=>clearTimeout(ke)},[j,m,f,Je,$,ml,yt]),V.useEffect(()=>{f.delete&&yt()},[yt,f.delete]);function Sn(){var ke,De,Fe;return U!=null&&U.loading?V.createElement("div",{className:is(T==null?void 0:T.loader,(ke=f==null?void 0:f.classNames)==null?void 0:ke.loader,"sonner-loader"),"data-visible":Je==="loading"},U.loading):H?V.createElement("div",{className:is(T==null?void 0:T.loader,(De=f==null?void 0:f.classNames)==null?void 0:De.loader,"sonner-loader"),"data-visible":Je==="loading"},H):V.createElement(bz,{className:is(T==null?void 0:T.loader,(Fe=f==null?void 0:f.classNames)==null?void 0:Fe.loader),visible:Je==="loading"})}return V.createElement("li",{tabIndex:0,ref:Zt,className:is(O,en,T==null?void 0:T.toast,(e=f==null?void 0:f.classNames)==null?void 0:e.toast,T==null?void 0:T.default,T==null?void 0:T[Je],(n=f==null?void 0:f.classNames)==null?void 0:n[Je]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:N,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":K,"data-promise":!!f.promise,"data-swiped":xe,"data-removed":ie,"data-visible":wn,"data-y-position":fu,"data-x-position":pl,"data-index":w,"data-front":kt,"data-swiping":Y,"data-dismissible":st,"data-type":Je,"data-invert":gl,"data-swipe-out":ce,"data-swipe-direction":X,"data-expanded":!!(j||I&&K),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${ie?qe:yr.current}px`,"--initial-height":I?"auto":`${Ie}px`,...C,...f.style},onDragEnd:()=>{W(!1),G(null),rs.current=null},onPointerDown:ke=>{Et||!st||(Dt.current=new Date,Oe(yr.current),ke.target.setPointerCapture(ke.pointerId),ke.target.tagName!=="BUTTON"&&(W(!0),rs.current={x:ke.clientX,y:ke.clientY}))},onPointerUp:()=>{var ke,De,Fe,Lt;if(ce||!st)return;rs.current=null;let hn=Number(((ke=Zt.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ft=Number(((De=Zt.current)==null?void 0:De.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ln=new Date().getTime()-((Fe=Dt.current)==null?void 0:Fe.getTime()),$t=B==="x"?hn:ft,fn=Math.abs($t)/Ln;if(Math.abs($t)>=Bz||fn>.11){Oe(yr.current),(Lt=f.onDismiss)==null||Lt.call(f,f),oe(B==="x"?hn>0?"right":"left":ft>0?"down":"up"),yt(),de(!0),me(!1);return}W(!1),G(null)},onPointerMove:ke=>{var De,Fe,Lt,hn;if(!rs.current||!st||((De=window.getSelection())==null?void 0:De.toString().length)>0)return;let ft=ke.clientY-rs.current.y,Ln=ke.clientX-rs.current.x,$t=(Fe=t.swipeDirections)!=null?Fe:Fz(z);!B&&(Math.abs(Ln)>1||Math.abs(ft)>1)&&G(Math.abs(Ln)>Math.abs(ft)?"x":"y");let fn={x:0,y:0};B==="y"?($t.includes("top")||$t.includes("bottom"))&&($t.includes("top")&&ft<0||$t.includes("bottom")&&ft>0)&&(fn.y=ft):B==="x"&&($t.includes("left")||$t.includes("right"))&&($t.includes("left")&&Ln<0||$t.includes("right")&&Ln>0)&&(fn.x=Ln),(Math.abs(fn.x)>0||Math.abs(fn.y)>0)&&me(!0),(Lt=Zt.current)==null||Lt.style.setProperty("--swipe-amount-x",`${fn.x}px`),(hn=Zt.current)==null||hn.style.setProperty("--swipe-amount-y",`${fn.y}px`)}},Kt&&!f.jsx?V.createElement("button",{"aria-label":M,"data-disabled":Et,"data-close-button":!0,onClick:Et||!st?()=>{}:()=>{var ke;yt(),(ke=f.onDismiss)==null||ke.call(f,f)},className:is(T==null?void 0:T.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},(i=U==null?void 0:U.close)!=null?i:jz):null,f.jsx||y.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:V.createElement(V.Fragment,null,Je||f.icon||f.promise?V.createElement("div",{"data-icon":"",className:is(T==null?void 0:T.icon,(o=f==null?void 0:f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Sn():null,f.type!=="loading"?f.icon||(U==null?void 0:U[Je])||vz(Je):null):null,V.createElement("div",{"data-content":"",className:is(T==null?void 0:T.content,(a=f==null?void 0:f.classNames)==null?void 0:a.content)},V.createElement("div",{"data-title":"",className:is(T==null?void 0:T.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?V.createElement("div",{"data-description":"",className:is(L,qn,T==null?void 0:T.description,(u=f==null?void 0:f.classNames)==null?void 0:u.description)},typeof f.description=="function"?f.description():f.description):null),y.isValidElement(f.cancel)?f.cancel:f.cancel&&Sf(f.cancel)?V.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||_,onClick:ke=>{var De,Fe;Sf(f.cancel)&&st&&((Fe=(De=f.cancel).onClick)==null||Fe.call(De,ke),yt())},className:is(T==null?void 0:T.cancelButton,(d=f==null?void 0:f.classNames)==null?void 0:d.cancelButton)},f.cancel.label):null,y.isValidElement(f.action)?f.action:f.action&&Sf(f.action)?V.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||R,onClick:ke=>{var De,Fe;Sf(f.action)&&((Fe=(De=f.action).onClick)==null||Fe.call(De,ke),!ke.defaultPrevented&&yt())},className:is(T==null?void 0:T.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function pC(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Vz(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?Dz:Iz;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${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[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(a)}),n}var Hz=y.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:p,style:f,visibleToasts:g=Mz,toastOptions:m,dir:v=pC(),gap:x=$z,loadingIcon:b,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:j}=t,[E,N]=V.useState([]),S=V.useMemo(()=>Array.from(new Set([r].concat(E.filter($=>$.position).map($=>$.position)))),[E,r]),[C,_]=V.useState([]),[R,O]=V.useState(!1),[L,A]=V.useState(!1),[z,F]=V.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
68k":"light"),H=V.useRef(null),I=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=V.useRef(null),U=V.useRef(!1),M=V.useCallback($=>{N(B=>{var G;return(G=B.find(X=>X.id===$.id))!=null&&G.delete||ir.dismiss($.id),B.filter(({id:X})=>X!==$.id)})},[]);return V.useEffect(()=>ir.subscribe($=>{if($.dismiss){N(B=>B.map(G=>G.id===$.id?{...G,delete:!0}:G));return}setTimeout(()=>{K0.flushSync(()=>{N(B=>{let G=B.findIndex(X=>X.id===$.id);return G!==-1?[...B.slice(0,G),{...B[G],...$},...B.slice(G+1)]:[$,...B]})})})}),[]),V.useEffect(()=>{if(d!=="system"){F(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:B})=>{F(B?"dark":"light")})}catch{$.addListener(({matches:G})=>{try{F(G?"dark":"light")}catch(X){console.error(X)}})}},[d]),V.useEffect(()=>{E.length<=1&&O(!1)},[E]),V.useEffect(()=>{let $=B=>{var G,X;s.every(oe=>B[oe]||B.code===oe)&&(O(!0),(G=H.current)==null||G.focus()),B.code==="Escape"&&(document.activeElement===H.current||(X=H.current)!=null&&X.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),V.useEffect(()=>{if(H.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,U.current=!1)}},[H.current]),V.createElement("section",{ref:e,"aria-label":`${k} ${I}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map(($,B)=>{var G;let[X,oe]=$.split("-");return E.length?V.createElement("ol",{key:$,dir:v==="auto"?pC():v,tabIndex:-1,ref:H,className:a,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":X,"data-lifted":R&&E.length>1&&!i,"data-x-position":oe,style:{"--front-toast-height":`${((G=C[0])==null?void 0:G.height)||0}px`,"--width":`${Lz}px`,"--gap":`${x}px`,...f,...Vz(c,u)},onBlur:K=>{U.current&&!K.currentTarget.contains(K.relatedTarget)&&(U.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||U.current||(U.current=!0,T.current=K.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{L||O(!1)},onDragEnd:()=>O(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},E.filter(K=>!K.position&&B===0||K.position===$).map((K,Z)=>{var ie,Q;return V.createElement(Uz,{key:K.id,icons:w,index:Z,toast:K,defaultRichColors:h,duration:(ie=m==null?void 0:m.duration)!=null?ie:p,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:g,closeButton:(Q=m==null?void 0:m.closeButton)!=null?Q:o,interacting:L,position:$,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:M,toasts:E.filter(Y=>Y.position==K.position),heights:C.filter(Y=>Y.position==K.position),setHeights:_,expandByDefault:i,gap:x,loadingIcon:b,expanded:R,pauseWhenPageIsHidden:j,swipeDirections:t.swipeDirections})})):null}))});const Wz=({...t})=>{const{theme:e="system"}=yz();return l.jsx(Hz,{theme:e,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"}},...t})},qz=1,Kz=1e6;let yv=0;function Gz(){return yv=(yv+1)%Number.MAX_SAFE_INTEGER,yv.toString()}const vv=new Map,mC=t=>{if(vv.has(t))return;const e=setTimeout(()=>{vv.delete(t),cd({type:"REMOVE_TOAST",toastId:t})},Kz);vv.set(t,e)},Yz=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,qz)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;
68return n?mC(n):t.toasts.forEach(r=>{mC(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},pp=[];let mp={toasts:[]};function cd(t){mp=Yz(mp,t),pp.forEach(e=>{e(mp)})}function St({...t}){const e=Gz(),n=s=>cd({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>cd({type:"DISMISS_TOAST",toastId:e});return cd({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function ht(){const[t,e]=y.useState(mp);return y.useEffect(()=>(pp.push(e),()=>{const n=pp.indexOf(e);n>-1&&pp.splice(n,1)}),[t]),{...t,toast:St,dismiss:n=>cd({type:"DISMISS_TOAST",toastId:n})}}function Ce(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function gC(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function KR(...t){return e=>{let n=!1;const r=t.map(s=>{const i=gC(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():gC(t[s],null)}}}}function ot(...t){return y.useCallback(KR(...t),t)}function Jz(t,e){const n=y.createContext(e),r=i=>{const{children:o,...a}=i,c=y.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:o})};r.displayName=t+"Provider";function s(i){const o=y.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function Ns(t,e=[]){let n=[];function r(i,o){const a=y.createContext(o),c=n.length;n=[...n,o];const u=h=>{var x;const{scope:p,children:f,...g}=h,m=((x=p==null?void 0:p[t])==null?void 0:x[c])||a,v=y.useMemo(()=>g,Object.values(g));return l.jsx(m.Provider,{value:v,children:f})};u.displayName=i+"Provider";function d(h,p){var m;const f=((m=p==null?void 0:p[t])==null?void 0:m[c])||a,g=y.useContext(f);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,d]}const s=()=>{const i=n.map(o=>y.createContext(o));return function(a){const c=(a==null?void 0:a[t])||i;return y.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return s.scopeName=t,[r,Qz(s,...e)]}function Qz(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...a,...h}},{});return y.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Oc(t){const e=Xz(t),n=y.forwardRef((r,s)=>{const{children:i,...o}=r,a=y.Children.toArray(i),c=a.find(e5);if(c){const u=c.props.children,d=a.map(h=>h===c?y.Children.count(u)>1?y.Children.only(null):y.isValidElement(u)?u.props.children:null:h);return l.jsx(e,{...o,ref:s,children:y.isValidElement(u)?y.cloneElement(u,void 0,d):null})}return l.jsx(e,{...o,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var eu=Oc("Slot");function Xz(t){const e=y.forwardRef((n,r)=>{const{children:s,...i}=n;if(y.isValidElement(s)){const o=n5(s),a=t5(i,s.props);return s.type!==y.Fragment&&(a.ref=r?KR(r,o):o),y.cloneElement(s,a)}return y.Children.count(s)>1?y.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var GR=Symbol("radix.slottable");function Zz(t){const e=({children:n})=>l.jsx(l.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=GR,e}function e5(t){return y.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===GR}function t5(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function n5(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.
vendor: 8,979 bytes, line 68
68isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Z0(t){const e=t+"CollectionProvider",[n,r]=Ns(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:v,children:x}=m,b=V.useRef(null),w=V.useRef(new Map).current;return l.jsx(s,{scope:v,itemMap:w,collectionRef:b,children:x})};o.displayName=e;const a=t+"CollectionSlot",c=Oc(a),u=V.forwardRef((m,v)=>{const{scope:x,children:b}=m,w=i(a,x),k=ot(v,w.collectionRef);return l.jsx(c,{ref:k,children:b})});u.displayName=a;const d=t+"CollectionItemSlot",h="data-radix-collection-item",p=Oc(d),f=V.forwardRef((m,v)=>{const{scope:x,children:b,...w}=m,k=V.useRef(null),j=ot(v,k),E=i(d,x);return V.useEffect(()=>(E.itemMap.set(k,{ref:k,...w}),()=>void E.itemMap.delete(k))),l.jsx(p,{[h]:"",ref:j,children:b})});f.displayName=d;function g(m){const v=i(t+"CollectionConsumer",m);return V.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((E,N)=>w.indexOf(E.ref.current)-w.indexOf(N.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:u,ItemSlot:f},g,r]}var r5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=r5.reduce((t,e)=>{const n=Oc(`Primitive.${e}`),r=y.forwardRef((s,i)=>{const{asChild:o,...a}=s,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function YR(t,e){t&&Vr.flushSync(()=>t.dispatchEvent(e))}function Jr(t){const e=y.useRef(t);return y.useEffect(()=>{e.current=t}),y.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function s5(t,e=globalThis==null?void 0:globalThis.document){const n=Jr(t);y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var i5="DismissableLayer",Ab="dismissableLayer.update",o5="dismissableLayer.pointerDownOutside",a5="dismissableLayer.focusOutside",yC,JR=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fh=y.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=t,u=y.useContext(JR),[d,h]=y.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=y.useState({}),g=ot(e,N=>h(N)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(v),b=d?m.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,k=b>=x,j=c5(N=>{const S=N.target,C=[...u.branches].some(_=>_.contains(S));!k||C||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},p),E=u5(N=>{const S=N.target;[...u.branches].some(_=>_.contains(S))||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},p);return s5(N=>{b===u.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},p),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(yC=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),vC(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=yC)}},[d,p,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),vC())},[d,u]),y.useEffect(()=>{const N=()=>f({});return document.addEventListener(Ab,N),()=>document.removeEventListener(Ab,N)},[]),l.jsx(Ae.div,{...c,ref:g,style:{pointerEvents:w?k?"auto":"none":void 0,...t.style},onFocusCapture:Ce(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Ce(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ce(t.onPointerDownCapture,j.onPointerDownCapture)})});Fh.displayName=i5;var l5="DismissableLayerBranch",QR=y.forwardRef((t,e)=>{const n=y.useContext(JR),r=y.useRef(null),s=ot(e,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),l.jsx(Ae.div,{...t,ref:s})});QR.displayName=l5;function c5(t,e=globalThis==null?void 0:globalThis.document){const n=Jr(t),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){XR(o5,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function u5(t,e=globalThis==null?void 0:globalThis.document){const n=Jr(t),r=y.useRef(!1);return y.useEffect(()=>{const s=i=>{i.target&&!r.current&&XR(a5,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vC(){const t=new CustomEvent(Ab);document.dispatchEvent(t)}function XR(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?YR(s,i):s.dispatchEvent(i)}var d5=Fh,h5=QR,Mn=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},f5="Portal",Fg=y.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=y.useState(!1);Mn(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?K0.createPortal(l.jsx(Ae.div,{...r,ref:e}),o):null});Fg.displayName=f5;function p5(t,e){return y.useReducer((n,r)=>e[n][r]??n,t)}var ta=t=>{const{present:e,children:n}=t,r=m5(e),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=ot(r.ref,g5(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:i}):null};ta.displayName="Presence";function m5(t){const[e,n]=y.useState(),r=y.useRef(null),s=y.useRef(t),i=y.useRef("none"),o=t?"mounted":"unmounted",[a,c]=p5(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=Cf(r.current);i.current=a==="mounted"?u:"none"},[a]),Mn(()=>{const u=r.current,d=s.current;if(d!==t){const p=i.current,f=Cf(u);t?c("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),Mn(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,h=f=>{const m=Cf(r.current).includes(f.animationName);if(f.target===e&&m&&(c("ANIMATION_END"),!s.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},p=f=>{f.target===e&&(i.current=Cf(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:y.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Cf(t){return(t==null?void 0:t.animationName)||"none"}function g5(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var y5=n0[" useInsertionEffect ".trim().toString()]||Mn;function Ci({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,o]=v5({defaultProp:e,onChange:n}),a=t!==void 0,c=a?t:s;{const d=y.useRef(t!==void 0);y.useEffect(()=>{const h=d.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"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=a},[a,r])}const u=y.useCallback(d=>{var h;if(a){const p=x5(d)?d(t):d;p!==t&&((h=o.current)==null||h.call(o,p))}else i(d)},[a,t,i,o]);return[c,u]}function v5({defaultProp:t,onChange:e}){const[n,r]=y.useState(t),s=y.useRef(n),i=y.useRef(e);return y5(()=>{i.current=e},[e]),y.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function x5(t){return typeof t=="function"}var ZR=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"}),b5="VisuallyHidden",Ug=y.forwardRef((t,e)=>
68l.jsx(Ae.span,{...t,ref:e,style:{...ZR,...t.style}}));Ug.displayName=b5;var w5=Ug,ek="ToastProvider",[tk,k5,S5]=Z0("Toast"),[eA,Doe]=Ns("Toast",[S5]),[C5,Vg]=eA(ek),tA=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,c]=y.useState(null),[u,d]=y.useState(0),h=y.useRef(!1),p=y.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ek}\`. Expected non-empty \`string\`.`),l.jsx(tk.Provider,{scope:e,children:l.jsx(C5,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:c,onToastAdd:y.useCallback(()=>d(f=>f+1),[]),onToastRemove:y.useCallback(()=>d(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:o})})};tA.displayName=ek;var nA="ToastViewport",j5=["F8"],Ob="toast.viewportPause",Pb="toast.viewportResume",rA=y.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=j5,label:s="Notifications ({hotkey})",...i}=t,o=Vg(nA,n),a=k5(n),c=y.useRef(null),u=y.useRef(null),d=y.useRef(null),h=y.useRef(null),p=ot(e,h,o.onViewportChange),f=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;y.useEffect(()=>{const v=x=>{var w;r.length!==0&&r.every(k=>x[k]||x.code===k)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),y.useEffect(()=>{const v=c.current,x=h.current;if(g&&v&&x){const b=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(Ob);x.dispatchEvent(E),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(Pb);x.dispatchEvent(E),o.isClosePausedRef.current=!1}},k=E=>{!v.contains(E.relatedTarget)&&w()},j=()=>{v.contains(document.activeElement)||w()};return v.addEventListener("focusin",b),v.addEventListener("focusout",k),v.addEventListener("pointermove",b),v.addEventListener("pointerleave",j),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{v.removeEventListener("focusin",b),v.removeEventListener("focusout",k),v.removeEventListener("pointermove",b),v.removeEventListener("pointerleave",j),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[g,o.isClosePausedRef]);const m=y.useCallback(({tabbingDirection:v})=>{const b=a().map(w=>{const k=w.ref.current,j=[k,...$5(k)];return v==="forwards"?j:j.reverse()});return(v==="forwards"?b.reverse():b).flat()},[a]);return y.useEffect(()=>{const v=h.current;if(v){const x=b=>{var j,E,N;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const S=document.activeElement,C=b.shiftKey;if(b.target===v&&C){(j=u.current)==null||j.focus();return}const O=m({tabbingDirection:C?"backwards":"forwards"}),L=O.findIndex(A=>A===S);xv(O.slice(L+1))?b.preventDefault():C?(E=u.current)==null||E.focus():(N=d.current)==null||N.focus()}};return v.addEventListener("keydown",x),()=>v.removeEventListener("keydown",x)}},[a,m]),l.jsxs(h5,{ref:c,role:"region","aria-label":s.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&l.jsx(Mb,{ref:u,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"forwards"});xv(v)}}),l.jsx(tk.Slot,{scope:n,children:l.jsx(Ae.ol,{tabIndex:-1,...i,ref:p})}),g&&l.jsx(Mb,{ref:d,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"backwards"});xv(v)}})]})});rA.displayName=nA;var sA="ToastFocusProxy",Mb=y.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Vg(sA,n);return l.jsx(Ug,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});Mb.displayName=sA;var Uh="Toast",N5="toast.swipeStart",_5="toast.swipeMove",E5="toast.swipeCancel",T5="toast.swipeEnd",iA=y.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a,c]=Ci({prop:r,defaultProp:s??!0,onChange:i,caller:Uh});return l.jsx(ta,{present:n||a,children:l.jsx(O5,{open:a,...o,ref:e,onClose:()=>c(!1),onPause:Jr(t.onPause),onResume:Jr(t.onResume),onSwipeStart:Ce(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ce(t.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:Ce(t.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:Ce(t.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)})})})});iA.displayName=Uh;var[R5,A5]=eA(Uh,{onClose(){}}),O5=y.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:f,...g}=t,m=Vg(Uh,n),[v,x]=y.useState(null),b=ot(e,A=>x(A)),w=y.useRef(null),k=y.useRef(null),j=s||m.duration,E=y.useRef(0),N=y.useRef(j),S=y.useRef(0),{onToastAdd:C,onToastRemove:_}=m,R=Jr(()=>{var z;(v==null?void 0:v.contains(document.activeElement))&&((z=m.viewport)==null||z.focu
68s()),o()}),O=y.useCallback(A=>{!A||A===1/0||(window.clearTimeout(S.current),E.current=new Date().getTime(),S.current=window.setTimeout(R,A))},[R]);y.useEffect(()=>{const A=m.viewport;if(A){const z=()=>{O(N.current),u==null||u()},F=()=>{const H=new Date().getTime()-E.current;N.current=N.current-H,window.clearTimeout(S.current),c==null||c()};return A.addEventListener(Ob,F),A.addEventListener(Pb,z),()=>{A.removeEventListener(Ob,F),A.removeEventListener(Pb,z)}}},[m.viewport,j,c,u,O]),y.useEffect(()=>{i&&!m.isClosePausedRef.current&&O(j)},[i,j,m.isClosePausedRef,O]),y.useEffect(()=>(C(),()=>_()),[C,_]);const L=y.useMemo(()=>v?hA(v):null,[v]);return m.viewport?l.jsxs(l.Fragment,{children:[L&&l.jsx(P5,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),l.jsx(R5,{scope:n,onClose:R,children:Vr.createPortal(l.jsx(tk.ItemSlot,{scope:n,children:l.jsx(d5,{asChild:!0,onEscapeKeyDown:Ce(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||R(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(Ae.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...g,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ce(t.onKeyDown,A=>{A.key==="Escape"&&(a==null||a(A.nativeEvent),A.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,R()))}),onPointerDown:Ce(t.onPointerDown,A=>{A.button===0&&(w.current={x:A.clientX,y:A.clientY})}),onPointerMove:Ce(t.onPointerMove,A=>{if(!w.current)return;const z=A.clientX-w.current.x,F=A.clientY-w.current.y,H=!!k.current,I=["left","right"].includes(m.swipeDirection),T=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,U=I?T(0,z):0,M=I?0:T(0,F),$=A.pointerType==="touch"?10:2,B={x:U,y:M},G={originalEvent:A,delta:B};H?(k.current=B,jf(_5,h,G,{discrete:!1})):xC(B,m.swipeDirection,$)?(k.current=B,jf(N5,d,G,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(z)>$||Math.abs(F)>$)&&(w.current=null)}),onPointerUp:Ce(t.onPointerUp,A=>{const z=k.current,F=A.target;if(F.hasPointerCapture(A.pointerId)&&F.releasePointerCapture(A.pointerId),k.current=null,w.current=null,z){const H=A.currentTarget,I={originalEvent:A,delta:z};xC(z,m.swipeDirection,m.swipeThreshold)?jf(T5,f,I,{discrete:!0}):jf(E5,p,I,{discrete:!0}),H.addEventListener("click",T=>T.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),P5=t=>{const{__scopeToast:e,children:n,...r}=t,s=Vg(Uh,e),[i,o]=y.useState(!1),[a,c]=y.useState(!1);return D5(()=>o(!0)),y.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:l.jsx(Fg,{asChild:!0,children:l.jsx(Ug,{...r,children:i&&l.jsxs(l.Fragment,{children:[s.label," ",n]})})})},M5="ToastTitle",oA=y.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return l.jsx(Ae.div,{...r,ref:e})});oA.displayName=M5;var I5="ToastDescription",aA=y.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return l.jsx(Ae.div,{...r,ref:e})});aA.displayName=I5;var lA="ToastAction",cA=y.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?l.jsx(dA,{altText:n,asChild:!0,children:l.jsx(nk,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${lA}\`. Expected non-empty \`string\`.`),null)});cA.displayName=lA;var uA="ToastClose",nk=y.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=A5(uA,n);return l.jsx(dA,{asChild:!0,children:l.jsx(Ae.button,{type:"button",...r,ref:e,onClick:Ce(t.onClick,s.onClose)})})});nk.displayName=uA;var dA=y.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return l.jsx(Ae.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function hA(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),L5(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...hA(r))}}),e}function jf(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?YR(s,i):s.dispatchEvent(i)}var xC=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function D5(t=()=>{}){const e=Jr(t);Mn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function L5(t){return t.nodeType===t.ELEMENT_NODE}function $5(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function xv(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var B5=tA,fA=rA,pA=iA,mA=oA,gA=aA,yA=cA,vA=nk;function xA(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=xA(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function bA(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=xA(t))&&(r&&(r+=" "),r+=e);return r}const bC=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,wC=bA,tu=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return wC(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const p=bC(d)||bC(h);return s[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[h,p]=d;
vendor: 8,815 bytes, lines 68-193
68return p===void 0||(u[h]=p),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:p,...f}=d;return Object.entries(f).every(g=>{let[m,v]=g;return Array.isArray(v)?v.includes({...i,...a}[m]):{...i,...a}[m]===v})?[...u,h,p]:u},[]);return wC(t,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** 69 * @license lucide-react v0.462.0 - ISC 70 * 71 * This source code is licensed under the ISC license. 72 * See the LICENSE file in the root directory of this source tree. 73 */const z5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wA=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** 74 * @license lucide-react v0.462.0 - ISC 75 * 76 * This source code is licensed under the ISC license. 77 * See the LICENSE file in the root directory of this source tree. 78 */var F5={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"};/** 79 * @license lucide-react v0.462.0 - ISC 80 * 81 * This source code is licensed under the ISC license. 82 * See the LICENSE file in the root directory of this source tree. 83 */const U5=y.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>y.createElement("svg",{ref:c,...F5,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:wA("lucide",s),...a},[...o.map(([u,d])=>y.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** 84 * @license lucide-react v0.462.0 - ISC 85 * 86 * This source code is licensed under the ISC license. 87 * See the LICENSE file in the root directory of this source tree. 88 */const we=(t,e)=>{const n=y.forwardRef(({className:r,...s},i)=>y.createElement(U5,{ref:i,iconNode:e,className:wA(`lucide-${z5(t)}`,r),...s}));return n.displayName=`${t}`,n};/** 89 * @license lucide-react v0.462.0 - ISC 90 * 91 * This source code is licensed under the ISC license. 92 * See the LICENSE file in the root directory of this source tree. 93 */const ei=we("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 94 * @license lucide-react v0.462.0 - ISC 95 * 96 * This source code is licensed under the ISC license. 97 * See the LICENSE file in the root directory of this source tree. 98 */const qs=we("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 99 * @license lucide-react v0.462.0 - ISC 100 * 101 * This source code is licensed under the ISC license. 102 * See the LICENSE file in the root directory of this source tree. 103 */const V5=we("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"}]]);/** 104 * @license lucide-react v0.462.0 - ISC 105 * 106 * This source code is licensed under the ISC license. 107 * See the LICENSE file in the root directory of this source tree. 108 */const rk=we("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 109 * @license lucide-react v0.462.0 - ISC 110 * 111 * This source code is licensed under the ISC license. 112 * See the LICENSE file in the root directory of this source tree. 113 */const Vh=we("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"}]]);/** 114 * @license lucide-react v0.462.0 - ISC 115 * 116 * This source code is licensed under the ISC license. 117 * See the LICENSE file in the root directory of this source tree. 118 */const kA=we("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 119 * @license lucide-react v0.462.0 - ISC 120 * 121 * This source code is licensed under the ISC license. 122 * See the LICENSE file in the root directory of this source tree. 123 */const Hg=we("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 124 * @license lucide-react v0.462.0 - ISC 125 * 126 * This source code is licensed under the ISC license. 127 * See the LICENSE file in the root directory of this source tree. 128 */const SA=we("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 129 * @license lucide-react v0.462.0 - ISC 130 * 131 * This source code is licensed under the ISC license. 132 * See the LICENSE file in the root directory of this source tree. 133 */const Wg=we("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 134 * @license lucide-react v0.462.0 - ISC 135 * 136 * This source code is licensed under the ISC license. 137 * See the LICENSE file in the root directory of this source tree. 138 */const H5=we("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 139 * @license lucide-react v0.462.0 - ISC 140 * 141 * This source code is licensed under the ISC license. 142 * See the LICENSE file in the root directory of this source tree. 143 */const W5=we("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"}]]);/** 144 * @license lucide-react v0.462.0 - ISC 145 * 146 * This source code is licensed under the ISC license. 147 * See the LICENSE file in the root directory of this source tree. 148 */const Qd=we("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 149 * @license lucide-react v0.462.0 - ISC 150 * 151 * This source code is licensed under the ISC license. 152 * See the LICENSE file in the root directory of this source tree. 153 */const q5=we("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"}]]);/** 154 * @license lucide-react v0.462.0 - ISC 155 * 156 * This source code is licensed under the ISC license. 157 * See the LICENSE file in the root directory of this source tree. 158 */const K5=we("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 159 * @license lucide-react v0.462.0 - ISC 160 * 161 * This source code is licensed under the ISC license. 162 * See the LICENSE file in the root directory of this source tree. 163 */const Pc=we("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"}]]);/** 164 * @license lucide-react v0.462.0 - ISC 165 * 166 * This source code is licensed under the ISC license. 167 * See the LICENSE file in the root directory of this source tree. 168 */const sk=we("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"}]]);/** 169 * @license lucide-react v0.462.0 - ISC 170 * 171 * This source code is licensed under the ISC license. 172 * See the LICENSE file in the root directory of this source tree. 173 */const ul=we("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"}]]);/** 174 * @license lucide-react v0.462.0 - ISC 175 * 176 * This source code is licensed under the ISC license. 177 * See the LICENSE file in the root directory of this source tree. 178 */const rm=we("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"}]]);/** 179 * @license lucide-react v0.462.0 - ISC 180 * 181 * This source code is licensed under the ISC license. 182 * See the LICENSE file in the root directory of this source tree. 183 */const G5=we("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** 184 * @license lucide-react v0.462.0 - ISC 185 * 186 * This source code is licensed under the ISC license. 187 * See the LICENSE file in the root directory of this source tree. 188 */const Y5=we("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"}]]);/** 189 * @license lucide-react v0.462.0 - ISC 190 * 191 * This source code is licensed under the ISC license. 192 * See the LICENSE file in the root directory of this source tree. 193 */const J5=we("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"}
193]]);/** 194 * @license lucide-react v0.462.0 - ISC 195 * 196 * This source code is licensed under the ISC license. 197 * See the LICENSE file in the root directory of this source tree. 198 */const CA=we("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"}]]);/** 199 * @license lucide-react v0.462.0 - ISC 200 * 201 * This source code is licensed under the ISC license. 202 * See the LICENSE file in the root directory of this source tree. 203 */const jA=we("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"}]]);/** 204 * @license lucide-react v0.462.0 - ISC 205 * 206 * This source code is licensed under the ISC license. 207 * See the LICENSE file in the root directory of this source tree. 208 */const NA=we("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** 209 * @license lucide-react v0.462.0 - ISC 210 * 211 * This source code is licensed under the ISC license. 212 * See the LICENSE file in the root directory of this source tree. 213 */const _A=we("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"}]]);/** 214 * @license lucide-react v0.462.0 - ISC 215 * 216 * This source code is licensed under the ISC license. 217 * See the LICENSE file in the root directory of this source tree. 218 */const Q5=we("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"}]]);/** 219 * @license lucide-react v0.462.0 - ISC 220 * 221 * This source code is licensed under the ISC license. 222 * See the LICENSE file in the root directory of this source tree. 223 */const X5=we("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 224 * @license lucide-react v0.462.0 - ISC 225 * 226 * This source code is licensed under the ISC license. 227 * See the LICENSE file in the root directory of this source tree. 228 */const Z5=we("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"}]]);/** 229 * @license lucide-react v0.462.0 - ISC 230 * 231 * This source code is licensed under the ISC license. 232 * See the LICENSE file in the root directory of this source tree. 233 */const EA=we("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"}]]);/** 234 * @license lucide-react v0.462.0 - ISC 235 * 236 * This source code is licensed under the ISC license. 237 * See the LICENSE file in the root directory of this source tree. 238 */const eF=we("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"}]]);/** 239 * @license lucide-react v0.462.0 - ISC 240 * 241 * This source code is licensed under the ISC license. 242 * See the LICENSE file in the root directory of this source tree. 243 */const tF=we("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"}]]);/** 244 * @license lucide-react v0.462.0 - ISC 245 * 246 * This source code is licensed under the ISC license. 247 * See the LICENSE file in the root directory of this source tree. 248 */const qt=we("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 249 * @license lucide-react v0.462.0 - ISC 250 * 251 * This source code is licensed under the ISC license. 252 * See the LICENSE file in the root directory of this source tree.
253 */const ik=we("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"}]]);/** 254 * @license lucide-react v0.462.0 - ISC 255 * 256 * This source code is licensed under the ISC license. 257 * See the LICENSE file in the root directory of this source tree. 258 */const TA=we("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"}]]);/** 259 * @license lucide-react v0.462.0 - ISC 260 * 261 * This source code is licensed under the ISC license. 262 * See the LICENSE file in the root directory of this source tree. 263 */const nF=we("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"}]]);/** 264 * @license lucide-react v0.462.0 - ISC 265 * 266 * This source code is licensed under the ISC license. 267 * See the LICENSE file in the root directory of this source tree. 268 */const RA=we("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"}]]);/** 269 * @license lucide-react v0.462.0 - ISC 270 * 271 * This source code is licensed under the ISC license. 272 * See the LICENSE file in the root directory of this source tree. 273 */const rF=we("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"}]]);/** 274 * @license lucide-react v0.462.0 - ISC 275 * 276 * This source code is licensed under the ISC license. 277 * See the LICENSE file in the root directory of this source tree. 278 */const sF=we("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"}]]);/** 279 * @license lucide-react v0.462.0 - ISC 280 * 281 * This source code is licensed under the ISC license. 282 * See the LICENSE file in the root directory of this source tree. 283 */const iF=we("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** 284 * @license lucide-react v0.462.0 - ISC 285 * 286 * This source code is licensed under the ISC license. 287 * See the LICENSE file in the root directory of this source tree. 288 */const oF=we("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** 289 * @license lucide-react v0.462.0 - ISC 290 * 291 * This source code is licensed under the ISC license. 292 * See the LICENSE file in the root directory of this source tree. 293 */const sm=we("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"}]]);/** 294 * @license lucide-react v0.462.0 - ISC 295 * 296 * This source code is licensed under the ISC license. 297 * See the LICENSE file in the root directory of this source tree. 298 */const aF=we("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"}]]);/** 299 * @license lucide-react v0.462.0 - ISC 300 * 301 * This source code is licensed under the ISC license. 302 * See the LICENSE file in the root directory of this source tree. 303 */const AA=we("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 304 * @license lucide-react v0.462.0 - ISC 305 * 306 * This source code is licensed under the ISC license. 307 * See the LICENSE file in the root directory of this source tree. 308 */const Qr=we("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 309 * @license lucide-react v0.462.0 - ISC 310 * 311 * This source code is licensed under the ISC license. 312 * See the LICENSE file in the root directory of this source tree. 313 */const lF=we("Podcast",[["path",{d:"M16.85 18.58a9 9 0 1 0-9.7 0",key:"d71mpg"}],["path",{d:"M8 14a5 5 0 1 1 8 0",key:"fc81rn"}],["circle",{cx:"12",cy:"11",r:"1",key:"1gvufo"}],["path",{d:"M13 17a1 1 0 1 0-2 0l.5 4.5a.5.5 0 1 0 1 0Z",key:"za5kbj"}]]);/** 314 * @license lucide-react v0.462.0 - ISC 315 * 316 * This source code is licensed under the ISC license. 317 * See the LICENSE file in the root directory of this source tree. 318 */const OA=we("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"}]]);/** 319 * @license lucide-react v0.462.0 - ISC 320 * 321 * This source code is licensed under the ISC license. 322 * See the LICENSE file in the root directory of this source tree. 323 */const qg=we("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"}]]);/** 324 * @license lucide-react v0.462.0 - ISC 325 * 326 * This source code is licensed under the ISC license. 327 * See the LICENSE file in the root directory of this source tree. 328 */const PA=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 329 * @license lucide-react v0.462.0 - ISC 330 * 331 * This source code is licensed under the ISC license. 332 * See the LICENSE file in the root directory of this source tree. 333 */const cF=we("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"}]]);/** 334 * @license lucide-react v0.462.0 - ISC 335 * 336 * This source code is licensed under the ISC license. 337 * See the LICENSE file in the root directory of this source tree. 338 */const uF=we("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"}]]);/** 339 * @license lucide-react v0.462.0 - ISC 340 * 341 * This source code is licensed under the ISC license. 342 * See the LICENSE file in the root directory of this source tree. 343 */const ok=we("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 344 * @license lucide-react v0.462.0 - ISC 345 * 346 * This source code is licensed under the ISC license. 347 * See the LICENSE file in the root directory of this source tree.
vendor: 7,674 bytes, lines 348-368
348 */const dF=we("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"}]]);/** 349 * @license lucide-react v0.462.0 - ISC 350 * 351 * This source code is licensed under the ISC license. 352 * See the LICENSE file in the root directory of this source tree. 353 */const ks=we("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"}]]);/** 354 * @license lucide-react v0.462.0 - ISC 355 * 356 * This source code is licensed under the ISC license. 357 * See the LICENSE file in the root directory of this source tree. 358 */const Kg=we("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"}]]);/** 359 * @license lucide-react v0.462.0 - ISC 360 * 361 * This source code is licensed under the ISC license. 362 * See the LICENSE file in the root directory of this source tree. 363 */const ak=we("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"}]]);/** 364 * @license lucide-react v0.462.0 - ISC 365 * 366 * This source code is licensed under the ISC license. 367 * See the LICENSE file in the root directory of this source tree. 368 */const nu=we("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),lk="-",hF=t=>{const e=pF(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(lk);return a[0]===""&&a.length!==1&&a.shift(),MA(a,e)||fF(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},MA=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?MA(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(lk);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},kC=/^\[(.+)\]$/,fF=t=>{if(kC.test(t)){const e=kC.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},pF=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return gF(Object.entries(t.classGroups),n).forEach(([i,o])=>{Ib(o,r,i,e)}),r},Ib=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:SC(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(mF(s)){Ib(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Ib(o,SC(e,i),n,r)})})},SC=(t,e)=>{let n=t;return e.split(lk).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},mF=t=>t.isThemeGetter,gF=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[n,s]}):t,yF=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},IA="!",vF=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const c=[];let u=0,d=0,h;for(let v=0;v<a.length;v++){let x=a[v];if(u===0){if(x===s&&(r||a.slice(v,v+i)===e)){c.push(a.slice(d,v)),d=v+i;continue}if(x==="/"){h=v;continue}}x==="["?u++:x==="]"&&u--}const p=c.length===0?a:a.substring(d),f=p.startsWith(IA),g=f?p.substring(1):p,m=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:g,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:o}):o},xF=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},bF=t=>({cache:yF(t.cacheSize),parseClassName:vF(t),...hF(t)}),wF=/\s+/,kF=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(wF);let a="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:f}=n(u);let g=!!f,m=r(g?p.substring(0,f):p);if(!m){if(!g){a=u+(a.length>0?" "+a:a);continue}if(m=r(p),!m){a=u+(a.length>0?" "+a:a);continue}g=!1}const v=xF(d).join(":"),x=h?v+IA:v,b=x+m;if(i.includes(b))continue;i.push(b);const w=s(m,g);for(let k=0;k<w.length;++k){const j=w[k];i.push(x+j)}a=u+(a.length>0?" "+a:a)}return a};function SF(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=DA(e))&&(r&&(r+=" "),r+=n);return r}const DA=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=DA(t[r]))&&(n&&(n+=" "),n+=e);return n};function CF(t,...e){let n,r,s,i=o;function o(c){const u=e.reduce((d,h)=>h(d),t());return n=bF(u),r=n.cache.get,s=n.cache.set,i=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=kF(c,n);return s(c,d),d}return function(){return i(SF.apply(null,arguments))}}const vt=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},LA=/^\[(?:([a-z-]+):)?(.+)\]$/i,jF=/^\d+\/\d+$/,NF=new Set(["px","full","screen"]),_F=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,EF=/\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$/,TF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,RF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ni=t=>sc(t)||NF.has(t)||jF.test(t),Ui=t=>ru(t,"length",BF),sc=t=>!!t&&!Number.isNaN(Number(t)),bv=t=>ru(t,"number",sc),ju=t=>!!t&&Number.isInteger(Number(t)),OF=t=>t.endsWith("%")&&sc(t.slice(0,-1)),ze=t=>LA.test(t),Vi=t=>_F.test(t),PF=new Set(["length","size","percentage"]),MF=t=>ru(t,PF,$A),IF=t=>ru(t,"position",$A),DF=new Set(["image","url"]),LF=t=>ru(t,DF,FF),$F=t=>ru(t,"",zF),Nu=()=>!0,ru=(t,e,n)=>{const r=LA.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},BF=t=>EF.test(t)&&!TF.test(t),$A=()=>!1,zF=t=>RF.test(t),FF=t=>AF.test(t),UF=()=>{const t=vt("colors"),e=vt("spacing"),n=vt("blur"),r=vt("brightness"),s=vt("borderColor"),i=vt("borderRadius"),o=vt("borderSpacing"),a=vt("borderWidth"),c=vt("contrast"),u=vt("grayscale"),d=vt("hueRotate"),h=vt("invert"),p=vt("gap"),f=vt("gradientColorStops"),g=vt("gradientColorStopPositions"),m=vt("inset"),v=vt("margin"),x=vt("opacity"),b=vt("padding"),w=vt("saturate"),k=vt("scale"),j=vt("sepia"),E=vt("skew"),N=vt("space"),S=vt("translate"),C=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ze,e],O=()=>[ze,e],L=()=>["",ni,Ui],A=()=>["auto",sc,ze],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],T=()=>["","0",ze],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[sc,ze];return{cacheSize:500,separator:":",theme:{colors:[Nu],spacing:[ni,Ui],blur:["none","",Vi,ze],brightness:M(),borderColor:[t],borderRadius:["n
368one","","full",Vi,ze],borderSpacing:O(),borderWidth:L(),contrast:M(),grayscale:T(),hueRotate:M(),invert:T(),gap:O(),gradientColorStops:[t],gradientColorStopPositions:[OF,Ui],inset:R(),margin:R(),opacity:M(),padding:O(),saturate:M(),scale:M(),sepia:T(),skew:M(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[Vi]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:[...z(),ze]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],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",ju,ze]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",ju,ze]}],"grid-cols":[{"grid-cols":[Nu]}],"col-start-end":[{col:["auto",{span:["full",ju,ze]},ze]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Nu]}],"row-start-end":[{row:["auto",{span:[ju,ze]},ze]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,e]}],"min-w":[{"min-w":[ze,e,"min","max","fit"]}],"max-w":[{"max-w":[ze,e,"none","full","min","max","fit","prose",{screen:[Vi]},Vi]}],h:[{h:[ze,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Vi,Ui]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bv]}],"font-family":[{font:[Nu]}],"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",ze]}],"line-clamp":[{"line-clamp":["none",sc,bv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ni,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ni,Ui]}],"underline-offset":[{"underline-offset":["auto",ni,ze]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],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",ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),IF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",MF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},LF]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}
vendor: 4,885 bytes, line 368
368],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:F()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[ni,ze]}],"outline-w":[{outline:[ni,Ui]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[ni,Ui]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Vi,$F]}],"shadow-color":[{shadow:[Nu]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Vi,ze]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"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":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ze]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[ju,ze]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],accent:[{accent:["auto",t]}],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",ze]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}
vendor: 4,226 bytes, line 368
368],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",ze]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ni,Ui,bv]}],stroke:[{stroke:[t,"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"]}}},VF=CF(UF);function se(...t){return VF(bA(t))}const HF=B5,BA=y.forwardRef(({className:t,...e},n)=>l.jsx(fA,{ref:n,className:se("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]",t),...e}));BA.displayName=fA.displayName;const WF=tu("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"}}),zA=y.forwardRef(({className:t,variant:e,...n},r)=>l.jsx(pA,{ref:r,className:se(WF({variant:e}),t),...n}));zA.displayName=pA.displayName;const qF=y.forwardRef(({className:t,...e},n)=>
vendor: 4,261 bytes, line 368
368l.jsx(yA,{ref:n,className:se("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",t),...e}));qF.displayName=yA.displayName;const FA=y.forwardRef(({className:t,...e},n)=>l.jsx(vA,{ref:n,className:se("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",t),"toast-close":"",...e,children:l.jsx(nu,{className:"h-4 w-4"})}));FA.displayName=vA.displayName;const UA=y.forwardRef(({className:t,...e},n)=>l.jsx(mA,{ref:n,className:se("text-sm font-semibold",t),...e}));UA.displayName=mA.displayName;const VA=y.forwardRef(({className:t,...e},n)=>l.jsx(gA,{ref:n,className:se("text-sm opacity-90",t),...e}));VA.displayName=gA.displayName;function KF(){const{toasts:t}=ht();return l.jsxs(HF,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return l.jsxs(zA,{...i,children:[l.jsxs("div",{className:"grid gap-1",children:[n&&l.jsx(UA,{children:n}),r&&l.jsx(VA,{children:r})]}),s,l.jsx(FA,{})]},e)}),l.jsx(BA,{})]})}var GF=n0[" useId ".trim().toString()]||(()=>{}),YF=0;function vi(t){const[e,n]=y.useState(GF());return Mn(()=>{t||n(r=>r??String(YF++))},[t]),t||(e?`radix-${e}`:"")}const JF=["top","right","bottom","left"],Ho=Math.min,br=Math.max,im=Math.round,Nf=Math.floor,Ks=t=>({x:t,y:t}),QF={left:"right",right:"left",bottom:"top",top:"bottom"},XF={start:"end",end:"start"};function Db(t,e,n){return br(t,Ho(e,n))}function ji(t,e){return typeof t=="function"?t(e):t}function Ni(t){return t.split("-")[0]}function su(t){return t.split("-")[1]}function ck(t){return t==="x"?"y":"x"}function uk(t){return t==="y"?"height":"width"}const ZF=new Set(["top","bottom"]);function Vs(t){return ZF.has(Ni(t))?"y":"x"}function dk(t){return ck(Vs(t))}function eU(t,e,n){n===void 0&&(n=!1);const r=su(t),s=dk(t),i=uk(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=om(o)),[o,om(o)]}function tU(t){const e=om(t);return[Lb(t),e,Lb(e)]}function Lb(t){return t.replace(/start|end/g,e=>XF[e])}const CC=["left","right"],jC=["right","left"],nU=["top","bottom"],rU=["bottom","top"];function sU(t,e,n){switch(t){case"top":case"bottom":return n?e?jC:CC:e?CC:jC;case"left":case"right":return e?nU:rU;default:return[]}}function iU(t,e,n,r){const s=su(t);let i=sU(Ni(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Lb)))),i}function om(t){return t.replace(/left|right|bottom|top/g,e=>QF[e])}function oU(t){return{top:0,right:0,bottom:0,left:0,...t}}function HA(t){return typeof t!="number"?oU(t):{top:t,right:t,bottom:t,left:t}}function am(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function NC(t,e,n){let{reference:r,floating:s}=t;const i=Vs(e),o=dk(e),a=uk(o),c=Ni(e),u=i==="y",d=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,p=r[a]/2-s[a]/2;let f;switch(c){case"top":f={x:d,y:r.y-s.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-s.width,y:h};break;default:f={x:r.x,y:r.y}}switch(su(e)){case"start":f[o]-=p*(n&&u?-1:1);break;case"end":f[o]+=p*(n&&u?-1:1);break}return f}const aU=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=NC(u,r,c),p=r,f={},g=0;for(let m=0;m<a.length;m++){const{name:v,fn:x}=a[m],{x:b,y:w,data:k,reset:j}=await x({x:d,y:h,initialPlacement:r,placement:p,strategy:s,middlewareData:f,re
vendor: 10,342 bytes, line 368
368cts:u,platform:o,elements:{reference:t,floating:e}});d=b??d,h=w??h,f={...f,[v]:{...f[v],...k}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(p=j.placement),j.rects&&(u=j.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):j.rects),{x:d,y:h}=NC(u,p,c)),m=-1)}return{x:d,y:h,placement:p,strategy:s,middlewareData:f}};async function Xd(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=ji(e,t),g=HA(f),v=a[p?h==="floating"?"reference":"floating":h],x=am(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),b=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),k=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},j=am(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:c}):b);return{top:(x.top-j.top+g.top)/k.y,bottom:(j.bottom-x.bottom+g.bottom)/k.y,left:(x.left-j.left+g.left)/k.x,right:(j.right-x.right+g.right)/k.x}}const lU=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=e,{element:u,padding:d=0}=ji(t,e)||{};if(u==null)return{};const h=HA(d),p={x:n,y:r},f=dk(s),g=uk(f),m=await o.getDimensions(u),v=f==="y",x=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",k=i.reference[g]+i.reference[f]-p[f]-i.floating[g],j=p[f]-i.reference[f],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let N=E?E[w]:0;(!N||!await(o.isElement==null?void 0:o.isElement(E)))&&(N=a.floating[w]||i.floating[g]);const S=k/2-j/2,C=N/2-m[g]/2-1,_=Ho(h[x],C),R=Ho(h[b],C),O=_,L=N-m[g]-R,A=N/2-m[g]/2+S,z=Db(O,A,L),F=!c.arrow&&su(s)!=null&&A!==z&&i.reference[g]/2-(A<O?_:R)-m[g]/2<0,H=F?A<O?A-O:A-L:0;return{[f]:p[f]+H,data:{[f]:z,centerOffset:A-z-H,...F&&{alignmentOffset:H}},reset:F}}}),cU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...v}=ji(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Ni(s),b=Vs(a),w=Ni(a)===a,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=p||(w||!m?[om(a)]:tU(a)),E=g!=="none";!p&&E&&j.push(...iU(a,m,g,k));const N=[a,...j],S=await Xd(e,v),C=[];let _=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&C.push(S[x]),h){const A=eU(s,o,k);C.push(S[A[0]],S[A[1]])}if(_=[..._,{placement:s,overflows:C}],!C.every(A=>A<=0)){var R,O;const A=(((R=i.flip)==null?void 0:R.index)||0)+1,z=N[A];if(z&&(!(h==="alignment"?b!==Vs(z):!1)||_.every(I=>I.overflows[0]>0&&Vs(I.placement)===b)))return{data:{index:A,overflows:_},reset:{placement:z}};let F=(O=_.filter(H=>H.overflows[0]<=0).sort((H,I)=>H.overflows[1]-I.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(f){case"bestFit":{var L;const H=(L=_.filter(I=>{if(E){const T=Vs(I.placement);return T===b||T==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(T=>T>0).reduce((T,U)=>T+U,0)]).sort((I,T)=>I[1]-T[1])[0])==null?void 0:L[0];H&&(F=H);break}case"initialPlacement":F=a;break}if(s!==F)return{reset:{placement:F}}}return{}}}};function _C(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function EC(t){return JF.some(e=>t[e]>=0)}const uU=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=ji(t,e);switch(r){case"referenceHidden":{const i=await Xd(e,{...s,elementContext:"reference"}),o=_C(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:EC(o)}}}case"escaped":{const i=await Xd(e,{...s,altBoundary:!0}),o=_C(i,n.floating);return{data:{escapedOffsets:o,escaped:EC(o)}}}default:return{}}}}},WA=new Set(["left","top"]);async function dU(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Ni(n),a=su(n),c=Vs(n)==="y",u=WA.has(o)?-1:1,d=i&&c?-1:1,h=ji(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(f=a==="end"?g*-1:g),c?{x:f*d,y:p*u}:{x:p*u,y:f*d}}const hU=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=e,c=await dU(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},fU=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x,y:b}=v;return{x,y:b}}},...c}=ji(t,e),u={x:n,y:r},d=await Xd(e,c),h=Vs(Ni(s)),p=ck(h);let f=u[p],g=u[h];if(i){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",b=f+d[v],w=f-d[x];f=Db(b,f,w)}if(o){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",b=g+d[v],w=g-d[x];g=Db(b,g,w)}const m=a.fn({...e,[p]:f,[h]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[h]:o}}}}}},pU=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=ji(t,e),d={x:n,y:r},h=Vs(s),p=ck(h);let f=d[p],g=d[h];const m=ji(a,e),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const w=p==="y"?"height":"width",k=i.reference[p]-i.floating[w]+v.mainAxis,j=i.reference[p]+i.reference[w]-v.mainAxis;f<k?f=k:f>j&&(f=j)}if(u){var x,b;const w=p==="y"?"width":"height",k=WA.has(Ni(s)),j=i.reference[h]-i.floating[w]+(k&&((x=o.offset)==null?void 0:x[h])||0)+(k?0:v.crossAxis),E=i.reference[h]+i.reference[w]+(k?0:((b=o.offset)==null?void 0:b[h])||0)-(k?v.crossAxis:0);g<j?g=j:g>E&&(g=E)}return{[p]:f,[h]:g}}}},mU=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:c=()=>{},...u}=ji(t,e),d=await Xd(e,u),h=Ni(s),p=su(s),f=Vs(s)==="y",{width:g,height:m}=i.floating;let v,x;h==="top"||h==="bottom"?(v=h,x=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(x=h,v=p==="end"?"top":"bottom");const b=m-d.top-d.bottom,w=g-d.left-d.right,k=Ho(m-d[v],b),j=Ho(g-d[x],w),E=!e.middlewareData.shift;let N=k,S=j;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(S=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(N=b),E&&!p){const _=br(d.left,0),R=br(d.right,0),O=br(d.top,0),L=br(d.bottom,0);f?S=g-2*(_!==0||R!==0?_+R:br(d.left,d.right)):N=m-2*(O!==0||L!==0?O+L:br(d.top,d.bottom))}await c({...e,availableWidth:S,availableHeight:N});const C=await o.getDimensions(a.floating);return g!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}};function Gg(){return typeof window<"u"}function iu(t){return qA(t)?(t.nodeName||"").toLowerCase():"#document"}function jr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ti(t){var e;return(e=(qA(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qA(t){return Gg()?t instanceof Node||t instanceof jr(t).Node:!1}function Ss(t){return Gg()?t instanceof Element||t instanceof jr(t).Element:!1}function Ys(t){return Gg()?t instanceof HTMLElement||t instanceof jr(t).HTMLElement:!1}function TC(t){return!Gg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof jr(t).ShadowRoot}const gU=new Set(["inline","contents"]);function Hh(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Cs(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!gU.has(s)}const yU=new Set(["table","td","th"]);function vU(t){return yU.has(iu(t))}const xU=[":popover-open",":modal"];function Yg(t){return xU.some(e=>{try{return t.matches(e)}catch{return!1}})}const bU=["transform","translate","scale","rotate","perspective"],wU=["transform","translate","scale","rotate","perspective","filter"],kU=["paint","layout","strict","content"];function hk(t){const e=fk(),n=Ss(t)?Cs(t):t;return bU.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||wU.some(r=>(n.willChange||"").includes(r))||kU.some(r=>(n.contain||"").includes(r))}function SU(t){let e=Wo(t);for(;Ys(e)&&!Mc(e);){if(hk(e))return e;if(Yg(e))return null;e=Wo(e)}return null}function fk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const CU=new Set(["html","body","#document"]);function Mc(t){return CU.has(iu(t))}function Cs(t){return jr(t).getComputedStyle(t)}function Jg(t){return Ss(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Wo(t){if(iu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||TC(t)&&t.host||ti(t);return TC(e)?e.host:e}function KA(t){const e=Wo(t);return Mc(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ys(e)&&Hh(e)?e:KA(e)}function Zd(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=KA(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=jr(s);if(i){const a=$b(o);return e.concat(o,o.visualViewport||[],Hh(s)?s:[],a&&n?Zd(a):[])}return e.concat(s,Zd(s,[],n))}function $b(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function GA(t){const e=Cs(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Ys(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=im(n)!==i||im(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function pk(t){return Ss(t)?t:t.contextElement}function ic(t){const e=pk(t);if(!Ys(e))return Ks(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=GA(e);let o=(i?im(n.width):n.width)/r,a=(i?im(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const jU=Ks(0);function YA(t){const e=jr(t);
vendor: 4,678 bytes, line 368
368return!fk()||!e.visualViewport?jU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function NU(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==jr(t)?!1:e}function Ya(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=pk(t);let o=Ks(1);e&&(r?Ss(r)&&(o=ic(r)):o=ic(t));const a=NU(i,n,r)?YA(i):Ks(0);let c=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,d=s.width/o.x,h=s.height/o.y;if(i){const p=jr(i),f=r&&Ss(r)?jr(r):r;let g=p,m=$b(g);for(;m&&r&&f!==g;){const v=ic(m),x=m.getBoundingClientRect(),b=Cs(m),w=x.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,k=x.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,h*=v.y,c+=w,u+=k,g=jr(m),m=$b(g)}}return am({width:d,height:h,x:c,y:u})}function mk(t,e){const n=Jg(t).scrollLeft;return e?e.left+n:Ya(ti(t)).left+n}function JA(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=r.left+e.scrollLeft-(n?0:mk(t,r)),i=r.top+e.scrollTop;return{x:s,y:i}}function _U(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=ti(r),a=e?Yg(e.floating):!1;if(r===o||a&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ks(1);const d=Ks(0),h=Ys(r);if((h||!h&&!i)&&((iu(r)!=="body"||Hh(o))&&(c=Jg(r)),Ys(r))){const f=Ya(r);u=ic(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const p=o&&!h&&!i?JA(o,c,!0):Ks(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-c.scrollTop*u.y+d.y+p.y}}function EU(t){return Array.from(t.getClientRects())}function TU(t){const e=ti(t),n=Jg(t),r=t.ownerDocument.body,s=br(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=br(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+mk(t);const a=-n.scrollTop;return Cs(r).direction==="rtl"&&(o+=br(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function RU(t,e){const n=jr(t),r=ti(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const u=fk();(!u||u&&e==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}const AU=new Set(["absolute","fixed"]);function OU(t,e){const n=Ya(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Ys(t)?ic(t):Ks(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:o,height:a,x:c,y:u}}function RC(t,e,n){let r;if(e==="viewport")r=RU(t,n);else if(e==="document")r=TU(ti(t));else if(Ss(e))r=OU(e,n);else{const s=YA(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return am(r)}function QA(t,e){const n=Wo(t);return n===e||!Ss(n)||Mc(n)?!1:Cs(n).position==="fixed"||QA(n,e)}function PU(t,e){const n=e.get(t);if(n)return n;let r=Zd(t,[],!1).filter(a=>Ss(a)&&iu(a)!=="body"),s=null;const i=Cs(t).position==="fixed";let o=i?Wo(t):t;for(;Ss(o)&&!Mc(o);){const a=Cs(o),c=hk(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&AU.has(s.position)||Hh(o)&&!c&&QA(t,o))?r=r.filter(d=>d!==o):s=a,o=Wo(o)}return e.set(t,r),r}function MU(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Yg(e)?[]:PU(e,this._c):[].concat(n),r],a=o[0],c=o.reduce((u,d)=>{const h=RC(e,d,s);return u.top=br(h.top,u.top),u.right=Ho(h.right,u.right),u.bottom=Ho(h.bottom,u.bottom),u.left=br(h.left,u.left),u},RC(e,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function IU(t){const{width:e,height:n}=GA(t);return{width:e,height:n}}function DU(t,e,n){const r=Ys(e),s=ti(e),i=n==="fixed",o=Ya(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const c=Ks(0);function u(){c.x=mk(s)}if(r||!r&&!i)if((iu(e)!=="body"||Hh(s))&&(a=Jg(e)),r){const f=Ya(e,!0,i,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else s&&u();i&&!r&&s&&u();const d=s&&!r&&!i?JA(s,a):Ks(0),h=o.left+a.scrollLeft-c.x-d.x,p=o.top+a.scrollTop-c.y-d.y;return{x:h,y:p,width:o.width,height:o.height}}function wv(t){return Cs(t).position==="static"}function AC(t,e){if(!Ys(t)||Cs(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ti(t)===n&&(n=n.ownerDocument.body),n}function XA(t,e){const n=jr(t);if(Yg(t))return n;if(!Ys(t)){let s=Wo(t);for(;s&&!Mc(s);){if(Ss(s)&&!wv(s))return s;s=Wo(s)}return n}let r=AC(t,e);for(;r&&vU(r)&&wv(r);)r=AC(r,e);return r&&Mc(r)&&wv(r)&&!hk(r)?n:r||SU(t)||n}const LU=async function(t){const e=this.getOffsetParent||XA,n=this.getDimensions,r=await n(t.floating);return{reference:DU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $U(t){return Cs(t).direction==="rtl"}const BU={convertOffsetParentRelativeRectToViewportRelativeRect:_U,getDocumentElement:ti,getClippingRect:MU,getOffsetParent:XA,getElementRects:LU,getClientRects:EU,getDimensions:IU,get
vendor: 10,325 bytes, line 368
368Scale:ic,isElement:Ss,isRTL:$U};function ZA(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function zU(t,e){let n=null,r;const s=ti(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const u=t.getBoundingClientRect(),{left:d,top:h,width:p,height:f}=u;if(a||e(),!p||!f)return;const g=Nf(h),m=Nf(s.clientWidth-(d+p)),v=Nf(s.clientHeight-(h+f)),x=Nf(d),w={rootMargin:-g+"px "+-m+"px "+-v+"px "+-x+"px",threshold:br(0,Ho(1,c))||1};let k=!0;function j(E){const N=E[0].intersectionRatio;if(N!==c){if(!k)return o();N?o(!1,N):r=setTimeout(()=>{o(!1,1e-7)},1e3)}N===1&&!ZA(u,t.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(j,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,w)}n.observe(t)}return o(!0),i}function FU(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=pk(t),d=s||i?[...u?Zd(u):[],...Zd(e)]:[];d.forEach(x=>{s&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const h=u&&a?zU(u,n):null;let p=-1,f=null;o&&(f=new ResizeObserver(x=>{let[b]=x;b&&b.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(e)})),n()}),u&&!c&&f.observe(u),f.observe(e));let g,m=c?Ya(t):null;c&&v();function v(){const x=Ya(t);m&&!ZA(m,x)&&n(),m=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(b=>{s&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),h==null||h(),(x=f)==null||x.disconnect(),f=null,c&&cancelAnimationFrame(g)}}const UU=hU,VU=fU,HU=cU,WU=mU,qU=uU,OC=lU,KU=pU,GU=(t,e,n)=>{const r=new Map,s={platform:BU,...n},i={...s.platform,_c:r};return aU(t,e,{...s,platform:i})};var YU=typeof document<"u",JU=function(){},gp=YU?y.useLayoutEffect:JU;function lm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!lm(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!lm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function e2(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function PC(t,e){const n=e2(t);return Math.round(e*n)/n}function kv(t){const e=y.useRef(t);return gp(()=>{e.current=t}),e}function QU(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:u}=t,[d,h]=y.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,f]=y.useState(r);lm(p,r)||f(r);const[g,m]=y.useState(null),[v,x]=y.useState(null),b=y.useCallback(I=>{I!==E.current&&(E.current=I,m(I))},[]),w=y.useCallback(I=>{I!==N.current&&(N.current=I,x(I))},[]),k=i||g,j=o||v,E=y.useRef(null),N=y.useRef(null),S=y.useRef(d),C=c!=null,_=kv(c),R=kv(s),O=kv(u),L=y.useCallback(()=>{if(!E.current||!N.current)return;const I={placement:e,strategy:n,middleware:p};R.current&&(I.platform=R.current),GU(E.current,N.current,I).then(T=>{const U={...T,isPositioned:O.current!==!1};A.current&&!lm(S.current,U)&&(S.current=U,Vr.flushSync(()=>{h(U)}))})},[p,e,n,R,O]);gp(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,h(I=>({...I,isPositioned:!1})))},[u]);const A=y.useRef(!1);gp(()=>(A.current=!0,()=>{A.current=!1}),[]),gp(()=>{if(k&&(E.current=k),j&&(N.current=j),k&&j){if(_.current)return _.current(k,j,L);L()}},[k,j,L,_,C]);const z=y.useMemo(()=>({reference:E,floating:N,setReference:b,setFloating:w}),[b,w]),F=y.useMemo(()=>({reference:k,floating:j}),[k,j]),H=y.useMemo(()=>{const I={position:n,left:0,top:0};if(!F.floating)return I;const T=PC(F.floating,d.x),U=PC(F.floating,d.y);return a?{...I,transform:"translate("+T+"px, "+U+"px)",...e2(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:U}},[n,a,F.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:L,refs:z,elements:F,floatingStyles:H}),[d,L,z,F,H])}const XU=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?OC({element:r.current,padding:s}).fn(n):{}:r?OC({element:r,padding:s}).fn(n):{}}}},ZU=(t,e)=>({...UU(t),options:[t,e]}),e6=(t,e)=>({...VU(t),options:[t,e]}),t6=(t,e)=>({...KU(t),options:[t,e]}),n6=(t,e)=>({...HU(t),options:[t,e]}),r6=(t,e)=>({...WU(t),options:[t,e]}),s6=(t,e)=>({...qU(t),options:[t,e]}),i6=(t,e)=>({...XU(t),options:[t,e]});var o6="Arrow",t2=y.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return l.jsx(Ae.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});t2.displayName=o6;var a6=t2;function gk(t){const[e,n]=y.useState(void 0);return Mn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var yk="Popper",[n2,Qg]=Ns(yk),[l6,r2]=n2(yk),s2=t=>{const{__scopePopper:e,children:n}=t,[r,s]=y.useState(null);return l.jsx(l6,{scope:e,anchor:r,onAnchorChange:s,children:n})};s2.displayName=yk;var i2="PopperAnchor",o2=y.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=r2(i2,n),o=y.useRef(null),a=ot(e,o);return y.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:l.jsx(Ae.div,{...s,ref:a})});o2.displayName=i2;var vk="PopperContent",[c6,u6]=n2(vk),a2=y.forwardRef((t,e)=>{var K,Z,ie,Q,Y,W;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:g,...m}=t,v=r2(vk,n),[x,b]=y.useState(null),w=ot(e,ce=>b(ce)),[k,j]=y.useState(null),E=gk(k),N=(E==null?void 0:E.width)??0,S=(E==null?void 0:E.height)??0,C=r+(i!=="center"?"-"+i:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},R=Array.isArray(u)?u:[u],O=R.length>0,L={padding:_,boundary:R.filter(h6),altBoundary:O},{refs:A,floatingStyles:z,placement:F,isPositioned:H,middlewareData:I}=QU({strategy:"fixed",placement:C,whileElementsMounted:(...ce)=>FU(...ce,{animationFrame:f==="always"}),elements:{reference:v.anchor},middleware:[ZU({mainAxis:s+S,alignmentAxis:o}),c&&e6({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?t6():void 0,...L}),c&&n6({...L}),r6({...L,apply:({elements:ce,rects:de,availableWidth:xe,availableHeight:me})=>{const{width:qe,height:Oe}=de.reference,Ie=ce.floating.style;Ie.setProperty("--radix-popper-available-width",`${xe}px`),Ie.setProperty("--radix-popper-available-height",`${me}px`),Ie.setProperty("--radix-popper-anchor-width",`${qe}px`),Ie.setProperty("--radix-popper-anchor-height",`${Oe}px`)}}),k&&i6({element:k,padding:a}),f6({arrowWidth:N,arrowHeight:S}),p&&s6({strategy:"referenceHidden",...L})]}),[T,U]=u2(F),M=Jr(g);Mn(()=>{H&&(M==null||M())},[H,M]);const $=(K=I.arrow)==null?void 0:K.x,B=(Z=I.arrow)==null?void 0:Z.y,G=((ie=I.arrow)==null?void 0:ie.centerOffset)!==0,[X,oe]=y.useState();return Mn(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:H?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(Q=I.transformOrigin)==null?void 0:Q.x,(Y=I.transformOrigin)==null?void 0:Y.y].join(" "),...((W=I.hide)==null?void 0:W.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(c6,{scope:n,placedSide:T,onArrowChange:j,arrowX:$,arrowY:B,shouldHideArrow:G,children:l.jsx(Ae.div,{"data-side":T,"data-align":U,...m,ref:w,style:{...m.style,animation:H?void 0:"none"}})})})});a2.displayName=vk;var l2="PopperArrow",d6={top:"bottom",right:"left",bottom:"top",left:"right"},c2=y.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=u6(l2,r),o=d6[i.placedSide];return l.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:l.jsx(a6,{...s,ref:n,style:{...s.style,display:"block"}})})});c2.displayName=l2;function h6(t){return t!==null}var f6=t=>({name:"transformOrigin",options:t,fn(e){var v,x,b;const{placement:n,rects:r,middlewareData:s}=e,o=((v=s.arrow)==null?void 0:v.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[u,d]=u2(n),h={start:"0%",center:"50%",end:"100%"}[d],p=(((x=s.arrow)==null?void 0:x.x)??0)+a/2,f=(((b=s.arrow)==null?void 0:b.y)??0)+c/2;let g="",m="";return u==="bottom"?(g=o?h:`${p}px`,m=`${-c}px`):u==="top"?(g=o?h:`${p}px`,m=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,m=o?h:`${f}px`):u==="left"&&(g=`${r.floating.width+c}px`,m=o?h:`${f}px`),{data:{x:g,y:m}}}});function u2(t){const[e,n="center"]=t.split("-");return[e,n]}var d2=s2,h2=o2,f2=a2,p2=c2,[Xg,Loe]=Ns("Tooltip",[Qg]),Zg=Qg(),m2="TooltipProvider",p6=700,Bb="tooltip.open",[m6,xk]=Xg(m2),g2=t=>{const{__scopeTooltip:e,delayDuration:n=p6,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=y.useRef(!0),a=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(m6,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 6,735 bytes, line 368
368o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:y.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};g2.displayName=m2;var eh="Tooltip",[g6,ey]=Xg(eh),y2=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=t,c=xk(eh,t.__scopeTooltip),u=Zg(e),[d,h]=y.useState(null),p=vi(),f=y.useRef(0),g=o??c.disableHoverableContent,m=a??c.delayDuration,v=y.useRef(!1),[x,b]=Ci({prop:r,defaultProp:s??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(Bb))):c.onClose(),i==null||i(N)},caller:eh}),w=y.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),k=y.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v.current=!1,b(!0)},[b]),j=y.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),E=y.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{v.current=!0,b(!0),f.current=0},m)},[m,b]);return y.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),l.jsx(d2,{...u,children:l.jsx(g6,{scope:e,contentId:p,open:x,stateAttribute:w,trigger:d,onTriggerChange:h,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayedRef.current?E():k()},[c.isOpenDelayedRef,E,k]),onTriggerLeave:y.useCallback(()=>{g?j():(window.clearTimeout(f.current),f.current=0)},[j,g]),onOpen:k,onClose:j,disableHoverableContent:g,children:n})})};y2.displayName=eh;var zb="TooltipTrigger",v2=y.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=ey(zb,n),i=xk(zb,n),o=Zg(n),a=y.useRef(null),c=ot(e,a,s.onTriggerChange),u=y.useRef(!1),d=y.useRef(!1),h=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(h2,{asChild:!0,...o,children:l.jsx(Ae.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Ce(t.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ce(t.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Ce(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ce(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Ce(t.onBlur,s.onClose),onClick:Ce(t.onClick,s.onClose)})})});v2.displayName=zb;var y6="TooltipPortal",[$oe,v6]=Xg(y6,{forceMount:void 0}),Ic="TooltipContent",x2=y.forwardRef((t,e)=>{const n=v6(Ic,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=ey(Ic,t.__scopeTooltip);return l.jsx(ta,{present:r||o.open,children:o.disableHoverableContent?l.jsx(b2,{side:s,...i,ref:e}):l.jsx(x6,{side:s,...i,ref:e})})}),x6=y.forwardRef((t,e)=>{const n=ey(Ic,t.__scopeTooltip),r=xk(Ic,t.__scopeTooltip),s=y.useRef(null),i=ot(e,s),[o,a]=y.useState(null),{trigger:c,onClose:u}=n,d=s.current,{onPointerInTransitChange:h}=r,p=y.useCallback(()=>{a(null),h(!1)},[h]),f=y.useCallback((g,m)=>{const v=g.currentTarget,x={x:g.clientX,y:g.clientY},b=C6(x,v.getBoundingClientRect()),w=j6(x,b),k=N6(m.getBoundingClientRect()),j=E6([...w,...k]);a(j),h(!0)},[h]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(c&&d){const g=v=>f(v,d),m=v=>f(v,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",m)}}},[c,d,f,p]),y.useEffect(()=>{if(o){const g=m=>{const v=m.target,x={x:m.clientX,y:m.clientY},b=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),w=!_6(x,o);b?p():w&&(p(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,o,u,p]),l.jsx(b2,{...t,ref:i})}),[b6,w6]=Xg(eh,{isInside:!1}),k6=Zz("TooltipContent"),b2=y.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,c=ey(Ic,n),u=Zg(n),{onClose:d}=c;return y.useEffect(()=>(document.addEventListener(Bb,d),()=>document.removeEventListener(Bb,d)),[d]),y.useEffect(()=>{if(c.trigger){const h=p=>{const f=p.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(Fh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:l.jsxs(f2,{"data-state":c.stateAttribute,...u,...a,ref:e,style:{...a.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(k6,{children:r}),l.jsx(b6,{scope:n,isInside:!0,children:l.jsx(w5,{id:c.contentId,role:"tooltip",children:s||r})})]})})});x2.displayName=Ic;var w2="TooltipArrow",S6=y.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Zg(n);return w6(w2,n).isInside?null:l.jsx(p2,{...s,...r,ref:e})});S6.displayName=w2;function C6(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function j6(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function N6(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function _6(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i],c=e[o],u=a.x,d=a.y,h=c.x,p=c.y;d>r!=p>r&&n<(h-u)*(r-d)/(p-d)+u&&(s=!s)}return s}function E6(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),T6(e)}function T6(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var R6=g2,A6=y2,O6=v2,k2=x2;const S2=R6,P6=A6,M6=O6,C2=y.forwardRef(({className:t,sideOffset:e=4,...n},r)=>
368l.jsx(k2,{ref:r,sideOffset:e,className:se("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",t),...n}));C2.displayName=k2.displayName;function I6(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})}const D6=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class bk extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class L6 extends bk{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class MC extends bk{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class IC extends bk{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Fb;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Fb||(Fb={}));class $6{constructor(e,{headers:n={},customFetch:r,region:s=Fb.Any}={}){this.url=e,this.headers=n,this.region=s,this.fetch=D6(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return I6(this,arguments,void 0,function*(n,r={}){var s;let i,o;try{const{headers:a,method:c,body:u,signal:d,timeout:h}=r;let p={},{region:f}=r;f||(f=this.region);const g=new URL(`${this.url}/${n}`);f&&f!=="any"&&(p["x-region"]=f,g.searchParams.set("forceFunctionRegion",f));let m;u&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",m=u):typeof u=="string"?(p["Content-Type"]="text/plain",m=u):typeof FormData<"u"&&u instanceof FormData?m=u:(p["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 v=d;h&&(o=new AbortController,i=setTimeout(()=>o.abort(),h),d?(v=o.signal,d.addEventListener("abort",()=>o.abort())):v=o.signal);const x=yield this.fetch(g.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),a),body:m,signal:v}).catch(j=>{throw new L6(j)}),b=x.headers.get("x-relay-error");if(b&&b==="true")throw new MC(x);if(!x.ok)throw new IC(x);let w=((s=x.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),k;return w==="application/json"?k=yield x.json():w==="application/octet-stream"||w==="application/pdf"?k=yield x.blob():w==="text/event-stream"?k=x:w==="multipart/form-data"?k=yield x.formData():k=yield x.text(),{data:k,error:null,response:x}}catch(a){return{data:null,error:a,response:a instanceof IC||a instanceof MC?a.context:void 0}}finally{i&&clearTimeout(i)}})}}var B6=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
368de=t.code}},z6=class{constructor(t){var e,n,r;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(r=t.urlLengthLimit)!==null&&r!==void 0?r:8e3,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}then(t,e){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 s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{let o=null,a=null,c=null,u=i.status,d=i.statusText;if(i.ok){var h,p;if(n.method!=="HEAD"){var f;const v=await i.text();v===""||(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"))?a=v:a=JSON.parse(v))}const g=(h=n.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),m=(p=i.headers.get("content-range"))===null||p===void 0?void 0:p.split("/");g&&m&&m.length>1&&(c=parseInt(m[1])),n.isMaybeSingle&&Array.isArray(a)&&(a.length>1?(o={code:"PGRST116",details:`Results contain ${a.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},a=null,c=null,u=406,d="Not Acceptable"):a.length===1?a=a[0]:a=null)}else{const g=await i.text();try{o=JSON.parse(g),Array.isArray(o)&&i.status===404&&(a=[],o=null,u=200,d="OK")}catch{i.status===404&&g===""?(u=204,d="No Content"):o={message:g}}if(o&&n.shouldThrowOnError)throw new B6(o)}return{error:o,data:a,count:c,status:u,statusText:d}});return this.shouldThrowOnError||(s=s.catch(i=>{var o;let a="",c="",u="";const d=i==null?void 0:i.cause;if(d){var h,p,f,g;const x=(h=d==null?void 0:d.message)!==null&&h!==void 0?h:"",b=(p=d==null?void 0:d.code)!==null&&p!==void 0?p:"";a=`${(f=i==null?void 0:i.name)!==null&&f!==void 0?f:"FetchError"}: ${i==null?void 0:i.message}`,a+=` 369 370Caused by: ${(g=d==null?void 0:d.name)!==null&&g!==void 0?g:"Error"}: ${x}`,b&&(a+=` (${b})`),d!=null&&d.stack&&(a+=` 371${d.stack}`)}else{var m;a=(m=i==null?void 0:i.stack)!==null&&m!==void 0?m:""}const v=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${v} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(c+=`. Your request URL is ${v} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:a,hint:c,code:u},data:null,count:null,status:0,statusText:""}})),s.then(t,e)}returns(){return this}overrideTypes(){return this}},F6=class extends z6{select(t){let e=!1;const n=(t??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(i,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
371explain({analyze:t=!1,verbose:e=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:i="text"}={}){var o;const a=[t?"analyze":null,e?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const DC=new RegExp("[,()]");var Al=class extends F6{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&DC.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&DC.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`not.in.(${n})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const i=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${s}fts${i}.${e}`),this}match(t){return Object.entries(t).filter(([e,n])=>n!==void 0).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},U6=class{constructor(t,{headers:e={},schema:n,fetch:r,urlLengthLimit:s=8e3}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r,this.urlLengthLimit=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:n=!1,count:r}=e??{},s=n?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:a,headers:c}=this.cloneRequestState();return a.searchParams.set("select",o),r&&c.append("Prefer",`count=${r}`),new Al({method:s,url:a,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),n||o.append("Prefer","missing=default"),Array.isArray(t)){const a=t.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(a.length>
3710){const c=[...new Set(a)].map(u=>`"${u}"`);i.searchParams.set("columns",c.join(","))}}return new Al({method:s,url:i,headers:o,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var i;const o="POST",{url:a,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),r&&c.append("Prefer",`count=${r}`),s||c.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);a.searchParams.set("columns",d.join(","))}}return new Al({method:o,url:a,headers:c,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit})}update(t,{count:e}={}){var n;const r="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Al({method:r,url:s,headers:i,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Al({method:n,url:r,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit})}};function th(t){"@babel/helpers - typeof";return th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},th(t)}function V6(t,e){if(th(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(th(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function H6(t){var e=V6(t,"string");return th(e)=="symbol"?e:e+""}function W6(t,e,n){return(e=H6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function _f(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?LC(Object(n),!0).forEach(function(r){W6(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):LC(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var q6=class j2{constructor(e,{headers:n={},schema:r,fetch:s,timeout:i,urlLengthLimit:o=8e3}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=o;const a=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(c,u)=>{const d=new AbortController,h=setTimeout(()=>d.abort(),i),p=u==null?void 0:u.signal;if(p){if(p.aborted)return clearTimeout(h),a(c,u);const f=()=>{clearTimeout(h),d.abort()};return p.addEventListener("abort",f,{once:!0}),a(c,_f(_f({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(h),p.removeEventListener("abort",f)})}return a(c,_f(_f({},u),{},{signal:d.signal})).finally(()=>clearTimeout(h))}:this.fetch=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new U6(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(e){return new j2(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(e,n={},{head:r=!1,get:s=!1,count:i}={}){var o;let a;const c=new URL(`${this.url}/rpc/${e}`);let u;const d=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(d)),h=r&&Object.values(n).some(d);h?(a="POST",u=n):r||s?(a=r?"HEAD":"GET",Object.entries(n).filter(([f,g])=>g!==void 0).map(([f,g])=>[f,Array.isArray(g)?`{${g.join(",")}}`:`${g}
371`]).forEach(([f,g])=>{c.searchParams.append(f,g)})):(a="POST",u=n);const p=new Headers(this.headers);return h?p.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&p.set("Prefer",`count=${i}`),new Al({method:a,url:c,headers:p,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit})}};class K6{constructor(){}static detectEnvironment(){var e;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"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.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 s=r.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 372import ws from "ws" 373new 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 e=this.detectEnvironment();if(e.constructor)return e.constructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=` 374 375Suggested solution: ${e.workaround}`),new Error(n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const G6="2.100.1",Y6=`realtime-js/${G6}`,J6="1.0.0",N2="2.0.0",Q6=N2,X6=1e4,Z6=100,so={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},_2={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},Ub={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class eV{constructor(e){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=e??[]}encode(e,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;const s=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var n,r;const s=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(e,n,r){var s,i;const o=e.topic,a=(s=e.ref)!==null&&s!==void 0?s:"",c=(i=e.join_ref)!==null&&i!==void 0?i:"",u=e.payload.event,d=this.allowedMetadataKeys?this._pick(e.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(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.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 p=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+a.length+o.length+u.length+h.length,f=new ArrayBuffer(this.HEADER_LENGTH+p);let g=new DataView(f),m=0;g.setUint8(m++,this.KINDS.userBroadcastPush),g.setUint8(m++,c.length),g.setUint8(m++,a.length),g.setUint8(m++,o.length),g.setUint8(m++,u.length),g.setUint8(m++,h.length),g.setUint8(m++,n),Array.from(c,x=>g.setUint8(m++,x.charCodeAt(0))),Array.from(a,x=>g.setUint8(m++,x.charCodeAt(0))),Array.from(o,x=>g.setUint8(m++,x.charCodeAt(0))),Array.from(u,x=>g.setUint8(m++,x.charCodeAt(0))),Array.from(h,x=>g.setUint8(m++,x.charCodeAt(0)));var v=new Uint8Array(f.byteLength+r.byteLength);return v.set(new Uint8Array(f),0),v.set(new Uint8Array(r),f.byteLength),v.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[s,i,o,a,c]=r;
375return n({join_ref:s,ref:i,topic:o,event:a,payload:c})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,s)}}_decodeUserBroadcast(e,n,r){const s=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),a=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(e.slice(c,c+s));c=c+s;const d=r.decode(e.slice(c,c+i));c=c+i;const h=r.decode(e.slice(c,c+o));c=c+o;const p=e.slice(c,e.byteLength),f=a===this.JSON_ENCODING?JSON.parse(r.decode(p)):p,g={type:this.BROADCAST_EVENT,event:d,payload:f};return o>0&&(g.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}var pt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(pt||(pt={}));const $C=(t,e,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((i,o)=>(i[o]=tV(o,t,e,s),i),{}):{}},tV=(t,e,n,r)=>{const s=e.find(a=>a.name===t),i=s==null?void 0:s.type,o=n[t];return i&&!r.includes(i)?E2(i,o):Vb(o)},E2=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return iV(e,n)}switch(t){case pt.bool:return nV(e);case pt.float4:case pt.float8:case pt.int2:case pt.int4:case pt.int8:case pt.numeric:case pt.oid:return rV(e);case pt.json:case pt.jsonb:return sV(e);case pt.timestamp:return oV(e);case pt.abstime:case pt.date:case pt.daterange:case pt.int4range:case pt.int8range:case pt.money:case pt.reltime:case pt.text:case pt.time:case pt.timestamptz:case pt.timetz:case pt.tsrange:case pt.tstzrange:return Vb(e);default:return Vb(e)}},Vb=t=>t,nV=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},rV=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},sV=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},iV=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let i;const o=t.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>E2(e,a))}return t},oV=t=>typeof t=="string"?t.replace(" ","T"):t,T2=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var ud=t=>typeof t=="function"?t:function(){return t},aV=typeof self<"u"?self:null,Ol=typeof window<"u"?window:null,Is=aV||Ol||globalThis,lV="2.0.0",cV=1e4,uV=1e3,Bs={connecting:0,open:1,closing:2,closed:3},rr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},ci={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Hb={longpoll:"longpoll",websocket:"websocket"},dV={complete:4},Wb="base64url.bearer.phx.",Ef=class{constructor(t,e,n,r){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),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()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}
vendor: 20,330 bytes, lines 375-376
375matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},R2=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},hV=class{constructor(t,e,n){this.state=rr.closed,this.topic=t,this.params=ud(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Ef(this,ci.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new R2(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=rr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=rr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=rr.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=rr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Ef(this,ci.leave,ud({}),this.timeout).send(),this.state=rr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(ci.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=rr.closed,this.bindings=[]}onClose(t){this.on(ci.close,t)}onError(t){return this.on(ci.error,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(typeof e>"u"||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Ef(this,t,function(){return e},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=rr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ci.close,"leave")},n=new Ef(this,ci.leave,ud({}),t);return n.receive("ok",()=>e()).receive("timeout",()=>e()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(t,e,n){return e}filterBindings(t,e,n){return!0}isMember(t,e,n,r){return this.topic!==t?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=rr.joining,this.joinPush.resend(t))}trigger(t,e,n,r){let s=this.onMessage(t,e,n,r);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===t&&this.filterBindings(o,e,n));for(let o=0;o<i.length;o++)i[o].callback(s,n,r||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===rr.closed}isErrored(){return this.state===rr.errored}isJoined(){return this.state===rr.joined}isJoining(){return this.state===rr.joining}isLeaving(){return this.state===rr.leaving}},cm=class{static request(t,e,n,r,s,i,o){if(Is.XDomainRequest){let a=new Is.XDomainRequest;return this.xdomainRequest(a,t,e,r,s,i,o)}else if(Is.XMLHttpRequest){let a=new Is.XMLHttpRequest;return this.xhrRequest(a,t,e,n,r,s,i,o)}else{if(Is.fetch&&Is.AbortController)return this.fetchRequest(t,e,n,r,s,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,n,r,s,i,o){let a={method:t,headers:n,body:r},c=null;return s&&(c=new AbortController,setTimeout(()=>c.abort(),s),a.signal=c.signal),Is.fetch(e,a).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),c}static xdomainRequest(t,e,n,r,s,i,o){return t.timeout=s,t.open(e,n),t.onload=()=>{let a=this.parseJSON(t.responseText);o&&o(a)},i&&(t.ontimeout=i),t.onprogress=()=>{},t.send(r),t}static xhrRequest(t,e,n,r,s,i,o,a){t.open(e,n,!0),t.timeout=i;for(let[c,u]of Object.entries(r))t.setRequestHeader(c,u);return t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===dV.complete&&a){let c=this.parseJSON(t.responseText);a(c)}},o&&(t.ontimeout=o),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let s=e?`${e}[${r}]`:r,i=t[r];typeof i=="object"?n.push(this.serialize(i,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},fV=t=>{let e="",n=new Uint8Array(t),r=n.byteLength;for(let s=0;s<r;s++)e+=String.fromCharCode(n[s]);return btoa(e)},vl=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Wb)&&(this.authToken=atob(e[1].slice(Wb.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=Bs.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Hb.websocket),"$1/"+Hb.longpoll)}endpointURL(){return cm.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=Bs.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Bs.open||this.readyState===Bs.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:n,token:r,messages:s}=e;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Bs.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(t){typeof t!="string"&&(t=fV(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(` 376`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,n){for(let s of this.reqs)s.abort();this.readyState=Bs.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(t,e,n,r,s){let i,o=()=>{this.reqs.delete(i),r()};i=cm.request(t,this.endpointURL(),e,n,this.timeout,o,a=>{this.reqs.delete(i),this.isActive()&&s(a)}),this.reqs.add(i)}},pV=class Hu{constructor(e,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Hu.syncState(this.state,s,i,o),this.pendingDiffs.forEach(c=>{this.state=Hu.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],a()}),this.channel.on(r.diff,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Hu.syncDiff(this.state,s,i,o),a())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Hu.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,n,r,s){let i=this.clone(e),o={},a={};return this.map(i,(c,u)=>{n[c]||(a[c]=u)}),this.map(n,(c,u)=>{let d=i[c];if(d){let h=u.metas.map(m=>m.phx_ref),p=d.metas.map(m=>m.phx_ref),f=u.metas.filter(m=>p.indexOf(m.phx_ref)<0),g=d.metas.filter(m=>h.indexOf(m.phx_ref)<0);f.length>0&&(o[c]=u,o[c].metas=f),g.length>0&&(a[c]=this.clone(d),a[c].metas=g)}else o[c]=u}),this.syncDiff(i,{joins:o,leaves:a},r,s)}static syncDiff(e,n,r,s){let{joins:i,leaves:o}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(i,(a,c)=>{let u=e[a];if(e[a]=this.clone(c),u){let d=e[a].metas.map(p=>p.phx_ref),h=u.metas.filter(p=>d.indexOf(p.phx_ref)<0);e[a].metas.unshift(...h)}r(a,u,c)}),this.map(o,(a,c)=>{let u=e[a];if(!u)return;let d=c.metas.map(h=>h.phx_ref);u.metas=u.metas.filter(h=>d.indexOf(h.phx_ref)<0),s(a,u,c),u.metas.length===0&&delete e[a]}),e}static list(e,n){return n||(n=function(r,s){return s}),this.map(e,(r,s)=>n(r,s))}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Tf={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,r,s,i,o]=JSON.parse(t);return e({join_ref:n,ref:r,topic:s,event:i,payload:o})}},binaryEncode(t){let{join_ref:e,ref:n,event:r,topic:s,payload:i}=t,o=this.META_LENGTH+e.length+n.length+s.length+r.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(a),u=0;c.setUint8(u++,this.KINDS.push),c.setUint8(u++,e.length),c.setUint8(u++,n.length),c.setUint8(u++,s.length),c.setUint8(u++,r.length),Array.from(e,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(n,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(s,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(r,h=>c.setUint8(u++,h.charCodeAt(0)));var d=new Uint8Array(a.byteLength+i.byteLength);return d.set(new Uint8Array(a),0),d.set(new Uint8Array(i),a.byteLength),d.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,r);case this.KINDS.reply:return this.decodeReply(t,e,r);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,r)}},decodePush(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(t.slice(o,o+r));o=o+r;let c=n.decode(t.slice(o,o+s));o=o+s;let u=n.decode(t.slice(o,o+i));o=o+i;let d=t.slice(o,t.byteLength);return{join_ref:a,ref:null,topic:c,event:u,payload:d}},decodeReply(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),o=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(t.slice(a,a+r));a=a+r;let u=n.decode(t.slice(a,a+s));a=a+s;let d=n.decode(t.slice(a,a+i));a=a+i;let h=n.decode(t.slice(a,a+o));a=a+o;let p=t.slice(a,t.byteLength),f={status:h,response:p};return{join_ref:c,ref:u,topic:d,event:ci.reply,payload:f}},decodeBroadcast(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),i=this.HEADER_LENGTH+2,o=n.decode(t.slice(i,i+r));i=i+r;let a=n.decode(t.slice(i,i+s));i=i+s;let c=t.slice(i,t.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:c}}},mV=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||cV,this.transport=e.transport||Is.WebSocket||vl,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||Is&&Is.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Tf.encode.bind(Tf),this.defaultDecoder=Tf.decode.bind(Tf),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==vl?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Ol&&Ol.addEventListener&&(Ol.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Ol.addEventListener("pageshow",r=>{n===this.connectClock&&(n=null,this.connect())}),Ol.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=r=>e.rejoinAfterMs?e.rejoinAfterMs(r):[1e3,2e3,5e3][r-1]||1e4,this.reconnectAfterMs=r=>e.reconnectAfterMs?e.reconnectAfterMs(r):[10,50,100,150,200,250,500,1e3,2e3][r-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(r,s,i)=>{console.log(`${r}: ${s}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=ud(e.params||{}),this.endPoint=`${t}/${Hb.websocket}`,this.vsn=e.vsn||lV,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new R2(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return vl}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=cm.appendParams(cm.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,n)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=ud(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==vl?this.connectWithFallback(vl,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let r=this.onMessage(s=>{s.ref===e&&(this.off([r]),t(Date.now()-n))});return!0}transportName(t){switch(t){case vl:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Wb}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,s,i,o=this.transportName(t),a=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([s,i]),r=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return a("memorized");this.fallbackTimer=setTimeout(a,e),i=this.onError(c=>{this.log("transport","error",c),r&&!n&&(clearTimeout(this.fallbackTimer),a(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let c=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,e),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),uV,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();const r=this.conn;this.waitForBufferDone(r,()=>{e?r.close(e,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){}
vendor: 6,442 bytes, line 376
376,this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,n=1){if(n===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,n+1)},150*n)}waitForSocketClosed(t,e,n=1){if(n===5||t.readyState===Bs.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,n+1)},150*n)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",t,e,n),(e===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(ci.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Bs.connecting:return"connecting";case Bs.open:return"open";case Bs.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([n])=>t.indexOf(n)===-1)}channel(t,e={}){let n=new hV(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:r,ref:s,join_ref:i}=t;this.log("push",`${e} ${n} (${i}, ${s})`,r)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:n,event:r,payload:s,ref:i,join_ref:o}=e;if(i&&i===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",a)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${n} ${r} ${i&&"("+i+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const c=this.channels[a];c.isMember(n,r,s,o)&&c.trigger(r,s,i,o)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([n,r])=>{try{r(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}leaveOpenTopic(t){let e=this.channels.find(n=>n.topic===t&&(n.isJoined()||n.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class dd{constructor(e,n){const r=yV(n);this.presence=new pV(e.getChannel(),r),this.presence.onJoin((s,i,o)=>{const a=dd.onJoinPayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onLeave((s,i,o)=>{const a=dd.onLeavePayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return dd.transformState(this.presence.state)}static transformState(e){return e=gV(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const s=e[r];return n[r]=yp(s),n},{})}static onJoinPayload(e,n,r){const s=BC(n),i=yp(r);return{event:"join",key:e,currentPresences:s,newPresences:i}}static onLeavePayload(e,n,r){const s=BC(n),i=yp(r);return{event:"leave",key:e,currentPresences:s,leftPresences:i}}}function yp(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function gV(t){return JSON.parse(JSON.stringify(t))}function yV(t){return(t==null?void 0:t.events)&&{events:t.events}}function BC(t){return t!=null&&t.metas?yp(t):[]}var zC;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(zC||(zC={}));class vV{get state(){return this.presenceAdapter.state}constructor(e,n){this.channel=e,this.presenceAdapter=new dd(this.channel.channelAdapter,n)}}class xV{constructor(e,n,r){const s=bV(r);this.channel=e.getSocket().channel(n,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,n){return this.channel.on(e,n)}off(e,n){this.channel.off(e,n)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,n,r){let s;try{s=this.channel.push(e,n,r)}catch{throw`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>Z6){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(e){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),e)}canPush(){return this.socket.isConnected()&&this.state===so.joined}isJoined(){return this.state===so.joined}isJoining(){return this.state===so.joining}isClosed(){return this.state===so.closed}isLeaving(){return this.state===so.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function bV(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var FC;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELET
376E="DELETE"})(FC||(FC={}));var hd;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(hd||(hd={}));var ui;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(ui||(ui={}));class fd{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,n={config:{}},r){var s,i;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new xV(this.socket.socketAdapter,e,this.params),this.presence=new vV(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=T2(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,n=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:a,private:c}}=this.params,u=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(f=>f.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[hd.PRESENCE]&&this.bindings[hd.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,h={},p={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(f=>{e==null||e(ui.CHANNEL_ERROR,f)}),this._onClose(()=>e==null?void 0:e(ui.CLOSED)),this.updateJoinPayload(Object.assign({config:p},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:f})=>{if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){e==null||e(ui.SUBSCRIBED);return}this._updatePostgresBindings(f,e)}).receive("error",f=>{this.state=so.errored,e==null||e(ui.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(ui.TIMED_OUT)})}return this}_updatePostgresBindings(e,n){var r;const s=this.bindings.postgres_changes,i=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,o=[];for(let a=0;a<i;a++){const c=s[a],{filter:{event:u,schema:d,table:h,filter:p}}=c,f=e&&e[a];if(f&&f.event===u&&fd.isFilterValueEqual(f.schema,d)&&fd.isFilterValueEqual(f.table,h)&&fd.isFilterValueEqual(f.filter,p))o.push(Object.assign(Object.assign({},c),{id:f.id}));else{this.unsubscribe(),this.state=so.errored,n==null||n(ui.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=so.errored&&n&&n(ui.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){if(this.channelAdapter.isJoined()&&e===hd.PRESENCE)throw this.socket.log("channel",`cannot add presence callbacks for ${this.topic} after joining.`),new Error("cannot add presence callbacks after joining a channel");return this._on(e,n,r)}async httpSend(e,n,r={}){var s;if(n==null)return Promise.reject("Payload is required for httpSend()");const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let c=a.statusText;
376try{const u=await a.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(e,n={}){var r,s;if(!this.channelAdapter.canPush()&&e.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:i,payload:o}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,c;const u=this.channelAdapter.push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,n,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),o}_on(e,n,r){const s=e.toLocaleLowerCase(),i=this.channelAdapter.on(e,r),o={type:s,filter:n,callback:r,ref:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,n,r)=>{var s,i,o,a,c,u,d;const h=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,r))return!1;const p=(s=this.bindings[h])===null||s===void 0?void 0:s.find(f=>f.ref===e.ref);if(!p)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in p){const f=p.id,g=(i=p.filter)===null||i===void 0?void 0:i.event;return f&&((o=n.ids)===null||o===void 0?void 0:o.includes(f))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((a=n.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const f=(u=(c=p==null?void 0:p.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return f==="*"||f===((d=n==null?void 0:n.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===h})}_notThisChannelEvent(e,n){const{close:r,error:s,leave:i,join:o}=_2;return n&&[r,s,i,o].includes(e)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:i,table:o,commit_timestamp:a,type:c,errors:u}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:a,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return n})}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=$C(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=$C(e.columns,e.old_record)),n}}class wV{constructor(e,n){this.socket=new mV(e,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,n,r,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{e(),i("ok")},n,r)})}push(e){this.socket.push(e)}log(e,n,r){this.socket.log(e,n,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Ub.connecting}isDisconnecting(){return this.socket.connectionState()==Ub.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const kV={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},SV=[1e3,2e3,5e3,1e4],CV=1e4,jV=` 377 addEventListener("message", (e) => { 378 if (e.data.event === "start") { 379 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 380 } 381 });`;class NV{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
381,this.ref=0,this.serializer=new eV,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((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;const s=this._initializeOptions(n);this.socketAdapter=new wV(e,s),this.httpEndpoint=T2(e),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const n=e.message;throw n.includes("Node.js")?new Error(`${n} 382 383To use Realtime in Node.js, you need to provide a WebSocket implementation: 384 385Option 1: Use Node.js 22+ which has native WebSocket support 386Option 2: Install and provide the "ws" package: 387 388 npm install ws 389 390 import ws from "ws" 391 const client = new RealtimeClient(url, { 392 ...options, 393 transport: ws 394 })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,n){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,n)}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return n==="ok"&&e.teardown(),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(e);return this.disconnect(),n}log(e,n,r){this.socketAdapter.log(e,n,r)}connectionState(){return this.socketAdapter.connectionState()||Ub.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,n={config:{}}){const r=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new fd(`realtime:${e}`,n,this);return this.channels.push(i),i}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}async _performAuth(e=null){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),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(s=>{const i={access_token:n,version:Y6};n&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(_2.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${e}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(n,r)=>{n=="sent"&&this._setAuthSafely(),e&&e(n,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},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)}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([jV],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(e){var n,r,s,i,o,a,c,u,d;this.worker=(n=e==null?void 0:e.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=e==null?void 0:e.accessToken)!==null&&r!==void 0?r:null;const h={};
394h.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:X6,h.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:kV.HEARTBEAT_INTERVAL,h.transport=(o=e==null?void 0:e.transport)!==null&&o!==void 0?o:K6.getWebSocketConstructor(),h.params=e==null?void 0:e.params,h.logger=e==null?void 0:e.logger,h.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),h.reconnectAfterMs=(a=e==null?void 0:e.reconnectAfterMs)!==null&&a!==void 0?a:m=>SV[m-1]||CV;let p,f;const g=(c=e==null?void 0:e.vsn)!==null&&c!==void 0?c:Q6;switch(g){case J6:p=(m,v)=>v(JSON.stringify(m)),f=(m,v)=>v(JSON.parse(m));break;case N2:p=this.serializer.encode.bind(this.serializer),f=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${h.vsn}`)}if(h.vsn=g,h.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:p,h.decode=(d=e==null?void 0:e.decode)!==null&&d!==void 0?d:f,h.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,h.params=Object.assign(Object.assign({},h.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,h.autoSendHeartbeat=!this.worker}return h}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var nh=class extends Error{constructor(t,e){var n;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((n=e.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function _V(t,e,n){const r=new URL(e,t);if(n)for(const[s,i]of Object.entries(n))i!==void 0&&r.searchParams.set(s,i);return r.toString()}async function EV(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function TV(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=_V(t.baseUrl,r,s),c=await EV(t.auth),u=await e(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),p=h&&d?JSON.parse(d):d;if(!u.ok){const f=h?p:void 0,g=f==null?void 0:f.error;throw new nh((g==null?void 0:g.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:f})}return{status:u.status,headers:u.headers,data:p}}}}function Rf(t){return t.join("�")}var RV=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Rf(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){const n={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Rf(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Rf(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Rf(t.namespace)}`}),!0}catch(e){if(e instanceof nh&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof nh&&n.status===409)return;throw n}}};function xl(t){return t.join("�")}var AV=class{constructor(t,e="",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${xl(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${xl(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${xl(t.namespace)}
394/tables/${t.name}`,body:e});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${xl(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${xl(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${xl(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof nh&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof nh&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},OV=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=TV({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new RV(this.client,e),this.tableOps=new AV(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}},ty=class extends Error{constructor(t,e="storage",n,r){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function ny(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var qb=class extends ty{constructor(t,e,n,r="storage"){super(t,r,e,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},A2=class extends ty{constructor(t,e,n="storage"){super(t,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};const PV=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),MV=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Kb=t=>{if(Array.isArray(t))return t.map(n=>Kb(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=Kb(r)}),e},IV=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function rh(t){"@babel/helpers - typeof";return rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rh(t)}function DV(t,e){if(rh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(rh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function LV(t){var e=DV(t,"string");return rh(e)=="symbol"?e:e+""}function $V(t,e,n){return(e=LV(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function _e(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
394e%2?UC(Object(n),!0).forEach(function(r){$V(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):UC(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const VC=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},BV=async(t,e,n,r)=>{if(t!==null&&typeof t=="object"&&typeof t.json=="function"){const s=t;let i=parseInt(s.status,10);Number.isFinite(i)||(i=500),s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";e(new qb(VC(o),i,a,r))}).catch(()=>{const o=i+"";e(new qb(s.statusText||`HTTP ${i} error`,i,o,r))})}else e(new A2(VC(t),t,r))},zV=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||t==="HEAD"||!r?_e(_e({},s),n):(MV(r)?(s.headers=_e({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(r)):s.body=r,e!=null&&e.duplex&&(s.duplex=e.duplex),_e(_e({},s),n))};async function _u(t,e,n,r,s,i,o){return new Promise((a,c)=>{t(n,zV(e,r,s,i)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>a(u)).catch(u=>BV(u,c,r,o))})}function O2(t="storage"){return{get:async(e,n,r,s)=>_u(e,"GET",n,r,s,void 0,t),post:async(e,n,r,s,i)=>_u(e,"POST",n,s,i,r,t),put:async(e,n,r,s,i)=>_u(e,"PUT",n,s,i,r,t),head:async(e,n,r,s)=>_u(e,"HEAD",n,_e(_e({},r),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,n,r,s,i)=>_u(e,"DELETE",n,s,i,r,t)}}const FV=O2("storage"),{get:sh,post:ds,put:Gb,head:UV,remove:wk}=FV,wr=O2("vectors");var ou=class{constructor(t,e={},n,r="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=e,this.fetch=PV(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=_e(_e({},this.headers),{},{[t]:e}),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(ny(n))return{data:null,error:n};throw n}}},VV=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ny(e))return{data:null,error:e};throw e}}};let P2;P2=Symbol.toStringTag;var HV=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[P2]="BlobDownloadBuilder",this.promise=null}asStream(){return new VV(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ny(e))return{data:null,error:e};throw e}}};const WV={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},HC={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var qV=class extends ou{constructor(t,e={},n,r){super(t,e,r,"storage"),this.bucketId=n}async uploadOrUpdate(t,e,n,r){var s=this;return s.handleOperation(async()=>{let i;const o=_e(_e({},HC),r);let a=_e(_e({},s.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",s.encodeMetadata(c)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(c))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers&&(a=_e(_e({},a),r.headers));const u=s._removeEmptyFolders(e),d=s._getFinalPath(u),h=await(t=="PUT"?Gb:ds)(s.fetch,`${s.url}/object/${d}`,i,_e({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(t,e,n){return this.uploadOrUpdate("POST",t,e,n)}async uploadToSignedUrl(t,e,n,r){var s=this;const i=s._removeEmptyFolders(t),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",e),s.handleOperation(async()=>{let c;const u=_e(_e({},HC),r),d=_e(_e({},s.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:i,fullPath:(await Gb(s.fetch,a.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t);const s=_e({},n.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const i=await ds(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+i.url),a=o.searchParams.get("token");if(!a)throw new ty("No token returned by API");return{signedUrl:o.toString(),path:t,token:a}})}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;return r.handleOperation(async()=>await ds(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(t,e,n){var r=this;return r.handleOperation(async()=>({path:(await ds(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(t,e,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(t);const i=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let o=await ds(r.fetch,`${r.url}/object/sign/${s}
394`,_e({expiresIn:e},i?{transform:n.transform}:{}),{headers:r.headers});const a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"",c=i&&o.signedURL.includes("/object/sign/")?o.signedURL.replace("/object/sign/","/render/image/sign/"):o.signedURL;return{signedUrl:encodeURI(`${r.url}${c}${a}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{const s=await ds(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return s.map(o=>_e(_e({},o),{},{signedUrl:o.signedURL?encodeURI(`${r.url}${o.signedURL}${i}`):null}))})}download(t,e,n){const r=typeof(e==null?void 0:e.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((e==null?void 0:e.transform)||{}),i=s?`?${s}`:"",o=this._getFinalPath(t),a=()=>sh(this.fetch,`${this.url}/${r}/${o}${i}`,{headers:this.headers,noResolveJson:!0},n);return new HV(a,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);return e.handleOperation(async()=>Kb(await sh(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await UV(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(ny(s)){var r;const i=s instanceof qb?s.status:s instanceof A2?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const n=this._getFinalPath(t),r=[],s=e!=null&&e.download?`download=${e.download===!0?"":e.download}`:"";s!==""&&r.push(s);const i=typeof(e==null?void 0:e.transform)<"u"?"render/image":"object",o=this.transformOptsToQueryString((e==null?void 0:e.transform)||{});o!==""&&r.push(o);let a=r.join("&");return a!==""&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}${a}`)}}}async remove(t){var e=this;return e.handleOperation(async()=>await wk(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,n){var r=this;return r.handleOperation(async()=>{const s=_e(_e(_e({},WV),e),{},{prefix:t||""});return await ds(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(t,e){var n=this;return n.handleOperation(async()=>{const r=_e({},t);return await ds(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const e=[];return t.width&&e.push(`width=${t.width}`),t.height&&e.push(`height=${t.height}`),t.resize&&e.push(`resize=${t.resize}`),t.format&&e.push(`format=${t.format}`),t.quality&&e.push(`quality=${t.quality}`),e.join("&")}};const KV="2.100.1",Wh={"X-Client-Info":`storage-js/${KV}`};var GV=class extends ou{constructor(t,e={},n,r){const s=new URL(t);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=_e(_e({},Wh),e);super(i,o,n,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=e.listBucketOptionsToQueryString(t);return await sh(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await sh(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await ds(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async updateBucket(t,e){var n=this;return n.handleOperation(async()=>await Gb(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await ds(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await wk(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},YV=class extends ou{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=_e(_e({},Wh),e);super(r,s,n,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await ds(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),s=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await sh(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await wk(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!IV(t))throw new ty("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 OV({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}
394),r=this.shouldThrowOnError;return new Proxy(n,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},JV=class extends ou{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=_e(_e({},Wh),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await wr.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await wr.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},QV=class extends ou{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=_e(_e({},Wh),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},XV=class extends ou{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=_e(_e({},Wh),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await wr.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},ZV=class extends XV{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new e8(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},e8=class extends JV{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new t8(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},t8=class extends QV{constructor(t,e,n,r,s){super(t,e,s),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},n8=class extends GV{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new qV(this.url,this.headers,t,this.fetch)}get vectors(){return new ZV(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new YV(this.url+"/iceberg",this.headers,this.fetch)}};function ry(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}const M2="2.100.1",Pl=30*1e3,Yb=3,Sv=Yb*Pl,r8="http://localhost:9999",s8="supabase.auth.token",
394i8={"X-Client-Info":`gotrue-js/${M2}`},Jb="X-Supabase-Api-Version",I2={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},o8=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,a8=10*60*1e3;class ih extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function ge(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class l8 extends ih{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function c8(t){return ge(t)&&t.name==="AuthApiError"}class ga extends ih{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class Oi extends ih{constructor(e,n,r,s){super(e,r,s),this.name=n,this.status=r}}class vr extends Oi{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Cv(t){return ge(t)&&t.name==="AuthSessionMissingError"}class bl extends Oi{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Af extends Oi{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Of extends Oi{constructor(e,n=null){super(e,"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 u8(t){return ge(t)&&t.name==="AuthImplicitGrantRedirectError"}class WC extends Oi{constructor(e,n=null){super(e,"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 d8 extends Oi{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 Qb extends Oi{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function jv(t){return ge(t)&&t.name==="AuthRetryableFetchError"}class qC extends Oi{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Xb extends Oi{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const um="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),KC=` 395\r=`.split(""),h8=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<KC.length;e+=1)t[KC[e].charCodeAt(0)]=-2;for(let e=0;e<um.length;e+=1)t[um[e].charCodeAt(0)]=e;return t})();function GC(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(um[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(um[r]),e.queuedBits-=6}}function D2(t,e,n){const r=h8[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function YC(t){const e=[],n=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{m8(o,r,n)};for(let o=0;o<t.length;o+=1)D2(t.charCodeAt(o),s,i);return e.join("")}function f8(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function p8(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}f8(r,e)}}function m8(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if(!(t>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function oc(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)D2(t.charCodeAt(s),n,r);return new Uint8Array(e)}function g8(t){const e=[];return p8(t,n=>e.push(n)),new Uint8Array(e)}function wa(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};return t.forEach(s=>GC(s,n,r)),GC(null,n,r),e.join("")}function y8(t){return Math.round(Date.now()/1e3)+t}function v8(){return Symbol("auth-callback")}const jn=()=>typeof window<"u"&&typeof document<"u",la={tested:!1,writable:!1},L2=()=>{if(!jn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(la.tested)return la.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),la.tested=!0,la.writable=!0}catch{la.tested=!0,la.writable=!1}return la.writable};function x8(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
395h((s,i)=>{e[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{e[s]=r}),e}const $2=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),b8=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Ml=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},ca=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Cn=async(t,e)=>{await t.removeItem(e)};class sy{constructor(){this.promise=new sy.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}sy.promiseConstructor=Promise;function Pf(t){const e=t.split(".");if(e.length!==3)throw new Xb("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!o8.test(e[r]))throw new Xb("JWT not in base64url format");return{header:JSON.parse(YC(e[0])),payload:JSON.parse(YC(e[1])),signature:oc(e[2]),raw:{header:e[0],payload:e[1]}}}async function w8(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function k8(t,e){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await t(i);if(!e(i,null,o)){r(o);return}}catch(o){if(!e(i,o)){s(o);return}}})()})}function S8(t){return("0"+t.toString(16)).substr(-2)}function C8(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let i=0;i<56;i++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(e),Array.from(e,S8).join("")}async function j8(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function N8(t){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."),t;const n=await j8(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function wl(t,e,n=!1){const r=C8();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Ml(t,`${e}-code-verifier`,s);const i=await N8(r);return[i,r===i?"plain":"s256"]}const _8=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function E8(t){const e=t.headers.get(Jb);if(!e||!e.match(_8))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function T8(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function R8(t){switch(t){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 A8=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function kl(t){if(!A8.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Nv(){const t={};return new Proxy(t,{get:(e,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:(e,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:(e,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 O8(t,e){return new Proxy(t,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const i=r.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!e.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."),e.value=!0),Reflect.get(n,r,s)}})}function JC(t){return JSON.parse(JSON.stringify(t))}const fa=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),P8=[502,503,504];async function QC(t){var e;if(!b8(t))throw new Qb(fa(t),0);if(P8.includes(t.status))throw new Qb(fa(t),t.status);let n;try{n=await t.json()}catch(i){throw new ga(fa(i),i)}let r;const s=E8(t);if(s&&s.getTime()>=I2["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 qC(fa(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new vr}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((i,o)=>
395i&&typeof o=="string",!0))throw new qC(fa(n),t.status,n.weak_password.reasons);throw new l8(fa(n),t.status||500,r)}const M8=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function Se(t,e,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[Jb]||(i[Jb]=I2["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await I8(t,e,n+a,{headers:i,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 I8(t,e,n,r,s,i){const o=M8(e,r,s,i);let a;try{a=await t(n,Object.assign({},o))}catch(c){throw console.error(c),new Qb(fa(c),0)}if(a.ok||await QC(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(c){await QC(c)}}function ls(t){var e;let n=null;$8(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=y8(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function XC(t){const e=ls(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function io(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function D8(t){return{data:t,error:null}}function L8(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=t,o=ry(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},c=Object.assign({},o);return{data:{properties:a,user:c},error:null}}function ZC(t){return t}function $8(t){return t.access_token&&t.refresh_token&&t.expires_in}const _v=["global","local","others"];class B8{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=$2(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)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(e,n=_v[0]){if(_v.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${_v.join(", ")}`);try{return await Se(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ge(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Se(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:io})}catch(r){if(ge(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=ry(e,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Se(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:L8,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ge(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Se(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:io})}catch(n){if(ge(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,s,i,o,a,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Se(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:ZC});if(d.error)throw d.error;const h=await d.json(),p=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,f=(c=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);u[`${v}Page`]=m}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(ge(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){kl(e);try{return await Se(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:io})}catch(n){if(ge(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){kl(e);try{return await Se(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:io})}catch(r){if(ge(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){kl(e);
395try{return await Se(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:io})}catch(r){if(ge(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){kl(e.userId);try{const{data:n,error:r}=await Se(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(ge(n))return{data:null,error:n};throw n}}async _deleteFactor(e){kl(e.userId),kl(e.id);try{return{data:await Se(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(ge(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,s,i,o,a,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Se(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:ZC});if(d.error)throw d.error;const h=await d.json(),p=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,f=(c=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);u[`${v}Page`]=m}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(ge(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await Se(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ge(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Se(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ge(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await Se(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ge(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await Se(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ge(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Se(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ge(n))return{data:null,error:n};throw n}}async _listCustomProviders(e){try{const n={};return e!=null&&e.type&&(n.type=e.type),await Se(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(ge(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(e){try{return await Se(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ge(n))return{data:null,error:n};throw n}}async _getCustomProvider(e){try{return await Se(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ge(n))return{data:null,error:n};throw n}}async _updateCustomProvider(e,n){try{return await Se(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ge(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{return await Se(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ge(n))return{data:null,error:n};throw n}}}function ej(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const Rs={debug:!!(globalThis&&L2()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};
395class B2 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class tj extends B2{}async function z8(t,e,n){Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;let s;e>0&&(s=setTimeout(()=>{r.abort(),Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){clearTimeout(s),Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await n()}finally{Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new tj(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Rs.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}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"),clearTimeout(s),await n()}})}catch(i){if(e>0&&clearTimeout(s),(i==null?void 0:i.name)==="AbortError"&&e>0){if(r.signal.aborted)return Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async o=>{if(o){Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,o.name);try{return await n()}finally{Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw Rs.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new tj(`Lock "${t}" was released because another request stole it`)}throw i}}function F8(){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 z2(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function U8(t){return parseInt(t,16)}function V8(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function H8(t){var e;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:c,resources:u,scheme:d,uri:h,version:p}=t;{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(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(` 396`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const f=z2(t.address),g=d?`${d}://${r}`:r,m=t.statement?`${t.statement} 397`:"",v=`${g} wants you to sign in with your Ethereum account: 398${f} 399 400${m}`;let x=`URI: ${h} 401Version: ${p} 402Chain ID: ${n}${o?` 403Nonce: ${o}`:""} 404Issued At: ${i.toISOString()}`;if(s&&(x+=` 405Expiration Time: ${s.toISOString()}`),a&&(x+=` 406Not Before: ${a.toISOString()}
406`),c&&(x+=` 407Request ID: ${c}`),u){let b=` 408Resources:`;for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);b+=` 409- ${w}`}x+=b}return`${v} 410${x}`}class nn extends Error{constructor({message:e,code:n,cause:r,name:s}){var i;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=s??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class dm extends nn{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function W8({error:t,options:e}){var n,r,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new nn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new nn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new nn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new nn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new nn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new nn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new nn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new nn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if(F2(o)){if(i.rp.id!==o)return new nn({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new nn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new nn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new nn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new nn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function q8({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new nn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new nn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(F2(r)){if(n.rpId!==r)return new nn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new nn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new nn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ER
410ROR",cause:t})}return new nn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class K8{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const G8=new K8;function Y8(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,s=ry(t,["challenge","user","excludeCredentials"]),i=oc(e).buffer,o=Object.assign(Object.assign({},n),{id:oc(n.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];a.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:oc(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function J8(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=ry(t,["challenge","allowCredentials"]),s=oc(e).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const a=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},a),{id:oc(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function Q8(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:wa(new Uint8Array(t.response.attestationObject)),clientDataJSON:wa(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function X8(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:wa(new Uint8Array(s.authenticatorData)),clientDataJSON:wa(new Uint8Array(s.clientDataJSON)),signature:wa(new Uint8Array(s.signature)),userHandle:s.userHandle?wa(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function F2(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function nj(){var t,e;return!!(jn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function Z8(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new dm("Browser returned unexpected credential type",e)}:{data:null,error:new dm("Empty credential response",e)}}catch(e){return{data:null,error:W8({error:e,options:t})}}}async function eH(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new dm("Browser returned unexpected credential type",e)}:{data:null,error:new dm("Empty credential response",e)}}catch(e){return{data:null,error:q8({error:e,options:t})}}}const tH={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},nH={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function hm(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of t)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))r[i]=o;else if(n(o))r[i]=o;else if(e(o)){const a=r[i];e(a)?r[i]=hm(a,o):r[i]=hm(o)}else r[i]=o}return r}function rH(t,e){return hm(tH,t,e||{})}function sH(t,e){return hm(nH,t,e||{})}class iH{constructor(e){this.client=e,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(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:s},i){var o;try{const{data:a,error:c}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!a)return{data:null,error:c};const u=s??G8.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:d}=a.webauthn.credential_options.publicKey;if(!d.name){const h=r;if(h)d.name=`${d.id}:${h}`;else{const f=(await this.client.getUser()).data.user,g=((o=f==null?void 0:f.user_metadata)===null||o===void 0?void 0:o.name)||(f==null?void 0:f.email)||(f==null?void 0:f.id)||"User";d.name=`${d.id}:${g}`}}d.displayName||(d.displayName=d.name)}switch(a.webauthn.type){case"create":{const d=rH(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:h,error:p}=await Z8({publicKey:d,signal:u});return h?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:h}},error:null}:{data:null,error:p}}case"request":{const d=sH(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:h,error:p}=await eH(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:d,signal:u}));return h?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:h}},error:null}:{data:null,error:p}}}}catch(a){return ge(a)?{data:null,error:a}:{data:null,error:new ga("Unexpected error in challenge",a)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new ih("rpId is required for WebAuthn authentication")};try{if(!nj())return{data:null,error:new ga("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:i});if(!o)return{data:null,error:a};const{webauthn:c}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(o){return ge(o)?{data:null,error:o}:{data:null,error:new ga("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new ih("rpId is required for WebAuthn registration")};try{if(!nj())return{data:null,error:new ga("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(d=>{var h;
410return(h=d.data)===null||h===void 0?void 0:h.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===e&&p.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:a};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:i});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return ge(o)?{data:null,error:o}:{data:null,error:new ga("Unexpected error in register",o)}}}}F8();const oH={url:r8,storageKey:s8,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:i8,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function rj(t,e,n){return await n()}const Sl={};class oh{get jwks(){var e,n;return(n=(e=Sl[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){Sl[this.storageKey]=Object.assign(Object.assign({},Sl[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=Sl[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Sl[this.storageKey]=Object.assign(Object.assign({},Sl[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,s;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 i=Object.assign(Object.assign({},oH),e);if(this.storageKey=i.storageKey,this.instanceID=(n=oh.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,oh.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&jn()){const o=`${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(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new B8({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=$2(i.fetch),this.lock=i.lock||rj,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&jn()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=z8:this.lock=rj,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 iH(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?(i.storage?this.storage=i.storage:L2()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ej(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=ej(this.memoryStorage)),jn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${M2}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),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 e;try{let n={},r="none";if(jn()&&(n=x8(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),jn()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),u8(i)){const c=(e=i.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ge(n)?this._returnResult({error:n}):this._returnResult({error:new ga("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,s;try{const i=await Se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:ls}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(ge(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var n,r,s;try{let i;if("email"in e){const{email:d,password:h,options:p}=e;let f=null,g=null;this.flowType==="pkce"&&([f,g]=await wl(this.storage,this.storageKey)),i=await Se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:d,password:h,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:f,code_challenge_method:g},xform:ls})}else if("phone"in e){const{phone:d,password:h,options:p}=e;i=await Se(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(s=p==null?void 0:p.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:ls})}else throw new Af("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await Cn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(await Cn(this.storage,`${this.storageKey}-code-verifier`),ge(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(e){try{let n;if("email"in e){const{email:i,password:o,options:a}=e;n=await Se(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:XC})}else if("phone"in e){const{phone:i,password:o,options:a}=e;n=await Se(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:XC})}else throw new Af("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const i=new bl;return this._returnResult({data:{user:null,session:null},error:i})}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:s})}catch(n){if(ge(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,s,i,o,a,c,u,d,h,p;let f,g;if("message"in e)f=e.message,g=e.signature;else{const{chain:m,wallet:v,statement:x,options:b}=e;let w;if(jn())if(typeof v=="object")w=v;else{const C=window;if("ethereum"in C&&typeof C.ethereum=="object"&&"request"in C.ethereum&&typeof C.ethereum.request=="function")w=C.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 v!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=v}const k=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href),j=await w.request({method:"eth_requestAccounts"}).then(C=>C).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const E=z2(j[0]);let N=(r=b==null?void 0:b.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!N){const C=await w.request({method:"eth_chainId"});N=U8(C)}const S={domain:k.host,address:E,statement:x,uri:k.href,version:"1",chainId:N,nonce:(s=b==null?void 0:b.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=b==null?void 0:b.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(c=b==null?void 0:b.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=b==null?void 0:b.signInWithEthereum)===null||d===void 0?void 0:d.resources};f=H8(S),g=await w.request({method:"personal_sign",params:[V8(f),E]})}try{const{data:m,error:v}=await Se(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:g}
410,!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:ls});if(v)throw v;if(!m||!m.session||!m.user){const x=new bl;return this._returnResult({data:{user:null,session:null},error:x})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:v})}catch(m){if(ge(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(e){var n,r,s,i,o,a,c,u,d,h,p,f;let g,m;if("message"in e)g=e.message,m=e.signature;else{const{chain:v,wallet:x,statement:b,options:w}=e;let k;if(jn())if(typeof x=="object")k=x;else{const E=window;if("solana"in E&&typeof E.solana=="object"&&("signIn"in E.solana&&typeof E.solana.signIn=="function"||"signMessage"in E.solana&&typeof E.solana.signMessage=="function"))k=E.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 x!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=x}const j=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href);
410if("signIn"in k&&k.signIn){const E=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),b?{statement:b}:null));let N;if(Array.isArray(E)&&E[0]&&typeof E[0]=="object")N=E[0];else if(E&&typeof E=="object"&&"signedMessage"in E&&"signature"in E)N=E;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)g=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),m=N.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${j.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(s=(r=w==null?void 0:w.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((h=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...w.signInWithSolana.resources.map(N=>`- ${N}`)]:[]].join(` 411`);const E=await k.signMessage(new TextEncoder().encode(g),"utf8");if(!E||!(E instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=E}}try{const{data:v,error:x}=await Se(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:wa(m)},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:ls});if(x)throw x;if(!v||!v.session||!v.user){const b=new bl;return this._returnResult({data:{user:null,session:null},error:b})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:x})}catch(v){if(ge(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(e){const n=await ca(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new d8;const{data:i,error:o}=await Se(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:ls});if(await Cn(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new bl;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(await Cn(this.storage,`${this.storageKey}-code-verifier`),ge(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(e){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=e,a=await Se(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:ls}),{data:c,error:u}=a;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new bl;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(ge(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,s,i,o;try{if("email"in e){const{email:a,options:c}=e;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await wl(this.storage,this.storageKey));const{error:h}=await Se(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,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 e){const{phone:a,options:c}=e,{data:u,error:d}=await Se(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new Af("You must provide either an email or phone number.")}catch(a){if(await Cn(this.storage,`${this.storageKey}-code-verifier`),ge(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(e){var n,r;try{let s,i;"options"in e&&(s=(n=e.options)===null||n===void 0?void 0:n.redirectTo,i=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await Se(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:ls});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(ge(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var n,r,s,i,o;try{let a=null,c=null;this.flowType==="pkce"&&([a,c]=await wl(this.storage,this.storageKey));const u=await Se(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:c}),headers:this.headers,xform:D8});return!((i=u.data)===null||i===void 0)&&i.url&&jn()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(a){if(await Cn(this.storage,`${this.storageKey}-code-verifier`),ge(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new vr;const{error:s}=await Se(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(ge(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:s,options:i}=e,{error:o}=await Se(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){const{phone:r,type:s,options:i}=e,{data:o,error:a}=await Se(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a})}throw new Af("You must provide either an email or phone number and a type")}catch(n){if(ge(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(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,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 s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.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(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(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 e=null;const n=await ca(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not val
411id"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<Sv:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const o=await ca(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Nv()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=O8(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await Se(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:io}):await this._useSession(async n=>{var r,s,i;const{data:o,error:a}=n;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new vr}:await Se(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:io})})}catch(n){if(ge(n))return Cv(n)&&(await this._removeSession(),await Cn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new vr;const o=s.session;let a=null,c=null;this.flowType==="pkce"&&e.email!=null&&([a,c]=await wl(this.storage,this.storageKey));const{data:u,error:d}=await Se(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:c}),jwt:o.access_token,xform:io});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await Cn(this.storage,`${this.storageKey}-code-verifier`),ge(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new vr;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=Pf(e.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){const{data:a,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:c}=await this._getUser(e.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(ge(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:o,error:a}=n;if(a)throw a;e=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new vr;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(ge(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){try{if(!jn())throw new Of("No browser detected.");
411if(e.error||e.error_description||e.error_code)throw new Of(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new WC("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Of("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new WC("No code detected.");const{data:b,error:w}=await this._exchangeCodeForSession(e.code);if(w)throw w;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:b.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:c,token_type:u}=e;if(!i||!a||!o||!u)throw new Of("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(a);let p=d+h;c&&(p=parseInt(c));const f=p-d;f*1e3<=Pl&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${h}s`);const g=p-h;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,p,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,p,d);const{data:m,error:v}=await this._getUser(i);if(v)throw v;const x={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:h,expires_at:p,refresh_token:o,token_type:u,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:x,redirectType:e.type},error:null})}catch(r){if(ge(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await ca(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i&&!Cv(i))return this._returnResult({error:i});const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(c8(a)&&(a.status===404||a.status===401||a.status===403)||Cv(a)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await Cn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=v8(),r={id:n,callback:e,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(e){return await this._useSession(async n=>{var r,s;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await wl(this.storage,this.storageKey,!0));try{return await Se(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await Cn(this.storage,`${this.storageKey}-code-verifier`),ge(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(ge(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:s}=await this._useSession(async i=>{var o,a,c,u,d;const{data:h,error:p}=i;if(p)throw p;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Se(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(s)throw s;
411return jn()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(ge(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:i}}=n;if(s)throw s;const{options:o,provider:a,token:c,access_token:u,nonce:d}=e,h=await Se(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=i==null?void 0:i.access_token)!==null&&r!==void 0?r:void 0,body:{provider:a,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:ls}),{data:p,error:f}=h;return f?this._returnResult({data:{user:null,session:null},error:f}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new bl}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:f}))}catch(s){if(await Cn(this.storage,`${this.storageKey}-code-verifier`),ge(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)throw o;return await Se(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(ge(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await k8(async s=>(s>0&&await w8(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Se(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ls})),(s,i)=>{const o=200*Math.pow(2,s);return i&&jv(i)&&Date.now()+o-r<Pl})}catch(r){if(this._debug(n,"error",r),ge(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),jn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await ca(this.storage,this.storageKey);if(s&&this.userStorage){let o=await ca(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Ml(this.userStorage,this.storageKey+"-user",o)),s.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Nv()}else if(s&&!s.user&&!s.user){const o=await ca(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await Cn(this.storage,this.storageKey+"-user"),await Ml(this.storage,this.storageKey,s)):s.user=Nv()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const i=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Sv;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${Sv}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),jv(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(s.access_token);!a&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new vr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new sy;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new vr;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={data:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),ge(i)){const o={data:null,error:i};return jv(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,n,r=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,n)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Cn(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Ml(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=JC(s);await Ml(this.storage,this.storageKey,i)}else{const s=JC(n);await Ml(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Cn(this.storage,this.storageKey),await Cn(this.storage,this.storageKey+"-code-verifier"),await Cn(this.storage,this.storageKey+"-user"),this.userStorage&&await Cn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&jn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
411catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Pl);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);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 e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);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 e=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 s=Math.floor((r.expires_at*1e3-e)/Pl);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Pl}ms, refresh threshold is ${Yb} ticks`),s<=Yb&&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(e){if(e.isAcquireTimeout||e instanceof B2)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!jn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(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(e,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await wl(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?this._returnResult({data:null,error:i}):await Se(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ge(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;
411if(o)return this._returnResult({data:null,error:o});const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:c,error:u}=await Se(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.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(ge(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Q8(e.webauthn.credential_response):X8(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:c}=await Se(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.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)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:c}))})}catch(n){if(ge(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await Se(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Y8(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:J8(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ge(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var n,r,s,i;if(e)try{const{payload:f}=Pf(e);let g=null;f.aal&&(g=f.aal);let m=g;const{data:{user:v},error:x}=await this.getUser(e);if(x)return this._returnResult({data:null,error:x});((r=(n=v==null?void 0:v.factors)===null||n===void 0?void 0:n.filter(k=>k.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(m="aal2");const w=f.amr||[];return{data:{currentLevel:g,nextLevel:m,currentAuthenticationMethods:w},error:null}}catch(f){if(ge(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:o},error:a}
411=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Pf(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(f=>f.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(d="aal2");const p=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:p},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await Se(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new vr})})}catch(n){if(ge(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new vr});const o=await Se(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&jn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ge(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new vr});const o=await Se(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&jn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ge(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await Se(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new vr})})}catch(e){if(ge(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await Se(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new vr})})}catch(n){if(ge(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(a=>a.kid===e);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(a=>a.kid===e),r&&this.jwks_cached_at+a8>s)return r;const{data:i,error:o}=await Se(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,r=i.keys.find(a=>a.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:f,error:g}
411=await this.getSession();if(g||!f.session)return this._returnResult({data:null,error:g});r=f.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:c}}=Pf(r);n!=null&&n.allowExpired||T8(i.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.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:i,header:s,signature:o},error:null}}const d=R8(s.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,g8(`${a}.${c}`)))throw new Xb("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(ge(r))return this._returnResult({data:null,error:r});throw r}}}oh.nextInstanceID={};const aH=oh,lH="2.100.1";let Wu="";typeof Deno<"u"?Wu="deno":typeof document<"u"?Wu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Wu="react-native":Wu="node";const cH={"X-Client-Info":`supabase-js-${Wu}/${lH}`},uH={headers:cH},dH={schema:"public"},hH={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},fH={};function ah(t){"@babel/helpers - typeof";return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ah(t)}function pH(t,e){if(ah(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ah(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mH(t){var e=pH(t,"string");return ah(e)=="symbol"?e:e+""}function gH(t,e,n){return(e=mH(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sj(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Ft(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?sj(Object(n),!0).forEach(function(r){gH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sj(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const yH=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),vH=()=>Headers,xH=(t,e,n)=>{const r=yH(n),s=vH();return async(i,o)=>{var a;const c=(a=await e())!==null&&a!==void 0?a:t;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(i,Ft(Ft({},o),{},{headers:u}))}};function bH(t){return t.endsWith("/")?t:t+"/"}function wH(t,e){var n,r;const{db:s,auth:i,realtime:o,global:a}=t,{db:c,auth:u,realtime:d,global:h}=e,p={db:Ft(Ft({},c),s),auth:Ft(Ft({},u),i),realtime:Ft(Ft({},d),o),storage:{},global:Ft(Ft(Ft({},h),a),{},{headers:Ft(Ft({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?p.accessToken=t.accessToken:delete p.accessToken,p}function kH(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(bH(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var SH=class extends aH{constructor(t){super(t)}},CH=class{constructor(t,e,n){var r,s;this.supabaseUrl=t,this.supabaseKey=e;const i=kH(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:dH,realtime:fH,auth:Ft(Ft({},hH),{},{storageKey:o}),global:uH},c=wH(n??{},a);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},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=xH(e,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Ft({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 q6(new URL("rest/v1",i).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new n8(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new $6(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,n;if(t.accessToken)return await t.accessToken();const{data:r}=await t.auth.getSession();
411return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:i,flowType:o,lock:a,debug:c,throwOnError:u},d,h){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new SH({url:this.authUrl.href,headers:Ft(Ft({},p),d),storageKey:i,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:c,throwOnError:u,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new NV(this.realtimeUrl.href,Ft(Ft({},t),{},{params:Ft(Ft({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const jH=(t,e,n)=>new CH(t,e,n);function NH(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const n=e.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}NH()&&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");function _H(){var v,x;if(typeof window>"u")return;const t=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(b=>t===b||t.endsWith("."+b)),r="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",s=n?((v=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:v[1])??((x=t.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:x[1]):void 0,i=window.parent&&window.parent!==window;if(!s||!i)return localStorage;const o=t.endsWith(".lovableproject-dev.com")||t.endsWith(".gpt-eng.com"),a=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=c&&a.test(c)?[c]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",h=2e3,p=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),f=(b,w,k)=>new Promise(j=>{const E=p();let N=!1,S;const C=O=>{N||(N=!0,clearTimeout(S),window.removeEventListener("message",_),j(O))},_=O=>{if(u.indexOf(O.origin)<0)return;const L=O.data;L&&L.type===d&&L.requestId===E&&C(L)};window.addEventListener("message",_);const R={type:b,requestId:E,projectId:s,key:w};k!==void 0&&(R.value=k);for(const O of u)window.parent.postMessage(R,O);S=setTimeout(()=>C(null),h)});let g=!0;const m=250;return{getItem:async b=>{let w=await f("lovable-preview-auth:get",b);return!w&&g&&(await new Promise(k=>setTimeout(k,m)),w=await f("lovable-preview-auth:get",b)),g=!1,w&&w.ok&&typeof w.value=="string"?w.value===""?(localStorage.removeItem(b),null):w.value:localStorage.getItem(b)},setItem:(b,w)=>(localStorage.setItem(b,w),f("lovable-preview-auth:set",b,w).then(()=>{})),removeItem:b=>(localStorage.removeItem(b),f("lovable-preview-auth:remove",b).then(()=>{}))}}const EH="https://ouxnmydssnzuvficfwah.supabase.co",TH="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im91eG5teWRzc256dXZmaWNmd2FoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQyMDk2MDYsImV4cCI6MjA4OTc4NTYwNn0.-4HSqD2dfns5G78QREqe8Y6Ub_Pb9kja1POrrwtzXX8",D=jH(EH,TH,{auth:{storage:_H(),persistSession:!0,autoRefreshToken:!0}}),U2=y.createContext(void 0),RH=({children:t})=>{const[e,n]=y.useState(null),[r,s]=y.useState(null),[i,o]=y.useState(!1),[a,c]=y.useState(!0),u=async f=>{try{const{data:g,error:m}=await D.from("user_roles").select("role").eq("user_id",f).eq("role","admin").maybeSingle();return m?(console.error("Admin role check failed:",m.message),!1):!!g}catch(g){return console.error("Admin role check threw:",g),!1}};y.useEffect(()=>{let f=!0,g=0;const m=x=>{if(!f)return;s(x);const b=(x==null?void 0:x.user)??null;if(n(b),!b){o(!1),c(!1);return}c(!0),g+=1;const w=g;u(b.id).then(k=>{!f||w!==g||o(k)}).finally(()=>{!f||w!==g||c(!1)})},{data:{subscription:v}}=D.auth.onAuthStateChange((x,b)=>{setTimeout(()=>m(b),0)});return D.auth.getSession().then(({data:{session:x}})=>
411{m(x)}).catch(()=>{f&&(n(null),s(null),o(!1),c(!1))}),()=>{f=!1,g+=1,v.unsubscribe()}},[]);const d=async(f,g)=>{const{error:m}=await D.auth.signInWithPassword({email:f,password:g});return{error:m}},h=async(f,g)=>{const{error:m}=await D.auth.signUp({email:f,password:g});return{error:m}},p=async()=>{await D.auth.signOut(),o(!1)};return l.jsx(U2.Provider,{value:{user:e,session:r,isAdmin:i,loading:a,signIn:d,signUp:h,signOut:p},children:t})},pr=()=>{const t=y.useContext(U2);if(!t)throw new Error("useAuth must be used within AuthProvider");return t},ij=[{label:"Find Your Track (Assessment)",href:"/assessment"},{label:"Individual Coaching",href:"/individual-coaching"},{label:"Cohorts",href:"/cohort-coaching"},{label:"Narratives",href:"/narratives"},{label:"Reading Room",href:"/reading-room"}],oj=[{label:"The Book",href:"/book"},{label:"The Podcast",href:"/podcast"},{label:"The Newsletter",href:"/blog"}],aj=[{label:"Bio",href:"/bio"},{label:"Press",href:"/press-media"},{label:"How I use AI",href:"/how-i-use-ai"}],Ge=()=>{const[t,e]=y.useState(!1),[n,r]=y.useState(!1),[s,i]=y.useState(!1),[o,a]=y.useState(!1),[c,u]=y.useState(!1),{user:d}=pr();return y.useEffect(()=>{D.from("site_settings").select("value").eq("key","events_enabled").maybeSingle().then(({data:h})=>u((h==null?void 0:h.value)===!0))},[]),l.jsxs("header",{className:"fixed top-0 left-0 right-0 z-50 bg-background/95 backdrop-blur-sm border-b border-border",children:[l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 flex items-center justify-between h-16",children:[l.jsxs("a",{href:"/",className:"flex flex-col leading-tight no-underline hover:opacity-80 transition-opacity",children:[l.jsx("span",{className:"font-heading text-xl font-bold text-foreground tracking-wide",children:"Stephanie Peirolo"}),l.jsx("span",{className:"font-body text-[10px] md:text-xs uppercase tracking-wider text-muted-foreground",children:"Author, executive coach, decision making strategist"})]}),l.jsxs("nav",{className:"hidden md:flex items-center gap-8",children:[l.jsx("a",{href:"/",className:"font-body text-sm font-semibold uppercase tracking-wider text-foreground no-underline hover:text-primary transition-colors",children:"Home"}),l.jsxs("div",{className:"relative",onMouseEnter:()=>e(!0),onMouseLeave:()=>e(!1),children:[l.jsxs("button",{className:"font-body text-sm font-semibold uppercase tracking-wider text-foreground hover:text-primary transition-colors flex items-center gap-1 py-2",children:["Offerings",l.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),t&&l.jsx("div",{className:"absolute top-full right-0 pt-0 w-64",children:l.jsx("div",{className:"bg-card border border-border rounded shadow-lg py-2 animate-fade-in",children:ij.map(h=>l.jsx("a",{href:h.href,className:"block px-5 py-2.5 text-sm font-body text-foreground no-underline hover:bg-secondary transition-colors",children:h.label},h.label))})})]}),l.jsxs("div",{className:"relative",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[l.jsxs("button",{className:"font-body text-sm font-semibold uppercase tracking-wider text-foreground hover:text-primary transition-colors flex items-center gap-1 py-2",children:["Content",l.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${n?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),n&&l.jsx("div",{className:"absolute top-full right-0 pt-0 w-48",children:l.jsx("div",{className:"bg-card border border-border rounded shadow-lg py-2 animate-fade-in",children:oj.map(h=>l.jsx("a",{href:h.href,className:"block px-5 py-2.5 text-sm font-body text-foreground no-underline hover:bg-secondary transition-colors",children:h.label},h.label))})})]}),l.jsxs("div",{className:"relative",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[l.jsxs("button",{className:"font-body text-sm font-semibold uppercase tracking-wider text-foreground hover:text-primary transition-colors flex items-center gap-1 py-2",children:["About",l.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),s&&l.jsx("div",{className:"absolute top-full right-0 pt-0 w-48",children:l.jsx("div",{className:"bg-card border border-border rounded shadow-lg py-2 animate-fade-in",children:aj.map(h=>l.jsx("a",{href:h.href,className:"block px-5 py-2.5 text-sm font-body text-foreground no-underline hover:bg-secondary transition-colors",children:h.label},h.label))})})]}),c&&l.jsx("a",{href:"/events",className:"font-body text-sm font-semibold uppercase tracking-wider text-foreground no-underline hover:text-primary transition-colors",children:"Events"}),l.jsx("a",{href:"/contact",className:"font-body text-sm font-semibold uppercase tracking-wider text-foreground no-underline hover:text-primary transition-colors",children:"Contact"}),d&&l.jsx("a",{href:"/dashboard",className:"font-body text-sm font-semibold uppercase tracking-wider text-foreground no-underline hover:text-primary transition-colors",children:"Dashboard"}),l.jsx("a",{href:"/individual-coaching",className:"inline-block whitespace-nowrap bg-primary text-primary-foreground px-5 py-2 font-body text-xs font-bold uppercase tracking-wider shadow-sm transition-all duration-200 hover:brightness-[1.2] active:scale-[0.97]",children:"Work with Stephanie"})]}),l.jsx("button",{className:"md:hidden text-foreground p-2",onClick:()=>a(!o),"aria-label":"Toggle menu",children:o?l.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}):l.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})]}),o&&l.jsx("div",{className:"md:hidden bg-card border-t border-border animate-fade-in",children:l.jsxs("div",{className:"px-6 py-4 space-y-3",children:[l.jsx("a",{href:"/",className:"block font-body text-sm font-semibold uppercase tracking-wider text-foreground no-underline",children:"Home"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-body text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-1",children:"Offerings"}),ij.map(h=>l.jsx("a",{href:h.href,className:"block pl-4 py-1.5 font-body text-sm text-foreground no-underline",children:h.label},h.label))]}),l.jsxs("div",{children:[l.jsx("p",{className:"font-body text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-1",children:"Content"}),oj.map(h=>l.jsx("a",{href:h.href,className:"block pl-4 py-1.5 font-body text-sm text-foreground no-underline",children:h.label},h.label))]}),l.jsxs("div",{children:[l.jsx("p",{className:"font-body text-sm font-semibold uppercase tracking-wider text-muted-foreground mb-1",children:"About"}),aj.map(h=>l.jsx("a",{href:h.href,className:"block pl-4 py-1.5 font-body text-sm text-foreground no-underline",children:h.label},h.label))]}),c&&l.jsx("a",{href:"/events",className:"block font-body text-sm font-semibold uppercase tracking-wider text-foreground no-underline",children:"Events"}),l.jsx("a",{href:"/contact",className:"block font-body text-sm font-semibold uppercase tracking-wider text-foreground no-underline",children:"Contact"}),l.jsx("a",{href:"/individual-coaching",className:"inline-block bg-primary text-primary-foreground px-5 py-2 font-body text-xs font-bold uppercase tracking-wider shadow-sm",children:"Work with Stephanie"})]})})]})},re=({children:t,className:e="",animation:n="fade-up",delay:r=0})=>{const s=y.useRef(null);return y.useEffect(()=>{const i=s.current;if(!i)return;const o=new IntersectionObserver(([a])=>{a.isIntersecting&&(i.style.animationDelay=`${r}ms`,i.classList.add(`animate-${n}`),i.style.opacity="",o.unobserve(i))},{threshold:.12,rootMargin:"0px 0px -40px 0px"});return o.observe(i),()=>o.disconnect()},[n,r]),l.jsx("div",{ref:s,style:{opacity:0}
411,className:e,children:t})},V2=y.createContext(void 0),Pi=({pageSlug:t,children:e})=>{const{isAdmin:n}=pr(),{toast:r}=ht(),[s,i]=y.useState(!1),[o,a]=y.useState({}),[c,u]=y.useState({}),[d,h]=y.useState(!1);y.useEffect(()=>{(async()=>{const{data:w}=await D.from("page_content").select("content_key, content").eq("page_slug",t);if(w){const k={};w.forEach(j=>{k[j.content_key]=j.content}),a(k),u(k)}})()},[t]);const p=y.useCallback(()=>{s&&u({...o}),i(b=>!b)},[s,o]),f=y.useCallback((b,w)=>{const k=s?c:o[b]!==void 0?o:c;return k[b]!==void 0?k[b]:w},[s,c,o]),g=y.useCallback((b,w)=>{u(k=>({...k,[b]:w}))},[]),m=y.useCallback(async()=>{h(!0);const b=Object.entries(c);for(const[w,k]of b){if(o[w]===k)continue;const{error:j}=await D.from("page_content").upsert({page_slug:t,content_key:w,content:k,content_type:"text"},{onConflict:"page_slug,content_key"});if(j){r({title:"Save error",description:j.message,variant:"destructive"}),h(!1);return}}a({...c}),i(!1),h(!1),r({title:"Page content saved!"})},[c,o,t,r]),v=y.useCallback(()=>{u({...o}),i(!1)},[o]),x=JSON.stringify(c)!==JSON.stringify(o);return l.jsx(V2.Provider,{value:{isEditMode:s,toggleEditMode:p,getContent:f,setContent:g,saveAll:m,cancelEditing:v,hasChanges:x,saving:d,isAdmin:n},children:e})},kk=()=>{const t=y.useContext(V2);if(!t)throw new Error("usePageEditor must be used within PageEditorProvider");return t},fe=({contentKey:t,defaultValue:e,as:n="span",className:r="",style:s,html:i=!1})=>{const{isEditMode:o,getContent:a,setContent:c}=kk(),u=y.useRef(null),d=a(t,e);if(y.useEffect(()=>{u.current&&i&&u.current.innerHTML!==d&&(u.current.innerHTML=d)},[d,i,o]),!o)return i?y.createElement(n,{className:r,style:s,dangerouslySetInnerHTML:{__html:d}}):y.createElement(n,{className:r,style:s},d);const h=`${r} outline-2 outline-dashed outline-blue-400/60 hover:outline-blue-500 focus:outline-blue-500 transition-[outline-color] cursor-text rounded-sm`,g={ref:u,className:h,style:s,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:()=>{u.current&&c(t,i?u.current.innerHTML:u.current.textContent||"")},onKeyDown:m=>{m.key==="Enter"&&!i&&m.preventDefault()}};return i&&(g.dangerouslySetInnerHTML={__html:d}),y.createElement(n,g,i?void 0:d)},AH="/assets/hero-bg-3qugBwYO.png",OH=()=>l.jsxs("section",{className:"relative min-h-screen flex items-center overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:`url(${AH})`}}),l.jsx("div",{className:"absolute inset-0 bg-black/50"}),l.jsx("div",{className:"relative z-10 container mx-auto px-6 md:px-12 lg:px-24 py-24 text-white",children:l.jsxs("div",{className:"max-w-3xl",children:[l.jsx(re,{animation:"rise",delay:100,children:l.jsx(fe,{contentKey:"hero_heading",defaultValue:"You're at a turning point.",as:"h1",className:"mb-6"})}),l.jsx(re,{animation:"fade-up",delay:300,children:l.jsx(fe,{contentKey:"hero_subheading",defaultValue:"Where do you go from here?",as:"p",className:"mb-10 text-lg md:text-xl font-light opacity-90"})}),l.jsx(re,{animation:"fade-up",delay:600,children:l.jsxs("div",{className:"flex flex-wrap gap-4",children:[l.jsx("a",{href:"/assessment",className:"inline-block bg-primary text-primary-foreground px-8 py-3 font-body text-sm font-bold uppercase tracking-wider shadow-sm transition-all duration-200 hover:brightness-[1.2] active:scale-[0.97]",children:"Take our free assessment"}),l.jsx("a",{href:"/narratives",className:"inline-block bg-transparent text-white border-2 border-white px-8 py-3 font-body text-sm font-bold uppercase tracking-wider transition-all duration-200 hover:bg-white hover:text-foreground active:scale-[0.97]",children:"What's Holding You Back?"})]})})]})})]}),PH=()=>l.jsx("section",{id:"turning-points",className:"bg-background py-20 md:py-28",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsxs(re,{animation:"fade-up",className:"max-w-3xl mx-auto text-center mb-12",children:[l.jsx(fe,{contentKey:"tp_heading",defaultValue:"It's time for a change",as:"h2",className:"mb-6"}),l.jsx(fe,{contentKey:"tp_intro",as:"div",html:!0,className:"space-y-4 text-foreground
411/85 leading-relaxed",defaultValue:`<p>Are you stuck in your career and want more?</p> 412<p>Are you moving into a different season of life â a promotion at work, new baby, approaching retirement?</p> 413<p>Most of our turning points are around work or big changes that impact our identity. While they often overlap, the content and coaching I provide focuses on two areas.</p>`}),l.jsx("div",{className:"mt-8",children:l.jsx("a",{href:"/assessment",className:"inline-block bg-foreground text-background px-8 py-3 font-body text-xs font-bold uppercase tracking-wider transition-opacity hover:opacity-90 active:scale-[0.97]",children:"Not sure which fits? Take the 2-minute assessment"})})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-8 max-w-4xl mx-auto",children:[l.jsx(re,{animation:"fade-up",delay:100,children:l.jsxs("div",{className:"h-full bg-card border border-primary rounded p-8 shadow-md hover:shadow-xl transition-all flex flex-col",children:[l.jsx(fe,{contentKey:"tp_card1_title",defaultValue:"Turning Points",as:"h3",className:"font-heading text-2xl font-bold mb-3 text-foreground"}),l.jsx(fe,{contentKey:"tp_card1_body",defaultValue:"You are at a turning point, making a decision or changing direction and you want tools and support.",as:"p",className:"text-muted-foreground text-sm leading-relaxed mb-6 flex-1"}),l.jsx("a",{href:"/turning-points",className:"inline-block self-start border border-foreground px-6 py-2 font-body text-xs font-bold uppercase tracking-wider text-foreground transition-colors hover:bg-foreground hover:text-background active:scale-[0.97]",children:"Explore Turning Points"})]})}),l.jsx(re,{animation:"fade-up",delay:250,children:l.jsxs("div",{className:"h-full bg-card border border-primary rounded p-8 shadow-md hover:shadow-xl transition-all flex flex-col",children:[l.jsx(fe,{contentKey:"tp_card2_title",defaultValue:"Real Work",as:"h3",className:"font-heading text-2xl font-bold mb-3 text-foreground"}),l.jsx(fe,{contentKey:"tp_card2_body",defaultValue:"You want to be better at your job, but you're not getting the support you need. You want practical advice, not hustle foolishness, because you want real work that is sustainable.",as:"p",className:"text-muted-foreground text-sm leading-relaxed mb-6 flex-1"}),l.jsx("a",{href:"/real-work",className:"inline-block self-start border border-foreground px-6 py-2 font-body text-xs font-bold uppercase tracking-wider text-foreground transition-colors hover:bg-foreground hover:text-background active:scale-[0.97]",children:"Explore Real Work"})]})})]})]})});var Ev="focusScope.autoFocusOnMount",Tv="focusScope.autoFocusOnUnmount",lj={bubbles:!1,cancelable:!0},MH="FocusScope",Sk=y.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,c]=y.useState(null),u=Jr(s),d=Jr(i),h=y.useRef(null),p=ot(e,m=>c(m)),f=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let m=function(w){if(f.paused||!a)return;const k=w.target;a.contains(k)?h.current=k:Ki(h.current,{select:!0})},v=function(w){if(f.paused||!a)return;const k=w.relatedTarget;k!==null&&(a.contains(k)||Ki(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const j of w)j.removedNodes.length>0&&Ki(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[r,a,f.paused]),y.useEffect(()=>{if(a){uj.add(f);const m=document.activeElement;if(!a.contains(m)){const x=new CustomEvent(Ev,lj);a.addEventListener(Ev,u),a.dispatchEvent(x),x.defaultPrevented||(IH(zH(H2(a)),{select:!0}),document.activeElement===m&&Ki(a))}return()=>{a.removeEventListener(Ev,u),setTimeout(()=>{const x=new CustomEvent(Tv,lj);a.addEventListener(Tv,d),a.dispatchEvent(x),x.defaultPrevented||Ki(m??document.body,{select:!0}),a.removeEventListener(Tv,d),uj.remove(f)},0)}}},[a,u,d,f]);const g=y.useCallback(m=>{if(!n&&!r||f.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(v&&x){const b=m.currentTarget,[w,k]=DH(b);w&&k?!m.shiftKey&&x===k?(m.preventDefault(),n&&Ki(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&Ki(k,{select:!0})):x===b&&m.preventDefault()}},[n,r,f.paused]);return l.jsx(Ae.div,{tabIndex:-1,...o,ref:p,onKeyDown:g})});Sk.displayName=MH;function IH(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ki(r,{select:e}),document.activeElement!==n)return}function DH(t){const e=H2(t),n=cj(e,t),r=cj(e.reverse(),t);return[n,r]}function H2(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function cj(t,e){for(const n of t)if(!LH(n,{upTo:e}))return n}function LH(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function $H(t){return t instanceof HTMLInputElement&&"select"in t}function Ki(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&$H(t)&&e&&t.select()}}var uj=BH();function BH(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=dj(t,e),t.unshift(e)},remove(e){var n;t=dj(t,e),(n=t[0])==null||n.resume()}}}function dj(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function zH(t){return t.filter(e=>e.tagName!=="A")}var Rv=0;function W2(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??hj()),document.body.insertAdjacentElement("beforeend",t[1]??hj()),Rv++,()=>{Rv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 5,838 bytes, lines 413-428
413=>e.remove()),Rv--}},[])}function hj(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Fs=function(){return Fs=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Fs.apply(this,arguments)};function q2(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function FH(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var vp="right-scroll-bar-position",xp="width-before-scroll-bar",UH="with-scroll-bars-hidden",VH="--removed-body-scroll-bar-size";function Av(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function HH(t,e){var n=y.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var WH=typeof window<"u"?y.useLayoutEffect:y.useEffect,fj=new WeakMap;function qH(t,e){var n=HH(null,function(r){return t.forEach(function(s){return Av(s,r)})});return WH(function(){var r=fj.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(a){i.has(a)||Av(a,null)}),i.forEach(function(a){s.has(a)||Av(a,o)})}fj.set(n,t)},[t]),n}function KH(t){return t}function GH(t,e){e===void 0&&(e=KH);var n=[],r=!1,s={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]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return s}function YH(t){t===void 0&&(t={});var e=GH(null);return e.options=Fs({async:!0,ssr:!1},t),e}var K2=function(t){var e=t.sideCar,n=q2(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Fs({},n))};K2.isSideCarExport=!0;function JH(t,e){return t.useMedium(e),K2}var G2=YH(),Ov=function(){},iy=y.forwardRef(function(t,e){var n=y.useRef(null),r=y.useState({onScrollCapture:Ov,onWheelCapture:Ov,onTouchMoveCapture:Ov}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,h=t.shards,p=t.sideCar,f=t.noRelative,g=t.noIsolation,m=t.inert,v=t.allowPinchZoom,x=t.as,b=x===void 0?"div":x,w=t.gapMode,k=q2(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=p,E=qH([n,e]),N=Fs(Fs({},k),s);return y.createElement(y.Fragment,null,d&&y.createElement(j,{sideCar:G2,removeScrollBar:u,shards:h,noRelative:f,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),o?y.cloneElement(y.Children.only(a),Fs(Fs({},N),{ref:E})):y.createElement(b,Fs({},N,{className:c,ref:E}),a))});iy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};iy.classNames={fullWidth:xp,zeroRight:vp};var QH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function XH(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=QH();return e&&t.setAttribute("nonce",e),t}function ZH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function eW(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var tW=function(){var t=0,e=null;return{add:function(n){t==0&&(e=XH())&&(ZH(e,n),eW(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},nW=function(){var t=tW();return function(e,n){y.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Y2=function(){var t=nW(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},rW={left:0,top:0,right:0,gap:0},Pv=function(t){return parseInt(t||"",10)||0},sW=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[Pv(n),Pv(r),Pv(s)]},iW=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return rW;var e=sW(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},oW=Y2(),ac="data-scroll-locked",aW=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),` 414 .`.concat(UH,` { 415 overflow: hidden `).concat(r,`; 416 padding-right: `).concat(a,"px ").concat(r,`; 417 } 418 body[`).concat(ac,`] { 419 overflow: hidden `).concat(r,`; 420 overscroll-behavior: contain; 421 `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` 422 padding-left: `.concat(s,`px; 423 padding-top: `).concat(i,`px; 424 padding-right: `).concat(o,`px; 425 margin-left:0; 426 margin-top:0; 427 margin-right: `).concat(a,"px ").concat(r,`; 428 `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";
428")].filter(Boolean).join(""),` 429 } 430 431 .`).concat(vp,` { 432 right: `).concat(a,"px ").concat(r,`; 433 } 434 435 .`).concat(xp,` { 436 margin-right: `).concat(a,"px ").concat(r,`; 437 } 438 439 .`).concat(vp," .").concat(vp,` { 440 right: 0 `).concat(r,`; 441 } 442 443 .`).concat(xp," .").concat(xp,` { 444 margin-right: 0 `).concat(r,`; 445 } 446 447 body[`).concat(ac,`] { 448 `).concat(VH,": ").concat(a,`px; 449 } 450`)},pj=function(){var t=parseInt(document.body.getAttribute(ac)||"0",10);return isFinite(t)?t:0},lW=function(){y.useEffect(function(){return document.body.setAttribute(ac,(pj()+1).toString()),function(){var t=pj()-1;t<=0?document.body.removeAttribute(ac):document.body.setAttribute(ac,t.toString())}},[])},cW=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;lW();var i=y.useMemo(function(){return iW(s)},[s]);return y.createElement(oW,{styles:aW(i,!e,s,n?"":"!important")})},Zb=!1;if(typeof window<"u")try{var Mf=Object.defineProperty({},"passive",{get:function(){return Zb=!0,!0}});window.addEventListener("test",Mf,Mf),window.removeEventListener("test",Mf,Mf)}catch{Zb=!1}var Cl=Zb?{passive:!1}:!1,uW=function(t){return t.tagName==="TEXTAREA"},J2=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!uW(t)&&n[e]==="visible")},dW=function(t){return J2(t,"overflowY")},hW=function(t){return J2(t,"overflowX")},mj=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Q2(t,r);if(s){var i=X2(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fW=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},pW=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Q2=function(t,e){return t==="v"?dW(e):hW(e)},X2=function(t,e){return t==="v"?fW(e):pW(e)},mW=function(t,e){return t==="h"&&e==="rtl"?-1:1},gW=function(t,e,n,r,s){var i=mW(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,c=e.contains(a),u=!1,d=o>0,h=0,p=0;do{if(!a)break;var f=X2(t,a),g=f[0],m=f[1],v=f[2],x=m-v-i*g;(g||x)&&Q2(t,a)&&(h+=x,p+=g);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(p)<1||!s))&&(u=!0),u},If=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},gj=function(t){return[t.deltaX,t.deltaY]},yj=function(t){return t&&"current"in t?t.current:t},yW=function(t,e){return t[0]===e[0]&&t[1]===e[1]},vW=function(t){return` 451 .block-interactivity-`.concat(t,` {pointer-events: none;} 452 .allow-interactivity-`).concat(t,` {pointer-events: all;} 453`)},xW=0,jl=[];function bW(t){var e=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(xW++)[0],i=y.useState(Y2)[0],o=y.useRef(t);y.useEffect(function(){o.current=t},[t]),y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var m=FH([t.lockRef.current],(t.shards||[]).map(yj),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=y.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var x=If(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-x[0],k="deltaY"in m?m.deltaY:b[1]-x[1],j,E=m.target,N=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in m&&N==="h"&&E.type==="range")return!1;var S=mj(N,E);if(!S)return!0;if(S?j=N:(j=N==="v"?"h":"v",S=mj(N,E)),!S)return!1;if(!r.current&&"changedTouches"in m&&(w||k)&&(r.current=j),!j)return!0;var C=r.current||j;return gW(C,v,m,C==="h"?w:k,!0)},[]),c=y.useCallback(function(m){var v=m;if(!(!jl.length||jl[jl.length-1]!==i)){var x="deltaY"in v?gj(v):If(v),b=e.current.filter(function(j){return j.name===v.type&&(j.target===v.target||v.target===j.shadowParent)&&yW(j.delta,x)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}
vendor: 9,053 bytes, lines 453-457
453if(!b){var w=(o.current.shards||[]).map(yj).filter(Boolean).filter(function(j){return j.contains(v.target)}),k=w.length>0?a(v,w[0]):!o.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),u=y.useCallback(function(m,v,x,b){var w={name:m,delta:v,target:x,should:b,shadowParent:wW(x)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(k){return k!==w})},1)},[]),d=y.useCallback(function(m){n.current=If(m),r.current=void 0},[]),h=y.useCallback(function(m){u(m.type,gj(m),m.target,a(m,t.lockRef.current))},[]),p=y.useCallback(function(m){u(m.type,If(m),m.target,a(m,t.lockRef.current))},[]);y.useEffect(function(){return jl.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Cl),document.addEventListener("touchmove",c,Cl),document.addEventListener("touchstart",d,Cl),function(){jl=jl.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Cl),document.removeEventListener("touchmove",c,Cl),document.removeEventListener("touchstart",d,Cl)}},[]);var f=t.removeScrollBar,g=t.inert;return y.createElement(y.Fragment,null,g?y.createElement(i,{styles:vW(s)}):null,f?y.createElement(cW,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function wW(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const kW=JH(G2,bW);var Ck=y.forwardRef(function(t,e){return y.createElement(iy,Fs({},t,{ref:e,sideCar:kW}))});Ck.classNames=iy.classNames;var SW=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Nl=new WeakMap,Df=new WeakMap,Lf={},Mv=0,Z2=function(t){return t&&(t.host||Z2(t.parentNode))},CW=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Z2(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},jW=function(t,e,n,r){var s=CW(e,Array.isArray(t)?t:[t]);Lf[n]||(Lf[n]=new WeakMap);var i=Lf[n],o=[],a=new Set,c=new Set(s),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};s.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))d(p);else try{var f=p.getAttribute(r),g=f!==null&&f!=="false",m=(Nl.get(p)||0)+1,v=(i.get(p)||0)+1;Nl.set(p,m),i.set(p,v),o.push(p),m===1&&g&&Df.set(p,!0),v===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return d(e),a.clear(),Mv++,function(){o.forEach(function(h){var p=Nl.get(h)-1,f=i.get(h)-1;Nl.set(h,p),i.set(h,f),p||(Df.has(h)||h.removeAttribute(r),Df.delete(h)),f||h.removeAttribute(n)}),Mv--,Mv||(Nl=new WeakMap,Nl=new WeakMap,Df=new WeakMap,Lf={})}},eO=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=SW(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),jW(r,s,n,"aria-hidden")):function(){return null}},oy="Dialog",[tO,Boe]=Ns(oy),[NW,_s]=tO(oy),nO=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=y.useRef(null),c=y.useRef(null),[u,d]=Ci({prop:r,defaultProp:s??!1,onChange:i,caller:oy});return l.jsx(NW,{scope:e,triggerRef:a,contentRef:c,contentId:vi(),titleId:vi(),descriptionId:vi(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(h=>!h),[d]),modal:o,children:n})};nO.displayName=oy;var rO="DialogTrigger",sO=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=_s(rO,n),i=ot(e,s.triggerRef);return l.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":_k(s.open),...r,ref:i,onClick:Ce(t.onClick,s.onOpenToggle)})});sO.displayName=rO;var jk="DialogPortal",[_W,iO]=tO(jk,{forceMount:void 0}),oO=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=_s(jk,e);return l.jsx(_W,{scope:e,forceMount:n,children:y.Children.map(r,o=>l.jsx(ta,{present:n||i.open,children:l.jsx(Fg,{asChild:!0,container:s,children:o})}))})};oO.displayName=jk;var fm="DialogOverlay",aO=y.forwardRef((t,e)=>{const n=iO(fm,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=_s(fm,t.__scopeDialog);return i.modal?l.jsx(ta,{present:r||i.open,children:l.jsx(TW,{...s,ref:e})}):null});aO.displayName=fm;var EW=Oc("DialogOverlay.RemoveScroll"),TW=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=_s(fm,n);return l.jsx(Ck,{as:EW,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(Ae.div,{"data-state":_k(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Ja="DialogContent",lO=y.forwardRef((t,e)=>{const n=iO(Ja,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=_s(Ja,t.__scopeDialog);return l.jsx(ta,{present:r||i.open,children:i.modal?l.jsx(RW,{...s,ref:e}):l.jsx(AW,{...s,ref:e})})});lO.displayName=Ja;var RW=y.forwardRef((t,e)=>{const n=_s(Ja,t.__scopeDialog),r=y.useRef(null),s=ot(e,n.contentRef,r);return y.useEffect(()=>{const i=r.current;if(i)return eO(i)},[]),l.jsx(cO,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ce(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Ce(t.onFocusOutside,i=>i.preventDefault())})}),AW=y.forwardRef((t,e)=>{const n=_s(Ja,t.__scopeDialog),r=y.useRef(!1),s=y.useRef(!1);return l.jsx(cO,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),cO=y.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=_s(Ja,n),c=y.useRef(null),u=ot(e,c);return W2(),l.jsxs(l.Fragment,{children:[l.jsx(Sk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(Fh,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":_k(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(OW,{titleId:a.titleId}),l.jsx(MW,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Nk="DialogTitle",uO=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=_s(Nk,n);return l.jsx(Ae.h2,{id:s.titleId,...r,ref:e})});uO.displayName=Nk;var dO="DialogDescription",hO=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=_s(dO,n);return l.jsx(Ae.p,{id:s.descriptionId,...r,ref:e})});hO.displayName=dO;var fO="DialogClose",pO=y.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=_s(fO,n);return l.jsx(Ae.button,{type:"button",...r,ref:e,onClick:Ce(t.onClick,()=>s.onOpenChange(!1))})});pO.displayName=fO;function _k(t){return t?"open":"closed"}var mO="DialogTitleWarning",[zoe,gO]=Jz(mO,{contentName:Ja,titleName:Nk,docsSlug:"dialog"}),OW=({titleId:t})=>{const e=gO(mO),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 454 455If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 456 457For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},PW="DialogDescriptionWarning",MW=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gO(PW).contentName}}.`;return y.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},yO=nO,IW=sO,vO=oO,ay=aO,ly=lO,cy=uO,uy=hO,xO=pO;const Es=yO,Ek=IW,DW=vO,bO=y.forwardRef(({className:t,...e},n)=>l.jsx(ay,{ref:n,className:se("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",t),...e}));bO.displayName=ay.displayName;const es=y.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(DW,{children:[l.jsx(bO,{}),l.jsxs(ly,{ref:r,className:se("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",t),...n,children:[e,l.jsxs(xO,{className:"absolute right-4 top-4 roun
457ded-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(nu,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));es.displayName=ly.displayName;const ts=({className:t,...e})=>l.jsx("div",{className:se("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});ts.displayName="DialogHeader";const _r=y.forwardRef(({className:t,...e},n)=>l.jsx(cy,{ref:n,className:se("text-lg font-semibold leading-none tracking-tight",t),...e}));_r.displayName=cy.displayName;const pm=y.forwardRef(({className:t,...e},n)=>l.jsx(uy,{ref:n,className:se("text-sm text-muted-foreground",t),...e}));pm.displayName=uy.displayName;const ue=y.forwardRef(({className:t,type:e,...n},r)=>l.jsx("input",{type:e,className:se("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",t),ref:r,...n}));ue.displayName="Input";const LW=tu("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"}}),q=y.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const o=r?eu:"button";return l.jsx(o,{className:se(LW({variant:e,size:n,className:t})),ref:i,...s})});q.displayName="Button";var wO={exports:{}},$W="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",BW=$W,zW=BW;function kO(){}function SO(){}SO.resetWarningCache=kO;var FW=function(){function t(r,s,i,o,a,c){if(c!==zW){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}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:SO,resetWarningCache:kO};return n.PropTypes=n,n};wO.exports=FW();var UW=wO.exports;const Gt=wg(UW);function vj(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function xj(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?vj(Object(n),!0).forEach(function(r){CO(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vj(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function bp(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bp=function(e){return typeof e}:bp=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bp(t)}function CO(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VW(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function HW(t,e){if(t==null)return{};var n=VW(t,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function jO(t,e){return WW(t)||qW(t,e)||KW(t,e)||GW()}function WW(t){if(Array.isArray(t))return t}function qW(t,e){var n=t&&(typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"]);if(n!=null){var r=[],s=!0,i=!1,o,a;try{for(n=n.call(t);!(s=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function KW(t,e){if(t){if(typeof t=="string")return bj(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bj(t,e)}}function bj(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}
457function GW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 458In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Kn=function(e,n,r){var s=!!r,i=V.useRef(r);V.useEffect(function(){i.current=r},[r]),V.useEffect(function(){if(!s||!e)return function(){};var o=function(){i.current&&i.current.apply(i,arguments)};return e.on(n,o),function(){e.off(n,o)}},[s,n,e,i])},ew=function(e){var n=V.useRef(e);return V.useEffect(function(){n.current=e},[e]),n.current},Dc=function(e){return e!==null&&bp(e)==="object"},YW=function(e){return Dc(e)&&typeof e.then=="function"},JW=function(e){return Dc(e)&&typeof e.elements=="function"&&typeof e.createToken=="function"&&typeof e.createPaymentMethod=="function"&&typeof e.confirmCardPayment=="function"},wj="[object Object]",QW=function t(e,n){if(!Dc(e)||!Dc(n))return e===n;var r=Array.isArray(e),s=Array.isArray(n);if(r!==s)return!1;var i=Object.prototype.toString.call(e)===wj,o=Object.prototype.toString.call(n)===wj;if(i!==o)return!1;if(!i&&!r)return e===n;var a=Object.keys(e),c=Object.keys(n);if(a.length!==c.length)return!1;for(var u={},d=0;d<a.length;d+=1)u[a[d]]=!0;for(var h=0;h<c.length;h+=1)u[c[h]]=!0;var p=Object.keys(u);if(p.length!==a.length)return!1;var f=e,g=n,m=function(x){return t(f[x],g[x])};return p.every(m)},XW=function(e,n,r){return Dc(e)?Object.keys(e).reduce(function(s,i){var o=!Dc(n)||!QW(e[i],n[i]);return r.includes(i)?(o&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),s):o?xj(xj({},s||{}),{},CO({},i,e[i])):s},null):null},NO="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",kj=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NO;if(e===null||JW(e))return e;throw new Error(n)},ZW=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NO;if(YW(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(s){return kj(s,n)})};var r=kj(e,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},eq=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:"react-stripe-js",version:"6.2.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.2.0",url:"https://stripe.com/docs/stripe-js/react"}))},_O=V.createContext(null);_O.displayName="ElementsContext";var tq=function(e,n){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return e};Gt.any,Gt.object;Gt.func.isRequired;var EO=V.createContext(null);EO.displayName="CheckoutContext";var Sj=function(e){var n=V.useContext(EO),r=V.useContext(_O);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."));return n}else return tq(r,e)},nq=["mode"],rq=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},an=function(e,n,r){var s="".concat(rq(e),"Element"),i=function(u){var d=u.id,h=u.className,p=u.options,f=p===void 0?{}:p,g=u.onBlur,m=u.onFocus,v=u.onReady,x=u.onChange,b=u.onEscape,w=u.onClick,k=u.onLoadError,j=u.onLoaderStart,E=u.onNetworksChange,N=u.onConfirm,S=u.onCancel,C=u.onShippingAddressChange,_=u.onShippingRateChange,R=u.onSavedPaymentMethodRemove,O=u.onSavedPaymentMethodUpdate,L=Sj("mounts <".concat(s,">")),A="elements"in L?L.elements:null,z="checkoutState"in L?L.checkoutState:null,F=(z==null?void 0:z.type)==="success"||(z==null?void 0:z.type)==="loading"?z.sdk:null,H=V.useState(null),I=jO(H,2),T=I[0],U=I[1],M=V.useRef(null),$=V.useRef(null);Kn(T,"blur",g),Kn(T,"focus",m),Kn(T,"escape",b),Kn(T,"click",w),Kn(T,"loaderror",k),Kn(T,"loaderstart",j),Kn(T,"networkschange",E),Kn(T,"confirm",N),Kn(T,"cancel",S),Kn(T,"shippingaddresschange",C),Kn(T,"shippingratechange",_),Kn(T,"savedpaymentmethodremove",R),Kn(T,"savedpaymentmethodupdate",O),Kn(T,"change",x);var B;v&&(e==="expressCheckout"?B=v:B=function(){v(T)}),Kn(T,"ready",B),V.useLayoutEffect(function(){if(M.current===null&&$.current!==null&&(A||F)){var X=null;if(F){var oe=F,K=F;switch(e){case"paymentForm":X=K.createForm(f);break;case"payment":X=oe.createPaymentElement(f);break;case"address":if("mode"in f){var Z=f.mode,ie=HW(f,nq);if(Z==="shipping")X=oe.createShippingAddressElement(ie);else if(Z==="billing")X=oe.createBillingAddressElement(ie);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":X=oe.createExpressCheckoutElement(f);break;case"currencySelector":X=F.createCurrencySelectorElement();break;case"taxId":X=oe.createTaxIdElement(f);break;case"contactDetails":X=oe.createContactDetailsElement();break;default:throw new Error("<".concat(s,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else A&&(X=A.create(e,f));M.current=X,U(X),X&&X.mount($.current)}},[A,F,f]);var G=ew(f);return V.useEffect(function(){if(M.current){var X=XW(f,G,["paymentRequest"]);X&&"update"in M.current&&M.current.update(X)}},[f,G]),V.useLayoutEffect(function(){return function(){if(M.current&&typeof M.current.destroy=="function")try{M.current.destroy(),M.current=null}catch{}}},[]),V.createElement("div",{id:d,className:h,ref:$})},o=function(u){Sj("mounts <".concat(s,">"));var d=u.id,h=u.className;return V.createElement("div",{id:d,className:h})},a=n?o:i;return a.propTypes={id:Gt.string,className:Gt.string,onChange:Gt.func,onBlur:Gt.func,onFocus:Gt.func,onReady:Gt.func,onEscape:Gt.func,onClick:Gt.func,onLoadError:Gt.func,onLoaderStart:Gt.func,onNetworksChange:Gt.func,onConfirm:Gt.func,onCancel:Gt.func,onShippingAddressChange:Gt.func,onShippingRateChange:Gt.func,onSavedPaymentMethodRemove:Gt.func,onSavedPaymentMethodUpdate:Gt.func,options:Gt.object},a.displayName=s,a.__elementType=e,a},Qt=typeof window>"u",Tk=V.createContext(null);Tk.displayName="EmbeddedCheckoutProviderContext";var TO=function(){var e=V.useContext(Tk);if(!e)throw new Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return e},sq="Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",iq=function(e){var n=e.stripe,r=e.options,s=e.children,i=V.useMemo(function(){return ZW(n,sq)},[n]),o=V.useRef(null),a=V.useRef(null),c=V.useState({embeddedCheckout:null}),u=jO(c,2),d=u[0],h=u[1];V.useEffect(function(){if(!(a.current||o.current)){var g=function(v){a.current||o.current||(a.current=v,o.current=a.current.createEmbeddedCheckoutPage(r).then(function(x){h({embeddedCheckout:x})}))};i.tag==="async"&&!a.current&&(r.clientSecret||r.fetchClientSecret)?i.stripePromise.then(function(m){m&&g(m)}):i.tag==="sync"&&!a.current&&(r.clientSecret||r.fetchClientSecret)&&g(i.stripe)}},[i,r,d,a]),V.useEffect(function(){return function(){d.embeddedCheckout?(o.current=null,d.embeddedCheckout.destroy()):o.current&&o.current.then(function(){o.current=null,d.embeddedCheckout&&d.embeddedCheckout.destroy()})}},[d.embeddedCheckout]),V.useEffect(function(){eq(a)},[a]);var p=ew(n);V.useEffect(function(){p!==null&&p!==n&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")},[p,n]);var f=ew(r);return V.useEffect(function(){if(f!=null){if(r==null){console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");return}r.clientSecret===void 0&&r.fetchClientSecret===void 0&&console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."),f.clientSecret!=null&&r.clientSecret!==f.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),f.fetchClientSecret!=null&&r.fetchClientSecret!==f.fetchClientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),f.onComplete!=null&&r.onComplete!==f.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."),f.onShippingDetailsChange!=null&&r.onShippingDetailsChange!==f.onShippingDetailsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."),f.onLineItemsChange!=null&&r.onLineItemsChange!==f.onLineItemsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.")}},[f,r]),V.createElement(Tk.Provider,{value:d},s)},oq=function(e){var n=e.id,r=e.className,s=TO(),i=s.embeddedCheckout,o=V.useRef(!1),a=V.useRef(null);return V.useLayoutEffect(function(){return!o.current&&i&&a.current!==null&&(i.mount(a.current),o.current=!0),function(){if(o.current&&i)try{i.unmount(),o.current=!1}catch{}}},[i]),V.createElement("div",{ref:a,id:n,className:r})},aq=function(e){var n=e.id,r=e.className;return TO(),V.createElement("div",{id:n,className:r})},lq=Qt?aq:oq;an("auBankAccount",Qt);an("card",Qt);an("cardNumber",Qt);an("cardExpiry",Qt);an("cardCvc",Qt);an("iban",Qt);an("payment",Qt);an("expressCheckout",Qt);an("paymentRequestButton",Qt);an("linkAuthentication",Qt);an("contactDetails",Qt);an("address",Qt);an("shippingAddress",Qt);an("paymentMethodMessaging",Qt);an("taxId",Qt);
458an("issuingCardNumberDisplay",Qt);an("issuingCardCvcDisplay",Qt);an("issuingCardExpiryDisplay",Qt);an("issuingCardPinDisplay",Qt);an("issuingCardCopyButton",Qt);function wp(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wp=function(e){return typeof e}:wp=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wp(t)}var RO="dahlia",cq=function(e){return e===3?"v3":e},AO="https://js.stripe.com",uq="".concat(AO,"/").concat(RO,"/stripe.js"),dq=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,hq=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,Cj="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",fq=function(e){return dq.test(e)||hq.test(e)},pq=function(){for(var e=document.querySelectorAll('script[src^="'.concat(AO,'"]')),n=0;n<e.length;n++){var r=e[n];if(fq(r.src))return r}return null},jj=function(e){var n="",r=document.createElement("script");r.src="".concat(uq).concat(n);var s=document.head||document.body;if(!s)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return s.appendChild(r),r},mq=function(e,n){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"9.2.0",startTime:n})},Eu=null,$f=null,Bf=null,gq=function(e){return function(n){e(new Error("Failed to load Stripe.js",{cause:n}))}},yq=function(e,n){return function(){window.Stripe?e(window.Stripe):n(new Error("Stripe.js not available"))}},vq=function(e){return Eu!==null?Eu:(Eu=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&e&&console.warn(Cj),window.Stripe){n(window.Stripe);return}try{var s=pq();if(s&&e)console.warn(Cj);else if(!s)s=jj(e);else if(s&&Bf!==null&&$f!==null){var i;s.removeEventListener("load",Bf),s.removeEventListener("error",$f),(i=s.parentNode)===null||i===void 0||i.removeChild(s),s=jj(e)}Bf=yq(n,r),$f=gq(r),s.addEventListener("load",Bf),s.addEventListener("error",$f)}catch(o){r(o);return}}),Eu.catch(function(n){return Eu=null,Promise.reject(n)}))},xq=function(e,n,r){if(e===null)return null;var s=n[0];if(typeof s!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(wp(s)," instead."));var i=s.match(/^pk_test/),o=cq(e.version),a=RO;i&&o!==a&&console.warn("Stripe.js@".concat(o," was loaded on the page, but @stripe/stripe-js@").concat("9.2.0"," expected Stripe.js@").concat(a,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var c=e.apply(void 0,n);return mq(c,r),c},Tu,OO=!1,PO=function(){return Tu||(Tu=vq(null).catch(function(e){return Tu=null,Promise.reject(e)}),Tu)};Promise.resolve().then(function(){return PO()}).catch(function(t){OO||console.warn(t)});var bq=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];OO=!0;var s=Date.now();return PO().then(function(i){return xq(i,n,s)})};const pa="pk_live_51MwY4ZKNNy7m2frwdv20YGbOe4yXdHTf8avQKaaVec52QjwCwZt3d2spC6d8Hvl7VvjDquQEizoEbTA5ZBmE2ING00BpqSWpUH";function MO(){if(pa!=null&&pa.startsWith("pk_test_"))return"sandbox";if(pa!=null&&pa.startsWith("pk_live_"))return"live";throw new Error("Payments are not configured for this build. Complete Stripe go-live in your Lovable project to enable production checkout.")}let Iv=null;function wq(){return Iv||(MO(),Iv=bq(pa)),Iv}function dy(){return MO()}function kq({priceId:t,quantity:e,customerEmail:n,userId:r,returnUrl:s,metadata:i,donationCents:o}){const a=async()=>{const c=s||`${window.location.origin}/checkout/return?session_id={CHECKOUT_SESSION_ID}`,{data:u,error:d}=await D.functions.invoke("create-checkout",{body:{priceId:t,quantity:e,customerEmail:n,userId:r,returnUrl:c,environment:dy(),metadata:i,donationCents:o}});if(d||!(u!=null&&u.clientSecret))throw new Error((d==null?void 0:d.message)||(u==null?void 0:u.error)||"Failed to create checkout session");return u.clientSecret};return l.jsx("div",{id:"checkout",children:l.jsx(iq,{stripe:wq(),options:{fetchClientSecret:a},children:l.jsx(lq,{})})})}function Rk(){const{user:t,signIn:e}=pr(),{toast:n}=ht(),[r,s]=y.useState(!1),[i,o]=y.useState(null),[a,c]=y.useState(null),[u,d]=y.useState(0),[h,p]=y.useState(!1),[f,g]=y.useState("signup"),[m,v]=y.useState(""),[x,b]=y.useState(""),[w,k]=y.useState(!1),j=y.useCallback(_=>{o(_),c(t?{email:t.email??_.customerEmail??"",userId:t.id}:null),v(_.customerEmail??""),b(""),g("signup"),d(0),p(!1),s(!0)},[t]),E=y.useCallback(()=>{s(!1),o(null),c(null),b(""),d(0),p(!1)},[]),N=async _=>{var R;if(_.preventDefault(),!(!m.trim()||!x)){k(!0);try{if(f==="signup"){const{data:O,error:L}=await D.auth.signUp({email:m.trim(),password:x,options:{emailRedirectTo:`${window.location.origin}/dashboard`}});if(L){n({title:"Sign up failed",description:L.message,variant:"destructive"});return}const A=(R=O.user)==null?void 0:R.id;c({email:m.trim(),userId:A}),n({title:"Account created",description:"Check your email to verify â your purchase will be waiting in y
458our dashboard."})}else{const{error:O}=await e(m.trim(),x);if(O){n({title:"Sign in failed",description:O.message,variant:"destructive"});return}c({email:m.trim()})}}finally{k(!1)}}},S=t?{email:t.email??(a==null?void 0:a.email)??"",userId:t.id}:a,C=l.jsx(Es,{open:r,onOpenChange:_=>_?s(!0):E(),children:l.jsxs(es,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[l.jsx(ts,{children:l.jsx(_r,{className:"font-heading text-xl",children:(i==null?void 0:i.title)??"Complete your purchase"})}),r&&i&&!S&&l.jsxs("div",{className:"space-y-5",children:[l.jsx("div",{className:"rounded border border-border bg-muted/40 p-4 text-sm text-foreground/80",children:f==="signup"?"Create a free account so your purchase shows up in your dashboard and you can access it any time.":"Sign in so your purchase is linked to your dashboard."}),l.jsxs("form",{onSubmit:N,className:"space-y-3",children:[l.jsx(ue,{type:"email",placeholder:"Email",required:!0,value:m,onChange:_=>v(_.target.value)}),l.jsx(ue,{type:"password",placeholder:"Password",required:!0,minLength:6,value:x,onChange:_=>b(_.target.value)}),l.jsx(q,{type:"submit",className:"w-full",disabled:w,children:w?"Please waitâ¦":f==="signup"?"Create account & continue":"Sign in & continue"})]}),l.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:[f==="signup"?"Already have an account?":"New here?"," ",l.jsx("button",{type:"button",onClick:()=>g(f==="signup"?"signin":"signup"),className:"text-primary underline hover:no-underline",children:f==="signup"?"Sign in":"Create an account"})]}),l.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["Prefer to check out as a guest?"," ",l.jsx("button",{type:"button",onClick:()=>c({email:m.trim()||i.customerEmail||"[email protected]"}),className:"underline hover:no-underline",children:"Continue without an account"}),". ",l.jsx(Be,{to:"/dashboard",className:"underline hover:no-underline",children:"Learn more"})]})]}),r&&i&&S&&!h&&l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"rounded border border-primary/30 bg-primary/5 p-4",children:[l.jsx("h3",{className:"font-heading text-lg text-foreground mb-2",children:"Add a Scholarship Fund donation?"}),l.jsx("p",{className:"text-sm text-foreground/80 leading-relaxed",children:"Donate to make these services available to someone who can't afford them â every penny goes to someone who wants to do this work."})]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[{label:"No thanks",cents:0},{label:"$1",cents:100},{label:"$5",cents:500},{label:"$10",cents:1e3}].map(_=>{const R=u===_.cents;return l.jsx("button",{type:"button",onClick:()=>d(_.cents),className:`px-4 py-3 border-2 text-sm font-body font-semibold transition-all ${R?"border-primary bg-primary text-primary-foreground":"border-border bg-background hover:border-primary/50"}`,children:_.label},_.cents)})}),l.jsxs(q,{type:"button",className:"w-full",onClick:()=>p(!0),children:["Continue to payment",u>0&&` (+ $${(u/100).toFixed(2)} donation)`]})]}),r&&i&&S&&h&&l.jsx(kq,{...i,customerEmail:S.email||i.customerEmail,userId:S.userId??i.userId,donationCents:u})]})});return{openCheckout:j,closeCheckout:E,isOpen:r,checkoutElement:C}}const IO="/assets/individual-bg-OqDWAHk3.jpg",Sq=[{key:"home_pc_price_1",price:"$500",title:"One Hour Session",description:"A single 60-minute session to get clarity on a specific decision, challenge, or transition with practical tools and expert guidance.",cta:"Schedule Session â",priceId:"individual_coaching_1_onetime"},{key:"home_pc_price_2",price:"$1,425",title:"3 - One Hour Sessions",description:"Three focused 1:1 sessions designed to help you clarify your goals, uncover patterns, and make meaningful progress toward your next step.",cta:"Schedule Sessions â",priceId:"individual_coaching_3_onetime"},{key:"home_pc_price_3",price:"$2,250",title:"5 - One Hour Sessions",description:"A deeper coaching journey over five sessions to explore complex decisions, align with your values, and build lasting confidence and momentum.",cta:"Schedule Sessions â",priceId:"individual_coaching_5_onetime"}],Cq=()=>{const{openCheckout:t,checkoutElement:e}=Rk(),{user:n}=pr();return l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"relative overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:`url(${IO})`}}),l.jsx("div",{className:"absolute inset-0",style:{backgroundColor:"rgba(24, 24, 24, 0.55)"}}),l.jsx("div",{className:"relative z-10 container mx-auto px-6 md:px-12 lg:px-24 py-20 md:py-28",children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"home_pc_eyebrow",defaultValue:"Clarity. Confidence. Direction.",as:"p",className:"font-heading text-lg tracking-wide mb-3 text-white/80"}),l.jsx(fe,{contentKey:"home_pc_heading",defaultValue:"Individual Coaching",as:"h2",className:"font-heading text-4xl md:text-5xl lg:text-6xl font-bold text-white leading-[1.1] mb-6",style:{textWrap:"balance"}}),l.jsx(fe,{contentKey:"home_pc_body",as:"div",className:"font-body text-base md:text-lg leading-relaxed text-white/85 mb-6",html:!0,defaultValue:"If you want support with a big decision about work or your career, book an Indiv
458idual Coaching session. Stephanie will provide practical tools to help you clarify your goals, responsibilities, dreams, and values, while navigating any old familial or cultural narratives that no longer serve. Based on the content in her book <em>The Saint and the Drunk: A Guide to Making the Big Decisions in Your Life</em>, these one-hour 1:1 video sessions can help you tune into the genius of your body and work with any resistance or fear that may arise."}),l.jsx("a",{href:"#book-appointment",className:"inline-block bg-white border border-primary text-primary px-6 py-3 font-body text-sm font-semibold uppercase tracking-wider hover:bg-primary hover:text-primary-foreground transition-colors active:scale-[0.97]",children:"Schedule a Coaching Session"})]}),l.jsxs(re,{animation:"fade-left",delay:200,children:[l.jsx("div",{className:"w-full max-w-md mx-auto rounded shadow-xl overflow-hidden",children:l.jsx("div",{className:"wistia_responsive_padding",style:{padding:"56.25% 0 0 0",position:"relative"},children:l.jsx("div",{className:"wistia_responsive_wrapper",style:{height:"100%",left:0,position:"absolute",top:0,width:"100%"},children:l.jsx("iframe",{src:"https://fast.wistia.net/embed/iframe/fxyst90jbs?seo=true&videoFoam=true",title:"Stephanie Peirolo Coaching Video",allow:"autoplay; fullscreen",frameBorder:"0",scrolling:"no",className:"wistia_embed",name:"wistia_embed",width:"100%",height:"100%",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}})})})}),l.jsx("p",{className:"text-center text-sm text-white/60 mt-3",children:"Watch above for more about Stephanie's process"})]})]})})]}),l.jsx("section",{id:"book-appointment",className:"bg-background py-20 md:py-28",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsx(re,{animation:"fade-up",children:l.jsx(fe,{contentKey:"home_pc_pricing_heading",defaultValue:"Book Your First Appointment",as:"h2",className:"font-heading text-3xl md:text-4xl font-bold text-foreground text-center mb-16"})}),l.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:Sq.map((r,s)=>l.jsx(re,{animation:"fade-up",delay:s*120,children:l.jsxs("div",{className:"bg-card border border-border rounded overflow-hidden shadow-md hover:shadow-xl transition-shadow p-6",children:[l.jsx(fe,{contentKey:`${r.key}_price`,defaultValue:r.price,as:"p",className:"font-heading text-sm font-bold text-primary uppercase tracking-wider mb-1"}),l.jsx(fe,{contentKey:`${r.key}_title`,defaultValue:r.title,as:"h3",className:"font-heading text-xl font-bold text-foreground mb-3"}),l.jsx(fe,{contentKey:`${r.key}_desc`,defaultValue:r.description,as:"p",className:"font-body text-sm text-muted-foreground leading-relaxed mb-6"}),l.jsx("button",{type:"button",onClick:()=>t({priceId:r.priceId,customerEmail:n==null?void 0:n.email,userId:n==null?void 0:n.id,title:`${r.title} â ${r.price}`,returnUrl:`${window.location.origin}/checkout/return?session_id={CHECKOUT_SESSION_ID}&dest=coaching`,metadata:{purchase_source:`purchase_${r.priceId}`,product_label:r.title}}
458),className:"inline-block border border-primary text-primary px-5 py-2.5 font-body text-sm font-semibold uppercase tracking-wider hover:bg-primary hover:text-primary-foreground transition-colors active:scale-[0.97]",children:r.cta})]})},r.key))})]})}),e]})},Us=({contentKey:t,defaultSrc:e,alt:n,className:r=""})=>{const{isEditMode:s,getContent:i,setContent:o}=kk(),[a,c]=y.useState(!1),u=i(t,e);return s?l.jsxs("div",{className:"relative group",children:[l.jsx("img",{src:u,alt:n,className:`${r} outline-2 outline-dashed outline-blue-400/60 group-hover:outline-blue-500`,loading:"lazy"}),l.jsx("button",{onClick:()=>c(!a),className:"absolute top-2 right-2 bg-blue-600 text-white p-1.5 rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx(jA,{className:"h-4 w-4"})}),a&&l.jsxs("div",{className:"absolute top-10 right-2 z-50 bg-white border shadow-xl rounded p-3 min-w-[300px]",children:[l.jsx("label",{className:"text-xs font-medium text-gray-700 mb-1 block",children:"Image URL"}),l.jsx("input",{type:"url",value:u,onChange:d=>o(t,d.target.value),className:"w-full border rounded px-2 py-1.5 text-sm",placeholder:"https://...",autoFocus:!0}),l.jsx("button",{onClick:()=>c(!1),className:"mt-2 text-xs text-blue-600 hover:underline",children:"Done"})]})]}):l.jsx("img",{src:u,alt:n,className:r,loading:"lazy"})},jq=[{key:"more_1",image:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/5356232-1d06-03a-fb6d-b026ff7c38_mj-s-cw2ai6A_eeM-unsplash.jpg",title:"Fierce Grace",description:"The Substack about big feelings, better work, and more",linkText:"Read",link:"/blog"},{key:"more_2",image:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/6ec5b24-568-e12-ee7d-2043e10f0a3_7b03fd35-cf28-4721-bb3b-79141aceb808.png",title:"The Bad Boss Brief podcast",description:"Bad Bosses, old friends, real talk",linkText:"Watch & Listen",link:"/podcast"},{key:"more_3",image:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/c4dbd87-8e87-dc17-a1ea-d686351ed42_photo_by_Daniel_Berman_1_.png",title:"Corporate Coaching and Training Programs",description:"For businesses and non-profits",linkText:"View Corporate Programs",link:"/corporate-coaching"}],Nq=()=>l.jsx("section",{className:"bg-background py-20 md:py-28",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsxs(re,{animation:"fade-up",className:"text-center mb-12",children:[l.jsx("hr",{className:"border-border max-w-xs mx-auto mb-6"}),l.jsx(fe,{contentKey:"more_heading",defaultValue:"More from Stephanie",as:"h4",className:"text-foreground"})]}),l.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:jq.map((t,e)=>l.jsx(re,{animation:"scale-up",delay:e*150,children:l.jsxs("div",{className:"bg-card rounded border border-primary shadow-md hover:shadow-xl hover:-translate-y-1 transition-all duration-300 overflow-hidden h-full flex flex-col",children:[l.jsx("a",{href:t.link,...t.link.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},children:l.jsx(Us,{contentKey:`${t.key}_image`,defaultSrc:t.image,alt:t.title,className:"w-full h-56 object-cover transition-transform duration-500 hover:scale-105"})}),l.jsxs("div",{className:"p-6 flex flex-col flex-1",children:[l.jsx(fe,{contentKey:`${t.key}_title`,defaultValue:t.title,as:"h4",className:"mb-2 text-foreground"}),l.jsx(fe,{contentKey:`${t.key}_desc`,defaultValue:t.description,as:"p",className:"text-muted-foreground text-sm mb-6 flex-1"}),l.jsx("a",{href:t.link,...t.link.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},className:"inline-block border border-foreground px-6 py-2 font-body text-xs font-bold uppercase tracking-wider text-foreground transition-colors hover:bg-foreground hover:text-background active:scale-[0.97] self-start",children:t.linkText})]})]})},t.key))})]})}),DO="/assets/contact-bg-CVLSJsvC.png",au=()=>{const[t,e]=y.useState(""),[n,r]=y.useState(""),[s,i]=y.useState(""),[o,a]=y.useState(!1),{toast:c}=ht(),u=async d=>{d.preventDefault(),a(!0);const{error:h}=await D.from("form_submissions").insert({name:t,email:n,message:s,source:"contact"});if(a(!1),h)c({title:"Error",description:"Something went wrong. Please try again.",variant:"destructive"});else{const p=Date.now();D.functions.invoke("send-transactional-email",{body:{templateName:"contact-confirmation",recipientEmail:n,idempotencyKey:`contact-${n}-${p}`,templateData:{name:t}}}).catch(()=>{}),D.functions.invoke("send-transactional-email",{body:{templateName:"contact-notification",idempotencyKey:`contact-notify-${n}-${p}`,templateData:{name:t,email:n,message:s}}}).catch(()=>{}),c({title:"Message sent!",description:"Stephanie will get back to you soon."}),e(""),r(""),i("")}};return l.jsxs("section",{id:"contact",className:"relative py-20 md:py-28 overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:`url(${DO})`}}),l.jsx("div",{className:"absolute inset-0",style:{backgroundColor:"rgba(24, 24, 24, 0.7)"}}),l.jsx("div",{className:"relative z-10 container mx-auto px-6 md:px-12 lg:px-24 flex justify-center",children:l.jsx(re,{animation:"scale-up",className:"w-full max-w-lg",children:l.jsxs("div",{className:"bg-secondary text-foreground rounded shadow-lg p-8 md:p-12",children:[l.jsx("h4",{className:"text-center mb-2 text-foreground",children:"Get In Touch"}),l.jsx("p",{className:"text-center font-heading text-xl text-foreground mb-8",children:"Tell me more"}),l.jsxs("form",{onSubmit:u,className:"space-y-4",children:[l.jsx("input",{type:"text",placeholder:"Name",required:!0,value:t,onChange:d=>e(d.target.value),className:"w-full border border-input bg-background px-4 py-3 text-sm rounded font-body text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),l.jsx("input",{type:"email",placeholder:"Email",required:!0,value:n,onChange:d=>r(d.target.value),className:"w-full border border-input bg-background px-4 py-3 text-sm rounded font-body text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),l.jsx("textarea",{placeholder:"How can I help?",required:!0,rows:4,value:s,onChange:d=>i(d.target.value),className:"w-full border border-input bg-background px-4 py-3 text-sm rounded font-body text-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none"}),l.jsx("button",{type:"submit",disabled:o,className:"w-full bg-primary text-primary-foreground py-3 font-body text-sm font-bold uppercase tracking-wider transition-all hover:brightness-[1.2] active:scale-[0.97] disabled:opacity-50",children:o?"Sending...":"Submit"})]})]})})})]})},LO=()=>{const[t,e]=y.useState(""),[n,r]=y.useState(!1),{toast:s}=ht(),i=async o=>{o.preventDefault(),r(!0);const{error:a}=await D.from("form_submissions").insert({email:t,source:"newsletter"});r(!1),a?s({title:"Error",description:"Something went wrong.",variant:"destructive"}):(s({title:"Thanks for signing up!",description:"You'll hear from us soon."}),e(""))};return l.jsx("section",{className:"section-light py-16 md:py-20",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 flex justify-center",children:l.jsxs(re,{animation:"fade-up",className:"w-full max-w-lg",children:[l.jsx("p",{className:"text-sm text-foreground
458/80 mb-4",children:"To find out about the latest events, classes and offerings, sign up here."}),l.jsxs("form",{onSubmit:i,className:"flex flex-col sm:flex-row gap-3",children:[l.jsx("input",{type:"email",placeholder:"Email",required:!0,value:t,onChange:o=>e(o.target.value),className:"flex-1 border border-input bg-background px-4 py-3 text-sm rounded font-body text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),l.jsx("button",{type:"submit",disabled:n,className:"border border-foreground px-6 py-3 font-body text-xs font-bold uppercase tracking-wider text-foreground transition-colors hover:bg-foreground hover:text-background active:scale-[0.97] whitespace-nowrap disabled:opacity-50",children:n?"...":"Keep in touch"})]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:"I don't sell any of your data, I will reach out sparingly, and it's easy to unsubscribe."})]})})})},Ye=()=>l.jsx("footer",{className:"section-light py-10",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 flex flex-col sm:flex-row items-center justify-between gap-4",children:[l.jsx("p",{className:"text-sm text-foreground/70",children:"© 2026 Stephanie Peirolo"}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("a",{href:"https://www.linkedin.com/in/speirolo/",target:"_blank",rel:"noopener noreferrer",className:"text-foreground/60 hover:text-primary transition-colors","aria-label":"LinkedIn",children:l.jsx(EA,{size:20})}),l.jsx("a",{href:"https://www.instagram.com/",target:"_blank",rel:"noopener noreferrer",className:"text-foreground/60 hover:text-primary transition-colors","aria-label":"Instagram",children:l.jsx(_A,{size:20})}),l.jsx("a",{href:"https://www.tiktok.com/",target:"_blank",rel:"noopener noreferrer",className:"text-foreground/60 hover:text-primary transition-colors","aria-label":"TikTok",children:l.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:"M9 12a4 4 0 1 0 4 4V4a
4585 5 0 0 0 5 5"})})})]})]})}),Mi=()=>{const{isAdmin:t,isEditMode:e,toggleEditMode:n,saveAll:r,cancelEditing:s,hasChanges:i,saving:o}=kk();return t?e?l.jsx("div",{className:"fixed top-0 left-0 right-0 z-[9999] bg-blue-600 text-white shadow-lg",children:l.jsxs("div",{className:"container mx-auto px-4 py-2.5 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(sm,{className:"h-4 w-4"}),l.jsx("span",{className:"font-body text-sm font-semibold",children:"Editing Mode"}),i&&l.jsx("span",{className:"text-xs bg-white/20 px-2 py-0.5 rounded",children:"Unsaved changes"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:s,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm font-medium rounded bg-white/20 hover:bg-white/30 transition-colors",children:[l.jsx(nu,{className:"h-3.5 w-3.5"}),"Cancel"]}),l.jsxs("button",{onClick:r,disabled:o||!i,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm font-semibold rounded bg-white text-blue-600 hover:bg-blue-50 transition-colors disabled:opacity-50",children:[l.jsx(qg,{className:"h-3.5 w-3.5"}),o?"Saving...":"Save Changes"]})]})]})}):l.jsxs("button",{onClick:n,className:"fixed bottom-6 right-6 z-[9999] bg-blue-600 hover:bg-blue-700 text-white px-4 py-3 rounded-full shadow-2xl flex items-center gap-2 font-body text-sm font-semibold transition-all active:scale-[0.96]",children:[l.jsx(sm,{className:"h-4 w-4"}),"Edit Page"]}):null};function as(t,e,n,r){if(!r)return;let s=document.head.querySelector(t);s||(s=document.createElement("meta"),s.setAttribute(e,n),document.head.appendChild(s)),s.setAttribute("content",r)}function _q(t,e){let n=document.head.querySelector(`link[rel="${t}"]`);if(!e){n&&n.remove();return}n||(n=document.createElement("link"),n.setAttribute("rel",t),document.head.appendChild(n)),n.setAttribute("href",e)}const ut=({pageKey:t,title:e,description:n,image:r,canonical:s,noindex:i,type:o="website",jsonLd:a})=>{const{data:c}=iC({queryKey:["page_seo",t],enabled:!!t,queryFn:async()=>{const{data:d}=await D.from("page_seo").select("*").eq("page_key",t).maybeSingle();return d}}),{data:u}=iC({queryKey:["page_seo","__defaults__"],queryFn:async()=>{const{data:d}=await D.from("page_seo").select("*").eq("page_key","__defaults__").maybeSingle();return d}});return y.useEffect(()=>{const d=e||(c==null?void 0:c.title)||(u==null?void 0:u.title),h=n||(c==null?void 0:c.description)||(u==null?void 0:u.description),p=r||(c==null?void 0:c.og_image)||(u==null?void 0:u.og_image),f=s||(c==null?void 0:c.canonical_url)||(typeof window<"u"?window.location.href:""),g=i??(c==null?void 0:c.noindex)??!1;d&&(document.title=d),h&&as('meta[name="description"]',"name","description",h),d&&as('meta[property="og:title"]',"property","og:title",d),h&&as('meta[property="og:description"]',"property","og:description",h),p&&as('meta[property="og:image"]',"property","og:image",p),as('meta[property="og:type"]',"property","og:type",o),f&&as('meta[property="og:url"]',"property","og:url",f),as('meta[name="twitter:card"]',"name","twitter:card","summary_large_image"),d&&as('meta[name="twitter:title"]',"name","twitter:title",d),h&&as('meta[name="twitter:description"]',"name","twitter:description",h),p&&as('meta[name="twitter:image"]',"name","twitter:image",p),_q("canonical",f||""),as('meta[name="robots"]',"name","robots",g?"noindex,nofollow":"index,follow")},[e,n,r,s,i,o,c,u]),y.useEffect(()=>{if(!a)return;const d=document.createElement("script");return d.type="application/ld+json",d.setAttribute("data-seo-jsonld","true"),d.textContent=JSON.stringify(a),document.head.appendChild(d),()=>{d.remove()}},[a]),null},Eq=()=>l.jsx(Pi,{pageSlug:"home",children:l.jsxs("main",{children:[l.jsx(ut,{pageKey:"home"}),l.jsx(Ge,{}),l.jsx(OH,{}),l.jsx(PH,{}),l.jsx(Cq,{}),l.jsx(Nq,{}),l.jsx(au,{}),l.jsx(LO,{}),l.jsx(Ye,{}),l.jsx(Mi,{})]})}),Tq=()=>{const[t,e]=y.useState([]);return y.useEffect(()=>{D.from("press_items").select("*").eq("published",!0).order("position",{ascending:!0}).then(({data:n})=>e(n??[]))},[]),l.jsxs(l.Fragment,{children:[l.jsx(Ge,{}),l.jsxs("main",{children:[l.jsx(ut,{pageKey:"press-media"}),l.jsx("section",{className:"section-dark pt-28 pb-20 md:pt-36 md:pb-28",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:l.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-12 lg:gap-20",children:[l.jsxs("div",{className:"md:w-7/12",children:[l.jsx(re,{animation:"rise",children:l.jsx(fe,{contentKey:"press_heading",defaultValue:"Stephanie's Press & Media Releases",as:"h1",className:"mb-6"})}),l.jsx(re,{animation:"fade-up",delay:200,children:l.jsx(fe,{contentKey:"press_intro",defaultValue:"Stephanie Peirolo has been a sought-after guest on a wide range of podcasts and media platforms, where she shares her insightful perspective and authentic voice. Known for her compelling storytelling and thought leadership, Stephanie brings clarity and depth to every conversation. Browse below to explore her latest media appearances and engaging podcast interviews.",as:"p",className:"text-white/80 leading-relaxed mb-8"})}),l.jsx(re,{animation:"fade-up",delay:400,children:l.jsx("a",{href:"/contact",className:"inline-block bg-primary text-primary-foreground px-8 py-2.5 font-body text-sm font-bold uppercase tracking-wider shadow-sm transition-all duration-200 hover:brightness-[1.2] active:scale-[0.97]",children:"Book Stephanie on Your Show"})})]}),l.jsxs(re,{animation:"fade-in",delay:300,className:"md:w-5/12",children:[l.jsx(Us,{contentKey:"press_hero_image",defaultSrc:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2
458160578998/settings_images/82fbbb8-003-bdce-5328-a26a818603_Books.JPG.jpeg",alt:"Stephanie Peirolo with her books",className:"w-full rounded shadow-md"}),l.jsx("p",{className:"text-right text-xs italic text-white/60 mt-2",children:"Photo By Daniel Berman"})]})]})})}),l.jsx("section",{className:"bg-background py-20 md:py-28",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:l.jsx("div",{className:"space-y-16",children:t.map((n,r)=>l.jsx(re,{animation:r%2===0?"fade-right":"fade-left",delay:100,children:l.jsxs("div",{className:`flex flex-col ${r%2===0?"md:flex-row":"md:flex-row-reverse"} items-center gap-8 lg:gap-14`,children:[n.image_url&&l.jsx("div",{className:"md:w-5/12",children:l.jsx("img",{src:n.image_url,alt:n.title,className:"w-full rounded shadow-md object-contain"})}),l.jsxs("div",{className:n.image_url?"md:w-7/12":"w-full max-w-2xl mx-auto text-center",children:[l.jsx("span",{className:"inline-block font-body text-xs font-bold uppercase tracking-widest text-primary mb-2",children:n.item_type==="podcast"?"Podcast":n.item_type==="video"?"Video":"Article"}),l.jsx("h2",{className:"text-2xl md:text-3xl mb-3 text-foreground font-heading",children:n.title}),n.description&&l.jsx("p",{className:"text-muted-foreground leading-relaxed mb-6",children:n.description}),n.link_url&&l.jsx("a",{href:n.link_url,target:"_blank",rel:"noopener noreferrer",className:"inline-block bg-primary text-primary-foreground px-6 py-2.5 font-body text-xs font-bold uppercase tracking-wider shadow-sm transition-all hover:brightness-[1.2] active:scale-[0.97]",children:n.link_text})]})]})},n.id))})})}),l.jsx("section",{className:"section-light py-20 md:py-28",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:l.jsxs(re,{animation:"scale-up",className:"max-w-3xl mx-auto text-center",children:[l.jsx(fe,{contentKey:"press_moth_heading",defaultValue:"The Moth Presents Stephanie Peirolo: Walking With RJ",as:"h2",className:"mb-4 text-foreground"}),l.jsx(fe,{contentKey:"press_moth_desc",defaultValue:"A mother navigates the everyday after her son is gravely injured. Stephanie now serves as Chair of the board of directors of the Health Care Rights Initiative, a nonprofit that helps patients and caregivers navigate the health care system.",as:"p",className:"text-muted-foreground leading-relaxed mb-8"}),l.jsx("div",{className:"aspect-video w-full rounded overflow-hidden shadow-lg mb-6",children:l.jsx("iframe",{className:"w-full h-full",src:"https://www.youtube.com/embed/WebsjShV0ZA",title:"The Moth Presents Stephanie Peirolo: Walking With RJ",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),l.jsx("a",{href:"https://www.youtube.com/watch?v=WebsjShV0ZA",target:"_blank",rel:"noopener noreferrer",className:"inline-block bg-primary text-primary-foreground px-8 py-2.5 font-body text-sm font-bold uppercase tracking-wider shadow-sm transition-all hover:brightness-[1.2] active:scale-[0.97]",children:"Watch on Youtube"})]})})}),l.jsx("section",{id:"book-stephanie",className:"section-dark py-20 md:py-28",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 text-center",children:l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"press_book_heading",defaultValue:"Book Stephanie on Your Show",as:"h2",className:"mb-4"}),l.jsx(fe,{contentKey:"press_book_desc",defaultValue:"Interested in having Stephanie as a guest on your podcast or media platform? Get in touch to discuss topics, availability, and more.",as:"p",className:"text-white/80 max-w-xl mx-auto mb-8"}),l.jsx("a",{href:"/contact",className:"inline-block bg-primary text-primary-foreground px-8 py-3 font-body text-sm font-bold uppercase tracking-wider shadow-sm transition-all hover:brightness-[1.2] active:scale-[0.97]",children:"Get In Touch"})]})})})]}),l.jsx(Ye,{}),l.jsx(Mi,{})]})},Rq=()=>l.jsx(Pi,{pageSlug:"press-media",children:l.jsx(Tq,{})}),Aq=()=>{const[t,e]=y.useState(""),[n,r]=y.useState(""),[s,i]=y.useState(""),[o,a]=y.useState(!1),{toast:c}=ht(),u=async d=>{d.preventDefault(),a(!0);const{error:h}=await D.from("form_submissions").insert({name:t,email:n,message:s,source:"contact"});if(a(!1),h)c({title:"Error",description:"Something went wrong.",variant:"destructive"});else{const p=Date.now();D.functions.invoke("send-transactional-email",{body:{templateName:"contact-confirmation",recipientEmail:n,idempotencyKey:`contact-${n}-${p}`,templateData:{name:t}}}).catch(()=>{}),D.functions.invoke("send-transactional-email",{body:{templateName:"contact-notification",idempotencyKey:`contact-notify-${n}-${p}`,templateData:{name:t,email:n,message:s}}}).catch(()=>{}),c({title:"Message sent!",description:"Stephanie will get back to you soon."}),e(""),r(""),i("")}};return l.jsxs("main",{children:[l.jsx(ut,{pageKey:"contact"}),l.jsx(Ge,{}),l.jsxs("section",{className:"relative pt-16 min-h-[70vh] flex items-center justify-center overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:`url(${DO})`}}),l.jsx("div",{className:"absolute inset-0",style:{backgroundColor:"rgba(24, 24, 24, 0.7)"}}),l.jsxs("div",{className:"relative z-10 container mx-auto px-6 md:px-12 lg:px-24 py-20 md:py-28 flex flex-col items-center text-center",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"contact_eyebrow",defaultValue:"Get in touch",as:"p",className:"font-heading text-primary italic text-lg mb-4"}),l.jsx(fe,{contentKey:"contact_heading",as:"h1",className:"font-heading text-3xl md:text-4xl lg:text-5xl text-white font-bold leading-[1.15]",style:{textWrap:"balance"},html:!0,defaultValue:"Ready to book a training, retreat,<br />reading or coaching session?<br />I would love to hear from you."})]}),l.jsx(re,{animation:"fade-up",delay:200,className:"w-full max-w-lg mt-10",children:l.jsxs("form",{onSubmit:u,className:"space-y-4",children:[l.jsx("input",{type:"text",placeholder:"Name",required:!0,value:t,onChange:d=>e(d.target.value),className:"w-full bg-white/95 px-4 py-3.5 text-sm rounded font-body text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary"}),l.jsx("input",{type:"email",placeholder:"Email",required:!0,value:n,onChange:d=>r(d.target.value),className:"w-full bg-white/95 px-4 py-3.5 text-sm rounded font-body text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary"}),l.jsx("textarea",{placeholder:"Leave a Message",required:!0,rows:5,value:s,onChange:d=>i(d.target.value),className:"w-full bg-white/95 px-4 py-3.5 text-sm rounded font-body text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary resize-none"}),l.jsx("button",{type:"submit",disabled:o,className:"w-full bg-primary text-primary-foreground py-3.5 font-body text-sm font-bold uppercase tracking-wider rounded transition-all hover:brightness-[1.15] active:scale-[0.97] disabled:opacity-50",children:o?"Sending...":"Submit"})]})})]})]}),l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:l.jsx("hr",{className:"border-border"})}),l.jsx("section",{className:"section-light py-16 md:py-24",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 text-center",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"contact_social_heading",as:"h2",className:"font-heading text-2xl md:text-3xl lg:text-4xl font-bold text-foreground leading-[1.2] mb-3",style:{textWrap:"balance"},defaultValue:"Follow me on social media for the latest updates and events."}),l.jsx("p",{className:"text-muted-foreground font-body text-sm mb-10",children:"@speirolo"})]}),l.jsx(re,{animation:"fade-up",delay:150,children:l.jsxs("div",{className:"flex items-center justify-center gap-8",children:[l.jsx("a",{href:"https://www.instagram.com/speirolo/",target:"_blank",rel:"noopener noreferrer",className:"text-foreground
458/70 hover:text-primary transition-colors","aria-label":"Instagram",children:l.jsx(_A,{size:32})}),l.jsx("a",{href:"https://www.linkedin.com/in/speirolo/",target:"_blank",rel:"noopener noreferrer",className:"text-foreground/70 hover:text-primary transition-colors","aria-label":"LinkedIn",children:l.jsx(EA,{size:32})}),l.jsx("a",{href:"https://www.tiktok.com/@speirolo",target:"_blank",rel:"noopener noreferrer",className:"text-foreground/70 hover:text-primary transition-colors","aria-label":"TikTok",children:l.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:"M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5"})})}),l.jsx("a",{href:"#",target:"_blank",rel:"noopener noreferrer",className:"text-foreground/70 hover:text-primary transition-colors","aria-label":"Podcast",children:l.jsx(lF,{size:32})})]})})]})}),l.jsx(Ye,{}),l.jsx(Mi,{})]})},Oq=()=>l.jsx(Pi,{pageSlug:"contact",children:l.jsx(Aq,{})});function Pq(t){return Object.prototype.toString.call(t)==="[object Object]"}function Nj(t){return Pq(t)||Array.isArray(t)}function Mq(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Ak(t,e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;const s=JSON.stringify(Object.keys(t.breakpoints||{})),i=JSON.stringify(Object.keys(e.breakpoints||{}));return s!==i?!1:n.every(o=>{const a=t[o],c=e[o];return typeof a=="function"?`${a}`==`${c}`:!Nj(a)||!Nj(c)?a===c:Ak(a,c)})}function _j(t){return t.concat().sort((e,n)=>e.name>n.name?1:-1).map(e=>e.options)}function Iq(t,e){if(t.length!==e.length)return!1;const n=_j(t),r=_j(e);return n.every((s,i)=>{const o=r[i];return Ak(s,o)})}function Ok(t){return typeof t=="number"}function tw(t){return typeof t=="string"}function hy(t){return typeof t=="boolean"}function Ej(t){return Object.prototype.toString.call(t)==="[object Object]"}function At(t){return Math.abs(t)}function Pk(t){return Math.sign(t)}function pd(t,e){return At(t-e)}function Dq(t,e){if(t===0||e===0||At(t)<=At(e))return 0;const n=pd(At(t),At(e));return At(n/t)}function Lq(t){return Math.round(t*100)/100}function lh(t){return ch(t).map(Number)}function bs(t){return t[qh(t)]}function qh(t){return Math.max(0,t.length-1)}function Mk(t,e){return e===qh(t)}function Tj(t,e=0){return Array.from(Array(t),(n,r)=>e+r)}function ch(t){return Object.keys(t)}function $O(t,e){return[t,e].reduce((n,r)=>(ch(r).forEach(s=>{const i=n[s],o=r[s],a=Ej(i)&&Ej(o);n[s]=a?$O(i,o):o}),n),{})}function nw(t,e){return typeof e.MouseEvent<"u"&&t instanceof e.MouseEvent}function $q(t,e){const n={start:r,center:s,end:i};function r(){return 0}function s(c){return i(c)/2}function i(c){return e-c}function o(c,u){return tw(t)?n[t](c):t(e,c,u)}return{measure:o}}function uh(){let t=[];function e(s,i,o,a={passive:!0}){let c;if("addEventListener"in s)s.addEventListener(i,o,a),c=()=>s.removeEventListener(i,o,a);else{const u=s;u.addListener(o),c=()=>u.removeListener(o)}return t.push(c),r}function n(){t=t.filter(s=>s())}const r={add:e,clear:n};return r}function Bq(t,e,n,r){const s=uh(),i=1e3/60;let o=null,a=0,c=0;function u(){s.add(t,"visibilitychange",()=>{t.hidden&&g()})}function d(){f(),s.clear()}function h(v){if(!c)return;o||(o=v,n(),n());const x=v-o;for(o=v,a+=x;a>=i;)n(),a-=i;const b=a/i;r(b),c&&(c=e.requestAnimationFrame(h))}function p(){c||(c=e.requestAnimationFrame(h))}function f(){e.cancelAnimationFrame(c),o=null,a=0,c=0}function g(){o=null,a=0}return{init:u,destroy:d,start:p,stop:f,update:n,render:r}}function zq(t,e){const n=e==="rtl",r=t==="y",s=r?"y":"x",i=r?"x":"y",o=!r&&n?-1:1,a=d(),c=h();function u(g){const{height:m,width:v}=g;return r?m:v}function d(){return r?"top":n?"right":"left"}function h(){return r?"bottom":n?"left":"right"}function p(g){return g*o}return{scroll:s,cross:i,startEdge:a,endEdge:c,measureSize:u,direction:p}}function Qa(t=0,e=0){const n=At(t-e);function r(u){return u<t}function s(u){return u>e}function i(u){return r(u)||s(u)}function o(u){return i(u)?r(u)?t:e:u}function a(u){return n?u-n*Math.ceil((u-e)/n):u}return{length:n,max:e,min:t,constrain:o,reachedAny:i,reachedMax:s,reachedMin:r,removeOffset:a}}function BO(t,e,n){const{constrain:r}=Qa(0,t),s=t+1;let i=o(e);function o(p){return n?At((s+p)%s):r(p)}function a(){return i}function c(p){return i=o(p),h}function u(p){return d().set(a()+p)}function d(){return BO(t,a(),n)}const h={get:a,set:c,add:u,clone:d};return h}function Fq(t,e,n,r,s,i,o,a,c,u,d,h,p,f,g,m,v,x,b){const{cross:w,direction:k}=t,j=["INPUT","SELECT","TEXTAREA"],E={passive:!1},N=uh(),S=uh(),C=Qa(50,225).constrain(f.measure(20)),_={mouse:300,touch:400},R={mouse:500,touch:600},O=g?43:25;let L=!1,A=0,z=0,F=!1,H=!1,I=!1,T=!1;function U(W){if(!b)return;function ce(xe){(hy(b)||b(W,xe))&&oe(xe)}const de=e;N.add(de,"dragstart",xe=>xe.preventDefault(),E).add(de,"touchmove",()=>{},E).add(de,"touchend",()=>{}).add(de,"touchstart",ce).add(de,"mousedown",ce).add(de,"touchcancel",Z).add(de,"contextmenu",Z).add(de,"click",ie,!0)}function M(){N.clear(),S.clear()}function $(){const W=T?n:e;S.add(W,"touchmove",K,E).add(W,"touchend",Z).add(W,"mousemove",K,E).add(W,"mouseup",Z)}function B(W){const ce=W.nodeName||"";return j.includes(ce)}function G(){return(g?R:_)[T?"mouse":"touch"]}function X(W,ce){const de=h.add(Pk(W)*-1),xe=d.byDistance(W,!g).distance;return g||At(W)<C?xe:v&&ce?xe*.5:d.byIndex(de.get(),0).distance}function oe(W){const ce=nw(W,r);T=ce,I=g&&ce&&!W.buttons&&L,L=pd(s.get(),o.get())>=2,!(ce&&W.button!==0)&&(B(W.target)||(F=!0,i.pointerDown(W),u.useFriction(0).useDuration(0),s.set(o),$(),A=i.readPoint(W),z=i.readPoint(W,w),p.emit
vendor: 14,600 bytes, line 458
458("pointerDown")))}function K(W){if(!nw(W,r)&&W.touches.length>=2)return Z(W);const de=i.readPoint(W),xe=i.readPoint(W,w),me=pd(de,A),qe=pd(xe,z);if(!H&&!T&&(!W.cancelable||(H=me>qe,!H)))return Z(W);const Oe=i.pointerMove(W);me>m&&(I=!0),u.useFriction(.3).useDuration(.75),a.start(),s.add(k(Oe)),W.preventDefault()}function Z(W){const de=d.byDistance(0,!1).index!==h.get(),xe=i.pointerUp(W)*G(),me=X(k(xe),de),qe=Dq(xe,me),Oe=O-10*qe,Ie=x+qe/50;H=!1,F=!1,S.clear(),u.useDuration(Oe).useFriction(Ie),c.distance(me,!g),T=!1,p.emit("pointerUp")}function ie(W){I&&(W.stopPropagation(),W.preventDefault(),I=!1)}function Q(){return F}return{init:U,destroy:M,pointerDown:Q}}function Uq(t,e){let r,s;function i(h){return h.timeStamp}function o(h,p){const g=`client${(p||t.scroll)==="x"?"X":"Y"}`;return(nw(h,e)?h:h.touches[0])[g]}function a(h){return r=h,s=h,o(h)}function c(h){const p=o(h)-o(s),f=i(h)-i(r)>170;return s=h,f&&(r=h),p}function u(h){if(!r||!s)return 0;const p=o(s)-o(r),f=i(h)-i(r),g=i(h)-i(s)>170,m=p/f;return f&&!g&&At(m)>.1?m:0}return{pointerDown:a,pointerMove:c,pointerUp:u,readPoint:o}}function Vq(){function t(n){const{offsetTop:r,offsetLeft:s,offsetWidth:i,offsetHeight:o}=n;return{top:r,right:s+i,bottom:r+o,left:s,width:i,height:o}}return{measure:t}}function Hq(t){function e(r){return t*(r/100)}return{measure:e}}function Wq(t,e,n,r,s,i,o){const a=[t].concat(r);let c,u,d=[],h=!1;function p(v){return s.measureSize(o.measure(v))}function f(v){if(!i)return;u=p(t),d=r.map(p);function x(b){for(const w of b){if(h)return;const k=w.target===t,j=r.indexOf(w.target),E=k?u:d[j],N=p(k?t:r[j]);if(At(N-E)>=.5){v.reInit(),e.emit("resize");break}}}c=new ResizeObserver(b=>{(hy(i)||i(v,b))&&x(b)}),n.requestAnimationFrame(()=>{a.forEach(b=>c.observe(b))})}function g(){h=!0,c&&c.disconnect()}return{init:f,destroy:g}}function qq(t,e,n,r,s,i){let o=0,a=0,c=s,u=i,d=t.get(),h=0;function p(){const E=r.get()-t.get(),N=!c;let S=0;return N?(o=0,n.set(r),t.set(r),S=E):(n.set(t),o+=E/c,o*=u,d+=o,t.add(o),S=d-h),a=Pk(S),h=d,j}function f(){const E=r.get()-e.get();return At(E)<.001}function g(){return c}function m(){return a}function v(){return o}function x(){return w(s)}function b(){return k(i)}function w(E){return c=E,j}function k(E){return u=E,j}const j={direction:m,duration:g,velocity:v,seek:p,settled:f,useBaseFriction:b,useBaseDuration:x,useFriction:k,useDuration:w};return j}function Kq(t,e,n,r,s){const i=s.measure(10),o=s.measure(50),a=Qa(.1,.99);let c=!1;function u(){return!(c||!t.reachedAny(n.get())||!t.reachedAny(e.get()))}function d(f){if(!u())return;const g=t.reachedMin(e.get())?"min":"max",m=At(t[g]-e.get()),v=n.get()-e.get(),x=a.constrain(m/o);n.subtract(v*x),!f&&At(v)<i&&(n.set(t.constrain(n.get())),r.useDuration(25).useBaseFriction())}function h(f){c=!f}return{shouldConstrain:u,constrain:d,toggleActive:h}}function Gq(t,e,n,r,s){const i=Qa(-e+t,0),o=h(),a=d(),c=p();function u(g,m){return pd(g,m)<=1}function d(){const g=o[0],m=bs(o),v=o.lastIndexOf(g),x=o.indexOf(m)+1;return Qa(v,x)}function h(){return n.map((g,m)=>{const{min:v,max:x}=i,b=i.constrain(g),w=!m,k=Mk(n,m);return w?x:k||u(v,b)?v:u(x,b)?x:b}).map(g=>parseFloat(g.toFixed(3)))}function p(){if(e<=t+s)return[i.max];if(r==="keepSnaps")return o;const{min:g,max:m}=a;return o.slice(g,m)}return{snapsContained:c,scrollContainLimit:a}}function Yq(t,e,n){const r=e[0],s=n?r-t:bs(e);return{limit:Qa(s,r)}}function Jq(t,e,n,r){const i=e.min+.1,o=e.max+.1,{reachedMin:a,reachedMax:c}=Qa(i,o);function u(p){return p===1?c(n.get()):p===-1?a(n.get()):!1}function d(p){if(!u(p))return;const f=t*(p*-1);r.forEach(g=>g.add(f))}return{loop:d}}function Qq(t){const{max:e,length:n}=t;function r(i){const o=i-e;return n?o/-n:0}return{get:r}}function Xq(t,e,n,r,s){const{startEdge:i,endEdge:o}=t,{groupSlides:a}=s,c=h().map(e.measure),u=p(),d=f();function h(){return a(r).map(m=>bs(m)[o]-m[0][i]).map(At)}function p(){return r.map(m=>n[i]-m[i]).map(m=>-At(m))}function f(){return a(u).map(m=>m[0]).map((m,v)=>m+c[v])}return{snaps:u,snapsAligned:d}}function Zq(t,e,n,r,s,i){const{groupSlides:o}=s,{min:a,max:c}=r,u=d();function d(){const p=o(i),f=!t||e==="keepSnaps";return n.length===1?[i]:f?p:p.slice(a,c).map((g,m,v)=>{const x=!m,b=Mk(v,m);if(x){const w=bs(v[0])+1;return Tj(w)}if(b){const w=qh(i)-bs(v)[0]+1;return Tj(w,bs(v)[0])}return g})}return{slideRegistry:u}}function e9(t,e,n,r,s){const{reachedAny:i,removeOffset:o,constrain:a}=r;function c(g){return g.concat().sort((m,v)=>At(m)-At(v))[0]}function u(g){const m=t?o(g):a(g),v=e.map((b,w)=>({diff:d(b-m,0),index:w})).sort((b,w)=>At(b.diff)-At(w.diff)),{index:x}=v[0];return{index:x,distance:m}}function d(g,m){const v=[g,g+n,g-n];if(!t)return g;if(!m)return c(v);const x=v.filter(b=>Pk(b)===m);return x.length?c(x):bs(v)-n}function h(g,m){const v=e[g]-s.get(),x=d(v,m);return{index:g,distance:x}}function p(g,m){const v=s.get()+g,{index:x,distance:b}=u(v),w=!t&&i(v);if(!m||w)return{index:x,distance:g};const k=e[x]-b,j=g+d(k,0);return{index:x,distance:j}}return{byDistance:p,byIndex:h,shortcut:d}}function t9(t,e,n,r,s,i,o){function a(h){const p=h.distance,f=h.index!==e.get();i.add(p),p&&(r.duration()?t.start():(t.update(),t.render(1),t.update())),f&&(n.set(e.get()),e.set(h.index),o.emit("select"))}function c(h,p){const f=s.byDistance(h,p);a(f)}function u(h,p){const f=e.clone().set(h),g=s.byIndex(f.get(),p);a(g)}return{distance:c,index:u}}function n9(t,e,n,r,s,i,o,a){const c={passive:!0,capture:!0};let u=0;function d(f){if(!a)return;function g(m){if(new Date().getTime()-u>10)return;o.emit("slideFocusStart"),t.scrollLeft=0;const b=n.findIndex(w=>w.includes(m));Ok(b)&&(s.useDuration(0),r.index(b,0),o.emit("slideFocus"))}i.add(document,"keydown",h,!1),e.forEach((m,v)=>{i.add(m,"focus",x=>{(hy(a)||a(f,x))&&g(v)},c)})}function h(f){f.code==="Tab"&&(u=new Date().getTime())}return{init:d}}function qu(t){let e=t;function n(){return e}function r(c){e=o(c)}function s(c){e+=o(c)}function i(c){e-=o(c)}function o(c){return Ok(c)?c:c.get()}return{get:n,set:r,add:s,subtract:i}}function zO(t,e){const n=t.scroll==="x"?o:a,r=e.style;let s=null,i=!1;function o(p){return`translate3d(${p}px,0px,0px)`}function a(p){return`translate3d(0px,${p}px,0px)`}function c(p){if(i)return;const f=Lq(t.direction(p));f!==s&&(r.transform=n(f),s=f)}function u(p){i=!p}function d(){i||(r.transform="",e.getAttribute("style")||e.removeAttribute("style"))}return{clear:d,to:c,toggleActive:u}}function r9(t,e,n,r,s,i,o,a,c){const d=lh(s),h=lh(s).reverse(),p=x().concat(b());function f(N,S){return N.reduce((C,_)=>C-s[_],S)}function g(N,S){return N.reduce((C,_)=>f(C,S)>0?C.concat([_]):C,[])}function m(N){return i.map((S,C)=>({start:S-r[C]+.5+N,end:S+e-.5+N}))}function v(N,S,C){const _=m(S);return N.map(R=>{const O=C?0:-n,L=C?n:0,A=C?"end":"start",z=_[R][A];return{index:R,loopPoint:z,slideLocation:qu(-1),translate:zO(t,c[R]),target:()=>a.get()>z?O:L}})}function x(){const N=o[0],S=g(h,N);return v(S,n,!1)}function b(){const N=e-o[0]-1,S=g(d,N);return v(S,-n,!0)}function w(){return p.every(({index:N})=>{const S=d.filter(C=>C!==N);return f(S,e)<=.1})}function k(){p.forEach(N=>{const{target:S,translate:C,slideLocation:_}=N,R=S();R!==_.get()&&(C.to(R),_.set(R))})}function j(){p.forEach(N=>N.translate.clear())}return{canLoop:w,clear:j,loop:k,loopPoints:p}}function s9(t,e,n){let r,s=!1;function i(c){if(!n)return;function u(d){for(const h of d)if(h.type==="childList"){c.reInit(),e.emit("slidesChanged");break}}r=new MutationObserver(d=>{s||(hy(n)||n(c,d))&&u(d)}),r.observe(t,{childList:!0})}function o(){r&&r.disconnect(),s=!0}return{init:i,destroy:o}}function i9(t,e,n,r){const s={};let i=null,o=null,a,c=!1;function u(){a=new IntersectionObserver(g=>{c||(g.forEach(m=>{const v=e.indexOf(m.target);s[v]=m}),i=null,o=null,n.emit("slidesInView"))},{root:t.parentElement,threshold:r}),e.forEach(g=>a.observe(g))}function d(){a&&a.disconnect(),c=!0}function h(g){return ch(s).reduce((m,v)=>{const x=parseInt(v),{isIntersecting:b}=s[x];return(g&&b||!g&&!b)&&m.push(x),m},[])}function p(g=!0){if(g&&i)return i;if(!g&&o)return o;const m=h(g);return g&&(i=m),g||(o=m),m}return{init:u,destroy:d,get:p}}function o9(t,e,n,r,s,i){const{measureSize:o,startEdge:a,endEdge:c}=t,u=n[0]&&s,d=g(),h=m(),p=n.map(o),f=v();function g(){if(!u)return 0;const b=n[0];return At(e[a]-b[a])}function m(){if(!u)return 0;const b=i.getComputedStyle(bs(r));return parseFloat(b.getPropertyValue(`margin-${c}`))}function v(){return n.map((b,w,k)=>{const j=!w,E=Mk(k,w);return j?p[w]+d:E?p[w]+h:k[w+1][a]-b[a]}).map(At)}return{slideSizes:p,slideSizesWithGaps:f,startGap:d,endGap:h}}function a9(t,e,n,r,s,i,o,a,c){const{startEdge:u,endEdge:d,direction:h}=t,p=Ok(n);function f(x,b){return lh(x).filter(w=>w%b===0).map(w=>x.slice(w,w+b))}function g(x){return x.length?lh(x).reduce((b,w,k)=>{const j=bs(b)||0,E=j===0,N=w===qh(x),S=s[u]-i[j][u],C=s[u]-i[w][d],_=!r&&E?h(o):0,R=!r&&N?h(a):0,O=At(C-R-(S+_));return k&&O>e+c&&b.push(w),N&&b.push(x.length),b},[]).map((b,w,k)=>{const j=Math.max(k[w-1]||0);return x.slice(j,b)}):[]}function m(x){return p?f(x,n):g(x)}return{groupSlides:m}}function l9(t,e,n,r,s,i,o){const{align:a,axis:c,direction:u,startIndex:d,loop:h,duration:p,dragFree:f,dragThreshold:g,inViewThreshold:m,slidesToScroll:v,skipSnaps:x,containScroll:b,watchResize:w,watchSlides:k,watchDrag:j,watchFocus:E}=i,N=2,S=Vq(),C=S.measure(e),_=n.map(S.measure),R=zq(c,u),O=R.measureSize(C),L=Hq(O),A=$q(a,O),z=!h&&!!b,F=h||!!b,{slideSizes:H,slideSizesWithGaps:I,startGap:T,endGap:U}=o9(R,C,_,n,F,s),M=a9(R,O,v,h,C,_,T,U,N),{snaps:$,snapsAligned:B}=Xq(R,A,C,_,M),G=-bs($)+bs(I),{snapsContained:X,scrollContainLimit:oe}=Gq(O,G,B,b,N),K=z?X:B,{limit:Z}=Yq(G,K,h),ie=BO(qh(K),d,h),Q=ie.clone(),Y=lh(n),W=({dragHandler:kn,scrollBody:Kt,scrollBounds:tn,options:{loop:Dn}})=>{Dn||tn.constrain(kn.pointerDown()),Kt.seek()},ce=({scrollBody:kn,translate:Kt,location:tn,offsetLocation:Dn,previousLocation:yr,scrollLooper:Bi,slideLooper:rs,dragHandler:fu,animation:pl,eventHandler:aa,scrollBounds:ml,options:{loop:gl}},Et)=>{const yt=kn.settled(),Sn=!ml.shouldConstrain(),ke=gl?yt:yt&&Sn,De=ke&&!fu.pointerDown();De&&pl.stop();const Fe=tn.get()*Et+yr.get()*(1-Et);Dn.set(Fe),gl&&(Bi.loop(kn.direction()),rs.loop()),Kt.to(Dn.get()),De&&aa.emit("settle"),ke||aa.emit("scroll")},de=Bq(r,s,()=>W(qn),kn=>ce(qn,kn)),xe=.68,me=K[ie.get()],qe=qu(me),Oe=qu(me),Ie=qu(me),He=qu(me),_t=qq(qe,Ie,Oe,He,p,xe),Dt=e9(h,K,G,Z,He),Zt=t9(de,ie,Q,_t,Dt,He,o),kt=Qq(Z),wn=uh(),Je=i9(e,n,o,m),{slideRegistry:st}=Zq(z,b,K,oe,M,Y),en=n9(t,n,st,Zt,_t,wn,o,E),qn={ownerDocument:r,ownerWindow:s,eventHandler:o,containerRect:C,slideRects:_,animation:de,axis:R,dragHandler:Fq(R,t,r,s,He,Uq(R,s),qe,de,Zt,_t,Dt,ie,o,L,f,g,x,xe,j),eventStore:wn,percentOfView:L,index:ie,indexPrevious:Q,limit:Z,location:qe,offsetLocation:Ie,previousLocation:Oe,options:i,resizeHandler:Wq(e,o,s,n,R,w,S),scrollBody:_t,scrollBounds:Kq(Z,Ie,He,_t,L),scrollLooper:Jq(G,Z,Ie,[qe,Ie,Oe,He]),scrollProgress:kt,scrollSnapList:K.map(kt.get),scrollSnaps:K,scrollTarget:Dt,scrollTo:Zt,slideLooper:r9(R,O,G,H,I,$,K,Ie,n),slideFocus:en,slidesHandler:s9(e,o,k),slidesInView:Je,slideIndexes:Y,slideRegistry:st,slidesToScroll:M,target:He,translate:zO(R,e)};return qn}function c9(){let t={},e;function n(u){e=u}function r(u){return t[u]||[]}function s(u){return r(u).forEach(d=>d(e,u)),c}function i(u,d){return t[u]=r(u).concat([d]),c}function o(u,d){return t[u]=r(u).filter(h=>h!==d),c}function a(){t={}}const c={init:n,emit:s,off:o,on:i,clear:a};return c}const u9={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function d9(t){function e(i,o){return $O(i,o||{})}function n(i){const o=i.breakpoints||{},a=ch(o).filter(c=>t.matchMedia(c).matches).map(c=>o[c]).reduce((c,u)=>e(c,u),{});return e(i,a)}function r(i){return i.map(o=>ch(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(t.matchMedia)}return{mergeOptions:e,optionsAtMedia:n,optionsMediaQueries:r}}function h9(t){let e=[];function n(i,o){return e=o.filter(({options:a})=>t.optionsAtMedia(a).active!==!1),e.forEach(a=>a.init(i,t)),o.reduce((a,c)=>Object.assign(a,{[c.name]:c}),{})}function r(){e=e.filter(i=>i.destroy())}return{init:n,destroy:r}}function mm(t,e,n){const r=t.ownerDocument,s=r.defaultView,i=d9(s),o=h9(i),a=uh(),c=c9(),{mergeOptions:u,optionsAtMedia:d,optionsMediaQueries:h}=i,{on:p,off:f,emit:g}=c,m=R;let v=!1,x,b=u(u9,mm.globalOptions),w=u(b),k=[],j,E,N;function S(){const{container:Y,slides:W}=w;E=(tw(Y)?t.querySelector(Y):Y)||t.children[0];const de=tw(W)?E.querySelectorAll(W):W;N=[].slice.call(de||E.children)}function C(Y){const W=l9(t,E,N,r,s,Y,c);if(Y.loop&&!W.slideLooper.canLoop()){const ce=Object.assign({},Y,{loop:!1});return C(ce)}return W}function _(Y,W){v||(b=u(b,Y),w=d(b),k=W||k,S(),x=C(w),h([b,...k.map(({options:ce})=>ce)]).forEach(ce=>a.add(ce,"change",R)),w.active&&(x.translate.to(x.location.get()),x.animation.init(),x.slidesInView.init(),x.slideFocus.init(Q),x.eventHandler.init(Q),x.resizeHandler.init(Q),x.slidesHandler.init(Q),x.options.loop&&x.slideLooper.loop(),E.offsetParent&&N.length&&x.dragHandler.init(Q),j=o.init(Q,k)))}function R(Y,W){const ce=M();O(),_(u({startIndex:ce},Y),W),c.emit("reInit")}function O(){x.dragHandler.destroy(),x.eventStore.clear(),x.translate.clear(),x.slideLooper.clear(),x.resizeHandler.destroy(),x.slidesHandler.destroy(),x.slidesInView.destroy(),x.animation.destroy(),o.destroy(),a.clear()}function L(){v||(v=!0,a.clear(),O(),c.emit("destroy"),c.clear())}function A(Y,W,ce){!w.active||v||(x.scrollBody.useBaseFriction().useDuration(W===!0?0:w.duration),x.scrollTo.index(Y,ce||0))}function z(Y){const W=x.index.add(1).get();A(W,Y,-1)}function F(Y){const W=x.index.add(-1).get();A(W,Y,1)}function H(){return x.index.add(1).get()!==M()}function I(){return x.index.add(-1).get()!==M()}function T(){return x.scrollSnapList}function U(){return x.scrollProgress.get(x.offsetLocation.get())}function M(){return x.index.get()}function $(){return x.indexPrevious.get()}function B(){return x.slidesInView.get()}function G(){return x.slidesInView.get(!1)}function X(){return j}function oe(){return x}function K(){return t}function Z(){return E}function ie(){return N}const Q={canScrollNext:H,canScrollPrev:I,containerNode:Z,internalEngine:oe,destroy:L,off:f,on:p,emit:g,plugins:X,previousScrollSnap:$,reInit:m,rootNode:K,scrollNext:z,scrollPrev:F,scrollProgress:U,scrollSnapList:T,scrollTo:A,selectedScrollSnap:M,slideNo
458des:ie,slidesInView:B,slidesNotInView:G};return _(e,n),setTimeout(()=>c.emit("init"),0),Q}mm.globalOptions=void 0;function Ik(t={},e=[]){const n=y.useRef(t),r=y.useRef(e),[s,i]=y.useState(),[o,a]=y.useState(),c=y.useCallback(()=>{s&&s.reInit(n.current,r.current)},[s]);return y.useEffect(()=>{Ak(n.current,t)||(n.current=t,c())},[t,c]),y.useEffect(()=>{Iq(r.current,e)||(r.current=e,c())},[e,c]),y.useEffect(()=>{if(Mq()&&o){mm.globalOptions=Ik.globalOptions;const u=mm(o,n.current,r.current);return i(u),()=>u.destroy()}else i(void 0)},[o,i]),[a,s]}Ik.globalOptions=void 0;const FO=y.createContext(null);function fy(){const t=y.useContext(FO);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}const UO=y.forwardRef(({orientation:t="horizontal",opts:e,setApi:n,plugins:r,className:s,children:i,...o},a)=>{const[c,u]=Ik({...e,axis:t==="horizontal"?"x":"y"},r),[d,h]=y.useState(!1),[p,f]=y.useState(!1),g=y.useCallback(b=>{b&&(h(b.canScrollPrev()),f(b.canScrollNext()))},[]),m=y.useCallback(()=>{u==null||u.scrollPrev()},[u]),v=y.useCallback(()=>{u==null||u.scrollNext()},[u]),x=y.useCallback(b=>{b.key==="ArrowLeft"?(b.preventDefault(),m()):b.key==="ArrowRight"&&(b.preventDefault(),v())},[m,v]);return y.useEffect(()=>{!u||!n||n(u)},[u,n]),y.useEffect(()=>{if(u)return g(u),u.on("reInit",g),u.on("select",g),()=>{u==null||u.off("select",g)}},[u,g]),l.jsx(FO.Provider,{value:{carouselRef:c,api:u,opts:e,orientation:t||((e==null?void 0:e.axis)==="y"?"vertical":"horizontal"),scrollPrev:m,scrollNext:v,canScrollPrev:d,canScrollNext:p},children:l.jsx("div",{ref:a,onKeyDownCapture:x,className:se("relative",s),role:"region","aria-roledescription":"carousel",...o,children:i})})});UO.displayName="Carousel";const VO=y.forwardRef(({className:t,...e},n)=>{const{carouselRef:r,orientation:s}=fy();return l.jsx("div",{ref:r,className:"overflow-hidden",children:l.jsx("div",{ref:n,className:se("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...e})})});VO.displayName="CarouselContent";const HO=y.forwardRef(({className:t,...e},n)=>{const{orientation:r}=fy();return l.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:se("min-w-0 shrink-0 grow-0 basis-full",r==="horizontal"?"pl-4":"pt-4",t),...e})});HO.displayName="CarouselItem";const WO=y.forwardRef(({className:t,variant:e="outline",size:n="icon",...r},s)=>{const{orientation:i,scrollPrev:o,canScrollPrev:a}=fy();return l.jsxs(q,{ref:s,variant:e,size:n,className:se("absolute h-8 w-8 rounded-full",i==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!a,onClick:o,...r,children:[l.jsx(ei,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Previous slide"})]})});WO.displayName="CarouselPrevious";const qO=y.forwardRef(({className:t,variant:e="outline",size:n="icon",...r},s)=>{const{orientation:i,scrollNext:o,canScrollNext:a}=fy();return l.jsxs(q,{ref:s,variant:e,size:n,className:se("absolute h-8 w-8 rounded-full",i==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!a,onClick:o,...r,children:[l.jsx(qs,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Next slide"})]})});qO.displayName="CarouselNext";const Ru={hero:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/ed3c7ee-c1ff-f0a0-cc7c-f84bc05de2f_photo_by_Daniel_Berman_6_.png",corporateCoaching:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/f4a5235-10e7-8eb1-d6b7-74acad37e1f_Copy_of_Heading.png",training:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/c5ab51-53f8-c073-133-5622303da1e_IMG_6368_2.jpeg",teamLeadership:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/d075f7b-4b3a-ec3c-042d-2dfb7256b64_social_images_13_.jpg",teamCohort:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2
458160578998/settings_images/a5f60da-5f66-6307-8fd7-70acfa04387_social_images_14_.jpg"},f9=[{key:"corp_testimonial_1",quote:`"I've had the privilege of working with Stephanie across two companies over five years in C-level roles, and she is an extraordinary coach. Her energy is upbeat, warm, and positive, always grounded in her own executive experience and personal wisdom. Stephanie has guided me through two very challenging CEOs, complex 'Game of Thrones'-style peer dynamics, COVID, and Gen-Z/Millennial/Gen-X intergenerational conflictsâall while teaching me to lead from my strengths. She is an invaluable member of my personal board of directors."`,attr:"â CCO"},{key:"corp_testimonial_2",quote:`"I worked with Stephanie for five years as the CEO of a technology consultancy. Her strategic guidance was integral to my growth and frankly, survival. She not only provided valuable insights but also offered crucial support as I navigated complex operational challenges. Stephanie's unique blend of expertise and empathy made her an invaluable partner in my leadership journey."`,attr:"â CEO"}],p9=()=>l.jsxs("main",{children:[l.jsx(ut,{pageKey:"corporate-coaching"}),l.jsx(Ge,{}),l.jsx("section",{className:"section-dark pt-16",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 py-16 md:py-24",children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"corp_eyebrow",defaultValue:"Confidential. Strategic. Results-Driven.",as:"p",className:"font-heading text-lg md:text-xl tracking-wide mb-4 text-white/80"}),l.jsx(fe,{contentKey:"corp_heading",defaultValue:"Corporate Coaching",as:"h1",className:"font-heading text-4xl md:text-5xl lg:text-6xl font-bold leading-[1.1] mb-6",style:{textWrap:"balance"}}),l.jsx(fe,{contentKey:"corp_hero_body",as:"div",className:"font-body text-base md:text-lg leading-relaxed text-white/85 mb-6",html:!0,defaultValue:"<p>Stephanie has worked with corporations and non-profits since 2013, and offers executive coaching, team coaching, facilitation and trainings. She is a board-certified executive coach with an MA in Transformational Leadership, a member of the International Coaching Federation and has over 1000 hours of executive coaching experience.</p>"}),l.jsx(Be,{to:"/contact",className:"inline-block border border-white px-6 py-3 font-body text-sm font-semibold uppercase tracking-wider hover:bg-white hover:text-[hsl(43,40%,42%)] transition-colors active:scale-[0.97]",children:"Get in Touch â"})]}),l.jsxs(re,{animation:"fade-left",delay:200,children:[l.jsx(Us,{contentKey:"corp_hero_image",defaultSrc:Ru.hero,alt:"Stephanie Peirolo - Executive Coach",className:"w-full rounded shadow-xl"}),l.jsx("p",{className:"text-right text-sm italic text-white/60 mt-3",children:"Photo By Daniel Berman"})]})]})})}),l.jsx("section",{className:"bg-background py-20 md:py-28",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"corp_coaching_heading",defaultValue:"Corporate Coaching",as:"h2",className:"font-heading text-3xl md:text-4xl font-bold text-foreground mb-4"}),l.jsx(fe,{contentKey:"corp_coaching_subtitle",defaultValue:"1:1 Leadership Coaching for Executives and High-Potentials",as:"p",className:"font-body font-bold text-foreground mb-4"}),l.jsx(fe,{contentKey:"corp_coaching_body",defaultValue:"Executive Coaching helps you define and reach your goals, build new skills, and navigate leadership challenges as they arise. We usually meet twice a month, primarily on video, in a confidential, supportive, strengths-based process.",as:"p",className:"font-body text-muted-foreground leading-relaxed mb-4"}),l.jsx(fe,{contentKey:"corp_coaching_note",defaultValue:"Ideal for senior leaders, founders, and executives seeking personalized, ongoing support.",as:"p",className:"font-body text-sm italic text-muted-foreground mb-6"}),l.jsx(Be,{to:"/contact",className:"inline-block border border-foreground px-6 py-3 font-body text-sm font-semibold uppercase tracking-wider text-foreground hover:bg-foreground hover:text-background transition-colors active:scale-[0.97]",children:"Get in Touch â
458"})]}),l.jsx(re,{animation:"fade-left",delay:150,children:l.jsx(Us,{contentKey:"corp_coaching_image",defaultSrc:Ru.corporateCoaching,alt:"Corporate coaching workspace",className:"w-full rounded shadow-lg"})})]})})}),l.jsx("section",{className:"section-light py-20 md:py-28",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"corp_team_heading",defaultValue:"Team Coaching",as:"h2",className:"font-heading text-3xl md:text-4xl font-bold text-foreground text-center mb-2"}),l.jsx(fe,{contentKey:"corp_team_subtitle",defaultValue:"From Individual Growth to Organizational Momentum",as:"p",className:"font-body font-bold text-foreground text-center mb-4"}),l.jsx(fe,{contentKey:"corp_team_intro",defaultValue:"Coaching that only focuses on individual growth works. But coaching that involves an entire team can really move a business to the next level.",as:"p",className:"font-body text-muted-foreground leading-relaxed mb-12 max-w-2xl mx-auto text-center"})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-stretch",children:[l.jsx(re,{animation:"fade-up",delay:100,className:"flex",children:l.jsxs("div",{className:"bg-card border border-primary rounded overflow-hidden shadow-md hover:shadow-xl hover:-translate-y-1 transition-all duration-300 flex flex-col",children:[l.jsx(Us,{contentKey:"corp_team_lead_image",defaultSrc:Ru.teamLeadership,alt:"Leadership team development",className:"w-full h-56 object-cover"}),l.jsxs("div",{className:"p-6 flex flex-col flex-1",children:[l.jsx(fe,{contentKey:"corp_team_lead_title",defaultValue:"Leadership Team Development",as:"h3",className:"font-heading text-xl font-bold text-foreground mb-2"}),l.jsx(fe,{contentKey:"corp_team_lead_desc",defaultValue:"I have worked with a number of leadership teams combining individual and team sessions to work on skills that benefit the individual, team and organization.",as:"p",className:"font-body text-sm text-muted-foreground leading-relaxed mb-6 flex-1"}),l.jsx(Be,{to:"/contact",className:"inline-block border border-foreground px-5 py-2.5 font-body text-xs font-bold uppercase tracking-wider text-foreground hover:bg-foreground hover:text-background transition-colors active:scale-[0.97] self-start",children:"Get in Touch â"})]})]})}),l.jsx(re,{animation:"fade-up",delay:200,className:"flex",children:l.jsxs("div",{className:"bg-card border border-primary rounded overflow-hidden shadow-md hover:shadow-xl hover:-translate-y-1 transition-all duration-300 flex flex-col",children:[l.jsx(Us,{contentKey:"corp_cohort_image",defaultSrc:Ru.teamCohort,alt:"Cohort coaching session",className:"w-full h-56 object-cover"}),l.jsxs("div",{className:"p-6 flex flex-col flex-1",children:[l.jsx(fe,{contentKey:"corp_cohort_title",defaultValue:"Cohort Coaching",as:"h3",className:"font-heading text-xl font-bold text-foreground mb-2"}),l.jsx(fe,{contentKey:"corp_cohort_desc",defaultValue:"I work with a cohort of 5-10 people within a company. Sometimes, these are up and coming leaders that a company wants to develop and train, but in a more cost effective way than individual executive coaching. The curriculum is co-created with leadership and the members of the cohort, and the group meets once a month.",as:"p",className:"font-body text-sm text-muted-foreground leading-relaxed mb-6 flex-1"}),l.jsx(Be,{to:"/contact",className:"inline-block border border-foreground px-5 py-2.5 font-body text-xs font-bold uppercase tracking-wider text-foreground hover:bg-foreground hover:text-background transition-colors active:scale-[0.97] self-start",children:"Get in Touch â"})]})]})})]})]})}),l.jsx("section",{className:"bg-background py-20 md:py-28",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:l.jsxs("div",{className:"grid md:grid-cols-[2fr_1fr] gap-12 items-start",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"corp_training_heading",defaultValue:"Training",as:"h2",className:"font-heading text-3xl md:text-4xl font-bold text-foreground mb-6"}),l.jsx(fe,{contentKey:"corp_training_body",as:"div",className:"font-body text-muted-foreground leading-relaxed space-y-5",html:!0,defaultValue:`<p>I offer training sessions that are engaging, impactful, and tailored to your team and your specific needs, in person or online.</p> 459<p><strong class="text-foreground">The Growth Series</strong> is for advertising agencies and creative service companies who need to change their narratives around business development to drive organic growth. I work with leaders and team
459s to build and refine skills and processes. Find out why my clients call me the "growth whisperer."</p> 460<p><strong class="text-foreground">The Management ToolBox Series</strong> is for top performing mid-level or senior managers to hone skills like managing conflict, building effective feedback loops and 1:1s; creating top performing intergenerational teams and more.</p> 461<p><strong class="text-foreground">Pitch Perfect Presentation Training</strong> is a hands on class for individuals and teams to build and present to win - pitches, funding, or promotions.</p> 462<p><strong class="text-foreground">Closing the Deal</strong> customized training for sales teams or individuals to build skills qualifying, asking strategic questions, dealing with objections, negotiating and closing. This is especially useful for teams who have to sell a new product or sell in a new way or for teams who think sales is NOT for them.</p>`}),l.jsx(Be,{to:"/contact",className:"inline-block mt-6 border border-foreground px-6 py-3 font-body text-sm font-semibold uppercase tracking-wider text-foreground hover:bg-foreground hover:text-background transition-colors active:scale-[0.97]",children:"Schedule a Consultation â"})]}),l.jsx(re,{animation:"fade-up",delay:150,children:l.jsx(Us,{contentKey:"corp_training_image",defaultSrc:Ru.training,alt:"Training session",className:"w-full rounded shadow-lg"})})]})})}),l.jsx("section",{className:"section-light py-20 md:py-28",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-4xl",children:[l.jsx(re,{animation:"fade-up",children:l.jsx(fe,{contentKey:"corp_testimonials_heading",defaultValue:"What clients say",as:"h2",className:"font-heading text-3xl md:text-4xl font-bold text-foreground text-center mb-12"})}),l.jsxs(UO,{opts:{loop:!0},children:[l.jsx(VO,{children:f9.map(t=>l.jsx(HO,{children:l.jsxs("div",{className:"bg-card border border-border rounded p-8 md:p-12 shadow-md mx-2",children:[l.jsx(fe,{contentKey:`${t.key}_quote`,as:"p",defaultValue:t.quote,className:"font-body text-base md:text-lg leading-relaxed text-foreground mb-6 italic"}),l.jsx(fe,{contentKey:`${t.key}_attr`,as:"p",defaultValue:t.attr,className:"font-body text-sm text-muted-foreground"})]})},t.key))}),l.jsx(WO,{}),l.jsx(qO,{})]})]})}),l.jsx(au,{}),l.jsx(Ye,{}),l.jsx(Mi,{})]}),m9=()=>l.jsx(Pi,{pageSlug:"corporate-coaching",children:l.jsx(p9,{})}),g9=[{key:"ind_price_1",price:"$500",title:"One Hour Session",description:"A single 60-minute session to get clarity on a specific decision, challenge, or transition with practical tools and expert guidance.",cta:"Book Session â",priceId:"individual_coaching_1_onetime",image:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/efc3c4-dd00-1dee-4635-a82fdb88206_social_images_20_.jpg"},{key:"ind_price_2",price:"$1,425",title:"3 - One Hour Sessions",description:"Three focused 1:1 sessions designed to help you clarify your goals, uncover patterns, and make meaningful progress toward your next step.",cta:"Book Sessions â",priceId:"individual_coaching_3_onetime",image:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/4acd1e7-3ccc-e20b-e67-ed82e61c6b5e_social_images_23_.jpg"},{key:"ind_price_3",price:"$2,250",title:"5 - One Hour Sessions",description:"A deeper coaching journey over five sessions to explore complex decisions, align with your values, and build lasting confidence and momentum.",cta:"Book Sessions â",priceId:"individual_coaching_5_onetime",image:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/026e5a-702b-ca73-b43f-52c5d76538f_social_images_24_.jpg"}],y9=()=>{const{openCheckout:t,checkoutElement:e}=Rk(),{user:n}=pr();return l.jsxs("main",{children:[l.jsx(ut,{pageKey:"individual-coaching"}),l.jsx(Ge,{}),l.jsxs("section",{className:"relative pt-16 min-h-[85vh] flex items-center overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center bg-no-repeat",style:{backgroundImage:`url(${IO})`}}),l.jsx("div",{className:"absolute inset-0",style:{backgroundColor:"rgba(24, 24, 24, 0.55)"}}),l.jsx("div",{className:"relative z-10 container mx-auto px-6 md:px-12 lg:px-24 py-16 md:py-24",children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx(fe,{contentKey:"ind_eyebrow",defaultValue:"Clarity. Confidence. Direction.",as:"p",className:"font-heading text-lg tracking-wide mb-3 text-white/80"}),l.jsx(fe,{contentKey:"ind_heading",defaultValue:"Individual Coaching",as:"h1",className:"font-heading text-4xl md:text-5xl lg:text-6xl font-bold text-white leading-[1.1] mb-6",style:{textWrap:"balance"}}),l.jsx(fe,{contentKey:"ind_hero_body",as:"div",className:"font-body text-base md:text-lg leading-relaxed text-white/85 mb-6",html:!0,defaultValue:"If you want support with a big decision about work or your career, book an individual coaching session. Stephanie will provide practical tools to help you clarify your goals, responsibilities, dreams, and values, while navigating any old familial or cultural narratives that no longer serve. Based on the content in her book <em>The Saint and the Drunk A Guide To Making the Big Decisions In Your Life</em>, these one hour 1:1 video sessions with Stephanie can help you tune into the genius of your body and work with any resistance or fear that may arise."}),l.jsx("a",{href:"#book-appointment",className:"inline-block bg-white border border-primary text-primary px-6 py-3 font-body text-sm font-semibold uppercase tracking-wider hover:bg-primary hover:text-primary-foreground transition-colors active:scale-[0.97]",children:"Schedule a Coaching Session"})]}),l.jsxs(re,{animation:"fade-left",delay:200,children:[l.jsx("div",{className:"w-full max-w-md mx-auto rounded shadow-xl overflow-hidden",children:l.jsx("div",{className:"wistia_responsive_padding",style:{padding:"56.25% 0 0 0",position:"relative"},children:l.jsx("div",{className:"wistia_responsive_wrapper",style:{height:"100%",left:0,position:"absolute",top:0,width:"100%"},children:l.jsx("iframe",{src:"https://fast.wistia.net/embed/iframe/fxyst90jbs?seo=true&videoFoam=true",title:"Stephanie Peirolo Coaching Video",allow:"autoplay; fullscreen",frameBorder:"0",scrolling:"no",className:"wistia_embed",name:"wistia_embed",width:"100%",height:"100%",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}})})})}),l.jsx("p",{className:"text-center text-sm text-white/60 mt-3",children:"Watch the Above for More About Stephanie's Process"})]})]})})]}),l.jsx("section",{id:"book-appointment",className:"bg-background py-20 md:py-28",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsx(re,{animation:"fade-up",children:l.jsx(fe,{contentKey:"ind_pricing_heading",defaultValue:"Book Your First Appointment",as:"h2",className:"font-heading text-3xl md:text-4xl font-bold text-foreground text-center mb-16"})}),l.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:g9.map((r,s)=>l.jsx(re,{animation:"fade-up",delay:s*120,children:l.jsxs("div",{className:"bg-card border border-border rounded overflow-hidden shadow-md hover:shadow-xl transition-shadow",children:[l.jsx(Us,{contentKey:`${r.key}_image`,defaultSrc:r.image,alt:r.title,className:"w-full h-48 object-cover"}),l.jsxs("div",{className:"p-6",children:[l.jsx(fe,{contentKey:`${r.key}_price`,defaultValue:r.price,as:"p",className:"font-heading text-sm font-bold text-primary uppercase tracking-wider mb-1"}),l.jsx(fe,{contentKey:`${r.key}_title`,defaultValue:r.title,as:"h3",className:"font-heading text-xl font-bold text-foreground mb-3"}),l.jsx(fe,{contentKey:`${r.key}_desc`,defaultValue:r.description,as:"p",className:"font-body text-sm text-muted-foreground leading-relaxed mb-6"}),l.jsx("button",{type:"button",onClick:()=>t({priceId:r.priceId,customerEmail:n==null?void 0:n.email,userId:n==null?void 0:n.id,title:`${r.title} â ${r.price}`,returnUrl:`${window.location.origin}/checkout/return?session_id={CHECKOUT_SESSION_ID}&dest=coaching`,metadata:{purchase_source:`purchase_${r.priceId}`,product_label:r.title}}
462),className:"inline-block border border-primary text-primary px-5 py-2.5 font-body text-sm font-semibold uppercase tracking-wider hover:bg-primary hover:text-primary-foreground transition-colors active:scale-[0.97]",children:r.cta})]})]})},r.key))})]})}),l.jsx(au,{}),l.jsx(Ye,{}),l.jsx(Mi,{}),e]})},v9=()=>l.jsx(Pi,{pageSlug:"individual-coaching",children:l.jsx(y9,{})}),jt=y.forwardRef(({className:t,...e},n)=>l.jsx("textarea",{className:se("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",t),ref:n,...e}));jt.displayName="Textarea";const x9=({cohortKey:t,cohortTitle:e,children:n})=>{const[r,s]=y.useState(!1),[i,o]=y.useState(!1),[a,c]=y.useState({name:"",email:"",phone:"",timing:"",questions:""}),u=(h,p)=>c(f=>({...f,[h]:p})),d=async h=>{if(h.preventDefault(),!a.name.trim()||!a.email.trim()){St({title:"Please add your name and email.",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a.email.trim())){St({title:"Please enter a valid email address.",variant:"destructive"});return}o(!0);try{const f=[`Cohort interest: ${e}`,a.phone&&`Phone: ${a.phone}`,a.timing&&`Preferred timing / availability: ${a.timing}`,a.questions&&`Questions or context: ${a.questions}`].filter(Boolean).join(` 463 464`),{error:g}=await D.from("form_submissions").insert({name:a.name.trim(),email:a.email.trim(),message:f,source:`cohort_interest_${t}`});if(g)throw g;D.functions.invoke("send-transactional-email",{body:{templateName:"cohort-interest",recipientEmail:a.email.trim(),idempotencyKey:`cohort-interest-${t}-${a.email.trim()}-${Date.now()}`,templateData:{name:a.name.trim(),cohortName:e}}}).catch(()=>{}),St({title:"Thank you!",description:"Your interest has been registered. We'll be in touch when the cohort is ready to run."}),c({name:"",email:"",phone:"",timing:"",questions:""}),s(!1)}catch{St({title:"Something went wrong. Please try again.",variant:"destructive"})}finally{o(!1)}};return l.jsxs(Es,{open:r,onOpenChange:s,children:[l.jsx(Ek,{asChild:!0,children:n}),l.jsxs(es,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[l.jsxs(ts,{children:[l.jsx(_r,{className:"font-heading text-2xl font-bold text-foreground text-center",children:"Register Interest"}),l.jsx("p",{className:"font-body text-sm text-muted-foreground text-center mt-2",children:e}),l.jsx("p",{className:"font-body text-xs text-muted-foreground text-center mt-1",children:"Cohorts only run when they fill. Register your interest and we'll let you know
464when dates are confirmed."})]}),l.jsxs("form",{onSubmit:d,className:"space-y-4 mt-2",children:[l.jsx(ue,{placeholder:"Name",required:!0,value:a.name,onChange:h=>u("name",h.target.value),maxLength:100}),l.jsx(ue,{placeholder:"Email",type:"email",required:!0,value:a.email,onChange:h=>u("email",h.target.value),maxLength:255}),l.jsx(ue,{placeholder:"Phone (optional)",value:a.phone,onChange:h=>u("phone",h.target.value),maxLength:50}),l.jsx(jt,{placeholder:"Preferred timing or availability (optional)",value:a.timing,onChange:h=>u("timing",h.target.value),maxLength:500,rows:2}),l.jsx(jt,{placeholder:"Anything you'd like to share or ask? (optional)",value:a.questions,onChange:h=>u("questions",h.target.value),maxLength:1e3,rows:3}),l.jsx(q,{type:"submit",disabled:i,className:"w-full bg-primary hover:brightness-110 text-primary-foreground font-body font-semibold uppercase tracking-wider py-3",children:i?"Submitting...":"Register Interest"})]})]})]})},b9=[{key:"cohort_unexpected",title:"Navigating the Unexpected Change",body:"You are in the middle of a turning point you didn't expect or want. It might be a layoff, the end of a relationship, or a financial reversal. This cohort coaching group will include ways to plan what comes next for you, with specific tools for honoring your loss and any resistance.",fit:"This is for you if you are going through an unexpected change and want to take a moment to orient yourself, take a breath, and get ready for what comes next.",note:"50% off coupon available â mention it when you register."},{key:"cohort_grow",title:"Grow Your Career",body:"You want to change your career. You might want to turbo-charge growth, build the skills to move to the next level, or change careers entirely. You have an idea of where you want to go, but you want to work on the specifics, address any fears or resistance, and build community with others going through the same thing.",fit:"This is for you if you have work experience but feel stuck or are ready to move to the next level. You want tactics, tools, and a mindset reboot.",note:null}],w9=()=>{const[t,e]=y.useState(!1),[n,r]=y.useState({name:"",email:"",topic:"",importance:"",about:""}),s=(o,a)=>r(c=>({...c,[o]:a})),i=async o=>{if(o.preventDefault(),!n.email.trim()||!n.topic.trim()){St({title:"Please add your email and a topic idea.",variant:"destructive"});return}e(!0);try{const a=[`Cohort topic: ${n.topic}`,n.importance&&`Why this matters: ${n.importance}`,n.about&&`About me: ${n.about}`].filter(Boolean).join(` 465 466`),{error:c}=await D.from("form_submissions").insert({name:n.name.trim()||null,email:n.email.trim(),message:a,source:"cohort_suggestion"});if(c)throw c;D.functions.invoke("send-transactional-email",{body:{templateName:"cohort-suggestion",recipientEmail:n.email.trim(),idempotencyKey:`cohort-suggest-${n.email.trim()}-${Date.now()}`,templateData:{name:n.name.trim()||void 0}}}).catch(()=>{}),St({title:"Thank you!",description:"Your cohort suggestion has been received."}),r({name:"",email:"",topic:"",importance:"",about:""})}catch{St({title:"Something went wrong. Please try again.",variant:"destructive"})}finally{e(!1)}};return l.jsxs("main",{children:[l.jsx(ut,{pageKey:"cohort-coaching"}),l.jsx(Ge,{}),l.jsx("section",{className:"section-light pt-32 pb-16 md:pt-40 md:pb-20",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-4xl",children:l.jsxs(re,{animation:"fade-up",children:[l.jsx("p",{className:"font-body text-xs font-bold uppercase tracking-[0.2em] text-primary mb-3 text-center",children:"Small Group · 3 Sessions · Up to 8 People"}),l.jsx(fe,{contentKey:"cc_heading",defaultValue:"Cohort Coaching",as:"h1",className:"text-center mb-6"}),l.jsx(fe,{contentKey:"cc_intro",as:"div",html:!0,className:"text-foreground/85 leading-relaxed space-y-4 max-w-2xl mx-auto",defaultValue:`<p>Cohort coaching is a small group session arranged around particular themes and/or groups. Each cohort meets for three 1-hour virtual sessions and includes no more than 8 people. Each session has a topic, and the group shares questions and experience with one another.</p> 467<p><strong>Cost per series is $225, or $75 per session.</strong></p> 468<p class="text-sm text-muted-foreground"><em>A course must have at least 3 people to go forward. If fewer than three sign up and the course is cancelled, you will receive a full refund. There are no refunds for individual sessions you miss.</em></p> 469<p>
469Anyone participating in cohort coaching can join my Office Hours, held once a month.</p>`})]})})}),l.jsx("section",{className:"bg-background py-16 md:py-20",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-5xl",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx("h2",{className:"text-center mb-2",children:"Upcoming Cohorts: Turning Points"}),l.jsx("p",{className:"text-center text-muted-foreground text-sm mt-2",children:"Cohorts run only when they fill. Register your interest below and you'll be notified when dates are confirmed."})]}),l.jsx("div",{className:"grid md:grid-cols-2 gap-8 mt-10",children:b9.map((o,a)=>l.jsx(re,{animation:"fade-up",delay:a*150,children:l.jsxs("div",{className:"h-full bg-card border border-border rounded p-8 shadow-md flex flex-col",children:[l.jsx(fe,{contentKey:`${o.key}_title`,defaultValue:o.title,as:"h3",className:"font-heading text-2xl font-bold mb-4 text-foreground"}),l.jsx(fe,{contentKey:`${o.key}_body`,defaultValue:o.body,as:"p",className:"text-muted-foreground text-sm leading-relaxed mb-4"}),l.jsx(fe,{contentKey:`${o.key}_fit`,defaultValue:o.fit,as:"p",className:"text-muted-foreground text-sm leading-relaxed mb-4 italic"}),o.note&&l.jsx(fe,{contentKey:`${o.key}_note`,defaultValue:o.note,as:"p",className:"text-primary text-sm font-semibold mb-4"}),l.jsx(x9,{cohortKey:o.key,cohortTitle:o.title,children:l.jsx("button",{type:"button",className:"mt-auto inline-block self-start border border-primary text-primary px-6 py-2.5 font-body text-xs font-bold uppercase tracking-wider hover:bg-primary hover:text-primary-foreground transition-colors active:scale-[0.97]",children:"Register Interest"})})]})},o.key))})]})}),l.jsx("section",{className:"section-light py-16 md:py-20",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-2xl",children:l.jsxs(re,{animation:"fade-up",children:[l.jsx("h2",{className:"text-center mb-3",children:"Suggest a Cohort"}),l.jsx("p",{className:"text-center text-muted-foreground mb-8",children:"Don't see what you're looking for? Suggest a cohort topic or group and I'll be in touch."}),l.jsxs("form",{onSubmit:i,className:"space-y-4 bg-background p-6 md:p-8 rounded border border-border shadow-sm",children:[l.jsx(ue,{placeholder:"Your name (optional)",value:n.name,onChange:o=>s("name",o.target.value),maxLength:100}),l.jsx(ue,{placeholder:"Email",type:"email",required:!0,value:n.email,onChange:o=>s("email",o.target.value),maxLength:255}),l.jsx(jt,{placeholder:"I'd like to see a cohort or group focused onâ¦",required:!0,value:n.topic,onChange:o=>s("topic",o.target.value),maxLength:2e3,rows:4}),l.jsx(jt,{placeholder:"Why I think this is importantâ¦",value:n.importance,onChange:o=>s("importance",o.target.value),maxLength:2e3,rows:4}),l.jsx(jt,{placeholder:"More about me â age, gender, occupation, or any specific season in your life you'd like to share",value:n.about,onChange:o=>s("about",o.target.value),maxLength:2e3,rows:3}),l.jsx(q,{type:"submit",disabled:t,className:"w-full bg-primary hover:brightness-110 text-primary-foreground font-body font-semibold uppercase tracking-wider py-3",children:t?"Submitting...":"Submit Suggestion"})]})]})})}),l.jsx(au,{}),l.jsx(Ye,{}),l.jsx(Mi,{})]})},k9=()=>l.jsx(Pi,{pageSlug:"cohort-coaching",children:l.jsx(w9,{})});function bn(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Js(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function S9(t,e){const n=bn(t);return isNaN(e)?Js(t,NaN):(n.setDate(n.getDate()+e),n)}function Rj(t,e){const n=bn(t);if(isNaN(e))return Js(t,NaN);if(!e)return n;const r=n.getDate(),s=Js(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const KO=6048e5,C9=864e5,GO=6e4,YO=36e5;let j9={};function Kh(){return j9}function Lc(t,e){var a,c,u,d;const n=Kh(),r=(e==null?void 0:e.weekStartsOn)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=bn(t),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function gm(t){return Lc(t,{weekStartsOn:1}
vendor: 4,405 bytes, line 469
469)}function JO(t){const e=bn(t),n=e.getFullYear(),r=Js(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=gm(r),i=Js(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=gm(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function ym(t){const e=bn(t);return e.setHours(0,0,0,0),e}function Aj(t){const e=bn(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function N9(t,e){const n=ym(t),r=ym(e),s=+n-Aj(n),i=+r-Aj(r);return Math.round((s-i)/C9)}function _9(t){const e=JO(t),n=Js(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),gm(n)}function Oj(t,e){const n=ym(t),r=ym(e);return+n==+r}function E9(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function T9(t){if(!E9(t)&&typeof t!="number")return!1;const e=bn(t);return!isNaN(Number(e))}function R9(t){const e=bn(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function A9(t){const e=bn(t);return e.setDate(1),e.setHours(0,0,0,0),e}function O9(t){const e=bn(t),n=Js(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function P9(t,e){var a,c;const n=Kh(),r=n.weekStartsOn??((c=(a=n.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??0,s=bn(t),i=s.getDay(),o=(i<r?-7:0)+6-(i-r);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}const M9={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"}},I9=(t,e,n)=>{let r;const s=M9[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Dv(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const D9={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},L9={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$9={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},B9={date:Dv({formats:D9,defaultWidth:"full"}),time:Dv({formats:L9,defaultWidth:"full"}),dateTime:Dv({formats:$9,defaultWidth:"full"})},z9={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},F9=(t,e,n,r)=>z9[t];function Au(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const U9={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},V9={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},H9={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"]},W9={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","Frid
469ay","Saturday"]},q9={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"}},K9={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"}},G9=(t,e)=>{const n=Number(t),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"},Y9={ordinalNumber:G9,era:Au({values:U9,defaultWidth:"wide"}),quarter:Au({values:V9,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Au({values:H9,defaultWidth:"wide"}),day:Au({values:W9,defaultWidth:"wide"}),dayPeriod:Au({values:q9,defaultWidth:"wide",formattingValues:K9,defaultFormattingWidth:"wide"})};function Ou(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const o=i[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?Q9(a,h=>h.test(o)):J9(a,h=>h.test(o));let u;u=t.valueCallback?t.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=e.slice(o.length);return{value:u,rest:d}}}function J9(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Q9(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function X9(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(s.length);return{value:o,rest:a}}}const Z9=/^(\d+)(th|st|nd|rd)?/i,eK=/\d+/i,tK={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},nK={any:[/^b/i,/^(a|c)/i]},rK={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sK={any:[/1/i,/2/i,/3/i,/4/i]},iK={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},oK={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]},aK={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},lK={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]},cK={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},uK={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}},dK={ordinalNumber:X9({matchPattern:Z9,parsePattern:eK,valueCallback:t=>parseInt(t,10)}),era:Ou({matchPatterns:tK,defaultMatchWidth:"wide",parsePatterns:nK,defaultParseWidth:"any"}),quarter:Ou({matchPatterns:rK,defaultMatchWidth:"wide",parsePatterns:sK,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ou({matchPatterns:iK,defaultMatchWidth:"wide",parsePatterns:oK,defaultParseWidth:"any"}),day:Ou({matchPatterns:aK,defaultMatchWidth:"wide",parsePatterns:lK,defaultParseWidth:"any"}),dayPeriod:Ou({matchPatterns:cK,defaultMatchWidth:"any",parsePatterns:uK,defaultParseWidth:"any"})},hK={code:"en-US",formatDistance:I9,formatLong:B9,formatRelative:F9,localize:Y9,match:dK,options:{weekStartsOn:0,firstWeekContainsDate:1}};function fK(t){const e=bn(t);return N9(e,O9(e))+1}function pK(t){const e=bn(t),n=+gm(e)-+_9(e);return Math.round(n/KO)+1}function QO(t,e){var d,h,p,f;const n=bn(t),r=n.getFullYear(),s=Kh(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((f=(p=s.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??1,o=Js(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=Lc(o,e),c=Js(t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=Lc(c,e);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function mK(t,e){var a,c,u,d;const n=Kh(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,s=QO(t,e),i=Js(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Lc(i,e)}function gK(t,e){const n=bn(t),r=+Lc(n,e)-+mK(n,e);return Math.round(r/KO)+1}function lt(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Hi={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return lt(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):lt(n+1,2)},d(t,e){return lt(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){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(t,e){return lt(t.getHours()%12||12,e.length)},H(t,e){return lt(t.getHours(),e.length)},m(t,e){return lt(t.getMinutes(),e.length)},s(t,e){return lt(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return lt(s,e.length)}},_l={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Pj={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){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(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Hi.y(t,e)},Y:function(t,e,n,r){const s=QO(t,r),i=s>0?s:1-s;if(e==="YY"){const o=i%100;return lt(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):lt(i,e.length)},R:function(t,e){const n=JO(t);return lt(n,e.length)},u:function(t,e){const n=t.getFullYear();return lt(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return lt(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(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return lt(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(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Hi.M(t,e);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(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return lt(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(t,e,n,r){const s=gK(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):lt(s,e.length)},I:function(t,e,n){const r=pK(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):lt(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Hi.d(t,e)},D:function(t,e,n){const r=fK(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):lt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){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(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return lt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return lt(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return lt(s,e.length);case"io":return n.ordinalNumber(s,{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(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=_l.noon:r===0?s=_l.midnight:s=r/12>
vendor: 4,402 bytes, line 469
469=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=_l.evening:r>=12?s=_l.afternoon:r>=4?s=_l.morning:s=_l.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Hi.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Hi.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):lt(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):lt(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Hi.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Hi.s(t,e)},S:function(t,e){return Hi.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Ij(r);case"XXXX":case"XX":return ma(r);case"XXXXX":case"XXX":default:return ma(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Ij(r);case"xxxx":case"xx":return ma(r);case"xxxxx":case"xxx":default:return ma(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Mj(r,":");case"OOOO":default:return"GMT"+ma(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Mj(r,":");case"zzzz":default:return"GMT"+ma(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return lt(r,e.length)},T:function(t,e,n){const r=t.getTime();return lt(r,e.length)}};function Mj(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+lt(i,2)}function Ij(t,e){return t%60===0?(t>0?"-":"+")+lt(Math.abs(t)/60,2):ma(t,e)}function ma(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=lt(Math.trunc(r/60),2),i=lt(r%60,2);return n+s+e+i}const Dj=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},XO=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},yK=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return Dj(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",Dj(r,e)).replace("{{time}}",XO(s,e))},vK={p:XO,P:yK},xK=/^D+$/,bK=/^Y+$/,wK=["D","DD","YY","YYYY"];function kK(t){return xK.test(t)}function SK(t){return bK.test(t)}function CK(t,e,n){const r=jK(t,e,n);if(console.warn(r),wK.includes(t))throw new RangeError(r)}function jK(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const NK=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_K=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,EK=/^'([^]*?)'?$/,TK=/''/g,RK=/[a-zA-Z]/;function mt(t,e,n){var d,h,p,f;const r=Kh(),s=r.locale??hK,i=r.firstWeekContainsDate??((h=(d=r.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,o=r.weekStartsOn??((f=(p=r.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,a=bn(t);if(!T9(a))throw new RangeError("Invalid time value");let c=e.match(_K).map(g=>{const m=g[0];if(m==="p"||m==="P"){const v=vK[m];return v(g,s.formatLong)}return g}).join("").match(NK).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const m=g[0];if(m==="'")return{isToken:!1,value:AK(g)};if(Pj[m])return{isToken:!0,value:g};
469if(m.match(RK))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:g}});s.localize.preprocessor&&(c=s.localize.preprocessor(a,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(g=>{if(!g.isToken)return g.value;const m=g.value;(SK(m)||kK(m))&&CK(m,e,String(t));const v=Pj[m[0]];return v(a,m,s.localize,u)}).join("")}function AK(t){const e=t.match(EK);return e?e[1].replace(TK,"'"):t}function Lj(t,e){const n=bn(t),r=bn(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function ka(t,e){const r=IK(t);let s;if(r.date){const c=DK(r.date,2);s=LK(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const i=s.getTime();let o=0,a;if(r.time&&(o=$K(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(a=BK(r.timezone),isNaN(a))return new Date(NaN)}else{const c=new Date(i+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(i+o+a)}const zf={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},OK=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,PK=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,MK=/^([+-])(\d{2})(?::?(\d{2}))?$/;function IK(t){const e={},n=t.split(zf.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],zf.timeZoneDelimiter.test(e.date)&&(e.date=t.split(zf.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const s=zf.timezone.exec(r);s?(e.time=r.replace(s[1],""),e.timezone=s[1]):e.time=r}return e}function DK(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const s=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?s:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function LK(t,e){if(e===null)return new Date(NaN);const n=t.match(OK);if(!n)return new Date(NaN);const r=!!n[4],s=Pu(n[1]),i=Pu(n[2])-1,o=Pu(n[3]),a=Pu(n[4]),c=Pu(n[5])-1;if(r)return HK(e,a,c)?zK(e,a,c):new Date(NaN);{const u=new Date(0);return!UK(e,i,o)||!VK(e,s)?new Date(NaN):(u.setUTCFullYear(e,i,Math.max(s,o)),u)}}function Pu(t){return t?parseInt(t):1}function $K(t){const e=t.match(PK);if(!e)return NaN;const n=Lv(e[1]),r=Lv(e[2]),s=Lv(e[3]);return WK(n,r,s)?n*YO+r*GO+s*1e3:NaN}function Lv(t){return t&&parseFloat(t.replace(",","."))||0}function BK(t){if(t==="Z")return 0;const e=t.match(MK);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return qK(r,s)?n*(r*YO+s*GO):NaN}function zK(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const s=r.getUTCDay()||7,i=(e-1)*7+n+1-s;return r.setUTCDate(r.getUTCDate()+i),r}const FK=[31,null,31,30,31,30,31,31,30,31,30,31];function ZO(t){return t%400===0||t%4===0&&t%100!==0}function UK(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(FK[e]||(ZO(t)?29:28))}function VK(t,e){return e>=1&&e<=(ZO(t)?366:365)}function HK(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function WK(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function qK(t,e){return e>=0&&e<=59}const KK=()=>{const[t,e]=y.useState([]);return y.useEffect(()=>{D.from("blog_posts").select("*").eq("status","published").order("published_at",{ascending:!1}).then(({data:n})=>e(n??[]))},[]),l.jsxs("main",{children:[l.jsx(ut,{pageKey:"blog"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-24 pb-16 section-light min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsx(re,{animation:"fade-up",children:l.jsx("h1",{className:"text-center mb-12",children:"Blog"})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((n,r)=>l.jsx(re,{animation:"fade-up",delay:r*100,children:l.jsx(Be,{to:`/blog/${n.slug}`,className:"block group no-underline",children:l.jsxs("article",{className:"bg-background rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-shadow",children:[n.featured_image&&l.jsx("img",{src:n.featured_image,alt:n.title,className:"w-full h-48 object-cover"}),l.jsxs("div",{className:"p-6",children:[l.jsx("h3",{className:"text-foreground group-hover:text-primary transition-colors font-bold text-lg mb-2",children:n.title}),n.excerpt&&l.jsx("p",{className:"text-muted-foreground text-sm mb-3",children:n.excerpt}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[n.author&&`${n.author} · `,mt(new Date(n.published_at),"MMM d, yyyy")]})]})]})})},n.id))}),t.length===0&&l.jsx("p",{className:"text-center text-muted-foreground mt-8",children:"No posts yet. Check back soon!"})]})}),l.jsx(Ye,{})]})},GK=()=>{const{slug:t}=ea(),[e,n]=y.useState(null);return y.useEffect(()=>{t&&D.from("blog_posts").select("*").eq("slug",t).eq("status","published").single().then(({data:r})=>n(r))},[t]),e?l.jsxs("main",{children:[l.jsx(ut,{title:e.seo_title||e.title,de
469scription:e.seo_description||e.excerpt,image:e.featured_image,type:"article",jsonLd:{"@context":"https://schema.org","@type":"BlogPosting",headline:e.title,description:e.seo_description||e.excerpt||void 0,image:e.featured_image||void 0,datePublished:e.published_at,author:{"@type":"Person",name:e.author||"Stephanie Peirolo"},url:`https://speirolo.com/blog/${e.slug}`}}),l.jsx(Ge,{}),l.jsx("article",{className:"pt-24 pb-16 section-light min-h-screen",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-3xl",children:l.jsxs(re,{animation:"fade-up",children:[e.featured_image&&l.jsx("img",{src:e.featured_image,alt:e.title,className:"w-full rounded-lg mb-8 shadow-md"}),l.jsx("h1",{className:"mb-4",children:e.title}),l.jsxs("p",{className:"text-muted-foreground text-sm mb-8",children:[e.author&&`By ${e.author} · `,mt(new Date(e.published_at),"MMMM d, yyyy")]}),l.jsx("div",{className:"prose prose-lg max-w-none",dangerouslySetInnerHTML:{__html:e.content}})]})})}),l.jsx(Ye,{})]}):l.jsxs("main",{children:[l.jsx(Ge,{}),l.jsx("div",{className:"pt-24 pb-16 text-center min-h-screen section-light",children:l.jsx("p",{className:"text-muted-foreground mt-20",children:"Loading..."})}),l.jsx(Ye,{})]})},YK=()=>{const[t,e]=y.useState([]),[n,r]=y.useState(!0);return y.useEffect(()=>{D.functions.invoke("substack-feed").then(({data:s})=>{e((s==null?void 0:s.items)??[]),r(!1)})},[]),l.jsxs("main",{children:[l.jsx(ut,{pageKey:"substack"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 section-light min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx("h1",{className:"text-center mb-4",children:"Writing"}),l.jsx("p",{className:"text-center text-muted-foreground mb-4 max-w-2xl mx-auto",children:"Essays, reflections, and ideas from Stephanie's Substack."}),l.jsx("div",{className:"text-center mb-12",children:l.jsxs("a",{href:"https://speirolo.substack.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm font-semibold uppercase tracking-wider text-primary hover:underline",children:["Subscribe on Substack ",l.jsx(sk,{className:"h-3 w-3"})]})})]}),n&&l.jsx("div",{className:"flex justify-center py-12",children:l.jsx(qt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),!n&&t.length===0&&l.jsxs("p",{className:"text-center text-muted-foreground",children:["Unable to load posts right now."," ",l.jsx("a",{href:"https://speirolo.substack.com/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Visit Substack directly â"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((s,i)=>l.jsx(re,{animation:"fade-up",delay:Math.min(i*80,400),children:l.jsx("a",{href:s.link,target:"_blank",rel:"noopener noreferrer",className:"block group no-underline h-full",children:l.jsxs("article",{className:"bg-background rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-shadow h-full flex flex-col",children:[s.image&&l.jsx("img",{src:s.image,alt:s.title,className:"w-full h-48 object-cover",loading:"lazy"}),l.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[l.jsx("h3",{className:"text-foreground group-hover:text-primary transition-colors font-bold text-lg mb-2",children:s.title}),s.excerpt&&l.jsxs("p",{className:"text-muted-foreground text-sm mb-3 flex-1",children:[s.excerpt,"â¦"]}),s.pubDate&&l.jsx("p",{className:"text-xs text-muted-foreground",children:mt(new Date(s.pubDate),"MMM d, yyyy")})]})]})})},s.link))})]})}),l.jsx(Ye,{})]})},$v="https://badbossbrief.substack.com/",JK=()=>{const[t,e]=y.useState([]),[n,r]=y.useState(!0);return y.useEffect(()=>{D.functions.invoke("badboss-feed").then(({data:s})=>{e((s==null?void 0:s.items)??[]),r(!1)})},[]),l.jsxs("main",{children:[l.jsx(ut,{pageKey:"podcast",jsonLd:{"@context":"https://schema.org","@type":"PodcastSeries",name:"Bad Boss Brief",description:"Stephanie's podcast on leadership, power, and the bosses who shape (or break) us.",url:"https://speirolo.com/podcast",author:{"@type":"Person",name:"Stephanie Peirolo"},webFeed:$v}}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 section-light min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx("h1",{className:"text-center mb-4",children:"Bad Boss Brief"}),l.jsx("p",{className:"text-center text-muted-foreground mb-4 max-w-2xl mx-auto",children:"Stephanie's podcast on leadership, power, and the bosses who shape (or break) us."}),l.jsx("div",{className:"text-center mb-12",children:l.jsxs("a",{href:$v,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm font-semibold uppercase tracking-wider text-primary hover:underline",children:["Listen & Subscribe on Substack ",l.jsx(sk,{className:"h-3 w-3"})]})})]}),n&&l.jsx("div",{className:"flex justify-center py-12",children:l.jsx(qt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),!n&&t.length===0&&l.jsxs("p",{className:"text-center text-muted-foreground",children:["Unable to load episodes right now."," ",l.jsx("a",{href:$v,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Visit Bad Boss Brief directly â"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-16",children:t.map((s,i)=>l.jsx(re,{animation:"fade-up",delay:Math.min(i*80,400),children:l.jsx("a",{href:s.link,target:"_blank",rel:"noopener noreferrer",className:"block group no-underline h-full",children:l.jsxs("article",{className:"bg-background rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-shadow h-full flex flex-col",children:[s.image&&l.jsx("img",{src:s.image,alt:s.title,className:"w-full h-48 object-cover",loading:"lazy"}),l.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[l.jsx("h3",{className:"text-foreground group-hover:text-primary transition-colors font-bold text-lg mb-2",children:s.title}),s.excerpt&&l.jsxs("p",{className:"text-muted-foreground text-sm mb-3 flex-1",children:[s.excerpt,"â¦"]}),s.pubDate&&l.jsx("p",{className:"text-xs text-muted-foreground",children:mt(new Date(s.pubDate),"MMM d, yyyy")})]})]})})},s.link))}),l.jsx(re,{animation:"fade-up",children:l.jsxs("div",{className:"max-w-2xl mx-auto bg-background rounded-lg shadow-md p-6",children:[l.jsx("h2",{className:"text-center text-xl font-bold mb-4",children:"Subscribe"}),l.jsx("iframe",{src:"https://badbossbrief.substack.com/embed",width:"100%",height:"320",style:{border:"1px solid hsl(var(--border))",background:"transparent"},frameBorder:0,scrolling:"no",title:"Subscribe to Bad Boss Brief"})]})})]})}),l.jsx(Ye,{})]})},$j=()=>{const[t,e]=y.useState(""),[n,r]=y.useState(""),[s,i]=y.useState(!1),[o,a]=y.useState(!1),{signIn:c,signUp:u,user:d,loading:h}=pr(),p=In(),[f]=X0(),g=f.get("next")||"/reading-room",{toast:m}=ht();y.useEffect(()=>{!h&&d&&p(g,{replace:!0})},[h,d,p,g]);const v=async x=>{if(x.preventDefault(),i(!0),o){const{error:b}=await u(t,n);b?m({title:"Sign up failed",description:b.message,variant:"destructive"}):(m({title:"Account created",description:"Check your email to verify, then sign in."}),a(!1))}else{const{error:b}=await c(t,n);b?m({title:"Login failed",description:b.message,variant:"destructive"}):p(g,{replace:!0})}i(!1)};return l.jsxs("main",{children:[l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 section-light min-h-screen",children:l.jsx("div",{className:"container mx-auto px-6 max-w-md",children:l.jsxs("div",{className:"bg-background border rounded-lg shadow-md p-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-center mb-6 font-heading",children:o?"Create Account":"Sign In"}),l.jsxs("form",{onSubmit:v,className:"space-y-4",children:[l.jsx(ue,{type:"email",placeholder:"Email",required:!0,value:t,onChange:x=>e(x.target.value)}),l.jsx(ue,{type:"password",placeholder:"Password",required:!0,minLength:6,value:n,onChange:x=>r(x.target.value)}),l.jsx(q,{type:"submit",className:"w-full",disabled:s,children:s?"Please waitâ¦":o?"Create Account":"Sign In"})]}),!o&&l.jsx("p",{className:"text-center text-sm mt-4",children:l.jsx(Be,{to:"/forgot-password",className:"text-primary underline hover:no-underline",children:"Forgot your password?"})}),l.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-4",children:[o?"Already have an account?":"Don't have an account?"," ",l.jsx("button",{type:"button",onClick:()=>a(!o),className:"text-primary underline hover:no-underline",children:o?"Sign In":"Sign Up"})]}),l.jsx("p",{className:"text-center text-xs text-muted-foreground mt-6",children:l.jsx(Be,{to:"/",className:"hover:underline",children:"â Back to home"})})]})})}),l.jsx(Ye,{})]})},QK=()=>{const[t,e]=y.useState(""),[n,r]=y.useState(!1),[s,i]=y.useState(!1),{toast:o}=ht(),a=async c=>{c.preventDefault(),r(!0);const{error:u}=await D.auth.resetPasswordForEmail(t,{redirectTo:`${window.location.origin}/reset-password`});r(!1),u?o({title:"Couldn't send reset email",description:u.message,variant:"destructive"}):(i(!0),o({title:"Check your email",description:"We've sent you a password reset link."}))};return l.jsxs("main",{children:[l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 section-light min-h-screen",children:l.jsx("div",{className:"container mx-auto px-6 max-w-md",children:l.jsxs("div",{className:"bg-background border rounded-lg shadow-md p-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-center mb-2 font-heading",children:"Forgot password?"}),l.jsx("p",{className:"text-center text-sm text-muted-foreground mb-6",children:"Enter your account email and we'll send you a link to reset it."}),s?l.jsxs("div",{className:"text-center space-y-4",children:[l.jsxs("p",{className:"text-sm",children:["If an account exists for ",l.jsx("strong",{children:t}),", a reset link is on its way. Check your inbox (and spam folder)."]}),l.jsx(q,{variant:"outline",onClick:()=>i(!1),className:"w-full",children:"Send to a different email"})]}):l.jsxs("form",{onSubmit:a,className:"space-y-4",children:[l.jsx(ue,{type:"email",placeholder:"Email",required:!0,value:t,onChange:c=>e(c.target.value)}),l.jsx(q,{type:"submit",className:"w-full",disabled:n,children:n?"Sendingâ¦":"Send reset link"})]}),l.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-6",children:["Remembered it?"," ",l.jsx(Be,{to:"/login",className:"text-primary underline hover:no-underline",children:"Sign in"})]}),l.jsx("p",{className:"text-center text-xs text-muted-foreground mt-4",children:l.jsx(Be,{to:"/",className:"hover:underline",children:"â Back to home"})})]})})}),l.jsx(Ye,{})]})},XK=()=>{const[t,e]=y.useState(""),[n,r]=y.useState(""),[s,i]=y.useState(!1),[o,a]=y.useState(!1),[c,u]=y.useState(null),d=In(),{toast:h}=ht();y.useEffect(()=>{const{data:f}=D.auth.onAuthStateChange(m=>{(m==="PASSWORD_RECOVERY"||m==="SIGNED_IN")&&a(!0)});D.auth.getSession().then(({data:m})=>{m.session&&a(!0)});const g=setTimeout(()=>{D.auth.getSession().then(({data:m})=>
469{m.session||u("This reset link is invalid or has expired. Please request a new one.")})},1500);return()=>{f.subscription.unsubscribe(),clearTimeout(g)}},[]);const p=async f=>{if(f.preventDefault(),t!==n){h({title:"Passwords don't match",variant:"destructive"});return}i(!0);const{error:g}=await D.auth.updateUser({password:t});i(!1),g?h({title:"Couldn't update password",description:g.message,variant:"destructive"}):(h({title:"Password updated",description:"You're all set."}),d("/dashboard",{replace:!0}))};return l.jsxs("main",{children:[l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 section-light min-h-screen",children:l.jsx("div",{className:"container mx-auto px-6 max-w-md",children:l.jsxs("div",{className:"bg-background border rounded-lg shadow-md p-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-center mb-6 font-heading",children:"Set a new password"}),c?l.jsxs("div",{className:"text-center space-y-4",children:[l.jsx("p",{className:"text-sm text-destructive",children:c}),l.jsx(Be,{to:"/forgot-password",className:"text-primary underline text-sm",children:"Request a new link"})]}):o?l.jsxs("form",{onSubmit:p,className:"space-y-4",children:[l.jsx(ue,{type:"password",placeholder:"New password",required:!0,minLength:6,value:t,onChange:f=>e(f.target.value)}),l.jsx(ue,{type:"password",placeholder:"Confirm new password",required:!0,minLength:6,value:n,onChange:f=>r(f.target.value)}),l.jsx(q,{type:"submit",className:"w-full",disabled:s,children:s?"Updatingâ¦":"Update password"})]}):l.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Verifying your reset linkâ¦"}),l.jsx("p",{className:"text-center text-xs text-muted-foreground mt-6",children:l.jsx(Be,{to:"/",className:"hover:underline",children:"â Back to home"})})]})})}),l.jsx(Ye,{})]})},ZK=({isMember:t})=>{const{user:e}=pr(),{toast:n}=ht(),[r,s]=y.useState([]),[i,o]=y.useState(""),[a,c]=y.useState(!1),[u,d]=y.useState(!0),h=y.useRef(null);y.useEffect(()=>{if(!e){d(!1);return}D.from("reading_room_messages").select("*").order("created_at",{ascending:!0}).limit(200).then(({data:g})=>{s(g??[]),d(!1)});const f=D.channel("reading-room-messages").on("postgres_changes",{event:"INSERT",schema:"public",table:"reading_room_messages"},g=>s(m=>[...m,g.new])).on("postgres_changes",{event:"DELETE",schema:"public",table:"reading_room_messages"},g=>s(m=>m.filter(v=>v.id!==g.old.id))).subscribe();return()=>{D.removeChannel(f)}},[e]),y.useEffect(()=>{var f;(f=h.current)==null||f.scrollTo({top:h.current.scrollHeight,behavior:"smooth"})},[r]);const p=async()=>{var m,v;if(!i.trim()||!e)return;c(!0);const f=((m=e.user_metadata)==null?void 0:m.full_name)||((v=e.email)==null?void 0:v.split("@")[0])||"Member",{error:g}=await D.from("reading_room_messages").insert({user_id:e.id,display_name:f,message:i.trim()});g?n({title:"Couldn't send",description:g.message,variant:"destructive"}):o(""),c(!1)};return e?l.jsxs("div",{className:"bg-background border rounded-lg flex flex-col h-[500px]",children:[l.jsxs("div",{className:"border-b px-4 py-3",children:[l.jsx("h3",{className:"font-bold",children:"Members Chat"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"A space for Reading Room members to talk shop."})]}),l.jsxs("div",{ref:h,className:"flex-1 overflow-y-auto p-4 space-y-3",children:[u&&l.jsx("div",{className:"flex justify-center",children:l.jsx(qt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!u&&r.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No messages yet â be the first to start a thread."}),r.map(f=>l.jsxs("div",{className:"text-sm",children:[l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsx("span",{className:"font-semibold text-foreground",children:f.display_name}),l.jsx("span",{className:"text-xs text-muted-foreground",children:mt(new Date(f.created_at),"MMM d, h:mm a")})]}),l.jsx("p",{className:"text-foreground/90 whitespace-pre-wrap break-words",children:f.message})]},f.id))]}),l.jsx("div",{className:"border-t p-3",children:t?l.jsxs("form",{className:"flex gap-2",onSubmit:f=>{f.preventDefault(),p()},children:[l.jsx(ue,{placeholder:"Share a thoughtâ¦",value:i,onChange:f=>o(f.target.value),maxLength:2e3,disabled:a}),l.jsx(q,{type:"submit",size:"icon",disabled:a||!i.trim(),children:l.jsx(cF,{className:"h-4 w-4"})})]}):l.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Reading Room members can post here. Email Stephanie about a season's pass to join."})})]}):l.jsx("div",{className:"bg-background border rounded-lg p-6 text-center",children:l.jsxs("p",{className:"text-sm text-muted-foreground",children:[l.jsx("a",{href:"/login?next=/reading-room",className:"text-primary hover:underline",children:"Sign in"})," to read and join the conversation."]})})},e7=tu("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 Ot({className:t,variant:e,...n}){return l.jsx("div",{className:se(e7({variant:e}),t),...n})}var t7=y.createContext(void 0);function Dk(t){const e=y.useContext(t7);return t||e||"ltr"}var Bv="rovingFocusGroup.onEntryFocus",n7={bubbles:!1,cancelable:!0},Gh="RovingFocusGroup",[rw,eP,r7]=Z0(Gh),[s7,tP]=Ns(Gh,[r7]),[i7,o7]=s7(Gh),nP=y.forwardRef((t,e)=>l.jsx(rw.Provider,{scope:t.__scopeRovingFocusGroup,children:l.jsx(rw.Slot,{scope:t.__scopeRovingFocusGroup,children:l.jsx(a7,{...t,ref:e})})}));nP.displayName=Gh;var a7=y.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=t,p=y.useRef(null),f=ot(e,p),g=Dk(i),[m,v]=Ci({prop:o,defaultProp:a??null,onChange:c,caller:Gh}),[x,b]=y.useState(!1),w=Jr(u),k=eP(n),j=y.useRef(!1),[E,N]=y.useState(0);return y.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(Bv,w),()=>S.removeEventListener(Bv,w)},[w]),l.jsx(i7,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:m,onItemFocus:y.useCallback(S=>v(S),[v]),onItemShiftTab:y.useCallback(()=>b(!0),[]),onFocusableItemAdd:y.useCallback(()=>N(S=>S+1),[]),onFocusableItemRemove:y.useCallback(()=>N(S=>S-1),[]),children:l.jsx(Ae.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...t.style},onMouseDown:Ce(t.onMouseDown,()=>{j.current=!0}),onFocus:Ce(t.onFocus,S=>{const C=!j.current;if(S.target===S.currentTarget&&C&&!x){const _=new CustomEvent(Bv,n7);if(S.currentTarget.dispatchEvent(_),!_.defaultPrevented){const R=k().filter(F=>F.focusable),O=R.find(F=>F.active),L=R.find(F=>
vendor: 4,070 bytes, line 469
469F.id===m),z=[O,L,...R].filter(Boolean).map(F=>F.ref.current);iP(z,d)}}j.current=!1}),onBlur:Ce(t.onBlur,()=>b(!1))})})}),rP="RovingFocusGroupItem",sP=y.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...a}=t,c=vi(),u=i||c,d=o7(rP,n),h=d.currentTabStopId===u,p=eP(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:m}=d;return y.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),l.jsx(rw.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(Ae.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...a,ref:e,onMouseDown:Ce(t.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:Ce(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:Ce(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=u7(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=p().filter(k=>k.focusable).map(k=>k.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const k=w.indexOf(v.currentTarget);w=d.loop?d7(w,k+1):w.slice(k+1)}setTimeout(()=>iP(w))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:m!=null}):o})})});sP.displayName=rP;var l7={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function c7(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function u7(t,e,n){const r=c7(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return l7[r]}function iP(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function d7(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var h7=nP,f7=sP,py="Tabs",[p7,Foe]=Ns(py,[tP]),oP=tP(),[m7,Lk]=p7(py),aP=y.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:c="automatic",...u}=t,d=Dk(a),[h,p]=Ci({prop:r,onChange:s,defaultProp:i??"",caller:py});return l.jsx(m7,{scope:n,baseId:vi(),value:h,onValueChange:p,orientation:o,dir:d,activationMode:c,children:l.jsx(Ae.div,{dir:d,"data-orientation":o,...u,ref:e})})});aP.displayName=py;var lP="TabsList",cP=y.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=Lk(lP,n),o=oP(n);return l.jsx(h7,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:l.jsx(Ae.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});cP.displayName=lP;var uP="TabsTrigger",dP=y.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,o=Lk(uP,n),a=oP(n),c=pP(o.baseId,r),u=mP(o.baseId,r),d=r===o.value;return l.jsx(f7,{asChild:!0,...a,focusable:!s,active:d,children:l.jsx(Ae.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:Ce(t.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:Ce(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:Ce(t.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!s&&h&&o.onValueChange(r)})})})});dP.displayName=uP;var hP="TabsContent",fP=y.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=t,a=Lk(hP,n),c=pP(a.baseId,r),u=mP(a.baseId,r),d=r===a.value,h=y.useRef(d);return y.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),l.jsx(ta,{present:s||d,children:({present:p})=>l.jsx(Ae.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:p&&i})})});fP.displayName=hP;function pP(t,e){return`${t}-trigger-${e}`}function mP(t,e){return`${t}-content-${e}`}var g7=aP,gP=cP,yP=dP,vP=fP;const y7=g7,xP=y.forwardRef(({className:t,...e},n)=>
469l.jsx(gP,{ref:n,className:se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));xP.displayName=gP.displayName;const bP=y.forwardRef(({className:t,...e},n)=>l.jsx(yP,{ref:n,className:se("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",t),...e}));bP.displayName=yP.displayName;const wP=y.forwardRef(({className:t,...e},n)=>l.jsx(vP,{ref:n,className:se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));wP.displayName=vP.displayName;const dh=[{value:"real_work",label:"Real Work"},{value:"turning_points",label:"Turning Points"}],my=[{id:1,name:"Boss 101",blurb:"Foundational concepts"},{id:2,name:"Fight",blurb:"Anger and conflict"},{id:3,name:"Big Feelings",blurb:"Navigating strong emotions"},{id:4,name:"Change",blurb:"When things get different"},{id:5,name:"Seasons",blurb:"Youth, aging and more"},{id:6,name:"Women's Room",blurb:""},{id:7,name:"For Introverts",blurb:""}],v7=t=>{var e;return((e=my.find(n=>n.id===t))==null?void 0:e.name)??"Unsorted"},x7=t=>{var e;return((e=dh.find(n=>n.value===t))==null?void 0:e.label)??t},b7=t=>t==="video"?l.jsx(AA,{className:"h-4 w-4"}):t==="worksheet"?l.jsx(ul,{className:"h-4 w-4"}):l.jsx(rk,{className:"h-4 w-4"}),w7=()=>{const{user:t}=pr(),{openCheckout:e,checkoutElement:n}=Rk(),[r,s]=y.useState([]),[i,o]=y.useState(!0),[a,c]=y.useState(!1),[u,d]=y.useState(null),[h,p]=y.useState(null),[f,g]=y.useState(!1),[m,v]=y.useState(null),[x,b]=y.useState("real_work"),w=S=>{if(!t){window.location.href="/login?next=/reading-room";return}e({priceId:S,customerEmail:t.email,userId:t.id,title:S==="reading_room_monthly"?"Reading Room â $5/month":"Reading Room â $60/year",metadata:{purchase_source:`subscription_${S}`,product_label:"Reading Room Membership"}})};y.useEffect(()=>{D.from("reading_room_articles").select("id, slug, title, type, excerpt, cover_image, is_free_preview, tracks, section").eq("published",!0).order("position",{ascending:!0}).order("title",{ascending:!0}).then(({data:S})=>{s(S??[]),o(!1)})},[]),y.useEffect(()=>{if(!t){c(!1);return}D.from("reading_room_members").select("expires_at").eq("user_id",t.id).maybeSingle().then(({data:S})=>{if(!S)return c(!1);const C=!S.expires_at||new Date(S.expires_at)>new Date;c(C)})},[t]);const k=y.useMemo(()=>r.filter(S=>(S.tracks??[]).includes(x)),[r,x]),j=y.useMemo(()=>{const S=new Map;return k.forEach(C=>{const _=C.section??0;S.has(_)||S.set(_,[]),S.get(_).push(C)}),S},[k]),E=async S=>{if(!S.is_free_preview&&!a)return;d(S),p(null),v(null),g(!0);const{data:_,error:R}=await D.from("reading_room_article_bodies").select("body, video_url, file_url").eq("article_id",S.id).maybeSingle();R||!_?v("Unable to load this content. You may need an active membership."):p(_),g(!1)},N=S=>l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.map((C,_)=>{const R=!C.is_free_preview&&!a;return l.jsx(re,{animation:"fade-up",delay:Math.min(_*40,240),children:l.jsx("button",{onClick:()=>E(C),disabled:R&&!t,className:"text-left bg-background rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-shadow w-full h-full flex flex-col group disabled:cursor-not-allowed",children:l.jsxs("div",{className:"p-5 flex-1 flex flex-col",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[l.jsxs(Ot,{variant:"outline",className:"capitalize text-xs",children:[l.jsx("span",{className:"mr-1",children:b7(C.type)}),C.type]}),C.is_free_preview&&l.jsx(Ot,{className:"text-xs",children:"Free preview"}),R&&l.jsxs(Ot,{variant:"secondary",className:"text-xs",children:[l.jsx(ik,{className:"h-3 w-3 mr-1"}),"Members"]})]}),l.jsx("h3",{className:"font-bold text-lg mb-2 group-hover:text-primary transition-colors",children:C.title}),C.excerpt&&l.jsx("p",{className:"text-sm text-muted-foreground flex-1",children:C.excerpt}),R&&l.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:t?"Members-only â subscribe below to read.":"Sign in or subscribe to read."})]})})},C.id)})});return l.jsxs("main",{children:[l.jsx(ut,{pageKey:"reading-room"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 section-light min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsx(re,{animation:"fade-up",children:l.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-10",children:[l.jsx(Ot,{variant:"secondary",className:"mb-3 uppercase tracking-wider",children:"The Reading Room"}),l.jsx("h1",{className:"mb-4",children:"Articles, videos & worksheets"}),l.jsxs("p",{className:"text-muted-foreground text-lg leading-relaxed mb-6",children:["Two tracks â ",l.jsx("strong",{children:"Real Work"})," for the workplace, ",l.jsx("strong",{children:"Turning Points"})," for the big changes and decisions â each organized into sections so you can find what you need."]}
469),l.jsxs("p",{className:"text-foreground/80 mb-8",children:["A membership is ",l.jsx("strong",{children:"$5/month"})," or ",l.jsx("strong",{children:"$60/year"})," and includes access to my monthly live Office Hours. Browse below and try any free preview on me."]}),t&&a?l.jsx(Ot,{className:"text-sm",children:"â Active member"}):l.jsxs("div",{className:"flex flex-col sm:flex-row justify-center gap-3",children:[l.jsx(q,{size:"lg",onClick:()=>w("reading_room_monthly"),children:"Subscribe â $5/month"}),l.jsx(q,{size:"lg",variant:"outline",onClick:()=>w("reading_room_yearly"),children:"Subscribe â $60/year"}),!t&&l.jsx(q,{asChild:!0,size:"lg",variant:"ghost",children:l.jsx("a",{href:"/login?next=/reading-room",children:"Sign In"})})]})]})}),i&&l.jsx("div",{className:"flex justify-center py-12",children:l.jsx(qt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),!i&&l.jsxs(y7,{value:x,onValueChange:S=>b(S),className:"mb-16",children:[l.jsx(xP,{className:"mx-auto grid w-full max-w-md grid-cols-2 mb-10",children:dh.map(S=>l.jsx(bP,{value:S.value,className:"uppercase tracking-wider text-xs font-semibold",children:S.label},S.value))}),dh.map(S=>l.jsxs(wP,{value:S.value,className:"space-y-14",children:[my.map(C=>{const _=(j.get(C.id)??[]).filter(()=>x===S.value);return S.value!==x||_.length===0?null:l.jsxs("div",{children:[l.jsx(re,{animation:"fade-up",children:l.jsxs("div",{className:"mb-6 flex items-baseline justify-between gap-4 border-b border-border pb-3",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"font-heading text-2xl md:text-3xl text-foreground",children:C.name}),C.blurb&&l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:C.blurb})]}),l.jsxs("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:[_.length," ",_.length===1?"piece":"pieces"]})]})}),N(_)]},C.id)}),k.length===0&&l.jsx("p",{className:"text-center text-muted-foreground py-12",children:"New content is coming soon."})]},S.value))]}),l.jsx("div",{className:"max-w-3xl mx-auto",children:l.jsx(re,{animation:"fade-up",children:l.jsx(ZK,{isMember:a})})})]})}),l.jsx(Ye,{}),l.jsx(Es,{open:!!u,onOpenChange:S=>!S&&d(null),children:l.jsx(es,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:u&&l.jsxs(l.Fragment,{children:[l.jsx(ts,{children:l.jsx(_r,{className:"font-heading",children:u.title})}),f&&l.jsx("div",{className:"flex justify-center py-8",children:l.jsx(qt,{className:"h-6 w-6 animate-spin"})}),m&&l.jsx("p",{className:"text-sm text-destructive",children:m}),h&&l.jsxs("div",{className:"space-y-4",children:[h.video_url&&l.jsx("div",{className:"aspect-video",children:l.jsx("iframe",{src:h.video_url,className:"w-full h-full rounded",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:u.title})}),h.body&&l.jsx("div",{className:"prose max-w-none",dangerouslySetInnerHTML:{__html:h.body}}),h.file_url&&l.jsx(q,{asChild:!0,children:l.jsx("a",{href:h.file_url,target:"_blank",rel:"noopener noreferrer",children:"Download worksheet"})})]})]})})}),n]})},k7=()=>{const[t,e]=y.useState([]),[n,r]=y.useState(!0);return y.useEffect(()=>{(async()=>{const{data:s}=await D.from("narrative_sections").select("id, slug, title, prompt, pdf_url").eq("published",!0).order("position",{ascending:!0});e(s??[]),r(!1)})()},[]),l.jsxs("main",{children:[l.jsx(ut,{pageKey:"narratives"}),l.jsx(Ge,{}),l.jsx("section",{className:"bg-background pt-32 pb-12 md:pt-40 md:pb-16",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-4xl",children:[l.jsx(re,{animation:"rise",children:l.jsx("h2",{className:"font-heading text-4xl md:text-5xl text-foreground mb-8",children:"What Stories are Holding you Back?"})}),l.jsx(re,{animation:"fade-up",delay:150,children:l.jsxs("div",{className:"space-y-6 text-base md:text-lg text-foreground/80 font-light leading-relaxed",children:[l.jsx("p",{children:"We all carry narratives from our family, our culture, our community. But they are often hidden. We've heard them so many times we think of them as fact, when they are only a story."}),l.jsx("p",{children:"But we must make those stories visible to understand if they support or limit us if we are going to be able to"}),l.jsxs("ul",{className:"list-disc list-inside space-y-2 pl-2 marker:text-primary",children:[l.jsx("li",{children:"Make decisions with clarity and intention"}),l.jsx("li",{children:"Move through big changes and stay grounded"}),l.jsx("li",{children:"Build skills to define and refine our career or vocation"})]}),l.jsx("p",{className:"font-heading text-2xl md:text-3xl text-foreground pt-4",children:"How do we uncover, name, and reframe those narratives?"})]})})]})}),l.jsx("section",{className:"bg-muted/30 py-12 md:py-20",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-6xl",children:[l.jsx(re,{animation:"fade-up",children:l.jsx("p",{className:"text-center text-foreground
469/70 mb-10 font-light",children:"Choose a theme to explore the full reflection, then download the free worksheet."})}),n?l.jsx("div",{className:"flex justify-center py-16",children:l.jsx(qt,{className:"h-8 w-8 animate-spin text-primary"})}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:t.map(s=>l.jsxs(Be,{to:`/narratives/${s.slug}`,className:"group text-left p-6 border-2 border-border bg-background hover:border-primary/50 hover:shadow-md transition-all duration-200 no-underline flex flex-col",children:[l.jsx("h3",{className:"font-heading text-xl text-foreground mb-3",children:s.title}),l.jsx("p",{className:"text-sm text-foreground/70 font-light leading-relaxed flex-1",children:s.prompt}),l.jsxs("div",{className:"mt-5 flex items-center justify-between gap-3",children:[l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-body font-semibold uppercase tracking-wider text-primary",children:["Read more",l.jsx(qs,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-1"})]}),s.pdf_url&&l.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] font-body font-bold uppercase tracking-wider text-primary bg-primary/10 border border-primary/30 rounded px-2 py-1 whitespace-nowrap",children:"+ Free Worksheet"})]})]},s.id))})]})}),l.jsx(Ye,{})]})};var rt;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(const a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(rt||(rt={}));var Bj;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Bj||(Bj={}));const ye=rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qi=t=>{switch(typeof t){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return Number.isNaN(t)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(t)?ye.array:t===null?ye.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ye.promise:typeof Map<"u"&&t instanceof Map?ye.map:typeof Set<"u"&&t instanceof Set?ye.set:typeof Date<"u"&&t instanceof Date?ye.date:ye.object;default:return ye.unknown}}
vendor: 4,703 bytes, line 469
469,ne=rt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class _i extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),r}static assert(e){if(!(e instanceof _i))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}_i.create=t=>new _i(t);const sw=(t,e)=>{let n;switch(t.code){case ne.invalid_type:t.received===ye.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,rt.jsonStringifyReplacer)}`;break;case ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${rt.joinValues(t.keys,", ")}`;break;case ne.invalid_union:n="Invalid input";break;case ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${rt.joinValues(t.options)}`;break;case ne.invalid_enum_value:n=`Invalid enum value. Expected ${rt.joinValues(t.options)}, received '${t.received}'`;break;case ne.invalid_arguments:n="Invalid function arguments";break;case ne.invalid_return_type:n="Invalid function return type";break;case ne.invalid_date:n="Invalid date";break;case ne.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:rt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ne.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ne.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ne.custom:n="Invalid input";break;case ne.invalid_intersection_types:n="Intersection results could not be merged";break;case ne.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ne.not_finite:n="Number must be finite";break;default:n=e.defaultError,rt.assertNever(t)}return{message:n}};let S7=sw;function C7(){return S7}const j7=t=>
vendor: 5,009 bytes, line 469
469{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};function ae(t,e){const n=C7(),r=j7({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===sw?void 0:sw].filter(s=>!!s)});t.common.issues.push(r)}class Er{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Le;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Er.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return Le;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const Le=Object.freeze({status:"aborted"}),Ku=t=>({status:"dirty",value:t}),ns=t=>({status:"valid",value:t}),zj=t=>t.status==="aborted",Fj=t=>t.status==="dirty",$c=t=>t.status==="valid",vm=t=>typeof Promise<"u"&&t instanceof Promise;var ve;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ve||(ve={}));class qo{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Uj=(t,e)=>{if($c(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new _i(t.common.issues);return this._error=n,this._error}}};function We(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:s}}class tt{get description(){return this._def.description}_getType(e){return Qi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Qi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Er,ctx:{common:e.parent.common,data:e.data,parsedType:Qi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(vm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qi(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Uj(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qi(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return $c(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>$c(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qi(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(vm(s)?s:Promise.resolve(s));return Uj(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),a=()=>i.addIssue({code:ne.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}
vendor: 7,337 bytes, line 469
469_refinement(e){return new zc({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Io.create(this,this._def)}nullable(){return Fc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gs.create(this)}promise(){return km.create(this,this._def)}or(e){return bm.create([this,e],this._def)}and(e){return wm.create(this,e,this._def)}transform(e){return new zc({...We(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new aw({...We(this._def),innerType:this,defaultValue:n,typeName:$e.ZodDefault})}brand(){return new G7({typeName:$e.ZodBranded,type:this,...We(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new lw({...We(this._def),innerType:this,catchValue:n,typeName:$e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return $k.create(this,e)}readonly(){return cw.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const N7=/^c[^\s-]{8,}$/i,_7=/^[0-9a-z]+$/,E7=/^[0-9A-HJKMNP-TV-Z]{26}$/i,T7=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,R7=/^[a-z0-9_-]{21}$/i,A7=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,O7=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,P7=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,M7="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let zv;const I7=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,D7=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,L7=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$7=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,B7=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z7=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",F7=new RegExp(`^${kP}$`);function SP(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function U7(t){return new RegExp(`^${SP(t)}$`)}function V7(t){let e=`${kP}T${SP(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function H7(t,e){return!!((e==="v4"||!e)&&I7.test(t)||(e==="v6"||!e)&&L7.test(t))}function W7(t,e){if(!A7.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function q7(t,e){return!!((e==="v4"||!e)&&D7.test(t)||(e==="v6"||!e)&&$7.test(t))}class wo extends tt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ye.string){const i=this._getOrReturnCtx(e);return ae(i,{code:ne.invalid_type,expected:ye.string,received:i.parsedType}),Le}const r=new Er;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?ae(s,{code:ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&ae(s,{code:ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")P7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"email",code:ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")zv||(zv=new RegExp(M7,"u")),zv.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"emoji",code:ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")T7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"uuid",code:ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")R7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"nanoid",code:ne.invalid_string,message:i.message}),r.dirty());
vendor: 16,319 bytes, line 469
469else if(i.kind==="cuid")N7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"cuid",code:ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")_7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"cuid2",code:ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")E7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"ulid",code:ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ae(s,{validation:"url",code:ne.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"regex",code:ne.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?V7(i).test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?F7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?U7(i).test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?O7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"duration",code:ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?H7(e.data,i.version)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"ip",code:ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?W7(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"jwt",code:ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?q7(e.data,i.version)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"cidr",code:ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?B7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"base64",code:ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?z7.test(e.data)||(s=this._getOrReturnCtx(e,s),ae(s,{validation:"base64url",code:ne.invalid_string,message:i.message}),r.dirty()):rt.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:ne.invalid_string,...ve.errToObj(r)})}_addCheck(e){return new wo({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ve.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ve.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ve.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ve.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ve.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ve.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ve.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ve.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ve.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ve.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ve.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ve.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ve.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ve.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ve.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ve.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ve.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ve.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ve.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ve.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ve.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ve.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ve.errToObj(n)})}nonempty(e){return this.min(1,ve.errToObj(e))}trim(){return new wo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}wo.create=t=>new wo({checks:[],typeName:$e.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...We(t)});function K7(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class hh extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ye.number){const i=this._getOrReturnCtx(e);return ae(i,{code:ne.invalid_type,expected:ye.number,received:i.parsedType}),Le}let r;const s=new Er;for(const i of this._def.checks)i.kind==="int"?rt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ae(r,{code:ne.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ae(r,{code:ne.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ae(r,{code:ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?K7(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),ae(r,{code:ne.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ae(r,{code:ne.not_finite,message:i.message}),s.dirty()):rt.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ve.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ve.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ve.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ve.toString(n))}setLimit(e,n,r,s){return new hh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ve.toString(s)}]})}_addCheck(e){return new hh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ve.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ve.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ve.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ve.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ve.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ve.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ve.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ve.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ve.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&rt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}hh.create=t=>new hh({checks:[],typeName:$e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...We(t)});class fh extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ye.bigint)return this._getInvalidInput(e);let r;const s=new Er;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ae(r,{code:ne.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ae(r,{code:ne.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ae(r,{code:ne.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):rt.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ae(n,{code:ne.invalid_type,expected:ye.bigint,received:n.parsedType}),Le}gte(e,n){return this.setLimit("min",e,!0,ve.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ve.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ve.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ve.toString(n))}setLimit(e,n,r,s){return new fh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ve.toString(s)}]})}_addCheck(e){return new fh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ve.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ve.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ve.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ve.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ve.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}fh.create=t=>new fh({checks:[],typeName:$e.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...We(t)});class Vj extends tt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ye.boolean){const r=this._getOrReturnCtx(e);return ae(r,{code:ne.invalid_type,expected:ye.boolean,received:r.parsedType}),Le}return ns(e.data)}}Vj.create=t=>new Vj({typeName:$e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...We(t)});class xm extends tt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ye.date){const i=this._getOrReturnCtx(e);return ae(i,{code:ne.invalid_type,expected:ye.date,received:i.parsedType}),Le}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return ae(i,{code:ne.invalid_date}),Le}const r=new Er;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),ae(s,{code:ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):rt.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xm({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ve.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ve.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}xm.create=t=>new xm({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:$e.ZodDate,...We(t)});class Hj extends tt{_parse(e){if(this._getType(e)!==ye.symbol){const r=this._getOrReturnCtx(e);return ae(r,{code:ne.invalid_type,expected:ye.symbol,received:r.parsedType}),Le}return ns(e.data)}}Hj.create=t=>new Hj({typeName:$e.ZodSymbol,...We(t)});class Wj extends tt{_parse(e){if(this._getType(e)!==ye.undefined){const r=this._getOrReturnCtx(e);return ae(r,{code:ne.invalid_type,expected:ye.undefined,received:r.parsedType}),Le}return ns(e.data)}}Wj.create=t=>new Wj({typeName:$e.ZodUndefined,...We(t)});class qj extends tt{_parse(e){if(this._getType(e)!==ye.null){const r=this._getOrReturnCtx(e);return ae(r,{code:ne.invalid_type,expected:ye.null,received:r.parsedType}),Le}return ns(e.data)}}qj.create=t=>new qj({typeName:$e.ZodNull,...We(t)});class Kj extends tt{constructor(){super(...arguments),this._any=!0}_parse(e){return ns(e.data)}}Kj.create=t=>new Kj({typeName:$e.ZodAny,...We(t)});class Gj extends tt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ns(e.data)}}Gj.create=t=>new Gj({typeName:$e.ZodUnknown,...We(t)});class Ko extends tt{_parse(e){const n=this._getOrReturnCtx(e);return ae(n,{code:ne.invalid_type,expected:ye.never,received:n.parsedType}),Le}}Ko.create=t=>new Ko({typeName:$e.ZodNever,...We(t)});class Yj extends tt{_parse(e){if(this._getType(e)!==ye.undefined){const r=this._getOrReturnCtx(e);return ae(r,{code:ne.invalid_type,expected:ye.void,received:r.parsedType}),Le}return ns(e.data)}}Yj.create=t=>new Yj({typeName:$e.ZodVoid,...We(t)});class Gs extends tt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==ye.array)return ae(n,{code:ne.invalid_type,expected:ye.array,received:n.parsedType}),Le;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(o||a)&&(ae(n,{code:o?ne.too_big:ne.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}
vendor: 6,538 bytes, line 469
469if(s.minLength!==null&&n.data.length<s.minLength.value&&(ae(n,{code:ne.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ae(n,{code:ne.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>s.type._parseAsync(new qo(n,o,n.path,a)))).then(o=>Er.mergeArray(r,o));const i=[...n.data].map((o,a)=>s.type._parseSync(new qo(n,o,n.path,a)));return Er.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Gs({...this._def,minLength:{value:e,message:ve.toString(n)}})}max(e,n){return new Gs({...this._def,maxLength:{value:e,message:ve.toString(n)}})}length(e,n){return new Gs({...this._def,exactLength:{value:e,message:ve.toString(n)}})}nonempty(e){return this.min(1,e)}}Gs.create=(t,e)=>new Gs({type:t,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...We(e)});function Il(t){if(t instanceof Ut){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Io.create(Il(r))}return new Ut({...t._def,shape:()=>e})}else return t instanceof Gs?new Gs({...t._def,type:Il(t.element)}):t instanceof Io?Io.create(Il(t.unwrap())):t instanceof Fc?Fc.create(Il(t.unwrap())):t instanceof Xa?Xa.create(t.items.map(e=>Il(e))):t}class Ut extends tt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=rt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==ye.object){const u=this._getOrReturnCtx(e);return ae(u,{code:ne.invalid_type,expected:ye.object,received:u.parsedType}),Le}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ko&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||a.push(u);const c=[];for(const u of o){const d=i[u],h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new qo(s,h,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ko){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")a.length>0&&(ae(s,{code:ne.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new qo(s,h,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,p=await d.value;u.push({key:h,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>Er.mergeObjectSync(r,u)):Er.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return ve.errToObj,new Ut({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ve.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Ut({...this._def,unknownKeys:"strip"})}passthrough(){return new Ut({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ut({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ut({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:$e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ut({...this._def,catchall:e})}pick(e){const n={};for(const r of rt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Ut({...this._def,shape:()=>n})}omit(e){const n={};for(const r of rt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Ut({...this._def,shape:()=>n})}deepPartial(){return Il(this)}partial(e){const n={};for(const r of rt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new Ut({...this._def,shape:()=>n})}required(e){const n={};for(const r of rt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Io;)i=i._def.innerType;n[r]=i}return new Ut({...this._def,shape:()=>n})}keyof(){return CP(rt.objectKeys(this.shape))}}Ut.create=(t,e)=>new Ut({shape:()=>t,unknownKeys:"strip",catchall:Ko.create(),typeName:$e.ZodObject,...We(e)});Ut.strictCreate=(t,e)=>new Ut({shape:()=>t,unknownKeys:"strict",catchall:Ko.create(),typeName:$e.ZodObject,...We(e)});Ut.lazycreate=(t,e)=>new Ut({shape:t,unknownKeys:"strip",catchall:Ko.create(),typeName:$e.ZodObject,...We(e)});class bm extends tt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new _i(a.ctx.common.issues));return ae(n,{code:ne.invalid_union,unionErrors:o}),Le}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(c=>new _i(c));return ae(n,{code:ne.invalid_union,unionErrors:a}),Le}}get options(){return this._def.options}}bm.create=(t,e)=>new bm({options:t,typeName:$e.ZodUnion,...We(e)});function iw(t,e){const n=Qi(t),r=Qi(e);if(t===e)return{valid:!0,data:t};if(n===ye.object&&r===ye.object){const s=rt.objectKeys(e),i=rt.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(const a of i){const c=iw(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===ye.array&&r===ye.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],a=e[i],c=iw(o,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===ye.date&&r===ye.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class wm extends tt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>
vendor: 4,181 bytes, line 469
469{if(zj(i)||zj(o))return Le;const a=iw(i.value,o.value);return a.valid?((Fj(i)||Fj(o))&&n.dirty(),{status:n.value,value:a.data}):(ae(r,{code:ne.invalid_intersection_types}),Le)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}wm.create=(t,e,n)=>new wm({left:t,right:e,typeName:$e.ZodIntersection,...We(n)});class Xa extends tt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.array)return ae(r,{code:ne.invalid_type,expected:ye.array,received:r.parsedType}),Le;if(r.data.length<this._def.items.length)return ae(r,{code:ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Le;!this._def.rest&&r.data.length>this._def.items.length&&(ae(r,{code:ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new qo(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Er.mergeArray(n,o)):Er.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Xa({...this._def,rest:e})}}Xa.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xa({items:t,typeName:$e.ZodTuple,rest:null,...We(e)})};class Jj extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.map)return ae(r,{code:ne.invalid_type,expected:ye.map,received:r.parsedType}),Le;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([a,c],u)=>({key:s._parse(new qo(r,a,r.path,[u,"key"])),value:i._parse(new qo(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Le;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Le;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}Jj.create=(t,e,n)=>new Jj({valueType:e,keyType:t,typeName:$e.ZodMap,...We(n)});class ph extends tt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.set)return ae(r,{code:ne.invalid_type,expected:ye.set,received:r.parsedType}),Le;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ae(r,{code:ne.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ae(r,{code:ne.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Le;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>i._parse(new qo(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,n){return new ph({...this._def,minSize:{value:e,message:ve.toString(n)}})}max(e,n){return new ph({...this._def,maxSize:{value:e,message:ve.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}ph.create=(t,e)=>new ph({valueType:t,minSize:null,maxSize:null,typeName:$e.ZodSet,...We(e)});class Qj extends tt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Qj.create=(t,e)=>new Qj({getter:t,typeName:$e.ZodLazy,...We(e)});class ow extends tt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ae(n,{received:n.data,code:ne.invalid_literal,expected:this._def.value}),Le}
vendor: 4,179 bytes, line 469
469return{status:"valid",value:e.data}}get value(){return this._def.value}}ow.create=(t,e)=>new ow({value:t,typeName:$e.ZodLiteral,...We(e)});function CP(t,e){return new Bc({values:t,typeName:$e.ZodEnum,...We(e)})}class Bc extends tt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ae(n,{expected:rt.joinValues(r),received:n.parsedType,code:ne.invalid_type}),Le}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return ae(n,{received:n.data,code:ne.invalid_enum_value,options:r}),Le}return ns(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Bc.create(e,{...this._def,...n})}exclude(e,n=this._def){return Bc.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Bc.create=CP;class Xj extends tt{_parse(e){const n=rt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ye.string&&r.parsedType!==ye.number){const s=rt.objectValues(n);return ae(r,{expected:rt.joinValues(s),received:r.parsedType,code:ne.invalid_type}),Le}if(this._cache||(this._cache=new Set(rt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=rt.objectValues(n);return ae(r,{received:r.data,code:ne.invalid_enum_value,options:s}),Le}return ns(e.data)}get enum(){return this._def.values}}Xj.create=(t,e)=>new Xj({values:t,typeName:$e.ZodNativeEnum,...We(e)});class km extends tt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ye.promise&&n.common.async===!1)return ae(n,{code:ne.invalid_type,expected:ye.promise,received:n.parsedType}),Le;const r=n.parsedType===ye.promise?n.data:Promise.resolve(n.data);return ns(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}km.create=(t,e)=>new km({type:t,typeName:$e.ZodPromise,...We(e)});class zc extends tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return Le;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Le:c.status==="dirty"||n.value==="dirty"?Ku(c.value):c});{if(n.value==="aborted")return Le;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Le:a.status==="dirty"||n.value==="dirty"?Ku(a.value):a}}if(s.type==="refinement"){const o=a=>{const c=s.refinement(a,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Le:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Le:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!$c(o))return Le;const a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>$c(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:n.value,value:a})):Le);rt.assertNever(s)}}zc.create=(t,e,n)=>
vendor: 4,517 bytes, line 469
469new zc({schema:t,typeName:$e.ZodEffects,effect:e,...We(n)});zc.createWithPreprocess=(t,e,n)=>new zc({schema:e,effect:{type:"preprocess",transform:t},typeName:$e.ZodEffects,...We(n)});class Io extends tt{_parse(e){return this._getType(e)===ye.undefined?ns(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Io.create=(t,e)=>new Io({innerType:t,typeName:$e.ZodOptional,...We(e)});class Fc extends tt{_parse(e){return this._getType(e)===ye.null?ns(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fc.create=(t,e)=>new Fc({innerType:t,typeName:$e.ZodNullable,...We(e)});class aw extends tt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}aw.create=(t,e)=>new aw({innerType:t,typeName:$e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...We(e)});class lw extends tt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vm(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}lw.create=(t,e)=>new lw({innerType:t,typeName:$e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...We(e)});class Zj extends tt{_parse(e){if(this._getType(e)!==ye.nan){const r=this._getOrReturnCtx(e);return ae(r,{code:ne.invalid_type,expected:ye.nan,received:r.parsedType}),Le}return{status:"valid",value:e.data}}}Zj.create=t=>new Zj({typeName:$e.ZodNaN,...We(t)});class G7 extends tt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class $k extends tt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Le:i.status==="dirty"?(n.dirty(),Ku(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Le:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new $k({in:e,out:n,typeName:$e.ZodPipeline})}}class cw extends tt{_parse(e){const n=this._def.innerType._parse(e),r=s=>($c(s)&&(s.value=Object.freeze(s.value)),s);return vm(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}cw.create=(t,e)=>new cw({innerType:t,typeName:$e.ZodReadonly,...We(e)});Ut.lazycreate;var $e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})($e||($e={}));const Sm=wo.create;Ko.create;Gs.create;const jP=Ut.create;Ut.strictCreate;bm.create;wm.create;Xa.create;const Y7=ow.create;Bc.create;km.create;Io.create;Fc.create;var J7="Label",NP=y.forwardRef((t,e)=>l.jsx(Ae.label,{...t,ref:e,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));NP.displayName=J7;var _P=NP;const Q7=tu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ee=y.forwardRef(({className:t,...e},n)=>l.jsx(_P,{ref:n,className:se(Q7(),t),...e}));
469Ee.displayName=_P.displayName;const X7=jP({name:Sm().trim().max(100).optional().or(Y7("")),email:Sm().trim().email("Please enter a valid email").max(255)}),Fv=t=>{const e=[],n=/\*([^*]+)\*/g;let r=0,s,i=0;for(;(s=n.exec(t))!==null;)s.index>r&&e.push(t.slice(r,s.index)),e.push(l.jsx("em",{children:s[1]},i++)),r=s.index+s[0].length;return r<t.length&&e.push(t.slice(r)),e},Z7=t=>t.split(/\n\s*\n/).map(n=>n.trim()).filter(Boolean).map((n,r)=>n.startsWith("## ")?l.jsx("h3",{className:"font-heading text-2xl md:text-3xl text-foreground mt-12 mb-4",children:Fv(n.slice(3).trim())},r):n.startsWith("# ")?l.jsx("h2",{className:"font-heading text-3xl md:text-4xl text-foreground mt-14 mb-5",children:Fv(n.slice(2).trim())},r):l.jsx("p",{className:"mb-5 text-base md:text-lg text-foreground/85 font-light leading-relaxed",children:Fv(n)},r)),eG=()=>{const{slug:t}=ea(),{toast:e}=ht(),[n,r]=y.useState(null),[s,i]=y.useState(!0),[o,a]=y.useState(!1),[c,u]=y.useState(""),[d,h]=y.useState(""),[p,f]=y.useState(!1),[g,m]=y.useState(!1);y.useEffect(()=>{(async()=>{i(!0);const{data:b}=await D.from("narrative_sections").select("id, slug, title, prompt, body, pdf_url").eq("slug",t).eq("published",!0).maybeSingle();r(b),i(!1)})()},[t]);const v=b=>{const w=document.createElement("a");w.href=b,w.download="",w.target="_blank",w.rel="noopener noreferrer",document.body.appendChild(w),w.click(),document.body.removeChild(w)},x=async()=>{if(!(n!=null&&n.pdf_url))return;const b=X7.safeParse({name:c,email:d});if(!b.success){e({title:"Check your info",description:b.error.errors[0].message,variant:"destructive"});return}f(!0);const{error:w}=await D.from("form_submissions").insert({email:b.data.email,name:b.data.name||null,source:"narratives-worksheet",message:`Requested worksheet: ${n.slug}`});if(w){e({title:"Something went wrong",description:w.message,variant:"destructive"}),f(!1);return}D.functions.invoke("send-transactional-email",{body:{templateName:"narrative-worksheet",recipientEmail:b.data.email,idempotencyKey:`narrative-${n.slug}-${b.data.email}-${Date.now()}`,templateData:{name:b.data.name||void 0,topic:n.title||n.slug,worksheetUrl:n.pdf_url}}}).catch(()=>{}),v(n.pdf_url),m(!0),f(!1)};return s?l.jsxs("main",{children:[l.jsx(Ge,{}),l.jsx("div",{className:"flex justify-center pt-40 pb-24",children:l.jsx(qt,{className:"h-8 w-8 animate-spin text-primary"})}),l.jsx(Ye,{})]}):n?l.jsxs("main",{children:[l.jsx(ut,{pageKey:`narrative-${n.slug}`}),l.jsx(Ge,{}),l.jsx("article",{className:"bg-background pt-32 pb-16 md:pt-40 md:pb-20",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-3xl",children:[l.jsxs(Be,{to:"/narratives",className:"inline-flex items-center gap-1.5 text-sm font-body uppercase tracking-wider text-muted-foreground hover:text-primary mb-8",children:[l.jsx(ei,{className:"h-3.5 w-3.5"}),"All Narratives"]}),l.jsx(re,{animation:"rise",children:l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-8",children:[l.jsx("h1",{className:"font-heading text-4xl md:text-6xl text-foreground",children:n.title}),n.pdf_url&&l.jsxs(q,{size:"lg",onClick:()=>{var b;return(b=document.getElementById("worksheet-cta"))==null?void 0:b.scrollIntoView({behavior:"smooth",block:"center"})},className:"font-body uppercase tracking-wider shadow-lg shrink-0 mt-2",children:[l.jsx(Pc,{className:"mr-2 h-4 w-4"}),"Free Worksheet"]})]})}),n.body?l.jsx("div",{className:"prose-content",children:Z7(n.body)}):l.jsx("p",{className:"text-foreground/70 italic",children:"Content coming soon."}),l.jsx("div",{id:"worksheet-cta",className:"mt-16 border-t border-border pt-10 scroll-mt-32",children:n.pdf_url?l.jsxs(q,{size:"lg",onClick:()=>a(!0),className:"font-body uppercase tracking-wider shadow-lg",children:[l.jsx(Pc,{className:"mr-2 h-4 w-4"}),"Free Worksheet About ",n.title]}):l.jsx("p",{className:"text-sm uppercase tracking-wider text-muted-foreground font-body",children:"Free worksheet coming soon"})})]})}),l.jsx(Ye,{}),l.jsx(Es,{open:o,onOpenChange:b=>{a(b),b||(m(!1),u(""),h(""))},children:l.jsx(es,{children:g?l.jsxs("div",{className:"text-center py-6 space-y-4",children:[l.jsx(Qd,{className:"h-12 w-12 text-primary mx-auto"}),l.jsx(_r,{className:"font-heading text-2xl",children:"Your download is starting"}),l.jsx(pm,{children:"Check your downloads folder. If it didn't start, allow pop-ups for this site and try again."}),l.jsx(q,{onClick:()=>a(!1),className:"mt-4",children:"Close"})]}):l.jsxs(l.Fragment,{children:[l.jsxs(ts,{children:[l.jsx(_r,{className:"font-heading text-2xl",children:"Where should we send this?"}),l.jsxs(pm,{children:["Enter your email to download the ",n.title," worksheet."]})]}),l.jsxs("div",{className:"space-y-4 py-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{htmlFor:"d-name",children:"Name (optional)"}),l.jsx(ue,{id:"d-name",value:c,onChange:b=>u(b.target.value),maxLength:100})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{htmlFor:"d-email",children:"Email"}),l.jsx(ue,{id:"d-email",type:"email",value:d,onChange:b=>h(b.target.value),maxLength:255,required:!0})]}),l.jsx(q,{onClick:x,disabled:p||!d,className:"w-full",children:p?l.jsx(qt,{className:"h-4 w-4 animate-spin"}):"Get my worksheet"})]})]})})})]}):l.jsxs("main",{children:[l.jsx(Ge,{}),l.jsxs("section",{className:"pt-40 pb-24 container mx-auto px-6 text-center",children:[l.jsx("h1",{className:"font-heading text-3xl mb-4",children:"Section not found"}),l.jsx(Be,{to:"/narratives",className:"text-primary hover:underline",children:"Back to Narratives"})]}),l.jsx(Ye,{})]})},tG=()=>l.jsx(Pi,{pageSlug:"bio",children:l.jsxs("main",{children:[l.jsx(ut,{pageKey:"bio"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 md:pt-40 md:pb-20 bg-background",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-4xl",children:l.jsx(re,{animation:"fade-up",children:l.jsx(fe,{contentKey:"bio_headline",defaultValue:"Helping people make their most important decisions with clarity, courage and conviction",as:"h1",className:"mb-8 text-center"})})})}),l.jsx("section",{className:"section-light py-16 md:py-20",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:l.jsxs("div",{className:"flex flex-col md:flex-row items-start gap-12 lg:gap-20 max-w-6xl mx-auto",children:[l.jsxs(re,{animation:"fade-in",delay:100,className:"md:w-4/12 md:sticky md:top-24",children:[l.jsx(Us,{contentKey:"bio_photo",defaultSrc:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2
469160578998/settings_images/33d64d0-df7-80d0-876d-d051e8f715a_Desk.jpg",alt:"Stephanie Peirolo",className:"w-full rounded shadow-sm"}),l.jsx("p",{className:"text-right text-xs italic text-muted-foreground mt-2",children:"Photo by Daniel Berman"})]}),l.jsx(re,{animation:"fade-right",className:"md:w-8/12",children:l.jsx(fe,{contentKey:"bio_body",as:"div",html:!0,className:"space-y-5 text-foreground/85 leading-relaxed text-base md:text-lg",defaultValue:`<p>Stephanie Peirolo is a writer and board-certified executive coach who bridges the worlds of business, spirituality and personal transformation.</p> 470<p>Stephanie coaches leaders of companies who make cool things, from ads to apps to consumer products. Her experience as a woman in executive leadership gives her a unique perspective on what it is like to be a woman in the C Suite, which is why some of her executive coaching clients have worked with her for over a decade.</p> 471<p>In May of 2025 her book <a href="/#book" class="underline hover:text-primary"><em>The Saint and the Drunk: A Guide to Making the Big Decisions In Your Life</em></a> was published by Shepheard-Walwyn in London, and she began coaching individuals who were facing big changes in their lives at work or home or both.</p> 472<p>Stephanie co-hosts <em>The Bad Boss Brief</em>, a podcast that dives into the real stories behind workplace dysfunctionâand what better leadership could look like. She also writes <em>Fierce Grace</em> on Substack, touching on topics from work to grief, to dealing with discomfort. Her writing has appeared in the Guardian, NPR and other publications.</p> 473<p>As a storyteller, Stephanie has shared her powerful narratives on The Moth Mainstage and in their bestselling book <em>All These Wonders</em>.</p> 474<p>With a BA in Creative Writing from Stanford University and an MA in Transformational Leadership from Seattle University's School of Theology and Ministry, Stephanie brings deep listening, sharp insight, and radical compassion to every conversation.</p> 475<p>She is Board Certified by the CCE and a member of the International Coaching Federation. She coaches both corporate and individual clients and leads trainings for organizations, offering practical tools rooted in story, intention, and organizational expertise.</p>`})})]})})}),l.jsx(Ye,{}),l.jsx(Mi,{})]})}),nG=()=>l.jsx(Pi,{pageSlug:"how-i-use-ai",children:l.jsxs("main",{children:[l.jsx(ut,{pageKey:"how-i-use-ai"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 md:pt-40 md:pb-20 bg-background",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-3xl",children:l.jsx(re,{animation:"fade-up",children:l.jsx(fe,{contentKey:"ai_headline",defaultValue:"About My Use of AI",as:"h1",className:"mb-8 text-center"})})})}),l.jsx("section",{className:"section-light py-16 md:py-20",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-3xl",children:l.jsx(re,{animation:"fade-up",children:l.jsx(fe,{contentKey:"ai_body",as:"div",html:!0,className:"space-y-5 text-foreground/85 leading-relaxed text-base md:text-lg",defaultValue:`<p>I don't use artificial intelligence for any of my writing. If you are reading or listening to my words, they are 100% from my mind, not an LLM.</p> 476<p>I use no AI for content on this site, not in emails to you, not in my Substack <em>Fierce Grace</em> or our podcast <em>Bad Boss Brief</em> or social media. I don't use AI for ideation, brainstorming, editing or proofreading. AI tools are turned off on my computer programs where that is possible.</p> 477<p>If I wrote it or said it, it comes from me, for better or worse.</p> 478<p>However, AI tools are built into the platform that designed this site, and will be used to add to this site as needed. AI tools are also built into the video editing software that I use to smooth out edits and adjust backgrounds or other cosmetic fixes. The skilled people who help me with this site and editing my podcast are free to use the tools of their choice, as are people who host podcasts on which I am a guest. But the words, ideas and IP are all mine.</p>`})})})}),l.jsx(Ye,{}),l.jsx(Mi,{})]})});var Bk="Progress",zk=100,[rG,Uoe]=Ns(Bk),[sG,iG]=rG(Bk),EP=y.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=oG,...o}=t;(s||s===0)&&!eN(s)&&console.error(aG(`${s}`,"Progress"));const a=eN(s)?s:zk;r!==null&&!tN(r,a)&&console.error(lG(`${r}`,"Progress"));const c=tN(r,a)?r:null,u=Cm(c)?i(c,a):void 0;return l.jsx(sG,{scope:n,value:c,max:a,children:l.jsx(Ae.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Cm(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":AP(c,a),"data-value":c??void 0,"data-max":a,...o,ref:e})})});EP.displayName=Bk;var TP="ProgressIndicator",RP=y.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=iG(TP,n);return l.jsx(Ae.div,{"data-state":AP(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});RP.displayName=TP;function oG(t,e){return`${Math.round(t/e*100)}%`}function AP(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Cm(t){return typeof t=="number"}function eN(t){return Cm(t)&&!isNaN(t)&&t>0}function tN(t,e){return Cm(t)&&!isNaN(t)&&t<=e&&t>=0}function aG(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${zk}\`.`}function lG(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: 479 - a positive number 480 - less than the value passed to \`max\` (or ${zk} if no \`max\` prop is set) 481 - \`null\` or \`undefined\` if the progress is indeterminate. 482 483Defaulting to \`null\`.`}var OP=EP,cG=RP;const PP=y.forwardRef(({className:t,value:e,...n},r)=>l.jsx(OP,{ref:r,className:se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:l.jsx(cG,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));
483PP.displayName=OP.displayName;const uw=[{id:"q1",prompt:"What's prompting you to look for support right now?",options:[{id:"a",label:"A turning point in my personal life",weights:{tp:3,personal:1,urgency:1}},{id:"b",label:"A shift or stuckness in my career",weights:{rw:3,personal:1,urgency:1}},{id:"c",label:"I'm curious and want to grow steadily",weights:{reading:2}},{id:"d",label:"I want to learn alongside others going through similar things",weights:{cohort:2}}]},{id:"q2",prompt:"Which best describes the change you're navigating?",options:[{id:"a",label:"New baby, retirement, loss, relationship change",weights:{tp:3}},{id:"b",label:"Promotion, new role, leadership challenge",weights:{rw:3}},{id:"c",label:"A bit of both â work and life are shifting together",weights:{tp:1,rw:1}},{id:"d",label:"Nothing specific â I want better tools for whatever's next",weights:{reading:2}}]},{id:"q3",prompt:"How time-sensitive is this for you?",options:[{id:"a",label:"I need to make a decision in the next 30 days",weights:{personal:3,urgency:2}},{id:"b",label:"In the next 3â6 months",weights:{cohort:2,personal:1}},{id:"c",label:"No deadline â ongoing growth",weights:{reading:2}}]},{id:"q4",prompt:"How do you learn best?",options:[{id:"a",label:"Deep one-on-one conversation",weights:{personal:3}},{id:"b",label:"In a group, hearing others' stories",weights:{cohort:3}},{id:"c",label:"Reading, reflecting, going at my own pace",weights:{reading:3}}]},{id:"q5",prompt:"What's your budget comfort zone?",options:[{id:"a",label:"I'm ready to invest in premium 1:1 work",weights:{personal:3}},{id:"b",label:"Meaningful support at a shared-cost level",weights:{cohort:3}},{id:"c",label:"Low-cost, library-style access",weights:{reading:3}}]},{id:"q6",prompt:"Which sentence feels most true?",options:[{id:"a",label:"I don't know who I am in this next chapter.",weights:{tp:3}},{id:"b",label:"I want to be better at my job without the hustle nonsense.",weights:{rw:3}},{id:"c",label:"I want frameworks I can apply to anything.",weights:{reading:1,rw:1}}]},{id:"q7",prompt:"How private is what you're working through?",options:[{id:"a",label:"Very private â I need confidentiality",weights:{personal:3,urgency:1}},{id:"b",label:"Open to sharing in a small trusted group",weights:{cohort:3}},{id:"c",label:"I'd rather reflect on my own",weights:{reading:2}}]},{id:"q8",prompt:"Which describes your work context?",options:[{id:"a",label:"I lead people / I'm a senior IC navigating leadership",weights:{rw:3}},{id:"b",label:"I'm a founder or exec at a turning point",weights:{rw:2,personal:1}},{id:"c",label:"Work is fine â life is what's shifting",weights:{tp:3}}]},{id:"q9",prompt:"What kind of accountability helps you most?",options:[{id:"a",label:"A coach who knows my situation deeply",weights:{personal:3}},{id:"b",label:"Peers checking in regularly",weights:{cohort:3}},{id:"c",label:"Self-directed prompts and content",weights:{reading:2}}]},{id:"q10",prompt:"If you got one thing from this, it would beâ¦",options:[{id:"a",label:"Clarity on a hard decision",weights:{tp:1,personal:2,urgency:1}},{id:"b",label:"Practical leadership tools I can use Monday",weights:{rw:2,cohort:1}},{id:"c",label:"A steady practice of reflection and learning",weights:{reading:3}}]}];function uG(t){const e={tp:0,rw:0,personal:0,cohort:0,reading:0,urgency:0};for(const a of uw){const c=t[a.id],u=a.options.find(d=>d.id===c);if(u)for(const[d,h]of Object.entries(u.weights))e[d]+=h??0}const n=e.rw>e.tp?"real-work":"turning-points",r=[["personal",e.personal],["cohort",e.cohort],["reading",e.reading]],i=e.urgency>=2?["personal","cohort","reading"]:["reading","cohort","personal"];r.sort((a,c)=>c[1]!==a[1]?c[1]-a[1]:i.indexOf(a[0])-i.indexOf(c[0]));const o=r[0][0];return{theme:n,format:o,scores:e}}const dG={"turning-points|personal":{headline:"Turning Points â Individual Coaching",body:"You're at a real inflection point in your life and you need a confidential thinking partner who can hold the full weight of what you're navigating. One-on-one coaching with Stephanie gives you the focused, private space to move from stuck to clear, and to make this next decision with conviction.",cta:{label:"Explore Individual Coaching",href:"/individual-coaching"}},"turning-points|cohort":{headline:"Turning Points â Cohort Coaching",body:"You're navigating a season of change and you don't want to do it alone. A cohort gives you a trusted circle of people moving through similar transitions, paired with Stephanie's guidance â so you can hear your own story reflected back, and find courage in community.",cta:{label:"Explore Cohorts",href:"/cohort-coaching"}},"turning-points|reading":{headline:"Turning Points â Reading Room",body:"You want frameworks, essays, and reflective tools you can return to as life
483keeps shifting. The Reading Room is a quiet, self-paced library of Stephanie's writing and resources â perfect for steady, ongoing growth on your own schedule.",cta:{label:"Step into the Reading Room",href:"/reading-room"}},"real-work|personal":{headline:"Real Work â Individual Coaching",body:"You're carrying real weight at work and you need practical, confidential support â not hustle clichés. One-on-one executive coaching with Stephanie gives you the sharp insight and accountability to lead well and make the next move with clarity.",cta:{label:"Explore Individual Coaching",href:"/individual-coaching"}},"real-work|cohort":{headline:"Real Work â Cohort Coaching",body:"You want to get better at your job and you learn best alongside peers. A cohort gives you a regular cadence of group coaching with leaders facing the same kinds of challenges â practical tools, real conversation, sustainable growth.",cta:{label:"Explore Cohorts",href:"/cohort-coaching"}},"real-work|reading":{headline:"Real Work â Reading Room",body:"You want practical frameworks for leadership and work you can revisit on your own time. The Reading Room collects Stephanie's writing and tools on real work â clear, durable, and grounded in decades of experience.",cta:{label:"Step into the Reading Room",href:"/reading-room"}}};function nN(t){return`${t.theme}|${t.format}`}const hG=jP({name:Sm().trim().min(1,"Please enter your name").max(100),email:Sm().trim().email("Please enter a valid email").max(255)}),fG=()=>{const{toast:t}=ht(),[e,n]=y.useState("intro"),[r,s]=y.useState(0),[i,o]=y.useState({}),[a,c]=y.useState(""),[u,d]=y.useState(""),[h,p]=y.useState(!1),[f,g]=y.useState(null),m=uw[r],v=uw.length,x=y.useMemo(()=>(r+(i[m==null?void 0:m.id]?1:0))/v*100,[r,i,m,v]),b=E=>{o(N=>({...N,[m.id]:E}))},w=()=>{i[m.id]&&(r<v-1?s(r+1):n("gate"))},k=()=>{r>0?s(r-1):n("intro")},j=async()=>{const E=hG.safeParse({name:a,email:u});if(!E.success){t({title:"Check your info",description:E.error.errors[0].message,variant:"destructive"});return}const N=uG(i);p(!0);const S={answers:i,result:{theme:N.theme,format:N.format,key:nN(N)},scores:N.scores},{error:C}=await D.from("form_submissions").insert({email:E.data.email,name:E.data.name,source:"assessment",message:JSON.stringify(S,null,2)});if(p(!1),C){t({title:"Something went wrong",description:C.message,variant:"destructive"});return}const _=N.scores.tp,R=N.scores.rw,O=_+R||1,L=Math.round(_/O*100),A=100-L,F=Math.abs(L-A)<=15?"both":N.theme,H=N.theme==="real-work"?"Real Work":"Turning Points";D.functions.invoke("send-transactional-email",{body:{templateName:"assessment-result",recipientEmail:E.data.email,idempotencyKey:`assessment-${E.data.email}-${Date.now()}`,templateData:{name:E.data.name,turningPointPct:L,realWorkPct:A,theme:F,trackName:H}}}).catch(()=>{}),g(N),n("result")};return l.jsxs("main",{children:[l.jsx(ut,{pageKey:"assessment"}),l.jsx(Ge,{}),l.jsx("section",{className:"bg-background pt-32 pb-20 md:pt-40 md:pb-28 min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-2xl",children:[e==="intro"&&l.jsxs("div",{className:"text-center space-y-6 animate-fade-in",children:[l.jsx("h1",{className:"font-heading text-4xl md:text-5xl text-foreground",children:"Find Your Track"}),l.jsxs("p",{className:"text-base md:text-lg text-foreground/75 font-light leading-relaxed",children:["Ten quick questions to help you figure out whether your next step is around a ",l.jsx("em",{children:"turning point"})," in your life or the ",l.jsx("em",{children:"real work"})," of your career â and which kind of support (Individual Coaching, a cohort, or the Reading Room) will move you forward."]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Takes about 2 minutes."}),l.jsxs(q,{size:"lg",onClick:()=>n("quiz"),className:"font-body uppercase tracking-wider",children:["Start the assessment",l.jsx(qs,{className:"ml-2 h-4 w-4"})]})]}),e==="quiz"&&m&&l.jsxs("div",{className:"space-y-8 animate-fade-in",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-xs font-body uppercase tracking-wider text-muted-foreground",children:[l.jsxs("span",{children:["Question ",r+1," of ",v]}),l.jsxs("span",{children:[Math.round(x),"%"]})]}),l.jsx(PP,{value:x,className:"h-1"})]}),l.jsx("h2",{className:"font-heading text-2xl md:text-3xl text-foreground",children:m.prompt}),l.jsx("div",{className:"space-y-3",children:m.options.map(E=>{const N=i[m.id]===E.id;return l.jsx("button",{type:"button",onClick:()=>b(E.id),className:`w-full text-left p-5 border-2 transition-all duration-150 ${N?"border-primary bg-primary/5 shadow-sm":"border-border bg-background hover:border-primary/50"}`,children:l.jsx("span",{className:"font-body text-base text-foreground",children:E.label})},E.id)})}),l.jsxs("div",{className:"flex justify-between pt-2",children:[l.jsxs(q,{variant:"ghost",onClick:k,className:"font-body uppercase tracking-wider",children:[l.jsx(ei,{className:"mr-2 h-4 w-4"})," Back"]}),l.jsxs(q,{onClick:w,disabled:!i[m.id],className:"font-body uppercase tracking-wider",children:[r===v-1?"See my result":"Next",l.jsx(qs,{className:"ml-2 h-4 w-4"})]})]})]}),e==="gate"&&l.jsxs("div",{className:"space-y-6 animate-fade-in",children:[l.jsx("h2",{className:"font-heading text-3xl md:text-4xl text-foreground text-center",children:"Your result is ready."}
483),l.jsx("p",{className:"text-center text-foreground/75 font-light",children:"Enter your name and email to see which track is the best fit for you."}),l.jsxs("div",{className:"space-y-4 max-w-md mx-auto pt-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{htmlFor:"a-name",children:"Name"}),l.jsx(ue,{id:"a-name",value:a,onChange:E=>c(E.target.value),maxLength:100,required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{htmlFor:"a-email",children:"Email"}),l.jsx(ue,{id:"a-email",type:"email",value:u,onChange:E=>d(E.target.value),maxLength:255,required:!0})]}),l.jsx(q,{onClick:j,disabled:h||!a||!u,className:"w-full font-body uppercase tracking-wider",size:"lg",children:h?l.jsx(qt,{className:"h-4 w-4 animate-spin"}):"Show me my result"}),l.jsx("button",{onClick:()=>n("quiz"),className:"block mx-auto text-xs text-muted-foreground hover:text-foreground underline",children:"Go back and change answers"})]})]}),e==="result"&&f&&(()=>{const E=dG[nN(f)];return l.jsxs("div",{className:"space-y-6 text-center animate-fade-in",children:[l.jsx(Qd,{className:"h-12 w-12 text-primary mx-auto"}),l.jsx("p",{className:"font-body text-xs uppercase tracking-wider text-muted-foreground",children:"Your recommended track"}),l.jsx("h2",{className:"font-heading text-3xl md:text-4xl text-foreground",children:E.headline}),l.jsx("p",{className:"text-base md:text-lg text-foreground/80 font-light leading-relaxed max-w-xl mx-auto",children:E.body}),l.jsx("div",{className:"pt-4",children:l.jsx(q,{asChild:!0,size:"lg",className:"font-body uppercase tracking-wider",children:l.jsx("a",{href:E.cta.href,children:E.cta.label})})}),l.jsxs("div",{className:"pt-6 border-t border-border max-w-md mx-auto",children:[l.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-3",children:"Explore the other tracks"}),l.jsxs("div",{className:"flex flex-wrap justify-center gap-3 text-sm",children:[l.jsx("a",{href:"/individual-coaching",className:"text-foreground hover:text-primary underline",children:"Individual Coaching"}),l.jsx("span",{className:"text-muted-foreground",children:"·"}),l.jsx("a",{href:"/cohort-coaching",className:"text-foreground hover:text-primary underline",children:"Cohorts"}),l.jsx("span",{className:"text-muted-foreground",children:"·"}),l.jsx("a",{href:"/reading-room",className:"text-foreground hover:text-primary underline",children:"Reading Room"})]})]})]})})()]})}),l.jsx(Ye,{})]})},pG=()=>l.jsx("section",{id:"book",className:"bg-background pt-20 md:pt-28 pb-0",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:l.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-12 lg:gap-20",children:[l.jsx(re,{animation:"fade-right",className:"md:w-5/12",children:l.jsx(Us,{contentKey:"book_cover",defaultSrc:"https://kajabi-storefronts-production.kajabi-cdn.com/kajabi-storefronts-production/file-uploads/themes/2160578998/settings_images/31b5d2a-ed00-f622-55e0-c0151285c_Heading.png",alt:"The Saint and the Drunk book cover",className:"w-full max-w-md mx-auto"})}),l.jsx(re,{animation:"fade-left",delay:250,className:"md:w-7/12",children:l.jsxs("div",{className:"bg-secondary rounded p-8 md:p-12",children:[l.jsx("p",{className:"font-bold text-sm mb-2",style:{color:"hsl(356, 66%, 49%)"},children:l.jsx("strong",{children:"Buy Now!"})}),l.jsx(fe,{contentKey:"book_title",defaultValue:"The Saint and the Drunk",as:"h2",className:"mb-2 text-foreground"}),l.jsx(fe,{contentKey:"book_subtitle",defaultValue:"A Guide to Making the Big Decisions in Your Life",as:"h5",className:"mb-6 text-muted-foreground"}),l.jsx(fe,{contentKey:"book_body",as:"div",className:"space-y-4 text-foreground/90 text-sm leading-relaxed text-left",html:!0,defaultValue:`<p>What if you had an internal compass that could provide direction at every turning point in your life?</p> 484<p>I wrote this book to show people how to build a practice of intentional decision making based on the ancient tools of discernment.</p> 485<p>Everyone has access to an internal wisdom. But for many that connection has been obscured by cultural or familial narratives, trauma or grief. I explore ways we can use our imagination, the genius of the body and other paths to reconnect to our emotional compass.<
485/p> 486<p>The Saint and the Drunk â A Guide to Making the Big Decisions In Your Life shows how to use ancient spiritual tools with a modern, spiritual-but-not-religious approach to:</p> 487<ul class="list-disc pl-6 space-y-1"><li>Make major life decisions with intention and clarity</li><li>Use exercises and writing prompts to help identify cultural and familial narratives that can support or limit</li><li>Clarify values and dreams</li><li>Learn how to tap into the genius of the body, or your somatic wisdom</li><li>Demonstrate how to honor resistance</li><li>Deal with the impact of grief and trauma on decision making</li></ul>`}),l.jsxs("div",{className:"flex flex-wrap gap-4 mt-8",children:[l.jsx("a",{href:"https://shepheardwalwyn.com/product/the-saint-and-the-drunk/",target:"_blank",rel:"noopener noreferrer",className:"inline-block bg-primary text-primary-foreground px-8 py-2.5 font-body text-sm font-bold uppercase tracking-wider shadow-sm transition-all hover:brightness-[1.2] active:scale-[0.97]",children:"Order UK"}),l.jsx("a",{href:"https://amzn.to/3XBSb7l",target:"_blank",rel:"noopener noreferrer",className:"inline-block bg-primary text-primary-foreground px-8 py-2.5 font-body text-sm font-bold uppercase tracking-wider shadow-sm transition-all hover:brightness-[1.2] active:scale-[0.97]",children:"Order US"})]})]})})]})})}),Mu=[{quote:"In the accelerated culture we live in today, it can be difficult to know how to decide what we really want out of life. In The Saint and the Drunk, Stephanie Peirolo helps the reader to understand that discernment is a process that can be applied to everything from family to career to our spiritual lives. Warmly written and inviting to many different readers, this book will be a helpful guide for anyone seeking to slow down and listen for inner guidance.",author:"Kaya Oakes",title:"author of The Defiant Middle, How Women Claim Life's In-Betweens to Remake the World"},{quote:"Stephanie Peirolo has been hitting with bits of wisdom for the better part of 40 years. So, it's both a blessing and a privilege to finally be able to read some concentrated ver
487sion of what had been given away earnestly, but freely: a guide to navigating the rocky shoals of the lives we lead with her as a guide in the know. Consider then The Saint and the Drunk, a guidebook for hard times by a Virgil who's been almost everywhere that matters and is gifted with a desire to get out through the same with a minimum of bad juju. A must read.",author:"Eugene S. Robinson",title:"author of A Walk Across Dirty Water & Straight Into Murderer's Row"},{quote:"How rare for a book to be both practical and hopeful. The Saint and the Drunk offers a process completely customizable to each reader, acknowledging inherited roadblocks while tuning into our inherent wisdom to craft a path forward towards our dreams. I imagine this book under glass with a âBreak in Case of Emergencyâ axe. Every person should own a copy.",author:"Kat Gordon",title:"Founder The 3% Movement / Co-Founder The 3% Coaching Coalition"},{quote:"I thought this book was excellent. I read A LOT of non-fiction, especially Buddhist works, psychological and social science / self-help-type books â some of which can be heady and philosophical â with lessons which are often a challenge to apply consistently in daily life. This book was every bit as rich in content, but packaged for very practical application and an enjoyable, well-organized read. ⦠I find the author to be candid, balanced, compassionate and writing from a lived experience from which we could all learn a great deal.",author:"JenO",title:"on Goodreads"}],mG=()=>{const[t,e]=y.useState(0),[n,r]=y.useState(!1);y.useEffect(()=>{if(n)return;const o=setInterval(()=>e(a=>(a+1)%Mu.length),9e3);return()=>clearInterval(o)},[n]);const s=o=>e(a=>(a+o+Mu.length)%Mu.length),i=Mu[t];return l.jsx("section",{className:"bg-background pt-10 md:pt-12 pb-10 md:pb-12",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-4xl",children:l.jsxs("div",{className:"text-center",children:[l.jsx(OA,{className:"h-8 w-8 text-primary mx-auto mb-6 opacity-70"}),l.jsx("div",{className:"relative min-h-[200px] md:min-h-[180px]",children:l.jsx("blockquote",{className:"animate-fade-in text-base md:text-lg text-foreground/85 font-light leading-relaxed italic",children:i.quote},t)}),l.jsxs("div",{className:"mt-6",children:[l.jsxs("p",{className:"font-heading text-lg text-foreground",children:["â ",i.author]}),l.jsx("p",{className:"text-sm text-muted-foreground font-light mt-1",children:i.title})]}),l.jsxs("div",{className:"flex items-center justify-center gap-4 mt-8",children:[l.jsx("button",{onClick:()=>s(-1),"aria-label":"Previous review",className:"p-2 rounded-full border border-border hover:bg-background transition-colors",children:l.jsx(SA,{className:"h-4 w-4"})}),l.jsx("div",{className:"flex gap-2",children:Mu.map((o,a)=>l.jsx("button",{onClick:()=>e(a),"aria-label":`Go to review ${a+1}`,className:`h-2 w-2 rounded-full transition-all ${a===t?"bg-primary w-6":"bg-foreground
487/20"}`},a))}),l.jsx("button",{onClick:()=>s(1),"aria-label":"Next review",className:"p-2 rounded-full border border-border hover:bg-background transition-colors",children:l.jsx(Wg,{className:"h-4 w-4"})})]})]})})})},gG=()=>l.jsx(Pi,{pageSlug:"book",children:l.jsxs("main",{children:[l.jsx(ut,{pageKey:"book",jsonLd:{"@context":"https://schema.org","@type":"Book",name:"The Saint and the Drunk: A Guide To Making the Big Decisions In Your Life",author:{"@type":"Person",name:"Stephanie Peirolo"},description:"A guide to discernment â an intentional process for making the big decisions in your life.",url:"https://speirolo.com/book",inLanguage:"en"}}),l.jsx(Ge,{}),l.jsxs("div",{className:"pt-24 md:pt-28",children:[l.jsx(pG,{}),l.jsx(mG,{})]}),l.jsx(LO,{}),l.jsx(Ye,{}),l.jsx(Mi,{})]})}),yG=()=>l.jsxs("main",{children:[l.jsx(ut,{pageKey:"real-work"}),l.jsx(Ge,{}),l.jsx("section",{className:"bg-background pt-32 pb-12 md:pt-40 md:pb-16",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-4xl",children:[l.jsx(re,{animation:"rise",children:l.jsx("h1",{className:"font-heading text-4xl md:text-5xl text-foreground mb-8",children:"Real Work"})}),l.jsx(re,{animation:"fade-up",delay:150,children:l.jsxs("div",{className:"space-y-6 text-base md:text-lg text-foreground/85 font-light leading-relaxed",children:[l.jsx("p",{children:"Most of us need to work to provide for the basics â which get more expensive every month."}),l.jsx("p",{children:"I get it. I raised two kids by myself, sometimes working three jobs at a time to pay the bills."}),l.jsx("p",{children:"I never had a dream job. I struggled against the greed, sexism and ageism in corporate America."}),l.jsx("p",{children:"So I'm not going to tell you to hustle more, or climb the corporate ladder, unless that's what you want to do. What I am going to tell you are the things I wish I'd known. The things I wish my employers had taught me."}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2 marker:text-primary",children:[l.jsx("li",{children:"How to deal with conflict"}),l.jsx("li",{children:"How to give and receive feedback as a person with less power"}),l.jsx("li",{children:"How to see and navigate the most damaging narratives of late-stage capitalism when you can't afford to leave yet"})]}),l.jsxs("p",{children:["I am a board-certified executive coach, and I've been coaching and consulting for over a decade."," ",l.jsx(Be,{to:"/bio",className:"text-primary underline underline-offset-4 hover:no-underline",children:"Read my bio â"})]}),l.jsx("h2",{className:"font-heading text-2xl md:text-3xl text-foreground pt-4",children:"Companies are no longer investing in their next generation of leaders"}),l.jsx("p",{children:"Along the way, I've seen budgets cut for the training and development of the leaders of tomorrow â the mid-level doers, the individual contributors who were innovating, inventing and exploring new ways of working."}),l.jsx("p",{children:"Companies would pay me to coach a CEO, but not the people below them on the org chart."}),l.jsx("p",{children:"I kept asking them to let me coach a group of their up-and-coming stars; to form a cohort to develop the important skills they need as managers, leaders and mentors for their teams."}),l.jsx("p",{children:"But companies were cutting budgets, laying off staff, and didn't want to spend more on training or coaching unless it was short term, quick turn and delivered ROI on the KPIs."}),l.jsx("p",{className:"font-heading text-2xl md:text-3xl text-foreground pt-4",children:"So I decided to do it myself."}),l.jsx("p",{children:"If you want to grow in your career, or have been promoted but are not getting the support you need, the Real Work content will give you:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-2 marker:text-primary",children:[l.jsx("li",{children:"Practical, clear tactics for dealing with most workplace situations from an experienced and qualified guide â that's me!"}),l.jsx("li",{children:"Three different levels of engagement for every budget and schedule"})]})]})})]})}),l.jsx("section",{className:"bg-muted/30 py-16 md:py-20",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-6xl",children:[l.jsx(re,{animation:"fade-up",children:l.jsx("h2",{className:"font-heading text-3xl md:text-4xl text-foreground text-center mb-12",children:"Three ways to work with me"})}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[l.jsx(re,{animation:"fade-up",delay:100,children:l.jsxs(Be,{to:"/reading-room",className:"group h-full block p-6 border-2 border-border bg-background hover:border-primary/50 hover:shadow-md transition-all duration-200 no-underline flex flex-col",children:[l.jsx("h3",{className:"font-heading text-xl text-foreground mb-3",children:"The Reading Room"}
487),l.jsx("p",{className:"text-sm text-foreground/75 font-light leading-relaxed flex-1",children:"Access articles, videos and content from Stephanie that you can use at your own pace."}),l.jsxs("span",{className:"mt-5 inline-flex items-center gap-1.5 text-xs font-body font-semibold uppercase tracking-wider text-primary",children:["Explore ",l.jsx(qs,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-1"})]})]})}),l.jsx(re,{animation:"fade-up",delay:200,children:l.jsxs(Be,{to:"/cohort-coaching",className:"group h-full block p-6 border-2 border-border bg-background hover:border-primary/50 hover:shadow-md transition-all duration-200 no-underline flex flex-col",children:[l.jsx("h3",{className:"font-heading text-xl text-foreground mb-3",children:"Cohort Coaching"}),l.jsx("p",{className:"text-sm text-foreground/75 font-light leading-relaxed flex-1",children:"Three-session courses on specific topics for small groups. Take an existing class, suggest one of your own, or bring your own cohort for a discount."}),l.jsxs("span",{className:"mt-5 inline-flex items-center gap-1.5 text-xs font-body font-semibold uppercase tracking-wider text-primary",children:["Learn more ",l.jsx(qs,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-1"})]})]})}),l.jsx(re,{animation:"fade-up",delay:300,children:l.jsxs(Be,{to:"/indiv
487idual-coaching",className:"group h-full block p-6 border-2 border-border bg-background hover:border-primary/50 hover:shadow-md transition-all duration-200 no-underline flex flex-col",children:[l.jsx("h3",{className:"font-heading text-xl text-foreground mb-3",children:"Individual Coaching"}),l.jsx("p",{className:"text-sm text-foreground/75 font-light leading-relaxed flex-1",children:"One-on-one coaching to dive deep on key issues."}),l.jsxs("span",{className:"mt-5 inline-flex items-center gap-1.5 text-xs font-body font-semibold uppercase tracking-wider text-primary",children:["Learn more ",l.jsx(qs,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-1"})]})]})})]}),l.jsx(re,{animation:"fade-up",delay:350,children:l.jsxs("p",{className:"text-center text-foreground/75 mt-10 max-w-2xl mx-auto",children:["All of these get you a ticket to my monthly"," ",l.jsx("span",{className:"font-semibold text-foreground",children:"Office Hours"})," â open conversations in an informal virtual setting."]})}),l.jsx(re,{animation:"fade-up",delay:400,children:l.jsx("div",{className:"text-center mt-10",children:l.jsx(Be,{to:"/reading-room",className:"inline-block bg-foreground text-background px-8 py-3 font-body text-xs font-bold uppercase tracking-wider transition-opacity hover:opacity-90 active:scale-[0.97]",children:"Browse the Reading Room and pick a free article"})})})]})}),l.jsx(au,{}),l.jsx(Ye,{})]}),vG=()=>l.jsxs("main",{children:[l.jsx(ut,{pageKey:"turning-points"}),l.jsx(Ge,{}),l.jsx("section",{className:"bg-background pt-32 pb-12 md:pt-40 md:pb-16",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-4xl",children:[l.jsx(re,{animation:"rise",children:l.jsx("h1",{className:"font-heading text-4xl md:text-5xl text-foreground mb-8",children:"Turning Point"})}),l.jsx(re,{animation:"fade-up",delay:150,children:l.jsxs("div",{className:"space-y-6 text-base md:text-lg text-foreground/85 font-light leading-relaxed",children:[l.jsx("p",{children:"Whether we chose the changes we are going through or they were forced on us, the experience of being at a turning point is often characterized by:"}),l.jsxs("ul",{className:"list-disc pl-6 space-y-3 marker:text-primary",children:[l.jsx("li",{children:"A change in circumstances â for better, worse, or a combination of both â that impacts our identity, finances, emotional security, and place in the world. Who are we in this new season?"}),l.jsx("li",{children:"Feeling disoriented, as if we aren't sure the tools which got us here will be the ones we need to move forward. We might feel adrift, unsure of what to do next."}),l.jsx("li",{children:"Internal and external conflict as we navigate new roles or circumstances. What narratives are holding us back? What responses are we getting from the people around us?"})]}),l.jsx("p",{children:"The Turning Point content will help you build an internal compass to guide you through the big decisions and changes in your life."}),l.jsxs("p",{children:["Based on my book ",l.jsx("em",{children:"The Saint and The Drunk"}),", this content gives you the tools to develop a decision-making process based on your reality, responsibilities, dreams, hopes, values and intentions."]}),l.jsx("p",{children:"You'll get context, support, and practical tactics to process what was and plan for what comes next."})]})})]})}),l.jsx("section",{className:"bg-muted/30 py-16 md:py-20",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-6xl",children:[l.jsx(re,{animation:"fade-up",children:l.jsx("h2",{className:"font-heading text-3xl md:text-4xl text-foreground text-center mb-12",children:"Three ways to work with me"})}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[l.jsx(re,{animation:"fade-up",delay:100,children:l.jsxs(Be,{to:"/reading-room",className:"group h-full block p-6 border-2 border-border bg-background hover:border-primary/50 hover:shadow-md transition-all duration-200 no-underline flex flex-col",children:[l.jsx("h3",{className:"font-heading text-xl text-foreground mb-3",children:"The Reading Room"}
487),l.jsx("p",{className:"text-sm text-foreground/75 font-light leading-relaxed flex-1",children:"Access articles, videos and content from Stephanie that you can use at your own pace."}),l.jsxs("span",{className:"mt-5 inline-flex items-center gap-1.5 text-xs font-body font-semibold uppercase tracking-wider text-primary",children:["Explore ",l.jsx(qs,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-1"})]})]})}),l.jsx(re,{animation:"fade-up",delay:200,children:l.jsxs(Be,{to:"/cohort-coaching",className:"group h-full block p-6 border-2 border-border bg-background hover:border-primary/50 hover:shadow-md transition-all duration-200 no-underline flex flex-col",children:[l.jsx("h3",{className:"font-heading text-xl text-foreground mb-3",children:"Cohort Coaching"}),l.jsx("p",{className:"text-sm text-foreground/75 font-light leading-relaxed flex-1",children:"Three-session courses on specific topics for small groups. Take an existing class, suggest one of your own, or bring your own cohort for a discount."}),l.jsxs("span",{className:"mt-5 inline-flex items-center gap-1.5 text-xs font-body font-semibold uppercase tracking-wider text-primary",children:["Learn more ",l.jsx(qs,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-1"})]})]})}),l.jsx(re,{animation:"fade-up",delay:300,children:l.jsxs(Be,{to:"/indiv
487idual-coaching",className:"group h-full block p-6 border-2 border-border bg-background hover:border-primary/50 hover:shadow-md transition-all duration-200 no-underline flex flex-col",children:[l.jsx("h3",{className:"font-heading text-xl text-foreground mb-3",children:"Individual Coaching"}),l.jsx("p",{className:"text-sm text-foreground/75 font-light leading-relaxed flex-1",children:"One-on-one coaching to dive deep on key issues."}),l.jsxs("span",{className:"mt-5 inline-flex items-center gap-1.5 text-xs font-body font-semibold uppercase tracking-wider text-primary",children:["Learn more ",l.jsx(qs,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-1"})]})]})})]}),l.jsx(re,{animation:"fade-up",delay:350,children:l.jsxs("p",{className:"text-center text-foreground/75 mt-10 max-w-2xl mx-auto",children:["All of these get you a ticket to my monthly"," ",l.jsx("span",{className:"font-semibold text-foreground",children:"Office Hours"})," â open conversations in an informal virtual setting."]})}),l.jsx(re,{animation:"fade-up",delay:400,children:l.jsx("div",{className:"text-center mt-10",children:l.jsx(Be,{to:"/narratives",className:"inline-block bg-foreground text-background px-8 py-3 font-body text-xs font-bold uppercase tracking-wider transition-opacity hover:opacity-90 active:scale-[0.97]",children:"What narratives are holding you back?"})})})]})}),l.jsx(au,{}),l.jsx(Ye,{})]}),Ii=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:n,className:se("w-full caption-bottom text-sm",t),...e})}));Ii.displayName="Table";const Di=y.forwardRef(({className:t,...e},n)=>l.jsx("thead",{ref:n,className:se("[&_tr]:border-b",t),...e}));Di.displayName="TableHeader";const Li=y.forwardRef(({className:t,...e},n)=>l.jsx("tbody",{ref:n,className:se("[&_tr:last-child]:border-0",t),...e}));Li.displayName="TableBody";const xG=y.forwardRef(({className:t,...e},n)=>l.jsx("tfoot",{ref:n,className:se("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));xG.displayName="TableFooter";const Nt=y.forwardRef(({className:t,...e},n)=>l.jsx("tr",{ref:n,className:se("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",t),...e}));Nt.displayName="TableRow";const Pe=y.forwardRef(({className:t,...e},n)=>l.jsx("th",{ref:n,className:se("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));Pe.displayName="TableHead";const je=y.forwardRef(({className:t,...e},n)=>l.jsx("td",{ref:n,className:se("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));je.displayName="TableCell";const bG=y.forwardRef(({className:t,...e},n)=>l.jsx("caption",{ref:n,className:se("mt-4 text-sm text-muted-foreground",t),...e}));bG.displayName="TableCaption";function rN(t,[e,n]){return Math.min(n,Math.max(e,t))}function Fk(t){const e=y.useRef({value:t,previous:t});return y.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var wG=[" ","Enter","ArrowUp","ArrowDown"],kG=[" ","Enter"],Za="Select",[gy,yy,SG]=Z0(Za),[lu,Voe]=Ns(Za,[SG,Qg]),vy=Qg(),[CG,na]=lu(Za),[jG,NG]=lu(Za),MP=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:p,required:f,form:g}=t,m=vy(e),[v,x]=y.useState(null),[b,w]=y.useState(null),[k,j]=y.useState(!1),E=Dk(u),[N,S]=Ci({prop:r,defaultProp:s??!1,onChange:i,caller:Za}),[C,_]=Ci({prop:o,defaultProp:a,onChange:c,caller:Za}),R=y.useRef(null),O=v?g||!!v.closest("form"):!0,[L,A]=y.useState(new Set),z=Array.from(L).map(F=>F.props.value).join(";");return l.jsx(d2,{...m,children:l.jsxs(CG,{required:f,scope:e,trigger:v,onTriggerChange:x,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:j,contentId:vi(),value:C,onValueChange:_,open:N,onOpenChange:S,dir:E,triggerPointerDownPosRef:R,disabled:p,children:[l.jsx(gy.Provider,{scope:e,children:l.jsx(jG,{scope:t.__scopeSelect,onNativeOptionAdd:y.useCallback(F=>{A(H=>new Set(H).add(F))},[]),onNativeOptionRemove:y.useCallback(F=>{A(H=>{const I=new Set(H);return I.delete(F),I})},[]),children:n})}),O?l.jsxs(sM,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:h,value:C,onChange:F=>_(F.target.value),disabled:p,form:g,children:[C===void 0?l.jsx("option",{value:""}):null,Array.from(L)]},z):null]})})};MP.displayName=Za;var IP="SelectTrigger",DP=y.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=vy(n),o=na(IP,n),a=o.disabled||r,c=ot(e,o.onTriggerChange),u=yy(n),d=y.useRef("touch"),[h,p,f]=oM(m=>{const v=u().filter(w=>!w.disabled),x=v.find(w=>w.value===o.value),b=aM(v,m,x);b!==void 0&&o.onValueChange(b.value)}),g=m=>{a||(o.onOpenChange(!0),f()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(h2,{asChild:!0,...i,children:l.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":iM(o.value)?"":void 0,...s,ref:c,onClick:Ce(s.onClick,m=>
vendor: 15,972 bytes, line 487
487{m.currentTarget.focus(),d.current!=="mouse"&&g(m)}),onPointerDown:Ce(s.onPointerDown,m=>{d.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:Ce(s.onKeyDown,m=>{const v=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(v&&m.key===" ")&&wG.includes(m.key)&&(g(),m.preventDefault())})})})});DP.displayName=IP;var LP="SelectValue",$P=y.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=t,c=na(LP,n),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,h=ot(e,c.onValueNodeChange);return Mn(()=>{u(d)},[u,d]),l.jsx(Ae.span,{...a,ref:h,style:{pointerEvents:"none"},children:iM(c.value)?l.jsx(l.Fragment,{children:o}):i})});$P.displayName=LP;var _G="SelectIcon",BP=y.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return l.jsx(Ae.span,{"aria-hidden":!0,...s,ref:e,children:r||"â¼"})});BP.displayName=_G;var EG="SelectPortal",zP=t=>l.jsx(Fg,{asChild:!0,...t});zP.displayName=EG;var el="SelectContent",FP=y.forwardRef((t,e)=>{const n=na(el,t.__scopeSelect),[r,s]=y.useState();if(Mn(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Vr.createPortal(l.jsx(UP,{scope:t.__scopeSelect,children:l.jsx(gy.Slot,{scope:t.__scopeSelect,children:l.jsx("div",{children:t.children})})}),i):null}return l.jsx(VP,{...t,ref:e})});FP.displayName=el;var cs=10,[UP,ra]=lu(el),TG="SelectContentImpl",RG=Oc("SelectContent.RemoveScroll"),VP=y.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:g,hideWhenDetached:m,avoidCollisions:v,...x}=t,b=na(el,n),[w,k]=y.useState(null),[j,E]=y.useState(null),N=ot(e,K=>k(K)),[S,C]=y.useState(null),[_,R]=y.useState(null),O=yy(n),[L,A]=y.useState(!1),z=y.useRef(!1);y.useEffect(()=>{if(w)return eO(w)},[w]),W2();const F=y.useCallback(K=>{const[Z,...ie]=O().map(W=>W.ref.current),[Q]=ie.slice(-1),Y=document.activeElement;for(const W of K)if(W===Y||(W==null||W.scrollIntoView({block:"nearest"}),W===Z&&j&&(j.scrollTop=0),W===Q&&j&&(j.scrollTop=j.scrollHeight),W==null||W.focus(),document.activeElement!==Y))return},[O,j]),H=y.useCallback(()=>F([S,w]),[F,S,w]);y.useEffect(()=>{L&&H()},[L,H]);const{onOpenChange:I,triggerPointerDownPosRef:T}=b;y.useEffect(()=>{if(w){let K={x:0,y:0};const Z=Q=>{var Y,W;K={x:Math.abs(Math.round(Q.pageX)-(((Y=T.current)==null?void 0:Y.x)??0)),y:Math.abs(Math.round(Q.pageY)-(((W=T.current)==null?void 0:W.y)??0))}},ie=Q=>{K.x<=10&&K.y<=10?Q.preventDefault():w.contains(Q.target)||I(!1),document.removeEventListener("pointermove",Z),T.current=null};return T.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ie,{capture:!0})}}},[w,I,T]),y.useEffect(()=>{const K=()=>I(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[I]);const[U,M]=oM(K=>{const Z=O().filter(Y=>!Y.disabled),ie=Z.find(Y=>Y.ref.current===document.activeElement),Q=aM(Z,K,ie);Q&&setTimeout(()=>Q.ref.current.focus())}),$=y.useCallback((K,Z,ie)=>{const Q=!z.current&&!ie;(b.value!==void 0&&b.value===Z||Q)&&(C(K),Q&&(z.current=!0))},[b.value]),B=y.useCallback(()=>w==null?void 0:w.focus(),[w]),G=y.useCallback((K,Z,ie)=>{const Q=!z.current&&!ie;(b.value!==void 0&&b.value===Z||Q)&&R(K)},[b.value]),X=r==="popper"?dw:HP,oe=X===dw?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:g,hideWhenDetached:m,avoidCollisions:v}:{};return l.jsx(UP,{scope:n,content:w,viewport:j,onViewportChange:E,itemRefCallback:$,selectedItem:S,onItemLeave:B,itemTextRefCallback:G,focusSelectedItem:H,selectedItemText:_,position:r,isPositioned:L,searchRef:U,children:l.jsx(Ck,{as:RG,allowPinchZoom:!0,children:l.jsx(Sk,{asChild:!0,trapped:b.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Ce(s,K=>{var Z;(Z=b.trigger)==null||Z.focus({preventScroll:!0}),K.preventDefault()}),children:l.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(X,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:K=>K.preventDefault(),...x,...oe,onPlaced:()=>A(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ce(x.onKeyDown,K=>{const Z=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!Z&&K.key.length===1&&M(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let Q=O().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(K.key)&&(Q=Q.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const Y=K.target,W=Q.indexOf(Y);Q=Q.slice(W+1)}setTimeout(()=>F(Q)),K.preventDefault()}})})})})})})});VP.displayName=TG;var AG="SelectItemAlignedPosition",HP=y.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=na(el,n),o=ra(el,n),[a,c]=y.useState(null),[u,d]=y.useState(null),h=ot(e,N=>d(N)),p=yy(n),f=y.useRef(!1),g=y.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:x,focusSelectedItem:b}=o,w=y.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&v&&x){const N=i.trigger.getBoundingClientRect(),S=u.getBoundingClientRect(),C=i.valueNode.getBoundingClientRect(),_=x.getBoundingClientRect();if(i.dir!=="rtl"){const Y=_.left-S.left,W=C.left-Y,ce=N.left-W,de=N.width+ce,xe=Math.max(de,S.width),me=window.innerWidth-cs,qe=rN(W,[cs,Math.max(cs,me-xe)]);a.style.minWidth=de+"px",a.style.left=qe+"px"}else{const Y=S.right-_.right,W=window.innerWidth-C.right-Y,ce=window.innerWidth-N.right-W,de=N.width+ce,xe=Math.max(de,S.width),me=window.innerWidth-cs,qe=rN(W,[cs,Math.max(cs,me-xe)]);a.style.minWidth=de+"px",a.style.right=qe+"px"}const R=p(),O=window.innerHeight-cs*2,L=m.scrollHeight,A=window.getComputedStyle(u),z=parseInt(A.borderTopWidth,10),F=parseInt(A.paddingTop,10),H=parseInt(A.borderBottomWidth,10),I=parseInt(A.paddingBottom,10),T=z+F+L+I+H,U=Math.min(v.offsetHeight*5,T),M=window.getComputedStyle(m),$=parseInt(M.paddingTop,10),B=parseInt(M.paddingBottom,10),G=N.top+N.height/2-cs,X=O-G,oe=v.offsetHeight/2,K=v.offsetTop+oe,Z=z+F+K,ie=T-Z;if(Z<=G){const Y=R.length>0&&v===R[R.length-1].ref.current;a.style.bottom="0px";const W=u.clientHeight-m.offsetTop-m.offsetHeight,ce=Math.max(X,oe+(Y?B:0)+W+H),de=Z+ce;a.style.height=de+"px"}else{const Y=R.length>0&&v===R[0].ref.current;a.style.top="0px";const ce=Math.max(G,z+m.offsetTop+(Y?$:0)+oe)+ie;a.style.height=ce+"px",m.scrollTop=Z-G+m.offsetTop}a.style.margin=`${cs}px 0`,a.style.minHeight=U+"px",a.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[p,i.trigger,i.valueNode,a,u,m,v,x,i.dir,r]);Mn(()=>w(),[w]);const[k,j]=y.useState();Mn(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const E=y.useCallback(N=>{N&&g.current===!0&&(w(),b==null||b(),g.current=!1)},[w,b]);return l.jsx(PG,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:E,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:l.jsx(Ae.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});HP.displayName=AG;var OG="SelectPopperPosition",dw=y.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=cs,...i}=t,o=vy(n);return l.jsx(f2,{...o,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});dw.displayName=OG;var[PG,Uk]=lu(el,{}),hw="SelectViewport",WP=y.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=ra(hw,n),o=Uk(hw,n),a=ot(e,i.onViewportChange),c=y.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(gy.Slot,{scope:n,children:l.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ce(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&h){const f=Math.abs(c.current-d.scrollTop);if(f>0){const g=window.innerHeight-cs*2,m=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),x=Math.max(m,v);if(x<g){const b=x+f,w=Math.min(g,b),k=b-w;h.style.height=w+"px",h.style.bottom==="0px"&&(d.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});WP.displayName=hw;var qP="SelectGroup",[MG,IG]=lu(qP),DG=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=vi();return l.jsx(MG,{scope:n,id:s,children:l.jsx(Ae.div,{role:"group","aria-labelledby":s,...r,ref:e})})});DG.displayName=qP;var KP="SelectLabel",GP=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=IG(KP,n);return l.jsx(Ae.div,{id:s.id,...r,ref:e})});GP.displayName=KP;var jm="SelectItem",[LG,YP]=lu(jm),JP=y.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=t,a=na(jm,n),c=ra(jm,n),u=a.value===r,[d,h]=y.useState(i??""),[p,f]=y.useState(!1),g=ot(e,b=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,b,r,s)}),m=vi(),v=y.useRef("touch"),x=()=>{s||(a.onValueChange(r),a.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(LG,{scope:n,value:r,disabled:s,textId:m,isSelected:u,onItemTextChange:y.useCallback(b=>{h(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:l.jsx(gy.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:l.jsx(Ae.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:g,onFocus:Ce(o.onFocus,()=>f(!0)),onBlur:Ce(o.onBlur,()=>f(!1)),onClick:Ce(o.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:Ce(o.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:Ce(o.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:Ce(o.onPointerMove,b=>{var w;v.current=b.pointerType,s?(w=c.onItemLeave)==null||w.call(c):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(o.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:Ce(o.onKeyDown,b=>{var k;((k=c.searchRef)==null?void 0:k.current)!==""&&b.key===" "||(kG.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});JP.displayName=jm;var Gu="SelectItemText",QP=y.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,o=na(Gu,n),a=ra(Gu,n),c=YP(Gu,n),u=NG(Gu,n),[d,h]=y.useState(null),p=ot(e,x=>h(x),c.onItemTextChange,x=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,x,c.value,c.disabled)}),f=d==null?void 0:d.textContent,g=y.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=u;return Mn(()=>(m(g),()=>v(g)),[m,v,g]),l.jsxs(l.Fragment,{children:[l.jsx(Ae.span,{id:c.textId,...i,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Vr.createPortal(i.children,o.valueNode):null]})});QP.displayName=Gu;var XP="SelectItemIndicator",ZP=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return YP(XP,n).isSelected?l.jsx(Ae.span,{"aria-hidden":!0,...r,ref:e}):null});ZP.displayName=XP;var fw="SelectScrollUpButton",eM=y.forwardRef((t,e)=>{const n=ra(fw,t.__scopeSelect),r=Uk(fw,t.__scopeSelect),[s,i]=y.useState(!1),o=ot(e,r.onScrollButtonChange);return Mn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?l.jsx(nM,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});eM.displayName=fw;var pw="SelectScrollDownButton",tM=y.forwardRef((t,e)=>{const n=ra(pw,t.__scopeSelect),r=Uk(pw,t.__scopeSelect),[s,i]=y.useState(!1),o=ot(e,r.onScrollButtonChange);return Mn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;i(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?l.jsx(nM,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});tM.displayName=pw;var nM=y.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=ra("SelectScrollButton",n),o=y.useRef(null),a=yy(n),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),Mn(()=>{var d;const u=a().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),l.jsx(Ae.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:Ce(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ce(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ce(s.onPointerLeave,()=>{c()})})}),$G="SelectSeparator",rM=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return l.jsx(Ae.div,{"aria-hidden":!0,...r,ref:e})});rM.displayName=$G;var mw="SelectArrow",BG=y.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=vy(n),i=na(mw,n),o=ra(mw,n);return i.open&&o.position==="popper"?l.jsx(p2,{...s,...r,ref:e}):null});BG.displayName=mw;var zG="SelectBubbleInput",sM=y.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const s=y.useRef(null),i=ot(r,s),o=Fk(e);return y.useEffect(()=>{const a=s.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==e&&d){const h=new Event("change",{bubbles:!0});d.call(a,e),a.dispatchEvent(h)}},[o,e]),l.jsx(Ae.select,{...n,style:{...ZR,...n.style},ref:i,defaultValue:e})});sM.displayName=zG;function iM(t){return t===""||t===void 0}function oM(t){const e=Jr(t),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(o=>{const a=n.current+o;e(a),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),i=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function aM(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=FG(t,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function FG(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var UG=MP,lM=DP,VG=$P,HG=BP,WG=zP,cM=FP,qG=WP,uM=GP,dM=JP,KG=QP,GG=ZP,hM=eM,fM=tM,pM=rM;const Xr=UG,Zr=VG,Tr=y.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(lM,{ref:r,className:se("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
487ing-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",t),...n,children:[e,l.jsx(HG,{asChild:!0,children:l.jsx(Hg,{className:"h-4 w-4 opacity-50"})})]}));Tr.displayName=lM.displayName;const mM=y.forwardRef(({className:t,...e},n)=>l.jsx(hM,{ref:n,className:se("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(H5,{className:"h-4 w-4"})}));mM.displayName=hM.displayName;const gM=y.forwardRef(({className:t,...e},n)=>l.jsx(fM,{ref:n,className:se("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(Hg,{className:"h-4 w-4"})}));gM.displayName=fM.displayName;const Rr=y.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>l.jsx(WG,{children:l.jsxs(cM,{ref:s,className:se("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",t),position:n,...r,children:[l.jsx(mM,{}),l.jsx(qG,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(gM,{})]})}));Rr.displayName=cM.displayName;const YG=y.forwardRef(({className:t,...e},n)=>l.jsx(uM,{ref:n,className:se("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));YG.displayName=uM.displayName;const nt=y.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(dM,{ref:r,className:se("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",t),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(GG,{children:l.jsx(kA,{className:"h-4 w-4"})})}),l.jsx(KG,{children:e})]}));nt.displayName=dM.displayName;const JG=y.forwardRef(({className:t,...e},n)=>l.jsx(pM,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",t),...e}));JG.displayName=pM.displayName;const QG=()=>{const[t,e]=y.useState([]),[n,r]=y.useState(""),[s,i]=y.useState("all"),[o,a]=y.useState("all"),c=In(),{toast:u}=ht(),d=async()=>{const{data:f}=await D.from("reading_room_articles").select("*").order("section",{ascending:!0,nullsFirst:!1}).order("title",{ascending:!0});e(f??[])};y.useEffect(()=>{d()},[]);const h=async f=>{confirm("Delete this item?")&&(await D.from("reading_room_articles").delete().eq("id",f),d(),u({title:"Deleted"}))},p=y.useMemo(()=>t.filter(f=>!(n&&!f.title.toLowerCase().includes(n.toLowerCase())&&!f.slug.toLowerCase().includes(n.toLowerCase())||s!=="all"&&!(f.tracks??[]).includes(s)||o!=="all"&&(o==="none"&&f.section!=null||o!=="none"&&String(f.section)!==o))),[t,n,s,o]);return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-bold font-heading",children:"Reading Room"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," pieces across tracks and sections."]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(q,{size:"sm",variant:"outline",onClick:()=>c("/admin/reading-room/members"),children:"Manage Members"}),l.jsxs(q,{size:"sm",onClick:()=>c("/admin/reading-room/new"),children:[l.jsx(Qr,{className:"h-4 w-4 mr-1"}),"New Item"]})]})]}),l.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[l.jsx(ue,{placeholder:"Search title or slugâ¦",value:n,onChange:f=>r(f.target.value),className:"max-w-xs"}),l.jsxs(Xr,{value:s,onValueChange:i,children:[l.jsx(Tr,{className:"w-[180px]",children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"all",children:"All tracks"}),dh.map(f=>l.jsx(nt,{value:f.value,children:f.label},f.value))]})]}),l.jsxs(Xr,{value:o,onValueChange:a,children:[l.jsx(Tr,{className:"w-[220px]",children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"all",children:"All sections"}),l.jsx(nt,{value:"none",children:"Unsorted"}),my.map(f=>l.jsxs(nt,{value:String(f.id),children:[f.id,". ",f.name]},f.id))]})]}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[p.length," shown"]})]}),l.jsx("div",{className:"border rounded-lg bg-background",children:l.jsxs(Ii,{children:[l.jsx(Di,{children:l.jsxs(Nt,{children:[l.jsx(Pe,{children:"Title"}),l.jsx(Pe,{children:"Section"}),l.jsx(Pe,{children:"Tracks"}),l.jsx(Pe,{children:"Type"}),l.jsx(Pe,{children:"Status"}),l.jsx(Pe,{children:"Free"}),l.jsx(Pe,{})]})}),l.jsxs(Li,{children:[p.map(f=>l.jsxs(Nt,{children:[l.jsxs(je,{className:"font-medium",children:[f.title,l.jsx("div",{className:"text-xs text-muted-foreground",children:f.slug})]}),l.jsx(je,{className:"text-sm",children:v7(f.section)}),l.jsx(je,{children:l.jsxs("div",{className:"flex flex-wrap gap-1",children:[(f.tracks??[]).map(g=>l.jsx(Ot,{variant:"outline",className:"text-xs",children:x7(g)},g)),(!f.tracks||f.tracks.length===0)&&l.jsx("span",{className:"text-xs text-muted-foreground",children:"â"})]})}),l.jsx(je,{children:l.jsx(Ot,{variant:"outline",className:"capitalize",children:f.type})}),l.jsx(je,{children:l.jsx(Ot,{variant:f.published?"default":"secondary",children:f.published?"Published":"Draft"})}),l.jsx(je,{children:f.is_free_preview?"â":""}),l.jsx(je,{children:l.jsxs("div",{className:"flex gap-1",children:[l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>c(`/admin/reading-room/${f.id}`),children:l.jsx(ok,{className:"h-4 w-4"})}),l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>h(f.id),children:l.jsx(ks,{className:"h-4 w-4 text-destructive"})})]})})]},f.id)),p.length===0&&l.jsx(Nt,{children:l.jsx(je,{colSpan:7,className:"text-center text-muted-foreground py-8",children:"No items match."})})]})]})})]})};var xy="Switch",[XG,Hoe]=Ns(xy),[ZG,eY]=XG(xy),yM=y.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:u,form:d,...h}=t,[p,f]=y.useState(null),g=ot(e,w=>f(w)),m=y.useRef(!1),v=p?d||!!p.closest("form"):!0,[x,b]=Ci({prop:s,defaultProp:i??!1,onChange:u,caller:xy});return l.jsxs(ZG,{scope:n,checked:x,disabled:a,children:[l.jsx(Ae.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":wM(x),"data-disabled":a?"":void 0,disabled:a,value:c,...h,ref:g,onClick:Ce(t.onClick,w=>{b(k=>!k),v&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),v&&l.jsx(bM,{control:p,bubbles:!m.current,name:r,value:c,checked:x,required:o,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});yM.displayName=xy;var vM="SwitchThumb",xM=y.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=eY(vM,n);
vendor: 5,235 bytes, line 487
487return l.jsx(Ae.span,{"data-state":wM(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});xM.displayName=vM;var tY="SwitchBubbleInput",bM=y.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const o=y.useRef(null),a=ot(o,i),c=Fk(n),u=gk(e);return y.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&f){const g=new Event("click",{bubbles:r});f.call(d,n),d.dispatchEvent(g)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});bM.displayName=tY;function wM(t){return t?"checked":"unchecked"}var kM=yM,nY=xM;const Ei=y.forwardRef(({className:t,...e},n)=>l.jsx(kM,{className:se("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",t),...e,ref:n,children:l.jsx(nY,{className:se("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")})}));Ei.displayName=kM.displayName;var by="Checkbox",[rY,Woe]=Ns(by),[sY,Vk]=rY(by);function iY(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:s,disabled:i,form:o,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=t,[p,f]=Ci({prop:n,defaultProp:s??!1,onChange:c,caller:by}),[g,m]=y.useState(null),[v,x]=y.useState(null),b=y.useRef(!1),w=g?!!o||!!g.closest("form"):!0,k={checked:p,disabled:i,setChecked:f,control:g,setControl:m,name:a,form:o,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Do(s)?!1:s,isFormControl:w,bubbleInput:v,setBubbleInput:x};return l.jsx(sY,{scope:e,...k,children:oY(h)?h(k):r})}var SM="CheckboxTrigger",CM=y.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},s)=>{const{control:i,value:o,disabled:a,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:p,isFormControl:f,bubbleInput:g}=Vk(SM,t),m=ot(s,d),v=y.useRef(c);return y.useEffect(()=>{const x=i==null?void 0:i.form;if(x){const b=()=>h(v.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[i,h]),l.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":Do(c)?"mixed":c,"aria-required":u,"data-state":TM(c),"data-disabled":a?"":void 0,disabled:a,value:o,...r,ref:m,onKeyDown:Ce(e,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Ce(n,x=>{h(b=>Do(b)?!0:!b),g&&f&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})})});CM.displayName=SM;var Hk=y.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c,onCheckedChange:u,form:d,...h}=t;return l.jsx(iY,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:a,required:o,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:p})=>l.jsxs(l.Fragment,{children:[l.jsx(CM,{...h,ref:e,__scopeCheckbox:n}),p&&l.jsx(EM,{__scopeCheckbox:n})]})})});Hk.displayName=by;var jM="CheckboxIndicator",NM=y.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=Vk(jM,n);return l.jsx(ta,{present:r||Do(i.checked)||i.checked===!0,children:l.jsx(Ae.span,{"data-state":TM(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});NM.displayName=jM;var _M="CheckboxBubbleInput",EM=y.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:a,disabled:c,name:u,value:d,form:h,bubbleInput:p,setBubbleInput:f}=Vk(_M,t),g=ot(n,f),m=Fk(i),v=gk(r);y.useEffect(()=>{const b=p;if(!b)return;const w=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(w,"checked").set,E=!s.current;if(m!==i&&j){const N=new Event("click",{bubbles:E});b.indeterminate=Do(i),j.call(b,Do(i)?!1:i),b.dispatchEvent(N)}},[p,m,i,s]);const x=y.useRef(Do(i)?!1:i);return l.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??x.current,required:a,disabled:c,name:u,value:d,form:h,...e,tabIndex:-1,ref:g,style:{...e.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});EM.displayName=_M;function oY(t){return typeof t=="function"}function Do(t){return t==="indeterminate"}function TM(t){return Do(t)?"indeterminate":t?"checked":"unchecked"}const Wk=y.forwardRef(({className:t,...e},n)=>l.jsx(Hk,{ref:n,className:se("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",t),...e,children:l.jsx(NM,{className:se("flex items-center justify-center text-current"),children:l.jsx(kA,{className:"h-4 w-4"})})}));Wk.displayName=Hk.displayName;
487var RM={exports:{}},AM={};/** 488 * @license React 489 * use-sync-external-store-shim.production.js 490 * 491 * Copyright (c) Meta Platforms, Inc. and affiliates. 492 * 493 * This source code is licensed under the MIT license found in the 494 * LICENSE file in the root directory of this source tree. 495 */var Uc=y;function aY(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var lY=typeof Object.is=="function"?Object.is:aY,cY=Uc.useState,uY=Uc.useEffect,dY=Uc.useLayoutEffect,hY=Uc.useDebugValue;function fY(t,e){var n=e(),r=cY({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return dY(function(){s.value=n,s.getSnapshot=e,Uv(s)&&i({inst:s})},[t,n,e]),uY(function(){return Uv(s)&&i({inst:s}),t(function(){Uv(s)&&i({inst:s})})},[t]),hY(n),n}function Uv(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!lY(t,n)}catch{return!0}}function pY(t,e){return e()}var mY=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?pY:fY;AM.useSyncExternalStore=Uc.useSyncExternalStore!==void 0?Uc.useSyncExternalStore:mY;RM.exports=AM;var qk=RM.exports;function _n(t){this.content=t}_n.prototype={constructor:_n,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,s=r.find(t),i=r.content.slice();return s==-1?i.push(n||t,e):(i[s+1]=e,n&&(i[s]=n)),new _n(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new _n(n)},addToStart:function(t,e){return new _n([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new _n(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),i=r.find(t);return s.splice(i==-1?s.length:i,0,e,n),new _n(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=_n.from(t),t.size?new _n(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=_n.from(t),t.size?new _n(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=_n.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};_n.from=function(t){if(t instanceof _n)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new _n(e)};function OM(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),i=e.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)n++;return n}if(s.content.size||i.content.size){let o=OM(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function PM(t,e,n,r){for(let s=t.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:r};let o=t.child(--s),a=e.child(--i),c=o.nodeSize;if(o==a){n-=c,r-=c;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,d=Math.min(o.text.length,a.text.length);for(;u<d&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=PM(o.content,a.content,n-1,r-1);if(u)return u}n-=c,r-=c}}class J{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,s=0,i){for(let o=0,a=0;a<n;o++){let c=this.content[o],u=a+c.nodeSize;if(u>e&&r(c,s+a,i||null,o)!==!1&&c.content.size){let d=a+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,n-d),r,s+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(a,c)=>{let u=a.isText?a.text.slice(Math.max(e,c)-c,n-c):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);
vendor: 4,281 bytes, line 495
495return new J(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let i=0,o=0;o<n;i++){let a=this.content[i],c=o+a.nodeSize;c>e&&((o<e||c>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),s+=a.nodeSize),o=c}return new J(r,s)}cutByIndex(e,n){return e==n?J.empty:e==0&&n==this.content.length?this:new J(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new J(s,i)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.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(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return OM(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return PM(this,e,n,r)}findIndex(e){if(e==0)return Ff(0,e);if(e==this.size)return Ff(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=e)return i==e?Ff(n+1,i):Ff(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.empty;let n,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(n||(n=e.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new J(n||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const Vv={index:0,offset:0};function Ff(t,e){return Vv.index=t,Vv.offset=e,Vv}function Nm(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Nm(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Nm(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let dt=class gw{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Nm(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return gw.none;if(e instanceof gw)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};dt.none=[];
vendor: 6,513 bytes, line 495
495class _m extends Error{}class le{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=IM(this.content,e+this.openStart,n);return r&&new le(r,this.openStart,this.openEnd)}removeBetween(e,n){return new le(MM(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return le.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new le(J.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new le(e,r,s)}}le.empty=new le(J.empty,0,0);function MM(t,e,n){let{index:r,offset:s}=t.findIndex(e),i=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(s==e||i.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(MM(i.content,e-s-1,n-s-1)))}function IM(t,e,n,r){let{index:s,offset:i}=t.findIndex(e),o=t.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=IM(o.content,e-i-1,n,o);return a&&t.replaceChild(s,o.copy(a))}function gY(t,e,n){if(n.openStart>t.depth)throw new _m("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new _m("Inconsistent open depths");return DM(t,e,n,0)}function DM(t,e,n,r){let s=t.index(r),i=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let o=DM(t,e,n,r+1);return i.copy(i.content.replaceChild(s,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return Ba(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=yY(n,t);return Ba(i,$M(t,o,a,e,r))}else return Ba(i,Em(t,e,r))}function LM(t,e){if(!e.type.compatibleContent(t.type))throw new _m("Cannot join "+e.type.name+" onto "+t.type.name)}function yw(t,e,n){let r=t.node(n);return LM(r,e.node(n)),r}function $a(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function md(t,e,n,r){let s=(e||t).node(n),i=0,o=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&($a(t.nodeAfter,r),i++));for(let a=i;a<o;a++)$a(s.child(a),r);e&&e.depth==n&&e.textOffset&&$a(e.nodeBefore,r)}function Ba(t,e){return t.type.checkContent(e),t.copy(e)}function $M(t,e,n,r,s){let i=t.depth>s&&yw(t,e,s+1),o=r.depth>s&&yw(n,r,s+1),a=[];return md(null,t,s,a),i&&o&&e.index(s)==n.index(s)?(LM(i,o),$a(Ba(i,$M(t,e,n,r,s+1)),a)):(i&&$a(Ba(i,Em(t,e,s+1)),a),md(e,n,s,a),o&&$a(Ba(o,Em(n,r,s+1)),a)),md(r,null,s,a),new J(a)}function Em(t,e,n){let r=[];if(md(null,t,n,r),t.depth>n){let s=yw(t,e,n+1);$a(Ba(s,Em(t,e,n+1)),r)}return md(e,null,n,r),new J(r)}function yY(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)s=e.node(i).copy(J.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class mh{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return dt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let a=r;r=s,s=a}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Tm(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=e;;){let{index:a,offset:c}=o.content.findIndex(i),u=i-c;if(r.push(o,a,s+c),!u||(o=o.child(a),o.isText))break;i=u-1,s+=c+1}return new mh(n,r,i)}
vendor: 4,383 bytes, line 495
495static resolveCached(e,n){let r=sN.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==n)return o}else sN.set(e,r=new vY);let s=r.elts[r.i]=mh.resolve(e,n);return r.i=(r.i+1)%xY,s}}class vY{constructor(){this.elts=[],this.i=0}}const xY=12,sN=new WeakMap;class Tm{constructor(e,n,r){this.$from=e,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 bY=Object.create(null);let Lo=class vw{constructor(e,n,r,s=dt.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||J.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,s=0){this.content.nodesBetween(e,n,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,s){return this.content.textBetween(e,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Nm(this.attrs,n||e.defaultAttrs||bY)&&dt.sameSet(this.marks,r||dt.none)}copy(e=null){return e==this.content?this:new vw(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new vw(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return le.empty;let s=this.resolve(e),i=this.resolve(n),o=r?0:s.sharedDepth(n),a=s.start(o),u=s.node(o).content.cut(s.pos-a,i.pos-a);return new le(u,s.depth-o,i.depth-o)}replace(e,n,r){return gY(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return mh.resolveCached(this,e)}resolveNoCache(e){return mh.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),BM(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=J.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let c=s;c<i;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=dt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!dt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}
495`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,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(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=J.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};Lo.prototype.text=void 0;class Rm extends Lo{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):BM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Rm(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Rm(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function BM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class tl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new wY(e,n);if(r.next==null)return tl.empty;let s=zM(r);r.next&&r.err("Unexpected trailing text");let i=EY(_Y(s));return TY(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let s=this;for(let i=n;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let s=[this];function i(o,a){let c=o.matchFragment(e,r);if(c&&(!n||c.validEnd))return J.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&s.indexOf(h)==-1){s.push(h);let p=i(h,a.concat(d));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let a=s;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:a,next:c}=i.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!s.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:s}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(` 496`)}}tl.empty=new tl(!0);class wY{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function zM(t){let e=[];do e.push(kY(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function kY(t){let e=[];do e.push(SY(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function SY(t){let e=NY(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=CY(t,e);else break;return e}function iN(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");
vendor: 4,721 bytes, line 496
496let e=Number(t.next);return t.pos++,e}function CY(t,e){let n=iN(t),r=n;return t.eat(",")&&(t.next!="}"?r=iN(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function jY(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function NY(t){if(t.eat("(")){let e=zM(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=jY(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function _Y(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,c){let u={term:c,to:a};return e[o].push(u),u}function s(o,a){o.forEach(c=>c.to=a)}function i(o,a){if(o.type=="choice")return o.exprs.reduce((c,u)=>c.concat(i(u,a)),[]);if(o.type=="seq")for(let c=0;;c++){let u=i(o.exprs[c],a);if(c==o.exprs.length-1)return u;s(u,a=n())}else if(o.type=="star"){let c=n();return r(a,c),s(i(o.expr,c),c),[r(c)]}else if(o.type=="plus"){let c=n();return s(i(o.expr,a),c),s(i(o.expr,c),c),[r(c)]}else{if(o.type=="opt")return[r(a)].concat(i(o.expr,a));if(o.type=="range"){let c=a;for(let u=0;u<o.min;u++){let d=n();s(i(o.expr,c),d),c=d}if(o.max==-1)s(i(o.expr,c),c);else for(let u=o.min;u<o.max;u++){let d=n();r(c,d),s(i(o.expr,c),d),c=d}return[r(c)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function FM(t,e){return e-t}function oN(t,e){let n=[];return r(e),n.sort(FM);function r(s){let i=t[s];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(s);for(let o=0;o<i.length;o++){let{term:a,to:c}=i[o];!a&&n.indexOf(c)==-1&&r(c)}}}function EY(t){let e=Object.create(null);return n(oN(t,0));function n(r){let s=[];r.forEach(o=>{t[o].forEach(({term:a,to:c})=>{if(!a)return;let u;for(let d=0;d<s.length;d++)s[d][0]==a&&(u=s[d][1]);oN(t,c).forEach(d=>{u||s.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let i=e[r.join(",")]=new tl(r.indexOf(t.length-1)>-1);for(let o=0;o<s.length;o++){let a=s[o][1].sort(FM);i.next.push({type:s[o][0],next:e[a.join(",")]||n(a)})}return i}}function TY(t,e){for(let n=0,r=[t];n<r.length;n++){let s=r[n],i=!s.validEnd,o=[];for(let a=0;a<s.next.length;a++){let{type:c,next:u}=s.next[a];o.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),r.indexOf(u)==-1&&r.push(u)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function UM(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function VM(t,e){let n=Object.create(null);for(let r in t){let s=e&&e[r];if(s===void 0){let i=t[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function HM(t,e,n,r){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${s}`);for(let s in t){let i=t[s];i.validate&&i.validate(e[s])}}function WM(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new AY(t,r,e[r]);return n}let aN=class qM{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=WM(e,r.attrs),this.defaultAttrs=UM(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==tl.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:VM(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Lo(this,this.computeAttrs(e),J.from(n),dt.setFrom(r))}createChecked(e=null,n,r){return n=J.from(n),this.checkContent(n),new Lo(this,this.computeAttrs(e),n,dt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=J.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(J.empty,!0);return i?new Lo(this,e,n.append(i),dt.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);
vendor: 9,565 bytes, lines 496-497
496if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){HM(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:dt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,o)=>r[i]=new qM(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function RY(t,e,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class AY{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?RY(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class wy{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=WM(e,s.attrs),this.excluded=null;let i=UM(this.attrs);this.instance=i?new dt(this,i):null}create(e=null){return!e&&this.instance?this.instance:new dt(this,VM(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new wy(i,s++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){HM(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class KM{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=_n.from(e.nodes),n.marks=_n.from(e.marks||{}),this.nodes=aN.compile(this.spec.nodes,this),this.marks=wy.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=tl.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?lN(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:lN(this,o.split(" "))}this.nodeFromJSON=s=>Lo.fromJSON(this,s),this.markFromJSON=s=>dt.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof aN){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new Rm(r,r.defaultAttrs,e,dt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function lN(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],i=t.marks[s],o=i;if(i)n.push(i);else for(let a in t.marks){let c=t.marks[a];(s=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function OY(t){return t.tag!=null}function PY(t){return t.style!=null}class $o{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(OY(s))this.tags.push(s);else if(PY(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new uN(this,n,!1);return r.addAll(e,dt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new uN(this,n,!0);return r.addAll(e,dt.none,n.from,n.to),le.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(DY(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,n,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let c=o.getAttrs(n);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(e){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<i)break}n.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=dN(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=dN(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $o(e,$o.schemaRules(e)))}}const GM={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},MY={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},YM={ol:!0,ul:!0},gh=1,xw=2,gd=4;function cN(t,e,n){return e!=null?(e?gh:0)|(e==="full"?xw:0):t&&t.whitespace=="pre"?gh|xw:n&~gd}class Uf{constructor(e,n,r,s,i,o){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=dt.none,this.match=i||(o&gd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&gh)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=J.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!GM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class uN{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=cN(null,n.preserveWhitespace,0)|(r?gd:0);s?i=new Uf(s.type,s.attrs,dt.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new Uf(null,null,dt.none,!0,null,o):i=new Uf(e.schema.topNodeType,null,dt.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,i=s.options&xw?"full":this.localPreserveWS||(s.options&gh)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,` 497`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let c=0;c<a.length;c++)c&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[c]&&this.insertNode(o.text(a[c]),n,!/\S/.test(a[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 a=s.content[s.content.length-1],c=e.previousSibling;(!a||c&&c.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;YM.hasOwnProperty(o)&&this.parser.normalizeLists&&IY(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(c?c.ignore:MY.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let u,d=this.needsBlock;if(GM.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),u=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}
vendor: 4,920 bytes, lines 497-498
497let h=c&&c.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),u&&this.sync(i),this.needsBlock=d}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,c,u,c.consuming===!1?a:void 0)}this.localPreserveWS=s}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` 498`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let a=void 0;;){let c=this.parser.matchStyle(i,o,this,a);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)a=c;else break}}return n}addElementByRule(e,n,r,s){let i,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let c=this.enter(o,n.attrs||null,r,n.preserveWhitespace);c&&(i=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r,!1));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=s==null?null:e.childNodes[s];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,n);this.findAtPoint(e,i)}findPlace(e,n,r){let s,i;for(let o=this.open,a=0;o>=0;o--){let c=this.nodes[o],u=c.findWrapping(e);if(u&&(!s||s.length>u.length+a)&&(s=u,i=c,!u.length))break;if(c.solid){if(r)break;a+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)n=this.enterInner(s[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let s=this.findPlace(e,n,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=dt.none;for(let a of s.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):hN(a.type,e.type))&&(o=a.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,s){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,s)),i}enterInner(e,n,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=cN(e,i,o.options);o.options&gd&&o.content.length==0&&(a|=gd);let c=dt.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):hN(u.type,e))?(c=u.addToSet(c),!1):!0),this.nodes.push(new Uf(e,n,c,s,null,a)),this.open++,r}closeExtra(e=!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(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=gh)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(a,c)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;c>=i;c--)if(o(a-1,c))return!0;return!1}else{let d=c>0||c==0&&s?this.nodes[c].type:r&&c>=i?r.node(c-i).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;c--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;
vendor: 9,786 bytes, line 498
498if(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 IY(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&YM.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function DY(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function dN(t){let e={};for(let n in t)e[n]=t[n];return e}function hN(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let i=[],o=a=>{i.push(a);for(let c=0;c<a.edgeCount;c++){let{type:u,next:d}=a.edge(c);if(u==e||i.indexOf(d)<0&&o(d))return!0}};if(o(s.contentMatch))return!0}}class dl{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Hv(n).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let a=0,c=0;for(;a<i.length&&c<o.marks.length;){let u=o.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(i[a][0])||u.type.spec.spanning===!1)break;a++,c++}for(;a<i.length;)s=i.pop()[1];for(;c<o.marks.length;){let u=o.marks[c++],d=this.serializeMark(u,o.isInline,n);d&&(i.push([u,s]),s.appendChild(d.dom),s=d.contentDOM||d.dom)}}s.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:s}=kp(Hv(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&kp(Hv(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return kp(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dl(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=fN(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return fN(e.marks)}}function fN(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Hv(t){return t.document||window.document}const pN=new WeakMap;function LY(t){let e=pN.get(t);return e===void 0&&pN.set(t,e=$Y(t)),e}function $Y(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(t),e}function kp(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=LY(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(n=s.slice(0,o),s=s.slice(o+1));let a,c=n?t.createElementNS(n,s):t.createElement(s),u=e[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 p=h.indexOf(" ");p>0?c.setAttributeNS(h.slice(0,p),h.slice(p+1),u[h]):h=="style"&&c.style?c.style.cssText=u[h]:c.setAttribute(h,u[h])}}for(let h=d;h<e.length;h++){let p=e[h];if(p===0){if(h<e.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:g}=kp(t,p,n,r);if(c.appendChild(f),g){if(a)throw new RangeError("Multiple content holes");a=g}}}return{dom:c,contentDOM:a}}const JM=65535,QM=Math.pow(2,16);function BY(t,e){return t+e*QM}function mN(t){return t&JM}function zY(t){return(t-(t&JM))/QM}const XM=1,ZM=2,Sp=4,eI=8;class bw{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&eI)>0}get deletedBefore(){return(this.delInfo&(XM|Sp))>0}get deletedAfter(){return(this.delInfo&(ZM|Sp))>0}get deletedAcross(){return(this.delInfo&Sp)>0}}class kr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&kr.empty)return kr.empty}recover(e){let n=0,r=mN(e);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+zY(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?s:0);if(c>e)break;let u=this.ranges[a+i],d=this.ranges[a+o],h=c+u;if(e<=h){let p=u?e==c?-1:e==h?1:n:n,f=c+s+(p<0?0:d);if(r)return f;let g=e==(n<0?c:h)?null:BY(a/3,e-c),m=e==c?ZM:e==h?XM:Sp;return(n<0?e!=c:e!=h)&&(m|=eI),new bw(f,m,g)}s+=d-u}return r?e+s:new bw(e+s,0,null)}touches(e,n){let r=0,s=mN(n),i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let u=this.ranges[a+i],d=c+u;if(e<=d&&a==s*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],a=o-(this.inverted?i:0),c=o+(this.inverted?0:i),u=this.ranges[s+n],d=this.ranges[s+r];e(a,a+u,c,c+d),i+=d-u}}invert(){return new kr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?kr.empty:new kr(e<0?[0,-e,0]:[0,0,e])}}kr.empty=new kr([]);class yh{constructor(e,n,r=0,s=e?e.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new yh(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new yh;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],a=o.mapResult(e,n);if(a.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this._maps[c].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return r?e:new bw(e,s,null)}}const Wv=Object.create(null);class Wn{getMap(){return kr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Wv[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Wv)throw new RangeError("Duplicate use of step JSON ID "+e);return Wv[e]=n,n.prototype.jsonID=e,n}}class sn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new sn(e,null)}static fail(e){return new sn(null,e)}static fromReplace(e,n,r,s){try{return sn.ok(e.replace(n,r,s))}catch(i){if(i instanceof _m)return sn.fail(i.message);throw i}}}function Kk(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(Kk(i.content,e,i))),i.isInline&&(i=e(i,n,s)),r.push(i)}return J.fromArray(r)}class ko extends Wn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new le(Kk(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),n.openStart,n.openEnd);return sn.fromReplace(e,this.from,this.to,i)}invert(){return new ys(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ko(n.pos,r.pos,this.mark)}merge(e){return e instanceof ko&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ko(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ko(n.from,n.to,e.markFromJSON(n.mark))}}Wn.jsonID("addMark",ko);class ys extends Wn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new le(Kk(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return sn.fromReplace(e,this.from,this.to,r)}invert(){return new ko(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ys(n.pos,r.pos,this.mark)}merge(e){return e instanceof ys&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ys(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ys(n.from,n.to,e.markFromJSON(n.mark))}}Wn.jsonID("removeMark",ys);class So extends Wn{constructor(e,n){super(),this.pos=e,this.mark=n}
vendor: 5,584 bytes, line 498
498apply(e){let n=e.nodeAt(this.pos);if(!n)return sn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return sn.fromReplace(e,this.pos,this.pos+1,new le(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new So(this.pos,n.marks[s]);return new So(this.pos,this.mark)}}return new nl(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new So(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new So(n.pos,e.markFromJSON(n.mark))}}Wn.jsonID("addNodeMark",So);class nl extends Wn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return sn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return sn.fromReplace(e,this.pos,this.pos+1,new le(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new So(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nl(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new nl(n.pos,e.markFromJSON(n.mark))}}Wn.jsonID("removeNodeMark",nl);class gn extends Wn{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&ww(e,this.from,this.to)?sn.fail("Structure replace would overwrite content"):sn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new kr([this.from,this.to-this.from,this.slice.size])}invert(e){return new gn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new gn(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof gn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?le.empty:new le(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new gn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?le.empty:new le(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new gn(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new gn(n.from,n.to,le.fromJSON(e,n.slice),!!n.structure)}}Wn.jsonID("replace",gn);class vn extends Wn{constructor(e,n,r,s,i,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=a}apply(e){if(this.structure&&(ww(e,this.from,this.gapFrom)||ww(e,this.gapTo,this.to)))return sn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return sn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?sn.fromReplace(e,this.from,this.to,r):sn.fail("Content does not fit in gap")}getMap(){return new kr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new vn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||i>r.pos?null:new vn(n.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,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 vn(n.from,n.to,n.gapFrom,n.gapTo,le.fromJSON(e,n.slice),n.insert,!!n.structure)}}Wn.jsonID("replaceAround",vn);function ww(t,e,n){let r=t.resolve(e),s=n-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function FY(t,e,n,r){let s=[],i=[],o,a;t.doc.nodesBetween(e,n,(c,u,d)=>{if(!c.isInline)return;let h=c.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let p=Math.max(u,e),f=Math.min(u+c.nodeSize,n),g=r.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(g)||(o&&o.to==p&&o.mark.eq(h[m])?o.to=f:s.push(o=new ys(p,f,h[m])));a&&a.to==p?a.to=f:i.push(a=new ko(p,f,r))}}
vendor: 7,647 bytes, lines 498-499
498),s.forEach(c=>t.step(c)),i.forEach(c=>t.step(c))}function UY(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;i++;let c=null;if(r instanceof wy){let u=o.marks,d;for(;d=r.isInSet(u);)(c||(c=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(o.marks)&&(c=[r]):c=o.marks;if(c&&c.length){let u=Math.min(a+o.nodeSize,n);for(let d=0;d<c.length;d++){let h=c[d],p;for(let f=0;f<s.length;f++){let g=s[f];g.step==i-1&&h.eq(s[f].style)&&(p=g)}p?(p.to=u,p.step=i):s.push({style:h,from:Math.max(a,e),to:u,step:i})}}}),s.forEach(o=>t.step(new ys(o.from,o.to,o.style)))}function Gk(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],a=e+1;for(let c=0;c<i.childCount;c++){let u=i.child(c),d=a+u.nodeSize,h=r.matchType(u.type);if(!h)o.push(new gn(a,d,le.empty));else{r=h;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||t.step(new ys(a,d,u.marks[p]));if(s&&u.isText&&n.whitespace!="pre"){let p,f=/\r?\n|\r/g,g;for(;p=f.exec(u.text);)g||(g=new le(J.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new gn(a+p.index,a+p.index+p[0].length,g))}}a=d}if(!r.validEnd){let c=r.fillBefore(J.empty,!0);t.replace(a,a,new le(c,0,0))}for(let c=o.length-1;c>=0;c--)t.step(o[c])}function VY(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function cu(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,i=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+s,c=t.$to.indexAfter(r)-i;if(r<t.depth&&o.canReplace(a,c,n))return r;if(r==0||o.type.spec.isolating||!VY(o,a,c))break;a&&(s=1),c<o.childCount&&(i=1)}return null}function HY(t,e,n){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),a=s.after(i+1),c=o,u=a,d=J.empty,h=0;for(let g=i,m=!1;g>n;g--)m||r.index(g)>0?(m=!0,d=J.from(r.node(g).copy(d)),h++):c--;let p=J.empty,f=0;for(let g=i,m=!1;g>n;g--)m||s.after(g+1)<s.end(g)?(m=!0,p=J.from(s.node(g).copy(p)),f++):u++;t.step(new vn(c,u,o,a,new le(d.append(p),h,f),d.size-h,!0))}function Yk(t,e,n=null,r=t){let s=WY(t,e),i=s&&qY(r,e);return i?s.map(gN).concat({type:e,attrs:n}).concat(i.map(gN)):null}function gN(t){return{type:t,attrs:null}}function WY(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return n.canReplaceWith(r,s,o)?i:null}function qY(t,e){let{parent:n,startIndex:r,endIndex:s}=t,i=n.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let c=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;c&&u<s;u++)c=c.matchType(n.child(u).type);return!c||!c.validEnd?null:o}function KY(t,e,n){let r=J.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=J.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new vn(s,i,s,i,new le(r,0,0),n.length,!0))}function GY(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let c=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,c)&&YY(t.doc,t.mapping.slice(i).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",g=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!g?u=!1:!f&&g&&(u=!0)}u===!1&&nI(t,o,a,i),Gk(t,t.mapping.slice(i).map(a,1),r,void 0,u===null);let d=t.mapping.slice(i),h=d.map(a,1),p=d.map(a+o.nodeSize,1);return t.step(new vn(h,p,h+1,p-1,new le(J.from(r.create(c,null,o.marks)),0,0),1,!0)),u===!0&&tI(t,o,a,i),!1}})}function tI(t,e,n,r){e.forEach((s,i)=>{if(s.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(s.text);){let c=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function nI(t,e,n,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text(` 499`))}})}function YY(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function JY(t,e,n,r,s){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let o=n.create(r,null,s||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new vn(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new le(J.from(o),0,0),1,!0))}function lc(t,e,n=1,r){let s=t.resolve(e),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let u=s.depth-1,d=n-2;u>i;u--,d--){let h=s.node(u),p=s.index(u);if(h.type.spec.isolating)return!1;let f=h.content.cutByIndex(p,h.childCount),g=r&&r[d+1];g&&(f=f.replaceChild(0,g.type.create(g.attrs)));let m=r&&r[d]||h;if(!h.canReplace(p+1,h.childCount)||!m.type.validContent(f))return!1}let a=s.indexAfter(i),c=r&&r[0];return s.node(i).canReplaceWith(a,a,c?c.type:s.node(i+1).type)}function QY(t,e,n=1,r){let s=t.doc.resolve(e),i=J.empty,o=J.empty;for(let a=s.depth,c=s.depth-n,u=n-1;a>c;a--,u--){i=J.from(s.node(a).copy(i));let d=r&&r[u];o=J.from(d?d.type.create(d.attrs,o):s.node(a).copy(o))}t.step(new gn(e,e,new le(i.append(o),n,n),!0))}function sa(t,e){let n=t.resolve(e),r=n.index();return rI(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function XY(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let s=0;s<e.childCount;s++){let i=e.child(s),o=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function rI(t,e){return!!(t&&e&&!t.isLeaf&&XY(t,e))}function ky(t,e,n=-1){let r=t.resolve(e);for(let s=r.depth;;s--){let i,o,a=r.index(s);if(s==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(s+1),a++,o=r.node(s).maybeChild(a)):(i=r.node(s).maybeChild(a-1),o=r.node(s+1)),i&&!i.isTextblock&&rI(i,o)&&r.node(s).canReplace(a,a+1))return e;if(s==0)break;e=n<0?r.before(s):r.after(s)}}function ZY(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(s);d&&!h?r=!1:!d&&h&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);nI(t,d.node(),d.before(),a)}o.inlineContent&&Gk(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let c=t.mapping.slice(a),u=c.map(e-n);if(t.step(new gn(u,c.map(e+n,-1),le.empty,!0)),r===!0){let d=t.doc.resolve(u);tI(t,d.node(),d.before(),t.steps.length)}return t}function eJ(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i<r.node(s).childCount)return null}return null}function sI(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let s=n.content;for(let i=0;i<n.openStart;i++)s=s.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,c=r.index(o)+(a>0?1:0),u=r.node(o),d=!1;if(i==1)d=u.canReplace(c,c,s);else{let h=u.contentMatchAt(c).findWrapping(s.firstChild.type);d=h&&u.canReplaceWith(c,c,h[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}
vendor: 6,178 bytes, line 499
499function Sy(t,e,n=e,r=le.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return iI(s,i,r)?new gn(e,n,r):new tJ(s,i,r).fit()}function iI(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class tJ{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=J.from(e.node(s).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 e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,a=s.depth;for(;o&&a&&i.childCount==1;)i=i.firstChild.content,o--,a--;let c=new le(i,o,a);return e>-1?new vn(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new gn(r.pos,s.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=qv(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:u}=this.frontier[a],d,h=null;if(n==1&&(o?u.matchType(o.type)||(h=u.fillBefore(J.from(o),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:h};if(n==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:d};if(i&&u.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=qv(e,n);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new le(e,n+1,Math.max(r,s.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=qv(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new le(Yu(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new le(Yu(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let o=this.unplaced,a=r?r.content:o.content,c=o.openStart-e,u=0,d=[],{match:h,type:p}=this.frontier[n];if(s){for(let m=0;m<s.childCount;m++)d.push(s.child(m));h=h.matchFragment(s)}let f=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let m=a.child(u),v=h.matchType(m.type);if(!v)break;u++,(u>1||c==0||m.content.size)&&(h=v,d.push(oI(m.mark(p.allowedMarks(m.marks)),u==1?c:0,u==a.childCount?f:-1)))}let g=u==a.childCount;g||(f=-1),this.placed=Ju(this.placed,n,J.from(d)),this.frontier[n].match=h,g&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,v=a;m<f;m++){let x=v.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),v=x.content}this.unplaced=g?e==0?le.empty:new le(Yu(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new le(Yu(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Kv(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=Kv(e,n,s,r,i);if(o){for(let a=n-1;a>=0;a--){let{match:c,type:u}=this.frontier[a],d=Kv(e,a,u,c,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ju(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=Ju(this.placed,this.depth,J.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=Ju(this.placed,this.frontier.length,n))}}function Yu(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Yu(t.firstChild.content,e-1,n)))}function Ju(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ju(t.lastChild.content,e-1,n)))}function qv(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function oI(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,oI(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(J.empty,!0)))),t.copy(r)}function Kv(t,e,n,r,s){let i=t.node(e),o=s?t.indexAfter(e):t.index(e);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,o);return a&&!nJ(n,i.content,o)?a:null}function nJ(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function rJ(t){return t.spec.defining||t.spec.definingForContent}function sJ(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),i=t.doc.resolve(n);if(iI(s,i,r))return t.step(new gn(e,n,r));let o=lI(s,i);o[o.length-1]==0&&o.pop();let a=-(s.depth+1);o.unshift(a);for(let p=s.depth,f=s.pos-1;p>0;p--,f--){let g=s.node(p).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(p)>-1?a=p:s.before(p)==f&&o.splice(1,0,-p)}let c=o.indexOf(a),u=[],d=r.openStart;for(let p=r.content,f=0;;f++){let g=p.firstChild;if(u.push(g),f==r.openStart)break;p=g.content}for(let p=d-1;p>=0;p--){let f=u[p],g=rJ(f.type);
vendor: 4,870 bytes, line 499
499if(g&&!f.sameMarkup(s.node(Math.abs(a)-1)))d=p;else if(g||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+d+1)%(r.openStart+1),g=u[f];if(g)for(let m=0;m<o.length;m++){let v=o[(m+c)%o.length],x=!0;v<0&&(x=!1,v=-v);let b=s.node(v-1),w=s.index(v-1);if(b.canReplaceWith(w,w,g.type,g.marks))return t.replace(s.before(v),x?i.after(v):n,new le(aI(r.content,0,r.openStart,f),f,r.openEnd))}}let h=t.steps.length;for(let p=o.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>h));p--){let f=o[p];f<0||(e=s.before(f),n=i.after(f))}}function aI(t,e,n,r,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(aI(i.content,e+1,n,r,i)))}if(e>r){let i=s.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(J.empty,!0))}return t}function iJ(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=eJ(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new le(J.from(r),0,0))}function oJ(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n),i=lI(r,s);for(let o=0;o<i.length;o++){let a=i[o],c=o==i.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),s.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),s.indexAfter(a-1))))return t.delete(r.before(a),s.after(a))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&s.end(o)-n!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function lI(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let s=r;s>=0;s--){let i=t.start(s);if(i<t.pos-(t.depth-s)||e.end(s)>e.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&n.push(s)}return n}class cc extends Wn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return sn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return sn.fromReplace(e,this.pos,this.pos+1,new le(J.from(s),0,n.isLeaf?0:1))}getMap(){return kr.empty}invert(e){return new cc(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new cc(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new cc(n.pos,n.attr,n.value)}}Wn.jsonID("attr",cc);class vh extends Wn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return sn.ok(r)}getMap(){return kr.empty}invert(e){return new vh(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new vh(n.attr,n.value)}}Wn.jsonID("docAttr",vh);let Vc=class extends Error{};Vc=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Vc.prototype=Object.create(Error.prototype);Vc.prototype.constructor=Vc;Vc.prototype.name="TransformError";class cI{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new yh}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Vc(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let s=this.mapping.maps[r];r&&(e=s.map(e,1),n=s.map(n,-1)),s.forEach((i,o,a,c)=>{e=Math.min(e,a),n=Math.max(n,c)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=le.empty){let s=Sy(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new le(J.from(r),0,0))}delete(e,n){return this.replace(e,n,le.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return sJ(this,e,n,r),this}replaceRangeWith(e,n,r){return iJ(this,e,n,r),this}deleteRange(e,n){return oJ(this,e,n),this}lift(e,n){return HY(this,e,n),this}join(e,n=1){return ZY(this,e,n),this}wrap(e,n){return KY(this,e,n),this}setBlockType(e,n=e,r,s=null){return GY(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return JY(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new cc(e,n,r)),this}setDocAttribute(e,n){return this.step(new vh(e,n)),this}addNodeMark(e,n){return this.step(new So(e,n)),this}
vendor: 5,108 bytes, line 499
499removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof dt)n.isInSet(r.marks)&&this.step(new nl(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new nl(e,i)),s=i.removeFromSet(s);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return QY(this,e,n,r),this}addMark(e,n,r){return FY(this,e,n,r),this}removeMark(e,n,r){return UY(this,e,n,r),this}clearIncompatible(e,n,r){return Gk(this,e,n,r),this}}const Gv=Object.create(null);class Ve{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new aJ(e.min(n),e.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 e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=le.empty){let r=n.content.lastChild,s=null;for(let a=0;a<n.openEnd;a++)s=r,r=r.lastChild;let i=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:c,$to:u}=o[a],d=e.mapping.slice(i);e.replaceRange(d.map(c.pos),d.map(u.pos),a?le.empty:n),a==0&&xN(e,i,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:o,$to:a}=s[i],c=e.mapping.slice(r),u=c.map(o.pos),d=c.map(a.pos);i?e.deleteRange(u,d):(e.replaceRangeWith(u,d,n),xN(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let s=e.parent.inlineContent?new Me(e):Dl(e.node(0),e.parent,e.pos,e.index(),n,r);if(s)return s;for(let i=e.depth-1;i>=0;i--){let o=n<0?Dl(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Dl(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Wr(e.node(0))}static atStart(e){return Dl(e,e,0,0,1)||new Wr(e)}static atEnd(e){return Dl(e,e,e.content.size,e.childCount,-1)||new Wr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Gv[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Gv)throw new RangeError("Duplicate use of selection JSON ID "+e);return Gv[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Me.between(this.$anchor,this.$head).getBookmark()}}Ve.prototype.visible=!0;class aJ{constructor(e,n){this.$from=e,this.$to=n}}let yN=!1;function vN(t){!yN&&!t.parent.inlineContent&&(yN=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Me extends Ve{constructor(e,n=e){vN(e),vN(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ve.near(r);let s=e.resolve(n.map(this.anchor));return new Me(s.parent.inlineContent?s:r,r)}replace(e,n=le.empty){if(super.replace(e,n),n==le.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Me&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Cy(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Me(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let s=e.resolve(n);return new this(s,r==n?s:e.resolve(r))}static between(e,n,r){let s=e.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=Ve.findFrom(n,r,!0)||Ve.findFrom(n,-r,!0);if(i)n=i.$head;else return Ve.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(Ve.findFrom(e,-r,!0)||Ve.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=s<0&&(e=n))),new Me(e,n)}}Ve.jsonID("text",Me);class Cy{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Cy(e.map(this.anchor),e.map(this.head))}resolve(e){return Me.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ne extends Ve{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:s}=n.mapResult(this.anchor),i=e.resolve(s);return r?Ve.near(i):new Ne(i)}content(){return new le(J.from(this.node),0,0)}eq(e){return e instanceof Ne&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Jk(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ne(e.resolve(n.anchor))}static create(e,n){return new Ne(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Ne.prototype.visible=!1;Ve.jsonID("node",Ne);class Jk{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Cy(r,r):new Jk(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ne.isSelectable(r)?new Ne(n):Ve.near(n)}}class Wr extends Ve{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}
vendor: 4,243 bytes, line 499
499replace(e,n=le.empty){if(n==le.empty){e.delete(0,e.doc.content.size);let r=Ve.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Wr(e)}map(e){return new Wr(e)}eq(e){return e instanceof Wr}getBookmark(){return lJ}}Ve.jsonID("all",Wr);const lJ={map(){return this},resolve(t){return new Wr(t)}};function Dl(t,e,n,r,s,i=!1){if(e.inlineContent)return Me.create(t,n);for(let o=r-(s>0?0:1);s>0?o<e.childCount:o>=0;o+=s){let a=e.child(o);if(a.isAtom){if(!i&&Ne.isSelectable(a))return Ne.create(t,n-(s<0?a.nodeSize:0))}else{let c=Dl(t,a,n+s,s<0?a.childCount:0,s,i);if(c)return c}n+=a.nodeSize*s}return null}function xN(t,e,n){let r=t.steps.length-1;if(r<e)return;let s=t.steps[r];if(!(s instanceof gn||s instanceof vn))return;let i=t.mapping.maps[r],o;i.forEach((a,c,u,d)=>{o==null&&(o=d)}),t.setSelection(Ve.near(t.doc.resolve(o),n))}const bN=1,Vf=2,wN=4;class cJ extends cI{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|bN)&~Vf,this.storedMarks=null,this}get selectionSet(){return(this.updated&bN)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Vf,this}ensureMarks(e){return dt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Vf)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Vf,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||dt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(n);i=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(Ve.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=wN,this}get scrolledIntoView(){return(this.updated&wN)>0}}function kN(t,e){return!e||!t?t:t.bind(e)}class Qu{constructor(e,n,r){this.name=e,this.init=kN(n.init,r),this.apply=kN(n.apply,r)}}const uJ=[new Qu("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Qu("selection",{init(t,e){return t.selection||Ve.atStart(e.doc)},apply(t){return t.selection}}),new Qu("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Qu("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Yv{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=uJ.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 Qu(r.key,r.spec.state,r))})}}class Ql{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
vendor: 10,834 bytes, lines 499-500
499apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),s=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let c=s?s[o].n:0,u=s?s[o].state:this,d=c<n.length&&a.spec.appendTransaction.call(a,c?n.slice(c):n,u,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!s){s=[];for(let h=0;h<this.config.plugins.length;h++)s.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),i=!0}s&&(s[o]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ql(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let i=r[s];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new cJ(this)}static create(e){let n=new Yv(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ql(n);for(let s=0;s<n.fields.length;s++)r[n.fields[s].name]=n.fields[s].init(e,r);return r}reconfigure(e){let n=new Yv(this.schema,e.plugins),r=n.fields,s=new Ql(n);for(let i=0;i<r.length;i++){let o=r[i].name;s[o]=this.hasOwnProperty(o)?this[o]:r[i].init(e,s)}return s}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new Yv(e.schema,e.plugins),i=new Ql(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Lo.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=Ve.fromJSON(i.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],u=c.spec.state;if(c.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[o.name]=u.fromJSON.call(c,e,n[a],i);return}}i[o.name]=o.init(e,i)}}),i}}function uI(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=uI(s,e,{})),n[r]=s}return n}class It{constructor(e){this.spec=e,this.props={},e.props&&uI(e.props,this,this.props),this.key=e.key?e.key.key:dI("plugin")}getState(e){return e[this.key]}}const Jv=Object.create(null);function dI(t){return t in Jv?t+"$"+ ++Jv[t]:(Jv[t]=0,t+"$")}class dn{constructor(e="key"){this.key=dI(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const dJ=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function hI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const hJ=(t,e,n)=>{let r=hI(t,n);if(!r)return!1;let s=Qk(r);if(!s){let o=r.blockRange(),a=o&&cu(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let i=s.nodeBefore;if(gI(t,s,e,-1))return!0;if(r.parent.content.size==0&&(Hc(i,"end")||Ne.isSelectable(i)))for(let o=r.depth;;o--){let a=Sy(t.doc,r.before(o),r.after(o),le.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(Hc(i,"end")?Ve.findFrom(c.doc.resolve(c.mapping.map(s.pos,-1)),-1):Ne.create(c.doc,s.pos-i.nodeSize)),e(c.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},fJ=(t,e,n)=>{let r=hI(t,n);if(!r)return!1;let s=Qk(r);return s?fI(t,s,e):!1},pJ=(t,e,n)=>{let r=pI(t,n);if(!r)return!1;let s=Xk(r);return s?fI(t,s,e):!1};function fI(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let d=s.lastChild;if(!d)return!1;s=d}let o=e.nodeAfter,a=o,c=e.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let u=Sy(t.doc,i,c,le.empty);if(!u||u.from!=i||u instanceof gn&&u.slice.size>=c-i)return!1;if(n){let d=t.tr.step(u);d.setSelection(Me.create(d.doc,i)),n(d.scrollIntoView())}return!0}function Hc(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const mJ=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Qk(r)}let o=i&&i.nodeBefore;return!o||!Ne.isSelectable(o)?!1:(e&&e(t.tr.setSelection(Ne.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function Qk(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function pI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const gJ=(t,e,n)=>{let r=pI(t,n);if(!r)return!1;let s=Xk(r);if(!s)return!1;let i=s.nodeAfter;if(gI(t,s,e,1))return!0;if(r.parent.content.size==0&&(Hc(i,"start")||Ne.isSelectable(i))){let o=Sy(t.doc,r.before(),r.after(),le.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Hc(i,"start")?Ve.findFrom(a.doc.resolve(a.mapping.map(s.pos)),1):Ne.create(a.doc,a.mapping.map(s.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos,s.pos+i.nodeSize).scrollIntoView()),!0):!1},yJ=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Xk(r)}let o=i&&i.nodeAfter;return!o||!Ne.isSelectable(o)?!1:(e&&e(t.tr.setSelection(Ne.create(t.doc,i.pos)).scrollIntoView()),!0)};function Xk(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const vJ=(t,e)=>{let n=t.selection,r=n instanceof Ne,s;if(r){if(n.node.isTextblock||!sa(t.doc,n.from))return!1;s=n.from}else if(s=ky(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(Ne.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},xJ=(t,e)=>{let n=t.selection,r;if(n instanceof Ne){if(n.node.isTextblock||!sa(t.doc,n.to))return!1;r=n.to}else if(r=ky(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},bJ=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&cu(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},wJ=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` 500`).scrollIntoView()),!0)};function mI(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const kJ=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),o=mI(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let a=n.after(),c=t.tr.replaceWith(a,a,o.createAndFill());c.setSelection(Ve.near(c.doc.resolve(a),1)),e(c.scrollIntoView())}return!0},SJ=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof Wr||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=mI(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,a=t.tr.insert(o,i.createAndFill());a.setSelection(Me.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},CJ=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(lc(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&cu(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)},jJ=(t,e)=>{let{$from:n,to:r}=t.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),e&&e(t.tr.setSelection(Ne.create(t.doc,s))),!0)};function NJ(t,e,n){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(s.isTextblock||sa(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function gI(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,a,c=s.type.spec.isolating||i.type.spec.isolating;if(!c&&NJ(t,e,n))return!0;let u=!c&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,g=J.empty;for(let x=o.length-1;x>=0;x--)g=J.from(o[x].create(null,g));g=J.from(s.copy(g));let m=t.tr.step(new vn(e.pos-1,f,e.pos,f,new le(g,1,0),o.length,!0)),v=m.doc.resolve(f+2*o.length);v.nodeAfter&&v.nodeAfter.type==s.type&&sa(m.doc,v.pos)&&m.join(v.pos),n(m.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&c?null:Ve.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),p=h&&cu(h);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(h,p).scrollIntoView()),!0;if(u&&Hc(i,"start",!0)&&Hc(s,"end")){let f=s,g=[];for(;g.push(f),!f.isTextblock;)f=f.lastChild;let m=i,v=1;for(;!m.isTextblock;m=m.firstChild)v++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(n){let x=J.empty;for(let w=g.length-1;w>=0;w--)x=J.from(g[w].copy(x));let b=t.tr.step(new vn(e.pos-g.length,e.pos+i.nodeSize,e.pos+v,e.pos+i.nodeSize-v,new le(x,g.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function yI(t){return function(e,n){let r=e.selection,s=t<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(e.tr.setSelection(Me.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const _J=yI(-1),EJ=yI(1);function TJ(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),a=o&&Yk(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function SN(t,e=null){return function(n,r){let s=!1;for(let i=0;i<n.selection.ranges.length&&!s;i++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(o,a,(c,u)=>{if(s)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)s=!0;else{let d=n.doc.resolve(u),h=d.index();s=d.parent.canReplaceWith(h,h+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:c}}=n.selection.ranges[o];i.setBlockType(a,c,t,e)}
vendor: 4,849 bytes, line 500
500r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function RJ(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i);if(!o)return!1;let a=r?n.tr:null;return AJ(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function AJ(t,e,n,r=null){let s=!1,i=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=o.resolve(e.start-2);i=new Tm(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Tm(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let a=Yk(i,n,r,e);return a?(t&&OJ(t,e,a,s,n),!0):!1}function OJ(t,e,n,r,s){let i=J.empty;for(let d=n.length-1;d>=0;d--)i=J.from(n[d].type.create(n[d].attrs,i));t.step(new vn(e.start-(r?2:0),e.end,e.start,e.end,new le(i,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==s&&(o=d+1);let a=n.length-o,c=e.start+n.length-(r?2:0),u=e.parent;for(let d=e.startIndex,h=e.endIndex,p=!0;d<h;d++,p=!1)!p&&lc(t.doc,c,a)&&(t.split(c,a),c+=2*a),c+=u.child(d).nodeSize;return t}function PJ(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,o=>o.childCount>0&&o.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?MJ(e,n,t,i):IJ(e,n,i):!0:!1}}function MJ(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);i<o&&(s.step(new vn(i-1,o,i,o,new le(J.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Tm(s.doc.resolve(r.$from.pos),s.doc.resolve(o),r.depth));const a=cu(r);if(a==null)return!1;s.lift(r,a);let c=s.doc.resolve(s.mapping.map(i,-1)-1);return sa(s.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&s.join(c.pos),e(s.scrollIntoView()),!0}function IJ(t,e,n){let r=t.tr,s=n.parent;for(let f=n.end,g=n.endIndex-1,m=n.startIndex;g>m;g--)f-=s.child(g).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),o=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,c=n.endIndex==s.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(a?0:1),d+1,o.content.append(c?J.empty:J.from(s))))return!1;let h=i.pos,p=h+o.nodeSize;return r.step(new vn(h-(a?1:0),p+(c?1:0),h+1,p-1,new le((a?J.empty:J.from(s.copy(J.empty))).append(c?J.empty:J.from(s.copy(J.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function DJ(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,u=>u.childCount>0&&u.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let a=i.parent,c=a.child(o-1);if(c.type!=t)return!1;if(n){let u=c.lastChild&&c.lastChild.type==a.type,d=J.from(u?t.create():null),h=new le(J.from(t.create(null,J.from(a.type.create(null,d)))),u?3:1,0),p=i.start,f=i.end;n(e.tr.step(new vn(p-(u?3:1),f,p,f,h,1,!0)).scrollIntoView())}return!0}}const Tn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Wc=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let kw=null;const di=function(t,e,n){let r=kw||(kw=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},LJ=function(){kw=null},rl=function(t,e,n,r){return n&&(CN(t,e,n,r,-1)||CN(t,e,n,r,1))},$J=/^(img|br|input|textarea|hr)$/i;function CN(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Fr(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Yh(t)||$J.test(t.nodeName)||t.contentEditable=="false")return!1;e=Tn(t)+(s<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else t=o,e=s<0?Fr(t):0}else return!1}}function Fr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function BJ(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Fr(t)}else if(t.parentNode&&!Yh(t))e=Tn(t),t=t.parentNode;else return null}}function zJ(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Yh(t))e=Tn(t)+1,t=t.parentNode;else return null}}function FJ(t,e,n){for(let r=e==0,s=e==Fr(t);r||s;){if(t==n)return!0;let i=Tn(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,s=s&&i==Fr(t)}}function Yh(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const jy=function(t){return t.focusNode&&rl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ya(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function UJ(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function VJ(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);
vendor: 5,031 bytes, line 500
500if(r)return{node:r.offsetNode,offset:Math.min(Fr(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Fr(r.startContainer),r.startOffset)}}}const Qs=typeof navigator<"u"?navigator:null,jN=typeof document<"u"?document:null,ia=Qs&&Qs.userAgent||"",Sw=/Edge\/(\d+)/.exec(ia),vI=/MSIE \d/.exec(ia),Cw=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ia),fr=!!(vI||Cw||Sw),Bo=vI?document.documentMode:Cw?+Cw[1]:Sw?+Sw[1]:0,qr=!fr&&/gecko\/(\d+)/i.test(ia);qr&&+(/Firefox\/(\d+)/.exec(ia)||[0,0])[1];const jw=!fr&&/Chrome\/(\d+)/.exec(ia),An=!!jw,xI=jw?+jw[1]:0,Hn=!fr&&!!Qs&&/Apple Computer/.test(Qs.vendor),qc=Hn&&(/Mobile\/\w+/.test(ia)||!!Qs&&Qs.maxTouchPoints>2),Lr=qc||(Qs?/Mac/.test(Qs.platform):!1),bI=Qs?/Win/.test(Qs.platform):!1,gi=/Android \d/.test(ia),Jh=!!jN&&"webkitFontSmoothing"in jN.documentElement.style,HJ=Jh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function WJ(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function ri(t,e){return typeof t=="number"?t:t[e]}function qJ(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function NN(t,e,n){let r=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=Wc(o);continue}let a=o,c=a==i.body,u=c?WJ(i):qJ(a),d=0,h=0;if(e.top<u.top+ri(r,"top")?h=-(u.top-e.top+ri(s,"top")):e.bottom>u.bottom-ri(r,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+ri(s,"top")-u.top:e.bottom-u.bottom+ri(s,"bottom")),e.left<u.left+ri(r,"left")?d=-(u.left-e.left+ri(s,"left")):e.right>u.right-ri(r,"right")&&(d=e.right-u.right+ri(s,"right")),d||h)if(c)i.defaultView.scrollBy(d,h);else{let f=a.scrollLeft,g=a.scrollTop;h&&(a.scrollTop+=h),d&&(a.scrollLeft+=d);let m=a.scrollLeft-f,v=a.scrollTop-g;e={left:e.left-m,top:e.top-v,right:e.right-m,bottom:e.bottom-v}}let p=c?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(p))break;o=p=="absolute"?o.offsetParent:Wc(o)}}function KJ(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(i,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=n-20){r=a,s=c.top;break}}return{refDOM:r,refTop:s,stack:wI(t.dom)}}function wI(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Wc(r));return e}function GJ({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;kI(n,r==0?0:r-e)}function kI(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:s,left:i}=t[n];r.scrollTop!=s+e&&(r.scrollTop=s+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let El=null;function YJ(t){if(t.setActive)return t.setActive();if(El)return t.focus(El);let e=wI(t);t.focus(El==null?{get preventScroll(){return El={preventScroll:!0},!0}}:void 0),El||(El=!1,kI(e,0))}function SI(t,e){let n,r=2e8,s,i=0,o=e.top,a=e.top,c,u;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=di(d).getClientRects();else continue;for(let f=0;f<p.length;f++){let g=p[f];if(g.top<=o&&g.bottom>=a){o=Math.max(g.bottom,o),a=Math.min(g.top,a);let m=g.left>e.left?g.left-e.left:g.right<e.left?e.left-g.right:0;if(m<r){n=d,r=m,s=m&&n.nodeType==3?{left:g.right<e.left?g.right:g.left,top:e.top}:e,d.nodeType==1&&m&&(i=h+(e.left>=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!c&&g.left<=e.left&&g.right>=e.left&&(c=d,u={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!n&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(i=h+1)}}return!n&&c&&(n=c,s=u,r=0),n&&n.nodeType==3?JJ(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:SI(n,s)}function JJ(t,e){let n=t.nodeValue.length,r=document.createRange(),s;for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=Gi(r,1);if(o.top!=o.bottom&&Zk(e,o)){s={node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:t,offset:0}}function Zk(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function QJ(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function XJ(t,e,n){let{node:r,offset:s}=SI(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();i=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,s,i)}function ZJ(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),c;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((c=a.dom.getBoundingClientRect()).width||c.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&c.left>r.left||c.top>
vendor: 8,852 bytes, line 500
500r.top?s=a.posBefore:(!o&&c.right<r.left||c.bottom<r.top)&&(s=a.posAfter),o=!0),!a.contentDOM&&s<0&&!a.node.isText))return(a.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return s>-1?s:t.docView.posFromDOM(e,n,-1)}function CI(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let o=t.childNodes[i];if(o.nodeType==1){let a=o.getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(Zk(e,u))return CI(o,e,u)}}if((i=(i+1)%r)==s)break}return t}function eQ(t,e){let n=t.dom.ownerDocument,r,s=0,i=VJ(n,e.left,e.top);i&&({node:r,offset:s}=i);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!Zk(e,u)||(o=CI(t.dom,e,u),!o))return null}if(Hn)for(let u=o;r&&u;u=Wc(u))u.draggable&&(r=void 0);if(o=QJ(o,e),r){if(qr&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let d=r.childNodes[s],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&s++}let u;Jh&&s&&r.nodeType==1&&(u=r.childNodes[s-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&s--,r==t.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(a=ZJ(t,r,s,e))}a==null&&(a=XJ(t,o,e));let c=t.docView.nearestDesc(o,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function _N(t){return t.top<t.bottom||t.left<t.right}function Gi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(_N(r))return r}return Array.prototype.find.call(n,_N)||t.getBoundingClientRect()}const tQ=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function jI(t,e,n){let{node:r,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),o=Jh||qr;if(r.nodeType==3)if(o&&(tQ.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let c=Gi(di(r,s,s),n);if(qr&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let u=Gi(di(r,s-1,s-1),-1);if(u.top==c.top){let d=Gi(di(r,s,s+1),-1);if(d.top!=c.top)return Iu(d,d.left<u.left)}}return c}else{let c=s,u=s,d=n<0?1:-1;return n<0&&!s?(u++,d=-1):n>=0&&s==r.nodeValue.length?(c--,d=1):n<0?c--:u++,Iu(Gi(di(r,c,u),d),d<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Fr(r))){let c=r.childNodes[s-1];if(c.nodeType==1)return Qv(c.getBoundingClientRect(),!1)}if(i==null&&s<Fr(r)){let c=r.childNodes[s];if(c.nodeType==1)return Qv(c.getBoundingClientRect(),!0)}return Qv(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==Fr(r))){let c=r.childNodes[s-1],u=c.nodeType==3?di(c,Fr(c)-(o?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return Iu(Gi(u,1),!1)}if(i==null&&s<Fr(r)){let c=r.childNodes[s];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let u=c?c.nodeType==3?di(c,0,o?0:1):c.nodeType==1?c:null:null;if(u)return Iu(Gi(u,-1),!0)}return Iu(Gi(r.nodeType==3?di(r):r,-n),n>=0)}function Iu(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Qv(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function NI(t,e,n){let r=t.state,s=t.root.activeElement;r!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),s!=t.dom&&s&&s.focus()}}function nQ(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return NI(t,e,()=>{let{node:i}=t.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let o=jI(t,s.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=di(a,0,a.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"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const rQ=/[\u0590-\u08ac]/;function sQ(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,a=t.domSelection();return a?!rQ.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:o:NI(t,e,()=>{let{focusNode:c,focusOffset:u,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:g,focusOffset:m}=t.domSelectionRange(),v=g&&!f.contains(g.nodeType==1?g:g.parentNode)||c==g&&u==m;try{a.collapse(d,h),c&&(c!=d||u!=h)&&a.extend&&a.extend(c,u)}catch{}return p!=null&&(a.caretBidiLevel=p),v}):r.pos==r.start()||r.pos==r.end()}let EN=null,TN=null,RN=!1;function iQ(t,e,n){return EN==e&&TN==n?RN:(EN=e,TN=n,RN=n=="up"||n=="down"?nQ(t,e,n):sQ(t,e,n))}const Kr=0,AN=1,Sa=2,Xs=3;class Qh{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=Kr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let s=this.children[n];if(s==e)return r;r+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,o;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let s;if(e==this.dom&&this.contentDOM)s=n>Tn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!n||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],i=r+s.size;if(r==e&&i!=r){for(;!s.border&&s.children.length;)for(let o=0;o<s.children.length;o++){let a=s.children[o];if(a.size){s=a;break}}return s}if(e<i)return s.descAt(e-r-s.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,s=0;for(let i=0;r<this.children.length;r++){let o=this.children[r],a=i+o.size;if(a>e||o instanceof EI){s=e-i;break}i=a}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof _I&&i.side>=0;r--);if(n<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&n&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Tn(i.dom)+1:0}}else{let i,o=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Tn(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,i=-1;for(let o=r,a=0;;a++){let c=this.children[a],u=o+c.size;if(s==-1&&e<=u){let d=o+c.border;if(e>=d&&n<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,d);e=o;for(let h=a;h>0;h--){let p=this.children[h-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){s=Tn(
vendor: 5,732 bytes, lines 500-501
500p.dom)+1;break}e-=p.size}s==-1&&(s=0)}if(s>-1&&(u>n||a==this.children.length-1)){n=u;for(let d=a+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=Tn(h.dom);break}n+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:s,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,s=!1){let i=Math.min(e,n),o=Math.max(e,n);for(let f=0,g=0;f<this.children.length;f++){let m=this.children[f],v=g+m.size;if(i>g&&o<v)return m.setSelection(e-g-m.border,n-g-m.border,r,s);g=v}let a=this.domFromPos(e,e?-1:1),c=n==e?a:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),d=r.domSelectionRange(),h=!1;if((qr||Hn)&&e==n){let{node:f,offset:g}=a;if(f.nodeType==3){if(h=!!(g&&f.nodeValue[g-1]==` 501`),h&&g==f.nodeValue.length)for(let m=f,v;m;m=m.parentNode){if(v=m.nextSibling){v.nodeName=="BR"&&(a=c={node:v.parentNode,offset:Tn(v)+1});break}let x=m.pmViewDesc;if(x&&x.node&&x.node.isBlock)break}}else{let m=f.childNodes[g-1];h=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(qr&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let f=d.focusNode.childNodes[d.focusOffset];f&&f.contentEditable=="false"&&(s=!0)}if(!(s||h&&Hn)&&rl(a.node,a.offset,d.anchorNode,d.anchorOffset)&&rl(c.node,c.offset,d.focusNode,d.focusOffset))return;let p=!1;if((u.extend||e==n)&&!(h&&qr)){u.collapse(a.node,a.offset);try{e!=n&&u.extend(c.node,c.offset),p=!0}catch{}}if(!p){if(e>n){let g=a;a=c,c=g}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,s=0;s<this.children.length;s++){let i=this.children[s],o=r+i.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+i.border,c=o-i.border;if(e>=a&&n<=c){this.dirty=e==r||n==o?Sa:AN,e==a&&n==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Xs:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Sa:Xs}r=o}this.dirty=Sa}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Sa:AN;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class _I extends Qh{constructor(e,n,r,s){let i,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==Kr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class oQ extends Qh{constructor(e,n,r,s){super(e,[],n,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class sl extends Qh{constructor(e,n,r,s,i){super(e,[],r,s),this.mark=n,this.spec=i}static create(e,n,r,s){let i=s.nodeViews[n.type.name],o=i&&i(n,s,r);return(!o||!o.dom)&&(o=dl.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new sl(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Xs||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Xs&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Kr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Kr}}slice(e,n,r){let s=sl.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;n<o&&(i=_w(i,n,o,r)),e>0&&(i=_w(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=s;return s.children=i,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class zo extends Qh{constructor(e,n,r,s,i,o,a,c,u){super(e,[],i,o),this.node=n,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=a}static create(e,n,r,s,i,o){let a=i.nodeViews[n.type.name],c,u=a&&a(n,i,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,s),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}=dl.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 p=d;return d=AI(d,r,n),u?c=new aQ(e,n,r,s,d,h||null,p,u,i,o+1):n.isText?new Ny(e,n,r,s,d,p,i):new zo(e,n,r,s,d,h||null,p,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;
vendor: 5,107 bytes, line 501
501let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>J.empty)}return e}matchesNode(e,n,r){return this.dirty==Kr&&e.eq(this.node)&&Am(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,a=i&&i.pos<0,c=new cQ(this,o&&o.node,e);hQ(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?c.syncToMarks(u.spec.marks,r,e,d):u.type.side>=0&&!h&&c.syncToMarks(d==this.node.childCount?dt.none:this.node.child(d).marks,r,e,d),c.placeWidget(u,e,s)},(u,d,h,p)=>{c.syncToMarks(u.marks,r,e,p);let f;c.findNodeMatch(u,d,h,p)||a&&e.state.selection.from>s&&e.state.selection.to<s+u.nodeSize&&(f=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(u,d,h,f,e)||c.updateNextNode(u,d,h,e,p,s)||c.addNode(u,d,h,e,s),s+=u.nodeSize}),c.syncToMarks([],r,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Sa)&&(o&&this.protectLocalComposition(e,o),TI(this.contentDOM,this.children,e),qc&&fQ(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof Me)||r<n||s>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,a=pQ(this.node.content,o,r-n,s-n);return a<0?null:{node:i,pos:a,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new oQ(this,i,n,s);e.input.compositionNodes.push(o),this.children=_w(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==Xs||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,s),!0)}updateInner(e,n,r,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=Kr}updateOuterDeco(e){if(Am(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=RI(this.dom,this.nodeDOM,Nw(this.outerDeco,this.node,n),Nw(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ON(t,e,n,r,s){AI(r,e,t);let i=new zo(void 0,t,e,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class Ny extends zo{constructor(e,n,r,s,i,o,a){super(e,n,r,s,i,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,s){return this.dirty==Xs||this.dirty!=Kr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Kr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=Kr,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new Ny(this.parent,s,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Xs)}get domAtom(){return!1}isText(e){return this.node.text==e}}class EI extends Qh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Kr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class aQ extends zo{constructor(e,n,r,s,i,o,a,c,u,d){super(e,n,r,s,i,o,a,u,d),this.spec=c}update(e,n,r,s){if(this.dirty==Xs)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}
vendor: 7,683 bytes, line 501
501setSelection(e,n,r,s){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function TI(t,e,n){let r=t.firstChild,s=!1;for(let i=0;i<e.length;i++){let o=e[i],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=PN(r),s=!0;r=r.nextSibling}else s=!0,t.insertBefore(a,r);if(o instanceof sl){let c=r?r.previousSibling:t.lastChild;TI(o.contentDOM,o.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=PN(r),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const yd=function(t){t&&(this.nodeName=t)};yd.prototype=Object.create(null);const Ca=[new yd];function Nw(t,e,n){if(t.length==0)return Ca;let r=n?Ca[0]:new yd,s=[r];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&s.push(r=new yd(o.nodeName));for(let a in o){let c=o[a];c!=null&&(n&&s.length==1&&s.push(r=new yd(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+c:a=="style"?r.style=(r.style?r.style+";":"")+c:a!="nodeName"&&(r[a]=c))}}}return s}function RI(t,e,n,r){if(n==Ca&&r==Ca)return e;let s=e;for(let i=0;i<r.length;i++){let o=r[i],a=n[i];if(i){let c;a&&a.nodeName==o.nodeName&&s!=t&&(c=s.parentNode)&&c.nodeName.toLowerCase()==o.nodeName||(c=document.createElement(o.nodeName),c.pmIsDeco=!0,c.appendChild(s),a=Ca[0]),s=c}lQ(s,a||Ca[0],o)}return s}function lQ(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)s.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<s.length;i++)r.indexOf(s[i])==-1&&t.classList.add(s[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(e.style);)t.style.removeProperty(s[1])}n.style&&(t.style.cssText+=n.style)}}function AI(t,e,n){return RI(t,t,Ca,Nw(e,n,t.nodeType!=1))}function Am(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function PN(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class cQ{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=uQ(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,s){let i=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Kr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let c=-1,u=this.top.children.length;s<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(e[o])&&!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=sl.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=this.top.children.indexOf(o,this.index);else for(let a=this.index,c=Math.min(this.top.children.length,a+5);a<c;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,s,i){let o=this.top.children[s];return o.dirty==Xs&&o.dom==o.contentDOM&&(o.dirty=Sa),o.update(e,n,r,i)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}e=n}}updateNextNode(e,n,r,s,i,o){for(let a=this.index;a<this.top.children.length;a++){let c=this.top.children[a];if(c instanceof zo){let u=this.preMatch.matched.get(c);if(u!=null&&u!=i)return!1;let d=c.dom,h,p=this.isLocked(d)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Xs&&Am(n,c.outerDeco));if(!p&&c.update(e,n,r,s))return this.destroyBetween(this.index,a),c.dom!=d&&(this.changed=!0),this.index++,!0;if(!p&&(h=this.recreateWrapper(c,e,n,r,s,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Sa,h.updateChildren(s,o+1),h.dirty=Kr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,s,i,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Am(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let a=zo.create(this.top,n,r,s,i,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let c of a.children)c.parent=a}return e.destroy(),a}addNode(e,n,r,s,i){let o=zo.create(this.top,e,n,r,s,i);o.contentDOM&&o.updateChildren(s,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(e)&&(e==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let i=new _I(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof sl;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ny)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Hn||An)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new EI(this.top,[],r,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function uQ(t,e){let n=e,r=n.children.length,s=t.childCount,i=new Map,o=[];e:for(;s>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof sl)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=t.child(s-1))break;--s,i.set(a,s),o.push(a)}}return{index:s,matched:i,matches:o.reverse()}}function dQ(t,e){return t.type.side-e.type.side}function hQ(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let u=0;u<t.childCount;u++){let d=t.child(u);r(d,s,e.forChild(i,d),u),i+=d.nodeSize}return}let o=0,a=[],c=null;for(let u=0;;){let d,h;for(;o<s.length&&s[o].to==i;){let v=s[o++];v.widget&&(d?(h||(h=[d])).push(v):d=v)}if(d)if(h){h.sort(dQ);for(let v=0;v<h.length;v++)n(h[v],u,!!c)}else n(d,u,!!c);let p,f;if(c)f=-1,p=c,c=null;else if(u<t.childCount)f=u,p=t.child(u++);else break;for(let v=0;v<a.length;v++)a[v].to<=i&&a.splice(v--,1);for(;o<s.length&&s[o].from<=i&&s[o].to>i;)a.push(s[o++]);let g=i+p.nodeSize;if(p.isText){let v=g;o<s.length&&s[o].from<v&&(v=s[o].from);for(let x=0;x<a.length;
vendor: 9,750 bytes, line 501
501x++)a[x].to<v&&(v=a[x].to);v<g&&(c=p.cut(v-i),p=p.cut(0,v-i),g=v,f=-1)}else for(;o<s.length&&s[o].to<g;)o++;let m=p.isInline&&!p.isLeaf?a.filter(v=>!v.inline):a.slice();r(p,m,e.forChild(i,p),f),i=g}}function fQ(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function pQ(t,e,n,r){for(let s=0,i=0;s<t.childCount&&i<=r;){let o=t.child(s++),a=i;if(i+=o.nodeSize,!o.isText)continue;let c=o.text;for(;s<t.childCount;){let u=t.child(s++);if(i+=u.nodeSize,!u.isText)break;c+=u.text}if(i>=n){if(i>=r&&c.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?c.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&c.length>=r+e.length-a&&c.slice(r-a,r-a+e.length)==e)return r}}return-1}function _w(t,e,n,r,s){let i=[];for(let o=0,a=0;o<t.length;o++){let c=t[o],u=a,d=a+=c.size;u>=n||d<=e?i.push(c):(u<e&&i.push(c.slice(0,e-u,r)),s&&(i.push(s),s=void 0),d>n&&i.push(c.slice(n-u,c.size,r)))}return i}function eS(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),c,u;if(jy(n)){for(c=o;s&&!s.node;)s=s.parent;let h=s.node;if(s&&h.isAtom&&Ne.isSelectable(h)&&s.parent&&!(h.isInline&&FJ(n.focusNode,n.focusOffset,s.dom))){let p=s.posBefore;u=new Ne(o==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,p=o;for(let f=0;f<n.rangeCount;f++){let g=n.getRangeAt(f);h=Math.min(h,t.docView.posFromDOM(g.startContainer,g.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(h<0)return null;[c,o]=p==t.state.selection.anchor?[p,h]:[h,p],a=r.resolve(o)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let d=r.resolve(c);if(!u){let h=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;u=tS(t,d,a,h)}return u}function OI(t){return t.editable?t.hasFocus():MI(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function xi(t,e=!1){let n=t.state.selection;if(PI(t,n),!!OI(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&An){let r=t.domSelectionRange(),s=t.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&rl(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)gQ(t);else{let{anchor:r,head:s}=n,i,o;MN&&!(n instanceof Me)&&(n.$from.parent.inlineContent||(i=IN(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=IN(t,n.to))),t.docView.setSelection(r,s,t,e),MN&&(i&&DN(i),o&&DN(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&mQ(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const MN=Hn||An&&xI<63;function IN(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),s=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Hn&&s&&s.contentEditable=="false")return Xv(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return Xv(s);if(i)return Xv(i)}}function Xv(t){return t.contentEditable="true",Hn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function DN(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function mQ(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,s=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!OI(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function gQ(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Tn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&fr&&Bo<=11&&(n.disabled=!0,n.disabled=!1)}function PI(t,e){if(e instanceof Ne){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(LN(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else LN(t)}function LN(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function tS(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||Me.between(e,n,r)}function $N(t){return t.editable&&!t.hasFocus()?!1:MI(t)}function MI(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function yQ(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return rl(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ew(t,e){let{$anchor:n,$head:r}=t.selection,s=e>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&Ve.findFrom(i,e)}function Xi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function BN(t,e,n){let r=t.state.selection;if(r instanceof Me)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return Xi(t,new Me(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=Ew(t.state,e);return s&&s instanceof Ne?Xi(t,s):!1}else if(!(Lr&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let a=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?Ne.isSelectable(i)?Xi(t,new Ne(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):Jh?Xi(t,new Me(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ne&&r.node.isInline)return Xi(t,new Me(e>0?r.$to:r.$from));{let s=Ew(t.state,e);return s?Xi(t,s):!1}}}function Om(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vd(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Tl(t,e){return e<0?vQ(t):xQ(t)}function vQ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(qr&&n.nodeType==1&&r<Om(n)&&vd(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(vd(a,-1))s=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(II(n))break;{let a=n.previousSibling;for(;a&&vd(a,-1);)s=n.parentNode,i=Tn(a),a=a.previousSibling;if(a)n=a,r=Om(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Tw(t,n,r):s&&Tw(t,s,i)}function xQ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=Om(n),i,o;for(;;)if(r<s){if(n.nodeType!=1)break;let a=n.childNodes[r];if(vd(a,1))i=n,o=++r;else break}else{if(II(n))break;{let a=n.nextSibling;for(;a&&vd(a,1);)i=a.parentNode,o=Tn(a)+1,a=a.nextSibling;if(a)n=a,r=0,s=Om(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}i&&Tw(t,i,o)}function II(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function bQ(t,e){for(;t&&e==t.childNodes.length&&!Yh(t);)e=Tn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function wQ(t,e){for(;t&&!e&&!Yh(t);)e=Tn(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Tw(t,e,n){if(e.nodeType!=3){let i,o;(o=bQ(e,n))?(e=o,n=0):(i=wQ(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(jy(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:s}=t;setTimeout(()=>{t.state==s&&xi(t)},50)}function zN(t,e){let n=t.state.doc.resolve(e);if(!(An||bI)&&n.parent.inlineContent){let s=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left<s.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>s.top&&o<s.bottom&&Math.abs(i.left-s.left)>1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function FN(t,e,n){let r=t.state.selection;if(r instanceof Me&&!r.empty||n.indexOf("s")>-1||Lr&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Ew(t.state,e);if(o&&o instanceof Ne)return Xi(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,a=r instanceof Wr?Ve.near(o,e):Ve.findFrom(o,e);return a?Xi(t,a):!1}return!1}function UN(t,e){if(!(t.state.selection instanceof Me))return!0;let{$head:n,$anchor:r,empty:s}=t.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(n.pos-i.nodeSize,n.pos):o.delete(n.pos,n.pos+i.nodeSize),t.dispatch(o),!0}return!1}function VN(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function kQ(t){if(!Hn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;VN(t,r,"true"),setTimeout(()=>VN(t,r,"false"),20)}return!1}function SQ(t){let e="";
vendor: 4,151 bytes, lines 501-504
501return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function CQ(t,e){let n=e.keyCode,r=SQ(e);if(n==8||Lr&&n==72&&r=="c")return UN(t,-1)||Tl(t,-1);if(n==46&&!e.shiftKey||Lr&&n==68&&r=="c")return UN(t,1)||Tl(t,1);if(n==13||n==27)return!0;if(n==37||Lr&&n==66&&r=="c"){let s=n==37?zN(t,t.state.selection.from)=="ltr"?-1:1:-1;return BN(t,s,r)||Tl(t,s)}else if(n==39||Lr&&n==70&&r=="c"){let s=n==39?zN(t,t.state.selection.from)=="ltr"?1:-1:1;return BN(t,s,r)||Tl(t,s)}else{if(n==38||Lr&&n==80&&r=="c")return FN(t,-1,r)||Tl(t,-1);if(n==40||Lr&&n==78&&r=="c")return kQ(t)||FN(t,1,r)||Tl(t,1);if(r==(Lr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function nS(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let o=t.someProp("clipboardSerializer")||dl.fromSchema(t.state.schema),a=FI(),c=a.createElement("div");c.appendChild(o.serializeFragment(r,{document:a}));let u=c.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=zI[u.nodeName.toLowerCase()]);){for(let f=d.length-1;f>=0;f--){let g=a.createElement(d[f]);for(;c.firstChild;)g.appendChild(c.firstChild);c.appendChild(g),h++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${s} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,` 502 503`);return{dom:c,text:p,slice:e}}function DI(t,e,n,r,s){let i=s.parent.type.spec.code,o,a;if(!n&&!e)return null;let c=!!e&&(r||i||!n);if(c){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return a=new le(J.from(t.state.schema.text(e.replace(/\r\n?/g,` 504`))),0,0),t.someProp("transformPasted",p=>{a=p(a,t,!0)}),a;let h=t.someProp("clipboardTextParser",p=>p(e,s,r,t));if(h)a=h;else{let p=s.marks(),{schema:f}=t.state,g=dl.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let v=o.appendChild(document.createElement("p"));m&&v.appendChild(g.serializeNode(f.text(m,p)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=EQ(n),Jh&&TQ(o);let u=o&&o.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 p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||$o.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||d),context:s,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!jQ.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)a=RQ(HN(a,+d[1],+d[2]),d[4]);else if(a=le.maxOpen(NQ(a.content,s),!0),a.openStart||a.openEnd){let h=0,p=0;for(let f=a.content.firstChild;h<a.openStart&&!f.type.spec.isolating;h++,f=f.firstChild);for(let f=a.content.lastChild;p<a.openEnd&&!f.type.spec.isolating;p++,f=f.lastChild);a=HN(a,h,p)}return t.someProp("transformPasted",h=>{a=h(a,t,c)}),a}const jQ=/^(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 NQ(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(a=>{if(!o)return;let c=s.findWrapping(a.type),u;if(!c)return o=null;if(u=o.length&&i.length&&$I(c,i,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=BI(o[o.length-1],i.length));let d=LI(a,c);o.push(d),s=s.matchType(d.type),i=c}}),o)return J.from(o)}return t}function LI(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,J.from(t));return t}function $I(t,e,n,r,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=$I(t,e,n,r.lastChild,s+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(s==t.length-1?n.type:t[s+1]))return r.copy(r.content.append(J.from(LI(n,t,s+1))))}}function BI(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,BI(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(J.empty,!0);return t.copy(n.append(r))}
vendor: 4,774 bytes, line 504
504function Rw(t,e,n,r,s,i){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(i=0),s<r-1&&(a=Rw(a,e,n,r,s+1,i)),s>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,i<=s).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(J.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function HN(t,e,n){return e<t.openStart&&(t=new le(Rw(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new le(Rw(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const zI={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 WN=null;function FI(){return WN||(WN=document.implementation.createHTMLDocument("title"))}let Zv=null;function _Q(t){let e=window.trustedTypes;return e?(Zv||(Zv=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Zv.createHTML(t)):t}function EQ(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=FI().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),s;if((s=r&&zI[r[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=_Q(t),s)for(let i=0;i<s.length;i++)n=n.querySelector(s[i])||n;return n}function TQ(t){let e=t.querySelectorAll(An?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="Â "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function RQ(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:s,openStart:i,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let c=n.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;s=J.from(c.create(r[a+1],s)),i++,o++}return new le(s,i,o)}const Zn={},er={},AQ={touchstart:!0,touchmove:!0};class OQ{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 PQ(t){for(let e in Zn){let n=Zn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{IQ(t,r)&&!rS(t,r)&&(t.editable||!(r.type in er))&&n(t,r)},AQ[e]?{passive:!0}:void 0)}Hn&&t.dom.addEventListener("input",()=>null),Aw(t)}function Co(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function MQ(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Aw(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>rS(t,r))})}function rS(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function IQ(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function DQ(t,e){!rS(t,e)&&Zn[e.type]&&(t.editable||!(e.type in er))&&Zn[e.type](t,e)}er.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!VI(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(gi&&An&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),qc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",s=>s(t,ya(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||CQ(t,n)?n.preventDefault():Co(t,"key")};er.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};er.keypress=(t,e)=>{let n=e;if(VI(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Lr&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Me)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,s,i))&&t.dispatch(i()),n.preventDefault()}};function _y(t){return{left:t.clientX,top:t.clientY}}function LQ(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}
vendor: 21,003 bytes, line 504
504function sS(t,e,n,r,s){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,a=>o>i.depth?a(t,n,i.nodeAfter,i.before(o),s,!0):a(t,n,i.node(o),i.before(o),s,!1)))return!0;return!1}function uc(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function $Q(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ne.isSelectable(r)?(uc(t,new Ne(n)),!0):!1}function BQ(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof Ne&&(r=n.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o);if(Ne.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(o);break}}return s!=null?(uc(t,Ne.create(t.state.doc,s)),!0):!1}function zQ(t,e,n,r,s){return sS(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?BQ(t,n):$Q(t,n))}function FQ(t,e,n,r){return sS(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function UQ(t,e,n,r){return sS(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||VQ(t,n,r)}function VQ(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(uc(t,Me.create(r,0,r.content.size)),!0):!1;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),a=s.before(i);if(o.inlineContent)uc(t,Me.create(r,a+1,a+1+o.content.size));else if(Ne.isSelectable(o))uc(t,Ne.create(r,a));else continue;return!0}}function iS(t){return Pm(t)}const UI=Lr?"metaKey":"ctrlKey";Zn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=iS(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&LQ(n,t.input.lastClick)&&!n[UI]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button};let o=t.posAtCoords(_y(n));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new HQ(t,o,n,!!r)):(i=="doubleClick"?FQ:UQ)(t,o.pos,o.inside,n)?n.preventDefault():Co(t,"pointer"))};class HQ{constructor(e,n,r,s){this.view=e,this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[UI],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);i=d.parent,o=d.depth?d.before():0}const a=s?null:r.target,c=a?e.docView.nearestDesc(a,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||u instanceof Ne&&u.from<=o&&u.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&qr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Co(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>xi(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(_y(e))),this.updateAllowDefault(e),this.allowDefault||!n?Co(this.view,"pointer"):zQ(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Hn&&this.mightDrag&&!this.mightDrag.node.isAtom||An&&!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)?(uc(this.view,Ve.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Co(this.view,"pointer")}move(e){this.updateAllowDefault(e),Co(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Zn.touchstart=t=>{t.input.lastTouch=Date.now(),iS(t),Co(t,"pointer")};Zn.touchmove=t=>{t.input.lastTouch=Date.now(),Co(t,"pointer")};Zn.contextmenu=t=>iS(t);function VI(t,e){return t.composing?!0:Hn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const WQ=gi?5e3:-1;er.compositionstart=er.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Me&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||An&&bI&&qQ(t)))t.markCursor=t.state.storedMarks||n.marks(),Pm(t,!0),t.markCursor=null;else if(Pm(t,!e.selection.empty),qr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}t.input.composing=!0}HI(t,WQ)};function qQ(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}er.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,HI(t,20))};function HI(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Pm(t),e))}function WI(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=GQ());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function KQ(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=BJ(e.focusNode,e.focusOffset),r=zJ(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function GQ(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Pm(t,e=!1){if(!(gi&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),WI(t),e||t.docView&&t.docView.dirty){let n=eS(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function YQ(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const xh=fr&&Bo<15||qc&&HJ<604;Zn.copy=er.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=xh?null:n.clipboardData,o=r.content(),{dom:a,text:c}=nS(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",c)):YQ(t,a),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function JQ(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function QQ(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?bh(t,r.value,null,s,e):bh(t,r.textContent,r.innerHTML,s,e)},50)}function bh(t,e,n,r,s){let i=DI(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,s,i||le.empty)))return!0;if(!i)return!1;let o=JQ(i),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function qI(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}er.paste=(t,e)=>{let n=e;if(t.composing&&!gi)return;let r=xh?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&bh(t,qI(r),r.getData("text/html"),s,n)?n.preventDefault():QQ(t,n)};class KI{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const XQ=Lr?"altKey":"ctrlKey";function GI(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[XQ]}Zn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=t.state.selection,i=s.empty?null:t.posAtCoords(_y(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof Ne?s.to-1:s.to))){if(r&&r.mightDrag)o=Ne.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=Ne.create(t.state.doc,h.posBefore))}}let a=(o||t.state.selection).content(),{dom:c,text:u,slice:d}=nS(t,a);(!n.dataTransfer.files.length||!An||xI>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(xh?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",xh||n.dataTransfer.setData("text/plain",u),t.dragging=new KI(d,GI(t,n),o)};Zn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};er.dragover=er.dragenter=(t,e)=>e.preventDefault();er.drop=(t,e)=>{try{ZQ(t,e,t.dragging)}finally{t.dragging=null}};function ZQ(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(_y(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",f=>{i=f(i,t,!1)}):i=DI(t,qI(e.dataTransfer),xh?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&GI(t,e));if(t.someProp("handleDrop",f=>f(t,e,i||le.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let a=i?sI(t.state.doc,s.pos,i):s.pos;a==null&&(a=s.pos);let c=t.state.tr;if(o){let{node:f}=n;f?f.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=c.doc;if(d?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),c.doc.eq(h))return;let p=c.doc.resolve(u);if(d&&Ne.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new Ne(p));else{let f=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((g,m,v,x)=>f=x),c.setSelection(tS(t,p,c.doc.resolve(f)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}Zn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&xi(t)},20))};Zn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Zn.beforeinput=(t,e)=>{if(An&&gi&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,ya(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in er)Zn[t]=er[t];function wh(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Mm{constructor(e,n){this.toDOM=e,this.spec=n||za,this.side=this.spec.side||0}map(e,n,r,s){let{pos:i,deleted:o}=e.mapResult(n.from+s,this.side<0?-1:1);return o?null:new Qn(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Mm&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&wh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Fo{constructor(e,n){this.attrs=e,this.spec=n||za}map(e,n,r,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new Qn(i,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Fo&&wh(this.attrs,e.attrs)&&wh(this.spec,e.spec)}static is(e){return e.type instanceof Fo}destroy(){}}class oS{constructor(e,n){this.attrs=e,this.spec=n||za}map(e,n,r,s){let i=e.mapResult(n.from+s,1);if(i.deleted)return null;let o=e.mapResult(n.to+s,-1);return o.deleted||o.pos<=i.pos?null:new Qn(i.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:s}=e.content.findIndex(n.from),i;return s==n.from&&!(i=e.child(r)).isText&&s+i.nodeSize==n.to}eq(e){return this==e||e instanceof oS&&wh(this.attrs,e.attrs)&&wh(this.spec,e.spec)}destroy(){}}class Qn{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Qn(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Qn(e,e,new Mm(n,r))}static inline(e,n,r,s){return new Qn(e,n,new Fo(r,s))}static node(e,n,r,s){return new Qn(e,n,new oS(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fo}get widget(){return this.type instanceof Mm}}const Ll=[],za={};class Rt{constructor(e,n){this.local=e.length?e:Ll,this.children=n.length?n:Ll}static create(e,n){return n.length?Im(n,e,0,za):Fn}find(e,n,r){let s=[];return this.findInner(e??0,n??1e9,s,0,r),s}findInner(e,n,r,s,i){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+s,a.to+s))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,s+a,i)}}map(e,n,r){return this==Fn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||za)}mapInner(e,n,r,s,i){let o;for(let a=0;a<this.local.length;a++){let c=this.local[a].map(e,r,s);c&&c.type.valid(n,c)?(o||(o=[])).push(c):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?eX(this.children,o||[],e,n,r,s,i):o?new Rt(o.sort(Fa),Ll):Fn}add(e,n){return n.length?this==Fn?Rt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let s,i=0;e.forEach((a,c)=>{let u=c+r,d;if(d=JI(n,a,u)){for(s||(s=this.children.slice());i<s.length&&s[i]<c;)i+=3;s[i]==c?s[i+2]=s[i+2].addInner(a,d,u+1):s.splice(i,0,c,c+a.nodeSize,Im(d,a,u+1,za)),i+=3}});let o=YI(i?QI(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new Rt(o.length?this.local.concat(o).sort(Fa):this.local,s||this.children)}remove(e){return e.length==0||this==Fn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,s=this.local;for(let i=0;i<r.length;i+=3){let o,a=r[i]+n,c=r[i+1]+n;for(let d=0,h;d<e.length;d++)(h=e[d])&&h.from>a&&h.to<c&&(e[d]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[i+2].removeInner(o,a+1);u!=Fn?r[i+2]=u:(r.splice(i,3),i-=3)}if(s.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let a=0;a<s.length;a++)s[a].eq(o,n)&&(s==this.local&&(s=this.local.slice()),s.splice(a--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new Rt(s,r):Fn}forChild(e,n){if(this==Fn)return this;if(n.isLeaf)return Rt.empty;let r,s;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,o=i+n.content.size;for(let a=0;a<this.local.length;a++){let c=this.local[a];if(c.from<o&&c.to>i&&c.type instanceof Fo){let u=Math.max(i,c.from)-i,d=Math.min(o,c.to)-i;u<d&&(s||(s=[])).push(c.copy(u,d))}}if(s){let a=new Rt(s.sort(Fa),Ll);return r?new oo([a,r]):a}return r||Fn}eq(e){if(this==e)return!0;if(!(e instanceof Rt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return aS(this.localsInner(e))}localsInner(e){if(this==Fn)return Ll;if(e.inlineContent||!this.local.some(Fo.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Fo||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Rt.empty=new Rt([],[]);Rt.removeOverlap=aS;const Fn=Rt.empty;class oo{constructor(e){this.members=e}map(e,n){const r=this.members.map(s=>s.map(e,n,za));return oo.from(r)}forChild(e,n){if(n.isLeaf)return Rt.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=Fn&&(i instanceof oo?r=r.concat(i.members):r.push(i))}return oo.from(r)}eq(e){if(!(e instanceof oo)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let o=0;o<i.length;o++)n.push(i[o])}}return n?aS(r?n:n.sort(Fa)):Ll}static from(e){switch(e.length){case 0:return Fn;case 1:return e[0];default:return new oo(e.every(n=>n instanceof Rt)?e:e.reduce((n,r)=>n.concat(r instanceof Rt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function eX(t,e,n,r,s,i,o){let a=t.slice();for(let u=0,d=i;u<n.maps.length;u++){let h=0;n.maps[u].forEach((p,f,g,m)=>{let v=m-g-(f-p);for(let x=0;x<a.length;x+=3){let b=a[x+1];if(b<0||p>b+d-h)continue;let w=a[x]+d-h;f>=w?a[x+1]=p<=w?-2:-1:p>=d&&v&&(a[x]+=v,a[x+1]+=v)}h+=v}),d=n.maps[u].map(d,-1)}let c=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){c=!0,a[u+1]=-1;continue}let d=n.map(t[u]+i),h=d-s;if(h<0||h>=r.content.size){c=!0;continue}let p=n.map(t[u+1]+i,-1),f=p-s,{index:g,offset:m}=r.content.findIndex(h),v=r.maybeChild(g);if(v&&m==h&&m+v.nodeSize==f){let x=a[u+2].mapInner(n,v,d+1,t[u]+i+1,o);x!=Fn?(a[u]=h,a[u+1]=f,a[u+2]=x):(a[u+1]=-2,c=!0)}else c=!0}if(c){let u=tX(a,t,e,n,s,i,o),d=Im(u,r,0,o);e=d.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,p=0;h<d.children.length;h+=3){let f=d.children[h];for(;p<a.length&&a[p]<f;)p+=3;a.splice(p,0,d.children[h],d.children[h+1],d.children[h+2])}}return new Rt(e.sort(Fa),a)}function YI(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let s=t[r];n.push(new Qn(s.from+e,s.to+e,s.type))}return n}function tX(t,e,n,r,s,i,o){function a(c,u){for(let d=0;d<c.local.length;d++){let h=c.local[d].map(r,s,u);h?n.push(h):o.onRemove&&o.onRemove(c.local[d].spec)}for(let d=0;d<c.children.length;d+=3)a(c.children[d+2],c.children[d]+u+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&a(t[c+2],e[c]+i+1);return n}function JI(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,s=null;for(let i=0,o;i<t.length;i++)(o=t[i])&&o.from>n&&o.to<r&&((s||(s=[])).push(o),t[i]=null);return s}function QI(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Im(t,e,n,r){let s=[],i=!1;e.forEach((a,c)=>{let u=JI(t,a,c+n);if(u){i=!0;let d=Im(u,a,n+c+1,r);d!=Fn&&s.push(c,c+a.nodeSize,d)}});let o=YI(i?QI(t):t,-n).sort(Fa);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||s.length?new Rt(o,s):Fn}function Fa(t,e){return t.from-e.from||t.to-e.to}function aS(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let s=n+1;s<e.length;s++){let i=e[s];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[s]=i.copy(i.from,r.to),qN(e,s+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),qN(e,s,r.copy(i.from,r.to)));break}}}return e}function qN(t,e,n){for(;e<t.length&&Fa(n,t[e])>0;)e++;t.splice(e,0,n)}function ex(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Fn&&e.push(r)}
vendor: 10,364 bytes, line 504
504),t.cursorWrapper&&e.push(Rt.create(t.state.doc,[t.cursorWrapper.deco])),oo.from(e)}const nX={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},rX=fr&&Bo<=11;class sX{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class iX{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sX,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);fr&&Bo<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():Hn&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),rX&&(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,nX)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[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($N(this.view)){if(this.suppressingSelectionUpdates)return xi(this.view);if(fr&&Bo<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&rl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=Wc(i))n.add(i);for(let i=e.anchorNode;i;i=Wc(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&$N(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,a=!1,c=[];if(e.editable)for(let d=0;d<n.length;d++){let h=this.registerMutation(n[d],c);h&&(i=i<0?h.from:Math.min(h.from,i),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(a=!0))}if(c.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of c)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){d.parentNode.removeChild(d);break}h=h.firstChild}}}else if(qr&&c.length){let d=c.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,p]=d;h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let p of d){let f=p.parentNode;f&&f.nodeName=="LI"&&(!h||lX(e,h)!=f)&&p.remove()}}}let u=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&jy(r)&&(u=eS(e))&&u.eq(Ve.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,xi(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),oX(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,cX(e,c)),this.handleDOMChange(i,o,a,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||xi(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let h=e.addedNodes[d];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let s=e.previousSibling,i=e.nextSibling;if(fr&&Bo<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:h,nextSibling:p}=e.addedNodes[d];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let o=s&&s.parentNode==e.target?Tn(s)+1:0,a=r.localPosFromDOM(e.target,o,-1),c=i&&i.parentNode==e.target?Tn(i):e.target.childNodes.length,u=r.localPosFromDOM(e.target,c,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let KN=new WeakMap,GN=!1;function oX(t){if(!KN.has(t)&&(KN.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=qr,GN)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."),GN=!0}}function YN(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return rl(o.node,o.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function aX(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return YN(t,s)}let n;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?YN(t,n):null}function lX(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function cX(t,e){var n;let{focusNode:r,focusOffset:s}=t.domSelectionRange();for(let i of e)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=i.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let c=a.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;a=c}a.insertBefore(i,a.firstChild),r==i&&t.domSelection().collapse(i,s)}else i.parentNode.removeChild(i)}}function uX(t,e,n){let{node:r,fromOffset:s,toOffset:i,from:o,to:a}=t.docView.parseRange(e,n),c=t.domSelectionRange(),u,d=c.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:c.anchorOffset}],jy(c)||u.push({node:c.focusNode,offset:c.focusOffset})),An&&t.input.lastKeyCode===8)for(let v=i;v>s;v--){let x=r.childNodes[v-1],b=x.pmViewDesc;if(x.nodeName=="BR"&&!b){i=v;break}if(!b||b.size)break}let h=t.state.doc,p=t.someProp("domParser")||$o.fromSchema(t.state.schema),f=h.resolve(o),g=null,m=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:dX,context:f});if(u&&u[0].pos!=null){let v=u[0].pos,x=u[1]&&u[1].pos;x==null&&(x=v),g={anchor:v+o,head:x+o}}return{doc:m,sel:g,from:o,to:a}}function dX(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Hn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Hn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const hX=/^(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 fX(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let N=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,S=eS(t,N);if(S&&!t.state.selection.eq(S)){if(An&&gi&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",_=>_(t,ya(13,"Enter"))))return;let C=t.state.tr.setSelection(S);N=="pointer"?C.setMeta("pointer",!0):N=="key"&&C.scrollIntoView(),i&&C.setMeta("composition",i),t.dispatch(C)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let c=t.state.selection,u=uX(t,e,n),d=t.state.doc,h=d.slice(u.from,u.to),p,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,f="end"):(p=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let g=gX(h.content,u.doc.content,u.from,p,f);if(g&&t.input.domChangeCount++,(qc&&t.input.lastIOSEnter>Date.now()-225||gi)&&s.some(N=>N.nodeType==1&&!hX.test(N.nodeName))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",N=>N(t,ya(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!g)if(r&&c instanceof Me&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head)
vendor: 4,133 bytes, line 504
504)g={start:c.from,endA:c.to,endB:c.to};else{if(u.sel){let N=JN(t,t.state.doc,u.sel);if(N&&!N.eq(t.state.selection)){let S=t.state.tr.setSelection(N);i&&S.setMeta("composition",i),t.dispatch(S)}}return}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof Me&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),fr&&Bo<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>u.from&&u.doc.textBetween(g.start-u.from-1,g.start-u.from+1)==" Â "&&(g.start--,g.endA--,g.endB--);let m=u.doc.resolveNoCache(g.start-u.from),v=u.doc.resolveNoCache(g.endB-u.from),x=d.resolve(g.start),b=m.sameParent(v)&&m.parent.inlineContent&&x.end()>=g.endA;if((qc&&t.input.lastIOSEnter>Date.now()-225&&(!b||s.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!b&&m.pos<u.doc.content.size&&(!m.sameParent(v)||!m.parent.inlineContent)&&m.pos<v.pos&&!/\S/.test(u.doc.textBetween(m.pos,v.pos,"","")))&&t.someProp("handleKeyDown",N=>N(t,ya(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>g.start&&mX(d,g.start,g.endA,m,v)&&t.someProp("handleKeyDown",N=>N(t,ya(8,"Backspace")))){gi&&An&&t.domObserver.suppressSelectionUpdates();return}An&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),gi&&!b&&m.start()!=v.start()&&v.parentOffset==0&&m.depth==v.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==g.endA&&(g.endB-=2,v=u.doc.resolveNoCache(g.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(N){return N(t,ya(13,"Enter"))})},20));let w=g.start,k=g.endA,j=N=>{let S=N||t.state.tr.replace(w,k,u.doc.slice(g.start-u.from,g.endB-u.from));if(u.sel){let C=JN(t,S.doc,u.sel);C&&!(An&&t.composing&&C.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(C.head==w||C.head==S.mapping.map(k)-1)||fr&&C.empty&&C.head==w)&&S.setSelection(C)}return i&&S.setMeta("composition",i),S.scrollIntoView()},E;if(b)if(m.pos==v.pos){fr&&Bo<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>xi(t),20));let N=j(t.state.tr.delete(w,k)),S=d.resolve(g.start).marksAcross(d.resolve(g.endA));S&&N.ensureMarks(S),t.dispatch(N)}else if(g.endA==g.endB&&(E=pX(m.parent.content.cut(m.parentOffset,v.parentOffset),x.parent.content.cut(x.parentOffset,g.endA-x.start())))){let N=j(t.state.tr);E.type=="add"?N.addMark(w,k,E.mark):N.removeMark(w,k,E.mark),t.dispatch(N)}else if(m.parent.child(m.index()).isText&&m.index()==v.index()-(v.textOffset?0:1)){let N=m.parent.textBetween(m.parentOffset,v.parentOffset),S=()=>j(t.state.tr.insertText(N,w,k));t.someProp("handleTextInput",C=>C(t,w,k,N,S))||t.dispatch(S())}else t.dispatch(j());else t.dispatch(j())}function JN(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:tS(t,e.resolve(n.anchor),e.resolve(n.head))}function pX(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,a,c;for(let d=0;d<r.length;d++)s=r[d].removeFromSet(s);for(let d=0;d<n.length;d++)i=n[d].removeFromSet(i);if(s.length==1&&i.length==0)a=s[0],o="add",c=d=>d.mark(a.addToSet(d.marks));else if(s.length==0&&i.length==1)a=i[0],o="remove",c=d=>d.mark(a.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<e.childCount;d++)u.push(c(e.child(d)));if(J.from(u).eq(t))return{mark:a,type:o}}function mX(t,e,n,r,s){if(n-e<=s.pos-r.pos||tx(r,!0,!1)<s.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=t.resolve(tx(i,!0,!0));return!o.parent.isTextblock||o.pos>n||tx(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function tx(t,e,n){let r=t.depth,s=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,s++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function gX(t,e,n,r,s){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);
vendor: 4,449 bytes, line 504
504if(s=="end"){let c=Math.max(0,i-Math.min(o,a));r-=o+c-i}if(o<i&&t.size<e.size){let c=r<=i&&r>=o?i-r:0;i-=c,i&&i<e.size&&QN(e.textBetween(i-1,i+1))&&(i+=c?1:-1),a=i+(a-o),o=i}else if(a<i){let c=r<=i&&r>=a?i-r:0;i-=c,i&&i<t.size&&QN(t.textBetween(i-1,i+1))&&(i+=c?1:-1),o=i+(o-a),a=i}return{start:i,endA:o,endB:a}}function QN(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class XI{constructor(e,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 OQ,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(n_),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=e_(this),ZN(this),this.nodeViews=t_(this),this.docView=ON(this.state.doc,XN(this),ex(this),this.dom,this),this.domObserver=new iX(this,(r,s,i,o)=>fX(this,r,s,i,o)),this.domObserver.start(),PQ(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Aw(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(n_),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(WI(this),o=!0),this.state=e;let a=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=t_(this);vX(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Aw(this),this.editable=e_(this),ZN(this);let c=ex(this),u=XN(this),d=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,u,c);(h||!e.selection.eq(s.selection))&&(o=!0);let p=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&KJ(this);if(o){this.domObserver.stop();let f=h&&(fr||An)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&yX(s.selection,e.selection);if(h){let g=An?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=KQ(this)),(i||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=ON(e.doc,u,c,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&yQ(this))?xi(this,f):(PI(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&GJ(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ne){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&NN(this,n.getBoundingClientRect(),e)}else NN(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let 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,e)}}updateDraggedNode(e,n){let r=e.node,s=-1;
vendor: 6,061 bytes, line 504
504if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(s=i)}this.dragging=new KI(e.slice,e.move,s<0?void 0:Ne.create(this.state.doc,s))}someProp(e,n){let r=this._props&&this._props[e],s;if(r!=null&&(s=n?n(r):r))return s;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(s=n?n(a):a))return s}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let a=i[o].props[e];if(a!=null&&(s=n?n(a):a))return s}}hasFocus(){if(fr){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&YJ(this.dom),xi(this),this.domObserver.start()}get root(){let e=this._root;if(e==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 e||document}updateRoot(){this._root=null}posAtCoords(e){return eQ(this,e)}coordsAtPos(e,n=1){return jI(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let s=this.docView.posFromDOM(e,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return iQ(this,n||this.state,e)}pasteHTML(e,n){return bh(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return bh(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return nS(this,e)}destroy(){this.docView&&(MQ(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ex(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,LJ())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return DQ(this,e)}domSelectionRange(){let e=this.domSelection();return e?Hn&&this.root.nodeType===11&&UJ(this.dom.ownerDocument)==this.dom&&aX(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}XI.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function XN(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Qn.node(0,t.state.doc.content.size,e)]}function ZN(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Qn.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function e_(t){return!t.someProp("editable",e=>e(t.state)===!1)}function yX(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function t_(t){let e=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function vX(t,e){let n=0,r=0;for(let s in t){if(t[s]!=e[s])return!0;n++}for(let s in e)r++;return n!=r}function n_(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Go={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:"'"},Dm={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xX=typeof navigator<"u"&&/Mac/.test(navigator.platform),bX=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Rn=0;Rn<10;Rn++)Go[48+Rn]=Go[96+Rn]=String(Rn);for(var Rn=1;Rn<=24;Rn++)Go[Rn+111]="F"+Rn;for(var Rn=65;Rn<=90;Rn++)Go[Rn]=String.fromCharCode(Rn+32),Dm[Rn]=String.fromCharCode(Rn);for(var nx in Go)Dm.hasOwnProperty(nx)||(Dm[nx]=Go[nx]);function wX(t){var e=xX&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||bX&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Dm:Go)[t.keyCode]||t.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 kX=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),SX=typeof navigator<"u"&&/Win/.test(navigator.platform);function CX(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,s,i,o;for(let a=0;a<e.length-1;a++){let c=e[a];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))kX?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),o&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function jX(t){let e=Object.create(null);for(let n in t)e[CX(n)]=t[n];return e}
vendor: 56,518 bytes, lines 504-547
504function rx(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function NX(t){return new It({props:{handleKeyDown:ZI(t)}})}function ZI(t){let e=jX(t);return function(n,r){let s=wX(r),i,o=e[rx(s,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let a=e[rx(s,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(SX&&r.ctrlKey&&r.altKey)&&(i=Go[r.keyCode])&&i!=s){let a=e[rx(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var _X=Object.defineProperty,lS=(t,e)=>{for(var n in e)_X(t,n,{get:e[n],enumerable:!0})};function Ey(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:s}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,i=n.storedMarks,n}}}var Ty=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:s}=n,i=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([o,a])=>[o,(...u)=>{const d=a(...u)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o=[],a=!!t,c=t||s.tr,u=()=>(!a&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(c),o.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(n).map(([h,p])=>[h,(...g)=>{const m=this.buildProps(c,e),v=p(...g)(m);return o.push(v),d}])),run:u};return d}createCan(t){const{rawCommands:e,state:n}=this,r=!1,s=t||n.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([a,c])=>[a,(...u)=>c(...u)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o={tr:t,editor:r,view:i,state:Ey({state:s,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,c])=>[a,(...u)=>c(...u)(o)]))}};return o}},eD={};lS(eD,{blur:()=>EX,clearContent:()=>TX,clearNodes:()=>RX,command:()=>AX,createParagraphNear:()=>OX,cut:()=>PX,deleteCurrentNode:()=>MX,deleteNode:()=>IX,deleteRange:()=>DX,deleteSelection:()=>LX,enter:()=>$X,exitCode:()=>BX,extendMarkRange:()=>zX,first:()=>FX,focus:()=>VX,forEach:()=>HX,insertContent:()=>WX,insertContentAt:()=>GX,joinBackward:()=>QX,joinDown:()=>JX,joinForward:()=>XX,joinItemBackward:()=>ZX,joinItemForward:()=>eZ,joinTextblockBackward:()=>tZ,joinTextblockForward:()=>nZ,joinUp:()=>YX,keyboardShortcut:()=>sZ,lift:()=>iZ,liftEmptyBlock:()=>oZ,liftListItem:()=>aZ,newlineInCode:()=>lZ,resetAttributes:()=>cZ,scrollIntoView:()=>uZ,selectAll:()=>dZ,selectNodeBackward:()=>hZ,selectNodeForward:()=>fZ,selectParentNode:()=>pZ,selectTextblockEnd:()=>mZ,selectTextblockStart:()=>gZ,setContent:()=>yZ,setMark:()=>$Z,setMeta:()=>BZ,setNode:()=>zZ,setNodeSelection:()=>FZ,setTextDirection:()=>UZ,setTextSelection:()=>VZ,sinkListItem:()=>HZ,splitBlock:()=>WZ,splitListItem:()=>qZ,toggleList:()=>KZ,toggleMark:()=>GZ,toggleNode:()=>YZ,toggleWrap:()=>JZ,undoInputRule:()=>QZ,unsetAllMarks:()=>XZ,unsetMark:()=>ZZ,unsetTextDirection:()=>eee,updateAttributes:()=>tee,wrapIn:()=>nee,wrapInList:()=>ree});var EX=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),TX=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),RX=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(a,c)=>{if(a.type.isText)return;const{doc:u,mapping:d}=e,h=u.resolve(d.map(c)),p=u.resolve(d.map(c+a.nodeSize)),f=h.blockRange(p);if(!f)return;const g=cu(f);if(a.type.isTextblock){const{defaultType:m}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(f.start,m)}(g||g===0)&&e.lift(f,g)})}),!0},AX=t=>e=>t(e),OX=()=>({state:t,dispatch:e})=>SJ(t,e),PX=(t,e)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new Me(r.doc.resolve(Math.max(o-1,0)))),!0},MX=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const a=s.before(i),c=s.after(i);t.delete(a,c).scrollIntoView()}return!0}return!1};function on(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var IX=t=>({tr:e,state:n,dispatch:r})=>{const s=on(t,n.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const c=i.before(o),u=i.after(o);e.delete(c,u).scrollIntoView()}return!0}return!1},DX=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},LX=()=>({state:t,dispatch:e})=>dJ(t,e),$X=()=>({commands:t})=>t.keyboardShortcut("Enter"),BX=()=>({state:t,dispatch:e})=>kJ(t,e);function cS(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Lm(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:cS(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function tD(t,e,n={}){return t.find(r=>r.type===e&&Lm(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function r_(t,e,n={}){return!!tD(t,e,n)}function uS(t,e,n){var r;if(!t||!e)return;let s=t.parent.childAfter(t.parentOffset);if((!s.node||!s.node.marks.some(d=>d.type===e))&&(s=t.parent.childBefore(t.parentOffset)),!s.node||!s.node.marks.some(d=>d.type===e)||(n=n||((r=s.node.marks[0])==null?void 0:r.attrs),!tD([...s.node.marks],e,n)))return;let o=s.index,a=t.start()+s.offset,c=o+1,u=a+s.node.nodeSize;for(;o>0&&r_([...t.parent.child(o-1).marks],e,n);)o-=1,a-=t.parent.child(o).nodeSize;for(;c<t.parent.childCount&&r_([...t.parent.child(c).marks],e,n);)u+=t.parent.child(c).nodeSize,c+=1;return{from:a,to:u}}function $i(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var zX=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const i=$i(t,r.schema),{doc:o,selection:a}=n,{$from:c,from:u,to:d}=a;if(s){const h=uS(c,i,e);if(h&&h.from<=u&&h.to>=d){const p=Me.create(o,h.from,h.to);n.setSelection(p)}}return!0},FX=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function nD(t){return t instanceof Me}function ja(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function rD(t,e=null){if(!e)return null;const n=Ve.atStart(t),r=Ve.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const s=n.from,i=r.to;return e==="all"?Me.create(t,ja(0,s,i),ja(t.content.size,s,i)):Me.create(t,ja(e,s,i),ja(e,s,i))}function s_(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function $m(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function UX(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var VX=(t=null,e={})=>({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{($m()||s_())&&r.dom.focus(),UX()&&!$m()&&!s_()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!nD(n.state.selection))return o(),!0;const a=rD(s.doc,t)||n.state.selection,c=n.state.selection.eq(a);return i&&(c||s.setSelection(a),c&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},HX=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),WX=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),sD=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&sD(r)}return t};function Hf(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return sD(n)}function kh(t,e,n){if(t instanceof Lo||t instanceof J)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,s=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return J.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),kh("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,a="";const c=new KM({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?$o.fromSchema(c).parseSlice(Hf(t),n.parseOptions):$o.fromSchema(c).parse(Hf(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=$o.fromSchema(e);return n.slice?i.parseSlice(Hf(t),n.parseOptions).content:i.parse(Hf(t),n.parseOptions)}return kh("",e,n)}function qX(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof gn||s instanceof vn))return;const i=t.mapping.maps[r];let o=0;i.forEach((a,c,u,d)=>{o===0&&(o=d)}),t.setSelection(Ve.near(t.doc.resolve(o),n))}var KX=t=>!("type"in t),GX=(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{var o;if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const c=v=>{i.emit("contentError",{editor:i,error:v,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{kh(e,i.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(v){c(v)}try{a=kh(e,i.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(v){return c(v),!1}let{from:d,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,f=!0;if((KX(a)?a:[a]).forEach(v=>{v.check(),p=p?v.isText&&v.marks.length===0:!1,f=f?v.isBlock:!1}),d===h&&f){const{parent:v}=r.doc.resolve(d);v.isTextblock&&!v.type.spec.code&&!v.childCount&&(d-=1,h+=1)}let m;if(p){if(Array.isArray(e))m=e.map(v=>v.text||"").join("");else if(e instanceof J){let v="";e.forEach(x=>{x.text&&(v+=x.text)}),m=v}else typeof e=="object"&&e&&e.text?m=e.text:m=e;r.insertText(m,d,h)}else{m=a;const v=r.doc.resolve(d),x=v.node(),b=v.parentOffset===0,w=x.isText||x.isTextblock,k=x.content.size>0;b&&w&&k&&(d=Math.max(0,d-1)),r.replaceWith(d,h,m)}n.updateSelection&&qX(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},YX=()=>({state:t,dispatch:e})=>vJ(t,e),JX=()=>({state:t,dispatch:e})=>xJ(t,e),QX=()=>({state:t,dispatch:e})=>hJ(t,e),XX=()=>({state:t,dispatch:e})=>gJ(t,e),ZX=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ky(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},eZ=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ky(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},tZ=()=>({state:t,dispatch:e})=>fJ(t,e),nZ=()=>({state:t,dispatch:e})=>pJ(t,e);function iD(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function rZ(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,s,i,o;for(let a=0;a<e.length-1;a+=1){const c=e[a];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))$m()||iD()?o=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var sZ=t=>({editor:e,view:n,tr:r,dispatch:s})=>{const i=rZ(t).split(/-(?!$)/),o=i.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return c==null||c.steps.forEach(u=>{const d=u.map(r.mapping);d&&s&&r.maybeStep(d)}),!0};function Yo(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?on(e,t.schema):null,a=[];t.doc.nodesBetween(r,s,(h,p)=>{if(h.isText)return;const f=Math.max(r,p),g=Math.min(s,p+h.nodeSize);a.push({node:h,from:f,to:g})});const c=s-r,u=a.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>Lm(h.node.attrs,n,{strict:!1}));return i?!!u.length:u.reduce((h,p)=>h+p.to-p.from,0)>=c}var iZ=(t,e={})=>({state:n,dispatch:r})=>{const s=on(t,n.schema);return Yo(n,s,e)?bJ(n,r):!1},oZ=()=>({state:t,dispatch:e})=>CJ(t,e),aZ=t=>({state:e,dispatch:n})=>{const r=on(t,e.schema);return PJ(r)(e,n)},lZ=()=>({state:t,dispatch:e})=>wJ(t,e);function Ry(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function i_(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,s)=>(n.includes(s)||(r[s]=t[s]),r),{})}var cZ=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=Ry(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=on(t,r.schema)),a==="mark"&&(o=$i(t,r.schema));let c=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,h)=>{i&&i===d.type&&(c=!0,s&&n.setNodeMarkup(h,void 0,i_(d.attrs,e))),o&&d.marks.length&&d.marks.forEach(p=>{o===p.type&&(c=!0,s&&n.addMark(h,h+d.nodeSize,o.create(i_(p.attrs,e))))})})}),c},uZ=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),dZ=()=>({tr:t,dispatch:e})=>{if(e){const n=new Wr(t.doc);t.setSelection(n)}return!0},hZ=()=>({state:t,dispatch:e})=>mJ(t,e),fZ=()=>({state:t,dispatch:e})=>yJ(t,e),pZ=()=>({state:t,dispatch:e})=>jJ(t,e),mZ=()=>({state:t,dispatch:e})=>EJ(t,e),gZ=()=>({state:t,dispatch:e})=>_J(t,e);function Ow(t,e,n={},r={}){return kh(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var yZ=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:a})=>{const{doc:c}=i;if(r.preserveWhitespace!=="full"){const u=Ow(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,c.content.size,u).setMeta("preventUpdate",!n),!0}return o&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function oD(t,e){const n=$i(e,t.schema),{from:r,to:s,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,s,c=>{o.push(...c.marks)});const a=o.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function aD(t,e){const n=new cI(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function vZ(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function xZ(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function bZ(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Ay(t){return e=>bZ(e.$from,t)}function be(t,e,n){return t.config[e]===void 0&&t.parent?be(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?be(t.parent,e,n):null}):t.config[e]}function dS(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=be(e,"addExtensions",n);return r?[e,...dS(r())]:e}).flat(10)}function hS(t,e){const n=dl.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function lD(t){return typeof t=="function"}function at(t,e=void 0,...n){return lD(t)?e?t.bind(e)(...n):t(...n):t}function wZ(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Kc(t){const e=t.filter(s=>s.type==="extension"),n=t.filter(s=>s.type==="node"),r=t.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function cD(t){const e=[],{nodeExtensions:n,markExtensions:r}=Kc(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),c=[...o,...a];return t.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage,extensions:s},h=be(u,"addGlobalAttributes",d);if(!h)return;h().forEach(f=>{let g;Array.isArray(f.types)?g=f.types:f.types==="*"?g=c:f.types==="nodes"?g=o:f.types==="marks"?g=a:g=[],g.forEach(m=>{Object.entries(f.attributes).forEach(([v,x])=>{e.push({type:m,name:v,attribute:{...i,...x}})})})})}),s.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage},h=be(u,"addAttributes",d);if(!h)return;const p=h();Object.entries(p).forEach(([f,g])=>{const m={...i,...g};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,e.push({type:u.name,name:f,attribute:m})})}),e}function kZ(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let a=0;a<o;a+=1){const c=t[a];if(c==="'"&&!s){r=!r,n+=c;continue}if(c==='"'&&!r){s=!s,n+=c;continue}if(!r&&!s){if(c==="("){i+=1,n+=c;continue}if(c===")"&&i>0){i-=1,n+=c;continue}if(c===";"&&i===0){e.push(n),n="";continue}}n+=c}return n&&e.push(n),e}function o_(t){const e=[],n=kZ(t||""),r=n.length;for(let s=0;s<r;s+=1){const i=n[s],o=i.indexOf(":");if(o===-1)continue;const a=i.slice(0,o).trim(),c=i.slice(o+1).trim();a&&c&&e.push([a,c])}return e}function Jt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([s,i])=>{if(!r[s]){r[s]=i;return}if(s==="class"){const a=i?String(i).split(" "):[],c=r[s]?r[s].split(" "):[],u=a.filter(d=>!c.includes(d));r[s]=[...c,...u].join(" ")}else if(s==="style"){const a=new Map([...o_(r[s]),...o_(i)]);r[s]=Array.from(a.entries()).map(([c,u])=>`${c}: ${u}`).join("; ")}else r[s]=i}),r},{})}function Sh(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Jt(n,r),{})}function SZ(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function a_(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):SZ(n.getAttribute(o.name));return a==null?i:{...i,[o.name]:a}},{});return{...r,...s}}}}function l_(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&wZ(n)?!1:n!=null))}function c_(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function CZ(t,e){var n;const r=cD(t),{nodeExtensions:s,markExtensions:i}=Kc(t),o=(n=s.find(u=>be(u,"topNode")))==null?void 0:n.name,a=Object.fromEntries(s.map(u=>{const d=r.filter(x=>x.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((x,b)=>{const w=be(b,"extendNodeSchema",h);return{...x,...w?w(u):{}}},{}),f=l_({...p,content:at(be(u,"content",h)),marks:at(be(u,"marks",h)),group:at(be(u,"group",h)),inline:at(be(u,"inline",h)),atom:at(be(u,"atom",h)),selectable:at(be(u,"selectable",h)),draggable:at(be(u,"draggable",h)),code:at(be(u,"code",h)),whitespace:at(be(u,"whitespace",h)),linebreakReplacement:at(be(u,"linebreakReplacement",h)),defining:at(be(u,"defining",h)),isolating:at(be(u,"isolating",h)),attrs:Object.fromEntries(d.map(c_))}),g=at(be(u,"parseHTML",h));g&&(f.parseDOM=g.map(x=>a_(x,d)));const m=be(u,"renderHTML",h);m&&(f.toDOM=x=>m({node:x,HTMLAttributes:Sh(x,d)}));const v=be(u,"renderText",h);return v&&(f.toText=v),[u.name,f]})),c=Object.fromEntries(i.map(u=>{const d=r.filter(v=>v.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((v,x)=>{const b=be(x,"extendMarkSchema",h);return{...v,...b?b(u):{}}},{}),f=l_({...p,inclusive:at(be(u,"inclusive",h)),excludes:at(be(u,"excludes",h)),group:at(be(u,"group",h)),spanning:at(be(u,"spanning",h)),code:at(be(u,"code",h)),attrs:Object.fromEntries(d.map(c_))}),g=at(be(u,"parseHTML",h));g&&(f.parseDOM=g.map(v=>a_(v,d)));const m=be(u,"renderHTML",h);return m&&(f.toDOM=v=>m({mark:v,HTMLAttributes:Sh(v,d)})),[u.name,f]}));return new KM({topNode:o,nodes:a,marks:c})}function jZ(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function xd(t){return t.sort((n,r)=>{const s=be(n,"priority")||100,i=be(r,"priority")||100;return s>i?-1:s<i?1:0})}function uD(t){const e=xd(dS(t)),n=jZ(e.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.`),e}function dD(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=` 505 506`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,s,(c,u,d,h)=>{var p;c.isBlock&&u>r&&(a+=i);const f=o==null?void 0:o[c.type.name];if(f)return d&&(a+=f({node:c,pos:u,parent:d,index:h,range:e})),!1;c.isText&&(a+=(p=c==null?void 0:c.text)==null?void 0:p.slice(Math.max(r,u)-u,s-u))}),a}function NZ(t,e){const n={from:0,to:t.content.size};return dD(t,n,e)}function hD(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function _Z(t,e){const n=on(e,t.schema),{from:r,to:s}=t.selection,i=[];t.doc.nodesBetween(r,s,a=>{i.push(a)});const o=i.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function fD(t,e){const n=Ry(typeof e=="string"?e:e.name,t.schema);return n==="node"?_Z(t,e):n==="mark"?oD(t,e):{}}function EZ(t,e=JSON.stringify){const n={};return t.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function TZ(t){const e=EZ(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,o)=>o!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function pD(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((a,c)=>{o.push({from:a,to:c})});else{const{from:a,to:c}=n[i];if(a===void 0||c===void 0)return;o.push({from:a,to:c})}o.forEach(({from:a,to:c})=>{const u=e.slice(i).map(a,-1),d=e.slice(i).map(c),h=e.invert().map(u,-1),p=e.invert().map(d);r.push({oldRange:{from:h,to:p},newRange:{from:u,to:d}})})}),TZ(r)}function fS(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=n.resolve(t),o=uS(i,s.type);o&&r.push({mark:s,...o})}):n.nodesBetween(t,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}var RZ=(t,e,n,r=20)=>{const s=t.doc.resolve(n);let i=r,o=null;for(;i>0&&o===null;){const a=s.node(i);(a==null?void 0:a.type.name)===e?o=a:i-=1}return[o,i]};function Du(t,e){return e.nodes[t]||e.marks[t]||null}function Cp(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=t.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}var AZ=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,a)=>{var c,u;const d=((u=(c=s.type.spec).toText)==null?void 0:u.call(c,{node:s,pos:i,parent:o,index:a}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?d:d.slice(0,Math.max(0,r-i))}),n};function Pw(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?$i(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>Lm(h.attrs,n,{strict:!1}));let o=0;const a=[];if(s.forEach(({$from:h,$to:p})=>{const f=h.pos,g=p.pos;t.doc.nodesBetween(f,g,(m,v)=>{if(i&&m.inlineContent&&!m.type.allowsMarkType(i))return!1;if(!m.isText&&!m.marks.length)return;const x=Math.max(f,v),b=Math.min(g,v+m.nodeSize),w=b-x;o+=w,a.push(...m.marks.map(k=>({mark:k,from:x,to:b})))})}),o===0)return!1;const c=a.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>Lm(h.mark.attrs,n,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),u=a.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,p)=>h+p.to-p.from,0);return(c>0?c+u:c)>=o}function OZ(t,e,n={}){if(!e)return Yo(t,null,n)||Pw(t,null,n);const r=Ry(e,t.schema);return r==="node"?Yo(t,e,n):r==="mark"?Pw(t,e,n):!1}var PZ=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=Ay(a=>a.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},MZ=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function u_(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function d_(t,e){const{nodeExtensions:n}=Kc(e),r=n.find(o=>o.name===t);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=at(be(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function Oy(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let s=!0;return t.content.forEach(i=>{s!==!1&&(Oy(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function mD(t){return t instanceof Ne}var gD=class yD{constructor(e){this.position=e}static fromJSON(e){return new yD(e.position)}toJSON(){return{position:this.position}}};function IZ(t,e){const n=e.mapping.mapResult(t.position);return{position:new gD(n.pos),mapResult:n}}function DZ(t){return new gD(t)}function LZ(t,e,n){var r;const{selection:s}=e;let i=null;if(nD(s)&&(i=s.$cursor),i){const a=(r=t.storedMarks)!=null?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}const{ranges:o}=s;return o.some(({$from:a,$to:c})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,c.pos,(d,h,p)=>{if(u)return!1;if(d.isInline){const f=!p||p.type.allowsMarkType(n),g=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));u=f&&g}return!u}),u})}var $Z=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:a}=i,c=$i(t,r.schema);if(s)if(o){const u=oD(r,c);n.addStoredMark(c.create({...u,...e}))}else a.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(p,f)=>{const g=Math.max(f,d),m=Math.min(f+p.nodeSize,h);p.marks.find(x=>x.type===c)?p.marks.forEach(x=>{c===x.type&&n.addMark(g,m,c.create({...x.attrs,...e}))}):n.addMark(g,m,c.create(e))})});return LZ(r,n,c)},BZ=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),zZ=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=on(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:a})=>SN(i,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>SN(i,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},FZ=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=ja(t,0,r.content.size),i=Ne.create(r,s);e.setSelection(i)}return!0},UZ=(t,e)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=i.from,a=i.to),s&&n.doc.nodesBetween(o,a,(c,u)=>{c.isText||n.setNodeMarkup(u,void 0,{...c.attrs,dir:t})}),!0},VZ=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Me.atStart(r).from,a=Me.atEnd(r).to,c=ja(s,o,a),u=ja(i,o,a),d=Me.create(r,c,u);e.setSelection(d)}return!0},HZ=t=>({state:e,dispatch:n})=>{const r=on(t,e.schema);return DJ(r)(e,n)};function h_(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(r)}}var WZ=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:a,$to:c}=i,u=s.extensionManager.attributes,d=Cp(u,a.node().type.name,a.node().attrs);if(i instanceof Ne&&i.node.isBlock)return!a.parentOffset||!lc(o,a.pos)?!1:(r&&(t&&h_(n,s.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=c.parentOffset===c.parent.content.size,p=a.depth===0?void 0:vZ(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=h&&p?[{type:p,attrs:d}]:void 0,g=lc(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!g&&lc(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(g=!0,f=p?[{type:p,attrs:d}]:void 0),r){if(g&&(i instanceof Me&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),p&&!h&&!a.parentOffset&&a.parent.type!==p)){const m=e.mapping.map(a.before()),v=e.doc.resolve(m);a.node(-1).canReplaceWith(v.index(),v.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&h_(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return g},qZ=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{var o;const a=on(t,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!==a)return!1;const p=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(s){let x=J.empty;const b=c.index(-1)?1:c.index(-2)?2:3;for(let S=c.depth-b;S>=c.depth-3;S-=1)x=J.from(c.node(S).copy(x));const w=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,k={...Cp(p,c.node().type.name,c.node().attrs),...e},j=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(k))||void 0;x=x.append(J.from(a.createAndFill(null,j)||void 0));const E=c.before(c.depth-(b-1));n.replace(E,c.after(-w),new le(x,4-b,0));let N=-1;n.doc.nodesBetween(E,n.doc.content.size,(S,C)=>{if(N>-1)return!1;S.isTextblock&&S.content.size===0&&(N=C+1)}),N>-1&&n.setSelection(Me.near(n.doc.resolve(N))),n.scrollIntoView()}return!0}const f=u.pos===c.end()?h.contentMatchAt(0).defaultType:null,g={...Cp(p,h.type.name,h.attrs),...e},m={...Cp(p,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,u.pos);const v=f?[{type:a,attrs:g},{type:f,attrs:m}]:[{type:a,attrs:g}];if(!lc(n.doc,c.pos,2))return!1;if(s){const{selection:x,storedMarks:b}=r,{splittableMarks:w}=i.extensionManager,k=b||x.$to.parentOffset&&x.$from.marks();if(n.split(c.pos,2,v).scrollIntoView(),!k||!s)return!0;const j=k.filter(E=>w.includes(E.type.name));n.ensureMarks(j)}return!0},sx=(t,e)=>{const n=Ay(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&sa(t.doc,n.pos)&&t.join(n.pos),!0},ix=(t,e)=>{const n=Ay(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&sa(t.doc,r)&&t.join(r),!0},KZ=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:a,chain:c,commands:u,can:d})=>{const{extensions:h,splittableMarks:p}=s.extensionManager,f=on(t,o.schema),g=on(e,o.schema),{selection:m,storedMarks:v}=o,{$from:x,$to:b}=m,w=x.blockRange(b),k=v||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const j=Ay(E=>d_(E.type.name,h))(m);if(w.depth>=1&&j&&w.depth-j.depth<=1){if(j.node.type===f)return u.liftListItem(g);if(d_(j.node.type.name,h)&&f.validContent(j.node.content)&&a)return c().command(()=>(i.setNodeMarkup(j.pos,f),!0)).command(()=>sx(i,f)).command(()=>ix(i,f)).run()}return!n||!k||!a?c().command(()=>d().wrapInList(f,r)?!0:u.clearNodes()).wrapInList(f,r).command(()=>sx(i,f)).command(()=>ix(i,f)).run():c().command(()=>{const E=d().wrapInList(f,r),N=k.filter(S=>p.includes(S.type.name));return i.ensureMarks(N),E?!0:u.clearNodes()}).wrapInList(f,r).command(()=>sx(i,f)).command(()=>ix(i,f)).run()},GZ=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=$i(t,r.schema);return Pw(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},YZ=(t,e,n={})=>({state:r,commands:s})=>{const i=on(t,r.schema),o=on(e,r.schema),a=Yo(r,i,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),a?s.setNode(o,c):s.setNode(i,{...c,...n})},JZ=(t,e={})=>({state:n,commands:r})=>{const s=on(t,n.schema);return Yo(n,s,e)?r.lift(s):r.wrapIn(s,e)},QZ=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let i;if(s.spec.isInputRules&&(i=s.getState(t))){if(e){const o=t.tr,a=i.transform;for(let c=a.steps.length-1;c>=0;c-=1)o.step(a.steps[c].invert(a.docs[c]));if(i.text){const c=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,c))}else o.delete(i.from,i.to)}return!0}}return!1},XZ=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:s}=n;return r||e&&s.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},ZZ=(t,e={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,c=$i(t,r.schema),{$from:u,empty:d,ranges:h}=a;if(!s)return!0;if(d&&o){let{from:p,to:f}=a;const g=(i=u.marks().find(v=>v.type===c))==null?void 0:i.attrs,m=uS(u,c,g);m&&(p=m.from,f=m.to),n.removeMark(p,f,c)}else h.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,c)});return n.removeStoredMark(c),!0},eee=t=>({tr:e,state:n,dispatch:r})=>{const{selection:s}=n;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(a,c)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(c,void 0,u)}),!0},tee=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=Ry(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=on(t,r.schema)),a==="mark"&&(o=$i(t,r.schema));let c=!1;return n.selection.ranges.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;let p,f,g,m;n.selection.empty?r.doc.nodesBetween(d,h,(v,x)=>{i&&i===v.type&&(c=!0,g=Math.max(x,d),m=Math.min(x+v.nodeSize,h),p=x,f=v)}):r.doc.nodesBetween(d,h,(v,x)=>{x<d&&i&&i===v.type&&(c=!0,g=Math.max(x,d),m=Math.min(x+v.nodeSize,h),p=x,f=v),x>=d&&x<=h&&(i&&i===v.type&&(c=!0,s&&n.setNodeMarkup(x,void 0,{...v.attrs,...e})),o&&v.marks.length&&v.marks.forEach(b=>{if(o===b.type&&(c=!0,s)){const w=Math.max(x,d),k=Math.min(x+v.nodeSize,h);n.addMark(w,k,o.create({...b.attrs,...e}))}}))}),f&&(p!==void 0&&s&&n.setNodeMarkup(p,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(v=>{o===v.type&&s&&n.addMark(g,m,o.create({...v.attrs,...e}))}))}),c},nee=(t,e={})=>({state:n,dispatch:r})=>{const s=on(t,n.schema);return TJ(s,e)(n,r)},ree=(t,e={})=>({state:n,dispatch:r})=>{const s=on(t,n.schema);return RJ(s,e)(n,r)},see=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Py=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},iee=(t,e)=>{if(cS(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,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 Wf(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:a}=t,{view:c}=n;if(c.composing)return!1;const u=c.state.doc.resolve(r);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const h=AZ(u)+i;return o.forEach(p=>{if(d)return;const f=iee(h,p.find);if(!f)return;const g=c.state.tr,m=Ey({state:c.state,transaction:g}),v={from:r-(f[0].length-i.length),to:s},{commands:x,chain:b,can:w}=new Ty({editor:n,state:m});p.handler({state:m,range:v,match:f,commands:x,chain:b,can:w})===null||!g.steps.length||(p.undoable&&g.setMeta(a,{transform:g,from:r,to:s,text:i}),c.dispatch(g),d=!0)}),d}function oee(t){const{editor:e,rules:n}=t,r=new It({state:{init(){return null},apply(s,i,o){const a=s.getMeta(r);if(a)return a;const c=s.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=hS(J.from(d),o.schema);const{from:h}=c,p=h+d.length;Wf({editor:e,from:h,to:p,text:d,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,a){return Wf({editor:e,from:i,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&Wf({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?Wf({editor:e,from:o.pos,to:o.pos,text:` 507`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function aee(t){return Object.prototype.toString.call(t).slice(8,-1)}function qf(t){return aee(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function vD(t,e){const n={...t};return qf(t)&&qf(e)&&Object.keys(e).forEach(r=>{qf(e[r])&&qf(t[r])?n[r]=vD(t[r],e[r]):n[r]=e[r]}),n}var pS=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...at(be(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...at(be(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>vD(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},hl=class xD extends pS{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new xD(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const c=o.find(u=>(u==null?void 0:u.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function lee(t){return typeof t=="number"}var cee=class{constructor(t){this.find=t.find,this.handler=t.handler}},uee=(t,e,n)=>{if(cS(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=t,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function dee(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:a}=t,{commands:c,chain:u,can:d}=new Ty({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,s,(f,g)=>{var m,v,x,b,w;if((v=(m=f.type)==null?void 0:m.spec)!=null&&v.code||!(f.isText||f.isTextblock||f.isInline))return;const k=(w=(b=(x=f.content)==null?void 0:x.size)!=null?b:f.nodeSize)!=null?w:0,j=Math.max(r,g),E=Math.min(s,g+k);if(j>=E)return;const N=f.isText?f.text||"":f.textBetween(j-g,E-g,void 0,"");uee(N,i.find,o).forEach(C=>{if(C.index===void 0)return;const _=j+C.index+1,R=_+C[0].length,O={from:n.tr.mapping.map(_),to:n.tr.mapping.map(R)},L=i.handler({state:n,range:O,match:C,commands:c,chain:u,can:d,pasteEvent:o,dropEvent:a});h.push(L)})}),h.every(f=>f!==null)}var Kf=null,hee=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function fee(t){const{editor:e,rules:n}=t;let r=null,s=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const c=({state:d,from:h,to:p,rule:f,pasteEvt:g})=>{const m=d.tr,v=Ey({state:d,transaction:m});if(!(!dee({editor:e,state:v,from:Math.max(h-1,0),to:p.b-1,rule:f,pasteEvent:g,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(d=>new It({view(h){const p=g=>{var m;r=(m=h.dom.parentElement)!=null&&m.contains(g.target)?h.dom.parentElement:null,r&&(Kf=e)},f=()=>{Kf&&(Kf=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(h,p)=>{if(i=r===h.dom.parentElement,a=p,!i){const f=Kf;f!=null&&f.isEditable&&setTimeout(()=>{const g=f.state.selection;g&&f.commands.deleteRange({from:g.from,to:g.to})},10)}return!1},paste:(h,p)=>{var f;const g=(f=p.clipboardData)==null?void 0:f.getData("text/html");return o=p,s=!!(g!=null&&g.includes("data-pm-slice")),!1}}},appendTransaction:(h,p,f)=>{const g=h[0],m=g.getMeta("uiEvent")==="paste"&&!s,v=g.getMeta("uiEvent")==="drop"&&!i,x=g.getMeta("applyPasteRules"),b=!!x;if(!m&&!v&&!b)return;if(b){let{text:j}=x;typeof j=="string"?j=j:j=hS(J.from(j),f.schema);const{from:E}=x,N=E+j.length,S=hee(j);return c({rule:d,state:f,from:E,to:{b:N},pasteEvt:S})}const w=p.doc.content.findDiffStart(f.doc.content),k=p.doc.content.findDiffEnd(f.doc.content);if(!(!lee(w)||!k||w===k.b))return c({rule:d,state:f,from:w,to:k,pasteEvt:o})}}))}var My=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=uD(t),this.schema=CZ(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Du(e.name,this.schema)},r=be(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return xd([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Du(r.name,this.schema)},i=[],o=be(r,"addKeyboardShortcuts",s);let a={};if(r.type==="mark"&&be(r,"exitable",s)&&(a.ArrowRight=()=>hl.handleExit({editor:t,mark:r})),o){const p=Object.fromEntries(Object.entries(o()).map(([f,g])=>[f,()=>g({editor:t})]));a={...a,...p}}const c=NX(a);i.push(c);const u=be(r,"addInputRules",s);if(u_(r,t.options.enableInputRules)&&u){const p=u();if(p&&p.length){const f=oee({editor:t,rules:p}),g=Array.isArray(f)?f:[f];i.push(...g)}}const d=be(r,"addPasteRules",s);if(u_(r,t.options.enablePasteRules)&&d){const p=d();if(p&&p.length){const f=fee({editor:t,rules:p});i.push(...f)}}const h=be(r,"addProseMirrorPlugins",s);if(h){const p=h();i.push(...p)}return i})}get attributes(){return cD(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Kc(this.extensions);return Object.fromEntries(e.filter(n=>!!be(n,"addNodeView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:on(n.name,this.schema)},i=be(n,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const a=(c,u,d,h,p)=>{const f=Sh(c,r);return o({node:c,view:u,getPos:d,decorations:h,innerDecorations:p,editor:t,extension:n,HTMLAttributes:f})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return xd([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Du(s.name,this.schema)},o=be(s,"dispatchTransaction",i);return o?a=>{o.call(i,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return xd([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Du(s.name,this.schema)},o=be(s,"transformPastedHTML",i);return o?(a,c)=>{const u=r(a,c);return o.call(i,u)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Kc(this.extensions);return Object.fromEntries(e.filter(n=>!!be(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:$i(n.name,this.schema)},i=be(n,"addMarkView",s);if(!i)return[];const o=(a,c,u)=>{const d=Sh(a,r);return i()({mark:a,view:c,inline:u,editor:t,extension:n,HTMLAttributes:d,updateAttributes:h=>{Eee(a,t,h)}})};return[n.name,o]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Du(e.name,this.schema)};e.type==="mark"&&((n=at(be(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const s=be(e,"onBeforeCreate",r),i=be(e,"onCreate",r),o=be(e,"onUpdate",r),a=be(e,"onSelectionUpdate",r),c=be(e,"onTransaction",r),u=be(e,"onFocus",r),d=be(e,"onBlur",r),h=be(e,"onDestroy",r);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}};My.resolve=uD;My.sort=xd;My.flatten=dS;var pee={};lS(pee,{ClipboardTextSerializer:()=>wD,Commands:()=>kD,Delete:()=>SD,Drop:()=>CD,Editable:()=>jD,FocusEvents:()=>_D,Keymap:()=>ED,Paste:()=>TD,Tabindex:()=>RD,TextDirection:()=>AD,focusEventsPluginKey:()=>ND});var Xt=class bD extends pS{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new bD(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},wD=Xt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new It({key:new dn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,{ranges:i}=s,o=Math.min(...i.map(d=>d.$from.pos)),a=Math.max(...i.map(d=>d.$to.pos)),c=hD(n);return dD(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),kD=Xt.create({name:"commands",addCommands(){return{...eD}}}),SD=Xt.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,s;const i=()=>{var o,a,c,u;if((u=(c=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:c.call(a,t))!=null?u:t.getMeta("y-sync$"))return;const d=aD(t.before,[t,...e]);pD(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,(g,m)=>{const v=m+g.nodeSize-2,x=f.oldRange.from<=m&&v<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:g,from:m,to:v,newFrom:d.mapping.map(m),newTo:d.mapping.map(v),deletedRange:f.oldRange,newRange:f.newRange,partial:!x,editor:this.editor,transaction:t,combinedTransform:d})})});const p=d.mapping;d.steps.forEach((f,g)=>{var m,v;if(f instanceof ys){const x=p.slice(g).map(f.from,-1),b=p.slice(g).map(f.to),w=p.invert().map(x,-1),k=p.invert().map(b),j=(m=d.doc.nodeAt(x-1))==null?void 0:m.marks.some(N=>N.eq(f.mark)),E=(v=d.doc.nodeAt(b))==null?void 0:v.marks.some(N=>N.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:w,to:k},newRange:{from:x,to:b},partial:!!(E||j),editor:this.editor,transaction:t,combinedTransform:d})}})};(s=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),CD=Xt.create({name:"drop",addProseMirrorPlugins(){return[new It({key:new dn("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),jD=Xt.create({name:"editable",addProseMirrorPlugins(){return[new It({key:new dn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ND=new dn("focusEvents"),_D=Xt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new It({key:ND,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),ED=Xt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:c,doc:u}=a,{empty:d,$anchor:h}=c,{pos:p,parent:f}=h,g=h.parent.isTextblock&&p>0?a.doc.resolve(p-1):h,m=g.parent.type.spec.isolating,v=h.pos-h.parentOffset,x=m&&g.parent.childCount===1?v===h.pos:Ve.atStart(u).from===p;return!d||!f.type.isTextblock||f.textContent.length||!x||x&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return $m()||iD()?i:s},addProseMirrorPlugins(){return[new It({key:new dn("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(m=>m.getMeta("composition")))return;const r=t.some(m=>m.docChanged)&&!e.doc.eq(n.doc),s=t.some(m=>m.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:a}=e.selection,c=Ve.atStart(e.doc).from,u=Ve.atEnd(e.doc).to;if(i||!(o===c&&a===u)||!Oy(n.doc))return;const p=n.tr,f=Ey({state:n,transaction:p}),{commands:g}=new Ty({editor:this.editor,state:f});if(g.clearNodes(),!!p.steps.length)return p}})]}}),TD=Xt.create({name:"paste",addProseMirrorPlugins(){return[new It({key:new dn("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),RD=Xt.create({name:"tabindex",addProseMirrorPlugins(){return[new It({key:new dn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),AD=Xt.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Kc(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new It({key:new dn("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),mee=class Xu{constructor(e,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let 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},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Xu(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Xu(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Xu(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(a);if(!s&&!o&&c.depth<=this.depth)return;const u=new Xu(c,this.editor,s,s||o?n:null);s&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const c=o[a];if(i[c]!==n[c])break}}else r=s;s=s.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const i=Object.keys(n);return this.children.forEach(o=>{r&&s.length>0||(o.node.type.name===e&&i.every(c=>n[c]===o.node.attrs[c])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,n,r))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},gee=`.ProseMirror { 508 position: relative; 509} 510 511.ProseMirror { 512 word-wrap: break-word; 513 white-space: pre-wrap; 514 white-space: break-spaces; 515 -webkit-font-variant-ligatures: none; 516 font-variant-ligatures: none; 517 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 518} 519 520.ProseMirror [contenteditable="false"] { 521 white-space: normal; 522} 523 524.ProseMirror [contenteditable="false"] [contenteditable="true"] { 525 white-space: pre-wrap; 526} 527 528.ProseMirror pre { 529 white-space: pre-wrap; 530} 531 532img.ProseMirror-separator { 533 display: inline !important; 534 border: none !important; 535 margin: 0 !important; 536 width: 0 !important; 537 height: 0 !important; 538} 539 540.ProseMirror-gapcursor { 541 display: none; 542 pointer-events: none; 543 position: absolute; 544 margin: 0; 545} 546 547.ProseMirror-gapcursor:after {
548 content: ""; 549 display: block; 550 position: absolute; 551 top: -2px; 552 width: 20px; 553 border-top: 1px solid black; 554 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 555} 556 557@keyframes ProseMirror-cursor-blink { 558 to { 559 visibility: hidden; 560 } 561} 562 563.ProseMirror-hideselection *::selection { 564 background: transparent; 565} 566 567.ProseMirror-hideselection *::-moz-selection { 568 background: transparent; 569} 570 571.ProseMirror-hideselection * { 572 caret-color: transparent; 573} 574 575.ProseMirror-focused .ProseMirror-gapcursor { 576 display: block; 577}`;function yee(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}var vee=class extends see{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:IZ,createMappablePosition:DZ},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:s,moved:i})=>this.options.onDrop(r,s,i)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=rD(e,this.options.autofocus);this.editorState=Ql.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=yee(gee,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}
vendor: 7,331 bytes, lines 577-579
577),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=lD(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(o=>!o.key.startsWith(i))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[jD,wD.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),kD,_D,ED,RD,CD,TD,SD,AD.configure({direction:this.options.textDirection})].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new My(r,this)}createCommandManager(){this.commandManager=new Ty({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Ow(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Ow(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new XI(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(u)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),s=n.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),c=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),c&&this.emit("blur",{editor:this,event:c.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return fD(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return OZ(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return hS(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=` 578 579`,textSerializers:n={}}=t||{};return NZ(this.state.doc,{blockSeparator:e,textSerializers:{...hD(this.schema),...n}})}get isEmpty(){return Oy(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new mee(e,this)}get $doc(){return this.$pos(0)}};function Gc(t){return new Py({find:t.find,handler:({state:e,range:n,match:r})=>{const s=at(t.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],a=r[0];if(o){const c=a.search(/\S/),u=n.from+a.indexOf(o),d=u+o.length;if(fS(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(m=>m===t.type&&m!==f.mark.type)).filter(f=>f.to>u).length)return null;d<n.to&&i.delete(d,n.to),u>n.from&&i.delete(n.from+c,u);const p=n.from+c+o.length;i.addMark(n.from+c,p,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function OD(t){return new Py({find:t.find,handler:({state:e,range:n,match:r})=>{const s=at(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let a=n.to;const c=t.type.create(s);if(r[1]){const u=r[0].lastIndexOf(r[1]);let d=o+u;d>a?d=a:a=d+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,o+r[0].length-1),i.replaceWith(d,a,c)}else if(r[0]){const u=t.type.isInline?o:o-1;i.insert(u,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(a))}i.scrollIntoView()},undoable:t.undoable})}function Mw(t){return new Py({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=at(t.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function Yc(t){return new Py({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=at(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),c=o.doc.resolve(n.from).blockRange(),u=c&&Yk(c,t.type,i);if(!u)return null;if(o.wrap(c,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:p}=e,{splittableMarks:f}=t.editor.extensionManager,g=p||h.$to.parentOffset&&h.$from.marks();if(g){const m=g.filter(v=>
579f.includes(v.type.name));o.ensureMarks(m)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&sa(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)},undoable:t.undoable})}var xee=t=>"touches"in t,bee=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=a=>{if(!this.isResizing||!this.activeHandle)return;const c=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(c,u)},this.handleTouchMove=a=>{if(!this.isResizing||!this.activeHandle)return;const c=a.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 a=this.element.offsetWidth,c=this.element.offsetHeight;this.onCommit(a,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=a=>{a.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=a=>{a.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,s,i,o;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(s=t.options)!=null&&s.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(o=t.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,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 t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display="flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");
579return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),s=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),s&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,xee(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:s}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(r,s,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,s=this.startHeight;const i=t.includes("right"),o=t.includes("left"),a=t.includes("bottom"),c=t.includes("top");return i?r=this.startWidth+e:o&&(r=this.startWidth-e),a?s=this.startHeight+n:c&&(s=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(s=this.startHeight+(a?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,s,t):{width:r,height:s}}applyConstraints(t,e,n){var r,s,i,o;if(!n){let u=Math.max(this.minSize.width,t),d=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(u=Math.min(this.maxSize.width,u)),(s=this.maxSize)!=null&&s.height&&(d=Math.min(this.maxSize.height,d)),{width:u,height:d}}let a=t,c=e;return a<this.minSize.width&&(a=this.minSize.width,c=a/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,a=c*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&a>this.maxSize.width&&(a=this.maxSize.width,c=a/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&c>this.maxSize.height&&(c=this.maxSize.height,a=c*this.aspectRatio),{width:a,height:c}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",s=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function wee(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof Ne){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}var kee={};lS(kee,{createAtomBlockMarkdownSpec:()=>See,createBlockMarkdownSpec:()=>Cee,createInlineMarkdownSpec:()=>_ee,parseAttributes:()=>mS,parseIndentedBlocks:()=>Iw,renderNestedMarkdownContent:()=>yS,serializeAttributes:()=>gS});function mS(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}
579__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const u=s.map(d=>d.trim().slice(1));e.class=u.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,u,d])=>{var h;const p=parseInt(((h=d.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),f=n[p];f&&(e[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-]*$/)&&(e[d]=!0)}),e}function gS(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function See(t){const{nodeName:e,name:n,parseAttributes:r=mS,serializeAttributes:s=gS,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:a}=t,c=n||e,u=d=>{if(!a)return d;const h={};return a.forEach(p=>{p in d&&(h[p]=d[p])}),h};return{parseMarkdown:(d,h)=>{const p={...i,...d.attributes};return h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(d){var h;const p=new RegExp(`^:::${c}(?:\\s|$)`,"m"),f=(h=d.match(p))==null?void 0:h.index;return f!==void 0?f:-1},tokenize(d,h,p){const f=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),g=d.match(f);if(!g)return;const m=g[1]||"",v=r(m);if(!o.find(b=>!(b in v)))return{type:e,raw:g[0],attributes:v}}},renderMarkdown:d=>{const h=u(d.attrs||{}),p=s(h),f=p?` {${p}}`:"";return`:::${c}${f} :::`}}}function Cee(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=mS,serializeAttributes:i=gS,defaultAttributes:o={},content:a="block",allowedAttributes:c}=t,u=n||e,d=h=>{if(!c)return h;const p={};return c.forEach(f=>{f in h&&(p[f]=h[f])}),p};return{parseMarkdown:(h,p)=>{let f;if(r){const m=r(h);f=typeof m=="string"?[{type:"text",text:m}]:m}else a==="block"?f=p.parseChildren(h.tokens||[]):f=p.parseInline(h.tokens||[]);const g={...o,...h.attributes};return p.createNode(e,g,f)},markdownTokenizer:{name:e,level:"block",start(h){var p;const f=new RegExp(`^:::${u}`,"m"),g=(p=h.match(f))==null?void 0:p.index;return g!==void 0?g:-1},tokenize(h,p,f){var g;const m=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),v=h.match(m);if(!v)return;const[x,b=""]=v,w=s(b);let k=1;const j=x.length;let E="";const N=/^:::([\w-]*)(\s.*)?/gm,S=h.slice(j);for(N.lastIndex=0;;){const C=N.exec(S);if(C===null)break;const _=C.index,R=C[1];if(!((g=C[2])!=null&&g.endsWith(":::"))){if(R)k+=1;else if(k-=1,k===0){const O=S.slice(0,_);E=O.trim();const L=h.slice(0,j+_+C[0].length);let A=[];if(E)if(a==="block")for(A=f.blockTokens(O),A.forEach(z=>{z.text&&(!z.tokens||z.tokens.length===0)&&(z.tokens=f.inlineTokens(z.text))});A.length>0;){const z=A[A.length-1];if(z.type==="paragraph"&&(!z.text||z.text.trim()===""))A.pop();else break}else A=f.inlineTokens(E);return{type:e,raw:L,attributes:w,content:E,tokens:A}}}}}},renderMarkdown:(h,p)=>{const f=d(h.attrs||{}),g=i(f),m=g?` {${g}}`:"",v=p.renderChildren(h.content||[],` 580 581`);return`:::${u}${m} 582 583${v} 584 585:::`}}}function jee(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,s,i,o]=r;e[s]=i||o,r=n.exec(t)}return e}function Nee(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function _ee(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=jee,serializeAttributes:i=Nee,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:c}=t,u=n||e,d=p=>{if(!c)return p;const f={};return c.forEach(g=>{const m=typeof g=="string"?g:g.name,v=typeof g=="string"?void 0:g.skipIfDefault;if(m in p){const x=p[m];if(v!==void 0&&x===v)return;f[m]=x}}),f},h=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(p,f)=>{const g={...o,...p.attributes};if(a)return f.createNode(e,g);const m=r?r(p):p.content||"";return m?f.createNode(e,g,[f.createTextNode(m)]):f.createNode(e,g,[])},markdownTokenizer:{name:e,level:"inline",start(p){const f=a?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),g=p.match(f),m=g==null?void 0:g.index;return m!==void 0?m:-1},tokenize(p,f,g){const m=a?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),v=p.match(m);if(!v)return;let x="",b="";if(a){const[,k]=v;b=k}else{const[,k,j]=v;b=k,x=j||""}const w=s(b.trim());return{type:e,raw:v[0],content:x.trim(),attributes:w}}},renderMarkdown:p=>{let f="";r?f=r(p):p.content&&p.content.length>0&&(f=p.content.filter(x=>x.type==="text").map(x=>x.text).join(""));const g=d(p.attrs||{}),m=i(g),v=m?` ${m}`:"";return a?`[${u}${v}]`:`[${u}${v}]${f}[/${u}]`}}
585}function Iw(t,e,n){var r,s,i,o;const a=t.split(` 586`),c=[];let u="",d=0;const h=e.baseIndentSize||2;for(;d<a.length;){const p=a[d],f=p.match(e.itemPattern);if(!f){if(c.length>0)break;if(p.trim()===""){d+=1,u=`${u}${p} 587`;continue}else return}const g=e.extractItemData(f),{indentLevel:m,mainContent:v}=g;u=`${u}${p} 588`;const x=[v];for(d+=1;d<a.length;){const j=a[d];if(j.trim()===""){const N=a.slice(d+1).findIndex(_=>_.trim()!=="");if(N===-1)break;if((((s=(r=a[d+1+N].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:s.length)||0)>m){x.push(j),u=`${u}${j} 589`,d+=1;continue}else break}if((((o=(i=j.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>m)x.push(j),u=`${u}${j} 590`,d+=1;else break}let b;const w=x.slice(1);if(w.length>0){const j=w.map(E=>E.slice(m+h)).join(` 591`);j.trim()&&(e.customNestedParser?b=e.customNestedParser(j):b=n.blockTokens(j))}const k=e.createToken(g,b);c.push(k)}if(c.length!==0)return{items:c,raw:u}}function yS(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const s=typeof n=="function"?n(r):n,[i,...o]=t.content,a=e.renderChildren([i]);let c=`${s}${a}`;return o&&o.length>0&&o.forEach((u,d)=>{var h,p;const f=(p=(h=e.renderChild)==null?void 0:h.call(e,u,d+1))!=null?p:e.renderChildren([u]);if(f!=null){const g=f.split(` 592`).map(m=>m?e.indent(m):e.indent("")).join(` 593`);c+=u.type==="paragraph"?` 594 595${g}`:` 596${g}`}}),c}function Eee(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((a,c)=>{const u=i.mapping.map(c),d=i.mapping.map(c)+a.nodeSize;let h=null;if(a.marks.forEach(f=>{if(f!==o)return!1;h=f}),!h)return;let p=!1;if(Object.keys(n).forEach(f=>{n[f]!==h.attrs[f]&&(p=!0)}),p){const f=t.type.create({...t.attrs,...n});i.removeMark(u,d,t.type),i.addMark(u,d,f)}}),i.docChanged&&e.view.dispatch(i)}var mr=class PD extends pS{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new PD(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function il(t){return new cee({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=at(t.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],c=r[0];let u=n.to;if(a){const d=c.search(/\S/),h=n.from+c.indexOf(a),p=h+a.length;if(fS(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(v=>v===t.type&&v!==g.mark.type)).filter(g=>g.to>h).length)return null;p<n.to&&o.delete(p,n.to),h>n.from&&o.delete(n.from+d,h),u=n.from+d+a.length,o.addMark(n.from+d,u,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:Tee,getOwnPropertySymbols:Ree}=Object,{hasOwnProperty:Aee}=Object.prototype;function ox(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function Gf(t){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,s);const{cache:i}=s,o=i.get(n),a=i.get(r);if(o&&a)return o===r&&a===n;i.set(n,r),i.set(r,n);const c=t(n,r,s);return i.delete(n),i.delete(r),c}}function Oee(t){return t!=null?t[Symbol.toStringTag]:void 0}function f_(t){return Tee(t).concat(Ree(t))}const Pee=Object.hasOwn||((t,e)=>Aee.call(t,e));function fl(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const Mee="__v",Iee="__o",Dee="_owner",{getOwnPropertyDescriptor:p_,keys:m_}=Object;function Lee(t,e){return t.byteLength===e.byteLength&&Bm(new Uint8Array(t),new Uint8Array(e))}function $ee(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function Bee(t,e){return t.byteLength===e.byteLength&&Bm(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function zee(t,e){return fl(t.getTime(),e.getTime())}function Fee(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function Uee(t,e){return t===e}function g_(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.entries();let o,a,c=0;for(;(o=i.next())&&!o.done;){const u=e.entries();let d=!1,h=0;for(;(a=u.next())&&!a.done;){if(s[h]){h++;continue}const p=o.value,f=a.value;if(n.equals(p[0],f[0],c,h,t,e,n)&&n.equals(p[1],f[1],p[0],f[0],t,e,n)){d=s[h]=!0;break}h++}if(!d)return!1;c++}return!0}const Vee=fl;function Hee(t,e,n){const r=m_(t);let s=r.length;if(m_(e).length!==s)return!1;for(;s-- >0;)if(!MD(t,e,n,r[s]))return!1;return!0}function Lu(t,e,n){const r=f_(t);let s=r.length;if(f_(e).length!==s)return!1;let i,o,a;for(;s-- >0;)if(i=r[s],!MD(t,e,n,i)||(o=p_(t,i),a=p_(e,i),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function Wee(t,e){return fl(t.valueOf(),e.valueOf())}function qee(t,e){return t.source===e.source&&t.flags===e.flags}function y_(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.values();let o,a;for(;(o=i.next())&&!o.done;){const c=e.values();let u=!1,d=0;for(;(a=c.next())&&!a.done;){if(!s[d]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function Bm(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function Kee(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function MD(t,e,n,r){return(r===Dee||r===Iee||r===Mee)&&(t.$$typeof||e.$$typeof)?!0:Pee(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const Gee="[object ArrayBuffer]",Yee="[object Arguments]",Jee="[object Boolean]",Qee="[object DataView]",Xee="[object Date]",Zee="[object Error]",ete="[object Map]",tte="[object Number]",nte="[object Object]",rte="[object RegExp]",ste="[object Set]",ite="[object String]",ote={"[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
596]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},ate="[object URL]",lte=Object.prototype.toString;function cte({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:p,areUrlsEqual:f,unknownTagComparators:g}){return function(v,x,b){if(v===x)return!0;if(v==null||x==null)return!1;const w=typeof v;if(w!==typeof x)return!1;if(w!=="object")return w==="number"?a(v,x,b):w==="function"?i(v,x,b):!1;const k=v.constructor;if(k!==x.constructor)return!1;if(k===Object)return c(v,x,b);if(Array.isArray(v))return e(v,x,b);if(k===Date)return r(v,x,b);if(k===RegExp)return d(v,x,b);if(k===Map)return o(v,x,b);if(k===Set)return h(v,x,b);const j=lte.call(v);if(j===Xee)return r(v,x,b);if(j===rte)return d(v,x,b);if(j===ete)return o(v,x,b);if(j===ste)return h(v,x,b);if(j===nte)return typeof v.then!="function"&&typeof x.then!="function"&&c(v,x,b);if(j===ate)return f(v,x,b);if(j===Zee)return s(v,x,b);if(j===Yee)return c(v,x,b);if(ote[j])return p(v,x,b);if(j===Gee)return t(v,x,b);if(j===Qee)return n(v,x,b);if(j===Jee||j===tte||j===ite)return u(v,x,b);if(g){let E=g[j];if(!E){const N=Oee(v);N&&(E=g[N])}if(E)return E(v,x,b)}return!1}}function ute({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:Lee,areArraysEqual:n?Lu:$ee,areDataViewsEqual:Bee,areDatesEqual:zee,areErrorsEqual:Fee,areFunctionsEqual:Uee,areMapsEqual:n?ox(g_,Lu):g_,areNumbersEqual:Vee,areObjectsEqual:n?Lu:Hee,arePrimitiveWrappersEqual:Wee,areRegExpsEqual:qee,areSetsEqual:n?ox(y_,Lu):y_,areTypedArraysEqual:n?ox(Bm,Lu):Bm,areUrlsEqual:Kee,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=Gf(r.areArraysEqual),i=Gf(r.areMapsEqual),o=Gf(r.areObjectsEqual),a=Gf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:a})}return r}function dte(t){return function(e,n,r,s,i,o,a){return t(e,n,a)}}function hte({circular:t,comparator:e,createState:n,equals:r,strict:s}){if(n)return function(a,c){const{cache:u=t?new WeakMap:void 0,meta:d}=n();return e(a,c,{cache:u,equals:r,meta:d,strict:s})};if(t)return function(a,c){return e(a,c,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(a,c){return e(a,c,i)}}const fte=oa();oa({strict:!0});oa({circular:!0});oa({circular:!0,strict:!0});oa({createInternalComparator:()=>fl});oa({strict:!0,createInternalComparator:()=>fl});oa({circular:!0,createInternalComparator:()=>fl});oa({circular:!0,createInternalComparator:()=>fl,strict:!0});function oa(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=ute(t),o=cte(i),a=n?n(o):dte(o);return hte({circular:e,comparator:o,createState:r,equals:a,strict:s})}var ID={exports:{}},DD={};/** 597 * @license React 598 * use-sync-external-store-shim/with-selector.production.js 599 * 600 * Copyright (c) Meta Platforms, Inc. and affiliates. 601 * 602 * This source code is licensed under the MIT license found in the 603 * LICENSE file in the root directory of this source tree. 604 */var Iy=y,pte=qk;function mte(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var gte=typeof Object.is=="function"?Object.is:mte,yte=pte.useSyncExternalStore,vte=Iy.useRef,xte=Iy.useEffect,bte=Iy.useMemo,wte=Iy.useDebugValue;DD.useSyncExternalStoreWithSelector=function(t,e,n,r,s){var i=vte(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=bte(function(){function c(f){if(!u){if(u=!0,d=f,f=r(f),s!==void 0&&o.hasValue){var g=o.value;if(s(g,f))return h=g}return h=f}if(g=h,gte(d,f))return g;var m=r(f);return s!==void 0&&s(g,m)?(d=f,g):(d=f,h=m)}var u=!1,d,h,p=n===void 0?null:n;return[function(){return c(e())},p===null?void 0:function(){return c(p())}]},[e,n,r,s]);var a=yte(t,i[0],i[1]);return xte(function(){o.hasValue=!0,o.value=a},[a]),wte(a),a};ID.exports=DD;var kte=ID.exports,Ste=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},Cte=({contentComponent:t})=>
604{const e=qk.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return l.jsx(l.Fragment,{children:Object.values(e)})};function jte(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:K0.createPortal(r.reactElement,r.element,n)},t.forEach(s=>s())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(s=>s())}}}var Nte=class extends V.Component{constructor(t){var e;super(t),this.editorContentRef=V.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=jte(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:Ste(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&l.jsx(Cte,{contentComponent:t.contentComponent})]})}},_te=y.forwardRef((t,e)=>{const n=V.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return V.createElement(Nte,{key:n,innerRef:e,...t})}),LD=V.memo(_te),Ete=typeof window<"u"?y.useLayoutEffect:y.useEffect,Tte=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,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(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function Rte(t){var e;const[n]=y.useState(()=>new Tte(t.editor)),r=kte.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:fte);return Ete(()=>n.watch(t.editor),[t.editor,n]),y.useDebugValue(r),r}var Ate=!1,Dw=typeof window>"u",Ote=Dw||!!(typeof window<"u"&&window.next),Pte=class $D{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Dw||Ote?null:this.createEditor();if(this.options.current.immediatelyRender&&Dw&&Ate)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 e={...this.options.current,onBeforeCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onBeforeCreate)==null?void 0:i.call(s,...r)},onBlur:(...r)=>{var s,i;return(i=(s=this.options.current).onBlur)==null?void 0:i.call(s,...r)},onCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onCreate)==null?void 0:i.call(s,...r)},onDestroy:(...r)=>{var s,i;return(i=(s=this.options.current).onDestroy)==null?void 0:i.call(s,...r)},onFocus:(...r)=>{var s,i;return(i=(s=this.options.current).onFocus)==null?void 0:i.call(s,...r)},onSelectionUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onSelectionUpdate)==null?void 0:i.call(s,...r)},onTransaction:(...r)=>{var s,i;return(i=(s=this.options.current).onTransaction)==null?void 0:i.call(s,...r)}
604,onUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onUpdate)==null?void 0:i.call(s,...r)},onContentError:(...r)=>{var s,i;return(i=(s=this.options.current).onContentError)==null?void 0:i.call(s,...r)},onDrop:(...r)=>{var s,i;return(i=(s=this.options.current).onDrop)==null?void 0:i.call(s,...r)},onPaste:(...r)=>{var s,i;return(i=(s=this.options.current).onPaste)==null?void 0:i.call(s,...r)},onDelete:(...r)=>{var s,i;return(i=(s=this.options.current).onDelete)==null?void 0:i.call(s,...r)}};return new vee(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=n.extensions)==null?void 0:o[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?$D.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Mte(t={},e=[]){const n=y.useRef(t);n.current=t;const[r]=y.useState(()=>new Pte(n)),s=qk.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return y.useDebugValue(s),y.useEffect(r.onRender(e)),Rte({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}var BD=y.createContext({editor:null});BD.Consumer;var Ite=y.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Dte=()=>y.useContext(Ite);V.forwardRef((t,e)=>{const{onDragStart:n}=Dte(),r=t.as||"div";return l.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});V.createContext({markViewContentRef:()=>{}});var vS=y.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});vS.displayName="TiptapContext";var Lte=()=>y.useContext(vS);function zD({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const s=y.useMemo(()=>({editor:r}),[r]),i=y.useMemo(()=>({editor:r}),[r]);return l.jsx(BD.Provider,{value:i,children:l.jsx(vS.Provider,{value:s,children:n})})}zD.displayName="Tiptap";function FD({...t}){const{editor:e}=Lte();return l.jsx(LD,{editor:e,...t})}FD.displayName="Tiptap.Content";Object.assign(zD,{Content:FD});var zm=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},$te=/^\s*>\s$/,Bte=mr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return zm("blockquote",{...Jt(this.options.HTMLAttributes,t),children:zm("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((s,i)=>{var o,a;const d=((a=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?a:e.renderChildren([s])).split(` 605`).map(h=>h.trim()===""?n:`${n} ${h}`);r.push(d.join(` 606`))}),r.join(` 607${n} 608`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}}
vendor: 10,333 bytes, lines 608-629
608,addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Yc({find:$te,type:this.type})]}}),zte=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Fte=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Ute=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Vte=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Hte=hl.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return zm("strong",{...Jt(this.options.HTMLAttributes,t),children:zm("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Gc({find:zte,type:this.type}),Gc({find:Ute,type:this.type})]},addPasteRules(){return[il({find:Fte,type:this.type}),il({find:Vte,type:this.type})]}}),Wte=/(^|[^`])`([^`]+)`(?!`)$/,qte=/(^|[^`])`([^`]+)`(?!`)/g,Kte=hl.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Jt(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Gc({find:Wte,type:this.type})]},addPasteRules(){return[il({find:qte,type:this.type})]}}),ax=4,Gte=/^```([a-z]+)?[\s\n]$/,Yte=/^~~~([a-z]+)?[\s\n]$/,Jte=mr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:ax,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const i=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Jt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const s=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${s}`,e.renderChildren(t.content),"```"].join(` 609`):r=`\`\`\`${s} 610 611\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:ax,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?t.commands.insertContent(a):t.commands.command(({tr:c})=>{const{from:u,to:d}=s,f=r.doc.textBetween(u,d,` 612`,` 613`).split(` 614`).map(g=>a+g).join(` 615`);return c.replaceWith(u,d,r.schema.text(f)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:ax,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;return i.parent.type!==this.type?!1:o?t.commands.command(({tr:a})=>{var c;const{pos:u}=i,d=i.start(),h=i.end(),f=r.doc.textBetween(d,h,` 616`,` 617`).split(` 618`);let g=0,m=0;const v=u-d;for(let E=0;E<f.length;E+=1){if(m+f[E].length>=v){g=E;break}m+=f[E].length+1}const b=((c=f[g].match(/^ */))==null?void 0:c[0])||"",w=Math.min(b.length,n);if(w===0)return!0;let k=d;for(let E=0;E<g;E+=1)k+=f[E].length+1;return a.delete(k,k+w),u-k<=w&&a.setSelection(Me.create(a.doc,k)),!0}):t.commands.command(({tr:a})=>{const{from:c,to:u}=s,p=r.doc.textBetween(c,u,` 619`,` 620`).split(` 621`).map(f=>{var g;const m=((g=f.match(/^ */))==null?void 0:g[0])||"",v=Math.min(m.length,n);return f.slice(v)}).join(` 622`);return a.replaceWith(c,u,r.schema.text(p)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` 623 624`);return!i||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const a=s.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(Ve.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Mw({find:Gte,type:this.type,getAttributes:t=>({language:t[1]})}),Mw({find:Yte,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new It({key:new dn("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!n||!i)return!1;const{tr:o,schema:a}=t.state,c=a.text(n.replace(/\r\n?/g,` 625`));return o.replaceSelectionWith(this.type.create({language:i},c)),o.selection.$from.parent.type!==this.type&&o.setSelection(Me.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),Qte=mr.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 626 627`):""}),Xte=mr.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Jt(this.options.HTMLAttributes,t)]},renderText(){return` 628`},renderMarkdown:()=>` 629`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,c=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&c&&o){const h=c.filter(p=>a.includes(p.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Zte=mr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Jt(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(r);return t.content?`${s} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Mw({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),ene=mr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Jt(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!wee(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return mD(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:a})=>{if(a){const{$to:c}=o.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(Me.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(Ne.create(o.doc,c.pos)):o.setSelection(Me.create(o.doc,c.pos));else{const d=i.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,h=d==null?void 0:d.create();h&&(o.insert(u,h),o.setSelection(Me.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[OD({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
vendor: 4,520 bytes, line 629
629ype})]}}),tne=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,nne=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,rne=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,sne=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ine=hl.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Jt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Gc({find:tne,type:this.type}),Gc({find:rne,type:this.type})]},addPasteRules(){return[il({find:nne,type:this.type}),il({find:sne,type:this.type})]}});const one="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
629ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",ane="ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
629ºÐ´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",Lw="numeric",$w="ascii",Bw="alpha",bd="asciinumeric",Zu="alphanumeric",zw="domain",UD="emoji",lne="scheme",cne="slashscheme",lx="whitespace";function une(t,e){return t in e||(e[t]=[]),e[t]}function Na(t,e,n){e[Lw]&&(e[bd]=!0,e[Zu]=!0),e[$w]&&(e[bd]=!0,e[Bw]=!0),e[bd]&&(e[Zu]=!0),e[Bw]&&(e[Zu]=!0),e[Zu]&&(e[zw]=!0),e[UD]&&(e[zw]=!0);for(const r in e){const s=une(r,n);s.indexOf(t)<0&&s.push(t)}}function dne(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function lr(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}lr.groups={};lr.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const s=e.jr[r][0],i=e.jr[r][1];if(i&&s.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let s=0;s<t.length;s++)this.tt(t[s],e,n,r)},tr(t,e,n,r){r=r||lr.groups;let s;return e&&e.j?s=e:(s=new lr(e),n&&r&&Na(e,n,r)),this.jr.push([t,s]),s},ts(t,e,n,r){let s=this;const i=t.length;if(!i)return s;for(let o=0;o<i-1;o++)s=s.tt(t[o]);return s.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||lr.groups;const s=this;if(e&&e.j)return s.j[t]=e,e;const i=e;let o,a=s.go(t);if(a?(o=new lr,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new lr,i){if(r)if(o.t&&typeof o.t=="string"){const c=Object.assign(dne(o.t,r),n);Na(i,c,r)}else n&&Na(i,n,r);o.t=i}return s.j[t]=o,o}};const Ue=(t,e,n,r,s)=>t.ta(e,n,r,s),Bt=(t,e,n,r,s)=>t.tr(e,n,r,s),v_=(t,e,n,r,s)=>t.ts(e,n,r,s),ee=(t,e,n,r,s)=>t.tt(e,n,r,s),ai="WORD",Fw="UWORD",VD="ASCIINUMERICAL",HD="ALPHANUMERICAL",Ch="LOCALHOST",Uw="TLD",Vw="UTLD",jp="SCHEME",$l="SLASH_SCHEME",xS="NUM",Hw="WS",bS="NL",wd="OPENBRACE",kd="CLOSEBRACE",Fm="OPENBRACKET",Um="CLOSEBRACKET",Vm="OPENPAREN",Hm="CLOSEPAREN",Wm="OPENANGLEBRACKET",qm="CLOSEANGLEBRACKET",Km="FULLWIDTHLEFTPAREN",Gm="FULLWIDTHRIGHTPAREN",Ym="LEFTCORNERBRACKET",Jm="RIGHTCORNERBRACKET",Qm="LEFTWHITECORNERBRACKET",Xm="RIGHTWHITECORNERBRACKET",Zm="FULLWIDTHLESSTHAN",eg="FULLWIDTHGREATERTHAN",tg="AMPERSAND",ng="APOSTROPHE",rg="ASTERISK",Zi="AT",sg="BACKSLASH",ig="BACKTICK",og="CARET",ao="COLON",wS="COMMA",ag="DOLLAR",Os="DOT",lg="EQUALS",kS="EXCLAMATION",Mr="HYPHEN",Sd="PERCENT",cg="PIPE",ug="PLUS",dg="POUND",Cd="QUERY",SS="QUOTE",WD="FULLWIDTHMIDDLEDOT",CS="SEMI",Ps="SLASH",jd="TILDE",hg="UNDERSCORE",qD="EMOJI",fg="SYM";var KD=Object.freeze({__proto__:null,ALPHANUMERICAL:HD,AMPERSAND:tg,APOSTROPHE:ng,ASCIINUMERICAL:VD,ASTERISK:rg,AT:Zi,BACKSLASH:sg,BACKTICK:ig,CARET:og,CLOSEANGLEBRACKET:qm,CLOSEBRACE:kd,CLOSEBRACKET:Um,CLOSEPAREN:Hm,COLON:ao,COMMA:wS,DOLLAR:ag,DOT:Os,EMOJI:qD,EQUALS:lg,EXCLAMATION:kS,FULLWIDTHGREATERTHAN:eg,FULLWIDTHLEFTPAREN:Km,FULLWIDTHLESSTHAN:Zm,FULLWIDTHMIDDLEDOT:WD,FULLWIDTHRIGHTPAREN:Gm,HYPHEN:Mr,LEFTCORNERBRACKET:Ym,LEFTWHITECORNERBRACKET:Qm,LOCALHOST:Ch,NL:bS,NUM:xS,OPENANGLEBRACKET:Wm,OPENBRACE:wd,OPENBRACKET:Fm,OPENPAREN:Vm,PERCENT:Sd,PIPE:cg,PLUS:ug,POUND:dg,QUERY:Cd,QUOTE:SS,RIGHTCORNERBRACKET:Jm,RIGHTWHITECORNERBRACKET:Xm,SCHEME:jp,SEMI:CS,SLASH:Ps,SLASH_SCHEME:$l,SYM:fg,TILDE:jd,TLD:Uw,UNDERSCORE:hg,UTLD:Vw,UWORD:Fw,WORD:ai,WS:Hw});
vendor: 28,996 bytes, lines 629-644
629const si=/[a-z]/,$u=new RegExp("\\p{L}","u"),cx=new RegExp("\\p{Emoji}","u"),ii=/\d/,ux=/\s/,x_="\r",dx=` 630`,hne="ï¸",fne="â",hx="";let Yf=null,Jf=null;function pne(t=[]){const e={};lr.groups=e;const n=new lr;Yf==null&&(Yf=b_(one)),Jf==null&&(Jf=b_(ane)),ee(n,"'",ng),ee(n,"{",wd),ee(n,"}",kd),ee(n,"[",Fm),ee(n,"]",Um),ee(n,"(",Vm),ee(n,")",Hm),ee(n,"<",Wm),ee(n,">",qm),ee(n,"ï¼",Km),ee(n,"ï¼",Gm),ee(n,"ã",Ym),ee(n,"ã",Jm),ee(n,"ã",Qm),ee(n,"ã",Xm),ee(n,"ï¼",Zm),ee(n,"ï¼",eg),ee(n,"&",tg),ee(n,"*",rg),ee(n,"@",Zi),ee(n,"`",ig),ee(n,"^",og),ee(n,":",ao),ee(n,",",wS),ee(n,"$",ag),ee(n,".",Os),ee(n,"=",lg),ee(n,"!",kS),ee(n,"-",Mr),ee(n,"%",Sd),ee(n,"|",cg),ee(n,"+",ug),ee(n,"#",dg),ee(n,"?",Cd),ee(n,'"',SS),ee(n,"/",Ps),ee(n,";",CS),ee(n,"~",jd),ee(n,"_",hg),ee(n,"\\",sg),ee(n,"ã»",WD);const r=Bt(n,ii,xS,{[Lw]:!0});Bt(r,ii,r);const s=Bt(r,si,VD,{[bd]:!0}),i=Bt(r,$u,HD,{[Zu]:!0}),o=Bt(n,si,ai,{[$w]:!0});Bt(o,ii,s),Bt(o,si,o),Bt(s,ii,s),Bt(s,si,s);const a=Bt(n,$u,Fw,{[Bw]:!0});Bt(a,si),Bt(a,ii,i),Bt(a,$u,a),Bt(i,ii,i),Bt(i,si),Bt(i,$u,i);const c=ee(n,dx,bS,{[lx]:!0}),u=ee(n,x_,Hw,{[lx]:!0}),d=Bt(n,ux,Hw,{[lx]:!0});ee(n,hx,d),ee(u,dx,c),ee(u,hx,d),Bt(u,ux,d),ee(d,x_),ee(d,dx),Bt(d,ux,d),ee(d,hx,d);const h=Bt(n,cx,qD,{[UD]:!0});ee(h,"#"),Bt(h,cx,h),ee(h,hne,h);const p=ee(h,fne);ee(p,"#"),Bt(p,cx,h);const f=[[si,o],[ii,s]],g=[[si,null],[$u,a],[ii,i]];for(let m=0;m<Yf.length;m++)Wi(n,Yf[m],Uw,ai,f);for(let m=0;m<Jf.length;m++)Wi(n,Jf[m],Vw,Fw,g);Na(Uw,{tld:!0,ascii:!0},e),Na(Vw,{utld:!0,alpha:!0},e),Wi(n,"file",jp,ai,f),Wi(n,"mailto",jp,ai,f),Wi(n,"http",$l,ai,f),Wi(n,"https",$l,ai,f),Wi(n,"ftp",$l,ai,f),Wi(n,"ftps",$l,ai,f),Na(jp,{scheme:!0,ascii:!0},e),Na($l,{slashscheme:!0,ascii:!0},e),t=t.sort((m,v)=>m[0]>v[0]?1:-1);for(let m=0;m<t.length;m++){const v=t[m][0],b=t[m][1]?{[lne]:!0}:{[cne]:!0};v.indexOf("-")>=0?b[zw]=!0:si.test(v)?ii.test(v)?b[bd]=!0:b[$w]=!0:b[Lw]=!0,v_(n,v,v,b)}return v_(n,"localhost",Ch,{ascii:!0}),n.jd=new lr(fg),{start:n,tokens:Object.assign({groups:e},KD)}}function GD(t,e){const n=mne(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o<r;){let a=t,c=null,u=0,d=null,h=-1,p=-1;for(;o<r&&(c=a.go(n[o]));)a=c,a.accepts()?(h=0,p=0,d=a):h>=0&&(h+=n[o].length,p++),u+=n[o].length,i+=n[o].length,o++;i-=h,o-=p,u-=h,s.push({t:d.t,v:e.slice(i-u,i),s:i-u,e:i})}return s}function mne(t){const e=[],n=t.length;let r=0;for(;r<n;){let s=t.charCodeAt(r),i,o=s<55296||s>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function Wi(t,e,n,r,s){let i;const o=e.length;for(let a=0;a<o-1;a++){const c=e[a];t.j[c]?i=t.j[c]:(i=new lr(r),i.jr=s.slice(),t.j[c]=i),t=i}return i=new lr(n),i.jr=s.slice(),t.j[e[o-1]]=i,i}function b_(t){const e=[],n=[];let r=0,s="0123456789";for(;r<t.length;){let i=0;for(;s.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(t[r]),r++}return e}const jh={defaultProtocol:"http",events:null,format:w_,formatHref:w_,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function jS(t,e=null){let n=Object.assign({},jh);t&&(n=Object.assign(n,t instanceof jS?t.o:t));const r=n.ignoreTags,s=[];for(let i=0;i<r.length;i++)s.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=s}jS.prototype={o:jh,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=n.t in s?s[n.t]:jh[t],typeof s=="function"&&r&&(s=s(e,n))):typeof s=="function"&&r&&(s=s(e,n.t,n)),s)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function w_(t){return t}function YD(t,e){this.t="token",this.v=t,this.tk=e}YD.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"â¦":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=jh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),s=t.get("tagName",n,e),i=this.toFormattedString(t),o={},a=t.get("className",n,e),c=t.get("target",n,e),u=t.get("rel",n,e),d=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),c&&(o.target=c),u&&(o.rel=u),d&&Object.assign(o,d),{tagName:s,attributes:o,content:i,eventListeners:h}}};function Dy(t,e){class n extends YD{constructor(s,i){super(s,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const k_=Dy("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),S_=Dy("text"),gne=Dy("nl"),Qf=Dy("url",{isLink:!0,toHref(t=jh.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Ch&&t[1].t===ao}}),Pr=t=>new lr(t);function yne({groups:t}){const e=t.domain.concat([tg,rg,Zi,sg,ig,og,ag,lg,Mr,xS,Sd,cg,ug,dg,Ps,fg,jd,hg]),n=[ng,ao,wS,Os,kS,Sd,Cd,SS,CS,Wm,qm,wd,kd,Um,Fm,Vm,Hm,Km,Gm,Ym,Jm,Qm,Xm,Zm,eg],r=[tg,ng,rg,sg,ig,og,ag,lg,Mr,wd,kd,Sd,cg,ug,dg,Cd,Ps,fg,jd,hg],s=Pr(),i=ee(s,jd);Ue(i,r,i),Ue(i,t.domain,i);const o=Pr(),a=Pr(),c=Pr();Ue(s,t.domain,o),Ue(s,t.scheme,a),Ue(s,t.slashscheme,c),Ue(o,r,i),Ue(o,t.domain,o);const u=ee(o,Zi);ee(i,Zi,u),ee(a,Zi,u),ee(c,Zi,u);const d=ee(i,Os);Ue(d,r,i),Ue(d,t.domain,i);const h=Pr();Ue(u,t.domain,h),Ue(h,t.domain,h);const p=ee(h,Os);Ue(p,t.domain,h);const f=Pr(k_);Ue(p,t.tld,f),Ue(p,t.utld,f),ee(u,Ch,f);const g=ee(h,Mr);ee(g,Mr,g),Ue(g,t.domain,h),Ue(f,t.domain,h),ee(f,Os,p),ee(f,Mr,g);const m=ee(f,ao);Ue(m,t.numeric,k_);const v=ee(o,Mr),x=ee(o,Os);ee(v,Mr,v),Ue(v,t.domain,o),Ue(x,r,i),Ue(x,t.domain,o);const b=Pr(Qf);Ue(x,t.tld,b),Ue(x,t.utld,b),Ue(b,t.domain,o),Ue(b,r,i),ee(b,Os,x),ee(b,Mr,v),ee(b,Zi,u);const w=ee(b,ao),k=Pr(Qf);Ue(w,t.numeric,k);const j=Pr(Qf),E=Pr();Ue(j,e,j),Ue(j,n,E),Ue(E,e,j),Ue(E,n,E),ee(b,Ps,j),ee(k,Ps,j);const N=ee(a,ao),S=ee(c,ao),C=ee(S,Ps),_=ee(C,Ps);Ue(a,t.domain,o),ee(a,Os,x),ee(a,Mr,v),Ue(c,t.domain,o),ee(c,Os,x),ee(c,Mr,v),Ue(N,t.domain,j),ee(N,Ps,j),ee(N,Cd,j),Ue(_,t.domain,j),Ue(_,e,j),ee(_,Ps,j);const R=[[wd,kd],[Fm,Um],[Vm,Hm],[Wm,qm],[Km,Gm],[Ym,Jm],[Qm,Xm],[Zm,eg]];for(let O=0;O<R.length;O++){const[L,A]=R[O],z=ee(j,L);ee(E,L,z),ee(z,A,j);const F=Pr(Qf);Ue(z,e,F);const H=Pr();Ue(z,n),Ue(F,e,F),Ue(F,n,H),Ue(H,e,F),Ue(H,n,H),ee(F,A,j),ee(H,A,j)}return ee(s,Ch,b),ee(s,bS,gne),{start:s,tokens:KD}}function vne(t,e,n){let r=n.length,s=0,i=[],o=[];for(;s<r;){let a=t,c=null,u=null,d=0,h=null,p=-1;for(;s<r&&!(c=a.go(n[s].t));)o.push(n[s++]);for(;s<r&&(u=c||a.go(n[s].t));)c=null,a=u,a.accepts()?(p=0,h=a):p>=0&&p++,s++,d++;if(p<0)s-=d,s<r&&(o.push(n[s]),s++);else{o.length>0&&(i.push(fx(S_,e,o)),o=[]),s-=p,d-=p;const f=h.t,g=n.slice(s-d,s);i.push(fx(f,e,g))}}return o.length>0&&i.push(fx(S_,e,o)),i}function fx(t,e,n){const r=n[0].s,s=n[n.length-1].e,i=e.slice(r,s);return new t(i,n)}const xne=typeof console<"u"&&console&&console.warn||(()=>{}),bne="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",bt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function wne(){return lr.groups={},bt.scanner=null,bt.parser=null,bt.tokenQueue=[],bt.pluginQueue=[],bt.customSchemes=[],bt.initialized=!1,bt}function C_(t,e=!1){if(bt.initialized&&xne(`linkifyjs: already initialized - will not register custom scheme "${t}" ${bne}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 6311. Must only contain digits, lowercase ASCII letters or "-" 6322. Cannot start or end with "-" 6333. "-" cannot repeat`);bt.customSchemes.push([t,e])}function kne(){bt.scanner=pne(bt.customSchemes);for(let t=0;t<bt.tokenQueue.length;t++)bt.tokenQueue[t][1]({scanner:bt.scanner});bt.parser=yne(bt.scanner.tokens);for(let t=0;t<bt.pluginQueue.length;t++)bt.pluginQueue[t][1]({scanner:bt.scanner,parser:bt.parser});return bt.initialized=!0,bt}function NS(t){return bt.initialized||kne(),vne(bt.parser.start,t,GD(bt.scanner.start,t))}NS.scan=GD;function JD(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new jS(n),s=NS(t),i=[];for(let o=0;o<s.length;o++){const a=s[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}var _S="[\0-  áá â-\u2029âã]",Sne=new RegExp(_S),Cne=new RegExp(`${_S}$`),jne=new RegExp(_S,"g");function Nne(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function _ne(t){return new It({key:new dn("autolink"),appendTransaction:(e,n,r)=>{const s=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),i=e.some(u=>u.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,a=aD(n.doc,[...e]);if(pD(a).forEach(({newRange:u})=>{const d=xZ(r.doc,u,f=>f.isTextblock);let h,p;if(d.length>1)h=d[0],p=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(!Cne.test(f))return;h=d[0],p=r.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&p){const f=p.split(Sne).filter(Boolean);if(f.length<=0)return!1;const g=f[f.length-1],m=h.pos+p.lastIndexOf(g);if(!g)return!1;const v=NS(g).map(x=>x.toObject(t.defaultProtocol));if(!Nne(v))return!1;v.filter(x=>x.isLink).map(x=>({...x,from:m+x.start+1,to:m+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate(x.value)).filter(x=>t.shouldAutoLink(x.value)).forEach(x=>{fS(x.from,x.to,r.doc).some(b=>b.mark.type===t.type)||o.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!o.steps.length)return o}})}function Ene(t){return new It({key:new dn("handleClickLink"),props:{handleClick:(e,n,r)=>{var s,i;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const c=r.target;if(!c)return!1;const u=t.editor.view.dom;o=c.closest("a"),o&&!u.contains(o)&&(o=null)}if(!o)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const c=fD(e.state,t.type.name),u=(s=o.href)!=null?s:c.href,d=(i=o.target)!=null?i:c.target;u&&(window.open(u,d),a=!0)}return a}}})}function Tne(t){return new It({key:new dn("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:s}=t,{state:i}=e,{selection:o}=i,{empty:a}=o;if(a)return!1;let c="";r.content.forEach(d=>{c+=d.textContent});const u=JD(c,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===c);return!c||!u||s!==void 0&&!s(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function ua(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!t||t.replace(jne,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var QD=hl.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){C_(t);return}C_(t.scheme,t.optionalSlashes)})},onDestroy(){wne()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!ua(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const s=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!ua(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ua(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Jt(this.options.HTMLAttributes,t),0]:["a",Jt(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,s,i;const o=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",a=(i=(s=t.attrs)==null?void 0:s.title)!=null?i:"",c=e.renderChildren(t);return a?`[${c}](${o} "${a}")`:`[${c}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ua(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!ua(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[il({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,s=JD(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!ua(o,n),protocols:n,defaultProtocol:r}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(_ne({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!ua(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(Ene({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(Tne({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),Rne=QD,Ane=Object.defineProperty,One=(t,e)=>{for(var n in e)Ane(t,n,{get:e[n],enumerable:!0})},Pne="listItem",j_="textStyle",N_=/^\s*([-+*])\s$/,XD=mr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Jt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 634`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Pne,this.editor.getAttributes(j_)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Yc({find:N_,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Yc({find:N_,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(j_),editor:this.editor})),[t]}}),ZD=mr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Jt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let s=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(o=>o.type==="paragraph"))s=r(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const c=t.tokens.slice(1),u=r(c);s.push(...u)}}else s=r(t.tokens)}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,n)=>yS(t,e,r=>{var s,i;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((i=(s=r.meta)==null?void 0:s.parentAttrs)==null?void 0:i.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)}}}),Mne={};One(Mne,{findListItemPos:()=>Xh,getNextListDepth:()=>ES,handleBackspace:()=>Ww,handleDelete:()=>qw,hasListBefore:()=>eL,hasListItemAfter:()=>Ine,hasListItemBefore:()=>tL,listItemHasSubList:()=>nL,nextListIsDeeper:()=>rL,nextListIsHigher:()=>sL});var Xh=(t,e)=>{const{$from:n}=e.selection,r=on(t,e.schema);let s=null,i=n.depth,o=n.pos,a=null;for(;i>0&&a===null;)s=n.node(i),s.type===r?a=i:(i-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},ES=(t,e)=>{const n=Xh(t,e);if(!n)return!1;const[,r]=RZ(e,t,n.$pos.pos+4);return r},eL=(t,e,n)=>{const{$anchor:r}=t.selection,s=Math.max(0,r.pos-2),i=t.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},tL=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((n=s.nodeBefore)==null?void 0:n.type.name)!==t)},nL=(t,e,n)=>{if(!n)return!1;const r=on(t,e.schema);let s=!1;return n.descendants(i=>{i.type===r&&(s=!0)}),s},Ww=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Yo(t.state,e)&&eL(t.state,e,n)){const{$anchor:a}=t.state.selection,c=t.state.doc.resolve(a.before()-1),u=[];c.node().descendants((p,f)=>{p.type.name===e&&u.push({node:p,pos:f})});const d=u.at(-1);if(!d)return!1;const h=t.state.doc.resolve(c.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Yo(t.state,e)||!MZ(t.state))return!1;const r=Xh(e,t.state);if(!r)return!1;const i=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=nL(e,t.state,i);return tL(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},rL=(t,e)=>{const n=ES(t,e),r=Xh(t,e);return!r||!n?!1:n>r.depth},sL=(t,e)=>{const n=ES(t,e),r=Xh(t,e);return!r||!n?!1:n<r.depth},qw=(t,e)=>{if(!Yo(t.state,e)||!PZ(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:rL(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():sL(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},Ine=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((n=s.nodeAfter)==null?void 0:n.type.name)!==t)},iL=Xt.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&qw(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&qw(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Ww(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Ww(t,n,r)&&(e=!0)}),e}}}}),__=/^(\s*)(\d+)\.\s+(.*)$/,Dne=/^\s/;function Lne(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n],i=s.match(__);if(!i)break;const[,o,a,c]=i,u=o.length;let d=c,h=n+1;const p=[s];for(;h<t.length;){const f=t[h];if(f.match(__))break;if(f.trim()==="")p.push(f),d+=` 635`,h+=1;else if(f.match(Dne))p.push(f),d+=` 636${f.slice(u+2)}`,h+=1;else break}e.push({indent:u,number:parseInt(a,10),content:d.trim(),raw:p.join(` 637`)}),r=h,n=h}return[e,r]}function oL(t,e,n){var r;const s=[];let i=0;for(;i<t.length;){const o=t[i];if(o.indent===e){const a=o.content.split(` 638`),c=((r=a[0])==null?void 0:r.trim())||"",u=[];c&&u.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});const d=a.slice(1).join(` 639`).trim();if(d){const f=n.blockTokens(d);u.push(...f)}let h=i+1;const p=[];for(;h<t.length&&t[h].indent>e;)p.push(t[h]),h+=1;if(p.length>0){const f=Math.min(...p.map(m=>m.indent)),g=oL(p,f,n);u.push({type:"list",ordered:!0,start:p[0].number,items:g,raw:p.map(m=>m.raw).join(` 640`)})}s.push({type:"list_item",raw:o.raw,tokens:u}),i=h}else i+=1}return s}function $ne(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var Bne="listItem",E_="textStyle",T_=/^(\d+)\.\s$/,aL=mr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Jt(this.options.HTMLAttributes,n),0]:["ol",Jt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?$ne(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 641`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const s=t.split(` 642`),[i,o]=Lne(s);if(i.length===0)return;const a=oL(i,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:a,raw:s.slice(0,o).join(` 643`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Bne,this.editor.getAttributes(E_)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Yc({find:T_,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Yc({find:T_,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(E_)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),zne=/^\s*(\[([( |x])?\])\s$/,Fne=mr.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Jt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const s=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return yS(t,e,s)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),c=document.createElement("div"),u=h=>{var p,f;a.ariaLabel=((f=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:f.call(p,h,a.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};u(t),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:p}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const g=n();if(typeof g!="number")return!1;const m=f.doc.nodeAt(g);return f.setNodeMarkup(g,void 0,{...m==null?void 0:m.attrs,checked:p}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,p])=>{s.setAttribute(h,p)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,o),s.append(i,c),Object.entries(e).forEach(([h,p])=>{s.setAttribute(h,p)});let d=new Set(Object.keys(e));return{dom:s,contentDOM:c,update:h=>{if(h.type!==this.type)return!1;s.dataset.checked=h.attrs.checked,a.checked=h.attrs.checked,u(h);const p=r.extensionManager.attributes,f=Sh(h,p),g=new Set(Object.keys(f)),m=this.options.HTMLAttributes;return d.forEach(v=>{g.has(v)||(v in m?s.setAttribute(v,m[v]):s.removeAttribute(v))}),Object.entries(f).forEach(([v,x])=>{x==null?v in m?s.setAttribute(v,m[v]):s.removeAttribute(v):s.setAttribute(v,x)}),d=g,!0}}}},addInputRules(){return[Yc({find:zne,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Une=mr.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Jt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 644`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=i=>{const o=Iw(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>
vendor: 5,025 bytes, line 644
644({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,c)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:c}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=Iw(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Xt.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(XD.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(ZD.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(iL.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(aL.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Fne.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Une.configure(this.options.taskList)),t}});var R_=" ",Vne="Â ",Hne=mr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Jt(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===R_||r[0].text===Vne)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,s;if(!t)return"";const i=Array.isArray(t.content)?t.content:[];if(i.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((s=n==null?void 0:n.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?R_:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Wne=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,qne=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Kne=hl.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Jt(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Gc({find:Wne,type:this.type})]},addPasteRules(){return[il({find:qne,type:this.type})]}}),Gne=mr.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),Yne=hl.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Jt(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Jne(t={}){return new It({view(e){return new Qne(e,t)}})}class Qne{constructor(e,n){var r;this.editorView=e,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(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}
vendor: 4,302 bytes, line 644
644destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let h=e.nodeBefore,p=e.nodeAfter;if(h||p){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let g=f.getBoundingClientRect(),m=h?g.bottom:g.top;h&&p&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*a;r={left:g.left,right:g.right,top:m-v,bottom:m+v}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*o;r={left:h.left-p,right:h.left+p,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(),p=h.width/c.offsetWidth,f=h.height/c.offsetHeight;u=h.left-c.scrollLeft*p,d=h.top-c.scrollTop*f}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=sI(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ht extends Ve{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ht.valid(r)?new Ht(r):Ve.near(r)}content(){return le.empty}eq(e){return e instanceof Ht&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ht(e.resolve(n.pos))}getBookmark(){return new TS(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!Xne(e)||!Zne(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ht.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){i=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let c=e.doc.resolve(s);if(Ht.valid(c))return c}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!Ne.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let a=e.doc.resolve(s);if(Ht.valid(a))return a}return null}}}Ht.prototype.visible=!1;Ht.findFrom=Ht.findGapCursorFrom;Ve.jsonID("gapcursor",Ht);class TS{constructor(e){this.pos=e}map(e){return new TS(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ht.valid(n)?new Ht(n):Ve.near(n)}}function lL(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function Xne(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||lL(s.type))return!0;
vendor: 19,237 bytes, line 644
644if(s.inlineContent)return!1}}return!0}function Zne(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||lL(s.type))return!0;if(s.inlineContent)return!1}}return!0}function ere(){return new It({props:{decorations:sre,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ht.valid(n)?new Ht(n):null},handleClick:nre,handleKeyDown:tre,handleDOMEvents:{beforeinput:rre}}})}const tre=ZI({ArrowLeft:Xf("horiz",-1),ArrowRight:Xf("horiz",1),ArrowUp:Xf("vert",-1),ArrowDown:Xf("vert",1)});function Xf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,a=e>0?o.$to:o.$from,c=o.empty;if(o instanceof Me){if(!i.endOfTextblock(n)||a.depth==0)return!1;c=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Ht.findGapCursorFrom(a,e,c);return u?(s&&s(r.tr.setSelection(new Ht(u))),!0):!1}}function nre(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ht.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&Ne.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ht(r))),!0)}function rre(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ht))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let s=J.empty;for(let o=r.length-1;o>=0;o--)s=J.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new le(s,0,0));return i.setSelection(Me.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function sre(t){if(!(t.selection instanceof Ht))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Rt.create(t.doc,[Qn.widget(t.selection.head,e,{key:"gapcursor"})])}var pg=200,xn=function(){};xn.prototype.append=function(e){return e.length?(e=xn.from(e),!this.length&&e||e.length<pg&&this.leafAppend(e)||this.length<pg&&e.leafPrepend(this)||this.appendInner(e)):this};xn.prototype.prepend=function(e){return e.length?xn.from(e).append(this):this};xn.prototype.appendInner=function(e){return new ire(this,e)};xn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?xn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};xn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};xn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};xn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},n,r),s};xn.from=function(e){return e instanceof xn?e:e&&e.length?new cL(e):xn.empty};var cL=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,a){for(var c=i;c<o;c++)if(s(this.values[c],a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,a){for(var c=i-1;c>=o;c--)if(s(this.values[c],a+c)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=pg)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=pg)return new e(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(xn);xn.empty=new cL([]);var ire=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,i,o){var a=this.left.length;if(s<a&&this.left.forEachInner(r,s,Math.min(i,a),o)===!1||i>a&&this.right.forEachInner(r,Math.max(s-a,0),Math.min(this.length,i)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var a=this.left.length;if(s>a&&this.right.forEachInvertedInner(r,s-a,Math.max(i,a)-a,o+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(s,a),i,o)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var i=this.left.length;return s<=i?this.left.slice(r,s):r>=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(xn);const ore=500;class gs{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,a,c,u=[],d=[];return this.items.forEach((h,p)=>{if(!h.step){s||(s=this.remapping(r,p+1),i=s.maps.length),i--,d.push(h);return}if(s){d.push(new Ms(h.map));let f=h.step.map(s.slice(i)),g;f&&o.maybeStep(f).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],u.push(new Ms(g,void 0,void 0,u.length+d.length))),i--,g&&s.appendMap(g,i)}else o.maybeStep(h.step);if(h.selection)return a=s?h.selection.map(s.slice(i)):h.selection,c=new gs(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:a}}addTransform(e,n,r,s){let i=[],o=this.eventCount,a=this.items,c=!s&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),p=new Ms(e.mapping.maps[d],h,n),f;(f=c&&c.merge(p))&&(p=f,d?i.pop():a=a.slice(0,a.length-1)),i.push(p),n&&(o++,n=void 0),s||(c=p)}let u=o-r.depth;return u>lre&&(a=are(a,u),o-=u),new gs(a.append(i),o)}remapping(e,n){let r=new yh;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new gs(this.items.append(e.map(n=>new Ms(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},s);let c=n;this.items.forEach(p=>{let f=i.getMirror(--c);if(f==null)return;o=Math.min(o,f);let g=i.maps[f];if(p.step){let m=e.steps[f].invert(e.docs[f]),v=p.selection&&p.selection.map(i.slice(c+1,f));v&&a++,r.push(new Ms(g,m,v))}else r.push(new Ms(g))},s);let u=[];for(let p=n;p<o;p++)u.push(new Ms(i.maps[p]));let d=this.items.slice(0,s).append(u).append(r),h=new gs(d,a);return h.emptyItemCount()>ore&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,a)=>{if(a>=e)s.push(o),o.selection&&i++;else if(o.step){let c=o.step.map(n.slice(r)),u=c&&c.getMap();if(r--,u&&n.appendMap(u,r),c){let d=o.selection&&o.selection.map(n.slice(r));d&&i++;let h=new Ms(u.invert(),c,d),p,f=s.length-1;(p=s.length&&s[f].merge(h))?s[f]=p:s.push(h)}}else o.map&&r--},this.items.length,0),new gs(xn.from(s.reverse()),i)}}gs.empty=new gs(xn.empty,0);function are(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class Ms{constructor(e,n,r,s){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Ms(n.getMap().invert(),n,this.selection)}}}class eo{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const lre=20;function cre(t,e,n,r){let s=n.getMeta(Ua),i;if(s)return s.historyState;n.getMeta(hre)&&(t=new eo(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Ua))return o.getMeta(Ua).redo?new eo(t.done.addTransform(n,void 0,r,Np(e)),t.undone,A_(n.mapping.maps),t.prevTime,t.prevComposition):new eo(t.done,t.undone.addTransform(n,void 0,r,Np(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),c=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!ure(n,t.prevRanges)),u=o?px(t.prevRanges,n.mapping):A_(n.mapping.maps);return new eo(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,Np(e)),gs.empty,u,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new eo(t.done.rebased(n,i),t.undone.rebased(n,i),px(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new eo(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),px(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function ure(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,s)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&s>=e[i]&&(n=!0)}),n}function A_(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,s,i,o)=>e.push(i,o));return e}function px(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let s=e.map(t[r],1),i=e.map(t[r+1],-1);s<=i&&n.push(s,i)}return n}function dre(t,e,n){let r=Np(e),s=Ua.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let o=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),s,r),c=new eo(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(o).setMeta(Ua,{redo:n,historyState:c})}let mx=!1,O_=null;function Np(t){let e=t.plugins;if(O_!=e){mx=!1,O_=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){mx=!0;break}}return mx}const Ua=new dn("history"),hre=new dn("closeHistory");function fre(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new It({key:Ua,state:{init(){return new eo(gs.empty,gs.empty,null,0,-1)},apply(e,n,r){return cre(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,s=r=="historyUndo"?dL:r=="historyRedo"?hL:null;return!s||!e.editable?!1:(n.preventDefault(),s(e.state,e.dispatch))}}}})}function uL(t,e){return(n,r)=>{let s=Ua.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=dre(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const dL=uL(!1,!0),hL=uL(!0,!0);Xt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new It({key:new dn("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const s=this.options.limit;if(s==null||s===0){t=!0;return}const i=this.storage.characters({node:r.doc});if(i>s){const o=i-s,a=0,c=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,c=i-r,u=a-c,d=a;return e.deleteRange(u,d),!(this.storage.characters({node:e.doc})>r)}})]}});var pre=Xt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Jne(this.options)]}});Xt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new It({key:new dn("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return Rt.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((c,u)=>{if(c.isText)return;if(!(s>=u&&s<=u+c.nodeSize-1))return!1;o+=1});let a=0;return t.descendants((c,u)=>{if(c.isText||!(s>=u&&s<=u+c.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(Qn.node(u,u+c.nodeSize,{class:this.options.className}))}),Rt.create(t,i)}}})]}});var mre=Xt.create({name:"gapCursor",addProseMirrorPlugins(){return[ere()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=at(be(t,"allowGapCursor",n)))!=null?e:null}}}),P_="placeholder";function gre(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}Xt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:P_,placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${gre(this.options.dataAttribute)}`:`data-${P_}`;return[new It({key:new dn("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:s}=n,i=[];if(!r)return null;const o=this.editor.isEmpty;return e.descendants((a,c)=>{const u=s>=c&&s<=c+a.nodeSize,d=!a.isLeaf&&Oy(a);if(!a.type.isTextblock)return this.options.includeChildren;if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];o&&h.push(this.options.emptyEditorClass);const p=Qn.node(c,c+a.nodeSize,{class:h.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:c,hasAnchor:u}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Rt.create(e,i)}}})]}});Xt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new It({key:new dn("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||mD(n.selection)||t.view.dragging?null:Rt.create(n.doc,[Qn.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});var yre="skipTrailingNode";function M_({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var vre=Xt.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new dn(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new It({key:e,appendTransaction:(s,i,o)=>{const{doc:a,tr:c,schema:u}=o,d=e.getState(o),h=a.content.size,p=u.nodes[n];if(!s.some(f=>f.getMeta(yre))&&d)return c.insert(h,p.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!M_({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!M_({node:o,types:r})}}})]}}),xre=Xt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>dL(t,e),redo:()=>({state:t,dispatch:e})=>hL(t,e)}},addProseMirrorPlugins(){return[fre(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()}}}),bre=Xt.create({name:"starterKit",addExtensions(){var t,e,n,r;const s=[];return this.options.bold!==!1&&s.push(Hte.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(Bte.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(XD.configure(this.options.bulletList)),this.options.code!==!1&&s.push(Kte.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(Jte.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(Qte.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(pre.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(mre.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(Xte.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(Zte.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(xre.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(ene.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(ine.configure(this.options.italic)),this.options.listItem!==!1&&s.push(ZD.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(iL.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(QD.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(aL.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(Hne.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(Kne.configure(this.options.strike)),this.options.text!==!1&&s.push(Gne.configure(this.options.text)),this.options.underline!==!1&&s.push(Yne.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(vre.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),wre=bre,kre=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Sre=mr.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Jt(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const a=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",c=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",u=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return u?``:``}
644,addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:a})=>{const c=document.createElement("img");Object.entries(o).forEach(([h,p])=>{if(p!=null)switch(h){case"width":case"height":break;default:c.setAttribute(h,p);break}}),c.src=o.src;const u=new bee({element:c,editor:a,node:s,getPos:i,onResize:(h,p)=>{c.style.width=`${h}px`,c.style.height=`${p}px`},onCommit:(h,p)=>{const f=i();f!==void 0&&this.editor.chain().setNodeSelection(f).updateAttributes(this.name,{width:h,height:p}).run()},onUpdate:(h,p,f)=>h.type===s.type,options:{directions:t,min:{width:e,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:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[OD({find:kre,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Cre=Sre;const RS=({content:t,onChange:e})=>{const n=Mte({extensions:[wre,Rne.configure({openOnClick:!1}),Cre],content:t,onUpdate:({editor:i})=>e(i.getHTML())});if(!n)return null;const r=()=>{const i=prompt("URL:");i&&n.chain().focus().setLink({href:i}).run()},s=()=>{const i=prompt("Image URL:");i&&n.chain().focus().setImage({src:i}).run()};return l.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[l.jsxs("div",{className:"flex flex-wrap gap-1 p-2 border-b bg-muted/30",children:[l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>n.chain().focus().toggleBold().run(),className:n.isActive("bold")?"bg-muted":"",children:l.jsx(V5,{className:"h-4 w-4"})}),l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>n.chain().focus().toggleItalic().run(),className:n.isActive("italic")?"bg-muted":"",children:l.jsx(Q5,{className:"h-4 w-4"})}),l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>n.chain().focus().toggleHeading({level:1}).run(),className:n.isActive("heading",{level:1})?"bg-muted":"",children:l.jsx(Y5,{className:"h-4 w-4"})}),l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>n.chain().focus().toggleHeading({level:2}).run(),className:n.isActive("heading",{level:2})?"bg-muted":"",children:l.jsx(J5,{className:"h-4 w-4"})}),l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>n.chain().focus().toggleBulletList().run(),className:n.isActive("bulletList")?"bg-muted":"",children:l.jsx(tF,{className:"h-4 w-4"})}),l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>n.chain().focus().toggleOrderedList().run(),className:n.isActive("orderedList")?"bg-muted":"",children:l.jsx(eF,{className:"h-4 w-4"})}),l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>n.chain().focus().toggleBlockquote().run(),className:n.isActive("blockquote")?"bg-muted":"",children:l.jsx(OA,{className:"h-4 w-4"})}),l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:r,children:l.jsx(Z5,{className:"h-4 w-4"})}),l.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:s,children:l.jsx(jA,{className:"h-4 w-4"})})]}),l.jsx(LD,{editor:n,className:"prose prose-sm max-w-none p-4 min-h-[200px] focus:outline-none [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[200px]"})]})},I_=t=>t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),jre=()=>{const{id:t}=ea(),e=t==="new",n=In(),{toast:r}=ht(),[s,i]=y.useState(!e),[o,a]=y.useState(!1),[c,u]=y.useState(""),[d,h]=y.useState(""),[p,f]=y.useState("article"),[g,m]=y.useState(""),[v,x]=y.useState(""),[b,w]=y.useState(""),[k,j]=y.useState([]),[E,N]=y.useState(null),[S,C]=y.useState(!1),[_,R]=y.useState(!1),[O,L]=y.useState(0),[A,z]=y.useState(""),[F,H]=y.useState(""),[I,T]=y.useState("");y.useEffect(()=>{e||(async()=>{const{data:M}=await D.from("reading_room_articles").select("*").eq("id",t).maybeSingle();if(!M)return;u(M.title),h(M.slug),f(M.type),m(M.excerpt??""),x(M.cover_image??""),w(M.season??""),C(M.is_free_preview),R(M.published),L(M.position),j(M.tracks??[]),N(M.section??null);const{data:$}=await D.from("reading_room_article_bodies").select("*").eq("article_id",t).maybeSingle();$&&(z($.body??""),H($.video_url??""),T($.file_url??"")),i(!1)})()},[t,e]);const U=async()=>
644{if(!c||!d){r({title:"Title and slug required",variant:"destructive"});return}a(!0);const M={title:c,slug:d,type:p,excerpt:g||null,cover_image:v||null,season:b||null,is_free_preview:S,published:_,position:O,tracks:k,section:E};let $=t;if(e){const{data:X,error:oe}=await D.from("reading_room_articles").insert(M).select("id").single();if(oe){r({title:"Save failed",description:oe.message,variant:"destructive"}),a(!1);return}$=X.id}else{const{error:X}=await D.from("reading_room_articles").update(M).eq("id",t);if(X){r({title:"Save failed",description:X.message,variant:"destructive"}),a(!1);return}}const B={article_id:$,body:A||null,video_url:F||null,file_url:I||null},{error:G}=await D.from("reading_room_article_bodies").upsert(B);if(G){r({title:"Body save failed",description:G.message,variant:"destructive"}),a(!1);return}r({title:"Saved"}),a(!1),e&&n(`/admin/reading-room/${$}`,{replace:!0})};return s?l.jsx("div",{className:"p-8",children:"Loadingâ¦"}):l.jsxs("div",{className:"space-y-6 max-w-4xl",children:[l.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>n("/admin/reading-room"),children:[l.jsx(ei,{className:"h-4 w-4 mr-1"}),"Back"]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Title"}),l.jsx(ue,{value:c,onChange:M=>{u(M.target.value),e&&!d&&h(I_(M.target.value))}})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Slug"}),l.jsx(ue,{value:d,onChange:M=>h(I_(M.target.value))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Type"}),l.jsxs(Xr,{value:p,onValueChange:f,children:[l.jsx(Tr,{children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"article",children:"Article"}),l.jsx(nt,{value:"video",children:"Video"}),l.jsx(nt,{value:"worksheet",children:"Worksheet"})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Section"}),l.jsxs(Xr,{value:E?String(E):"none",onValueChange:M=>N(M==="none"?null:parseInt(M)),children:[l.jsx(Tr,{children:l.jsx(Zr,{placeholder:"Choose a section"})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"none",children:"Unsorted"}),my.map(M=>l.jsxs(nt,{value:String(M.id),children:[M.id,". ",M.name]},M.id))]})]})]}),l.jsxs("div",{className:"space-y-2 md:col-span-2",children:[l.jsx(Ee,{children:"Tracks"}),l.jsx("div",{className:"flex flex-wrap gap-4 pt-1",children:dh.map(M=>{const $=k.includes(M.value);return l.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[l.jsx(Wk,{checked:$,onCheckedChange:B=>{j(G=>B?Array.from(new Set([...G,M.value])):G.filter(X=>X!==M.value))}}),M.label]},M.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Check both if the piece belongs in both tracks."})]}),l.jsxs("div",{className:"space-y-2 md:col-span-2",children:[l.jsx(Ee,{children:"Legacy season label (optional)"}),l.jsx(ue,{value:b,onChange:M=>w(M.target.value),placeholder:"e.g. Turning Points"})]}),l.jsxs("div",{className:"space-y-2 md:col-span-2",children:[l.jsx(Ee,{children:"Excerpt"}),l.jsx(jt,{value:g,onChange:M=>m(M.target.value),rows:2})]}),l.jsxs("div",{className:"space-y-2 md:col-span-2",children:[l.jsx(Ee,{children:"Cover image URL"}),l.jsx(ue,{value:v,onChange:M=>x(M.target.value),placeholder:"https://â¦"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Position"}),l.jsx(ue,{type:"number",value:O,onChange:M=>L(parseInt(M.target.value||"0"))})]}),l.jsxs("div",{className:"flex items-center gap-6 pt-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ei,{checked:_,onCheckedChange:R,id:"pub"}),l.jsx(Ee,{htmlFor:"pub",children:"Published"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ei,{checked:S,onCheckedChange:C,id:"free"}),l.jsx(Ee,{htmlFor:"free",children:"Free preview"})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Video embed URL (YouTube, Vimeo, Loom embed)"}),l.jsx(ue,{value:F,onChange:M=>H(M.target.value),placeholder:"https://www.youtube.com/embed/â¦"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Worksheet/file URL"}),l.jsx(ue,{value:I,onChange:M=>T(M.target.value),placeholder:"https://â¦/worksheet.pdf"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Body"}),l.jsx(RS,{content:A,onChange:z})]}),l.jsx("div",{className:"flex gap-2",children:l.jsx(q,{onClick:U,disabled:o,children:o?"Savingâ¦":"Save"})})]})},Nre=()=>{const[t,e]=y.useState([]),[n,r]=y.useState(""),[s,i]=y.useState(""),[o,a]=y.useState(""),{toast:c}=ht(),u=In(),d=async()=>{const{data:f}=await D.from("reading_room_members").select("*").order("granted_at",{ascending:!1});e(f??[])};y.useEffect(()=>{d()},[]);const h=async()=>
644{if(!n.trim()){c({title:"User ID required",variant:"destructive"});return}const{error:f}=await D.from("reading_room_members").upsert({user_id:n.trim(),expires_at:s||null,notes:o||null},{onConflict:"user_id"});if(f){c({title:"Failed",description:f.message,variant:"destructive"});return}c({title:"Membership granted"}),r(""),i(""),a(""),d()},p=async f=>{confirm("Revoke this membership?")&&(await D.from("reading_room_members").delete().eq("id",f),d())};return l.jsxs("div",{className:"space-y-6 max-w-3xl",children:[l.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>u("/admin/reading-room"),children:[l.jsx(ei,{className:"h-4 w-4 mr-1"}),"Back"]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-bold font-heading",children:"Reading Room Members"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Grant a Reading Room pass by entering the user's auth ID. Find it in the Cloud â Users panel."})]}),l.jsxs("div",{className:"bg-background border rounded-lg p-5 space-y-3",children:[l.jsx("h3",{className:"font-bold",children:"Grant access"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"User ID (auth UUID)"}),l.jsx(ue,{value:n,onChange:f=>r(f.target.value),placeholder:"00000000-0000-0000-0000-000000000000"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Expires at (optional)"}),l.jsx(ue,{type:"datetime-local",value:s,onChange:f=>i(f.target.value)})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Notes"}),l.jsx(ue,{value:o,onChange:f=>a(f.target.value),placeholder:"e.g. Spring 2026 season"})]}),l.jsx(q,{onClick:h,children:"Grant Membership"})]}),l.jsx("div",{className:"border rounded-lg bg-background",children:l.jsxs(Ii,{children:[l.jsx(Di,{children:l.jsxs(Nt,{children:[l.jsx(Pe,{children:"User ID"}),l.jsx(Pe,{children:"Granted"}),l.jsx(Pe,{children:"Expires"}),l.jsx(Pe,{children:"Notes"}),l.jsx(Pe,{})]})}),l.jsxs(Li,{children:[t.map(f=>l.jsxs(Nt,{children:[l.jsx(je,{className:"font-mono text-xs",children:f.user_id}),l.jsx(je,{className:"text-sm",children:mt(new Date(f.granted_at),"MMM d, yyyy")}),l.jsx(je,{className:"text-sm",children:f.expires_at?mt(new Date(f.expires_at),"MMM d, yyyy"):"â"}),l.jsx(je,{className:"text-sm text-muted-foreground",children:f.notes||""}),l.jsx(je,{children:l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>p(f.id),children:l.jsx(ks,{className:"h-4 w-4 text-destructive"})})})]},f.id)),t.length===0&&l.jsx(Nt,{children:l.jsx(je,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No members yet."})})]})]})})]})},_re=()=>{const{toast:t}=ht(),[e,n]=y.useState([]),[r,s]=y.useState(!0),i=async()=>{const{data:a}=await D.from("narrative_sections").select("id, slug, title, pdf_url, published, position").order("position",{ascending:!0});n(a??[]),s(!1)};y.useEffect(()=>{i()},[]);const o=async(a,c)=>{const{error:u}=await D.from("narrative_sections").update({published:c}).eq("id",a);if(u){t({title:"Update failed",description:u.message,variant:"destructive"});return}n(d=>d.map(h=>h.id===a?{...h,published:c}:h))};return r?l.jsx("div",{className:"flex justify-center py-16",children:l.jsx(qt,{className:"h-6 w-6 animate-spin text-primary"})}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-heading",children:"Narratives Worksheets"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Edit prompts and upload PDFs for the public /narratives page."})]}),l.jsxs(Ii,{children:[l.jsx(Di,{children:l.jsxs(Nt,{children:[l.jsx(Pe,{className:"w-16",children:"#"}),l.jsx(Pe,{children:"Title"}),l.jsx(Pe,{children:"Slug"}),l.jsx(Pe,{children:"PDF"}),l.jsx(Pe,{children:"Published"}),l.jsx(Pe,{className:"text-right",children:"Actions"})]})}),l.jsx(Li,{children:e.map(a=>l.jsxs(Nt,{children:[l.jsx(je,{className:"text-muted-foreground",children:a.position}),l.jsx(je,{className:"font-medium",children:a.title}),l.jsx(je,{className:"text-muted-foreground text-sm",children:a.slug}),l.jsx(je,{children:a.pdf_url?l.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-primary",children:[l.jsx(ul,{className:"h-4 w-4"})," Uploaded"]}):l.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-muted-foreground",children:[l.jsx(W5,{className:"h-4 w-4"})," Missing"]})}),l.jsx(je,{children:l.jsx(Ei,{checked:a.published,onCheckedChange:c=>o(a.id,c)})}),l.jsx(je,{className:"text-right",children:l.jsx(Be,{to:`/admin/narratives/${a.id}`,children:l.jsx(q,{variant:"outline",size:"sm",children:"Edit"})})})]},a.id))})]})]})},Ere=()=>{const{id:t}=ea(),e=In(),{toast:n}=ht(),r=y.useRef(null),[s,i]=y.useState(!0),[o,a]=y.useState(!1),[c,u]=y.useState(!1),[d,h]=y.useState(""),[p,f]=y.useState(""),[g,m]=y.useState(""),[v,x]=y.useState(""),[b,w]=y.useState(null),[k,j]=y.useState(0),[E,N]=y.useState(!0);y.useEffect(()=>{(async()=>{const{data:_}=await D.from("narrative_sections").select("*").eq("id",t).maybeSingle();_&&(h(_.slug),f(_.title),m(_.prompt),x(_.body??""),w(_.pdf_url),j(_.position),N(_.published)),i(!1)})()},[t]);const S=async()=>{a(!0);const{error:_}=await D.from("narrative_sections").update({title:p,prompt:g,body:v,pdf_url:b,position:k,published:E}).eq("id",t);if(a(!1),_){n({title:"Save failed",description:_.message,variant:"destructive"});return}n({title:"Saved"})},C=async _=>{var z;const R=(z=_.target.files)==null?void 0:z[0];if(!R)return;u(!0);const O=`narratives/${d}-${Date.now()}.pdf`,{error:L}=await D.storage.from("media").upload(O,R,{upsert:!0});if(L){n({title:"Upload failed",description:L.message,variant:"destructive"}),u(!1);return}const{data:A}=D.storage.from("media").getPublicUrl(O);w(A.publicUrl),u(!1),n({title:"PDF uploaded â click Save to keep"})};return s?l.jsx("div",{className:"p-8",children:l.jsx(qt,{className:"h-6 w-6 animate-spin"})}):l.jsxs("div",{className:"space-y-6 max-w-3xl",children:[l.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>e("/admin/narratives"),children:[l.jsx(ei,{className:"h-4 w-4 mr-1"}),"Back"]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Title"}),l.jsx(ue,{value:p,onChange:_=>f(_.target.value)})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Slug"}),l.jsx(ue,{value:d,disabled:!0})]}),l.jsxs("div",{className:"space-y-2 md:col-span-2",children:[l.jsx(Ee,{children:"Prompt (shown on the tile)"}),l.jsx(jt,{value:g,onChange:_=>m(_.target.value),rows:4})]}),l.jsxs("div",{className:"space-y-2 md:col-span-2",children:[l.jsx(Ee,{children:"Body (full essay shown on the detail page)"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Supports lightweight markdown: ",l.jsx("code",{children:"# Heading"}),", ",l.jsx("code",{children:"## Subheading"}),",",l.jsx("code",{children:" *italic*"}),". Separate paragraphs with a blank line."]}
644),l.jsx(jt,{value:v,onChange:_=>x(_.target.value),rows:20,className:"font-mono text-sm"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ee,{children:"Position"}),l.jsx(ue,{type:"number",value:k,onChange:_=>j(parseInt(_.target.value||"0"))})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-6",children:[l.jsx(Ei,{checked:E,onCheckedChange:N,id:"pub"}),l.jsx(Ee,{htmlFor:"pub",children:"Published"})]})]}),l.jsxs("div",{className:"space-y-2 border-t pt-6",children:[l.jsx(Ee,{children:"Worksheet PDF"}),b&&l.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary hover:underline",children:[l.jsx(ul,{className:"h-4 w-4"})," View current PDF"]}),l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("input",{ref:r,type:"file",accept:"application/pdf",onChange:C,className:"hidden"}),l.jsxs(q,{variant:"outline",onClick:()=>{var _;return(_=r.current)==null?void 0:_.click()},disabled:c,children:[l.jsx(Kg,{className:"h-4 w-4 mr-1"}),c?"Uploadingâ¦":b?"Replace PDF":"Upload PDF"]}),b&&l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>w(null),children:"Remove"})]}),l.jsxs("div",{className:"space-y-2 pt-2",children:[l.jsx(Ee,{className:"text-xs text-muted-foreground",children:"Or paste a PDF URL"}),l.jsx(ue,{value:b??"",onChange:_=>w(_.target.value||null),placeholder:"https://â¦/file.pdf"})]})]}),l.jsx("div",{className:"flex gap-2",children:l.jsx(q,{onClick:S,disabled:o,children:o?"Savingâ¦":"Save"})})]})},Tre=()=>{const[t,e]=y.useState([]);return y.useEffect(()=>{D.from("courses").select("*").eq("status","published").order("created_at",{ascending:!1}).then(({data:n})=>e(n??[]))},[]),l.jsxs("main",{children:[l.jsx(ut,{pageKey:"courses"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-24 pb-16 section-light min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsx(re,{animation:"fade-up",children:l.jsx("h1",{className:"text-center mb-12",children:"Courses"})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((n,r)=>l.jsx(re,{animation:"fade-up",delay:r*100,children:l.jsx(Be,{to:`/courses/${n.slug}`,className:"block group no-underline",children:l.jsxs("div",{className:"bg-background rounded-lg overflow-hidden shadow-md hover:shadow-lg transition-shadow",children:[n.thumbnail&&l.jsx("img",{src:n.thumbnail,alt:n.title,className:"w-full h-48 object-cover"}),l.jsxs("div",{className:"p-6",children:[l.jsx("h3",{className:"text-foreground group-hover:text-primary transition-colors font-bold text-lg mb-2",children:n.title}),n.description&&l.jsx("p",{className:"text-muted-foreground text-sm mb-3",children:n.description}),l.jsx("p",{className:"text-primary font-bold",children:Number(n.price)>0?`$${Number(n.price).toFixed(2)}`:"Free"})]})]})})},n.id))}),t.length===0&&l.jsx("p",{className:"text-center text-muted-foreground mt-8",children:"No courses available yet."})]})}),l.jsx(Ye,{})]})},Rre=()=>{const{slug:t}=ea(),[e,n]=y.useState(null),[r,s]=y.useState([]),[i,o]=y.useState([]),[a,c]=y.useState(null),[u,d]=y.useState([]);y.useEffect(()=>{(async()=>{if(!t)return;const{data:f}=await D.from("courses").select("*").eq("slug",t).eq("status","published").single();if(!f)return;n(f);const{data:g}=await D.from("course_modules").select("*").eq("course_id",f.id).order("position");if(s(g??[]),g!=null&&g.length){d([g[0].id]);const{data:m}=await D.from("course_lessons").select("*").in("module_id",g.map(v=>v.id)).order("position");if(o(m??[]),m!=null&&m.length){const v=m.find(x=>x.is_free_preview);v&&c(v)}}})()},[t]);const h=p=>{d(f=>f.includes(p)?f.filter(g=>g!==p):[...f,p])};return e?l.jsxs("main",{children:[l.jsx(ut,{title:e.seo_title||e.title,description:e.seo_description||e.description,image:e.thumbnail}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-24 pb-16 section-light min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx("h1",{className:"mb-4",children:e.title}),e.description&&l.jsx("p",{className:"text-muted-foreground mb-8 max-w-2xl",children:e.description})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[l.jsx("div",{className:"lg:col-span-1 space-y-2",children:r.map(p=>l.jsxs("div",{className:"border rounded-lg bg-background overflow-hidden",children:[l.jsxs("button",{onClick:()=>h(p.id),className:"w-full flex items-center gap-2 p-3 text-left font-medium hover:bg-muted/50 transition-colors",children:[u.includes(p.id)?l.jsx(Hg,{className:"h-4 w-4"}):l.jsx(Wg,{className:"h-4 w-4"}),p.title]}),u.includes(p.id)&&l.jsx("div",{className:"border-t",children:i.filter(f=>f.module_id===p.id).map(f=>l.jsxs("button",{onClick:()=>f.is_free_preview&&c(f),className:`w-full flex items-center gap-2 px-4 py-2 text-sm text-left transition-colors ${(a==null?void 0:a.id)===f.id?"bg-primary/10 text-primary":f.is_free_preview?"hover:bg-muted/50":"text-muted-foreground cursor-not-allowed"}`,children:[f.is_free_preview?l.jsx(AA,{className:"h-3 w-3"}):l.jsx(ik,{className:"h-3 w-3"}),f.title]},f.id))})]}
644,p.id))}),l.jsx("div",{className:"lg:col-span-2",children:a?l.jsxs("div",{className:"bg-background rounded-lg p-6 shadow-sm",children:[l.jsx("h2",{className:"text-xl font-bold mb-4",children:a.title}),a.video_url&&l.jsx("div",{className:"aspect-video mb-6",children:l.jsx("iframe",{src:a.video_url,className:"w-full h-full rounded",allowFullScreen:!0})}),a.content&&l.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:a.content}})]}):l.jsx("div",{className:"text-center py-20 text-muted-foreground",children:l.jsx("p",{children:"Select a lesson to begin."})})})]})]})}),l.jsx(Ye,{})]}):l.jsxs("main",{children:[l.jsx(Ge,{}),l.jsx("div",{className:"pt-24 pb-16 text-center min-h-screen section-light",children:l.jsx("p",{className:"text-muted-foreground mt-20",children:"Loading..."})}),l.jsx(Ye,{})]})},Are=()=>{const[t,e]=y.useState(""),[n,r]=y.useState(""),[s,i]=y.useState(!1),[o,a]=y.useState(!1),{signIn:c,signUp:u,isAdmin:d,user:h,loading:p}=pr(),f=In(),{toast:g}=ht();y.useEffect(()=>{!p&&h&&d&&f("/admin")},[p,h,d,f]);const m=async v=>{if(v.preventDefault(),i(!0),o){const{error:x}=await u(t,n);x?g({title:"Sign up failed",description:x.message,variant:"destructive"}):(g({title:"Account created",description:"Please check your email to verify your account, then sign in."}),a(!1))}else{const{error:x}=await c(t,n);x?g({title:"Login failed",description:x.message,variant:"destructive"}):f("/admin",{replace:!0})}i(!1)};return l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted/30",children:l.jsxs("div",{className:"w-full max-w-sm bg-background border rounded-lg shadow-lg p-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-center mb-6 font-heading",children:o?"Create Admin Account":"Admin Login"}),l.jsxs("form",{onSubmit:m,className:"space-y-4",children:[l.jsx(ue,{type:"email",placeholder:"Email",required:!0,value:t,onChange:v=>e(v.target.value)}),l.jsx(ue,{type:"password",placeholder:"Password",required:!0,value:n,onChange:v=>r(v.target.value)}),l.jsx(q,{type:"submit",className:"w-full",disabled:s,children:s?o?"Creating account...":"Signing in...":o?"Sign Up":"Sign In"})]}),l.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-4",children:[o?"Already have an account?":"Don't have an account?"," ",l.jsx("button",{type:"button",onClick:()=>a(!o),className:"text-primary underline hover:no-underline",children:o?"Sign In":"Sign Up"})]})]})})},gx=768;function Ore(){const[t,e]=y.useState(void 0);return y.useEffect(()=>{const n=window.matchMedia(`(max-width: ${gx-1}px)`),r=()=>{e(window.innerWidth<gx)};return n.addEventListener("change",r),e(window.innerWidth<gx),()=>n.removeEventListener("change",r)},[]),!!t}var Pre="Separator",D_="horizontal",Mre=["horizontal","vertical"],fL=y.forwardRef((t,e)=>{const{decorative:n,orientation:r=D_,...s}=t,i=Ire(r)?r:D_,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return l.jsx(Ae.div,{"data-orientation":i,...a,...s,ref:e})});fL.displayName=Pre;function Ire(t){return Mre.includes(t)}var pL=fL;const Nd=y.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>l.jsx(pL,{ref:s,decorative:n,orientation:e,className:se("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Nd.displayName=pL.displayName;const Dre=yO,Lre=vO,mL=y.forwardRef(({className:t,...e},n)=>l.jsx(ay,{className:se("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",t),...e,ref:n}));mL.displayName=ay.displayName;const $re=tu("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"}}),gL=y.forwardRef(({side:t="right",className:e,children:n,...r},s)=>l.jsxs(Lre,{children:[l.jsx(mL,{}),l.jsxs(ly,{ref:s,className:se($re({side:t}),e),...r,children:[n,l.jsxs(xO,{className:"absolute right-4 top-4 roun
644ded-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(nu,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gL.displayName=ly.displayName;const Bre=y.forwardRef(({className:t,...e},n)=>l.jsx(cy,{ref:n,className:se("text-lg font-semibold text-foreground",t),...e}));Bre.displayName=cy.displayName;const zre=y.forwardRef(({className:t,...e},n)=>l.jsx(uy,{ref:n,className:se("text-sm text-muted-foreground",t),...e}));zre.displayName=uy.displayName;function L_({className:t,...e}){return l.jsx("div",{className:se("animate-pulse rounded-md bg-muted",t),...e})}const Fre="sidebar:state",Ure=60*60*24*7,Vre="16rem",Hre="18rem",Wre="3rem",qre="b",yL=y.createContext(null);function Zh(){const t=y.useContext(yL);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const vL=y.forwardRef(({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:s,children:i,...o},a)=>{const c=Ore(),[u,d]=y.useState(!1),[h,p]=y.useState(t),f=e??h,g=y.useCallback(b=>{const w=typeof b=="function"?b(f):b;n?n(w):p(w),document.cookie=`${Fre}=${w}; path=/; max-age=${Ure}`},[n,f]),m=y.useCallback(()=>c?d(b=>!b):g(b=>!b),[c,g,d]);y.useEffect(()=>{const b=w=>{w.key===qre&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[m]);const v=f?"expanded":"collapsed",x=y.useMemo(()=>({state:v,open:f,setOpen:g,isMobile:c,openMobile:u,setOpenMobile:d,toggleSidebar:m}),[v,f,g,c,u,d,m]);return l.jsx(yL.Provider,{value:x,children:l.jsx(S2,{delayDuration:0,children:l.jsx("div",{style:{"--sidebar-width":Vre,"--sidebar-width-icon":Wre,...s},className:se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:a,...o,children:i})})})});vL.displayName="SidebarProvider";const xL=y.forwardRef(({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:s,...i},o)=>{const{isMobile:a,state:c,openMobile:u,setOpenMobile:d}=Zh();return n==="none"?l.jsx("div",{className:se("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:s}):a?l.jsx(Dre,{open:u,onOpenChange:d,...i,children:l.jsx(gL,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Hre},side:t,children:l.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):l.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":e,"data-side":t,children:[l.jsx("div",{className:se("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),l.jsx("div",{className:se("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:l.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:s})})]})});xL.displayName="Sidebar";const bL=y.forwardRef(({className:t,onClick:e,...n},r)=>{const{toggleSidebar:s}=Zh();return l.jsxs(q,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:se("h-7 w-7",t),onClick:i=>{e==null||e(i),s()},...n,children:[l.jsx(iF,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});bL.displayName="SidebarTrigger";const Kre=y.forwardRef(({className:t,...e},n)=>{const{toggleSidebar:r}=Zh();return l.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:se("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})});Kre.displayName="SidebarRail";const Gre=y.forwardRef(({className:t,...e},n)=>l.jsx("main",{ref:n,className:se("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
644h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...e}));Gre.displayName="SidebarInset";const Yre=y.forwardRef(({className:t,...e},n)=>l.jsx(ue,{ref:n,"data-sidebar":"input",className:se("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...e}));Yre.displayName="SidebarInput";const Jre=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,"data-sidebar":"header",className:se("flex flex-col gap-2 p-2",t),...e}));Jre.displayName="SidebarHeader";const wL=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,"data-sidebar":"footer",className:se("flex flex-col gap-2 p-2",t),...e}));wL.displayName="SidebarFooter";const Qre=y.forwardRef(({className:t,...e},n)=>l.jsx(Nd,{ref:n,"data-sidebar":"separator",className:se("mx-2 w-auto bg-sidebar-border",t),...e}));Qre.displayName="SidebarSeparator";const kL=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,"data-sidebar":"content",className:se("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e}));kL.displayName="SidebarContent";const SL=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,"data-sidebar":"group",className:se("relative flex w-full min-w-0 flex-col p-2",t),...e}));SL.displayName="SidebarGroup";const CL=y.forwardRef(({className:t,asChild:e=!1,...n},r)=>{const s=e?eu:"div";return l.jsx(s,{ref:r,"data-sidebar":"group-label",className:se("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})});CL.displayName="SidebarGroupLabel";const Xre=y.forwardRef(({className:t,asChild:e=!1,...n},r)=>{const s=e?eu:"button";return l.jsx(s,{ref:r,"data-sidebar":"group-action",className:se("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...n})});Xre.displayName="SidebarGroupAction";const jL=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,"data-sidebar":"group-content",className:se("w-full text-sm",t),...e}));jL.displayName="SidebarGroupContent";const NL=y.forwardRef(({className:t,...e},n)=>l.jsx("ul",{ref:n,"data-sidebar":"menu",className:se("flex w-full min-w-0 flex-col gap-1",t),...e}));NL.displayName="SidebarMenu";const _L=y.forwardRef(({className:t,...e},n)=>l.jsx("li",{ref:n,"data-sidebar":"menu-item",className:se("group/menu-item relative",t),...e}));_L.displayName="SidebarMenuItem";const Zre=tu("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),EL=y.forwardRef(({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:s,className:i,...o},a)=>{const c=t?eu:"button",{isMobile:u,state:d}=Zh(),h=l.jsx(c,{ref:a,"data-sidebar":"menu-button","data-size":r,"data-active":e,className:se(Zre({variant:n,size:r}),i),...o});return s?(typeof s=="string"&&(s={children:s}),l.jsxs(P6,{children:[l.jsx(M6,{asChild:!0,children:h}),l.jsx(C2,{side:"right",align:"center",hidden:d!=="collapsed"||u,...s})]})):h});EL.displayName="SidebarMenuButton";const ese=y.forwardRef(({className:t,asChild:e=!1,showOnHover:n=!1,...r},s)=>{const i=e?eu:"button";return l.jsx(i,{ref:s,"data-sidebar":"menu-action",className:se("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...r})});ese.displayName="SidebarMenuAction";const tse=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:se("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e}));tse.displayName="SidebarMenuBadge";const nse=y.forwardRef(({className:t,showIcon:e=!1,...n},r)=>{const s=y.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:se("flex h-8 items-center gap-2 rounded-md px-2",t),...n,children:[e&&l.jsx(L_,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(L_,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});nse.displayName="SidebarMenuSkeleton";const rse=y.forwardRef(({className:t,...e},n)=>l.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:se("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e}));
644rse.displayName="SidebarMenuSub";const sse=y.forwardRef(({...t},e)=>l.jsx("li",{ref:e,...t}));sse.displayName="SidebarMenuSubItem";const ise=y.forwardRef(({asChild:t=!1,size:e="md",isActive:n,className:r,...s},i)=>{const o=t?eu:"a";return l.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":e,"data-active":n,className:se("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...s})});ise.displayName="SidebarMenuSubButton";const TL=y.forwardRef(({className:t,activeClassName:e,pendingClassName:n,to:r,...s},i)=>l.jsx(uz,{ref:i,to:r,className:({isActive:o,isPending:a})=>se(t,o&&e,a&&n),...s}));TL.displayName="NavLink";const ose=[{title:"Dashboard",url:"/admin",icon:X5},{title:"Contacts",url:"/admin/contacts",icon:ak},{title:"Submissions",url:"/admin/submissions",icon:NA},{title:"Blog",url:"/admin/blog",icon:ul},{title:"Courses",url:"/admin/courses",icon:rm},{title:"Press & Media",url:"/admin/press-media",icon:sF},{title:"Reading Room",url:"/admin/reading-room",icon:rk},{title:"Narratives",url:"/admin/narratives",icon:uF},{title:"Events",url:"/admin/events",icon:Vh},{title:"Coaching",url:"/admin/coaching",icon:rm}];function ase(){const{state:t}=Zh(),e=t==="collapsed";Ai();const{signOut:n}=pr();return l.jsxs(xL,{collapsible:"icon",children:[l.jsx(kL,{children:l.jsxs(SL,{children:[l.jsx(CL,{children:"Admin Center"}),l.jsx(jL,{children:l.jsx(NL,{children:ose.map(r=>l.jsx(_L,{children:l.jsx(EL,{asChild:!0,children:l.jsxs(TL,{to:r.url,end:r.url==="/admin",className:"hover:bg-muted/50",activeClassName:"bg-muted text-primary font-medium",children:[l.jsx(r.icon,{className:"mr-2 h-4 w-4"}),!e&&l.jsx("span",{children:r.title})]})})},r.title))})})]})}),l.jsx(wL,{children:l.jsxs(q,{variant:"ghost",size:"sm",onClick:n,className:"w-full justify-start",children:[l.jsx(TA,{className:"mr-2 h-4 w-4"}),!e&&"Sign Out"]})})]})}const lse=()=>{const{isAdmin:t,loading:e,user:n}=pr(),r=In();return y.useEffect(()=>{!e&&(!n||!t)&&r("/admin/login")},[e,n,t,r]),e?l.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."}):!n||!t?null:l.jsx(vL,{children:l.jsxs("div",{className:"min-h-screen flex w-full",children:[l.jsx(ase,{}),l.jsxs("div",{className:"flex-1 flex flex-col",children:[l.jsxs("header",{className:"h-14 flex items-center border-b px-4 bg-background",children:[l.jsx(bL,{className:"mr-4"}),l.jsx("span",{className:"font-heading text-lg font-bold",children:"Admin Center"})]}),l.jsx("main",{className:"flex-1 p-6 bg-muted/20 overflow-auto",children:l.jsx(JB,{})})]})]})})},ol=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:se("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));ol.displayName="Card";const mg=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:se("flex flex-col space-y-1.5 p-6",t),...e}));mg.displayName="CardHeader";const gg=y.forwardRef(({className:t,...e},n)=>l.jsx("h3",{ref:n,className:se("text-2xl font-semibold leading-none tracking-tight",t),...e}));gg.displayName="CardTitle";const cse=y.forwardRef(({className:t,...e},n)=>l.jsx("p",{ref:n,className:se("text-sm text-muted-foreground",t),...e}));cse.displayName="CardDescription";const al=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:se("p-6 pt-0",t),...e}));al.displayName="CardContent";const use=y.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:se("flex items-center p-6 pt-0",t),...e}));use.displayName="CardFooter";const Zf=({title:t,value:e,icon:n})=>l.jsx(ol,{children:l.jsxs(al,{className:"flex items-center gap-4 p-6",children:[l.jsx("div",{className:"p-3 rounded-lg bg-primary/10 text-primary",children:n}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:t}),l.jsx("p",{className:"text-2xl font-bold tabular-nums",children:e})]})]})}),dse=()=>{const[t,e]=y.useState({contacts:0,submissions:0,posts:0,courses:0}),[n,r]=y.useState([]);return y.useEffect(()=>{(async()=>{const[i,o,a,c]=await Promise.all([D.from("contacts").select("id",{count:"exact",head:!0}),D.from("form_submissions").select("id",{count:"exact",head:!0}),D.from("blog_posts").select("id",{count:"exact",head:!0}).eq("status","published"),D.from("courses").select("id",{count:"exact",head:!0})]);
644e({contacts:i.count??0,submissions:o.count??0,posts:a.count??0,courses:c.count??0});const{data:u}=await D.from("form_submissions").select("*").order("created_at",{ascending:!1}).limit(5);r(u??[])})()},[]),l.jsxs("div",{className:"space-y-6",children:[l.jsx("h2",{className:"text-2xl font-bold font-heading",children:"Dashboard"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(Zf,{title:"Total Contacts",value:t.contacts,icon:l.jsx(ak,{className:"h-5 w-5"})}),l.jsx(Zf,{title:"Submissions",value:t.submissions,icon:l.jsx(NA,{className:"h-5 w-5"})}),l.jsx(Zf,{title:"Published Posts",value:t.posts,icon:l.jsx(ul,{className:"h-5 w-5"})}),l.jsx(Zf,{title:"Courses",value:t.courses,icon:l.jsx(rm,{className:"h-5 w-5"})})]}),l.jsxs(ol,{children:[l.jsx(mg,{children:l.jsx(gg,{children:"Recent Submissions"})}),l.jsx(al,{children:n.length===0?l.jsx("p",{className:"text-muted-foreground text-sm",children:"No submissions yet."}):l.jsx("div",{className:"space-y-3",children:n.map(s=>l.jsxs("div",{className:"flex items-center justify-between border-b pb-3 last:border-0",children:[l.jsxs("div",{children:[l.jsxs("p",{className:"font-medium text-sm",children:[s.name||"Anonymous"," â ",s.email]}),l.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-md",children:s.message})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ot,{variant:"outline",children:s.source}),l.jsx(Ot,{variant:s.status==="new"?"default":"secondary",children:s.status}),l.jsx("span",{className:"text-xs text-muted-foreground",children:mt(new Date(s.created_at),"MMM d")})]})]},s.id))})})]})]})},RL=({name:t,color:e,onRemove:n})=>l.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium text-white",style:{backgroundColor:e},children:[t,n&&l.jsx("button",{onClick:n,className:"hover:opacity-70 ml-0.5",children:"Ã"})]}),hse=({contact:t,open:e,onOpenChange:n,allTags:r,tagAssignments:s,onUpdated:i})=>{const[o,a]=y.useState([]),[c,u]=y.useState(""),[d,h]=y.useState(""),[p,f]=y.useState(!1),{toast:g}=ht(),m=t?r.filter(j=>s.some(E=>E.contact_id===t.id&&E.tag_id===j.id)):[],v=t?r.filter(j=>!s.some(E=>E.contact_id===t.id&&E.tag_id===j.id)):[];y.useEffect(()=>{t&&(u(t.notes||""),D.from("form_submissions").select("*").eq("contact_id",t.id).order("created_at",{ascending:!1}).then(({data:j})=>a(j??[])))},[t]);const x=async j=>{if(!t)return;const{error:E}=await D.from("contact_tag_assignments").insert({contact_id:t.id,tag_id:j});E||i()},b=async j=>{t&&(await D.from("contact_tag_assignments").delete().eq("contact_id",t.id).eq("tag_id",j),i())},w=async()=>{if(!t||!d.trim())return;const j=`hsl(${Math.floor(Math.random()*360)}, 60%, 45%)`,{data:E,error:N}=await D.from("contact_tags").insert({name:d.trim(),color:j}).select().single();if(N){g({title:"Error",description:N.message,variant:"destructive"});return}await D.from("contact_tag_assignments").insert({contact_id:t.id,tag_id:E.id}),h(""),f(!1),i()},k=async()=>{if(!t)return;const{error:j}=await D.from("contacts").update({notes:c}).eq("id",t.id);j?g({title:"Error",description:j.message,variant:"destructive"}):(g({title:"Notes saved"}),i())};return t?l.jsx(Es,{open:e,onOpenChange:n,children:l.jsxs(es,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[l.jsx(ts,{children:l.jsx(_r,{className:"text-xl",children:t.name||"Unnamed Contact"})}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(nF,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{children:t.email})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(aF,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{children:t.phone||"â"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(Vh,{className:"h-4 w-4 text-muted-foreground"}),l.jsxs("span",{children:["Added ",mt(new Date(t.created_at),"MMM d, yyyy")]})]}),l.jsx("div",{className:"flex items-center gap-2 text-sm",children:l.jsx(Ot,{variant:"outline",children:t.source})})]}),l.jsx(Nd,{}),l.jsxs("div",{children:[l.jsxs("h4",{className:"text-sm font-semibold mb-2 flex items-center gap-1.5",children:[l.jsx(dF,{className:"h-4 w-4"})," Tags"]}),l.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-3",children:[m.map(j=>l.jsx(RL,{name:j.name,color:j.color,onRemove:()=>b(j.id)},j.id)),m.length===0&&l.jsx("span",{className:"text-xs text-muted-foreground",children:"No tags assigned"})]}),l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[v.map(j=>l.jsxs("button",{onClick:()=>x(j.id),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs border border-dashed border-muted-foreground
644/40 text-muted-foreground hover:border-primary hover:text-primary transition-colors",children:[l.jsx(Qr,{className:"h-3 w-3"})," ",j.name]},j.id)),p?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ue,{value:d,onChange:j=>h(j.target.value),placeholder:"Tag name",className:"h-7 text-xs w-28",onKeyDown:j=>j.key==="Enter"&&w()}),l.jsx(q,{size:"sm",className:"h-7 text-xs px-2",onClick:w,children:"Add"}),l.jsx(q,{size:"sm",variant:"ghost",className:"h-7 text-xs px-1",onClick:()=>{f(!1),h("")},children:l.jsx(nu,{className:"h-3 w-3"})})]}):l.jsxs("button",{onClick:()=>f(!0),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs border border-dashed border-primary/50 text-primary hover:bg-primary/5 transition-colors",children:[l.jsx(Qr,{className:"h-3 w-3"})," New tag"]})]})]}),l.jsx(Nd,{}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Notes"}),l.jsx(jt,{value:c,onChange:j=>u(j.target.value),placeholder:"Add notes about this contact...",rows:3,className:"text-sm"}),l.jsx(q,{size:"sm",className:"mt-2",onClick:k,children:"Save Notes"})]}),l.jsx(Nd,{}),l.jsxs("div",{children:[l.jsxs("h4",{className:"text-sm font-semibold mb-2 flex items-center gap-1.5",children:[l.jsx(rF,{className:"h-4 w-4"})," Form Submissions (",o.length,")"]}),o.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No form submissions from this contact."}):l.jsx("div",{className:"space-y-3",children:o.map(j=>l.jsxs("div",{className:"border rounded-lg p-3 text-sm space-y-1 bg-muted/30",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Ot,{variant:"outline",className:"text-xs",children:j.source}),l.jsx("span",{className:"text-xs text-muted-foreground",children:mt(new Date(j.created_at),"MMM d, yyyy 'at' h:mm a")})]}),j.name&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Name:"})," ",j.name]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Email:"})," ",j.email]}),j.message&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Message:"})," ",j.message]}),l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Status:"})," ",l.jsx(Ot,{variant:j.status==="new"?"default":"secondary",className:"text-xs",children:j.status})]})]},j.id))})]})]})]})}):null};var AL={exports:{}};/* @license
645Papa Parse 646v5.5.3 647https://github.com/mholt/PapaParse 648License: MIT 649*/(function(t,e){((n,r)=>{t.exports=r()})(n4,function n(){var r=typeof self<"u"?self:typeof window<"u"?window:r!==void 0?r:{},s,i=!r.document&&!!r.postMessage,o=r.IS_PAPA_WORKER||!1,a={},c=0,u={};function d(S){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(C){var _=j(C);_.chunkSize=parseInt(_.chunkSize),C.step||C.chunk||(_.chunkSize=null),this._handle=new m(_),(this._handle.streamer=this)._config=_}).call(this,S),this.parseChunk=function(C,_){var R=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<R){let L=this._config.newline;L||(O=this._config.quoteChar||'"',L=this._handle.guessLineEndings(C,O)),C=[...C.split(L).slice(R)].join(L)}this.isFirstChunk&&N(this._config.beforeFirstChunk)&&(O=this._config.beforeFirstChunk(C))!==void 0&&(C=O),this.isFirstChunk=!1,this._halted=!1;var R=this._partialLine+C,O=(this._partialLine="",this._handle.parse(R,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(C=O.meta.cursor,R=(this._finished||(this._partialLine=R.substring(C-this._baseIndex),this._baseIndex=C),O&&O.data&&(this._rowCount+=O.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)r.postMessage({results:O,workerId:u.WORKER_ID,finished:R});else if(N(this._config.chunk)&&!_){if(this._config.chunk(O,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=O=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(O.data),this._completeResults.errors=this._completeResults.errors.concat(O.errors),this._completeResults.meta=O.meta),this._completed||!R||!N(this._config.complete)||O&&O.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),R||O&&O.meta.paused||this._nextChunk(),O}this._halted=!0},this._sendError=function(C){N(this._config.error)?this._config.error(C):o&&this._config.error&&r.postMessage({workerId:u.WORKER_ID,error:C,finished:!1})}}function h(S){var C;(S=S||{}).chunkSize||(S.chunkSize=u.RemoteChunkSize),d.call(this,S),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(_){this._input=_,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(C=new XMLHttpRequest,this._config.withCredentials&&(C.withCredentials=this._config.withCredentials),i||(C.onload=E(this._chunkLoaded,this),C.onerror=E(this._chunkError,this)),C.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var _,R=this._config.downloadRequestHeaders;for(_ in R)C.setRequestHeader(_,R[_])}var O;this._config.chunkSize&&(O=this._start+this._config.chunkSize-1,C.setRequestHeader("Range","bytes="+this._start+"-"+O));try{C.send(this._config.downloadRequestBody)}catch(L){this._chunkError(L.message)}i&&C.status===0&&this._chunkError()}},this._chunkLoaded=function(){C.readyState===4&&(C.status<200||400<=C.status?this._chunkError():(this._start+=this._config.chunkSize||C.responseText.length,this._finished=!this._config.chunkSize||this._start>=(_=>(_=_.getResponseHeader("Content-Range"))!==null?parseInt(_.substring(_.lastIndexOf("/")+1)):-1)(C),this.parseChunk(C.responseText)))},this._chunkError=function(_){_=C.statusText||_,this._sendError(new Error(_))}}function p(S){(S=S||{}).chunkSize||(S.chunkSize=u.LocalChunkSize),d.call(this,S);var C,_,R=typeof FileReader<"u";this.stream=function(O){this._input=O,_=O.slice||O.webkitSlice||O.mozSlice,R?((C=new FileReader).onload=E(this._chunkLoaded,this),C.onerror=E(this._chunkError,this)):C=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var O=this._input,L=(this._config.chunkSize&&(L=Math.min(this._start+this._config.chunkSize,this._input.size),O=_.call(O,this._start,L)),C.readAsText(O,this._config.encoding));R||this._chunkLoaded({target:{result:L}})},this._chunkLoaded=function(O){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(O.target.result)},this._chunkError=function(){this._sendError(C.error)}}function f(S){var C;d.call(this,S=S||{}),this.stream=function(_){return C=_,this._nextChunk()},this._nextChunk=function(){var _,R;if(!this._finished)return _=this._config.chunkSize,C=_?(R=C.substring(0,_),C.substring(_)):(R=C,""),this._finished=!C,this.parseChunk(R)}}function g(S){d.call(this,S=S||{});
vendor: 11,323 bytes, lines 649-657
649var C=[],_=!0,R=!1;this.pause=function(){d.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){d.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(O){this._input=O,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){R&&C.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),C.length?this.parseChunk(C.shift()):_=!0},this._streamData=E(function(O){try{C.push(typeof O=="string"?O:O.toString(this._config.encoding)),_&&(_=!1,this._checkIsFinished(),this.parseChunk(C.shift()))}catch(L){this._streamError(L)}},this),this._streamError=E(function(O){this._streamCleanUp(),this._sendError(O)},this),this._streamEnd=E(function(){this._streamCleanUp(),R=!0,this._streamData("")},this),this._streamCleanUp=E(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function m(S){var C,_,R,O,L=Math.pow(2,53),A=-L,z=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,F=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,H=this,I=0,T=0,U=!1,M=!1,$=[],B={data:[],errors:[],meta:{}};function G(Z){return S.skipEmptyLines==="greedy"?Z.join("").trim()==="":Z.length===1&&Z[0].length===0}function X(){if(B&&R&&(K("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),R=!1),S.skipEmptyLines&&(B.data=B.data.filter(function(W){return!G(W)})),oe()){let W=function(ce,de){N(S.transformHeader)&&(ce=S.transformHeader(ce,de)),$.push(ce)};var Y=W;if(B)if(Array.isArray(B.data[0])){for(var Z=0;oe()&&Z<B.data.length;Z++)B.data[Z].forEach(W);B.data.splice(0,1)}else B.data.forEach(W)}function ie(W,ce){for(var de=S.header?{}:[],xe=0;xe<W.length;xe++){var me=xe,qe=W[xe],qe=((Oe,Ie)=>(He=>(S.dynamicTypingFunction&&S.dynamicTyping[He]===void 0&&(S.dynamicTyping[He]=S.dynamicTypingFunction(He)),(S.dynamicTyping[He]||S.dynamicTyping)===!0))(Oe)?Ie==="true"||Ie==="TRUE"||Ie!=="false"&&Ie!=="FALSE"&&((He=>{if(z.test(He)&&(He=parseFloat(He),A<He&&He<L))return 1})(Ie)?parseFloat(Ie):F.test(Ie)?new Date(Ie):Ie===""?null:Ie):Ie)(me=S.header?xe>=$.length?"__parsed_extra":$[xe]:me,qe=S.transform?S.transform(qe,me):qe);me==="__parsed_extra"?(de[me]=de[me]||[],de[me].push(qe)):de[me]=qe}return S.header&&(xe>$.length?K("FieldMismatch","TooManyFields","Too many fields: expected "+$.length+" fields but parsed "+xe,T+ce):xe<$.length&&K("FieldMismatch","TooFewFields","Too few fields: expected "+$.length+" fields but parsed "+xe,T+ce)),de}var Q;B&&(S.header||S.dynamicTyping||S.transform)&&(Q=1,!B.data.length||Array.isArray(B.data[0])?(B.data=B.data.map(ie),Q=B.data.length):B.data=ie(B.data,0),S.header&&B.meta&&(B.meta.fields=$),T+=Q)}function oe(){return S.header&&$.length===0}function K(Z,ie,Q,Y){Z={type:Z,code:ie,message:Q},Y!==void 0&&(Z.row=Y),B.errors.push(Z)}N(S.step)&&(O=S.step,S.step=function(Z){B=Z,oe()?X():(X(),B.data.length!==0&&(I+=Z.data.length,S.preview&&I>S.preview?_.abort():(B.data=B.data[0],O(B,H))))}),this.parse=function(Z,ie,Q){var Y=S.quoteChar||'"',Y=(S.newline||(S.newline=this.guessLineEndings(Z,Y)),R=!1,S.delimiter?N(S.delimiter)&&(S.delimiter=S.delimiter(Z),B.meta.delimiter=S.delimiter):((Y=((W,ce,de,xe,me)=>{var qe,Oe,Ie,He;me=me||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var _t=0;_t<me.length;_t++){for(var Dt,Zt=me[_t],kt=0,wn=0,Je=0,st=(Ie=void 0,new x({comments:xe,delimiter:Zt,newline:ce,preview:10}).parse(W)),en=0;en<st.data.length;en++)de&&G(st.data[en])?Je++:(Dt=st.data[en].length,wn+=Dt,Ie===void 0?Ie=Dt:0<Dt&&(kt+=Math.abs(Dt-Ie),Ie=Dt));0<st.data.length&&(wn/=st.data.length-Je),(Oe===void 0||kt<=Oe)&&(He===void 0||He<wn)&&1.99<wn&&(Oe=kt,qe=Zt,He=wn)}return{successful:!!(S.delimiter=qe),bestDelimiter:qe}})(Z,S.newline,S.skipEmptyLines,S.comments,S.delimitersToGuess)).successful?S.delimiter=Y.bestDelimiter:(R=!0,S.delimiter=u.DefaultDelimiter),B.meta.delimiter=S.delimiter),j(S));return S.preview&&S.header&&Y.preview++,C=Z,_=new x(Y),B=_.parse(C,ie,Q),X(),U?{meta:{paused:!0}}:B||{meta:{paused:!1}}},this.paused=function(){return U},this.pause=function(){U=!0,_.abort(),C=N(S.chunk)?"":C.substring(_.getCharIndex())},this.resume=function(){H.streamer._halted?(U=!1,H.streamer.parseChunk(C,!0)):setTimeout(H.resume,3)},this.aborted=function(){return M},this.abort=function(){M=!0,_.abort(),B.meta.aborted=!0,N(S.complete)&&S.complete(B),C=""},this.guessLineEndings=function(W,Y){W=W.substring(0,1048576);var Y=new RegExp(v(Y)+"([^]*?)"+v(Y),"gm"),Q=(W=W.replace(Y,"")).split("\r"),Y=W.split(` 650`),W=1<Y.length&&Y[0].length<Q[0].length;if(Q.length===1||W)return` 651`;for(var ce=0,de=0;de<Q.length;de++)Q[de][0]===` 652`&&ce++;return ce>=Q.length/2?`\r 653`:"\r"}}function v(S){return S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function x(S){var C=(S=S||{}).delimiter,_=S.newline,R=S.comments,O=S.step,L=S.preview,A=S.fastMode,z=null,F=!1,H=S.quoteChar==null?'"':S.quoteChar,I=H;if(S.escapeChar!==void 0&&(I=S.escapeChar),(typeof C!="string"||-1<u.BAD_DELIMITERS.indexOf(C))&&(C=","),R===C)throw new Error("Comment character same as delimiter");R===!0?R="#":(typeof R!="string"||-1<u.BAD_DELIMITERS.indexOf(R))&&(R=!1),_!==` 654`&&_!=="\r"&&_!==`\r 655`&&(_=` 656`);var T=0,U=!1;this.parse=function(M,$,B){if(typeof M!="string")throw new Error("Input must be a string");var G=M.length,X=C.length,oe=_.length,K=R.length,Z=N(O),ie=[],Q=[],Y=[],W=T=0;if(!M)return kt();if(A||A!==!1&&M.indexOf(H)===-1){for(var ce=M.split(_),de=0;de<ce.length;de++){if(Y=ce[de],T+=Y.length,de!==ce.length-1)T+=_.length;else if(B)return kt();if(!R||Y.substring(0,K)!==R){if(Z){if(ie=[],He(Y.split(C)),wn(),U)return kt()}else He(Y.split(C));if(L&&L<=de)return ie=ie.slice(0,L),kt(!0)}}return kt()}for(var xe=M.indexOf(C,T),me=M.indexOf(_,T),qe=new RegExp(v(I)+v(H),"g"),Oe=M.indexOf(H,T);;)if(M[T]===H)for(Oe=T,T++;;){if((Oe=M.indexOf(H,Oe+1))===-1)return B||Q.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ie.length,index:T}),Dt();if(Oe===G-1)return Dt(M.substring(T,Oe).replace(qe,H));if(H===I&&M[Oe+1]===I)Oe++;else if(H===I||Oe===0||M[Oe-1]!==I){xe!==-1&&xe<Oe+1&&(xe=M.indexOf(C,Oe+1));var Ie=_t((me=me!==-1&&me<Oe+1?M.indexOf(_,Oe+1):me)===-1?xe:Math.min(xe,me));if(M.substr(Oe+1+Ie,X)===C){Y.push(M.substring(T,Oe).replace(qe,H)),M[T=Oe+1+Ie+X]!==H&&(Oe=M.indexOf(H,T)),xe=M.indexOf(C,T),me=M.indexOf(_,T);break}if(Ie=_t(me),M.substring(Oe+1+Ie,Oe+1+Ie+oe)===_){if(Y.push(M.substring(T,Oe).replace(qe,H)),Zt(Oe+1+Ie+oe),xe=M.indexOf(C,T),Oe=M.indexOf(H,T),Z&&(wn(),U))return kt();if(L&&ie.length>=L)return kt(!0);break}Q.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ie.length,index:T}),Oe++}}else if(R&&Y.length===0&&M.substring(T,T+K)===R){if(me===-1)return kt();T=me+oe,me=M.indexOf(_,T),xe=M.indexOf(C,T)}else if(xe!==-1&&(xe<me||me===-1))Y.push(M.substring(T,xe)),T=xe+X,xe=M.indexOf(C,T);else{if(me===-1)break;if(Y.push(M.substring(T,me)),Zt(me+oe),Z&&(wn(),U))return kt();if(L&&ie.length>=L)return kt(!0)}return Dt();function He(Je){ie.push(Je),W=T}function _t(Je){var st=0;return st=Je!==-1&&(Je=M.substring(Oe+1,Je))&&Je.trim()===""?Je.length:st}function Dt(Je){return B||(Je===void 0&&(Je=M.substring(T)),Y.push(Je),T=G,He(Y),Z&&wn()),kt()}function Zt(Je){T=Je,He(Y),Y=[],me=M.indexOf(_,T)}function kt(Je){if(S.header&&!$&&ie.length&&!F){var st=ie[0],en=Object.create(null),qn=new Set(st);let kn=!1;for(let Kt=0;Kt<st.length;Kt++){let tn=st[Kt];if(en[tn=N(S.transformHeader)?S.transformHeader(tn,Kt):tn]){let Dn,yr=en[tn];for(;Dn=tn+"_"+yr,yr++,qn.has(Dn););qn.add(Dn),st[Kt]=Dn,en[tn]++,kn=!0,(z=z===null?{}:z)[Dn]=tn}else en[tn]=1,st[Kt]=tn;qn.add(tn)}kn&&console.warn("Duplicate headers found and renamed."),F=!0}return{data:ie,errors:Q,meta:{delimiter:C,linebreak:_,aborted:U,truncated:!!Je,cursor:W+($||0),renamedHeaders:z}}}function wn(){O(kt()),ie=[],Q=[]}},this.abort=function(){U=!0},this.getCharIndex=function(){return T}}function b(S){var C=S.data,_=a[C.workerId],R=!1;if(C.error)_.userError(C.error,C.file);else if(C.results&&C.results.data){var O={abort:function(){R=!0,w(C.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(N(_.userStep)){for(var L=0;L<C.results.data.length&&(_.userStep({data:C.results.data[L],errors:C.results.errors,meta:C.results.meta},O),!R);L++);delete C.results}else N(_.userChunk)&&(_.userChunk(C.results,O,C.file),delete C.results)}C.finished&&!R&&w(C.workerId,C.results)}function w(S,C){var _=a[S];N(_.userComplete)&&_.userComplete(C),_.terminate(),delete a[S]}function k(){throw new Error("Not implemented.")}function j(S){if(typeof S!="object"||S===null)return S;var C,_=Array.isArray(S)?[]:{};for(C in S)_[C]=j(S[C]);return _}function E(S,C){return function(){S.apply(C,arguments)}}function N(S){return typeof S=="function"}return u.parse=function(S,C){var _=(C=C||{}).dynamicTyping||!1;if(N(_)&&(C.dynamicTypingFunction=_,_={}),C.dynamicTyping=_,C.transform=!!N(C.transform)&&C.transform,!C.worker||!u.WORKERS_SUPPORTED)return _=null,u.NODE_STREAM_INPUT,typeof S=="string"?(S=(R=>R.charCodeAt(0)!==65279?R:R.slice(1))(S),_=new(C.download?h:f)(C)):S.readable===!0&&N(S.read)&&N(S.on)?_=new g(C):(r.File&&S instanceof File||S instanceof Object)&&(_=new p(C)),_.stream(S);(_=(()=>{var R;return!!u.WORKERS_SUPPORTED&&(R=(()=>{var O=r.URL||r.webkitURL||null,L=n.toString();return u.BLOB_URL||(u.BLOB_URL=O.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",L,")();"],{type:"text/javascript"})))})(),(R=new r.Worker(R)).onmessage=b,R.id=c++,a[R.id]=R)})()).userStep=C.step,_.userChunk=C.chunk,_.userComplete=C.complete,_.userError=C.error,C.step=N(C.step),C.chunk=N(C.chunk),C.complete=N(C.complete),C.error=N(C.error),delete C.worker,_.postMessage({input:S,config:C,workerId:_.id})},u.unparse=function(S,C){var _=!1,R=!0,O=",",L=`\r 657`,A='"',z=A+A,F=!1,H=null,I=!1,T=((()=>{if(typeof C=="object"){if(typeof C.delimiter!="string"||u.BAD_DELIMITERS.filter(function($){return C.delimiter.indexOf($)!==-1}).length||(O=C.delimiter),typeof C.quotes!="boolean"&&typeof C.quotes!="function"&&!Array.isArray(C.quotes)||(_=C.quotes),typeof C.skipEmptyLines!="boolean"&&typeof C.skipEmptyLines!="string"||(F=C.skipEmptyLines),typeof C.newline=="string"&&(L=C.newline),typeof C.quoteChar=="string"&&(A=C.quoteChar),typeof C.header=="boolean"&&(R=C.header),Array.isArray(C.columns)){if(C.columns.length===0)throw new Error("Option columns is empty");H=C.columns}C.escapeChar!==void 0&&(z=C.escapeChar+A),C.escapeFormulae instanceof RegExp?I=C.escapeFormulae:typeof C.escapeFormulae=="boolean"&&C.escapeFormulae&&(I=/^[=+\-@\t\r].*$/)}})(),new RegExp(v(A),"g"));if(typeof S=="string"&&(S=JSON.parse(S)),Array.isArray(S)){if(!S.length||Array.isArray(S[0]))return U(null,S,F);if(typeof S[0]=="object")return U(H||Object.keys(S[0]),S,F)}
657else if(typeof S=="object")return typeof S.data=="string"&&(S.data=JSON.parse(S.data)),Array.isArray(S.data)&&(S.fields||(S.fields=S.meta&&S.meta.fields||H),S.fields||(S.fields=Array.isArray(S.data[0])?S.fields:typeof S.data[0]=="object"?Object.keys(S.data[0]):[]),Array.isArray(S.data[0])||typeof S.data[0]=="object"||(S.data=[S.data])),U(S.fields||[],S.data||[],F);throw new Error("Unable to serialize unrecognized input");function U($,B,G){var X="",oe=(typeof $=="string"&&($=JSON.parse($)),typeof B=="string"&&(B=JSON.parse(B)),Array.isArray($)&&0<$.length),K=!Array.isArray(B[0]);if(oe&&R){for(var Z=0;Z<$.length;Z++)0<Z&&(X+=O),X+=M($[Z],Z);0<B.length&&(X+=L)}for(var ie=0;ie<B.length;ie++){var Q=(oe?$:B[ie]).length,Y=!1,W=oe?Object.keys(B[ie]).length===0:B[ie].length===0;if(G&&!oe&&(Y=G==="greedy"?B[ie].join("").trim()==="":B[ie].length===1&&B[ie][0].length===0),G==="greedy"&&oe){for(var ce=[],de=0;de<Q;de++){var xe=K?$[de]:de;ce.push(B[ie][xe])}Y=ce.join("").trim()===""}if(!Y){for(var me=0;me<Q;me++){0<me&&!W&&(X+=O);var qe=oe&&K?$[me]:me;X+=M(B[ie][qe],me)}ie<B.length-1&&(!G||0<Q&&!W)&&(X+=L)}}return X}function M($,B){var G,X;return $==null?"":$.constructor===Date?JSON.stringify($).slice(1,25):(X=!1,I&&typeof $=="string"&&I.test($)&&($="'"+$,X=!0),G=$.toString().replace(T,z),(X=X||_===!0||typeof _=="function"&&_($,B)||Array.isArray(_)&&_[B]||((oe,K)=>{for(var Z=0;Z<K.length;Z++)if(-1<oe.indexOf(K[Z]))return!0;return!1})(G,u.BAD_DELIMITERS)||-1<G.indexOf(O)||G.charAt(0)===" "||G.charAt(G.length-1)===" ")?A+G+A:G)}},u.RECORD_SEP="�",u.UNIT_SEP="�",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",` 658`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!i&&!!r.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=x,u.ParserHandle=m,u.NetworkStreamer=h,u.FileStreamer=p,u.StringStreamer=f,u.ReadableStreamStreamer=g,r.jQuery&&((s=r.jQuery).fn.parse=function(S){var C=S.config||{},_=[];return this.each(function(L){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var A=0;A<this.files.length;A++)_.push({file:this.files[A],inputElem:this,instanceConfig:s.extend({},C)})}),R(),this;function R(){if(_.length===0)N(S.complete)&&S.complete();else{var L,A,z,F,H=_[0];if(N(S.before)){var I=S.before(H.file,H.inputElem);if(typeof I=="object"){if(I.action==="abort")return L="AbortError",A=H.file,z=H.inputElem,F=I.reason,void(N(S.error)&&S.error({name:L},A,z,F));if(I.action==="skip")return void O();typeof I.config=="object"&&(H.instanceConfig=s.extend(H.instanceConfig,I.config))}else if(I==="skip")return void O()}var T=H.instanceConfig.complete;H.instanceConfig.complete=function(U){N(T)&&T(U,H.file,H.inputElem),O()},u.parse(H.file,H.instanceConfig)}}function O(){_.splice(0,1),R()}}),o&&(r.onmessage=function(S){S=S.data,u.WORKER_ID===void 0&&S&&(u.WORKER_ID=S.workerId),typeof S.input=="string"?r.postMessage({workerId:u.WORKER_ID,results:u.parse(S.input,S.config),finished:!0}):(r.File&&S.input instanceof File||S.input instanceof Object)&&(S=u.parse(S.input,S.config))&&r.postMessage({workerId:u.WORKER_ID,results:S,finished:!0})}),(h.prototype=Object.create(d.prototype)).constructor=h,(p.prototype=Object.create(d.prototype)).constructor=p,(f.prototype=Object.create(f.prototype)).constructor=f,(g.prototype=Object.create(d.prototype)).constructor=g,u})})(AL);var fse=AL.exports;const pse=wg(fse),mse=({open:t,onOpenChange:e,onImported:n})=>{var m;const[r,s]=y.useState([]),[i,o]=y.useState([]),[a,c]=y.useState({}),[u,d]=y.useState(!1),{toast:h}=ht(),p=["name","email","phone","notes"],f=v=>{var b;const x=(b=v.target.files)==null?void 0:b[0];x&&pse.parse(x,{complete:w=>{const k=w.data;if(k.length<2)return;s(k[0]),o(k.slice(1).filter(E=>E.some(N=>N.trim())));const j={};k[0].forEach((E,N)=>{const S=E.toLowerCase().trim();p.includes(S)&&(j[S]=String(N))}),c(j)}})},g=async()=>{if(!a.email){h({title:"Email column required",variant:"destructive"});return}d(!0);const v=i.map(b=>({email:b[parseInt(a.email)]||"",name:a.name&&b[parseInt(a.name)]||null,phone:a.phone&&b[parseInt(a.phone)]||null,notes:a.notes&&b[parseInt(a.notes)]||null,source:"csv"})).filter(b=>b.email),{error:x}=await D.from("contacts").upsert(v,{onConflict:"email"});d(!1),x?h({title:"Import failed",description:x.message,variant:"destructive"}):(h({title:`Imported ${v.length} contacts`}),e(!1),n())};return l.jsx(Es,{open:t,onOpenChange:e,children:l.jsxs(es,{className:"max-w-lg",children:[l.jsx(ts,{children:l.jsx(_r,{children:"Import Contacts from CSV"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("input",{type:"file",accept:".csv",onChange:f,className:"text-sm"}),r.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Map CSV columns to contact fields:"}),l.jsx("div",{className:"space-y-2",children:p.map(v=>l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-sm font-medium capitalize w-20",children:[v,v==="email"?" *":""]}),l.jsxs(Xr,{value:a[v]||"",onValueChange:x=>c(b=>({...b,[v]:x})),children:[l.jsx(Tr,{className:"w-full",children:l.jsx(Zr,{placeholder:"Select column"})}),l.jsx(Rr,{children:r.map((x,b)=>l.jsx(nt,{value:String(b),children:x},b))})]})]},v))}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[i.length," rows found. Preview: ",(m=i[0])==null?void 0:m.slice(0,3).join(", "),"..."]}),l.jsx(q,{onClick:g,disabled:u,className:"w-full",children:u?"Importing...":`Import ${i.length} Contacts`})]})]})]})})},gse=()=>{const[t,e]=y.useState([]),[n,r]=y.useState([]),[s,i]=y.useState([]),[o,a]=y.useState(""),[c,u]=y.useState(!1),[d,h]=y.useState(!1),[p,f]=y.useState(""),[g,m]=y.useState(""),[v,x]=y.useState(""),[b,w]=y.useState([]),[k,j]=y.useState(null),{toast:E}=ht(),N=y.useCallback(async()=>{const[A,z,F]=await Promise.all([D.from("contacts").select("*").order("created_at",{ascending:!1}),D.from("contact_tags").select("*"),D.from("contact_tag_assignments").select("*")]);e(A.data??[]),r(z.data??[]),i(F.data??[])},[]);y.useEffect(()=>{N()},[N]);const S=async()=>
658{if(!g)return;const{error:A}=await D.from("contacts").insert({name:p,email:g,phone:v,source:"manual"});A?E({title:"Error",description:A.message,variant:"destructive"}):(E({title:"Contact added"}),u(!1),f(""),m(""),x(""),N())},C=async()=>{b.length&&(await D.from("contacts").delete().in("id",b),w([]),N(),E({title:"Contacts deleted"}))},_=()=>{const A=["name","email","phone","source","created_at"],z=t.map(U=>A.map(M=>U[M]??"").join(",")),F=[A.join(","),...z].join(` 659`),H=new Blob([F],{type:"text/csv"}),I=URL.createObjectURL(H),T=document.createElement("a");T.href=I,T.download="contacts.csv",T.click()},R=t.filter(A=>{var z;return(((z=A.name)==null?void 0:z.toLowerCase())||"").includes(o.toLowerCase())||A.email.toLowerCase().includes(o.toLowerCase())}),O=A=>{const z=s.filter(F=>F.contact_id===A).map(F=>F.tag_id);return n.filter(F=>z.includes(F.id))},L=A=>{w(z=>z.includes(A)?z.filter(F=>F!==A):[...z,A])};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-2xl font-bold font-heading",children:"Contacts"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(q,{variant:"outline",size:"sm",onClick:_,children:[l.jsx(Pc,{className:"h-4 w-4 mr-1"}),"Export"]}),l.jsxs(q,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[l.jsx(Kg,{className:"h-4 w-4 mr-1"}),"Import CSV"]}),l.jsxs(Es,{open:c,onOpenChange:u,children:[l.jsx(Ek,{asChild:!0,children:l.jsxs(q,{size:"sm",children:[l.jsx(Qr,{className:"h-4 w-4 mr-1"}),"Add Contact"]})}),l.jsxs(es,{children:[l.jsx(ts,{children:l.jsx(_r,{children:"Add Contact"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{placeholder:"Name",value:p,onChange:A=>f(A.target.value)}),l.jsx(ue,{placeholder:"Email",type:"email",required:!0,value:g,onChange:A=>m(A.target.value)}),l.jsx(ue,{placeholder:"Phone",value:v,onChange:A=>x(A.target.value)}),l.jsx(q,{onClick:S,className:"w-full",children:"Add"})]})]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative flex-1 max-w-sm",children:[l.jsx(PA,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ue,{placeholder:"Search contacts...",value:o,onChange:A=>a(A.target.value),className:"pl-9"})]}),b.length>0&&l.jsxs(q,{variant:"destructive",size:"sm",onClick:C,children:[l.jsx(ks,{className:"h-4 w-4 mr-1"}),"Delete (",b.length,")"]})]}),l.jsx("div",{className:"border rounded-lg bg-background",children:l.jsxs(Ii,{children:[l.jsx(Di,{children:l.jsxs(Nt,{children:[l.jsx(Pe,{className:"w-10",children:l.jsx("input",{type:"checkbox",onChange:A=>w(A.target.checked?R.map(z=>z.id):[]),checked:b.length===R.length&&R.length>0})}),l.jsx(Pe,{children:"Name"}),l.jsx(Pe,{children:"Email"}),l.jsx(Pe,{children:"Phone"}),l.jsx(Pe,{children:"Source"}),l.jsx(Pe,{children:"Tags"}),l.jsx(Pe,{children:"Created"})]})}),l.jsxs(Li,{children:[R.map(A=>l.jsxs(Nt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>j(A),children:[l.jsx(je,{onClick:z=>z.stopPropagation(),children:l.jsx("input",{type:"checkbox",checked:b.includes(A.id),onChange:()=>L(A.id)})}),l.jsx(je,{className:"font-medium",children:A.name||"â"}),l.jsx(je,{children:A.email}),l.jsx(je,{children:A.phone||"â"}),l.jsx(je,{children:l.jsx(Ot,{variant:"outline",children:A.source})}),l.jsx(je,{children:l.jsx("div",{className:"flex gap-1 flex-wrap",children:O(A.id).map(z=>l.jsx(RL,{name:z.name,color:z.color},z.id))})}),l.jsx(je,{className:"text-muted-foreground text-sm",children:mt(new Date(A.created_at),"MMM d, yyyy")})]},A.id)),R.length===0&&l.jsx(Nt,{children:l.jsx(je,{colSpan:7,className:"text-center text-muted-foreground py-8",children:"No contacts found."})})]})]})}),l.jsx(mse,{open:d,onOpenChange:h,onImported:N}),l.jsx(hse,{contact:k,open:!!k,onOpenChange:A=>{A||j(null)},allTags:n,tagAssignments:s,onUpdated:N})]})},yse=()=>{const[t,e]=y.useState([]),[n,r]=y.useState("all"),[s,i]=y.useState("all"),[o,a]=y.useState(null),{toast:c}=ht(),u=async()=>{let h=D.from("form_submissions").select("*").order("created_at",{ascending:!1});n!=="all"&&(h=h.eq("source",n)),s!=="all"&&(h=h.eq("status",s));const{data:p}=await h;e(p??[])};y.useEffect(()=>{u()},[n,s]);const d=async(h,p)=>{await D.from("form_submissions").update({status:p}).eq("id",h),u(),c({title:`Marked as ${p}`})};return l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-2xl font-bold font-heading",children:"Form Submissions"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsxs(Xr,{value:n,onValueChange:r,children:[l.jsx(Tr,{className:"w-40",children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"all",children:"All Sources"}),l.jsx(nt,{value:"contact",children:"Contact"}),l.jsx(nt,{value:"newsletter",children:"Newsletter"}),l.jsx(nt,{value:"coaching",children:"Coaching"})]})]}),l.jsxs(Xr,{value:s,onValueChange:i,children:[l.jsx(Tr,{className:"w-40",children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"all",children:"All Statuses"}),l.jsx(nt,{value:"new",children:"New"}),l.jsx(nt,{value:"read",children:"Read"}),l.jsx(nt,{value:"replied",children:"Replied"})]})]})]}),l.jsx("div",{className:"border rounded-lg bg-background",children:l.jsxs(Ii,{children:[l.jsx(Di,{children:l.jsxs(Nt,{children:[l.jsx(Pe,{children:"Name"}),l.jsx(Pe,{children:"Email"}),l.jsx(Pe,{children:"Source"}),l.jsx(Pe,{children:"Status"}),l.jsx(Pe,{children:"Date"}),l.jsx(Pe,{children:"Actions"})]})}),l.jsxs(Li,{children:[t.map(h=>l.jsxs(Nt,{className:"cursor-pointer",onClick:()=>{a(h),h.status==="new"&&d(h.id,"read")},children:[l.jsx(je,{className:"font-medium",children:h.name||"â"}),l.jsx(je,{children:h.email}),l.jsx(je,{children:l.jsx(Ot,{variant:"outline",children:h.source})}),l.jsx(je,{children:l.jsx(Ot,{variant:h.status==="new"?"default":"secondary",children:h.status})}),l.jsx(je,{className:"text-sm text-muted-foreground",children:mt(new Date(h.created_at),"MMM d, yyyy h:mm a")}),l.jsx(je,{children:l.jsx(q,{variant:"ghost",size:"sm",onClick:p=>{p.stopPropagation(),d(h.id,"replied")},children:"Mark Replied"})})]}
659,h.id)),t.length===0&&l.jsx(Nt,{children:l.jsx(je,{colSpan:6,className:"text-center text-muted-foreground py-8",children:"No submissions found."})})]})]})}),l.jsx(Es,{open:!!o,onOpenChange:()=>a(null),children:l.jsxs(es,{children:[l.jsx(ts,{children:l.jsxs(_r,{children:["Submission from ",(o==null?void 0:o.name)||(o==null?void 0:o.email)]})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium",children:"Email:"})," ",l.jsx("span",{className:"text-sm",children:o==null?void 0:o.email})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium",children:"Source:"})," ",l.jsx(Ot,{variant:"outline",children:o==null?void 0:o.source})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium",children:"Message:"}),l.jsx("p",{className:"text-sm mt-1 whitespace-pre-wrap",children:(o==null?void 0:o.message)||"No message"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium",children:"Submitted:"})," ",l.jsx("span",{className:"text-sm",children:o&&mt(new Date(o.created_at),"PPpp")})]})]})]})})]})},vse=()=>{const[t,e]=y.useState([]),n=In(),{toast:r}=ht(),s=async()=>{const{data:o}=await D.from("blog_posts").select("*").order("created_at",{ascending:!1});e(o??[])};y.useEffect(()=>{s()},[]);const i=async o=>{await D.from("blog_posts").delete().eq("id",o),s(),r({title:"Post deleted"})};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-2xl font-bold font-heading",children:"Blog Posts"}),l.jsxs(q,{size:"sm",onClick:()=>n("/admin/blog/new"),children:[l.jsx(Qr,{className:"h-4 w-4 mr-1"}),"New Post"]})]}),l.jsx("div",{className:"border rounded-lg bg-background",children:l.jsxs(Ii,{children:[l.jsx(Di,{children:l.jsxs(Nt,{children:[l.jsx(Pe,{children:"Title"}),l.jsx(Pe,{children:"Slug"}),l.jsx(Pe,{children:"Status"}),l.jsx(Pe,{children:"Published"}),l.jsx(Pe,{children:"Actions"})]})}),l.jsxs(Li,{children:[t.map(o=>l.jsxs(Nt,{children:[l.jsx(je,{className:"font-medium",children:o.title}),l.jsx(je,{className:"text-muted-foreground text-sm",children:o.slug}),l.jsx(je,{children:l.jsx(Ot,{variant:o.status==="published"?"default":"secondary",children:o.status})}),l.jsx(je,{className:"text-sm text-muted-foreground",children:o.published_at?mt(new Date(o.published_at),"MMM d, yyyy"):"â"}),l.jsx(je,{children:l.jsxs("div",{className:"flex gap-1",children:[l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>n(`/admin/blog/${o.id}`),children:l.jsx(ok,{className:"h-4 w-4"})}),l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>i(o.id),children:l.jsx(ks,{className:"h-4 w-4 text-destructive"})})]})})]},o.id)),t.length===0&&l.jsx(Nt,{children:l.jsx(je,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No blog posts yet."})})]})]})})]})},xse=({value:t,onChange:e})=>{const[n,r]=y.useState(!1),[s,i]=y.useState(!1),o=y.useRef(null),a=y.useCallback(async u=>{if(!u.type.startsWith("image/"))return;r(!0);const d=u.name.split(".").pop(),h=`${Date.now()}-${Math.random().toString(36).slice(2)}.${d}`,{error:p}=await D.storage.from("blog-images").upload(h,u,{contentType:u.type});if(!p){const{data:f}=D.storage.from("blog-images").getPublicUrl(h);e(f.publicUrl)}r(!1)},[e]),c=y.useCallback(u=>{u.preventDefault(),i(!1);const d=u.dataTransfer.files[0];d&&a(d)},[a]);return l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-foreground mb-1.5 block",children:"Featured Image"}),t?l.jsxs("div",{className:"relative rounded border border-border overflow-hidden",children:[l.jsx("img",{src:t,alt:"Featured",className:"w-full h-48 object-cover"}),l.jsx(q,{variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-7 w-7",onClick:()=>e(""),children:l.jsx(nu,{className:"h-4 w-4"})})]}):l.jsxs("div",{className:`border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ${s?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onDragOver:u=>{u.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:c,onClick:()=>{var u;return(u=o.current)==null?void 0:u.click()},children:[n?l.jsx(qt,{className:"h-8 w-8 mx-auto animate-spin text-muted-foreground"}):l.jsxs(l.Fragment,{children:[l.jsx(CA,{className:"h-8 w-8 mx-auto text-muted-foreground mb-2"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Drag & drop an image here, or click to browse"})]}),l.jsx("input",{ref:o,type:"file",accept:"image/*",className:"hidden",onChange:u=>{var h;const d=(h=u.target.files)==null?void 0:h[0];d&&a(d),o.current&&(o.current.value="")}})]})]})},bse=()=>{const{id:t}=ea(),e=t==="new",n=In(),{toast:r}=ht(),[s,i]=y.useState(""),[o,a]=y.useState(""),[c,u]=y.useState(""),[d,h]=y.useState(""),[p,f]=y.useState(""),[g,m]=y.useState("draft"),[v,x]=y.useState(""),[b,w]=y.useState(!1),[k,j]=y.useState(""),[E,N]=y.useState("");y.useEffect(()=>{!e&&t&&D.from("blog_posts").select("*").eq("id",t).single().then(({data:_})=>{_&&(i(_.title),a(_.slug),u(_.content??""),h(_.excerpt??""),f(_.featured_image??""),m(_.status),x(_.author??""),j(_.seo_title??""),N(_.seo_description??""))})},[t,e]);const S=_=>_.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),C=async()=>
659{if(!s||!o){r({title:"Title and slug required",variant:"destructive"});return}w(!0);const _={title:s,slug:o,content:c,excerpt:d||null,featured_image:p||null,status:g,author:v||null,seo_title:k||null,seo_description:E||null,published_at:g==="published"?new Date().toISOString():null};if(e){const{error:R}=await D.from("blog_posts").insert(_);R?r({title:"Error",description:R.message,variant:"destructive"}):(r({title:"Post created"}),n("/admin/blog"))}else{const{error:R}=await D.from("blog_posts").update(_).eq("id",t);r(R?{title:"Error",description:R.message,variant:"destructive"}:{title:"Post updated"})}w(!1)};return l.jsxs("div",{className:"max-w-3xl space-y-4",children:[l.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>n("/admin/blog"),children:[l.jsx(ei,{className:"h-4 w-4 mr-1"}),"Back to Blog"]}),l.jsx("h2",{className:"text-2xl font-bold font-heading",children:e?"New Post":"Edit Post"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(ue,{placeholder:"Title",value:s,onChange:_=>{i(_.target.value),e&&a(S(_.target.value))}}),l.jsx(ue,{placeholder:"Slug",value:o,onChange:_=>a(_.target.value)})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(ue,{placeholder:"Author",value:v,onChange:_=>x(_.target.value)}),l.jsxs(Xr,{value:g,onValueChange:m,children:[l.jsx(Tr,{children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"draft",children:"Draft"}),l.jsx(nt,{value:"published",children:"Published"})]})]})]}),l.jsx(xse,{value:p,onChange:f}),l.jsx(jt,{placeholder:"Excerpt",value:d,onChange:_=>h(_.target.value),rows:2}),l.jsx(RS,{content:c,onChange:u}),l.jsxs("div",{className:"space-y-2 border-t pt-4",children:[l.jsx("h3",{className:"font-semibold",children:"SEO"}),l.jsx(ue,{placeholder:`SEO Title (defaults to "${s||"post title"}")`,value:k,onChange:_=>j(_.target.value)}),l.jsx(jt,{placeholder:"SEO Description (defaults to excerpt)",value:E,onChange:_=>N(_.target.value),rows:2})]}),l.jsx("div",{className:"flex items-center gap-4",children:l.jsx(q,{onClick:C,disabled:b,className:"flex-1",children:b?"Saving...":"Save Post"})})]})},wse=()=>{const[t,e]=y.useState([]),n=In(),{toast:r}=ht(),s=async()=>{const{data:o}=await D.from("courses").select("*").order("created_at",{ascending:!1});e(o??[])};y.useEffect(()=>{s()},[]);const i=async o=>{await D.from("courses").delete().eq("id",o),s(),r({title:"Course deleted"})};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-2xl font-bold font-heading",children:"Courses"}),l.jsxs(q,{size:"sm",onClick:()=>n("/admin/courses/new"),children:[l.jsx(Qr,{className:"h-4 w-4 mr-1"}),"New Course"]})]}),l.jsx("div",{className:"border rounded-lg bg-background",children:l.jsxs(Ii,{children:[l.jsx(Di,{children:l.jsxs(Nt,{children:[l.jsx(Pe,{children:"Title"}),l.jsx(Pe,{children:"Status"}),l.jsx(Pe,{children:"Price"}),l.jsx(Pe,{children:"Actions"})]})}),l.jsxs(Li,{children:[t.map(o=>l.jsxs(Nt,{children:[l.jsx(je,{className:"font-medium",children:o.title}),l.jsx(je,{children:l.jsx(Ot,{variant:o.status==="published"?"default":"secondary",children:o.status})}),l.jsxs(je,{children:["$",Number(o.price).toFixed(2)]}),l.jsx(je,{children:l.jsxs("div",{className:"flex gap-1",children:[l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>n(`/admin/courses/${o.id}`),children:l.jsx(ok,{className:"h-4 w-4"})}),l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>i(o.id),children:l.jsx(ks,{className:"h-4 w-4 text-destructive"})})]})})]},o.id)),t.length===0&&l.jsx(Nt,{children:l.jsx(je,{colSpan:4,className:"text-center text-muted-foreground py-8",children:"No courses yet."})})]})]})})]})};function kse(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return y.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const Ly=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function uu(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function AS(t){return"nodeType"in t}function gr(t){var e,n;return t?uu(t)?t:AS(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function OS(t){const{Document:e}=gr(t);return t instanceof e}function ef(t){return uu(t)?!1:t instanceof gr(t).HTMLElement}function OL(t){return t instanceof gr(t).SVGElement}function du(t){return t?uu(t)?t.document:AS(t)?OS(t)?t:ef(t)||OL(t)?t.ownerDocument:document:document:document}const Zs=Ly?y.useLayoutEffect:y.useEffect;function PS(t){const e=y.useRef(t);return Zs(()=>{e.current=t}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function Sse(){const t=y.useRef(null),e=y.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=y.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Nh(t,e){e===void 0&&(e=[t]);const n=y.useRef(t);return Zs(()=>{n.current!==t&&(n.current=t)},e),n}function tf(t,e){const n=y.useRef();return y.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function yg(t){const e=PS(t),n=y.useRef(null),r=y.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function Kw(t){const e=y.useRef();return y.useEffect(()=>{e.current=t},[t]),e.current}let yx={};function nf(t,e){return y.useMemo(()=>
659{if(e)return e;const n=yx[t]==null?0:yx[t]+1;return yx[t]=n,t+"-"+n},[t,e])}function PL(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,o)=>{const a=Object.entries(o);for(const[c,u]of a){const d=i[c];d!=null&&(i[c]=d+t*u)}return i},{...e})}}const dc=PL(1),_h=PL(-1);function Cse(t){return"clientX"in t&&"clientY"in t}function MS(t){if(!t)return!1;const{KeyboardEvent:e}=gr(t.target);return e&&t instanceof e}function jse(t){if(!t)return!1;const{TouchEvent:e}=gr(t.target);return e&&t instanceof e}function Gw(t){if(jse(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Cse(t)?{x:t.clientX,y:t.clientY}:null}const Eh=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Eh.Translate.toString(t),Eh.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),$_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Nse(t){return t.matches($_)?t:t.querySelector($_)}const _se={display:"none"};function Ese(t){let{id:e,value:n}=t;return V.createElement("div",{id:e,style:_se},n)}function Tse(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return V.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Rse(){const[t,e]=y.useState("");return{announce:y.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const ML=y.createContext(null);function Ase(t){const e=y.useContext(ML);y.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function Ose(){const[t]=y.useState(()=>new Set),e=y.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[y.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[t]),e]}const Pse={draggable:` 660 To pick up a draggable item, press the space bar. 661 While dragging, use the arrow keys to move the item. 662 Press space again to drop the item in its new position, or press escape to cancel. 663 `},Mse={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Ise(t){let{announcements:e=Mse,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Pse}=t;const{announce:i,announcement:o}=Rse(),a=nf("DndLiveRegion"),[c,u]=y.useState(!1);if(y.useEffect(()=>{u(!0)},[]),Ase(y.useMemo(()=>({onDragStart(h){let{active:p}=h;i(e.onDragStart({active:p}))},onDragMove(h){let{active:p,over:f}=h;e.onDragMove&&i(e.onDragMove({active:p,over:f}))},onDragOver(h){let{active:p,over:f}=h;i(e.onDragOver({active:p,over:f}))},onDragEnd(h){let{active:p,over:f}=h;i(e.onDragEnd({active:p,over:f}))},onDragCancel(h){let{active:p,over:f}=h;i(e.onDragCancel({active:p,over:f}))}}),[i,e])),!c)return null;const d=V.createElement(V.Fragment,null,V.createElement(Ese,{id:r,value:s.draggable}),V.createElement(Tse,{id:a,announcement:o}));return n?Vr.createPortal(d,n):d}var cn;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(cn||(cn={}));function vg(){}function B_(t,e){return y.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Dse(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return y.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const js=Object.freeze({x:0,y:0});function IL(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function DL(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Lse(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function z_(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function LL(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function F_(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.to
663p),{x:e+t.width*.5,y:n+t.height*.5}}const $se=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=F_(e,e.left,e.top),i=[];for(const o of r){const{id:a}=o,c=n.get(a);if(c){const u=IL(F_(c),s);i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(DL)},Bse=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=z_(e),i=[];for(const o of r){const{id:a}=o,c=n.get(a);if(c){const u=z_(c),d=s.reduce((p,f,g)=>p+IL(u[g],f),0),h=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:h}})}}return i.sort(DL)};function zse(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=s-r,a=i-n;if(r<s&&n<i){const c=e.width*e.height,u=t.width*t.height,d=o*a,h=d/(c+u-d);return Number(h.toFixed(4))}return 0}const Fse=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const c=zse(a,e);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort(Lse)};function Use(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function $L(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:js}function Vse(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,a)=>({...o,top:o.top+t*a.y,bottom:o.bottom+t*a.y,left:o.left+t*a.x,right:o.right+t*a.x}),{...n})}}const Hse=Vse(1);function Wse(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function qse(t,e,n){const r=Wse(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:a}=r,c=t.left-o-(1-s)*parseFloat(n),u=t.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?t.width/s:t.width,h=i?t.height/i:t.height;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c}}const Kse={ignoreTransform:!1};function hu(t,e){e===void 0&&(e=Kse);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:d}=gr(t).getComputedStyle(t);u&&(n=qse(n,u,d))}const{top:r,left:s,width:i,height:o,bottom:a,right:c}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:c}}function U_(t){return hu(t,{ignoreTransform:!0})}function Gse(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function Yse(t,e){return e===void 0&&(e=gr(t).getComputedStyle(t)),e.position==="fixed"}function Jse(t,e){e===void 0&&(e=gr(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function $y(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(OS(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!ef(s)||OL(s)||n.includes(s))return n;const i=gr(t).getComputedStyle(s);return s!==t&&Jse(s,i)&&n.push(s),Yse(s,i)?n:r(s.parentNode)}return t?r(t):n}function BL(t){const[e]=$y(t,1);return e??null}function vx(t){return!Ly||!t?null:uu(t)?t:AS(t)?OS(t)||t===du(t).scrollingElement?window:ef(t)?t:null:null}function zL(t){return uu(t)?t.scrollX:t.scrollLeft}function FL(t){return uu(t)?t.scrollY:t.scrollTop}function Yw(t){return{x:zL(t),y:FL(t)}}var mn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(mn||(mn={}));function UL(t){return!Ly||!t?!1:t===document.scrollingElement}function VL(t){const e={x:0,y:0},n=UL(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:e}}const Qse={x:.2,y:.2};function Xse(t,e,n,r,s){let{top:i,left:o,right:a,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=Qse);const{isTop:u,isBottom:d,isLeft:h,isRight:p}=VL(t),f={x:0,y:0},g={x:0,y:0},m={height:e.height*s.y,width:e.width*s.x};return!u&&i<=e.top+m.height?(f.y=mn.Backward,g.y=r*Math.abs((e.top+m.height-i)/m.height)):!d&&c>=e.bottom-m.height&&(f.y=mn.Forward,g.y=r*Math.abs((e.bottom-m.height-c)/m.height)),!p&&a>=e.right-m.width?(f.x=mn.Forward,g.x=r*Math.abs((e.right-m.width-a)/m.width)):!h&&o<=e.left+m.width&&(f.x=mn.Backward,g.x=r*Math.abs((e.left+m.width-o)/m.width)),{direction:f,speed:g}}function Zse(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function HL(t){return t.reduce((e,n)=>dc(e,Yw(n)),js)}function eie(t){return t.reduce((e,n)=>e+zL(n),0)}function tie(t){return t.reduce((e,n)=>e+FL(n),0)}function nie(t,e){if(e===void 0&&(e=hu),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);BL(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const rie=[["x",["left","right"],eie],["y",["top","bottom"],tie]];class IS{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=$y(n),s=HL(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,a]of rie)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=a(r),d=s[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class _d{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>
663{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function sie(t){const{EventTarget:e}=gr(t);return t instanceof e?t:du(t)}function xx(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var $r;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})($r||($r={}));function V_(t){t.preventDefault()}function iie(t){t.stopPropagation()}var Ze;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Ze||(Ze={}));const WL={start:[Ze.Space,Ze.Enter],cancel:[Ze.Esc],end:[Ze.Space,Ze.Enter,Ze.Tab]},oie=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Ze.Right:return{...n,x:n.x+25};case Ze.Left:return{...n,x:n.x-25};case Ze.Down:return{...n,y:n.y+25};case Ze.Up:return{...n,y:n.y-25}}};class DS{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new _d(du(n)),this.windowListeners=new _d(gr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($r.Resize,this.handleCancel),this.windowListeners.add($r.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($r.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&nie(r),n(js)}handleKeyDown(e){if(MS(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=WL,coordinateGetter:o=oie,scrollBehavior:a="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:js;this.referenceCoordinates||(this.referenceCoordinates=d);const h=o(e,{active:n,context:r.current,currentCoordinates:d});if(h){const p=_h(h,d),f={x:0,y:0},{scrollableAncestors:g}=r.current;for(const m of g){const v=e.code,{isTop:x,isRight:b,isLeft:w,isBottom:k,maxScroll:j,minScroll:E}=VL(m),N=Zse(m),S={x:Math.min(v===Ze.Right?N.right-N.width/2:N.right,Math.max(v===Ze.Right?N.left:N.left+N.width/2,h.x)),y:Math.min(v===Ze.Down?N.bottom-N.height/2:N.bottom,Math.max(v===Ze.Down?N.top:N.top+N.height/2,h.y))},C=v===Ze.Right&&!b||v===Ze.Left&&!w,_=v===Ze.Down&&!k||v===Ze.Up&&!x;if(C&&S.x!==h.x){const R=m.scrollLeft+p.x,O=v===Ze.Right&&R<=j.x||v===Ze.Left&&R>=E.x;if(O&&!p.y){m.scrollTo({left:R,behavior:a});return}O?f.x=m.scrollLeft-R:f.x=v===Ze.Right?m.scrollLeft-j.x:m.scrollLeft-E.x,f.x&&m.scrollBy({left:-f.x,behavior:a});break}else if(_&&S.y!==h.y){const R=m.scrollTop+p.y,O=v===Ze.Down&&R<=j.y||v===Ze.Up&&R>=E.y;if(O&&!p.x){m.scrollTo({top:R,behavior:a});return}O?f.y=m.scrollTop-R:f.y=v===Ze.Down?m.scrollTop-j.y:m.scrollTop-E.y,f.y&&m.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(e,dc(_h(h,this.referenceCoordinates),f))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}DS.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=WL,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s==null||s({event:t.nativeEvent}),!0)}return!1}}];function H_(t){return!!(t&&"distance"in t)}function W_(t){return!!(t&&"delay"in t)}class LS{constructor(e,n,r){var s;r===void 0&&(r=sie(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=du(o),this.documentListeners=new _d(this.document),this.listeners=new _d(r),this.windowListeners=new _d(gr(o)),this.initialCoordinates=(s=Gw(i))!=null?s:js,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add($r.Resize,this.handleCancel),this.windowListeners.add($r.DragStart,V_),this.windowListeners.add($r.VisibilityChange,this.handleCancel),this.windowListeners.add($r.ContextMenu,V_),this.documentListeners.add($r.Key
663down,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(W_(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(H_(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add($r.Click,iie,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($r.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(n=Gw(e))!=null?n:js,u=_h(s,c);if(!r&&a){if(H_(a)){if(a.tolerance!=null&&xx(u,a.tolerance))return this.handleCancel();if(xx(u,a.distance))return this.handleStart()}if(W_(a)&&xx(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}e.cancelable&&e.preventDefault(),o(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Ze.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const aie={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class $S extends LS{constructor(e){const{event:n}=e,r=du(n.target);super(e,aie,r)}}$S.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const lie={move:{name:"mousemove"},end:{name:"mouseup"}};var Jw;(function(t){t[t.RightClick=2]="RightClick"})(Jw||(Jw={}));class cie extends LS{constructor(e){super(e,lie,du(e.event.target))}}cie.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Jw.RightClick?!1:(r==null||r({event:n}),!0)}}];const bx={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class uie extends LS{constructor(e){super(e,bx)}static setup(){return window.addEventListener(bx.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(bx.move.name,e)};function e(){}}}uie.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var Ed;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Ed||(Ed={}));var xg;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(xg||(xg={}));function die(t){let{acceleration:e,activator:n=Ed.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=xg.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:h,threshold:p}=t;const f=fie({delta:h,disabled:!i}),[g,m]=Sse(),v=y.useRef({x:0,y:0}),x=y.useRef({x:0,y:0}),b=y.useMemo(()=>{switch(n){case Ed.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ed.DraggableRect:return s}},[n,s,c]),w=y.useRef(null),k=y.useCallback(()=>{const E=w.current;if(!E)return;const N=v.current.x*x.current.x,S=v.current.y*x.current.y;E.scrollBy(N,S)},[]),j=y.useMemo(()=>a===xg.TreeOrder?[...u].reverse():u,[a,u]);y.useEffect(()=>{if(!i||!u.length||!b){m();return}for(const E of j){if((r==null?void 0:r(E))===!1)continue;const N=u.indexOf(E),S=d[N];if(!S)continue;const{direction:C,speed:_}=Xse(E,S,b,e,p);for(const R of["x","y"])f[R][C[R]]||(_[R]=0,C[R]=0);if(_.x>0||_.y>0){m(),w.current=E,g(k,o),v.current=_,x.current=C;return}}v.current={x:0,y:0},x.current={x:0,y:0},m()},[e,k,r,m,i,o,JSON.stringify(b),JSON.stringify(f),g,u,j,d,JSON.stringify(p)])}const hie={x:{[mn.Backward]:!1,[mn.Forward]:!1},y:{[mn.Backward]:!1,[mn.Forward]:!1}};function fie(t){let{delta:e,disabled:n}=t;const r=Kw(e);return tf(s=>{if(n||!r||!s)return hie;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[mn.Backward]:s.x[mn.Backward]||i.x===-1,[mn.Forward]:s.x[mn.Forward]||i.x===1},y:{[mn.Backward]:s.y[mn.Backward]||i.y===-1,[mn.Forward]:s.y[mn.Forward]||i.y===1}}},[n,e,r])}function pie(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return tf(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function mie(t,e){return y.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...i]},[]),[t,e])}var Th;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Th||(Th={}));var Qw;(function(t){t.Optimized="optimized"})(Qw||(Qw={}));const q_=new Map;function gie(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=y.useState(null),{frequency:a,measure:c,strategy:u}=s,d=y.useRef(t),h=v(),p=Nh(h),f=y.useCallback(function(x){x===void 0&&(x=[]),!p.current&&o(b=>b===null?x:b.concat(x.filter(w=>!b.includes(w))))}
663,[p]),g=y.useRef(null),m=tf(x=>{if(h&&!n)return q_;if(!x||x===q_||d.current!==t||i!=null){const b=new Map;for(let w of t){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){b.set(w.id,w.rect.current);continue}const k=w.node.current,j=k?new IS(c(k),k):null;w.rect.current=j,j&&b.set(w.id,j)}return b}return x},[t,i,n,h,c]);return y.useEffect(()=>{d.current=t},[t]),y.useEffect(()=>{h||f()},[n,h]),y.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),y.useEffect(()=>{h||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{f(),g.current=null},a))},[a,h,f,...r]),{droppableRects:m,measureDroppableContainers:f,measuringScheduled:i!=null};function v(){switch(u){case Th.Always:return!1;case Th.BeforeDragging:return n;default:return!n}}}function qL(t,e){return tf(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function yie(t,e){return qL(t,e)}function vie(t){let{callback:e,disabled:n}=t;const r=PS(e),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function By(t){let{callback:e,disabled:n}=t;const r=PS(e),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function xie(t){return new IS(hu(t),t)}function K_(t,e,n){e===void 0&&(e=xie);const[r,s]=y.useState(null);function i(){s(c=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=c??n)!=null?u:null}const d=e(t);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const o=vie({callback(c){if(t)for(const u of c){const{type:d,target:h}=u;if(d==="childList"&&h instanceof HTMLElement&&h.contains(t)){i();break}}}}),a=By({callback:i});return Zs(()=>{i(),t?(a==null||a.observe(t),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[t]),r}function bie(t){const e=qL(t);return $L(t,e)}const G_=[];function wie(t){const e=y.useRef(t),n=tf(r=>t?r&&r!==G_&&t&&e.current&&t.parentNode===e.current.parentNode?r:$y(t):G_,[t]);return y.useEffect(()=>{e.current=t},[t]),n}function kie(t){const[e,n]=y.useState(null),r=y.useRef(t),s=y.useCallback(i=>{const o=vx(i.target);o&&n(a=>a?(a.set(o,Yw(o)),new Map(a)):null)},[]);return y.useEffect(()=>{const i=r.current;if(t!==i){o(i);const a=t.map(c=>{const u=vx(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,Yw(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=t}return()=>{o(t),o(i)};function o(a){a.forEach(c=>{const u=vx(c);u==null||u.removeEventListener("scroll",s)})}},[s,t]),y.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>dc(i,o),js):HL(t):js,[t,e])}function Y_(t,e){e===void 0&&(e=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},e),y.useEffect(()=>{const r=t!==js;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?_h(t,n.current):js}function Sie(t){y.useEffect(()=>{if(!Ly)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function Cie(t,e){return y.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function KL(t){return y.useMemo(()=>t?Gse(t):null,[t])}const J_=[];function jie(t,e){e===void 0&&(e=hu);const[n]=t,r=KL(n?gr(n):null),[s,i]=y.useState(J_);function o(){i(()=>t.length?t.map(c=>UL(c)?r:new IS(e(c),c)):J_)}const a=By({callback:o});return Zs(()=>{a==null||a.disconnect(),o(),t.forEach(c=>a==null?void 0:a.observe(c))},[t]),s}function Nie(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return ef(e)?e:t}function _ie(t){let{measure:e}=t;const[n,r]=y.useState(null),s=y.useCallback(u=>{for(const{target:d}of u)if(ef(d)){r(h=>{const p=e(d);return h?{...h,width:p.width,height:p.height}:p});break}},[e]),i=By({callback:s}),o=y.useCallback(u=>{const d=Nie(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),r(d?e(d):null)},[e,i]),[a,c]=yg(o);return y.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const Eie=[{sensor:$S,options:{}},{sensor:DS,options:{}}],Tie={current:{}},_p={draggable:{measure:U_},droppable:{measure:U_,strategy:Th.WhileDragging,frequency:Qw.Optimized},dragOverlay:{measure:hu}};class Td extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;
663return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const Rie={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Td,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:vg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:_p,measureDroppableContainers:vg,windowRect:null,measuringScheduled:!1},Aie={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:vg,draggableNodes:new Map,over:null,measureDroppableContainers:vg},zy=y.createContext(Aie),GL=y.createContext(Rie);function Oie(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Td}}}function Pie(t,e){switch(e.type){case cn.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case cn.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case cn.DragEnd:case cn.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case cn.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new Td(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case cn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const o=new Td(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case cn.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new Td(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Mie(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=y.useContext(zy),i=Kw(r),o=Kw(n==null?void 0:n.id);return y.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!MS(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const h=Nse(d);if(h){h.focus();break}}})}},[r,e,s,o,i]),null}function Iie(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function Die(t){return y.useMemo(()=>({draggable:{..._p.draggable,...t==null?void 0:t.draggable},droppable:{..._p.droppable,...t==null?void 0:t.droppable},dragOverlay:{..._p.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function Lie(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=y.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;Zs(()=>{if(!o&&!a||!e){i.current=!1;return}if(i.current||!r)return;const u=e==null?void 0:e.node.current;if(!u||u.isConnected===!1)return;const d=n(u),h=$L(d,r);if(o||(h.x=0),a||(h.y=0),i.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const p=BL(u);p&&p.scrollBy({top:h.y,left:h.x})}},[e,o,a,r,n])}const YL=y.createContext({...js,scaleX:1,scaleY:1});var to;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(to||(to={}));const $ie=y.memo(function(e){var n,r,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:u,sensors:d=Eie,collisionDetection:h=Fse,measuring:p,modifiers:f,...g}=e;const m=y.useReducer(Pie,void 0,Oie),[v,x]=m,[b,w]=Ose(),[k,j]=y.useState(to.Uninitialized),E=k===to.Initialized,{draggable:{active:N,nodes:S,translate:C},droppable:{containers:_}}=v,R=N!=null?S.get(N):null,O=y.useRef({initial:null,translated:null}),L=y.useMemo(()=>{var Et;return N!=null?{id:N,data:(Et=R==null?void 0:R.data)!=null?Et:Tie,rect:O}:null},[N,R]),A=y.useRef(null),[z,F]=y.useState(null),[H,I]=y.useState(null),T=Nh(g,Object.values(g)),U=nf("DndDescribedBy",o),M=y.useMemo(()=>_.getEnabled(),[_]),$=Die(p),{droppableRects:B,measureDroppableContainers:G,measuringScheduled:X}=gie(M,{dragging:E,dependencies:[C.x,C.y],config:$.droppable}),oe=pie(S,N),K=y.useMemo(()=>H?Gw(H):null,[H]),Z=gl(),ie=yie(oe,$.draggable.measure);Lie({activeNode:N!=null?S.get(N):null,config:Z.layoutShiftCompensation,initialRect:ie,measure:$.draggable.measure});const Q=K_(oe,$.draggable.measure,ie),Y=K_(oe?oe.parentElement:null),W=y.useRef({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ce=_.getNodeFor((n=W.current.over)==null?void 0:n.id),de=_ie({measure:$.dragOverlay.measure}),xe=(r=de.nodeRef.current)!=null?r:oe,me=E?(s=de.rect)!=null?s:Q:null,qe=!!(de.nodeRef.current&&de.rect),Oe=bie(qe?null:Q),Ie=KL(xe?gr(xe):null),He=wie(E?ce??oe:null),_t=jie(He),Dt=Iie(f,{transform:{x:C.x-Oe.x,y:C.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:H,active:L,activeNodeRect:Q,containerNodeRect:Y,draggingNodeRect:me,over:W.current.over,overlayNodeRect:de.rect,scrollableAncestors:He,scrollableAncestorRects:_t,windowRect:Ie}),Zt=K?dc(K,C):null,kt=kie(He),wn=Y_(kt),Je=Y_(kt,[Q]),st=dc(Dt,wn),en=me?Hse(me,Dt):null,qn=L&&en?h({active:L,collisionRect:en,droppableRects:B,droppableContainers:M,pointerCoordinates:Zt}):null,kn=LL(qn,"id"),[Kt,tn]=y.useState(null),Dn=qe?Dt:dc(Dt,Je),yr=Use(Dn,(i=Kt==null?void 0:Kt.rect)!=null?i:null,Q),Bi=y.useRef(null),rs=y.useCallback((Et,yt)=>{let{sensor:Sn,options:ke}=yt;if(A.current==null)return;const De=S.get(A.current);if(!De)return;const Fe=Et.nativeEvent,Lt=new Sn({active:A.current,activeNode:De,event:Fe,options:ke,context:W,onAbort(ft){if(!S.get(ft))return;const{onDragAbort:$t}=T.current,fn={id:ft};$t==null||$t(fn),b({type:"onDragAbort",event:fn})},onPending(ft,Ln,$t,fn){if(!S.get(ft))return;const{onDragPending:mu}=T.current,zi={id:ft,constraint:Ln,initialCoordinates:$t,offset:fn};mu==null||mu(zi),b({type:"onDragPending",event:zi})},onStart(ft){const Ln=A.current;if(Ln==null)return;const $t=S.get(Ln);if(!$t)return;const{onDragStart:fn}=T.current,pu={activatorEvent:Fe,active:{id:Ln,data:$t.data,rect:O}};Vr.unstable_batchedUpdates(()=>{fn==null||fn(pu),j(to.Initializing),x({type:cn.DragStart,initialCoordinates:ft,active:Ln}),b({type:"onDragStart",event:pu}),F(Bi.current),I(Fe)})},onMove(ft){x({type:cn.DragMove,coordinates:ft})},onEnd:hn(cn.DragEnd),onCancel:hn(cn.DragCancel)});Bi.current=Lt;function hn(ft){return async function(){const{active:$t,collisions:fn,over:pu,scrollAdjustedTranslate:mu}=W.current;let zi=null;if($t&&mu){const{cancelDrop:gu}=T.current;zi={activatorEvent:Fe,active:$t,collisions:fn,delta:mu,over:pu},ft===cn.DragEnd&&typeof gu=="function"&&await Promise.resolve(gu(zi))&&(ft=cn.DragCancel)}A.current=null,Vr.unstable_batchedUpdates(()=>{x({type:ft}),j(to.Uninitialized),tn(null),F(null),I(null),Bi.current=null;const gu=ft===cn.DragEnd?"onDragEnd":"onDragCancel";if(zi){const Fy=T.current[gu];Fy==null||Fy(zi),b({type:gu,event:zi})}})}}},[S]),fu=y.useCallback((Et,yt)=>(Sn,ke)=>{const De=Sn.nativeEvent,Fe=S.get(ke);if(A.current!==null||!Fe||De.dndKit||De.defaultPrevented)return;const Lt={active:Fe};Et(Sn,yt.options,Lt)===!0&&(De.dndKit={capturedBy:yt.sensor},A.current=ke,rs(Sn,yt))},[S,rs]),pl=mie(d,fu);Sie(d),Zs(()=>{Q&&k===to.Initializing&&j(to.Initialized)},[Q,k]),y.useEffect(()=>{const{onDragMove:Et}=T.current,{active:yt,activatorEvent:Sn,collisions:ke,over:De}=W.current;if(!yt||!Sn)return;const Fe={active:yt,activatorEvent:Sn,collisions:ke,delta:{x:st.x,y:st.y},over:De};Vr.unstable_batchedUpdates(()=>{Et==null||Et(Fe),b({type:"onDragMove",event:Fe})})},[st.x,st.y]),y.useEffect(()=>{const{active:Et,activatorEvent:yt,collisions:Sn,droppableContainers:ke,scrollAdjustedTranslate:De}=W.current;if(!Et||A.current==null||!yt||!De)return;const{onDragOver:Fe}=T.current,Lt=ke.get(kn),hn=Lt&&Lt.rect.current?{id:Lt.id,rect:Lt.rect.current,data:Lt.data,disabled:Lt.disabled}:null,ft={active:Et,activatorEvent:yt,collisions:Sn,delta:{x:De.x,y:De.y},over:hn};Vr.unstable_batchedUpdates(()=>{tn(hn),Fe==null||Fe(ft),b({type:"onDragOver",event:ft})})},[kn]),Zs(()=>{W.current={activatorEvent:H,active:L,activeNode:oe,collisionRect:en,collisions:qn,droppableRects:B,draggableNodes:S,draggingNode:xe,draggingNodeRect:me,droppableContainers:_,over:Kt,scrollableAncestors:He,scrollAdjustedTranslate:st},O.current={initial:me,translated:en}},[L,oe,qn,en,S,xe,me,B,_,Kt,He,st]),die({...Z,delta:C,draggingRect:en,pointerCoordinates:Zt,scrollableAncestors:He,scrollableAncestorRects:_t});const aa=y.useMemo(()=>({active:L,activeNode:oe,activeNodeRect:Q,activatorEvent:H,collisions:qn,containerNodeRect:Y,dragOverlay:de,draggableNodes:S,droppableContainers:_,droppableRects:B,over:Kt,measureDroppableContainers:G,scrollableAncestors:He,scrollableAncestorRects:_t,measuringConfiguration:$,measuringScheduled:X,windowRect:Ie}),[L,oe,Q,H,qn,Y,de,S,_,B,Kt,G,He,_t,$,X,Ie]),ml=y.useMemo(()=>({activatorEvent:H,activators:pl,active:L,activeNodeRect:Q,ariaDescribedById:{draggable:U},dispatch:x,draggableNodes:S,over:Kt,measureDroppableContainers:G}),[H,pl,L,Q,x,U,S,Kt,G]);return V.createElement(ML.Provider,{value:w},V.createElement(zy.Provider,{value:ml},V.createElement(GL.Provider,{value:aa},V.createElement(YL.Provider,{value:yr},u)),V.createElement(Mie,{disabled:(a==null?void 0:a.restoreFocus)===!1})),V.createElement(Ise,{...a,hiddenTextDescribedById:U}));function gl(){const Et=(z==null?void 0:z.autoScrollEnabled)===!1,yt=typeof c=="object"?c.enabled===!1:c===!1,Sn=E&&!Et&&!yt;return typeof c=="object"?{...c,enabled:Sn}:{enabled:Sn}}}),Bie=y.createContext(null),Q_="button",zie="Draggable";function Fie(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=nf(zie),{activators:o,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:h,over:p}=y.useContext(zy),{role:f=Q_,roleDescription:g="draggable",tabIndex:m=0}=s??{},v=(c==null?void 0:c.id)===e,x=y.useContext(v?YL:Bie),[b,w]=yg(),[k,j]=yg(),E=Cie(o,e),N=Nh(n);Zs(()=>(h.set(e,{id:e,key:i,node:b,activatorNode:k,data:N}),()=>{const C=h.get(e);C&&C.key===i&&h.delete(e)}),[h,e]);const S=y.useMemo(()=>({role:f,tabIndex:m,"aria-disabled":r,"aria-pressed":v&&f===Q_?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,f,m,v,g,d.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:S,isDragging:v,listeners:r?void 0:E,node:b,over:p,setNodeRef:w,setActivatorNodeRef:j,transform:x}}function Uie(){return y.useContext(GL)}const Vie="Droppable",Hie={timeout:25};function Wie(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=nf(Vie),{active:o,dispatch:a,over:c,measureDroppableContainers:u}=y.useContext(zy),d=y.useRef({disabled:n}),h=y.useRef(!1),p=y.useRef(null),f=y.useRef(null),{disabled:g,updateMeasurementsFor:m,timeout:v}={...Hie,...s},x=Nh(m??r),b=y.useCallback(()=>
663{if(!h.current){h.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{u(Array.isArray(x.current)?x.current:[x.current]),f.current=null},v)},[v]),w=By({callback:b,disabled:g||!o}),k=y.useCallback((S,C)=>{w&&(C&&(w.unobserve(C),h.current=!1),S&&w.observe(S))},[w]),[j,E]=yg(k),N=Nh(e);return y.useEffect(()=>{!w||!j.current||(w.disconnect(),h.current=!1,w.observe(j.current))},[j,w]),y.useEffect(()=>(a({type:cn.RegisterDroppable,element:{id:r,key:i,disabled:n,node:j,rect:p,data:N}}),()=>a({type:cn.UnregisterDroppable,key:i,id:r})),[r]),y.useEffect(()=>{n!==d.current.disabled&&(a({type:cn.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:o,rect:p,isOver:(c==null?void 0:c.id)===r,node:j,over:c,setNodeRef:E}}function BS(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function qie(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function ep(t){return t!==null&&t>=0}function Kie(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Gie(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const JL=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=BS(e,r,n),o=e[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},tp={scaleX:1,scaleY:1},Yie=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const a=(e=i[n])!=null?e:r;if(!a)return null;if(s===n){const u=i[o];return u?{x:0,y:n<o?u.top+u.height-(a.top+a.height):u.top-a.top,...tp}:null}const c=Jie(i,s,n);return s>n&&s<=o?{x:0,y:-a.height-c,...tp}:s<n&&s>=o?{x:0,y:a.height+c,...tp}:{x:0,y:0,...tp}};function Jie(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?n<e?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const QL="Sortable",XL=V.createContext({activeIndex:-1,containerId:QL,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:JL,disabled:{draggable:!1,droppable:!1}});function Qie(t){let{children:e,id:n,items:r,strategy:s=JL,disabled:i=!1}=t;const{active:o,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:d}=Uie(),h=nf(QL,n),p=a.rect!==null,f=y.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),g=o!=null,m=o?f.indexOf(o.id):-1,v=u?f.indexOf(u.id):-1,x=y.useRef(f),b=!Kie(f,x.current),w=v!==-1&&m===-1||b,k=Gie(i);Zs(()=>{b&&g&&d(f)},[b,f,g,d]),y.useEffect(()=>{x.current=f},[f]);const j=y.useMemo(()=>({activeIndex:m,containerId:h,disabled:k,disableTransforms:w,items:f,overIndex:v,useDragOverlay:p,sortedRects:qie(f,c),strategy:s}),[m,h,k.draggable,k.droppable,w,f,v,c,p,s]);return V.createElement(XL.Provider,{value:j},e)}const Xie=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return BS(n,r,s).indexOf(e)},Zie=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:u}=t;return!u||!r||a!==i&&s===o?!1:n?!0:o!==s&&e===c},eoe={duration:200,easing:"ease"},ZL="transform",toe=Eh.Transition.toString({property:ZL,duration:0,easing:"linear"}),noe={roleDescription:"sortable"};function roe(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=y.useState(null),a=y.useRef(n);return Zs(()=>{if(!e&&n!==a.current&&r.current){const c=s.current;if(c){const u=hu(r.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&o(d)}}n!==a.current&&(a.current=n)},[e,n,r,s]),y.useEffect(()=>{i&&o(null)},[i]),i}function soe(t){let{animateLayoutChanges:e=Zie,attributes:n,disabled:r,data:s,getNewIndex:i=Xie,id:o,strategy:a,resizeObserverConfig:c,transition:u=eoe}=t;const{items:d,containerId:h,activeIndex:p,disabled:f,disableTransforms:g,sortedRects:m,overIndex:v,useDragOverlay:x,strategy:b}=y.useContext(XL),w=ioe(r,f),k=d.indexOf(o),j=y.useMemo(()=>({sortable:{containerId:h,index:k,items:d},...s}),[h,s,k,d]),E=y.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:N,node:S,isOver:C,setNodeRef:_}=Wie({id:o,data:j,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}
663),{active:R,activatorEvent:O,activeNodeRect:L,attributes:A,setNodeRef:z,listeners:F,isDragging:H,over:I,setActivatorNodeRef:T,transform:U}=Fie({id:o,data:j,attributes:{...noe,...n},disabled:w.draggable}),M=kse(_,z),$=!!R,B=$&&!g&&ep(p)&&ep(v),G=!x&&H,X=G&&B?U:null,K=B?X??(a??b)({rects:m,activeNodeRect:L,activeIndex:p,overIndex:v,index:k}):null,Z=ep(p)&&ep(v)?i({id:o,items:d,activeIndex:p,overIndex:v}):k,ie=R==null?void 0:R.id,Q=y.useRef({activeId:ie,items:d,newIndex:Z,containerId:h}),Y=d!==Q.current.items,W=e({active:R,containerId:h,isDragging:H,isSorting:$,id:o,index:k,items:d,newIndex:Q.current.newIndex,previousItems:Q.current.items,previousContainerId:Q.current.containerId,transition:u,wasDragging:Q.current.activeId!=null}),ce=roe({disabled:!W,index:k,node:S,rect:N});return y.useEffect(()=>{$&&Q.current.newIndex!==Z&&(Q.current.newIndex=Z),h!==Q.current.containerId&&(Q.current.containerId=h),d!==Q.current.items&&(Q.current.items=d)},[$,Z,h,d]),y.useEffect(()=>{if(ie===Q.current.activeId)return;if(ie!=null&&Q.current.activeId==null){Q.current.activeId=ie;return}const xe=setTimeout(()=>{Q.current.activeId=ie},50);return()=>clearTimeout(xe)},[ie]),{active:R,activeIndex:p,attributes:A,data:j,rect:N,index:k,newIndex:Z,items:d,isOver:C,isSorting:$,isDragging:H,listeners:F,node:S,overIndex:v,over:I,setNodeRef:M,setActivatorNodeRef:T,setDroppableNodeRef:_,setDraggableNodeRef:z,transform:ce??K,transition:de()};function de(){if(ce||Y&&Q.current.newIndex===k)return toe;if(!(G&&!MS(O)||!u)&&($||W))return Eh.Transition.toString({...u,property:ZL})}}function ioe(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}function bg(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const ooe=[Ze.Down,Ze.Right,Ze.Up,Ze.Left],aoe=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:a}}=e;if(ooe.includes(t.code)){if(t.preventDefault(),!n||!r)return;const c=[];i.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const p=s.get(h.id);if(p)switch(t.code){case Ze.Down:r.top<p.top&&c.push(h);break;case Ze.Up:r.top>p.top&&c.push(h);break;case Ze.Left:r.left>p.left&&c.push(h);break;case Ze.Right:r.left<p.left&&c.push(h);break}});const u=Bse({active:n,collisionRect:r,droppableRects:s,droppableContainers:c,pointerCoordinates:null});let d=LL(u,"id");if(d===(o==null?void 0:o.id)&&u.length>1&&(d=u[1].id),d!=null){const h=i.get(n.id),p=i.get(d),f=p?s.get(p.id):null,g=p==null?void 0:p.node.current;if(g&&f&&h&&p){const v=$y(g).some((E,N)=>a[N]!==E),x=e4(h,p),b=loe(h,p),w=v||!x?{x:0,y:0}:{x:b?r.width-f.width:0,y:b?r.height-f.height:0},k={x:f.left,y:f.top};return w.x&&w.y?k:_h(k,w)}}}};function e4(t,e){return!bg(t)||!bg(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function loe(t,e){return!bg(t)||!bg(e)||!e4(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const coe=({lesson:t,onDelete:e,onUpdate:n})=>{const[r,s]=y.useState(!1),i=y.useRef(null),o=async a=>{var p;const c=(p=a.target.files)==null?void 0:p[0];if(!c||!c.type.startsWith("video/"))return;s(!0);const u=c.name.split(".").pop(),d=`${Date.now()}-${Math.random().toString(36).slice(2)}.${u}`,{error:h}=await D.storage.from("course-videos").upload(d,c,{contentType:c.type});if(!h){const{data:f}=D.storage.from("course-videos").getPublicUrl(d);n(t.id,"video_url",f.publicUrl)}s(!1),i.current&&(i.current.value="")};return l.jsxs("div",{className:"border rounded p-3 space-y-2 bg-muted/20",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{value:t.title,onChange:a=>n(t.id,"title",a.target.value),placeholder:"Lesson title",className:"flex-1"}),l.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[l.jsx("span",{children:"Free"}),l.jsx(Ei,{checked:t.is_free_preview,onCheckedChange:a=>n(t.id,"is_free_preview",a)})]}),l.jsx(q,{variant:"ghost",size:"sm",onClick:e,children:l.jsx(ks,{className:"h-3 w-3 text-destructive"})})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{value:t.video_url,onChange:a=>n(t.id,"video_url",a.target.value),placeholder:"Video URL (paste or upload)",className:"flex-1"}),l.jsx("input",{ref:i,type:"file",accept:"video/mp4,video/*",className:"hidden",onChange:o}),l.jsx(q,{variant:"outline",size:"sm",disabled:r,onClick:()=>{var a;return(a=i.current)==null?void 0:a.click()},children:r?l.jsx(qt,{className:"h-4 w-4 animate-spin"}):l.jsxs(l.Fragment,{children:[l.jsx(Kg,{className:"h-4 w-4 mr-1"}),"Upload MP4"]})})]}),t.video_url&&t.video_url.includes("course-videos")&&l.jsx("video",{src:t.video_url,controls:!0,className:"w-full max-h-48 rounded"}),l.jsx(RS,{content:t.content,onChange:a=>n(t.id,"content",a)})]})},uoe=({module:t,lessons:e,onDelete:n,onAddLesson:r,onDeleteLesson:s,onUpdateLesson:i})=>
663{const[o,a]=y.useState(!0),{attributes:c,listeners:u,setNodeRef:d,transform:h,transition:p}=soe({id:t.id}),f={transform:Eh.Transform.toString(h),transition:p};return l.jsxs("div",{ref:d,style:f,className:"border rounded-lg bg-background mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2 p-3 border-b",children:[l.jsx("button",{...c,...u,className:"cursor-grab",children:l.jsx(G5,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx("button",{onClick:()=>a(!o),children:o?l.jsx(Hg,{className:"h-4 w-4"}):l.jsx(Wg,{className:"h-4 w-4"})}),l.jsx("span",{className:"font-medium flex-1",children:t.title}),l.jsx(q,{variant:"ghost",size:"sm",onClick:n,children:l.jsx(ks,{className:"h-4 w-4 text-destructive"})})]}),o&&l.jsxs("div",{className:"p-3 space-y-2",children:[e.map(g=>l.jsx(coe,{lesson:g,onDelete:()=>s(g.id),onUpdate:i},g.id)),l.jsxs(q,{variant:"outline",size:"sm",onClick:r,children:[l.jsx(Qr,{className:"h-3 w-3 mr-1"}),"Add Lesson"]})]})]})},doe=()=>{const{id:t}=ea(),e=t==="new",n=In(),{toast:r}=ht(),[s,i]=y.useState(""),[o,a]=y.useState(""),[c,u]=y.useState(""),[d,h]=y.useState(""),[p,f]=y.useState("draft"),[g,m]=y.useState("0"),[v,x]=y.useState([]),[b,w]=y.useState([]),[k,j]=y.useState(!1),[E,N]=y.useState(""),[S,C]=y.useState(""),_=Dse(B_($S),B_(DS,{coordinateGetter:aoe}));y.useEffect(()=>{!e&&t&&(async()=>{const{data:U}=await D.from("courses").select("*").eq("id",t).single();U&&(i(U.title),a(U.slug),u(U.description??""),h(U.thumbnail??""),f(U.status),m(String(U.price??0)),N(U.seo_title??""),C(U.seo_description??""));const{data:M}=await D.from("course_modules").select("*").eq("course_id",t).order("position");if(x(M??[]),M!=null&&M.length){const $=M.map(G=>G.id),{data:B}=await D.from("course_lessons").select("*").in("module_id",$).order("position");w(B??[])}})()},[t,e]);const R=T=>T.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),O=async()=>{if(!s||!o){r({title:"Title and slug required",variant:"destructive"});return}j(!0);const T={title:s,slug:o,description:c||null,thumbnail:d||null,status:p,price:parseFloat(g)||0,seo_title:E||null,seo_description:S||null};let U=t;if(e){const{data:M,error:$}=await D.from("courses").insert(T).select("id").single();if($){r({title:"Error",description:$.message,variant:"destructive"}),j(!1);return}U=M.id}else await D.from("courses").update(T).eq("id",t);for(let M=0;M<v.length;M++){const $=v[M];if($.id.startsWith("temp-")){const{data:B}=await D.from("course_modules").insert({course_id:U,title:$.title,position:M}).select("id").single();if(B){const G=$.id;x(X=>X.map(oe=>oe.id===G?{...oe,id:B.id}:oe));for(const X of b.filter(oe=>oe.module_id===G))X.id.startsWith("temp-")&&await D.from("course_lessons").insert({module_id:B.id,title:X.title,content:X.content,video_url:X.video_url||null,position:X.position,is_free_preview:X.is_free_preview})}}else{await D.from("course_modules").update({title:$.title,position:M}).eq("id",$.id);for(const B of b.filter(G=>G.module_id===$.id))B.id.startsWith("temp-")?await D.from("course_lessons").insert({module_id:$.id,title:B.title,content:B.content,video_url:B.video_url||null,position:B.position,is_free_preview:B.is_free_preview}):await D.from("course_lessons").update({title:B.title,content:B.content,video_url:B.video_url||null,position:B.position,is_free_preview:B.is_free_preview}).eq("id",B.id)}}r({title:e?"Course created":"Course updated"}),j(!1),e&&n("/admin/courses")},L=()=>{const T={id:`temp-${Date.now()}`,title:"New Module",position:v.length,course_id:t||""};x([...v,T])},A=async T=>{T.startsWith("temp-")||await D.from("course_modules").delete().eq("id",T),x(v.filter(U=>U.id!==T)),w(b.filter(U=>U.module_id!==T))},z=T=>{const U=b.filter($=>$.module_id===T),M={id:`temp-${Date.now()}`,title:"New Lesson",content:"",video_url:"",position:U.length,module_id:T,is_free_preview:!1};w([...b,M])},F=async T=>{T.startsWith("temp-")||await D.from("course_lessons").delete().eq("id",T),w(b.filter(U=>U.id!==T))},H=(T,U,M)=>{w(b.map($=>$.id===T?{...$,[U]:M}:$))},I=T=>{const{active:U,over:M}=T;if(U.id!==(M==null?void 0:M.id)){const $=v.findIndex(G=>G.id===U.id),B=v.findIndex(G=>G.id===M.id);x(BS(v,$,B))}};return l.jsxs("div",{className:"max-w-4xl space-y-4",children:[l.jsxs(q,{variant:"ghost",size:"sm",onClick:()=>n("/admin/courses"),children:[l.jsx(ei,{className:"h-4 w-4 mr-1"}),"Back"]}),l.jsx("h2",{className:"text-2xl font-bold font-heading",children:e?"New Course":"Edit Course"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(ue,{placeholder:"Course Title",value:s,onChange:T=>{i(T.target.value),e&&a(R(T.target.value))}}),l.jsx(ue,{placeholder:"Slug",value:o,onChange:T=>a(T.target.value)})]}),l.jsx(jt,{placeholder:"Description",value:c,onChange:T=>u(T.target.value),rows:3}),l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsx(ue,{placeholder:"Thumbn
663ail URL",value:d,onChange:T=>h(T.target.value)}),l.jsx(ue,{placeholder:"Price",type:"number",value:g,onChange:T=>m(T.target.value)}),l.jsxs(Xr,{value:p,onValueChange:f,children:[l.jsx(Tr,{children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"draft",children:"Draft"}),l.jsx(nt,{value:"published",children:"Published"})]})]})]}),l.jsxs(ol,{children:[l.jsxs(mg,{className:"flex flex-row items-center justify-between",children:[l.jsx(gg,{children:"Modules & Lessons"}),l.jsxs(q,{size:"sm",onClick:L,children:[l.jsx(Qr,{className:"h-4 w-4 mr-1"}),"Add Module"]})]}),l.jsxs(al,{children:[l.jsx($ie,{sensors:_,collisionDetection:$se,onDragEnd:I,children:l.jsx(Qie,{items:v.map(T=>T.id),strategy:Yie,children:v.map(T=>l.jsx(uoe,{module:T,lessons:b.filter(U=>U.module_id===T.id).sort((U,M)=>U.position-M.position),onDelete:()=>A(T.id),onAddLesson:()=>z(T.id),onDeleteLesson:F,onUpdateLesson:H},T.id))})}),v.length===0&&l.jsx("p",{className:"text-center text-muted-foreground py-4",children:"No modules yet. Add one to start building your course."})]})]}),l.jsxs(ol,{children:[l.jsx(mg,{children:l.jsx(gg,{children:"SEO"})}),l.jsxs(al,{className:"space-y-2",children:[l.jsx(ue,{placeholder:`SEO Title (defaults to "${s||"course title"}")`,value:E,onChange:T=>N(T.target.value)}),l.jsx(jt,{placeholder:"SEO Description (defaults to description)",value:S,onChange:T=>C(T.target.value),rows:2})]})]}),l.jsx(q,{onClick:O,disabled:k,className:"w-full",children:k?"Saving...":"Save Course"})]})},hoe={title:"",description:"",image_url:"",link_url:"",link_text:"Read More",item_type:"article",published:!0},foe=()=>{const[t,e]=y.useState([]),[n,r]=y.useState(null),[s,i]=y.useState(!1),[o,a]=y.useState(!1),{toast:c}=ht(),u=y.useCallback(async()=>{const{data:v}=await D.from("press_items").select("*").order("position",{ascending:!0});e(v??[])},[]);y.useEffect(()=>{u()},[u]);const d=()=>{r({...hoe}),i(!0)},h=v=>{r({...v}),i(!0)},p=async v=>{a(!0);const x=v.name.split(".").pop(),b=`press/${Date.now()}.${x}`,{error:w}=await D.storage.from("blog-images").upload(b,v);if(w){c({title:"Upload failed",description:w.message,variant:"destructive"}),a(!1);return}const{data:k}=D.storage.from("blog-images").getPublicUrl(b);r(j=>j&&{...j,image_url:k.publicUrl}),a(!1)},f=async()=>{if(!(n!=null&&n.title))return;const v={title:n.title,description:n.description||null,image_url:n.image_url||null,link_url:n.link_url||null,link_text:n.link_text||"Read More",item_type:n.item_type||"article",published:n.published??!0,position:n.position??t.length};let x;n.id?{error:x}=await D.from("press_items").update(v).eq("id",n.id):{error:x}=await D.from("press_items").insert({...v,position:t.length+1}),x?c({title:"Error",description:x.message,variant:"destructive"}):(c({title:n.id?"Updated":"Added"}),i(!1),r(null),u())},g=async v=>{await D.from("press_items").delete().eq("id",v),c({title:"Deleted"}),u()},m=async(v,x)=>{const b=t.findIndex(E=>E.id===v);if(x==="up"&&b===0||x==="down"&&b===t.length-1)return;const w=x==="up"?b-1:b+1,k=t[b],j=t[w];await Promise.all([D.from("press_items").update({position:j.position}).eq("id",k.id),D.from("press_items").update({position:k.position}).eq("id",j.id)]),u()};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-2xl font-bold font-heading",children:"Press & Media"}),l.jsxs(q,{size:"sm",onClick:d,children:[l.jsx(Qr,{className:"h-4 w-4 mr-1"}),"Add Item"]})]}),l.jsx("div",{className:"border rounded-lg bg-background",children:l.jsxs(Ii,{children:[l.jsx(Di,{children:l.jsxs(Nt,{children:[l.jsx(Pe,{className:"w-10",children:"#"}),l.jsx(Pe,{children:"Title"}),l.jsx(Pe,{children:"Type"}),l.jsx(Pe,{children:"Status"}),l.jsx(Pe,{className:"w-32",children:"Actions"})]})}),l.jsxs(Li,{children:[t.map((v,x)=>l.jsxs(Nt,{children:[l.jsx(je,{children:l.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.jsx("button",{onClick:()=>m(v.id,"up"),disabled:x===0,className:"text-xs text-muted-foreground hover:text-foreground disabled:opacity-30",children:"â²"}),l.jsx("button",{onClick:()=>m(v.id,"down"),disabled:x===t.length-1,className:"text-xs text-muted-foreground hover:text-foreground disabled:opacity-30",children:"â¼"})]})}),l.jsx(je,{children:l.jsxs("div",{className:"flex items-center gap-3",children:[v.image_url&&l.jsx("img",{src:v.image_url,alt:"",className:"w-12 h-12 rounded object-cover"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-sm",children:v.title}),l.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-xs",children:v.description})]})]})}),l.jsx(je,{children:l.jsx(Ot,{variant:"outline",children:v.item_type})}),l.jsx(je,{children:l.jsx(Ot,{variant:v.published?"default":"secondary",children:v.published?"Published":"Draft"})}),l.jsx(je,{children:l.jsxs("div",{className:"flex gap-1",children:[l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>h(v),children:l.jsx(sm,{className:"h-4 w-4"})}),l.jsx(q,{variant:"ghost",size:"sm",onClick:()=>g(v.id),children:l.jsx(ks,{className:"h-4 w-4 text-destructive"})})]})})]},v.id)),t.length===0&&l.jsx(Nt,{children:l.jsx(je,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No press items yet."})})]})]})}),l.jsx(Es,{open:s,onOpenChange:i,children:l.jsxs(es,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[l.jsx(ts,{children:l.jsxs(_r,{children:[n!=null&&n.id?"Edit":"Add"," Press / Media Item"]})}),n&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(Ee,{children:"Title"}),l.jsx(ue,{value:n.title??"",onChange:v=>r({...n,title:v.target.value})})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Description"}),l.jsx(jt,{value:n.description??"",onChange:v=>r({...n,description:v.target.value}),rows:3})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Type"}),l.jsxs(Xr,{value:n.item_type??"article",onValueChange:v=>r({...n,item_type:v}),children:[l.jsx(Tr,{children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"article",children:"Article"}),l.jsx(nt,{value:"podcast",children:"Podcast"}),l.jsx(nt,{value:"video",children:"Video"})]})]})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Image"}),n.image_url&&l.jsxs("div",{className:"relative mb-2",children:[l.jsx("img",{src:n.image_url,alt:"",className:"w-full h-40 object-cover rounded"}),l.jsx("button",{onClick:()=>r({...n,image_url:""}),className:"absolute top-1 right-1 bg-destructive text-destructive-foreground rounded-full w-6 h-6 text-xs flex items-center justify-center",children:"â"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ue,{placeholder:"Image URL",value:n.image_url??"",onChange:v=>r({...n,image_url:v.target.value}),className:"flex-1"}),l.jsxs(q,{variant:"outline",size:"sm",className:"shrink-0",disabled:o,onClick:()=>{var v;return(v=document.getElementById("press-img-upload"))==null?void 0:v.click()},children:[l.jsx(Kg,{className:"h-4 w-4 mr-1"}),o?"...":"Upload"]}),l.jsx("input",{id:"press-img-upload",type:"file",accept:"image/*",className:"hidden",onChange:v=>{var x;(x=v.target.files)!=null&&x[0]&&p(v.target.files[0])}})]})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Link URL"}),l.jsx(ue,{value:n.link_url??"",onChange:v=>r({...n,link_url:v.target.value}),placeholder:"https://..."})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Link Text"}),l.jsx(ue,{value:n.link_text??"",onChange:v=>r({...n,link_text:v.target.value}),placeholder:"Read the Article"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ei,{checked:n.published??!0,onCheckedChange:v=>r({...n,published:v})}),l.jsx(Ee,{children:"Published"})]}),l.jsxs(q,{onClick:f,className:"w-full",children:[n.id?"Update":"Add"," Item"]})]})]})})]})},poe=()=>{const[t,e]=y.useState([]),[n,r]=y.useState(null),[s,i]=y.useState(new Date),[o,a]=y.useState(null);y.useEffect(()=>{D.from("site_settings").select("value").eq("key","events_enabled").maybeSingle().then(({data:m})=>r((m==null?void 0:m.value)===!0)),D.from("events").select("*").order("start_at",{ascending:!0}).then(({data:m})=>e(m??[]))},[]);const c=A9(s),u=R9(s),d=Lc(c),h=P9(u),p=y.useMemo(()=>{const m=[];let v=d;for(;
663v<=h;)m.push(v),v=S9(v,1);return m},[d,h]),f=y.useMemo(()=>{const m=new Map;return t.forEach(v=>{const x=mt(ka(v.start_at),"yyyy-MM-dd"),b=m.get(x)??[];b.push(v),m.set(x,b)}),m},[t]),g=o?f.get(mt(o,"yyyy-MM-dd"))??[]:t.filter(m=>Lj(ka(m.start_at),s));return n===!1?l.jsxs("main",{children:[l.jsx(ut,{pageKey:"events",title:"Events â Stephanie Peirolo",description:"Upcoming events with Stephanie Peirolo."}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 section-light min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 text-center",children:[l.jsx("h1",{className:"mb-4",children:"Events"}),l.jsx("p",{className:"text-muted-foreground",children:"Check back soon for upcoming events."})]})}),l.jsx(Ye,{})]}):l.jsxs("main",{children:[l.jsx(ut,{pageKey:"events",title:"Events â Stephanie Peirolo",description:"Upcoming events, talks, and workshops with Stephanie Peirolo."}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-16 section-light min-h-screen",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24",children:[l.jsxs(re,{animation:"fade-up",children:[l.jsx("h1",{className:"text-center mb-4",children:"Events"}),l.jsx("p",{className:"text-center text-muted-foreground mb-12",children:"Upcoming talks, workshops, and appearances."})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[l.jsxs("div",{className:"lg:col-span-2 bg-background rounded-lg shadow-md p-4 md:p-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("button",{onClick:()=>i(Rj(s,-1)),className:"p-2 hover:bg-muted rounded","aria-label":"Previous month",children:l.jsx(SA,{className:"h-5 w-5"})}),l.jsx("h2",{className:"font-heading text-xl",children:mt(s,"MMMM yyyy")}),l.jsx("button",{onClick:()=>i(Rj(s,1)),className:"p-2 hover:bg-muted rounded","aria-label":"Next month",children:l.jsx(Wg,{className:"h-5 w-5"})})]}),l.jsx("div",{className:"grid grid-cols-7 gap-1 text-center text-xs text-muted-foreground mb-2",children:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(m=>l.jsx("div",{className:"py-1 font-semibold",children:m},m))}),l.jsx("div",{className:"grid grid-cols-7 gap-1",children:p.map(m=>{const v=mt(m,"yyyy-MM-dd"),x=f.get(v)??[],b=Lj(m,s),w=o&&Oj(m,o),k=Oj(m,new Date);return l.jsxs("button",{onClick:()=>a(w?null:m),className:`aspect-square p-1 rounded text-sm flex flex-col items-center justify-start transition-colors ${b?"":"text-muted-foreground/40"} ${w?"bg-primary text-primary-foreground":k?"bg-muted":"hover:bg-muted/50"}`,children:[l.jsx("span",{className:"font-medium",children:mt(m,"d")}),x.length>0&&l.jsx("span",{className:`mt-1 h-1.5 w-1.5 rounded-full ${w?"bg-primary-foreground":"bg-primary"}`})]},v)})})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("h3",{className:"font-heading text-lg",children:o?mt(o,"MMMM d, yyyy"):"This Month"}),g.length===0&&l.jsxs("p",{className:"text-muted-foreground text-sm",children:["No events ",o?"on this day":"this month","."]}),g.map(m=>l.jsxs("article",{className:"bg-background rounded-lg shadow-md overflow-hidden",children:[m.cover_image&&l.jsx("img",{src:m.cover_image,alt:m.title,className:"w-full h-40 object-cover"}),l.jsxs("div",{className:"p-4 space-y-2",children:[l.jsx("h4",{className:"font-bold",children:m.title}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(Vh,{className:"h-3 w-3"}),mt(ka(m.start_at),"EEE, MMM d"),l.jsx(K5,{className:"h-3 w-3 ml-2"}),mt(ka(m.start_at),"h:mm a")]}),m.location&&l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(RA,{className:"h-3 w-3"}),m.location]}),m.description&&l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 whitespace-pre-line",children:m.description}),m.link_url&&l.jsx("a",{href:m.link_url,target:"_blank",rel:"noopener noreferrer",className:"inline-block text-sm font-semibold text-primary hover:underline",children:"Learn more â"})]})]},m.id))]})]})]})}),l.jsx(Ye,{})]})},X_={title:"",description:"",location:"",date:"",startTime:"",endTime:"",cover_image:"",link_url:"",published:!0},Z_=({event:t,onSaved:e,trigger:n})=>{const[r,s]=y.useState(!1),[i,o]=y.useState(X_),[a,c]=y.useState(!1),[u,d]=y.useState(!1);y.useEffect(()=>{if(r)if(t){const f=ka(t.start_at),g=t.end_at?ka(t.end_at):null;
663o({title:t.title,description:t.description??"",location:t.location??"",date:mt(f,"yyyy-MM-dd"),startTime:mt(f,"HH:mm"),endTime:g?mt(g,"HH:mm"):"",cover_image:t.cover_image??"",link_url:t.link_url??"",published:t.published})}else o(X_)},[r,t]);const h=async f=>{c(!0);const g=f.name.split(".").pop(),m=`events/${Date.now()}-${Math.random().toString(36).slice(2)}.${g}`,{error:v}=await D.storage.from("media").upload(m,f,{contentType:f.type});if(v)bo.error(v.message);else{const{data:x}=D.storage.from("media").getPublicUrl(m);o(b=>({...b,cover_image:x.publicUrl}))}c(!1)},p=async()=>{if(!i.title||!i.date||!i.startTime){bo.error("Title, date, and start time are required.");return}d(!0);const f=new Date(`${i.date}T${i.startTime}`).toISOString(),g=i.endTime?new Date(`${i.date}T${i.endTime}`).toISOString():null,m={title:i.title,description:i.description||null,location:i.location||null,start_at:f,end_at:g,cover_image:i.cover_image||null,link_url:i.link_url||null,published:i.published},{error:v}=t?await D.from("events").update(m).eq("id",t.id):await D.from("events").insert(m);d(!1),v?bo.error(v.message):(bo.success("Event saved"),s(!1),e())};return l.jsxs(Es,{open:r,onOpenChange:s,children:[l.jsx(Ek,{asChild:!0,children:n}),l.jsxs(es,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[l.jsx(ts,{children:l.jsx(_r,{children:t?"Edit Event":"New Event"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx(Ee,{children:"Title *"}),l.jsx(ue,{value:i.title,onChange:f=>o({...i,title:f.target.value})})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Description"}),l.jsx(jt,{rows:3,value:i.description,onChange:f=>o({...i,description:f.target.value})})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Location"}),l.jsx(ue,{value:i.location,onChange:f=>o({...i,location:f.target.value}),placeholder:"e.g. New York, NY or Online"})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[l.jsxs("div",{children:[l.jsx(Ee,{children:"Date *"}),l.jsx(ue,{type:"date",value:i.date,onChange:f=>o({...i,date:f.target.value})})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Start *"}),l.jsx(ue,{type:"time",value:i.startTime,onChange:f=>o({...i,startTime:f.target.value})})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"End"}),l.jsx(ue,{type:"time",value:i.endTime,onChange:f=>o({...i,endTime:f.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Cover Image"}),i.cover_image?l.jsxs("div",{className:"relative",children:[l.jsx("img",{src:i.cover_image,alt:"",className:"w-full h-32 object-cover rounded"}),l.jsx(q,{size:"sm",variant:"destructive",type:"button",className:"absolute top-1 right-1",onClick:()=>o({...i,cover_image:""}),children:"Remove"})]}):l.jsxs("label",{className:"flex items-center gap-2 border-2 border-dashed rounded p-4 cursor-pointer hover:border-primary/50",children:[a?l.jsx(qt,{className:"h-4 w-4 animate-spin"}):l.jsx(CA,{className:"h-4 w-4"}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"Upload cover image"}),l.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:f=>{var g;return((g=f.target.files)==null?void 0:g[0])&&h(f.target.files[0])}})]})]}),l.jsxs("div",{children:[l.jsx(Ee,{children:"Registration / Info Link (optional)"}),l.jsx(ue,{value:i.link_url,onChange:f=>o({...i,link_url:f.target.value}),placeholder:"https://..."})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ei,{checked:i.published,onCheckedChange:f=>o({...i,published:f})}),l.jsx(Ee,{children:"Published (visible on site)"})]}),l.jsx(q,{onClick:p,disabled:u,className:"w-full",children:u?"Saving...":"Save Event"})]})]})]})},moe=()=>{const[t,e]=y.useState([]),[n,r]=y.useState(!1),s=async()=>{const{data:a}=await D.from("events").select("*").order("start_at",{ascending:!0});e(a??[]);const{data:c}=await D.from("site_settings").select("value").eq("key","events_enabled").maybeSingle();r((c==null?void 0:c.value)===!0)};y.useEffect(()=>{s()},[]);const i=async a=>{r(a);const{error:c}=await D.from("site_settings").upsert({key:"events_enabled",value:a},{onConflict:"key"});if(c){bo.error(c.message);return}bo.success(a?"Events page is now visible":"Events page is now hidden")},o=async a=>{if(!confirm("Delete this event?"))return;const{error:c}=await D.from("events").delete().eq("id",a);c?bo.error(c.message):(bo.success("Event deleted"),s())};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-heading font-bold",children:"Events"}),l.jsx("p",{className:"text-muted-foreground",children:"Manage upcoming events and toggle the public Events page."})]}),l.jsx(Z_,{onSaved:s,trigger:l.jsxs(q,{children:[l.jsx(Qr,{className:"h-4 w-4 mr-1"}),"New Event"]})})]}),l.jsx(ol,{children:l.jsxs(al,{className:"flex items-center gap-3 pt-6",children:[l.jsx(Ei,{checked:n,onCheckedChange:i}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium",children:"Show Events page on site"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Toggle visibility of /events without deleting events."})]})]})}),l.jsxs("div",{className:"space-y-3",children:[t.length===0&&l.jsx("p",{className:"text-muted-foreground",children:"No events yet. Add one to get started."}),t.map(a=>l.jsx(ol,{children:l.jsxs(al,{className:"pt-4 flex flex-col md:flex-row gap-4",children:[a.cover_image&&l.jsx("img",{src:a.c
663over_image,alt:a.title,className:"w-full md:w-48 h-32 object-cover rounded"}),l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"font-bold",children:a.title}),!a.published&&l.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:"Draft"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(Vh,{className:"h-3 w-3"}),mt(ka(a.start_at),"EEE, MMM d, yyyy · h:mm a")]}),a.location&&l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(RA,{className:"h-3 w-3"}),a.location]}),a.description&&l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:a.description})]}),l.jsxs("div",{className:"flex md:flex-col gap-2",children:[l.jsx(Z_,{event:a,onSaved:s,trigger:l.jsxs(q,{size:"sm",variant:"outline",children:[l.jsx(sm,{className:"h-3 w-3 mr-1"}),"Edit"]})}),l.jsx(q,{size:"sm",variant:"ghost",onClick:()=>o(a.id),children:l.jsx(ks,{className:"h-3 w-3 text-destructive"})})]})]})},a.id))]})]})},goe=()=>{const t=Ai();return y.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:l.jsxs("div",{className:"text-center",children:[l.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),l.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),l.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},yoe={coaching:"/coaching",dashboard:"/dashboard","reading-room":"/reading-room"},voe=()=>{const[t]=X0(),e=In(),n=t.get("session_id"),r=t.get("dest"),s=r?yoe[r]:null;return y.useEffect(()=>{if(n&&s){const i=setTimeout(()=>e(s,{replace:!0}),1500);return()=>clearTimeout(i)}},[n,s,e]),l.jsxs("main",{children:[l.jsx(ut,{pageKey:"checkout-return"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-24 md:pt-40 md:pb-32",children:l.jsx("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-2xl text-center",children:n?l.jsxs(l.Fragment,{children:[l.jsx(Qd,{className:"h-16 w-16 text-primary mx-auto mb-6"}),l.jsx("h1",{className:"font-heading text-3xl md:text-4xl mb-4",children:"Thank you!"}),l.jsx("p",{className:"text-foreground/80 mb-2 leading-relaxed",children:"Your payment was received. You'll get an email confirmation shortly."}),s?l.jsxs("p",{className:"text-foreground/80 mb-6 leading-relaxed",children:["Taking you to your ",r==="coaching"?"coaching portal":"dashboard","â¦"]}):l.jsx("p",{className:"text-foreground/80 mb-6 leading-relaxed",children:"Your purchases are now available in your dashboard."}),l.jsxs("p",{className:"text-xs text-muted-foreground mb-8",children:["Reference: ",l.jsx("span",{className:"font-mono",children:n})]}),l.jsxs("div",{className:"flex gap-3 justify-center flex-wrap",children:[s?l.jsx(q,{asChild:!0,children:l.jsx(Be,{to:s,children:r==="coaching"?"Go to coaching portal":"Continue"})}):l.jsx(q,{asChild:!0,children:l.jsx(Be,{to:"/dashboard",children:"Go to your dashboard"})}),l.jsx(q,{asChild:!0,variant:"outline",children:l.jsx(Be,{to:"/",children:"Back to home"})})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("h1",{className:"font-heading text-3xl md:text-4xl mb-4",children:"No session found"}),l.jsx("p",{className:"text-foreground/80 mb-8",children:"We couldn't find a checkout session. If you were mid-payment, please try again."}),l.jsx(q,{asChild:!0,children:l.jsx(Be,{to:"/",children:"Back to home"})})]})})}),l.jsx(Ye,{})]})},xoe=t=>{if(!t)return!1;const e=t.current_period_end?new Date(t.current_period_end).getTime():null,n=!e||e>Date.now();return["active","trialing","past_due"].includes(t.status)&&n||t.status==="canceled"&&!!e&&e>Date.now()},eE=t=>t==="reading_room_monthly"||t==="reading_room_yearly",boe=()=>{const{user:t,loading:e}=pr(),n=In(),[r,s]=y.useState([]),[i,o]=y.useState([]),[a,c]=y.useState(null),[u,d]=y.useState(!1),[h,p]=y.useState(!0);if(y.useEffect(()=>{!e&&!t&&n("/login?next=/dashboard",{replace:!0})},[e,t,n]),y.useEffect(()=>{if(!t)return;const m=dy();(async()=>{p(!0);const[v,x,b,w]=await Promise.all([D.from("narrative_sections").select("id, slug, title, pdf_url").eq("published",!0).order("position",{ascending:!0}),D.from("purchases").select("id, product_label, amount, currency, purchase_source, created_at, price_id").eq("user_id",t.id).eq("environment",m).order("created_at",{ascending:!1}),D.from("subscriptions").select("id, status, price_id, current_period_end, cancel_at_period_end").eq("user_id",t.id).eq("environment",m).order("created_at",{ascending:!1}).limit(1).maybeSingle(),D.from("reading_room_members").select("user_id, expires_at").eq("user_id",t.id).maybeSingle()]);s((v.data||[]).filter(E=>E.pdf_url)),o(x.data||[]),c(b.data||null);const k=w.data,j=!!k&&(!k.expires_at||new Date(k.expires_at).getTime()>Date.now());d(j),p(!1)})()},[t]),e||!t&&!e)return l.jsx("div",{className:"flex justify-center pt-40 pb-24",children:l.jsx(qt,{className:"h-8 w-8 animate-spin text-primary"})});const f=i.filter(m=>!eE(m.price_id||"")),g=u||xoe(a)&&eE((a==null?void 0:a.price_id)||"");return l.jsxs(l.Fragment,{children:[l.jsx(ut,{pageKey:"dashboard"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-24 md:pt-40 md:pb-32",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-5xl",children:[l.jsxs("div",{className:"mb-12 flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-body text-sm text-primary uppercase tracking-wider mb-2",children:"Your dashboard"}),l.jsxs("h1",{className:"font-heading text-3xl md:text-4xl mb-2",children:["Welcome back",t!=null&&t.email?`, ${t.email}`:""]}
663),l.jsx("p",{className:"text-foreground/70",children:"Everything you've unlocked lives here."})]}),l.jsxs(q,{variant:"outline",size:"sm",onClick:async()=>{await D.auth.signOut(),St({title:"Signed out"}),n("/",{replace:!0})},children:[l.jsx(TA,{className:"mr-2 h-4 w-4"})," Log out"]})]}),h?l.jsx("div",{className:"flex justify-center py-20",children:l.jsx(qt,{className:"h-8 w-8 animate-spin text-primary"})}):l.jsxs("div",{className:"space-y-16",children:[l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx(rk,{className:"h-5 w-5 text-primary"}),l.jsx("h2",{className:"font-heading text-2xl",children:"Reading Room"})]}),g?l.jsxs("div",{className:"border border-border p-6 bg-card",children:[l.jsx("p",{className:"text-foreground/80 mb-2",children:"Your Reading Room membership is active."}),(a==null?void 0:a.current_period_end)&&l.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[a.cancel_at_period_end?"Access until ":"Renews ",new Date(a.current_period_end).toLocaleDateString()]}),l.jsx(q,{asChild:!0,children:l.jsx(Be,{to:"/reading-room",children:"Enter the Reading Room"})})]}):l.jsxs("div",{className:"border border-dashed border-border p-6 text-foreground/70 flex items-start gap-3",children:[l.jsx(ik,{className:"h-4 w-4 mt-1 text-muted-foreground shrink-0"}),l.jsxs("div",{children:[l.jsx("p",{className:"mb-3",children:"You don't have an active Reading Room membership yet."}),l.jsx(q,{asChild:!0,variant:"outline",children:l.jsx(Be,{to:"/reading-room",children:"Learn more & subscribe"})})]})]})]}),l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx(rm,{className:"h-5 w-5 text-primary"}),l.jsx("h2",{className:"font-heading text-2xl",children:"Coaching Portal"})]}),f.length>0?l.jsx(Be,{to:"/coaching",className:"block border border-border p-6 bg-card hover:border-primary transition-colors",children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-heading text-lg mb-1",children:"Open your coaching workspace"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Schedule sessions, review the agenda, take notes, and download resources from Stephanie."}),l.jsx("ul",{className:"text-sm text-foreground/80 space-y-1",children:f.map(m=>l.jsxs("li",{children:["· ",m.product_label," â purchased ",new Date(m.created_at).toLocaleDateString()]},m.id))})]}),l.jsx(sk,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-1"})]})}):l.jsxs("div",{className:"border border-dashed border-border p-6 text-foreground/70",children:[l.jsx("p",{className:"mb-3",children:"No coaching purchases yet."}),l.jsx(q,{asChild:!0,variant:"outline",children:l.jsx(Be,{to:"/indiv
663idual-coaching",children:"Explore coaching options"})})]})]}),l.jsxs("section",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx(Pc,{className:"h-5 w-5 text-primary"}),l.jsx("h2",{className:"font-heading text-2xl",children:"Narrative Downloads"})]}),r.length>0?l.jsx("div",{className:"grid md:grid-cols-2 gap-3",children:r.map(m=>l.jsxs("a",{href:m.pdf_url,target:"_blank",rel:"noopener noreferrer",className:"border border-border p-5 bg-card hover:border-primary transition-colors flex items-center justify-between gap-4 group",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-heading text-base",children:m.title}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"PDF worksheet"})]}),l.jsx(Pc,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary shrink-0"})]},m.id))}):l.jsx("div",{className:"border border-dashed border-border p-6 text-foreground/70",children:"No worksheets available yet."})]})]})]})}),l.jsx(Ye,{})]})},woe=()=>l.jsx("main",{children:l.jsx(boe,{})}),koe=["If you need to cancel or reschedule a session, give 24 hours notice or you may be charged for the time. You can only reschedule one session up to two times.","Packages of sessions must be used within 6 months, unless arranged in advance.","Coaching is not therapy or treatment for mental health issues or substance abuse.","Our work together is confidential.","I will use care in protecting your personal data and never sell it."],Soe=({open:t,onOpenChange:e,onCompleted:n})=>{const{user:r}=pr(),[s,i]=y.useState(!1),[o,a]=y.useState({name:"",discuss:"",about_you:"",learning_style:"",concerns:"",hopes:"",agreed_terms:!1}),c=(d,h)=>a(p=>({...p,[d]:h})),u=async d=>{if(d.preventDefault(),!r)return;if(!o.agreed_terms){St({title:"Please agree to the coaching agreement",variant:"destructive"});return}i(!0);const{error:h}=await D.from("coaching_intake").upsert({user_id:r.id,name:o.name.trim()||null,discuss:o.discuss.trim()||null,about_you:o.about_you.trim()||null,learning_style:o.learning_style.trim()||null,concerns:o.concerns.trim()||null,hopes:o.hopes.trim()||null,agreed_terms:!0,agreed_at:new Date().toISOString()},{onConflict:"user_id"});if(i(!1),h){St({title:"Could not save",description:h.message,variant:"destructive"});return}St({title:"Thanks! Opening your booking calendarâ¦"}),n()};return l.jsx(Es,{open:t,onOpenChange:e,children:l.jsxs(es,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(ts,{children:[l.jsx(_r,{className:"font-heading text-2xl",children:"Before your first session"}),l.jsx(pm,{children:"A quick intake so Stephanie can prepare. All fields are optional except the agreement at the end."})]}),l.jsxs("form",{onSubmit:u,className:"space-y-5 pt-2",children:[l.jsxs("div",{children:[l.jsx(Ee,{htmlFor:"name",children:"Your name"}),l.jsx(ue,{id:"name",value:o.name,onChange:d=>c("name",d.target.value),maxLength:150})]}),l.jsxs("div",{children:[l.jsx(Ee,{htmlFor:"discuss",children:"What do you want to discuss in our coaching session(s)?"}),l.jsx(jt,{id:"discuss",rows:3,value:o.discuss,onChange:d=>c("discuss",d.target.value),maxLength:2e3})]}),l.jsxs("div",{children:[l.jsx(Ee,{htmlFor:"about",children:"What should I know about you before we meet?"}),l.jsx(jt,{id:"about",rows:3,value:o.about_you,onChange:d=>c("about_you",d.target.value),maxLength:2e3})]}),l.jsxs("div",{children:[l.jsx(Ee,{htmlFor:"learning",children:"Is there anything I should know about how you learn? (e.g. visual, neurodivergent, etc.)"}),l.jsx(jt,{id:"learning",rows:2,value:o.learning_style,onChange:d=>c("learning_style",d.target.value),maxLength:2e3})]}),l.jsxs("div",{children:[l.jsx(Ee,{htmlFor:"concerns",children:"Do you have any concerns about our work together?"}),l.jsx(jt,{id:"concerns",rows:2,value:o.concerns,onChange:d=>c("concerns",d.target.value),maxLength:2e3})]}),l.jsxs("div",{children:[l.jsx(Ee,{htmlFor:"hopes",children:"What do you hope to gain?"}),l.jsx(jt,{id:"hopes",rows:2,value:o.hopes,onChange:d=>c("hopes",d.target.value),maxLength:2e3})]}),l.jsxs("div",{className:"border border-primary/40 bg-primary/5 p-4 rounded-sm",children:[l.jsx("p",{className:"font-heading text-sm uppercase tracking-wider text-primary mb-2",children:"Coaching Agreement â TL;DR"}),l.jsx("ul",{className:"list-disc pl-5 space-y-1.5 text-sm text-foreground
663/85",children:koe.map(d=>l.jsx("li",{children:d},d))}),l.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:l.jsx(Be,{to:"/coaching/terms",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2",children:"Read the full agreement â"})}),l.jsxs("label",{className:"flex items-start gap-3 mt-4 cursor-pointer",children:[l.jsx(Wk,{checked:o.agreed_terms,onCheckedChange:d=>c("agreed_terms",d===!0),className:"mt-0.5"}),l.jsx("span",{className:"text-sm text-foreground/90",children:"I have read and agree to the Coaching Agreement."})]})]}),l.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[l.jsx(q,{type:"button",variant:"outline",onClick:()=>e(!1),disabled:s,children:"Cancel"}),l.jsx(q,{type:"submit",disabled:s||!o.agreed_terms,children:s?"Savingâ¦":"Agree & continue to booking"})]})]})]})})},tE=t=>t==="completed"?"bg-muted text-foreground/70":t==="canceled"?"bg-destructive/10 text-destructive":"bg-primary/10 text-primary",Rl={individual_coaching_1_onetime:{label:"1 Session",url:"https://calendly.com/stephanie-upperhand/coaching-with-stephanie-1-session"},individual_coaching_3_onetime:{label:"3 Session Series",url:"https://calendly.com/stephanie-upperhand/threesessionseries"},individual_coaching_5_onetime:{label:"5 Session Series",url:"https://calendly.com/stephanie-upperhand/coaching-with-stephanie-5-session-series-"}},Coe=()=>{const{user:t,loading:e}=pr(),n=In(),[r,s]=y.useState(!0),[i,o]=y.useState(!1),[a,c]=y.useState([]),[u,d]=y.useState([]),[h,p]=y.useState(null),[f,g]=y.useState(""),[m,v]=y.useState(!1);y.useState("");const[x,b]=y.useState([]),[w,k]=y.useState(!1),[j,E]=y.useState(!1),[N,S]=y.useState(null);y.useEffect(()=>{!e&&!t&&n("/login?next=/coaching",{replace:!0})},[e,t,n]),y.useEffect(()=>{if(!t)return;const A=dy();(async()=>{var M,$,B;s(!0);const[z,F,H,I]=await Promise.all([D.from("purchases").select("id, price_id").eq("user_id",t.id).eq("environment",A).ilike("price_id","%coaching%"),D.from("coaching_sessions").select("*").eq("user_id",t.id).order("position",{ascending:!0}),D.from("coaching_resources").select("*").eq("user_id",t.id).order("created_at",{ascending:!1}),D.from("coaching_intake").select("agreed_terms").eq("user_id",t.id).maybeSingle()]);o((z.data||[]).length>0||(F.data||[]).length>0),c(F.data||[]),d(H.data||[]);const T=Array.from(new Set((z.data||[]).map(G=>G.price_id).filter(Boolean)));b(T),k(!!((M=I.data)!=null&&M.agreed_terms));const U=(($=F.data)==null?void 0:$.find(G=>G.status==="upcoming"))||((B=F.data)==null?void 0:B[0]);U&&(p(U.id),g(U.client_notes||"")),s(!1)})()},[t]);const C=y.useMemo(()=>a.find(A=>A.id===h)||null,[a,h]),_=y.useMemo(()=>u.filter(A=>!C||A.session_id===C.id||A.session_id===null),[u,C]),R=A=>{p(A.id),g(A.client_notes||"")},O=async()=>{if(!C)return;v(!0);const{error:A}=await D.from("coaching_sessions").update({client_notes:f}).eq("id",C.id);if(v(!1),A){St({title:"Could not save notes",description:A.message,variant:"destructive"});return}c(z=>z.map(F=>F.id===C.id?{...F,client_notes:f}:F)),St({title:"Notes saved"})},L=async A=>{const{data:z,error:F}=await D.storage.from("coaching-resources").createSignedUrl(A.file_path,300);if(F||!(z!=null&&z.signedUrl)){St({title:"Download failed",description:F==null?void 0:F.message,variant:"destructive"});return}window.open(z.signedUrl,"_blank","noopener,noreferrer")};return e||r?l.jsx("div",{className:"flex justify-center pt-40 pb-24",children:l.jsx(qt,{className:"h-8 w-8 animate-spin text-primary"})}):i?l.jsxs(l.Fragment,{children:[l.jsx(ut,{pageKey:"coaching-portal"}),l.jsx(Ge,{}),l.jsx("section",{className:"pt-32 pb-24 md:pt-40",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 max-w-7xl",children:[l.jsxs(Be,{to:"/dashboard",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-6",children:[l.jsx(ei,{className:"h-4 w-4"})," Back to dashboard"]}),l.jsxs("div",{className:"mb-8",children:[l.jsx("p",{className:"font-body text-sm text-primary uppercase tracking-wider mb-2",children:"Coaching Portal"}),l.jsx("h1",{className:"font-heading text-3xl md:text-4xl",children:"Your coaching workspace"})]}),l.jsxs("div",{className:"grid lg:grid-cols-[280px_1fr] gap-8",children:[l.jsxs("aside",{className:"space-y-2",children:[l.jsx("h2",{className:"font-heading text-sm uppercase tracking-wider text-muted-foreground mb-2",children:"Sessions"}),a.length===0?l.jsx("p",{className:"text-sm text-muted-foreground border border-dashed border-border p-4",children:"Stephanie will add your sessions here once your first is scheduled."}):a.map(A=>l.jsxs("button",{onClick:()=>R(A),className:`w-full text-left p-3 border transition-colors ${h===A.id?"border-primary bg-primary/5":"border-border hover:bg-muted/50"}`,children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[l.jsx("span",{className:"font-heading text-sm",children:A.title}),l.jsx(Ot,{variant:"outline",className:tE(A.status),children:A.status})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:A.scheduled_at?new Date(A.scheduled_at).toLocaleStr
663ing([],{dateStyle:"medium",timeStyle:"short"}):"Not yet scheduled"})]},A.id)),x.some(A=>Rl[A])&&l.jsxs("div",{className:"pt-6",children:[l.jsx("h3",{className:"font-heading text-sm uppercase tracking-wider text-muted-foreground mb-2",children:"Schedule"}),!w&&l.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Before your first session, please complete a quick intake and agree to the coaching terms."}),l.jsx("div",{className:"space-y-2",children:x.filter(A=>Rl[A]).map(A=>l.jsxs(q,{variant:"outline",className:"w-full justify-start",onClick:()=>{const z=Rl[A].url;w?window.open(z,"_blank","noopener,noreferrer"):(S(z),E(!0))},children:[l.jsx(Vh,{className:"mr-2 h-4 w-4"}),w?`Book: ${Rl[A].label}`:`Start intake & book: ${Rl[A].label}`]},A))})]})]}),l.jsx("div",{className:"space-y-8",children:C?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border border-border p-6 bg-card",children:l.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"font-heading text-2xl mb-1",children:C.title}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[C.scheduled_at?new Date(C.scheduled_at).toLocaleString([],{dateStyle:"full",timeStyle:"short"}):"Time to be scheduled"," · ",C.duration_minutes," min"]})]}),l.jsx(Ot,{variant:"outline",className:tE(C.status),children:C.status})]})}),l.jsxs("section",{children:[l.jsxs("h3",{className:"font-heading text-lg mb-3 flex items-center gap-2",children:[l.jsx(ul,{className:"h-4 w-4 text-primary"})," Agenda"]}),l.jsx("div",{className:"border border-border p-5 bg-card whitespace-pre-wrap text-foreground/85 min-h-[80px]",children:C.agenda||l.jsx("span",{className:"text-muted-foreground italic",children:"Stephanie hasn't set an agenda yet."})})]}),l.jsxs("section",{children:[l.jsx("h3",{className:"font-heading text-lg mb-3",children:"Coach notes"}),l.jsx("div",{className:"border border-border p-5 bg-card whitespace-pre-wrap text-foreground/85 min-h-[80px]",children:C.coach_notes||l.jsx("span",{className:"text-muted-foreground italic",children:"No coach notes yet."})})]}),l.jsxs("section",{children:[l.jsx("h3",{className:"font-heading text-lg mb-3",children:"Your notes"}),l.jsx(jt,{value:f,onChange:A=>g(A.target.value),placeholder:"Capture what came up for you, questions, next stepsâ¦",rows:8,className:"mb-3"}),l.jsxs(q,{onClick:O,disabled:m,children:[l.jsx(qg,{className:"mr-2 h-4 w-4"})," ",m?"Savingâ¦":"Save notes"]})]}),l.jsxs("section",{children:[l.jsxs("h3",{className:"font-heading text-lg mb-3 flex items-center gap-2",children:[l.jsx(oF,{className:"h-4 w-4 text-primary"})," Resources"]}),_.length===0?l.jsx("p",{className:"text-sm text-muted-foreground border border-dashed border-border p-4",children:"No resources yet."}):l.jsx("div",{className:"space-y-2",children:_.map(A=>l.jsxs("button",{onClick:()=>L(A),className:"w-full border border-border p-4 bg-card flex items-center justify-between gap-3 hover:border-primary transition-colors text-left",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-heading text-sm",children:A.title}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.content_type||"file"," · added ",new Date(A.created_at).toLocaleDateString(),A.session_id===null?" · shared":""]})]}),l.jsx(Pc,{className:"h-4 w-4 text-muted-foreground shrink-0"})]},A.id))})]})]}):l.jsxs("div",{className:"border border-dashed border-border p-8",children:[l.jsx("h2",{className:"font-heading text-xl mb-2",children:"Welcome to your coaching workspace"}),l.jsxs("p",{className:"text-foreground/70 mb-4",children:["Your sessions, agendas, notes and resources will appear here.",x.some(A=>Rl[A])&&" Use the Book buttons in the sidebar to schedule your session."]})]})})]})]})}),l.jsx(Soe,{open:j,onOpenChange:E,onCompleted:()=>{k(!0),E(!1),N&&(window.open(N,"_blank","noopener,noreferrer"),S(null))}}),l.jsx(Ye,{})]}):l.jsxs(l.Fragment,{children:[l.jsx(ut,{pageKey:"coaching-portal"}),l.jsx(Ge,{}),l.jsxs("section",{className:"pt-32 pb-24 md:pt-40 container mx-auto px-6 max-w-3xl",children:[l.jsx("h1",{className:"font-heading text-3xl mb-4",children:"Coaching Portal"}
663),l.jsx("p",{className:"text-foreground/70 mb-6",children:"You don't have coaching access yet. Purchase a session on the individual coaching page to unlock this workspace."}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx(q,{asChild:!0,children:l.jsx(Be,{to:"/individual-coaching",children:"Explore coaching"})}),l.jsx(q,{asChild:!0,variant:"outline",children:l.jsx(Be,{to:"/dashboard",children:"Back to dashboard"})})]})]}),l.jsx(Ye,{})]})},joe=()=>l.jsxs(l.Fragment,{children:[l.jsx(ut,{pageKey:"coaching-terms"}),l.jsx(Ge,{}),l.jsx("main",{className:"pt-32 pb-24 md:pt-40",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 max-w-3xl",children:[l.jsx("h1",{className:"font-heading text-3xl md:text-4xl mb-8",children:"Coaching Agreement"}),l.jsxs("section",{className:"mb-10 p-5 border border-primary/40 bg-primary/5",children:[l.jsx("h2",{className:"font-heading text-xl mb-3",children:"TL;DR"}),l.jsx("p",{className:"mb-3 text-sm text-foreground/80",children:"The coaching agreement outlines the following:"}),l.jsxs("ol",{className:"list-decimal pl-5 space-y-2 text-sm text-foreground/85",children:[l.jsx("li",{children:"If you need to cancel or reschedule a session, you need to give me 24 hours notice or you may be charged for the time. You can only reschedule one session up to two times."}),l.jsx("li",{children:"If you have a package of sessions, you must use them within 6 months, unless arranged in advance."}),l.jsx("li",{children:"Coaching is not therapy or treatment for mental health issues or substance abuse and should not be used as such."}),l.jsx("li",{children:"Our work together is confidential."}),l.jsx("li",{children:"I will use care in protecting your personal data and never sell it."})]}),l.jsx("p",{className:"mt-3 text-sm text-foreground/70",children:"Please do read the whole thing, but those are the highlights."})]}),l.jsxs("div",{className:"prose prose-neutral max-w-none text-foreground/85 space-y-4 text-sm md:text-base",children:[l.jsx("p",{children:'This Agreement is entered into by and between: Stephanie Peirolo, Upperhand LLC ("Coach") and Client ("Client") whereby Coach agrees to provide Coaching Services for Client.'}),l.jsxs("p",{children:[l.jsx("strong",{children:"Description of Coaching:"})," Coaching is partnership (defined as an alliance, not a legal business partnership) between the Coach and the Client in a thought-provoking and creative process that inspires the client to maximize personal and professional potential. It is designed to facilitate the creation/development of personal, professional or business goals and to develop and carry out a strategy/plan for achieving those goals."]}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"1) Coach-Client Relationship"}),l.jsx("p",{children:'A. Coach agrees to maintain the ethics and standards of behavior established by the International Coaching Federation ("ICF"). www.coachingfederation.org/ethics.'}),l.jsx("p",{children:"B. Client is solely responsible for creating and implementing his/her/their own physical, mental and emotional well-being, decisions, choices, actions and results arising out of or resulting from the coaching relationship and his/her/their coaching calls and interactions with the Coach. As such, the Client agrees that the Coach is not and will not be liable or responsible for any actions or inaction, or for any direct or indirect result of any services provided by the Coach. Client understands coaching is not therapy and does not substitute for therapy if needed, and does not prevent, cure, or treat any mental disorder or medical disease."}),l.jsx("p",{children:"C. Client further acknowledges that he/she/they may terminate or discontinue the coaching relationship at any time."}),l.jsx("p",{children:"D. Client acknowledges that coaching is a comprehensive process that may involve different areas of life, including work, finances, health, relationships, education and recreation. The Client agrees that deciding how to handle these issues, incorporate coaching principles into those areas and implementing choices is exclusively the Client's responsibility."}),l.jsx("p",{children:"E. Client acknowledges that coaching does not involve the diagnosis or treatment of mental disorders as defined by the American Psychiatric Association and that coaching is not to be used as a substitute for counseling, psychotherapy, psychoanalysis, mental health care, substance abuse treatment, or other professional advice by legal, medical or other qualified professionals and that it is the Client's exclusive responsibility to seek such independent professional guidance as needed. If Client is currently under the care of a mental health professional, it is recommended that the Client promptly inform the mental health care provider of the nature and extent of the coaching relationship agreed upon by the Client and the Coach. Should the client become aware of a mental health issue at any time during the coaching relationship, Client agrees to inform the Coach."}),l.jsx("p",{children:"F. The Client understands that in order to enhance the coaching relationship, the Client agrees to communicate honestly, be open to feedback and assistance and to create the time and energy to participate fully in the program."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"2) Services & Term"}),l.jsx("p",{children:"The parties agree to engage in Coaching Services through internet meetings. The term of this agreement will be for the duration of the package purchased by the Client."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"3) Schedule & Fees"}),l.jsx("p",{children:"Each meeting shall be 60 minutes long, unless otherwise arranged. All payment will be in advance, through the Stripe or other mutually agreed upon online payment platform. Client will be notified by email in advance of the upcoming session. Any meeting cancelled or rescheduled with less than 24 hours notice will be billed at the full rate. All of the purchased
663sessions in the package must be used within 4 months of the purchase date. Clients may not reschedule a session more than twice."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"4) Confidentiality"}),l.jsx("p",{children:"This coaching relationship, as well as all information (documented or verbal) that the Client shares with the Coach as part of this relationship, is bound by the principles of confidentiality set forth in the ICF Code of Ethics. However, please be aware that the Coach-Client relationship is not considered a legally confidential relationship (like the medical and legal professions) and thus communications are not subject to the protection of any legally recognized privilege. The Coach agrees not to disclose any information pertaining to the Client without the Client's written consent. The Coach will not disclose the Client's name as a reference without the Client's consent."}),l.jsxs("p",{children:[l.jsx("em",{children:"Confidential Information"})," does not include information that: (a) was in the Coach's possession prior to its being furnished by the Client; (b) is generally known to the public or in the Client's industry; (c) is obtained by the Coach from a third party, without breach of any obligation to the Client; (d) is independently developed by the Coach without use of or reference to the Client's confidential information; or (e) the Coach is required by statute, lawfully issued subpoena, or by court order to disclose; (f) is disclosed to the Coach and as a result of such disclosure the Coach reasonably believes there to be an imminent or likely risk of danger or harm to the Client or others; and (g) involves illegal activity. The Client also acknowledges his or her continuing obligation to raise any confidentiality questions or concerns with the Coach in a timely manner."]}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"5) Privacy / Data Protection"}),l.jsx("p",{children:"A. The Coach and the Client will each of them comply as appropriate with applicable privacy/data protection legislation (including GDPR), binding court order, judgment or decree, guidance, codes, policy or standards."}),l.jsx("p",{children:`B. With regard to processing personal data/personal identifiable information ("data") in relation to the Client, the Coach will: process such data lawfully (on an appropriate basis including but not limited to consent, or to comply with the Coach's legal or regulatory obligations, or for contractual performance, or for the Coach's legitimate interests), fairly and in a transparent manner; collect such data for specified, explicit and legitimate purposes and not further process such data in a manner that is incompatible with those purposes; ensure that such data is adequate, relevant and limited to what is necessary in relation to the purposes for which they are processed; maintain such data accurately; keep such data for no longer than is necessary for the purposes for which the data are processed; process such data in a manner that ensures appropriate security of the data, including protection against unauthorized or unlawful processing and against accidental loss, destruction or damage, using appropriate technical or organizational measures; maintain records of such data processing under applicable privacy/data protection legislation requirements; share such data with third parties who the Coach will inform the Client about; concerning such data, observe the Client's privacy/data protection rights under applicable privacy/data protection legislation requirements, which may be subject to some conditions and exceptions; process such data for marketing purposes under applicable privacy/data protection legislation requirements; in case of a security breach concerning such data, where requirements of applicable privacy/data protection legislation are met, notify a regulatory or supervisory authority, board or other body responsible for administering privacy/data protection legislation, and the Client of the data security breach; and, where it is necessary for the Coach to transfer such data internationally the Coach will comply with applicable privacy/data protection legislation requirements designed to ensure the privacy of such data.`}),l.jsx("p",{children:"C. In connection with any infringement by the C
663oach of applicable privacy/data protection legislation requirements, including a security breach, concerning personal data/personal identifiable information in relation to the Client, the Coach's entire liability under this Agreement and the Client's exclusive remedy shall be limited to the amount actually paid by the Client to the Coach under this Agreement for all coaching services rendered through and including the termination date."}),l.jsx("p",{children:"D. Client acknowledges that the Coach is working through a third party platform provider, and Coach is not responsible for their data privacy practices."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"6) Cancellation Policy"}),l.jsx("p",{children:"Client agrees that it is the Client's responsibility to notify the Coach more than 24 hours in advance of the scheduled calls/meetings. Coach reserves the right to bill Client for a missed meeting. Coach will attempt in good faith to reschedule the missed meeting."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"7) Limited Liability"}),l.jsx("p",{children:"Except as expressly provided in this Agreement, the Coach makes no guarantees, representations or warranties of any kind or nature, express or implied with respect to the coaching services negotiated, agreed upon and rendered. In no event shall the Coach be liable to the Client for any indirect, consequential or special damages. Notwithstanding any damages that the Client may incur, the Coach's entire liability under this Agreement, and the Client's exclusive remedy, shall be limited to the amount actually paid by the Client to the Coach under this Agreement for all coaching services rendered through and including the termination date."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"8) Entire Agreement"}),l.jsx("p",{children:"This document reflects the entire agreement between the Coach and the Client, and reflects a complete understanding of the parties with respect to the subject matter. This Agreement supersedes all prior written and oral representations. The Agreement may not be amended, altered or supplemented except in writing signed by both the Coach and the Client."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"9) Dispute Resolution"}),l.jsx("p",{children:"If a dispute arises out of this Agreement that cannot be resolved by mutual consent, the Client and Coach agree to attempt to mediate in good faith for up to 30 days after notice given. If the dispute is not so resolved, and in the event of legal action, the prevailing party shall be entitled to recover attorney's fees and court costs from the other party."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"10) Severability"}),l.jsx("p",{children:"If any provision of this Agreement shall be held to be invalid or unenforceable for any reason, the remaining provisions shall continue to be valid and enforceable. If the Court finds that any provision of this Agreement is invalid or unenforceable, but that by limiting such provision it would become valid and enforceable, then such provision shall be deemed to be written, construed, and enforced as so limited."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"11) Waiver"}),l.jsx("p",{children:"The failure of either party to enforce any provision of this Agreement shall not be construed as a waiver or limitation of that party's right to subsequently enforce and compel strict compliance with every provision of this Agreement."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"12) Applicable Law"}),l.jsx("p",{children:"This Agreement shall be governed and construed in accordance with the laws of the State of Washington, without giving effect to any conflicts of laws provisions."}),l.jsx("h3",{className:"font-heading text-lg pt-2",children:"13) Binding Effect"}),l.jsx("p",{children:"This Agreement shall be binding upon the parties hereto and their respective successors and permissible assigns."}),l.jsx("p",{className:"pt-4 font-semibold",children:'By clicking "I AGREE" you agree to this agreement.'})]})]})}),l.jsx(Ye,{})]}),Noe=()=>{const[t]=X0(),e=t.get("token")||"",[n,r]=y.useState("loading"),[s,i]=y.useState(!1);y.useEffect(()=>{if(!e){r("invalid");return}(async()=>{try{const a=`https://ouxnmydssnzuvficfwah.supabase.co/functions/v1/handle-email-unsubscribe?token=${encodeURIComponent(e)}`,c=await fetch(a,{headers:{apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im91eG5teWRzc256dXZmaWNmd2FoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQyMDk2MDYsImV4cCI6MjA4OTc4NTYwNn0.-4HSqD2dfns5G78QREqe8Y6Ub_Pb9kja1POrrwtzXX8"}}),u=await c.json();if(!c.ok)return r("invalid");if(u.valid===!1&&u.reason==="already_unsubscribed")return r("already");if(u.valid)return r("valid");r("invalid")}catch{r("invalid")}})()},[e]);const o=async()=>{i(!0);const{data:a,error:c}=await D.functions.invoke("handle-email-unsubscribe",{body:{token:e}});
663if(i(!1),c)return r("error");if(a!=null&&a.success)return r("success");if((a==null?void 0:a.reason)==="already_unsubscribed")return r("already");r("error")};return l.jsxs("main",{children:[l.jsx(Ge,{}),l.jsx("section",{className:"min-h-[60vh] pt-32 pb-20 flex items-center",children:l.jsxs("div",{className:"container mx-auto px-6 md:px-12 lg:px-24 max-w-lg text-center",children:[n==="loading"&&l.jsxs("div",{className:"flex flex-col items-center gap-4",children:[l.jsx(qt,{className:"h-8 w-8 animate-spin text-primary"}),l.jsx("p",{className:"text-muted-foreground",children:"Checking your linkâ¦"})]}),n==="valid"&&l.jsxs(l.Fragment,{children:[l.jsx("h1",{className:"font-heading text-3xl md:text-4xl mb-4",children:"Unsubscribe"}),l.jsx("p",{className:"text-foreground/80 mb-8",children:"Click below to confirm and stop receiving emails from Stephanie Peirolo."}),l.jsx(q,{size:"lg",onClick:o,disabled:s,className:"font-body uppercase tracking-wider",children:s?l.jsx(qt,{className:"h-4 w-4 animate-spin"}):"Confirm unsubscribe"})]}),n==="success"&&l.jsxs(l.Fragment,{children:[l.jsx(Qd,{className:"h-10 w-10 text-primary mx-auto mb-4"}),l.jsx("h1",{className:"font-heading text-3xl mb-3",children:"You're unsubscribed"}),l.jsx("p",{className:"text-foreground/80",children:"You won't receive further emails. Take care."})]}),n==="already"&&l.jsxs(l.Fragment,{children:[l.jsx(Qd,{className:"h-10 w-10 text-primary mx-auto mb-4"}),l.jsx("h1",{className:"font-heading text-3xl mb-3",children:"Already unsubscribed"}),l.jsx("p",{className:"text-foreground/80",children:"This email is already on our unsubscribe list."})]}),(n==="invalid"||n==="error")&&l.jsxs(l.Fragment,{children:[l.jsx(q5,{className:"h-10 w-10 text-destructive mx-auto mb-4"}),l.jsx("h1",{className:"font-heading text-3xl mb-3",children:n==="invalid"?"Invalid or expired link":"Something went wrong"}),l.jsx("p",{className:"text-foreground/80",children:"Please try the link again from a recent email, or contact us if the problem persists."})]})]})}),l.jsx(Ye,{})]})},_oe=()=>{const[t,e]=y.useState(!0),[n,r]=y.useState([]),[s,i]=y.useState(""),[o,a]=y.useState(""),[c,u]=y.useState(!1);y.useEffect(()=>{(async()=>{var w;e(!0);const p=dy(),[f,g,m]=await Promise.all([D.from("purchases").select("user_id, product_label, created_at, price_id, stripe_customer_id").eq("environment",p).ilike("price_id","%coaching%").order("created_at",{ascending:!1}),D.from("coaching_sessions").select("user_id"),D.from("site_settings").select("value").eq("key","calendly_url").maybeSingle()]),v=(w=m.data)==null?void 0:w.value;a(typeof v=="string"?v:"");const x=new Map;(f.data||[]).forEach(k=>{x.get(k.user_id)||x.set(k.user_id,{user_id:k.user_id,email:null,latest_purchase:k.created_at,product_label:k.product_label,session_count:0})}),(g.data||[]).forEach(k=>{x.has(k.user_id)||x.set(k.user_id,{user_id:k.user_id,email:null,latest_purchase:null,product_label:null,session_count:0})});const b=new Map;(g.data||[]).forEach(k=>b.set(k.user_id,(b.get(k.user_id)||0)+1)),x.forEach((k,j)=>k.session_count=b.get(j)||0),r(Array.from(x.values())),e(!1)})()},[]);const d=async()=>{u(!0);const{error:p}=await D.from("site_settings").upsert({key:"calendly_url",value:o},{onConflict:"key"});if(u(!1),p)return St({title:"Save failed",description:p.message,variant:"destructive"});St({title:"Calendly URL saved"})},h=n.filter(p=>!s||(p.product_label||"").toLowerCase().includes(s.toLowerCase())||p.user_id.includes(s));return l.jsxs("div",{className:"p-6 md:p-10 max-w-6xl",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx(ak,{className:"h-6 w-6 text-primary"}),l.jsx("h1",{className:"font-heading text-3xl",children:"Coaching Clients"})]}),l.jsx("p",{className:"text-muted-foreground mb-8",children:"Everyone who has purchased individual coaching or has a session on file."}),l.jsxs("div",{className:"border border-border p-5 bg-card mb-8",children:[l.jsx("h2",{className:"font-heading text-sm uppercase tracking-wider text-muted-foreground mb-3",children:"Calendly link"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx(ue,{placeholder:"https://calendly.com/your-handle/coaching",value:o,onChange:p=>a(p.target.value)}
663),l.jsxs(q,{onClick:d,disabled:c,children:[l.jsx(qg,{className:"mr-2 h-4 w-4"})," Save"]})]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Shown to clients on their coaching page."})]}),l.jsxs("div",{className:"relative mb-4 max-w-sm",children:[l.jsx(PA,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(ue,{value:s,onChange:p=>i(p.target.value),placeholder:"Search clients",className:"pl-9"})]}),t?l.jsx("div",{className:"py-16 flex justify-center",children:l.jsx(qt,{className:"h-6 w-6 animate-spin text-primary"})}):h.length===0?l.jsx("p",{className:"text-muted-foreground border border-dashed border-border p-8",children:"No coaching clients yet."}):l.jsx("div",{className:"space-y-2",children:h.map(p=>l.jsx(Be,{to:`/admin/coaching/${p.user_id}`,className:"block border border-border p-4 bg-card hover:border-primary transition-colors",children:l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-heading",children:p.product_label||"Coaching client"}),l.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:p.user_id})]}),l.jsxs("div",{className:"text-right text-sm",children:[l.jsxs("p",{className:"text-foreground/80",children:[p.session_count," session",p.session_count===1?"":"s"]}),p.latest_purchase&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Purchased ",new Date(p.latest_purchase).toLocaleDateString()]})]})]})},p.user_id))})]})},Eoe=t=>{if(!t)return"";const e=new Date(t),n=r=>String(r).padStart(2,"0");return`${e.getFullYear()}-${n(e.getMonth()+1)}-${n(e.getDate())}T${n(e.getHours())}:${n(e.getMinutes())}`},Toe=()=>{const{userId:t}=ea(),[e,n]=y.useState(!0),[r,s]=y.useState([]),[i,o]=y.useState([]),[a,c]=y.useState(null),[u,d]=y.useState(!1),[h,p]=y.useState(!1),[f,g]=y.useState("shared"),m=y.useRef(null),v=async()=>{var R;if(!t)return;n(!0);const[C,_]=await Promise.all([D.from("coaching_sessions").select("*").eq("user_id",t).order("position"),D.from("coaching_resources").select("*").eq("user_id",t).order("created_at",{ascending:!1})]);s(C.data||[]),o(_.data||[]),!a&&((R=C.data)!=null&&R[0])&&c(C.data[0].id),n(!1)};y.useEffect(()=>{v()},[t]);const x=r.find(C=>C.id===a)||null,b=async()=>{var O;if(!t)return;const C=(((O=r[r.length-1])==null?void 0:O.position)??-1)+1,{data:_,error:R}=await D.from("coaching_sessions").insert({user_id:t,title:`Session ${r.length+1}`,position:C}).select().single();if(R)return St({title:"Could not add session",description:R.message,variant:"destructive"});s([...r,_]),c(_.id)},w=C=>{x&&s(_=>_.map(R=>R.id===x.id?{...R,...C}:R))},k=async()=>{if(!x)return;d(!0);const{error:C}=await D.from("coaching_sessions").update({title:x.title,scheduled_at:x.scheduled_at,duration_minutes:x.duration_minutes,agenda:x.agenda,coach_notes:x.coach_notes,status:x.status}).eq("id",x.id);if(d(!1),C)return St({title:"Save failed",description:C.message,variant:"destructive"});St({title:"Session saved"})},j=async()=>{var R;if(!x||!confirm("Delete this session? This cannot be undone."))return;const{error:C}=await D.from("coaching_sessions").delete().eq("id",x.id);if(C)return St({title:"Delete failed",description:C.message,variant:"destructive"});const _=r.filter(O=>O.id!==x.id);s(_),c(((R=_[0])==null?void 0:R.id)||null)},E=async C=>{var A;if(!t)return;p(!0);const _=C.name.split(".").pop()||"bin",R=`${t}/${crypto.randomUUID()}.${_}`,{error:O}=await D.storage.from("coaching-resources").upload(R,C,{contentType:C.type||"application/octet-stream"});if(O)return p(!1),St({title:"Upload failed",description:O.message,variant:"destructive"});const{error:L}=await D.from("coaching_resources").insert({user_id:t,session_id:f==="shared"?null:f,title:C.name,file_path:R,file_size:C.size,content_type:C.type,uploaded_by:(A=(await D.auth.getUser()).data.user)==null?void 0:A.id});if(p(!1),L)return St({title:"Save failed",description:L.message,variant:"destructive"});St({title:"Resource uploaded"}),m.current&&(m.current.value=""),v()},N=async C=>{confirm(`Delete "${C.title}"?`)&&(await D.storage.from("coaching-resources").remove([C.file_path]),await D.from("coaching_resources").delete().eq("id",C.id),o(_=>_.filter(R=>R.id!==C.id)))},S=async C=>{const{data:_}=await D.storage.from("coaching-resources").createSignedUrl(C.file_path,300);_!=null&&_.signedUrl&&window.open(_.signedUrl,"_blank","noopener,noreferrer")};return e?l.jsx("div",{className:"p-16 flex justify-center",children:l.jsx(qt,{className:"h-6 w-6 animate-spin text-primary"})}):l.jsxs("div",{className:"p-6 md:p-10 max-w-6xl",children:[l.jsxs(Be,{to:"/admin/coaching",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-4",children:[l.jsx(ei,{className:"h-4 w-4"})," All clients"]}),l.jsx("h1",{className:"font-heading text-2xl mb-1",children:"Coaching client"}),l.jsx("p",{className:"text-xs text-muted-foreground font-mono mb-8",children:t}),l.jsxs("div",{className:"grid lg:grid-cols-[240px_1fr] gap-8",children:[l.jsxs("aside",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("h2",{className:"font-heading text-sm uppercase tracking-wider text-muted-foreground",children:"Sessions"}),l.jsx(q,{size:"sm",variant:"ghost",onClick:b,children:l.jsx(Qr,{className:"h-4 w-4"})})]}),r.length===0?l.jsx("p",{className:"text-xs text-muted-foreground border border-dashed border-border p-3",children:"No sessions yet. Click + to add one."}):r.map(C=>l.jsxs("button",{onClick:()=>c(C.id),className:`w-full text-left p-3 border transition-colors ${a===C.id?"border-primary bg-primary/5":"border-border hover:bg-muted/50"}`,children:[l.jsx("p",{className:"font-heading text-sm",children:C.title}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[C.scheduled_at?new Date(C.scheduled_at).toLocaleDateString():"unscheduled"," · ",C.status]})]},C.id))]}),l.jsx("div",{className:"space-y-8",children:x?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"border border-border p-5 bg-card space-y-4",children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Title"}),l.jsx(ue,{value:x.title,onChange:C=>w({title:C.target.value})})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Status"}),l.jsxs(Xr,{value:x.status,onValueChange:C=>w({status:C}),children:[l.jsx(Tr,{children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"upcoming",children:"Upcoming"}),l.jsx(nt,{value:"completed",children:"Completed"}),l.jsx(nt,{value:"canceled",children:"Canceled"})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Scheduled at"}),l.jsx(ue,{type:"datetime-local",value:Eoe(x.scheduled_at),onChange:C=>w({scheduled_at:C.target.value?new Date(C.target.value).toISOString():null})})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Duration (min)"}),l.jsx(ue,{type:"number",value:x.duration_minutes,onChange:C=>w({duration_minutes:Number(C.target.value)})})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Agenda"}),l.jsx(jt,{rows:6,value:x.agenda||"",onChange:C=>w({agenda:C.target.value})})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Coach notes (visible to client)"}),l.jsx(jt,{rows:6,value:x.coach_notes||"",onChange:C=>w({coach_notes:C.target.value})})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Client's notes (read-only)"}),l.jsx("div",{className:"border border-border p-3 bg-muted/30 text-sm whitespace-pre-wrap min-h-[60
663px]",children:x.client_notes||l.jsx("span",{className:"text-muted-foreground italic",children:"No client notes yet."})})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(q,{onClick:k,disabled:u,children:[l.jsx(qg,{className:"mr-2 h-4 w-4"})," ",u?"Savingâ¦":"Save session"]}),l.jsxs(q,{variant:"outline",onClick:j,className:"text-destructive",children:[l.jsx(ks,{className:"mr-2 h-4 w-4"})," Delete"]})]})]}),l.jsxs("section",{children:[l.jsx("h3",{className:"font-heading text-lg mb-3",children:"Resources"}),l.jsx("div",{className:"border border-border p-4 bg-card mb-4",children:l.jsxs("div",{className:"flex flex-col md:flex-row gap-3 md:items-end",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Attach to"}),l.jsxs(Xr,{value:f,onValueChange:g,children:[l.jsx(Tr,{children:l.jsx(Zr,{})}),l.jsxs(Rr,{children:[l.jsx(nt,{value:"shared",children:"Shared with client (all sessions)"}),r.map(C=>l.jsx(nt,{value:C.id,children:C.title},C.id))]})]})]}),l.jsxs("div",{className:"flex-1",children:[l.jsx("label",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"File"}),l.jsx(ue,{ref:m,type:"file",disabled:h,onChange:C=>{var _;return((_=C.target.files)==null?void 0:_[0])&&E(C.target.files[0])}})]}),h&&l.jsx(qt,{className:"h-4 w-4 animate-spin text-primary"})]})}),i.length===0?l.jsx("p",{className:"text-sm text-muted-foreground border border-dashed border-border p-4",children:"No resources uploaded yet."}):l.jsx("div",{className:"space-y-2",children:i.map(C=>{var R;const _=C.session_id?((R=r.find(O=>O.id===C.session_id))==null?void 0:R.title)||"Session":"Shared";return l.jsxs("div",{className:"border border-border p-4 bg-card flex items-center justify-between gap-3",children:[l.jsxs("button",{onClick:()=>S(C),className:"flex-1 text-left flex items-center gap-3 hover:text-primary",children:[l.jsx(ul,{className:"h-4 w-4 shrink-0"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-heading text-sm",children:C.title}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[_," · ",new Date(C.created_at).toLocaleDateString()]})]})]}),l.jsx(q,{size:"sm",variant:"ghost",onClick:()=>N(C),className:"text-destructive",children:l.jsx(ks,{className:"h-4 w-4"})})]},C.id)})})]})]}):l.jsxs("div",{className:"border border-dashed border-border p-8",children:[l.jsx("p",{className:"text-foreground/70 mb-4",children:"No session selected. Add one to get started."}),l.jsxs(q,{onClick:b,children:[l.jsx(Qr,{className:"mr-2 h-4 w-4"})," Add session"]})]})})]})]})},Roe="pk_live_51MwY4ZKNNy7m2frwdv20YGbOe4yXdHTf8avQKaaVec52QjwCwZt3d2spC6d8Hvl7VvjDquQEizoEbTA5ZBmE2ING00BpqSWpUH";function Aoe(){return Roe.startsWith("pk_test_")?l.jsxs("div",{className:"w-full bg-orange-100 border-b border-orange-300 px-4 py-2 text-center text-sm text-orange-800",children:["All payments made in the preview are in test mode."," ",l.jsx("a",{href:"https://docs.lovable.dev/features/payments#test-and-live-environments",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"Read more"})]}):null}const Ooe=({children:t})=>{const e=Ai(),[n,r]=y.useState(e.pathname);return y.useEffect(()=>{r(e.pathname),window.scrollTo({top:0,behavior:"instant"})},[e.pathname]),l.jsx("div",{className:"animate-page-enter",style:{willChange:"opacity, transform"},children:t},n)},Poe=new W3,Moe=()=>l.jsx(J3,{client:Poe,children:l.jsx(RH,{children:l.jsxs(S2,{children:[l.jsx(KF,{}),l.jsx(Wz,{}),l.jsxs(az,{children:[l.jsx(Aoe,{}),l.jsx(Ooe,{children:l.jsxs(XB,{children:[l.jsx(Te,{path:"/",element:l.jsx(Eq,{})}),l.jsx(Te,{path:"/press-media",element:l.jsx(Rq,{})}),l.jsx(Te,{path:"/contact",element:l.jsx(Oq,{})}),l.jsx(Te,{path:"/checkout/return",element:l.jsx(voe,{})}),l.jsx(Te,{path:"/corporate-coaching",element:l.jsx(m9,{})}),l.jsx(Te,{path:"/individual-coaching",element:l.jsx(v9,{})}),l.jsx(Te,{path:"/cohort-coaching",element:l.jsx(k9,{})}),l.jsx(Te,{path:"/blog",element:l.jsx(YK,{})}),l.jsx(Te,{path:"/blog/legacy",element:l.jsx(KK,{})}),l.jsx(Te,{path:"/blog/:slug",element:l.jsx(GK,{})}),l.jsx(Te,{path:"/courses",element:l.jsx(Tre,{})}),l.jsx(Te,{path:"/courses/:slug",element:l.jsx(Rre,{})}),l.jsx(Te,{path:"/events",element:l.jsx(poe,{})}),l.jsx(Te,{path:"/podcast",element:l.jsx(JK,{})}),l.jsx(Te,{path:"/reading-room",element:l.jsx(w7,{})}),l.jsx(Te,{path:"/narratives",element:l.jsx(k7,{})}),l.jsx(Te,{path:"/narratives/:slug",element:l.jsx(eG,{})}),l.jsx(Te,{path:"/bio",element:l.jsx(tG,{})}),l.jsx(Te,{path:"/how-i-use-ai",element:l.jsx(nG,{})}),l.jsx(Te,{path:"/assessment",element:l.jsx(fG,{})}),l.jsx(Te,{path:"/book",element:l.jsx(gG,{})}),l.jsx(Te,{path:"/real-work",element:l.jsx(yG,{})}),l.jsx(Te,{path:"/turning-points",element:l.jsx(vG,{})}),l.jsx(Te,{path:"/login",element:l.jsx($j,{})}),l.jsx(Te,{path:"/signup",element:l.jsx($j,{})}),l.jsx(Te,{path:"/forgot-password",element:l.jsx(QK,{})}),l.jsx(Te,{path:"/reset-password",element:l.jsx(XK,{})}),l.jsx(Te,{path:"/dashboard",element:l.jsx(woe,{})}),l.jsx(Te,{path:"/coaching",element:l.jsx(Coe,{})}),l.jsx(Te,{path:"/coaching/terms",element:l.jsx(joe,{})}),l.jsx(Te,{path:"/unsubscribe",element:l.jsx(Noe,{})}),l.jsx(Te,{path:"/admin/login",element:l.jsx(Are,{})}),l.jsxs(Te,{path:"/admin",element:l.jsx(lse,{}),children:[l.jsx(Te,{index:!0,element:l.jsx(dse,{})}),l.jsx(Te,{path:"contacts",element:l.jsx(gse,{})}),l.jsx(Te,{path:"submissions",element:l.jsx(yse,{})}),l.jsx(Te,{path:"blog",element:l.jsx(vse,{})}),l.jsx(Te,{path:"blog/:id",element:l.jsx(bse,{})}),l.jsx(Te,{path:"courses",element:l.jsx(wse,{})}),l.jsx(Te,{path:"courses/:id",element:l.jsx(doe,{})}),l.jsx(Te,{path:"press-media",element:l.jsx(foe,{})}),l.jsx(Te,{path:"events",element:l.jsx(moe,{})}),l.jsx(Te,{path:"reading-room",element:l.jsx(QG,{})}),l.jsx(Te,{path:"reading-room/members",element:l.jsx(Nre,{})}),l.jsx(Te,{path:"reading-room/:id",element:l.jsx(jre,{})}),l.jsx(Te,{path:"narratives",element:l.jsx(_re,{})}),l.jsx(Te,{path:"narratives/:id",element:l.jsx(Ere,{})}),l.jsx(Te,{path:"coaching",element:l.jsx(_oe,{})}),l.jsx(Te,{path:"coaching/:userId",element:l.jsx(Toe,{})})]}),l.jsx(Te,{path:"*",element:l.jsx(goe,{})})]})})]})]})})});SR(document.getElementById("root")).render(l.jsx(Moe,{}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.