PageSourceSearch

https://www.institutboufflers.org/assets/index-DhBAyvQN.js

js institutboufflers.org collected 2026-10-02 12:34:09 UTC 1,156,812 bytes, 523 lines download raw bytes

vendor: 6,122 bytes, lines 1-9
1var nx=t=>{throw TypeError(t)};var $m=(t,e,n)=>e.has(t)||nx("Cannot "+n);var A=(t,e,n)=>($m(t,e,"read from private field"),n?n.call(t):e.get(t)),fe=(t,e,n)=>e.has(t)?nx("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ne=(t,e,n,r)=>($m(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Te=(t,e,n)=>($m(t,e,"access private method"),n);var Rd=(t,e,n,r)=>({set _(s){ne(t,e,s,n)},get _(){return A(t,e,r)}});function yj(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)}})();function bC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wC={exports:{}},jp={},xC={exports:{}},Ce={};/**
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 od=Symbol.for("react.element"),vj=Symbol.for("react.portal"),bj=Symbol.for("react.fragment"),wj=Symbol.for("react.strict_mode"),xj=Symbol.for("react.profiler"),kj=Symbol.for("react.provider"),Sj=Symbol.for("react.context"),Ej=Symbol.for("react.forward_ref"),Cj=Symbol.for("react.suspense"),_j=Symbol.for("react.memo"),Tj=Symbol.for("react.lazy"),rx=Symbol.iterator;function Aj(t){return t===null||typeof t!="object"?null:(t=rx&&t[rx]||t["@@iterator"],typeof t=="function"?t:null)}var kC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},SC=Object.assign,EC={};function ql(t,e,n){this.props=t,this.context=e,this.refs=EC,this.updater=n||kC}ql.prototype.isReactComponent={};ql.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")};ql.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function CC(){}CC.prototype=ql.prototype;function M0(t,e,n){this.props=t,this.context=e,this.refs=EC,this.updater=n||kC}var L0=M0.prototype=new CC;L0.constructor=M0;SC(L0,ql.prototype);L0.isPureReactComponent=!0;var sx=Array.isArray,_C=Object.prototype.hasOwnProperty,D0={current:null},TC={key:!0,ref:!0,__self:!0,__source:!0};function AC(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)_C.call(e,r)&&!TC.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:od,type:t,key:i,ref:o,props:s,_owner:D0.current}}function Nj(t,e){return{$$typeof:od,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function $0(t){return typeof t=="object"&&t!==null&&t.$$typeof===od}function Oj(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var ix=/\/+/g;function Fm(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Oj(""+t.key):e.toString(36)}function Ef(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 od:case vj:o=!0}}if(o)return o=t,s=s(o),t=r===""?"."+Fm(o,0):r,sx(s)?(n="",t!=null&&(n=t.replace(ix,"$&/")+"/"),Ef(s,e,n,"",function(c){return c})):s!=null&&($0(s)&&(s=Nj(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(ix,"$&/")+"/")+t)),e.push(s)),1;if(o=0,r=r===""?".":r+":",sx(t))for(var a=0;a<t.length;a++){i=t[a];var l=r+Fm(i,a);o+=Ef(i,e,n,l,s)}else if(l=Aj(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=r+Fm(i,a++),o+=Ef(i,e,n,l,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 Pd(t,e,n){if(t==null)return t;var r=[],s=0;return Ef(t,r,"","",function(i){return e.call(n,i,s++)}),r}function Rj(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 un={current:null},Cf={transition:null},Pj={ReactCurrentDispatcher:un,ReactCurrentBatchConfig:Cf,ReactCurrentOwner:D0};function NC(){throw Error("act(...) is not supported in production builds of React.")}Ce.Children={map:Pd,forEach:function(t,e,n){Pd(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Pd(t,function(){e++}),e},toArray:function(t){return Pd(t,function(e){return e})||[]},only:function(t){if(!$0(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ce.Component=ql;Ce.Fragment=bj;Ce.Profiler=xj;Ce.PureComponent=M0;Ce.StrictMode=wj;Ce.Suspense=Cj;
vendor: 5,085 bytes, lines 9-25
9Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Pj;Ce.act=NC;Ce.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=SC({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=D0.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)_C.call(e,l)&&!TC.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:od,type:t.type,key:s,ref:i,props:r,_owner:o}};Ce.createContext=function(t){return t={$$typeof:Sj,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:kj,_context:t},t.Consumer=t};Ce.createElement=AC;Ce.createFactory=function(t){var e=AC.bind(null,t);return e.type=t,e};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(t){return{$$typeof:Ej,render:t}};Ce.isValidElement=$0;Ce.lazy=function(t){return{$$typeof:Tj,_payload:{_status:-1,_result:t},_init:Rj}};Ce.memo=function(t,e){return{$$typeof:_j,type:t,compare:e===void 0?null:e}};Ce.startTransition=function(t){var e=Cf.transition;Cf.transition={};try{t()}finally{Cf.transition=e}};Ce.unstable_act=NC;Ce.useCallback=function(t,e){return un.current.useCallback(t,e)};Ce.useContext=function(t){return un.current.useContext(t)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(t){return un.current.useDeferredValue(t)};Ce.useEffect=function(t,e){return un.current.useEffect(t,e)};Ce.useId=function(){return un.current.useId()};Ce.useImperativeHandle=function(t,e,n){return un.current.useImperativeHandle(t,e,n)};Ce.useInsertionEffect=function(t,e){return un.current.useInsertionEffect(t,e)};Ce.useLayoutEffect=function(t,e){return un.current.useLayoutEffect(t,e)};Ce.useMemo=function(t,e){return un.current.useMemo(t,e)};Ce.useReducer=function(t,e,n){return un.current.useReducer(t,e,n)};Ce.useRef=function(t){return un.current.useRef(t)};Ce.useState=function(t){return un.current.useState(t)};Ce.useSyncExternalStore=function(t,e,n){return un.current.useSyncExternalStore(t,e,n)};Ce.useTransition=function(){return un.current.useTransition()};Ce.version="18.3.1";xC.exports=Ce;var x=xC.exports;const M=bC(x),F0=yj({__proto__:null,default:M},[x]);/**
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 Ij=x,jj=Symbol.for("react.element"),Mj=Symbol.for("react.fragment"),Lj=Object.prototype.hasOwnProperty,Dj=Ij.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$j={key:!0,ref:!0,__self:!0,__source:!0};function OC(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)Lj.call(e,r)&&!$j.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:jj,type:t,key:i,ref:o,props:s,_owner:Dj.current}}jp.Fragment=Mj;jp.jsx=OC;jp.jsxs=OC;wC.exports=jp;var m=wC.exports,RC={exports:{}},Ln={},PC={exports:{}},IC={};/**
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(j,$){var J=j.length;j.push($);e:for(;0<J;){var ae=J-1>>>1,se=j[ae];if(0<s(se,$))j[ae]=$,j[J]=se,J=ae;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var $=j[0],J=j.pop();if(J!==$){j[0]=J;e:for(var ae=0,se=j.length,pe=se>>>1;ae<pe;){var be=2*(ae+1)-1,Ue=j[be],Tt=be+1,Ne=j[Tt];if(0>s(Ue,J))Tt<se&&0>s(Ne,Ue)?(j[ae]=Ne,j[Tt]=J,ae=Tt):(j[ae]=Ue,j[be]=J,ae=be);else if(Tt<se&&0>s(Ne,J))j[ae]=Ne,j[Tt]=J,ae=Tt;else break e}}return $}function s(j,$){var J=j.sortIndex-$.sortIndex;return J!==0?J:j.id-$.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 l=[],c=[],u=1,d=null,f=3,h=!1,p=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=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(j){for(var $=n(c);$!==null;){if($.callback===null)r(c);else if($.startTime<=j)r(c),$.sortIndex=$.expirationTime,e(l,$);else break;$=n(c)}}function k(j){if(g=!1,w(j),!p)if(n(l)!==null)p=!0,U(S);else{var $=n(c);$!==null&&Z(k,$.startTime-j)}}function S(j,$){p=!1,g&&(g=!1,v(T),T=-1),h=!0;var J=f;try{for(w($),d=n(l);d!==null&&(!(d.expirationTime>$)||j&&!q());){var ae=d.callback;
vendor: 9,178 bytes, lines 25-34
25if(typeof ae=="function"){d.callback=null,f=d.priorityLevel;var se=ae(d.expirationTime<=$);$=t.unstable_now(),typeof se=="function"?d.callback=se:d===n(l)&&r(l),w($)}else r(l);d=n(l)}if(d!==null)var pe=!0;else{var be=n(c);be!==null&&Z(k,be.startTime-$),pe=!1}return pe}finally{d=null,f=J,h=!1}}var C=!1,E=null,T=-1,N=5,P=-1;function q(){return!(t.unstable_now()-P<N)}function R(){if(E!==null){var j=t.unstable_now();P=j;var $=!0;try{$=E(!0,j)}finally{$?D():(C=!1,E=null)}}else C=!1}var D;if(typeof b=="function")D=function(){b(R)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,H=I.port2;I.port1.onmessage=R,D=function(){H.postMessage(null)}}else D=function(){y(R,0)};function U(j){E=j,C||(C=!0,D())}function Z(j,$){T=y(function(){j(t.unstable_now())},$)}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(j){j.callback=null},t.unstable_continueExecution=function(){p||h||(p=!0,U(S))},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(j){switch(f){case 1:case 2:case 3:var $=3;break;default:$=f}var J=f;f=$;try{return j()}finally{f=J}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(j,$){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var J=f;f=j;try{return $()}finally{f=J}},t.unstable_scheduleCallback=function(j,$,J){var ae=t.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ae+J:ae):J=ae,j){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=J+se,j={id:u++,callback:$,priorityLevel:j,startTime:J,expirationTime:se,sortIndex:-1},J>ae?(j.sortIndex=J,e(c,j),n(l)===null&&j===n(c)&&(g?(v(T),T=-1):g=!0,Z(k,J-ae))):(j.sortIndex=se,e(l,j),p||h||(p=!0,U(S))),j},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(j){var $=f;return function(){var J=f;f=$;try{return j.apply(this,arguments)}finally{f=J}}}})(IC);PC.exports=IC;var Fj=PC.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 Bj=x,jn=Fj;function z(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 jC=new Set,uu={};function na(t,e){El(t,e),El(t+"Capture",e)}function El(t,e){for(uu[t]=e,t=0;t<e.length;t++)jC.add(e[t])}var As=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gy=Object.prototype.hasOwnProperty,zj=/^[: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]*$/,ox={},ax={};function Uj(t){return gy.call(ax,t)?!0:gy.call(ox,t)?!1:zj.test(t)?ax[t]=!0:(ox[t]=!0,!1)}function Vj(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 Hj(t,e,n,r){if(e===null||typeof e>"u"||Vj(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 dn(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 Wt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Wt[t]=new dn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Wt[e]=new dn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Wt[t]=new dn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Wt[t]=new dn(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){Wt[t]=new dn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Wt[t]=new dn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Wt[t]=new dn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Wt[t]=new dn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Wt[t]=new dn(t,5,!1,t.toLowerCase(),null,!1,!1)});var B0=/[\-:]([a-z])/g;function z0(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(B0,z0);Wt[e]=new dn(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(B0,z0);Wt[e]=new dn(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(B0,z0);Wt[e]=new dn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Wt[t]=new dn(t,1,!1,t.toLowerCase(),null,!1,!1)});Wt.xlinkHref=new dn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Wt[t]=new dn(t,1,!1,t.toLowerCase(),null,!0,!0)});function U0(t,e,n,r){var s=Wt.hasOwnProperty(e)?Wt[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Hj(e,n,s,r)&&(n=null),r||s===null?Uj(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 Ls=Bj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Id=Symbol.for("react.element"),La=Symbol.for("react.portal"),Da=Symbol.for("react.fragment"),V0=Symbol.for("react.strict_mode"),yy=Symbol.for("react.profiler"),MC=Symbol.for("react.provider"),LC=Symbol.for("react.context"),H0=Symbol.for("react.forward_ref"),vy=Symbol.for("react.suspense"),by=Symbol.for("react.suspense_list"),W0=Symbol.for("react.memo"),Qs=Symbol.for("react.lazy"),DC=Symbol.for("react.offscreen"),lx=Symbol.iterator;function ic(t){return t===null||typeof t!="object"?null:(t=lx&&t[lx]||t["@@iterator"],typeof t=="function"?t:null)}var tt=Object.assign,Bm;function Sc(t){if(Bm===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Bm=e&&e[1]||""}return`
34`+Bm+t}var zm=!1;function Um(t,e){if(!t||zm)return"";zm=!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(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}
vendor: 18,177 bytes, lines 34-37
34catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.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 l=`
37`+s[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{zm=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Sc(t):""}function Wj(t){switch(t.tag){case 5:return Sc(t.type);case 16:return Sc("Lazy");case 13:return Sc("Suspense");case 19:return Sc("SuspenseList");case 0:case 2:case 15:return t=Um(t.type,!1),t;case 11:return t=Um(t.type.render,!1),t;case 1:return t=Um(t.type,!0),t;default:return""}}function wy(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 Da:return"Fragment";case La:return"Portal";case yy:return"Profiler";case V0:return"StrictMode";case vy:return"Suspense";case by:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case LC:return(t.displayName||"Context")+".Consumer";case MC:return(t._context.displayName||"Context")+".Provider";case H0:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case W0:return e=t.displayName||null,e!==null?e:wy(t.type)||"Memo";case Qs:e=t._payload,t=t._init;try{return wy(t(e))}catch{}}return null}function qj(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 wy(e);case 8:return e===V0?"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 Bi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function $C(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Kj(t){var e=$C(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 jd(t){t._valueTracker||(t._valueTracker=Kj(t))}function FC(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=$C(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Zf(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 xy(t,e){var n=e.checked;return tt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function cx(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Bi(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 BC(t,e){e=e.checked,e!=null&&U0(t,"checked",e,!1)}function ky(t,e){BC(t,e);var n=Bi(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")?Sy(t,e.type,n):e.hasOwnProperty("defaultValue")&&Sy(t,e.type,Bi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function ux(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 Sy(t,e,n){(e!=="number"||Zf(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Ec=Array.isArray;function Za(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=""+Bi(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 Ey(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(z(91));return tt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function dx(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(z(92));if(Ec(n)){if(1<n.length)throw Error(z(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Bi(n)}}function zC(t,e){var n=Bi(e.value),r=Bi(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 fx(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function UC(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 Cy(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?UC(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Md,VC=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(Md=Md||document.createElement("div"),Md.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Md.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function du(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Lc={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},Gj=["Webkit","ms","Moz","O"];Object.keys(Lc).forEach(function(t){Gj.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Lc[e]=Lc[t]})});function HC(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Lc.hasOwnProperty(t)&&Lc[t]?(""+e).trim():e+"px"}function WC(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=HC(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var Jj=tt({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 _y(t,e){if(e){if(Jj[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(z(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(z(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(z(61))}if(e.style!=null&&typeof e.style!="object")throw Error(z(62))}}function Ty(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 Ay=null;function q0(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ny=null,Ya=null,Xa=null;function hx(t){if(t=cd(t)){if(typeof Ny!="function")throw Error(z(280));var e=t.stateNode;e&&(e=Fp(e),Ny(t.stateNode,t.type,e))}}function qC(t){Ya?Xa?Xa.push(t):Xa=[t]:Ya=t}function KC(){if(Ya){var t=Ya,e=Xa;if(Xa=Ya=null,hx(t),e)for(t=0;t<e.length;t++)hx(e[t])}}function GC(t,e){return t(e)}function JC(){}var Vm=!1;function QC(t,e,n){if(Vm)return t(e,n);Vm=!0;try{return GC(t,e,n)}finally{Vm=!1,(Ya!==null||Xa!==null)&&(JC(),KC())}}function fu(t,e){var n=t.stateNode;if(n===null)return null;var r=Fp(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(z(231,e,typeof n));return n}var Oy=!1;if(As)try{var oc={};Object.defineProperty(oc,"passive",{get:function(){Oy=!0}}),window.addEventListener("test",oc,oc),window.removeEventListener("test",oc,oc)}catch{Oy=!1}function Qj(t,e,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var Dc=!1,Yf=null,Xf=!1,Ry=null,Zj={onError:function(t){Dc=!0,Yf=t}};function Yj(t,e,n,r,s,i,o,a,l){Dc=!1,Yf=null,Qj.apply(Zj,arguments)}function Xj(t,e,n,r,s,i,o,a,l){if(Yj.apply(this,arguments),Dc){if(Dc){var c=Yf;Dc=!1,Yf=null}else throw Error(z(198));Xf||(Xf=!0,Ry=c)}}function ra(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 ZC(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 px(t){if(ra(t)!==t)throw Error(z(188))}function eM(t){var e=t.alternate;if(!e){if(e=ra(t),e===null)throw Error(z(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 px(s),t;if(i===r)return px(s),e;i=i.sibling}throw Error(z(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(z(189))}}if(n.alternate!==r)throw Error(z(190))}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?t:e}function YC(t){return t=eM(t),t!==null?XC(t):null}function XC(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=XC(t);if(e!==null)return e;t=t.sibling}return null}var e_=jn.unstable_scheduleCallback,mx=jn.unstable_cancelCallback,tM=jn.unstable_shouldYield,nM=jn.unstable_requestPaint,dt=jn.unstable_now,rM=jn.unstable_getCurrentPriorityLevel,K0=jn.unstable_ImmediatePriority,t_=jn.unstable_UserBlockingPriority,eh=jn.unstable_NormalPriority,sM=jn.unstable_LowPriority,n_=jn.unstable_IdlePriority,Mp=null,Kr=null;function iM(t){if(Kr&&typeof Kr.onCommitFiberRoot=="function")try{Kr.onCommitFiberRoot(Mp,t,void 0,(t.current.flags&128)===128)}catch{}}var Er=Math.clz32?Math.clz32:lM,oM=Math.log,aM=Math.LN2;function lM(t){return t>>>=0,t===0?32:31-(oM(t)/aM|0)|0}var Ld=64,Dd=4194304;function Cc(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 th(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=Cc(a):(i&=o,i!==0&&(r=Cc(i)))}else o=n&~s,o!==0?r=Cc(o):i!==0&&(r=Cc(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-Er(e),s=1<<n,r|=t[n],e&=~s;return r}function cM(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 uM(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Er(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=cM(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function Py(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function r_(){var t=Ld;return Ld<<=1,!(Ld&4194240)&&(Ld=64),t}function Hm(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ad(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Er(e),t[e]=n}function dM(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-Er(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function G0(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Er(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var De=0;function s_(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var i_,J0,o_,a_,l_,Iy=!1,$d=[],Si=null,Ei=null,Ci=null,hu=new Map,pu=new Map,ri=[],fM="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 gx(t,e){switch(t){case"focusin":case"focusout":Si=null;break;case"dragenter":case"dragleave":Ei=null;break;case"mouseover":case"mouseout":Ci=null;break;case"pointerover":case"pointerout":hu.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":pu.delete(e.pointerId)}}function ac(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=cd(e),e!==null&&J0(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function hM(t,e,n,r,s){switch(e){case"focusin":return Si=ac(Si,t,e,n,r,s),!0;case"dragenter":return Ei=ac(Ei,t,e,n,r,s),!0;case"mouseover":return Ci=ac(Ci,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return hu.set(i,ac(hu.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,pu.set(i,ac(pu.get(i)||null,t,e,n,r,s)),!0}return!1}function c_(t){var e=mo(t.target);if(e!==null){var n=ra(e);if(n!==null){if(e=n.tag,e===13){if(e=ZC(n),e!==null){t.blockedOn=e,l_(t.priority,function(){o_(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 _f(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=jy(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Ay=r,n.target.dispatchEvent(r),Ay=null}else return e=cd(n),e!==null&&J0(e),t.blockedOn=n,!1;e.shift()}return!0}function yx(t,e,n){_f(t)&&n.delete(e)}function pM(){Iy=!1,Si!==null&&_f(Si)&&(Si=null),Ei!==null&&_f(Ei)&&(Ei=null),Ci!==null&&_f(Ci)&&(Ci=null),hu.forEach(yx),pu.forEach(yx)}function lc(t,e){t.blockedOn===e&&(t.blockedOn=null,Iy||(Iy=!0,jn.unstable_scheduleCallback(jn.unstable_NormalPriority,pM)))}function mu(t){function e(s){return lc(s,t)}if(0<$d.length){lc($d[0],t);for(var n=1;n<$d.length;n++){var r=$d[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Si!==null&&lc(Si,t),Ei!==null&&lc(Ei,t),Ci!==null&&lc(Ci,t),hu.forEach(e),pu.forEach(e),n=0;n<ri.length;n++)r=ri[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<ri.length&&(n=ri[0],n.blockedOn===null);)c_(n),n.blockedOn===null&&ri.shift()}var el=Ls.ReactCurrentBatchConfig,nh=!0;function mM(t,e,n,r){var s=De,i=el.transition;el.transition=null;try{De=1,Q0(t,e,n,r)}finally{De=s,el.transition=i}}function gM(t,e,n,r){var s=De,i=el.transition;el.transition=null;try{De=4,Q0(t,e,n,r)}finally{De=s,el.transition=i}}function Q0(t,e,n,r){if(nh){var s=jy(t,e,n,r);if(s===null)eg(t,e,r,rh,n),gx(t,r);else if(hM(s,t,e,n,r))r.stopPropagation();else if(gx(t,r),e&4&&-1<fM.indexOf(t)){for(;s!==null;){var i=cd(s);if(i!==null&&i_(i),i=jy(t,e,n,r),i===null&&eg(t,e,r,rh,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else eg(t,e,r,null,n)}}var rh=null;function jy(t,e,n,r){if(rh=null,t=q0(r),t=mo(t),t!==null)if(e=ra(t),e===null)t=null;else if(n=e.tag,n===13){if(t=ZC(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 rh=t,null}
vendor: 10,028 bytes, line 37
37function u_(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(rM()){case K0:return 1;case t_:return 4;case eh:case sM:return 16;case n_:return 536870912;default:return 16}default:return 16}}var gi=null,Z0=null,Tf=null;function d_(){if(Tf)return Tf;var t,e=Z0,n=e.length,r,s="value"in gi?gi.value:gi.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 Tf=s.slice(t,1<r?1-r:void 0)}function Af(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 Fd(){return!0}function vx(){return!1}function Dn(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)?Fd:vx,this.isPropagationStopped=vx,this}return tt(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=Fd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Fd)},persist:function(){},isPersistent:Fd}),e}var Kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Y0=Dn(Kl),ld=tt({},Kl,{view:0,detail:0}),yM=Dn(ld),Wm,qm,cc,Lp=tt({},ld,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:X0,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!==cc&&(cc&&t.type==="mousemove"?(Wm=t.screenX-cc.screenX,qm=t.screenY-cc.screenY):qm=Wm=0,cc=t),Wm)},movementY:function(t){return"movementY"in t?t.movementY:qm}}),bx=Dn(Lp),vM=tt({},Lp,{dataTransfer:0}),bM=Dn(vM),wM=tt({},ld,{relatedTarget:0}),Km=Dn(wM),xM=tt({},Kl,{animationName:0,elapsedTime:0,pseudoElement:0}),kM=Dn(xM),SM=tt({},Kl,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),EM=Dn(SM),CM=tt({},Kl,{data:0}),wx=Dn(CM),_M={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TM={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"},AM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NM(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=AM[t])?!!e[t]:!1}function X0(){return NM}var OM=tt({},ld,{key:function(t){if(t.key){var e=_M[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Af(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?TM[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:X0,charCode:function(t){return t.type==="keypress"?Af(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Af(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),RM=Dn(OM),PM=tt({},Lp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xx=Dn(PM),IM=tt({},ld,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:X0}),jM=Dn(IM),MM=tt({},Kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),LM=Dn(MM),DM=tt({},Lp,{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}),$M=Dn(DM),FM=[9,13,27,32],eb=As&&"CompositionEvent"in window,$c=null;As&&"documentMode"in document&&($c=document.documentMode);var BM=As&&"TextEvent"in window&&!$c,f_=As&&(!eb||$c&&8<$c&&11>=$c),kx=" ",Sx=!1;function h_(t,e){switch(t){case"keyup":return FM.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function p_(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $a=!1;function zM(t,e){switch(t){case"compositionend":return p_(e);case"keypress":return e.which!==32?null:(Sx=!0,kx);case"textInput":return t=e.data,t===kx&&Sx?null:t;default:return null}}function UM(t,e){if($a)return t==="compositionend"||!eb&&h_(t,e)?(t=d_(),Tf=Z0=gi=null,$a=!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 f_&&e.locale!=="ko"?null:e.data;default:return null}}var VM={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 Ex(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!VM[t.type]:e==="textarea"}function m_(t,e,n,r){qC(r),e=sh(e,"onChange"),0<e.length&&(n=new Y0("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Fc=null,gu=null;function HM(t){__(t,0)}function Dp(t){var e=za(t);if(FC(e))return t}function WM(t,e){if(t==="change")return e}var g_=!1;if(As){var Gm;if(As){var Jm="oninput"in document;if(!Jm){var Cx=document.createElement("div");Cx.setAttribute("oninput","return;"),Jm=typeof Cx.oninput=="function"}Gm=Jm}else Gm=!1;g_=Gm&&(!document.documentMode||9<document.documentMode)}function _x(){Fc&&(Fc.detachEvent("onpropertychange",y_),gu=Fc=null)}function y_(t){if(t.propertyName==="value"&&Dp(gu)){var e=[];m_(e,gu,t,q0(t)),QC(HM,e)}}function qM(t,e,n){t==="focusin"?(_x(),Fc=e,gu=n,Fc.attachEvent("onpropertychange",y_)):t==="focusout"&&_x()}function KM(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Dp(gu)}function GM(t,e){if(t==="click")return Dp(e)}function JM(t,e){if(t==="input"||t==="change")return Dp(e)}function QM(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var _r=typeof Object.is=="function"?Object.is:QM;function yu(t,e){if(_r(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(!gy.call(e,s)||!_r(t[s],e[s]))return!1}return!0}function Tx(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ax(t,e){var n=Tx(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=Tx(n)}}function v_(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?v_(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function b_(){for(var t=window,e=Zf();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Zf(t.document)}return e}function tb(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 ZM(t){var e=b_(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&v_(n.ownerDocument.documentElement,n)){if(r!==null&&tb(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=Ax(n,i);var o=Ax(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 YM=As&&"documentMode"in document&&11>
vendor: 2,276 bytes, line 37
37=document.documentMode,Fa=null,My=null,Bc=null,Ly=!1;function Nx(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ly||Fa==null||Fa!==Zf(r)||(r=Fa,"selectionStart"in r&&tb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bc&&yu(Bc,r)||(Bc=r,r=sh(My,"onSelect"),0<r.length&&(e=new Y0("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Fa)))}function Bd(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Ba={animationend:Bd("Animation","AnimationEnd"),animationiteration:Bd("Animation","AnimationIteration"),animationstart:Bd("Animation","AnimationStart"),transitionend:Bd("Transition","TransitionEnd")},Qm={},w_={};As&&(w_=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);function $p(t){if(Qm[t])return Qm[t];if(!Ba[t])return t;var e=Ba[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in w_)return Qm[t]=e[n];return t}var x_=$p("animationend"),k_=$p("animationiteration"),S_=$p("animationstart"),E_=$p("transitionend"),C_=new Map,Ox="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 Gi(t,e){C_.set(t,e),na(e,[t])}for(var Zm=0;Zm<Ox.length;Zm++){var Ym=Ox[Zm],XM=Ym.toLowerCase(),e2=Ym[0].toUpperCase()+Ym.slice(1);Gi(XM,"on"+e2)}Gi(x_,"onAnimationEnd");Gi(k_,"onAnimationIteration");Gi(S_,"onAnimationStart");Gi("dblclick","onDoubleClick");
vendor: 4,089 bytes, line 37
37Gi("focusin","onFocus");Gi("focusout","onBlur");Gi(E_,"onTransitionEnd");El("onMouseEnter",["mouseout","mouseover"]);El("onMouseLeave",["mouseout","mouseover"]);El("onPointerEnter",["pointerout","pointerover"]);El("onPointerLeave",["pointerout","pointerover"]);na("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));na("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));na("onBeforeInput",["compositionend","keypress","textInput","paste"]);na("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));na("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));na("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _c="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(" "),t2=new Set("cancel close invalid load scroll toggle".split(" ").concat(_c));function Rx(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,Xj(r,e,void 0,t),t.currentTarget=null}function __(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],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;Rx(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;Rx(s,a,c),i=l}}}if(Xf)throw t=Ry,Xf=!1,Ry=null,t}function qe(t,e){var n=e[zy];n===void 0&&(n=e[zy]=new Set);var r=t+"__bubble";n.has(r)||(T_(e,t,2,!1),n.add(r))}function Xm(t,e,n){var r=0;e&&(r|=4),T_(n,t,r,e)}var zd="_reactListening"+Math.random().toString(36).slice(2);function vu(t){if(!t[zd]){t[zd]=!0,jC.forEach(function(n){n!=="selectionchange"&&(t2.has(n)||Xm(n,!1,t),Xm(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[zd]||(e[zd]=!0,Xm("selectionchange",!1,e))}}function T_(t,e,n,r){switch(u_(e)){case 1:var s=mM;break;case 4:s=gM;break;default:s=Q0}n=s.bind(null,e,n,t),s=void 0,!Oy||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 eg(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;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=mo(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}QC(function(){var c=i,u=q0(n),d=[];e:{var f=C_.get(t);if(f!==void 0){var h=Y0,p=t;switch(t){case"keypress":if(Af(n)===0)break e;case"keydown":case"keyup":h=RM;break;case"focusin":p="focus",h=Km;break;case"focusout":p="blur",h=Km;break;case"beforeblur":case"afterblur":h=Km;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":h=bx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=bM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=jM;break;case x_:case k_:case S_:h=kM;break;case E_:h=LM;break;case"scroll":h=yM;break;case"wheel":h=$M;break;case"copy":case"cut":case"paste":h=EM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=xx}var g=(e&4)!==0,y=!g&&t==="scroll",v=g?f!==null?f+"Capture":null:f;g=[];for(var b=c,w;b!==null;){w=b;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,v!==null&&(k=fu(b,v),k!=null&&g.push(bu(b,k,w)))),y)break;b=b.return}
vendor: 1,036 bytes, line 37
370<g.length&&(f=new h(f,p,null,n,u),d.push({event:f,listeners:g}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&n!==Ay&&(p=n.relatedTarget||n.fromElement)&&(mo(p)||p[Ns]))break e;if((h||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=c,p=p?mo(p):null,p!==null&&(y=ra(p),p!==y||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=c),h!==p)){if(g=bx,k="onMouseLeave",v="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(g=xx,k="onPointerLeave",v="onPointerEnter",b="pointer"),y=h==null?f:za(h),w=p==null?f:za(p),f=new g(k,b+"leave",h,n,u),f.target=y,f.relatedTarget=w,k=null,mo(u)===c&&(g=new g(v,b+"enter",p,n,u),g.target=w,g.relatedTarget=y,k=g),y=k,h&&p)t:{for(g=h,v=p,b=0,w=g;w;w=ma(w))b++;for(w=0,k=v;k;k=ma(k))w++;for(;0<b-w;)g=ma(g),b--;for(;0<w-b;)v=ma(v),w--;for(;b--;){if(g===v||v!==null&&g===v.alternate)break t;g=ma(g),v=ma(v)}g=null}else g=null;h!==null&&Px(d,f,h,g,!1),p!==null&&y!==null&&Px(d,y,p,g,!0)}}
vendor: 4,213 bytes, lines 37-38
37e:{if(f=c?za(c):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=WM;else if(Ex(f))if(g_)S=JM;else{S=KM;var C=qM}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=GM);if(S&&(S=S(t,c))){m_(d,S,n,u);break e}C&&C(t,f,c),t==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Sy(f,"number",f.value)}switch(C=c?za(c):window,t){case"focusin":(Ex(C)||C.contentEditable==="true")&&(Fa=C,My=c,Bc=null);break;case"focusout":Bc=My=Fa=null;break;case"mousedown":Ly=!0;break;case"contextmenu":case"mouseup":case"dragend":Ly=!1,Nx(d,n,u);break;case"selectionchange":if(YM)break;case"keydown":case"keyup":Nx(d,n,u)}var E;if(eb)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else $a?h_(t,n)&&(T="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(f_&&n.locale!=="ko"&&($a||T!=="onCompositionStart"?T==="onCompositionEnd"&&$a&&(E=d_()):(gi=u,Z0="value"in gi?gi.value:gi.textContent,$a=!0)),C=sh(c,T),0<C.length&&(T=new wx(T,t,null,n,u),d.push({event:T,listeners:C}),E?T.data=E:(E=p_(n),E!==null&&(T.data=E)))),(E=BM?zM(t,n):UM(t,n))&&(c=sh(c,"onBeforeInput"),0<c.length&&(u=new wx("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=E))}__(d,e)})}function bu(t,e,n){return{instance:t,listener:e,currentTarget:n}}function sh(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=fu(t,n),i!=null&&r.unshift(bu(t,i,s)),i=fu(t,e),i!=null&&r.push(bu(t,i,s))),t=t.return}return r}function ma(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Px(t,e,n,r,s){for(var i=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=fu(n,i),l!=null&&o.unshift(bu(n,l,a))):s||(l=fu(n,i),l!=null&&o.push(bu(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var n2=/\r\n?/g,r2=/\u0000|\uFFFD/g;function Ix(t){return(typeof t=="string"?t:""+t).replace(n2,`
38`).replace(r2,"")}function Ud(t,e,n){if(e=Ix(e),Ix(t)!==e&&n)throw Error(z(425))}function ih(){}var Dy=null,$y=null;function Fy(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 By=typeof setTimeout=="function"?setTimeout:void 0,s2=typeof clearTimeout=="function"?clearTimeout:void 0,jx=typeof Promise=="function"?Promise:void 0,i2=typeof queueMicrotask=="function"?queueMicrotask:typeof jx<"u"?function(t){return jx.resolve(null).then(t).catch(o2)}:By;function o2(t){setTimeout(function(){throw t})}function tg(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),mu(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);mu(e)}function _i(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 Mx(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 Gl=Math.random().toString(36).slice(2),Ur="__reactFiber$"+Gl,wu="__reactProps$"+Gl,Ns="__reactContainer$"+Gl,zy="__reactEvents$"+Gl,a2="__reactListeners$"+Gl,l2="__reactHandles$"+Gl;function mo(t){var e=t[Ur];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Ns]||n[Ur]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Mx(t);t!==null;){if(n=t[Ur])return n;t=Mx(t)}return e}t=n,n=t.parentNode}return null}function cd(t){return t=t[Ur]||t[Ns],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function za(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(z(33))}function Fp(t){return t[wu]||null}var Uy=[],Ua=-1;function Ji(t){return{current:t}}function Je(t){0>Ua||(t.current=Uy[Ua],Uy[Ua]=null,Ua--)}function He(t,e){Ua++,Uy[Ua]=t.current,t.current=e}var zi={}
vendor: 14,557 bytes, line 38
38,Yt=Ji(zi),xn=Ji(!1),Bo=zi;function Cl(t,e){var n=t.type.contextTypes;if(!n)return zi;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 kn(t){return t=t.childContextTypes,t!=null}function oh(){Je(xn),Je(Yt)}function Lx(t,e,n){if(Yt.current!==zi)throw Error(z(168));He(Yt,e),He(xn,n)}function A_(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(z(108,qj(t)||"Unknown",s));return tt({},n,r)}function ah(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||zi,Bo=Yt.current,He(Yt,t),He(xn,xn.current),!0}function Dx(t,e,n){var r=t.stateNode;if(!r)throw Error(z(169));n?(t=A_(t,e,Bo),r.__reactInternalMemoizedMergedChildContext=t,Je(xn),Je(Yt),He(Yt,t)):Je(xn),He(xn,n)}var ws=null,Bp=!1,ng=!1;function N_(t){ws===null?ws=[t]:ws.push(t)}function c2(t){Bp=!0,N_(t)}function Qi(){if(!ng&&ws!==null){ng=!0;var t=0,e=De;try{var n=ws;for(De=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}ws=null,Bp=!1}catch(s){throw ws!==null&&(ws=ws.slice(t+1)),e_(K0,Qi),s}finally{De=e,ng=!1}}return null}var Va=[],Ha=0,lh=null,ch=0,Wn=[],qn=0,zo=null,Ss=1,Es="";function lo(t,e){Va[Ha++]=ch,Va[Ha++]=lh,lh=t,ch=e}function O_(t,e,n){Wn[qn++]=Ss,Wn[qn++]=Es,Wn[qn++]=zo,zo=t;var r=Ss;t=Es;var s=32-Er(r)-1;r&=~(1<<s),n+=1;var i=32-Er(e)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Ss=1<<32-Er(e)+s|n<<s|r,Es=i+t}else Ss=1<<i|n<<s|r,Es=t}function nb(t){t.return!==null&&(lo(t,1),O_(t,1,0))}function rb(t){for(;t===lh;)lh=Va[--Ha],Va[Ha]=null,ch=Va[--Ha],Va[Ha]=null;for(;t===zo;)zo=Wn[--qn],Wn[qn]=null,Es=Wn[--qn],Wn[qn]=null,Ss=Wn[--qn],Wn[qn]=null}var Pn=null,Rn=null,Ze=!1,vr=null;function R_(t,e){var n=Gn(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 $x(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,Pn=t,Rn=_i(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Pn=t,Rn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=zo!==null?{id:Ss,overflow:Es}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Gn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Pn=t,Rn=null,!0):!1;default:return!1}}function Vy(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Hy(t){if(Ze){var e=Rn;if(e){var n=e;if(!$x(t,e)){if(Vy(t))throw Error(z(418));e=_i(n.nextSibling);var r=Pn;e&&$x(t,e)?R_(r,n):(t.flags=t.flags&-4097|2,Ze=!1,Pn=t)}}else{if(Vy(t))throw Error(z(418));t.flags=t.flags&-4097|2,Ze=!1,Pn=t}}}function Fx(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Pn=t}function Vd(t){if(t!==Pn)return!1;if(!Ze)return Fx(t),Ze=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Fy(t.type,t.memoizedProps)),e&&(e=Rn)){if(Vy(t))throw P_(),Error(z(418));for(;e;)R_(t,e),e=_i(e.nextSibling)}if(Fx(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(z(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Rn=_i(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Rn=null}}else Rn=Pn?_i(t.stateNode.nextSibling):null;return!0}function P_(){for(var t=Rn;t;)t=_i(t.nextSibling)}function _l(){Rn=Pn=null,Ze=!1}function sb(t){vr===null?vr=[t]:vr.push(t)}var u2=Ls.ReactCurrentBatchConfig;function uc(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(z(309));var r=n.stateNode}if(!r)throw Error(z(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(z(284));if(!n._owner)throw Error(z(290,t))}return t}function Hd(t,e){throw t=Object.prototype.toString.call(e),Error(z(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Bx(t){var e=t._init;return e(t._payload)}function I_(t){function e(v,b){if(t){var w=v.deletions;w===null?(v.deletions=[b],v.flags|=16):w.push(b)}}function n(v,b){if(!t)return null;for(;b!==null;)e(v,b),b=b.sibling;return null}function r(v,b){for(v=new Map;b!==null;)b.key!==null?v.set(b.key,b):v.set(b.index,b),b=b.sibling;return v}function s(v,b){return v=Oi(v,b),v.index=0,v.sibling=null,v}function i(v,b,w){return v.index=w,t?(w=v.alternate,w!==null?(w=w.index,w<b?(v.flags|=2,b):w):(v.flags|=2,b)):(v.flags|=1048576,b)}function o(v){return t&&v.alternate===null&&(v.flags|=2),v}function a(v,b,w,k){return b===null||b.tag!==6?(b=cg(w,v.mode,k),b.return=v,b):(b=s(b,w),b.return=v,b)}function l(v,b,w,k){var S=w.type;return S===Da?u(v,b,w.props.children,k,w.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Qs&&Bx(S)===b.type)?(k=s(b,w.props),k.ref=uc(v,b,w),k.return=v,k):(k=Mf(w.type,w.key,w.props,null,v.mode,k),k.ref=uc(v,b,w),k.return=v,k)}function c(v,b,w,k){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=ug(w,v.mode,k),b.return=v,b):(b=s(b,w.children||[]),b.return=v,b)}function u(v,b,w,k,S){return b===null||b.tag!==7?(b=jo(w,v.mode,k,S),b.return=v,b):(b=s(b,w),b.return=v,b)}function d(v,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=cg(""+b,v.mode,w),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Id:return w=Mf(b.type,b.key,b.props,null,v.mode,w),w.ref=uc(v,null,b),w.return=v,w;case La:return b=ug(b,v.mode,w),b.return=v,b;case Qs:var k=b._init;return d(v,k(b._payload),w)}if(Ec(b)||ic(b))return b=jo(b,v.mode,w,null),b.return=v,b;Hd(v,b)}return null}function f(v,b,w,k){var S=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:a(v,b,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Id:return w.key===S?l(v,b,w,k):null;case La:return w.key===S?c(v,b,w,k):null;case Qs:return S=w._init,f(v,b,S(w._payload),k)}if(Ec(w)||ic(w))return S!==null?null:u(v,b,w,k,null);Hd(v,w)}return null}function h(v,b,w,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return v=v.get(w)||null,a(b,v,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Id:return v=v.get(k.key===null?w:k.key)||null,l(b,v,k,S);case La:return v=v.get(k.key===null?w:k.key)||null,c(b,v,k,S);case Qs:var C=k._init;return h(v,b,w,C(k._payload),S)}if(Ec(k)||ic(k))return v=v.get(w)||null,u(b,v,k,S,null);Hd(b,k)}return null}function p(v,b,w,k){for(var S=null,C=null,E=b,T=b=0,N=null;E!==null&&T<w.length;T++){E.index>T?(N=E,E=null):N=E.sibling;var P=f(v,E,w[T],k);if(P===null){E===null&&(E=N);break}t&&E&&P.alternate===null&&e(v,E),b=i(P,b,T),C===null?S=P:C.sibling=P,C=P,E=N}if(T===w.length)return n(v,E),Ze&&lo(v,T),S;if(E===null){for(;T<w.length;T++)E=d(v,w[T],k),E!==null&&(b=i(E,b,T),C===null?S=E:C.sibling=E,C=E);return Ze&&lo(v,T),S}for(E=r(v,E);T<w.length;T++)N=h(E,v,T,w[T],k),N!==null&&(t&&N.alternate!==null&&E.delete(N.key===null?T:N.key),b=i(N,b,T),C===null?S=N:C.sibling=N,C=N);return t&&E.forEach(function(q){return e(v,q)}),Ze&&lo(v,T),S}function g(v,b,w,k){var S=ic(w);if(typeof S!="function")throw Error(z(150));if(w=S.call(w),w==null)throw Error(z(151));for(var C=S=null,E=b,T=b=0,N=null,P=w.next();E!==null&&!P.done;T++,P=w.next()){E.index>T?(N=E,E=null):N=E.sibling;var q=f(v,E,P.value,k);if(q===null){E===null&&(E=N);break}t&&E&&q.alternate===null&&e(v,E),b=i(q,b,T),C===null?S=q:C.sibling=q,C=q,E=N}if(P.done)return n(v,E),Ze&&lo(v,T),S;if(E===null){for(;!P.done;T++,P=w.next())P=d(v,P.value,k),P!==null&&(b=i(P,b,T),C===null?S=P:C.sibling=P,C=P);return Ze&&lo(v,T),S}for(E=r(v,E);!P.done;T++,P=w.next())P=h(E,v,T,P.value,k),P!==null&&(t&&P.alternate!==null&&E.delete(P.key===null?T:P.key),b=i(P,b,T),C===null?S=P:C.sibling=P,C=P);return t&&E.forEach(function(R){return e(v,R)}),Ze&&lo(v,T),S}function y(v,b,w,k){if(typeof w=="object"&&w!==null&&w.type===Da&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Id:e:{for(var S=w.key,C=b;C!==null;){if(C.key===S){if(S=w.type,S===Da){if(C.tag===7){n(v,C.sibling),b=s(C,w.props.children),b.return=v,v=b;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Qs&&Bx(S)===C.type){n(v,C.sibling),b=s(C,w.props),b.ref=uc(v,C,w),b.return=v,v=b;break e}n(v,C);break}else e(v,C);C=C.sibling}w.type===Da?(b=jo(w.props.children,v.mode,k,w.key),b.return=v,v=b):(k=Mf(w.type,w.key,w.props,null,v.mode,k),k.ref=uc(v,b,w),k.return=v,v=k)}return o(v);case La:e:{for(C=w.key;b!==null;){if(b.key===C)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(v,b.sibling),b=s(b,w.children||[]),b.return=v,v=b;break e}else{n(v,b);break}else e(v,b);b=b.sibling}b=ug(w,v.mode,k),b.return=v,v=b}return o(v);case Qs:return C=w._init,y(v,b,C(w._payload),k)}if(Ec(w))return p(v,b,w,k);if(ic(w))return g(v,b,w,k);Hd(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(v,b.sibling),b=s(b,w),b.return=v,v=b):(n(v,b),b=cg(w,v.mode,k),b.return=v,v=b),o(v)):n(v,b)}return y}var Tl=I_(!0),j_=I_(!1),uh=Ji(null),dh=null,Wa=null,ib=null;function ob(){ib=Wa=dh=null}function ab(t){var e=uh.current;Je(uh),t._currentValue=e}function Wy(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 tl(t,e){dh=t,ib=Wa=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(wn=!0),t.firstContext=null)}function tr(t){var e=t._currentValue;if(ib!==t)if(t={context:t,memoizedValue:e,next:null},Wa===null){if(dh===null)throw Error(z(308));Wa=t,dh.dependencies={lanes:0,firstContext:t}}else Wa=Wa.next=t;return e}var go=null;function lb(t){go===null?go=[t]:go.push(t)}function M_(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,lb(e)):(n.next=s.next,s.next=n),e.interleaved=n,Os(t,r)}function Os(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 Zs=!1;function cb(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function L_(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 _s(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ti(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Oe&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,Os(t,n)}return s=r.interleaved,s===null?(e.next=e,lb(r)):(e.next=s.next,s.next=e),r.interleaved=e,Os(t,n)}function Nf(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,G0(t,n)}}function zx(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 fh(t,e,n,r){var s=t.updateQueue;Zs=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,u=c=l=null,a=i;do{var f=a.lane,h=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,g=a;switch(f=e,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=tt({},d,f);break e;case 2:Zs=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=d):u=u.next=h,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(u===null&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,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);Vo|=o,t.lanes=o,t.memoizedState=d}}function Ux(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(z(191,s));s.call(r)}}}var ud={},Gr=Ji(ud),xu=Ji(ud),ku=Ji(ud);function yo(t){if(t===ud)throw Error(z(174));return t}function ub(t,e){switch(He(ku,e),He(xu,t),He(Gr,ud),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Cy(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Cy(e,t)}Je(Gr),He(Gr,e)}function Al(){Je(Gr),Je(xu),Je(ku)}function D_(t){yo(ku.current);var e=yo(Gr.current),n=Cy(e,t.type);e!==n&&(He(xu,t),He(Gr,n))}function db(t){xu.current===t&&(Je(Gr),Je(xu))}var Ye=Ji(0);function hh(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 rg=[];function fb(){for(var t=0;t<rg.length;t++)rg[t]._workInProgressVersionPrimary=null;rg.length=0}
vendor: 7,008 bytes, line 38
38var Of=Ls.ReactCurrentDispatcher,sg=Ls.ReactCurrentBatchConfig,Uo=0,et=null,St=null,Nt=null,ph=!1,zc=!1,Su=0,d2=0;function Kt(){throw Error(z(321))}function hb(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!_r(t[n],e[n]))return!1;return!0}function pb(t,e,n,r,s,i){if(Uo=i,et=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Of.current=t===null||t.memoizedState===null?m2:g2,t=n(r,s),zc){i=0;do{if(zc=!1,Su=0,25<=i)throw Error(z(301));i+=1,Nt=St=null,e.updateQueue=null,Of.current=y2,t=n(r,s)}while(zc)}if(Of.current=mh,e=St!==null&&St.next!==null,Uo=0,Nt=St=et=null,ph=!1,e)throw Error(z(300));return t}function mb(){var t=Su!==0;return Su=0,t}function Mr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?et.memoizedState=Nt=t:Nt=Nt.next=t,Nt}function nr(){if(St===null){var t=et.alternate;t=t!==null?t.memoizedState:null}else t=St.next;var e=Nt===null?et.memoizedState:Nt.next;if(e!==null)Nt=e,St=t;else{if(t===null)throw Error(z(310));St=t,t={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Nt===null?et.memoizedState=Nt=t:Nt=Nt.next=t}return Nt}function Eu(t,e){return typeof e=="function"?e(t):e}function ig(t){var e=nr(),n=e.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=t;var r=St,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,l=null,c=i;do{var u=c.lane;if((Uo&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,et.lanes|=u,Vo|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,_r(r,e.memoizedState)||(wn=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){s=t;do i=s.lane,et.lanes|=i,Vo|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function og(t){var e=nr(),n=e.queue;if(n===null)throw Error(z(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);_r(i,e.memoizedState)||(wn=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function $_(){}function F_(t,e){var n=et,r=nr(),s=e(),i=!_r(r.memoizedState,s);if(i&&(r.memoizedState=s,wn=!0),r=r.queue,gb(U_.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||Nt!==null&&Nt.memoizedState.tag&1){if(n.flags|=2048,Cu(9,z_.bind(null,n,r,s,e),void 0,null),Pt===null)throw Error(z(349));Uo&30||B_(n,e,s)}return s}function B_(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=et.updateQueue,e===null?(e={lastEffect:null,stores:null},et.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function z_(t,e,n,r){e.value=n,e.getSnapshot=r,V_(e)&&H_(t)}function U_(t,e,n){return n(function(){V_(e)&&H_(t)})}function V_(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!_r(t,n)}catch{return!0}}function H_(t){var e=Os(t,1);e!==null&&Cr(e,t,1,-1)}function Vx(t){var e=Mr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eu,lastRenderedState:t},e.queue=t,t=t.dispatch=p2.bind(null,et,t),[e.memoizedState,t]}function Cu(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=et.updateQueue,e===null?(e={lastEffect:null,stores:null},et.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 W_(){return nr().memoizedState}function Rf(t,e,n,r){var s=Mr();et.flags|=t,s.memoizedState=Cu(1|e,n,void 0,r===void 0?null:r)}function zp(t,e,n,r){var s=nr();r=r===void 0?null:r;var i=void 0;if(St!==null){var o=St.memoizedState;if(i=o.destroy,r!==null&&hb(r,o.deps)){s.memoizedState=Cu(e,n,i,r);return}}et.flags|=t,s.memoizedState=Cu(1|e,n,i,r)}function Hx(t,e){return Rf(8390656,8,t,e)}function gb(t,e){return zp(2048,8,t,e)}function q_(t,e){return zp(4,2,t,e)}function K_(t,e){return zp(4,4,t,e)}function G_(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 J_(t,e,n){return n=n!=null?n.concat([t]):null,zp(4,4,G_.bind(null,e,t),n)}function yb(){}function Q_(t,e){var n=nr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&hb(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Z_(t,e){var n=nr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&hb(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function Y_(t,e,n){return Uo&21?(_r(n,e)||(n=r_(),et.lanes|=n,Vo|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,wn=!0),t.memoizedState=n)}function f2(t,e){var n=De;De=n!==0&&4>n?n:4,t(!0);var r=sg.transition;sg.transition={};try{t(!1),e()}finally{De=n,sg.transition=r}}function X_(){return nr().memoizedState}function h2(t,e,n){var r=Ni(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},eT(t))tT(e,n);else if(n=M_(t,e,n,r),n!==null){var s=an();Cr(n,t,r,s),nT(n,e,r)}}function p2(t,e,n){var r=Ni(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(eT(t))tT(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,_r(a,o)){var l=e.interleaved;l===null?(s.next=s,lb(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=M_(t,e,s,r),n!==null&&(s=an(),Cr(n,t,r,s),nT(n,e,r))}}function eT(t){var e=t.alternate;return t===et||e!==null&&e===et}function tT(t,e){zc=ph=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function nT(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,G0(t,n)}}var mh={readContext:tr,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useInsertionEffect:Kt,useLayoutEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useMutableSource:Kt,useSyncExternalStore:Kt,useId:Kt,unstable_isNewReconciler:!1},m2={readContext:tr,useCallback:function(t,e){return Mr().memoizedState=[t,e===void 0?null:e],t},useContext:tr,useEffect:Hx,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Rf(4194308,4,G_.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Rf(4194308,4,t,e)},useInsertionEffect:function(t,e){return Rf(4,2,t,e)},useMemo:function(t,e){var n=Mr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Mr();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=h2.bind(null,et,t),[r.memoizedState,t]}
vendor: 7,431 bytes, lines 38-40
38,useRef:function(t){var e=Mr();return t={current:t},e.memoizedState=t},useState:Vx,useDebugValue:yb,useDeferredValue:function(t){return Mr().memoizedState=t},useTransition:function(){var t=Vx(!1),e=t[0];return t=f2.bind(null,t[1]),Mr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=et,s=Mr();if(Ze){if(n===void 0)throw Error(z(407));n=n()}else{if(n=e(),Pt===null)throw Error(z(349));Uo&30||B_(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,Hx(U_.bind(null,r,i,t),[t]),r.flags|=2048,Cu(9,z_.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Mr(),e=Pt.identifierPrefix;if(Ze){var n=Es,r=Ss;n=(r&~(1<<32-Er(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Su++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=d2++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},g2={readContext:tr,useCallback:Q_,useContext:tr,useEffect:gb,useImperativeHandle:J_,useInsertionEffect:q_,useLayoutEffect:K_,useMemo:Z_,useReducer:ig,useRef:W_,useState:function(){return ig(Eu)},useDebugValue:yb,useDeferredValue:function(t){var e=nr();return Y_(e,St.memoizedState,t)},useTransition:function(){var t=ig(Eu)[0],e=nr().memoizedState;return[t,e]},useMutableSource:$_,useSyncExternalStore:F_,useId:X_,unstable_isNewReconciler:!1},y2={readContext:tr,useCallback:Q_,useContext:tr,useEffect:gb,useImperativeHandle:J_,useInsertionEffect:q_,useLayoutEffect:K_,useMemo:Z_,useReducer:og,useRef:W_,useState:function(){return og(Eu)},useDebugValue:yb,useDeferredValue:function(t){var e=nr();return St===null?e.memoizedState=t:Y_(e,St.memoizedState,t)},useTransition:function(){var t=og(Eu)[0],e=nr().memoizedState;return[t,e]},useMutableSource:$_,useSyncExternalStore:F_,useId:X_,unstable_isNewReconciler:!1};function fr(t,e){if(t&&t.defaultProps){e=tt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function qy(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:tt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Up={isMounted:function(t){return(t=t._reactInternals)?ra(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=an(),s=Ni(t),i=_s(r,s);i.payload=e,n!=null&&(i.callback=n),e=Ti(t,i,s),e!==null&&(Cr(e,t,s,r),Nf(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=an(),s=Ni(t),i=_s(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=Ti(t,i,s),e!==null&&(Cr(e,t,s,r),Nf(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=an(),r=Ni(t),s=_s(n,r);s.tag=2,e!=null&&(s.callback=e),e=Ti(t,s,r),e!==null&&(Cr(e,t,r,n),Nf(e,t,r))}};function Wx(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?!yu(n,r)||!yu(s,i):!0}function rT(t,e,n){var r=!1,s=zi,i=e.contextType;return typeof i=="object"&&i!==null?i=tr(i):(s=kn(e)?Bo:Yt.current,r=e.contextTypes,i=(r=r!=null)?Cl(t,s):zi),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Up,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function qx(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&&Up.enqueueReplaceState(e,e.state,null)}function Ky(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},cb(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=tr(i):(i=kn(e)?Bo:Yt.current,s.context=Cl(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(qy(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&&Up.enqueueReplaceState(s,s.state,null),fh(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function Nl(t,e){try{var n="",r=e;do n+=Wj(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 ag(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Gy(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var v2=typeof WeakMap=="function"?WeakMap:Map;function sT(t,e,n){n=_s(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){yh||(yh=!0,sv=r),Gy(t,e)},n}function iT(t,e,n){n=_s(-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(){Gy(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Gy(t,e),typeof r!="function"&&(Ai===null?Ai=new Set([this]):Ai.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Kx(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new v2;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=P2.bind(null,t,e,n),e.then(t,t))}function Gx(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 Jx(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=_s(-1,1),e.tag=2,Ti(n,e,1))),n.lanes|=1),t)}var b2=Ls.ReactCurrentOwner,wn=!1;function rn(t,e,n,r){e.child=t===null?j_(e,null,n,r):Tl(e,t.child,n,r)}function Qx(t,e,n,r,s){n=n.render;var i=e.ref;return tl(e,s),r=pb(t,e,n,r,i,s),n=mb(),t!==null&&!wn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Rs(t,e,s)):(Ze&&n&&nb(e),e.flags|=1,rn(t,e,r,s),e.child)}function Zx(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!Cb(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,oT(t,e,i,r,s)):(t=Mf(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:yu,n(o,r)&&t.ref===e.ref)return Rs(t,e,s)}return e.flags|=1,t=Oi(i,r),t.ref=e.ref,t.return=e,e.child=t}function oT(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(yu(i,r)&&t.ref===e.ref)if(wn=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(wn=!0);else return e.lanes=t.lanes,Rs(t,e,s)}return Jy(t,e,n,r,s)}function aT(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},He(Ka,_n),_n|=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,He(Ka,_n),_n|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,He(Ka,_n),_n|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,He(Ka,_n),_n|=r;return rn(t,e,s,n),e.child}function lT(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}
vendor: 5,244 bytes, line 40
40function Jy(t,e,n,r,s){var i=kn(n)?Bo:Yt.current;return i=Cl(e,i),tl(e,s),n=pb(t,e,n,r,i,s),r=mb(),t!==null&&!wn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Rs(t,e,s)):(Ze&&r&&nb(e),e.flags|=1,rn(t,e,n,s),e.child)}function Yx(t,e,n,r,s){if(kn(n)){var i=!0;ah(e)}else i=!1;if(tl(e,s),e.stateNode===null)Pf(t,e),rT(e,n,r),Ky(e,n,r,s),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=tr(c):(c=kn(n)?Bo:Yt.current,c=Cl(e,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&qx(e,o,r,c),Zs=!1;var f=e.memoizedState;o.state=f,fh(e,r,o,s),l=e.memoizedState,a!==r||f!==l||xn.current||Zs?(typeof u=="function"&&(qy(e,n,u,r),l=e.memoizedState),(a=Zs||Wx(e,n,a,r,f,l,c))?(d||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=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,L_(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:fr(e.type,a),o.props=c,d=e.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=tr(l):(l=kn(n)?Bo:Yt.current,l=Cl(e,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==l)&&qx(e,o,r,l),Zs=!1,f=e.memoizedState,o.state=f,fh(e,r,o,s);var p=e.memoizedState;a!==d||f!==p||xn.current||Zs?(typeof h=="function"&&(qy(e,n,h,r),p=e.memoizedState),(c=Zs||Wx(e,n,c,r,f,p,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,p,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,p,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),o.props=r,o.state=p,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return Qy(t,e,n,r,i,s)}function Qy(t,e,n,r,s,i){lT(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return s&&Dx(e,n,!1),Rs(t,e,i);r=e.stateNode,b2.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Tl(e,t.child,null,i),e.child=Tl(e,null,a,i)):rn(t,e,a,i),e.memoizedState=r.state,s&&Dx(e,n,!0),e.child}function cT(t){var e=t.stateNode;e.pendingContext?Lx(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Lx(t,e.context,!1),ub(t,e.containerInfo)}function Xx(t,e,n,r,s){return _l(),sb(s),e.flags|=256,rn(t,e,n,r),e.child}var Zy={dehydrated:null,treeContext:null,retryLane:0};function Yy(t){return{baseLanes:t,cachePool:null,transitions:null}}function uT(t,e,n){var r=e.pendingProps,s=Ye.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),He(Ye,s&1),t===null)return Hy(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=Wp(o,r,0,null),t=jo(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Yy(n),e.memoizedState=Zy,t):vb(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return w2(t,e,o,r,a,s,n);if(i){i=r.fallback,o=e.mode,s=t.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Oi(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Oi(a,i):(i=jo(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?Yy(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=Zy,r}return i=t.child,t=i.sibling,r=Oi(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 vb(t,e){return e=Wp({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Wd(t,e,n,r){return r!==null&&sb(r),Tl(e,t.child,null,n),t=vb(e,e.pen
vendor: 7,680 bytes, line 40
40dingProps.children),t.flags|=2,e.memoizedState=null,t}function w2(t,e,n,r,s,i,o){if(n)return e.flags&256?(e.flags&=-257,r=ag(Error(z(422))),Wd(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=Wp({mode:"visible",children:r.children},s,0,null),i=jo(i,s,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&Tl(e,t.child,null,o),e.child.memoizedState=Yy(o),e.memoizedState=Zy,i);if(!(e.mode&1))return Wd(t,e,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(z(419)),r=ag(i,r,void 0),Wd(t,e,o,r)}if(a=(o&t.childLanes)!==0,wn||a){if(r=Pt,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,Os(t,s),Cr(r,t,s,-1))}return Eb(),r=ag(Error(z(421))),Wd(t,e,o,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=I2.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,Rn=_i(s.nextSibling),Pn=e,Ze=!0,vr=null,t!==null&&(Wn[qn++]=Ss,Wn[qn++]=Es,Wn[qn++]=zo,Ss=t.id,Es=t.overflow,zo=e),e=vb(e,r.children),e.flags|=4096,e)}function e1(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Wy(t.return,e,n)}function lg(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 dT(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(rn(t,e,r.children,n),r=Ye.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&&e1(t,n,e);else if(t.tag===19)e1(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(He(Ye,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&&hh(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),lg(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&&hh(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}lg(e,!0,n,null,i);break;case"together":lg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Pf(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Rs(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Vo|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(z(153));if(e.child!==null){for(t=e.child,n=Oi(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Oi(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function x2(t,e,n){switch(e.tag){case 3:cT(e),_l();break;case 5:D_(e);break;case 1:kn(e.type)&&ah(e);break;case 4:ub(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;He(uh,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(He(Ye,Ye.current&1),e.flags|=128,null):n&e.child.childLanes?uT(t,e,n):(He(Ye,Ye.current&1),t=Rs(t,e,n),t!==null?t.sibling:null);He(Ye,Ye.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return dT(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),He(Ye,Ye.current),r)break;return null;case 22:case 23:return e.lanes=0,aT(t,e,n)}return Rs(t,e,n)}var fT,Xy,hT,pT;fT=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}};Xy=function(){};hT=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,yo(Gr.current);var i=null;switch(n){case"input":s=xy(t,s),r=xy(t,r),i=[];break;case"select":s=tt({},s,{value:void 0}),r=tt({},r,{value:void 0}),i=[];break;case"textarea":s=Ey(t,s),r=Ey(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=ih)}_y(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(uu.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(uu.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&qe("scroll",t),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(e.updateQueue=c)&&(e.flags|=4)}};pT=function(t,e,n,r){n!==r&&(e.flags|=4)};function dc(t,e){if(!Ze)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 Gt(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 k2(t,e,n){var r=e.pendingProps;switch(rb(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(e),null;case 1:return kn(e.type)&&oh(),Gt(e),null;case 3:return r=e.stateNode,Al(),Je(xn),Je(Yt),fb(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Vd(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,vr!==null&&(av(vr),vr=null))),Xy(t,e),Gt(e),null;case 5:db(e);var s=yo(ku.current);if(n=e.type,t!==null&&e.stateNode!=null)hT(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(z(166));return Gt(e),null}if(t=yo(Gr.current),Vd(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[Ur]=e,r[wu]=i,t=(e.mode&1)!==0,n){case"dialog":qe("cancel",r),qe("close",r);break;case"iframe":case"object":case"embed":qe("load",r);break;case"video":case"audio":for(s=0;s<_c.length;s++)qe(_c[s],r);break;case"source":qe("error",r);break;case"img":case"image":case"link":qe("error",r),qe("load",r);break;case"details":qe("toggle",r);break;case"input":cx(r,i),qe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},qe("invalid",r);break;case"textarea":dx(r,i),qe("invalid",r)}_y(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];
vendor: 32,503 bytes, line 40
40o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ud(r.textContent,a,t),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ud(r.textContent,a,t),s=["children",""+a]):uu.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&qe("scroll",r)}switch(n){case"input":jd(r),ux(r,i,!0);break;case"textarea":jd(r),fx(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ih)}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=UC(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[Ur]=e,t[wu]=r,fT(t,e,!1,!1),e.stateNode=t;e:{switch(o=Ty(n,r),n){case"dialog":qe("cancel",t),qe("close",t),s=r;break;case"iframe":case"object":case"embed":qe("load",t),s=r;break;case"video":case"audio":for(s=0;s<_c.length;s++)qe(_c[s],t);s=r;break;case"source":qe("error",t),s=r;break;case"img":case"image":case"link":qe("error",t),qe("load",t),s=r;break;case"details":qe("toggle",t),s=r;break;case"input":cx(t,r),s=xy(t,r),qe("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=tt({},r,{value:void 0}),qe("invalid",t);break;case"textarea":dx(t,r),s=Ey(t,r),qe("invalid",t);break;default:s=r}_y(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?WC(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&VC(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&du(t,l):typeof l=="number"&&du(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(uu.hasOwnProperty(i)?l!=null&&i==="onScroll"&&qe("scroll",t):l!=null&&U0(t,i,l,o))}switch(n){case"input":jd(t),ux(t,r,!1);break;case"textarea":jd(t),fx(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Bi(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?Za(t,!!r.multiple,i,!1):r.defaultValue!=null&&Za(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=ih)}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 Gt(e),null;case 6:if(t&&e.stateNode!=null)pT(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(z(166));if(n=yo(ku.current),yo(Gr.current),Vd(e)){if(r=e.stateNode,n=e.memoizedProps,r[Ur]=e,(i=r.nodeValue!==n)&&(t=Pn,t!==null))switch(t.tag){case 3:Ud(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ud(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ur]=e,e.stateNode=r}return Gt(e),null;case 13:if(Je(Ye),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Ze&&Rn!==null&&e.mode&1&&!(e.flags&128))P_(),_l(),e.flags|=98560,i=!1;else if(i=Vd(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(z(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(z(317));i[Ur]=e}else _l(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Gt(e),i=!1}else vr!==null&&(av(vr),vr=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||Ye.current&1?Ct===0&&(Ct=3):Eb())),e.updateQueue!==null&&(e.flags|=4),Gt(e),null);case 4:return Al(),Xy(t,e),t===null&&vu(e.stateNode.containerInfo),Gt(e),null;case 10:return ab(e.type._context),Gt(e),null;case 17:return kn(e.type)&&oh(),Gt(e),null;case 19:if(Je(Ye),i=e.memoizedState,i===null)return Gt(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)dc(i,!1);else{if(Ct!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=hh(t),o!==null){for(e.flags|=128,dc(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 He(Ye,Ye.current&1|2),e.child}t=t.sibling}i.tail!==null&&dt()>Ol&&(e.flags|=128,r=!0,dc(i,!1),e.lanes=4194304)}else{if(!r)if(t=hh(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),dc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ze)return Gt(e),null}else 2*dt()-i.renderingStartTime>Ol&&n!==1073741824&&(e.flags|=128,r=!0,dc(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=dt(),e.sibling=null,n=Ye.current,He(Ye,r?n&1|2:n&1),e):(Gt(e),null);case 22:case 23:return Sb(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?_n&1073741824&&(Gt(e),e.subtreeFlags&6&&(e.flags|=8192)):Gt(e),null;case 24:return null;case 25:return null}throw Error(z(156,e.tag))}function S2(t,e){switch(rb(e),e.tag){case 1:return kn(e.type)&&oh(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Al(),Je(xn),Je(Yt),fb(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return db(e),null;case 13:if(Je(Ye),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(z(340));_l()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Je(Ye),null;case 4:return Al(),null;case 10:return ab(e.type._context),null;case 22:case 23:return Sb(),null;case 24:return null;default:return null}}var qd=!1,Zt=!1,E2=typeof WeakSet=="function"?WeakSet:Set,te=null;function qa(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){lt(t,e,r)}else n.current=null}function ev(t,e,n){try{n()}catch(r){lt(t,e,r)}}var t1=!1;function C2(t,e){if(Dy=nh,t=b_(),tb(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,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var h;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++c===s&&(a=o),f===i&&++u===r&&(l=o),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for($y={focusedElem:t,selectionRange:n},nh=!1,te=e;te!==null;)if(e=te,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,te=t;else for(;te!==null;){e=te;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,y=p.memoizedState,v=e.stateNode,b=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:fr(e.type,g),y);v.__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(z(163))}}catch(k){lt(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,te=t;break}te=e.return}return p=t1,t1=!1,p}function Uc(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&&ev(e,n,i)}s=s.next}while(s!==r)}}function Vp(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 tv(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 mT(t){var e=t.alternate;e!==null&&(t.alternate=null,mT(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ur],delete e[wu],delete e[zy],delete e[a2],delete e[l2])),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 gT(t){return t.tag===5||t.tag===3||t.tag===4}function n1(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gT(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 nv(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=ih));else if(r!==4&&(t=t.child,t!==null))for(nv(t,e,n),t=t.sibling;t!==null;)nv(t,e,n),t=t.sibling}function rv(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(rv(t,e,n),t=t.sibling;t!==null;)rv(t,e,n),t=t.sibling}var $t=null,gr=!1;function Vs(t,e,n){for(n=n.child;n!==null;)yT(t,e,n),n=n.sibling}function yT(t,e,n){if(Kr&&typeof Kr.onCommitFiberUnmount=="function")try{Kr.onCommitFiberUnmount(Mp,n)}catch{}switch(n.tag){case 5:Zt||qa(n,e);case 6:var r=$t,s=gr;$t=null,Vs(t,e,n),$t=r,gr=s,$t!==null&&(gr?(t=$t,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):$t.removeChild(n.stateNode));break;case 18:$t!==null&&(gr?(t=$t,n=n.stateNode,t.nodeType===8?tg(t.parentNode,n):t.nodeType===1&&tg(t,n),mu(t)):tg($t,n.stateNode));break;case 4:r=$t,s=gr,$t=n.stateNode.containerInfo,gr=!0,Vs(t,e,n),$t=r,gr=s;break;case 0:case 11:case 14:case 15:if(!Zt&&(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)&&ev(n,e,o),s=s.next}while(s!==r)}Vs(t,e,n);break;case 1:if(!Zt&&(qa(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){lt(n,e,a)}Vs(t,e,n);break;case 21:Vs(t,e,n);break;case 22:n.mode&1?(Zt=(r=Zt)||n.memoizedState!==null,Vs(t,e,n),Zt=r):Vs(t,e,n);break;default:Vs(t,e,n)}}function r1(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new E2),e.forEach(function(r){var s=j2.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function lr(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:$t=a.stateNode,gr=!1;break e;case 3:$t=a.stateNode.containerInfo,gr=!0;break e;case 4:$t=a.stateNode.containerInfo,gr=!0;break e}a=a.return}if($t===null)throw Error(z(160));yT(i,o,s),$t=null,gr=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){lt(s,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)vT(e,t),e=e.sibling}function vT(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(lr(e,t),jr(t),r&4){try{Uc(3,t,t.return),Vp(3,t)}catch(g){lt(t,t.return,g)}try{Uc(5,t,t.return)}catch(g){lt(t,t.return,g)}}break;case 1:lr(e,t),jr(t),r&512&&n!==null&&qa(n,n.return);break;case 5:if(lr(e,t),jr(t),r&512&&n!==null&&qa(n,n.return),t.flags&32){var s=t.stateNode;try{du(s,"")}catch(g){lt(t,t.return,g)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&BC(s,i),Ty(a,o);var c=Ty(a,i);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?WC(s,d):u==="dangerouslySetInnerHTML"?VC(s,d):u==="children"?du(s,d):U0(s,u,d,c)}switch(a){case"input":ky(s,i);break;case"textarea":zC(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Za(s,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?Za(s,!!i.multiple,i.defaultValue,!0):Za(s,!!i.multiple,i.multiple?[]:"",!1))}s[wu]=i}catch(g){lt(t,t.return,g)}}break;case 6:if(lr(e,t),jr(t),r&4){if(t.stateNode===null)throw Error(z(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(g){lt(t,t.return,g)}}break;case 3:if(lr(e,t),jr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{mu(e.containerInfo)}catch(g){lt(t,t.return,g)}break;case 4:lr(e,t),jr(t);break;case 13:lr(e,t),jr(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(xb=dt())),r&4&&r1(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(Zt=(c=Zt)||u,lr(e,t),Zt=c):lr(e,t),jr(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&t.mode&1)for(te=t,u=t.child;u!==null;){for(d=te=u;te!==null;){switch(f=te,h=f.child,f.tag){case 0:case 11:case 14:case 15:Uc(4,f,f.return);break;case 1:qa(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(g){lt(r,n,g)}}break;case 5:qa(f,f.return);break;case 22:if(f.memoizedState!==null){i1(d);continue}}h!==null?(h.return=f,te=h):i1(d)}u=u.sibling}e:for(u=null,d=t;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=HC("display",o))}catch(g){lt(t,t.return,g)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){lt(t,t.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:lr(e,t),jr(t),r&4&&r1(t);break;case 21:break;default:lr(e,t),jr(t)}}function jr(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(gT(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(du(s,""),r.flags&=-33);var i=n1(t);rv(t,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=n1(t);nv(t,a,o);break;default:throw Error(z(161))}}catch(l){lt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function _2(t,e,n){te=t,bT(t)}function bT(t,e,n){for(var r=(t.mode&1)!==0;te!==null;){var s=te,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||qd;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||Zt;a=qd;var c=Zt;if(qd=o,(Zt=l)&&!c)for(te=s;te!==null;)o=te,l=o.child,o.tag===22&&o.memoizedState!==null?o1(s):l!==null?(l.return=o,te=l):o1(s);for(;i!==null;)te=i,bT(i),i=i.sibling;te=s,qd=a,Zt=c}s1(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,te=i):s1(t)}}function s1(t){for(;te!==null;){var e=te;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Zt||Vp(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Zt)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:fr(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Ux(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}Ux(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&mu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}Zt||e.flags&512&&tv(e)}catch(f){lt(e,e.return,f)}}if(e===t){te=null;break}if(n=e.sibling,n!==null){n.return=e.return,te=n;break}te=e.return}}function i1(t){for(;te!==null;){var e=te;if(e===t){te=null;break}var n=e.sibling;if(n!==null){n.return=e.return,te=n;break}te=e.return}}function o1(t){for(;te!==null;){var e=te;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Vp(4,e)}catch(l){lt(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(l){lt(e,s,l)}}var i=e.return;try{tv(e)}catch(l){lt(e,i,l)}break;case 5:var o=e.return;try{tv(e)}catch(l){lt(e,o,l)}}}catch(l){lt(e,e.return,l)}if(e===t){te=null;break}var a=e.sibling;if(a!==null){a.return=e.return,te=a;break}te=e.return}}var T2=Math.ceil,gh=Ls.ReactCurrentDispatcher,bb=Ls.ReactCurrentOwner,Qn=Ls.ReactCurrentBatchConfig,Oe=0,Pt=null,gt=null,Ht=0,_n=0,Ka=Ji(0),Ct=0,_u=null,Vo=0,Hp=0,wb=0,Vc=null,vn=null,xb=0,Ol=1/0,ys=null,yh=!1,sv=null,Ai=null,Kd=!1,yi=null,vh=0,Hc=0,iv=null,If=-1,jf=0;function an(){return Oe&6?dt():If!==-1?If:If=dt()}function Ni(t){return t.mode&1?Oe&2&&Ht!==0?Ht&-Ht:u2.transition!==null?(jf===0&&(jf=r_()),jf):(t=De,t!==0||(t=window.event,t=t===void 0?16:u_(t.type)),t):1}function Cr(t,e,n,r){if(50<Hc)throw Hc=0,iv=null,Error(z(185));ad(t,n,r),(!(Oe&2)||t!==Pt)&&(t===Pt&&(!(Oe&2)&&(Hp|=n),Ct===4&&si(t,Ht)),Sn(t,r),n===1&&Oe===0&&!(e.mode&1)&&(Ol=dt()+500,Bp&&Qi()))}function Sn(t,e){var n=t.callbackNode;uM(t,e);var r=th(t,t===Pt?Ht:0);if(r===0)n!==null&&mx(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&mx(n),e===1)t.tag===0?c2(a1.bind(null,t)):N_(a1.bind(null,t)),i2(function(){!(Oe&6)&&Qi()}),n=null;else{switch(s_(r)){case 1:n=K0;break;case 4:n=t_;break;case 16:n=eh;break;case 536870912:n=n_;break;default:n=eh}n=TT(n,wT.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function wT(t,e){if(If=-1,jf=0,Oe&6)throw Error(z(327));var n=t.callbackNode;if(nl()&&t.callbackNode!==n)return null;var r=th(t,t===Pt?Ht:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=bh(t,r);else{e=r;var s=Oe;Oe|=2;var i=kT();(Pt!==t||Ht!==e)&&(ys=null,Ol=dt()+500,Io(t,e));do try{O2();break}catch(a){xT(t,a)}while(!0);ob(),gh.current=i,Oe=s,gt!==null?e=0:(Pt=null,Ht=0,e=Ct)}if(e!==0){if(e===2&&(s=Py(t),s!==0&&(r=s,e=ov(t,s))),e===1)throw n=_u,Io(t,0),si(t,r),Sn(t,dt()),n;if(e===6)si(t,r);else{if(s=t.current.alternate,!(r&30)&&!A2(s)&&(e=bh(t,r),e===2&&(i=Py(t),i!==0&&(r=i,e=ov(t,i))),e===1))throw n=_u,Io(t,0),si(t,r),Sn(t,dt()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(z(345));case 2:co(t,vn,ys);break;case 3:if(si(t,r),(r&130023424)===r&&(e=xb+500-dt(),10<e)){if(th(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){an(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=By(co.bind(null,t,vn,ys),e);break}co(t,vn,ys);break;case 4:if(si(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var o=31-Er(r);i=1<<o,o=e[o],o>s&&(s=o),r&=~i}if(r=s,r=dt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*T2(r/1960))-r,10<r){t.timeoutHandle=By(co.bind(null,t,vn,ys),r);break}co(t,vn,ys);break;case 5:co(t,vn,ys);break;default:throw Error(z(329))}}}return Sn(t,dt()),t.callbackNode===n?wT.bind(null,t):null}function ov(t,e){var n=Vc;return t.current.memoizedState.isDehydrated&&(Io(t,e).flags|=256),t=bh(t,e),t!==2&&(e=vn,vn=n,e!==null&&av(e)),t}function av(t){vn===null?vn=t:vn.push.apply(vn,t)}function A2(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(!_r(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 si(t,e){for(e&=~wb,e&=~Hp,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Er(e),r=1<<n;t[n]=-1,e&=~r}}function a1(t){if(Oe&6)throw Error(z(327));nl();var e=th(t,0);if(!(e&1))return Sn(t,dt()),null;var n=bh(t,e);if(t.tag!==0&&n===2){var r=Py(t);r!==0&&(e=r,n=ov(t,r))}if(n===1)throw n=_u,Io(t,0),si(t,e),Sn(t,dt()),n;if(n===6)throw Error(z(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,co(t,vn,ys),Sn(t,dt()),null}function kb(t,e){var n=Oe;Oe|=1;try{return t(e)}finally{Oe=n,Oe===0&&(Ol=dt()+500,Bp&&Qi())}}function Ho(t){yi!==null&&yi.tag===0&&!(Oe&6)&&nl();var e=Oe;Oe|=1;var n=Qn.transition,r=De;try{if(Qn.transition=null,De=1,t)return t()}finally{De=r,Qn.transition=n,Oe=e,!(Oe&6)&&Qi()}}function Sb(){_n=Ka.current,Je(Ka)}function Io(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,s2(n)),gt!==null)for(n=gt.return;n!==null;){var r=n;switch(rb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&oh();break;case 3:Al(),Je(xn),Je(Yt),fb();break;case 5:db(r);break;case 4:Al();break;case 13:Je(Ye);break;case 19:Je(Ye);break;case 10:ab(r.type._context);break;case 22:case 23:Sb()}n=n.return}if(Pt=t,gt=t=Oi(t.current,null),Ht=_n=e,Ct=0,_u=null,wb=Hp=Vo=0,vn=Vc=null,go!==null){for(e=0;e<go.length;e++)if(n=go[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}go=null}return t}function xT(t,e){do{var n=gt;try{if(ob(),Of.current=mh,ph){for(var r=et.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}ph=!1}if(Uo=0,Nt=St=et=null,zc=!1,Su=0,bb.current=null,n===null||n.return===null){Ct=1,_u=e,gt=null;break}e:{var i=t,o=n.return,a=n,l=e;if(e=Ht,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=Gx(o);if(h!==null){h.flags&=-257,Jx(h,o,a,i,e),h.mode&1&&Kx(i,c,e),e=h,l=c;var p=e.updateQueue;if(p===null){var g=new Set;g.add(l),e.updateQueue=g}else p.add(l);break e}else{if(!(e&1)){Kx(i,c,e),Eb();break e}l=Error(z(426))}}else if(Ze&&a.mode&1){var y=Gx(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),Jx(y,o,a,i,e),sb(Nl(l,a));break e}}i=l=Nl(l,a),Ct!==4&&(Ct=2),Vc===null?Vc=[i]:Vc.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var v=sT(i,l,e);zx(i,v);break e;case 1:a=l;var b=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ai===null||!Ai.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var k=iT(i,a,e);zx(i,k);break e}}i=i.return}while(i!==null)}ET(n)}catch(S){e=S,gt===n&&n!==null&&(gt=n=n.return);continue}break}while(!0)}function kT(){var t=gh.current;return gh.current=mh,t===null?mh:t}function Eb(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),Pt===null||!(Vo&268435455)&&!(Hp&268435455)||si(Pt,Ht)}function bh(t,e){var n=Oe;Oe|=2;var r=kT();(Pt!==t||Ht!==e)&&(ys=null,Io(t,e));do try{N2();break}catch(s){xT(t,s)}while(!0);if(ob(),Oe=n,gh.current=r,gt!==null)throw Error(z(261));return Pt=null,Ht=0,Ct}function N2(){for(;gt!==null;)ST(gt)}function O2(){for(;gt!==null&&!tM();)ST(gt)}function ST(t){var e=_T(t.alternate,t,_n);t.memoizedProps=t.pendingProps,e===null?ET(t):gt=e,bb.current=null}function ET(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=S2(n,e),n!==null){n.flags&=32767,gt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ct=6,gt=null;return}}else if(n=k2(n,e,_n),n!==null){gt=n;return}if(e=e.sibling,e!==null){gt=e;return}gt=e=t}while(e!==null);Ct===0&&(Ct=5)}function co(t,e,n){var r=De,s=Qn.transition;try{Qn.transition=null,De=1,R2(t,e,n,r)}finally{Qn.transition=s,De=r}return null}function R2(t,e,n,r){do nl();while(yi!==null);if(Oe&6)throw Error(z(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(z(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(dM(t,i),t===Pt&&(gt=Pt=null,Ht=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Kd||(Kd=!0,TT(eh,function(){return nl(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Qn.transition,Qn.transition=null;var o=De;De=1;var a=Oe;Oe|=4,bb.current=null,C2(t,n),vT(n,t),ZM($y),nh=!!Dy,$y=Dy=null,t.current=n,_2(n),nM(),Oe=a,De=o,Qn.transition=i}else t.current=n;if(Kd&&(Kd=!1,yi=t,vh=s),i=t.pendingLanes,i===0&&(Ai=null),iM(n.stateNode),Sn(t,dt()),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(yh)throw yh=!1,t=sv,sv=null,t;return vh&1&&t.tag!==0&&nl(),i=t.pendingLanes,i&1?t===iv?Hc++:(Hc=0,iv=t):Hc=0,Qi(),null}function nl(){if(yi!==null){var t=s_(vh),e=Qn.transition,n=De;try{if(Qn.transition=null,De=16>t?16:t,yi===null)var r=!1;else{if(t=yi,yi=null,vh=0,Oe&6)throw Error(z(331));var s=Oe;for(Oe|=4,te=t.current;te!==null;){var i=te,o=i.child;if(te.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(te=c;te!==null;){var u=te;switch(u.tag){case 0:case 11:case 15:Uc(8,u,i)}var d=u.child;if(d!==null)d.return=u,te=d;else for(;te!==null;){u=te;var f=u.sibling,h=u.return;if(mT(u),u===c){te=null;break}if(f!==null){f.return=h,te=f;break}te=h}}}var p=i.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}te=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,te=o;else e:for(;te!==null;){if(i=te,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Uc(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,te=v;break e}te=i.return}}var b=t.current;for(te=b;te!==null;){o=te;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,te=w;else e:for(o=b;te!==null;){if(a=te,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Vp(9,a)}}catch(S){lt(a,a.return,S)}if(a===o){te=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,te=k;break e}te=a.return}}if(Oe=s,Qi(),Kr&&typeof Kr.onPostCommitFiberRoot=="function")try{Kr.onPostCommitFiberRoot(Mp,t)}catch{}r=!0}return r}finally{De=n,Qn.transition=e}}return!1}function l1(t,e,n){e=Nl(n,e),e=sT(t,e,1),t=Ti(t,e,1),e=an(),t!==null&&(ad(t,1,e),Sn(t,e))}function lt(t,e,n){if(t.tag===3)l1(t,t,n);else for(;e!==null;){if(e.tag===3){l1(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ai===null||!Ai.has(r))){t=Nl(n,t),t=iT(e,t,1),e=Ti(e,t,1),t=an(),e!==null&&(ad(e,1,t),Sn(e,t));break}}e=e.return}}function P2(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=an(),t.pingedLanes|=t.suspendedLanes&n,Pt===t&&(Ht&n)===n&&(Ct===4||Ct===3&&(Ht&130023424)===Ht&&500>dt()-xb?Io(t,0):wb|=n),Sn(t,e)}function CT(t,e){e===0&&(t.mode&1?(e=Dd,Dd<<=1,!(Dd&130023424)&&(Dd=4194304)):e=1);var n=an();t=Os(t,e),t!==null&&(ad(t,e,n),Sn(t,n))}function I2(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),CT(t,n)}function j2(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(z(314))}r!==null&&r.delete(e),CT(t,n)}var _T;_T=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||xn.current)wn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return wn=!1,x2(t,e,n);wn=!!(t.flags&131072)}else wn=!1,Ze&&e.flags&1048576&&O_(e,ch,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Pf(t,e),t=e.pendingProps;var s=Cl(e,Yt.current);tl(e,n),s=pb(null,e,r,t,s,n);var i=mb();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,kn(r)?(i=!0,ah(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,cb(e),s.updater=Up,e.stateNode=s,s._reactInternals=e,Ky(e,r,t,n),e=Qy(null,e,r,!0,i,n)):(e.tag=0,Ze&&i&&nb(e),rn(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Pf(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=L2(r),t=fr(r,t),s){case 0:e=Jy(null,e,r,t,n);break e;case 1:e=Yx(null,e,r,t,n);break e;case 11:e=Qx(null,e,r,t,n);break e;case 14:e=Zx(null,e,r,fr(r.type,t),n);break e}throw Error(z(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fr(r,s),Jy(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fr(r,s),Yx(t,e,r,s,n);case 3:e:{if(cT(e),t===null)throw Error(z(387));r=e.pendingProps,i=e.memoizedState,s=i.element,L_(t,e),fh(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=Nl(Error(z(423)),e),e=Xx(t,e,r,n,s);break e}else if(r!==s){s=Nl(Error(z(424)),e),e=Xx(t,e,r,n,s);break e}else for(Rn=_i(e.stateNode.containerInfo.firstChild),Pn=e,Ze=!0,vr=null,n=j_(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_l(),r===s){e=Rs(t,e,n);break e}rn(t,e,r,n)}e=e.child}return e;case 5:return D_(e),t===null&&Hy(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,Fy(r,s)?o=null:i!==null&&Fy(r,i)&&(e.flags|=32),lT(t,e),rn(t,e,o,n),e.child;case 6:return t===null&&Hy(e),null;case 13:return uT(t,e,n);case 4:return ub(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Tl(e,null,r,n):rn(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fr(r,s),Qx(t,e,r,s,n);case 7:return rn(t,e,e.pendingProps,n),e.child;case 8:return rn(t,e,e.pendingProps.children,n),e.child;case 12:return rn(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,He(uh,r._currentValue),r._currentValue=o,i!==null)if(_r(i.value,o)){if(i.children===s.children&&!xn.current){e=Rs(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 l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=_s(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Wy(i.return,n,e),a.lanes|=n;break}l=l.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(z(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Wy(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}rn(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,tl(e,n),s=tr(s),r=r(s),e.flags|=1,rn(t,e,r,n),e.child;case 14:return r=e.type,s=fr(r,e.pendingProps),s=fr(r.type,s),Zx(t,e,r,s,n);case 15:return oT(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fr(r,s),Pf(t,e),e.tag=1,kn(r)?(t=!0,ah(e)):t=!1,tl(e,n),rT(e,r,s),Ky(e,r,s,n),Qy(null,e,r,!0,t,n);case 19:return dT(t,e,n);case 22:return aT(t,e,n)}throw Error(z(156,e.tag))};function TT(t,e){return e_(t,e)}function M2(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 Gn(t,e,n,r){return new M2(t,e,n,r)}function Cb(t){return t=t.prototype,!(!t||!t.isReactComponent)}function L2(t){if(typeof t=="function")return Cb(t)?1:0;if(t!=null){if(t=t.$$typeof,t===H0)return 11;if(t===W0)return 14}return 2}function Oi(t,e){var n=t.alternate;return n===null?(n=Gn(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.deleti
vendor: 4,945 bytes, line 40
40ons=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 Mf(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")Cb(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Da:return jo(n.children,s,i,e);case V0:o=8,s|=8;break;case yy:return t=Gn(12,n,e,s|2),t.elementType=yy,t.lanes=i,t;case vy:return t=Gn(13,n,e,s),t.elementType=vy,t.lanes=i,t;case by:return t=Gn(19,n,e,s),t.elementType=by,t.lanes=i,t;case DC:return Wp(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case MC:o=10;break e;case LC:o=9;break e;case H0:o=11;break e;case W0:o=14;break e;case Qs:o=16,r=null;break e}throw Error(z(130,t==null?t:typeof t,""))}return e=Gn(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function jo(t,e,n,r){return t=Gn(7,t,r,e),t.lanes=n,t}function Wp(t,e,n,r){return t=Gn(22,t,r,e),t.elementType=DC,t.lanes=n,t.stateNode={isHidden:!1},t}function cg(t,e,n){return t=Gn(6,t,null,e),t.lanes=n,t}function ug(t,e,n){return e=Gn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function D2(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=Hm(0),this.expirationTimes=Hm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hm(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function _b(t,e,n,r,s,i,o,a,l){return t=new D2(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Gn(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},cb(i),t}function $2(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:La,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function AT(t){if(!t)return zi;t=t._reactInternals;e:{if(ra(t)!==t||t.tag!==1)throw Error(z(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(kn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(z(171))}if(t.tag===1){var n=t.type;if(kn(n))return A_(t,n,e)}return e}function NT(t,e,n,r,s,i,o,a,l){return t=_b(n,r,!0,t,s,i,o,a,l),t.context=AT(null),n=t.current,r=an(),s=Ni(n),i=_s(r,s),i.callback=e??null,Ti(n,i,s),t.current.lanes=s,ad(t,s,r),Sn(t,r),t}function qp(t,e,n,r){var s=e.current,i=an(),o=Ni(s);return n=AT(n),e.context===null?e.context=n:e.pendingContext=n,e=_s(i,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Ti(s,e,o),t!==null&&(Cr(t,s,o,i),Nf(t,s,o)),o}function wh(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 c1(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Tb(t,e){c1(t,e),(t=t.alternate)&&c1(t,e)}function F2(){return null}var OT=typeof reportError=="function"?reportError:function(t){console.error(t)};function Ab(t){this._internalRoot=t}Kp.prototype.render=Ab.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(z(409));qp(t,e,null,null)};Kp.prototype.unmount=Ab.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ho(function(){qp(null,t,null,null)}),e[Ns]=null}};function Kp(t){this._internalRoot=t}Kp.prototype.unstable_scheduleHydration=function(t){if(t){var e=a_();t={blockedOn:null,target:t,priority:e};for(var n=0;n<ri.length&&e!==0&&e<ri[n].priority;n++);ri.splice(n,0,t),n===0&&c_(t)}};function Nb(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Gp(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function u1(){}function B2(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=wh(o);i.call(c)}}var o=NT(e,r,t,0,null,!1,!1,"",u1);return t._reactRootContainer=o,t[Ns]=o.current,vu(t.nodeType===8?t.parentNode:t),Ho(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=wh(l);a.call(c)}}var l=_b(t,0,!1,null,null,!1,!1,"",u1);return t._reactRootContainer=l,t[Ns]=l.current,vu(t.nodeType===8?t.parentNode:t),Ho(function(){qp(e,l,n,r)}),l}function Jp(t,e,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=wh(o);a.call(l)}}qp(e,o,t,s)}
40else o=B2(n,e,t,s,r);return wh(o)}i_=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Cc(e.pendingLanes);n!==0&&(G0(e,n|1),Sn(e,dt()),!(Oe&6)&&(Ol=dt()+500,Qi()))}break;case 13:Ho(function(){var r=Os(t,1);if(r!==null){var s=an();Cr(r,t,1,s)}}),Tb(t,1)}};J0=function(t){if(t.tag===13){var e=Os(t,134217728);if(e!==null){var n=an();Cr(e,t,134217728,n)}Tb(t,134217728)}};o_=function(t){if(t.tag===13){var e=Ni(t),n=Os(t,e);if(n!==null){var r=an();Cr(n,t,e,r)}Tb(t,e)}};a_=function(){return De};l_=function(t,e){var n=De;try{return De=t,e()}finally{De=n}};Ny=function(t,e,n){switch(e){case"input":if(ky(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=Fp(r);if(!s)throw Error(z(90));FC(r),ky(r,s)}}}break;case"textarea":zC(t,n);break;case"select":e=n.value,e!=null&&Za(t,!!n.multiple,e,!1)}};GC=kb;JC=Ho;var z2={usingClientEntryPoint:!1,Events:[cd,za,Fp,qC,KC,kb]},fc={findFiberByHostInstance:mo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},U2={bundleType:fc.bundleType,version:fc.version,rendererPackageName:fc.rendererPackageName,rendererConfig:fc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ls.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=YC(t),t===null?null:t.stateNode},findFiberByHostInstance:fc.findFiberByHostInstance||F2,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 Gd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gd.isDisabled&&Gd.supportsFiber)try{Mp=Gd.inject(U2),Kr=Gd}catch{}}Ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z2;Ln.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nb(e))throw Error(z(200));return $2(t,e,null,n)};Ln.createRoot=function(t,e){if(!Nb(t))throw Error(z(299));var n=!1,r="",s=OT;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=_b(t,1,!1,null,null,n,!1,r,s),t[Ns]=e.current,vu(t.nodeType===8?t.parentNode:t),new Ab(e)};Ln.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(z(188)):(t=Object.keys(t).join(","),Error(z(268,t)));return t=YC(e),t=t===null?null:t.stateNode,t};Ln.flushSync=function(t){return Ho(t)};Ln.hydrate=function(t,e,n){if(!Gp(e))throw Error(z(200));return Jp(null,t,e,!0,n)};Ln.hydrateRoot=function(t,e,n){if(!Nb(t))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=OT;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=NT(e,null,t,1,n??null,s,!1,i,o),t[Ns]=e.current,vu(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 Kp(e)};Ln.render=function(t,e,n){if(!Gp(e))throw Error(z(200));return Jp(null,t,e,!1,n)};Ln.unmountComponentAtNode=function(t){if(!Gp(t))throw Error(z(40));return t._reactRootContainer?(Ho(function(){Jp(null,null,t,!1,function(){t._reactRootContainer=null,t[Ns]=null})}),!0):!1};Ln.unstable_batchedUpdates=kb;Ln.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Gp(n))throw Error(z(200));if(t==null||t._reactInternals===void 0)throw Error(z(38));return Jp(t,e,n,!1,r)};Ln.version="18.3.1-next-f1338f8080-20240426";function RT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(RT)}catch(t){console.error(t)}}RT(),RC.exports=Ln;var dd=RC.exports;const Ob=bC(dd);var PT,d1=dd;PT=d1.createRoot,d1.hydrateRoot;var fd=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(){}},Wo=typeof window>"u"||"Deno"in globalThis;function yn(){}function V2(t,e){return typeof t=="function"?t(e):t}function lv(t){return typeof t=="number"&&t>=0&&t!==1/0}function IT(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ri(t,e){return typeof t=="function"?t(e):t}function Vn(t,e){return typeof t=="function"?t(e):t}function f1(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==Rb(o,e.options))return!1}else if(!Au(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function h1(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Tu(e.options.mutationKey)!==Tu(i))return!1}else if(!Au(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Rb(t,e){return((e==null?void 0:e.queryKeyHashFn)||Tu)(t)}function Tu(t){return JSON.stringify(t,(e,n)=>uv(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Au(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Au(t[n],e[n])):!1}function jT(t,e){if(t===e)return t;const n=p1(t)&&p1(e);if(n||uv(t)&&uv(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),o=i.length,a=n?[]:{},l=new Set(r);let c=0;for(let u=0;u<o;u++){const d=n?u:i[u];(!n&&l.has(d)||n)&&t[d]===void 0&&e[d]===void 0?(a[d]=void 0,c++):(a[d]=jT(t[d],e[d]),a[d]===t[d]&&t[d]!==void 0&&c++)}return s===o&&c===s?t:a}return e}function cv(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 p1(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function uv(t){if(!m1(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!m1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function m1(t){return Object.prototype.toString.call(t)==="[object Object]"}function H2(t){return new Promise(e=>{setTimeout(e,t)})}function dv(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?jT(t,e):e}function W2(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function q2(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Pb=Symbol();function MT(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Pb?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function K2(t,e){return typeof t=="function"?t(...e):!!t}var Eo,li,fl,uC,G2=(uC=class extends fd{constructor(){super();fe(this,Eo);fe(this,li);fe(this,fl);ne(this,fl,e=>{if(!Wo&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){A(this,li)||this.setEventListener(A(this,fl))}onUnsubscribe(){var e;this.hasListeners()||((e=A(this,li))==null||e.call(this),ne(this,li,void 0))}setEventListener(e){var n;ne(this,fl,e),(n=A(this,li))==null||n.call(this),ne(this,li,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){A(this,Eo)!==e&&(ne(this,Eo,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 A(this,Eo)=="boolean"?A(this,Eo):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Eo=new WeakMap,li=new WeakMap,fl=new WeakMap,uC),Ib=new G2,hl,ci,pl,dC,J2=(dC=class extends fd{constructor(){super();fe(this,hl,!0);fe(this,ci);fe(this,pl);ne(this,pl,e=>{if(!Wo&&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(){A(this,ci)||this.setEventListener(A(this,pl))}onUnsubscribe(){var e;this.hasListeners()||((e=A(this,ci))==null||e.call(this),ne(this,ci,void 0))}setEventListener(e){var n;ne(this,pl,e),(n=A(this,ci))==null||n.call(this),ne(this,ci,e(this.setOnline.bind(this)))}setOnline(e){A(this,hl)!==e&&(ne(this,hl,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return A(this,hl)}},hl=new WeakMap,ci=new WeakMap,pl=new WeakMap,dC),xh=new J2;function fv(){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 Q2(t){return Math.min(1e3*2**t,3e4)}function LT(t){return(t??"online")==="online"?xh.isOnline():!0}var DT=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function dg(t){return t instanceof DT}function $T(t){let e=!1,n=0,r=!1,s;const i=fv(),o=g=>{var y;r||(f(new DT(g)),(y=t.abort)==null||y.call(t))},a=()=>{e=!0},l=()=>{e=!1},c=()=>Ib.isFocused()&&(t.networkMode==="always"||xh.isOnline())&&t.canRun(),u=()=>LT(t.networkMode)&&t.canRun(),d=g=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,g),s==null||s(),i.resolve(g))},f=g=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,g),s==null||s(),i.reject(g))},h=()=>new Promise(g=>{var y;s=v=>{(r||c())&&g(v)},(y=t.onPause)==null||y.call(t)}).then(()=>{var g;s=void 0,r||(g=t.onContinue)==null||g.call(t)}),p=()=>{if(r)return;let g;const y=n===0?t.initialPromise:void 0;try{g=y??t.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var C;if(r)return;const b=t.retry??(Wo?0:3),w=t.retryDelay??Q2,k=typeof w=="function"?w(n,v):w,S=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,v);if(e||!S){f(v);return}n++,(C=t.onFail)==null||C.call(t,n,v),H2(k).then(()=>c()?void 0:h()).then(()=>{e?f(v):p()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():h().then(p),i)}}var Z2=t=>setTimeout(t,0);function Y2(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=Z2;const i=a=>{e?t.push(a):s(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Bt=Y2(),Co,fC,FT=(fC=class{constructor(){fe(this,Co)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lv(this.gcTime)&&ne(this,Co,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Wo?1/0:5*60*1e3))}clearGcTimeout(){A(this,Co)&&(clearTimeout(A(this,Co)),ne(this,Co,void 0))}},Co=new WeakMap,fC),ml,_o,Un,To,Jt,nd,Ao,pr,ms,hC,X2=(hC=class extends FT{constructor(e){super();fe(this,pr);fe(this,ml);fe(this,_o);fe(this,Un);fe(this,To);fe(this,Jt);fe(this,nd);fe(this,Ao);ne(this,Ao,!1),ne(this,nd,e.defaultOptions),this.setOptions(e.options),this.observers=[],ne(this,To,e.client),ne(this,Un,A(this,To).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ne(this,ml,eL(this.options)),this.state=e.state??A(this,ml),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=A(this,Jt))==null?void 0:e.promise}setOptions(e){this.options={...A(this,nd),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,Un).remove(this)}setData(e,n){const r=dv(this.state.data,e,this.options);return Te(this,pr,ms).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Te(this,pr,ms).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=A(this,Jt))==null?void 0:r.promise;return(s=A(this,Jt))==null||s.cancel(e),n?n.then(yn).catch(yn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(A(this,ml))}isActive(){return this.observers.some(e=>Vn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Pb||this.state.dataUpdateCount+this.state.errorUpdate
40Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ri(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:!IT(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=A(this,Jt))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=A(this,Jt))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),A(this,Un).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(A(this,Jt)&&(A(this,Ao)?A(this,Jt).cancel({revert:!0}):A(this,Jt).cancelRetry()),this.scheduleGc()),A(this,Un).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,pr,ms).call(this,{type:"invalidate"})}fetch(e,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(A(this,Jt))return A(this,Jt).continueRetry(),A(this,Jt).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(ne(this,Ao,!0),r.signal)})},i=()=>{const f=MT(this.options,n),p=(()=>{const g={client:A(this,To),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return ne(this,Ao,!1),this.options.persister?this.options.persister(f,p,this):f(p)},a=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:A(this,To),state:this.state,fetchFn:i};return s(f),f})();(c=this.options.behavior)==null||c.onFetch(a,this),ne(this,_o,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Te(this,pr,ms).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,p,g,y;dg(f)&&f.silent||Te(this,pr,ms).call(this,{type:"error",error:f}),dg(f)||((p=(h=A(this,Un).config).onError)==null||p.call(h,f,this),(y=(g=A(this,Un).config).onSettled)==null||y.call(g,this.state.data,f,this)),this.scheduleGc()};return ne(this,Jt,$T({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,p,g,y;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(v){l(v);return}(p=(h=A(this,Un).config).onSuccess)==null||p.call(h,f,this),(y=(g=A(this,Un).config).onSettled)==null||y.call(g,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Te(this,pr,ms).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Te(this,pr,ms).call(this,{type:"pause"})},onContinue:()=>{Te(this,pr,ms).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),A(this,Jt).start()}},ml=new WeakMap,_o=new WeakMap,Un=new WeakMap,To=new WeakMap,Jt=new WeakMap,nd=new WeakMap,Ao=new WeakMap,pr=new WeakSet,ms=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,...BT(r.data,this.options),fetchMeta:e.meta??null};case"success":return ne(this,_o,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 dg(s)&&s.revert&&A(this,_o)?{...A(this,_o),fetchStatus:"idle"}
vendor: 5,105 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),Bt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),A(this,Un).notify({query:this,type:"updated",action:e})})},hC);function BT(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:LT(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function eL(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 Fr,pC,tL=(pC=class extends fd{constructor(e={}){super();fe(this,Fr);this.config=e,ne(this,Fr,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Rb(s,n);let o=this.get(i);return o||(o=new X2({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){A(this,Fr).has(e.queryHash)||(A(this,Fr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=A(this,Fr).get(e.queryHash);n&&(e.destroy(),n===e&&A(this,Fr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Bt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return A(this,Fr).get(e)}getAll(){return[...A(this,Fr).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>f1(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>f1(e,r)):n}notify(e){Bt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fr=new WeakMap,pC),Br,tn,No,zr,Ks,mC,nL=(mC=class extends FT{constructor(e){super();fe(this,zr);fe(this,Br);fe(this,tn);fe(this,No);this.mutationId=e.mutationId,ne(this,tn,e.mutationCache),ne(this,Br,[]),this.state=e.state||rL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){A(this,Br).includes(e)||(A(this,Br).push(e),this.clearGcTimeout(),A(this,tn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ne(this,Br,A(this,Br).filter(n=>n!==e)),this.scheduleGc(),A(this,tn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){A(this,Br).length||(this.state.status==="pending"?this.scheduleGc():A(this,tn).remove(this))}continue(){var e;return((e=A(this,No))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,l,c,u,d,f,h,p,g,y,v,b,w,k,S,C,E,T;const n=()=>{Te(this,zr,Ks).call(this,{type:"continue"})};ne(this,No,$T({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(N,P)=>{Te(this,zr,Ks).call(this,{type:"failed",failureCount:N,error:P})},onPause:()=>{Te(this,zr,Ks).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,tn).canRun(this)}));const r=this.state.status==="pending",s=!A(this,No).canStart();try{if(r)n();else{Te(this,zr,Ks).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=A(this,tn).config).onMutate)==null?void 0:o.call(i,e,this));const P=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));P!==this.state.context&&Te(this,zr,Ks).call(this,{type:"pending",context:P,variables:e,isPaused:s})}const N=await A(this,No).start();return await((u=(c=A(this,tn).config).onSuccess)==null?void 0:u.call(c,N,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,N,e,this.state.context)),await((p=(h=A(this,tn).config).onSettled)==null?void 0:p.call(h,N,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,N,null,e,this.state.context)),Te(this,zr,Ks).call(this,{type:"success",data:N}),N}catch(N){try{throw await((b=(v=A(this,tn).config).onError)==null?void 0:b.call(v,N,e,this.state.context,this)),await((k=(w=this.options).onError)==null?void 0:k.call(w,N,e,this.state.context)),await((C=(S=A(this,tn).config).onSettled)==null?void 0:C.call(S,void 0,N,this.state.variables,this.state.context,this)),await((T=(E=this.options).onSettled)==null?void 0:T.call(E,void 0,N,e,this.state.context)),N}finally{Te(this,zr,Ks).call(this,{type:"error",error:N})}}finally{A(this,tn).runNext(this)}}},Br=new WeakMap,tn=new WeakMap,No=new WeakMap,zr=new WeakSet,Ks=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};
40case"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),Bt.batch(()=>{A(this,Br).forEach(r=>{r.onMutationUpdate(e)}),A(this,tn).notify({mutation:this,type:"updated",action:e})})},mC);function rL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xs,mr,rd,gC,sL=(gC=class extends fd{constructor(e={}){super();fe(this,xs);fe(this,mr);fe(this,rd);this.config=e,ne(this,xs,new Set),ne(this,mr,new Map),ne(this,rd,0)}build(e,n,r){const s=new nL({mutationCache:this,mutationId:++Rd(this,rd)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){A(this,xs).add(e);const n=Jd(e);if(typeof n=="string"){const r=A(this,mr).get(n);r?r.push(e):A(this,mr).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(A(this,xs).delete(e)){const n=Jd(e);if(typeof n=="string"){const r=A(this,mr).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&A(this,mr).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Jd(e);if(typeof n=="string"){const r=A(this,mr).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=Jd(e);if(typeof n=="string"){const s=(r=A(this,mr).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(){Bt.batch(()=>
vendor: 15,318 bytes, line 40
40{A(this,xs).forEach(e=>{this.notify({type:"removed",mutation:e})}),A(this,xs).clear(),A(this,mr).clear()})}getAll(){return Array.from(A(this,xs))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>h1(n,r))}findAll(e={}){return this.getAll().filter(n=>h1(e,n))}notify(e){Bt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(e.map(n=>n.continue().catch(yn))))}},xs=new WeakMap,mr=new WeakMap,rd=new WeakMap,gC);function Jd(t){var e;return(e=t.options.scope)==null?void 0:e.id}function g1(t){return{onFetch:(e,n)=>{var u,d,f,h,p;const r=e.options,s=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=e.state.data)==null?void 0:h.pages)||[],o=((p=e.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},v=MT(e.options,e.fetchOptions),b=async(w,k,S)=>{if(g)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const q={client:e.client,queryKey:e.queryKey,pageParam:k,direction:S?"backward":"forward",meta:e.options.meta};return y(q),q})(),T=await v(E),{maxPages:N}=e.options,P=S?q2:W2;return{pages:P(w.pages,T,N),pageParams:P(w.pageParams,k,N)}};if(s&&i.length){const w=s==="backward",k=w?iL:y1,S={pages:i,pageParams:o},C=k(r,S);a=await b(S,C,w)}else{const w=t??i.length;do{const k=l===0?o[0]??r.initialPageParam:y1(r,a);if(l>0&&k==null)break;a=await b(a,k),l++}while(l<w)}return a};e.options.persister?e.fetchFn=()=>{var g,y;return(y=(g=e.options).persister)==null?void 0:y.call(g,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function y1(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 iL(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 it,ui,di,gl,yl,fi,vl,bl,yC,oL=(yC=class{constructor(t={}){fe(this,it);fe(this,ui);fe(this,di);fe(this,gl);fe(this,yl);fe(this,fi);fe(this,vl);fe(this,bl);ne(this,it,t.queryCache||new tL),ne(this,ui,t.mutationCache||new sL),ne(this,di,t.defaultOptions||{}),ne(this,gl,new Map),ne(this,yl,new Map),ne(this,fi,0)}mount(){Rd(this,fi)._++,A(this,fi)===1&&(ne(this,vl,Ib.subscribe(async t=>{t&&(await this.resumePausedMutations(),A(this,it).onFocus())})),ne(this,bl,xh.subscribe(async t=>{t&&(await this.resumePausedMutations(),A(this,it).onOnline())})))}unmount(){var t,e;Rd(this,fi)._--,A(this,fi)===0&&((t=A(this,vl))==null||t.call(this),ne(this,vl,void 0),(e=A(this,bl))==null||e.call(this),ne(this,bl,void 0))}isFetching(t){return A(this,it).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return A(this,ui).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=A(this,it).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=A(this,it).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Ri(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return A(this,it).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=A(this,it).get(r.queryHash),i=s==null?void 0:s.state.data,o=V2(e,i);if(o!==void 0)return A(this,it).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return Bt.batch(()=>A(this,it).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=A(this,it).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=A(this,it);Bt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=A(this,it);return Bt.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Bt.batch(()=>A(this,it).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(yn).catch(yn)}invalidateQueries(t,e={}){return Bt.batch(()=>(A(this,it).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=Bt.batch(()=>A(this,it).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(yn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(yn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=A(this,it).build(this,e);return n.isStaleByTime(Ri(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(yn).catch(yn)}fetchInfiniteQuery(t){return t.behavior=g1(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(yn).catch(yn)}ensureInfiniteQueryData(t){return t.behavior=g1(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return xh.isOnline()?A(this,ui).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,it)}getMutationCache(){return A(this,ui)}getDefaultOptions(){return A(this,di)}setDefaultOptions(t){ne(this,di,t)}setQueryDefaults(t,e){A(this,gl).set(Tu(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...A(this,gl).values()],n={};return e.forEach(r=>{Au(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){A(this,yl).set(Tu(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...A(this,yl).values()],n={};return e.forEach(r=>{Au(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...A(this,di).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Rb(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===Pb&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...A(this,di).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){A(this,it).clear(),A(this,ui).clear()}},it=new WeakMap,ui=new WeakMap,di=new WeakMap,gl=new WeakMap,yl=new WeakMap,fi=new WeakMap,vl=new WeakMap,bl=new WeakMap,yC),pn,Ae,sd,nn,Oo,wl,hi,pi,id,xl,kl,Ro,Po,mi,Sl,Ie,Tc,hv,pv,mv,gv,yv,vv,bv,zT,vC,aL=(vC=class extends fd{constructor(e,n){super();fe(this,Ie);fe(this,pn);fe(this,Ae);fe(this,sd);fe(this,nn);fe(this,Oo);fe(this,wl);fe(this,hi);fe(this,pi);fe(this,id);fe(this,xl);fe(this,kl);fe(this,Ro);fe(this,Po);fe(this,mi);fe(this,Sl,new Set);this.options=n,ne(this,pn,e),ne(this,pi,null),ne(this,hi,fv()),this.options.experimental_prefetchInRender||A(this,hi).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&&(A(this,Ae).addObserver(this),v1(A(this,Ae),this.options)?Te(this,Ie,Tc).call(this):this.updateResult(),Te(this,Ie,gv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wv(A(this,Ae),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wv(A(this,Ae),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,Ie,yv).call(this),Te(this,Ie,vv).call(this),A(this,Ae).removeObserver(this)}setOptions(e){const n=this.options,r=A(this,Ae);if(this.options=A(this,pn).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Vn(this.options.enabled,A(this,Ae))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,Ie,bv).call(this),A(this,Ae).setOptions(this.options),n._defaulted&&!cv(this.options,n)&&A(this,pn).getQueryCache().notify({type:"observerOptionsUpdated",query:A(this,Ae),observer:this});const s=this.hasListeners();s&&b1(A(this,Ae),r,this.options,n)&&Te(this,Ie,Tc).call(this),this.updateResult(),s&&(A(this,Ae)!==r||Vn(this.options.enabled,A(this,Ae))!==Vn(n.enabled,A(this,Ae))||Ri(this.options.staleTime,A(this,Ae))!==Ri(n.staleTime,A(this,Ae)))&&Te(this,Ie,hv).call(this);const i=Te(this,Ie,pv).call(this);s&&(A(this,Ae)!==r||Vn(this.options.enabled,A(this,Ae))!==Vn(n.enabled,A(this,Ae))||i!==A(this,mi))&&Te(this,Ie,mv).call(this,i)}getOptimisticResult(e){const n=A(this,pn).getQueryCache().build(A(this,pn),e),r=this.createResult(n,e);return cL(this,r)&&(ne(this,nn,r),ne(this,wl,this.options),ne(this,Oo,A(this,Ae).state)),r}getCurrentResult(){return A(this,nn)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){A(this,Sl).add(e)}getCurrentQuery(){return A(this,Ae)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=A(this,pn).defaultQueryOptions(e),r=A(this,pn).getQueryCache().build(A(this,pn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Te(this,Ie,Tc).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),A(this,nn)))}createResult(e,n){var N;const r=A(this,Ae),s=this.options,i=A(this,nn),o=A(this,Oo),a=A(this,wl),c=e!==r?e.state:A(this,sd),{state:u}=e;let d={...u},f=!1,h;if(n._optimisticResults){const P=this.hasListeners(),q=!P&&v1(e,n),R=P&&b1(e,r,n,s);(q||R)&&(d={...d,...BT(u.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:g,status:y}=d;h=d.data;let v=!1;if(n.placeholderData!==void 0&&h===void 0&&y==="pending"){let P;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(P=i.data,v=!0):P=typeof n.placeholderData=="function"?n.placeholderData((N=A(this,kl))==null?void 0:N.state.data,A(this,kl)):n.placeholderData,P!==void 0&&(y="success",h=dv(i==null?void 0:i.data,P,n),f=!0)}if(n.select&&h!==void 0&&!v)if(i&&h===(o==null?void 0:o.data)&&n.select===A(this,id))h=A(this,xl);else try{ne(this,id,n.select),h=n.select(h),h=dv(i==null?void 0:i.data,h,n),ne(this,xl,h),ne(this,pi,null)}catch(P){ne(this,pi,P)}A(this,pi)&&(p=A(this,pi),h=A(this,xl),g=Date.now(),y="error");const b=d.fetchStatus==="fetching",w=y==="pending",k=y==="error",S=w&&b,C=h!==void 0,T={status:y,fetchStatus:d.fetchStatus,isPending:w,isSuccess:y==="success",isError:k,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:k&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:k&&C,isStale:jb(e,n),refetch:this.refetch,promise:A(this,hi),isEnabled:Vn(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=D=>{T.status==="error"?D.reject(T.error):T.data!==void 0&&D.resolve(T.data)},q=()=>{const D=ne(this,hi,T.promise=fv());P(D)},R=A(this,hi);switch(R.status){case"pending":e.queryHash===r.queryHash&&P(R);break;case"fulfilled":(T.status==="error"||T.data!==R.value)&&q();break;case"rejected":(T.status!=="error"||T.error!==R.reason)&&q();break}}return T}updateResult(){const e=A(this,nn),n=this.createResult(A(this,Ae),this.options);if(ne(this,Oo,A(this,Ae).state),ne(this,wl,this.options),A(this,Oo).data!==void 0&&ne(this,kl,A(this,Ae)),cv(n,e))return;ne(this,nn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!A(this,Sl).size)return!0;const o=new Set(i??A(this,Sl));return this.options.throwOnError&&o.add("error"),Object.keys(A(this,nn)).some(a=>{const l=a;return A(this,nn)[l]!==e[l]&&o.has(l)})};Te(this,Ie,zT).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,Ie,gv).call(this)}},pn=new WeakMap,Ae=new WeakMap,sd=new WeakMap,nn=new WeakMap,Oo=new WeakMap,wl=new WeakMap,hi=new WeakMap,pi=new WeakMap,id=new WeakMap,xl=new WeakMap,kl=new WeakMap,Ro=new WeakMap,Po=new WeakMap,mi=new WeakMap,Sl=new WeakMap,Ie=new WeakSet,Tc=function(e){Te(this,Ie,bv).call(this);let n=A(this,Ae).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(yn)),n},hv=function(){Te(this,Ie,yv).call(this);const e=Ri(this.options.staleTime,A(this,Ae));if(Wo||A(this,nn).isStale||!lv(e))return;const r=IT(A(this,nn).dataUpdatedAt,e)+1;ne(this,Ro,setTimeout(()=>{A(this,nn).isStale||this.updateResult()},r))},pv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(A(this,Ae)):this.options.refetchInterval)??!1},mv=function(e){Te(this,Ie,vv).call(this),ne(this,mi,e),!(Wo||Vn(this.options.enabled,A(this,Ae))===!1||!lv(A(this,mi))||A(this,mi)===0)&&ne(this,Po,setInterval(()=>{(this.options.refetchIntervalInBackground||Ib.isFocused())&&Te(this,Ie,Tc).call(this)},A(this,mi)))},gv=function(){Te(this,Ie,hv).call(this),Te(this,Ie,mv).call(this,Te(this,Ie,pv).call(this))},yv=function(){A(this,Ro)&&(clearTimeout(A(this,Ro)),ne(this,Ro,void 0))},vv=function(){A(this,Po)&&(clearInterval(A(this,Po)),ne(this,Po,void 0))},bv=function(){const e=A(this,pn).getQueryCache().build(A(this,pn),this.options);if(e===A(this,Ae))return;const n=A(this,Ae);ne(this,Ae,e),ne(this,sd,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},zT=function(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(A(this,nn))}),A(this,pn).getQueryCache().notify({query:A(this,Ae),type:"observerResultsUpdated"})})},vC);function lL(t,e){return Vn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function v1(t,e){return lL(t,e)||t.state.data!==void 0&&wv(t,e,e.refetchOnMount)}function wv(t,e,n){if(Vn(e.enabled,t)!==!1&&Ri(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&jb(t,e)}return!1}function b1(t,e,n,r){return(t!==e||Vn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&jb(t,n)}function jb(t,e){return Vn(e.enabled,t)!==!1&&t.isStaleByTime(Ri(e.staleTime,t))}function cL(t,e){return!cv(t.getCurrentResult(),e)}var UT=x.createContext(void 0),uL=t=>{const e=x.useContext(UT);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},dL=({client:t,children:e})=>(x.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),m.jsx(UT.Provider,{value:t,children:e})),VT=x.createContext(!1),fL=()=>x.useContext(VT);VT.Provider;function hL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var pL=x.createContext(hL()),mL=()=>x.useContext(pL),gL=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOn
40Mount=!1))},yL=t=>{x.useEffect(()=>{t.clearReset()},[t])},vL=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||K2(n,[t.error,r])),bL=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))}},wL=(t,e)=>t.isLoading&&t.isFetching&&!e,xL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,w1=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function kL(t,e,n){var d,f,h,p,g;const r=fL(),s=mL(),i=uL(),o=i.defaultQueryOptions(t);(f=(d=i.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),o._optimisticResults=r?"isRestoring":"optimistic",bL(o),gL(o,s),yL(s);const a=!i.getQueryCache().get(o.queryHash),[l]=x.useState(()=>new e(i,o)),c=l.getOptimisticResult(o),u=!r&&t.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const v=u?l.subscribe(Bt.batchCalls(y)):yn;return l.updateResult(),v},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),x.useEffect(()=>{l.setOptions(o)},[o,l]),xL(o,c))throw w1(o,l,s);if(vL({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((p=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||p.call(h,o,c),o.experimental_prefetchInRender&&!Wo&&wL(c,r)){const y=a?w1(o,l,s):(g=i.getQueryCache().get(o.queryHash))==null?void 0:g.promise;y==null||y.catch(yn).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function HT(t,e){return kL(t,aL)}/**
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 Nu(){return Nu=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},Nu.apply(this,arguments)}var vi;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(vi||(vi={}));const x1="popstate";function SL(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:o,hash:a}=r.location;return xv("",{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:kh(s)}return CL(e,n,null,t)}function vt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function WT(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function EL(){return Math.random().toString(36).substr(2,8)}function k1(t,e){return{usr:t.state,key:t.key,idx:e}}function xv(t,e,n,r){return n===void 0&&(n=null),Nu({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Jl(e):e,{state:n,key:e&&e.key||r||EL()})}function kh(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 Jl(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 CL(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=vi.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(Nu({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=vi.Pop;let y=u(),v=y==null?null:y-c;c=y,l&&l({action:a,location:g.location,delta:v})}function f(y,v){a=vi.Push;let b=xv(g.location,y,v);c=u()+1;let w=k1(b,c),k=g.createHref(b);try{o.pushState(w,"",k)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(k)}i&&l&&l({action:a,location:g.location,delta:1})}function h(y,v){a=vi.Replace;let b=xv(g.location,y,v);c=u();let w=k1(b,c),k=g.createHref(b);o.replaceState(w,"",k),i&&l&&l({action:a,location:g.location,delta:0})}function p(y){let v=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof y=="string"?y:kh(y);return b=b.replace(/ $/,"%20"),vt(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let g={get action(){return a},get location(){return t(s,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(x1,d),l=y,()=>{s.removeEventListener(x1,d),l=null}},createHref(y){return e(s,y)},createURL:p,encodeLocation(y){let v=p(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:h,go(y){return o.go(y)}};return g}var S1;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(S1||(S1={}));function _L(t,e,n){return n===void 0&&(n="/"),TL(t,e,n,!1)}function TL(t,e,n,r){let s=typeof e=="string"?Jl(e):e,i=Mb(s.pathname||"/",n);if(i==null)return null;let o=qT(t);AL(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=FL(i);a=DL(o[l],c,r)}return a}function qT(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(vt(l.relativePath.startsWith(r),'Absolute route path "'+l.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."),l.relativePath=l.relativePath.slice(r.length));let c=Pi([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(vt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),qT(i.children,e,u,c)),!(i.path==null&&!i.index)&&e.push({path:c,score:ML(c,i.index),routesMeta:u})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of KT(i.path))s(i,o,l)}),e}function KT(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=KT(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function AL(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:LL(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const NL=/^:[\w-]+$/,OL=3,RL=2,PL=1,IL=10,jL=-2,E1=t=>t==="*";function ML(t,e){let n=t.split("/"),r=n.length;return n.some(E1)&&(r+=jL),e&&(r+=RL),n.filter(s=>!E1(s)).reduce((s,i)=>s+(NL.test(i)?OL:i===""?PL:IL),r)}function LL(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 DL(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=i==="/"?e:e.slice(i.length)||"/",d=C1({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=C1({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;
vendor: 13,984 bytes, lines 49-67
49Object.assign(s,d.params),o.push({params:s,pathname:Pi([i,d.pathname]),pathnameBase:VL(Pi([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=Pi([i,d.pathnameBase]))}return o}function C1(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=$L(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((c,u,d)=>{let{paramName:f,isOptional:h}=u;if(f==="*"){let g=a[d]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const p=a[d];return h&&!p?c[f]=void 0:c[f]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:t}}function $L(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),WT(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,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function FL(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return WT(!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 Mb(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 BL(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?Jl(t):t;return{pathname:n?n.startsWith("/")?n:zL(n,e):e,search:HL(r),hash:WL(s)}}function zL(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 fg(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 UL(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function GT(t,e){let n=UL(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function JT(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=Jl(t):(s=Nu({},t),vt(!s.pathname||!s.pathname.includes("?"),fg("?","pathname","search",s)),vt(!s.pathname||!s.pathname.includes("#"),fg("#","pathname","hash",s)),vt(!s.search||!s.search.includes("#"),fg("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}a=d>=0?e[d]:"/"}let l=BL(s,a),c=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Pi=t=>t.join("/").replace(/\/\/+/g,"/"),VL=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),HL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,WL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function qL(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const QT=["post","put","patch","delete"];new Set(QT);const KL=["get",...QT];new Set(KL);/**
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 Ou(){return Ou=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},Ou.apply(this,arguments)}const Lb=x.createContext(null),GL=x.createContext(null),sa=x.createContext(null),Qp=x.createContext(null),Zi=x.createContext({outlet:null,matches:[],isDataRoute:!1}),ZT=x.createContext(null);function JL(t,e){let{relative:n}=e===void 0?{}:e;hd()||vt(!1);let{basename:r,navigator:s}=x.useContext(sa),{hash:i,pathname:o,search:a}=XT(t,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:Pi([r,o])),s.createHref({pathname:l,search:a,hash:i})}function hd(){return x.useContext(Qp)!=null}function Ql(){return hd()||vt(!1),x.useContext(Qp).location}function YT(t){x.useContext(sa).static||x.useLayoutEffect(t)}function pd(){let{isDataRoute:t}=x.useContext(Zi);return t?cD():QL()}function QL(){hd()||vt(!1);let t=x.useContext(Lb),{basename:e,future:n,navigator:r}=x.useContext(sa),{matches:s}=x.useContext(Zi),{pathname:i}=Ql(),o=JSON.stringify(GT(s,n.v7_relativeSplatPath)),a=x.useRef(!1);return YT(()=>{a.current=!0}),x.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=JT(c,JSON.parse(o),i,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Pi([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,o,i,t])}function ZL(){let{matches:t}=x.useContext(Zi),e=t[t.length-1];return e?e.params:{}}function XT(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=x.useContext(sa),{matches:s}=x.useContext(Zi),{pathname:i}=Ql(),o=JSON.stringify(GT(s,r.v7_relativeSplatPath));return x.useMemo(()=>JT(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function YL(t,e){return XL(t,e)}function XL(t,e,n,r){hd()||vt(!1);let{navigator:s}=x.useContext(sa),{matches:i}=x.useContext(Zi),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Ql(),u;if(e){var d;let y=typeof e=="string"?Jl(e):e;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||vt(!1),u=y}else u=c;let f=u.pathname||"/",h=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let p=_L(t,{pathname:h}),g=sD(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Pi([l,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Pi([l,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return e&&g?x.createElement(Qp.Provider,{value:{location:Ou({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:vi.Pop}},g):g}function eD(){let t=lD(),e=qL(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 x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},e),n?x.createElement("pre",{style:s},n):null,null)}const tD=x.createElement(eD,null);class nD extends x.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?x.createElement(Zi.Provider,{value:this.props.routeContext},x.createElement(ZT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rD(t){let{routeContext:e,match:n,children:r}=t,s=x.useContext(Lb);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Zi.Provider,{value:e},r)}function sD(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 u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||vt(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:f,errors:h}=n,p=d.route.loader&&f[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||p){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let h,p=!1,g=null,y=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,g=d.route.errorElement||tD,l&&(c<0&&f===0?(p=!0,y=null):c===f&&(p=!0,y=d.route.hydrateFallbackElement||null)));let v=e.concat(o.slice(0,f+1)),b=()=>{let w;return h?w=g:p?w=y:d.route.Component?w=x.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,x.createElement(rD,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?x.createElement(nD,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var eA=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(eA||{}),Sh=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}(Sh||{});function iD(t){let e=x.useContext(Lb);return e||vt(!1),e}function oD(t){let e=x.useContext(GL);return e||vt(!1),e}function aD(t){let e=x.useContext(Zi);return e||vt(!1),e}function tA(t){let e=aD(),n=e.matches[e.matches.length-1];return n.route.id||vt(!1),n.route.id}function lD(){var t;let e=x.useContext(ZT),n=oD(Sh.UseRouteError),r=tA(Sh.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function cD(){let{router:t}=iD(eA.UseNavigateStable),e=tA(Sh.UseNavigateStable),n=x.useRef(!1);return YT(()=>{n.current=!0}),x.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,Ou({fromRouteId:e},i)))},[t,e])}function uD(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function ur(t){vt(!1)}function dD(t){let{basename:e="/",children:n=null,location:r,navigationType:s=vi.Pop,navigator:i,static:o=!1,future:a}=t;hd()&&vt(!1);let l=e.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:l,navigator:i,static:o,future:Ou({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=Jl(r));let{pathname:u="/",search:d="",hash:f="",state:h=null,key:p="default"}=r,g=x.useMemo(()=>{let y=Mb(u,l);return y==null?null:{location:{pathname:y,search:d,hash:f,state:h,key:p},navigationType:s}},[l,u,d,f,h,p,s]);return g==null?null:x.createElement(sa.Provider,{value:c},x.createElement(Qp.Provider,{children:n,value:g}))}function fD(t){let{children:e,location:n}=t;return YL(kv(e),n)}new Promise(()=>{});function kv(t,e){e===void 0&&(e=[]);let n=[];return x.Children.forEach(t,(r,s)=>{if(!x.isValidElement(r))return;let i=[...e,s];if(r.type===x.Fragment){n.push.apply(n,kv(r.props.children,i));return}r.type!==ur&&vt(!1),!r.props.index||!r.props.children||vt(!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=kv(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 Sv(){return Sv=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},Sv.apply(this,arguments)}function hD(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 pD(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function mD(t,e){return t.button===0&&(!e||e==="_self")&&!pD(t)}const gD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],yD="6";try{window.__reactRouterVersion=yD}catch{}const vD="startTransition",_1=F0[vD];function bD(t){let{basename:e,children:n,future:r,window:s}=t,i=x.useRef();i.current==null&&(i.current=SL({window:s,v5Compat:!0}));let o=i.current,[a,l]=x.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},u=x.useCallback(d=>{c&&_1?_1(()=>l(d)):l(d)},[l,c]);return x.useLayoutEffect(()=>o.listen(u),[o,u]),x.useEffect(()=>uD(r),[r]),x.createElement(dD,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const wD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Et=x.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d}=e,f=hD(e,gD),{basename:h}=x.useContext(sa),p,g=!1;
67if(typeof c=="string"&&xD.test(c)&&(p=c,wD))try{let w=new URL(window.location.href),k=c.startsWith("//")?new URL(w.protocol+c):new URL(c),S=Mb(k.pathname,h);k.origin===w.origin&&S!=null?c=S+k.search+k.hash:g=!0}catch{}let y=JL(c,{relative:s}),v=kD(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:s,viewTransition:d});function b(w){r&&r(w),w.defaultPrevented||v(w)}return x.createElement("a",Sv({},f,{href:p||y,onClick:g||i?r:b,ref:n,target:l}))});var T1;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(T1||(T1={}));var A1;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(A1||(A1={}));function kD(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=pd(),c=Ql(),u=XT(t,{relative:o});return x.useCallback(d=>{if(mD(d,n)){d.preventDefault();let f=r!==void 0?r:kh(c)===kh(u);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[c,l,u,r,s,n,t,i,o,a])}const he=t=>typeof t=="string",hc=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},N1=t=>t==null?"":String(t),SD=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},ED=/###/g,O1=t=>t&&t.includes("###")?t.replace(ED,"."):t,R1=t=>!t||he(t),Wc=(t,e,n)=>{const r=he(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(R1(t))return{};const i=O1(r[s]);!t[i]&&n&&(t[i]=new n),Object.prototype.hasOwnProperty.call(t,i)?t=t[i]:t={},++s}return R1(t)?{}:{obj:t,k:O1(r[s])}},P1=(t,e,n)=>{const{obj:r,k:s}=Wc(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],o=e.slice(0,e.length-1),a=Wc(t,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=Wc(t,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},CD=(t,e,n,r)=>{const{obj:s,k:i}=Wc(t,e,Object);s[i]=s[i]||[],s[i].push(n)},Eh=(t,e)=>{const{obj:n,k:r}=Wc(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},_D=(t,e,n)=>{const r=Eh(t,n);return r!==void 0?r:Eh(e,n)},nA=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,r)?he(t[r])||t[r]instanceof String||he(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):nA(t[r],e[r],n):t[r]=e[r]);return t},ls=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),TD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},AD=t=>he(t)?t.replace(/[&<>"'\/]/g,e=>TD[e]):t;class ND{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const OD=[" ",",","?","!",";"],RD=new ND(20),PD=(t,e,n)=>{e=e||"",n=n||"";const r=OD.filter(o=>!e.includes(o)&&!n.includes(o));if(r.length===0)return!0;const s=RD.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(t);if(!i){const o=t.indexOf(n);o>0&&!s.test(t.substring(0,o))&&(i=!0)}return i},Ev=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let s=t;for(let i=0;i<r.length;){if(!s||typeof s!="object")return;let o,a="";for(let l=i;l<r.length;++l)if(l!==i&&(a+=n),a+=r[l],o=s[a],o!==void 0){if(["string","number","boolean"].includes(typeof o)&&l<r.length-1)continue;i+=l-i+1;break}s=o}return s},Ru=t=>t==null?void 0:t.replace(/_/g,"-"),ID={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class Ch{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||ID,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}
vendor: 4,110 bytes, line 67
67forward(e,n,r,s){return s&&!this.debug?null:(e=e.map(i=>he(i)?i.replace(/[\r\n\x00-\x1F\x7F]/g," "):i),he(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Ch(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Ch(this.logger,e)}}var Hr=new Ch;let Zp=class{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}once(e,n){const r=(...s)=>{n(...s),this.off(e,r)};return this.on(e,r),this}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,i])=>{for(let o=0;o<i;o++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,i])=>{for(let o=0;o<i;o++)s(e,...n)})}};class I1 extends Zp{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r,s={}){var c,u;const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.includes(".")?a=e.split("."):(a=[e,n],r&&(Array.isArray(r)?a.push(...r):he(r)&&i?a.push(...r.split(i)):a.push(r)));const l=Eh(this.data,a);return!l&&!n&&!r&&e.includes(".")&&(e=a[0],n=a[1],r=a.slice(2).join(".")),l||!o||!he(r)?l:Ev((u=(c=this.data)==null?void 0:c[e])==null?void 0:u[n],r,i)}addResource(e,n,r,s,i={silent:!1}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,n];r&&(a=a.concat(o?r.split(o):r)),e.includes(".")&&(a=e.split("."),s=n,n=a[1]),this.addNamespaces(n),P1(this.data,a,s),i.silent||this.emit("added",e,n,r,s)}addResources(e,n,r,s={silent:!1}){for(const i in r)(he(r[i])||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,i,o={silent:!1,skipCopy:!1}){let a=[e,n];e.includes(".")&&(a=e.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let l=Eh(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?nA(l,r,i):l={...l,...r},P1(this.data,a,l),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var rA={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(i=>{var o;e=((o=this.processors[i])==null?void 0:o.process(e,n,r,s))??e}),e}};const sA=Symbol("i18next/PATH_KEY");function jD(){const t=[],e=Object.create(null);let n;return e.get=(r,s)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),s===sA?t:(t.push(s),n=Proxy.revocable(r,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function rl(t,e){const{[sA]:n}=t(jD()),r=(e==null?void 0:e.keySeparator)??".",s=(e==null?void 0:e.nsSeparator)??":",i=(e==null?void 0:e.enableSelector)==="strict";if(n.length>1&&s){const o=e==null?void 0:e.ns,a=i?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(a&&(i?a:a.length>1?a.slice(1):[]).includes(n[0]))return`${n[0]}${s}${n.slice(1).join(r)}`}return n.join(r)}const hg=t=>!he(t)&&typeof t!="boolean"&&typeof t!="number";class _h extends Zp{constructor(e,n={}){super(),SD(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
67i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Hr.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const s=this.resolve(e,r);if((s==null?void 0:s.res)===void 0)return!1;const i=hg(s.res);return!(r.returnObjects===!1&&i)}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&e.includes(r),a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!PD(e,r,s);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:he(i)?[i]:i};const c=e.split(r);(r!==s||r===s&&this.options.ns.includes(c[0]))&&(i=c.shift()),e=c.join(s)}return{key:e,namespaces:he(i)?[i]:i}}translate(e,n,r){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),e==null)return"";typeof e=="function"&&(e=rl(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]),e=e.map(D=>typeof D=="function"?rl(D,{...this.options,...s}):String(D));const i=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],s),c=l[l.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const d=s.lng||this.language,f=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((d==null?void 0:d.toLowerCase())==="cimode")return f?i?{res:`${c}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:a;const h=this.resolve(e,s);let p=h==null?void 0:h.res;const g=(h==null?void 0:h.usedKey)||a,y=(h==null?void 0:h.exactUsedKey)||a,v=["[object Number]","[object Function]","[object RegExp]"],b=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,k=s.count!==void 0&&!he(s.count),S=_h.hasDefaultValue(s),C=k?this.pluralResolver.getSuffix(d,s.count,s):"",E=s.ordinal&&k?this.pluralResolver.getSuffix(d,s.count,{ordinal:!1}):"",T=k&&!s.ordinal&&s.count===0,N=T&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${C}`]||s[`defaultValue${E}`]||s.defaultValue;let P=p;w&&!p&&S&&(P=N);const q=hg(P),R=Object.prototype.toString.apply(P);if(w&&P&&q&&!v.includes(R)&&!(he(b)&&Array.isArray(P))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,P,{...s,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=D,h.usedParams=this.getUsedParamsDetails(s),h):D}if(o){const D=Array.isArray(P),I=D?[]:{},H=D?y:g;for(const U in P)if(Object.prototype.hasOwnProperty.call(P,U)){const Z=`${H}${o}${U}`;S&&!p?I[U]=this.translate(Z,{...s,defaultValue:hg(N)?N[U]:void 0,joinArrays:!1,ns:l}):I[U]=this.translate(Z,{...s,joinArrays:!1,ns:l}),I[U]===Z&&(I[U]=P[U])}p=I}}else if(w&&he(b)&&Array.isArray(p))p=p.join(b),p&&(p=this.extendTranslation(p,e,s,r));else{let D=!1,I=!1;!this.isValidLookup(p)&&S&&(D=!0,p=N),this.isValidLookup(p)||(I=!0,p=a);const U=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&I?void 0:p,Z=S&&N!==p&&this.options.updateMissing;if(I||D||Z){if(this.logger.log(Z?"updateKey":"missingKey",d,c,k&&!Z?`${a}${this.pluralResolver.getSuffix(d,s.count,s)}`:a,Z?N:p),o){const ae=this.resolve(a,{...s,keySeparator:!1});ae&&ae.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let j=[];const $=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&$&&$[0])for(let ae=0;ae<$.length;ae++)j.push($[ae]);else this.options.saveMissingTo==="all"?j=this.languageUtils.toResolveHierarchy(s.lng||this.language):j.push(s.lng||this.language);const J=(ae,se,pe)=>{var Ue;const be=S&&pe!==p?pe:U;this.options.missingKeyHandler?this.options.missingKeyHandler(ae,c,se,be,Z,s):(Ue=this.backendConnector)!=null&&Ue.saveMissing&&this.backendConnector.saveMissing(ae,c,se,be,Z,s),this.emit
vendor: 29,029 bytes, line 67
67("missingKey",ae,c,se,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?j.forEach(ae=>{const se=this.pluralResolver.getSuffixes(ae,s);T&&s[`defaultValue${this.options.pluralSeparator}zero`]&&!se.includes(`${this.options.pluralSeparator}zero`)&&se.push(`${this.options.pluralSeparator}zero`),se.forEach(pe=>{J([ae],a+pe,s[`defaultValue${pe}`]||N)})}):J(j,a,N))}p=this.extendTranslation(p,e,s,h,r),I&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${c}${u}${a}`),(I||D)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${a}`:a,D?p:void 0,s))}return i?(h.res=p,h.usedParams=this.getUsedParamsDetails(s),h):p}extendTranslation(e,n,r,s,i){var l,c;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=he(e)&&(((c=r==null?void 0:r.interpolation)==null?void 0:c.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const h=e.match(this.interpolator.nestingRegexp);d=h&&h.length}let f=r.replace&&!he(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,r.lng||this.language||s.usedLng,r),u){const h=e.match(this.interpolator.nestingRegexp),p=h&&h.length;d<p&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>(i==null?void 0:i[0])===h[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):this.translate(...h,n),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,a=he(o)?[o]:o;return e!=null&&(a!=null&&a.length)&&r.applyPostProcessor!==!1&&(e=rA.handle(a,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,s,i,o,a;return he(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?rl(l,{...this.options,...n}):l)),e.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;s=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&!he(n.count),h=f&&!n.ordinal&&n.count===0,p=n.context!==void 0&&(he(n.context)||typeof n.context=="number")&&n.context!=="",g=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(y=>{var v,b;this.isValidLookup(r)||(a=y,!this.checkedLoadedFor[`${g[0]}-${y}`]&&((v=this.utils)!=null&&v.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(a))&&(this.checkedLoadedFor[`${g[0]}-${y}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(w=>{var C;if(this.isValidLookup(r))return;o=w;const k=[u];if((C=this.i18nFormat)!=null&&C.addLookupKeys)this.i18nFormat.addLookupKeys(k,u,w,y,n);else{let E;f&&(E=this.pluralResolver.getSuffix(w,n.count,n));const T=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(n.ordinal&&E.startsWith(N)&&k.push(u+E.replace(N,this.options.pluralSeparator)),k.push(u+E),h&&k.push(u+T)),p){const P=`${u}${this.options.contextSeparator||"_"}${n.context}`;k.push(P),f&&(n.ordinal&&E.startsWith(N)&&k.push(P+E.replace(N,this.options.pluralSeparator)),k.push(P+E),h&&k.push(P+T))}}let S;for(;S=k.pop();)this.isValidLookup(r)||(i=S,r=this.getResource(w,y,S,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,s={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!he(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&r.startsWith(n)&&e[r]!==void 0)return!0;return!1}}class j1{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Hr.create("languageUtils")}getScriptPartFromCode(e){if(e=Ru(e),!e||!e.includes("-"))return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Ru(e),!e||!e.includes("-"))return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(he(e)&&e.includes("-")){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return n=s;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>o===i?!0:!o.includes("-")&&!i.includes("-")?!1:!!(o.includes("-")&&!i.includes("-")&&o.slice(0,o.indexOf("-"))===i||o.startsWith(i)&&i.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),he(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return he(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):he(e)&&i(this.formatLanguageCode(e)),r.forEach(o=>{s.includes(o)||i(this.formatLanguageCode(o))}),s}}const M1={zero:0,one:1,two:2,few:3,many:4,other:5},L1={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class MD{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Hr.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=Ru(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),L1;if(!e.match(/-|_/))return L1;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[i]=o,o}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,i)=>M1[s]-M1[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,n,r={}){const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const D1=(t,e,n,r=".",s=!0)=>{let i=_D(t,e,n);return!i&&s&&he(n)&&(i=Ev(t,n,r),i===void 0&&(i=Ev(e,n,r))),i},pg=t=>t.replace(/\$/g,"$$$$");class $1{constructor(e={}){var n;this.logger=Hr.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:y,maxReplaces:v,alwaysFormat:b}=e.interpolation;this.escape=n!==void 0?n:AD,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?ls(i):o||"{{",this.suffix=a?ls(a):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d?ls(d):"-",this.unescapeSuffix=this.unescapePrefix?"":u?ls(u):"",this.nestingPrefix=f?ls(f):h||ls("$t("),this.nestingSuffix=p?ls(p):g||ls(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=v||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,r,s){var h;let i,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=p=>{if(!p.includes(this.formatSeparator)){const b=D1(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...s,...n,interpolationkey:p}):b}const g=p.split(this.formatSeparator),y=g.shift().trim(),v=g.join(this.formatSeparator).trim();return this.format(D1(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),v,r,{...s,...n,interpolationkey:y})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((h=s==null?void 0:s.interpolation)==null?void 0:h.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>pg(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?pg(this.escape(p)):pg(p)}].forEach(p=>{for(a=0;i=p.regex.exec(e);){const g=i[1].trim();if(o=c(g),o===void 0)if(typeof u=="function"){const v=u(e,i,s);o=he(v)?v:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))o="";else if(d){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),o="";else!he(o)&&!this.useRawValueToEscape&&(o=N1(o));const y=p.safeValue(o);if(e=e.replace(i[0],y),d?(p.regex.lastIndex+=o.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n,r={}){let s,i,o;const a=(l,c)=>{const u=this.nestingOptionsSeparator;if(!l.includes(u))return l;const d=l.split(new RegExp(`${ls(u)}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,o);const h=f.match(/'/g),p=f.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!p||((p==null?void 0:p.length)??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),c&&(o={...c,...o})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,g),`${l}${u}${f}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&!he(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const c=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(c!==-1&&(l=s[1].slice(c).split(this.formatSeparator).map(u=>u.trim()).filter(Boolean),s[1]=s[1].slice(0,c)),i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&!he(i))return i;he(i)||(i=N1(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),l.length&&(i=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const LD=t=>{let e=t.toLowerCase().trim();const n={};if(t.includes("(")){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].slice(0,-1);e==="currency"&&!s.includes(":")?n.currency||(n.currency=s.trim()):e==="relativetime"&&!s.includes(":")?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=a.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:e,formatOptions:n}},F1=t=>{const e={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=e[o];return a||(a=t(Ru(r),s),e[o]=a),a(n)}},DD=t=>(e,n,r)=>t(Ru(n),r)(e);class $D{constructor(e={}){this.logger=Hr.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?F1:DD;this.formats={number:r((s,i)=>{const o=new Intl.NumberFormat(s,{...i});return a=>o.format(a)}),currency:r((s,i)=>{const o=new Intl.NumberFormat(s,{...i,style:"currency"});return a=>o.format(a)}),datetime:r((s,i)=>{const o=new Intl.DateTimeFormat(s,{...i});return a=>o.format(a)}),relativetime:r((s,i)=>{const o=new Intl.RelativeTimeFormat(s,{...i});return a=>o.format(a,i.range||"day")}),list:r((s,i)=>{const o=new Intl.ListFormat(s,{...i});return a=>o.format(a)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=F1(n)}format(e,n,r,s={}){if(!n||e==null)return e;const i=n.split(this.formatSeparator),o=[];for(let l=0;l<i.length;l++){let c=i[l];for(;c.indexOf("(")>-1&&!c.includes(")")&&l+1<i.length;)c=`${c}${this.formatSeparator}${i[++l]}`;o.push(c)}return o.reduce((l,c)=>{var f;const{formatName:u,formatOptions:d}=LD(c);if(this.formats[u]){let h=l;try{const p=((f=s==null?void 0:s.formatParams)==null?void 0:f[s.interpolationkey])||{},g=p.locale||p.lng||s.locale||s.lng||r;h=this.formats[u](l,g,{...d,...s,...p})}catch(p){this.logger.warn(p)}return h}else this.logger.warn(`there was no format function for ${u}`);return l},e)}}const FD=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class BD extends Zp{constructor(e,n,r,s={}){var i,o;super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Hr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,r,s.backend,s)}queueLoad(e,n,r,s){const i={},o={},a={},l={};return e.forEach(c=>{let u=!0;n.forEach(d=>{const f=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,u=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(a[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const s=e.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const a={};this.queue.forEach(l=>{CD(l.loaded,[i],o),FD(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{a[c][d]===void 0&&(a[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r,s=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&s<this.maxRetries){setTimeout(()=>{this.read(e,n,r,s+1,i*2,o)},i);return}o(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(e,n);c&&typeof c.then=="function"?c.then(u=>a(null,u)).catch(a):a(null,c)}catch(c){a(c)}return}return l(e,n,a)}prepareLoading(e,n,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();he(e)&&(e=this.languageUtils.toResolveHierarchy(e)),he(n)&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,n,r,s,i,o={},a=()=>{}){var l,c,u,d,f;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((d=(u=this.services)==null?void 0:u.utils)!=null&&d.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((f=this.backend)!=null&&f.create){const h={...o,isUpdate:i},p=this.backend.create.bind(this.backend);if(p.length<6)try{let g;p.length===5?g=p(e,n,r,s,h):g=p(e,n,r,s),g&&typeof g.then=="function"?g.then(y=>a(null,y)).catch(a):a(null,g)}catch(g){a(g)}else p(e,n,r,s,a,h)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const mg=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),he(t[1])&&(e.defaultValue=t[1]),he(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),B1=t=>(he(t.ns)&&(t.ns=[t.ns]),he(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),he(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Qd=()=>{},zD=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class qc extends Zp{constructor(e={},n){if(super(),this.options=B1(e),this.services={},this.logger=Hr,this.modules={external:[]},zD(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(he(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const r=mg();this.options={...r,...this.options,...B1(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const s=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?Hr.init(s(this.modules.logger),this.options):Hr.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=$D;const u=new j1(this.options);this.store=new I1(this.options.resources,this.options);const d=this.services;d.logger=Hr,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new MD(u,{prepend:this.options.pluralSeparator}),c&&(d.formatter=s(c),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new $1(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new BD(s(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.languageDetector&&(d.languageDetector=s(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=s(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new _h(this.services,this.options),this.translator.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Qd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...u)=>this.store[c](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...u)=>(this.store[c](...u),this)});const a=hc(),l=()=>{const c=(u,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(d),n(u,d)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,n=Qd){var i,o;let r=n;const s=he(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(d=>{d!=="cimode"&&(a.includes(d)||a.push(d))})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>l(u)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,c=>l(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(e,n,r){const s=hc();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Qd),this.services.backendConnector.reload(e,n,i=>{s.resolve(),r(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&rA.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!["cimode","dev"].includes(r)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=hc();this.emit("languageChanging",e);const s=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...c)=>this.t(...c)),n&&n(a,(...c)=>this.t(...c))},o=a=>{var u,d;!e&&!a&&this.services.languageDetector&&(a=[]);const l=he(a)?a:a&&a[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(he(a)?[a]:a);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(d=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||d.call(u,c)),this.loadResources(c,f=>{i(f,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,n,r,s){const i=s==null?void 0:s.scopeNs,o=(a,l,...c)=>{let u;typeof l!="object"?u=this.options.overloadTranslationOptionHandler([a,l].concat(c)):u={...l},u.lng=u.lng||o.lng,u.lngs=u.lngs||o.lngs;const d=u.ns!==void 0&&u.ns!==null;u.ns=u.ns||o.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||o.keyPrefix);const f={...this.options,...u};Array.isArray(i)&&!d&&(f.ns=i),typeof u.keyPrefix=="function"&&(u.keyPrefix=rl(u.keyPrefix,f));const h=this.options.keySeparator||".";let p;return u.keyPrefix&&Array.isArray(a)?p=a.map(g=>(typeof g=="function"&&(g=rl(g,f)),`${u.keyPrefix}${h}${g}`)):(typeof a=="function"&&(a=rl(a,f)),p=u.keyPrefix?`${u.keyPrefix}${h}${a}`:a),this.t(p,u)};return he(e)?o.lng=e:o.lngs=e,o.ns=n,o.keyPrefix=r,o}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
67if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const c=this.services.backendConnector.state[`${a}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!s||o(i,e)))}loadNamespaces(e,n){const r=hc();return this.options.ns?(he(e)&&(e=[e]),e.forEach(s=>{this.options.ns.includes(s)||this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=hc();he(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(o=>!s.includes(o)&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){var s,i;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new j1(mg());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(r.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const r=new qc(e,n);return r.createInstance=qc.createInstance,r}cloneInstance(e={},n=Qd){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new qc(s);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const a=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((u,d)=>(u[d]={...l[c][d]},u),l[c]),l),{});i.store=new I1(a,s),i.services.resourceStore=i.store}if(e.interpolation){const l={...mg().interpolation,...this.options.interpolation,...e.interpolation},c={...s,interpolation:l};i.services.interpolator=new $1(c)}return i.translator=new _h(i.services,s),i.translator.on("*",(a,...l)=>{i.emit(a,...l)}),i.init(s,n),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const fn=qc.createInstance();fn.createInstance;fn.dir;fn.init;fn.loadResources;fn.reloadResources;fn.use;fn.changeLanguage;fn.getFixedT;fn.t;fn.exists;fn.setDefaultNamespace;fn.hasLoadedNamespace;fn.loadNamespaces;fn.loadLanguages;const UD=(t,e,n,r)=>{var i,o,a,l;const s=[n,{code:e,...r||{}}];if((o=(i=t==null?void 0:t.services)==null?void 0:i.logger)!=null&&o.forward)return t.services.logger.forward(s,"warn","react-i18next::",!0);qo(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(l=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&l.warn?t.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},z1={},Cv=(t,e,n,r)=>{qo(n)&&z1[n]||(qo(n)&&(z1[n]=new Date),UD(t,e,n,r))},iA=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},_v=(t,e,n)=>{t.loadNamespaces(e,iA(t,n))},U1=(t,e,n,r)=>{if(qo(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return _v(t,n,r);
67n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,iA(t,r))},VD=(t,e,n={})=>!e.languages||!e.languages.length?(Cv(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,t))return!1}}),qo=t=>typeof t=="string",HD=t=>typeof t=="object"&&t!==null,WD=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qD={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},KD=t=>qD[t],GD=t=>t.replace(WD,KD);let Tv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:GD,transDefaultProps:void 0};const JD=(t={})=>{Tv={...Tv,...t}},QD=()=>Tv;let oA;const ZD=t=>{oA=t},YD=()=>oA,XD={type:"3rdParty",init(t){JD(t.options.react),ZD(t)}},e$=x.createContext();class t${constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var aA={exports:{}},lA={};/**
68 * @license React
69 * use-sync-external-store-shim.production.js
70 *
71 * Copyright (c) Meta Platforms, Inc. and affiliates.
72 *
73 * This source code is licensed under the MIT license found in the
74 * LICENSE file in the root directory of this source tree.
75 */var Rl=x;function n$(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var r$=typeof Object.is=="function"?Object.is:n$,s$=Rl.useState,i$=Rl.useEffect,o$=Rl.useLayoutEffect,a$=Rl.useDebugValue;function l$(t,e){var n=e(),r=s$({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return o$(function(){s.value=n,s.getSnapshot=e,gg(s)&&i({inst:s})},[t,n,e]),i$(function(){return gg(s)&&i({inst:s}),t(function(){gg(s)&&i({inst:s})})},[t]),a$(n),n}function gg(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!r$(t,n)}catch{return!0}}function c$(t,e){return e()}var u$=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c$:l$;lA.useSyncExternalStore=Rl.useSyncExternalStore!==void 0?Rl.useSyncExternalStore:u$;aA.exports=lA;var d$=aA.exports;const f$=(t,e)=>{if(qo(e))return e;if(HD(e)&&qo(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const n=t[t.length-1];return typeof n=="function"?"":n}return t},h$={t:f$,ready:!1},p$=()=>()=>{},Mt=(t,e={})=>{var N,P,q;const{i18n:n}=e,{i18n:r,defaultNS:s}=x.useContext(e$)||{},i=n||r||YD();i&&!i.reportNamespaces&&(i.reportNamespaces=new t$),i||Cv(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=x.useMemo(()=>{var R;return{...QD(),...(R=i==null?void 0:i.options)==null?void 0:R.react,...e}},[i,e]),{useSuspense:a,keyPrefix:l}=o,c=s||((N=i==null?void 0:i.options)==null?void 0:N.defaultNS),u=qo(c)?[c]:c||["translation"],d=x.useMemo(()=>u,u);(q=(P=i==null?void 0:i.reportNamespaces)==null?void 0:P.addUsedNamespaces)==null||q.call(P,d);const f=x.useRef(0),h=x.useCallback(R=>{if(!i)return p$;const{bindI18n:D,bindI18nStore:I}=o,H=()=>{f.current+=1,R()};return D&&i.on(D,H),I&&i.store.on(I,H),()=>{D&&D.split(" ").forEach(U=>i.off(U,H)),I&&I.split(" ").forEach(U=>i.store.off(U,H))}},[i,o]),p=x.useRef(),g=x.useCallback(()=>{if(!i)return h$;const R=!!(i.isInitialized||i.initializedStoreOnce)&&d.every(j=>VD(j,i,o)),D=e.lng||i.language,I=f.current,H=p.current;if(H&&H.ready===R&&H.lng===D&&H.keyPrefix===l&&H.revision===I)return H;const Z={t:i.getFixedT(D,o.nsMode==="fallback"?d:d[0],l,{scopeNs:d}),ready:R,lng:D,keyPrefix:l,revision:I};return p.current=Z,Z},[i,d,l,o,e.lng]),[y,v]=x.useState(0),{t:b,ready:w}=d$.useSyncExternalStore(h,g,g);x.useEffect(()=>{if(i&&!w&&!a){const R=()=>v(D=>D+1);e.lng?U1(i,e.lng,d,R):_v(i,d,R)}},[i,e.lng,d,w,a,y]);const k=i||{},S=x.useRef(null),C=x.useRef(),E=R=>{const D=Object.getOwnPropertyDescriptors(R);D.__original&&delete D.__original;const I=Object.create(Object.getPrototypeOf(R),D);if(!Object.prototype.hasOwnProperty.call(I,"__original"))try{Object.defineProperty(I,"__original",{value:R,writable:!1,enumerable:!1,
75configurable:!1})}catch{}return I},T=x.useMemo(()=>{const R=k,D=R==null?void 0:R.language;let I=R;R&&(S.current&&S.current.__original===R?C.current!==D?(I=E(R),S.current=I,C.current=D):I=S.current:(I=E(R),S.current=I,C.current=D));const H=!w&&!a?(...Z)=>(Cv(i,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...Z)):b,U=[H,I,w];return U.t=H,U.i18n=I,U.ready=w,U},[b,k,w,k.resolvedLanguage,k.language,k.languages]);if(i&&a&&!w)throw new Promise(R=>{const D=()=>R();e.lng?U1(i,e.lng,d,D):_v(i,d,D)});return T};var V1=["light","dark"],m$="(prefers-color-scheme: dark)",g$=x.createContext(void 0),y$={setTheme:t=>{},themes:[]},v$=()=>{var t;return(t=x.useContext(g$))!=null?t:y$};x.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let c=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(p=>`'${p}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=s?V1.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(p,g=!1,y=!0)=>{let v=o?o[p]:p,b=g?p+"|| ''":`'${v}'`,w="";return s&&y&&!g&&V1.includes(p)&&(w+=`d.style.colorScheme = '${p}';`),n==="class"?g||v?w+=`c.add(${b})`:w+="null":v&&(w+=`d[s](n,${b})`),w},h=t?`!function(){${u}${f(t)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${m$}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${c?"":"else{"+f(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${d}}catch(t){}}();`;return x.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})});var b$=t=>{switch(t){case"success":return k$;case"info":return E$;case"warning":return S$;case"error":return C$;default:return null}},w$=Array(12).fill(0),x$=({visible:t,className:e})=>M.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},M.createElement("div",{className:"sonner-spinner"},w$.map((n,r)=>M.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),k$=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),S$=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},M.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"})),E$=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),C$=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),_$=M.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"},M.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),M.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),T$=()=>{let[t,e]=M.useState(document.hidden);return M.useEffect(()=>{let n=()=>{e(document.hidden)};
75return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},Av=1,A$=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:Av++,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 l=>{if(i=["resolve",l],M.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(O$(l)&&!l.ok){s=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:c,description:u})}else if(e.success!==void 0){s=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,c)=>o.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));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)||Av++;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}},gn=new A$,N$=(t,e)=>{let n=(e==null?void 0:e.id)||Av++;return gn.addToast({title:t,...e,id:n}),n},O$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",R$=N$,P$=()=>gn.toasts,I$=()=>gn.getActiveToasts(),kr=Object.assign(R$,{success:gn.success,info:gn.info,warning:gn.warning,error:gn.error,custom:gn.custom,message:gn.message,promise:gn.promise,dismiss:gn.dismiss,loading:gn.loading},{getHistory:P$,getToasts:I$});function j$(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))}j$(`: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;
75left: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}
75: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%);
75--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%)}
76`);function Zd(t){return t.label!==void 0}var M$=3,L$="32px",D$="16px",H1=4e3,$$=356,F$=14,B$=20,z$=200;function cr(...t){return t.filter(Boolean).join(" ")}function U$(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var V$=t=>{var e,n,r,s,i,o,a,l,c,u,d;let{invert:f,toast:h,unstyled:p,interacting:g,setHeights:y,visibleToasts:v,heights:b,index:w,toasts:k,expanded:S,removeToast:C,defaultRichColors:E,closeButton:T,style:N,cancelButtonStyle:P,actionButtonStyle:q,className:R="",descriptionClassName:D="",duration:I,position:H,gap:U,loadingIcon:Z,expandByDefault:j,classNames:$,icons:J,closeButtonAriaLabel:ae="Close toast",pauseWhenPageIsHidden:se}
vendor: 3,388 bytes, line 76
76=t,[pe,be]=M.useState(null),[Ue,Tt]=M.useState(null),[Ne,ns]=M.useState(!1),[Fn,sr]=M.useState(!1),[Or,rs]=M.useState(!1),[Rr,to]=M.useState(!1),[fa,ha]=M.useState(!1),[sc,pa]=M.useState(0),[ss,_]=M.useState(0),O=M.useRef(h.duration||I||H1),L=M.useRef(null),G=M.useRef(null),K=w===0,W=w+1<=v,ee=h.type,_e=h.dismissible!==!1,Fe=h.className||"",hn=h.descriptionClassName||"",is=M.useMemo(()=>b.findIndex(ve=>ve.toastId===h.id)||0,[b,h.id]),Pr=M.useMemo(()=>{var ve;return(ve=h.closeButton)!=null?ve:T},[h.closeButton,T]),Ad=M.useMemo(()=>h.duration||I||H1,[h.duration,I]),no=M.useRef(0),Ir=M.useRef(0),Nd=M.useRef(0),as=M.useRef(null),[Lm,Od]=H.split("-"),ex=M.useMemo(()=>b.reduce((ve,Be,Qe)=>Qe>=is?ve:ve+Be.height,0),[b,is]),tx=T$(),mj=h.invert||f,Dm=ee==="loading";Ir.current=M.useMemo(()=>is*U+ex,[is,ex]),M.useEffect(()=>{O.current=Ad},[Ad]),M.useEffect(()=>{ns(!0)},[]),M.useEffect(()=>{let ve=G.current;if(ve){let Be=ve.getBoundingClientRect().height;return _(Be),y(Qe=>[{toastId:h.id,height:Be,position:h.position},...Qe]),()=>y(Qe=>Qe.filter(ir=>ir.toastId!==h.id))}},[y,h.id]),M.useLayoutEffect(()=>{if(!Ne)return;let ve=G.current,Be=ve.style.height;ve.style.height="auto";let Qe=ve.getBoundingClientRect().height;ve.style.height=Be,_(Qe),y(ir=>ir.find(or=>or.toastId===h.id)?ir.map(or=>or.toastId===h.id?{...or,height:Qe}:or):[{toastId:h.id,height:Qe,position:h.position},...ir])},[Ne,h.title,h.description,y,h.id]);let Bs=M.useCallback(()=>{sr(!0),pa(Ir.current),y(ve=>ve.filter(Be=>Be.toastId!==h.id)),setTimeout(()=>{C(h)},z$)},[h,C,y,Ir]);M.useEffect(()=>{if(h.promise&&ee==="loading"||h.duration===1/0||h.type==="loading")return;let ve;return S||g||se&&tx?(()=>{if(Nd.current<no.current){let Be=new Date().getTime()-no.current;O.current=O.current-Be}Nd.current=new Date().getTime()})():O.current!==1/0&&(no.current=new Date().getTime(),ve=setTimeout(()=>{var Be;(Be=h.onAutoClose)==null||Be.call(h,h),Bs()},O.current)),()=>clearTimeout(ve)},[S,g,h,ee,se,tx,Bs]),M.useEffect(()=>{h.delete&&Bs()},[Bs,h.delete]);function gj(){var ve,Be,Qe;return J!=null&&J.loading?M.createElement("div",{className:cr($==null?void 0:$.loader,(ve=h==null?void 0:h.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":ee==="loading"},J.loading):Z?M.createElement("div",{className:cr($==null?void 0:$.loader,(Be=h==null?void 0:h.classNames)==null?void 0:Be.loader,"sonner-loader"),"data-visible":ee==="loading"},Z):M.createElement(x$,{className:cr($==null?void 0:$.loader,(Qe=h==null?void 0:h.classNames)==null?void 0:Qe.loader),visible:ee==="loading"})}return M.createElement("li",{tabIndex:0,ref:G,className:cr(R,Fe,$==null?void 0:$.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,$==null?void 0:$.default,$==null?void 0:$[ee],(n=h==null?void 0:h.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:E,"data-styled":!(h.jsx||h.unstyled||p),"data-mounted":Ne,"data-promise":!!h.promise,"data-swiped":fa,"data-removed":Fn,"data-visible":W,"data-y-position":Lm,"data-x-position":Od,"data-index":w,"data-front":K,"data-swiping":Or,"data-dismissible":_e,"data-type":ee,"data-invert":mj,"data-swipe-out":Rr,"data-swipe-direction":Ue,"data-expanded":!!(S||j&&Ne),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${Fn?sc:Ir.current}px`,"--initial-height":j?"auto":`${ss}px`,...N,...h.style},onDragEnd:()=>
76{rs(!1),be(null),as.current=null},onPointerDown:ve=>{Dm||!_e||(L.current=new Date,pa(Ir.current),ve.target.setPointerCapture(ve.pointerId),ve.target.tagName!=="BUTTON"&&(rs(!0),as.current={x:ve.clientX,y:ve.clientY}))},onPointerUp:()=>{var ve,Be,Qe,ir;if(Rr||!_e)return;as.current=null;let or=Number(((ve=G.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),zs=Number(((Be=G.current)==null?void 0:Be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ro=new Date().getTime()-((Qe=L.current)==null?void 0:Qe.getTime()),ar=pe==="x"?or:zs,Us=Math.abs(ar)/ro;if(Math.abs(ar)>=B$||Us>.11){pa(Ir.current),(ir=h.onDismiss)==null||ir.call(h,h),Tt(pe==="x"?or>0?"right":"left":zs>0?"down":"up"),Bs(),to(!0),ha(!1);return}rs(!1),be(null)},onPointerMove:ve=>{var Be,Qe,ir,or;if(!as.current||!_e||((Be=window.getSelection())==null?void 0:Be.toString().length)>0)return;let zs=ve.clientY-as.current.y,ro=ve.clientX-as.current.x,ar=(Qe=t.swipeDirections)!=null?Qe:U$(H);!pe&&(Math.abs(ro)>1||Math.abs(zs)>1)&&be(Math.abs(ro)>Math.abs(zs)?"x":"y");let Us={x:0,y:0};pe==="y"?(ar.includes("top")||ar.includes("bottom"))&&(ar.includes("top")&&zs<0||ar.includes("bottom")&&zs>0)&&(Us.y=zs):pe==="x"&&(ar.includes("left")||ar.includes("right"))&&(ar.includes("left")&&ro<0||ar.includes("right")&&ro>0)&&(Us.x=ro),(Math.abs(Us.x)>0||Math.abs(Us.y)>0)&&ha(!0),(ir=G.current)==null||ir.style.setProperty("--swipe-amount-x",`${Us.x}px`),(or=G.current)==null||or.style.setProperty("--swipe-amount-y",`${Us.y}px`)}},Pr&&!h.jsx?M.createElement("button",{"aria-label":ae,"data-disabled":Dm,"data-close-button":!0,onClick:Dm||!_e?()=>{}:()=>{var ve;Bs(),(ve=h.onDismiss)==null||ve.call(h,h)},className:cr($==null?void 0:$.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=J==null?void 0:J.close)!=null?i:_$):null,h.jsx||x.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:M.createElement(M.Fragment,null,ee||h.icon||h.promise?M.createElement("div",{"data-icon":"",className:cr($==null?void 0:$.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||gj():null,h.type!=="loading"?h.icon||(J==null?void 0:J[ee])||b$(ee):null):null,M.createElement("div",{"data-content":"",className:cr($==null?void 0:$.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},M.createElement("div",{"data-title":"",className:cr($==null?void 0:$.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?M.createElement("div",{"data-description":"",className:cr(D,hn,$==null?void 0:$.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),x.isValidElement(h.cancel)?h.cancel:h.cancel&&Zd(h.cancel)?M.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:ve=>{var Be,Qe;Zd(h.cancel)&&_e&&((Qe=(Be=h.cancel).onClick)==null||Qe.call(Be,ve),Bs())},className:cr($==null?void 0:$.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,x.isValidElement(h.action)?h.action:h.action&&Zd(h.action)?M.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||q,onClick:ve=>{var Be,Qe;Zd(h.action)&&((Qe=(Be=h.action).onClick)==null||Qe.call(Be,ve),!ve.defaultPrevented&&Bs())},className:cr($==null?void 0:$.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function W1(){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 H$(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?D$:L$;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${o}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var W$=x.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:h,visibleToasts:p=M$,toastOptions:g,dir:y=W1(),gap:v=F$,loadingIcon:b,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:S}=t,[C,E]=M.useState([]),T=M.useMemo(()=>Array.from(new Set([r].concat(C.filter(se=>se.position).map(se=>
76se.position)))),[C,r]),[N,P]=M.useState([]),[q,R]=M.useState(!1),[D,I]=M.useState(!1),[H,U]=M.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=M.useRef(null),j=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=M.useRef(null),J=M.useRef(!1),ae=M.useCallback(se=>{E(pe=>{var be;return(be=pe.find(Ue=>Ue.id===se.id))!=null&&be.delete||gn.dismiss(se.id),pe.filter(({id:Ue})=>Ue!==se.id)})},[]);return M.useEffect(()=>gn.subscribe(se=>{if(se.dismiss){E(pe=>pe.map(be=>be.id===se.id?{...be,delete:!0}:be));return}setTimeout(()=>{Ob.flushSync(()=>{E(pe=>{let be=pe.findIndex(Ue=>Ue.id===se.id);return be!==-1?[...pe.slice(0,be),{...pe[be],...se},...pe.slice(be+1)]:[se,...pe]})})})}),[]),M.useEffect(()=>{if(u!=="system"){U(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let se=window.matchMedia("(prefers-color-scheme: dark)");try{se.addEventListener("change",({matches:pe})=>{U(pe?"dark":"light")})}catch{se.addListener(({matches:be})=>{try{U(be?"dark":"light")}catch(Ue){console.error(Ue)}})}},[u]),M.useEffect(()=>{C.length<=1&&R(!1)},[C]),M.useEffect(()=>{let se=pe=>{var be,Ue;s.every(Tt=>pe[Tt]||pe.code===Tt)&&(R(!0),(be=Z.current)==null||be.focus()),pe.code==="Escape"&&(document.activeElement===Z.current||(Ue=Z.current)!=null&&Ue.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[s]),M.useEffect(()=>{if(Z.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,J.current=!1)}},[Z.current]),M.createElement("section",{ref:e,"aria-label":`${k} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((se,pe)=>{var be;let[Ue,Tt]=se.split("-");return C.length?M.createElement("ol",{key:se,dir:y==="auto"?W1():y,tabIndex:-1,ref:Z,className:a,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":Ue,"data-lifted":q&&C.length>1&&!i,"data-x-position":Tt,style:{"--front-toast-height":`${((be=N[0])==null?void 0:be.height)||0}px`,"--width":`${$$}px`,"--gap":`${v}px`,...h,...H$(l,c)},onBlur:Ne=>{J.current&&!Ne.currentTarget.contains(Ne.relatedTarget)&&(J.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:Ne=>{Ne.target instanceof HTMLElement&&Ne.target.dataset.dismissible==="false"||J.current||(J.current=!0,$.current=Ne.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{D||R(!1)},onDragEnd:()=>R(!1),onPointerDown:Ne=>{Ne.target instanceof HTMLElement&&Ne.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},C.filter(Ne=>!Ne.position&&pe===0||Ne.position===se).map((Ne,ns)=>{var Fn,sr;return M.createElement(V$,{key:Ne.id,icons:w,index:ns,toast:Ne,defaultRichColors:d,duration:(Fn=g==null?void 0:g.duration)!=null?Fn:f,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:p,closeButton:(sr=g==null?void 0:g.closeButton)!=null?sr:o,interacting:D,position:se,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ae,toasts:C.filter(Or=>Or.position==Ne.position),heights:N.filter(Or=>Or.position==Ne.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:b,expanded:q,pauseWhenPageIsHidden:S,swipeDirections:t.swipeDirections})})):null}))});const q$=({...t})=>{const{theme:e="system"}=v$();return m.jsx(W$,{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})},K$=1,G$=1e6;let yg=0;function J$(){return yg=(yg+1)%Number.MAX_SAFE_INTEGER,yg.toString()}const vg=new Map,q1=t=>{if(vg.has(t))return;const e=setTimeout(()=>{vg.delete(t),Kc({type:"REMOVE_TOAST",toastId:t})},G$);vg.set(t,e)},Q$=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,K$)};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;
76return n?q1(n):t.toasts.forEach(r=>{q1(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)}}},Lf=[];let Df={toasts:[]};function Kc(t){Df=Q$(Df,t),Lf.forEach(e=>{e(Df)})}function Z$({...t}){const e=J$(),n=s=>Kc({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Kc({type:"DISMISS_TOAST",toastId:e});return Kc({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function Yp(){const[t,e]=x.useState(Df);return x.useEffect(()=>(Lf.push(e),()=>{const n=Lf.indexOf(e);n>-1&&Lf.splice(n,1)}),[t]),{...t,toast:Z$,dismiss:n=>Kc({type:"DISMISS_TOAST",toastId:n})}}function Ge(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 K1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function cA(...t){return e=>{let n=!1;const r=t.map(s=>{const i=K1(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():K1(t[s],null)}}}}function qt(...t){return x.useCallback(cA(...t),t)}function Y$(t,e){const n=x.createContext(e),r=i=>{const{children:o,...a}=i,l=x.useMemo(()=>a,Object.values(a));return m.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function s(i){const o=x.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 ia(t,e=[]){let n=[];function r(i,o){const a=x.createContext(o),l=n.length;n=[...n,o];const c=d=>{var v;const{scope:f,children:h,...p}=d,g=((v=f==null?void 0:f[t])==null?void 0:v[l])||a,y=x.useMemo(()=>p,Object.values(p));return m.jsx(g.Provider,{value:y,children:h})};c.displayName=i+"Provider";function u(d,f){var g;const h=((g=f==null?void 0:f[t])==null?void 0:g[l])||a,p=x.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const s=()=>{const i=n.map(o=>x.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return x.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,X$(s,...e)]}function X$(...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:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Pu(t){const e=e4(t),n=x.forwardRef((r,s)=>{const{children:i,...o}=r,a=x.Children.toArray(i),l=a.find(t4);if(l){const c=l.props.children,u=a.map(d=>d===l?x.Children.count(c)>1?x.Children.only(null):x.isValidElement(c)?c.props.children:null:d);return m.jsx(e,{...o,ref:s,children:x.isValidElement(c)?x.cloneElement(c,void 0,u):null})}return m.jsx(e,{...o,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var uA=Pu("Slot");function e4(t){const e=x.forwardRef((n,r)=>{const{children:s,...i}=n;if(x.isValidElement(s)){const o=r4(s),a=n4(i,s.props);return s.type!==x.Fragment&&(a.ref=r?cA(r,o):o),x.cloneElement(s,a)}return x.Children.count(s)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var dA=Symbol("radix.slottable");function fA(t){const e=({children:n})=>m.jsx(m.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=dA,e}function t4(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===dA}function n4(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 l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function r4(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,534 bytes, line 76
76isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function s4(t){const e=t+"CollectionProvider",[n,r]=ia(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:v}=g,b=M.useRef(null),w=M.useRef(new Map).current;return m.jsx(s,{scope:y,itemMap:w,collectionRef:b,children:v})};o.displayName=e;const a=t+"CollectionSlot",l=Pu(a),c=M.forwardRef((g,y)=>{const{scope:v,children:b}=g,w=i(a,v),k=qt(y,w.collectionRef);return m.jsx(l,{ref:k,children:b})});c.displayName=a;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=Pu(u),h=M.forwardRef((g,y)=>{const{scope:v,children:b,...w}=g,k=M.useRef(null),S=qt(y,k),C=i(u,v);return M.useEffect(()=>(C.itemMap.set(k,{ref:k,...w}),()=>void C.itemMap.delete(k))),m.jsx(f,{[d]:"",ref:S,children:b})});h.displayName=u;function p(g){const y=i(t+"CollectionConsumer",g);return M.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,E)=>w.indexOf(C.ref.current)-w.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},p,r]}var i4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nt=i4.reduce((t,e)=>{const n=Pu(`Primitive.${e}`),r=x.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function hA(t,e){t&&dd.flushSync(()=>t.dispatchEvent(e))}function Zr(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function o4(t,e=globalThis==null?void 0:globalThis.document){const n=Zr(t);x.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 a4="DismissableLayer",Nv="dismissableLayer.update",l4="dismissableLayer.pointerDownOutside",c4="dismissableLayer.focusOutside",G1,pA=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xp=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,c=x.useContext(pA),[u,d]=x.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=x.useState({}),p=qt(e,E=>d(E)),g=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),b=u?g.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,k=b>=v,S=d4(E=>{const T=E.target,N=[...c.branches].some(P=>P.contains(T));!k||N||(s==null||s(E),o==null||o(E),E.defaultPrevented||a==null||a())},f),C=f4(E=>{const T=E.target;[...c.branches].some(P=>P.contains(T))||(i==null||i(E),o==null||o(E),E.defaultPrevented||a==null||a())},f);return o4(E=>{b===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},f),x.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(G1=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),J1(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=G1)}},[u,f,n,c]),x.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),J1())},[u,c]),x.useEffect(()=>{const E=()=>h({});return document.addEventListener(Nv,E),()=>document.removeEventListener(Nv,E)},[]),m.jsx(nt.div,{...l,ref:p,style:{pointerEvents:w?k?"auto":"none":void 0,...t.style},onFocusCapture:Ge(t.onFocusCapture,C.onFocusCapture),onBlurCapture:Ge(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ge(t.onPointerDownCapture,S.onPointerDownCapture)})});Xp.displayName=a4;var u4="DismissableLayerBranch",mA=x.forwardRef((t,e)=>{const n=x.useContext(pA),r=x.useRef(null),s=qt(e,r);return x.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(nt.div,{...t,ref:s})});mA.displayName=u4;function d4(t,e=globalThis==null?void 0:globalThis.document){const n=Zr(t),r=x.useRef(!1),s=x.useRef(()=>{});return x.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){gA(l4,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}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 f4(t,e=globalThis==null?void 0:globalThis.document){const n=Zr(t),r=x.useRef(!1);return x.useEffect(()=>{const s=i=>{i.target&&!r.current&&gA(c4,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 J1(){const t=new CustomEvent(Nv);document.dispatchEvent(t)}function gA(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?hA(s,i):s.dispatchEvent(i)}var h4=Xp,p4=mA,Ps=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},m4="Portal",Db=x.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=x.useState(!1);Ps(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Ob.createPortal(m.jsx(nt.div,{...r,ref:e}),o):null});Db.displayName=m4;function g4(t,e){return x.useReducer((n,r)=>e[n][r]??n,t)}var Zl=t=>{const{present:e,children:n}=t,r=y4(e),s=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=qt(r.ref,v4(s));return typeof n=="function"||r.isPresent?x.cloneElement(s,{ref:i}):null};Zl.displayName="Presence";function y4(t){const[e,n]=x.useState(),r=x.useRef(null),s=x.useRef(t),i=x.useRef("none"),o=t?"mounted":"unmounted",[a,l]=g4(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=Yd(r.current);i.current=a==="mounted"?c:"none"},[a]),Ps(()=>{const c=r.current,u=s.current;if(u!==t){const f=i.current,h=Yd(c);t?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),Ps(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,d=h=>{const g=Yd(r.current).includes(h.animationName);if(h.target===e&&g&&(l("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=h=>{h.target===e&&(i.current=Yd(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Yd(t){return(t==null?void 0:t.animationName)||"none"}function v4(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 b4=F0[" useInsertionEffect ".trim().toString()]||Ps;function yA({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,o]=w4({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:s;{const u=x.useRef(t!==void 0);x.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"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.`),u.current=a},[a,r])}const c=x.useCallback(u=>{var d;if(a){const f=x4(u)?u(t):u;f!==t&&((d=o.current)==null||d.call(o,f))}else i(u)},[a,t,i,o]);return[l,c]}function w4({defaultProp:t,onChange:e}
76){const[n,r]=x.useState(t),s=x.useRef(n),i=x.useRef(e);return b4(()=>{i.current=e},[e]),x.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function x4(t){return typeof t=="function"}var k4=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"}),S4="VisuallyHidden",em=x.forwardRef((t,e)=>m.jsx(nt.span,{...t,ref:e,style:{...k4,...t.style}}));em.displayName=S4;var E4=em,$b="ToastProvider",[Fb,C4,_4]=s4("Toast"),[vA,bY]=ia("Toast",[_4]),[T4,tm]=vA($b),bA=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=x.useState(null),[c,u]=x.useState(0),d=x.useRef(!1),f=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${$b}\`. Expected non-empty \`string\`.`),m.jsx(Fb.Provider,{scope:e,children:m.jsx(T4,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:x.useCallback(()=>u(h=>h+1),[]),onToastRemove:x.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};bA.displayName=$b;var wA="ToastViewport",A4=["F8"],Ov="toast.viewportPause",Rv="toast.viewportResume",xA=x.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=A4,label:s="Notifications ({hotkey})",...i}=t,o=tm(wA,n),a=C4(n),l=x.useRef(null),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=qt(e,d,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=o.toastCount>0;x.useEffect(()=>{const y=v=>{var w;r.length!==0&&r.every(k=>v[k]||v.code===k)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),x.useEffect(()=>{const y=l.current,v=d.current;if(p&&y&&v){const b=()=>{if(!o.isClosePausedRef.current){const C=new CustomEvent(Ov);v.dispatchEvent(C),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const C=new CustomEvent(Rv);v.dispatchEvent(C),o.isClosePausedRef.current=!1}},k=C=>{!y.contains(C.relatedTarget)&&w()},S=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",b),y.addEventListener("focusout",k),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",S),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",k),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[p,o.isClosePausedRef]);const g=x.useCallback(({tabbingDirection:y})=>{const b=a().map(w=>{const k=w.ref.current,S=[k,...z4(k)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?b.reverse():b).flat()},[a]);return x.useEffect(()=>{const y=d.current;if(y){const v=b=>{var S,C,E;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const T=document.activeElement,N=b.shiftKey;if(b.target===y&&N){(S=c.current)==null||S.focus();return}const R=g({tabbingDirection:N?"backwards":"forwards"}),D=R.findIndex(I=>I===T);bg(R.slice(D+1))?b.preventDefault():N?(C=c.current)==null||C.focus():(E=u.current)==null||E.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[a,g]),m.jsxs(p4,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&m.jsx(Pv,{ref:c,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});bg(y)}}),m.jsx(Fb.Slot,{scope:n,children:m.jsx(nt.ol,{tabIndex:-1,...i,ref:f})}),p&&m.jsx(Pv,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});bg(y)}})]})});xA.displayName=wA;var kA="ToastFocusProxy",Pv=x.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=tm(kA,n);return m.jsx(em,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var c;const a=o.relatedTarget;!((c=i.viewport)!=null&&c.contains(a))&&r()}})});Pv.displayName=kA;var md="Toast",N4="toast.swipeStart",O4="toast.swipeMove",R4="toast.swipeCancel",P4="toast.swipeEnd",SA=x.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=yA({prop:r,defaultProp:s??!0,onChange:i,caller:md}
vendor: 5,079 bytes, line 76
76);return m.jsx(Zl,{present:n||a,children:m.jsx(M4,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Zr(t.onPause),onResume:Zr(t.onResume),onSwipeStart:Ge(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ge(t.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Ge(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ge(t.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});SA.displayName=md;var[I4,j4]=vA(md,{onClose(){}}),M4=x.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...p}=t,g=tm(md,n),[y,v]=x.useState(null),b=qt(e,I=>v(I)),w=x.useRef(null),k=x.useRef(null),S=s||g.duration,C=x.useRef(0),E=x.useRef(S),T=x.useRef(0),{onToastAdd:N,onToastRemove:P}=g,q=Zr(()=>{var H;(y==null?void 0:y.contains(document.activeElement))&&((H=g.viewport)==null||H.focus()),o()}),R=x.useCallback(I=>{!I||I===1/0||(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(q,I))},[q]);x.useEffect(()=>{const I=g.viewport;if(I){const H=()=>{R(E.current),c==null||c()},U=()=>{const Z=new Date().getTime()-C.current;E.current=E.current-Z,window.clearTimeout(T.current),l==null||l()};return I.addEventListener(Ov,U),I.addEventListener(Rv,H),()=>{I.removeEventListener(Ov,U),I.removeEventListener(Rv,H)}}},[g.viewport,S,l,c,R]),x.useEffect(()=>{i&&!g.isClosePausedRef.current&&R(S)},[i,S,g.isClosePausedRef,R]),x.useEffect(()=>(N(),()=>P()),[N,P]);const D=x.useMemo(()=>y?OA(y):null,[y]);return g.viewport?m.jsxs(m.Fragment,{children:[D&&m.jsx(L4,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),m.jsx(I4,{scope:n,onClose:q,children:dd.createPortal(m.jsx(Fb.ItemSlot,{scope:n,children:m.jsx(h4,{asChild:!0,onEscapeKeyDown:Ge(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||q(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:m.jsx(nt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...p,ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ge(t.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Ge(t.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:Ge(t.onPointerMove,I=>{if(!w.current)return;const H=I.clientX-w.current.x,U=I.clientY-w.current.y,Z=!!k.current,j=["left","right"].includes(g.swipeDirection),$=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,J=j?$(0,H):0,ae=j?0:$(0,U),se=I.pointerType==="touch"?10:2,pe={x:J,y:ae},be={originalEvent:I,delta:pe};Z?(k.current=pe,Xd(O4,d,be,{discrete:!1})):Q1(pe,g.swipeDirection,se)?(k.current=pe,Xd(N4,u,be,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(H)>se||Math.abs(U)>se)&&(w.current=null)}),onPointerUp:Ge(t.onPointerUp,I=>{const H=k.current,U=I.target;if(U.hasPointerCapture(I.pointerId)&&U.releasePointerCapture(I.pointerId),k.current=null,w.current=null,H){const Z=I.currentTarget,j={originalEvent:I,delta:H};Q1(H,g.swipeDirection,g.swipeThreshold)?Xd(P4,h,j,{discrete:!0}):Xd(R4,f,j,{discrete:!0}),Z.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),L4=t=>{const{__scopeToast:e,children:n,...r}=t,s=tm(md,e),[i,o]=x.useState(!1),[a,l]=x.useState(!1);return F4(()=>o(!0)),x.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:m.jsx(Db,{asChild:!0,children:m.jsx(em,{...r,children:i&&m.jsxs(m.Fragment,{children:[s.label," ",n]})})})},D4="ToastTitle",EA=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return m.jsx(nt.div,{...r,ref:e})});EA.displayName=D4;var $4="ToastDescription",CA=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return m.jsx(nt.div,{...r,ref:e})});CA.displayName=$4;var _A="ToastAction",TA=x.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?m.jsx(NA,{altText:n,asChild:!0,children:m.jsx(Bb,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${_A}\`. Expected non-empty \`string\`.`),null)});TA.displayName=_A;
vendor: 8,002 bytes, lines 76-151
76var AA="ToastClose",Bb=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=j4(AA,n);return m.jsx(NA,{asChild:!0,children:m.jsx(nt.button,{type:"button",...r,ref:e,onClick:Ge(t.onClick,s.onClose)})})});Bb.displayName=AA;var NA=x.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return m.jsx(nt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function OA(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),B4(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(...OA(r))}}),e}function Xd(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?hA(s,i):s.dispatchEvent(i)}var Q1=(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 F4(t=()=>{}){const e=Zr(t);Ps(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function B4(t){return t.nodeType===t.ELEMENT_NODE}function z4(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 bg(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var U4=bA,RA=xA,PA=SA,IA=EA,jA=CA,MA=TA,LA=Bb;function DA(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=DA(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function $A(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=DA(t))&&(r&&(r+=" "),r+=e);return r}const Z1=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Y1=$A,gd=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Y1(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=Z1(u)||Z1(d);return s[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[g,y]=p;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...c,d,f]:c},[]);return Y1(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};/**
77 * @license lucide-react v0.462.0 - ISC
78 *
79 * This source code is licensed under the ISC license.
80 * See the LICENSE file in the root directory of this source tree.
81 */const V4=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),FA=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
82 * @license lucide-react v0.462.0 - ISC
83 *
84 * This source code is licensed under the ISC license.
85 * See the LICENSE file in the root directory of this source tree.
86 */var H4={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"};/**
87 * @license lucide-react v0.462.0 - ISC
88 *
89 * This source code is licensed under the ISC license.
90 * See the LICENSE file in the root directory of this source tree.
91 */const W4=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>x.createElement("svg",{ref:l,...H4,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:FA("lucide",s),...a},[...o.map(([c,u])=>x.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
92 * @license lucide-react v0.462.0 - ISC
93 *
94 * This source code is licensed under the ISC license.
95 * See the LICENSE file in the root directory of this source tree.
96 */const $e=(t,e)=>{const n=x.forwardRef(({className:r,...s},i)=>x.createElement(W4,{ref:i,iconNode:e,className:FA(`lucide-${V4(t)}`,r),...s}));return n.displayName=`${t}`,n};/**
97 * @license lucide-react v0.462.0 - ISC
98 *
99 * This source code is licensed under the ISC license.
100 * See the LICENSE file in the root directory of this source tree.
101 */const BA=$e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
102 * @license lucide-react v0.462.0 - ISC
103 *
104 * This source code is licensed under the ISC license.
105 * See the LICENSE file in the root directory of this source tree.
106 */const q4=$e("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
107 * @license lucide-react v0.462.0 - ISC
108 *
109 * This source code is licensed under the ISC license.
110 * See the LICENSE file in the root directory of this source tree.
111 */const K4=$e("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"}]]);/**
112 * @license lucide-react v0.462.0 - ISC
113 *
114 * This source code is licensed under the ISC license.
115 * See the LICENSE file in the root directory of this source tree.
116 */const G4=$e("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"}]]);/**
117 * @license lucide-react v0.462.0 - ISC
118 *
119 * This source code is licensed under the ISC license.
120 * See the LICENSE file in the root directory of this source tree.
121 */const J4=$e("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
122 * @license lucide-react v0.462.0 - ISC
123 *
124 * This source code is licensed under the ISC license.
125 * See the LICENSE file in the root directory of this source tree.
126 */const zA=$e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
127 * @license lucide-react v0.462.0 - ISC
128 *
129 * This source code is licensed under the ISC license.
130 * See the LICENSE file in the root directory of this source tree.
131 */const X1=$e("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
132 * @license lucide-react v0.462.0 - ISC
133 *
134 * This source code is licensed under the ISC license.
135 * See the LICENSE file in the root directory of this source tree.
136 */const Q4=$e("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"}]]);/**
137 * @license lucide-react v0.462.0 - ISC
138 *
139 * This source code is licensed under the ISC license.
140 * See the LICENSE file in the root directory of this source tree.
141 */const Iv=$e("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"}]]);/**
142 * @license lucide-react v0.462.0 - ISC
143 *
144 * This source code is licensed under the ISC license.
145 * See the LICENSE file in the root directory of this source tree.
146 */const UA=$e("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"}]]);/**
147 * @license lucide-react v0.462.0 - ISC
148 *
149 * This source code is licensed under the ISC license.
150 * See the LICENSE file in the root directory of this source tree.
151 */const Z4=$e("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"}
151]]);/**
152 * @license lucide-react v0.462.0 - ISC
153 *
154 * This source code is licensed under the ISC license.
155 * See the LICENSE file in the root directory of this source tree.
156 */const Y4=$e("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
157 * @license lucide-react v0.462.0 - ISC
158 *
159 * This source code is licensed under the ISC license.
160 * See the LICENSE file in the root directory of this source tree.
161 */const X4=$e("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"}]]);/**
162 * @license lucide-react v0.462.0 - ISC
163 *
164 * This source code is licensed under the ISC license.
165 * See the LICENSE file in the root directory of this source tree.
166 */const eF=$e("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"}]]);/**
167 * @license lucide-react v0.462.0 - ISC
168 *
169 * This source code is licensed under the ISC license.
170 * See the LICENSE file in the root directory of this source tree.
171 */const tF=$e("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"}]]);/**
172 * @license lucide-react v0.462.0 - ISC
173 *
174 * This source code is licensed under the ISC license.
175 * See the LICENSE file in the root directory of this source tree.
176 */const Ko=$e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
177 * @license lucide-react v0.462.0 - ISC
178 *
179 * This source code is licensed under the ISC license.
180 * See the LICENSE file in the root directory of this source tree.
181 */const VA=$e("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"}]]);/**
182 * @license lucide-react v0.462.0 - ISC
183 *
184 * This source code is licensed under the ISC license.
185 * See the LICENSE file in the root directory of this source tree.
186 */const zb=$e("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"}]]);/**
187 * @license lucide-react v0.462.0 - ISC
188 *
189 * This source code is licensed under the ISC license.
190 * See the LICENSE file in the root directory of this source tree.
191 */const nF=$e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
192 * @license lucide-react v0.462.0 - ISC
193 *
194 * This source code is licensed under the ISC license.
195 * See the LICENSE file in the root directory of this source tree.
196 */const rF=$e("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
197 * @license lucide-react v0.462.0 - ISC
198 *
199 * This source code is licensed under the ISC license.
200 * See the LICENSE file in the root directory of this source tree.
201 */const sF=$e("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"}]]);/**
202 * @license lucide-react v0.462.0 - ISC
203 *
204 * This source code is licensed under the ISC license.
205 * See the LICENSE file in the root directory of this source tree.
206 */const iF=$e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
207 * @license lucide-react v0.462.0 - ISC
208 *
209 * This source code is licensed under the ISC license.
210 * See the LICENSE file in the root directory of this source tree.
211 */const oF=$e("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"}]]);/**
212 * @license lucide-react v0.462.0 - ISC
213 *
214 * This source code is licensed under the ISC license.
215 * See the LICENSE file in the root directory of this source tree.
216 */const aF=$e("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
217 * @license lucide-react v0.462.0 - ISC
218 *
219 * This source code is licensed under the ISC license.
220 * See the LICENSE file in the root directory of this source tree.
221 */const lF=$e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
222 * @license lucide-react v0.462.0 - ISC
223 *
224 * This source code is licensed under the ISC license.
225 * See the LICENSE file in the root directory of this source tree.
226 */const cF=$e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
vendor: 9,040 bytes, lines 226-241
226],["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"}]]);/**
227 * @license lucide-react v0.462.0 - ISC
228 *
229 * This source code is licensed under the ISC license.
230 * See the LICENSE file in the root directory of this source tree.
231 */const uF=$e("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/**
232 * @license lucide-react v0.462.0 - ISC
233 *
234 * This source code is licensed under the ISC license.
235 * See the LICENSE file in the root directory of this source tree.
236 */const dF=$e("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
237 * @license lucide-react v0.462.0 - ISC
238 *
239 * This source code is licensed under the ISC license.
240 * See the LICENSE file in the root directory of this source tree.
241 */const nm=$e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ub="-",fF=t=>{const e=pF(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(Ub);return a[0]===""&&a.length!==1&&a.shift(),HA(a,e)||hF(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},HA=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?HA(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(Ub);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},ek=/^\[(.+)\]$/,hF=t=>{if(ek.test(t)){const e=ek.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])=>{jv(o,r,i,e)}),r},jv=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:tk(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(mF(s)){jv(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{jv(o,tk(e,i),n,r)})})},tk=(t,e)=>{let n=t;return e.split(Ub).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)}}},WA="!",vF=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let c=0,u=0,d;for(let y=0;y<a.length;y++){let v=a[y];if(c===0){if(v===s&&(r||a.slice(y,y+i)===e)){l.push(a.slice(u,y)),u=y+i;continue}if(v==="/"){d=y;continue}}v==="["?c++:v==="]"&&c--}const f=l.length===0?a:a.substring(u),h=f.startsWith(WA),p=h?f.substring(1):f,g=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},bF=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},wF=t=>({cache:yF(t.cacheSize),parseClassName:vF(t),...fF(t)}),xF=/\s+/,kF=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(xF);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(c);let p=!!h,g=r(p?f.substring(0,h):f);if(!g){if(!p){a=c+(a.length>0?" "+a:a);continue}if(g=r(f),!g){a=c+(a.length>0?" "+a:a);continue}p=!1}const y=bF(u).join(":"),v=d?y+WA:y,b=v+g;if(i.includes(b))continue;i.push(b);const w=s(g,p);for(let k=0;k<w.length;++k){const S=w[k];i.push(v+S)}a=c+(a.length>0?" "+a:a)}return a};function SF(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=qA(e))&&(r&&(r+=" "),r+=n);return r}const qA=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=qA(t[r]))&&(n&&(n+=" "),n+=e);return n};function EF(t,...e){let n,r,s,i=o;function o(l){const c=e.reduce((u,d)=>d(u),t());return n=wF(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=kF(l,n);return s(l,u),u}return function(){return i(SF.apply(null,arguments))}}const We=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},KA=/^\[(?:([a-z-]+):)?(.+)\]$/i,CF=/^\d+\/\d+$/,_F=new Set(["px","full","screen"]),TF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,AF=/\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$/,NF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,OF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=t=>sl(t)||_F.has(t)||CF.test(t),Hs=t=>Yl(t,"length",FF),sl=t=>!!t&&!Number.isNaN(Number(t)),wg=t=>Yl(t,"number",sl),pc=t=>!!t&&Number.isInteger(Number(t)),PF=t=>t.endsWith("%")&&sl(t.slice(0,-1)),we=t=>KA.test(t),Ws=t=>TF.test(t),IF=new Set(["length","size","percentage"]),jF=t=>Yl(t,IF,GA),MF=t=>Yl(t,"position",GA),LF=new Set(["image","url"]),DF=t=>Yl(t,LF,zF),$F=t=>Yl(t,"",BF),mc=()=>!0,Yl=(t,e,n)=>{const r=KA.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},FF=t=>AF.test(t)&&!NF.test(t),GA=()=>!1,BF=t=>OF.test(t),zF=t=>RF.test(t),UF=()=>{const t=We("colors"),e=We("spacing"),n=We("blur"),r=We("brightness"),s=We("borderColor"),i=We("borderRadius"),o=We("borderSpacing"),a=We("borderWidth"),l=We("contrast"),c=We("grayscale"),u=We("hueRotate"),d=We("invert"),f=We("gap"),h=We("gradientColorStops"),p=We("gradientColorStopPositions"),g=We("inset"),y=We("margin"),v=We("opacity"),b=We("padding"),w=We("saturate"),k=We("scale"),S=We("sepia"),C=We("skew"),E=We("space"),T=We("translate"),N=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",we,e],R=()=>[we,e],D=()=>["",cs,Hs],I=()=>["auto",sl,we],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",we],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ae=()=>[sl,we];return{cacheSize:500,separator:":",theme:{colors:[mc],spacing:[cs,Hs],blur:["none","",Ws,we],brightness:ae(),borderColor:[t],borderRadius:["none","","full",Ws,we],borderSpacing:R(),borderWidth:D(),contrast:ae(),grayscale:$(),hueRotate:ae(),invert:$(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[PF,Hs],inset:q(),margin:q(),opacity:ae(),padding:R(),saturate:ae(),scale:ae(),sepia:$(),skew:ae(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",we]}],container:["container"],columns:[{columns:[Ws]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"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:[...H(),we]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",pc,we]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",we]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",pc,we]}],"grid-cols":[{"grid-cols":[mc]}],"col-start-end":[{col:["auto",{span:["full",pc,we]},we]}],"col-start":[{"col-start":I()}
vendor: 9,422 bytes, line 241
241],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[mc]}],"row-start-end":[{row:["auto",{span:[pc,we]},we]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",we]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",we]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"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:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",we,e]}],"min-w":[{"min-w":[we,e,"min","max","fit"]}],"max-w":[{"max-w":[we,e,"none","full","min","max","fit","prose",{screen:[Ws]},Ws]}],h:[{h:[we,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[we,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[we,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[we,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Ws,Hs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wg]}],"font-family":[{font:[mc]}],"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",we]}],"line-clamp":[{"line-clamp":["none",sl,wg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cs,we]}],"list-image":[{"list-image":["none",we]}],"list-style-type":[{list:["none","disc","decimal",we]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cs,Hs]}],"underline-offset":[{"underline-offset":["auto",cs,we]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we]}],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",we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),MF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},DF]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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":[v]}],"border-style":[{border:[...U(),"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":[v]}],"divide-style":[{divide:U()}],"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:["",...U()]}],"outline-offset":[{"outline-offset":[cs,we]}],"outline-w":[{outline:[cs,Hs]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[cs,Hs]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Ws,$F]}],"shadow-color":[{shadow:[mc]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ws,we]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",we]}],duration:[{duration:ae()}],ease:[{ease:["linear","in","out","in-out",we]}],delay:[{delay:ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",we]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[pc,we]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",we]}],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",we]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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"]}
vendor: 4,647 bytes, line 241
241],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",we]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[cs,Hs,wg]}],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=EF(UF);function Ee(...t){return VF($A(t))}const HF=U4,JA=x.forwardRef(({className:t,...e},n)=>m.jsx(RA,{ref:n,className:Ee("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}));JA.displayName=RA.displayName;const WF=gd("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"}}),QA=x.forwardRef(({className:t,variant:e,...n},r)=>m.jsx(PA,{ref:r,className:Ee(WF({variant:e}),t),...n}));QA.displayName=PA.displayName;const qF=x.forwardRef(({className:t,...e},n)=>m.jsx(MA,{ref:n,className:Ee("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=MA.displayName;const ZA=x.forwardRef(({className:t,...e},n)=>m.jsx(LA,{ref:n,className:Ee("absolute right-2 top-2 rounded-md p-1 text-foreground
vendor: 20,553 bytes, line 241
241/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:m.jsx(nm,{className:"h-4 w-4"})}));ZA.displayName=LA.displayName;const YA=x.forwardRef(({className:t,...e},n)=>m.jsx(IA,{ref:n,className:Ee("text-sm font-semibold",t),...e}));YA.displayName=IA.displayName;const XA=x.forwardRef(({className:t,...e},n)=>m.jsx(jA,{ref:n,className:Ee("text-sm opacity-90",t),...e}));XA.displayName=jA.displayName;function KF(){const{toasts:t}=Yp();return m.jsxs(HF,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return m.jsxs(QA,{...i,children:[m.jsxs("div",{className:"grid gap-1",children:[n&&m.jsx(YA,{children:n}),r&&m.jsx(XA,{children:r})]}),s,m.jsx(ZA,{})]},e)}),m.jsx(JA,{})]})}var GF=F0[" useId ".trim().toString()]||(()=>{}),JF=0;function xg(t){const[e,n]=x.useState(GF());return Ps(()=>{t||n(r=>r??String(JF++))},[t]),t||(e?`radix-${e}`:"")}const QF=["top","right","bottom","left"],Ui=Math.min,An=Math.max,Th=Math.round,ef=Math.floor,Jr=t=>({x:t,y:t}),ZF={left:"right",right:"left",bottom:"top",top:"bottom"},YF={start:"end",end:"start"};function Mv(t,e,n){return An(t,Ui(e,n))}function Is(t,e){return typeof t=="function"?t(e):t}function js(t){return t.split("-")[0]}function Xl(t){return t.split("-")[1]}function Vb(t){return t==="x"?"y":"x"}function Hb(t){return t==="y"?"height":"width"}const XF=new Set(["top","bottom"]);function Wr(t){return XF.has(js(t))?"y":"x"}function Wb(t){return Vb(Wr(t))}function eB(t,e,n){n===void 0&&(n=!1);const r=Xl(t),s=Wb(t),i=Hb(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Ah(o)),[o,Ah(o)]}function tB(t){const e=Ah(t);return[Lv(t),e,Lv(e)]}function Lv(t){return t.replace(/start|end/g,e=>YF[e])}const nk=["left","right"],rk=["right","left"],nB=["top","bottom"],rB=["bottom","top"];function sB(t,e,n){switch(t){case"top":case"bottom":return n?e?rk:nk:e?nk:rk;case"left":case"right":return e?nB:rB;default:return[]}}function iB(t,e,n,r){const s=Xl(t);let i=sB(js(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Lv)))),i}function Ah(t){return t.replace(/left|right|bottom|top/g,e=>ZF[e])}function oB(t){return{top:0,right:0,bottom:0,left:0,...t}}function eN(t){return typeof t!="number"?oB(t):{top:t,right:t,bottom:t,left:t}}function Nh(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 sk(t,e,n){let{reference:r,floating:s}=t;const i=Wr(e),o=Wb(e),a=Hb(o),l=js(e),c=i==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-s.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-s.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Xl(e)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}const aB=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:u,y:d}=sk(c,r,l),f=r,h={},p=0;for(let g=0;g<a.length;g++){const{name:y,fn:v}=a[g],{x:b,y:w,data:k,reset:S}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:h,rects:c,platform:o,elements:{reference:t,floating:e}});u=b??u,d=w??d,h={...h,[y]:{...h[y],...k}},S&&p<=50&&(p++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):S.rects),{x:u,y:d}=sk(c,f,l)),g=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:h}};async function Iu(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Is(e,t),p=eN(h),y=a[f?d==="floating"?"reference":"floating":d],v=Nh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="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},S=Nh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(v.top-S.top+p.top)/k.y,bottom:(S.bottom-v.bottom+p.bottom)/k.y,left:(v.left-S.left+p.left)/k.x,right:(S.right-v.right+p.right)/k.x}}const lB=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Is(t,e)||{};if(c==null)return{};const d=eN(u),f={x:n,y:r},h=Wb(s),p=Hb(h),g=await o.getDimensions(c),y=h==="y",v=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",k=i.reference[p]+i.reference[h]-f[h]-i.floating[p],S=f[h]-i.reference[h],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let E=C?C[w]:0;(!E||!await(o.isElement==null?void 0:o.isElement(C)))&&(E=a.floating[w]||i.floating[p]);const T=k/2-S/2,N=E/2-g[p]/2-1,P=Ui(d[v],N),q=Ui(d[b],N),R=P,D=E-g[p]-q,I=E/2-g[p]/2+T,H=Mv(R,I,D),U=!l.arrow&&Xl(s)!=null&&I!==H&&i.reference[p]/2-(I<R?P:q)-g[p]/2<0,Z=U?I<R?I-R:I-D:0;return{[h]:f[h]+Z,data:{[h]:H,centerOffset:I-H-Z,...U&&{alignmentOffset:Z}},reset:U}}}),cB=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:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...y}=Is(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=js(s),b=Wr(a),w=js(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(w||!g?[Ah(a)]:tB(a)),C=p!=="none";!f&&C&&S.push(...iB(a,g,p,k));const E=[a,...S],T=await Iu(e,y),N=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&N.push(T[v]),d){const I=eB(s,o,k);N.push(T[I[0]],T[I[1]])}if(P=[...P,{placement:s,overflows:N}],!N.every(I=>I<=0)){var q,R;const I=(((q=i.flip)==null?void 0:q.index)||0)+1,H=E[I];if(H&&(!(d==="alignment"?b!==Wr(H):!1)||P.every(j=>j.overflows[0]>0&&Wr(j.placement)===b)))return{data:{index:I,overflows:P},reset:{placement:H}};let U=(R=P.filter(Z=>Z.overflows[0]<=0).sort((Z,j)=>Z.overflows[1]-j.overflows[1])[0])==null?void 0:R.placement;if(!U)switch(h){case"bestFit":{var D;const Z=(D=P.filter(j=>{if(C){const $=Wr(j.placement);return $===b||$==="y"}return!0}).map(j=>[j.placement,j.overflows.filter($=>$>0).reduce(($,J)=>$+J,0)]).sort((j,$)=>j[1]-$[1])[0])==null?void 0:D[0];Z&&(U=Z);break}case"initialPlacement":U=a;break}if(s!==U)return{reset:{placement:U}}}return{}}}};function ik(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ok(t){return QF.some(e=>t[e]>=0)}const uB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=Is(t,e);switch(r){case"referenceHidden":{const i=await Iu(e,{...s,elementContext:"reference"}),o=ik(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ok(o)}}}case"escaped":{const i=await Iu(e,{...s,altBoundary:!0}),o=ik(i,n.floating);return{data:{escapedOffsets:o,escaped:ok(o)}}}default:return{}}}}},tN=new Set(["left","top"]);async function dB(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=js(n),a=Xl(n),l=Wr(n)==="y",c=tN.has(o)?-1:1,u=i&&l?-1:1,d=Is(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const fB=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,l=await dB(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},hB=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:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...l}=Is(t,e),c={x:n,y:r},u=await Iu(e,l),d=Wr(js(s)),f=Vb(d);let h=c[f],p=c[d];if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+u[y],w=h-u[v];h=Mv(b,h,w)}if(o){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=p+u[y],w=p-u[v];p=Mv(b,p,w)}const g=a.fn({...e,[f]:h,[d]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:i,[d]:o}}}}}},pB=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:l=!0,crossAxis:c=!0}=Is(t,e),u={x:n,y:r},d=Wr(s),f=Vb(d);let h=u[f],p=u[d];const g=Is(a,e),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=f==="y"?"height":"width",k=i.reference[f]-i.floating[w]+y.mainAxis,S=i.reference[f]+i.reference[w]-y.mainAxis;h<k?h=k:h>S&&(h=S)}if(c){var v,b;const w=f==="y"?"width":"height",k=tN.has(js(s)),S=i.reference[d]-i.floating[w]+(k&&((v=o.offset)==null?void 0:v[d])||0)+(k?0:y.crossAxis),C=i.reference[d]+i.reference[w]+(k?0:((b=o.offset)==null?void 0:b[d])||0)-(k?y.crossAxis:0);p<S?p=S:p>C&&(p=C)}return{[f]:h,[d]:p}}}},mB=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:l=()=>{},...c}=Is(t,e),u=await Iu(e,c),d=js(s),f=Xl(s),h=Wr(s)==="y",{width:p,height:g}=i.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,y=f==="end"?"top":"bottom");const b=g-u.top-u.bottom,w=p-u.left-u.right,k=Ui(g-u[y],b),S=Ui(p-u[v],w),C=!e.middlewareData.shift;let E=k,T=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(T=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(E=b),C&&!f){const P=An(u.left,0),q=An(u.right,0),R=An(u.top,0),D=An(u.bottom,0);h?T=p-2*(P!==0||q!==0?P+q:An(u.left,u.right)):E=g-2*(R!==0||D!==0?R+D:An(u.top,u.bottom))}await l({...e,availableWidth:T,availableHeight:E});const N=await o.getDimensions(a.floating);return p!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function rm(){return typeof window<"u"}function ec(t){return nN(t)?(t.nodeName||"").toLowerCase():"#document"}function In(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ts(t){var e;return(e=(nN(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function nN(t){return rm()?t instanceof Node||t instanceof In(t).Node:!1}function Tr(t){return rm()?t instanceof Element||t instanceof In(t).Element:!1}function Yr(t){return rm()?t instanceof HTMLElement||t instanceof In(t).HTMLElement:!1}function ak(t){return!rm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof In(t).ShadowRoot}const gB=new Set(["inline","contents"]);function yd(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Ar(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!gB.has(s)}const yB=new Set(["table","td","th"]);function vB(t){return yB.has(ec(t))}const bB=[":popover-open",":modal"];function sm(t){return bB.some(e=>{try{return t.matches(e)}catch{return!1}})}const wB=["transform","translate","scale","rotate","perspective"],xB=["transform","translate","scale","rotate","perspective","filter"],kB=["paint","layout","strict","content"];function qb(t){const e=Kb(),n=Tr(t)?Ar(t):t;return wB.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)||xB.some(r=>(n.willChange||"").includes(r))||kB.some(r=>(n.contain||"").includes(r))}function SB(t){let e=Vi(t);for(;Yr(e)&&!Pl(e);){if(qb(e))return e;if(sm(e))return null;e=Vi(e)}return null}function Kb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const EB=new Set(["html","body","#document"]);function Pl(t){return EB.has(ec(t))}function Ar(t){return In(t).getComputedStyle(t)}function im(t){return Tr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Vi(t){if(ec(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ak(t)&&t.host||ts(t);return ak(e)?e.host:e}function rN(t){const e=Vi(t);return Pl(e)?t.ownerDocument?t.ownerDocument.body:t.body:Yr(e)&&yd(e)?e:rN(e)}function ju(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=rN(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=In(s);if(i){const a=Dv(o);return e.concat(o,o.visualViewport||[],yd(s)?s:[],a&&n?ju(a):[])}return e.concat(s,ju(s,[],n))}function Dv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function sN(t){const e=Ar(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Yr(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=Th(n)!==i||Th(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function Gb(t){return Tr(t)?t:t.contextElement}function il(t){const e=Gb(t);if(!Yr(e))return Jr(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=sN(e);let o=(i?Th(n.width):n.width)/r,a=(i?Th(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const CB=Jr(0);function iN(t){const e=In(t);return!Kb()||!e.visualViewport?CB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _B(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==In(t)?!1:e}function Go(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Gb(t);let o=Jr(1);e&&(r?Tr(r)&&(o=il(r)):o=il(t));const a=_B(i,n,r)?iN(i):Jr(0);let l=(s.left+a.x)/o.x,c=(s.top+a.y)/o.y,u=s.width/o.x,d=s.height/o.y;if(i){const f=In(i),h=r&&Tr(r)?In(r):r;let p=f,g=Dv(p);for(;g&&r&&h!==p;){const y=il(g),v=g.getBoundingClientRect(),b=Ar(g),w=v.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,k=v.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=k,p=In(g),g=Dv(p)}}return Nh({width:u,height:d,x:l,y:c})}function Jb(t,e){const n=im(t).scrollLeft;return e?e.left+n:Go(ts(t)).left+n}function oN(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=r.left+e.scrollLeft-(n?0:Jb(t,r)),i=r.top+e.scrollTop;return{x:s,y:i}}function TB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=ts(r),a=e?sm(e.floating):!1;if(r===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Jr(1);const u=Jr(0),d=Yr(r);if((d||!d&&!i)&&((ec(r)!=="body"||yd(o))&&(l=im(r)),Yr(r))){const h=Go(r);c=il(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=o&&!d&&!i?oN(o,l,!0):Jr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function AB(t){return Array.from(t.getClientRects())}function NB(t){const e=ts(t),n=im(t),r=t.ownerDocument.body,s=An(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=An(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Jb(t);const a=-n.scrollTop;return Ar(r).direction==="rtl"&&(o+=An(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function OB(t,e){const n=In(t),r=ts(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const c=Kb();(!c||c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}const RB=new Set(["absolute","fixed"]);function PB(t,e){const n=Go(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Yr(t)?il(t):Jr(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,c=r*i.y;return{width:o,height:a,x:l,y:c}}function lk(t,e,n){let r;if(e==="viewport")r=OB(t,n);else if(e==="document")r=NB(ts(t));else if(Tr(e))r=PB(e,n);else{const s=iN(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Nh(r)}function aN(t,e){const n=Vi(t);return n===e||!Tr(n)||Pl(n)?!1:Ar(n).position==="fixed"||aN(n,e)}function IB(t,e){const n=e.get(t);if(n)return n;let r=ju(t,[],!1).filter(a=>Tr(a)&&ec(a)!=="body"),s=null;const i=Ar(t).position==="fixed";let o=i?Vi(t):t;for(;Tr(o)&&!Pl(o);){const a=Ar(o),l=qb(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&RB.has(s.position)||yd(o)&&!l&&aN(t,o))?r=r.filter(u=>u!==o):s=a,o=Vi(o)}return e.set(t,r),r}function jB(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?sm(e)?[]:IB(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=lk(e,u,s);return c.top=An(d.top,c.top),c.right=Ui(d.right,c.right),c.bottom=Ui(d.bottom,c.bottom),c.left=An(d.left,c.left),c},lk(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function MB(t){const{width:e,height:n}=sN(t);return{width:e,height:n}}function LB(t,e,n){const r=Yr(e),s=ts(e),i=n==="fixed",o=Go(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=Jr(0);function c(){l.x=Jb(s)}if(r||!r&&!i)if((ec(e)!=="body"||yd(s))&&(a=im(e)),r){const h=Go(e,!0,i,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else s&&c();i&&!r&&s&&c();const u=s&&!r&&!i?oN(s,a):Jr(0),d=o.left+a.scrollLeft-l.x-u.x,f=o.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:o.width,height:o.height}}function kg(t){return Ar(t).position==="static"}function ck(t,e){if(!Yr(t)||Ar(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ts(t)===n&&(n=n.ownerDocument.body),n}function lN(t,e){const n=In(t);if(sm(t))return n;if(!Yr(t)){let s=Vi(t);for(;s&&!Pl(s);){if(Tr(s)&&!kg(s))return s;s=Vi(s)}return n}let r=ck(t,e);for(;r&&vB(r)&&kg(r);)r=ck(r,e);return r&&Pl(r)&&kg(r)&&!qb(r)?n:r||SB(t)||n}const DB=async function(t){const e=this.getOffsetParent||lN,n=this.getDimensions,r=await n(t.floating);return{reference:LB(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $B(t){return Ar(t).direction==="rtl"}const FB={convertOffsetParentRelativeRectToViewportRelativeRect:TB,getDocumentElement:ts,getClippingRect:jB,getOffsetParent:lN,getElementRects:DB,getClientRects:AB,getDimensions:MB,getScale:il,isElement:Tr,isRTL:$B};function cN(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function BB(t,e){let n=null,r;const s=ts(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=t.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=c;if(a||e(),!f||!h)return;const p=ef(d),g=ef(s.clientWidth-(u+f)),y=ef(s.clientHeight-(d+h)),v=ef(u),w={rootMargin:-p+"px "+-g+"px "+-y+"px "+-v+"px",threshold:An(0,Ui(1,l))||1};let k=!0;function S(C){const E=C[0].intersectionRatio;if(E!==l){if(!k)return o();E?o(!1,E):r=setTimeout(()=>{o(!1,1e-7)},1e3)}E===1&&!cN(c,t.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(S,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(t)}return o(!0),i}function zB(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:l=!1}=r,c=Gb(t),u=s||i?[...c?ju(c):[],...ju(e)]:[];u.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?BB(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(e)})),n()}),c&&!l&&h.observe(c),h.observe(e));let p,g=l?Go(t):null;l&&y();function y(){const v=Go(t);g&&!cN(g,v)&&n(),g=v,p=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(b=>{s&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const UB=fB,VB=hB,HB=cB,WB=mB,qB=uB,uk=lB,KB=pB,GB=(t,e,n)=>{const r=new Map,s={platform:FB,...n},i={...s.platform,_c:r};return aB(t,e,{...s,platform:i})};var JB=typeof document<"u",QB=function(){},$f=JB?x.useLayoutEffect:QB;function Oh(t,e){if(t===e)return!0;
vendor: 4,133 bytes, line 241
241if(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(!Oh(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)&&!Oh(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function uN(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function dk(t,e){const n=uN(t);return Math.round(e*n)/n}function Sg(t){const e=x.useRef(t);return $f(()=>{e.current=t}),e}function ZB(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:l,open:c}=t,[u,d]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=x.useState(r);Oh(f,r)||h(r);const[p,g]=x.useState(null),[y,v]=x.useState(null),b=x.useCallback(j=>{j!==C.current&&(C.current=j,g(j))},[]),w=x.useCallback(j=>{j!==E.current&&(E.current=j,v(j))},[]),k=i||p,S=o||y,C=x.useRef(null),E=x.useRef(null),T=x.useRef(u),N=l!=null,P=Sg(l),q=Sg(s),R=Sg(c),D=x.useCallback(()=>{if(!C.current||!E.current)return;const j={placement:e,strategy:n,middleware:f};q.current&&(j.platform=q.current),GB(C.current,E.current,j).then($=>{const J={...$,isPositioned:R.current!==!1};I.current&&!Oh(T.current,J)&&(T.current=J,dd.flushSync(()=>{d(J)}))})},[f,e,n,q,R]);$f(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(j=>({...j,isPositioned:!1})))},[c]);const I=x.useRef(!1);$f(()=>(I.current=!0,()=>{I.current=!1}),[]),$f(()=>{if(k&&(C.current=k),S&&(E.current=S),k&&S){if(P.current)return P.current(k,S,D);D()}},[k,S,D,P,N]);const H=x.useMemo(()=>({reference:C,floating:E,setReference:b,setFloating:w}),[b,w]),U=x.useMemo(()=>({reference:k,floating:S}),[k,S]),Z=x.useMemo(()=>{const j={position:n,left:0,top:0};if(!U.floating)return j;const $=dk(U.floating,u.x),J=dk(U.floating,u.y);return a?{...j,transform:"translate("+$+"px, "+J+"px)",...uN(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:J}},[n,a,U.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:D,refs:H,elements:U,floatingStyles:Z}),[u,D,H,U,Z])}const YB=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?uk({element:r.current,padding:s}).fn(n):{}:r?uk({element:r,padding:s}).fn(n):{}}}},XB=(t,e)=>({...UB(t),options:[t,e]}),e3=(t,e)=>({...VB(t),options:[t,e]}),t3=(t,e)=>({...KB(t),options:[t,e]}),n3=(t,e)=>({...HB(t),options:[t,e]}),r3=(t,e)=>({...WB(t),options:[t,e]}),s3=(t,e)=>({...qB(t),options:[t,e]}),i3=(t,e)=>({...YB(t),options:[t,e]});var o3="Arrow",dN=x.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return m.jsx(nt.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});dN.displayName=o3;var a3=dN;function l3(t){const[e,n]=x.useState(void 0);return Ps(()=>{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 l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.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 fN="Popper",[hN,pN]=ia(fN),[wY,mN]=hN(fN),gN="PopperAnchor",yN=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=mN(gN,n),o=x.useRef(null),a=qt(e,o);return x.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:m.jsx(nt.div,{...s,ref:a})});yN.displayName=gN;var Qb="PopperContent",[c3,u3]=hN(Qb),vN=x.forwardRef((t,e)=>{var Ne,ns,Fn,sr,Or,rs;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l
vendor: 9,913 bytes, line 241
241=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:p,...g}=t,y=mN(Qb,n),[v,b]=x.useState(null),w=qt(e,Rr=>b(Rr)),[k,S]=x.useState(null),C=l3(k),E=(C==null?void 0:C.width)??0,T=(C==null?void 0:C.height)??0,N=r+(i!=="center"?"-"+i:""),P=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},q=Array.isArray(c)?c:[c],R=q.length>0,D={padding:P,boundary:q.filter(f3),altBoundary:R},{refs:I,floatingStyles:H,placement:U,isPositioned:Z,middlewareData:j}=ZB({strategy:"fixed",placement:N,whileElementsMounted:(...Rr)=>zB(...Rr,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[XB({mainAxis:s+T,alignmentAxis:o}),l&&e3({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?t3():void 0,...D}),l&&n3({...D}),r3({...D,apply:({elements:Rr,rects:to,availableWidth:fa,availableHeight:ha})=>{const{width:sc,height:pa}=to.reference,ss=Rr.floating.style;ss.setProperty("--radix-popper-available-width",`${fa}px`),ss.setProperty("--radix-popper-available-height",`${ha}px`),ss.setProperty("--radix-popper-anchor-width",`${sc}px`),ss.setProperty("--radix-popper-anchor-height",`${pa}px`)}}),k&&i3({element:k,padding:a}),h3({arrowWidth:E,arrowHeight:T}),f&&s3({strategy:"referenceHidden",...D})]}),[$,J]=xN(U),ae=Zr(p);Ps(()=>{Z&&(ae==null||ae())},[Z,ae]);const se=(Ne=j.arrow)==null?void 0:Ne.x,pe=(ns=j.arrow)==null?void 0:ns.y,be=((Fn=j.arrow)==null?void 0:Fn.centerOffset)!==0,[Ue,Tt]=x.useState();return Ps(()=>{v&&Tt(window.getComputedStyle(v).zIndex)},[v]),m.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Z?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ue,"--radix-popper-transform-origin":[(sr=j.transformOrigin)==null?void 0:sr.x,(Or=j.transformOrigin)==null?void 0:Or.y].join(" "),...((rs=j.hide)==null?void 0:rs.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(c3,{scope:n,placedSide:$,onArrowChange:S,arrowX:se,arrowY:pe,shouldHideArrow:be,children:m.jsx(nt.div,{"data-side":$,"data-align":J,...g,ref:w,style:{...g.style,animation:Z?void 0:"none"}})})})});vN.displayName=Qb;var bN="PopperArrow",d3={top:"bottom",right:"left",bottom:"top",left:"right"},wN=x.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=u3(bN,r),o=d3[i.placedSide];return m.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:m.jsx(a3,{...s,ref:n,style:{...s.style,display:"block"}})})});wN.displayName=bN;function f3(t){return t!==null}var h3=t=>({name:"transformOrigin",options:t,fn(e){var y,v,b;const{placement:n,rects:r,middlewareData:s}=e,o=((y=s.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,u]=xN(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,h=(((b=s.arrow)==null?void 0:b.y)??0)+l/2;let p="",g="";return c==="bottom"?(p=o?d:`${f}px`,g=`${-l}px`):c==="top"?(p=o?d:`${f}px`,g=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,g=o?d:`${h}px`):c==="left"&&(p=`${r.floating.width+l}px`,g=o?d:`${h}px`),{data:{x:p,y:g}}}});function xN(t){const[e,n="center"]=t.split("-");return[e,n]}var p3=yN,m3=vN,g3=wN,[om,xY]=ia("Tooltip",[pN]),Zb=pN(),kN="TooltipProvider",y3=700,fk="tooltip.open",[v3,SN]=om(kN),EN=t=>{const{__scopeTooltip:e,delayDuration:n=y3,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=x.useRef(!0),a=x.useRef(!1),l=x.useRef(0);return x.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),m.jsx(v3,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:x.useCallback(c=>{a.current=c},[]),disableHoverableContent:s,children:i})};EN.displayName=kN;var CN="Tooltip",[kY,am]=om(CN),$v="TooltipTrigger",b3=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=am($v,n),i=SN($v,n),o=Zb(n),a=x.useRef(null),l=qt(e,a,s.onTriggerChange),c=x.useRef(!1),u=x.useRef(!1),d=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.jsx(p3,{asChild:!0,...o,children:m.jsx(nt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Ge(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ge(t.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:Ge(t.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ge(t.onFocus,()=>{c.current||s.onOpen()}),onBlur:Ge(t.onBlur,s.onClose),onClick:Ge(t.onClick,s.onClose)})})});b3.displayName=$v;var w3="TooltipPortal",[SY,x3]=om(w3,{forceMount:void 0}),Il="TooltipContent",_N=x.forwardRef((t,e)=>{const n=x3(Il,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=am(Il,t.__scopeTooltip);return m.jsx(Zl,{present:r||o.open,children:o.disableHoverableContent?m.jsx(TN,{side:s,...i,ref:e}):m.jsx(k3,{side:s,...i,ref:e})})}),k3=x.forwardRef((t,e)=>{const n=am(Il,t.__scopeTooltip),r=SN(Il,t.__scopeTooltip),s=x.useRef(null),i=qt(e,s),[o,a]=x.useState(null),{trigger:l,onClose:c}=n,u=s.current,{onPointerInTransitChange:d}=r,f=x.useCallback(()=>{a(null),d(!1)},[d]),h=x.useCallback((p,g)=>{const y=p.currentTarget,v={x:p.clientX,y:p.clientY},b=T3(v,y.getBoundingClientRect()),w=A3(v,b),k=N3(g.getBoundingClientRect()),S=R3([...w,...k]);a(S),d(!0)},[d]);return x.useEffect(()=>()=>f(),[f]),x.useEffect(()=>{if(l&&u){const p=y=>h(y,u),g=y=>h(y,l);return l.addEventListener("pointerleave",p),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",g)}}},[l,u,h,f]),x.useEffect(()=>{if(o){const p=g=>{const y=g.target,v={x:g.clientX,y:g.clientY},b=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),w=!O3(v,o);b?f():w&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,o,c,f]),m.jsx(TN,{...t,ref:i})}),[S3,E3]=om(CN,{isInside:!1}),C3=fA("TooltipContent"),TN=x.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=am(Il,n),c=Zb(n),{onClose:u}=l;return x.useEffect(()=>(document.addEventListener(fk,u),()=>document.removeEventListener(fk,u)),[u]),x.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),m.jsx(Xp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:m.jsxs(m3,{"data-state":l.stateAttribute,...c,...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:[m.jsx(C3,{children:r}),m.jsx(S3,{scope:n,isInside:!0,children:m.jsx(E4,{id:l.contentId,role:"tooltip",children:s||r})})]})})});_N.displayName=Il;var AN="TooltipArrow",_3=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Zb(n);return E3(AN,n).isInside?null:m.jsx(g3,{...s,...r,ref:e})});_3.displayName=AN;function T3(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 A3(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 N3(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 O3(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],l=e[o],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(s=!s)}return s}function R3(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),P3(e)}function P3(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 I3=EN,NN=_N;const j3=I3,M3=x.forwardRef(({className:t,sideOffset:e=4,...n},r)=>m.jsx(NN,{ref:r,sideOffset:e,className:Ee("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]:sli
241de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));M3.displayName=NN.displayName;const ON="/assets/logo-isb-DOrEFNif.png",RN="/assets/logo-isb-dark-eP9Hp0Tu.png",Yb=gd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-200 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 hover:shadow-lg hover:shadow-primary/25",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",inverted:"bg-secondary-foreground text-secondary hover:bg-secondary-foreground/90"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Le=x.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const o=r?uA:"button";return m.jsx(o,{className:Ee(Yb({variant:e,size:n,className:t})),ref:i,...s})});Le.displayName="Button";var Eg="focusScope.autoFocusOnMount",Cg="focusScope.autoFocusOnUnmount",hk={bubbles:!1,cancelable:!0},L3="FocusScope",PN=x.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,l]=x.useState(null),c=Zr(s),u=Zr(i),d=x.useRef(null),f=qt(e,g=>l(g)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let g=function(w){if(h.paused||!a)return;const k=w.target;a.contains(k)?d.current=k:Gs(d.current,{select:!0})},y=function(w){if(h.paused||!a)return;const k=w.relatedTarget;k!==null&&(a.contains(k)||Gs(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Gs(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const b=new MutationObserver(v);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,h.paused]),x.useEffect(()=>{if(a){mk.add(h);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Eg,hk);a.addEventListener(Eg,c),a.dispatchEvent(v),v.defaultPrevented||(D3(U3(IN(a)),{select:!0}),document.activeElement===g&&Gs(a))}return()=>{a.removeEventListener(Eg,c),setTimeout(()=>{const v=new CustomEvent(Cg,hk);a.addEventListener(Cg,u),a.dispatchEvent(v),v.defaultPrevented||Gs(g??document.body,{select:!0}),a.removeEventListener(Cg,u),mk.remove(h)},0)}}},[a,c,u,h]);const p=x.useCallback(g=>{if(!n&&!r||h.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const b=g.currentTarget,[w,k]=$3(b);w&&k?!g.shiftKey&&v===k?(g.preventDefault(),n&&Gs(w,{select:!0})):g.shiftKey&&v===w&&(g.preventDefault(),n&&Gs(k,{select:!0})):v===b&&g.preventDefault()}},[n,r,h.paused]);return m.jsx(nt.div,{tabIndex:-1,...o,ref:f,onKeyDown:p})});PN.displayName=L3;function D3(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Gs(r,{select:e}),document.activeElement!==n)return}function $3(t){const e=IN(t),n=pk(e,t),r=pk(e.reverse(),t);return[n,r]}function IN(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 pk(t,e){for(const n of t)if(!F3(n,{upTo:e}))return n}function F3(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 B3(t){return t instanceof HTMLInputElement&&"select"in t}function Gs(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&B3(t)&&e&&t.select()}}var mk=z3();function z3(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=gk(t,e),t.unshift(e)},remove(e){var n;t=gk(t,e),(n=t[0])==null||n.resume()}}}function gk(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function U3(t){return t.filter(e=>e.tagName!=="A")}var _g=0;function V3(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??yk()),document.body.insertAdjacentElement("beforeend",t[1]??yk()),_g++,()=>{_g===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 4,616 bytes, line 241
241=>e.remove()),_g--}},[])}function yk(){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 Vr=function(){return Vr=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},Vr.apply(this,arguments)};function tc(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 H3(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(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}function W3(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 Ff="right-scroll-bar-position",Bf="width-before-scroll-bar",q3="with-scroll-bars-hidden",K3="--removed-body-scroll-bar-size";function Tg(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function G3(t,e){var n=x.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 J3=typeof window<"u"?x.useLayoutEffect:x.useEffect,vk=new WeakMap;function Q3(t,e){var n=G3(null,function(r){return t.forEach(function(s){return Tg(s,r)})});return J3(function(){var r=vk.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(a){i.has(a)||Tg(a,null)}),i.forEach(function(a){s.has(a)||Tg(a,o)})}vk.set(n,t)},[t]),n}function Z3(t){return t}function Y3(t,e){e===void 0&&(e=Z3);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 l=function(){var u=o;o=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return s}function X3(t){t===void 0&&(t={});var e=Y3(null);return e.options=Vr({async:!0,ssr:!1},t),e}var jN=function(t){var e=t.sideCar,n=tc(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 x.createElement(r,Vr({},n))};jN.isSideCarExport=!0;function ez(t,e){return t.useMedium(e),jN}var MN=X3(),Ag=function(){},lm=x.forwardRef(function(t,e){var n=x.useRef(null),r=x.useState({onScrollCapture:Ag,onWheelCapture:Ag,onTouchMoveCapture:Ag}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,d=t.shards,f=t.sideCar,h=t.noRelative,p=t.noIsolation,g=t.inert,y=t.allowPinchZoom,v=t.as,b=v===void 0?"div":v,w=t.gapMode,k=tc(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,C=Q3([n,e]),E=Vr(Vr({},k),s);return x.createElement(x.Fragment,null,u&&x.createElement(S,{sideCar:MN,removeScrollBar:c,shards:d,noRelative:h,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),o?x.cloneElement(x.Children.only(a),Vr(Vr({},E),{ref:C})):x.createElement(b,Vr({},E,{className:l,ref:C}),a))});lm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lm.classNames={fullWidth:Bf,zeroRight:Ff};var tz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nz(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=tz();return e&&t.setAttribute("nonce",e),t}function rz(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function sz(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var iz=function(){var t=0,e=null;
vendor: 4,547 bytes, lines 241-281
241return{add:function(n){t==0&&(e=nz())&&(rz(e,n),sz(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},oz=function(){var t=iz();return function(e,n){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},LN=function(){var t=oz(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},az={left:0,top:0,right:0,gap:0},Ng=function(t){return parseInt(t||"",10)||0},lz=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[Ng(n),Ng(r),Ng(s)]},cz=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return az;var e=lz(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])}},uz=LN(),ol="data-scroll-locked",dz=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
242  .`.concat(q3,` {
243   overflow: hidden `).concat(r,`;
244   padding-right: `).concat(a,"px ").concat(r,`;
245  }
246  body[`).concat(ol,`] {
247    overflow: hidden `).concat(r,`;
248    overscroll-behavior: contain;
249    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
250    padding-left: `.concat(s,`px;
251    padding-top: `).concat(i,`px;
252    padding-right: `).concat(o,`px;
253    margin-left:0;
254    margin-top:0;
255    margin-right: `).concat(a,"px ").concat(r,`;
256    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
257  }
258  
259  .`).concat(Ff,` {
260    right: `).concat(a,"px ").concat(r,`;
261  }
262  
263  .`).concat(Bf,` {
264    margin-right: `).concat(a,"px ").concat(r,`;
265  }
266  
267  .`).concat(Ff," .").concat(Ff,` {
268    right: 0 `).concat(r,`;
269  }
270  
271  .`).concat(Bf," .").concat(Bf,` {
272    margin-right: 0 `).concat(r,`;
273  }
274  
275  body[`).concat(ol,`] {
276    `).concat(K3,": ").concat(a,`px;
277  }
278`)},bk=function(){var t=parseInt(document.body.getAttribute(ol)||"0",10);return isFinite(t)?t:0},fz=function(){x.useEffect(function(){return document.body.setAttribute(ol,(bk()+1).toString()),function(){var t=bk()-1;t<=0?document.body.removeAttribute(ol):document.body.setAttribute(ol,t.toString())}},[])},hz=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;fz();var i=x.useMemo(function(){return cz(s)},[s]);return x.createElement(uz,{styles:dz(i,!e,s,n?"":"!important")})},Fv=!1;if(typeof window<"u")try{var tf=Object.defineProperty({},"passive",{get:function(){return Fv=!0,!0}});window.addEventListener("test",tf,tf),window.removeEventListener("test",tf,tf)}catch{Fv=!1}var ga=Fv?{passive:!1}:!1,pz=function(t){return t.tagName==="TEXTAREA"},DN=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!pz(t)&&n[e]==="visible")},mz=function(t){return DN(t,"overflowY")},gz=function(t){return DN(t,"overflowX")},wk=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=$N(t,r);if(s){var i=FN(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},vz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},$N=function(t,e){return t==="v"?mz(e):gz(e)},FN=function(t,e){return t==="v"?yz(e):vz(e)},bz=function(t,e){return t==="h"&&e==="rtl"?-1:1},wz=function(t,e,n,r,s){var i=bz(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,l=e.contains(a),c=!1,u=o>0,d=0,f=0;do{if(!a)break;var h=FN(t,a),p=h[0],g=h[1],y=h[2],v=g-y-i*p;(p||v)&&$N(t,a)&&(d+=v,f+=p);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(u&&(Math.abs(d)<1||!s)||!u&&(Math.abs(f)<1||!s))&&(c=!0),c},nf=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},xk=function(t){return[t.deltaX,t.deltaY]},kk=function(t){return t&&"current"in t?t.current:t},xz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},kz=function(t){return`
279  .block-interactivity-`.concat(t,` {pointer-events: none;}
280  .allow-interactivity-`).concat(t,` {pointer-events: all;}
281`)},Sz=0,ya=[];function Ez(t){var e=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),s=x.useState(Sz++)[0],i=x.useState(LN)[0],o=x.useRef(t);x.useEffect(function(){o.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));
vendor: 10,493 bytes, lines 281-285
281var g=W3([t.lockRef.current],(t.shards||[]).map(kk),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=x.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var v=nf(g),b=n.current,w="deltaX"in g?g.deltaX:b[0]-v[0],k="deltaY"in g?g.deltaY:b[1]-v[1],S,C=g.target,E=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in g&&E==="h"&&C.type==="range")return!1;var T=wk(E,C);if(!T)return!0;if(T?S=E:(S=E==="v"?"h":"v",T=wk(E,C)),!T)return!1;if(!r.current&&"changedTouches"in g&&(w||k)&&(r.current=S),!S)return!0;var N=r.current||S;return wz(N,y,g,N==="h"?w:k,!0)},[]),l=x.useCallback(function(g){var y=g;if(!(!ya.length||ya[ya.length-1]!==i)){var v="deltaY"in y?xk(y):nf(y),b=e.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&xz(S.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(kk).filter(Boolean).filter(function(S){return S.contains(y.target)}),k=w.length>0?a(y,w[0]):!o.current.noIsolation;k&&y.cancelable&&y.preventDefault()}}},[]),c=x.useCallback(function(g,y,v,b){var w={name:g,delta:y,target:v,should:b,shadowParent:Cz(v)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(k){return k!==w})},1)},[]),u=x.useCallback(function(g){n.current=nf(g),r.current=void 0},[]),d=x.useCallback(function(g){c(g.type,xk(g),g.target,a(g,t.lockRef.current))},[]),f=x.useCallback(function(g){c(g.type,nf(g),g.target,a(g,t.lockRef.current))},[]);x.useEffect(function(){return ya.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ga),document.addEventListener("touchmove",l,ga),document.addEventListener("touchstart",u,ga),function(){ya=ya.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,ga),document.removeEventListener("touchmove",l,ga),document.removeEventListener("touchstart",u,ga)}},[]);var h=t.removeScrollBar,p=t.inert;return x.createElement(x.Fragment,null,p?x.createElement(i,{styles:kz(s)}):null,h?x.createElement(hz,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Cz(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const _z=ez(MN,Ez);var BN=x.forwardRef(function(t,e){return x.createElement(lm,Vr({},t,{ref:e,sideCar:_z}))});BN.classNames=lm.classNames;var Tz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},va=new WeakMap,rf=new WeakMap,sf={},Og=0,zN=function(t){return t&&(t.host||zN(t.parentNode))},Az=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=zN(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})},Nz=function(t,e,n,r){var s=Az(e,Array.isArray(t)?t:[t]);sf[n]||(sf[n]=new WeakMap);var i=sf[n],o=[],a=new Set,l=new Set(s),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};s.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),p=h!==null&&h!=="false",g=(va.get(f)||0)+1,y=(i.get(f)||0)+1;va.set(f,g),i.set(f,y),o.push(f),g===1&&p&&rf.set(f,!0),y===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return u(e),a.clear(),Og++,function(){o.forEach(function(d){var f=va.get(d)-1,h=i.get(d)-1;va.set(d,f),i.set(d,h),f||(rf.has(d)||d.removeAttribute(r),rf.delete(d)),h||d.removeAttribute(n)}),Og--,Og||(va=new WeakMap,va=new WeakMap,rf=new WeakMap,sf={})}},Oz=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Tz(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),Nz(r,s,n,"aria-hidden")):function(){return null}},cm="Dialog",[UN,VN]=ia(cm),[Rz,Nr]=UN(cm),HN=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=x.useRef(null),l=x.useRef(null),[c,u]=yA({prop:r,defaultProp:s??!1,onChange:i,caller:cm});return m.jsx(Rz,{scope:e,triggerRef:a,contentRef:l,contentId:xg(),titleId:xg(),descriptionId:xg(),open:c,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};HN.displayName=cm;var WN="DialogTrigger",qN=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Nr(WN,n),i=qt(e,s.triggerRef);return m.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":tw(s.open),...r,ref:i,onClick:Ge(t.onClick,s.onOpenToggle)})});qN.displayName=WN;var Xb="DialogPortal",[Pz,KN]=UN(Xb,{forceMount:void 0}),GN=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Nr(Xb,e);return m.jsx(Pz,{scope:e,forceMount:n,children:x.Children.map(r,o=>m.jsx(Zl,{present:n||i.open,children:m.jsx(Db,{asChild:!0,container:s,children:o})}))})};GN.displayName=Xb;var Rh="DialogOverlay",JN=x.forwardRef((t,e)=>{const n=KN(Rh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Nr(Rh,t.__scopeDialog);return i.modal?m.jsx(Zl,{present:r||i.open,children:m.jsx(jz,{...s,ref:e})}):null});JN.displayName=Rh;var Iz=Pu("DialogOverlay.RemoveScroll"),jz=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Nr(Rh,n);return m.jsx(BN,{as:Iz,allowPinchZoom:!0,shards:[s.contentRef],children:m.jsx(nt.div,{"data-state":tw(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Jo="DialogContent",QN=x.forwardRef((t,e)=>{const n=KN(Jo,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Nr(Jo,t.__scopeDialog);return m.jsx(Zl,{present:r||i.open,children:i.modal?m.jsx(Mz,{...s,ref:e}):m.jsx(Lz,{...s,ref:e})})});QN.displayName=Jo;var Mz=x.forwardRef((t,e)=>{const n=Nr(Jo,t.__scopeDialog),r=x.useRef(null),s=qt(e,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return Oz(i)},[]),m.jsx(ZN,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ge(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ge(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Ge(t.onFocusOutside,i=>i.preventDefault())})}),Lz=x.forwardRef((t,e)=>{const n=Nr(Jo,t.__scopeDialog),r=x.useRef(!1),s=x.useRef(!1);return m.jsx(ZN,{...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 l,c;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),ZN=x.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Nr(Jo,n),l=x.useRef(null),c=qt(e,l);return V3(),m.jsxs(m.Fragment,{children:[m.jsx(PN,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:m.jsx(Xp,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":tw(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx($z,{titleId:a.titleId}),m.jsx(Bz,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ew="DialogTitle",YN=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Nr(ew,n);return m.jsx(nt.h2,{id:s.titleId,...r,ref:e})});YN.displayName=ew;var XN="DialogDescription",eO=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Nr(XN,n);return m.jsx(nt.p,{id:s.descriptionId,...r,ref:e})});eO.displayName=XN;var tO="DialogClose",nO=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Nr(tO,n);return m.jsx(nt.button,{type:"button",...r,ref:e,onClick:Ge(t.onClick,()=>s.onOpenChange(!1))})});nO.displayName=tO;function tw(t){return t?"open":"closed"}var rO="DialogTitleWarning",[Dz,sO]=Y$(rO,{contentName:Jo,titleName:ew,docsSlug:"dialog"}),$z=({titleId:t})=>{const e=sO(rO),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
282
283If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
284
285For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Fz="DialogDescriptionWarning",Bz=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${sO(Fz).contentName}}.`;return x.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},nw=HN,iO=qN,rw=GN,vd=JN,bd=QN,wd=YN,xd=eO,um=nO;const zz=nw,Uz=iO,Vz=rw,oO=x.forwardRef(({className:t,...e},n)=>m.jsx(vd,{className:Ee("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}));oO.displayName=vd.displayName;const Hz=gd("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"}}),aO=x.forwardRef(({side:t="right",className:e,children:n,...r},s)=>m.jsxs(Vz,{children:[m.jsx(oO,{}),m.jsxs(bd,{ref:s,className:Ee(Hz({side:t}),e),...r,children:[n,m.jsxs(um,{className:"absolute right-4 top-4 roun
285ded-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:[m.jsx(nm,{className:"h-4 w-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));aO.displayName=bd.displayName;const lO=({className:t,...e})=>m.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",t),...e});lO.displayName="SheetHeader";const cO=x.forwardRef(({className:t,...e},n)=>m.jsx(wd,{ref:n,className:Ee("text-lg font-semibold text-foreground",t),...e}));cO.displayName=wd.displayName;const Wz=x.forwardRef(({className:t,...e},n)=>m.jsx(xd,{ref:n,className:Ee("text-sm text-muted-foreground",t),...e}));Wz.displayName=xd.displayName;const qz=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class sw extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class Kz extends sw{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Sk extends sw{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Ek extends sw{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Bv;(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"})(Bv||(Bv={}));class Gz{constructor(e,{headers:n={},customFetch:r,region:s=Bv.Any}={}){this.url=e,this.headers=n,this.region=s,this.fetch=qz(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return H3(this,arguments,void 0,function*(n,r={}){var s;let i,o;try{const{headers:a,method:l,body:c,signal:u,timeout:d}=r;let f={},{region:h}=r;h||(h=this.region);const p=new URL(`${this.url}/${n}`);h&&h!=="any"&&(f["x-region"]=h,p.searchParams.set("forceFunctionRegion",h));let g;c&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",g=c):typeof c=="string"?(f["Content-Type"]="text/plain",g=c):typeof FormData<"u"&&c instanceof FormData?g=c:(f["Content-Type"]="application/json",g=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?g=JSON.stringify(c):g=c;let y=u;d&&(o=new AbortController,i=setTimeout(()=>o.abort(),d),u?(y=o.signal,u.addEventListener("abort",()=>o.abort())):y=o.signal);const v=yield this.fetch(p.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),a),body:g,signal:y}).catch(S=>{throw new Kz(S)}),b=v.headers.get("x-relay-error");if(b&&b==="true")throw new Sk(v);if(!v.ok)throw new Ek(v);let w=((s=v.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),k;return w==="application/json"?k=yield v.json():w==="application/octet-stream"||w==="application/pdf"?k=yield v.blob():w==="text/event-stream"?k=v:w==="multipart/form-data"?k=yield v.formData():k=yield v.text(),{data:k,error:null,response:v}}catch(a){return{data:null,error:a,response:a instanceof Ek||a instanceof Sk?a.context:void 0}}finally{i&&clearTimeout(i)}})}}var Jz=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
285de=t.code}},Qz=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,l=null,c=i.status,u=i.statusText;if(i.ok){var d,f;if(n.method!=="HEAD"){var h;const v=await i.text();v===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((h=n.headers.get("Accept"))===null||h===void 0)&&h.includes("application/vnd.pgrst.plan+text"))?a=v:a=JSON.parse(v))}const g=(d=n.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),y=(f=i.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");g&&y&&y.length>1&&(l=parseInt(y[1])),n.isMaybeSingle&&n.method==="GET"&&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,l=null,c=406,u="Not Acceptable"):a.length===1?a=a[0]:a=null)}else{var p;const g=await i.text();try{o=JSON.parse(g),Array.isArray(o)&&i.status===404&&(a=[],o=null,c=200,u="OK")}catch{i.status===404&&g===""?(c=204,u="No Content"):o={message:g}}if(o&&n.isMaybeSingle&&(!(o==null||(p=o.details)===null||p===void 0)&&p.includes("0 rows"))&&(o=null,c=200,u="OK"),o&&n.shouldThrowOnError)throw new Jz(o)}return{error:o,data:a,count:l,status:c,statusText:u}});return this.shouldThrowOnError||(s=s.catch(i=>{var o;let a="",l="",c="";const u=i==null?void 0:i.cause;if(u){var d,f,h,p;const v=(d=u==null?void 0:u.message)!==null&&d!==void 0?d:"",b=(f=u==null?void 0:u.code)!==null&&f!==void 0?f:"";a=`${(h=i==null?void 0:i.name)!==null&&h!==void 0?h:"FetchError"}: ${i==null?void 0:i.message}`,a+=`
286
287Caused by: ${(p=u==null?void 0:u.name)!==null&&p!==void 0?p:"Error"}: ${v}`,b&&(a+=` (${b})`),u!=null&&u.stack&&(a+=`
288${u.stack}`)}else{var g;a=(g=i==null?void 0:i.stack)!==null&&g!==void 0?g:""}const y=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(c="",l="Request was aborted (timeout or manual cancellation)",y>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${y} 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.`)):((u==null?void 0:u.name)==="HeadersOverflowError"||(u==null?void 0:u.code)==="UND_ERR_HEADERS_OVERFLOW")&&(c="",l="HTTP headers exceeded server limits (typically 16KB)",y>this.urlLengthLimit&&(l+=`. Your request URL is ${y} 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:l,code:c},data:null,count:null,status:0,statusText:""}})),s.then(t,e)}returns(){return this}overrideTypes(){return this}},Zz=class extends Qz{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.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
288explain({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("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; 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 Ck=new RegExp("[,()]");var Na=class extends Zz{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"&&Ck.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"&&Ck.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).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}},Yz=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(c=>/\s/.test(c)&&!i?"":(c==='"'&&(i=!i),c)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),r&&l.append("Prefer",`count=${r}`),new Na({method:s,url:a,headers:l,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((l,c)=>l.concat(Object.keys(c)),[]);if(a.length>
2880){const l=[...new Set(a)].map(c=>`"${c}"`);i.searchParams.set("columns",l.join(","))}}return new Na({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:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),r&&l.append("Prefer",`count=${r}`),s||l.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(c.length>0){const u=[...new Set(c)].map(d=>`"${d}"`);a.searchParams.set("columns",u.join(","))}}return new Na({method:o,url:a,headers:l,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 Na({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 Na({method:n,url:r,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit})}};function Mu(t){"@babel/helpers - typeof";return Mu=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},Mu(t)}function Xz(t,e){if(Mu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Mu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function e5(t){var e=Xz(t,"string");return Mu(e)=="symbol"?e:e+""}function t5(t,e,n){return(e=e5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _k(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 of(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_k(Object(n),!0).forEach(function(r){t5(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_k(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var n5=class uO{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=(l,c)=>{const u=new AbortController,d=setTimeout(()=>u.abort(),i),f=c==null?void 0:c.signal;if(f){if(f.aborted)return clearTimeout(d),a(l,c);const h=()=>{clearTimeout(d),u.abort()};return f.addEventListener("abort",h,{once:!0}),a(l,of(of({},c),{},{signal:u.signal})).finally(()=>{clearTimeout(d),f.removeEventListener("abort",h)})}return a(l,of(of({},c),{},{signal:u.signal})).finally(()=>clearTimeout(d))}: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 Yz(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(e){return new uO(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 l=new URL(`${this.url}/rpc/${e}`);let c;const u=h=>h!==null&&typeof h=="object"&&(!Array.isArray(h)||h.some(u)),d=r&&Object.values(n).some(u);d?(a="POST",c=n):r||s?(a=r?"HEAD":"GET",Object.entries(n).filter(([h,p])=>p!==void 0).map(([h,p])=>[h,Array.isArray(p)?`{${p.join(",")}}`:`${p}
288`]).forEach(([h,p])=>{l.searchParams.append(h,p)})):(a="POST",c=n);const f=new Headers(this.headers);return d?f.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&f.set("Prefer",`count=${i}`),new Na({method:a,url:l,headers:f,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit})}};class r5{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:
289import ws from "ws"
290new 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+=`
291
292Suggested solution: ${e.workaround}`),new Error(n)}static createWebSocket(e,n){const r=this.getWebSocketConstructor();return new r(e,n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const s5="2.99.1",i5=`realtime-js/${s5}`,o5="1.0.0",dO="2.0.0",Tk=dO,zv=1e4,a5=1e3,l5=100;var Ys;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Ys||(Ys={}));var xt;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(xt||(xt={}));var yr;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(yr||(yr={}));var Uv;(function(t){t.websocket="websocket"})(Uv||(Uv={}));var fo;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(fo||(fo={}));class c5{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:"",l=(i=e.join_ref)!==null&&i!==void 0?i:"",c=e.payload.event,u=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},d=Object.keys(u).length===0?"":JSON.stringify(u);if(l.length>255)throw new Error(`joinRef length ${l.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(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+c.length+d.length,h=new ArrayBuffer(this.HEADER_LENGTH+f);
292let p=new DataView(h),g=0;p.setUint8(g++,this.KINDS.userBroadcastPush),p.setUint8(g++,l.length),p.setUint8(g++,a.length),p.setUint8(g++,o.length),p.setUint8(g++,c.length),p.setUint8(g++,d.length),p.setUint8(g++,n),Array.from(l,v=>p.setUint8(g++,v.charCodeAt(0))),Array.from(a,v=>p.setUint8(g++,v.charCodeAt(0))),Array.from(o,v=>p.setUint8(g++,v.charCodeAt(0))),Array.from(c,v=>p.setUint8(g++,v.charCodeAt(0))),Array.from(d,v=>p.setUint8(g++,v.charCodeAt(0)));var y=new Uint8Array(h.byteLength+r.byteLength);return y.set(new Uint8Array(h),0),y.set(new Uint8Array(r),h.byteLength),y.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,l]=r;return n({join_ref:s,ref:i,topic:o,event:a,payload:l})}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 l=this.HEADER_LENGTH+4;const c=r.decode(e.slice(l,l+s));l=l+s;const u=r.decode(e.slice(l,l+i));l=l+i;const d=r.decode(e.slice(l,l+o));l=l+o;const f=e.slice(l,e.byteLength),h=a===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,p={type:this.BROADCAST_EVENT,event:u,payload:h};return o>0&&(p.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_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)))}}class fO{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Ve;(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"})(Ve||(Ve={}));const Ak=(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]=u5(o,t,e,s),i),{}):{}},u5=(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)?hO(i,o):Vv(o)},hO=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return p5(e,n)}switch(t){case Ve.bool:return d5(e);case Ve.float4:case Ve.float8:case Ve.int2:case Ve.int4:case Ve.int8:case Ve.numeric:case Ve.oid:return f5(e);case Ve.json:case Ve.jsonb:return h5(e);case Ve.timestamp:return m5(e);case Ve.abstime:case Ve.date:case Ve.daterange:case Ve.int4range:case Ve.int8range:case Ve.money:case Ve.reltime:case Ve.text:case Ve.time:case Ve.timestamptz:case Ve.timetz:case Ve.tsrange:case Ve.tstzrange:return Vv(e);default:return Vv(e)}},Vv=t=>t,d5=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},f5=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},h5=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},p5=(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=>hO(e,a))}return t},m5=t=>typeof t=="string"?t.replace(" ","T"):t,pO=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};class Rg{constructor(e,n,r={},s=zv){this.channel=e,this.event=n,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHo
292oks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Nk;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Nk||(Nk={}));class Gc{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Gc.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=Gc.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Gc.syncDiff(this.state,s,i,o),a())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,s){const i=this.cloneDeep(e),o=this.transformState(n),a={},l={};return this.map(i,(c,u)=>{o[c]||(l[c]=u)}),this.map(o,(c,u)=>{const d=i[c];if(d){const f=u.map(y=>y.presence_ref),h=d.map(y=>y.presence_ref),p=u.filter(y=>h.indexOf(y.presence_ref)<0),g=d.filter(y=>f.indexOf(y.presence_ref)<0);p.length>0&&(a[c]=p),g.length>0&&(l[c]=g)}else a[c]=u}),this.syncDiff(i,{joins:a,leaves:l},r,s)}static syncDiff(e,n,r,s){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(i,(a,l)=>{var c;const u=(c=e[a])!==null&&c!==void 0?c:[];if(e[a]=this.cloneDeep(l),u.length>0){const d=e[a].map(h=>h.presence_ref),f=u.filter(h=>d.indexOf(h.presence_ref)<0);e[a].unshift(...f)}r(a,u,l)}),this.map(o,(a,l)=>{let c=e[a];if(!c)return;const u=l.map(d=>d.presence_ref);c=c.filter(d=>u.indexOf(d.presence_ref)<0),e[a]=c,s(a,c,l),c.length===0&&delete e[a]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const s=e[r];return"metas"in s?n[r]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=s,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Ok;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Ok||(Ok={}));var Jc;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Jc||(Jc={}));var vs;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(vs||(vs={}));class Ga{constructor(e,n={config:{}},r){var s,i;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=xt.closed,this.joinedOnce=!1,this.pushBuffer=[],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.timeout=this.socket.timeout,this.joinPush=new Rg(this,yr.join,this.params,this.timeout),this.rejoinTimer=new fO(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=xt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=xt.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=xt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=xt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=xt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(yr.reply,{},(o,a)=>{this._trigger(this._replyEventName(a),o)}),this.presence=new Gc(this),this.broadcastEndpointURL=pO(this.socket.endPoint),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.state==xt.closed){const{config:{broadcast:o,presence:a,private:l}}=this.params,c=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(h=>h.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[Jc.PRESENCE]&&this.bindings[Jc.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,d={},f={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(h=>e==null?void 0:e(vs.CHANNEL_ERROR,h)),this._onClose(()=>e==null?void 0:e(vs.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:h})=>{var p;if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){e==null||e(vs.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,y=(p=g==null?void 0:g.length)!==null&&p!==void 0?p:0,v=[];for(let b=0;b<y;b++){const w=g[b],{filter:{event:k,schema:S,table:C,filter:E}}=w,T=h&&h[b];if(T&&T.event===k&&Ga.isFilterValueEqual(T.schema,S)&&Ga.isFilterValueEqual(T.table,C)&&Ga.isFilterValueEqual(T.filter,E))v.push(Object.assign(Object.assign({},w),{id:T.id}));else{this.unsubscribe(),this.state=xt.errored,e==null||e(vs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=v,e&&e(vs.SUBSCRIBED);return}}).receive("error",h=>{this.state=xt.errored,e==null||e(vs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(vs.TIMED_OUT)})}return this}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){return this.state===xt.joined&&e===Jc.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(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 l=a.statusText;
292try{const c=await a.json();l=c.error||c.message||l}catch{}return Promise.reject(new Error(l))}async send(e,n={}){var r,s;if(!this._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 l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const c=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),c.receive("ok",()=>i("ok")),c.receive("error",()=>i("error")),c.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=xt.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(yr.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(s=>{r=new Rg(this,yr.leave,{},e),r.receive("ok",()=>{n(),s("ok")}).receive("timeout",()=>{n(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=xt.closed,this.bindings={}}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}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Rg(this,e,n,r);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>l5){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var s,i;const o=e.toLocaleLowerCase(),{close:a,error:l,leave:c,join:u}=yr;if(r&&[a,l,c,u].indexOf(o)>=0&&r!==this._joinRef())return;let f=this._onMessage(o,n,r);if(n&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(h=>{var p,g,y;return((p=h.filter)===null||p===void 0?void 0:p.event)==="*"||((y=(g=h.filter)===null||g===void 0?void 0:g.event)===null||y===void 0?void 0:y.toLocaleLowerCase())===o}).map(h=>h.callback(f,r)):(i=this.bindings[o])===null||i===void 0||i.filter(h=>{var p,g,y,v,b,w;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in h){const k=h.id,S=(p=h.filter)===null||p===void 0?void 0:p.event;return k&&((g=n.ids)===null||g===void 0?void 0:g.includes(k))&&(S==="*"||(S==null?void 0:S.toLocaleLowerCase())===((y=n.data)===null||y===void 0?void 0:y.type.toLocaleLowerCase()))}else{const k=(b=(v=h==null?void 0:h.filter)===null||v===void 0?void 0:v.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return k==="*"||k===((w=n==null?void 0:n.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===o}).map(h=>{if(typeof f=="object"&&"ids"in f){const p=f.data,{schema:g,table:y,commit_timestamp:v,type:b,errors:w}=p;f=Object.assign(Object.assign({},{schema:g,table:y,commit_timestamp:v,eventType:b,new:{},old:{},errors:w}),this._getPayloadRecords(p))}h.callback(f,r)}
292)}_isClosed(){return this.state===xt.closed}_isJoined(){return this.state===xt.joined}_isJoining(){return this.state===xt.joining}_isLeaving(){return this.state===xt.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const s=e.toLocaleLowerCase(),i={type:s,filter:n,callback:r};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&Ga.isEqual(s.filter,n))})),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(yr.close,{},e)}_onError(e){this._on(yr.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=xt.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=Ak(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=Ak(e.columns,e.old_record)),n}}const Pg=()=>{},af={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},g5=[1e3,2e3,5e3,1e4],y5=1e4,v5=`
293  addEventListener("message", (e) => {
294    if (e.data.event === "start") {
295      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
296    }
297  });`;class b5{constructor(e,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=zv,this.transport=null,this.heartbeatIntervalMs=af.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Pg,this.ref=0,this.reconnectTimer=null,this.vsn=Tk,this.logger=Pg,this.conn=null,this.sendBuffer=[],this.serializer=new c5,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=s=>s?(...i)=>s(...i):(...i)=>fetch(...i),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${e}/${Uv.websocket}`,this.httpEndpoint=pO(e),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=r5.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n}
298
299To use Realtime in Node.js, you need to provide a WebSocket implementation:
300
301Option 1: Use Node.js 22+ which has native WebSocket support
302Option 2: Install and provide the "ws" package:
303
304  npm install ws
305
306  import ws from "ws"
307  const client = new RealtimeClient(url, {
308    ...options,
309    transport: ws
310  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Ys.connecting:return fo.Connecting;case Ys.open:return fo.Open;case Ys.closing:return fo.Closing;default:return fo.Closed}}isConnected(){return this.connectionState()===fo.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}
310channel(e,n={config:{}}){const r=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new Ga(`realtime:${e}`,n,this);return this.channels.push(i),i}}push(e){const{topic:n,event:r,payload:s,ref:i}=e,o=()=>{this.encode(e,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${n} ${r} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(a5,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},af.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const c=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",c)}catch(u){this.log("error","error in heartbeat callback",u)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:s,payload:i,ref:o}=n,a=o?`(${o})`:"",l=i.status||"";this.log("receive",`${l} ${r} ${s} ${a}`.trim(),i),this.channels.filter(c=>c._isMember(r)).forEach(c=>c._trigger(s,i,o)),this._triggerStateCallbacks("message",n)})}_clearTimer(e){var n;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e),this.conn.readyState===Ys.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Ys.open||this.conn.readyState===Ys.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.accessTokenValue&&(this.channels.forEach(n=>{n.updateJoinPayload({access_token:this.accessTokenValue})}),this.sendBuffer=[],this.channels.forEach(n=>{n._isJoining()&&(n.joinPush.sent=!1,n.joinPush.send())})),this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(e){var n;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e);try{this.heartbeatCallback("error")}catch(n){this.log("error","error in heartbeat callback",n)}}
310_triggerChanError(){this.channels.forEach(e=>e._trigger(yr.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",s=new URLSearchParams(n);return`${e}${r}${s}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([v5],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(e,n=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=n)}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:i5};n&&s.updateJoinPayload(i),s.joinedOnce&&s._isJoined()&&s._push(yr.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)})}_triggerStateCallbacks(e,n){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(n)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new fO(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},af.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,s,i,o,a,l,c,u,d,f,h;switch(this.transport=(n=e==null?void 0:e.transport)!==null&&n!==void 0?n:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:zv,this.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:af.HEARTBEAT_INTERVAL,this.worker=(i=e==null?void 0:e.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=e==null?void 0:e.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(a=e==null?void 0:e.heartbeatCallback)!==null&&a!==void 0?a:Pg,this.vsn=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:Tk,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=e==null?void 0:e.reconnectAfterMs)!==null&&c!==void 0?c:p=>g5[p-1]||y5,this.vsn){case o5:this.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:(p,g)=>g(JSON.stringify(p)),this.decode=(d=e==null?void 0:e.decode)!==null&&d!==void 0?d:(p,g)=>g(JSON.parse(p));break;case dO:this.encode=(f=e==null?void 0:e.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}var Lu=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 w5(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 x5(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 k5(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=w5(t.baseUrl,r,s),l=await x5(t.auth),c=await e(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):void 0}),u=await c.text(),d=(c.headers.get("content-type")||"").includes("application/json"),f=d&&u?JSON.parse(u):u;if(!c.ok){const h=d?f:void 0,p=h==null?void 0:h.error;throw new Lu((p==null?void 0:p.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:p==null?void 0:p.type,icebergCode:p==null?void 0:p.code,details:h})}return{status:c.status,headers:c.headers,data:f}}}}function lf(t){return t.join("�")}var S5=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:lf(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/${lf(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${lf(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${lf(t.namespace)}`}),!0}catch(e){if(e instanceof Lu&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof Lu&&n.status===409)return;throw n}}};function ba(t){return t.join("�")}var E5=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/${ba(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/${ba(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/${ba(t.namespace)}
310/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/${ba(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/${ba(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/${ba(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof Lu&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof Lu&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},C5=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=k5({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new S5(this.client,e),this.tableOps=new E5(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)}},dm=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 fm(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Ac=class extends dm{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}}},mO=class extends dm{constructor(t,e,n="storage"){super(t,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};const _5=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),T5=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)},Hv=t=>{if(Array.isArray(t))return t.map(n=>Hv(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]=Hv(r)}),e},A5=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function Du(t){"@babel/helpers - typeof";return Du=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},Du(t)}function N5(t,e){if(Du(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}
310function O5(t){var e=N5(t,"string");return Du(e)=="symbol"?e:e+""}function R5(t,e,n){return(e=O5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rk(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 de(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Rk(Object(n),!0).forEach(function(r){R5(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rk(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const Pk=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)},P5=async(t,e,n,r)=>{if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"){const s=t,i=s.status||500;if(typeof s.json=="function")s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";e(new Ac(Pk(o),i,a,r))}).catch(()=>{if(r==="vectors"){const o=i+"";e(new Ac(s.statusText||`HTTP ${i} error`,i,o,r))}else{const o=i+"";e(new Ac(s.statusText||`HTTP ${i} error`,i,o,r))}});else{const o=i+"";e(new Ac(s.statusText||`HTTP ${i} error`,i,o,r))}}else e(new mO(Pk(t),t,r))},I5=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||t==="HEAD"||!r?de(de({},s),n):(T5(r)?(s.headers=de({"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),de(de({},s),n))};async function gc(t,e,n,r,s,i,o){return new Promise((a,l)=>{t(n,I5(e,r,s,i)).then(c=>{if(!c.ok)throw c;if(r!=null&&r.noResolveJson)return c;if(o==="vectors"){const u=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!u||!u.includes("application/json"))return{}}return c.json()}).then(c=>a(c)).catch(c=>P5(c,l,r,o))})}function gO(t="storage"){return{get:async(e,n,r,s)=>gc(e,"GET",n,r,s,void 0,t),post:async(e,n,r,s,i)=>gc(e,"POST",n,s,i,r,t),put:async(e,n,r,s,i)=>gc(e,"PUT",n,s,i,r,t),head:async(e,n,r,s)=>gc(e,"HEAD",n,de(de({},r),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,n,r,s,i)=>gc(e,"DELETE",n,s,i,r,t)}}const j5=gO("storage"),{get:$u,post:hr,put:Wv,head:M5,remove:iw}=j5,Nn=gO("vectors");var nc=class{constructor(t,e={},n,r="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=e,this.fetch=_5(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=de(de({},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(fm(n))return{data:null,error:n};throw n}}},L5=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(fm(e))return{data:null,error:e};throw e}}};let yO;yO=Symbol.toStringTag;var D5=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[yO]="BlobDownloadBuilder",this.promise=null}asStream(){return new L5(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(fm(e))return{data:null,error:e};throw e}}};const $5={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Ik={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var F5=class extends nc{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=de(de({},Ik),r);let a=de(de({},s.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(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=de(de({},a),r.headers));const c=s._removeEmptyFolders(e),u=s._getFinalPath(c),d=await(t=="PUT"?Wv:hr)(s.fetch,`${s.url}/object/${u}`,i,de({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:c,id:d.Id,fullPath:d.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 l;const c=de({upsert:Ik.upsert},r),u=de(de({},s.headers),{"x-upsert":String(c.upsert)});return typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",c.cacheControl)):(l=n,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType),{path:i,fullPath:(await Wv(s.fetch,a.toString(),l,{headers:u})).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t);const s=de({},n.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const i=await hr(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 dm("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 hr(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 hr(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),i=await hr(r.fetch,`${r.url}/object/sign/${s}
310`,de({expiresIn:e},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"",a=n!=null&&n.transform&&i.signedURL.includes("/object/sign/")?i.signedURL.replace("/object/sign/","/render/image/sign/"):i.signedURL;return{signedUrl:encodeURI(`${r.url}${a}${o}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{const s=await hr(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=>de(de({},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=()=>$u(this.fetch,`${this.url}/${r}/${o}${i}`,{headers:this.headers,noResolveJson:!0},n);return new D5(a,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);return e.handleOperation(async()=>Hv(await $u(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await M5(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(fm(s)){var r;const i=s instanceof Ac?s.status:s instanceof mO?(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 iw(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=de(de(de({},$5),e),{},{prefix:t||""});return await hr(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=de({},t);return await hr(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 B5="2.99.1",kd={"X-Client-Info":`storage-js/${B5}`};var z5=class extends nc{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=de(de({},kd),e);super(i,o,n,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=e.listBucketOptionsToQueryString(t);return await $u(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await $u(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await hr(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 Wv(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 hr(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await iw(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():""}},U5=class extends nc{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=de(de({},kd),e);super(r,s,n,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await hr(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 $u(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await iw(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!A5(t))throw new dm("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 C5({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}
310),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(l){if(r)throw l;return{data:null,error:l}}}}})}},V5=class extends nc{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=de(de({},kd),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Nn.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await Nn.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Nn.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await Nn.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},H5=class extends nc{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=de(de({},kd),{},{"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 Nn.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Nn.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 Nn.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Nn.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 Nn.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},W5=class extends nc{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=de(de({},kd),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Nn.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Nn.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Nn.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Nn.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},q5=class extends W5{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new K5(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)}},K5=class extends V5{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,de(de({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,de(de({},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 G5(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},G5=class extends H5{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,de(de({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,de(de({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,de(de({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,de(de({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,de(de({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},J5=class extends z5{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new F5(this.url,this.headers,t,this.fetch)}get vectors(){return new q5(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new U5(this.url+"/iceberg",this.headers,this.fetch)}};const vO="2.99.1",Oa=30*1e3,qv=3,Ig=qv*Oa,Q5="http://localhost:9999",Z5="supabase.auth.token",Y5={"X-Client-Info":`gotrue-js/${vO}`},Kv="X-Supabase-Api-Version",bO={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},X5=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,eU=10*60*1e3;
310class Fu extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function re(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class tU extends Fu{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function nU(t){return re(t)&&t.name==="AuthApiError"}class ho extends Fu{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class Ds extends Fu{constructor(e,n,r,s){super(e,r,s),this.name=n,this.status=r}}class Cn extends Ds{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function jg(t){return re(t)&&t.name==="AuthSessionMissingError"}class wa extends Ds{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class cf extends Ds{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class uf extends Ds{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 rU(t){return re(t)&&t.name==="AuthImplicitGrantRedirectError"}class jk extends Ds{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 sU extends Ds{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 Gv extends Ds{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function Mg(t){return re(t)&&t.name==="AuthRetryableFetchError"}class Mk extends Ds{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Jv extends Ds{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Ph="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Lk=` 	
311\r=`.split(""),iU=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Lk.length;e+=1)t[Lk[e].charCodeAt(0)]=-2;for(let e=0;e<Ph.length;e+=1)t[Ph[e].charCodeAt(0)]=e;return t})();function Dk(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(Ph[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(Ph[r]),e.queuedBits-=6}}function wO(t,e,n){const r=iU[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 $k(t){const e=[],n=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{lU(o,r,n)};for(let o=0;o<t.length;o+=1)wO(t.charCodeAt(o),s,i);return e.join("")}function oU(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 aU(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}oU(r,e)}}function lU(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 al(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)wO(t.charCodeAt(s),n,r);return new Uint8Array(e)}function cU(t){const e=[];return aU(t,n=>e.push(n)),new Uint8Array(e)}function vo(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};return t.forEach(s=>Dk(s,n,r)),Dk(null,n,r),e.join("")}function uU(t){return Math.round(Date.now()/1e3)+t}function dU(){return Symbol("auth-callback")}const Dt=()=>typeof window<"u"&&typeof document<"u",so={tested:!1,writable:!1},xO=()=>{if(!Dt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(so.tested)return so.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),so.tested=!0,so.writable=!0}catch{so.tested=!0,so.writable=!1}return so.writable};function fU(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
311h((s,i)=>{e[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{e[s]=r}),e}const kO=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),hU=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Ra=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},io=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Lt=async(t,e)=>{await t.removeItem(e)};class hm{constructor(){this.promise=new hm.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}hm.promiseConstructor=Promise;function df(t){const e=t.split(".");if(e.length!==3)throw new Jv("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!X5.test(e[r]))throw new Jv("JWT not in base64url format");return{header:JSON.parse($k(e[0])),payload:JSON.parse($k(e[1])),signature:al(e[2]),raw:{header:e[0],payload:e[1]}}}async function pU(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function mU(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 gU(t){return("0"+t.toString(16)).substr(-2)}function yU(){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,gU).join("")}async function vU(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 bU(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 vU(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function xa(t,e,n=!1){const r=yU();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Ra(t,`${e}-code-verifier`,s);const i=await bU(r);return[i,r===i?"plain":"s256"]}const wU=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function xU(t){const e=t.headers.get(Kv);if(!e||!e.match(wU))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function kU(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 SU(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 EU=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ka(t){if(!EU.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Lg(){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 CU(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 Fk(t){return JSON.parse(JSON.stringify(t))}const uo=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),_U=[502,503,504];async function Bk(t){var e;if(!hU(t))throw new Gv(uo(t),0);if(_U.includes(t.status))throw new Gv(uo(t),t.status);let n;try{n=await t.json()}catch(i){throw new ho(uo(i),i)}let r;const s=xU(t);
311if(s&&s.getTime()>=bO["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 Mk(uo(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Cn}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)=>i&&typeof o=="string",!0))throw new Mk(uo(n),t.status,n.weak_password.reasons);throw new tU(uo(n),t.status||500,r)}const TU=(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 ce(t,e,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[Kv]||(i[Kv]=bO["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():"",l=await AU(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(l):{data:Object.assign({},l),error:null}}async function AU(t,e,n,r,s,i){const o=TU(e,r,s,i);let a;try{a=await t(n,Object.assign({},o))}catch(l){throw console.error(l),new Gv(uo(l),0)}if(a.ok||await Bk(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(l){await Bk(l)}}function dr(t){var e;let n=null;RU(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=uU(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function zk(t){const e=dr(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 ii(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function NU(t){return{data:t,error:null}}function OU(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=t,o=tc(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},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function Uk(t){return t}function RU(t){return t.access_token&&t.refresh_token&&t.expires_in}const Dg=["global","local","others"];class PU{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=kO(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=Dg[0]){if(Dg.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Dg.join(", ")}`);try{return await ce(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(re(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await ce(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:ii})}catch(r){if(re(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=tc(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 ce(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:OU,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(re(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await ce(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:ii})}catch(n){if(re(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,s,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await ce(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:Uk});if(u.error)throw u.error;const d=await u.json(),f=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return h.length>
3110&&(h.forEach(p=>{const g=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(p.split(";")[1].split("=")[1]);c[`${y}Page`]=g}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(re(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){ka(e);try{return await ce(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:ii})}catch(n){if(re(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){ka(e);try{return await ce(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:ii})}catch(r){if(re(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){ka(e);try{return await ce(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:ii})}catch(r){if(re(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){ka(e.userId);try{const{data:n,error:r}=await ce(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(re(n))return{data:null,error:n};throw n}}async _deleteFactor(e){ka(e.userId),ka(e.id);try{return{data:await ce(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(re(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,s,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await ce(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:Uk});if(u.error)throw u.error;const d=await u.json(),f=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(p=>{const g=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(p.split(";")[1].split("=")[1]);c[`${y}Page`]=g}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(re(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await ce(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(re(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await ce(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(re(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await ce(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(re(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await ce(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(re(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await ce(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(re(n))return{data:null,error:n};throw n}}async _listCustomProviders(e){try{const n={};return e!=null&&e.type&&(n.type=e.type),await ce(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(re(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(e){try{return await ce(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(re(n))return{data:null,error:n};throw n}}async _getCustomProvider(e){try{return await ce(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(re(n))return{data:null,error:n};throw n}}async _updateCustomProvider(e,n){try{return await ce(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(re(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{return await ce(this.fetch,"DELET
311E",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(re(n))return{data:null,error:n};throw n}}}function Vk(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const us={debug:!!(globalThis&&xO()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class SO extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class IU extends SO{}async function jU(t,e,n){us.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;e>0&&setTimeout(()=>{r.abort(),us.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 s=>{if(s){us.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await n()}finally{us.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw us.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new IU(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(us.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}})}catch(s){if((s==null?void 0:s.name)==="AbortError"&&e>0)return us.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 i=>{if(i){us.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,i.name);try{return await n()}finally{us.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,i.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw s}}function MU(){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 EO(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function LU(t){return parseInt(t,16)}function DU(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function $U(t){var e;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:c,scheme:u,uri:d,version:f}=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(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
312`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const h=EO(t.address),p=u?`${u}://${r}
312`:r,g=t.statement?`${t.statement}
313`:"",y=`${p} wants you to sign in with your Ethereum account:
314${h}
315
316${g}`;let v=`URI: ${d}
317Version: ${f}
318Chain ID: ${n}${o?`
319Nonce: ${o}`:""}
320Issued At: ${i.toISOString()}`;if(s&&(v+=`
321Expiration Time: ${s.toISOString()}`),a&&(v+=`
322Not Before: ${a.toISOString()}`),l&&(v+=`
323Request ID: ${l}`),c){let b=`
324Resources:`;for(const w of c){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+=`
325- ${w}`}v+=b}return`${y}
326${v}`}class mt 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 Ih extends mt{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function FU({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 mt({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 mt({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 mt({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 mt({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 mt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new mt({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 mt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new mt({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(CO(o)){if(i.rp.id!==o)return new mt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new mt({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 mt({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 mt({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 mt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function BU({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 mt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new mt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(CO(r)){if(n.rpId!==r)return new mt({message:`The RP ID "${n.rpId}
326" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new mt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new mt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new mt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class zU{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 UU=new zU;function VU(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=tc(t,["challenge","user","excludeCredentials"]),i=al(e).buffer,o=Object.assign(Object.assign({},n),{id:al(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 l=0;l<r.length;l++){const c=r[l];a.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:al(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function HU(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=tc(t,["challenge","allowCredentials"]),s=al(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:al(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function WU(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:vo(new Uint8Array(t.response.attestationObject)),clientDataJSON:vo(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function qU(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:vo(new Uint8Array(s.authenticatorData)),clientDataJSON:vo(new Uint8Array(s.clientDataJSON)),signature:vo(new Uint8Array(s.signature)),userHandle:s.userHandle?vo(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function CO(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Hk(){var t,e;return!!(Dt()&&"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 KU(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ih("Browser returned unexpected credential type",e)}:{data:null,error:new Ih("Empty credential response",e)}}catch(e){return{data:null,error:FU({error:e,options:t})}}}async function GU(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ih("Browser returned unexpected credential type",e)}:{data:null,error:new Ih("Empty credential response",e)}}catch(e){return{data:null,error:BU({error:e,options:t})}}}const JU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},QU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function jh(...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]=jh(a,o):r[i]=jh(o)}else r[i]=o}return r}function ZU(t,e){return jh(JU,t,e||{})}function YU(t,e){return jh(QU,t,e||{})}class XU{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:l}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!a)return{data:null,error:l};const c=s??UU.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;if(!u.name){const d=r;if(d)u.name=`${u.id}:${d}`;else{const h=(await this.client.getUser()).data.user,p=((o=h==null?void 0:h.user_metadata)===null||o===void 0?void 0:o.name)||(h==null?void 0:h.email)||(h==null?void 0:h.id)||"User";u.name=`${u.id}:${p}`}}u.displayName||(u.displayName=u.name)}
326switch(a.webauthn.type){case"create":{const u=ZU(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:f}=await KU({publicKey:u,signal:c});return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case"request":{const u=YU(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:f}=await GU(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(a){return re(a)?{data:null,error:a}:{data:null,error:new ho("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 Fu("rpId is required for WebAuthn authentication")};try{if(!Hk())return{data:null,error:new ho("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:l}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(o){return re(o)?{data:null,error:o}:{data:null,error:new ho("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 Fu("rpId is required for WebAuthn registration")};try{if(!Hk())return{data:null,error:new ho("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(u=>{var d;return(d=u.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===e&&f.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:a};const{data:l,error:c}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:i});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(o){return re(o)?{data:null,error:o}:{data:null,error:new ho("Unexpected error in register",o)}}}}MU();const eV={url:Q5,storageKey:Z5,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Y5,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function Wk(t,e,n){return await n()}const Sa={};class Bu{get jwks(){var e,n;return(n=(e=Sa[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){Sa[this.storageKey]=Object.assign(Object.assign({},Sa[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=Sa[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Sa[this.storageKey]=Object.assign(Object.assign({},Sa[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({},eV),e);if(this.storageKey=i.storageKey,this.instanceID=(n=Bu.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Bu.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&Dt()){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 PU({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=kO(i.fetch),this.lock=i.lock||Wk,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&&Dt()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=jU:this.lock=Wk,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 XU(this)}
326,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:xO()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Vk(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=Vk(this.memoryStorage)),Dt()&&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} (${vO}) ${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(Dt()&&(n=fU(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Dt()&&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),rU(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="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 re(n)?this._returnResult({error:n}):this._returnResult({error:new ho("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,s;try{const i=await ce(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:dr}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(re(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:u,password:d,options:f}=e;let h=null,p=null;this.flowType==="pkce"&&([h,p]=await xa(this.storage,this.storageKey)),i=await ce(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:u,password:d,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:h,code_challenge_method:p},xform:dr})}else if("phone"in e){const{phone:u,password:d,options:f}=e;i=await ce(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:dr})}else throw new cf("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await Lt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(await Lt(this.storage,`${this.storageKey}-code-verifier`),re(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 ce(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:zk})}else if("phone"in e){const{phone:i,password:o,options:a}=e;n=await ce(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:zk})}else throw new cf("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 wa;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(re(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,l,c,u,d,f;let h,p;if("message"in e)h=e.message,p=e.signature;else{const{chain:g,wallet:y,statement:v,options:b}=e;let w;if(Dt())if(typeof y=="object")w=y;else{const N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")w=N.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 y!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=y}const k=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href),S=await w.request({method:"eth_requestAccounts"}).then(N=>N).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=EO(S[0]);let E=(r=b==null?void 0:b.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!E){const N=await w.request({method:"eth_chainId"});E=LU(N)}const T={domain:k.host,address:C,statement:v,uri:k.href,version:"1",chainId:E,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:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=b==null?void 0:b.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.resources};h=$U(T),p=await w.request({method:"personal_sign",params:[DU(h),C]})}try{const{data:g,error:y}=await ce(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:p},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:dr});if(y)throw y;if(!g||!g.session||!g.user){const v=new wa;return this._returnResult({data:{user:null,session:null},error:v})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(re(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var n,r,s,i,o,a,l,c,u,d,f,h;let p,g;if("message"in e)p=e.message,g=e.signature;else{const{chain:y,wallet:v,statement:b,options:w}=e;let k;if(Dt())if(typeof v=="object")k=v;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))k=C.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 v!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=v}const S=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href);
326if("signIn"in k&&k.signIn){const C=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),b?{statement:b}:null));let E;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")E=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)E=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)p=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),g=E.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");p=[`${S.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${S.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}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((d=(u=w==null?void 0:w.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||d===void 0)&&d.length?["Resources",...w.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(`
327`);const C=await k.signMessage(new TextEncoder().encode(p),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=C}}try{const{data:y,error:v}=await ce(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:vo(g)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=e.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:dr});if(v)throw v;if(!y||!y.session||!y.user){const b=new wa;return this._returnResult({data:{user:null,session:null},error:b})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:v})}catch(y){if(re(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async _exchangeCodeForSession(e){const n=await io(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new sU;const{data:i,error:o}=await ce(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:dr});if(await Lt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new wa;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 Lt(this.storage,`${this.storageKey}-code-verifier`),re(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 ce(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:dr}),{data:l,error:c}=a;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const u=new wa;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(n){if(re(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:l}=e;let c=null,u=null;this.flowType==="pkce"&&([c,u]=await xa(this.storage,this.storageKey));const{error:d}=await ce(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in e){const{phone:a,options:l}=e,{data:c,error:u}=await ce(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:u})}throw new cf("You must provide either an email or phone number.")}catch(a){if(await Lt(this.storage,`${this.storageKey}-code-verifier`),re(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 ce(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:dr});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,c=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(s){if(re(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,l=null;this.flowType==="pkce"&&([a,l]=await xa(this.storage,this.storageKey));const c=await ce(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:l}),headers:this.headers,xform:NU});return!((i=c.data)===null||i===void 0)&&i.url&&Dt()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(a){if(await Lt(this.storage,`${this.storageKey}-code-verifier`),re(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 Cn;const{error:s}=await ce(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(re(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 ce(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 ce(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 cf("You must provide either an email or phone number and a type")}catch(n){if(re(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 io(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
327id"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<Ig:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const o=await io(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Lg()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=CU(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 ce(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ii}):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 Cn}:await ce(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:ii})})}catch(n){if(re(n))return jg(n)&&(await this._removeSession(),await Lt(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 Cn;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&e.email!=null&&([a,l]=await xa(this.storage,this.storageKey));const{data:c,error:u}=await ce(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:l}),jwt:o.access_token,xform:ii});if(u)throw u;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await Lt(this.storage,`${this.storageKey}-code-verifier`),re(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 Cn;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=df(e.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){const{data:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});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(re(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 Cn;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(re(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){try{if(!Dt())throw new uf("No browser detected.");
327if(e.error||e.error_description||e.error_code)throw new uf(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 jk("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new uf("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 jk("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:l,token_type:c}=e;if(!i||!a||!o||!c)throw new uf("No session defined in URL");const u=Math.round(Date.now()/1e3),d=parseInt(a);let f=u+d;l&&(f=parseInt(l));const h=f-u;h*1e3<=Oa&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${d}s`);const p=f-d;u-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,f,u):u-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",p,f,u);const{data:g,error:y}=await this._getUser(i);if(y)throw y;const v={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:d,expires_at:f,refresh_token:o,token_type:c,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:v,redirectType:e.type},error:null})}catch(r){if(re(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 io(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&&!jg(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&&!(nU(a)&&(a.status===404||a.status===401||a.status===403)||jg(a)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await Lt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=dU(),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 xa(this.storage,this.storageKey,!0));try{return await ce(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 Lt(this.storage,`${this.storageKey}-code-verifier`),re(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(re(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,l,c,u;const{data:d,error:f}=i;if(f)throw f;const h=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:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await ce(this.fetch,"GET",h,{headers:this.headers,jwt:(u=(c=d.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return Dt()&&!(!((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(re(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;
327if(s)throw s;const{options:o,provider:a,token:l,access_token:c,nonce:u}=e,d=await ce(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:l,access_token:c,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:dr}),{data:f,error:h}=d;return h?this._returnResult({data:{user:null,session:null},error:h}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new wa}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:h}))}catch(s){if(await Lt(this.storage,`${this.storageKey}-code-verifier`),re(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 ce(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(re(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 mU(async s=>(s>
3270&&await pU(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await ce(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:dr})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Mg(i)&&Date.now()+o-r<Oa})}catch(r){if(this._debug(n,"error",r),re(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),Dt()&&!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 io(this.storage,this.storageKey);if(s&&this.userStorage){let o=await io(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Ra(this.userStorage,this.storageKey+"-user",o)),s.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Lg()}else if(s&&!s.user&&!s.user){const o=await io(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await Lt(this.storage,this.storageKey+"-user"),await Ra(this.storage,this.storageKey,s)):s.user=Lg()}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()<Ig;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${Ig}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Mg(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 Cn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new hm;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new Cn;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),re(i)){const o={data:null,error:i};return Mg(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(l){i.push(l)}});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 Lt(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 Ra(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=Fk(s);await Ra(this.storage,this.storageKey,i)}else{const s=Fk(n);await Ra(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Lt(this.storage,this.storageKey),await Lt(this.storage,this.storageKey+"-code-verifier"),await Lt(this.storage,this.storageKey+"-user"),this.userStorage&&await Lt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Dt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
327catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Oa);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)/Oa);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Oa}ms, refresh threshold is ${qv} ticks`),s<=qv&&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 SO)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Dt()||!(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 xa(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 ce(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(re(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;
327if(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:l,error:c}=await ce(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 c?this._returnResult({data:null,error:c}):(e.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(n){if(re(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"?WU(e.webauthn.credential_response):qU(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await ce(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 l?this._returnResult({data:null,error:l}):(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:l}))})}catch(n){if(re(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 ce(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:VU(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:HU(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(re(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:h}=df(e);let p=null;h.aal&&(p=h.aal);let g=p;const{data:{user:y},error:v}=await this.getUser(e);if(v)return this._returnResult({data:null,error:v});((r=(n=y==null?void 0:y.factors)===null||n===void 0?void 0:n.filter(k=>k.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(g="aal2");const w=h.amr||[];return{data:{currentLevel:p,nextLevel:g,currentAuthenticationMethods:w},error:null}}catch(h){if(re(h))return this._returnResult({data:null,error:h});throw h}const{data:{session:o},error:a}
327=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:l}=df(o.access_token);let c=null;l.aal&&(c=l.aal);let u=c;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(h=>h.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(u="aal2");const f=l.amr||[];return{data:{currentLevel:c,nextLevel:u,currentAuthenticationMethods:f},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 ce(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 Cn})})}catch(n){if(re(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 Cn});const o=await ce(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&&Dt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(re(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 Cn});const o=await ce(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&&Dt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(re(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 ce(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 Cn})})}catch(e){if(re(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 ce(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 Cn})})}catch(n){if(re(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+eU>s)return r;const{data:i,error:o}=await ce(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:h,error:p}
327=await this.getSession();if(p||!h.session)return this._returnResult({data:null,error:p});r=h.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=df(r);n!=null&&n.allowExpired||kU(i.exp);const c=!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(!c){const{error:h}=await this.getUser(r);if(h)throw h;return{data:{claims:i,header:s,signature:o},error:null}}const u=SU(s.alg),d=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,o,cU(`${a}.${l}`)))throw new Jv("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(re(r))return this._returnResult({data:null,error:r});throw r}}}Bu.nextInstanceID={};const tV=Bu,nV="2.99.1";let Nc="";typeof Deno<"u"?Nc="deno":typeof document<"u"?Nc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Nc="react-native":Nc="node";const rV={"X-Client-Info":`supabase-js-${Nc}/${nV}`},sV={headers:rV},iV={schema:"public"},oV={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},aV={};function zu(t){"@babel/helpers - typeof";return zu=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},zu(t)}function lV(t,e){if(zu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(zu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cV(t){var e=lV(t,"string");return zu(e)=="symbol"?e:e+""}function uV(t,e,n){return(e=cV(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qk(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 ot(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qk(Object(n),!0).forEach(function(r){uV(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qk(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const dV=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),fV=()=>Headers,hV=(t,e,n)=>{const r=dV(n),s=fV();return async(i,o)=>{var a;const l=(a=await e())!==null&&a!==void 0?a:t;let c=new s(o==null?void 0:o.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),r(i,ot(ot({},o),{},{headers:c}))}};function pV(t){return t.endsWith("/")?t:t+"/"}function mV(t,e){var n,r;const{db:s,auth:i,realtime:o,global:a}=t,{db:l,auth:c,realtime:u,global:d}=e,f={db:ot(ot({},l),s),auth:ot(ot({},c),i),realtime:ot(ot({},u),o),storage:{},global:ot(ot(ot({},d),a),{},{headers:ot(ot({},(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?f.accessToken=t.accessToken:delete f.accessToken,f}function gV(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(pV(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var yV=class extends tV{constructor(t){super(t)}},vV=class{constructor(t,e,n){var r,s;this.supabaseUrl=t,this.supabaseKey=e;const i=gV(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:iV,realtime:aV,auth:ot(ot({},oV),{},{storageKey:o}),global:sV},l=mV(n??{},a);if(this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=l.auth)!==null&&c!==void 0?c:{},this.headers,l.global.fetch)}this.fetch=hV(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(ot({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new n5(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new J5(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new Gz(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();
327return(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:l,throwOnError:c},u,d){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new yV({url:this.authUrl.href,headers:ot(ot({},f),u),storageKey:i,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:c,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new b5(this.realtimeUrl.href,ot(ot({},t),{},{params:ot(ot({},{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 bV=(t,e,n)=>new vV(t,e,n);function wV(){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}wV()&&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 xV(){var y,v;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?((y=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:y[1])??((v=t.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:v[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)$/,l=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),c=l&&a.test(l)?[l]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],u="lovable-preview-auth:result",d=2e3,f=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),h=(b,w,k)=>new Promise(S=>{const C=f();let E=!1,T;const N=R=>{E||(E=!0,clearTimeout(T),window.removeEventListener("message",P),S(R))},P=R=>{if(c.indexOf(R.origin)<0)return;const D=R.data;D&&D.type===u&&D.requestId===C&&N(D)};window.addEventListener("message",P);const q={type:b,requestId:C,projectId:s,key:w};k!==void 0&&(q.value=k);for(const R of c)window.parent.postMessage(q,R);T=setTimeout(()=>N(null),d)});let p=!0;const g=250;return{getItem:async b=>{let w=await h("lovable-preview-auth:get",b);return!w&&p&&(await new Promise(k=>setTimeout(k,g)),w=await h("lovable-preview-auth:get",b)),p=!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),h("lovable-preview-auth:set",b,w).then(()=>{})),removeItem:b=>(localStorage.removeItem(b),h("lovable-preview-auth:remove",b).then(()=>{}))}}const kV="https://amsbifdjlzyfedlrawnq.supabase.co",SV="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFtc2JpZmRqbHp5ZmVkbHJhd25xIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM2MDUwNDAsImV4cCI6MjA4OTE4MTA0MH0.gnVWdrizTt0nWaLvBVdAtbSiJQTDT6qdv9Naein6Rqg",Rt=bV(kV,SV,{auth:{storage:xV(),persistSession:!0,autoRefreshToken:!0}}),_O=x.createContext(void 0),EV=({children:t})=>{const[e,n]=x.useState(null),[r,s]=x.useState(!0);x.useEffect(()=>{const{data:{subscription:o}}=Rt.auth.onAuthStateChange((a,l)=>{n(l),s(!1)});return Rt.auth.getSession().then(({data:{session:a}})=>{n(a),s(!1)}),()=>o.unsubscribe()},[]);const i=async()=>{await Rt.auth.signOut()};return m.jsx(_O.Provider,{value:{session:e,user:(e==null?void 0:e.user)??null,loading:r,signOut:i},children:t})},pm=()=>{const t=x.useContext(_O);if(!t)throw new Error("useAuth must be used within AuthProvider");return t},Qv=({variant:t="dark",className:e})=>{const{i18n:n,t:r}=Mt(),s=(n.resolvedLanguage||n.language||"fr").startsWith("en")?"en":"fr",i=c=>{c!==s&&n.changeLanguage(c)}
327,o="px-2 py-0.5 text-xs font-semibold tracking-wider uppercase transition-colors rounded-sm",a=t==="light"?"bg-primary-foreground text-primary":"bg-foreground text-background",l=t==="light"?"text-primary-foreground/70 hover:text-primary-foreground":"text-foreground/60 hover:text-foreground";return m.jsxs("div",{className:Ee("inline-flex items-center gap-1 rounded-md border px-1 py-1",t==="light"?"border-primary-foreground/40":"border-border",e),role:"group","aria-label":r("language.label"),children:[m.jsx("button",{type:"button",onClick:()=>i("fr"),"aria-pressed":s==="fr",className:Ee(o,s==="fr"?a:l),children:r("language.fr")}),m.jsx("button",{type:"button",onClick:()=>i("en"),"aria-pressed":s==="en",className:Ee(o,s==="en"?a:l),children:r("language.en")})]})},oa=({forceScrolled:t=!1})=>{const{t:e}=Mt(),[n,r]=x.useState(!1),[s,i]=x.useState(!1),o=Ql(),{session:a}=pm(),l=a?"/mon-espace":"/connexion",c=e(a?"nav.myspace":"nav.login"),u=[{label:e("nav.events"),href:"/"},{label:e("nav.gazette"),href:"/blog"},{label:e("nav.institute"),href:"/qui-sommes-nous"}],d=t||n;return x.useEffect(()=>{const f=()=>r(window.scrollY>40);return window.addEventListener("scroll",f,{passive:!0}),f(),()=>window.removeEventListener("scroll",f)},[]),m.jsx(m.Fragment,{children:m.jsx("nav",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-500 ${d?"bg-background/70 backdrop-blur-2xl shadow-sm border-b border-border/30":"bg-transparent"}`,children:m.jsxs("div",{className:`container mx-auto flex items-center justify-between transition-all duration-500 ${d?"py-2 md:py-3":"py-3 md:py-5"}`,children:[m.jsx(Et,{to:"/",className:"flex items-center gap-3",children:m.jsx("img",{src:d?RN:ON,alt:"Logo Institut de Boufflers",className:"h-10 md:h-14 w-auto"})}),m.jsx("div",{className:"hidden md:flex items-center gap-1",children:u.map((f,h)=>m.jsxs("span",{className:"flex items-center",children:[h>0&&m.jsx("span",{className:`text-3xl leading-none mx-1 ${d?"text-foreground/20":"text-primary-foreground/30"}`,children:"·"}),m.jsx(Et,{to:f.href,className:`relative px-3 py-1 text-base font-medium transition-colors after:absolute after:bottom-0 after:left-3 after:right-3 after:h-[2px] after:bg-current after:origin-left after:scale-x-0 hover:after:scale-x-100 after:transition-transform after:duration-300 ${d?"text-foreground hover:text-primary":"text-primary-foreground hover:text-primary-foreground/80"} ${o.pathname===f.href?"after:scale-x-100":""}`,children:f.label})]},f.href))}),m.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[m.jsx(Qv,{variant:d?"dark":"light"}),m.jsx(Le,{asChild:!0,variant:"outline",size:"sm",className:`transition-all duration-500 gap-2 ${d?"border-primary/30 text-primary bg-transparent hover:bg-primary hover:text-primary-foreground":"border-primary-foreground/80 text-primary-foreground bg-transparent hover:bg-primary-foreground/10 hover:text-primary-foreground"}`,children:m.jsxs(Et,{to:l,children:[m.jsx(X1,{className:"w-4 h-4"}),c]})}),m.jsx(Le,{asChild:!0,variant:"outline",size:"sm",className:`transition-all duration-500 ${d?"border-primary/30 text-primary bg-transparent hover:bg-primary hover:text-primary-foreground":"border-primary-foreground/80 text-primary-foreground bg-transparent hover:bg-primary-foreground/10 hover:text-primary-foreground"}`,children:m.jsx(Et,{to:"/devenir-membre",children:e("nav.become")})})]}),m.jsxs(zz,{open:s,onOpenChange:i,children:[m.jsx(Uz,{asChild:!0,children:m.jsx("button",{className:`md:hidden p-2 rounded-md transition-colors ${d?"text-foreground hover:bg-muted":"text-primary-foreground hover:bg-primary-foreground/10"}
327`,"aria-label":e("nav.ariaMenu"),children:m.jsx(nF,{className:"h-6 w-6"})})}),m.jsxs(aO,{side:"right",className:"w-72",children:[m.jsx(lO,{children:m.jsx(cO,{className:"font-heading text-lg",children:e("nav.menu")})}),m.jsxs("div",{className:"flex flex-col gap-2 mt-8",children:[m.jsx("div",{className:"flex justify-center mb-2",children:m.jsx(Qv,{variant:"dark"})}),u.map(f=>m.jsx(Et,{to:f.href,onClick:()=>i(!1),className:`px-4 py-3 rounded-md text-base font-medium transition-colors hover:bg-muted ${o.pathname===f.href?"bg-muted text-primary":"text-foreground"}`,children:f.label},f.href)),m.jsxs("div",{className:"border-t border-border mt-4 pt-4 space-y-2",children:[m.jsx(Le,{asChild:!0,variant:"outline",className:"w-full gap-2",onClick:()=>i(!1),children:m.jsxs(Et,{to:l,children:[m.jsx(X1,{className:"w-4 h-4"}),c]})}),m.jsx(Le,{asChild:!0,className:"w-full",onClick:()=>i(!1),children:m.jsx(Et,{to:"/devenir-membre",children:e("nav.become")})})]})]})]})]})]})})})},mm="/assets/boufflers-portrait-Bj8yFfYz.png",aa="/assets/hero-bg-CNvsaDui.png",CV=()=>{const{t}=Mt(),e=t("hero.title"),[n,r]=e.split(`
328`);return m.jsxs("section",{className:"relative min-h-[50vh] md:min-h-[65vh] flex items-end overflow-hidden bg-primary",children:[m.jsx("img",{src:aa,alt:"",fetchPriority:"high",decoding:"async",className:"absolute inset-0 w-full h-full object-cover pointer-events-none select-none"}),m.jsx("div",{className:"noise-overlay !z-10 !opacity-[0.04]"}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/60 via-trans
328parent to-primary/20 pointer-events-none"}),m.jsx("img",{src:mm,alt:"Portrait du Marquis de Boufflers",fetchPriority:"high",decoding:"async",className:"absolute bottom-0 left-1/2 -translate-x-1/2 h-[85%] w-auto object-contain opacity-25 md:translate-x-0 md:left-auto md:-right-12 xl:right-[10%] md:h-[95%] pointer-events-none select-none"}),m.jsxs("div",{className:"relative z-10 container mx-auto pb-12 md:pb-28 pt-28 md:pt-32 text-center md:text-left",children:[m.jsxs("h1",{className:"font-heading text-primary-foreground text-5xl md:text-7xl lg:text-8xl font-black leading-[0.9] mb-6 opacity-0 animate-fade-in-up [animation-delay:100ms]",children:[n,m.jsx("br",{}),r]}),m.jsx("p",{className:"text-primary-foreground/80 text-lg md:text-xl max-w-md mx-auto md:mx-0 mb-10 opacity-0 animate-fade-in-up [animation-delay:250ms]",children:t("hero.subtitle")}),m.jsx(Le,{asChild:!0,size:"lg",className:"bg-primary-foreground text-primary hover:bg-primary-foreground/90 hover:shadow-xl hover:shadow-primary-foreground/20 opacity-0 animate-fade-in-up [animation-delay:400ms]",children:m.jsx(Et,{to:"/devenir-membre",children:t("hero.cta")})})]})]})},_V=1,TV="7dffdcd5-a59b-49bb-b979-baa086d1d940",AV="f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4",NV="/__l5e/assets-v1/7dffdcd5-a59b-49bb-b979-baa086d1d940/Conference_Program_28_septembre_2026_V5.pdf",OV="a/v1/f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4/7dffdcd5-a59b-49bb-b979-baa086d1d940/Conference_Program_28_septembre_2026_V5.pdf",RV="Conference_Program_28_septembre_2026_V5.pdf",PV=921875,IV="application/pdf",jV="2026-09-07T15:28:23Z",MV={version:_V,asset_id:TV,project_id:AV,url:NV,r2_key:OV,original_filename:RV,size:PV,content_type:IV,created_at:jV},At="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACvCAYAAACLko51AAAAtGVYSWZJSSoACAAAAAYAEgEDAAEAAAABAAAAGgEFAAEAAABWAAAAGwEFAAEAAABeAAAAKAEDAAEAAAACAAAAEwIDAAEAAAABAAAAaYcEAAEAAABmAAAAAAAAAGAAAAABAAAAYAAAAAEAAAAGAACQBwAEAAAAMDIxMAGRBwAEAAAAAQIDAACgBwAEAAAAMDEwMAGgAwABAAAA//8AAAKgBAABAAAArwAAAAOgBAABAAAArwAAAAAAAACedDdzAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEBWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSfvu78nIGlkPSdXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQnPz4KPHg6eG1wbWV0YSB4bWxuczp4PSdhZG9iZTpuczptZXRhLyc+CjxyZGY6UkRGIHhtbG5zOnJkZj0naHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyc+CgogPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9JycKICB4bWxuczpBdHRyaWI9J2h0dHA6Ly9ucy5hdHRyaWJ1dGlvbi5jb20vYWRzLzEuMC8nPgogIDxBdHRyaWI6QWRzPgogICA8cmRmOlNlcT4KICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0nUmVzb3VyY2UnPgogICAgIDxBdHRyaWI6Q3JlYXRlZD4yMDI2LTAzLTE1PC9BdHRyaWI6Q3JlYXRlZD4KICAgICA8QXR0cmliOkRhdGE+eyZxdW90O2RvYyZxdW90OzomcXVvdDtEQUdfRldDX2RGayZxdW90OywmcXVvdDt1c2VyJnF1b3Q7OiZxdW90O1VBRWlxdW45Y25zJnF1b3Q7LCZxdW90O2JyYW5kJnF1b3Q7OiZxdW90O0JBRWlxcll6UUxNJnF1b3Q7fTwvQXR0cmliOkRhdGE+CiAgICAgPEF0dHJpYjpFeHRJZD4wOTUxNjY0Ny1kYzAxLTQ1NmUtOWRiNi1mOTg1MWEzM2M0YzY8L0F0dHJpYjpFeHRJZD4KICAgICA8QXR0cmliOkZiSWQ+NTI1MjY1OTE0MTc5NTgwPC9BdHRyaWI6RmJJZD4KICAgICA8QXR0cmliOlRvdWNoVHlwZT4yPC9BdHRyaWI6VG91Y2hUeXBlPgogICAgPC9yZGY6bGk+CiAgIDwvcmRmOlNlcT4KICA8L0F0dHJpYjpBZHM+CiA8L3JkZjpEZXNjcmlwdGlvbj4KCiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0nJwogIHhtbG5zOmRjPSdodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyc+CiAgPGRjOnRpdGxlPgogICA8cmRmOkFsdD4KICAgIDxyZGY6bGkgeG1sOmxhbmc9J3gtZGVmYXVsdCc+VjIgQ2hhcnRlIGdyYXBoaXF1ZSBJU0IgLSAxPC9yZGY6bGk+CiAgIDwvcmRmOkFsdD4KICA8L2RjOnRpdGxlPgogPC9yZGY6RGVzY3JpcHRpb24+CjwvcmRmOlJERj4KPC94OnhtcG1ldGE+Cjw/eHBhY2tldCBlbmQ9J3InPz6AkFDNAAAKQElEQVR4nO2dS4wcRxnHx3biOCAlvISDvTv16JldewEFZEDmpSAESiCOH5Fy4MaVKweOGRP8wkEoEifEAYkLkhFIgACJSwQYx0JrZ3q6Z2btzXrx2oIIBQEHG+9jpqmvH5t2MPIyVd093+T/k/5qX7a6qvs3Nb3e/qpqNbBlolptBx19b/rIQkNHHU8NA09Fo6Sj5fqNmUbUUeIstfnyE088UO3owEQDeQFbIC9gC+QFbIG8gC2QF7AF8gK2QF7AFsgL2AJ5AVsgL2AL5AVsgbyALZAXsAXyArZAXsAWyAvYAnkBWyAvYAvkBVWwLXKTWLAi5J0/cOBBR33cVu2lBmNJbuY97EreQIkz1CZmXnBPSIyLjcYjtvlDvf5u09w2X4uv2MobGHlXZjyaeV+iPl6Ym3uPbf/mtX70aqPxUMWXG7jgXDpTtj3xlBHmduDJfxpp/mUVasNTt0aWNpcwmYFXXfTLtPP3hUbcXovGjJmcOdnXfKCmn7na1FG3oYc9M2PaxrRjLW6WrhHOSZ88tf7X2aY56tPx2CEvb7KZt6frT/eSr/kBfdXbxpW4m8+/DvpkZty1FXqG1vIUjRkzL3PObc689UN922fUMU/2C6CvZTzzQl7mQF7AFsgL2AJ5AVsgL2AL5AVsgbyALZAXsAXyArZAXsAWyAvYAnkBWyAvYAvkBWy
328BvIAtmbwdXX86fYF83WTDQQbOpEs+UNZ9MvLeuU4FnVqepDFDXuZklRRdTx6hF7WXmt7wWtOLbLJssuioksKIG1Et3LJlnyhLDb3+j30z0RIqKSYDI+92OoZKfcLX4reBJ3/V8eSvR46WvzHHX5h25kMHMy6JG2i51NHi52nbI/fN9+QvzfG8GedXaczZtw4AMSh9B5WARUfA2xos9wTYAnkBWyAvYAvkBWyBvIAtkBewBfICtkBewBbI+zaC3i2gv7G7Sit9V6HC8UysvC3H94qCv/aNEZMsL8hBn+SuUp+ld2lDTzzla/GlUROvbK7qh3whDlY5pkmUN5sdL2vd9D15pG15r/J5VYh35c8x9mQdDefmdnY9tbDU9Ggl8YHlSuSD5RkvCrW6kDtV6RdkEuWlF4LoaO7V8ddnm1HPU2uWq7QP++nq8Zfr9U+l163Sx70tk5fXyNa7kry4TW/7Dy2y8ZppJ/Tk+dypIK8DMnnDhm7dTFZWX7W5V6GnBvFeG7RauxCfTK8bP3kDrfpX0uX0R73JQXIhBiSvueF/zJ0K8jogk9f06Xgq75rNvUoFhryQt3ggbw7IC3khL+QtBcibA/JCXsgLeUsB8uaAvJAX8kLeUoC8OSAv5IW8kLcUIG8OyAt5IS/kLQXImwPyQl7IC3lLAfLmgLyQtzR5o6TWyGUeIIFXpqYe7mi1kL7P60ze9BzbX07O47rv98tOumYdPXXMobwvUptXG42HKhjPjmUhdqXyftO1vEG9/unUsQcL6Lv7yStrlD7Rvla9q65m3ma8EPPvc6cqfea9e48LZSUvSUKyhFqeiK/bhMy8nTflHVxW6uPx2IqaeX0pD7tOW6ln2kI8ay7EDdsZKs2AZnBfy34R/d1qzNfgUXNDvtjW9ZM9S3nNz27QcvyBkj9r1+uff1WIYxWN6Zg59+dMf35M2wt0kqoXm3u1GdP+N9pSPmnaP+rar3mtH62RXEXFdun7t4baK7K/Ww2J62pMXa/68SRjcrPPRj59x/er39BDmsRMuxtdIT5aix+sC4rri5F9LVUdjKmyccWPn/T7QijER2pFdBpBisjm87SWG5AXYRXIi7AN5EXYBvIibAN5EbaBvAjbQF6EbSAvwjaQF2EbyIuwDeRF2AbyImwDeRG2+S956fWywuL4Vbv4tbgi+7vlcUlnL2x3tBpUPp7kXllVu9x7bHLDcT/XqE1fyTuBlI/XqI6qqPQS4VyJG/U9XVhftxoqlYkrIByNabGh4zarHtNiUkXhVF6qzHA5tpWZxpDau970Bn2vfqAWKHHGebQ8TYWF5lPyRs9BGRD9fD8pwLxZSH+3mFCJb5vjCx1V/2nXXtwB1fcFWlw0bR43bZ+taExnQy2fN98m5xcd1BveNUYlfmTa/1Z63Zzdg66Wpy5NT+9xXhOXL8A0snVdFGAGtBtQM5Z3LAowaW85VwWY5t8vZNer7PHkzxu4LsA0j0NGsI9R24UVYNJ6AS5DF6PVam03x3e4Ln33tbxA54iee27H9815XPf9fqHydLpmbS2eXbAtwIxL3z0a03fS+7Cr7PFQLhw8+DCd3zcfIsel71Fb689Q27SGh+t+F1r6jkVHtiIvFh0ZKyAv5IW8kLcUIG8OyAt5IS/kLQXImwPyQl7IC3lLAfLmgLyQF/JC3lKAvDkgL+SFvJC3FCBvDsgLeSEv5C0FyJsD8kJeyAt5SwHy5sjL62sZdpMbtWpTu2TaWV2gC6PV73KngrwOyOQ1/Xn+z1QKpOVtm3sVpHVmVG/mC3EwvW685P2hELsWPX3tb7NNqj0aWNYuDd7Y14xea3h/qqUXopCXke8/tomV90bTO357/2xkjmsu6szMMQrTl9HZyJtBJTPmxnydKgX8pKbtzKiJf17L77a1+FqVY5pEeTdLm5T6gi/F90y/Ttrcq3wuSSnS61b6RAPewiTKC/4HVGvmsm7pnGmv0vFMsLxRq7WdRZ0ZGI1JlhdMOJAXsAXyArZAXsAWyAvYAnkBWyAvYAvkBWyBvKB06C89Lv5ixGGVSPpLWbVXG4wlk7g+LxhTWumreB0h9nVodW4tT1nmNK1iHmjxExcroy/GK6PLV+hd2nRF+ZH7Zto4ESrxUiDlkzRmdq8hgrvJnlF7Whx7PXmveDh2e1I03exJsdL01m/tn6Xj6XjseIbmTf5rPn3OXI3LXCxjpHO3GxCVSLnok5a3l5OtD07QmPELIHMyeQNVP9R3sLHLOCf73wt6cZ/GDHmZA3kBWyAvYAvkBWyBvIAtkBewBfICtkBewBbIC9gCeQFbIC9gC+QFbIG8gC2QF7AF8gK25OXtpdsLxMvNW8a5eA76RCuRryTL8p+iMUNe5kQ5eWlvjNDcZCrfsU3oUNzQQX/iPpmZ9y+JvKikmATerKQQX+54kmanO+n+GFYJtFp3OPNuuOiTya1rqKSYPNq7d7/Tl3tm22rPjE0uicf2X5p+7x7aXsD6Gdp8AK4nG5j84BX1/t2Badumb5f13ib1b37mA++jMWNhZ3AXuUVHDrtZtwG/YIH7QLMQlcHbZr5WS7Z98qaOuloxx1fiRWrz3NzcThd9xIwL7gmWewJsgbyALZAXsAXyArZAXsAWyAvYAnkBWyAvYAvkBWyBvIAtkBewBfICtkBewBbIC9gCeQFbIC9gC+QFbMnL27ctpU9L1WlzQ2oT8oJCyctLpfRmBh1S6fooCczMexMzLyiLfAFmmHz10+Z966PE1/Lf8aZ/SpyhNiEvKJq4uPFio/FIf2rqw72pqQ+Nmu709Aev7N37eCjEY9QmCif/f/4DdCi662pLmHMAAAAASUVORK5CYII=",LV=1,DV="f48e3641-0a32-4364-9567-98183ccfe851",$V="f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4",FV="/__l5e/assets-v1/f48e3641-0a32-4364-9567-98183ccfe851/flyer-isb-4.jpg",BV="a/v1/f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4/f48e3641-0a32-4364-9567-98183ccfe851/flyer-isb-4.jpg",zV="flyer-isb-4.jpg",UV=176614,VV="image/jpeg",HV="2026-08-21T16:57:09Z",WV={version:LV,asset_id:DV,project_id:$V,url:FV,r2_key:BV,original_filename:zV,size:UV,content_type:VV,created_at:HV},qV="/assets/event-causeries-CS4Dnc6J.png";var Sd=t=>t.type==="checkbox",bo=t=>t instanceof Date,sn=t=>t==null;const TO=t=>typeof t=="object";var ft=t=>!sn(t)&&!Array.isArray(t)&&TO(t)&&!bo(t),AO=t=>ft(t)&&t.target?Sd(t.target)?t.target.checked:t.target.value:t,KV=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,NO=(t,e)=>t.has(KV(e)),GV=t=>{const e=t.constructor&&t.constructor.prototype;return ft(e)&&e.hasOwnProperty("isPrototypeOf")},ow=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function kt(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(!(ow&&(t instanceof Blob||r))&&(n||ft(t)))if(e=n?[]:{},!n&&!GV(t))e=t;else for(const s in t)t.hasOwnProperty(s)&&(e[s]=kt(t[s]));else return t;return e}var gm=t=>/^\w*$/.test(t),ut=t=>t===void 0,aw=t=>Array.isArray(t)?t.filter(Boolean):[],lw=t=>aw(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Q=(t,e,n)=>{if(!e||!ft(t))return n;const r=(gm(e)?[e]:lw(e)).reduce((s,i)=>sn(s)?s:s[i],t);return ut(r)||r===t?ut(t[e])?n:t[e]:r},Tn=t=>typeof t=="boolean",je=(t,e,n)=>{let r=-1;const s=gm(e)?[e]:lw(e),i=s.length,o=i-1;for(;++r<i;){const a=s[r];let l=n;if(r!==o){const c=t[a];l=ft(c)||Array.isArray(c)?c:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;t[a]=l,t=t[a]}};const Mh={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},br={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ds={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},cw=M.createContext(null);cw.displayName="HookFormContext";const ym=()=>M.useContext(cw),JV=t=>{const{children:e,...n}=t;return M.createElement(cw.Provider,{value:n},e)};var OO=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const o=i;return e._proxyFormState[o]!==br.all&&(e._proxyFormState[o]=!r||br.all),n&&(n[o]=!0),t[o]}});return s};const uw=typeof window<"u"?M.useLayoutEffect:M.useEffect;function QV(t){const e=ym(),{control:n=e.control,disabled:r,name:s,exact:i}=t||{},[o,a]=M.useState(n._formState),l=M.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return uw(()=>n._subscribe({name:s,formState:l.current,exact:i,callback:c=>{!r&&a({...n._formState,...c})}}),[s,r,i]),M.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),M.useMemo(()=>OO(o,n,l.current,!1),[o,n])}var qr=t=>typeof t=="string",RO=(t,e,n,r,s)=>qr(t)?(r&&e.watch.add(t),Q(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),Q(n,i))):(r&&(e.watchAll=!0),n),Zv=t=>sn(t)||!TO(t);function ks(t,e,n=new WeakSet){if(Zv(t)||Zv(e))return t===e;if(bo(t)&&bo(e))return t.getTime()===e.getTime();const r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;if(n.has(t)||n.has(e))return!0;n.add(t),n.add(e);for(const i of r){const o=t[i];if(!s.includes(i))return!1;if(i!=="ref"){const a=e[i];
328if(bo(o)&&bo(a)||ft(o)&&ft(a)||Array.isArray(o)&&Array.isArray(a)?!ks(o,a,n):o!==a)return!1}}return!0}function ZV(t){const e=ym(),{control:n=e.control,name:r,defaultValue:s,disabled:i,exact:o,compute:a}=t||{},l=M.useRef(s),c=M.useRef(a),u=M.useRef(void 0);c.current=a;const d=M.useMemo(()=>n._getWatch(r,l.current),[n,r]),[f,h]=M.useState(c.current?c.current(d):d);return uw(()=>n._subscribe({name:r,formState:{values:!0},exact:o,callback:p=>{if(!i){const g=RO(r,n._names,p.values||n._formValues,!1,l.current);if(c.current){const y=c.current(g);ks(y,u.current)||(h(y),u.current=y)}else h(g)}}}),[n,i,r,o]),M.useEffect(()=>n._removeUnmounted()),f}function YV(t){const e=ym(),{name:n,disabled:r,control:s=e.control,shouldUnregister:i,defaultValue:o}=t,a=NO(s._names.array,n),l=M.useMemo(()=>Q(s._formValues,n,Q(s._defaultValues,n,o)),[s,n,o]),c=ZV({control:s,name:n,defaultValue:l,exact:!0}),u=QV({control:s,name:n,exact:!0}),d=M.useRef(t),f=M.useRef(s.register(n,{...t.rules,value:c,...Tn(t.disabled)?{disabled:t.disabled}:{}}));d.current=t;const h=M.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Q(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Q(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Q(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Q(u.validatingFields,n)},error:{enumerable:!0,get:()=>Q(u.errors,n)}}),[u,n]),p=M.useCallback(b=>f.current.onChange({target:{value:AO(b),name:n},type:Mh.CHANGE}),[n]),g=M.useCallback(()=>f.current.onBlur({target:{value:Q(s._formValues,n),name:n},type:Mh.BLUR}),[n,s._formValues]),y=M.useCallback(b=>{const w=Q(s._fields,n);w&&b&&(w._f.ref={focus:()=>b.focus&&b.focus(),select:()=>b.select&&b.select(),setCustomValidity:k=>b.setCustomValidity(k),reportValidity:()=>b.reportValidity()})},[s._fields,n]),v=M.useMemo(()=>({name:n,value:c,...Tn(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:p,onBlur:g,ref:y}),[n,r,u.disabled,p,g,y,c]);return M.useEffect(()=>{const b=s._options.shouldUnregister||i;s.register(n,{...d.current.rules,...Tn(d.current.disabled)?{disabled:d.current.disabled}:{}});const w=(k,S)=>{const C=Q(s._fields,k);C&&C._f&&(C._f.mount=S)};if(w(n,!0),b){const k=kt(Q(s._options.defaultValues,n));je(s._defaultValues,n,k),ut(Q(s._formValues,n))&&je(s._formValues,n,k)}return!a&&s.register(n),()=>{(a?b&&!s._state.action:b)?s.unregister(n):w(n,!1)}},[n,s,a,i]),M.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),M.useMemo(()=>({field:v,formState:u,fieldState:h}),[v,u,h])}const XV=t=>t.render(YV(t));var PO=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},Qc=t=>Array.isArray(t)?t:[t],Kk=()=>{let t=[];return{get observers(){return t},next:s=>{for(const i of t)i.next&&i.next(s)},subscribe:s=>(t.push(s),{unsubscribe:()=>{t=t.filter(i=>i!==s)}}),unsubscribe:()=>{t=[]}}},mn=t=>ft(t)&&!Object.keys(t).length,dw=t=>t.type==="file",wr=t=>typeof t=="function",Lh=t=>{if(!ow)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},IO=t=>t.type==="select-multiple",fw=t=>t.type==="radio",e6=t=>fw(t)||Sd(t),$g=t=>Lh(t)&&t.isConnected;function t6(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=ut(t)?r++:t[e[r++]];return t}function n6(t){for(const e in t)if(t.hasOwnProperty(e)&&!ut(t[e]))return!1;return!0}function pt(t,e){const n=Array.isArray(e)?e:gm(e)?[e]:lw(e),r=n.length===1?t:t6(t,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(ft(r)&&mn(r)||Array.isArray(r)&&n6(r))&&pt(t,n.slice(0,-1)),t}var jO=t=>{for(const e in t)if(wr(t[e]))return!0;return!1};function Dh(t,e={}){const n=Array.isArray(t);if(ft(t)||n)for(const r in t)Array.isArray(t[r])||ft(t[r])&&!jO(t[r])?(e[r]=Array.isArray(t[r])?[]:{},Dh(t[r],e[r])):sn(t[r])||(e[r]=!0);return e}function MO(t,e,n){const r=Array.isArray(t);if(ft(t)||r)for(const s in t)Array.isArray(t[s])||ft(t[s])&&!jO(t[s])?ut(e)||Zv(n[s])?n[s]=Array.isArray(t[s])?Dh(t[s],[]):{...Dh(t[s])}:MO(t[s],sn(e)?{}:e[s],n[s]):n[s]=!ks(t[s],e[s]);return n}var yc=(t,e)=>MO(t,e,Dh(e));const Gk={value:!1,isValid:!1},Jk={value:!0,isValid:!0};var LO=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!ut(t[0].attributes.value)?ut(t[0].value)||t[0].value===""?Jk:{value:t[0].value,isValid:!0}:Jk:Gk}return Gk},DO=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>ut(t)?t:e?t===""?NaN:t&&+t:n&&qr(t)?new Date(t):r?r(t):t;const Qk={isValid:!1,value:null};var $O=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,Qk):Qk;function Zk(t){const e=t.ref;return dw(e)?e.files:fw(e)?$O(t.refs).value:IO(e)?[...e.selectedOptions].map(({value:n})=>n):Sd(e)?LO(t.refs).value:DO(ut(e.value)?t.ref.value:e.value,t)}var r6=(t,e,n,r)=>{const s={};for(const i of t){const o=Q(e,i);o&&je(s,i,o._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},$h=t=>t instanceof RegExp,vc=t=>ut(t)?t:$h(t)?t.source:ft(t)?$h(t.value)?t.value.source:t.value:t,Yk=t=>({isOnSubmit:!t||t===br.onSubmit,isOnBlur:t===br.onBlur,isOnChange:t===br.onChange,isOnAll:t===br.all,isOnTouch:t===br.onTouched});const Xk="AsyncFunction";var s6=t=>!!t&&!!t.validate&&!!(wr(t.validate)&&t.validate.constructor.name===Xk||ft(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===Xk)),i6=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),eS=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Zc=(t,e,n,r)=>
vendor: 4,229 bytes, line 328
328{for(const s of n||Object.keys(t)){const i=Q(t,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],s)&&!r)return!0;if(o.ref&&e(o.ref,o.name)&&!r)return!0;if(Zc(a,e))break}else if(ft(a)&&Zc(a,e))break}}};function tS(t,e,n){const r=Q(t,n);if(r||gm(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=Q(e,i),a=Q(t,i);if(o&&!Array.isArray(o)&&n!==i)return{name:n};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:n}}var o6=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return mn(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(o=>e[o]===(!r||br.all))},a6=(t,e,n)=>!t||!e||t===e||Qc(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),l6=(t,e,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(e||t):(n?r.isOnBlur:s.isOnBlur)?!t:(n?r.isOnChange:s.isOnChange)?t:!0,c6=(t,e)=>!aw(Q(t,e)).length&&pt(t,e),u6=(t,e,n)=>{const r=Qc(Q(t,n));return je(r,"root",e[n]),je(t,n,r),t},zf=t=>qr(t);function nS(t,e,n="validate"){if(zf(t)||Array.isArray(t)&&t.every(zf)||Tn(t)&&!t)return{type:n,message:zf(t)?t:"",ref:e}}var Ea=t=>ft(t)&&!$h(t)?t:{value:t,message:""},rS=async(t,e,n,r,s,i)=>{const{ref:o,refs:a,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:h,validate:p,name:g,valueAsNumber:y,mount:v}=t._f,b=Q(n,g);if(!v||e.has(g))return{};const w=a?a[0]:o,k=R=>{s&&w.reportValidity&&(w.setCustomValidity(Tn(R)?"":R||""),w.reportValidity())},S={},C=fw(o),E=Sd(o),T=C||E,N=(y||dw(o))&&ut(o.value)&&ut(b)||Lh(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length,P=PO.bind(null,g,r,S),q=(R,D,I,H=ds.maxLength,U=ds.minLength)=>{const Z=R?D:I;S[g]={type:R?H:U,message:Z,ref:o,...P(R?H:U,Z)}};if(i?!Array.isArray(b)||!b.length:l&&(!T&&(N||sn(b))||Tn(b)&&!b||E&&!LO(a).isValid||C&&!$O(a).isValid)){const{value:R,message:D}=zf(l)?{value:!!l,message:l}:Ea(l);if(R&&(S[g]={type:ds.required,message:D,ref:w,...P(ds.required,D)},!r))return k(D),S}if(!N&&(!sn(d)||!sn(f))){let R,D;const I=Ea(f),H=Ea(d);if(!sn(b)&&!isNaN(b)){const U=o.valueAsNumber||b&&+b;sn(I.value)||(R=U>I.value),sn(H.value)||(D=U<H.value)}else{const U=o.valueAsDate||new Date(b),Z=J=>new Date(new Date().toDateString()+" "+J),j=o.type=="time",$=o.type=="week";qr(I.value)&&b&&(R=j?Z(b)>Z(I.value):$?b>I.value:U>new Date(I.value)),qr(H.value)&&b&&(D=j?Z(b)<Z(H.value):$?b<H.value:U<new Date(H.value))}if((R||D)&&(q(!!R,I.message,H.message,ds.max,ds.min),!r))return k(S[g].message),S}if((c||u)&&!N&&(qr(b)||i&&Array.isArray(b))){const R=Ea(c),D=Ea(u),I=!sn(R.value)&&b.length>+R.value,H=!sn(D.value)&&b.length<+D.value;if((I||H)&&(q(I,R.message,D.message),!r))return k(S[g].message),S}if(h&&!N&&qr(b)){const{value:R,message:D}=Ea(h);if($h(R)&&!b.match(R)&&(S[g]={type:ds.pattern,message:D,ref:o,...P(ds.pattern,D)},!r))return k(D),S}if(p){if(wr(p)){const R=await p(b,n),D=nS(R,w);if(D&&(S[g]={...D,...P(ds.validate,D.message)},!r))return k(D.message),S}else if(ft(p)){let R={};for(const D in p){if(!mn(R)&&!r)break;const I=nS(await p[D](b,n),w,D);I&&(R={...I,...P(D,I.message)},k(I.message),r&&(S[g]=R))}if(!mn(R)&&(S[g]={ref:w,...R},!r))return S}}return k(!0),S};const d6={mode:br.onSubmit,reValidateMode:br.onChange,shouldFocusError:!0};function f6(t={}){let e={...d6,...t},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:wr(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},s=ft(e.defaultValues)||ft(e.values)?kt(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:kt(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const f={array:Kk(),state:Kk()},h=e.criteriaMode===br.all,p=_=>O=>{clearTimeout(c),c=setTimeout(_,O)},g=async _=>{if(!e.disabled&&(u.isValid||d.isValid||_)){const O=e.resolver?mn((await E()).errors):await N(r,!0);O!==n.isValid&&f.state.next({isValid:O})}},y=(_,O)=>{!e.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((_||Array.from(a.mount)).forEac
vendor: 12,054 bytes, line 328
328h(L=>{L&&(O?je(n.validatingFields,L,O):pt(n.validatingFields,L))}),f.state.next({validatingFields:n.validatingFields,isValidating:!mn(n.validatingFields)}))},v=(_,O=[],L,G,K=!0,W=!0)=>{if(G&&L&&!e.disabled){if(o.action=!0,W&&Array.isArray(Q(r,_))){const ee=L(Q(r,_),G.argA,G.argB);K&&je(r,_,ee)}if(W&&Array.isArray(Q(n.errors,_))){const ee=L(Q(n.errors,_),G.argA,G.argB);K&&je(n.errors,_,ee),c6(n.errors,_)}if((u.touchedFields||d.touchedFields)&&W&&Array.isArray(Q(n.touchedFields,_))){const ee=L(Q(n.touchedFields,_),G.argA,G.argB);K&&je(n.touchedFields,_,ee)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=yc(s,i)),f.state.next({name:_,isDirty:q(_,O),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else je(i,_,O)},b=(_,O)=>{je(n.errors,_,O),f.state.next({errors:n.errors})},w=_=>{n.errors=_,f.state.next({errors:n.errors,isValid:!1})},k=(_,O,L,G)=>{const K=Q(r,_);if(K){const W=Q(i,_,ut(L)?Q(s,_):L);ut(W)||G&&G.defaultChecked||O?je(i,_,O?W:Zk(K._f)):I(_,W),o.mount&&g()}},S=(_,O,L,G,K)=>{let W=!1,ee=!1;const _e={name:_};if(!e.disabled){if(!L||G){(u.isDirty||d.isDirty)&&(ee=n.isDirty,n.isDirty=_e.isDirty=q(),W=ee!==_e.isDirty);const Fe=ks(Q(s,_),O);ee=!!Q(n.dirtyFields,_),Fe?pt(n.dirtyFields,_):je(n.dirtyFields,_,!0),_e.dirtyFields=n.dirtyFields,W=W||(u.dirtyFields||d.dirtyFields)&&ee!==!Fe}if(L){const Fe=Q(n.touchedFields,_);Fe||(je(n.touchedFields,_,L),_e.touchedFields=n.touchedFields,W=W||(u.touchedFields||d.touchedFields)&&Fe!==L)}W&&K&&f.state.next(_e)}return W?_e:{}},C=(_,O,L,G)=>{const K=Q(n.errors,_),W=(u.isValid||d.isValid)&&Tn(O)&&n.isValid!==O;if(e.delayError&&L?(l=p(()=>b(_,L)),l(e.delayError)):(clearTimeout(c),l=null,L?je(n.errors,_,L):pt(n.errors,_)),(L?!ks(K,L):K)||!mn(G)||W){const ee={...G,...W&&Tn(O)?{isValid:O}:{},errors:n.errors,name:_};n={...n,...ee},f.state.next(ee)}},E=async _=>{y(_,!0);const O=await e.resolver(i,e.context,r6(_||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return y(_),O},T=async _=>{const{errors:O}=await E(_);if(_)for(const L of _){const G=Q(O,L);G?je(n.errors,L,G):pt(n.errors,L)}else n.errors=O;return O},N=async(_,O,L={valid:!0})=>{for(const G in _){const K=_[G];if(K){const{_f:W,...ee}=K;if(W){const _e=a.array.has(W.name),Fe=K._f&&s6(K._f);Fe&&u.validatingFields&&y([G],!0);const hn=await rS(K,a.disabled,i,h,e.shouldUseNativeValidation&&!O,_e);if(Fe&&u.validatingFields&&y([G]),hn[W.name]&&(L.valid=!1,O))break;!O&&(Q(hn,W.name)?_e?u6(n.errors,hn,W.name):je(n.errors,W.name,hn[W.name]):pt(n.errors,W.name))}!mn(ee)&&await N(ee,O,L)}}return L.valid},P=()=>{for(const _ of a.unMount){const O=Q(r,_);O&&(O._f.refs?O._f.refs.every(L=>!$g(L)):!$g(O._f.ref))&&Ne(_)}a.unMount=new Set},q=(_,O)=>!e.disabled&&(_&&O&&je(i,_,O),!ks(J(),s)),R=(_,O,L)=>RO(_,a,{...o.mount?i:ut(O)?s:qr(_)?{[_]:O}:O},L,O),D=_=>aw(Q(o.mount?i:s,_,e.shouldUnregister?Q(s,_,[]):[])),I=(_,O,L={})=>{const G=Q(r,_);let K=O;if(G){const W=G._f;W&&(!W.disabled&&je(i,_,DO(O,W)),K=Lh(W.ref)&&sn(O)?"":O,IO(W.ref)?[...W.ref.options].forEach(ee=>ee.selected=K.includes(ee.value)):W.refs?Sd(W.ref)?W.refs.forEach(ee=>{(!ee.defaultChecked||!ee.disabled)&&(Array.isArray(K)?ee.checked=!!K.find(_e=>_e===ee.value):ee.checked=K===ee.value||!!K)}):W.refs.forEach(ee=>ee.checked=ee.value===K):dw(W.ref)?W.ref.value="":(W.ref.value=K,W.ref.type||f.state.next({name:_,values:kt(i)})))}(L.shouldDirty||L.shouldTouch)&&S(_,K,L.shouldTouch,L.shouldDirty,!0),L.shouldValidate&&$(_)},H=(_,O,L)=>{for(const G in O){if(!O.hasOwnProperty(G))return;const K=O[G],W=_+"."+G,ee=Q(r,W);(a.array.has(_)||ft(K)||ee&&!ee._f)&&!bo(K)?H(W,K,L):I(W,K,L)}},U=(_,O,L={})=>{const G=Q(r,_),K=a.array.has(_),W=kt(O);je(i,_,W),K?(f.array.next({name:_,values:kt(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&L.shouldDirty&&f.state.next({name:_,dirtyFields:yc(s,i),isDirty:q(_,W)})):G&&!G._f&&!sn(W)?H(_,W,L):I(_,W,L),eS(_,a)&&f.state.next({...n,name:_}),f.state.next({name:o.mount?_:void 0,values:kt(i)})},Z=async _=>{o.mount=!0;const O=_.target;let L=O.name,G=!0;const K=Q(r,L),W=Fe=>{G=Number.isNaN(Fe)||bo(Fe)&&isNaN(Fe.getTime())||ks(Fe,Q(i,L,Fe))},ee=Yk(e.mode),_e=Yk(e.reValidateMode);if(K){let Fe,hn;const is=O.type?Zk(K._f):AO(_),Pr=_.type===Mh.BLUR||_.type===Mh.FOCUS_OUT,Ad=!i6(K._f)&&!e.resolver&&!Q(n.errors,L)&&!K._f.deps||l6(Pr,Q(n.touchedFields,L),n.isSubmitted,_e,ee),no=eS(L,a,Pr);je(i,L,is),Pr?(K._f.onBlur&&K._f.onBlur(_),l&&l(0)):K._f.onChange&&K._f.onChange(_);const Ir=S(L,is,Pr),Nd=!mn(Ir)||no;if(!Pr&&f.state.next({name:L,type:_.type,values:kt(i)}),Ad)return(u.isValid||d.isValid)&&(e.mode==="onBlur"?Pr&&g():Pr||g()),Nd&&f.state.next({name:L,...no?{}:Ir});if(!Pr&&no&&f.state.next({...n}),e.resolver){const{errors:as}=await E([L]);if(W(is),G){const Lm=tS(n.errors,r,L),Od=tS(as,r,Lm.name||L);Fe=Od.error,L=Od.name,hn=mn(as)}}else y([L],!0),Fe=(await rS(K,a.disabled,i,h,e.shouldUseNativeValidation))[L],y([L]),W(is),G&&(Fe?hn=!1:(u.isValid||d.isValid)&&(hn=await N(r,!0)));G&&(K._f.deps&&$(K._f.deps),C(L,hn,Fe,Ir))}},j=(_,O)=>{if(Q(n.errors,O)&&_.focus)return _.focus(),1},$=async(_,O={})=>{let L,G;const K=Qc(_);if(e.resolver){const W=await T(ut(_)?_:K);L=mn(W),G=_?!K.some(ee=>Q(W,ee)):L}else _?(G=(await Promise.all(K.map(async W=>{const ee=Q(r,W);return await N(ee&&ee._f?{[W]:ee}:ee)}))).every(Boolean),!(!G&&!n.isValid)&&g()):G=L=await N(r);return f.state.next({...!qr(_)||(u.isValid||d.isValid)&&L!==n.isValid?{}:{name:_},...e.resolver||!_?{isValid:L}:{},errors:n.errors}),O.shouldFocus&&!G&&Zc(r,j,_?K:a.mount),G},J=_=>{const O={...o.mount?i:s};return ut(_)?O:qr(_)?Q(O,_):_.map(L=>Q(O,L))},ae=(_,O)=>({invalid:!!Q((O||n).errors,_),isDirty:!!Q((O||n).dirtyFields,_),error:Q((O||n).errors,_),isValidating:!!Q(n.validatingFields,_),isTouched:!!Q((O||n).touchedFields,_)}),se=_=>{_&&Qc(_).forEach(O=>pt(n.errors,O)),f.state.next({errors:_?n.errors:{}})},pe=(_,O,L)=>{const G=(Q(r,_,{_f:{}})._f||{}).ref,K=Q(n.errors,_)||{},{ref:W,message:ee,type:_e,...Fe}=K;je(n.errors,_,{...Fe,...O,ref:G}),f.state.next({name:_,errors:n.errors,isValid:!1}),L&&L.shouldFocus&&G&&G.focus&&G.focus()},be=(_,O)=>wr(_)?f.state.subscribe({next:L=>"values"in L&&_(R(void 0,O),L)}):R(_,O,!0),Ue=_=>f.state.subscribe({next:O=>{a6(_.name,O.name,_.exact)&&o6(O,_.formState||u,sc,_.reRenderRoot)&&_.callback({values:{...i},...n,...O,defaultValues:s})}}).unsubscribe,Tt=_=>(o.mount=!0,d={...d,..._.formState},Ue({..._,formState:d})),Ne=(_,O={})=>{for(const L of _?Qc(_):a.mount)a.mount.delete(L),a.array.delete(L),O.keepValue||(pt(r,L),pt(i,L)),!O.keepError&&pt(n.errors,L),!O.keepDirty&&pt(n.dirtyFields,L),!O.keepTouched&&pt(n.touchedFields,L),!O.keepIsValidating&&pt(n.validatingFields,L),!e.shouldUnregister&&!O.keepDefaultValue&&pt(s,L);f.state.next({values:kt(i)}),f.state.next({...n,...O.keepDirty?{isDirty:q()}:{}}),!O.keepIsValid&&g()},ns=({disabled:_,name:O})=>{(Tn(_)&&o.mount||_||a.disabled.has(O))&&(_?a.disabled.add(O):a.disabled.delete(O))},Fn=(_,O={})=>{let L=Q(r,_);const G=Tn(O.disabled)||Tn(e.disabled);return je(r,_,{...L||{},_f:{...L&&L._f?L._f:{ref:{name:_}},name:_,mount:!0,...O}}),a.mount.add(_),L?ns({disabled:Tn(O.disabled)?O.disabled:e.disabled,name:_}):k(_,!0,O.value),{...G?{disabled:O.disabled||e.disabled}:{},...e.progressive?{required:!!O.required,min:vc(O.min),max:vc(O.max),minLength:vc(O.minLength),maxLength:vc(O.maxLength),pattern:vc(O.pattern)}:{},name:_,onChange:Z,onBlur:Z,ref:K=>{if(K){Fn(_,O),L=Q(r,_);const W=ut(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,ee=e6(W),_e=L._f.refs||[];if(ee?_e.find(Fe=>Fe===W):W===L._f.ref)return;je(r,_,{_f:{...L._f,...ee?{refs:[..._e.filter($g),W,...Array.isArray(Q(s,_))?[{}]:[]],ref:{type:W.type,name:_}}:{ref:W}}}),k(_,!1,void 0,W)}else L=Q(r,_,{}),L._f&&(L._f.mount=!1),(e.shouldUnregister||O.shouldUnregister)&&!(NO(a.array,_)&&o.action)&&a.unMount.add(_)}}},sr=()=>e.shouldFocusError&&Zc(r,j,a.mount),Or=_=>{Tn(_)&&(f.state.next({disabled:_}),Zc(r,(O,L)=>{const G=Q(r,L);G&&(O.disabled=G._f.disabled||_,Array.isArray(G._f.refs)&&G._f.refs.forEach(K=>{K.disabled=G._f.disabled||_}))},0,!1))},rs=(_,O)=>async L=>{let G;L&&(L.preventDefault&&L.preventDefault(),L.persist&&L.persist());let K=kt(i);if(f.state.next({isSubmitting:!0}),e.resolver){const{errors:W,values:ee}=await E();n.errors=W,K=kt(ee)}else await N(r);if(a.disabled.size)for(const W of a.disabled)pt(K,W);if(pt(n.errors,"root"),mn(n.errors)){f.state.next({errors:{}});try{await _(K,L)}catch(W){G=W}}else O&&await O({...n.errors},L),sr(),setTimeout(sr);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:mn(n.errors)&&!G,submitCount:n.submitCount+1,errors:n.errors}),G)throw G},Rr=(_,O={})=>{Q(r,_)&&(ut(O.defaultValue)?U(_,kt(Q(s,_))):(U(_,O.defaultValue),je(s,_,kt(O.defaultValue))),O.keepTouched||pt(n.touchedFields,_),O.keepDirty||(pt(n.dirtyFields,_),n.isDirty=O.defaultValue?q(_,kt(Q(s,_))):q()),O.keepError||(pt(n.errors,_),u.isValid&&g()),f.state.next({...n}))},to=(_,O={})=>{const L=_?kt(_):s,G=kt(L),K=mn(_),W=K?s:G;if(O.keepDefaultValues||(s=L),!O.keepValues){if(O.keepDirtyValues){const ee=new Set([...a.mount,...Object.keys(yc(s,i))]);for(const _e of Array.from(ee))Q(n.dirtyFields,_e)?je(W,_e,Q(i,_e)):U(_e,Q(W,_e))}else{if(ow&&ut(_))for(const ee of a.mount){const _e=Q(r,ee);if(_e&&_e._f){const Fe=Array.isArray(_e._f.refs)?_e._f.refs[0]:_e._f.ref;if(Lh(Fe)){const hn=Fe.closest("form");if(hn){hn.reset();break}}}}if(O.keepFieldsRef)for(const ee of a.mount)U(ee,Q(W,ee));else r={}}i=e.shouldUnregister?O.keepDefaultValues?kt(s):{}:kt(W),f.array.next({values:{...W}}),f.state.next({values:{...W}})}a={mount:O.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!O.keepIsValid||!!O.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:K?!1:O.keepDirty?n.isDirty:!!(O.keepDefaultValues&&!ks(_,s)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:K?{}:O.keepDirtyValues?O.keepDefaultValues&&i?yc(s,i):n.dirtyFields:O.keepDefaultValues&&_?yc(s,_):O.keepDirty?n.dirtyFields:{},touchedFields:O.keepTouched?n.touchedFields:{},errors:O.keepErrors?n.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},fa=(_,O)=>to(wr(_)?_(i):_,O),ha=(_,O={})=>{const L=Q(r,_),G=L&&L._f;if(G){const K=G.refs?G.refs[0]:G.ref;K.focus&&(K.focus(),O.shouldSelect&&wr(K.select)&&K.select())}},sc=_=>{n={...n,..._}},ss={control:{register:Fn,unregister:Ne,getFieldState:ae,handleSubmit:rs,setError:pe,_subscribe:Ue,_runSchema:E,_focusError:sr,_getWatch:R,_getDirty:q,_setValid:g,_setFieldArray:v,_setDisabledField:ns,_setErrors:w,_getFieldArray:D,_reset:to,_resetDefaultValues:()=>wr(e.defaultValues)&&e.defaultValues().then(_=>{fa(_,e.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:Or,_subjects:f,_proxyFormState:u,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(_){o=_},get _defaultValues(){return s},get _names(){return a},set _names(_){a=_},get _formState(){return n},get _options(){return e},set _options(_){e={...e,..._}}},subscribe:Tt,trigger:$,register:Fn,handleSubmit:rs,watch:be,setValue:U,getValues:J,reset:fa,resetField:Rr,clearErrors:se,unregister:Ne,setError:pe,setFocus:ha,getFieldState:ae};return{...ss,formControl:ss}}function h6(t={}){const e=M.useRef(void 0),n=M.useRef(void 0),[r,s]=M.useState({isDirty:!1,isValidating:!1,isLoading:wr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:wr(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:r},t.defaultValues&&!wr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:o,...a}=f6(t);e.current={...a,formState:r}}const i=e.current.control;return i._options=t,uw(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}
vendor: 4,304 bytes, line 328
328),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,o},[i]),M.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),M.useEffect(()=>{t.mode&&(i._options.mode=t.mode),t.reValidateMode&&(i._options.reValidateMode=t.reValidateMode)},[i,t.mode,t.reValidateMode]),M.useEffect(()=>{t.errors&&(i._setErrors(t.errors),i._focusError())},[i,t.errors]),M.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,t.shouldUnregister]),M.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),M.useEffect(()=>{t.values&&!ks(t.values,n.current)?(i._reset(t.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=t.values,s(o=>({...o}))):i._resetDefaultValues()},[i,t.values]),M.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),e.current.formState=OO(r,i),e.current}const sS=(t,e,n)=>{if(t&&"reportValidity"in t){const r=Q(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},FO=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?sS(r.ref,n,t):r.refs&&r.refs.forEach(s=>sS(s,n,t))}},p6=(t,e)=>{e.shouldUseNativeValidation&&FO(t,e);const n={};for(const r in t){const s=Q(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(m6(e.names||Object.keys(t),r)){const o=Object.assign({},Q(n,r));je(o,"root",i),je(n,r,o)}else je(n,r,i)}return n},m6=(t,e)=>t.some(n=>n.startsWith(e+"."));var g6=function(t,e){for(var n={};t.length;){var r=t[0],s=r.code,i=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[o]={message:a.message,type:a.code}}else n[o]={message:i,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return t.push(d)})}),e){var l=n[o].types,c=l&&l[r.code];n[o]=PO(o,e,n,s,c?[].concat(c,r.message):r.message)}t.shift()}return n},y6=function(t,e,n){return n===void 0&&(n={}),function(r,s,i){try{return Promise.resolve(function(o,a){try{var l=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(c){return i.shouldUseNativeValidation&&FO({},i),{errors:{},values:n.raw?r:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:p6(g6(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},Pe;(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})(Pe||(Pe={}));var iS;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(iS||(iS={}));const ie=Pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xs=t=>{switch(typeof t){case"undefined":return ie.undefined;case"string":return ie.string;case"number":return Number.isNaN(t)?ie.nan:ie.number;case"boolean":return ie.boolean;case"function":return ie.function;case"bigint":return ie.bigint;case"symbol":return ie.symbol;case"object":return Array.isArray(t)?ie.array:t===null?ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ie.promise:typeof Map<"u"&&t instanceof Map?ie.map:typeof Set<"u"&&t instanceof Set?ie.set:typeof Date<"u"&&t instanceof Date?ie.date:ie.object;default:return ie.unknown}}
vendor: 4,686 bytes, line 328
328,V=Pe.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 Ms 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,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return s(this),r}static assert(e){if(!(e instanceof Ms))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pe.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()}}Ms.create=t=>new Ms(t);const Yv=(t,e)=>{let n;switch(t.code){case V.invalid_type:t.received===ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case V.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Pe.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:n=`Unrecognized key(s) in object: ${Pe.joinValues(t.keys,", ")}`;break;case V.invalid_union:n="Invalid input";break;case V.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Pe.joinValues(t.options)}`;break;case V.invalid_enum_value:n=`Invalid enum value. Expected ${Pe.joinValues(t.options)}, received '${t.received}'`;break;case V.invalid_arguments:n="Invalid function arguments";break;case V.invalid_return_type:n="Invalid function return type";break;case V.invalid_date:n="Invalid date";break;case V.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}"`:Pe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case V.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 V.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 V.custom:n="Invalid input";break;case V.invalid_intersection_types:n="Intersection results could not be merged";break;case V.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case V.not_finite:n="Number must be finite";break;default:n=e.defaultError,Pe.assertNever(t)}return{message:n}};let v6=Yv;function b6(){return v6}const w6=t=>
vendor: 29,148 bytes, line 328
328{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 l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};function Y(t,e){const n=b6(),r=w6({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Yv?void 0:Yv].filter(s=>!!s)});t.common.issues.push(r)}class Mn{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 ge;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 Mn.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 ge;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 ge=Object.freeze({status:"aborted"}),Oc=t=>({status:"dirty",value:t}),rr=t=>({status:"valid",value:t}),oS=t=>t.status==="aborted",aS=t=>t.status==="dirty",jl=t=>t.status==="valid",Fh=t=>typeof Promise<"u"&&t instanceof Promise;var oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(oe||(oe={}));class Hi{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 lS=(t,e)=>{if(jl(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 Ms(t.common.issues);return this._error=n,this._error}}};function Se(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:l}=t;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:s}}class Re{get description(){return this._def.description}_getType(e){return Xs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Xs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Mn,ctx:{common:e.parent.common,data:e.data,parsedType:Xs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Fh(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:Xs(e)},s=this._parseSync({data:e,path:r.path,parent:r});return lS(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:Xs(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return jl(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=>jl(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:Xs(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Fh(s)?s:Promise.resolve(s));return lS(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:V.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!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))}_refinement(e){return new Ll({schema:this,typeName:ye.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 Ii.create(this,this._def)}nullable(){return Dl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return Vh.create(this,this._def)}or(e){return zh.create([this,e],this._def)}and(e){return Uh.create(this,e,this._def)}transform(e){return new Ll({...Se(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new e0({...Se(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new V6({typeName:ye.ZodBranded,type:this,...Se(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new t0({...Se(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return hw.create(this,e)}readonly(){return n0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const x6=/^c[^\s-]{8,}$/i,k6=/^[0-9a-z]+$/,S6=/^[0-9A-HJKMNP-TV-Z]{26}$/i,E6=/^[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,C6=/^[a-z0-9_-]{21}$/i,_6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,T6=/^[-+]?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)?)??$/,A6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,N6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fg;const O6=/^(?:(?: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])$/,R6=/^(?:(?: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])$/,P6=/^(([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]))$/,I6=/^(([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])$/,j6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,M6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,BO="((\\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])))",L6=new RegExp(`^${BO}$`);function zO(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 D6(t){return new RegExp(`^${zO(t)}$`)}function $6(t){let e=`${BO}T${zO(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 F6(t,e){return!!((e==="v4"||!e)&&O6.test(t)||(e==="v6"||!e)&&P6.test(t))}function B6(t,e){if(!_6.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 z6(t,e){return!!((e==="v4"||!e)&&R6.test(t)||(e==="v6"||!e)&&I6.test(t))}class bi extends Re{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ie.string){const i=this._getOrReturnCtx(e);return Y(i,{code:V.invalid_type,expected:ie.string,received:i.parsedType}),ge}const r=new Mn;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Y(s,{code:V.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),Y(s,{code:V.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?Y(s,{code:V.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&Y(s,{code:V.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")A6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"email",code:V.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Fg||(Fg=new RegExp(N6,"u")),Fg.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"emoji",code:V.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")E6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"uuid",code:V.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")C6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"nanoid",code:V.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")x6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"cuid",code:V.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")k6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"cuid2",code:V.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")S6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"ulid",code:V.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Y(s,{validation:"url",code:V.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),Y(s,{validation:"regex",code:V.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),Y(s,{code:V.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),Y(s,{code:V.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Y(s,{code:V.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?$6(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{code:V.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?L6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{code:V.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?D6(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{code:V.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?T6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"duration",code:V.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?F6(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"ip",code:V.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?B6(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"jwt",code:V.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?z6(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"cidr",code:V.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?j6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"base64",code:V.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?M6.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"base64url",code:V.invalid_string,message:i.message}),r.dirty()):Pe.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:V.invalid_string,...oe.errToObj(r)})}_addCheck(e){return new bi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...oe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...oe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...oe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...oe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...oe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...oe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...oe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...oe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...oe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...oe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...oe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...oe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...oe.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,...oe.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,...oe.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...oe.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...oe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...oe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...oe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...oe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...oe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...oe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...oe.errToObj(n)})}nonempty(e){return this.min(1,oe.errToObj(e))}trim(){return new bi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new bi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new bi({...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}}bi.create=t=>new bi({checks:[],typeName:ye.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Se(t)});function U6(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 Uu extends Re{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)!==ie.number){const i=this._getOrReturnCtx(e);return Y(i,{code:V.invalid_type,expected:ie.number,received:i.parsedType}),ge}let r;const s=new Mn;for(const i of this._def.checks)i.kind==="int"?Pe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{code:V.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),Y(r,{code:V.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),Y(r,{code:V.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?U6(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Y(r,{code:V.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Y(r,{code:V.not_finite,message:i.message}),s.dirty()):Pe.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,oe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,oe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,oe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,oe.toString(n))}setLimit(e,n,r,s){return new Uu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:oe.toString(s)}]})}_addCheck(e){return new Uu({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:oe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:oe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:oe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:oe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:oe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:oe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:oe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:oe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:oe.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"&&Pe.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)}}Uu.create=t=>new Uu({checks:[],typeName:ye.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Vu extends Re{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)!==ie.bigint)return this._getInvalidInput(e);let r;const s=new Mn;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),Y(r,{code:V.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),Y(r,{code:V.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),Y(r,{code:V.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Pe.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Y(n,{code:V.invalid_type,expected:ie.bigint,received:n.parsedType}),ge}gte(e,n){return this.setLimit("min",e,!0,oe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,oe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,oe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,oe.toString(n))}setLimit(e,n,r,s){return new Vu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:oe.toString(s)}]})}_addCheck(e){return new Vu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:oe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:oe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:oe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:oe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:oe.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}}Vu.create=t=>new Vu({checks:[],typeName:ye.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Se(t)});class cS extends Re{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ie.boolean){const r=this._getOrReturnCtx(e);return Y(r,{code:V.invalid_type,expected:ie.boolean,received:r.parsedType}),ge}return rr(e.data)}}cS.create=t=>new cS({typeName:ye.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Se(t)});class Bh extends Re{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ie.date){const i=this._getOrReturnCtx(e);return Y(i,{code:V.invalid_type,expected:ie.date,received:i.parsedType}),ge}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Y(i,{code:V.invalid_date}),ge}const r=new Mn;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Y(s,{code:V.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),Y(s,{code:V.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Pe.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Bh({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:oe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:oe.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}}Bh.create=t=>new Bh({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ye.ZodDate,...Se(t)});class uS extends Re{_parse(e){if(this._getType(e)!==ie.symbol){const r=this._getOrReturnCtx(e);return Y(r,{code:V.invalid_type,expected:ie.symbol,received:r.parsedType}),ge}return rr(e.data)}}uS.create=t=>new uS({typeName:ye.ZodSymbol,...Se(t)});class dS extends Re{_parse(e){if(this._getType(e)!==ie.undefined){const r=this._getOrReturnCtx(e);return Y(r,{code:V.invalid_type,expected:ie.undefined,received:r.parsedType}),ge}return rr(e.data)}}dS.create=t=>new dS({typeName:ye.ZodUndefined,...Se(t)});class fS extends Re{_parse(e){if(this._getType(e)!==ie.null){const r=this._getOrReturnCtx(e);return Y(r,{code:V.invalid_type,expected:ie.null,received:r.parsedType}),ge}return rr(e.data)}}fS.create=t=>new fS({typeName:ye.ZodNull,...Se(t)});class hS extends Re{constructor(){super(...arguments),this._any=!0}_parse(e){return rr(e.data)}}hS.create=t=>new hS({typeName:ye.ZodAny,...Se(t)});class pS extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rr(e.data)}}pS.create=t=>new pS({typeName:ye.ZodUnknown,...Se(t)});class Wi extends Re{_parse(e){const n=this._getOrReturnCtx(e);return Y(n,{code:V.invalid_type,expected:ie.never,received:n.parsedType}),ge}}Wi.create=t=>new Wi({typeName:ye.ZodNever,...Se(t)});class mS extends Re{_parse(e){if(this._getType(e)!==ie.undefined){const r=this._getOrReturnCtx(e);return Y(r,{code:V.invalid_type,expected:ie.void,received:r.parsedType}),ge}return rr(e.data)}}mS.create=t=>new mS({typeName:ye.ZodVoid,...Se(t)});class Qr extends Re{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==ie.array)return Y(n,{code:V.invalid_type,expected:ie.array,received:n.parsedType}),ge;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(o||a)&&(Y(n,{code:o?V.too_big:V.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())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Y(n,{code:V.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&&(Y(n,{code:V.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 Hi(n,o,n.path,a)))).then(o=>Mn.mergeArray(r,o));const i=[...n.data].map((o,a)=>s.type._parseSync(new Hi(n,o,n.path,a)));return Mn.mergeArray(r,i)}
vendor: 5,082 bytes, line 328
328get element(){return this._def.type}min(e,n){return new Qr({...this._def,minLength:{value:e,message:oe.toString(n)}})}max(e,n){return new Qr({...this._def,maxLength:{value:e,message:oe.toString(n)}})}length(e,n){return new Qr({...this._def,exactLength:{value:e,message:oe.toString(n)}})}nonempty(e){return this.min(1,e)}}Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...Se(e)});function Pa(t){if(t instanceof at){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Ii.create(Pa(r))}return new at({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:Pa(t.element)}):t instanceof Ii?Ii.create(Pa(t.unwrap())):t instanceof Dl?Dl.create(Pa(t.unwrap())):t instanceof Qo?Qo.create(t.items.map(e=>Pa(e))):t}class at extends Re{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=Pe.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==ie.object){const c=this._getOrReturnCtx(e);return Y(c,{code:V.invalid_type,expected:ie.object,received:c.parsedType}),ge}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wi&&this._def.unknownKeys==="strip"))for(const c in s.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=i[c],d=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Hi(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Wi){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(c==="strict")a.length>0&&(Y(s,{code:V.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Hi(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,f=await u.value;c.push({key:d,value:f,alwaysSet:u.alwaysSet})}return c}).then(c=>Mn.mergeObjectSync(r,c)):Mn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return oe.errToObj,new at({...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:oe.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new at({...this._def,unknownKeys:"strip"})}passthrough(){return new at({...this._def,unknownKeys:"passthrough"})}extend(e){return new at({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new at({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new at({...this._def,catchall:e})}pick(e){const n={};for(const r of Pe.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new at({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Pe.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new at({...this._def,shape:()=>n})}deepPartial(){return Pa(this)}partial(e){const n={};for(const r of Pe.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new at({...this._def,shape:()=>n})}required(e){const n={};for(const r of Pe.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ii;)i=i._def.innerType;n[r]=i}return new at({...this._def,shape:()=>n})}keyof(){return UO(Pe.objectKeys(this.shape))}}at.create=(t,e)=>new at({shape:()=>t,unknownKeys:"strip",catchall:Wi.create(),typeName:ye.ZodObject,...Se(e)});at.strictCreate=(t,e)=>new at({shape:()=>t,unknownKeys:"strict",catchall:Wi.create(),typeName:ye.ZodObject,...Se(e)});at.lazycreate=(t,e)=>new at({shape:t,unknownKeys:"strip",catchall:Wi.create(),typeName:ye.ZodObject,...Se(e)});class zh extends Re{_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 Ms(a.ctx.common.issues));return Y(n,{code:V.invalid_union,unionErrors:o}),ge}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 l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;
vendor: 5,024 bytes, line 328
328const a=o.map(l=>new Ms(l));return Y(n,{code:V.invalid_union,unionErrors:a}),ge}}get options(){return this._def.options}}zh.create=(t,e)=>new zh({options:t,typeName:ye.ZodUnion,...Se(e)});function Xv(t,e){const n=Xs(t),r=Xs(e);if(t===e)return{valid:!0,data:t};if(n===ie.object&&r===ie.object){const s=Pe.objectKeys(e),i=Pe.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(const a of i){const l=Xv(t[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===ie.array&&r===ie.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],l=Xv(o,a);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return n===ie.date&&r===ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Uh extends Re{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(oS(i)||oS(o))return ge;const a=Xv(i.value,o.value);return a.valid?((aS(i)||aS(o))&&n.dirty(),{status:n.value,value:a.data}):(Y(r,{code:V.invalid_intersection_types}),ge)};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}))}}Uh.create=(t,e,n)=>new Uh({left:t,right:e,typeName:ye.ZodIntersection,...Se(n)});class Qo extends Re{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.array)return Y(r,{code:V.invalid_type,expected:ie.array,received:r.parsedType}),ge;if(r.data.length<this._def.items.length)return Y(r,{code:V.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ge;!this._def.rest&&r.data.length>this._def.items.length&&(Y(r,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Hi(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Mn.mergeArray(n,o)):Mn.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Qo({...this._def,rest:e})}}Qo.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qo({items:t,typeName:ye.ZodTuple,rest:null,...Se(e)})};class gS extends Re{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!==ie.map)return Y(r,{code:V.invalid_type,expected:ie.map,received:r.parsedType}),ge;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:s._parse(new Hi(r,a,r.path,[c,"key"])),value:i._parse(new Hi(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return ge;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return ge;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}gS.create=(t,e,n)=>new gS({valueType:e,keyType:t,typeName:ye.ZodMap,...Se(n)});class Hu extends Re{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ie.set)return Y(r,{code:V.invalid_type,expected:ie.set,received:r.parsedType}),ge;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Y(r,{code:V.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&&(Y(r,{code:V.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(l){const c=new Set;for(const u of l){if(u.status==="aborted")return ge;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>i._parse(new Hi(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,n){return new Hu({...this._def,minSize:{value:e,message:oe.toString(n)}})}max(e,n){return new Hu({...this._def,maxSize:{value:e,message:oe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Hu.create=(t,e)=>new Hu({valueType:t,minSize:null,maxSize:null,typeName:ye.ZodSet,...Se(e)});class yS extends Re{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})}}yS.create=(t,e)=>new yS({getter:t,typeName:ye.ZodLazy,...Se(e)});class vS extends Re{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Y(n,{received:n.data,code:V.invalid_literal,expected:this._def.value}),ge}
vendor: 5,374 bytes, line 328
328return{status:"valid",value:e.data}}get value(){return this._def.value}}vS.create=(t,e)=>new vS({value:t,typeName:ye.ZodLiteral,...Se(e)});function UO(t,e){return new Ml({values:t,typeName:ye.ZodEnum,...Se(e)})}class Ml extends Re{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Y(n,{expected:Pe.joinValues(r),received:n.parsedType,code:V.invalid_type}),ge}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 Y(n,{received:n.data,code:V.invalid_enum_value,options:r}),ge}return rr(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 Ml.create(e,{...this._def,...n})}exclude(e,n=this._def){return Ml.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Ml.create=UO;class bS extends Re{_parse(e){const n=Pe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ie.string&&r.parsedType!==ie.number){const s=Pe.objectValues(n);return Y(r,{expected:Pe.joinValues(s),received:r.parsedType,code:V.invalid_type}),ge}if(this._cache||(this._cache=new Set(Pe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Pe.objectValues(n);return Y(r,{received:r.data,code:V.invalid_enum_value,options:s}),ge}return rr(e.data)}get enum(){return this._def.values}}bS.create=(t,e)=>new bS({values:t,typeName:ye.ZodNativeEnum,...Se(e)});class Vh extends Re{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ie.promise&&n.common.async===!1)return Y(n,{code:V.invalid_type,expected:ie.promise,received:n.parsedType}),ge;const r=n.parsedType===ie.promise?n.data:Promise.resolve(n.data);return rr(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Vh.create=(t,e)=>new Vh({type:t,typeName:ye.ZodPromise,...Se(e)});class Ll extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.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=>{Y(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 ge;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?ge:l.status==="dirty"||n.value==="dirty"?Oc(l.value):l});{if(n.value==="aborted")return ge;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?ge:a.status==="dirty"||n.value==="dirty"?Oc(a.value):a}}if(s.type==="refinement"){const o=a=>{const l=s.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l 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"?ge:(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"?ge:(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(!jl(o))return ge;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=>jl(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:n.value,value:a})):ge);Pe.assertNever(s)}}Ll.create=(t,e,n)=>new Ll({schema:t,typeName:ye.ZodEffects,effect:e,...Se(n)});Ll.createWithPreprocess=(t,e,n)=>new Ll({schema:e,effect:{type:"preprocess",transform:t},typeName:ye.ZodEffects,...Se(n)});class Ii extends Re{_parse(e){return this._getType(e)===ie.undefined?rr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ii.create=(t,e)=>new Ii({innerType:t,typeName:ye.ZodOptional,...Se(e)});class Dl extends Re{_parse(e){return this._getType(e)===ie.null?rr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dl.create=(t,e)=>new Dl({innerType:t,typeName:ye.ZodNullable,...Se(e)});class e0 extends Re{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ie.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}e0.create=(t,e)=>new e0({innerType:t,typeName:ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Se(e)});class t0 extends Re{_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 Fh(s)?s.then(i=>
vendor: 3,813 bytes, line 328
328({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ms(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ms(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}t0.create=(t,e)=>new t0({innerType:t,typeName:ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Se(e)});class wS extends Re{_parse(e){if(this._getType(e)!==ie.nan){const r=this._getOrReturnCtx(e);return Y(r,{code:V.invalid_type,expected:ie.nan,received:r.parsedType}),ge}return{status:"valid",value:e.data}}}wS.create=t=>new wS({typeName:ye.ZodNaN,...Se(t)});class V6 extends Re{_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 hw extends Re{_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"?ge:i.status==="dirty"?(n.dirty(),Oc(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"?ge: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 hw({in:e,out:n,typeName:ye.ZodPipeline})}}class n0 extends Re{_parse(e){const n=this._def.innerType._parse(e),r=s=>(jl(s)&&(s.value=Object.freeze(s.value)),s);return Fh(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}n0.create=(t,e)=>new n0({innerType:t,typeName:ye.ZodReadonly,...Se(e)});at.lazycreate;var ye;(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"})(ye||(ye={}));const Yc=bi.create;Wi.create;Qr.create;const H6=at.create;at.strictCreate;zh.create;Uh.create;Qo.create;Ml.create;Vh.create;Ii.create;Dl.create;const W6=nw,q6=rw,VO=x.forwardRef(({className:t,...e},n)=>m.jsx(vd,{ref:n,className:Ee("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}));VO.displayName=vd.displayName;const HO=x.forwardRef(({className:t,children:e,...n},r)=>m.jsxs(q6,{children:[m.jsx(VO,{}),m.jsxs(bd,{ref:r,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-xl duration-200 glass-dialog 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%] rounded-lg",t),...n,children:[e,m.jsxs(um,{className:"absolute right-4 top-4 roun
328ded-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:[m.jsx(nm,{className:"h-4 w-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));HO.displayName=bd.displayName;const WO=({className:t,...e})=>m.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});WO.displayName="DialogHeader";const qO=x.forwardRef(({className:t,...e},n)=>m.jsx(wd,{ref:n,className:Ee("text-lg font-semibold leading-none tracking-tight",t),...e}));qO.displayName=wd.displayName;const KO=x.forwardRef(({className:t,...e},n)=>m.jsx(xd,{ref:n,className:Ee("text-sm text-muted-foreground",t),...e}));KO.displayName=xd.displayName;const Zn=x.forwardRef(({className:t,type:e,...n},r)=>m.jsx("input",{type:e,className:Ee("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 transition-colors",t),ref:r,...n}));Zn.displayName="Input";var K6="Label",GO=x.forwardRef((t,e)=>m.jsx(nt.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())}}));GO.displayName=K6;var JO=GO;const G6=gd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Jn=x.forwardRef(({className:t,...e},n)=>m.jsx(JO,{ref:n,className:Ee(G6(),t),...e}));Jn.displayName=JO.displayName;const J6=JV,QO=x.createContext({}),Bg=({...t})=>m.jsx(QO.Provider,{value:{name:t.name},children:m.jsx(XV,{...t})}),vm=()=>{const t=x.useContext(QO),e=x.useContext(ZO),{getFieldState:n,formState:r}=ym(),s=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},ZO=x.createContext({}),Uf=x.forwardRef(({className:t,...e},n)=>{const r=x.useId();return m.jsx(ZO.Provider,{value:{id:r},children:m.jsx("div",{ref:n,className:Ee("space-y-2",t),...e})})});Uf.displayName="FormItem";const Vf=x.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:s}=vm();return m.jsx(Jn,{ref:n,className:Ee(r&&"text-destructive",t),htmlFor:s,...e})});Vf.displayName="FormLabel";const Hf=x.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=vm();return m.jsx(uA,{ref:e,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Hf.displayName="FormControl";const Q6=x.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=vm();return m.jsx("p",{ref:n,id:r,className:Ee("text-sm text-muted-foreground",t),...e})});Q6.displayName="FormDescription";const Wf=x.forwardRef(({className:t,children:e,...n},r)=>{const{error:s,formMessageId:i}=vm(),o=s?String(s==null?void 0:s.message):e;return o?m.jsx("p",{ref:r,id:i,className:Ee("text-sm font-medium text-destructive",t),...n,children:o}):null});Wf.displayName="FormMessage";const Z6=H6({firstName:Yc().trim().min(1,"Prénom requis").max(100),lastName:Yc().trim().min(1,"Nom requis").max(100),email:Yc().trim().email("Email invalide").max(255)}),Y6=({open:t,onOpenChange:e,eventTitle:n})=>{const r=h6({resolver:y6(Z6),defaultValues:{firstName:"",lastName:"",email:""}}),s=i=>{kr.success("Inscription confirmée !",{description:`Merci ${i.firstName}, vous êtes inscrit(e) à "${n}".`}),r.reset(),e(!1)};return m.jsx(W6,{open:t,onOpenChange:e,children:m.jsxs(HO,{className:"sm:max-w-md",children:[m.jsxs(WO,{children:[m.jsx(qO,{className:"font-heading text-xl",children:"S'inscrire"}),m.jsx(KO,{children:n})]}),m.jsx(J6,{...r,children:m.jsxs("form",{onSubmit:r.handleSubmit(s),className:"space-y-4",children:[m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[m.jsx(Bg,{control:r.control,name:"firstName",render:({field:i})=>m.jsxs(Uf,{children:[m.jsx(Vf,{children:"Prénom"}),m.jsx(Hf,{children:m.jsx(Zn,{placeholder:"Stanislas",...i})}),m.jsx(Wf,{})]})}),m.jsx(Bg,{control:r.control,name:"lastName",render:({field:i})=>m.jsxs(Uf,{children:[m.jsx(Vf,{children:"Nom"}),m.jsx(Hf,{children:m.jsx(Zn,{placeholder:"de Boufflers",...i})}),m.jsx(Wf,{})]})})]}),m.jsx(Bg,{control:r.control,name:"email",render:({field:i})=>m.jsxs(Uf,{children:[m.jsx(Vf,{children:"Email"}),m.jsx(Hf,{children:m.jsx(Zn,{type:"email",placeholder:"[email protected]",...i})}),m.jsx(Wf,{})]})}),m.jsx(Le,{type:"submit",className:"w-full",children:"Confirmer l'inscription"})]})})]})})},X6=1,e8="00966e68-8598-4b50-908e-7a0935ae8003",t8="f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4",n8="/__l5e/assets-v1/00966e68-8598-4b50-908e-7a0935ae8003/sponsor-casalonga.png",r8="a/v1/f1
328d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4/00966e68-8598-4b50-908e-7a0935ae8003/sponsor-casalonga.png",s8="sponsor-casalonga.png",i8=34538,o8="image/webp",a8="2026-08-25T21:24:31Z",l8={version:X6,asset_id:e8,project_id:t8,url:n8,r2_key:r8,original_filename:s8,size:i8,content_type:o8,created_at:a8},c8=1,u8="2c3f8af2-d8ae-4e22-9f68-4d05a6b58e39",d8="f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4",f8="/__l5e/assets-v1/2c3f8af2-d8ae-4e22-9f68-4d05a6b58e39/sponsor-cms-francis-lefebvre.png",h8="a/v1/f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4/2c3f8af2-d8ae-4e22-9f68-4d05a6b58e39/sponsor-cms-francis-lefebvre.png",p8="sponsor-cms-francis-lefebvre.png",m8=29557,g8="image/png",y8="2026-08-25T15:05:47Z",v8={version:c8,asset_id:u8,project_id:d8,url:f8,r2_key:h8,original_filename:p8,size:m8,content_type:g8,created_at:y8},b8=1,w8="291c7406-97d3-4833-b66a-e272262abef6",x8="f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4",k8="/__l5e/assets-v1/291c7406-97d3-4833-b66a-e272262abef6/sponsor-cabinet-lionel-vial.png",S8="a/v1/f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4/291c7406-97d3-4833-b66a-e272262abef6/sponsor-cabinet-lionel-vial.png",E8="sponsor-cabinet-lionel-vial.png",C8=12703,_8="image/png",T8="2026-08-25T15:05:52Z",A8={version:b8,asset_id:w8,project_id:x8,url:k8,r2_key:S8,original_filename:E8,size:C8,content_type:_8,created_at:T8},N8=1,O8="e25510d4-e82a-4581-804c-cbeb29c8c2f4",R8="f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4",P8="/__l5e/assets-v1/e25510d4-e82a-4581-804c-cbeb29c8c2f4/sponsor-bandpay-greuter.png",I8="a/v1/f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4/e25510d4-e82a-4581-804c-cbeb29c8c2f4/sponsor-bandpay-greuter.png",j8="sponsor-bandpay-greuter.png",M8=16930,L8="image/png",D8="2026-08-25T15:05:58Z",$8={version:N8,asset_id:O8,project_id:R8,url:P8,r2_key:I8,original_filename:j8,size:M8,content_type:L8,created_at:D8},F8=1,B8="bfc64442-e2ab-4d4f-9da7-ac3ddbcea095",z8="f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4",U8="/__l5e/assets-v1/bfc64442-e2ab-4d4f-9da7-ac3ddbcea095/sponsor-le-pays-du-teilleul.png",V8="a/v1/f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4/bfc64442-e2ab-4d4f-9da7-ac3ddbcea095/sponsor-le-pays-du-teilleul.png",H8="sponsor-le-pays-du-teilleul.png",W8=9688,q8="image/png",K8="2026-08-25T15:06:03Z",G8={version:F8,asset_id:B8,project_id:z8,url:U8,r2_key:V8,original_filename:H8,size:W8,content_type:q8,created_at:K8},J8=1,Q8="b3b5acf7-dd39-4679-91d6-12e075ef1ce1",Z8="f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4",Y8="/__l5e/assets-v1/b3b5acf7-dd39-4679-91d6-12e075ef1ce1/sponsor-doucede-ip.png",X8="a/v1/f1d22b1b-8fa1-4964-bad2-b6ad4c9ea5e4/b3b5acf7-dd39-4679-91d6-12e075ef1ce1/sponsor-doucede-ip.png",eH="sponsor-doucede-ip.png",tH=5209,nH="image/png",rH="2026-08-25T15:06:08Z",sH={version:J8,asset_id:Q8,project_id:Z8,url:Y8,r2_key:X8,original_filename:eH,size:tH,content_type:nH,created_at:rH},iH=[{key:"grandMecene",size:"h-12 md:h-16",sponsors:[{name:"CMS Francis Lefebvre",url:v8.url}]},{key:"bienfaiteur",size:"h-11 md:h-[3.75rem]",sponsors:[{name:"Bandpay & Greuter",url:$8.url},{name:"Cabinet Lionel Vial",url:A8.url},{name:"Casalonga",url:l8.url}]},{key:"ami",size:"h-9 md:h-12",sponsors:[{name:"Le Pays du Teilleul Avocats",url:G8.url},{name:"Doucede IP",url:sH.url,className:"h-16 md:h-20"}]}],oH=()=>{const{t}=Mt();return m.jsx("div",{className:"relative isolate bg-sponsors text-sponsors-foreground py-8 md:py-12 overflow-hidden",children:m.jsx("div",{className:"relative z-10 container mx-auto",children:m.jsxs("div",{className:"max-w-4xl mx-auto",children:[m.jsx("h2",{className:"font-heading text-lg md:text-xl font-bold text-center mb-6 md:mb-8",children:t("sponsors.title")}),m.jsx("div",{className:"space-y-6 md:space-y-8",children:iH.map(e=>m.jsxs("div",{children:[m.jsx("p",{className:"text-center text-[0.65rem] md:text-xs uppercase tracking-[0.2em] text-sponsors-foreground/60 mb-3 md:mb-4",children:t(`sponsors.tiers.${e.key}`)}),m.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-5 md:gap-x-12",children:e.sponsors.map(n=>m.jsx("img",{src:n.url,alt:n.name,loading:"lazy",className:`${n.className??e.size} w-auto object-contain opacity-90 transition-opacity hover:opacity-100`},n.name))})]},e.key))})]})})})};function Ja(t){const[e,n]=x.useState(!1),r=x.useRef(null);return{ref:x.useCallback(i=>
328{r.current&&r.current.disconnect(),!(!i||e)&&(r.current=new IntersectionObserver(([o])=>{var a;o.isIntersecting&&(n(!0),(a=r.current)==null||a.disconnect())},{threshold:.1,...t}),r.current.observe(i))},[e]),isInView:e}}const aH=()=>{const{t}=Mt(),[e,n]=x.useState(!1),r=Ja(),s=Ja();return m.jsxs("section",{id:"evenements",children:[m.jsxs("div",{className:"relative isolate bg-background text-foreground py-10 md:py-24 overflow-hidden",children:[m.jsx("div",{className:"absolute inset-0 z-0 overflow-hidden pointer-events-none select-none",children:m.jsx("div",{className:"absolute -inset-[200%] opacity-[0.06] rotate-45",style:{backgroundImage:"url('/images/pattern-motif.png')",backgroundSize:"40px",backgroundRepeat:"repeat"}})}),m.jsx("div",{ref:r.ref,className:`relative z-10 container mx-auto reveal ${r.isInView?"revealed":""}`,children:m.jsx("div",{className:"max-w-6xl mx-auto",children:m.jsxs("div",{className:"grid md:grid-cols-2 gap-10 md:gap-14 items-center",children:[m.jsxs("div",{className:"text-center md:text-left",children:[m.jsxs("div",{className:"flex items-center gap-1 mb-4 md:justify-start justify-center",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold text-foreground",children:t("events.conference")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}),m.jsx("p",{className:"text-foreground/70 leading-relaxed text-sm md:text-base mb-6",children:t("events.conferenceDesc")}),m.jsxs("div",{className:"flex flex-wrap gap-3 md:justify-start justify-center",children:[m.jsx(Le,{asChild:!0,variant:"default",size:"lg",children:m.jsx("a",{href:"https://www.helloasso.com/associations/institut-stanislas-de-boufflers/evenements/la-propriete-intellectuelle-en-action-1",target:"_blank",rel:"noopener noreferrer",children:t("events.register")})}),m.jsx(Le,{asChild:!0,variant:"outline",size:"lg",children:m.jsxs("a",{href:MV.url,download:!0,children:[m.jsx(Iv,{className:"w-4 h-4"}),t("events.programme")]})})]})]}),m.jsx("div",{className:"max-w-sm md:max-w-md mx-auto md:mx-0",children:m.jsx("img",{src:WV.url,alt:t("events.altConfFlyer"),className:"w-full h-auto rounded-lg shadow-card ring-4 ring-white transition-all duration-500 hover:scale-[1.03] hover:shadow-card-hover hover:-translate-y-1"})})]})})})]}),m.jsx(oH,{}),m.jsx("div",{id:"causeries",className:"relative isolate bg-secondary text-secondary-foreground py-10 md:py-24 overflow-hidden",children:m.jsx("div",{ref:s.ref,className:`relative z-10 container mx-auto reveal ${s.isInView?"revealed":""}`,children:m.jsx("div",{className:"max-w-6xl mx-auto",children:m.jsxs("div",{className:"grid md:grid-cols-2 gap-10 md:gap-14 items-center",children:[m.jsxs("div",{className:"text-center md:text-left",children:[m.jsxs("div",{className:"flex items-center gap-1 mb-4 md:justify-start justify-center",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold text-secondary-foreground",children:t("events.afterwork")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}),m.jsx("p",{className:"text-secondary-foreground/70 leading-relaxed text-sm md:text-base mb-6",children:t("events.afterworkDesc")}),m.jsx(Le,{asChild:!0,variant:"default",size:"lg",children:m.jsx("a",{href:"https://www.notion.so/3466d7440c2b8076be04fcc433e5b930?pvs=106",target:"_blank",rel:"noopener noreferrer",children:t("events.register")})})]}),m.jsx("div",{className:"max-w-sm md:max-w-md mx-auto md:mx-0",children:m.jsx("img",{src:qV,alt:t("events.altCauseriesFlyer"),className:"w-full h-auto rounded-lg shadow-card ring-4 ring-white transition-all duration-500 hover:scale-[1.03] hover:shadow-card-hover hover:-translate-y-1"})})]})})})}),m.jsx(Y6,{open:e,onOpenChange:n,eventTitle:"Summer Party - Afterwork"})]})},lH=({memberOf:t})=>m.jsxs("div",{className:"relative w-full aspect-[1.586/1] rounded-xl overflow-hidden shadow-2xl select-none max-w-[420px]",children:[m.jsx("img",{src:aa,alt:"",className:"absolute inset-0 w-full h-full object-cover"}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/80 via-primary/60 to-primary/90"}),m.jsx("img",{src:mm,alt:"",className:"absolute -right-10 -bottom-2 h-full w-auto object-contain opacity-25 pointer-events-none"}),m.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full p-5 md:p-6",children:[m.jsx("div",{className:"flex items-start",children:m.jsx("img",{src:ON,alt:"",className:"h-8 md:h-10 w-auto"})}),m.jsxs("div",{className:"mt-auto",children:[m.jsx("p",{className:"text-[9px] md:text-[10px] text-primary-foreground
328/50 uppercase tracking-[0.2em] mb-1",children:t}),m.jsx("p",{className:"font-heading text-sm md:text-base text-primary-foreground font-bold leading-tight",children:"Institut de Boufflers"}),m.jsx("p",{className:"text-primary-foreground/70 text-xs md:text-sm mt-3 tracking-wide",children:"Mr Matthieu Dhenne"})]})]}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-transparent via-primary-foreground/5 to-transparent pointer-events-none"})]}),bm=()=>{const{t}=Mt();return m.jsx(m.Fragment,{children:m.jsx("section",{className:"py-10 md:py-16 bg-gradient-to-br from-muted/60 via-muted/30 to-background",children:m.jsx("div",{className:"container mx-auto px-4",children:m.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-8 lg:gap-14",children:[m.jsx("div",{className:"w-full lg:w-5/12 flex justify-center lg:justify-end",children:m.jsx(lH,{memberOf:t("membershipCta.cardMemberOf")})}),m.jsxs("div",{className:"w-full lg:w-7/12",children:[m.jsxs("div",{className:"flex items-center gap-1 mb-4",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold text-foreground",children:t("membershipCta.title")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}),m.jsx("p",{className:"text-muted-foreground leading-relaxed mb-6",children:t("membershipCta.body")}),m.jsx(Le,{asChild:!0,size:"lg",variant:"default",children:m.jsx(Et,{to:"/devenir-membre",children:t("membershipCta.cta")})})]})]})})})})},la=()=>{const{t}=Mt(),e=()=>{window.scrollTo({top:0,behavior:"smooth"})};return m.jsxs("footer",{className:"bg-secondary text-secondary-foreground",children:[m.jsx("div",{className:"container mx-auto",children:m.jsx("div",{className:"h-px bg-secondary-foreground/10"})}),m.jsxs("div",{className:"container mx-auto py-12 md:py-20",children:[m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-10 md:gap-8",children:[m.jsxs("div",{className:"flex flex-col items-center md:items-start gap-4",children:[m.jsx("img",{src:RN,alt:"Logo Institut de Boufflers",className:"h-12 w-auto brightness-0 invert"}),m.jsx("p",{className:"font-heading text-lg text-secondary-foreground/90 text-center md:text-left",children:t("footer.tagline")}),m.jsx("p",{className:"text-secondary-foreground/40 text-xs leading-relaxed max-w-xs text-center md:text-left",children:t("footer.blurb")})]}),m.jsxs("div",{className:"flex flex-col items-center md:items-start gap-3",children:[m.jsx("span",{className:"section-label text-secondary-foreground/40 mb-2",children:t("footer.navigation")}),m.jsx(Et,{to:"/",className:"text-sm text-secondary-foreground/60 hover:text-primary transition-colors",children:t("nav.events")}),m.jsx(Et,{to:"/blog",className:"text-sm text-secondary-foreground/60 hover:text-primary transition-colors",children:t("nav.gazette")}),m.jsx(Et,{to:"/qui-sommes-nous",className:"text-sm text-secondary-foreground/60 hover:text-primary transition-colors",children:t("nav.institute")})]}),m.jsxs("div",{className:"flex flex-col items-center md:items-end gap-3",children:[m.jsx("span",{className:"section-label text-secondary-foreground/40 mb-2",children:t("footer.contact")}),m.jsx("a",{href:"mailto:[email protected]",className:"text-sm text-secondary-foreground/60 hover:text-primary transition-colors",children:"[email protected]"}),m.jsx("div",{className:"mt-3",children:m.jsx(Qv,{variant:"dark"})}),m.jsxs("button",{onClick:e,className:"mt-2 flex items-center gap-2 text-xs text-secondary-foreground/40 hover:text-secondary-foreground/80 transition-colors group",children:[m.jsx("span",{children:t("footer.backToTop")}),m.jsx(q4,{className:"h-3 w-3 transition-transform group-hover:-translate-y-0.5"})]})]})]}),m.jsx("div",{className:"mt-12 pt-6 border-t border-secondary-foreground/10 text-center",children:m.jsx("p",{className:"text-secondary-foreground/30 text-xs",children:t("footer.rights",{year:new Date().getFullYear()})})})]})]})},cH=()=>m.jsxs("div",{className:"min-h-screen",children:[m.jsx("div",{className:"noise-overlay"}),m.jsx(oa,{}),m.jsx(CV,{}),m.jsx(aH,{}),m.jsx(bm,{}),m.jsx(la,{})]}
328),YO={Brevets:{bg:"bg-blue-600 dark:bg-blue-500",bgCard:"bg-blue-50 dark:bg-blue-950/40",text:"text-white",border:"border-blue-600 dark:border-blue-500",accent:"bg-blue-600 dark:bg-blue-400"},"Droit d'auteur":{bg:"bg-rose-600 dark:bg-rose-500",bgCard:"bg-rose-50 dark:bg-rose-950/40",text:"text-white",border:"border-rose-600 dark:border-rose-500",accent:"bg-rose-600 dark:bg-rose-400"},Marques:{bg:"bg-fuchsia-600 dark:bg-fuchsia-500",bgCard:"bg-fuchsia-50 dark:bg-fuchsia-950/40",text:"text-white",border:"border-fuchsia-600 dark:border-fuchsia-500",accent:"bg-fuchsia-600 dark:bg-fuchsia-400"},"Dessins & Modèles":{bg:"bg-lime-600 dark:bg-lime-500",bgCard:"bg-lime-50 dark:bg-lime-950/40",text:"text-white",border:"border-lime-600 dark:border-lime-500",accent:"bg-lime-600 dark:bg-lime-400"},Autres:{bg:"bg-slate-600 dark:bg-slate-500",bgCard:"bg-slate-50 dark:bg-slate-900/40",text:"text-white",border:"border-slate-600 dark:border-slate-500",accent:"bg-slate-600 dark:bg-slate-400"}},uH={Brevets:"text-blue-700 dark:text-blue-300","Droit d'auteur":"text-rose-700 dark:text-rose-300",Marques:"text-fuchsia-700 dark:text-fuchsia-300","Dessins & Modèles":"text-lime-700 dark:text-lime-300",Autres:"text-slate-700 dark:text-slate-300"},xS={bg:"bg-muted",bgCard:"bg-muted/50",text:"text-foreground/70",border:"border-border",accent:"bg-primary"};function ji(t){return t?YO[t]??xS:xS}function dH(t){return uH[t]??"text-foreground/60"}const fH=()=>{const{t,i18n:e}=Mt(),[n,r]=x.useState(null),s=x.useRef(null),[i,o]=x.useState(0),{data:a,isLoading:l}=HT({queryKey:["posts"],queryFn:async()=>{const{data:f,error:h}=await Rt.from("posts").select(`
329          id,
330          title,
331          slug,
332          published_at,
333          tags,
334          excerpt,
335          author_name,
336          authors ( name )
337        `).order("published_at",{ascending:!1});if(h)throw h;return f}}),c=["Brevets","Dessins & Modèles","Marques","Droit d'auteur","Autres"],u=x.useMemo(()=>{if(!a)return[];const f=new Set;return a.forEach(h=>{(h.tags||[]).forEach(p=>f.add(p))}),c.filter(h=>f.has(h))},[a]),d=x.useMemo(()=>a?n?a.filter(f=>(f.tags||[]).includes(n)):a:[],[a,n]);return x.useEffect(()=>{const f=s.current;if(!f)return;const h=()=>{const{width:g,height:y}=f.getBoundingClientRect(),v=Math.max(g,y),b=Math.ceil(v*Math.SQRT2+160);o(b)};h();const p=new ResizeObserver(()=>h());return p.observe(f),()=>p.disconnect()},[d.length,l]),m.jsxs("div",{className:"min-h-screen",children:[m.jsx("div",{className:"noise-overlay"}),m.jsx(oa,{}),m.jsxs("section",{className:"relative flex items-end overflow-hidden bg-primary pt-24 pb-10 md:pt-36 md:pb-24",children:[m.jsx("img",{src:aa,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none select-none"}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/60 via-trans
337parent to-primary/20 pointer-events-none"}),m.jsxs("div",{className:"relative z-10 container mx-auto",children:[m.jsxs("h1",{className:"font-heading text-primary-foreground text-3xl md:text-6xl lg:text-7xl font-black leading-[0.9] mb-4 opacity-0 animate-fade-in-up [animation-delay:100ms]",children:[t("blog.heroTitle1"),m.jsx("br",{}),t("blog.heroTitle2")]}),m.jsx("p",{className:"text-primary-foreground/80 text-lg md:text-xl opacity-0 animate-fade-in-up [animation-delay:250ms]",children:t("blog.heroSubtitle")})]})]}),m.jsxs("section",{ref:s,className:"relative bg-background py-10 md:py-24 overflow-hidden",children:[m.jsx("div",{className:"absolute inset-0 z-0 overflow-hidden pointer-events-none select-none","aria-hidden":"true",children:i>0&&m.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rotate-45 origin-center opacity-[0.06]",style:{width:`${i}px`,height:`${i}px`,backgroundImage:"url('/images/pattern-motif.png')",backgroundSize:"40px",backgroundRepeat:"repeat"}})}),m.jsxs("div",{className:"relative z-10 container mx-auto",children:[m.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold text-foreground",children:t("blog.latest")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}),m.jsxs("div",{className:"flex flex-wrap gap-2 mb-10",children:[m.jsx("button",{onClick:()=>r(null),className:`rounded-md border text-xs font-medium uppercase tracking-wider px-4 py-2 transition-all duration-200 ${n===null?"bg-primary text-primary-foreground border-primary shadow-lg shadow-primary/25":"bg-transparent text-foreground/70 border-border hover:border-primary/40 hover:text-primary"}`,children:t("blog.all")}),u.map(f=>{const h=ji(f);return m.jsx("button",{onClick:()=>r(n===f?null:f),className:`rounded-md border text-xs font-medium uppercase tracking-wider px-4 py-2 transition-all duration-200 ${n===f?`${h.bg} ${h.text} ${h.border} shadow-md`:"bg-transparent text-foreground/70 border-border hover:border-primary/40 hover:text-primary"}`,children:f},f)})]}),l?m.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((f,h)=>m.jsxs("div",{className:"rounded-lg border border-border bg-card p-6 animate-pulse h-64",children:[m.jsx("div",{className:"h-4 w-20 bg-muted rounded mb-4"}),m.jsx("div",{className:"h-5 bg-muted rounded mb-2"}),m.jsx("div",{className:"h-5 bg-muted rounded w-3/4 mb-4"}),m.jsx("div",{className:"h-4 bg-muted rounded w-full mb-2"}),m.jsx("div",{className:"h-4 bg-muted rounded w-2/3"})]},h))}):d.length===0?m.jsx("p",{className:"text-muted-foreground text-center py-12",children:t("blog.empty")}):m.jsx("div",{className:"grid gap-8 md:grid-cols-2 lg:grid-cols-3",children:d.map((f,h)=>{var v;const p=f.tags||[],g=p[0],y=g?ji(g):null;return m.jsx(Et,{to:`/blog/${f.slug}`,className:"group",style:{transitionDelay:`${Math.min(h*60,300)}ms`},children:m.jsxs("article",{className:"border border-border/40 bg-card p-5 md:p-7 flex flex-col h-full transition-all duration-300 group-hover:border-primary/30 group-hover:shadow-md group-hover:-translate-y-1",children:[m.jsx("div",{className:`absolute left-0 top-0 bottom-0 w-[3px] rounded-l-sm opacity-0 group-hover:opacity-100 transition-opacity duration-300 ${(y==null?void 0:y.bg)||"bg-primary"}`,style:{position:"absolute"}}),m.jsx("div",{className:"flex flex-wrap gap-1.5 mb-4",children:p.map(b=>{const w=ji(b),k=dH(b);return m.jsx("span",{className:`text-[10px] font-semibold uppercase tracking-[0.15em] px-2.5 py-1 rounded-md ${w.bgCard} ${k}`,children:b},b)})}),m.jsx("h3",{className:"font-heading text-lg md:text-xl font-bold text-card-foreground leading-tight group-hover:text-primary transition-colors line-clamp-3 mb-4",children:f.title}),m.jsx("p",{className:"text-muted-foreground text-sm md:text-base leading-relaxed line-clamp-3 flex-1",children:f.excerpt}),m.jsxs("div",{className:"mt-6 pt-4 border-t border-border/30 flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-foreground
337/50 tracking-[0.1em] uppercase",children:[f.published_at&&m.jsx("span",{children:new Date(f.published_at).toLocaleDateString((e.resolvedLanguage||e.language||"fr").startsWith("en")?"en-GB":"fr-FR",{day:"numeric",month:"short",year:"numeric"})}),m.jsx("span",{children:"·"}),m.jsx("span",{className:"font-medium",children:((v=f.authors)==null?void 0:v.name)||f.author_name||"Institut Stanislas de Boufflers"})]}),m.jsxs("span",{className:"text-primary text-xs opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[t("blog.read")," →"]})]})]})},f.id)})})]})]}),m.jsx(bm,{}),m.jsx(la,{})]})},hH=gd("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function pH({className:t,variant:e,...n}){return m.jsx("div",{className:Ee(hH({variant:e}),t),...n})}const mH=()=>{var o,a;const{t,i18n:e}=Mt(),{slug:n}=ZL(),{data:r,isLoading:s}=HT({queryKey:["post",n],queryFn:async()=>{const{data:l,error:c}=await Rt.from("posts").select(`
338          id,
339          title,
340          slug,
341          published_at,
342          tags,
343          excerpt,
344          body,
345          author_name,
346          authors ( name, role, institution )
347        `).eq("slug",n).single();if(c)throw c;return l}}),i=(r==null?void 0:r.tags)||[];return m.jsxs("div",{className:"min-h-screen",children:[m.jsx(oa,{}),m.jsxs("section",{className:"relative flex items-end overflow-hidden bg-primary pt-28 pb-12 md:pt-36 md:pb-16",children:[m.jsx("img",{src:aa,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none select-none"}),m.jsxs("div",{className:"relative z-10 container mx-auto",children:[m.jsxs(Et,{to:"/blog",className:"inline-flex items-center gap-2 text-primary-foreground/70 hover:text-primary-foreground mb-6 transition-colors text-sm",children:[m.jsx(BA,{className:"w-4 h-4"}),t("blogPost.back")]}),s?m.jsx("div",{className:"h-12 w-2/3 bg-primary-foreground/10 rounded animate-pulse"}):m.jsxs(m.Fragment,{children:[m.jsx("h1",{className:"font-heading text-primary-foreground text-3xl md:text-5xl lg:text-6xl font-black leading-[0.95] mb-4",children:r==null?void 0:r.title}),m.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-primary-foreground/80 text-base md:text-lg mt-2",children:[i.map(l=>m.jsx(pH,{className:`text-sm px-3 py-1 ${ji(l).bg} ${ji(l).text} ${ji(l).border} border`,children:l},l)),(r==null?void 0:r.published_at)&&m.jsx("span",{children:new Date(r.published_at).toLocaleDateString((e.resolvedLanguage||e.language||"fr").startsWith("en")?"en-GB":"fr-FR",{day:"numeric",month:"long",year:"numeric"})}),(((o=r==null?void 0:r.authors)==null?void 0:o.name)||(r==null?void 0:r.author_name))&&m.jsxs("span",{children:["— ",((a=r==null?void 0:r.authors)==null?void 0:a.name)||(r==null?void 0:r.author_name)]})]})]})]})]}),m.jsx("article",{className:"bg-background py-12 md:py-20",children:m.jsxs("div",{className:"container mx-auto max-w-3xl",children:[s?m.jsx("div",{className:"space-y-4",children:[...Array(6)].map((l,c)=>m.jsx("div",{className:"h-4 bg-muted rounded animate-pulse",style:{width:`${70+Math.random()*30}%`}},c))}):r!=null&&r.body?m.jsx("div",{className:"prose prose-lg max-w-none dark:prose-invert prose-headings:font-heading prose-headings:text-foreground prose-p:text-foreground/85 prose-p:leading-relaxed prose-li:text-foreground/85 prose-strong:text-foreground prose-a:text-primary",dangerouslySetInnerHTML:{__html:r.body}}):m.jsx("p",{className:"text-muted-foreground italic text-center py-12",children:t("blogPost.comingSoon")}),(r==null?void 0:r.authors)&&m.jsxs("div",{className:"mt-16 pt-8 border-t border-border",children:[m.jsx("p",{className:"font-heading font-bold text-foreground text-lg",children:r.authors.name}),r.authors.role&&m.jsx("p",{className:"text-muted-foreground text-sm",children:r.authors.role}),r.authors.institution&&m.jsx("p",{className:"text-muted-foreground text-sm",children:r.authors.institution})]})]})}),m.jsx(bm,{}),m.jsx(la,{})]})},gH=()=>{const{t}=Mt(),e=Ql();return x.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),m.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:m.jsxs("div",{className:"text-center",children:[m.jsx("h1",{className:"font-heading mb-4 text-4xl font-bold",children:t("notFound.title")}),m.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:t("notFound.message")}),m.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:t("notFound.home")})]})})},yH="/assets/signature-boufflers-CkfvEjgc.png",kS="/assets/matthieu-dhenne-BYPY-gbH.png",vH="/assets/benjamin-mollet-vieville-BYGH6i5L.png",SS="/assets/gregoire-hadot-pericard-DXW1vwlD.png",bH="/assets/nicolas-binctin-D3pdLyKO.png",ES="/assets/aujain-eghbali-NBtSGZ2B.png",wH="/assets/jacques-azema-DBN3oChn.png",xH="/assets/marie-courboulay-C7pnTyWv.png",CS="/assets/geraldine-doucede-Bv0T6ZdC.png",kH="/assets/william-fauchoux-B6yHWC_I.png",SH="/assets/marianne-gabriel-cI3omES9.png",EH="/assets/xavier-pres-FmlKPcJ8.png",CH=[{name:"Jacques Azéma",image:wH},{name:"Marie Courboulay",image:xH}],_S=()=>m.jsx("div",{className:"absolute inset-0 z-0 overflow-hidden pointer-events-none select-none",children:m.jsx("div",{className:"absolute -inset-[200%] opacity-[0.06] rotate-45",style:{backgroundImage:"url('/images/pattern-motif.png')",backgroundSize:"40px",backgroundRepeat:"repeat"}})}),zg=({member:t,size:e="sm",showRole:n=!0})=>{const r=e==="md"?"w-28 h-28 md:w-40 md:h-40":"w-24 h-24 md:w-36 md:h-36",s=e==="md"?"text-sm md:text-base":"text-xs md:text-sm";return m.jsxs("div",{className:"flex flex-col items-center text-center group",children:[m.jsxs("div",{className:`${r} rounded-lg overflow-hidden mb-3 relative transition-all duration-300 group-hover:scale-[1.03] group-hover:-translate-y-1`,children:[m.jsx("div",{className:"absolute inset-0 rounded-lg bg-muted",style:{backgroundImage:"url('/images/pattern-motif.png')",backgroundSize:"30px",backgroundRepeat:"repeat"}}),m.jsx("img",{src:t.image,alt:t.name,className:"absolute inset-0 w-full h-full object-cover object-top grayscale z-10 drop-shadow-md",loading:"lazy"})]}),t.link?m.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:`font-heading ${s} font-bold hover:text-primary transition-colors`,children:t.name}):m.jsx("span",{className:`font-heading ${s} font-bold`,children:t.name}),n&&t.role&&m.jsx("span",{className:"text-current/60 text-xs italic mt-0.5 opacity-60",children:t.role})]})},_H=()=>{const{t}=Mt(),e=Ja(),n=Ja(),r=Ja(),s=Ja(),i=[{name:"Matthieu Dhenne",role:t("about.roles.president"),image:kS,link:"https://www.dhenne-
347avocats.fr/avocat/matthieu-dhenne-avocat-brevets/"},{name:"Géraldine Doucède",role:t("about.roles.secretary"),image:CS},{name:"Grégoire Hadot-Péricard",role:t("about.roles.secretaryAdj"),image:SS},{name:"Aujain Eghbali",role:t("about.roles.treasurer"),image:ES,link:"https://www.bandpay-greuter.com/member/aujain-eghbali/"}],o=[{name:"Matthieu Dhenne",image:kS,link:"https://www.dhenne-avocats.fr/avocat/matthieu-dhenne-avocat-brevets/"},{name:"Nicolas Binctin",image:bH,link:"https://univ-droit.fr/universitaires/4893-binctin-nicolas"},{name:"Grégoire Hadot-Péricard",image:SS},{name:"Aujain Eghbali",image:ES,link:"https://www.bandpay-greuter.com/member/aujain-eghbali/"},{name:"Géraldine Doucède",image:CS},{name:"William Fauchoux",image:kH},{name:"Marianne Gabriel",image:SH},{name:"Benjamin Mollet-Viéville",image:vH,link:"https://www.dhenne-avocats.fr/avocat/benjamin-mollet-vieville/"},{name:"Xavier Près",image:EH}],a=[{label:t("about.contactGeneral"),email:"[email protected]"},{label:t("about.contactSecretary"),email:"[email protected]"},{label:t("about.contactTreasury"),email:"[email protected]"}];return m.jsxs("div",{className:"min-h-screen",children:[m.jsx("div",{className:"noise-overlay"}),m.jsx(oa,{}),m.jsxs("section",{className:"relative flex items-end overflow-hidden bg-primary pt-24 pb-10 md:pt-36 md:pb-24",children:[m.jsx("img",{src:aa,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none select-none"}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/60 via-trans
347parent to-primary/20 pointer-events-none"}),m.jsxs("div",{className:"relative z-10 container mx-auto",children:[m.jsx("h1",{className:"font-heading text-primary-foreground text-3xl md:text-6xl lg:text-7xl font-black leading-[0.9] mb-4 opacity-0 animate-fade-in-up [animation-delay:100ms]",children:t("about.title")}),m.jsx("p",{className:"text-primary-foreground/80 text-lg md:text-xl opacity-0 animate-fade-in-up [animation-delay:250ms]",children:t("about.subtitle")})]})]}),m.jsx("section",{className:"bg-background py-10 md:py-16",children:m.jsxs("div",{className:"container mx-auto max-w-3xl",children:[m.jsxs("div",{className:"flex items-center gap-1 mb-6",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold text-foreground",children:t("about.wordTitle")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}),m.jsxs("div",{className:"space-y-3 text-foreground/80 leading-relaxed text-sm md:text-base",children:[m.jsx("p",{children:t("about.word.p1")}),m.jsx("p",{className:"font-semibold text-base md:text-lg text-primary",children:t("about.word.p2")}),m.jsx("p",{children:t("about.word.p3")}),m.jsx("p",{children:t("about.word.p4")}),m.jsx("p",{children:t("about.word.p5")}),m.jsx("p",{children:t("about.word.p6")})]}),m.jsxs("div",{className:"flex flex-col items-end gap-3 mt-6",children:[m.jsx("div",{className:"w-36 md:w-48",children:m.jsx("img",{src:yH,alt:"Signature de S. de Boufflers",className:"w-full h-auto opacity-70 select-none"})}),m.jsx(Le,{asChild:!0,variant:"default",size:"default",className:"tracking-widest text-xs uppercase",children:m.jsx(Et,{to:"/devenir-membre",children:t("about.becomeMember")})})]})]})}),m.jsx("section",{className:"relative bg-secondary text-secondary-foreground py-16 md:py-24 overflow-hidden",children:m.jsxs("div",{ref:e.ref,className:`relative z-10 container mx-auto reveal ${e.isInView?"revealed":""}`,children:[m.jsxs("div",{className:"flex items-center justify-center gap-1 mb-10",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold",children:t("about.bureau")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}),m.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-6 md:gap-10 max-w-4xl mx-auto",children:i.map(l=>m.jsx(zg,{member:l},l.name))})]})}),m.jsxs("section",{className:"relative bg-background py-16 md:py-24 overflow-hidden",children:[m.jsx(_S,{}),m.jsxs("div",{ref:n.ref,className:`relative z-10 container mx-auto reveal ${n.isInView?"revealed":""}`,children:[m.jsxs("div",{className:"flex items-center justify-center gap-1 mb-10",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold text-foreground",children:t("about.council")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}),m.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-3 gap-6 md:gap-10 max-w-4xl mx-auto",children:o.map(l=>m.jsx(zg,{member:l,showRole:!1},l.name))})]})]}),m.jsxs("section",{className:"relative bg-background py-16 md:py-24 overflow-hidden",children:[m.jsx(_S,{}),m.jsxs("div",{ref:s.ref,className:`relative z-10 container mx-auto reveal ${s.isInView?"revealed":""}`,children:[m.jsxs("div",{className:"flex items-center justify-center gap-1 mb-10",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold text-foreground",children:t("about.honor")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}),m.jsx("div",{className:"flex flex-wrap justify-center gap-8 md:gap-14 max-w-3xl mx-auto",children:CH.map(l=>m.jsx(zg,{member:l,size:"md",showRole:!1},l.name))})]})]}),m.jsx("section",{className:"relative bg-secondary text-secondary-foreground py-16 md:py-24 overflow-hidden",children:m.jsxs("div",{ref:r.ref,className:`relative z-10 container mx-auto max-w-5xl reveal ${r.isInView?"revealed":""}`,children:[m.jsxs("div",{className:"flex items-center justify-center gap-1 mb-3",children:[m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"}),m.jsx("h2",{className:"font-heading text-xl md:text-2xl font-bold",children:t("about.contactTitle")}),m.jsx("img",{src:At,alt:"",className:"w-5 h-5 opacity-80 rotate-45 translate-y-[3px]","aria-hidden":"true"})]}
347),m.jsx("p",{className:"text-center text-secondary-foreground/70 text-sm md:text-base mb-10 max-w-xl mx-auto",children:t("about.contactIntro")}),m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 md:gap-6",children:a.map(l=>m.jsxs("a",{href:`mailto:${l.email}`,className:"group flex flex-col items-center text-center p-6 rounded-lg border border-secondary-foreground/15 bg-secondary-foreground/[0.03] hover:bg-secondary-foreground/[0.07] hover:border-secondary-foreground/30 transition-all duration-300",children:[m.jsx("div",{className:"w-10 h-10 rounded-full border border-secondary-foreground/20 flex items-center justify-center mb-4 group-hover:border-secondary-foreground/40 transition-colors",children:m.jsx(zb,{className:"w-4 h-4"})}),m.jsx("span",{className:"font-heading text-sm font-bold uppercase tracking-wider mb-2",children:l.label}),m.jsx("span",{className:"text-[11px] md:text-xs text-secondary-foreground/70 group-hover:text-secondary-foreground transition-colors whitespace-nowrap",children:l.email})]},l.email))})]})}),m.jsx(bm,{}),m.jsx(la,{})]})};var XO="AlertDialog",[TH,EY]=ia(XO,[VN]),$s=VN(),eR=t=>{const{__scopeAlertDialog:e,...n}=t,r=$s(e);return m.jsx(nw,{...r,...n,modal:!0})};eR.displayName=XO;var AH="AlertDialogTrigger",NH=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=$s(n);return m.jsx(iO,{...s,...r,ref:e})});NH.displayName=AH;var OH="AlertDialogPortal",tR=t=>{const{__scopeAlertDialog:e,...n}=t,r=$s(e);return m.jsx(rw,{...r,...n})};tR.displayName=OH;var RH="AlertDialogOverlay",nR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=$s(n);return m.jsx(vd,{...s,...r,ref:e})});nR.displayName=RH;var ll="AlertDialogContent",[PH,IH]=TH(ll),jH=fA("AlertDialogContent"),rR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=$s(n),o=x.useRef(null),a=qt(e,o),l=x.useRef(null);return m.jsx(Dz,{contentName:ll,titleName:sR,docsSlug:"alert-dialog",children:m.jsx(PH,{scope:n,cancelRef:l,children:m.jsxs(bd,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:Ge(s.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[m.jsx(jH,{children:r}),m.jsx(LH,{contentRef:o})]})})})});rR.displayName=ll;var sR="AlertDialogTitle",iR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=$s(n);return m.jsx(wd,{...s,...r,ref:e})});iR.displayName=sR;var oR="AlertDialogDescription",aR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=$s(n);return m.jsx(xd,{...s,...r,ref:e})});aR.displayName=oR;var MH="AlertDialogAction",lR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=$s(n);return m.jsx(um,{...s,...r,ref:e})});lR.displayName=MH;var cR="AlertDialogCancel",uR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=IH(cR,n),i=$s(n),o=qt(e,s);return m.jsx(um,{...i,...r,ref:o})});uR.displayName=cR;var LH=({contentRef:t})=>{const e=`\`${ll}\` requires a description for the component to be accessible for screen reader users.
348
349You can add a description to the \`${ll}\` by passing a \`${oR}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
350
351Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ll}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
352
353For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},DH=eR,$H=tR,dR=nR,fR=rR,hR=lR,pR=uR,mR=iR,gR=aR;const FH=DH,BH=$H,yR=x.forwardRef(({className:t,...e},n)=>m.jsx(dR,{className:Ee("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}));yR.displayName=dR.displayName;const vR=x.forwardRef(({className:t,...e},n)=>m.jsxs(BH,{children:[m.jsx(yR,{}),m.jsx(fR,{ref:n,className:Ee("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:rou
353nded-lg",t),...e})]}));vR.displayName=fR.displayName;const bR=({className:t,...e})=>m.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",t),...e});bR.displayName="AlertDialogHeader";const wR=({className:t,...e})=>m.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});wR.displayName="AlertDialogFooter";const xR=x.forwardRef(({className:t,...e},n)=>m.jsx(mR,{ref:n,className:Ee("text-lg font-semibold",t),...e}));xR.displayName=mR.displayName;const kR=x.forwardRef(({className:t,...e},n)=>m.jsx(gR,{ref:n,className:Ee("text-sm text-muted-foreground",t),...e}));kR.displayName=gR.displayName;const SR=x.forwardRef(({className:t,...e},n)=>m.jsx(hR,{ref:n,className:Ee(Yb(),t),...e}));SR.displayName=hR.displayName;const ER=x.forwardRef(({className:t,...e},n)=>m.jsx(pR,{ref:n,className:Ee(Yb({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));ER.displayName=pR.displayName;var pw="Progress",mw=100,[zH,CY]=ia(pw),[UH,VH]=zH(pw),CR=x.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=HH,...o}=t;(s||s===0)&&!TS(s)&&console.error(WH(`${s}`,"Progress"));const a=TS(s)?s:mw;r!==null&&!AS(r,a)&&console.error(qH(`${r}`,"Progress"));const l=AS(r,a)?r:null,c=Hh(l)?i(l,a):void 0;return m.jsx(UH,{scope:n,value:l,max:a,children:m.jsx(nt.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Hh(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":AR(l,a),"data-value":l??void 0,"data-max":a,...o,ref:e})})});CR.displayName=pw;var _R="ProgressIndicator",TR=x.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=VH(_R,n);return m.jsx(nt.div,{"data-state":AR(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});TR.displayName=_R;function HH(t,e){return`${Math.round(t/e*100)}%`}function AR(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Hh(t){return typeof t=="number"}function TS(t){return Hh(t)&&!isNaN(t)&&t>0}function AS(t,e){return Hh(t)&&!isNaN(t)&&t<=e&&t>=0}function WH(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${mw}\`.`}function qH(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
354  - a positive number
355  - less than the value passed to \`max\` (or ${mw} if no \`max\` prop is set)
356  - \`null\` or \`undefined\` if the progress is indeterminate.
357
358Defaulting to \`null\`.`}var NR=CR,KH=TR;const OR=x.forwardRef(({className:t,value:e,...n},r)=>m.jsx(NR,{ref:r,className:Ee("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:m.jsx(KH,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));OR.displayName=NR.displayName;const oo=["https://www.institutboufflers.org/pour-lapplication-du-principe-de-proportionnalite-a-la-saisie-contrefacon-charles-de-haas-en-reponse-a-thierry-mollet-vieville/","https://www.institutboufflers.org/breve-conclusion-dun-accord-entre-meta-et-la-sacd-pour-lutilisation-doeuvres-protegees-en-ligne-clara-grudler/","https://www.institutboufflers.org/affaire-cambridge-analytica-meta-accepte-de-verser-725-millions-de-dollars-et-met-fin-a-un-recours-collectif/","https://www.institutboufflers.org/la-proportionnalite-de-la-saisie-contrefacon-pour-lautoriser-et-la-valider-thierry-mollet-vieville/","https://www.institutboufflers.org/de-boufflers-le-chapelier-lakanal-et-les-lumieres-ce-quils-penseraient-probablement-de-levolution-du-droit-dauteur-et-pourquoi-il-est-grand-temps-denvisager/","https://www.institutboufflers.org/linvention-du-brevet-une-idee-de-genie-decouvrez-lextrait-du-livre-de-pascal-attali-sur-la-figure-marquante-de-stanislas-de-boufflers/","https://www.institutboufflers.org/la-strategie-licences-frand-doppo-tu-obtiens-une-injonction-ok-je-pars/","https://www.institutboufflers.org/the-birth-of-the-upc-sir-robin-jacob/","https://www.institutboufflers.org/deux-fois-sortie-par-la-porte-la-clause-de-reparation-rentre-par-la-fenetre-charles-de-haas/","https://www.institutboufflers.org/lia-en-tant-quinventeur-quand-lhomme-demeure-cele-d
358ans-la-mythologie-de-la-technique-matthieu-dhenne/","https://www.institutboufflers.org/laffaire-gomboc-ou-les-deboires-de-la-protection-des-marques-tridimensionnelles-clara-grudler/","https://www.institutboufflers.org/la-suffisance-de-la-description-a-lepreuve-de-lintelligence-artificielle-matthieu-dhenne/","https://www.institutboufflers.org/commentaire-de-la-decision-brompton-bicycle-ltd-c-chedech-get2get-cjue-11-juin-2020-aff-c-833-18-beaucoup-de-bruit-pour-rien-patrice-de-cande/","https://www.institutboufflers.org/condamnation-a-des-dommages-interets-pour-procedure-abusive-retournement-de-situation/","https://www.institutboufflers.org/covid-19-comment-mettre-en-oeuvre-la-licence-doffice/","https://www.institutboufflers.org/la-clause-de-reparation-passe-a-la-trappe-du-conseil-constitutionnel-charles-de-haas/","https://www.institutboufflers.org/la-guerre-des-couleurs/","https://www.institutboufflers.org/directives-droit-dauteur-et-cabsat-du-17-avril-2019-ne-legiferons-quen-tremblant/","https://www.institutboufflers.org/entre-garantie-didentite-dorigine-et-innovation-technique-laffirmation-dune-incompatibilite-par-le-tribunal-de-lunion-europeenne-clara-grudle/","https://www.institutboufflers.org/lhumoriste-les-reseaux-sociaux-et-le-nouvel-ordre-moral-sarah-dormont/","https://www.institutboufflers.org/lappreciation-de-lactivite-inventive-des-methodes-de-simulation-assistee-par-ordinateur-aurelie-jimenez/","https://www.institutboufflers.org/breve-reflexion-sur-la-regle-de-droit-transitoire-relative-a-limprescriptibilite-des-actions-en-annulation-des-titres-nationaux-de-propriete-industrielle-art-124-loi-pacte-matthieu-dhenn/","https://www.institutboufflers.org/la-saisie-de-brevet-une-procedure-a-reformer-charles-simon/","https://www.institutboufflers.org/crispr-cas9-une-innovation-de-rupture-aux-enjeux-multiples/","https://www.institutboufflers.org/lalternative-a-lintroduction-prochaine-en-droit-interne-de-la-regrettable-clause-de-reparation/","https://www.institutboufflers.org/un-droit-agile-arnaud-latil/","https://www.institutboufflers.org/larbre-dans-le-champ-le-brevet-dinvention-et-le-droit-dauteur-andre-lucas/","https://www.institutboufflers.org/exception-de-parodie-une-notion-autonome-pour-laquelle-il-nest-pas-necessaire-de-mentionner-la-source-de-loeuvre-parodiee-commentaire-cour-de-cassation-1e-civ-22-mai-2019-n-18/","https://www.institutboufflers.org/les-droits-de-linventeur-sur-une-fusee-obus-anecdote-sur-lexploitation-dun-brevet-pendant-la-premiere-guerre-mondiale/","https://www.institutboufflers.org/proposition-de-loi-relative-a-la-protection-des-recettes-et-creations-culinaires/"];function GH({password:t}){const[e,n]=x.useState(!1),[r,s]=x.useState([]),[i,o]=x.useState(0),[a,l]=x.useState("idle"),u=(a==="single"?[oo[0]]:oo).length,d=e?Math.round(i/u*100):r.length>0?100:0,f=async g=>{const y=g==="single"?[oo[0]]:oo;if(!confirm(`Importer ${y.length} article${y.length>1?"s":""} depuis institutboufflers.org ?`))return;l(g),n(!0),s([]),o(0);const v=[];for(let w=0;w<y.length;w++){const k=y[w];o(w+1);try{const C=await fetch("https://amsbifdjlzyfedlrawnq.supabase.co/functions/v1/scrape-and-import",{method:"POST",headers:{"x-admin-password":t,"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFtc2JpZmRqbHp5ZmVkbHJhd25xIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM2MDUwNDAsImV4cCI6MjA4OTE4MTA0MH0.gnVWdrizTt0nWaLvBVdAtbSiJQTDT6qdv9Naein6Rqg"},body:JSON.stringify({url:k})}),E=await C.json();C.ok&&E.success?v.push({url:k,success:!0,title:E.title,tag:E.tag}):v.push({url:k,success:!1,error:E.error||"Erreur inconnue"})}catch(S){v.push({url:k,success:!1,error:S.message})}s([...v]),w<y.length-1&&await new Promise(S=>setTimeout(S,1500))}n(!1);const b=v.filter(w=>w.success).length;kr.success(`Import terminé : ${b}/${y.length} article${y.length>1?"s":""} importé${y.length>1?"s":""}`)},h=r.filter(g=>g.success).length,p=r.filter(g=>!g.success).length;return m.jsxs("div",{className:"bg-card border border-border rounded-lg p-6 space-y-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"font-heading font-bold text-lg",children:"Importer depuis institutboufflers.org"}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[oo.length," articles à importer via Firecrawl"]})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs(Le,{variant:"outline",onClick:()=>f("single"),disabled:e,children:[e&&a==="single"?m.jsx(Ko,{className:"h-4 w-4 mr-1 animate-spin"}):m.jsx(Iv,{className:"h-4 w-4 mr-1"}),"Importer 1 article"]}),m.jsx(Le,{onClick:()=>f("all"),disabled:e,children:e&&a==="all"?m.jsxs(m.Fragment,{children:[m.jsx(Ko,{className:"h-4 w-4 mr-1 animate-spin"}),i,"/",oo.length]}):m.jsxs(m.Fragment,{children:[m.jsx(Iv,{className:"h-4 w-4 mr-1"}),"Tout importer"]})})]})]}),(e||r.length>0)&&m.jsxs(m.Fragment,{children:[m.jsx(OR,{value:d,className:"h-2"}),m.jsx("p",{className:"text-xs text-muted-foreground",children:e?`Import en cours… ${i}/${oo.length}`:`Terminé — ${h} succès, ${p} erreurs`})]}),r.length>0&&m.jsx("div",{className:"max-h-64 overflow-y-auto space-y-1 text-sm",children:r.map((g,y)=>m.jsxs("div",{className:"flex items-start gap-2 py-1",children:[g.success?m.jsx(J4,{className:"h-4 w-4 text-green-600 mt-0.5 shrink-0"}):m.jsx(Q4,{className:"h-4 w-4 text-destructive mt-0.5 shrink-0"}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("p",{className:"truncate font-medium",children:g.title||g.url.split("/").filter(
358Boolean).pop()}),g.tag&&m.jsx("span",{className:"text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded",children:g.tag}),g.error&&m.jsx("p",{className:"text-destructive text-xs",children:g.error})]})]},y))})]})}var RR={exports:{}},PR={};/**
359 * @license React
360 * use-sync-external-store-shim.production.js
361 *
362 * Copyright (c) Meta Platforms, Inc. and affiliates.
363 *
364 * This source code is licensed under the MIT license found in the
365 * LICENSE file in the root directory of this source tree.
366 */var $l=x;function JH(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var QH=typeof Object.is=="function"?Object.is:JH,ZH=$l.useState,YH=$l.useEffect,XH=$l.useLayoutEffect,eW=$l.useDebugValue;function tW(t,e){var n=e(),r=ZH({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return XH(function(){s.value=n,s.getSnapshot=e,Ug(s)&&i({inst:s})},[t,n,e]),YH(function(){return Ug(s)&&i({inst:s}),t(function(){Ug(s)&&i({inst:s})})},[t]),eW(n),n}function Ug(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!QH(t,n)}catch{return!0}}function nW(t,e){return e()}var rW=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?nW:tW;PR.useSyncExternalStore=$l.useSyncExternalStore!==void 0?$l.useSyncExternalStore:rW;RR.exports=PR;var gw=RR.exports;function Ft(t){this.content=t}Ft.prototype={constructor:Ft,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 Ft(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 Ft(n)},addToStart:function(t,e){return new Ft([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ft(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 Ft(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=Ft.from(t),t.size?new Ft(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ft.from(t),t.size?new Ft(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ft.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}};Ft.from=function(t){if(t instanceof Ft)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ft(e)};function IR(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=IR(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function jR(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),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;c<u&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let c=jR(o.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class F{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 l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,s+a,i||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,s+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";
vendor: 4,320 bytes, line 366
366a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},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]);return new F(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],l=o+a.nodeSize;l>e&&((o<e||l>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=l}return new F(r,s)}cutByIndex(e,n){return e==n?F.empty:e==0&&n==this.content.length?this:new F(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 F(s,i)}addToStart(e){return new F([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new F(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 IR(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return jR(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 F.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new F(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return F.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 F(n||e,r)}static from(e){if(!e)return F.empty;if(e instanceof F)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new F([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}F.empty=new F([],0);const Vg={index:0,offset:0};function ff(t,e){return Vg.index=t,Vg.offset=e,Vg}function Wh(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(!Wh(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Wh(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ze=class r0{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&&Wh(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;
vendor: 6,775 bytes, line 366
366if(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 r0.none;if(e instanceof r0)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};ze.none=[];class qh extends Error{}class X{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=LR(this.content,e+this.openStart,n);return r&&new X(r,this.openStart,this.openEnd)}removeBetween(e,n){return new X(MR(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 X.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 X(F.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 X(e,r,s)}}X.empty=new X(F.empty,0,0);function MR(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(MR(i.content,e-s-1,n-s-1)))}function LR(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=LR(o.content,e-i-1,n,o);return a&&t.replaceChild(s,o.copy(a))}function sW(t,e,n){if(n.openStart>t.depth)throw new qh("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new qh("Inconsistent open depths");return DR(t,e,n,0)}function DR(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=DR(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 Lo(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=iW(n,t);return Lo(i,FR(t,o,a,e,r))}else return Lo(i,Kh(t,e,r))}function $R(t,e){if(!e.type.compatibleContent(t.type))throw new qh("Cannot join "+e.type.name+" onto "+t.type.name)}function s0(t,e,n){let r=t.node(n);return $R(r,e.node(n)),r}function Mo(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 Xc(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&&(Mo(t.nodeAfter,r),i++));for(let a=i;a<o;a++)Mo(s.child(a),r);e&&e.depth==n&&e.textOffset&&Mo(e.nodeBefore,r)}function Lo(t,e){return t.type.checkContent(e),t.copy(e)}function FR(t,e,n,r,s){let i=t.depth>s&&s0(t,e,s+1),o=r.depth>s&&s0(n,r,s+1),a=[];return Xc(null,t,s,a),i&&o&&e.index(s)==n.index(s)?($R(i,o),Mo(Lo(i,FR(t,e,n,r,s+1)),a)):(i&&Mo(Lo(i,Kh(t,e,s+1)),a),Xc(e,n,s,a),o&&Mo(Lo(o,Kh(n,r,s+1)),a)),Xc(r,null,s,a),new F(a)}function Kh(t,e,n){let r=[];if(Xc(null,t,n,r),t.depth>n){let s=s0(t,e,n+1);Mo(Lo(s,Kh(t,e,n+1)),r)}return Xc(e,null,n,r),new F(r)}function iW(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(F.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class Wu{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 ze.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 Gh(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:l}=o.content.findIndex(i),c=i-l;if(r.push(o,a,s+l),!c||(o=o.child(a),o.isText))break;i=c-1,s+=l+1}return new Wu(n,r,i)}
vendor: 4,381 bytes, line 366
366static resolveCached(e,n){let r=NS.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 NS.set(e,r=new oW);let s=r.elts[r.i]=Wu.resolve(e,n);return r.i=(r.i+1)%aW,s}}class oW{constructor(){this.elts=[],this.i=0}}const aW=12,NS=new WeakMap;class Gh{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 lW=Object.create(null);let Mi=class i0{constructor(e,n,r,s=ze.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||F.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&&Wh(this.attrs,n||e.defaultAttrs||lW)&&ze.sameSet(this.marks,r||ze.none)}copy(e=null){return e==this.content?this:new i0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new i0(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 X.empty;let s=this.resolve(e),i=this.resolve(n),o=r?0:s.sharedDepth(n),a=s.start(o),c=s.node(o).content.cut(s.pos-a,i.pos-a);return new X(c,s.depth-o,i.depth-o)}replace(e,n,r){return sW(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 Wu.resolveCached(this,e)}resolveNoCache(e){return Wu.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()+")"),BR(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=F.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 l=s;l<i;l++)if(!this.type.allowsMarks(r.child(l).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=ze.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(!ze.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}
366`);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=F.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};Mi.prototype.text=void 0;class Jh extends Mi{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):BR(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 Jh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Jh(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 BR(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Zo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new cW(e,n);if(r.next==null)return Zo.empty;let s=zR(r);r.next&&r.err("Unexpected trailing text");let i=gW(mW(s));return yW(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 l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return F.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,a.concat(u));if(f)return f}}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:l}=i.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!s.type||l.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(`
367`)}}Zo.empty=new Zo(!0);class cW{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 zR(t){let e=[];do e.push(uW(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function uW(t){let e=[];do e.push(dW(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function dW(t){let e=pW(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=fW(t,e);else break;return e}function OS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");
vendor: 4,721 bytes, line 367
367let e=Number(t.next);return t.pos++,e}function fW(t,e){let n=OS(t),r=n;return t.eat(",")&&(t.next!="}"?r=OS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function hW(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 pW(t){if(t.eat("(")){let e=zR(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=hW(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 mW(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function s(o,a){o.forEach(l=>l.to=a)}function i(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=i(o.exprs[l],a);if(l==o.exprs.length-1)return c;s(c,a=n())}else if(o.type=="star"){let l=n();return r(a,l),s(i(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return s(i(o.expr,a),l),s(i(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(i(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let u=n();s(i(o.expr,l),u),l=u}if(o.max==-1)s(i(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let u=n();r(l,u),s(i(o.expr,l),u),l=u}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function UR(t,e){return e-t}function RS(t,e){let n=[];return r(e),n.sort(UR);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:l}=i[o];!a&&n.indexOf(l)==-1&&r(l)}}}function gW(t){let e=Object.create(null);return n(RS(t,0));function n(r){let s=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<s.length;u++)s[u][0]==a&&(c=s[u][1]);RS(t,l).forEach(u=>{c||s.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Zo(r.indexOf(t.length-1)>-1);for(let o=0;o<s.length;o++){let a=s[o][1].sort(UR);i.next.push({type:s[o][0],next:e[a.join(",")]||n(a)})}return i}}function yW(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:l,next:c}=s.next[a];o.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function VR(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 HR(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 WR(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 qR(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new bW(t,r,e[r]);return n}let PS=class KR{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=qR(e,r.attrs),this.defaultAttrs=VR(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==Zo.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:HR(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mi(this,this.computeAttrs(e),F.from(n),ze.setFrom(r))}createChecked(e=null,n,r){return n=F.from(n),this.checkContent(n),new Mi(this,this.computeAttrs(e),n,ze.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=F.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(F.empty,!0);return i?new Mi(this,e,n.append(i),ze.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);
vendor: 10,483 bytes, lines 367-369
367if(!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){WR(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:ze.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,o)=>r[i]=new KR(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 vW(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 bW{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?vW(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class wm{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=qR(e,s.attrs),this.excluded=null;let i=VR(this.attrs);this.instance=i?new ze(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ze(this,HR(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new wm(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){WR(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class GR{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=Ft.from(e.nodes),n.marks=Ft.from(e.marks||{}),this.nodes=PS.compile(this.spec.nodes,this),this.marks=wm.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]=Zo.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?IS(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==""?[]:IS(this,o.split(" "))}this.nodeFromJSON=s=>Mi.fromJSON(this,s),this.markFromJSON=s=>ze.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 PS){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 Jh(r,r.defaultAttrs,e,ze.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 IS(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 l=t.marks[a];(s=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(s)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function wW(t){return t.tag!=null}function xW(t){return t.style!=null}class Li{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(wW(s))this.tags.push(s);else if(xW(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 MS(this,n,!1);return r.addAll(e,ze.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new MS(this,n,!0);return r.addAll(e,ze.none,n.from,n.to),X.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(EW(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 l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||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=LS(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=LS(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Li(e,Li.schemaRules(e)))}}const JR={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},kW={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},QR={ol:!0,ul:!0},qu=1,o0=2,eu=4;function jS(t,e,n){return e!=null?(e?qu:0)|(e==="full"?o0:0):t&&t.whitespace=="pre"?qu|o0:n&~eu}class hf{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=ze.none,this.match=i||(o&eu?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(F.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&qu)){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=F.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(F.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&&!JR.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class MS{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=jS(null,n.preserveWhitespace,0)|(r?eu:0);s?i=new hf(s.type,s.attrs,ze.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new hf(null,null,ze.none,!0,null,o):i=new hf(e.schema.topNodeType,null,ze.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&o0?"full":this.localPreserveWS||(s.options&qu)>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,`
368`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));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],l=e.previousSibling;(!a||l&&l.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;QR.hasOwnProperty(o)&&this.parser.normalizeLists&&SW(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:kW.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(JR.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.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(`
369`),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 l=this.parser.matchStyle(i,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,s){let i,o;
vendor: 4,119 bytes, line 369
369if(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 l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.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(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!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 l=this.nodes[o],c=l.findWrapping(e);if(c&&(!s||s.length>c.length+a)&&(s=c,i=l,!c.length))break;if(l.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=ze.none;for(let a of s.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):DS(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=jS(e,i,o.options);o.options&eu&&o.content.length==0&&(a|=eu);let l=ze.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):DS(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new hf(e,n,l,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|=qu)}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,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&s?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}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;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];
vendor: 9,666 bytes, line 369
369if(r.isTextblock&&r.defaultAttrs)return r}}}function SW(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&QR.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function EW(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function LS(t){let e={};for(let n in t)e[n]=t[n];return e}function DS(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 l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class ca{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Hg(n).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let a=0,l=0;for(;a<i.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)s=i.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,n);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:s}=qf(Hg(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&&qf(Hg(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return qf(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ca(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=$S(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return $S(e.marks)}}function $S(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Hg(t){return t.document||window.document}const FS=new WeakMap;function CW(t){let e=FS.get(t);return e===void 0&&FS.set(t,e=_W(t)),e}function _W(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 qf(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=CW(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,l=n?t.createElementNS(n,s):t.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=qf(t,f,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const ZR=65535,YR=Math.pow(2,16);function TW(t,e){return t+e*YR}function BS(t){return t&ZR}function AW(t){return(t-(t&ZR))/YR}const XR=1,eP=2,Kf=4,tP=8;class a0{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&tP)>0}get deletedBefore(){return(this.delInfo&(XR|Kf))>0}get deletedAfter(){return(this.delInfo&(eP|Kf))>0}get deletedAcross(){return(this.delInfo&Kf)>0}}class On{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&On.empty)return On.empty}recover(e){let n=0,r=BS(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+AW(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 l=this.ranges[a]-(this.inverted?s:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+o],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,h=l+s+(f<0?0:u);if(r)return h;let p=e==(n<0?l:d)?null:TW(a/3,e-l),g=e==l?eP:e==d?XR:Kf;return(n<0?e!=l:e!=d)&&(g|=tP),new a0(h,g,p)}s+=u-c}return r?e+s:new a0(e+s,0,null)}touches(e,n){let r=0,s=BS(n),i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==s*3)return!0;r+=this.ranges[a+o]-c}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),l=o+(this.inverted?0:i),c=this.ranges[s+n],u=this.ranges[s+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new On(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?On.empty:new On(e<0?[0,-e,0]:[0,0,e])}}On.empty=new On([]);class Ku{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 Ku(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 Ku;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 l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return r?e:new a0(e,s,null)}}const Wg=Object.create(null);class en{getMap(){return On.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Wg[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 Wg)throw new RangeError("Duplicate use of step JSON ID "+e);return Wg[e]=n,n.prototype.jsonID=e,n}}class yt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new yt(e,null)}static fail(e){return new yt(null,e)}static fromReplace(e,n,r,s){try{return yt.ok(e.replace(n,r,s))}catch(i){if(i instanceof qh)return yt.fail(i.message);throw i}}}function yw(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(yw(i.content,e,i))),i.isInline&&(i=e(i,n,s)),r.push(i)}return F.fromArray(r)}class wi extends en{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 X(yw(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 yt.fromReplace(e,this.from,this.to,i)}invert(){return new Sr(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 wi(n.pos,r.pos,this.mark)}merge(e){return e instanceof wi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wi(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 wi(n.from,n.to,e.markFromJSON(n.mark))}}en.jsonID("addMark",wi);class Sr extends en{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 X(yw(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return yt.fromReplace(e,this.from,this.to,r)}invert(){return new wi(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 Sr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Sr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Sr(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 Sr(n.from,n.to,e.markFromJSON(n.mark))}}en.jsonID("removeMark",Sr);class xi extends en{constructor(e,n){super(),this.pos=e,this.mark=n}
vendor: 5,576 bytes, line 369
369apply(e){let n=e.nodeAt(this.pos);if(!n)return yt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return yt.fromReplace(e,this.pos,this.pos+1,new X(F.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 xi(this.pos,n.marks[s]);return new xi(this.pos,this.mark)}}return new Yo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new xi(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 xi(n.pos,e.markFromJSON(n.mark))}}en.jsonID("addNodeMark",xi);class Yo extends en{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return yt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return yt.fromReplace(e,this.pos,this.pos+1,new X(F.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new xi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yo(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 Yo(n.pos,e.markFromJSON(n.mark))}}en.jsonID("removeNodeMark",Yo);class Ot extends en{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&l0(e,this.from,this.to)?yt.fail("Structure replace would overwrite content"):yt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new On([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ot(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 Ot(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ot)||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?X.empty:new X(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ot(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?X.empty:new X(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ot(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 Ot(n.from,n.to,X.fromJSON(e,n.slice),!!n.structure)}}en.jsonID("replace",Ot);class It extends en{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&&(l0(e,this.from,this.gapFrom)||l0(e,this.gapTo,this.to)))return yt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return yt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?yt.fromReplace(e,this.from,this.to,r):yt.fail("Content does not fit in gap")}getMap(){return new On([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 It(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 It(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 It(n.from,n.to,n.gapFrom,n.gapTo,X.fromJSON(e,n.slice),n.insert,!!n.structure)}}en.jsonID("replaceAround",It);function l0(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 NW(t,e,n,r){let s=[],i=[],o,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:s.push(o=new Sr(f,h,d[g])));a&&a.to==f?a.to=h:i.push(a=new wi(f,h,r))}}
vendor: 7,411 bytes, lines 369-370
369),s.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function OW(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;i++;let l=null;if(r instanceof wm){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(a,e),to:c,step:i})}}}),s.forEach(o=>t.step(new Sr(o.from,o.to,o.style)))}function vw(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new Ot(a,u,X.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new Sr(a,u,c.marks[f]));if(s&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new X(F.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new Ot(a+f.index,a+f.index+f[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(F.empty,!0);t.replace(a,a,new X(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function RW(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function rc(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,l=t.$to.indexAfter(r)-i;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!RW(o,a,l))break;a&&(s=1),l<o.childCount&&(i=1)}return null}function PW(t,e,n){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),a=s.after(i+1),l=o,c=a,u=F.empty,d=0;for(let p=i,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=F.from(r.node(p).copy(u)),d++):l--;let f=F.empty,h=0;for(let p=i,g=!1;p>n;p--)g||s.after(p+1)<s.end(p)?(g=!0,f=F.from(s.node(p).copy(f)),h++):c++;t.step(new It(l,c,o,a,new X(u.append(f),d,h),u.size-d,!0))}function bw(t,e,n=null,r=t){let s=IW(t,e),i=s&&jW(r,e);return i?s.map(zS).concat({type:e,attrs:n}).concat(i.map(zS)):null}function zS(t){return{type:t,attrs:null}}function IW(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 jW(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 l=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;l&&c<s;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:o}function MW(t,e,n){let r=F.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=F.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new It(s,i,s,i,new X(r,0,0),n.length,!0))}function LW(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 l=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,l)&&DW(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&rP(t,o,a,i),vw(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),f=u.map(a+o.nodeSize,1);return t.step(new It(d,f,d+1,f-1,new X(F.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&nP(t,o,a,i),!1}})}function nP(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 l=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function rP(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(`
370`))}})}function DW(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function $W(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 It(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new X(F.from(o),0,0),1,!0))}function cl(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 c=s.depth-1,u=n-2;c>i;c--,u--){let d=s.node(c),f=s.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let a=s.indexAfter(i),l=r&&r[0];return s.node(i).canReplaceWith(a,a,l?l.type:s.node(i+1).type)}function FW(t,e,n=1,r){let s=t.doc.resolve(e),i=F.empty,o=F.empty;for(let a=s.depth,l=s.depth-n,c=n-1;a>l;a--,c--){i=F.from(s.node(a).copy(i));let u=r&&r[c];o=F.from(u?u.type.create(u.attrs,o):s.node(a).copy(o))}t.step(new Ot(e,e,new X(i.append(o),n,n),!0))}function Yi(t,e){let n=t.resolve(e),r=n.index();return sP(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function BW(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 sP(t,e){return!!(t&&e&&!t.isLeaf&&BW(t,e))}function xm(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&&sP(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 zW(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 u=o.whitespace=="pre",d=!!o.contentMatch.matchType(s);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);rP(t,u.node(),u.before(),a)}o.inlineContent&&vw(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Ot(c,l.map(e+n,-1),X.empty,!0)),r===!0){let u=t.doc.resolve(c);nP(t,u.node(),u.before(),t.steps.length)}return t}function UW(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 iP(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,l=r.
vendor: 9,618 bytes, line 370
370index(o)+(a>0?1:0),c=r.node(o),u=!1;if(i==1)u=c.canReplace(l,l,s);else{let d=c.contentMatchAt(l).findWrapping(s.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function km(t,e,n=e,r=X.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return oP(s,i,r)?new Ot(e,n,r):new VW(s,i,r).fit()}function oP(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class VW{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=F.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=F.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):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 l=new X(i,o,a);return e>-1?new It(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ot(r.pos,s.pos,l):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=qg(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:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(o?c.matchType(o.type)||(d=c.fillBefore(F.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=qg(e,n);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new X(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=qg(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new X(Rc(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new X(Rc(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 g=0;g<i.length;g++)this.openFrontierNode(i[g]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(s){for(let g=0;g<s.childCount;g++)u.push(s.child(g));d=d.matchFragment(s)}let h=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let g=a.child(c),y=d.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(d=y,u.push(aP(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=Pc(this.placed,n,F.from(u)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<h;g++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=v.content}this.unplaced=p?e==0?X.empty:new X(Rc(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new X(Rc(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Kg(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=Kg(e,n,s,r,i);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Kg(e,a,c,l,!0);if(!u||u.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=Pc(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=Pc(this.placed,this.depth,F.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(F.empty,!0);n.childCount&&(this.placed=Pc(this.placed,this.frontier.length,n))}}function Rc(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Rc(t.firstChild.content,e-1,n)))}function Pc(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Pc(t.lastChild.content,e-1,n)))}function qg(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function aP(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,aP(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(F.empty,!0)))),t.copy(r)}function Kg(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&&!HW(n,i.content,o)?a:null}function HW(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function WW(t){return t.spec.defining||t.spec.definingForContent}function qW(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),i=t.doc.resolve(n);if(oP(s,i,r))return t.step(new Ot(e,n,r));let o=cP(s,i);o[o.length-1]==0&&o.pop();let a=-(s.depth+1);o.unshift(a);for(let f=s.depth,h=s.pos-1;f>0;f--,h--){let p=s.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(f)>-1?a=f:s.before(f)==h&&o.splice(1,0,-f)}let l=o.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f],p=WW(h.type);if(p&&!h.sameMarkup(s.node(Math.abs(a)-1)))u=f;else if(p||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let g=0;g<o.length;g++){let y=o[(g+l)%o.length],v=!0;y<0&&(v=!1,y=-y);let b=s.node(y-1),w=s.index(y-1);if(b.canReplaceWith(w,w,p.type,p.marks))return t.replace(s.before(y),v?i.after(y):n,new X(lP(r.content,0,r.openStart,h),h,r.openEnd))}}let d=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let h=o[f];h<0||(e=s.before(h),n=i.after(h))}}function lP(t,e,n,r,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(lP(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(F.empty,!0))}return t}function KW(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=UW(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new X(F.from(r),0,0))}function GW(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n),i=cP(r,s);for(let o=0;o<i.length;o++){let a=i[o],l=o==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),s.end(a));if(a>0&&(l||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 cP(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 ul extends en{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 yt.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 yt.fromReplace(e,this.pos,this.pos+1,new X(F.from(s),0,n.isLeaf?0:1))}getMap(){return On.empty}invert(e){return new ul(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 ul(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 ul(n.pos,n.attr,n.value)}}en.jsonID("attr",ul);class Gu extends en{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 yt.ok(r)}getMap(){return On.empty}invert(e){return new Gu(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 Gu(n.attr,n.value)}}en.jsonID("docAttr",Gu);
vendor: 4,279 bytes, line 370
370let Fl=class extends Error{};Fl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Fl.prototype=Object.create(Error.prototype);Fl.prototype.constructor=Fl;Fl.prototype.name="TransformError";class uP{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ku}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Fl(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,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}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=X.empty){let s=km(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new X(F.from(r),0,0))}delete(e,n){return this.replace(e,n,X.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return qW(this,e,n,r),this}replaceRangeWith(e,n,r){return KW(this,e,n,r),this}deleteRange(e,n){return GW(this,e,n),this}lift(e,n){return PW(this,e,n),this}join(e,n=1){return zW(this,e,n),this}wrap(e,n){return MW(this,e,n),this}setBlockType(e,n=e,r,s=null){return LW(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return $W(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new ul(e,n,r)),this}setDocAttribute(e,n){return this.step(new Gu(e,n)),this}addNodeMark(e,n){return this.step(new xi(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof ze)n.isInSet(r.marks)&&this.step(new Yo(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new Yo(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 FW(this,e,n,r),this}addMark(e,n,r){return NW(this,e,n,r),this}removeMark(e,n,r){return OW(this,e,n,r),this}clearIncompatible(e,n,r){return vw(this,e,n,r),this}}const Gg=Object.create(null);class ke{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new JW(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=X.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:l,$to:c}=o[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?X.empty:n),a==0&&HS(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],l=e.mapping.slice(r),c=l.map(o.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),HS(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let s=e.parent.inlineContent?new me(e):Ia(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?Ia(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Ia(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 Yn(e.node(0))}static atStart(e){return Ia(e,e,0,0,1)||new Yn(e)}static atEnd(e){return Ia(e,e,e.content.size,e.childCount,-1)||new Yn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Gg[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 Gg)throw new RangeError("Duplicate use of selection JSON ID "+e);return Gg[e]=n,n.prototype.jsonID=e,n}getBookmark(){return me.between(this.$anchor,this.$head).getBookmark()}}ke.prototype.visible=!0;class JW{constructor(e,n){this.$from=e,this.$to=n}}let US=!1;function VS(t){!US&&!t.parent.inlineContent&&(US=!0,console.warn("TextSelection endpoint not pointing into a 
370node with inline content ("+t.parent.type.name+")"))}class me extends ke{constructor(e,n=e){VS(e),VS(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 ke.near(r);let s=e.resolve(n.map(this.anchor));return new me(s.parent.inlineContent?s:r,r)}replace(e,n=X.empty){if(super.replace(e,n),n==X.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 Sm(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=ke.findFrom(n,r,!0)||ke.findFrom(n,-r,!0);if(i)n=i.$head;else return ke.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(ke.findFrom(e,-r,!0)||ke.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=s<0&&(e=n))),new me(e,n)}}ke.jsonID("text",me);class Sm{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Sm(e.map(this.anchor),e.map(this.head))}resolve(e){return me.between(e.resolve(this.anchor),e.resolve(this.head))}}class ue extends ke{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?ke.near(i):new ue(i)}content(){return new X(F.from(this.node),0,0)}eq(e){return e instanceof ue&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ww(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ue(e.resolve(n.anchor))}static create(e,n){return new ue(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ue.prototype.visible=!1;ke.jsonID("node",ue);class ww{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Sm(r,r):new ww(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ue.isSelectable(r)?new ue(n):ke.near(n)}}class Yn extends ke{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=X.empty){if(n==X.empty){e.delete(0,e.doc.content.size);let r=ke.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Yn(e)}map(e){return new Yn(e)}eq(e){return e instanceof Yn}getBookmark(){return QW}}ke.jsonID("all",Yn);const QW={map(){return this},resolve(t){return new Yn(t)}};function Ia(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&&ue.isSelectable(a))return ue.create(t,n-(s<0?a.nodeSize:0))}else{let l=Ia(t,a,n+s,s<0?a.childCount:0,s,i);if(l)return l}n+=a.nodeSize*s}return null}function HS(t,e,n){let r=t.steps.length-1;if(r<e)return;let s=t.steps[r];if(!(s instanceof Ot||s instanceof It))return;let i=t.mapping.maps[r],o;i.forEach((a,l,c,u)=>{o==null&&(o=u)}),t.setSelection(ke.near(t.doc.resolve(o),n))}const WS=1,pf=2,qS=4;class ZW extends uP{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|WS)&~pf,this.storedMarks=null,this}get selectionSet(){return(this.updated&WS)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=pf,this}ensureMarks(e){return ze.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&pf)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~pf,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)||ze.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(ke.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|=qS,this}get scrolledIntoView(){return(this.updated&qS)>0}}function KS(t,e){return!e||!t?t:t.bind(e)}class Ic{constructor(e,n,r){this.name=e,this.init=KS(n.init,r),this.apply=KS(n.apply,r)}}const YW=[new Ic("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ic("selection",{init(t,e){return t.selection||ke.atStart(e.doc)},apply(t){return t.selection}}),new Ic("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ic("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];
vendor: 14,565 bytes, lines 370-371
370class Jg{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=YW.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 Ic(r.key,r.spec.state,r))})}}class Qa{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,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 l=s?s[o].n:0,c=s?s[o].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!s){s=[];for(let d=0;d<this.config.plugins.length;d++)s.push(d<o?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),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 Qa(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 ZW(this)}static create(e){let n=new Jg(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Qa(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 Jg(this.schema,e.plugins),r=n.fields,s=new Qa(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 Jg(e.schema,e.plugins),i=new Qa(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Mi.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=ke.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 l=r[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[o.name]=c.fromJSON.call(l,e,n[a],i);return}}i[o.name]=o.init(e,i)}}),i}}function dP(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=dP(s,e,{})),n[r]=s}return n}class rt{constructor(e){this.spec=e,this.props={},e.props&&dP(e.props,this,this.props),this.key=e.key?e.key.key:fP("plugin")}getState(e){return e[this.key]}}const Qg=Object.create(null);function fP(t){return t in Qg?t+"$"+ ++Qg[t]:(Qg[t]=0,t+"$")}class _t{constructor(e="key"){this.key=fP(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const XW=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function hP(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const e9=(t,e,n)=>{let r=hP(t,n);if(!r)return!1;let s=xw(r);if(!s){let o=r.blockRange(),a=o&&rc(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let i=s.nodeBefore;if(yP(t,s,e,-1))return!0;if(r.parent.content.size==0&&(Bl(i,"end")||ue.isSelectable(i)))for(let o=r.depth;;o--){let a=km(t.doc,r.before(o),r.after(o),X.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Bl(i,"end")?ke.findFrom(l.doc.resolve(l.mapping.map(s.pos,-1)),-1):ue.create(l.doc,s.pos-i.nodeSize)),e(l.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},t9=(t,e,n)=>{let r=hP(t,n);if(!r)return!1;let s=xw(r);return s?pP(t,s,e):!1},n9=(t,e,n)=>{let r=mP(t,n);if(!r)return!1;let s=kw(r);return s?pP(t,s,e):!1};function pP(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 u=s.lastChild;if(!u)return!1;s=u}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=km(t.doc,i,l,X.empty);if(!c||c.from!=i||c instanceof Ot&&c.slice.size>=l-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(me.create(u.doc,i)),n(u.scrollIntoView())}return!0}function Bl(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 r9=(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=xw(r)}let o=i&&i.nodeBefore;return!o||!ue.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ue.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function xw(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 mP(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const s9=(t,e,n)=>{let r=mP(t,n);if(!r)return!1;let s=kw(r);if(!s)return!1;let i=s.nodeAfter;if(yP(t,s,e,1))return!0;if(r.parent.content.size==0&&(Bl(i,"start")||ue.isSelectable(i))){let o=km(t.doc,r.before(),r.after(),X.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(Bl(i,"start")?ke.findFrom(a.doc.resolve(a.mapping.map(s.pos)),1):ue.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},i9=(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=kw(r)}let o=i&&i.nodeAfter;return!o||!ue.isSelectable(o)?!1:(e&&e(t.tr.setSelection(ue.create(t.doc,i.pos)).scrollIntoView()),!0)};function kw(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 o9=(t,e)=>{let n=t.selection,r=n instanceof ue,s;if(r){if(n.node.isTextblock||!Yi(t.doc,n.from))return!1;s=n.from}else if(s=xm(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(ue.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},a9=(t,e)=>{let n=t.selection,r;if(n instanceof ue){if(n.node.isTextblock||!Yi(t.doc,n.to))return!1;r=n.to}else if(r=xm(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},l9=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&rc(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},c9=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
371`).scrollIntoView()),!0)};function gP(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 u9=(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=gP(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(ke.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},d9=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof Yn||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=gP(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},f9=(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(cl(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&rc(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)},h9=(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(ue.create(t.doc,s))),!0)};function p9(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||Yi(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function yP(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,a,l=s.type.spec.isolating||i.type.spec.isolating;if(!l&&p9(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(a=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,p=F.empty;for(let v=o.length-1;v>=0;v--)p=F.from(o[v].create(null,p));p=F.from(s.copy(p));let g=t.tr.step(new It(e.pos-1,h,e.pos,h,new X(p,1,0),o.length,!0)),y=g.doc.resolve(h+2*o.length);y.nodeAfter&&y.nodeAfter.type==s.type&&Yi(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:ke.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&rc(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&Bl(i,"start",!0)&&Bl(s,"end")){let h=s,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=i,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let v=F.empty;for(let w=p.length-1;w>=0;w--)v=F.from(p[w].copy(v));let b=t.tr.step(new It(e.pos-p.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new X(v,p.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function vP(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 m9=vP(-1),g9=vP(1);function y9(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),a=o&&bw(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function GS(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,(l,c)=>{if(s)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)s=!0;else{let u=n.doc.resolve(c),d=u.index();s=u.parent.canReplaceWith(d,d+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:l}}=n.selection.ranges[o];i.setBlockType(a,l,t,e)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function v9(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 b9(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function b9(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 l=o.resolve(e.start-2);i=new Gh(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Gh(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let a=bw(i,n,r,e);return a?(t&&w9(t,e,a,s,n),!0):!1}function w9(t,e,n,r,s){let i=F.empty;for(let u=n.length-1;u>=0;u--)i=F.from(n[u].type.create(n[u].attrs,i));t.step(new It(e.start-(r?2:0),e.end,e.start,e.end,new X(i,0,0),n.length,!0));let o=0;for(let u=0;u<n.length;u++)n[u].type==s&&(o=u+1);let a=n.length-o,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&cl(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function x9(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?k9(e,n,t,i):S9(e,n,i):!0:!1}}function k9(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);i<o&&(s.step(new It(i-1,o,i,o,new X(F.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Gh(s.doc.resolve(r.$from.pos),s.doc.resolve(o),r.depth));const a=rc(r);if(a==null)return!1;s.lift(r,a);let l=s.doc.resolve(s.mapping.map(i,-1)-1);return Yi(s.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&s.join(l.pos),e(s.scrollIntoView()),!0}function S9(t,e,n){let r=t.tr,s=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=s.child(p).nodeSize,r.delete(h-1,h+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,l=n.endIndex==s.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,o.content.append(l?F.empty:F.from(s))))return!1;let d=i.pos,f=d+o.nodeSize;return r.step(new It(d-(a?1:0),f+(l?1:0),d+1,f-1,new X((a?F.empty:F.from(s.copy(F.empty))).append(l?F.empty:F.from(s.copy(F.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function E9(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let a=i.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=F.from(c?t.create():null),d=new X(F.from(t.create(null,F.from(a.type.create(null,u)))),c?3:1,0),f=i.start,h=i.end;n(e.tr.step(new It(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}const zt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},zl=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let c0=null;const bs=function(t,e,n){let r=c0||(c0=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},C9=function(){c0=null},Xo=function(t,e,n,r){return n&&(JS(t,e,n,r,-1)||JS(t,e,n,r,1))},_9=/^(img|br|input|textarea|hr)$/i;function JS(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;
vendor: 6,613 bytes, line 371
371if(e==(s<0?0:Kn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Ed(t)||_9.test(t.nodeName)||t.contentEditable=="false")return!1;e=zt(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?Kn(t):0}else return!1}}function Kn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function T9(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=Kn(t)}else if(t.parentNode&&!Ed(t))e=zt(t),t=t.parentNode;else return null}}function A9(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&&!Ed(t))e=zt(t)+1,t=t.parentNode;else return null}}function N9(t,e,n){for(let r=e==0,s=e==Kn(t);r||s;){if(t==n)return!0;let i=zt(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,s=s&&i==Kn(t)}}function Ed(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 Em=function(t){return t.focusNode&&Xo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function po(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function O9(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function R9(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Kn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Kn(r.startContainer),r.startOffset)}}}const Xr=typeof navigator<"u"?navigator:null,QS=typeof document<"u"?document:null,Xi=Xr&&Xr.userAgent||"",u0=/Edge\/(\d+)/.exec(Xi),bP=/MSIE \d/.exec(Xi),d0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xi),En=!!(bP||d0||u0),Di=bP?document.documentMode:d0?+d0[1]:u0?+u0[1]:0,Xn=!En&&/gecko\/(\d+)/i.test(Xi);Xn&&+(/Firefox\/(\d+)/.exec(Xi)||[0,0])[1];const f0=!En&&/Chrome\/(\d+)/.exec(Xi),Vt=!!f0,wP=f0?+f0[1]:0,Xt=!En&&!!Xr&&/Apple Computer/.test(Xr.vendor),Ul=Xt&&(/Mobile\/\w+/.test(Xi)||!!Xr&&Xr.maxTouchPoints>2),Hn=Ul||(Xr?/Mac/.test(Xr.platform):!1),xP=Xr?/Win/.test(Xr.platform):!1,Cs=/Android \d/.test(Xi),Cd=!!QS&&"webkitFontSmoothing"in QS.documentElement.style,P9=Cd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function I9(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 fs(t,e){return typeof t=="number"?t:t[e]}function j9(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 ZS(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=zl(o);continue}let a=o,l=a==i.body,c=l?I9(i):j9(a),u=0,d=0;if(e.top<c.top+fs(r,"top")?d=-(c.top-e.top+fs(s,"top")):e.bottom>c.bottom-fs(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+fs(s,"top")-c.top:e.bottom-c.bottom+fs(s,"bottom")),e.left<c.left+fs(r,"left")?u=-(c.left-e.left+fs(s,"left")):e.right>c.right-fs(r,"right")&&(u=e.right-c.right+fs(s,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let h=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let g=a.scrollLeft-h,y=a.scrollTop-p;e={left:e.left-g,top:e.top-y,right:e.right-g,bottom:e.bottom-y}}let f=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:zl(o)}}function M9(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 l=a.getBoundingClientRect();if(l.top>=n-20){r=a,s=l.top;break}}return{refDOM:r,refTop:s,stack:kP(t.dom)}}function kP(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=zl(r));return e}function L9({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;SP(n,r==0?0:r-e)}function SP(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 Ca=null;function D9(t){if(t.setActive)return t.setActive();if(Ca)return t.focus(Ca);let e=kP(t);t.focus(Ca==null?{get preventScroll(){return Ca={preventScroll:!0},!0}}:void 0),Ca||(Ca=!1,SP(e,0))}function EP(t,e){let n,r=2e8,s,i=0,o=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=bs(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=o&&p.bottom>=a){o=Math.max(p.bottom,o),a=Math.min(p.top,a);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=u,r=g,s=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&g&&(i=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=d+1)}}return!n&&l&&(n=l,s=c,r=0),n&&n.nodeType==3?$9(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:EP(n,s)}function $9(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=Js(r,1);if(o.top!=o.bottom&&Sw(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 Sw(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function F9(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function B9(t,e,n){let{node:r,offset:s}=EP(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 z9(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>
vendor: 4,373 bytes, line 371
371r.top?s=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(s=a.posAfter),o=!0),!a.contentDOM&&s<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return s>-1?s:t.docView.posFromDOM(e,n,-1)}function CP(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 l=0;l<a.length;l++){let c=a[l];if(Sw(e,c))return CP(o,e,c)}}if((i=(i+1)%r)==s)break}return t}function U9(t,e){let n=t.dom.ownerDocument,r,s=0,i=R9(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 c=t.dom.getBoundingClientRect();if(!Sw(e,c)||(o=CP(t.dom,e,c),!o))return null}if(Xt)for(let c=o;r&&c;c=zl(c))c.draggable&&(r=void 0);if(o=F9(o,e),r){if(Xn&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let u=r.childNodes[s],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&s++}let c;Cd&&s&&r.nodeType==1&&(c=r.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.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=z9(t,r,s,e))}a==null&&(a=B9(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function YS(t){return t.top<t.bottom||t.left<t.right}function Js(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(YS(r))return r}return Array.prototype.find.call(n,YS)||t.getBoundingClientRect()}const V9=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _P(t,e,n){let{node:r,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),o=Cd||Xn;if(r.nodeType==3)if(o&&(V9.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let l=Js(bs(r,s,s),n);if(Xn&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let c=Js(bs(r,s-1,s-1),-1);if(c.top==l.top){let u=Js(bs(r,s,s+1),-1);if(u.top!=l.top)return bc(u,u.left<c.left)}}return l}else{let l=s,c=s,u=n<0?1:-1;return n<0&&!s?(c++,u=-1):n>=0&&s==r.nodeValue.length?(l--,u=1):n<0?l--:c++,bc(Js(bs(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Kn(r))){let l=r.childNodes[s-1];if(l.nodeType==1)return Zg(l.getBoundingClientRect(),!1)}if(i==null&&s<Kn(r)){let l=r.childNodes[s];if(l.nodeType==1)return Zg(l.getBoundingClientRect(),!0)}return Zg(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==Kn(r))){let l=r.childNodes[s-1],c=l.nodeType==3?bs(l,Kn(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return bc(Js(c,1),!1)}if(i==null&&s<Kn(r)){let l=r.childNodes[s];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?bs(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return bc(Js(c,-1),!0)}return bc(Js(r.nodeType==3?bs(r):r,-n),n>=0)}function bc(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 Zg(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 TP(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 H9(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return TP(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=_P(t,s.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=bs(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const W9=/[\u0590-\u08ac]/;function q9(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?!W9.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:o:TP(t,e,()=>
vendor: 7,093 bytes, lines 371-372
371{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),y=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let XS=null,eE=null,tE=!1;function K9(t,e,n){return XS==e&&eE==n?tE:(XS=e,eE=n,tE=n=="up"||n=="down"?H9(t,e,n):q9(t,e,n))}const er=0,nE=1,wo=2,es=3;class _d{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=er,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>zt(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 NP){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 AP&&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?zt(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?zt(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 l=this.children[a],c=o+l.size;if(s==-1&&e<=c){let u=o+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=o;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){s=zt(f.dom)+1;break}e-=f.size}s==-1&&(s=0)}if(s>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=zt(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=c}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 h=0,p=0;h<this.children.length;h++){let g=this.children[h],y=p+g.size;if(i>p&&o<y)return g.setSelection(e-p-g.border,n-p-g.border,r,s);p=y}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((Xn||Xt)&&e==n){let{node:h,offset:p}=a;if(h.nodeType==3){if(d=!!(p&&h.nodeValue[p-1]==`
372`),d&&p==h.nodeValue.length)for(let g=h,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:zt(y)+1});break}let v=g.pmViewDesc;if(v&&v.node&&v.node.isBlock)break}}else{let g=h.childNodes[p-1];d=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Xn&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(s=!0)}if(!(s||d&&Xt)&&Xo(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Xo(l.node,l.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(d&&Xn)){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(h)}}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,l=o-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?wo:nE,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=es:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?wo:es}r=o}this.dirty=wo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?wo:nE;n.dirty<r&&(n.dirty=r)}
vendor: 3,737 bytes, line 372
372}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class AP extends _d{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==er&&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 G9 extends _d{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 ea extends _d{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=ca.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ea(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&es||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=es&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=er){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=er}}slice(e,n,r){let s=ea.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;n<o&&(i=p0(i,n,o,r)),e>0&&(i=p0(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 $i extends _d{constructor(e,n,r,s,i,o,a,l,c){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],l,c=a&&a(n,i,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,s),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=ca.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=PP(u,r,n),c?l=new J9(e,n,r,s,u,d||null,f,c,i,o+1):n.isText?new Cm(e,n,r,s,u,f,i):new $i(e,n,r,s,u,d||null,f,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let 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=()=>F.empty)}return e}matchesNode(e,n,r){return this.dirty==er&&e.eq(this.node)&&Qh(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}
vendor: 12,370 bytes, line 372
372updateChildren(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,l=new Z9(this,o&&o.node,e);eq(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?ze.none:this.node.child(u).marks,r,e,u),l.placeWidget(c,e,s)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e,f);let h;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(h=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,h,e)||l.updateNextNode(c,u,d,e,f,s)||l.addNode(c,u,d,e,s),s+=c.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==wo)&&(o&&this.protectLocalComposition(e,o),OP(this.contentDOM,this.children,e),Ul&&tq(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=nq(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 G9(this,i,n,s);e.input.compositionNodes.push(o),this.children=p0(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==es||!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=er}updateOuterDeco(e){if(Qh(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=RP(this.dom,this.nodeDOM,h0(this.outerDeco,this.node,n),h0(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 rE(t,e,n,r,s){PP(r,e,t);let i=new $i(void 0,t,e,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class Cm extends $i{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==es||this.dirty!=er&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=er||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=er,!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 Cm(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=es)}get domAtom(){return!1}isText(e){return this.node.text==e}}class NP extends _d{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==er&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class J9 extends $i{constructor(e,n,r,s,i,o,a,l,c,u){super(e,n,r,s,i,o,a,c,u),this.spec=l}update(e,n,r,s){if(this.dirty==es)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()}setSelection(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 OP(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=sE(r),s=!0;r=r.nextSibling}else s=!0,t.insertBefore(a,r);if(o instanceof ea){let l=r?r.previousSibling:t.lastChild;OP(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=sE(r),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const tu=function(t){t&&(this.nodeName=t)};tu.prototype=Object.create(null);const xo=[new tu];function h0(t,e,n){if(t.length==0)return xo;let r=n?xo[0]:new tu,s=[r];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&s.push(r=new tu(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&s.length==1&&s.push(r=new tu(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return s}function RP(t,e,n,r){if(n==xo&&r==xo)return e;let s=e;for(let i=0;i<r.length;i++){let o=r[i],a=n[i];if(i){let l;a&&a.nodeName==o.nodeName&&s!=t&&(l=s.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(s),a=xo[0]),s=l}Q9(s,a||xo[0],o)}return s}function Q9(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 PP(t,e,n){return RP(t,t,xo,h0(e,n,t.nodeType!=1))}function Qh(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 sE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Z9{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Y9(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=er,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;s<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let d=this.top.children[u];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=u;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=ea.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,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,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){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==es&&o.dom==o.contentDOM&&(o.dirty=wo),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 l=this.top.children[a];if(l instanceof $i){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=es&&Qh(n,l.outerDeco));if(!f&&l.update(e,n,r,s))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,r,s,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=wo,d.updateChildren(s,o+1),d.dirty=er),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)||!Qh(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let a=$i.create(this.top,n,r,s,i,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,s,i){let o=$i.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 AP(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 ea;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Cm)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Xt||Vt)&&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 NP(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 Y9(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 c=n.children[r-1];if(c instanceof ea)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(s-1))break;--s,i.set(a,s),o.push(a)}}return{index:s,matched:i,matches:o.reverse()}}function X9(t,e){return t.type.side-e.type.side}function eq(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,s,e.forChild(i,u),c),i+=u.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let u,d;for(;o<s.length&&s[o].to==i;){let y=s[o++];y.widget&&(u?(d||(d=[u])).push(y):u=y)}if(u)if(d){d.sort(X9);for(let y=0;y<d.length;y++)n(d[y],c,!!l)}else n(u,c,!!l);let f,h;if(l)h=-1,f=l,l=null;else if(c<t.childCount)h=c,f=t.child(c++);else break;for(let y=0;y<a.length;y++)a[y].to<=i&&a.splice(y--,1);for(;o<s.length&&s[o].from<=i&&s[o].to>i;)a.push(s[o++]);let p=i+f.nodeSize;if(f.isText){let y=p;o<s.length&&s[o].from<y&&(y=s[o].from);for(let v=0;v<a.length;v++)a[v].to<y&&(y=a[v].to);y<p&&(l=f.cut(y-i),f=f.cut(0,y-i),p=y,h=-1)}else for(;o<s.length&&s[o].to<p;)o++;let g=f.isInline&&!f.isLeaf?a.filter(y=>!y.inline):a.slice();r(f,g,e.forChild(i,f),h),i=p}}
vendor: 9,551 bytes, line 372
372function tq(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 nq(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 l=o.text;for(;s<t.childCount;){let c=t.child(s++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function p0(t,e,n,r,s){let i=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),s&&(i.push(s),s=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Ew(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),l,c;if(Em(n)){for(l=o;s&&!s.node;)s=s.parent;let d=s.node;if(s&&d.isAtom&&ue.isSelectable(d)&&s.parent&&!(d.isInline&&N9(n.focusNode,n.focusOffset,s.dom))){let f=s.posBefore;c=new ue(o==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=o,f=o;for(let h=0;h<n.rangeCount;h++){let p=n.getRangeAt(h);d=Math.min(d,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[l,o]=f==t.state.selection.anchor?[f,d]:[d,f],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let d=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=Cw(t,u,a,d)}return c}function IP(t){return t.editable?t.hasFocus():MP(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ts(t,e=!1){let n=t.state.selection;if(jP(t,n),!!IP(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Vt){let r=t.domSelectionRange(),s=t.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&Xo(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)sq(t);else{let{anchor:r,head:s}=n,i,o;iE&&!(n instanceof me)&&(n.$from.parent.inlineContent||(i=oE(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=oE(t,n.to))),t.docView.setSelection(r,s,t,e),iE&&(i&&aE(i),o&&aE(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&rq(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const iE=Xt||Vt&&wP<63;function oE(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(Xt&&s&&s.contentEditable=="false")return Yg(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return Yg(s);if(i)return Yg(i)}}function Yg(t){return t.contentEditable="true",Xt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function aE(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function rq(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(()=>{(!IP(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function sq(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,zt(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&En&&Di<=11&&(n.disabled=!0,n.disabled=!1)}function jP(t,e){if(e instanceof ue){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(lE(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else lE(t)}function lE(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Cw(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||me.between(e,n,r)}function cE(t){return t.editable&&!t.hasFocus()?!1:MP(t)}function MP(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 iq(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Xo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function m0(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&&ke.findFrom(i,e)}function ei(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function uE(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 ei(t,new me(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=m0(t.state,e);return s&&s instanceof ue?ei(t,s):!1}else if(!(Hn&&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?ue.isSelectable(i)?ei(t,new ue(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):Cd?ei(t,new me(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ue&&r.node.isInline)return ei(t,new me(e>0?r.$to:r.$from));{let s=m0(t.state,e);return s?ei(t,s):!1}}}function Zh(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function nu(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function _a(t,e){return e<0?oq(t):aq(t)}function oq(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(Xn&&n.nodeType==1&&r<Zh(n)&&nu(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(nu(a,-1))s=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(LP(n))break;{let a=n.previousSibling;for(;a&&nu(a,-1);)s=n.parentNode,i=zt(a),a=a.previousSibling;if(a)n=a,r=Zh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?g0(t,n,r):s&&g0(t,s,i)}function aq(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=Zh(n),i,o;for(;;)if(r<s){if(n.nodeType!=1)break;let a=n.childNodes[r];if(nu(a,1))i=n,o=++r;else break}else{if(LP(n))break;{let a=n.nextSibling;for(;a&&nu(a,1);)i=a.parentNode,o=zt(a)+1,a=a.nextSibling;if(a)n=a,r=0,s=Zh(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}i&&g0(t,i,o)}function LP(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function lq(t,e){for(;t&&e==t.childNodes.length&&!Ed(t);)e=zt(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 cq(t,e){for(;t&&!e&&!Ed(t);)e=zt(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 g0(t,e,n){if(e.nodeType!=3){let i,o;(o=lq(e,n))?(e=o,n=0):(i=cq(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Em(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&&Ts(t)},50)}function dE(t,e){let n=t.state.doc.resolve(e);if(!(Vt||xP)&&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 fE(t,e,n){let r=t.state.selection;if(r instanceof me&&!r.empty||n.indexOf("s")>-1||Hn&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=m0(t.state,e);if(o&&o instanceof ue)return ei(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,a=r instanceof Yn?ke.near(o,e):ke.findFrom(o,e);return a?ei(t,a):!1}return!1}function hE(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 pE(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function uq(t){if(!Xt||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;pE(t,r,"true"),setTimeout(()=>pE(t,r,"false"),20)}return!1}function dq(t){let e="";
vendor: 2,519 bytes, lines 372-375
372return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function fq(t,e){let n=e.keyCode,r=dq(e);if(n==8||Hn&&n==72&&r=="c")return hE(t,-1)||_a(t,-1);if(n==46&&!e.shiftKey||Hn&&n==68&&r=="c")return hE(t,1)||_a(t,1);if(n==13||n==27)return!0;if(n==37||Hn&&n==66&&r=="c"){let s=n==37?dE(t,t.state.selection.from)=="ltr"?-1:1:-1;return uE(t,s,r)||_a(t,s)}else if(n==39||Hn&&n==70&&r=="c"){let s=n==39?dE(t,t.state.selection.from)=="ltr"?1:-1:1;return uE(t,s,r)||_a(t,s)}else{if(n==38||Hn&&n==80&&r=="c")return fE(t,-1,r)||_a(t,-1);if(n==40||Hn&&n==78&&r=="c")return uq(t)||fE(t,1,r)||_a(t,1);if(r==(Hn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function _w(t,e){t.someProp("transformCopied",h=>{e=h(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 h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=t.someProp("clipboardSerializer")||ca.fromSchema(t.state.schema),a=UP(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=zP[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
373
374`);return{dom:l,text:f,slice:e}}function DP(t,e,n,r,s){let i=s.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return a=new X(F.from(t.state.schema.text(e.replace(/\r\n?/g,`
375`))),0,0),t.someProp("transformPasted",f=>{a=f(a,t,!0)}),a;let d=t.someProp("clipboardTextParser",f=>f(e,s,r,t));if(d)a=d;else{let f=s.marks(),{schema:h}=t.state,p=ca.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=o.appendChild(document.createElement("p"));g&&y.appendChild(p.serializeNode(h.text(g,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),o=gq(n),Cd&&yq(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Li.fromSc
vendor: 11,294 bytes, line 375
375hema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!hq.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=vq(mE(a,+u[1],+u[2]),u[4]);else if(a=X.maxOpen(pq(a.content,s),!0),a.openStart||a.openEnd){let d=0,f=0;for(let h=a.content.firstChild;d<a.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=mE(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t,l)}),a}const hq=/^(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 pq(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 l=s.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&i.length&&FP(l,i,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=BP(o[o.length-1],i.length));let u=$P(a,l);o.push(u),s=s.matchType(u.type),i=l}}),o)return F.from(o)}return t}function $P(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,F.from(t));return t}function FP(t,e,n,r,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=FP(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(F.from($P(n,t,s+1))))}}function BP(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,BP(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(F.empty,!0);return t.copy(n.append(r))}function y0(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=y0(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(F.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function mE(t,e,n){return e<t.openStart&&(t=new X(y0(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new X(y0(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const zP={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 gE=null;function UP(){return gE||(gE=document.implementation.createHTMLDocument("title"))}let Xg=null;function mq(t){let e=window.trustedTypes;return e?(Xg||(Xg=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Xg.createHTML(t)):t}function gq(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=UP().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),s;if((s=r&&zP[r[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=mq(t),s)for(let i=0;i<s.length;i++)n=n.querySelector(s[i])||n;return n}function yq(t){let e=t.querySelectorAll(Vt?"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 vq(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 l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;s=F.from(l.create(r[a+1],s)),i++,o++}return new X(s,i,o)}const ln={},cn={},bq={touchstart:!0,touchmove:!0};class wq{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 xq(t){for(let e in ln){let n=ln[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Sq(t,r)&&!Tw(t,r)&&(t.editable||!(r.type in cn))&&n(t,r)},bq[e]?{passive:!0}:void 0)}Xt&&t.dom.addEventListener("input",()=>null),v0(t)}function ki(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function kq(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 v0(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Tw(t,r))})}function Tw(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Sq(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 Eq(t,e){!Tw(t,e)&&ln[e.type]&&(t.editable||!(e.type in cn))&&ln[e.type](t,e)}cn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!HP(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Cs&&Vt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Ul&&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,po(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||fq(t,n)?n.preventDefault():ki(t,"key")};cn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};cn.keypress=(t,e)=>{let n=e;if(HP(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hn&&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 _m(t){return{left:t.clientX,top:t.clientY}}function Cq(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Aw(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 dl(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&&ue.isSelectable(r)?(dl(t,new ue(n)),!0):!1}function Tq(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof ue&&(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(ue.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?(dl(t,ue.create(t.state.doc,s)),!0):!1}function Aq(t,e,n,r,s){return Aw(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?Tq(t,n):_q(t,n))}function Nq(t,e,n,r){return Aw(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function Oq(t,e,n,r){return Aw(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||Rq(t,n,r)}function Rq(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(dl(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)dl(t,me.create(r,a+1,a+1+o.content.size));else if(ue.isSelectable(o))dl(t,ue.create(r,a));else continue;return!0}}function Nw(t){return Yh(t)}const VP=Hn?"metaKey":"ctrlKey";ln.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Nw(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&Cq(n,t.input.lastClick)&&!n[VP]&&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(_m(n));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Pq(t,o,n,!!r)):(i=="doubleClick"?Nq:Oq)(t,o.pos,o.inside,n)?n.preventDefault():ki(t,"pointer"))};class Pq{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[VP],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,o=u.depth?u.before():0}const a=s?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ue&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Xn&&!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)),ki(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(()=>Ts(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(_m(e))),this.updateAllowDefault(e),this.allowDefault||!n?ki(this.view,"pointer"):Aq(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Xt&&this.mightDrag&&!this.mightDrag.node.isAtom||Vt&&!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)?(dl(this.view,ke.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ki(this.view,"pointer")}move(e){this.updateAllowDefault(e),ki(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)}}ln.touchstart=t=>{t.input.lastTouch=Date.now(),Nw(t),ki(t,"pointer")};ln.touchmove=t=>{t.input.lastTouch=Date.now(),ki(t,"pointer")};
vendor: 4,340 bytes, line 375
375ln.contextmenu=t=>Nw(t);function HP(t,e){return t.composing?!0:Xt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Iq=Cs?5e3:-1;cn.compositionstart=cn.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)||Vt&&xP&&jq(t)))t.markCursor=t.state.storedMarks||n.marks(),Yh(t,!0),t.markCursor=null;else if(Yh(t,!e.selection.empty),Xn&&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}WP(t,Iq)};function jq(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"}cn.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++,WP(t,20))};function WP(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Yh(t),e))}function qP(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Lq());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Mq(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=T9(e.focusNode,e.focusOffset),r=A9(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 Lq(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Yh(t,e=!1){if(!(Cs&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),qP(t),e||t.docView&&t.docView.dirty){let n=Ew(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 Dq(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 Ju=En&&Di<15||Ul&&P9<604;ln.copy=cn.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=Ju?null:n.clipboardData,o=r.content(),{dom:a,text:l}=_w(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):Dq(t,a),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function $q(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Fq(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?Qu(t,r.value,null,s,e):Qu(t,r.textContent,r.innerHTML,s,e)},50)}function Qu(t,e,n,r,s){let i=DP(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,s,i||X.empty)))return!0;if(!i)return!1;let o=$q(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 KP(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;
vendor: 9,015 bytes, line 375
375let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}cn.paste=(t,e)=>{let n=e;if(t.composing&&!Cs)return;let r=Ju?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Qu(t,KP(r),r.getData("text/html"),s,n)?n.preventDefault():Fq(t,n)};class GP{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Bq=Hn?"altKey":"ctrlKey";function JP(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[Bq]}ln.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(_m(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof ue?s.to-1:s.to))){if(r&&r.mightDrag)o=ue.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(o=ue.create(t.state.doc,d.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:u}=_w(t,a);(!n.dataTransfer.files.length||!Vt||wP>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ju?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ju||n.dataTransfer.setData("text/plain",c),t.dragging=new GP(u,JP(t,n),o)};ln.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};cn.dragover=cn.dragenter=(t,e)=>e.preventDefault();cn.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(_m(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",h=>{i=h(i,t,!1)}):i=DP(t,KP(e.dataTransfer),Ju?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&JP(t,e));if(t.someProp("handleDrop",h=>h(t,e,i||X.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let a=i?iP(t.state.doc,s.pos,i):s.pos;a==null&&(a=s.pos);let l=t.state.tr;if(o){let{node:h}=n;h?h.replace(l):l.deleteSelection()}let c=l.mapping.map(a),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,d=l.doc;if(u?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(d))return;let f=l.doc.resolve(c);if(u&&ue.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new ue(f));else{let h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((p,g,y,v)=>h=v),l.setSelection(Cw(t,f,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}ln.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())&&Ts(t)},20))};ln.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)};ln.beforeinput=(t,e)=>{if(Vt&&Cs&&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,po(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 cn)ln[t]=cn[t];function Zu(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 Xh{constructor(e,n){this.toDOM=e,this.spec=n||Do,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 on(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Xh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Zu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Fi{constructor(e,n){this.attrs=e,this.spec=n||Do}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 on(i,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Fi&&Zu(this.attrs,e.attrs)&&Zu(this.spec,e.spec)}static is(e){return e.type instanceof Fi}destroy(){}}class Ow{constructor(e,n){this.attrs=e,this.spec=n||Do}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 on(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 Ow&&Zu(this.attrs,e.attrs)&&Zu(this.spec,e.spec)}destroy(){}}class on{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new on(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 on(e,e,new Xh(n,r))}static inline(e,n,r,s){return new on(e,n,new Fi(r,s))}static node(e,n,r,s){return new on(e,n,new Ow(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fi}get widget(){return this.type instanceof Xh}}const ja=[],Do={};class Xe{constructor(e,n){this.local=e.length?e:ja,this.children=n.length?n:ja}static create(e,n){return n.length?ep(n,e,0,Do):Qt}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==Qt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Do)}mapInner(e,n,r,s,i){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,s);l&&l.type.valid(n,l)?(o||(o=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?Uq(this.children,o||[],e,n,r,s,i):o?new Xe(o.sort($o),ja):Qt}add(e,n){return n.length?this==Qt?Xe.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let s,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=ZP(n,a,c)){for(s||(s=this.children.slice());i<s.length&&s[i]<l;)i+=3;s[i]==l?s[i+2]=s[i+2].addInner(a,u,c+1):s.splice(i,0,l,l+a.nodeSize,ep(u,a,c+1,Do)),i+=3}});let o=QP(i?YP(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new Xe(o.length?this.local.concat(o).sort($o):this.local,s||this.children)}remove(e){return e.length==0||this==Qt?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,l=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(o||(o=[])).push(d));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(o,a+1);c!=Qt?r[i+2]=c:(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 Xe(s,r):Qt}forChild(e,n){if(this==Qt)return this;if(n.isLeaf)return Xe.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 l=this.local[a];if(l.from<o&&l.to>i&&l.type instanceof Fi){let c=Math.max(i,l.from)-i,u=Math.min(o,l.to)-i;c<u&&(s||(s=[])).push(l.copy(c,u))}}if(s){let a=new Xe(s.sort($o),ja);return r?new oi([a,r]):a}return r||Qt}eq(e){if(this==e)return!0;if(!(e instanceof Xe)||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 Rw(this.localsInner(e))}localsInner(e){if(this==Qt)return ja;if(e.inlineContent||!this.local.some(Fi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Fi||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Xe.empty=new Xe([],[]);Xe.removeOverlap=Rw;const Qt=Xe.empty;class oi{constructor(e){this.members=e}map(e,n){const r=this.members.map(s=>s.map(e,n,Do));return oi.from(r)}forChild(e,n){if(n.isLeaf)return Xe.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=Qt&&(i instanceof oi?r=r.concat(i.members):r.push(i))}return oi.from(r)}eq(e){if(!(e instanceof oi)||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?Rw(r?n:n.sort($o)):ja}static from(e){switch(e.length){case 0:return Qt;
vendor: 10,766 bytes, line 375
375case 1:return e[0];default:return new oi(e.every(n=>n instanceof Xe)?e:e.reduce((n,r)=>n.concat(r instanceof Xe?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Uq(t,e,n,r,s,i,o){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,h,p,g)=>{let y=g-p-(h-f);for(let v=0;v<a.length;v+=3){let b=a[v+1];if(b<0||f>b+u-d)continue;let w=a[v]+u-d;h>=w?a[v+1]=f<=w?-2:-1:f>=u&&y&&(a[v]+=y,a[v+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+i),d=u-s;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+i,-1),h=f-s,{index:p,offset:g}=r.content.findIndex(d),y=r.maybeChild(p);if(y&&g==d&&g+y.nodeSize==h){let v=a[c+2].mapInner(n,y,u+1,t[c]+i+1,o);v!=Qt?(a[c]=d,a[c+1]=h,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=Vq(a,t,e,n,s,i,o),u=ep(c,r,0,o);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new Xe(e.sort($o),a)}function QP(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 on(s.from+e,s.to+e,s.type))}return n}function Vq(t,e,n,r,s,i,o){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,s,c);d?n.push(d):o.onRemove&&o.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function ZP(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 YP(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ep(t,e,n,r){let s=[],i=!1;e.forEach((a,l)=>{let c=ZP(t,a,l+n);if(c){i=!0;let u=ep(c,a,n+l+1,r);u!=Qt&&s.push(l,l+a.nodeSize,u)}});let o=QP(i?YP(t):t,-n).sort($o);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 Xe(o,s):Qt}function $o(t,e){return t.from-e.from||t.to-e.to}function Rw(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),yE(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),yE(e,s,r.copy(i.from,r.to)));break}}}return e}function yE(t,e,n){for(;e<t.length&&$o(n,t[e])>0;)e++;t.splice(e,0,n)}function ey(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Qt&&e.push(r)}),t.cursorWrapper&&e.push(Xe.create(t.state.doc,[t.cursorWrapper.deco])),oi.from(e)}const Hq={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Wq=En&&Di<=11;class qq{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 Kq{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new qq,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]);En&&Di<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():Xt&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Wq&&(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,Hq)),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(cE(this.view)){if(this.suppressingSelectionUpdates)return Ts(this.view);if(En&&Di<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Xo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=zl(i))n.add(i);for(let i=e.anchorNode;i;i=zl(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)&&cE(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(a=!0))}if(l.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of l)if(u.nodeName=="BR"&&u.parentNode){let d=u.nextSibling;d&&d.nodeType==1&&d.contentEditable=="false"&&u.parentNode.removeChild(u)}}else if(Xn&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||Qq(e,d)!=h)&&f.remove()}}}let c=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Em(r)&&(c=Ew(e))&&c.eq(ke.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ts(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),Gq(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Zq(e,l)),this.handleDOMChange(i,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ts(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 u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}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(En&&Di<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(s=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let o=s&&s.parentNode==e.target?zt(s)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?zt(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}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 vE=new WeakMap,bE=!1;function Gq(t){if(!vE.has(t)&&(vE.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Xn,bE)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."),bE=!0}}function wE(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Xo(o.node,o.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function Jq(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return wE(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?wE(t,n):null}function Qq(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 Zq(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 l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(i,a.firstChild),r==i&&t.domSelection().collapse(i,s)}else i.parentNode.removeChild(i)}}function Yq(t,e,n){let{node:r,fromOffset:s,toOffset:i,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Em(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Vt&&t.input.lastKeyCode===8)for(let y=i;y>s;y--){let v=r.childNodes[y-1],b=v.pmViewDesc;if(v.nodeName=="BR"&&!b){i=y;break}if(!b||b.size)break}
vendor: 4,166 bytes, line 375
375let d=t.state.doc,f=t.someProp("domParser")||Li.fromSchema(t.state.schema),h=d.resolve(o),p=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:s,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Xq,context:h});if(c&&c[0].pos!=null){let y=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=y),p={anchor:y+o,head:v+o}}return{doc:g,sel:p,from:o,to:a}}function Xq(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Xt&&/^(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||Xt&&/^(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 eK=/^(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 tK(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let E=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,T=Ew(t,E);if(T&&!t.state.selection.eq(T)){if(Vt&&Cs&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",P=>P(t,po(13,"Enter"))))return;let N=t.state.tr.setSelection(T);E=="pointer"?N.setMeta("pointer",!0):E=="key"&&N.scrollIntoView(),i&&N.setMeta("composition",i),t.dispatch(N)}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 l=t.state.selection,c=Yq(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,h="end"):(f=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let p=sK(d.content,c.doc.content,c.from,f,h);if(p&&t.input.domChangeCount++,(Ul&&t.input.lastIOSEnter>Date.now()-225||Cs)&&s.some(E=>E.nodeType==1&&!eK.test(E.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",E=>E(t,po(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof me&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let E=xE(t,t.state.doc,c.sel);if(E&&!E.eq(t.state.selection)){let T=t.state.tr.setSelection(E);i&&T.setMeta("composition",i),t.dispatch(T)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof me&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),En&&Di<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let g=c.doc.resolveNoCache(p.start-c.from),y=c.doc.resolveNoCache(p.endB-c.from),v=u.resolve(p.start),b=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=p.endA;if((Ul&&t.input.lastIOSEnter>Date.now()-225&&(!b||s.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!b&&g.pos<c.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(c.doc.textBetween(g.pos,y.pos,"","")))&&t.someProp("handleKeyDown",E=>E(t,po(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&rK(u,p.start,p.endA,g,y)&&t.someProp("handleKeyDown",E=>E(t,po(8,"Backspace")))){Cs&&Vt&&t.domObserver.suppressSelectionUpdates();return}Vt&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),Cs&&!b&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,y=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(E){return E(t,po(13,"Enter"))})},20));let w=p.start,k=p.endA,S=E=>{let T=E||t.state.tr.replace(w,k,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let N=xE(t,T.doc,c.sel);
vendor: 11,545 bytes, line 375
375N&&!(Vt&&t.composing&&N.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(N.head==w||N.head==T.mapping.map(k)-1)||En&&N.empty&&N.head==w)&&T.setSelection(N)}return i&&T.setMeta("composition",i),T.scrollIntoView()},C;if(b)if(g.pos==y.pos){En&&Di<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ts(t),20));let E=S(t.state.tr.delete(w,k)),T=u.resolve(p.start).marksAcross(u.resolve(p.endA));T&&E.ensureMarks(T),t.dispatch(E)}else if(p.endA==p.endB&&(C=nK(g.parent.content.cut(g.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,p.endA-v.start())))){let E=S(t.state.tr);C.type=="add"?E.addMark(w,k,C.mark):E.removeMark(w,k,C.mark),t.dispatch(E)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let E=g.parent.textBetween(g.parentOffset,y.parentOffset),T=()=>S(t.state.tr.insertText(E,w,k));t.someProp("handleTextInput",N=>N(t,w,k,E,T))||t.dispatch(T())}else t.dispatch(S());else t.dispatch(S())}function xE(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Cw(t,e.resolve(n.anchor),e.resolve(n.head))}function nK(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,a,l;for(let u=0;u<r.length;u++)s=r[u].removeFromSet(s);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(s.length==1&&i.length==0)a=s[0],o="add",l=u=>u.mark(a.addToSet(u.marks));else if(s.length==0&&i.length==1)a=i[0],o="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(F.from(c).eq(t))return{mark:a,type:o}}function rK(t,e,n,r,s){if(n-e<=s.pos-r.pos||ty(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(ty(i,!0,!0));return!o.parent.isTextblock||o.pos>n||ty(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function ty(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 sK(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);if(s=="end"){let l=Math.max(0,i-Math.min(o,a));r-=o+l-i}if(o<i&&t.size<e.size){let l=r<=i&&r>=o?i-r:0;i-=l,i&&i<e.size&&kE(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-o),o=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&kE(t.textBetween(i-1,i+1))&&(i+=l?1:-1),o=i+(o-a),a=i}return{start:i,endA:o,endB:a}}function kE(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 XP{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 wq,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(TE),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=CE(this),EE(this),this.nodeViews=_E(this),this.docView=rE(this.state.doc,SE(this),ey(this),this.dom,this),this.domObserver=new Kq(this,(r,s,i,o)=>tK(this,r,s,i,o)),this.domObserver.start(),xq(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&&v0(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(TE),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&&(qP(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 h=_E(this);oK(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&v0(this),this.editable=CE(this),EE(this);let l=ey(this),c=SE(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(s.selection))&&(o=!0);let f=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&M9(this);if(o){this.domObserver.stop();let h=d&&(En||Vt)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&iK(s.selection,e.selection);if(d){let p=Vt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Mq(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=rE(e.doc,c,l,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&iq(this))?Ts(this,h):(jP(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),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&L9(f)}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 ue){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&ZS(this,n.getBoundingClientRect(),e)}else ZS(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;if(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&&this.state.doc.nodeAt(i))==r.node&&(s=i)}this.dragging=new GP(e.slice,e.move,s<0?void 0:ue.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(En){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&&D9(this.dom),Ts(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 U9(this,e)}coordsAtPos(e,n=1){return _P(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 K9(this,n||this.state,e)}pasteHTML(e,n){return Qu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Qu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return _w(this,e)}destroy(){this.docView&&(kq(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ey(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,C9())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Eq(this,e)}domSelectionRange(){let e=this.domSelection();return e?Xt&&this.root.nodeType===11&&O9(this.dom.ownerDocument)==this.dom&&Jq(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}XP.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function SE(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"),[on.node(0,t.state.doc.content.size,e)]}function EE(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:on.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function CE(t){return!t.someProp("editable",e=>e(t.state)===!1)}function iK(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 _E(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 oK(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 TE(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 qi={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:"'"},tp={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},aK=typeof navigator<"u"&&/Mac/.test(navigator.platform),lK=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ut=0;Ut<10;Ut++)qi[48+Ut]=qi[96+Ut]=String(Ut);for(var Ut=1;Ut<=24;
vendor: 57,674 bytes, lines 375-418
375Ut++)qi[Ut+111]="F"+Ut;for(var Ut=65;Ut<=90;Ut++)qi[Ut]=String.fromCharCode(Ut+32),tp[Ut]=String.fromCharCode(Ut);for(var ny in qi)tp.hasOwnProperty(ny)||(tp[ny]=qi[ny]);function cK(t){var e=aK&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||lK&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?tp:qi)[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 uK=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),dK=typeof navigator<"u"&&/Win/.test(navigator.platform);function fK(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 l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))uK?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),o&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function hK(t){let e=Object.create(null);for(let n in t)e[fK(n)]=t[n];return e}function ry(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 pK(t){return new rt({props:{handleKeyDown:eI(t)}})}function eI(t){let e=hK(t);return function(n,r){let s=cK(r),i,o=e[ry(s,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let a=e[ry(s,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(dK&&r.ctrlKey&&r.altKey)&&(i=qi[r.keyCode])&&i!=s){let a=e[ry(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var mK=Object.defineProperty,Pw=(t,e)=>{for(var n in e)mK(t,n,{get:e[n],enumerable:!0})};function Tm(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 Am=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,(...c)=>{const u=a(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),u}]))}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,l=t||s.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),o.every(d=>d===!0)),u={...Object.fromEntries(Object.entries(n).map(([d,f])=>[d,(...p)=>{const g=this.buildProps(l,e),y=f(...p)(g);return o.push(y),u}])),run:c};return u}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,l])=>[a,(...c)=>l(...c)({...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:Tm({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,l])=>[a,(...c)=>l(...c)(o)]))}};return o}},tI={};Pw(tI,{blur:()=>gK,clearContent:()=>yK,clearNodes:()=>vK,command:()=>bK,createParagraphNear:()=>wK,cut:()=>xK,deleteCurrentNode:()=>kK,deleteNode:()=>SK,deleteRange:()=>EK,deleteSelection:()=>CK,enter:()=>_K,exitCode:()=>TK,extendMarkRange:()=>AK,first:()=>NK,focus:()=>RK,forEach:()=>PK,insertContent:()=>IK,insertContentAt:()=>LK,joinBackward:()=>FK,joinDown:()=>$K,joinForward:()=>BK,joinItemBackward:()=>zK,joinItemForward:()=>UK,joinTextblockBackward:()=>VK,joinTextblockForward:()=>HK,joinUp:()=>DK,keyboardShortcut:()=>qK,lift:()=>KK,liftEmptyBlock:()=>GK,liftListItem:()=>JK,newlineInCode:()=>QK,resetAttributes:()=>ZK,scrollIntoView:()=>YK,selectAll:()=>XK,selectNodeBackward:()=>e7,selectNodeForward:()=>t7,selectParentNode:()=>n7,selectTextblockEnd:()=>r7,selectTextblockStart:()=>s7,setContent:()=>i7,setMark:()=>_7,setMeta:()=>T7,setNode:()=>A7,setNodeSelection:()=>N7,setTextDirection:()=>O7,setTextSelection:()=>R7,sinkListItem:()=>P7,splitBlock:()=>I7,splitListItem:()=>j7,toggleList:()=>M7,toggleMark:()=>L7,toggleNode:()=>D7,toggleWrap:()=>$7,undoInputRule:()=>F7,unsetAllMarks:()=>B7,unsetMark:()=>z7,unsetTextDirection:()=>U7,updateAttributes:()=>V7,wrapIn:()=>H7,wrapInList:()=>W7});var gK=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),yK=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),vK=()=>({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,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+a.nodeSize)),h=d.blockRange(f);if(!h)return;const p=rc(h);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,g)}(p||p===0)&&e.lift(h,p)})}),!0},bK=t=>e=>t(e),wK=()=>({state:t,dispatch:e})=>d9(t,e),xK=(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},kK=()=>({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),l=s.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1};function bt(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 SK=t=>({tr:e,state:n,dispatch:r})=>{const s=bt(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 l=i.before(o),c=i.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},EK=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},CK=()=>({state:t,dispatch:e})=>XW(t,e),_K=()=>({commands:t})=>t.keyboardShortcut("Enter"),TK=()=>({state:t,dispatch:e})=>u9(t,e);function Iw(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function np(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:Iw(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function nI(t,e,n={}){return t.find(r=>r.type===e&&np(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function AE(t,e,n={}){return!!nI(t,e,n)}function jw(t,e,n){var r;if(!t||!e)return;let s=t.parent.childAfter(t.parentOffset);if((!s.node||!s.node.marks.some(u=>u.type===e))&&(s=t.parent.childBefore(t.parentOffset)),!s.node||!s.node.marks.some(u=>u.type===e)||(n=n||((r=s.node.marks[0])==null?void 0:r.attrs),!nI([...s.node.marks],e,n)))return;let o=s.index,a=t.start()+s.offset,l=o+1,c=a+s.node.nodeSize;for(;o>0&&AE([...t.parent.child(o-1).marks],e,n);)o-=1,a-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&AE([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Fs(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 AK=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const i=Fs(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:u}=a;if(s){const d=jw(l,i,e);if(d&&d.from<=c&&d.to>=u){const f=me.create(o,d.from,d.to);n.setSelection(f)}}return!0},NK=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 rI(t){return t instanceof me}function ko(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function sI(t,e=null){if(!e)return null;const n=ke.atStart(t),r=ke.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,ko(0,s,i),ko(t.content.size,s,i)):me.create(t,ko(e,s,i),ko(e,s,i))}function NE(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function rp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function OK(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var RK=(t=null,e={})=>({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(rp()||NE())&&r.dom.focus(),OK()&&!rp()&&!NE()&&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&&!rI(n.state.selection))return o(),!0;const a=sI(s.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||s.setSelection(a),l&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},PK=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),IK=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),iI=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&&iI(r)}return t};function mf(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 iI(n)}function Yu(t,e,n){if(t instanceof Mi||t instanceof F)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 F.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),Yu("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,a="";const l=new GR({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:c=>(o=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Li.fromSchema(l).parseSlice(mf(t),n.parseOptions):Li.fromSchema(l).parse(mf(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Li.fromSchema(e);return n.slice?i.parseSlice(mf(t),n.parseOptions).content:i.parse(mf(t),n.parseOptions)}return Yu("",e,n)}function jK(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof Ot||s instanceof It))return;const i=t.mapping.maps[r];let o=0;i.forEach((a,l,c,u)=>{o===0&&(o=u)}),t.setSelection(ke.near(t.doc.resolve(o),n))}var MK=t=>!("type"in t),LK=(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 l=y=>{i.emit("contentError",{editor:i,error:y,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Yu(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=Yu(e,i.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(y){return l(y),!1}let{from:u,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((MK(a)?a:[a]).forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),u===d&&h){const{parent:y}=r.doc.resolve(u);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(u-=1,d+=1)}let g;if(f){if(Array.isArray(e))g=e.map(y=>y.text||"").join("");else if(e instanceof F){let y="";e.forEach(v=>{v.text&&(y+=v.text)}),g=y}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,d)}else{g=a;const y=r.doc.resolve(u),v=y.node(),b=y.parentOffset===0,w=v.isText||v.isTextblock,k=v.content.size>0;b&&w&&k&&(u=Math.max(0,u-1)),r.replaceWith(u,d,g)}n.updateSelection&&jK(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},DK=()=>({state:t,dispatch:e})=>o9(t,e),$K=()=>({state:t,dispatch:e})=>a9(t,e),FK=()=>({state:t,dispatch:e})=>e9(t,e),BK=()=>({state:t,dispatch:e})=>s9(t,e),zK=()=>({state:t,dispatch:e,tr:n})=>{try{const r=xm(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},UK=()=>({state:t,dispatch:e,tr:n})=>{try{const r=xm(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},VK=()=>({state:t,dispatch:e})=>t9(t,e),HK=()=>({state:t,dispatch:e})=>n9(t,e);function oI(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function WK(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 l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))rp()||oI()?o=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var qK=t=>({editor:e,view:n,tr:r,dispatch:s})=>{const i=WK(t).split(/-(?!$)/),o=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),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}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&s&&r.maybeStep(u)}),!0};function Ki(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?bt(e,t.schema):null,a=[];t.doc.nodesBetween(r,s,(d,f)=>{if(d.isText)return;const h=Math.max(r,f),p=Math.min(s,f+d.nodeSize);a.push({node:d,from:h,to:p})});const l=s-r,c=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>np(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=l}var KK=(t,e={})=>({state:n,dispatch:r})=>{const s=bt(t,n.schema);return Ki(n,s,e)?l9(n,r):!1},GK=()=>({state:t,dispatch:e})=>f9(t,e),JK=t=>({state:e,dispatch:n})=>{const r=bt(t,e.schema);return x9(r)(e,n)},QK=()=>({state:t,dispatch:e})=>c9(t,e);function Nm(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function OE(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 ZK=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=Nm(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=bt(t,r.schema)),a==="mark"&&(o=Fs(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{i&&i===u.type&&(l=!0,s&&n.setNodeMarkup(d,void 0,OE(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&(l=!0,s&&n.addMark(d,d+u.nodeSize,o.create(OE(f.attrs,e))))})})}),l},YK=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),XK=()=>({tr:t,dispatch:e})=>{if(e){const n=new Yn(t.doc);t.setSelection(n)}return!0},e7=()=>({state:t,dispatch:e})=>r9(t,e),t7=()=>({state:t,dispatch:e})=>i9(t,e),n7=()=>({state:t,dispatch:e})=>h9(t,e),r7=()=>({state:t,dispatch:e})=>g9(t,e),s7=()=>({state:t,dispatch:e})=>m9(t,e);function b0(t,e,n={},r={}){return Yu(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var i7=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:a})=>{const{doc:l}=i;if(r.preserveWhitespace!=="full"){const c=b0(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n),!0}return o&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function aI(t,e){const n=Fs(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,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function lI(t,e){const n=new uP(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function o7(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 a7(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function l7(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 Om(t){return e=>l7(e.$from,t)}function le(t,e,n){return t.config[e]===void 0&&t.parent?le(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?le(t.parent,e,n):null}):t.config[e]}function Mw(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=le(e,"addExtensions",n);return r?[e,...Mw(r())]:e}).flat(10)}function Lw(t,e){const n=ca.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function cI(t){return typeof t=="function"}function Me(t,e=void 0,...n){return cI(t)?e?t.bind(e)(...n):t(...n):t}function c7(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Vl(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 uI(t){const e=[],{nodeExtensions:n,markExtensions:r}=Vl(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(c=>c.name!=="text").map(c=>c.name),a=r.map(c=>c.name),l=[...o,...a];return t.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage,extensions:s},d=le(c,"addGlobalAttributes",u);if(!d)return;d().forEach(h=>{let p;Array.isArray(h.types)?p=h.types:h.types==="*"?p=l:h.types==="nodes"?p=o:h.types==="marks"?p=a:p=[],p.forEach(g=>{Object.entries(h.attributes).forEach(([y,v])=>{e.push({type:g,name:y,attribute:{...i,...v}})})})})}),s.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage},d=le(c,"addAttributes",u);if(!d)return;const f=d();Object.entries(f).forEach(([h,p])=>{const g={...i,...p};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:c.name,name:h,attribute:g})})}),e}function u7(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let a=0;a<o;a+=1){const l=t[a];if(l==="'"&&!s){r=!r,n+=l;continue}if(l==='"'&&!r){s=!s,n+=l;continue}if(!r&&!s){if(l==="("){i+=1,n+=l;continue}if(l===")"&&i>0){i-=1,n+=l;continue}if(l===";"&&i===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function RE(t){const e=[],n=u7(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(),l=i.slice(o+1).trim();a&&l&&e.push([a,l])}return e}function wt(...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(" "):[],l=r[s]?r[s].split(" "):[],c=a.filter(u=>!l.includes(u));r[s]=[...l,...c].join(" ")}else if(s==="style"){const a=new Map([...RE(r[s]),...RE(i)]);r[s]=Array.from(a.entries()).map(([l,c])=>`${l}: ${c}`).join("; ")}else r[s]=i}),r},{})}function Xu(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)=>wt(n,r),{})}function d7(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function PE(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):d7(n.getAttribute(o.name));return a==null?i:{...i,[o.name]:a}},{});return{...r,...s}}}}function IE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&c7(n)?!1:n!=null))}function jE(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 f7(t,e){var n;const r=uI(t),{nodeExtensions:s,markExtensions:i}=Vl(t),o=(n=s.find(c=>le(c,"topNode")))==null?void 0:n.name,a=Object.fromEntries(s.map(c=>{const u=r.filter(v=>v.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((v,b)=>{const w=le(b,"extendNodeSchema",d);return{...v,...w?w(c):{}}},{}),h=IE({...f,content:Me(le(c,"content",d)),marks:Me(le(c,"marks",d)),group:Me(le(c,"group",d)),inline:Me(le(c,"inline",d)),atom:Me(le(c,"atom",d)),selectable:Me(le(c,"selectable",d)),draggable:Me(le(c,"draggable",d)),code:Me(le(c,"code",d)),whitespace:Me(le(c,"whitespace",d)),linebreakReplacement:Me(le(c,"linebreakReplacement",d)),defining:Me(le(c,"defining",d)),isolating:Me(le(c,"isolating",d)),attrs:Object.fromEntries(u.map(jE))}),p=Me(le(c,"parseHTML",d));p&&(h.parseDOM=p.map(v=>PE(v,u)));const g=le(c,"renderHTML",d);g&&(h.toDOM=v=>g({node:v,HTMLAttributes:Xu(v,u)}));const y=le(c,"renderText",d);return y&&(h.toText=y),[c.name,h]})),l=Object.fromEntries(i.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,v)=>{const b=le(v,"extendMarkSchema",d);return{...y,...b?b(c):{}}},{}),h=IE({...f,inclusive:Me(le(c,"inclusive",d)),excludes:Me(le(c,"excludes",d)),group:Me(le(c,"group",d)),spanning:Me(le(c,"spanning",d)),code:Me(le(c,"code",d)),attrs:Object.fromEntries(u.map(jE))}),p=Me(le(c,"parseHTML",d));p&&(h.parseDOM=p.map(y=>PE(y,u)));const g=le(c,"renderHTML",d);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:Xu(y,u)})),[c.name,h]}));return new GR({topNode:o,nodes:a,marks:l})}function h7(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function ru(t){return t.sort((n,r)=>{const s=le(n,"priority")||100,i=le(r,"priority")||100;return s>i?-1:s<i?1:0})}function dI(t){const e=ru(Mw(t)),n=h7(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 fI(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=`
376
377`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,s,(l,c,u,d)=>{var f;l.isBlock&&c>r&&(a+=i);const h=o==null?void 0:o[l.type.name];if(h)return u&&(a+=h({node:l,pos:c,parent:u,index:d,range:e})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)==null?void 0:f.slice(Math.max(r,c)-c,s-c))}),a}function p7(t,e){const n={from:0,to:t.content.size};return fI(t,n,e)}function hI(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function m7(t,e){const n=bt(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 pI(t,e){const n=Nm(typeof e=="string"?e:e.name,t.schema);return n==="node"?m7(t,e):n==="mark"?aI(t,e):{}}function g7(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 y7(t){const e=g7(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 mI(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const c=e.slice(i).map(a,-1),u=e.slice(i).map(l),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),y7(r)}function Dw(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=n.resolve(t),o=jw(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 v7=(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 wc(t,e){return e.nodes[t]||e.marks[t]||null}function Gf(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 b7=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,a)=>{var l,c;const u=((c=(l=s.type.spec).toText)==null?void 0:c.call(l,{node:s,pos:i,parent:o,index:a}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-i))}),n};function w0(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?Fs(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>np(d.attrs,n,{strict:!1}));let o=0;const a=[];if(s.forEach(({$from:d,$to:f})=>{const h=d.pos,p=f.pos;t.doc.nodesBetween(h,p,(g,y)=>{if(i&&g.inlineContent&&!g.type.allowsMarkType(i))return!1;if(!g.isText&&!g.marks.length)return;const v=Math.max(h,y),b=Math.min(p,y+g.nodeSize),w=b-v;o+=w,a.push(...g.marks.map(k=>({mark:k,from:v,to:b})))})}),o===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>np(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=a.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+c:l)>=o}function w7(t,e,n={}){if(!e)return Ki(t,null,n)||w0(t,null,n);const r=Nm(e,t.schema);return r==="node"?Ki(t,e,n):r==="mark"?w0(t,e,n):!1}var x7=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=Om(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)},k7=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function ME(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function LE(t,e){const{nodeExtensions:n}=Vl(e),r=n.find(o=>o.name===t);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=Me(le(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function Rm(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.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&&(Rm(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function gI(t){return t instanceof ue}var yI=class vI{constructor(e){this.position=e}static fromJSON(e){return new vI(e.position)}toJSON(){return{position:this.position}}};function S7(t,e){const n=e.mapping.mapResult(t.position);return{position:new yI(n.pos),mapResult:n}}function E7(t){return new yI(t)}function C7(t,e,n){var r;const{selection:s}=e;let i=null;if(rI(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(c=>c.type.excludes(n)))}const{ranges:o}=s;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=h&&p}return!c}),c})}var _7=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:a}=i,l=Fs(t,r.schema);if(s)if(o){const c=aI(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),g=Math.min(h+f.nodeSize,d);f.marks.find(v=>v.type===l)?f.marks.forEach(v=>{l===v.type&&n.addMark(p,g,l.create({...v.attrs,...e}))}):n.addMark(p,g,l.create(e))})});return C7(r,n,l)},T7=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),A7=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=bt(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})=>GS(i,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>GS(i,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},N7=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=ko(t,0,r.content.size),i=ue.create(r,s);e.setSelection(i)}return!0},O7=(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,(l,c)=>{l.isText||n.setNodeMarkup(c,void 0,{...l.attrs,dir:t})}),!0},R7=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,l=ko(s,o,a),c=ko(i,o,a),u=me.create(r,l,c);e.setSelection(u)}return!0},P7=t=>({state:e,dispatch:n})=>{const r=bt(t,e.schema);return E9(r)(e,n)};function DE(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 I7=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:a,$to:l}=i,c=s.extensionManager.attributes,u=Gf(c,a.node().type.name,a.node().attrs);if(i instanceof ue&&i.node.isBlock)return!a.parentOffset||!cl(o,a.pos)?!1:(r&&(t&&DE(n,s.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:o7(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0,p=cl(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&cl(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:u}]:void 0),r){if(p&&(i instanceof me&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,h),f&&!d&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&DE(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return p},j7=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{var o;const a=bt(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==a)return!1;const f=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(s){let v=F.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let T=l.depth-b;T>=l.depth-3;T-=1)v=F.from(l.node(T).copy(v));const w=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,k={...Gf(f,l.node().type.name,l.node().attrs),...e},S=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(k))||void 0;v=v.append(F.from(a.createAndFill(null,S)||void 0));const C=l.before(l.depth-(b-1));n.replace(C,l.after(-w),new X(v,4-b,0));let E=-1;n.doc.nodesBetween(C,n.doc.content.size,(T,N)=>{if(E>-1)return!1;T.isTextblock&&T.content.size===0&&(E=N+1)}),E>-1&&n.setSelection(me.near(n.doc.resolve(E))),n.scrollIntoView()}return!0}const h=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,p={...Gf(f,d.type.name,d.attrs),...e},g={...Gf(f,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const y=h?[{type:a,attrs:p},{type:h,attrs:g}]:[{type:a,attrs:p}];if(!cl(n.doc,l.pos,2))return!1;if(s){const{selection:v,storedMarks:b}=r,{splittableMarks:w}=i.extensionManager,k=b||v.$to.parentOffset&&v.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!k||!s)return!0;const S=k.filter(C=>w.includes(C.type.name));n.ensureMarks(S)}return!0},sy=(t,e)=>{const n=Om(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)&&Yi(t.doc,n.pos)&&t.join(n.pos),!0},iy=(t,e)=>{const n=Om(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)&&Yi(t.doc,r)&&t.join(r),!0},M7=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=s.extensionManager,h=bt(t,o.schema),p=bt(e,o.schema),{selection:g,storedMarks:y}=o,{$from:v,$to:b}=g,w=v.blockRange(b),k=y||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const S=Om(C=>LE(C.type.name,d))(g);if(w.depth>=1&&S&&w.depth-S.depth<=1){if(S.node.type===h)return c.liftListItem(p);if(LE(S.node.type.name,d)&&h.validContent(S.node.content)&&a)return l().command(()=>(i.setNodeMarkup(S.pos,h),!0)).command(()=>sy(i,h)).command(()=>iy(i,h)).run()}return!n||!k||!a?l().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>sy(i,h)).command(()=>iy(i,h)).run():l().command(()=>{const C=u().wrapInList(h,r),E=k.filter(T=>f.includes(T.type.name));return i.ensureMarks(E),C?!0:c.clearNodes()}).wrapInList(h,r).command(()=>sy(i,h)).command(()=>iy(i,h)).run()},L7=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=Fs(t,r.schema);return w0(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},D7=(t,e,n={})=>({state:r,commands:s})=>{const i=bt(t,r.schema),o=bt(e,r.schema),a=Ki(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?s.setNode(o,l):s.setNode(i,{...l,...n})},$7=(t,e={})=>({state:n,commands:r})=>{const s=bt(t,n.schema);return Ki(n,s,e)?r.lift(s):r.wrapIn(s,e)},F7=()=>({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 l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else o.delete(i.from,i.to)}return!0}}return!1},B7=()=>({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},z7=(t,e={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Fs(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!s)return!0;if(u&&o){let{from:f,to:h}=a;const p=(i=c.marks().find(y=>y.type===l))==null?void 0:i.attrs,g=jw(c,l,p);g&&(f=g.from,h=g.to),n.removeMark(f,h,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},U7=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,l)=>{if(a.isText)return;const c={...a.attrs};delete c.dir,e.setNodeMarkup(l,void 0,c)}),!0},V7=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=Nm(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=bt(t,r.schema)),a==="mark"&&(o=Fs(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;let f,h,p,g;n.selection.empty?r.doc.nodesBetween(u,d,(y,v)=>{i&&i===y.type&&(l=!0,p=Math.max(v,u),g=Math.min(v+y.nodeSize,d),f=v,h=y)}):r.doc.nodesBetween(u,d,(y,v)=>{v<u&&i&&i===y.type&&(l=!0,p=Math.max(v,u),g=Math.min(v+y.nodeSize,d),f=v,h=y),v>=u&&v<=d&&(i&&i===y.type&&(l=!0,s&&n.setNodeMarkup(v,void 0,{...y.attrs,...e})),o&&y.marks.length&&y.marks.forEach(b=>{if(o===b.type&&(l=!0,s)){const w=Math.max(v,u),k=Math.min(v+y.nodeSize,d);n.addMark(w,k,o.create({...b.attrs,...e}))}}))}),h&&(f!==void 0&&s&&n.setNodeMarkup(f,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(y=>{o===y.type&&s&&n.addMark(p,g,o.create({...y.attrs,...e}))}))}),l},H7=(t,e={})=>({state:n,dispatch:r})=>{const s=bt(t,n.schema);return y9(s,e)(n,r)},W7=(t,e={})=>({state:n,dispatch:r})=>{const s=bt(t,n.schema);return v9(s,e)(n,r)},q7=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={}}},Pm=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},K7=(t,e)=>{if(Iw(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 gf(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=b7(c)+i;return o.forEach(f=>{if(u)return;const h=K7(d,f.find);if(!h)return;const p=l.state.tr,g=Tm({state:l.state,transaction:p}),y={from:r-(h[0].length-i.length),to:s},{commands:v,chain:b,can:w}=new Am({editor:n,state:g});f.handler({state:g,range:y,match:h,commands:v,chain:b,can:w})===null||!p.steps.length||(f.undoable&&p.setMeta(a,{transform:p,from:r,to:s,text:i}),l.dispatch(p),u=!0)}),u}function G7(t){const{editor:e,rules:n}=t,r=new rt({state:{init(){return null},apply(s,i,o){const a=s.getMeta(r);if(a)return a;const l=s.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=Lw(F.from(u),o.schema);const{from:d}=l,f=d+u.length;gf({editor:e,from:d,to:f,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,a){return gf({editor:e,from:i,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&gf({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?gf({editor:e,from:o.pos,to:o.pos,text:`
378`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function J7(t){return Object.prototype.toString.call(t).slice(8,-1)}function yf(t){return J7(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function bI(t,e){const n={...t};return yf(t)&&yf(e)&&Object.keys(e).forEach(r=>{yf(e[r])&&yf(t[r])?n[r]=bI(t[r],e[r]):n[r]=e[r]}),n}var $w=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{...Me(le(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Me(le(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>bI(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}},ua=class wI extends $w{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new wI(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(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=o.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),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 Q7(t){return typeof t=="number"}var Z7=class{constructor(t){this.find=t.find,this.handler=t.handler}},Y7=(t,e,n)=>{if(Iw(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 X7(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:c,can:u}=new Am({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,s,(h,p)=>{var g,y,v,b,w;if((y=(g=h.type)==null?void 0:g.spec)!=null&&y.code||!(h.isText||h.isTextblock||h.isInline))return;const k=(w=(b=(v=h.content)==null?void 0:v.size)!=null?b:h.nodeSize)!=null?w:0,S=Math.max(r,p),C=Math.min(s,p+k);if(S>=C)return;const E=h.isText?h.text||"":h.textBetween(S-p,C-p,void 0,"");Y7(E,i.find,o).forEach(N=>{if(N.index===void 0)return;const P=S+N.index+1,q=P+N[0].length,R={from:n.tr.mapping.map(P),to:n.tr.mapping.map(q)},D=i.handler({state:n,range:R,match:N,commands:l,chain:c,can:u,pasteEvent:o,dropEvent:a});d.push(D)})}),d.every(h=>h!==null)}var vf=null,eG=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function tG(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 l=({state:u,from:d,to:f,rule:h,pasteEvt:p})=>{const g=u.tr,y=Tm({state:u,transaction:g});if(!(!X7({editor:e,state:y,from:Math.max(d-1,0),to:f.b-1,rule:h,pasteEvent:p,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new rt({view(d){const f=p=>{var g;r=(g=d.dom.parentElement)!=null&&g.contains(p.target)?d.dom.parentElement:null,r&&(vf=e)},h=()=>{vf&&(vf=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(i=r===d.dom.parentElement,a=f,!i){const h=vf;h!=null&&h.isEditable&&setTimeout(()=>{const p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,f)=>{var h;const p=(h=f.clipboardData)==null?void 0:h.getData("text/html");return o=f,s=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,h)=>{const p=d[0],g=p.getMeta("uiEvent")==="paste"&&!s,y=p.getMeta("uiEvent")==="drop"&&!i,v=p.getMeta("applyPasteRules"),b=!!v;if(!g&&!y&&!b)return;if(b){let{text:S}=v;typeof S=="string"?S=S:S=Lw(F.from(S),h.schema);const{from:C}=v,E=C+S.length,T=eG(S);return l({rule:u,state:h,from:C,to:{b:E},pasteEvt:T})}const w=f.doc.content.findDiffStart(h.doc.content),k=f.doc.content.findDiffEnd(h.doc.content);if(!(!Q7(w)||!k||w===k.b))return l({rule:u,state:h,from:w,to:k,pasteEvt:o})}}))}var Im=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=dI(t),this.schema=f7(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:wc(e.name,this.schema)},r=le(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return ru([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:wc(r.name,this.schema)},i=[],o=le(r,"addKeyboardShortcuts",s);let a={};if(r.type==="mark"&&le(r,"exitable",s)&&(a.ArrowRight=()=>ua.handleExit({editor:t,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([h,p])=>[h,()=>p({editor:t})]));a={...a,...f}}const l=pK(a);i.push(l);const c=le(r,"addInputRules",s);if(ME(r,t.options.enableInputRules)&&c){const f=c();if(f&&f.length){const h=G7({editor:t,rules:f}),p=Array.isArray(h)?h:[h];i.push(...p)}}const u=le(r,"addPasteRules",s);if(ME(r,t.options.enablePasteRules)&&u){const f=u();if(f&&f.length){const h=tG({editor:t,rules:f});i.push(...h)}}const d=le(r,"addProseMirrorPlugins",s);if(d){const f=d();i.push(...f)}return i})}get attributes(){return uI(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Vl(this.extensions);return Object.fromEntries(e.filter(n=>!!le(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:bt(n.name,this.schema)},i=le(n,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const a=(l,c,u,d,f)=>{const h=Xu(l,r);return o({node:l,view:c,getPos:u,decorations:d,innerDecorations:f,editor:t,extension:n,HTMLAttributes:h})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return ru([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:wc(s.name,this.schema)},o=le(s,"dispatchTransaction",i);return o?a=>{o.call(i,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return ru([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:wc(s.name,this.schema)},o=le(s,"transformPastedHTML",i);return o?(a,l)=>{const c=r(a,l);return o.call(i,c)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Vl(this.extensions);return Object.fromEntries(e.filter(n=>!!le(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:Fs(n.name,this.schema)},i=le(n,"addMarkView",s);if(!i)return[];const o=(a,l,c)=>{const u=Xu(a,r);return i()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:u,updateAttributes:d=>{mG(a,t,d)}})};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:wc(e.name,this.schema)};e.type==="mark"&&((n=Me(le(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const s=le(e,"onBeforeCreate",r),i=le(e,"onCreate",r),o=le(e,"onUpdate",r),a=le(e,"onSelectionUpdate",r),l=le(e,"onTransaction",r),c=le(e,"onFocus",r),u=le(e,"onBlur",r),d=le(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),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}};Im.resolve=dI;Im.sort=ru;Im.flatten=Mw;var nG={};Pw(nG,{ClipboardTextSerializer:()=>kI,Commands:()=>SI,Delete:()=>EI,Drop:()=>CI,Editable:()=>_I,FocusEvents:()=>AI,Keymap:()=>NI,Paste:()=>OI,Tabindex:()=>RI,TextDirection:()=>PI,focusEventsPluginKey:()=>TI});var ht=class xI extends $w{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new xI(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},kI=ht.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new rt({key:new _t("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(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos)),l=hI(n);return fI(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),SI=ht.create({name:"commands",addCommands(){return{...tI}}}),EI=ht.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,s;const i=()=>{var o,a,l,c;if((c=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?c:t.getMeta("y-sync$"))return;const u=lI(t.before,[t,...e]);mI(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,g)=>{const y=g+p.nodeSize-2,v=h.oldRange.from<=g&&y<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:g,to:y,newFrom:u.mapping.map(g),newTo:u.mapping.map(y),deletedRange:h.oldRange,newRange:h.newRange,partial:!v,editor:this.editor,transaction:t,combinedTransform:u})})});const f=u.mapping;u.steps.forEach((h,p)=>{var g,y;if(h instanceof Sr){const v=f.slice(p).map(h.from,-1),b=f.slice(p).map(h.to),w=f.invert().map(v,-1),k=f.invert().map(b),S=(g=u.doc.nodeAt(v-1))==null?void 0:g.marks.some(E=>E.eq(h.mark)),C=(y=u.doc.nodeAt(b))==null?void 0:y.marks.some(E=>E.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:w,to:k},newRange:{from:v,to:b},partial:!!(C||S),editor:this.editor,transaction:t,combinedTransform:u})}})};(s=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),CI=ht.create({name:"drop",addProseMirrorPlugins(){return[new rt({key:new _t("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),_I=ht.create({name:"editable",addProseMirrorPlugins(){return[new rt({key:new _t("editable"),props:{editable:()=>this.editor.options.editable}})]}}),TI=new _t("focusEvents"),AI=ht.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new rt({key:TI,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}}}})]}}),NI=ht.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:f,parent:h}=d,p=d.parent.isTextblock&&f>0?a.doc.resolve(f-1):d,g=p.parent.type.spec.isolating,y=d.pos-d.parentOffset,v=g&&p.parent.childCount===1?y===d.pos:ke.atStart(c).from===f;return!u||!h.type.isTextblock||h.textContent.length||!v||v&&d.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 rp()||oI()?i:s},addProseMirrorPlugins(){return[new rt({key:new _t("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),s=t.some(g=>g.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:a}=e.selection,l=ke.atStart(e.doc).from,c=ke.atEnd(e.doc).to;if(i||!(o===l&&a===c)||!Rm(n.doc))return;const f=n.tr,h=Tm({state:n,transaction:f}),{commands:p}=new Am({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),OI=ht.create({name:"paste",addProseMirrorPlugins(){return[new rt({key:new _t("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),RI=ht.create({name:"tabindex",addProseMirrorPlugins(){return[new rt({key:new _t("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),PI=ht.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Vl(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 rt({key:new _t("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),rG=class jc{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 jc(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 jc(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 jc(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 l=this.resolvedPos.doc.resolve(a);if(!s&&!o&&l.depth<=this.depth)return;const c=new jc(l,this.editor,s,s||o?n:null);s&&(c.actualDepth=this.depth+1),e.push(c)}),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 l=o[a];if(i[l]!==n[l])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(l=>n[l]===o.node.attrs[l])&&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)}},sG=`.ProseMirror {
379  position: relative;
380}
381
382.ProseMirror {
383  word-wrap: break-word;
384  white-space: pre-wrap;
385  white-space: break-spaces;
386  -webkit-font-variant-ligatures: none;
387  font-variant-ligatures: none;
388  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
389}
390
391.ProseMirror [contenteditable="false"] {
392  white-space: normal;
393}
394
395.ProseMirror [contenteditable="false"] [contenteditable="true"] {
396  white-space: pre-wrap;
397}
398
399.ProseMirror pre {
400  white-space: pre-wrap;
401}
402
403img.ProseMirror-separator {
404  display: inline !important;
405  border: none !important;
406  margin: 0 !important;
407  width: 0 !important;
408  height: 0 !important;
409}
410
411.ProseMirror-gapcursor {
412  display: none;
413  pointer-events: none;
414  position: absolute;
415  margin: 0;
416}
417
418.ProseMirror-gapcursor:after {
419  content: "";
420  display: block;
421  position: absolute;
422  top: -2px;
423  width: 20px;
424  border-top: 1px solid black;
425  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
426}
427
428@keyframes ProseMirror-cursor-blink {
429  to {
430    visibility: hidden;
431  }
432}
433
434.ProseMirror-hideselection *::selection {
435  background: transparent;
436}
437
438.ProseMirror-hideselection *::-moz-selection {
439  background: transparent;
440}
441
442.ProseMirror-hideselection * {
443  caret-color: transparent;
444}
445
446.ProseMirror-focused .ProseMirror-gapcursor {
447  display: block;
448}`;function iG(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 oG=class extends q7{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:S7,createMappablePosition:E7},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=sI(e,this.options.autofocus);this.editorState=Qa.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=iG(sG,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}
vendor: 8,279 bytes, lines 448-450
448),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=cI(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?[_I,kI.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),SI,AI,NI,RI,CI,OI,EI,PI.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 Im(r,this)}createCommandManager(){this.commandManager=new Am({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=b0(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=b0(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 XP(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 l=this.view.dom;l.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(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});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(c=>c.getMeta("focus")||c.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return pI(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return w7(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Lw(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
449
450`,textSerializers:n={}}=t||{};return p7(this.state.doc,{blockSeparator:e,textSerializers:{...hI(this.schema),...n}})}get isEmpty(){return Rm(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 rG(e,this)}get $doc(){return this.$pos(0)}};function Hl(t){return new Pm({find:t.find,handler:({state:e,range:n,match:r})=>{const s=Me(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 l=a.search(/\S/),c=n.from+a.indexOf(o),u=c+o.length;if(Dw(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+l,c);const f=n.from+l+o.length;i.addMark(n.from+l,f,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function aG(t){return new Pm({find:t.find,handler:({state:e,range:n,match:r})=>{const s=Me(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let a=n.to;const l=t.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,o+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?o:o-1;i.insert(c,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(a))}i.scrollIntoView()},undoable:t.undoable})}function x0(t){return new Pm({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=Me(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 Wl(t){return new Pm({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=Me(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),c=l&&bw(l,t.type,i);if(!c)return null;if(o.wrap(l,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=t.editor.extensionManager,p=f||d.$to.parentOffset&&d.$from.marks();if(p){const g=p.filter(y=>h.includes(y.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(d,i).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Yi(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)},undoable:t.undoable})}function lG(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof ue){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 cG={};Pw(cG,{createAtomBlockMarkdownSpec:()=>uG,createBlockMarkdownSpec:()=>dG,createInlineMarkdownSpec:()=>pG,parseAttributes:()=>Fw,parseIndentedBlocks:()=>k0,renderNestedMarkdownContent:()=>zw,serializeAttributes:()=>Bw});function Fw(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}
450__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.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(([,c,u])=>{var d;const f=parseInt(((d=u.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),h=n[f];h&&(e[c]=h.slice(1,-1))});const l=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 l&&l.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function Bw(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 uG(t){const{nodeName:e,name:n,parseAttributes:r=Fw,serializeAttributes:s=Bw,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:a}=t,l=n||e,c=u=>{if(!a)return u;const d={};return a.forEach(f=>{f in u&&(d[f]=u[f])}),d};return{parseMarkdown:(u,d)=>{const f={...i,...u.attributes};return d.createNode(e,f,[])},markdownTokenizer:{name:e,level:"block",start(u){var d;const f=new RegExp(`^:::${l}(?:\\s|$)`,"m"),h=(d=u.match(f))==null?void 0:d.index;return h!==void 0?h:-1},tokenize(u,d,f){const h=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=u.match(h);if(!p)return;const g=p[1]||"",y=r(g);if(!o.find(b=>!(b in y)))return{type:e,raw:p[0],attributes:y}}},renderMarkdown:u=>{const d=c(u.attrs||{}),f=s(d),h=f?` {${f}}`:"";return`:::${l}${h} :::`}}}function dG(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=Fw,serializeAttributes:i=Bw,defaultAttributes:o={},content:a="block",allowedAttributes:l}=t,c=n||e,u=d=>{if(!l)return d;const f={};return l.forEach(h=>{h in d&&(f[h]=d[h])}),f};return{parseMarkdown:(d,f)=>{let h;if(r){const g=r(d);h=typeof g=="string"?[{type:"text",text:g}]:g}else a==="block"?h=f.parseChildren(d.tokens||[]):h=f.parseInline(d.tokens||[]);const p={...o,...d.attributes};return f.createNode(e,p,h)},markdownTokenizer:{name:e,level:"block",start(d){var f;const h=new RegExp(`^:::${c}`,"m"),p=(f=d.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(d,f,h){var p;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=d.match(g);if(!y)return;const[v,b=""]=y,w=s(b);let k=1;const S=v.length;let C="";const E=/^:::([\w-]*)(\s.*)?/gm,T=d.slice(S);for(E.lastIndex=0;;){const N=E.exec(T);if(N===null)break;const P=N.index,q=N[1];if(!((p=N[2])!=null&&p.endsWith(":::"))){if(q)k+=1;else if(k-=1,k===0){const R=T.slice(0,P);C=R.trim();const D=d.slice(0,S+P+N[0].length);let I=[];if(C)if(a==="block")for(I=h.blockTokens(R),I.forEach(H=>{H.text&&(!H.tokens||H.tokens.length===0)&&(H.tokens=h.inlineTokens(H.text))});I.length>0;){const H=I[I.length-1];if(H.type==="paragraph"&&(!H.text||H.text.trim()===""))I.pop();else break}else I=h.inlineTokens(C);return{type:e,raw:D,attributes:w,content:C,tokens:I}}}}}},renderMarkdown:(d,f)=>{const h=u(d.attrs||{}),p=i(h),g=p?` {${p}}`:"",y=f.renderChildren(d.content||[],`
451
452`);return`:::${c}${g}
453
454${y}
455
456:::`}}}function fG(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 hG(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function pG(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=fG,serializeAttributes:i=hG,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=t,c=n||e,u=f=>{if(!l)return f;const h={};return l.forEach(p=>{const g=typeof p=="string"?p:p.name,y=typeof p=="string"?void 0:p.skipIfDefault;if(g in f){const v=f[g];if(y!==void 0&&v===y)return;h[g]=v}}),h},d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,h)=>{const p={...o,...f.attributes};if(a)return h.createNode(e,p);const g=r?r(f):f.content||"";return g?h.createNode(e,p,[h.createTextNode(g)]):h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(f){const h=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),p=f.match(h),g=p==null?void 0:p.index;return g!==void 0?g:-1},tokenize(f,h,p){const g=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),y=f.match(g);if(!y)return;let v="",b="";if(a){const[,k]=y;b=k}else{const[,k,S]=y;b=k,v=S||""}const w=s(b.trim());return{type:e,raw:y[0],content:v.trim(),attributes:w}}},renderMarkdown:f=>{let h="";r?h=r(f):f.content&&f.content.length>0&&(h=f.content.filter(v=>v.type==="text").map(v=>v.text).join(""));const p=u(f.attrs||{}),g=i(p),y=g?` ${g}`:"";return a?`[${c}${y}]`:`[${c}${y}]${h}[/${c}]`}}}function k0(t,e,n){var r,s,i,o;const a=t.split(`
457`),l=[];let c="",u=0;const d=e.baseIndentSize||2;for(;u<a.length;){const f=a[u],h=f.match(e.itemPattern);if(!h){if(l.length>0)break;if(f.trim()===""){u+=1,c=`${c}${f}
458`;continue}else return}const p=e.extractItemData(h),{indentLevel:g,mainContent:y}=p;c=`${c}${f}
459`;const v=[y];for(u+=1;u<a.length;){const S=a[u];if(S.trim()===""){const E=a.slice(u+1).findIndex(P=>P.trim()!=="");if(E===-1)break;if((((s=(r=a[u+1+E].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:s.length)||0)>g){v.push(S),c=`${c}${S}
460`,u+=1;continue}else break}if((((o=(i=S.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>g)v.push(S),c=`${c}${S}
461`,u+=1;else break}let b;const w=v.slice(1);if(w.length>0){const S=w.map(C=>C.slice(g+d)).join(`
462`);S.trim()&&(e.customNestedParser?b=e.customNestedParser(S):b=n.blockTokens(S))}const k=e.createToken(p,b);l.push(k)}if(l.length!==0)return{items:l,raw:c}}function zw(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 l=`${s}${a}`;return o&&o.length>0&&o.forEach((c,u)=>{var d,f;const h=(f=(d=e.renderChild)==null?void 0:d.call(e,c,u+1))!=null?f:e.renderChildren([c]);if(h!=null){const p=h.split(`
463`).map(g=>g?e.indent(g):e.indent("")).join(`
464`);l+=c.type==="paragraph"?`
465
466${p}`:`
467${p}`}}),l}function mG(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((a,l)=>{const c=i.mapping.map(l),u=i.mapping.map(l)+a.nodeSize;let d=null;if(a.marks.forEach(h=>{if(h!==o)return!1;d=h}),!d)return;let f=!1;
467if(Object.keys(n).forEach(h=>{n[h]!==d.attrs[h]&&(f=!0)}),f){const h=t.type.create({...t.attrs,...n});i.removeMark(c,u,t.type),i.addMark(c,u,h)}}),i.docChanged&&e.view.dispatch(i)}var $n=class II extends $w{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new II(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function ta(t){return new Z7({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=Me(t.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),f=d+a.length;if(Dw(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(y=>y===t.type&&y!==p.mark.type)).filter(p=>p.to>d).length)return null;f<n.to&&o.delete(f,n.to),d>n.from&&o.delete(n.from+u,d),c=n.from+u+a.length,o.addMark(n.from+u,c,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:gG,getOwnPropertySymbols:yG}=Object,{hasOwnProperty:vG}=Object.prototype;function oy(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function bf(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 l=t(n,r,s);return i.delete(n),i.delete(r),l}}function bG(t){return t!=null?t[Symbol.toStringTag]:void 0}function $E(t){return gG(t).concat(yG(t))}const wG=Object.hasOwn||((t,e)=>vG.call(t,e));function da(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const xG="__v",kG="__o",SG="_owner",{getOwnPropertyDescriptor:FE,keys:BE}=Object;function EG(t,e){return t.byteLength===e.byteLength&&sp(new Uint8Array(t),new Uint8Array(e))}function CG(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 _G(t,e){return t.byteLength===e.byteLength&&sp(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function TG(t,e){return da(t.getTime(),e.getTime())}function AG(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function NG(t,e){return t===e}function zE(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,l=0;for(;(o=i.next())&&!o.done;){const c=e.entries();let u=!1,d=0;for(;(a=c.next())&&!a.done;){if(s[d]){d++;continue}const f=o.value,h=a.value;if(n.equals(f[0],h[0],l,d,t,e,n)&&n.equals(f[1],h[1],f[0],h[0],t,e,n)){u=s[d]=!0;break}d++}if(!u)return!1;l++}return!0}const OG=da;function RG(t,e,n){const r=BE(t);let s=r.length;if(BE(e).length!==s)return!1;for(;s-- >0;)if(!jI(t,e,n,r[s]))return!1;return!0}function xc(t,e,n){const r=$E(t);let s=r.length;if($E(e).length!==s)return!1;let i,o,a;for(;s-- >0;)if(i=r[s],!jI(t,e,n,i)||(o=FE(t,i),a=FE(e,i),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function PG(t,e){return da(t.valueOf(),e.valueOf())}function IG(t,e){return t.source===e.source&&t.flags===e.flags}function UE(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 l=e.values();let c=!1,u=0;for(;(a=l.next())&&!a.done;){if(!s[u]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function sp(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 jG(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 jI(t,e,n,r){return(r===SG||r===kG||r===xG)&&(t.$$typeof||e.$$typeof)?!0:wG(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const MG="[object ArrayBuffer]",LG="[object Arguments]",DG="[object Boolean]",$G="[object DataView]",FG="[object Date]",BG="[object Error]",zG="[object Map]",UG="[object Number]",VG="[object Object]",HG="[object RegExp]",WG="[object Set]",qG="[object String]",KG={"[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
467]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},GG="[object URL]",JG=Object.prototype.toString;function QG({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:p}){return function(y,v,b){if(y===v)return!0;if(y==null||v==null)return!1;const w=typeof y;if(w!==typeof v)return!1;if(w!=="object")return w==="number"?a(y,v,b):w==="function"?i(y,v,b):!1;const k=y.constructor;if(k!==v.constructor)return!1;if(k===Object)return l(y,v,b);if(Array.isArray(y))return e(y,v,b);if(k===Date)return r(y,v,b);if(k===RegExp)return u(y,v,b);if(k===Map)return o(y,v,b);if(k===Set)return d(y,v,b);const S=JG.call(y);if(S===FG)return r(y,v,b);if(S===HG)return u(y,v,b);if(S===zG)return o(y,v,b);if(S===WG)return d(y,v,b);if(S===VG)return typeof y.then!="function"&&typeof v.then!="function"&&l(y,v,b);if(S===GG)return h(y,v,b);if(S===BG)return s(y,v,b);if(S===LG)return l(y,v,b);if(KG[S])return f(y,v,b);if(S===MG)return t(y,v,b);if(S===$G)return n(y,v,b);if(S===DG||S===UG||S===qG)return c(y,v,b);if(p){let C=p[S];if(!C){const E=bG(y);E&&(C=p[E])}if(C)return C(y,v,b)}return!1}}function ZG({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:EG,areArraysEqual:n?xc:CG,areDataViewsEqual:_G,areDatesEqual:TG,areErrorsEqual:AG,areFunctionsEqual:NG,areMapsEqual:n?oy(zE,xc):zE,areNumbersEqual:OG,areObjectsEqual:n?xc:RG,arePrimitiveWrappersEqual:PG,areRegExpsEqual:IG,areSetsEqual:n?oy(UE,xc):UE,areTypedArraysEqual:n?oy(sp,xc):sp,areUrlsEqual:jG,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=bf(r.areArraysEqual),i=bf(r.areMapsEqual),o=bf(r.areObjectsEqual),a=bf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:a})}return r}function YG(t){return function(e,n,r,s,i,o,a){return t(e,n,a)}}function XG({circular:t,comparator:e,createState:n,equals:r,strict:s}){if(n)return function(a,l){const{cache:c=t?new WeakMap:void 0,meta:u}=n();return e(a,l,{cache:c,equals:r,meta:u,strict:s})};if(t)return function(a,l){return e(a,l,{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,l){return e(a,l,i)}}const eJ=eo();eo({strict:!0});eo({circular:!0});eo({circular:!0,strict:!0});eo({createInternalComparator:()=>da});eo({strict:!0,createInternalComparator:()=>da});eo({circular:!0,createInternalComparator:()=>da});eo({circular:!0,createInternalComparator:()=>da,strict:!0});function eo(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=ZG(t),o=QG(i),a=n?n(o):YG(o);return XG({circular:e,comparator:o,createState:r,equals:a,strict:s})}var MI={exports:{}},LI={};/**
468 * @license React
469 * use-sync-external-store-shim/with-selector.production.js
470 *
471 * Copyright (c) Meta Platforms, Inc. and affiliates.
472 *
473 * This source code is licensed under the MIT license found in the
474 * LICENSE file in the root directory of this source tree.
475 */var jm=x,tJ=gw;function nJ(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var rJ=typeof Object.is=="function"?Object.is:nJ,sJ=tJ.useSyncExternalStore,iJ=jm.useRef,oJ=jm.useEffect,aJ=jm.useMemo,lJ=jm.useDebugValue;LI.useSyncExternalStoreWithSelector=function(t,e,n,r,s){var i=iJ(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=aJ(function(){function l(h){if(!c){if(c=!0,u=h,h=r(h),s!==void 0&&o.hasValue){var p=o.value;if(s(p,h))return d=p}return d=h}if(p=d,rJ(u,h))return p;var g=r(h);return s!==void 0&&s(p,g)?(u=h,p):(u=h,d=g)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,n,r,s]);var a=sJ(t,i[0],i[1]);return oJ(function(){o.hasValue=!0,o.value=a},[a]),lJ(a),a};MI.exports=LI;var cJ=MI.exports,uJ=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},dJ=({contentComponent:t})=>{const e=gw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return m.jsx(m.Fragment,{children:Object.values(e)})};function fJ(){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]:Ob.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 hJ=class extends M.Component{constructor(t){var e;super(t),this.editorContentRef=M.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=fJ(),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 m.jsxs(m.Fragment,{children:[m.jsx("div",{ref:uJ(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&m.jsx(dJ,{contentComponent:t.contentComponent})]})}},pJ=x.forwardRef((t,e)=>{const n=M.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return M.createElement(hJ,{key:n,innerRef:e,...t})}),DI=M.memo(pJ),mJ=typeof window<"u"?x.useLayoutEffect:x.useEffect,gJ=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0}
475,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 yJ(t){var e;const[n]=x.useState(()=>new gJ(t.editor)),r=cJ.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:eJ);return mJ(()=>n.watch(t.editor),[t.editor,n]),x.useDebugValue(r),r}var vJ=!1,S0=typeof window>"u",bJ=S0||!!(typeof window<"u"&&window.next),wJ=class $I{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 S0||bJ?null:this.createEditor();if(this.options.current.immediatelyRender&&S0&&vJ)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)},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 oG(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?$I.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}
475):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 xJ(t={},e=[]){const n=x.useRef(t);n.current=t;const[r]=x.useState(()=>new wJ(n)),s=gw.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return x.useDebugValue(s),x.useEffect(r.onRender(e)),yJ({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}var FI=x.createContext({editor:null});FI.Consumer;var kJ=x.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),SJ=()=>x.useContext(kJ);M.forwardRef((t,e)=>{const{onDragStart:n}=SJ(),r=t.as||"div";return m.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});M.createContext({markViewContentRef:()=>{}});var Uw=x.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Uw.displayName="TiptapContext";var EJ=()=>x.useContext(Uw);function BI({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=x.useMemo(()=>({editor:r}),[r]),i=x.useMemo(()=>({editor:r}),[r]);return m.jsx(FI.Provider,{value:i,children:m.jsx(Uw.Provider,{value:s,children:n})})}BI.displayName="Tiptap";function zI({...t}){const{editor:e}=EJ();return m.jsx(DI,{editor:e,...t})}zI.displayName="Tiptap.Content";Object.assign(BI,{Content:zI});var ip=(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]},CJ=/^\s*>\s$/,_J=$n.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return ip("blockquote",{...wt(this.options.HTMLAttributes,t),children:ip("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 u=((a=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?a:e.renderChildren([s])).split(`
476`).map(d=>d.trim()===""?n:`${n} ${d}`);r.push(u.join(`
477`))}),r.join(`
478${n}
479`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Wl({find:CJ,type:this.type})]}}),TJ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,AJ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,NJ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,OJ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,RJ=ua.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 ip("strong",{...wt(this.options.HTMLAttributes,t),children:ip("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
vendor: 7,850 bytes, lines 479-500
479,addInputRules(){return[Hl({find:TJ,type:this.type}),Hl({find:NJ,type:this.type})]},addPasteRules(){return[ta({find:AJ,type:this.type}),ta({find:OJ,type:this.type})]}}),PJ=/(^|[^`])`([^`]+)`(?!`)$/,IJ=/(^|[^`])`([^`]+)`(?!`)/g,jJ=ua.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",wt(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[Hl({find:PJ,type:this.type})]},addPasteRules(){return[ta({find:IJ,type:this.type})]}}),ay=4,MJ=/^```([a-z]+)?[\s\n]$/,LJ=/^~~~([a-z]+)?[\s\n]$/,DJ=$n.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:ay,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",wt(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(`
480`):r=`\`\`\`${s}
481
482\`\`\``,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:ay,{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:l})=>{const{from:c,to:u}=s,h=r.doc.textBetween(c,u,`
483`,`
484`).split(`
485`).map(p=>a+p).join(`
486`);return l.replaceWith(c,u,r.schema.text(h)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:ay,{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 l;const{pos:c}=i,u=i.start(),d=i.end(),h=r.doc.textBetween(u,d,`
487`,`
488`).split(`
489`);let p=0,g=0;const y=c-u;for(let C=0;C<h.length;C+=1){if(g+h[C].length>=y){p=C;break}g+=h[C].length+1}const b=((l=h[p].match(/^ */))==null?void 0:l[0])||"",w=Math.min(b.length,n);if(w===0)return!0;let k=u;for(let C=0;C<p;C+=1)k+=h[C].length+1;return a.delete(k,k+w),c-k<=w&&a.setSelection(me.create(a.doc,k)),!0}):t.commands.command(({tr:a})=>{const{from:l,to:c}=s,f=r.doc.textBetween(l,c,`
490`,`
491`).split(`
492`).map(h=>{var p;const g=((p=h.match(/^ */))==null?void 0:p[0])||"",y=Math.min(g.length,n);return h.slice(y)}).join(`
493`);return a.replaceWith(l,c,r.schema.text(f)),!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(`
494
495`);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:c})=>(c.setSelection(ke.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[x0({find:MJ,type:this.type,getAttributes:t=>({language:t[1]})}),x0({find:LJ,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new rt({key:new _t("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,l=a.text(n.replace(/\r\n?/g,`
496`));return o.replaceSelectionWith(this.type.create({language:i},l)),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}}})]}}),$J=$n.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
497
498`):""}),FJ=$n.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",wt(this.options.HTMLAttributes,t)]},renderText(){return`
499`},renderMarkdown:()=>`  
500`,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,l=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){const d=l.filter(f=>a.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),BJ=$n.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]}`,wt(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=>x0({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
500)\\s$`),type:this.type,getAttributes:{level:t}}))}}),zJ=$n.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",wt(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!lG(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return gI(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:l}=o.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(me.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(ue.create(o.doc,l.pos)):o.setSelection(me.create(o.doc,l.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=u==null?void 0:u.create();d&&(o.insert(c,d),o.setSelection(me.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[aG({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
vendor: 1,036 bytes, line 500
500ype})]}}),UJ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,VJ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,HJ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,WJ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,qJ=ua.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",wt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Hl({find:UJ,type:this.t
500ype}),Hl({find:HJ,type:this.type})]},addPasteRules(){return[ta({find:VJ,type:this.type}),ta({find:WJ,type:this.type})]}});const KJ="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yac
500hts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",GJ="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",E0="numeric",C0="ascii",_0="alpha",su="asciinumeric",Mc="alphanumeric",T0="domain",UI="emoji",JJ="scheme",QJ="slashscheme",ly="whitespace";function ZJ(t,e){return t in e||(e[t]=[]),e[t]}function So(t,e,n){e[E0]&&(e[su]=!0,e[Mc]=!0),e[C0]&&(e[su]=!0,e[_0]=!0),e[su]&&(e[Mc]=!0),e[_0]&&(e[Mc]=!0),e[Mc]&&(e[T0]=!0),e[UI]&&(e[T0]=!0);for(const r in e){const s=ZJ(r,n);s.indexOf(t)<0&&s.push(t)}}function YJ(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function bn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}bn.groups={};bn.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||bn.groups;let s;return e&&e.j?s=e:(s=new bn(e),n&&r&&So(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||bn.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 bn,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new bn,i){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(YJ(o.t,r),n);So(i,l,r)}else n&&So(i,n,r);o.t=i}return s.j[t]=o,o}};const xe=(t,e,n,r,s)=>t.ta(e,n,r,s),st=(t,e,n,r,s)=>t.tr(e,n,r,s),VE=(t,e,n,r,s)=>t.ts(e,n,r,s),B=(t,e,n,r,s)=>t.tt(e,n,r,s),gs="WORD",A0="UWORD",VI="ASCIINUMERICAL",HI="ALPHANUMERICAL",ed="LOCALHOST",N0="TLD",O0="UTLD",Jf="SCHEME",Ma="SLASH_SCHEME",Vw="NUM",R0="WS",Hw="NL",iu="OPENBRACE",ou="CLOSEBRACE",op="OPENBRACKET",ap="CLOSEBRACKET",lp="OPENPAREN",cp="CLOSEPAREN",up="OPENANGLEBRACKET",dp="CLOSEANGLEBRACKET",fp="FULLWIDTHLEFTPAREN",hp="FULLWIDTHRIGHTPAREN",pp="LEFTCORNERBRACKET",mp="RIGHTCORNERBRACKET",gp="LEFTWHITECORNERBRACKET",yp="RIGHTWHITECORNERBRACKET",vp="FULLWIDTHLESSTHAN",bp="FULLWIDTHGREATERTHAN",wp="AMPERSAND",xp="APOSTROPHE",kp="ASTERISK",ti="AT",Sp="BACKSLASH",Ep="BACKTICK",Cp="CARET",ai="COLON",Ww="COMMA",_p="DOLLAR",Lr="DOT",Tp="EQUALS",qw="EXCLAMATION",zn="HYPHEN",au="PERCENT",Ap="PIPE",Np="PLUS",Op="POUND",lu="QUERY",Kw="QUOTE",WI="FULLWIDTHMIDDLEDOT",Gw="SEMI",Dr="SLASH",cu="TILDE",Rp="UNDERSCORE",qI="EMOJI",Pp="SYM";var KI=Object.freeze({__proto__:null,ALPHANUMERICAL:HI,AMPERSAND:wp,APOSTROPHE:xp,ASCIINUMERICAL:VI,ASTERISK:kp,AT:ti,BACKSLASH:Sp,BACKTICK:Ep,CARET:Cp,CLOSEANGLEBRACKET:dp,CLOSEBRACE:ou,CLOSEBRACKET:ap,CLOSEPAREN:cp,COLON:ai,COMMA:Ww,DOLLAR:_p,DOT:Lr,EMOJI:qI,EQUALS:Tp,EXCLAMATION:qw,FULLWIDTHGREATERTHAN:bp,FULLWIDTHLEFTPAREN:fp,FULLWIDTHLESSTHAN:vp,FULLWIDTHMIDDLEDOT:WI,FULLWIDTHRIGHTPAREN:hp,HYPHEN:zn,LEFTCORNERBRACKET:pp,LEFTWHITECORNERBRACKET:gp,LOCALHOST:ed,NL:Hw,NUM:Vw,OPENANGLEBRACKET:up,OPENBRACE:iu,OPENBRACKET:op,OPENPAREN:lp,PERCENT:au,PIPE:Ap,PLUS:Np,POUND:Op,QUERY:lu,QUOTE:Kw,RIGHTCORNERBRACKET:mp,RIGHTWHITECORNERBRACKET:yp,SCHEME:Jf,SEMI:Gw,SLASH:Dr,SLASH_SCHEME:Ma,SYM:Pp,TILDE:cu,TLD:N0,UNDERSCORE:Rp,UTLD:O0,UWORD:A0,WORD:gs,WS:R0});const hs=/[a-z]/,kc=new RegExp("\\p{L}","u"),cy=new RegExp("\\p{Emoji}","u"),ps=/\d/,uy=/\s/,HE="\r",dy=`
501`,XJ="️",eQ="‍",fy="";let wf=null,xf=null;function tQ(t=[]){const e={};bn.groups=e;const n=new bn;wf==null&&(wf=WE(KJ)),xf==null&&(xf=WE(GJ)),B(n,"'",xp),B(n,"{",iu),B(n,"}",ou),B(n,"[",op),B(n,"]",ap),B(n,"(",lp),B(n,")",cp),B(n,"<",up),B(n,">",dp),B(n,"(",fp),B(n,")",hp),B(n,"「",pp),B(n,"」",mp),B(n,"『",gp),B(n,"』",yp),B(n,"<",vp),B(n,">",bp),B(n,"&",wp),B(n,"*",kp),B(n,"@",ti),B(n,"`",Ep),B(n,"^",Cp),B(n,":",ai),B(n,",",Ww),B(n,"$",_p),B(n,".",Lr),B(n,"=",Tp),B(n,"!",qw),B(n,"-",zn),B(n,"%",au),B(n,"|",Ap),B(n,"+",Np),B(n,"#",Op),B(n,"?",lu),B(n,'"',Kw),B(n,"/",Dr),B(n,";",Gw),B(n,"~",cu),B(n,"_",Rp),B(n,"\\",Sp),B(n,"・",WI);const r=st(n,ps,Vw,{[E0]:!0});st(r,ps,r);const s=st(r,hs,VI,{[su]:!0}),i=st(r,kc,HI,{[Mc]:!0}),o=st(n,hs,gs,{[C0]:!0});st(o,ps,s),st(o,hs,o),st(s,ps,s),st(s,hs,s);const a=st(n,kc,A0,{[_0]:!0});
vendor: 9,762 bytes, lines 501-504
501st(a,hs),st(a,ps,i),st(a,kc,a),st(i,ps,i),st(i,hs),st(i,kc,i);const l=B(n,dy,Hw,{[ly]:!0}),c=B(n,HE,R0,{[ly]:!0}),u=st(n,uy,R0,{[ly]:!0});B(n,fy,u),B(c,dy,l),B(c,fy,u),st(c,uy,u),B(u,HE),B(u,dy),st(u,uy,u),B(u,fy,u);const d=st(n,cy,qI,{[UI]:!0});B(d,"#"),st(d,cy,d),B(d,XJ,d);const f=B(d,eQ);B(f,"#"),st(f,cy,d);const h=[[hs,o],[ps,s]],p=[[hs,null],[kc,a],[ps,i]];for(let g=0;g<wf.length;g++)qs(n,wf[g],N0,gs,h);for(let g=0;g<xf.length;g++)qs(n,xf[g],O0,A0,p);So(N0,{tld:!0,ascii:!0},e),So(O0,{utld:!0,alpha:!0},e),qs(n,"file",Jf,gs,h),qs(n,"mailto",Jf,gs,h),qs(n,"http",Ma,gs,h),qs(n,"https",Ma,gs,h),qs(n,"ftp",Ma,gs,h),qs(n,"ftps",Ma,gs,h),So(Jf,{scheme:!0,ascii:!0},e),So(Ma,{slashscheme:!0,ascii:!0},e),t=t.sort((g,y)=>g[0]>y[0]?1:-1);for(let g=0;g<t.length;g++){const y=t[g][0],b=t[g][1]?{[JJ]:!0}:{[QJ]:!0};y.indexOf("-")>=0?b[T0]=!0:hs.test(y)?ps.test(y)?b[su]=!0:b[C0]=!0:b[E0]=!0,VE(n,y,y,b)}return VE(n,"localhost",ed,{ascii:!0}),n.jd=new bn(Pp),{start:n,tokens:Object.assign({groups:e},KI)}}function GI(t,e){const n=nQ(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o<r;){let a=t,l=null,c=0,u=null,d=-1,f=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(d=0,f=0,u=a):d>=0&&(d+=n[o].length,f++),c+=n[o].length,i+=n[o].length,o++;i-=d,o-=f,c-=d,s.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return s}function nQ(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 qs(t,e,n,r,s){let i;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new bn(r),i.jr=s.slice(),t.j[l]=i),t=i}return i=new bn(n),i.jr=s.slice(),t.j[e[o-1]]=i,i}function WE(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 td={defaultProtocol:"http",events:null,format:qE,formatHref:qE,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Jw(t,e=null){let n=Object.assign({},td);t&&(n=Object.assign(n,t instanceof Jw?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}Jw.prototype={o:td,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]:td[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 qE(t){return t}function JI(t,e){this.t="token",this.v=t,this.tk=e}JI.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=td.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),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:s,attributes:o,content:i,eventListeners:d}}};function Mm(t,e){class n extends JI{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 KE=Mm("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),GE=Mm("text"),rQ=Mm("nl"),kf=Mm("url",{isLink:!0,toHref(t=td.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ed&&t[1].t===ai}}),Bn=t=>new bn(t);function sQ({groups:t}){const e=t.domain.concat([wp,kp,ti,Sp,Ep,Cp,_p,Tp,zn,Vw,au,Ap,Np,Op,Dr,Pp,cu,Rp]),n=[xp,ai,Ww,Lr,qw,au,lu,Kw,Gw,up,dp,iu,ou,ap,op,lp,cp,fp,hp,pp,mp,gp,yp,vp,bp],r=[wp,xp,kp,Sp,Ep,Cp,_p,Tp,zn,iu,ou,au,Ap,Np,Op,lu,Dr,Pp,cu,Rp],s=Bn(),i=B(s,cu);xe(i,r,i),xe(i,t.domain,i);const o=Bn(),a=Bn(),l=Bn();xe(s,t.domain,o),xe(s,t.scheme,a),xe(s,t.slashscheme,l),xe(o,r,i),xe(o,t.domain,o);const c=B(o,ti);B(i,ti,c),B(a,ti,c),B(l,ti,c);const u=B(i,Lr);xe(u,r,i),xe(u,t.domain,i);const d=Bn();xe(c,t.domain,d),xe(d,t.domain,d);const f=B(d,Lr);xe(f,t.domain,d);const h=Bn(KE);xe(f,t.tld,h),xe(f,t.utld,h),B(c,ed,h);const p=B(d,zn);B(p,zn,p),xe(p,t.domain,d),xe(h,t.domain,d),B(h,Lr,f),B(h,zn,p);const g=B(h,ai);xe(g,t.numeric,KE);const y=B(o,zn),v=B(o,Lr);B(y,zn,y),xe(y,t.domain,o),xe(v,r,i),xe(v,t.domain,o);const b=Bn(kf);xe(v,t.tld,b),xe(v,t.utld,b),xe(b,t.domain,o),xe(b,r,i),B(b,Lr,v),B(b,zn,y),B(b,ti,c);const w=B(b,ai),k=Bn(kf);xe(w,t.numeric,k);const S=Bn(kf),C=Bn();xe(S,e,S),xe(S,n,C),xe(C,e,S),xe(C,n,C),B(b,Dr,S),B(k,Dr,S);const E=B(a,ai),T=B(l,ai),N=B(T,Dr),P=B(N,Dr);xe(a,t.domain,o),B(a,Lr,v),B(a,zn,y),xe(l,t.domain,o),B(l,Lr,v),B(l,zn,y),xe(E,t.domain,S),B(E,Dr,S),B(E,lu,S),xe(P,t.domain,S),xe(P,e,S),B(P,Dr,S);const q=[[iu,ou],[op,ap],[lp,cp],[up,dp],[fp,hp],[pp,mp],[gp,yp],[vp,bp]];for(let R=0;R<q.length;R++){const[D,I]=q[R],H=B(S,D);B(C,D,H),B(H,I,S);const U=Bn(kf);xe(H,e,U);const Z=Bn();xe(H,n),xe(U,e,U),xe(U,n,Z),xe(Z,e,U),xe(Z,n,Z),B(U,I,S),B(Z,I,S)}return B(s,ed,b),B(s,Hw,rQ),{start:s,tokens:KI}}function iQ(t,e,n){let r=n.length,s=0,i=[],o=[];for(;s<r;){let a=t,l=null,c=null,u=0,d=null,f=-1;for(;s<r&&!(l=a.go(n[s].t));)o.push(n[s++]);for(;s<r&&(c=l||a.go(n[s].t));)l=null,a=c,a.accepts()?(f=0,d=a):f>=0&&f++,s++,u++;if(f<0)s-=u,s<r&&(o.push(n[s]),s++);else{o.length>0&&(i.push(hy(GE,e,o)),o=[]),s-=f,u-=f;const h=d.t,p=n.slice(s-u,s);i.push(hy(h,e,p))}}return o.length>0&&i.push(hy(GE,e,o)),i}function hy(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 oQ=typeof console<"u"&&console&&console.warn||(()=>{}),aQ="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function lQ(){return bn.groups={},Ke.scanner=null,Ke.parser=null,Ke.tokenQueue=[],Ke.pluginQueue=[],Ke.customSchemes=[],Ke.initialized=!1,Ke}function JE(t,e=!1){if(Ke.initialized&&oQ(`linkifyjs: already initialized - will not register custom scheme "${t}" ${aQ}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
5021. Must only contain digits, lowercase ASCII letters or "-"
5032. Cannot start or end with "-"
5043. "-" cannot repeat`);Ke.customSchemes.push([t,e])}function cQ(){Ke.scanner=tQ(Ke.customSchemes);for(let t=0;t<Ke.tokenQueue.length;t++)Ke.tokenQueue[t][1]({scanner:Ke.scanner});Ke.parser=sQ(Ke.scanner.tokens);for(let t=0;t<Ke.pluginQueue.length;t++)Ke.pluginQueue[t][1]({scanner:Ke.scanner,parser:Ke.parser});return Ke.initialized=!0,Ke}function Qw(t){return Ke.initialized||cQ(),iQ(Ke.parser.start,t,GI(Ke.scanner.start,t))}Qw.scan=GI;function QI(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 Jw(n),s=Qw(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 Zw="[\0-   ᠎ -\u2029  ]",uQ=new RegExp(Zw),dQ=new RegExp(`${Zw}$`),fQ=new RegExp(Zw,"g");function hQ(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function pQ(t){return new rt({key:new _t("autolink"),appendTransaction:(e,n,r)=>{const s=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,a=lI(n.doc,[...e]);if(mI(a).forEach(({newRange:c})=>{const u=a7(r.doc,c,h=>h.isTextblock);let d,f;if(u.length>1)d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!dQ.test(h))return;d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&f){const h=f.split(uQ).filter(Boolean);if(h.length<=0)return!1;const p=h[h.length-1],g=d.pos+f.lastIndexOf(p);if(!p)return!1;const y=Qw(p).map(v=>v.toObject(t.defaultProtocol));if(!hQ(y))return!1;y.filter(v=>v.isLink).map(v=>({...v,from:g+v.start+1,to:g+v.end+1})).filter(v=>r.schema.marks.code?!r.doc.rangeHasMark(v.from,v.to,r.schema.marks.code):!0).filter(v=>t.validate(v.value)).filter(v=>t.shouldAutoLink(v.value)).forEach(v=>{Dw(v.from,v.to,r.doc).some(b=>b.mark.type===t.type)||o.addMark(v.from,v.to,t.type.create({href:v.href}))})}}),!!o.steps.length)return o}})}function mQ(t){return new rt({key:new _t("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 l=r.target;if(!l)return!1;const c=t.editor.view.dom;o=l.closest("a"),o&&!c.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 l=pI(e.state,t.type.n
vendor: 3,978 bytes, line 504
504ame),c=(s=o.href)!=null?s:l.href,u=(i=o.target)!=null?i:l.target;c&&(window.open(c,u),a=!0)}return a}}})}function gQ(t){return new rt({key:new _t("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:s}=t,{state:i}=e,{selection:o}=i,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const c=QI(l,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c||s!==void 0&&!s(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function ao(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(fQ,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var yQ=ua.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"){JE(t);return}JE(t.scheme,t.optionalSlashes)})},onDestroy(){lQ()},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)=>!!ao(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=>!!ao(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=>!!ao(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",wt(this.options.HTMLAttributes,t),0]:["a",wt(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:"",l=e.renderChildren(t);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ao(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=>!!ao(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[ta({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,s=QI(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!ao(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}
vendor: 13,277 bytes, lines 504-514
504,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(pQ({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!ao(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(mQ({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(gQ({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),vQ=Object.defineProperty,bQ=(t,e)=>{for(var n in e)vQ(t,n,{get:e[n],enumerable:!0})},wQ="listItem",QE="textStyle",ZE=/^\s*([-+*])\s$/,ZI=$n.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",wt(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,`
505`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wQ,this.editor.getAttributes(QE)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Wl({find:ZE,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Wl({find:ZE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(QE),editor:this.editor})),[t]}}),YI=$n.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",wt(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 l=t.tokens.slice(1),c=r(l);s.push(...c)}}else s=r(t.tokens)}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,n)=>zw(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)}}}),xQ={};bQ(xQ,{findListItemPos:()=>Td,getNextListDepth:()=>Yw,handleBackspace:()=>P0,handleDelete:()=>I0,hasListBefore:()=>XI,hasListItemAfter:()=>kQ,hasListItemBefore:()=>ej,listItemHasSubList:()=>tj,nextListIsDeeper:()=>nj,nextListIsHigher:()=>rj});var Td=(t,e)=>{const{$from:n}=e.selection,r=bt(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}},Yw=(t,e)=>{const n=Td(t,e);if(!n)return!1;const[,r]=v7(e,t,n.$pos.pos+4);return r},XI=(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))},ej=(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)},tj=(t,e,n)=>{if(!n)return!1;const r=bt(t,e.schema);let s=!1;return n.descendants(i=>{i.type===r&&(s=!0)}),s},P0=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ki(t.state,e)&&XI(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((f,h)=>{f.type.name===e&&c.push({node:f,pos:h})});const u=c.at(-1);if(!u)return!1;const d=t.state.doc.resolve(l.start()+u.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},d.end()).joinForward().run()}if(!Ki(t.state,e)||!k7(t.state))return!1;const r=Td(e,t.state);if(!r)return!1;const i=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=tj(e,t.state,i);return ej(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},nj=(t,e)=>{const n=Yw(t,e),r=Td(t,e);return!r||!n?!1:n>r.depth},rj=(t,e)=>{const n=Yw(t,e),r=Td(t,e);return!r||!n?!1:n<r.depth},I0=(t,e)=>{if(!Ki(t.state,e)||!x7(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:nj(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():rj(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},kQ=(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)},sj=ht.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&&I0(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&&I0(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&&P0(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&&P0(t,n,r)&&(e=!0)}),e}}}}),YE=/^(\s*)(\d+)\.\s+(.*)$/,SQ=/^\s/;function EQ(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n],i=s.match(YE);if(!i)break;const[,o,a,l]=i,c=o.length;let u=l,d=n+1;const f=[s];for(;d<t.length;){const h=t[d];if(h.match(YE))break;if(h.trim()==="")f.push(h),u+=`
506`,d+=1;else if(h.match(SQ))f.push(h),u+=`
507${h.slice(c+2)}`,d+=1;else break}e.push({indent:c,number:parseInt(a,10),content:u.trim(),raw:f.join(`
508`)}),r=d,n=d}return[e,r]}function ij(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(`
509`),l=((r=a[0])==null?void 0:r.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const u=a.slice(1).join(`
510`).trim();if(u){const h=n.blockTokens(u);c.push(...h)}let d=i+1;const f=[];for(;d<t.length&&t[d].indent>e;)f.push(t[d]),d+=1;if(f.length>0){const h=Math.min(...f.map(g=>g.indent)),p=ij(f,h,n);c.push({type:"list",ordered:!0,start:f[0].number,items:p,raw:f.map(g=>g.raw).join(`
511`)})}s.push({type:"list_item",raw:o.raw,tokens:c}),i=d}else i+=1}return s}function CQ(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 _Q="listItem",XE="textStyle",eC=/^(\d+)\.\s$/,oj=$n.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",wt(this.options.HTMLAttributes,n),0]:["ol",wt(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?CQ(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,`
512`):"",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(`
513`),[i,o]=EQ(s);if(i.length===0)return;const a=ij(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(`
514`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(_Q,this.editor.getAttributes(XE)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Wl({find:eC,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=Wl({find:eC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(XE)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),TQ=/^\s*(\[([( |x])?\])\s$/,AQ=$n.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",wt(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 zw(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"),l=document.createElement("div"),c=d=>{var f,h;a.ariaLabel=((h=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:h.call(f,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};c(t),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=n();if(typeof p!="number")return!1;const g=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...g==null?void 0:g.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{s.setAttribute(d,f)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,o),s.append(i,l),Object.entries(e).forEach(([d,f])=>{s.setAttribute(d,f)});let u=new Set(Object.keys(e));return{dom:s,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;s.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d);const f=r.extensionManager.attributes,h=Xu(d,f),p=new Set(Object.keys(h)),g=this.options.HTMLAttributes;return u.forEach(y=>{p.has(y)||(y in g?s.setAttribute(y,g[y]):s.removeAttribute(y))}),Object.entries(h).forEach(([y,v])=>{v==null?y in g?s.setAttribute(y,g[y]):s.removeAttribute(y):s.setAttribute(y,v)}),u=p,!0}}}}
514,addInputRules(){return[Wl({find:TQ,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),NQ=$n.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",wt(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,`
515`):"",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=k0(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(i)},s=k0(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()}}});ht.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(ZI.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(YI.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(sj.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(oj.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(AQ.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(NQ.configure(this.options.taskList)),t}});var tC="&nbsp;",OQ=" ",RQ=$n.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",wt(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===tC||r[0].text===OQ)?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?tC:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),PQ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,IQ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,jQ=ua.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",wt(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)}}
vendor: 5,103 bytes, line 515
515,addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Hl({find:PQ,type:this.type})]},addPasteRules(){return[ta({find:IQ,type:this.type})]}}),MQ=$n.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),LQ=ua.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",wt(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 DQ(t={}){return new rt({view(e){return new $Q(e,t)}})}class $Q{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}})}destroy(){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 d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),g=d?p.bottom:p.top;d&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:p.left,right:p.right,top:g-y,bottom:g+y}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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 c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),f=d.width/l.offsetWidth,h=d.height/l.offsetHeight;c=d.left-l.scrollLeft*f,u=d.top-l.scrollTop*h}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/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=iP(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 ct extends ke{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ct.valid(r)?new ct(r):ke.near(r)}content(){return X.empty}eq(e){return e instanceof ct&&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 ct(e.resolve(n.pos))}getBookmark(){return new Xw(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!FQ(e)||!BQ(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&&ct.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>
vendor: 16,560 bytes, line 515
5150?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 l=e.doc.resolve(s);if(ct.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!ue.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(ct.valid(a))return a}return null}}}ct.prototype.visible=!1;ct.findFrom=ct.findGapCursorFrom;ke.jsonID("gapcursor",ct);class Xw{constructor(e){this.pos=e}map(e){return new Xw(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ct.valid(n)?new ct(n):ke.near(n)}}function aj(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function FQ(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||aj(s.type))return!0;if(s.inlineContent)return!1}}return!0}function BQ(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||aj(s.type))return!0;if(s.inlineContent)return!1}}return!0}function zQ(){return new rt({props:{decorations:WQ,createSelectionBetween(t,e,n){return e.pos==n.pos&&ct.valid(n)?new ct(n):null},handleClick:VQ,handleKeyDown:UQ,handleDOMEvents:{beforeinput:HQ}}})}const UQ=eI({ArrowLeft:Sf("horiz",-1),ArrowRight:Sf("horiz",1),ArrowUp:Sf("vert",-1),ArrowDown:Sf("vert",1)});function Sf(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,l=o.empty;if(o instanceof me){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=ct.findGapCursorFrom(a,e,l);return c?(s&&s(r.tr.setSelection(new ct(c))),!0):!1}}function VQ(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ct.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&ue.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ct(r))),!0)}function HQ(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ct))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=F.empty;for(let o=r.length-1;o>=0;o--)s=F.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new X(s,0,0));return i.setSelection(me.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function WQ(t){if(!(t.selection instanceof ct))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Xe.create(t.doc,[on.widget(t.selection.head,e,{key:"gapcursor"})])}var Ip=200,jt=function(){};jt.prototype.append=function(e){return e.length?(e=jt.from(e),!this.length&&e||e.length<Ip&&this.leafAppend(e)||this.length<Ip&&e.leafPrepend(this)||this.appendInner(e)):this};jt.prototype.prepend=function(e){return e.length?jt.from(e).append(this):this};jt.prototype.appendInner=function(e){return new qQ(this,e)};jt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?jt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};jt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};jt.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)};jt.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};jt.from=function(e){return e instanceof jt?e:e&&e.length?new lj(e):jt.empty};var lj=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 l=i;l<o;l++)if(s(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(s,i,o,a){for(var l=i-1;l>=o;l--)if(s(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=Ip)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=Ip)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}(jt);jt.empty=new lj([]);var qQ=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}(jt);const KQ=500;class xr{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,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,u.push(d);return}if(s){u.push(new $r(d.map));let h=d.step.map(s.slice(i)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new $r(p,void 0,void 0,c.length+u.length))),i--,p&&s.appendMap(p,i)}else o.maybeStep(d.step);if(d.selection)return a=s?d.selection.map(s.slice(i)):d.selection,l=new xr(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,s){let i=[],o=this.eventCount,a=this.items,l=!s&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new $r(e.mapping.maps[u],d,n),h;(h=l&&l.merge(f))&&(f=h,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),n&&(o++,n=void 0),s||(l=f)}let c=o-r.depth;return c>JQ&&(a=GQ(a,c),o-=c),new xr(a.append(i),o)}remapping(e,n){let r=new Ku;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 xr(this.items.append(e.map(n=>new $r(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(f=>{f.selection&&a--},s);let l=n;this.items.forEach(f=>{let h=i.getMirror(--l);if(h==null)return;o=Math.min(o,h);let p=i.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),y=f.selection&&f.selection.map(i.slice(l+1,h));y&&a++,r.push(new $r(p,g,y))}else r.push(new $r(p))},s);let c=[];for(let f=n;f<o;f++)c.push(new $r(i.maps[f]));let u=this.items.slice(0,s).append(c).append(r),d=new xr(u,a);return d.emptyItemCount()>KQ&&(d=d.compress(this.items.length-r.length)),d}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 l=o.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=o.selection&&o.selection.map(n.slice(r));u&&i++;let d=new $r(c.invert(),l,u),f,h=s.length-1;(f=s.length&&s[h].merge(d))?s[h]=f:s.push(d)}}else o.map&&r--},this.items.length,0),new xr(jt.from(s.reverse()),i)}}xr.empty=new xr(jt.empty,0);function GQ(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class $r{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 $r(n.getMap().invert(),n,this.selection)}}}class ni{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const JQ=20;function QQ(t,e,n,r){let s=n.getMeta(Fo),i;if(s)return s.historyState;n.getMeta(XQ)&&(t=new ni(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Fo))return o.getMeta(Fo).redo?new ni(t.done.addTransform(n,void 0,r,Qf(e)),t.undone,nC(n.mapping.maps),t.prevTime,t.prevComposition):new ni(t.done,t.undone.addTransform(n,void 0,r,Qf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!ZQ(n,t.prevRanges)),c=o?py(t.prevRanges,n.mapping):nC(n.mapping.maps);return new ni(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Qf(e)),xr.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new ni(t.done.rebased(n,i),t.undone.rebased(n,i),py(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ni(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),py(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function ZQ(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 nC(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 py(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 YQ(t,e,n){let r=Qf(e),s=Fo.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),l=new ni(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(o).setMeta(Fo,{redo:n,historyState:l})}let my=!1,rC=null;function Qf(t){let e=t.plugins;if(rC!=e){my=!1,rC=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){my=!0;break}}return my}const Fo=new _t("history"),XQ=new _t("closeHistory");function eZ(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new rt({key:Fo,state:{init(){return new ni(xr.empty,xr.empty,null,0,-1)},apply(e,n,r){return QQ(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,s=r=="historyUndo"?uj:r=="historyRedo"?dj:null;return!s||!e.editable?!1:(n.preventDefault(),s(e.state,e.dispatch))}}}})}function cj(t,e){return(n,r)=>{let s=Fo.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=YQ(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const uj=cj(!1,!0),dj=cj(!0,!0);ht.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 rt({key:new _t("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,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(a,l);return t=!0,c}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,l=i-r,c=a-l,u=a;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var tZ=ht.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[DQ(this.options)]}});ht.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new rt({key:new _t("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return Xe.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(s>=c&&s<=c+l.nodeSize-1))return!1;o+=1});let a=0;return t.descendants((l,c)=>{if(l.isText||!(s>=c&&s<=c+l.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(on.node(c,c+l.nodeSize,{class:this.options.className}))}),Xe.create(t,i)}}})]}});var nZ=ht.create({name:"gapCursor",addProseMirrorPlugins(){return[zQ()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Me(le(t,"allowGapCursor",n)))!=null?e:null}}}),sC="placeholder";function rZ(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}ht.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:sC,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${rZ(this.options.dataAttribute)}`:`data-${sC}`;return[new rt({key:new _t("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,l)=>{const c=s>=l&&s<=l+a.nodeSize,u=!a.isLeaf&&Rm(a);if((c||!this.options.showOnlyCurrent)&&u){const d=[this.options.emptyNodeClass];o&&d.push(this.options.emptyEditorClass);const f=on.node(l,l+a.nodeSize,{class:d.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:c}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),Xe.create(e,i)}}})]}});ht.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new rt({key:new _t("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||gI(n.selection)||t.view.dragging?null:Xe.create(n.doc,[on.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function iC({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var sZ=ht.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new _t(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 rt({key:e,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:c}
515=o,u=e.getState(o),d=a.content.size,f=c.nodes[n];if(u)return l.insert(d,f.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!iC({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!iC({node:o,types:r})}}})]}}),iZ=ht.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>uj(t,e),redo:()=>({state:t,dispatch:e})=>dj(t,e)}},addProseMirrorPlugins(){return[eZ(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()}}}),oZ=ht.create({name:"starterKit",addExtensions(){var t,e,n,r;const s=[];return this.options.bold!==!1&&s.push(RJ.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(_J.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(ZI.configure(this.options.bulletList)),this.options.code!==!1&&s.push(jJ.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(DJ.configure(this.options.codeBlock)),this.options.document!==!1&&s.push($J.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(tZ.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(nZ.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(FJ.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(BJ.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(iZ.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(zJ.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(qJ.configure(this.options.italic)),this.options.listItem!==!1&&s.push(YI.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(sj.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(yQ.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(oj.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(RQ.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(jQ.configure(this.options.strike)),this.options.text!==!1&&s.push(MQ.configure(this.options.text)),this.options.underline!==!1&&s.push(LQ.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(sZ.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),aZ=oZ;function lZ({content:t,onChange:e}){const n=xJ({extensions:[aZ],content:t,onUpdate:({editor:s})=>{e(s.getHTML())},editorProps:{attributes:{class:"prose prose-sm dark:prose-invert max-w-none min-h-[250px] px-4 py-3 focus:outline-none"}}});if(!n)return null;const r=({onClick:s,active:i,children:o,title:a})=>m.jsx(Le,{type:"button",variant:i?"default":"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s,title:a,children:o});return m.jsxs("div",{className:"rounded-md border border-border bg-background overflow-hidden",children:[m.jsxs("div",{className:"flex flex-wrap gap-0.5 border-b border-border bg-muted/50 px-2 py-1.5",children:[m.jsx(r,{onClick:()=>n.chain().focus().toggleBold().run(),active:n.isActive("bold"),title:"Gras",children:m.jsx(K4,{className:"h-4 w-4"})}),m.jsx(r,{onClick:()=>n.chain().focus().toggleItalic().run(),active:n.isActive("italic"),title:"Italique",children:m.jsx(X4,{className:"h-4 w-4"})}),m.jsx("div",{className:"w-px bg-border mx-1"}),m.jsx(r,{onClick:()=>n.chain().focus().toggleHeading({level:2}).run(),active:n.isActive("heading",{level:2}),title:"Titre 2",children:m.jsx(Z4,{className:"h-4 w-4"})}),m.jsx(r,{onClick:()=>n.chain().focus().toggleHeading({level:3}).run(),active:n.isActive("heading",{level:3}),title:"Titre 3",children:m.jsx(Y4,{className:"h-4 w-4"})}),m.jsx("div",{className:"w-px bg-border mx-1"}),m.jsx(r,{onClick:()=>n.chain().focus().toggleBulletList().run(),active:n.isActive("bulletList"),title:"Liste à puces",children:m.jsx(tF,{className:"h-4 w-4"})}),m.jsx(r,{onClick:()=>n.chain().focus().toggleOrderedList().run(),active:n.isActive("orderedList"),title:"Liste numérotée",children:m.jsx(eF,{className:"h-4 w-4"})}),m.jsx(r,{onClick:()=>n.chain().focus().toggleBlockquote().run(),active:n.isActive("blockquote"),title:"Citation",children:m.jsx(oF,{className:"h-4 w-4"})}),m.jsx(r,{onClick:()=>n.chain().focus().setHorizontalRule().run(),title:"Séparateur",children:m.jsx(rF,{className:"h-4 w-4"})}),m.jsx("div",{className:"w-px bg-border mx-1"}),m.jsx(r,{onClick:()=>
515n.chain().focus().undo().run(),title:"Annuler",children:m.jsx(uF,{className:"h-4 w-4"})}),m.jsx(r,{onClick:()=>n.chain().focus().redo().run(),title:"Rétablir",children:m.jsx(aF,{className:"h-4 w-4"})})]}),m.jsx(DI,{editor:n})]})}const cZ=Object.keys(YO);function uZ(t){return t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function dZ({onAuth:t}){const[e,n]=x.useState(""),[r,s]=x.useState(!1),i=async o=>{o.preventDefault(),s(!0);try{(await fetch("https://amsbifdjlzyfedlrawnq.supabase.co/functions/v1/blog-admin",{method:"POST",headers:{"x-admin-password":e,"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFtc2JpZmRqbHp5ZmVkbHJhd25xIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM2MDUwNDAsImV4cCI6MjA4OTE4MTA0MH0.gnVWdrizTt0nWaLvBVdAtbSiJQTDT6qdv9Naein6Rqg"},body:JSON.stringify({action:"check"})})).status===401?kr.error("Mot de passe incorrect"):(sessionStorage.setItem("admin_pw",e),t(e))}catch{kr.error("Erreur de connexion")}s(!1)};return m.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:m.jsxs("form",{onSubmit:i,className:"bg-card border border-border rounded-lg p-8 w-full max-w-sm space-y-4 shadow-lg",children:[m.jsx("h1",{className:"font-heading text-2xl font-bold text-center",children:"Administration"}),m.jsx("p",{className:"text-muted-foreground text-sm text-center",children:"Entrez le mot de passe pour accéder à l'administration."}),m.jsx(Zn,{type:"password",placeholder:"Mot de passe",value:e,onChange:o=>n(o.target.value),required:!0}),m.jsx(Le,{type:"submit",className:"w-full",disabled:r,children:r?"Connexion…":"Se connecter"})]})})}function fZ({selected:t,onChange:e}){const n=r=>{t.includes(r)?e(t.filter(s=>s!==r)):e([...t,r])};return m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{children:"Catégories"}),m.jsx("div",{className:"flex flex-wrap gap-2",children:cZ.map(r=>{const s=t.includes(r),i=ji(r);return m.jsxs("button",{type:"button",onClick:()=>n(r),className:`text-xs font-medium px-3 py-1.5 rounded-md border transition-all duration-150 ${s?`${i.bg} ${i.text} ${i.border} shadow-sm`:"bg-transparent text-foreground/60 border-border hover:border-primary/40"}`,children:[r,s&&m.jsx(nm,{className:"inline-block ml-1.5 h-3 w-3"})]},r)})}),t.length===0&&m.jsx("p",{className:"text-xs text-muted-foreground",children:"Sélectionnez au moins une catégorie"})]})}function hZ({article:t,authors:e,password:n,onSaved:r,onCancel:s}){var k;const[i,o]=x.useState((t==null?void 0:t.title)||""),[a,l]=x.useState(((k=t==null?void 0:t.published_at)==null?void 0:k.slice(0,10))||new Date().toISOString().slice(0,10)),[c,u]=x.useState((t==null?void 0:t.tags)||[]),[d,f]=x.useState((t==null?void 0:t.body)||""),[h,p]=x.useState((t==null?void 0:t.author_id)||""),[g,y]=x.useState(!1),v=uZ(i);function b(S){const E=S.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim().replace(/^\d+\.\s*/,""),T=E.search(/[.!?]\s/);return T>0&&T>=80?E.slice(0,T+1):E.length<=160?E:E.slice(0,157)+"…"}const w=async S=>{if(S.preventDefault(),c.length===0){kr.error("Sélectionnez au moins une catégorie");return}y(!0);try{const E=await fetch("https://amsbifdjlzyfedlrawnq.supabase.co/functions/v1/blog-admin",{method:"POST",headers:{"x-admin-password":n,"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFtc2JpZmRqbHp5ZmVkbHJhd25xIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM2MDUwNDAsImV4cCI6MjA4OTE4MTA0MH0.gnVWdrizTt0nWaLvBVdAtbSiJQTDT6qdv9Naein6Rqg"},body:JSON.stringify({action:t?"update":"create",id:t==null?void 0:t.id,title:i,slug:v,published_at:new Date(a).toISOString(),tags:c,excerpt:b(d),body:d,author_id:h||null})});if(!E.ok){const T=await E.json();throw new Error(T.error||"Erreur")}kr.success(t?"Article mis à jour !":"Article créé !"),r()}catch(C){kr.error(C.message)}y(!1)};return m.jsxs("form",{onSubmit:w,className:"space-y-5 max-w-2xl",children:[m.jsxs(Le,{type:"button",variant:"ghost",size:"sm",onClick:s,className:"mb-2",children:[m.jsx(BA,{className:"h-4 w-4 mr-1"})," Retour"]}
515),m.jsx("h2",{className:"font-heading text-xl font-bold",children:t?"Modifier l'article":"Nouvel article"}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{children:"Titre"}),m.jsx(Zn,{value:i,onChange:S=>o(S.target.value),required:!0})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{children:"Date de publication"}),m.jsx(Zn,{type:"date",value:a,onChange:S=>l(S.target.value)})]}),m.jsx(fZ,{selected:c,onChange:u}),e.length>0&&m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{children:"Auteur"}),m.jsxs("select",{value:h,onChange:S=>p(S.target.value),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm",children:[m.jsx("option",{value:"",children:"Sélectionner un auteur"}),e.map(S=>m.jsxs("option",{value:S.id,children:[S.name,S.role?` — ${S.role}`:""]},S.id))]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{children:"Contenu"}),m.jsx(lZ,{content:d,onChange:f})]}),m.jsx(Le,{type:"submit",disabled:g,className:"w-full",children:g?"Enregistrement…":t?"Mettre à jour":"Publier l'article"})]})}function pZ(){const[t,e]=x.useState(()=>sessionStorage.getItem("admin_pw")||""),[n,r]=x.useState(!1),[s,i]=x.useState([]),[o,a]=x.useState([]),[l,c]=x.useState(!1),[u,d]=x.useState("list"),[f,h]=x.useState(),[p,g]=x.useState(null),[y,v]=x.useState(!1),b=x.useCallback(async()=>{c(!0);try{const{data:T,error:N}=await Rt.from("posts").select("id, title, slug, published_at, tags, excerpt, author_name").order("published_at",{ascending:!1});if(N)throw N;i(T||[])}catch{kr.error("Erreur de chargement")}c(!1)},[]),w=x.useCallback(async()=>{try{const{data:T}=await Rt.from("authors").select("id, name, role, institution").order("name");a(T||[])}catch{}},[]);x.useEffect(()=>{n&&(b(),w())},[n,b,w]),x.useEffect(()=>{t&&!n&&(async()=>{try{(await fetch("https://amsbifdjlzyfedlrawnq.supabase.co/functions/v1/blog-admin",{method:"POST",headers:{"x-admin-password":t,"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFtc2JpZmRqbHp5ZmVkbHJhd25xIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM2MDUwNDAsImV4cCI6MjA4OTE4MTA0MH0.gnVWdrizTt0nWaLvBVdAtbSiJQTDT6qdv9Naein6Rqg"},body:JSON.stringify({action:"check"})})).ok?r(!0):sessionStorage.removeItem("admin_pw")}catch{}})()},[]);const k=T=>{e(T),r(!0)},S=async()=>{if(p){v(!0);try{if(!(await fetch("https://amsbifdjlzyfedlrawnq.supabase.co/functions/v1/blog-admin",{method:"POST",headers:{"x-admin-password":t,"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFtc2JpZmRqbHp5ZmVkbHJhd25xIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzM2MDUwNDAsImV4cCI6MjA4OTE4MTA0MH0.gnVWdrizTt0nWaLvBVdAtbSiJQTDT6qdv9Naein6Rqg"},body:JSON.stringify({action:"delete",id:p.id})})).ok)throw new Error("Erreur");kr.success("Article supprimé"),b()}catch{kr.error("Erreur lors de la suppression")}v(!1),g(null)}},C=async T=>{try{const{data:N,error:P}=await Rt.from("posts").select("id, title, slug, published_at, tags, excerpt, body, author_name, author_id").eq("id",T).single();if(P)throw P;h(N),d("edit")}catch{kr.error("Erreur de chargement")}},E=()=>{sessionStorage.removeItem("admin_pw"),r(!1),e("")};return n?m.jsxs("div",{className:"min-h-screen bg-muted",children:[m.jsxs("header",{className:"bg-card border-b border-border px-6 py-4 flex items-center justify-between",children:[m.jsx("h1",{className:"font-heading text-lg font-bold",children:"Administration — La Gazette"}),m.jsxs(Le,{variant:"ghost",size:"sm",onClick:E,children:[m.jsx(VA,{className:"h-4 w-4 mr-1"})," Déconnexion"]})]}),m.jsxs("main",{className:"container mx-auto py-8 px-4",children:[u==="list"&&m.jsxs(m.Fragment,{children:[m.jsx(GH,{password:t}),m.jsxs("div",{className:"flex items-center justify-between mb-6 mt-8",children:[m.jsxs("h2",{className:"font-heading text-xl font-bold",children:["Articles (",s.length,")"]}),m.jsxs(Le,{onClick:()=>d("create"),children:[m.jsx(iF,{className:"h-4 w-4 mr-1"})," Nouvel article"]})]}),l?m.jsx("p",{className:"text-muted-foreground",children:"Chargement…"}):m.jsx("div",{className:"space-y-2",children:s.map(T=>{var P;const N=T.tags||[];return m.jsxs("div",{className:"bg-card border border-border rounded-lg p-4 flex items-center justify-between gap-4",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"font-medium truncate",children:T.title}),m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-1",children:[N.map(q=>{const R=ji(q);return m.jsx("span",{className:`text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded ${R.bg} ${R.text}`,children:q},q)}),m.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:(P=T.published_at)==null?void 0:P.slice(0,10)}),T.author_name&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:["· ",T.author_name]})]})]}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx(Le,{variant:"ghost",size:"icon",onClick:()=>
515C(T.id),children:m.jsx(sF,{className:"h-4 w-4"})}),m.jsx(Le,{variant:"ghost",size:"icon",onClick:()=>g({id:T.id,title:T.title}),className:"text-destructive hover:text-destructive",children:m.jsx(cF,{className:"h-4 w-4"})})]})]},T.id)})})]}),(u==="edit"||u==="create")&&m.jsx(hZ,{article:u==="edit"?f:void 0,authors:o,password:t,onSaved:()=>{d("list"),h(void 0),b()},onCancel:()=>{d("list"),h(void 0)}})]}),m.jsx(FH,{open:!!p,onOpenChange:T=>!T&&g(null),children:m.jsxs(vR,{children:[m.jsxs(bR,{children:[m.jsx(xR,{children:"Supprimer cet article ?"}),m.jsxs(kR,{children:["Vous êtes sur le point de supprimer « ",p==null?void 0:p.title," ». Cette action est irréversible."]})]}),m.jsxs(wR,{children:[m.jsx(ER,{disabled:y,children:"Annuler"}),m.jsx(SR,{onClick:S,disabled:y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:y?"Suppression…":"Supprimer"})]})]})})]}):m.jsx(dZ,{onAuth:k})}const mZ=()=>{const{t}=Mt(),e=Yc().trim().email({message:t("membership.errors.invalidEmail")}).max(255,{message:t("membership.errors.tooLong")}),[n,r]=x.useState(""),[s,i]=x.useState(!1),[o,a]=x.useState(!1),[l,c]=x.useState(!1),{toast:u}=Yp(),d=pd(),{session:f,loading:h}=pm();x.useEffect(()=>{!h&&f&&d("/mon-espace",{replace:!0})},[f,h,d]);const p=async g=>{var w;g.preventDefault(),c(!1);const y=e.safeParse(n);if(!y.success){u({title:t("membership.errors.invalidTitle"),description:(w=y.error.issues[0])==null?void 0:w.message,variant:"destructive"});return}if(i(!0),!(await Rt.auth.signInWithOtp({email:y.data,options:{emailRedirectTo:`${window.location.origin}/auth/callback`,shouldCreateUser:!1}})).error){i(!1),c(!0);return}const{error:b}=await Rt.auth.signInWithOtp({email:y.data,options:{emailRedirectTo:`${window.location.origin}/auth/callback`,shouldCreateUser:!0}});if(i(!1),b){u({title:t("membership.errors.errorTitle"),description:b.message,variant:"destructive"});return}a(!0)};return m.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[m.jsx(oa,{forceScrolled:!0}),m.jsx("main",{className:"flex-1 flex items-stretch px-0 pt-20",children:m.jsxs("div",{className:"w-full grid grid-cols-1 lg:grid-cols-2 overflow-hidden bg-card border-y border-border",children:[m.jsxs("aside",{className:"relative hidden lg:flex overflow-hidden bg-primary min-h-[480px]",children:[m.jsx("img",{src:aa,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none select-none"}),m.jsx("div",{className:"noise-overlay !z-10 !opacity-[0.04]"}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-primary/80 via-primary/40 to-primary/10 pointer-events-none"}),m.jsx("img",{src:mm,alt:"Portrait du Marquis de Boufflers",className:"absolute bottom-0 left-1/2 -translate-x-1/2 h-[90%] w-auto object-contain opacity-30 pointer-events-none select-none"}),m.jsxs("div",{className:"relative z-20 flex flex-col justify-end p-8 xl:p-10 w-full",children:[m.jsx("div",{className:"mb-auto"}),m.jsx("h2",{className:"font-heading text-primary-foreground text-4xl xl:text-5xl font-black leading-[0.95] mb-4 opacity-0 animate-fade-in-up [animation-delay:100ms]",style:{whiteSpace:"pre-line"},children:t("membership.heroTitle")}),m.jsx("p",{className:"text-primary-foreground/80 text-sm max-w-xs opacity-0 animate-fade-in-up [animation-delay:250ms]",children:t("membership.heroSubtitle")})]})]}),m.jsx("section",{className:"flex items-center justify-center px-6 py-10 lg:py-12 bg-background relative",children:m.jsxs("div",{className:"w-full max-w-md opacity-0 animate-fade-in-up [animation-delay:200ms]",children:[m.jsxs("div",{className:"lg:hidden text-center mb-10",children:[m.jsx("h1",{className:"font-heading text-4xl font-black mb-2",children:t("membership.mobileTitle")}
515),m.jsx("div",{className:"w-12 h-px bg-foreground/20 mx-auto"})]}),m.jsxs("div",{className:"hidden lg:block mb-10",children:[m.jsx("span",{className:"inline-block text-[10px] font-medium tracking-[0.2em] uppercase text-muted-foreground mb-3",children:t("membership.step")}),m.jsx("h1",{className:"font-heading text-4xl font-black mb-3",children:t("membership.title")}),m.jsx("p",{className:"text-muted-foreground text-sm",children:t("membership.intro")})]}),l&&m.jsxs("div",{className:"mb-5 p-4 rounded-lg border border-amber-300 bg-amber-50 text-sm",children:[m.jsx("p",{className:"text-foreground font-medium mb-1",children:t("membership.alreadyExistsTitle")}),m.jsxs("p",{className:"text-muted-foreground",children:[t("membership.alreadyExistsBody")," ",m.jsx(Et,{to:"/connexion",className:"text-foreground underline underline-offset-2 font-medium",children:t("membership.loginLink")})]})]}),o?m.jsxs("div",{className:"text-center py-8 px-6 border border-border rounded-lg bg-card",children:[m.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-full bg-primary/10 mb-5",children:m.jsx(zA,{className:"w-7 h-7 text-primary"})}),m.jsx("h2",{className:"font-heading text-2xl mb-3",children:t("membership.sentTitle")}),m.jsxs("p",{className:"text-sm text-muted-foreground mb-6",children:[t("membership.sentBody"),m.jsx("br",{}),m.jsx("strong",{className:"text-foreground",children:n}),m.jsx("br",{}),m.jsx("span",{className:"text-xs",children:t("membership.sentHint")})]}),m.jsx(Le,{variant:"outline",size:"sm",onClick:()=>{a(!1),r("")},children:t("membership.useOther")})]}):m.jsxs("form",{onSubmit:p,className:"space-y-5",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{htmlFor:"email",className:"text-xs uppercase tracking-wider text-muted-foreground",children:t("membership.emailLabel")}),m.jsxs("div",{className:"relative",children:[m.jsx(zb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),m.jsx(Zn,{id:"email",type:"email",placeholder:t("membership.emailPlaceholder"),value:n,onChange:g=>r(g.target.value),className:"pl-10 h-12 text-base",required:!0,autoComplete:"email"})]})]}),m.jsx(Le,{type:"submit",size:"lg",className:"w-full h-12 hover:shadow-xl hover:shadow-primary/20 transition-shadow",disabled:s,children:s?m.jsxs(m.Fragment,{children:[m.jsx(Ko,{className:"w-4 h-4 animate-spin"}),t("membership.sending")]}):t("membership.createAccount")}),m.jsxs("div",{className:"flex items-center gap-3 py-2",children:[m.jsx("div",{className:"flex-1 h-px bg-border"}),m.jsx("span",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:t("membership.noPassword")}),m.jsx("div",{className:"flex-1 h-px bg-border"})]}),m.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:[t("membership.alreadyMember")," ",m.jsx(Et,{to:"/connexion",className:"text-foreground underline underline-offset-2 font-medium",children:t("membership.loginLink")})]})]})]})})]})}),m.jsx(la,{})]})},gZ=()=>{const{t}=Mt(),e=Yc().trim().email({message:t("membership.errors.invalidEmail")}).max(255,{message:t("membership.errors.tooLong")}),[n,r]=x.useState(""),[s,i]=x.useState(!1),[o,a]=x.useState(!1),[l,c]=x.useState(!1),{toast:u}=Yp(),d=pd(),{session:f,loading:h}=pm();x.useEffect(()=>{!h&&f&&d("/mon-espace",{replace:!0})},[f,h,d]);const p=async g=>{var b;g.preventDefault(),c(!1);const y=e.safeParse(n);if(!y.success){u({title:t("membership.errors.invalidTitle"),description:(b=y.error.issues[0])==null?void 0:b.message,variant:"destructive"});return}i(!0);const{error:v}=await Rt.auth.signInWithOtp({email:y.data,options:{emailRedirectTo:`${window.location.origin}/auth/callback`,shouldCreateUser:!1}});if(i(!1),v){if(/signups? not allowed|not found|user not found|otp_disabled/i.test(v.message)){c(!0);return}u({title:t("membership.errors.errorTitle"),description:v.message,variant:"destructive"});return}a(!0)};return m.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[m.jsx(oa,{forceScrolled:!0}),m.jsx("main",{className:"flex-1 flex items-stretch px-0 pt-20",children:m.jsxs("div",{className:"w-full grid grid-cols-1 lg:grid-cols-2 overflow-hidden bg-card border-y border-border",children:[m.jsxs("aside",{className:"relative hidden lg:flex overflow-hidden bg-primary min-h-[480px]",children:[m.jsx("img",{src:aa,alt:"",className:"absolute inset-0 w-full h-full object-cover pointer-events-none select-none"}),m.jsx("div",{className:"noise-overlay !z-10 !opacity-[0.04]"}),m.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-primary/80 via-primary/40 to-primary/10 pointer-events-none"}),m.jsx("img",{src:mm,alt:"Portrait du Marquis de Boufflers",className:"absolute bottom-0 left-1/2 -translate-x-1/2 h-[90%] w-auto object-contain opacity-30 pointer-events-none select-none"}),m.jsxs("div",{className:"relative z-20 flex flex-col justify-end p-8 xl:p-10 w-full",children:[m.jsx("div",{className:"mb-auto"}),m.jsx("h2",{className:"font-heading text-primary-foreground text-4xl xl:text-5xl font-black leading-[0.95] mb-4 opacity-0 animate-fade-in-up [animation-delay:100ms]",style:{whiteSpace:"pre-line"},children:t("connexion.asideTitle")}
515),m.jsx("p",{className:"text-primary-foreground/80 text-sm max-w-xs mb-2 opacity-0 animate-fade-in-up [animation-delay:250ms]",children:t("connexion.asideBody")})]})]}),m.jsx("section",{className:"flex items-center justify-center px-6 py-10 lg:py-12 bg-background relative",children:m.jsxs("div",{className:"w-full max-w-md opacity-0 animate-fade-in-up [animation-delay:200ms]",children:[m.jsxs("div",{className:"lg:hidden text-center mb-10",children:[m.jsx("h1",{className:"font-heading text-4xl font-black mb-2",children:t("connexion.mobileTitle")}),m.jsx("div",{className:"w-12 h-px bg-foreground/20 mx-auto"})]}),m.jsxs("div",{className:"hidden lg:block mb-10",children:[m.jsx("span",{className:"inline-block text-[10px] font-medium tracking-[0.2em] uppercase text-muted-foreground mb-3",children:t("connexion.tag")}),m.jsx("h1",{className:"font-heading text-4xl font-black mb-3",children:t("connexion.title")}),m.jsx("p",{className:"text-muted-foreground text-sm",children:t("connexion.intro")})]}),l&&m.jsxs("div",{className:"mb-5 p-4 rounded-lg border border-destructive/30 bg-destructive/5 text-sm",children:[m.jsx("p",{className:"text-foreground font-medium mb-1",children:t("connexion.notFoundTitle")}),m.jsxs("p",{className:"text-muted-foreground",children:[t("connexion.notFoundBody")," ",m.jsx(Et,{to:"/devenir-membre",className:"text-foreground underline underline-offset-2 font-medium",children:t("connexion.becomeLink")})]})]}),o?m.jsxs("div",{className:"text-center py-8 px-6 border border-border rounded-lg bg-card",children:[m.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-full bg-primary/10 mb-5",children:m.jsx(zA,{className:"w-7 h-7 text-primary"})}),m.jsx("h2",{className:"font-heading text-2xl mb-3",children:t("connexion.sentTitle")}),m.jsxs("p",{className:"text-sm text-muted-foreground mb-6",children:[t("connexion.sentBody"),m.jsx("br",{}),m.jsx("strong",{className:"text-foreground",children:n})]}),m.jsx(Le,{variant:"outline",size:"sm",onClick:()=>{a(!1),r("")},children:t("connexion.useOther")})]}):m.jsxs("form",{onSubmit:p,className:"space-y-5",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{htmlFor:"email",className:"text-xs uppercase tracking-wider text-muted-foreground",children:t("connexion.emailLabel")}),m.jsxs("div",{className:"relative",children:[m.jsx(zb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),m.jsx(Zn,{id:"email",type:"email",placeholder:t("connexion.emailPlaceholder"),value:n,onChange:g=>r(g.target.value),className:"pl-10 h-12 text-base",required:!0,autoComplete:"email"})]})]}),m.jsx(Le,{type:"submit",size:"lg",className:"w-full h-12 hover:shadow-xl hover:shadow-primary/20 transition-shadow",disabled:s,children:s?m.jsxs(m.Fragment,{children:[m.jsx(Ko,{className:"w-4 h-4 animate-spin"}),t("connexion.sending")]}):t("connexion.sendLink")}),m.jsxs("div",{className:"flex items-center gap-3 py-2",children:[m.jsx("div",{className:"flex-1 h-px bg-border"}),m.jsx("span",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:t("connexion.noPassword")}),m.jsx("div",{className:"flex-1 h-px bg-border"})]}),m.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:[t("connexion.notMember")," ",m.jsx(Et,{to:"/devenir-membre",className:"text-foreground underline underline-offset-2 font-medium",children:t("connexion.joinLink")})]})]})]})})]})}),m.jsx(la,{})]})},yZ=()=>{const{t}=Mt(),e=pd(),[n,r]=x.useState(null);return x.useEffect(()=>{(async()=>{try{const i=new URL(window.location.href),o=i.searchParams.get("error_description")||new URLSearchParams(i.hash.replace(/^#/,"")).get("error_description");if(o){r(decodeURIComponent(o));return}if(i.searchParams.get("code")){const{error:l}=await Rt.auth.exchangeCodeForSession(window.location.href);if(l){r(l.message);return}e("/mon-espace",{replace:!0});return}for(let l=0;l<10;l++){const{data:c}=await Rt.auth.getSession();if(c.session){e("/mon-espace",{replace:!0});return}await new Promise(u=>setTimeout(u,200))}e("/connexion",{replace:!0})}catch(i){r((i==null?void 0:i.message)??"Erreur de connexion")}})()},[e]),m.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-6",children:m.jsx("div",{className:"text-center max-w-md",children:n?m.jsxs(m.Fragment,{children:[m.jsx(G4,{className:"w-8 h-8 mx-auto mb-3 text-destructive"}),m.jsx("h1",{className:"font-heading text-xl mb-2",children:t("authCallback.invalidTitle")}),m.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n}),m.jsx("button",{onClick:()=>e("/connexion",{replace:!0}),className:"text-sm underline text-primary",children:t("authCallback.back")})]}):m.jsxs(m.Fragment,{children:[m.jsx(Ko,{className:"w-8 h-8 animate-spin mx-auto mb-3 text-primary"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:t("authCallback.connecting")})]})})})},j0="https://www.helloasso.com/associations/institut-stanislas-de-boufflers/adhesions/adhesions-membres-de-l-institut-2026",vZ=({membership:t})=>{const{t:e,i18n:n}=Mt(),r=new Date,s=t!=null&&t.expires_at?new Date(t.expires_at):null,i=t&&s&&s>r,o=s?Math.ceil((s.getTime()-r.getTime())/(1e3*60*60*24)):0,a=i&&o<=30,l=new Date(r.getFullYear(),11,31),c=(n.resolvedLanguage||n.language||"fr").startsWith("en")?"en-GB":"fr-FR",u=new Intl.DateTimeFormat(c,{day:"numeric",month:"long",year:"numeric"});let d="bg-muted",f="bg-muted-foreground",h=e("monEspace.status.none"),p=e("monEspace.status.noneDetail");return i&&!a?(d="bg-emerald-50 border-emerald-200",f="bg-emerald-500",h=e("monEspace.status.active"),p=e("monEspace.status.val
515idUntil",{date:u.format(l)})):i&&a&&(d="bg-amber-50 border-amber-200",f="bg-amber-500",h=e("monEspace.status.expiring"),p=e("monEspace.status.expiresIn",{count:o})),m.jsxs("div",{className:`rounded-lg border p-6 ${d}`,children:[m.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[m.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${f}`}),m.jsx("span",{className:"font-heading text-lg",children:h})]}),(t==null?void 0:t.tier)&&m.jsx("div",{className:"mb-2",children:m.jsx("span",{className:"inline-block text-xs font-medium tracking-wide uppercase px-2 py-0.5 rounded bg-foreground/5 text-foreground/70 border border-foreground/10",children:t.tier})}),p&&m.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:p}),i&&m.jsx(Le,{asChild:!0,size:"sm",variant:"outline",children:m.jsxs("a",{href:j0,target:"_blank",rel:"noopener noreferrer",children:[e("monEspace.viewOnHelloasso"),m.jsx(UA,{className:"w-3.5 h-3.5"})]})})]})},bZ=()=>{const{t}=Mt();return m.jsxs("div",{className:"mt-6 rounded-lg border border-border overflow-hidden bg-card",children:[m.jsx("iframe",{src:`${j0}/widget`,title:"Adhésion HelloAsso",className:"w-full",style:{height:"750px",border:0},loading:"lazy"}),m.jsxs("div",{className:"p-3 text-xs text-muted-foreground text-center border-t border-border",children:[t("monEspace.poweredBy")," ",m.jsxs("a",{href:j0,target:"_blank",rel:"noopener noreferrer",className:"underline inline-flex items-center gap-1",children:[t("monEspace.openNewTab")," ",m.jsx(UA,{className:"w-3 h-3"})]})]})]})},wZ=()=>{const{t}=Mt(),e=pd(),{user:n,loading:r,signOut:s}=pm(),{toast:i}=Yp(),[o,a]=x.useState({first_name:"",last_name:"",phone:"",email:""}),[l,c]=x.useState(null),[u,d]=x.useState(!0),[f,h]=x.useState(!1),[p,g]=x.useState(!1),y=async k=>{const{data:S}=await Rt.from("memberships").select("id, status, expires_at, started_at, tier").eq("user_id",k).order("expires_at",{ascending:!1,nullsFirst:!1}).limit(1).maybeSingle();c(S??null)},v=async()=>{if(n!=null&&n.email){g(!0);try{const{data:k,error:S}=await Rt.functions.invoke("helloasso-sync",{body:{email:n.email}});if(S)throw S;await y(n.id),i({title:t("monEspace.sync.doneTitle"),description:(k==null?void 0:k.upserted)>0?t("monEspace.sync.updated",{count:k.upserted}):t("monEspace.sync.none")})}catch(k){i({title:t("monEspace.sync.errorTitle"),description:k.message,variant:"destructive"})}finally{g(!1)}}};x.useEffect(()=>{!r&&!n&&e("/connexion",{replace:!0})},[n,r,e]),x.useEffect(()=>{if(!n)return;(async()=>{const[{data:S},{data:C}]=await Promise.all([Rt.from("profiles").select("first_name, last_name, phone, email").eq("id",n.id).maybeSingle(),Rt.from("memberships").select("id, status, expires_at, started_at, tier").eq("user_id",n.id).order("expires_at",{ascending:!1,nullsFirst:!1}).limit(1).maybeSingle()]);a(S?{first_name:S.first_name??"",last_name:S.last_name??"",phone:S.phone??"",email:S.email??n.email??""}:E=>({...E,email:n.email??""})),c(C??null),d(!1)})()},[n]);const b=async k=>{var C,E,T;if(k.preventDefault(),!n)return;h(!0);const{error:S}=await Rt.from("profiles").upsert({id:n.id,first_name:((C=o.first_name)==null?void 0:C.trim())||null,last_name:((E=o.last_name)==null?void 0:E.trim())||null,phone:((T=o.phone)==null?void 0:T.trim())||null,email:n.email});h(!1),i(S?{title:t("monEspace.error"),description:S.message,variant:"destructive"}:{title:t("monEspace.saved")})},w=async()=>{await s(),e("/",{replace:!0})};return r||u?m.jsx("div",{className:"min-h-screen flex items-center justify-center",children:m.jsx(Ko,{className:"w-6 h-6 animate-spin text-primary"})}):m.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[m.jsx(oa,{forceScrolled:!0}),m.jsx("main",{className:"flex-1 py-32",children:m.jsxs("div",{className:"container mx-auto px-4",children:[m.jsxs("div",{className:"flex items-start justify-between mb-8 gap-4 flex-wrap",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-heading text-4xl mb-2",children:t("monEspace.title")}),m.jsx("p",{className:"text-muted-foreground text-sm",children:n==null?void 0:n.email})]}),m.jsxs(Le,{variant:"outline",size:"sm",onClick:w,children:[m.jsx(VA,{className:"w-4 h-4"}),t("monEspace.signOut")]})]}),m.jsxs("section",{className:"mb-10",children:[m.jsx("div",{className:"flex items-center justify-end mb-4",children:m.jsxs(Le,{variant:"ghost",size:"sm",onClick:v,disabled:p,children:[p?m.jsx(Ko,{className:"w-3.5 h-3.5 animate-spin"}):m.jsx(lF,{className:"w-3.5 h-3.5"}),t("monEspace.refresh")]})}),m.jsx(vZ,{membership:l}),(()=>{const k=l!=null&&l.expires_at?new Date(l.expires_at):null;return l&&k&&k>new Date?null:m.jsx(bZ,{})})()]}),m.jsxs("section",{children:[m.jsxs("h2",{className:"font-heading text-xl mb-4 flex items-center gap-2",children:[m.jsx(dF,{className:"w-5 h-5"}),t("monEspace.personalInfo")]}),m.jsxs("form",{onSubmit:b,className:"bg-card border border-border rounded-lg p-6 space-y-4",children:[m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{htmlFor:"first_name",children:t("monEspace.firstName")}
515),m.jsx(Zn,{id:"first_name",value:o.first_name??"",disabled:!0})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{htmlFor:"last_name",children:t("monEspace.lastName")}),m.jsx(Zn,{id:"last_name",value:o.last_name??"",disabled:!0})]})]}),m.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:t("monEspace.infoLocked")}),m.jsxs("div",{className:"space-y-2",children:[m.jsx(Jn,{htmlFor:"email",children:t("monEspace.email")}),m.jsx(Zn,{id:"email",value:o.email??"",disabled:!0}),m.jsx("p",{className:"text-xs text-muted-foreground",children:t("monEspace.emailLocked")})]})]})]})]})}),m.jsx(la,{})]})},xZ=new oL,kZ=()=>{const{i18n:t}=Mt();return x.useEffect(()=>{const e=(t.resolvedLanguage||t.language||"fr").startsWith("en")?"en":"fr";document.documentElement.lang=e},[t.resolvedLanguage,t.language]),null},SZ=()=>m.jsx(dL,{client:xZ,children:m.jsxs(j3,{children:[m.jsx(KF,{}),m.jsx(q$,{}),m.jsx(bD,{children:m.jsxs(EV,{children:[m.jsx(kZ,{}),m.jsxs(fD,{children:[m.jsx(ur,{path:"/",element:m.jsx(cH,{})}),m.jsx(ur,{path:"/blog",element:m.jsx(fH,{})}),m.jsx(ur,{path:"/blog/:slug",element:m.jsx(mH,{})}),m.jsx(ur,{path:"/qui-sommes-nous",element:m.jsx(_H,{})}),m.jsx(ur,{path:"/admin",element:m.jsx(pZ,{})}),m.jsx(ur,{path:"/devenir-membre",element:m.jsx(mZ,{})}),m.jsx(ur,{path:"/connexion",element:m.jsx(gZ,{})}),m.jsx(ur,{path:"/auth/callback",element:m.jsx(yZ,{})}),m.jsx(ur,{path:"/mon-espace",element:m.jsx(wZ,{})}),m.jsx(ur,{path:"*",element:m.jsx(gH,{})})]})]})})]})}),{slice:EZ,forEach:CZ}=[];function _Z(t){return CZ.call(EZ.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}
vendor: 6,616 bytes, line 515
515function TZ(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const oC=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,AZ=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let i=`${t}=${s}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!oC.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!oC.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},aC={create(t,e,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=AZ(t,e,s)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var NZ={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return aC.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:i}=e;n&&typeof document<"u"&&aC.create(n,t,r,s,i)}},OZ={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const o=s.substring(1).split("&");for(let a=0;a<o.length;a++){const l=o[a].indexOf("=");l>0&&o[a].substring(0,l)===e&&(n=o[a].substring(l+1))}}return n}},RZ={name:"hash",lookup(t){var s;let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(e){const a=o.split("&");for(let l=0;l<a.length;l++){const c=a[l].indexOf("=");c>0&&a[l].substring(0,c)===e&&(r=a[l].substring(c+1))}}if(r)return r;if(!r&&n>-1){const a=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?(s=a[typeof n=="number"?n:0])==null?void 0:s.replace("/",""):void 0}}}return r}};let Ta=null;const lC=()=>{if(Ta!==null)return Ta;try{if(Ta=typeof window<"u"&&window.localStorage!==null,!Ta)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ta=!1}return Ta};var PZ={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&lC())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&lC()&&window.localStorage.setItem(n,t)}};let Aa=null;const cC=()=>{if(Aa!==null)return Aa;try{if(Aa=typeof window<"u"&&window.sessionStorage!==null,!Aa)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Aa=!1}return Aa};var IZ={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&cC())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&cC()&&window.sessionStorage.setItem(n,t)}},jZ={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let i=0;i<n.length;i++)e.push(n[i]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},MZ={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},LZ={name:"path",lookup(t){var s;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},DZ={name:"subdomain",lookup(t){var s,i;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let fj=!1;try{document.cookie,fj=!0}catch{}const hj=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];fj||hj.splice(1,1);const $Z=()=>({order:hj,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class pj{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=_Z(n,this.options||{},$Z()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(NZ),this.addDetector(OZ),this.addDetector(PZ),this.addDetector(IZ),this.addDetector(jZ),this.addDetector(MZ),this.addDetector(LZ),this.addDetector(DZ),this.addDetector(RZ)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!TZ(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}
515cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}pj.type="languageDetector";const FZ={events:"Évènements",gazette:"La Gazette",institute:"L'Institut",login:"Connexion",myspace:"Mon espace",become:"Devenir membre",menu:"Menu",ariaMenu:"Menu"},BZ={tagline:"Institut de Boufflers",blurb:"Think tank au service de la protection et de la valorisation de l'innovation.",navigation:"Navigation",contact:"Contact",backToTop:"Retour en haut",rights:"© {{year}} Institut de Boufflers. Tous droits réservés."},zZ={label:"Langue",fr:"FR",en:"EN"},UZ={title:`Institut
516de Boufflers`,subtitle:"Le Think Tank au service de l'innovation.",cta:"Rejoindre l'association"},VZ={conference:"Conférence",conferenceDesc:"Cette journée examine la mise en œuvre contentieuse de la propriété intellectuelle dans une perspective transversale. Universitaires, praticiens et représentants d'institutions confronteront leurs analyses autour de l'accès au juge, de la preuve et de la confidentialité, des injonctions, du contentieux FRAND, du premier bilan de la Juridiction unifiée du brevet, de la saisie-contrefaçon et des sanctions pénales.",register:"je m'inscris",closed:"inscriptions fermées",afterwork:"Afterwork",afterworkDesc:"Une à deux fois par an, l'Institut Stanislas de Boufflers organise un afterwork pour échanger librement autour d'un verre, tisser des liens et partager des idées dans une ambiance décontractée.",altConfLogo:"Logo Les Conversations du Chevalier",altCauseriesLogo:"Logo Les Causeries du Chevalier",altConfFlyer:"Prochain événement — Conférence Droit des brevets",altCauseriesFlyer:"Prochain événement — Summer Party",programme:"télécharger le programme"},HZ={title:"Devenir membre",body:"L'adhésion vous donne accès à l'ensemble des conférences et afterworks du Chevalier. Gratuite pour les étudiants, 50 € pour les professionnels de moins de 30 ans et 75 € au-delà. Malheureusement, encore refusée dans les salons d'aéroport…",cta:"Devenir membre",cardMemberOf:"Membre de"},WZ={title:"Qui sommes-nous ?",subtitle:"L'Institut Stanislas de Boufflers, think tank au service de la protection et de la valorisation de l'innovation.",wordTitle:"Le mot du Chevalier",word:{p1:"Fondé à l'automne 2018, l'Institut Stanislas de Boufflers, qui compte désormais plus de 200 membres (2022), vise à réunir des spécialistes issus de tous horizons qui partagent l'ambition d'œuvrer en faveur de la protection et de la valorisation de l'innovation.",p2:"Le but est de forger une innovation responsable au service de l'intérêt général.",p3:"À cette fin, l'Institut rend des rapports destinés aux pouvoirs publics et organise des événements en vue de faire avancer les débats relatifs à la protection de l'innovation.",p4:"D'un point de vue institutionnel, l'Institut est mené par un conseil d'administration à la tête duquel se situent un Comité de surveillance et un Bureau.",p5:"Le Comité Scientifique de l'Institut en fixe les orientations.",p6:"Toute personne s'acquittant de la cotisation est susceptible d'intégrer l'Institut et de participer à ses activités."},becomeMember:"Devenir membre",bureau:"Le Bureau",council:"Conseil d'Administration",honor:"Membres d'honneur",contactTitle:"Nous contacter",contactIntro:"Pour toute demande, n'hésitez pas à vous adresser au service concerné.",contactGeneral:"Contact général",contactSecretary:"Secrétariat général",contactTreasury:"Trésorerie",roles:{president:"Président",secretary:"Secrétaire générale",secretaryAdj:"Secrétaire adjoint",treasurer:"Trésorier"}},qZ={heroTitle:`Devenir
517membre`,heroSubtitle:"Rejoignez l'Institut : créez votre compte, puis finalisez votre adhésion sur HelloAsso.",mobileTitle:"Devenir membre",step:"Étape 1 sur 2 — créer son compte",title:"Rejoindre l'Institut",intro:"Saisissez votre email pour créer votre compte. Vous serez ensuite redirigé vers HelloAsso pour régler votre cotisation annuelle.",alreadyExistsTitle:"Un compte existe déjà avec cet email.",alreadyExistsBody:"Connectez-vous plutôt à votre espace.",loginLink:"se connecter",sentTitle:"Vérifiez votre boîte mail",sentBody:"Un lien de connexion vient d'être envoyé à",sentHint:"Cliquez dessus pour activer votre compte, puis finalisez votre adhésion.",useOther:"utiliser une autre adresse",emailLabel:"Adresse email",emailPlaceholder:"[email protected]",sending:"envoi…",createAccount:"cr
517éer mon compte",noPassword:"sans mot de passe",alreadyMember:"Déjà membre ?",errors:{invalidEmail:"Adresse email invalide",tooLong:"Email trop long",invalidTitle:"Email invalide",errorTitle:"Erreur"}},KZ={asideTitle:`Espace
518membre`,asideBody:"Accédez à votre adhésion, vos informations et l'agenda privé de l'Institut.",mobileTitle:"Espace membre",tag:"Espace membre",title:"Connexion",intro:"Saisissez l'email avec lequel vous avez adhéré — nous vous envoyons un lien magique. Pas de mot de passe.",notFoundTitle:"Aucun compte associé à cet email.",notFoundBody:"Vous devez d'abord créer un compte.",becomeLink:"devenir membre",sentTitle:"Vérifiez votre boîte mail",sentBody:"Un lien de connexion vient d'être envoyé à",useOther:"utiliser une autre adresse",emailLabel:"Adresse email",emailPlaceholder:"[email protected]",sending:"envoi…",sendLink:"recevoir le lien de connexion",noPassword:"sans mot de passe",notMember:"Pas encore membre ?",joinLink:"rejoindre l'Institut"},GZ={title:"Mon espace",signOut:"déconnexion",refresh:"rafraîchir",viewOnHelloasso:"voir sur HelloAsso",poweredBy:"Propulsé par HelloAsso —",openNewTab:"ouvrir dans un nouvel onglet",personalInfo:"Informations personnelles",firstName:"Prénom",lastName:"Nom",infoLocked:"Prénom et nom proviennent de votre adhésion HelloAsso et ne peuvent pas être modifiés ici.",email:"Email",emailLocked:"L'email ne peut pas être modifié ici.",status:{active:"Membre actif",expiring:"Adhésion bientôt expirée",none:"Pas encore membre",noneDetail:"Adhérez ci-dessous pour rejoindre l'Institut.",validUntil:"Adhésion valide jusqu'au {{date}}",expiresIn_one:"Expire dans {{count}} jour",expiresIn_other:"Expire dans {{count}} jours"},sync:{doneTitle:"Synchronisation terminée",updated:"{{count}} adhésion(s) mise(s) à jour.",none:"Aucune nouvelle adhésion trouvée.",errorTitle:"Erreur de synchronisation"},saved:"Profil enregistré",error:"Erreur"},JZ={invalidTitle:"Lien invalide",back:"Retour à la connexion",connecting:"Connexion en cours…"},QZ={title:"404",message:"Oups ! Page introuvable.",home:"Retour à l'accueil"},ZZ={heroTitle:`La Gazette
519du Chevalier`,heroSubtitle:"Actualités & commentaires en matière de propriété intellectuelle — par l'Institut Stanislas de Boufflers.",latest:"Dernières paruti
519ons",all:"Tous",empty:"Aucun article dans cette catégorie pour le moment.",read:"Lire",defaultAuthor:"Institut Stanislas de Boufflers",back:"Retour à la Gazette",soon:"Contenu à venir…",heroTitle1:"La Gazette",heroTitle2:"du Chevalier"},YZ={back:"Retour à la Gazette",comingSoon:"Contenu à venir…"},XZ={title:"Ils sont chevaliers d'un autre genre : ceux qui, par leur soutien, permettent à l'Institut de Boufflers de faire vivre cette journée de conférence ambitieuse.",tiers:{grandMecene:"Grands mécènes",bienfaiteur:"Chevaliers bienfaiteurs",ami:"Amis du Chevalier"}},eY={nav:FZ,footer:BZ,language:zZ,hero:UZ,events:VZ,membershipCta:HZ,about:WZ,membership:qZ,connexion:KZ,monEspace:GZ,authCallback:JZ,notFound:QZ,blog:ZZ,blogPost:YZ,sponsors:XZ},tY={events:"Events",gazette:"The Gazette",institute:"The Institute",login:"Log in",myspace:"My account",become:"Become a member",menu:"Menu",ariaMenu:"Menu"},nY={tagline:"Institut de Boufflers",blurb:"A think tank dedicated to protecting and promoting innovation.",navigation:"Navigation",contact:"Contact",backToTop:"Back to top",rights:"© {{year}} Institut de Boufflers. All rights reserved."},rY={label:"Language",fr:"FR",en:"EN"},sY={title:`Institut
520de Boufflers`,subtitle:"The think tank at the service of innovation.",cta:"Join the association"},iY={conference:"Conference",conferenceDesc:"This conference examines the enforcement of intellectual property rights from a cross-cutting perspective. Academics, practitioners and institutional representatives will compare their analyses of access to justice, evidence and confidentiality, injunctions, FRAND litigation, the first assessment of the Unified Patent Court, seizure orders for evidence in infringement proceedings (saisie-contrefaçon), and criminal enforcement.",register:"register",closed:"registrations closed",afterwork:"Afterwork",afterworkDesc:"Once or twice a year, the Institut Stanislas de Boufflers hosts an afterwork to discuss freely over a drink, build connections and share ideas in a relaxed setting.",altConfLogo:"Les Conversations du Chevalier logo",altCauseriesLogo:"Les Causeries du Chevalier logo",altConfFlyer:"Upcoming event — Patent Law Conference",altCauseriesFlyer:"Upcoming event — Summer Party",programme:"download the programme"},oY={title:"Become a member",body:"Membership grants access to all of the Chevalier's conferences and afterworks. Free for students, €50 for professionals under 30 and €75 thereafter. Sadly, still not accepted in airport lounges…",cta:"Become a member",cardMemberOf:"Member of"},aY={title:"Who we are",subtitle:"The Institut Stanislas de Boufflers, a think tank dedicated to protecting and promoting innovation.",wordTitle:"A word from the Chevalier",word:{p1:"Founded in autumn 2018, the Institut Stanislas de Boufflers, which now counts more than 200 members (2022), brings together specialists from all backgrounds who share the ambition of working for the protection and valorisation of innovation.",p2:"Our goal: to forge responsible innovation in the public interest.",p3:"To this end, the Institute issues reports addressed to public authorities and organises events to advance debates on the protection of innovation.",p4:"Institutionally, the Institute is governed by a board of directors, headed by a Supervisory Committee and an Executive Office.",p5:"The Institute's Scientific Committee sets its orientations.",p6:"Anyone paying the membership fee may join the Institute and take part in its activities."},becomeMember:"Become a member",bureau:"Executive Office",council:"Board of Directors",honor:"Honorary members",contactTitle:"Contact us",contactIntro:"For any enquiry, feel free to reach out to the relevant department.",contactGeneral:"General contact",contactSecretary:"General secretariat",contactTreasury:"Treasury",roles:{president:"President",secretary:"General Secretary",secretaryAdj:"Deputy Secretary",treasurer:"Treasurer"}},lY={heroTitle:`Become a
521member`,heroSubtitle:"Join the Institute: create your account, then complete your membership on HelloAsso.",mobileTitle:"Become a member",step:"Step 1 of 2 — create your account",title:"Join the Institute",intro:"Enter your email to create your account. You will then be redirected to HelloAsso to pay your annual membership fee.",alreadyExistsTitle:"An account already exists with this email.",alreadyExistsBody:"Please log in to your account instead.",loginLink:"log in",sentTitle:"Check your inbox",sentBody:"A login link has just been sent to",sentHint:"Click it to activate your account, then complete your membership.",useOther:"use another email",emailLabel:"Email address",emailPlaceholder:"[email protected]",sending:"sending…",createAccount:"create my account",noPassword:"no password",alreadyMember:"Already a member?",errors:{invalidEmail:"Invalid email address",tooLong:"Email too long",invalidTitle:"Invalid email",errorTitle:"Error"}},cY={asideTitle:`Member
522area`,asideBody:"Access your membership, your information and the Institute's private agenda.",mobileTitle:"Member area",tag:"Member area",title:"Log in",intro:"Enter the email you used to join — we'll send you a magic link. No password required.",notFoundTitle:"No account is linked to this email.",notFoundBody:"You need to create an account first.",becomeLink:"become a member",sentTitle:"Check your inbox",sentBody:"A login link has just been sent to",useOther:"use another email",emailLabel:"Email address",emailPlaceholder:"[email protected]",sending:"sending…",sendLink:"send me the login link",noPassword:"no password",notMember:"Not a member yet?",j
522oinLink:"join the Institute"},uY={title:"My account",signOut:"sign out",refresh:"refresh",viewOnHelloasso:"view on HelloAsso",poweredBy:"Powered by HelloAsso —",openNewTab:"open in a new tab",personalInfo:"Personal information",firstName:"First name",lastName:"Last name",infoLocked:"First and last name come from your HelloAsso membership and cannot be edited here.",email:"Email",emailLocked:"Email cannot be edited here.",status:{active:"Active member",expiring:"Membership expiring soon",none:"Not yet a member",noneDetail:"Sign up below to join the Institute.",validUntil:"Membership valid until {{date}}",expiresIn_one:"Expires in {{count}} day",expiresIn_other:"Expires in {{count}} days"},sync:{doneTitle:"Sync complete",updated:"{{count}} membership(s) updated.",none:"No new membership found.",errorTitle:"Sync error"},saved:"Profile saved",error:"Error"},dY={invalidTitle:"Invalid link",back:"Back to login",connecting:"Signing in…"},fY={title:"404",message:"Oops! Page not found.",home:"Back to home"},hY={heroTitle:`The Gazette
523of the Chevalier`,heroSubtitle:"Intellectual property news & commentary — by the Institut Stanislas de Boufflers.",latest:"Latest issues",all:"All",empty:"No article in this category yet.",read:"Read",defaultAuthor:"Institut Stanislas de Boufflers",back:"Back to the Gazette",soon:"Content coming soon…",heroTitle1:"The Knight’s",heroTitle2:"Gazette"},pY={back:"Back to the Gazette",comingSoon:"Content coming soon…"},mY={title:"They are knights of a different kind: those who, through their support, enable the Institut de Boufflers to bring this ambitious conference day to life.",tiers:{grandMecene:"Major patrons",bienfaiteur:"Benefactor Knights",ami:"Friends of the Knight"}},gY={nav:tY,footer:nY,language:rY,hero:sY,events:iY,membershipCta:oY,about:aY,membership:lY,connexion:cY,monEspace:uY,authCallback:dY,notFound:fY,blog:hY,blogPost:pY,sponsors:mY};fn.use(pj).use(XD).init({resources:{fr:{translation:eY},en:{translation:gY}},fallbackLng:"fr",supportedLngs:["fr","en"],interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag"],lookupLocalStorage:"isb-lang",caches:["localStorage"]}});PT(document.getElementById("root")).render(m.jsx(SZ,{}));

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.