PageSourceSearch

https://non-initiative-ssr.community/assets/index-DYe-sHx2.js

js non-initiative-ssr.community collected 2026-10-09 22:02:38 UTC 1,392,382 bytes, 695 lines download raw bytes

vendor: 6,287 bytes, lines 1-9
1var lz=Object.defineProperty;var Y1=t=>{throw TypeError(t)};var cz=(t,e,n)=>e in t?lz(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ri=(t,e,n)=>cz(t,typeof e!="symbol"?e+"":e,n),Sy=(t,e,n)=>e.has(t)||Y1("Cannot "+n);var j=(t,e,n)=>(Sy(t,e,"read from private field"),n?n.call(t):e.get(t)),ke=(t,e,n)=>e.has(t)?Y1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),se=(t,e,n,r)=>(Sy(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ze=(t,e,n)=>(Sy(t,e,"access private method"),n);var Xh=(t,e,n,r)=>({set _(s){se(t,e,s,n)},get _(){return j(t,e,r)}});function uz(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 Rh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vT={exports:{}},dg={},xT={exports:{}},Ve={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Mh=Symbol.for("react.element"),dz=Symbol.for("react.portal"),hz=Symbol.for("react.fragment"),fz=Symbol.for("react.strict_mode"),pz=Symbol.for("react.profiler"),mz=Symbol.for("react.provider"),gz=Symbol.for("react.context"),yz=Symbol.for("react.forward_ref"),vz=Symbol.for("react.suspense"),xz=Symbol.for("react.memo"),bz=Symbol.for("react.lazy"),Z1=Symbol.iterator;function wz(t){return t===null||typeof t!="object"?null:(t=Z1&&t[Z1]||t["@@iterator"],typeof t=="function"?t:null)}var bT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wT=Object.assign,kT={};function pu(t,e,n){this.props=t,this.context=e,this.refs=kT,this.updater=n||bT}pu.prototype.isReactComponent={};pu.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")};pu.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ST(){}ST.prototype=pu.prototype;function J0(t,e,n){this.props=t,this.context=e,this.refs=kT,this.updater=n||bT}var Q0=J0.prototype=new ST;Q0.constructor=J0;wT(Q0,pu.prototype);Q0.isPureReactComponent=!0;var X1=Array.isArray,ET=Object.prototype.hasOwnProperty,Y0={current:null},CT={key:!0,ref:!0,__self:!0,__source:!0};function NT(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)ET.call(e,r)&&!CT.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:Mh,type:t,key:i,ref:o,props:s,_owner:Y0.current}}function kz(t,e){return{$$typeof:Mh,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Z0(t){return typeof t=="object"&&t!==null&&t.$$typeof===Mh}function Sz(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var eS=/\/+/g;function Ey(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Sz(""+t.key):e.toString(36)}function Kf(t,e,n,r,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Mh:case dz:o=!0}}if(o)return o=t,s=s(o),t=r===""?"."+Ey(o,0):r,X1(s)?(n="",t!=null&&(n=t.replace(eS,"$&/")+"/"),Kf(s,e,n,"",function(c){return c})):s!=null&&(Z0(s)&&(s=kz(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(eS,"$&/")+"/")+t)),e.push(s)),1;if(o=0,r=r===""?".":r+":",X1(t))for(var a=0;a<t.length;a++){i=t[a];var l=r+Ey(i,a);o+=Kf(i,e,n,l,s)}else if(l=wz(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=r+Ey(i,a++),o+=Kf(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 ef(t,e,n){if(t==null)return t;var r=[],s=0;return Kf(t,r,"","",function(i){return e.call(n,i,s++)}),r}function Ez(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 Hn={current:null},Jf={transition:null},Cz={ReactCurrentDispatcher:Hn,ReactCurrentBatchConfig:Jf,ReactCurrentOwner:Y0};function _T(){throw Error("act(...) is not supported in production builds of React.")}Ve.Children={map:ef,forEach:function(t,e,n){ef(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ef(t,function(){e++}),e},toArray:function(t){return ef(t,function(e){return e})||[]},only:function(t){if(!Z0(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ve.Component=pu;Ve.Fragment=hz;Ve.Profiler=pz;Ve.PureComponent=J0;Ve.StrictMode=fz;Ve.Suspense=vz;
vendor: 4,997 bytes, lines 9-25
9Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cz;Ve.act=_T;Ve.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=wT({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=Y0.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)ET.call(e,l)&&!CT.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:Mh,type:t.type,key:s,ref:i,props:r,_owner:o}};Ve.createContext=function(t){return t={$$typeof:gz,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:mz,_context:t},t.Consumer=t};Ve.createElement=NT;Ve.createFactory=function(t){var e=NT.bind(null,t);return e.type=t,e};Ve.createRef=function(){return{current:null}};Ve.forwardRef=function(t){return{$$typeof:yz,render:t}};Ve.isValidElement=Z0;Ve.lazy=function(t){return{$$typeof:bz,_payload:{_status:-1,_result:t},_init:Ez}};Ve.memo=function(t,e){return{$$typeof:xz,type:t,compare:e===void 0?null:e}};Ve.startTransition=function(t){var e=Jf.transition;Jf.transition={};try{t()}finally{Jf.transition=e}};Ve.unstable_act=_T;Ve.useCallback=function(t,e){return Hn.current.useCallback(t,e)};Ve.useContext=function(t){return Hn.current.useContext(t)};Ve.useDebugValue=function(){};Ve.useDeferredValue=function(t){return Hn.current.useDeferredValue(t)};Ve.useEffect=function(t,e){return Hn.current.useEffect(t,e)};Ve.useId=function(){return Hn.current.useId()};Ve.useImperativeHandle=function(t,e,n){return Hn.current.useImperativeHandle(t,e,n)};Ve.useInsertionEffect=function(t,e){return Hn.current.useInsertionEffect(t,e)};Ve.useLayoutEffect=function(t,e){return Hn.current.useLayoutEffect(t,e)};Ve.useMemo=function(t,e){return Hn.current.useMemo(t,e)};Ve.useReducer=function(t,e,n){return Hn.current.useReducer(t,e,n)};Ve.useRef=function(t){return Hn.current.useRef(t)};Ve.useState=function(t){return Hn.current.useState(t)};Ve.useSyncExternalStore=function(t,e,n){return Hn.current.useSyncExternalStore(t,e,n)};Ve.useTransition=function(){return Hn.current.useTransition()};Ve.version="18.3.1";xT.exports=Ve;var b=xT.exports;const F=Rh(b),X0=uz({__proto__:null,default:F},[b]);/**
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 Nz=b,_z=Symbol.for("react.element"),Tz=Symbol.for("react.fragment"),Az=Object.prototype.hasOwnProperty,jz=Nz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Rz={key:!0,ref:!0,__self:!0,__source:!0};function TT(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)Az.call(e,r)&&!Rz.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:_z,type:t,key:i,ref:o,props:s,_owner:jz.current}}dg.Fragment=Tz;dg.jsx=TT;dg.jsxs=TT;vT.exports=dg;var u=vT.exports,AT={exports:{}},Cr={},jT={exports:{}},RT={};/**
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(P,z){var Q=P.length;P.push(z);e:for(;0<Q;){var re=Q-1>>>1,ce=P[re];if(0<s(ce,z))P[re]=z,P[Q]=ce,Q=re;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var z=P[0],Q=P.pop();if(Q!==z){P[0]=Q;e:for(var re=0,ce=P.length,ae=ce>>>1;re<ae;){var Ce=2*(re+1)-1,we=P[Ce],Ge=Ce+1,Y=P[Ge];if(0>s(we,Q))Ge<ce&&0>s(Y,we)?(P[re]=Y,P[Ge]=Q,re=Ge):(P[re]=we,P[Ce]=Q,re=Ce);else if(Ge<ce&&0>s(Y,Q))P[re]=Y,P[Ge]=Q,re=Ge;else break e}}return z}function s(P,z){var Q=P.sortIndex-z.sortIndex;return Q!==0?Q:P.id-z.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=[],d=1,h=null,f=3,p=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=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(P){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=P)r(c),z.sortIndex=z.expirationTime,e(l,z);else break;z=n(c)}}function k(P){if(m=!1,w(P),!g)if(n(l)!==null)g=!0,B(S);else{var z=n(c);z!==null&&J(k,z.startTime-P)}}function S(P,z){g=!1,m&&(m=!1,v(N),N=-1),p=!0;var Q=f;
vendor: 9,261 bytes, lines 25-34
25try{for(w(z),h=n(l);h!==null&&(!(h.expirationTime>z)||P&&!D());){var re=h.callback;if(typeof re=="function"){h.callback=null,f=h.priorityLevel;var ce=re(h.expirationTime<=z);z=t.unstable_now(),typeof ce=="function"?h.callback=ce:h===n(l)&&r(l),w(z)}else r(l);h=n(l)}if(h!==null)var ae=!0;else{var Ce=n(c);Ce!==null&&J(k,Ce.startTime-z),ae=!1}return ae}finally{h=null,f=Q,p=!1}}var E=!1,C=null,N=-1,T=5,M=-1;function D(){return!(t.unstable_now()-M<T)}function A(){if(C!==null){var P=t.unstable_now();M=P;var z=!0;try{z=C(!0,P)}finally{z?L():(E=!1,C=null)}}else E=!1}var L;if(typeof x=="function")L=function(){x(A)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,U=I.port2;I.port1.onmessage=A,L=function(){U.postMessage(null)}}else L=function(){y(A,0)};function B(P){C=P,E||(E=!0,L())}function J(P,z){N=y(function(){P(t.unstable_now())},z)}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(P){P.callback=null},t.unstable_continueExecution=function(){g||p||(g=!0,B(S))},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(P){switch(f){case 1:case 2:case 3:var z=3;break;default:z=f}var Q=f;f=z;try{return P()}finally{f=Q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(P,z){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var Q=f;f=P;try{return z()}finally{f=Q}},t.unstable_scheduleCallback=function(P,z,Q){var re=t.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?re+Q:re):Q=re,P){case 1:var ce=-1;break;case 2:ce=250;break;case 5:ce=1073741823;break;case 4:ce=1e4;break;default:ce=5e3}return ce=Q+ce,P={id:d++,callback:z,priorityLevel:P,startTime:Q,expirationTime:ce,sortIndex:-1},Q>re?(P.sortIndex=Q,e(c,P),n(l)===null&&P===n(c)&&(m?(v(N),N=-1):m=!0,J(k,Q-re))):(P.sortIndex=ce,e(l,P),g||p||(g=!0,B(S))),P},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(P){var z=f;return function(){var Q=f;f=z;try{return P.apply(this,arguments)}finally{f=Q}}}})(RT);jT.exports=RT;var Mz=jT.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 Oz=b,Sr=Mz;function H(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 MT=new Set,Ld={};function yl(t,e){Vc(t,e),Vc(t+"Capture",e)}function Vc(t,e){for(Ld[t]=e,t=0;t<e.length;t++)MT.add(e[t])}var Ci=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hx=Object.prototype.hasOwnProperty,Pz=/^[: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]*$/,tS={},nS={};function Iz(t){return hx.call(nS,t)?!0:hx.call(tS,t)?!1:Pz.test(t)?nS[t]=!0:(tS[t]=!0,!1)}function Dz(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 Lz(t,e,n,r){if(e===null||typeof e>"u"||Dz(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 Wn(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 xn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xn[t]=new Wn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xn[e]=new Wn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xn[t]=new Wn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xn[t]=new Wn(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){xn[t]=new Wn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xn[t]=new Wn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xn[t]=new Wn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xn[t]=new Wn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xn[t]=new Wn(t,5,!1,t.toLowerCase(),null,!1,!1)});var ew=/[\-:]([a-z])/g;function tw(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(ew,tw);xn[e]=new Wn(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(ew,tw);xn[e]=new Wn(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(ew,tw);xn[e]=new Wn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xn[t]=new Wn(t,1,!1,t.toLowerCase(),null,!1,!1)});xn.xlinkHref=new Wn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xn[t]=new Wn(t,1,!1,t.toLowerCase(),null,!0,!0)});function nw(t,e,n,r){var s=xn.hasOwnProperty(e)?xn[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Lz(e,n,s,r)&&(n=null),r||s===null?Iz(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 Mi=Oz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,tf=Symbol.for("react.element"),ec=Symbol.for("react.portal"),tc=Symbol.for("react.fragment"),rw=Symbol.for("react.strict_mode"),fx=Symbol.for("react.profiler"),OT=Symbol.for("react.provider"),PT=Symbol.for("react.context"),sw=Symbol.for("react.forward_ref"),px=Symbol.for("react.suspense"),mx=Symbol.for("react.suspense_list"),iw=Symbol.for("react.memo"),Gi=Symbol.for("react.lazy"),IT=Symbol.for("react.offscreen"),rS=Symbol.iterator;function Tu(t){return t===null||typeof t!="object"?null:(t=rS&&t[rS]||t["@@iterator"],typeof t=="function"?t:null)}var St=Object.assign,Cy;function Xu(t){if(Cy===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Cy=e&&e[1]||""}return`
34`+Cy+t}var Ny=!1;function _y(t,e){if(!t||Ny)return"";Ny=!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: 16,008 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{Ny=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Xu(t):""}function zz(t){switch(t.tag){case 5:return Xu(t.type);case 16:return Xu("Lazy");case 13:return Xu("Suspense");case 19:return Xu("SuspenseList");case 0:case 2:case 15:return t=_y(t.type,!1),t;case 11:return t=_y(t.type.render,!1),t;case 1:return t=_y(t.type,!0),t;default:return""}}function gx(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 tc:return"Fragment";case ec:return"Portal";case fx:return"Profiler";case rw:return"StrictMode";case px:return"Suspense";case mx:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case PT:return(t.displayName||"Context")+".Consumer";case OT:return(t._context.displayName||"Context")+".Provider";case sw:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case iw:return e=t.displayName||null,e!==null?e:gx(t.type)||"Memo";case Gi:e=t._payload,t=t._init;try{return gx(t(e))}catch{}}return null}function $z(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 gx(e);case 8:return e===rw?"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 $o(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function DT(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Fz(t){var e=DT(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 nf(t){t._valueTracker||(t._valueTracker=Fz(t))}function LT(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=DT(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Ep(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function yx(t,e){var n=e.checked;return St({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function sS(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=$o(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 zT(t,e){e=e.checked,e!=null&&nw(t,"checked",e,!1)}function vx(t,e){zT(t,e);var n=$o(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")?xx(t,e.type,n):e.hasOwnProperty("defaultValue")&&xx(t,e.type,$o(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function iS(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 xx(t,e,n){(e!=="number"||Ep(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ed=Array.isArray;function mc(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=""+$o(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 bx(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(H(91));return St({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function oS(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(H(92));if(ed(n)){if(1<n.length)throw Error(H(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:$o(n)}}function $T(t,e){var n=$o(e.value),r=$o(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 aS(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function FT(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 wx(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?FT(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var rf,BT=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(rf=rf||document.createElement("div"),rf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=rf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function zd(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var dd={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},Bz=["Webkit","ms","Moz","O"];Object.keys(dd).forEach(function(t){Bz.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),dd[e]=dd[t]})});function qT(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||dd.hasOwnProperty(t)&&dd[t]?(""+e).trim():e+"px"}function UT(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=qT(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var qz=St({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 kx(t,e){if(e){if(qz[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(H(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(H(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(H(61))}if(e.style!=null&&typeof e.style!="object")throw Error(H(62))}}function Sx(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 Ex=null;function ow(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Cx=null,gc=null,yc=null;function lS(t){if(t=Ih(t)){if(typeof Cx!="function")throw Error(H(280));var e=t.stateNode;e&&(e=gg(e),Cx(t.stateNode,t.type,e))}}function VT(t){gc?yc?yc.push(t):yc=[t]:gc=t}function HT(){if(gc){var t=gc,e=yc;if(yc=gc=null,lS(t),e)for(t=0;t<e.length;t++)lS(e[t])}}function WT(t,e){return t(e)}function GT(){}var Ty=!1;function KT(t,e,n){if(Ty)return t(e,n);Ty=!0;try{return WT(t,e,n)}finally{Ty=!1,(gc!==null||yc!==null)&&(GT(),HT())}}function $d(t,e){var n=t.stateNode;if(n===null)return null;var r=gg(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(H(231,e,typeof n));return n}var Nx=!1;if(Ci)try{var Au={};Object.defineProperty(Au,"passive",{get:function(){Nx=!0}}),window.addEventListener("test",Au,Au),window.removeEventListener("test",Au,Au)}catch{Nx=!1}function Uz(t,e,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(d){this.onError(d)}}var hd=!1,Cp=null,Np=!1,_x=null,Vz={onError:function(t){hd=!0,Cp=t}};function Hz(t,e,n,r,s,i,o,a,l){hd=!1,Cp=null,Uz.apply(Vz,arguments)}function Wz(t,e,n,r,s,i,o,a,l){if(Hz.apply(this,arguments),hd){if(hd){var c=Cp;hd=!1,Cp=null}else throw Error(H(198));Np||(Np=!0,_x=c)}}function vl(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 JT(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 cS(t){if(vl(t)!==t)throw Error(H(188))}function Gz(t){var e=t.alternate;if(!e){if(e=vl(t),e===null)throw Error(H(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 cS(s),t;if(i===r)return cS(s),e;i=i.sibling}throw Error(H(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(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?t:e}function QT(t){return t=Gz(t),t!==null?YT(t):null}function YT(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=YT(t);if(e!==null)return e;t=t.sibling}return null}var ZT=Sr.unstable_scheduleCallback,uS=Sr.unstable_cancelCallback,Kz=Sr.unstable_shouldYield,Jz=Sr.unstable_requestPaint,Ot=Sr.unstable_now,Qz=Sr.unstable_getCurrentPriorityLevel,aw=Sr.unstable_ImmediatePriority,XT=Sr.unstable_UserBlockingPriority,_p=Sr.unstable_NormalPriority,Yz=Sr.unstable_LowPriority,eA=Sr.unstable_IdlePriority,hg=null,qs=null;function Zz(t){if(qs&&typeof qs.onCommitFiberRoot=="function")try{qs.onCommitFiberRoot(hg,t,void 0,(t.current.flags&128)===128)}catch{}}var ps=Math.clz32?Math.clz32:t4,Xz=Math.log,e4=Math.LN2;function t4(t){return t>>>=0,t===0?32:31-(Xz(t)/e4|0)|0}var sf=64,of=4194304;function td(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 Tp(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=td(a):(i&=o,i!==0&&(r=td(i)))}else o=n&~s,o!==0?r=td(o):i!==0&&(r=td(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-ps(e),s=1<<n,r|=t[n],e&=~s;return r}function n4(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 r4(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-ps(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=n4(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function Tx(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function tA(){var t=sf;return sf<<=1,!(sf&4194240)&&(sf=64),t}function Ay(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Oh(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ps(e),t[e]=n}function s4(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-ps(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function lw(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-ps(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var st=0;function nA(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var rA,cw,sA,iA,oA,Ax=!1,af=[],Eo=null,Co=null,No=null,Fd=new Map,Bd=new Map,eo=[],i4="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 dS(t,e){switch(t){case"focusin":case"focusout":Eo=null;break;case"dragenter":case"dragleave":Co=null;break;case"mouseover":case"mouseout":No=null;break;case"pointerover":case"pointerout":Fd.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bd.delete(e.pointerId)}}function ju(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=Ih(e),e!==null&&cw(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function o4(t,e,n,r,s){switch(e){case"focusin":return Eo=ju(Eo,t,e,n,r,s),!0;case"dragenter":return Co=ju(Co,t,e,n,r,s),!0;case"mouseover":return No=ju(No,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return Fd.set(i,ju(Fd.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Bd.set(i,ju(Bd.get(i)||null,t,e,n,r,s)),!0}return!1}function aA(t){var e=wa(t.target);if(e!==null){var n=vl(e);
vendor: 1,098 bytes, line 37
37if(n!==null){if(e=n.tag,e===13){if(e=JT(n),e!==null){t.blockedOn=e,oA(t.priority,function(){sA(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 Qf(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=jx(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Ex=r,n.target.dispatchEvent(r),Ex=null}else return e=Ih(n),e!==null&&cw(e),t.blockedOn=n,!1;e.shift()}return!0}function hS(t,e,n){Qf(t)&&n.delete(e)}function a4(){Ax=!1,Eo!==null&&Qf(Eo)&&(Eo=null),Co!==null&&Qf(Co)&&(Co=null),No!==null&&Qf(No)&&(No=null),Fd.forEach(hS),Bd.forEach(hS)}function Ru(t,e){t.blockedOn===e&&(t.blockedOn=null,Ax||(Ax=!0,Sr.unstable_scheduleCallback(Sr.unstable_NormalPriority,a4)))}function qd(t){function e(s){return Ru(s,t)}if(0<af.length){Ru(af[0],t);for(var n=1;n<af.length;n++){var r=af[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Eo!==null&&Ru(Eo,t),Co!==null&&Ru(Co,t),No!==null&&Ru(No,t),Fd.forEac
vendor: 11,472 bytes, line 37
37h(e),Bd.forEach(e),n=0;n<eo.length;n++)r=eo[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<eo.length&&(n=eo[0],n.blockedOn===null);)aA(n),n.blockedOn===null&&eo.shift()}var vc=Mi.ReactCurrentBatchConfig,Ap=!0;function l4(t,e,n,r){var s=st,i=vc.transition;vc.transition=null;try{st=1,uw(t,e,n,r)}finally{st=s,vc.transition=i}}function c4(t,e,n,r){var s=st,i=vc.transition;vc.transition=null;try{st=4,uw(t,e,n,r)}finally{st=s,vc.transition=i}}function uw(t,e,n,r){if(Ap){var s=jx(t,e,n,r);if(s===null)$y(t,e,r,jp,n),dS(t,r);else if(o4(s,t,e,n,r))r.stopPropagation();else if(dS(t,r),e&4&&-1<i4.indexOf(t)){for(;s!==null;){var i=Ih(s);if(i!==null&&rA(i),i=jx(t,e,n,r),i===null&&$y(t,e,r,jp,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else $y(t,e,r,null,n)}}var jp=null;function jx(t,e,n,r){if(jp=null,t=ow(r),t=wa(t),t!==null)if(e=vl(t),e===null)t=null;else if(n=e.tag,n===13){if(t=JT(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 jp=t,null}function lA(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(Qz()){case aw:return 1;case XT:return 4;case _p:case Yz:return 16;case eA:return 536870912;default:return 16}default:return 16}}var yo=null,dw=null,Yf=null;function cA(){if(Yf)return Yf;var t,e=dw,n=e.length,r,s="value"in yo?yo.value:yo.textContent,i=s.length;for(t=0;t<n&&e[t]===s[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===s[i-r];r++);return Yf=s.slice(t,1<r?1-r:void 0)}function Zf(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 lf(){return!0}function fS(){return!1}function Nr(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)?lf:fS,this.isPropagationStopped=fS,this}return St(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=lf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=lf)},persist:function(){},isPersistent:lf}),e}var mu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hw=Nr(mu),Ph=St({},mu,{view:0,detail:0}),u4=Nr(Ph),jy,Ry,Mu,fg=St({},Ph,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fw,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!==Mu&&(Mu&&t.type==="mousemove"?(jy=t.screenX-Mu.screenX,Ry=t.screenY-Mu.screenY):Ry=jy=0,Mu=t),jy)},movementY:function(t){return"movementY"in t?t.movementY:Ry}}),pS=Nr(fg),d4=St({},fg,{dataTransfer:0}),h4=Nr(d4),f4=St({},Ph,{relatedTarget:0}),My=Nr(f4),p4=St({},mu,{animationName:0,elapsedTime:0,pseudoElement:0}),m4=Nr(p4),g4=St({},mu,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),y4=Nr(g4),v4=St({},mu,{data:0}),mS=Nr(v4),x4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},b4={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"},w4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function k4(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=w4[t])?!!e[t]:!1}function fw(){return k4}var S4=St({},Ph,{key:function(t){if(t.key){var e=x4[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Zf(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?b4[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fw,charCode:function(t){return t.type==="keypress"?Zf(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Zf(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),E4=Nr(S4),C4=St({},fg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gS=Nr(C4),N4=St({},Ph,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fw}),_4=Nr(N4),T4=St({},mu,{propertyName:0,elapsedTime:0,pseudoElement:0}),A4=Nr(T4),j4=St({},fg,{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}),R4=Nr(j4),M4=[9,13,27,32],pw=Ci&&"CompositionEvent"in window,fd=null;Ci&&"documentMode"in document&&(fd=document.documentMode);var O4=Ci&&"TextEvent"in window&&!fd,uA=Ci&&(!pw||fd&&8<fd&&11>=fd),yS=" ",vS=!1;function dA(t,e){switch(t){case"keyup":return M4.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hA(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var nc=!1;function P4(t,e){switch(t){case"compositionend":return hA(e);case"keypress":return e.which!==32?null:(vS=!0,yS);case"textInput":return t=e.data,t===yS&&vS?null:t;default:return null}}function I4(t,e){if(nc)return t==="compositionend"||!pw&&dA(t,e)?(t=cA(),Yf=dw=yo=null,nc=!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 uA&&e.locale!=="ko"?null:e.data;default:return null}}var D4={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 xS(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!D4[t.type]:e==="textarea"}function fA(t,e,n,r){VT(r),e=Rp(e,"onChange"),0<e.length&&(n=new hw("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var pd=null,Ud=null;function L4(t){EA(t,0)}function pg(t){var e=ic(t);if(LT(e))return t}function z4(t,e){if(t==="change")return e}var pA=!1;if(Ci){var Oy;if(Ci){var Py="oninput"in document;if(!Py){var bS=document.createElement("div");bS.setAttribute("oninput","return;"),Py=typeof bS.oninput=="function"}Oy=Py}else Oy=!1;pA=Oy&&(!document.documentMode||9<document.documentMode)}function wS(){pd&&(pd.detachEvent("onpropertychange",mA),Ud=pd=null)}function mA(t){if(t.propertyName==="value"&&pg(Ud)){var e=[];fA(e,Ud,t,ow(t)),KT(L4,e)}}function $4(t,e,n){t==="focusin"?(wS(),pd=e,Ud=n,pd.attachEvent("onpropertychange",mA)):t==="focusout"&&wS()}function F4(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return pg(Ud)}function B4(t,e){if(t==="click")return pg(e)}function q4(t,e){if(t==="input"||t==="change")return pg(e)}function U4(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ys=typeof Object.is=="function"?Object.is:U4;function Vd(t,e){if(ys(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(!hx.call(e,s)||!ys(t[s],e[s]))return!1}return!0}function kS(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function SS(t,e){var n=kS(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=kS(n)}}function gA(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?gA(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yA(){for(var t=window,e=Ep();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ep(t.document)}return e}function mw(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 V4(t){var e=yA(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&gA(n.ownerDocument.documentElement,n)){if(r!==null&&mw(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=SS(n,i);var o=SS(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 H4=Ci&&"documentMode"in document&&11>=document.documentMode,rc=null,Rx=null,md=null,Mx=!1;function ES(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mx||rc==null||rc!==Ep(r)||(r=rc,"selectionStart"in r&&mw(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),md&&Vd(md,r)||(md=r,r=Rp(Rx,"onSelect"),0<r.length&&(e=new hw("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=rc)))}function cf(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var sc={animationend:cf("Animation","AnimationEnd"),animationiteration:cf("Animation","AnimationIteration"),animationstart:cf("Animation","AnimationStart"),transitionend:cf("Transition","TransitionEnd")},Iy={},vA={};Ci&&(vA=document.createElement("div").style,"AnimationEvent"in window||(delete sc.animationend.animation,delete sc.animationiteration.animation,delete sc.animationstart.animation),"TransitionEvent"in window||delete sc.transitionend.transition);function mg(t){if(Iy[t])return Iy[t];if(!sc[t])return t;var e=sc[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in vA)return Iy[t]=e[n];return t}var xA=mg("animationend"),bA=mg("animationiteration"),wA=mg("animationstart"),kA=mg("transitionend"),SA=new Map,CS="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Jo(t,e){SA.set(t,e),yl(e,[t])}for(var Dy=0;Dy<CS.length;Dy++){var Ly=CS[Dy],W4=Ly.toLowerCase(),G4=Ly[0].toUpperCase()+Ly.slice(1);Jo(W4,"on"+G4)}Jo(xA,"onAnimationEnd");Jo(bA,"onAnimationIteration");Jo(wA,"onAnimationStart");Jo("dblclick","onDoubleClick");Jo("focusin","onFocus");Jo("focusout","onBlur");Jo(kA,"onTransitionEnd");Vc("onMouseEnter",["mouseout","mouseover"]);Vc("onMouseLeave",["mouseout","mouseover"]);Vc("onPointerEnter",["pointerout","pointerover"]);Vc("onPointerLeave",["pointerout","pointerover"]);yl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yl("onBeforeInput",["compositionend","keypress","textInput","paste"]);yl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nd="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(" "),K4=new Set("cancel close invalid load scroll toggle".split(" ").concat(nd));function NS(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,Wz(r,e,void 0,t),t.currentTarget=null}function EA(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;NS(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;NS(s,a,c),i=l}}}if(Np)throw t=_x,Np=!1,_x=null,t}function ft(t,e){var n=e[Lx];n===void 0&&(n=e[Lx]=new Set);var r=t+"__bubble";n.has(r)||(CA(e,t,2,!1),n.add(r))}function zy(t,e,n){var r=0;e&&(r|=4),CA(n,t,r,e)}var uf="_reactListening"+Math.random().toString(36).slice(2);function Hd(t){if(!t[uf]){t[uf]=!0,MT.forEach(function(n){n!=="selectionchange"&&(K4.has(n)||zy(n,!1,t),zy(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[uf]||(e[uf]=!0,zy("selectionchange",!1,e))}}function CA(t,e,n,r){switch(lA(e)){case 1:var s=l4;break;case 4:s=c4;break;default:s=uw}n=s.bind(null,e,n,t),s=void 0,!Nx||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 $y(t,e,n,r,s){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;
vendor: 5,316 bytes, lines 37-38
37if(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=wa(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}KT(function(){var c=i,d=ow(n),h=[];e:{var f=SA.get(t);if(f!==void 0){var p=hw,g=t;switch(t){case"keypress":if(Zf(n)===0)break e;case"keydown":case"keyup":p=E4;break;case"focusin":g="focus",p=My;break;case"focusout":g="blur",p=My;break;case"beforeblur":case"afterblur":p=My;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":p=pS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=h4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=_4;break;case xA:case bA:case wA:p=m4;break;case kA:p=A4;break;case"scroll":p=u4;break;case"wheel":p=R4;break;case"copy":case"cut":case"paste":p=y4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=gS}var m=(e&4)!==0,y=!m&&t==="scroll",v=m?f!==null?f+"Capture":null:f;m=[];for(var x=c,w;x!==null;){w=x;var k=w.stateNode;if(w.tag===5&&k!==null&&(w=k,v!==null&&(k=$d(x,v),k!=null&&m.push(Wd(x,k,w)))),y)break;x=x.return}0<m.length&&(f=new p(f,g,null,n,d),h.push({event:f,listeners:m}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&n!==Ex&&(g=n.relatedTarget||n.fromElement)&&(wa(g)||g[Ni]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=c,g=g?wa(g):null,g!==null&&(y=vl(g),g!==y||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=c),p!==g)){if(m=pS,k="onMouseLeave",v="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(m=gS,k="onPointerLeave",v="onPointerEnter",x="pointer"),y=p==null?f:ic(p),w=g==null?f:ic(g),f=new m(k,x+"leave",p,n,d),f.target=y,f.relatedTarget=w,k=null,wa(d)===c&&(m=new m(v,x+"enter",g,n,d),m.target=w,m.relatedTarget=y,k=m),y=k,p&&g)t:{for(m=p,v=g,x=0,w=m;w;w=_l(w))x++;for(w=0,k=v;k;k=_l(k))w++;for(;0<x-w;)m=_l(m),x--;for(;0<w-x;)v=_l(v),w--;for(;x--;){if(m===v||v!==null&&m===v.alternate)break t;m=_l(m),v=_l(v)}m=null}else m=null;p!==null&&_S(h,f,p,m,!1),g!==null&&y!==null&&_S(h,y,g,m,!0)}}e:{if(f=c?ic(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var S=z4;else if(xS(f))if(pA)S=q4;else{S=F4;var E=$4}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=B4);if(S&&(S=S(t,c))){fA(h,S,n,d);break e}E&&E(t,f,c),t==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&xx(f,"number",f.value)}switch(E=c?ic(c):window,t){case"focusin":(xS(E)||E.contentEditable==="true")&&(rc=E,Rx=c,md=null);break;case"focusout":md=Rx=rc=null;break;case"mousedown":Mx=!0;break;case"contextmenu":case"mouseup":case"dragend":Mx=!1,ES(h,n,d);break;case"selectionchange":if(H4)break;case"keydown":case"keyup":ES(h,n,d)}var C;if(pw)e:{switch(t){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else nc?dA(t,n)&&(N="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(uA&&n.locale!=="ko"&&(nc||N!=="onCompositionStart"?N==="onCompositionEnd"&&nc&&(C=cA()):(yo=d,dw="value"in yo?yo.value:yo.textContent,nc=!0)),E=Rp(c,N),0<E.length&&(N=new mS(N,t,null,n,d),h.push({event:N,listeners:E}),C?N.data=C:(C=hA(n),C!==null&&(N.data=C)))),(C=O4?P4(t,n):I4(t,n))&&(c=Rp(c,"onBeforeInput"),0<c.length&&(d=new mS("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:c}),d.data=C))}EA(h,e)})}function Wd(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Rp(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=$d(t,n),i!=null&&r.unshift(Wd(t,i,s)),i=$d(t,e),i!=null&&r.push(Wd(t,i,s))),t=t.return}return r}function _l(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function _S(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=$d(n,i),l!=null&&o.unshift(Wd(n,l,a))):s||(l=$d(n,i),l!=null&&o.push(Wd(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var J4=/\r\n?/g,Q4=/\u0000|\uFFFD/g;function TS(t){return(typeof t=="string"?t:""+t).replace(J4,`
38`).replace(Q4,"")}function df(t,e,n){if(e=TS(e),TS(t)!==e&&n)throw Error(H(425))}function Mp(){}var Ox=null,Px=null;function Ix(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 Dx=typeof setTimeout=="function"?setTimeout:void 0,Y4=typeof clearTimeout=="function"?clearTimeout:void 0,AS=typeof Promise=="function"?Promise:void 0,Z4=typeof queueMicrotask=="function"?queueMicrotask:typeof AS<"u"?function(t){return AS.resolve(null).then(t).cat
vendor: 4,824 bytes, line 38
38ch(X4)}:Dx;function X4(t){setTimeout(function(){throw t})}function Fy(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),qd(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);qd(e)}function _o(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 jS(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 gu=Math.random().toString(36).slice(2),Ds="__reactFiber$"+gu,Gd="__reactProps$"+gu,Ni="__reactContainer$"+gu,Lx="__reactEvents$"+gu,e$="__reactListeners$"+gu,t$="__reactHandles$"+gu;function wa(t){var e=t[Ds];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Ni]||n[Ds]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=jS(t);t!==null;){if(n=t[Ds])return n;t=jS(t)}return e}t=n,n=t.parentNode}return null}function Ih(t){return t=t[Ds]||t[Ni],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ic(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(H(33))}function gg(t){return t[Gd]||null}var zx=[],oc=-1;function Qo(t){return{current:t}}function mt(t){0>oc||(t.current=zx[oc],zx[oc]=null,oc--)}function dt(t,e){oc++,zx[oc]=t.current,t.current=e}var Fo={},An=Qo(Fo),ar=Qo(!1),Ja=Fo;function Hc(t,e){var n=t.type.contextTypes;if(!n)return Fo;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 lr(t){return t=t.childContextTypes,t!=null}function Op(){mt(ar),mt(An)}function RS(t,e,n){if(An.current!==Fo)throw Error(H(168));dt(An,e),dt(ar,n)}function NA(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(H(108,$z(t)||"Unknown",s));return St({},n,r)}function Pp(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Fo,Ja=An.current,dt(An,t),dt(ar,ar.current),!0}function MS(t,e,n){var r=t.stateNode;if(!r)throw Error(H(169));n?(t=NA(t,e,Ja),r.__reactInternalMemoizedMergedChildContext=t,mt(ar),mt(An),dt(An,t)):mt(ar),dt(ar,n)}var pi=null,yg=!1,By=!1;function _A(t){pi===null?pi=[t]:pi.push(t)}function n$(t){yg=!0,_A(t)}function Yo(){if(!By&&pi!==null){By=!0;var t=0,e=st;try{var n=pi;for(st=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}pi=null,yg=!1}catch(s){throw pi!==null&&(pi=pi.slice(t+1)),ZT(aw,Yo),s}finally{st=e,By=!1}}return null}var ac=[],lc=0,Ip=null,Dp=0,Lr=[],zr=0,Qa=null,yi=1,vi="";function ha(t,e){ac[lc++]=Dp,ac[lc++]=Ip,Ip=t,Dp=e}function TA(t,e,n){Lr[zr++]=yi,Lr[zr++]=vi,Lr[zr++]=Qa,Qa=t;var r=yi;t=vi;var s=32-ps(r)-1;r&=~(1<<s),n+=1;var i=32-ps(e)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,yi=1<<32-ps(e)+s|n<<s|r,vi=i+t}else yi=1<<i|n<<s|r,vi=t}function gw(t){t.return!==null&&(ha(t,1),TA(t,1,0))}function yw(t){for(;t===Ip;)Ip=ac[--lc],ac[lc]=null,Dp=ac[--lc],ac[lc]=null;for(;t===Qa;)Qa=Lr[--zr],Lr[zr]=null,vi=Lr[--zr],Lr[zr]=null,yi=Lr[--zr],Lr[zr]=null}var wr=null,br=null,yt=!1,ls=null;function AA(t,e){var n=Fr(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 OS(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,wr=t,br=_o(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,wr=t,br=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Qa!==null?{id:yi,overflow:vi}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Fr(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,wr=t,br=null,!0):!1;default:return!1}}function $x(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Fx(t){if(yt){var e=br;if(e){var n=e;if(!OS(t,e)){if($x(t))throw Error(H(418));e=_o(n.nextSibling);var r=wr;e&&OS(t,e)?AA(r,n):(t.flags=t.flags&-4097|2,yt=!1,wr=t)}}else{if($x(t))throw Error(H(418));t.flags=t.flags&-4097|2,yt=!1,wr=t}}}function PS(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;wr=t}function hf(t){if(t!==wr)return!1;if(!yt)return PS(t),yt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Ix(t.type,t.memoizedProps)),e&&(e=br)){if($x(t))throw jA(),Error(H(418));for(;e;)AA(t,e),e=_o(e.nextSibling)}if(PS(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(H(317));e:{for(t=t.nextSibling,e=0;t;
vendor: 11,271 bytes, line 38
38){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){br=_o(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}br=null}}else br=wr?_o(t.stateNode.nextSibling):null;return!0}function jA(){for(var t=br;t;)t=_o(t.nextSibling)}function Wc(){br=wr=null,yt=!1}function vw(t){ls===null?ls=[t]:ls.push(t)}var r$=Mi.ReactCurrentBatchConfig;function Ou(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(H(309));var r=n.stateNode}if(!r)throw Error(H(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(H(284));if(!n._owner)throw Error(H(290,t))}return t}function ff(t,e){throw t=Object.prototype.toString.call(e),Error(H(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function IS(t){var e=t._init;return e(t._payload)}function RA(t){function e(v,x){if(t){var w=v.deletions;w===null?(v.deletions=[x],v.flags|=16):w.push(x)}}function n(v,x){if(!t)return null;for(;x!==null;)e(v,x),x=x.sibling;return null}function r(v,x){for(v=new Map;x!==null;)x.key!==null?v.set(x.key,x):v.set(x.index,x),x=x.sibling;return v}function s(v,x){return v=Ro(v,x),v.index=0,v.sibling=null,v}function i(v,x,w){return v.index=w,t?(w=v.alternate,w!==null?(w=w.index,w<x?(v.flags|=2,x):w):(v.flags|=2,x)):(v.flags|=1048576,x)}function o(v){return t&&v.alternate===null&&(v.flags|=2),v}function a(v,x,w,k){return x===null||x.tag!==6?(x=Ky(w,v.mode,k),x.return=v,x):(x=s(x,w),x.return=v,x)}function l(v,x,w,k){var S=w.type;return S===tc?d(v,x,w.props.children,k,w.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Gi&&IS(S)===x.type)?(k=s(x,w.props),k.ref=Ou(v,x,w),k.return=v,k):(k=ip(w.type,w.key,w.props,null,v.mode,k),k.ref=Ou(v,x,w),k.return=v,k)}function c(v,x,w,k){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=Jy(w,v.mode,k),x.return=v,x):(x=s(x,w.children||[]),x.return=v,x)}function d(v,x,w,k,S){return x===null||x.tag!==7?(x=Ba(w,v.mode,k,S),x.return=v,x):(x=s(x,w),x.return=v,x)}function h(v,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Ky(""+x,v.mode,w),x.return=v,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case tf:return w=ip(x.type,x.key,x.props,null,v.mode,w),w.ref=Ou(v,null,x),w.return=v,w;case ec:return x=Jy(x,v.mode,w),x.return=v,x;case Gi:var k=x._init;return h(v,k(x._payload),w)}if(ed(x)||Tu(x))return x=Ba(x,v.mode,w,null),x.return=v,x;ff(v,x)}return null}function f(v,x,w,k){var S=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:a(v,x,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case tf:return w.key===S?l(v,x,w,k):null;case ec:return w.key===S?c(v,x,w,k):null;case Gi:return S=w._init,f(v,x,S(w._payload),k)}if(ed(w)||Tu(w))return S!==null?null:d(v,x,w,k,null);ff(v,w)}return null}function p(v,x,w,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return v=v.get(w)||null,a(x,v,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case tf:return v=v.get(k.key===null?w:k.key)||null,l(x,v,k,S);case ec:return v=v.get(k.key===null?w:k.key)||null,c(x,v,k,S);case Gi:var E=k._init;return p(v,x,w,E(k._payload),S)}if(ed(k)||Tu(k))return v=v.get(w)||null,d(x,v,k,S,null);ff(x,k)}return null}function g(v,x,w,k){for(var S=null,E=null,C=x,N=x=0,T=null;C!==null&&N<w.length;N++){C.index>N?(T=C,C=null):T=C.sibling;var M=f(v,C,w[N],k);if(M===null){C===null&&(C=T);break}t&&C&&M.alternate===null&&e(v,C),x=i(M,x,N),E===null?S=M:E.sibling=M,E=M,C=T}if(N===w.length)return n(v,C),yt&&ha(v,N),S;if(C===null){for(;N<w.length;N++)C=h(v,w[N],k),C!==null&&(x=i(C,x,N),E===null?S=C:E.sibling=C,E=C);return yt&&ha(v,N),S}for(C=r(v,C);N<w.length;N++)T=p(C,v,N,w[N],k),T!==null&&(t&&T.alternate!==null&&C.delete(T.key===null?N:T.key),x=i(T,x,N),E===null?S=T:E.sibling=T,E=T);return t&&C.forEach(function(D){return e(v,D)}),yt&&ha(v,N),S}function m(v,x,w,k){var S=Tu(w);if(typeof S!="function")throw Error(H(150));if(w=S.call(w),w==null)throw Error(H(151));for(var E=S=null,C=x,N=x=0,T=null,M=w.next();C!==null&&!M.done;N++,M=w.next()){C.index>N?(T=C,C=null):T=C.sibling;var D=f(v,C,M.value,k);if(D===null){C===null&&(C=T);break}t&&C&&D.alternate===null&&e(v,C),x=i(D,x,N),E===null?S=D:E.sibling=D,E=D,C=T}if(M.done)return n(v,C),yt&&ha(v,N),S;if(C===null){for(;!M.done;N++,M=w.next())M=h(v,M.value,k),M!==null&&(x=i(M,x,N),E===null?S=M:E.sibling=M,E=M);return yt&&ha(v,N),S}for(C=r(v,C);!M.done;N++,M=w.next())M=p(C,v,N,M.value,k),M!==null&&(t&&M.alternate!==null&&C.delete(M.key===null?N:M.key),x=i(M,x,N),E===null?S=M:E.sibling=M,E=M);return t&&C.forEach(function(A){return e(v,A)}),yt&&ha(v,N),S}function y(v,x,w,k){if(typeof w=="object"&&w!==null&&w.type===tc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case tf:e:{for(var S=w.key,E=x;E!==null;){if(E.key===S){if(S=w.type,S===tc){if(E.tag===7){n(v,E.sibling),x=s(E,w.props.children),x.return=v,v=x;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Gi&&IS(S)===E.type){n(v,E.sibling),x=s(E,w.props),x.ref=Ou(v,E,w),x.return=v,v=x;break e}n(v,E);break}else e(v,E);E=E.sibling}w.type===tc?(x=Ba(w.props.children,v.mode,k,w.key),x.return=v,v=x):(k=ip(w.type,w.key,w.props,null,v.mode,k),k.ref=Ou(v,x,w),k.return=v,v=k)}return o(v);case ec:e:{for(E=w.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(v,x.sibling),x=s(x,w.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else e(v,x);x=x.sibling}x=Jy(w,v.mode,k),x.return=v,v=x}return o(v);case Gi:return E=w._init,y(v,x,E(w._payload),k)}if(ed(w))return g(v,x,w,k);if(Tu(w))return m(v,x,w,k);ff(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(v,x.sibling),x=s(x,w),x.return=v,v=x):(n(v,x),x=Ky(w,v.mode,k),x.return=v,v=x),o(v)):n(v,x)}return y}var Gc=RA(!0),MA=RA(!1),Lp=Qo(null),zp=null,cc=null,xw=null;function bw(){xw=cc=zp=null}function ww(t){var e=Lp.current;mt(Lp),t._currentValue=e}function Bx(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 xc(t,e){zp=t,xw=cc=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(or=!0),t.firstContext=null)}function Hr(t){var e=t._currentValue;if(xw!==t)if(t={context:t,memoizedValue:e,next:null},cc===null){if(zp===null)throw Error(H(308));cc=t,zp.dependencies={lanes:0,firstContext:t}}else cc=cc.next=t;return e}var ka=null;function kw(t){ka===null?ka=[t]:ka.push(t)}function OA(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,kw(e)):(n.next=s.next,s.next=n),e.interleaved=n,_i(t,r)}function _i(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 Ki=!1;function Sw(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function PA(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 bi(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function To(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ke&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,_i(t,n)}return s=r.interleaved,s===null?(e.next=e,kw(r)):(e.next=s.next,s.next=e),r.interleaved=e,_i(t,n)}function Xf(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,lw(t,n)}}function DS(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 $p(t,e,n,r){var s=t.updateQueue;Ki=!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 d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var h=s.baseState;o=0,d=c=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=t,m=a;switch(f=e,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){h=g.call(p,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(p,h,f):g,f==null)break e;h=St({},h,f);break e;case 2:Ki=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=p,l=h):d=d.next=p,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(d===null&&(l=h),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Za|=o,t.lanes=o,t.memoizedState=h}}function LS(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(H(191,s));s.call(r)}}}var Dh={},Us=Qo(Dh),Kd=Qo(Dh),Jd=Qo(Dh);function Sa(t){if(t===Dh)throw Error(H(174));return t}function Ew(t,e){switch(dt(Jd,e),dt(Kd,t),dt(Us,Dh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:wx(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=wx(e,t)}mt(Us),dt(Us,e)}function Kc(){mt(Us),mt(Kd),mt(Jd)}function IA(t){Sa(Jd.current);var e=Sa(Us.current),n=wx(e,t.type);e!==n&&(dt(Kd,t),dt(Us,n))}function Cw(t){Kd.current===t&&(mt(Us),mt(Kd))}var bt=Qo(0);function Fp(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 qy=[];function Nw(){for(var t=0;t<qy.length;t++)qy[t]._workInProgressVersionPrimary=null;qy.length=0}var ep=Mi.ReactCurrentDispatcher,Uy=Mi.ReactCurrentBatchConfig,Ya=0,kt=null,Jt=null,en=null,Bp=!1,gd=!1,Qd=0,s$=0;
vendor: 4,967 bytes, line 38
38function Sn(){throw Error(H(321))}function _w(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ys(t[n],e[n]))return!1;return!0}function Tw(t,e,n,r,s,i){if(Ya=i,kt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ep.current=t===null||t.memoizedState===null?l$:c$,t=n(r,s),gd){i=0;do{if(gd=!1,Qd=0,25<=i)throw Error(H(301));i+=1,en=Jt=null,e.updateQueue=null,ep.current=u$,t=n(r,s)}while(gd)}if(ep.current=qp,e=Jt!==null&&Jt.next!==null,Ya=0,en=Jt=kt=null,Bp=!1,e)throw Error(H(300));return t}function Aw(){var t=Qd!==0;return Qd=0,t}function As(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?kt.memoizedState=en=t:en=en.next=t,en}function Wr(){if(Jt===null){var t=kt.alternate;t=t!==null?t.memoizedState:null}else t=Jt.next;var e=en===null?kt.memoizedState:en.next;if(e!==null)en=e,Jt=t;else{if(t===null)throw Error(H(310));Jt=t,t={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},en===null?kt.memoizedState=en=t:en=en.next=t}return en}function Yd(t,e){return typeof e=="function"?e(t):e}function Vy(t){var e=Wr(),n=e.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=t;var r=Jt,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 d=c.lane;if((Ya&d)===d)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 h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=h,o=r):l=l.next=h,kt.lanes|=d,Za|=d}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,ys(r,e.memoizedState)||(or=!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,kt.lanes|=i,Za|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Hy(t){var e=Wr(),n=e.queue;if(n===null)throw Error(H(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);ys(i,e.memoizedState)||(or=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function DA(){}function LA(t,e){var n=kt,r=Wr(),s=e(),i=!ys(r.memoizedState,s);if(i&&(r.memoizedState=s,or=!0),r=r.queue,jw(FA.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||en!==null&&en.memoizedState.tag&1){if(n.flags|=2048,Zd(9,$A.bind(null,n,r,s,e),void 0,null),rn===null)throw Error(H(349));Ya&30||zA(n,e,s)}return s}function zA(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=kt.updateQueue,e===null?(e={lastEffect:null,stores:null},kt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function $A(t,e,n,r){e.value=n,e.getSnapshot=r,BA(e)&&qA(t)}function FA(t,e,n){return n(function(){BA(e)&&qA(t)})}function BA(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ys(t,n)}catch{return!0}}function qA(t){var e=_i(t,1);e!==null&&ms(e,t,1,-1)}function zS(t){var e=As();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yd,lastRenderedState:t},e.queue=t,t=t.dispatch=a$.bind(null,kt,t),[e.memoizedState,t]}function Zd(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=kt.updateQueue,e===null?(e={lastEffect:null,stores:null},kt.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 UA(){return Wr().memoizedState}function tp(t,e,n,r){var s=As();kt.flags|=t,s.memoizedState=Zd(1|e,n,void 0,r===void 0?null:r)}function vg(t,e,n,r){var s=Wr();r=r===void 0?null:r;var i=void 0;if(Jt!==null){var o=Jt.memoizedState;if(i=o.destroy,r!==null&&_w(r,o.deps)){s.memoizedState=Zd(e,n,i,r);return}}kt.flags|=t,s.memoizedState=Zd(1|e,n,i,r)}function $S(t,e){return tp(8390656,8,t,e)}function jw(t,e){return vg(2048,8,t,e)}function VA(t,e){return vg(4,2,t,e)}function HA(t,e){return vg(4,4,t,e)}function WA(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 GA(t,e,n){return n=n!=null?n.concat([t]):null,vg(4,4,WA.bind(null,e,t),n)}function Rw(){}function KA(t,e){var n=Wr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&_w(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function JA(t,e){var n=Wr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&_w(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function QA(t,e,n){return Ya&21?(ys(n,e)||(n=tA(),kt.lanes|=n,Za|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,or=!0),t.memoizedState=n)}function i$(t,e){var n=st;st=n!==0&&4>n?n:4,t(!0);var r=Uy.transition;Uy.transition={};try{t(!1),e()}finally{st=n,Uy.transition=r}}
vendor: 6,171 bytes, line 38
38function YA(){return Wr().memoizedState}function o$(t,e,n){var r=jo(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ZA(t))XA(e,n);else if(n=OA(t,e,n,r),n!==null){var s=Fn();ms(n,t,r,s),ej(n,e,r)}}function a$(t,e,n){var r=jo(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ZA(t))XA(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,ys(a,o)){var l=e.interleaved;l===null?(s.next=s,kw(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=OA(t,e,s,r),n!==null&&(s=Fn(),ms(n,t,r,s),ej(n,e,r))}}function ZA(t){var e=t.alternate;return t===kt||e!==null&&e===kt}function XA(t,e){gd=Bp=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function ej(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,lw(t,n)}}var qp={readContext:Hr,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useInsertionEffect:Sn,useLayoutEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useMutableSource:Sn,useSyncExternalStore:Sn,useId:Sn,unstable_isNewReconciler:!1},l$={readContext:Hr,useCallback:function(t,e){return As().memoizedState=[t,e===void 0?null:e],t},useContext:Hr,useEffect:$S,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,tp(4194308,4,WA.bind(null,e,t),n)},useLayoutEffect:function(t,e){return tp(4194308,4,t,e)},useInsertionEffect:function(t,e){return tp(4,2,t,e)},useMemo:function(t,e){var n=As();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=As();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=o$.bind(null,kt,t),[r.memoizedState,t]},useRef:function(t){var e=As();return t={current:t},e.memoizedState=t},useState:zS,useDebugValue:Rw,useDeferredValue:function(t){return As().memoizedState=t},useTransition:function(){var t=zS(!1),e=t[0];return t=i$.bind(null,t[1]),As().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=kt,s=As();if(yt){if(n===void 0)throw Error(H(407));n=n()}else{if(n=e(),rn===null)throw Error(H(349));Ya&30||zA(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,$S(FA.bind(null,r,i,t),[t]),r.flags|=2048,Zd(9,$A.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=As(),e=rn.identifierPrefix;if(yt){var n=vi,r=yi;n=(r&~(1<<32-ps(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Qd++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=s$++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},c$={readContext:Hr,useCallback:KA,useContext:Hr,useEffect:jw,useImperativeHandle:GA,useInsertionEffect:VA,useLayoutEffect:HA,useMemo:JA,useReducer:Vy,useRef:UA,useState:function(){return Vy(Yd)},useDebugValue:Rw,useDeferredValue:function(t){var e=Wr();return QA(e,Jt.memoizedState,t)},useTransition:function(){var t=Vy(Yd)[0],e=Wr().memoizedState;return[t,e]},useMutableSource:DA,useSyncExternalStore:LA,useId:YA,unstable_isNewReconciler:!1},u$={readContext:Hr,useCallback:KA,useContext:Hr,useEffect:jw,useImperativeHandle:GA,useInsertionEffect:VA,useLayoutEffect:HA,useMemo:JA,useReducer:Hy,useRef:UA,useState:function(){return Hy(Yd)},useDebugValue:Rw,useDeferredValue:function(t){var e=Wr();return Jt===null?e.memoizedState=t:QA(e,Jt.memoizedState,t)},useTransition:function(){var t=Hy(Yd)[0],e=Wr().memoizedState;return[t,e]},useMutableSource:DA,useSyncExternalStore:LA,useId:YA,unstable_isNewReconciler:!1};function ts(t,e){if(t&&t.defaultProps){e=St({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function qx(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:St({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var xg={isMounted:function(t){return(t=t._reactInternals)?vl(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Fn(),s=jo(t),i=bi(r,s);i.payload=e,n!=null&&(i.callback=n),e=To(t,i,s),e!==null&&(ms(e,t,s,r),Xf(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Fn(),s=jo(t),i=bi(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=To(t,i,s),e!==null&&(ms(e,t,s,r),Xf(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Fn(),r=jo(t),s=bi(n,r);s.tag=2,e!=null&&(s.callback=e),e=To(t,s,r),e!==null&&(ms(e,t,r,n),Xf(e,t,r))}};function FS(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?!Vd(n,r)||!Vd(s,i):!0}function tj(t,e,n){var r=!1,s=Fo,i=e.contextType;return typeof i=="object"&&i!==null?i=Hr(i):(s=lr(e)?Ja:An.current,r=e.contextTypes,i=(r=r!=null)?Hc(t,s):Fo),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=xg,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function BS(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&&xg.enqueueReplaceState(e,e.state,null)}function Ux(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},Sw(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=Hr(i):(i=lr(e)?Ja:An.current,s.context=Hc(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(qx(t,e,i,n),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&xg.enqueueReplaceState(s,s.state,null),$p(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}
vendor: 11,208 bytes, lines 38-40
38function Jc(t,e){try{var n="",r=e;do n+=zz(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 Wy(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Vx(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var d$=typeof WeakMap=="function"?WeakMap:Map;function nj(t,e,n){n=bi(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Vp||(Vp=!0,eb=r),Vx(t,e)},n}function rj(t,e,n){n=bi(-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(){Vx(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Vx(t,e),typeof r!="function"&&(Ao===null?Ao=new Set([this]):Ao.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function qS(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new d$;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=C$.bind(null,t,e,n),e.then(t,t))}function US(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 VS(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=bi(-1,1),e.tag=2,To(n,e,1))),n.lanes|=1),t)}var h$=Mi.ReactCurrentOwner,or=!1;function Dn(t,e,n,r){e.child=t===null?MA(e,null,n,r):Gc(e,t.child,n,r)}function HS(t,e,n,r,s){n=n.render;var i=e.ref;return xc(e,s),r=Tw(t,e,n,r,i,s),n=Aw(),t!==null&&!or?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Ti(t,e,s)):(yt&&n&&gw(e),e.flags|=1,Dn(t,e,r,s),e.child)}function WS(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!$w(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,sj(t,e,i,r,s)):(t=ip(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:Vd,n(o,r)&&t.ref===e.ref)return Ti(t,e,s)}return e.flags|=1,t=Ro(i,r),t.ref=e.ref,t.return=e,e.child=t}function sj(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(Vd(i,r)&&t.ref===e.ref)if(or=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(or=!0);else return e.lanes=t.lanes,Ti(t,e,s)}return Hx(t,e,n,r,s)}function ij(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},dt(dc,mr),mr|=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,dt(dc,mr),mr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,dt(dc,mr),mr|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,dt(dc,mr),mr|=r;return Dn(t,e,s,n),e.child}function oj(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Hx(t,e,n,r,s){var i=lr(n)?Ja:An.current;return i=Hc(e,i),xc(e,s),n=Tw(t,e,n,r,i,s),r=Aw(),t!==null&&!or?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Ti(t,e,s)):(yt&&r&&gw(e),e.flags|=1,Dn(t,e,n,s),e.child)}function GS(t,e,n,r,s){if(lr(n)){var i=!0;Pp(e)}else i=!1;if(xc(e,s),e.stateNode===null)np(t,e),tj(e,n,r),Ux(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=Hr(c):(c=lr(n)?Ja:An.current,c=Hc(e,c));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&BS(e,o,r,c),Ki=!1;var f=e.memoizedState;o.state=f,$p(e,r,o,s),l=e.memoizedState,a!==r||f!==l||ar.current||Ki?(typeof d=="function"&&(qx(e,n,d,r),l=e.memoizedState),(a=Ki||FS(e,n,a,r,f,l,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=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,PA(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:ts(e.type,a),o.props=c,h=e.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Hr(l):(l=lr(n)?Ja:An.current,l=Hc(e,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&BS(e,o,r,l),Ki=!1,f=e.memoizedState,o.state=f,$p(e,r,o,s);var g=e.memoizedState;a!==h||f!==g||ar.current||Ki?(typeof p=="function"&&(qx(e,n,p,r),g=e.memoizedState),(c=Ki||FS(e,n,c,r,f,g,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,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=g),o.props=r,o.state=g,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 Wx(t,e,n,r,i,s)}function Wx(t,e,n,r,s,i){oj(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return s&&MS(e,n,!1),Ti(t,e,i);r=e.stateNode,h$.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Gc(e,t.child,null,i),e.child=Gc(e,null,a,i)):Dn(t,e,a,i),e.memoizedState=r.state,s&&MS(e,n,!0),e.child}function aj(t){var e=t.stateNode;e.pendingContext?RS(t,e.pendingContext,e.pendingContext!==e.context):e.context&&RS(t,e.context,!1),Ew(t,e.containerInfo)}function KS(t,e,n,r,s){return Wc(),vw(s),e.flags|=256,Dn(t,e,n,r),e.child}var Gx={dehydrated:null,treeContext:null,retryLane:0};function Kx(t){return{baseLanes:t,cachePool:null,transitions:null}}function lj(t,e,n){var r=e.pendingProps,s=bt.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),dt(bt,s&1),t===null)return Fx(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=kg(o,r,0,null),t=Ba(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Kx(n),e.memoizedState=Gx,t):Mw(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return f$(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=Ro(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Ro(a,i):(i=Ba(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?Kx(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=Gx,r}return i=t.child,t=i.sibling,r=Ro(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 Mw(t,e){return e=kg({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function pf(t,e,n,r){return r!==null&&vw(r),Gc(e,t.child,null,n),t=Mw(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function f$(t,e,n,r,s,i,o){if(n)return e.flags&256?(e.flags&=-257,r=Wy(Error(H(422))),pf(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=kg({mode:"visible",children:r.children},s,0,null),i=Ba(i,s,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&Gc(e,t.child,null,o),e.child.memoizedState=Kx(o),e.memoizedState=Gx,i);if(!(e.mode&1))return pf(t,e,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(H(419)),r=Wy(i,r,void 0),pf(t,e,o,r)}if(a=(o&t.childLanes)!==0,or||a){if(r=rn,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,_i(t,s),ms(r,t,s,-1))}return zw(),r=Wy(Error(H(421))),pf(t,e,o,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=N$.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,br=_o(s.nextSibling),wr=e,yt=!0,ls=null,t!==null&&(Lr[zr++]=yi,Lr[zr++]=vi,Lr[zr++]=Qa,yi=t.id,vi=t.overflow,Qa=e),e=Mw(e,r.children),e.flags|=4096,e)}function JS(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Bx(t.return,e,n)}function Gy(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 cj(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(Dn(t,e,r.children,n),r=bt.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&&JS(t,n,e);else if(t.tag===19)JS(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(dt(bt,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&&Fp(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),Gy(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&&Fp(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}Gy(e,!0,n,null,i);break;case"together":Gy(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function np(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}
vendor: 4,903 bytes, line 40
40function Ti(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Za|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(H(153));if(e.child!==null){for(t=e.child,n=Ro(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Ro(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function p$(t,e,n){switch(e.tag){case 3:aj(e),Wc();break;case 5:IA(e);break;case 1:lr(e.type)&&Pp(e);break;case 4:Ew(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;dt(Lp,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(dt(bt,bt.current&1),e.flags|=128,null):n&e.child.childLanes?lj(t,e,n):(dt(bt,bt.current&1),t=Ti(t,e,n),t!==null?t.sibling:null);dt(bt,bt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return cj(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),dt(bt,bt.current),r)break;return null;case 22:case 23:return e.lanes=0,ij(t,e,n)}return Ti(t,e,n)}var uj,Jx,dj,hj;uj=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}};Jx=function(){};dj=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,Sa(Us.current);var i=null;switch(n){case"input":s=yx(t,s),r=yx(t,r),i=[];break;case"select":s=St({},s,{value:void 0}),r=St({},r,{value:void 0}),i=[];break;case"textarea":s=bx(t,s),r=bx(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Mp)}kx(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"&&(Ld.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"&&(Ld.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ft("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)}};hj=function(t,e,n,r){n!==r&&(e.flags|=4)};function Pu(t,e){if(!yt)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 En(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 m$(t,e,n){var r=e.pendingProps;switch(yw(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(e),null;case 1:return lr(e.type)&&Op(),En(e),null;case 3:return r=e.stateNode,Kc(),mt(ar),mt(An),Nw(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(hf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ls!==null&&(rb(ls),ls=null))),Jx(t,e),En(e),null;case 5:Cw(e);var s=Sa(Jd.current);if(n=e.type,t!==null&&e.stateNode!=null)dj(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(H(166));return En(e),null}if(t=Sa(Us.current),hf(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[Ds]=e,r[Gd]=i,t=(e.mode&1)!==0,n){case"dialog":ft("cancel",r),ft("close",r);break;case"iframe":case"object":case"embed":ft("load",r);break;case"video":case"audio":for(s=0;s<nd.length;s++)ft(nd[s],r);break;case"source":ft("error",r);break;case"img":case"image":case"link":ft("error",r),ft("load",r);break;case"details":ft("toggle",r);break;case"input":sS(r,i),ft("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ft("invalid",r);break;case"textarea":oS(r,i),ft("invalid",r)}kx(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&&df(r.textContent,a,t),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&df(r.textContent,a,t),s=["children",""+a]):Ld.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ft("scroll",r)}switch(n){case"input":nf(r),iS(r,i,!0);break;case"textarea":nf(r),aS(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Mp)}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=FT(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[Ds]=e,t[Gd]=r,uj(t,e,!1,!1),e.stateNode=t;e:{switch(o=Sx(n,r),n){case"dialog":ft("cancel",t),ft("close",t),s=r;break;case"iframe":case"object":case"embed":ft("load",t),s=r;break;case"video":case"audio":for(s=0;s<nd.length;s++)ft(nd[s],t);s=r;break;case"source":ft("error",t),s=r;break;case"img":case"image":case"link":ft("error",t),ft("load",t),s=r;break;case"details":ft("toggle",t),s=r;break;case"input":sS(t,r),s=yx(t,r),ft("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=St({},r,{value:void 0}),ft("invalid",t);break;case"textarea":oS(t,r),s=bx(t,r),ft("invalid",t);break;default:s=r}kx(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?UT(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&BT(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&zd(t,l):typeof l=="number"&&zd(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ld.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ft("scroll",t):l!=null&&nw(t,i,l,o))}switch(n){case"input":nf(t),iS(t,r,!1);break;case"textarea":nf(t),aS(t);break;case"option":r.value!=null&&t.setAttribute("value",""+$o(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?mc(t,!!r.multiple,i,!1):r.defaultValue!=null&&mc(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=Mp)}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 En(e),null;case 6:if(t&&e.stateNode!=null)hj(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(H(166));if(n=Sa(Jd.current),Sa(Us.current),hf(e)){if(r=e.stateNode,n=e.memoizedProps,r[Ds]=e,(i=r.nodeValue!==n)&&(t=wr,t!==null))switch(t.tag){case 3:df(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&df(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ds]=e,e.stateNode=r}return En(e),null;case 13:if(mt(bt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(yt&&br!==null&&e.mode&1&&!(e.flags&128))jA(),Wc(),e.flags|=98560,i=!1;else if(i=hf(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(H(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Ds]=e}else Wc(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;En(e),i=!1}else ls!==null&&(rb(ls),ls=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||bt.current&1?Yt===0&&(Yt=3):zw())),e.updateQueue!==null&&(e.flags|=4),En(e),null);case 4:return Kc(),Jx(t,e),t===null&&Hd(e.stateNode.containerInfo),En(e),null;case 10:return ww(e.type._context),En(e),null;case 17:return lr(e.type)&&Op(),En(e),null;case 19:if(mt(bt),i=e.memoizedState,i===null)return En(e),null;if(r=(e.flags&128)!==0,o=i.rendering,o===null)if(r)Pu(i,!1);else{if(Yt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Fp(t),o!==null){for(e.flags|=128,Pu(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 dt(bt,bt.current&1|2),e.child}t=t.sibling}i.tail!==null&&Ot()>Qc&&(e.flags|=128,r=!0,Pu(i,!1),e.lanes=4194304)}else{if(!r)if(t=Fp(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Pu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!yt)return En(e),null}else 2*Ot()-i.renderingStartTime>Qc&&n!==1073741824&&(e.flags|=128,r=!0,Pu(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=Ot(),e.sibling=null,n=bt.current,dt(bt,r?n&1|2:n&1),e):(En(e),null);case 22:case 23:return Lw(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?mr&1073741824&&(En(e),e.subtreeFlags&6&&(e.flags|=8192)):En(e),null;case 24:return null;case 25:return null}throw Error(H(156,e.tag))}function g$(t,e){switch(yw(e),e.tag){case 1:return lr(e.type)&&Op(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Kc(),mt(ar),mt(An),Nw(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Cw(e),null;case 13:if(mt(bt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(H(340));Wc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return mt(bt),null;case 4:return Kc(),null;case 10:return ww(e.type._context),null;case 22:case 23:return Lw(),null;case 24:return null;default:return null}}var mf=!1,_n=!1,y$=typeof WeakSet=="function"?WeakSet:Set,le=null;function uc(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){jt(t,e,r)}else n.current=null}function Qx(t,e,n){try{n()}catch(r){jt(t,e,r)}}var QS=!1;function v$(t,e){if(Ox=Ap,t=yA(),mw(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,d=0,h=t,f=null;t:for(;;){for(var p;h!==n||s!==0&&h.nodeType!==3||(a=o+s),h!==i||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===n&&++c===s&&(a=o),f===i&&++d===r&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Px={focusedElem:t,selectionRange:n},Ap=!1,le=e;le!==null;)if(e=le,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,le=t;else for(;le!==null;){e=le;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,y=g.memoizedState,v=e.stateNode,x=v.getSnapshotBeforeUpdate(e.elementType===e.type?m:ts(e.type,m),y);v.__reactInternalSnapshotBeforeUpdate=x}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(H(163))}}catch(k){jt(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,le=t;break}le=e.return}return g=QS,QS=!1,g}function yd(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&&Qx(e,n,i)}s=s.next}while(s!==r)}}function bg(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 Yx(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 fj(t){var e=t.alternate;e!==null&&(t.alternate=null,fj(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ds],delete e[Gd],delete e[Lx],delete e[e$],delete e[t$])),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 pj(t){return t.tag===5||t.tag===3||t.tag===4}function YS(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pj(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 Zx(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=Mp));else if(r!==4&&(t=t.child,t!==null))for(Zx(t,e,n),t=t.sibling;t!==null;)Zx(t,e,n),t=t.sibling}function Xx(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(Xx(t,e,n),t=t.sibling;t!==null;)Xx(t,e,n),t=t.sibling}var pn=null,is=!1;function zi(t,e,n){for(n=n.child;n!==null;)mj(t,e,n),n=n.sibling}function mj(t,e,n){if(qs&&typeof qs.onCommitFiberUnmount=="function")try{qs.onCommitFiberUnmount(hg,n)}catch{}switch(n.tag){case 5:_n||uc(n,e);case 6:var r=pn,s=is;pn=null,zi(t,e,n),pn=r,is=s,pn!==null&&(is?(t=pn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):pn.removeChild(n.stateNode));break;case 18:pn!==null&&(is?(t=pn,n=n.stateNode,t.nodeType===8?Fy(t.parentNode,n):t.nodeType===1&&Fy(t,n),qd(t)):Fy(pn,n.stateNode));break;case 4:r=pn,s=is,pn=n.stateNode.containerInfo,is=!0,zi(t,e,n),pn=r,is=s;break;case 0:case 11:case 14:case 15:if(!_n&&(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)&&Qx(n,e,o),s=s.next}while(s!==r)}zi(t,e,n);break;case 1:if(!_n&&(uc(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){jt(n,e,a)}zi(t,e,n);break;case 21:zi(t,e,n);break;case 22:n.mode&1?(_n=(r=_n)||n.memoizedState!==null,zi(t,e,n),_n=r):zi(t,e,n);break;default:zi(t,e,n)}}function ZS(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new y$),e.forEach(function(r){var s=_$.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Qr(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:pn=a.stateNode,is=!1;break e;case 3:pn=a.stateNode.containerInfo,is=!0;break e;case 4:pn=a.stateNode.containerInfo,is=!0;break e}a=a.return}if(pn===null)throw Error(H(160));mj(i,o,s),pn=null,is=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){jt(s,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)gj(e,t),e=e.sibling}function gj(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Qr(e,t),_s(t),r&4){try{yd(3,t,t.return),bg(3,t)}catch(m){jt(t,t.return,m)}try{yd(5,t,t.return)}catch(m){jt(t,t.return,m)}}break;case 1:Qr(e,t),_s(t),r&512&&n!==null&&uc(n,n.return);break;case 5:if(Qr(e,t),_s(t),r&512&&n!==null&&uc(n,n.return),t.flags&32){var s=t.stateNode;try{zd(s,"")}catch(m){jt(t,t.return,m)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&zT(s,i),Sx(a,o);var c=Sx(a,i);for(o=0;o<l.length;o+=2){var d=l[o],h=l[o+1];d==="style"?UT(s,h):d==="dangerouslySetInnerHTML"?BT(s,h):d==="children"?zd(s,h):nw(s,d,h,c)}switch(a){case"input":vx(s,i);break;case"textarea":$T(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?mc(s,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?mc(s,!!i.multiple,i.defaultValue,!0):mc(s,!!i.multiple,i.multiple?[]:"",!1))}s[Gd]=i}catch(m){jt(t,t.return,m)}}break;case 6:if(Qr(e,t),_s(t),r&4){if(t.stateNode===null)throw Error(H(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(m){jt(t,t.return,m)}}break;case 3:if(Qr(e,t),_s(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{qd(e.containerInfo)}catch(m){jt(t,t.return,m)}break;case 4:Qr(e,t),_s(t);break;case 13:Qr(e,t),_s(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Iw=Ot())),r&4&&ZS(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(_n=(c=_n)||d,Qr(e,t),_n=c):Qr(e,t),_s(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!d&&t.mode&1)for(le=t,d=t.child;d!==null;){for(h=le=d;le!==null;){switch(f=le,p=f.child,f.tag){case 0:case 11:case 14:case 15:yd(4,f,f.return);break;case 1:uc(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(m){jt(r,n,m)}}break;case 5:uc(f,f.return);break;case 22:if(f.memoizedState!==null){eE(h);continue}}p!==null?(p.return=f,le=p):eE(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{s=h.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=qT("display",o))}catch(m){jt(t,t.return,m)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(m){jt(t,t.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Qr(e,t),_s(t),r&4&&ZS(t);break;case 21:break;default:Qr(e,t),_s(t)}}function _s(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(pj(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(zd(s,""),r.flags&=-33);var i=YS(t);Xx(t,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=YS(t);Zx(t,a,o);break;default:throw Error(H(161))}}catch(l){jt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function x$(t,e,n){le=t,yj(t)}function yj(t,e,n){for(var r=(t.mode&1)!==0;le!==null;){var s=le,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||mf;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||_n;a=mf;var c=_n;if(mf=o,(_n=l)&&!c)for(le=s;le!==null;)o=le,l=o.child,o.tag===22&&o.memoizedState!==null?tE(s):l!==null?(l.return=o,le=l):tE(s);for(;i!==null;)le=i,yj(i),i=i.sibling;le=s,mf=a,_n=c}XS(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,le=i):XS(t)}}function XS(t){for(;le!==null;){var e=le;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:_n||bg(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!_n)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:ts(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&LS(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}LS(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 d=c.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&qd(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}_n||e.flags&512&&Yx(e)}catch(f){jt(e,e.return,f)}}if(e===t){le=null;break}if(n=e.sibling,n!==null){n.return=e.return,le=n;break}le=e.return}}function eE(t){for(;le!==null;){var e=le;if(e===t){le=null;break}var n=e.sibling;if(n!==null){n.return=e.return,le=n;break}le=e.return}}function tE(t){for(;le!==null;){var e=le;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{bg(4,e)}catch(l){jt(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(l){jt(e,s,l)}}var i=e.return;try{Yx(e)}catch(l){jt(e,i,l)}break;case 5:var o=e.return;try{Yx(e)}catch(l){jt(e,o,l)}}}catch(l){jt(e,e.return,l)}if(e===t){le=null;break}var a=e.sibling;if(a!==null){a.return=e.return,le=a;break}le=e.return}}var b$=Math.ceil,Up=Mi.ReactCurrentDispatcher,Ow=Mi.ReactCurrentOwner,Br=Mi.ReactCurrentBatchConfig,Ke=0,rn=null,Ut=null,vn=0,mr=0,dc=Qo(0),Yt=0,Xd=null,Za=0,wg=0,Pw=0,vd=null,sr=null,Iw=0,Qc=1/0,di=null,Vp=!1,eb=null,Ao=null,gf=!1,vo=null,Hp=0,xd=0,tb=null,rp=-1,sp=0;function Fn(){return Ke&6?Ot():rp!==-1?rp:rp=Ot()}function jo(t){return t.mode&1?Ke&2&&vn!==0?vn&-vn:r$.transition!==null?(sp===0&&(sp=tA()),sp):(t=st,t!==0||(t=window.event,t=t===void 0?16:lA(t.type)),t):1}function ms(t,e,n,r){if(50<xd)throw xd=0,tb=null,Error(H(185));Oh(t,n,r),(!(Ke&2)||t!==rn)&&(t===rn&&(!(Ke&2)&&(wg|=n),Yt===4&&to(t,vn)),cr(t,r),n===1&&Ke===0&&!(e.mode&1)&&(Qc=Ot()+500,yg&&Yo()))}function cr(t,e){var n=t.callbackNode;r4(t,e);var r=Tp(t,t===rn?vn:0);if(r===0)n!==null&&uS(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&uS(n),e===1)t.tag===0?n$(nE.bind(null,t)):_A(nE.bind(null,t)),Z4(function(){!(Ke&6)&&Yo()}),n=null;else{switch(nA(r)){case 1:n=aw;break;case 4:n=XT;break;case 16:n=_p;break;case 536870912:n=eA;break;default:n=_p}n=Cj(n,vj.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function vj(t,e){if(rp=-1,sp=0,Ke&6)throw Error(H(327));var n=t.callbackNode;if(bc()&&t.callbackNode!==n)return null;var r=Tp(t,t===rn?vn:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Wp(t,r);else{e=r;var s=Ke;Ke|=2;var i=bj();(rn!==t||vn!==e)&&(di=null,Qc=Ot()+500,Fa(t,e));do try{S$();break}catch(a){xj(t,a)}while(!0);bw(),Up.current=i,Ke=s,Ut!==null?e=0:(rn=null,vn=0,e=Yt)}if(e!==0){if(e===2&&(s=Tx(t),s!==0&&(r=s,e=nb(t,s))),e===1)throw n=Xd,Fa(t,0),to(t,r),cr(t,Ot()),n;if(e===6)to(t,r);else{if(s=t.current.alternate,!(r&30)&&!w$(s)&&(e=Wp(t,r),e===2&&(i=Tx(t),i!==0&&(r=i,e=nb(t,i))),e===1))throw n=Xd,Fa(t,0),to(t,r),cr(t,Ot()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(H(345));case 2:fa(t,sr,di);break;case 3:if(to(t,r),(r&130023424)===r&&(e=Iw+500-Ot(),10<e)){if(Tp(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){Fn(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=Dx(fa.bind(null,t,sr,di),e);break}fa(t,sr,di);break;case 4:if(to(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var o=31-ps(r);i=1<<o,o=e[o],o>s&&(s=o),r&=~i}if(r=s,r=Ot()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*b$(r/1960))-r,10<r){t.timeoutHandle=Dx(fa.bind(null,t,sr,di),r);break}fa(t,sr,di);break;case 5:fa(t,sr,di);break;default:throw Error(H(329))}}}return cr(t,Ot()),t.callbackNode===n?vj.bind(null,t):null}function nb(t,e){var n=vd;return t.current.memoizedState.isDehydrated&&(Fa(t,e).flags|=256),t=Wp(t,e),t!==2&&(e=sr,sr=n,e!==null&&rb(e)),t}function rb(t){sr===null?sr=t:sr.push.apply(sr,t)}function w$(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(!ys(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 to(t,e){for(e&=~Pw,e&=~wg,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-ps(e),r=1<<n;t[n]=-1,e&=~r}}function nE(t){if(Ke&6)throw Error(H(327));bc();var e=Tp(t,0);if(!(e&1))return cr(t,Ot()),null;var n=Wp(t,e);if(t.tag!==0&&n===2){var r=Tx(t);r!==0&&(e=r,n=nb(t,r))}if(n===1)throw n=Xd,Fa(t,0),to(t,e),cr(t,Ot()),n;if(n===6)throw Error(H(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,fa(t,sr,di),cr(t,Ot()),null}function Dw(t,e){var n=Ke;Ke|=1;try{return t(e)}finally{Ke=n,Ke===0&&(Qc=Ot()+500,yg&&Yo())}}function Xa(t){vo!==null&&vo.tag===0&&!(Ke&6)&&bc();var e=Ke;Ke|=1;var n=Br.transition,r=st;try{if(Br.transition=null,st=1,t)return t()}finally{st=r,Br.transition=n,Ke=e,!(Ke&6)&&Yo()}}function Lw(){mr=dc.current,mt(dc)}function Fa(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,Y4(n)),Ut!==null)for(n=Ut.return;n!==null;){var r=n;switch(yw(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Op();break;case 3:Kc(),mt(ar),mt(An),Nw();break;case 5:Cw(r);break;case 4:Kc();break;case 13:mt(bt);break;case 19:mt(bt);break;case 10:ww(r.type._context);break;case 22:case 23:Lw()}n=n.return}if(rn=t,Ut=t=Ro(t.current,null),vn=mr=e,Yt=0,Xd=null,Pw=wg=Za=0,sr=vd=null,ka!==null){for(e=0;e<ka.length;e++)if(n=ka[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}ka=null}return t}function xj(t,e){do{var n=Ut;try{if(bw(),ep.current=qp,Bp){for(var r=kt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Bp=!1}if(Ya=0,en=Jt=kt=null,gd=!1,Qd=0,Ow.current=null,n===null||n.return===null){Yt=1,Xd=e,Ut=null;break}e:{var i=t,o=n.return,a=n,l=e;if(e=vn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=US(o);if(p!==null){p.flags&=-257,VS(p,o,a,i,e),p.mode&1&&qS(i,c,e),e=p,l=c;var g=e.updateQueue;if(g===null){var m=new Set;m.add(l),e.updateQueue=m}else g.add(l);break e}else{if(!(e&1)){qS(i,c,e),zw();break e}l=Error(H(426))}}else if(yt&&a.mode&1){var y=US(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),VS(y,o,a,i,e),vw(Jc(l,a));break e}}i=l=Jc(l,a),Yt!==4&&(Yt=2),vd===null?vd=[i]:vd.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var v=nj(i,l,e);DS(i,v);break e;case 1:a=l;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ao===null||!Ao.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var k=rj(i,a,e);DS(i,k);break e}}i=i.return}while(i!==null)}kj(n)}catch(S){e=S,Ut===n&&n!==null&&(Ut=n=n.return);continue}break}while(!0)}function bj(){var t=Up.current;return Up.current=qp,t===null?qp:t}function zw(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),rn===null||!(Za&268435455)&&!(wg&268435455)||to(rn,vn)}function Wp(t,e){var n=Ke;Ke|=2;var r=bj();(rn!==t||vn!==e)&&(di=null,Fa(t,e));do try{k$();break}catch(s){xj(t,s)}while(!0);if(bw(),Ke=n,Up.current=r,Ut!==null)throw Error(H(261));return rn=null,vn=0,Yt}function k$(){for(;Ut!==null;)wj(Ut)}function S$(){for(;Ut!==null&&!Kz();)wj(Ut)}function wj(t){var e=Ej(t.alternate,t,mr);t.memoizedProps=t.pendingProps,e===null?kj(t):Ut=e,Ow.current=null}function kj(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=g$(n,e),n!==null){n.flags&=32767,Ut=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Yt=6,Ut=null;return}}else if(n=m$(n,e,mr),n!==null){Ut=n;return}if(e=e.sibling,e!==null){Ut=e;return}Ut=e=t}while(e!==null);Yt===0&&(Yt=5)}function fa(t,e,n){var r=st,s=Br.transition;try{Br.transition=null,st=1,E$(t,e,n,r)}finally{Br.transition=s,st=r}return null}function E$(t,e,n,r){do bc();while(vo!==null);if(Ke&6)throw Error(H(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(H(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(s4(t,i),t===rn&&(Ut=rn=null,vn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||gf||(gf=!0,Cj(_p,function(){return bc(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Br.transition,Br.transition=null;var o=st;st=1;var a=Ke;Ke|=4,Ow.current=null,v$(t,n),gj(n,t),V4(Px),Ap=!!Ox,Px=Ox=null,t.current=n,x$(n),Jz(),Ke=a,st=o,Br.transition=i}else t.current=n;if(gf&&(gf=!1,vo=t,Hp=s),i=t.pendingLanes,i===0&&(Ao=null),Zz(n.stateNode),cr(t,Ot()),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(Vp)throw Vp=!1,t=eb,eb=null,t;return Hp&1&&t.tag!==0&&bc(),i=t.pendingLanes,i&1?t===tb?xd++:(xd=0,tb=t):xd=0,Yo(),null}function bc(){if(vo!==null){var t=nA(Hp),e=Br.transition,n=st;try{if(Br.transition=null,st=16>t?16:t,vo===null)var r=!1;else{if(t=vo,vo=null,Hp=0,Ke&6)throw Error(H(331));var s=Ke;for(Ke|=4,le=t.current;le!==null;){var i=le,o=i.child;if(le.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(le=c;le!==null;){var d=le;switch(d.tag){case 0:case 11:case 15:yd(8,d,i)}var h=d.child;if(h!==null)h.return=d,le=h;else for(;le!==null;){d=le;var f=d.sibling,p=d.return;if(fj(d),d===c){le=null;break}if(f!==null){f.return=p,le=f;break}le=p}}}var g=i.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(m!==null)}}le=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,le=o;else e:for(;le!==null;){if(i=le,i.flags&2048)switch(i.tag){case 0:case 11:case 15:yd(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,le=v;break e}le=i.return}}var x=t.current;for(le=x;le!==null;){o=le;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,le=w;else e:for(o=x;le!==null;){if(a=le,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:bg(9,a)}}catch(S){jt(a,a.return,S)}if(a===o){le=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,le=k;break e}le=a.return}}if(Ke=s,Yo(),qs&&typeof qs.onPostCommitFiberRoot=="function")try{qs.onPostCommitFiberRoot(hg,t)}catch{}r=!0}return r}finally{st=n,Br.transition=e}}return!1}function rE(t,e,n){e=Jc(n,e),e=nj(t,e,1),t=To(t,e,1),e=Fn(),t!==null&&(Oh(t,1,e),cr(t,e))}function jt(t,e,n){if(t.tag===3)rE(t,t,n);else for(;e!==null;){if(e.tag===3){rE(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ao===null||!Ao.has(r))){t=Jc(n,t),t=rj(e,t,1),e=To(e,t,1),t=Fn(),e!==null&&(Oh(e,1,t),cr(e,t));break}}e=e.return}}function C$(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Fn(),t.pingedLanes|=t.suspendedLanes&n,rn===t&&(vn&n)===n&&(Yt===4||Yt===3&&(vn&130023424)===vn&&500>Ot()-Iw?Fa(t,0):Pw|=n),cr(t,e)}function Sj(t,e){e===0&&(t.mode&1?(e=of,of<<=1,!(of&130023424)&&(of=4194304)):e=1);var n=Fn();t=_i(t,e),t!==null&&(Oh(t,e,n),cr(t,n))}function N$(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Sj(t,n)}function _$(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(H(314))}r!==null&&r.delete(e),Sj(t,n)}var Ej;Ej=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ar.current)or=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return or=!1,p$(t,e,n);or=!!(t.flags&131072)}else or=!1,yt&&e.flags&1048576&&TA(e,Dp,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;np(t,e),t=e.pendingProps;var s=Hc(e,An.current);xc(e,n),s=Tw(null,e,r,t,s,n);var i=Aw();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,lr(r)?(i=!0,Pp(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Sw(e),s.updater=xg,e.stateNode=s,s._reactInternals=e,Ux(e,r,t,n),e=Wx(null,e,r,!0,i,n)):(e.tag=0,yt&&i&&gw(e),Dn(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(np(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=A$(r),t=ts(r,t),s){case 0:e=Hx(null,e,r,t,n);break e;case 1:e=GS(null,e,r,t,n);break e;case 11:e=HS(null,e,r,t,n);break e;case 14:e=WS(null,e,r,ts(r.type,t),n);break e}throw Error(H(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ts(r,s),Hx(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ts(r,s),GS(t,e,r,s,n);case 3:e:{if(aj(e),t===null)throw Error(H(387));r=e.pendingProps,i=e.memoizedState,s=i.element,PA(t,e),$p(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=Jc(Error(H(423)),e),e=KS(t,e,r,n,s);break e}else if(r!==s){s=Jc(Error(H(424)),e),e=KS(t,e,r,n,s);break e}else for(br=_o(e.stateNode.containerInfo.firstChild),wr=e,yt=!0,ls=null,n=MA(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wc(),r===s){e=Ti(t,e,n);break e}Dn(t,e,r,n)}e=e.child}return e;case 5:return IA(e),t===null&&Fx(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,Ix(r,s)?o=null:i!==null&&Ix(r,i)&&(e.flags|=32),oj(t,e),Dn(t,e,o,n),e.child;case 6:return t===null&&Fx(e),null;case 13:return lj(t,e,n);case 4:return Ew(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Gc(e,null,r,n):Dn(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ts(r,s),HS(t,e,r,s,n);case 7:return Dn(t,e,e.pendingProps,n),e.child;case 8:return Dn(t,e,e.pendingProps.children,n),e.child;case 12:return Dn(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,dt(Lp,r._currentValue),r._currentValue=o,i!==null)if(ys(i.value,o)){if(i.children===s.children&&!ar.current){e=Ti(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=bi(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Bx(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(H(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Bx(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}Dn(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,xc(e,n),s=Hr(s),r=r(s),e.flags|=1,Dn(t,e,r,n),e.child;case 14:return r=e.type,s=ts(r,e.pendingProps),s=ts(r.type,s),WS(t,e,r,s,n);case 15:return sj(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:ts(r,s),np(t,e),e.tag=1,lr(r)?(t=!0,Pp(e)):t=!1,xc(e,n),tj(e,r,s),Ux(e,r,s,n),Wx(null,e,r,!0,t,n);case 19:return cj(t,e,n);case 22:return ij(t,e,n)}throw Error(H(156,e.tag))};function Cj(t,e){return ZT(t,e)}function T$(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 Fr(t,e,n,r){return new T$(t,e,n,r)}function $w(t){return t=t.prototype,!(!t||!t.isReactComponent)}function A$(t){if(typeof t=="function")return $w(t)?1:0;if(t!=null){if(t=t.$$typeof,t===sw)return 11;if(t===iw)return 14}return 2}function Ro(t,e){var n=t.alternate;return n===null?(n=Fr(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: 6,825 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 ip(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")$w(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case tc:return Ba(n.children,s,i,e);case rw:o=8,s|=8;break;case fx:return t=Fr(12,n,e,s|2),t.elementType=fx,t.lanes=i,t;case px:return t=Fr(13,n,e,s),t.elementType=px,t.lanes=i,t;case mx:return t=Fr(19,n,e,s),t.elementType=mx,t.lanes=i,t;case IT:return kg(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case OT:o=10;break e;case PT:o=9;break e;case sw:o=11;break e;case iw:o=14;break e;case Gi:o=16,r=null;break e}throw Error(H(130,t==null?t:typeof t,""))}return e=Fr(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Ba(t,e,n,r){return t=Fr(7,t,r,e),t.lanes=n,t}function kg(t,e,n,r){return t=Fr(22,t,r,e),t.elementType=IT,t.lanes=n,t.stateNode={isHidden:!1},t}function Ky(t,e,n){return t=Fr(6,t,null,e),t.lanes=n,t}function Jy(t,e,n){return e=Fr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function j$(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=Ay(0),this.expirationTimes=Ay(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ay(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Fw(t,e,n,r,s,i,o,a,l){return t=new j$(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Fr(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sw(i),t}function R$(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ec,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function Nj(t){if(!t)return Fo;t=t._reactInternals;e:{if(vl(t)!==t||t.tag!==1)throw Error(H(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(lr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(H(171))}if(t.tag===1){var n=t.type;if(lr(n))return NA(t,n,e)}return e}function _j(t,e,n,r,s,i,o,a,l){return t=Fw(n,r,!0,t,s,i,o,a,l),t.context=Nj(null),n=t.current,r=Fn(),s=jo(n),i=bi(r,s),i.callback=e??null,To(n,i,s),t.current.lanes=s,Oh(t,s,r),cr(t,r),t}function Sg(t,e,n,r){var s=e.current,i=Fn(),o=jo(s);return n=Nj(n),e.context===null?e.context=n:e.pendingContext=n,e=bi(i,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=To(s,e,o),t!==null&&(ms(t,s,o,i),Xf(t,s,o)),o}function Gp(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 sE(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Bw(t,e){sE(t,e),(t=t.alternate)&&sE(t,e)}function M$(){return null}var Tj=typeof reportError=="function"?reportError:function(t){console.error(t)};function qw(t){this._internalRoot=t}Eg.prototype.render=qw.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(H(409));Sg(t,e,null,null)};Eg.prototype.unmount=qw.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Xa(function(){Sg(null,t,null,null)}),e[Ni]=null}};function Eg(t){this._internalRoot=t}Eg.prototype.unstable_scheduleHydration=function(t){if(t){var e=iA();t={blockedOn:null,target:t,priority:e};for(var n=0;n<eo.length&&e!==0&&e<eo[n].priority;n++);eo.splice(n,0,t),n===0&&aA(t)}};function Uw(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Cg(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function iE(){}function O$(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=Gp(o);i.call(c)}}var o=_j(e,r,t,0,null,!1,!1,"",iE);return t._reactRootContainer=o,t[Ni]=o.current,Hd(t.nodeType===8?t.parentNode:t),Xa(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=Gp(l);a.call(c)}}var l=Fw(t,0,!1,null,null,!1,!1,"",iE);return t._reactRootContainer=l,t[Ni]=l.current,Hd(t.nodeType===8?t.parentNode:t),Xa(function(){Sg(e,l,n,r)}),l}function Ng(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=Gp(o);a.call(l)}}Sg(e,o,t,s)}else o=O$(n,e,t,s,r);return Gp(o)}rA=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=td(e.pendingLanes);n!==0&&(lw(e,n|1),cr(e,Ot()),!(Ke&6)&&(Qc=Ot()+500,Yo()))}break;case 13:Xa(function(){var r=_i(t,1);if(r!==null){var s=Fn();ms(r,t,1,s)}}),Bw(t,1)}};cw=function(t){if(t.tag===13){var e=_i(t,134217728);if(e!==null){var n=Fn();ms(e,t,134217728,n)}Bw(t,134217728)}};sA=function(t){if(t.tag===13){var e=jo(t),n=_i(t,e);if(n!==null){var r=Fn();ms(n,t,e,r)}Bw(t,e)}};iA=function(){return st};oA=function(t,e){var n=st;try{return st=t,e()}finally{st=n}};Cx=function(t,e,n){switch(e){case"input":if(vx(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=gg(r);if(!s)throw Error(H(90));LT(r),vx(r,s)}}}break;case"textarea":$T(t,n);break;case"select":e=n.value,e!=null&&mc(t,!!n.multiple,e,!1)}};WT=Dw;GT=Xa;var P$={usingClientEntryPoint:!1,Events:[Ih,ic,gg,VT,HT,Dw]},Iu={findFiberByHostInstance:wa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},I$={bundleType:Iu.bundleType,version:Iu.version,rendererPackageName:Iu.rendererPackageName,rendererConfig:Iu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Mi.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=QT(t),t===null?null:t.stateNode},findFiberByHostInstance:Iu.findFiberByHostInstance||M$,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yf.isDisabled&&yf.supportsFiber)try{hg=yf.inject(I$),qs=yf}catch{}}Cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P$;Cr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uw(e))throw Error(H(200));return R$(t,e,null,n)};Cr.createRoot=function(t,e){if(!Uw(t))throw Error(H(299));var n=!1,r="",s=Tj;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=Fw(t,1,!1,null,null,n,!1,r,s),t[Ni]=e.current,Hd(t.nodeType===8?t.parentNode:t),new qw(e)};Cr.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(H(188)):(t=Object.keys(t).join(","),Error(H(268,t)));return t=QT(e),t=t===null?null:t.stateNode,t};Cr.flushSync=function(t){return Xa(t)};Cr.hydrate=function(t,e,n){if(!Cg(e))throw Error(H(200));return Ng(null,t,e,!0,n)};Cr.hydrateRoot=function(t,e,n){if(!Uw(t))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=Tj;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=_j(e,null,t,1,n??null,s,!1,i,o),t[Ni]=e.current,Hd(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 Eg(e)};Cr.render=function(t,e,n){if(!Cg(e))throw Error(H(200));return Ng(null,t,e,!1,n)};Cr.unmountComponentAtNode=function(t){if(!Cg(t))throw Error(H(40));return t._reactRootContainer?(Xa(function(){Ng(null,null,t,!1,function(){t._reactRootContainer=null,t[Ni]=null})}),!0):!1};Cr.unstable_batchedUpdates=Dw;Cr.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Cg(n))throw Error(H(200));if(t==null||t._reactInternals===void 0)throw Error(H(38));return Ng(t,e,n,!1,r)};Cr.version="18.3.1-next-f1338f8080-20240426";function Aj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Aj)}catch(t){console.error(t)}}Aj(),AT.exports=Cr;var xl=AT.exports;const Vw=Rh(xl);var jj,oE=xl;jj=oE.createRoot,oE.hydrateRoot;var D$=typeof Element<"u",L$=typeof Map=="function",z$=typeof Set=="function",$$=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function op(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,s;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!op(t[r],e[r]))return!1;return!0}var i;if(L$&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;for(i=t.entries();!(r=i.next()).done;)if(!op(r.value[1],e.get(r.value[0])))return!1;return!0}if(z$&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if($$&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[r]))return!1;if(D$&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&t.$$typeof)&&!op(t[s[r]],e[s[r]]))return!1;return!0}return t!==t&&e!==e}var F$=function(e,n){try{return op(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const B$=Rh(F$);var q$=function(t,e,n,r,s,i,o,a){if(!t){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,s,i,o,a],d=0;l=new Error(e.replace(/%s/g,function(){return c[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},U$=q$;const aE=Rh(U$);
40var V$=function(e,n,r,s){var i=r?r.call(s,e,n):void 0;if(i!==void 0)return!!i;if(e===n)return!0;if(typeof e!="object"||!e||typeof n!="object"||!n)return!1;var o=Object.keys(e),a=Object.keys(n);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),c=0;c<o.length;c++){var d=o[c];if(!l(d))return!1;var h=e[d],f=n[d];if(i=r?r.call(s,h,f,d):void 0,i===!1||i===void 0&&h!==f)return!1}return!0};const H$=Rh(V$);var Rj=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(Rj||{}),Qy={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},lE=Object.values(Rj),Hw={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},W$=Object.entries(Hw).reduce((t,[e,n])=>(t[n]=e,t),{}),hs="data-rh",wc={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},kc=(t,e)=>{for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null},G$=t=>{let e=kc(t,"title");const n=kc(t,wc.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),n&&e)return n.replace(/%s/g,()=>e);const r=kc(t,wc.DEFAULT_TITLE);return e||r||void 0},K$=t=>kc(t,wc.ON_CHANGE_CLIENT_STATE)||(()=>{}),Yy=(t,e)=>e.filter(n=>typeof n[t]<"u").map(n=>n[t]).reduce((n,r)=>({...n,...r}),{}),J$=(t,e)=>e.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let i=0;i<s.length;i+=1){const a=s[i].toLowerCase();if(t.indexOf(a)!==-1&&r[a])return n.concat(r)}}return n},[]),Q$=t=>console&&typeof console.warn=="function"&&console.warn(t),Du=(t,e,n)=>{const r={};return n.filter(s=>Array.isArray(s[t])?!0:(typeof s[t]<"u"&&Q$(`Helmet: ${t} should be of type "Array". Instead found type "${typeof s[t]}"`),!1)).map(s=>s[t]).reverse().reduce((s,i)=>{const o={};i.filter(l=>{let c;const d=Object.keys(l);for(let f=0;f<d.length;f+=1){const p=d[f],g=p.toLowerCase();e.indexOf(g)!==-1&&!(c==="rel"&&l[c].toLowerCase()==="canonical")&&!(g==="rel"&&l[g].toLowerCase()==="stylesheet")&&(c=g),e.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(c=p)}if(!c||!l[c])return!1;const h=l[c].toLowerCase();return r[c]||(r[c]={}),o[c]||(o[c]={}),r[c][h]?!1:(o[c][h]=!0,!0)}).reverse().forEach(l=>s.push(l));const a=Object.keys(o);for(let l=0;l<a.length;l+=1){const c=a[l],d={...r[c],...o[c]};r[c]=d}return s},[]).reverse()},Y$=(t,e)=>{if(Array.isArray(t)&&t.length){for(let n=0;n<t.length;n+=1)if(t[n][e])return!0}return!1},Z$=t=>({baseTag:J$(["href"],t),bodyAttributes:Yy("bodyAttributes",t),defer:kc(t,wc.DEFER),encode:kc(t,wc.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Yy("htmlAttributes",t),linkTags:Du("link",["rel","href"],t),metaTags:Du("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:Du("noscript",["innerHTML"],t),onChangeClientState:K$(t),scriptTags:Du("script",["src","innerHTML"],t),styleTags:Du("style",["cssText"],t),title:G$(t),titleAttributes:Yy("titleAttributes",t),prioritizeSeoTags:Y$(t,wc.PRIORITIZE_SEO_TAGS)}),Mj=t=>Array.isArray(t)?t.join(""):t,X$=(t,e)=>{const n=Object.keys(t);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&e[n[r]].includes(t[n[r]]))return!0;return!1},Zy=(t,e)=>Array.isArray(t)?t.reduce((n,r)=>(X$(r,e)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:t,priority:[]},cE=(t,e)=>({...t,[e]:void 0}),e3=["noscript","script","style"],sb=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),Oj=t=>Object.keys(t).reduce((e,n)=>{const r=typeof t[n]<"u"?`${n}
40="${t[n]}"`:`${n}`;return e?`${e} ${r}`:r},""),t3=(t,e,n,r)=>{const s=Oj(n),i=Mj(e);return s?`<${t} ${hs}="true" ${s}>${sb(i,r)}</${t}>`:`<${t} ${hs}="true">${sb(i,r)}</${t}>`},n3=(t,e,n=!0)=>e.reduce((r,s)=>{const i=s,o=Object.keys(i).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,d)=>{const h=typeof i[d]>"u"?d:`${d}="${sb(i[d],n)}"`;return c?`${c} ${h}`:h},""),a=i.innerHTML||i.cssText||"",l=e3.indexOf(t)===-1;return`${r}<${t} ${hs}="true" ${o}${l?"/>":`>${a}</${t}>`}`},""),Pj=(t,e={})=>Object.keys(t).reduce((n,r)=>{const s=Hw[r];return n[s||r]=t[r],n},e),r3=(t,e,n)=>{const r={key:e,[hs]:!0},s=Pj(n,r);return[F.createElement("title",s,e)]},ap=(t,e)=>e.map((n,r)=>{const s={key:r,[hs]:!0};return Object.keys(n).forEach(i=>{const a=Hw[i]||i;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[a]=n[i]}),F.createElement(t,s)}),Or=(t,e,n=!0)=>{switch(t){case"title":return{toComponent:()=>r3(t,e.title,e.titleAttributes),toString:()=>t3(t,e.title,e.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Pj(e),toString:()=>Oj(e)};default:return{toComponent:()=>ap(t,e),toString:()=>n3(t,e,n)}}},s3=({metaTags:t,linkTags:e,scriptTags:n,encode:r})=>{const s=Zy(t,Qy.meta),i=Zy(e,Qy.link),o=Zy(n,Qy.script);return{priorityMethods:{toComponent:()=>[...ap("meta",s.priority),...ap("link",i.priority),...ap("script",o.priority)],toString:()=>`${Or("meta",s.priority,r)} ${Or("link",i.priority,r)} ${Or("script",o.priority,r)}`},metaTags:s.default,linkTags:i.default,scriptTags:o.default}},i3=t=>{const{baseTag:e,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:i,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:c}=t;let{linkTags:d,metaTags:h,scriptTags:f}=t,p={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:p,linkTags:d,metaTags:h,scriptTags:f}=s3(t)),{priority:p,base:Or("base",e,r),bodyAttributes:Or("bodyAttributes",n,r),htmlAttributes:Or("htmlAttributes",s,r),link:Or("link",d,r),meta:Or("meta",h,r),noscript:Or("noscript",i,r),script:Or("script",f,r),style:Or("style",o,r),title:Or("title",{title:a,titleAttributes:l},r)}},ib=i3,vf=[],Ij=!!(typeof window<"u"&&window.document&&window.document.createElement),ob=class{constructor(t,e){ri(this,"instances",[]);ri(this,"canUseDOM",Ij);ri(this,"context");ri(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?vf:this.instances,add:t=>{(this.canUseDOM?vf:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?vf:this.instances).indexOf(t);(this.canUseDOM?vf:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=ib({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},o3={},Dj=F.createContext(o3),ja,Lj=(ja=class extends b.Component{constructor(n){super(n);ri(this,"helmetData");this.helmetData=new ob(this.props.context||{},ja.canUseDOM)}render(){return F.createElement(Dj.Provider,{value:this.helmetData.value},this.props.children)}},ri(ja,"canUseDOM",Ij),ja),Tl=(t,e)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${t}[${hs}]`),s=[].slice.call(r),i=[];let o;return e&&e.length&&e.forEach(a=>{const l=document.createElement(t);for(const c in a)if(Object.prototype.hasOwnProperty.call(a,c))if(c==="innerHTML")l.innerHTML=a.innerHTML;else if(c==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const d=c,h=typeof a[d]>"u"?"":a[d];l.setAttribute(c,h)}l.setAttribute(hs,"true"),s.some((c,d)=>(o=d,l.isEqualNode(c)))?s.splice(o,1):i.push(l)}),s.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}
40),i.forEach(a=>n.appendChild(a)),{oldTags:s,newTags:i}},ab=(t,e)=>{const n=document.getElementsByTagName(t)[0];if(!n)return;const r=n.getAttribute(hs),s=r?r.split(","):[],i=[...s],o=Object.keys(e);for(const a of o){const l=e[a]||"";n.getAttribute(a)!==l&&n.setAttribute(a,l),s.indexOf(a)===-1&&s.push(a);const c=i.indexOf(a);c!==-1&&i.splice(c,1)}for(let a=i.length-1;a>=0;a-=1)n.removeAttribute(i[a]);s.length===i.length?n.removeAttribute(hs):n.getAttribute(hs)!==o.join(",")&&n.setAttribute(hs,o.join(","))},a3=(t,e)=>{typeof t<"u"&&document.title!==t&&(document.title=Mj(t)),ab("title",e)},uE=(t,e)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:i,metaTags:o,noscriptTags:a,onChangeClientState:l,scriptTags:c,styleTags:d,title:h,titleAttributes:f}=t;ab("body",r),ab("html",s),a3(h,f);const p={baseTag:Tl("base",n),linkTags:Tl("link",i),metaTags:Tl("meta",o),noscriptTags:Tl("noscript",a),scriptTags:Tl("script",c),styleTags:Tl("style",d)},g={},m={};Object.keys(p).forEach(y=>{const{newTags:v,oldTags:x}=p[y];v.length&&(g[y]=v),x.length&&(m[y]=p[y].oldTags)}),e&&e(),l(t,g,m)},Lu=null,l3=t=>{Lu&&cancelAnimationFrame(Lu),t.defer?Lu=requestAnimationFrame(()=>{uE(t,()=>{Lu=null})}):(uE(t),Lu=null)},c3=l3,dE=class extends b.Component{constructor(){super(...arguments);ri(this,"rendered",!1)}shouldComponentUpdate(e){return!H$(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:n}=this.props.context;let r=null;const s=Z$(e.get().map(i=>{const o={...i.props};return delete o.context,o}));Lj.canUseDOM?c3(s):ib&&(r=ib(s)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},dx,zj=(dx=class extends b.Component{shouldComponentUpdate(t){return!B$(cE(this.props,"helmetData"),cE(t,"helmetData"))}mapNestedChildrenToProps(t,e){if(!e)return null;switch(t.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,e,n,r){return{...e,[t.type]:[...e[t.type]||[],{...n,...this.mapNestedChildrenToProps(t,r)}]}}mapObjectTypeChildren(t,e,n,r){switch(t.type){case"title":return{...e,[t.type]:r,titleAttributes:{...n}};case"body":return{...e,bodyAttributes:{...n}};case"html":return{...e,htmlAttributes:{...n}};default:return{...e,[t.type]:{...n}}}}mapArrayTypeChildrenToProps(t,e){let n={...e};return Object.keys(t).forEach(r=>{n={...n,[r]:t[r]}}),n}warnOnInvalidChildren(t,e){return aE(lE.some(n=>t.type===n),typeof t.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${lE.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),aE(!e||typeof e=="string"||Array.isArray(e)&&!e.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,e){let n={};return F.Children.forEach(t,r=>{if(!r||!r.props)return;const{children:s,...i}=r.props,o=Object.keys(i).reduce((l,c)=>(l[W$[c]||c]=i[c],l),{});let{type:a}=r;
40switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,s),a){case"Symbol(react.fragment)":e=this.mapChildrenToProps(s,e);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,o,s);break;default:e=this.mapObjectTypeChildren(r,e,o,s);break}}),this.mapArrayTypeChildrenToProps(n,e)}render(){const{children:t,...e}=this.props;let n={...e},{helmetData:r}=e;if(t&&(n=this.mapChildrenToProps(t,n)),r&&!(r instanceof ob)){const s=r;r=new ob(s.context,!0),delete n.helmetData}return r?F.createElement(dE,{...n,context:r.value}):F.createElement(Dj.Consumer,null,s=>F.createElement(dE,{...n,context:s}))}},ri(dx,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),dx);const u3=1,d3=1e6;let Xy=0;function h3(){return Xy=(Xy+1)%Number.MAX_SAFE_INTEGER,Xy.toString()}const ev=new Map,hE=t=>{if(ev.has(t))return;const e=setTimeout(()=>{ev.delete(t),bd({type:"REMOVE_TOAST",toastId:t})},d3);ev.set(t,e)},f3=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,u3)};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;return n?hE(n):t.toasts.forEach(r=>{hE(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)}}},lp=[];let cp={toasts:[]};function bd(t){cp=f3(cp,t),lp.forEach(e=>{e(cp)})}function lb({...t}){const e=h3(),n=s=>bd({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>bd({type:"DISMISS_TOAST",toastId:e});return bd({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function Lh(){const[t,e]=b.useState(cp);return b.useEffect(()=>(lp.push(e),()=>{const n=lp.indexOf(e);n>-1&&lp.splice(n,1)}),[t]),{...t,toast:lb,dismiss:n=>bd({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 fE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function $j(...t){return e=>{let n=!1;const r=t.map(s=>{const i=fE(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():fE(t[s],null)}}}}function Ue(...t){return b.useCallback($j(...t),t)}function p3(t,e){const n=b.createContext(e),r=i=>{const{children:o,...a}=i,l=b.useMemo(()=>a,Object.values(a));return u.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function s(i){const o=b.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 _r(t,e=[]){let n=[];function r(i,o){const a=b.createContext(o),l=n.length;n=[...n,o];const c=h=>{var v;const{scope:f,children:p,...g}=h,m=((v=f==null?void 0:f[t])==null?void 0:v[l])||a,y=b.useMemo(()=>g,Object.values(g));return u.jsx(m.Provider,{value:y,children:p})};c.displayName=i+"Provider";function d(h,f){var m;const p=((m=f==null?void 0:f[t])==null?void 0:m[l])||a,g=b.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[c,d]}const s=()=>{const i=n.map(o=>b.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return b.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,m3(s,...e)]}function m3(...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 h=l(i)[`__scope${c}`];return{...a,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function Yc(t){const e=y3(t),n=b.forwardRef((r,s)=>{const{children:i,...o}=r,a=b.Children.toArray(i),l=a.find(v3);if(l){const c=l.props.children,d=a.map(h=>h===l?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:h);return u.jsx(e,{...o,ref:s,children:b.isValidElement(c)?b.cloneElement(c,void 0,d):null})}return u.jsx(e,{...o,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var g3=Yc("Slot");function y3(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;
vendor: 8,636 bytes, line 40
40if(b.isValidElement(s)){const o=b3(s),a=x3(i,s.props);return s.type!==b.Fragment&&(a.ref=r?$j(r,o):o),b.cloneElement(s,a)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Fj=Symbol("radix.slottable");function Bj(t){const e=({children:n})=>u.jsx(u.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=Fj,e}function v3(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Fj}function x3(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 b3(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)}function zh(t){const e=t+"CollectionProvider",[n,r]=_r(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:y,children:v}=m,x=F.useRef(null),w=F.useRef(new Map).current;return u.jsx(s,{scope:y,itemMap:w,collectionRef:x,children:v})};o.displayName=e;const a=t+"CollectionSlot",l=Yc(a),c=F.forwardRef((m,y)=>{const{scope:v,children:x}=m,w=i(a,v),k=Ue(y,w.collectionRef);return u.jsx(l,{ref:k,children:x})});c.displayName=a;const d=t+"CollectionItemSlot",h="data-radix-collection-item",f=Yc(d),p=F.forwardRef((m,y)=>{const{scope:v,children:x,...w}=m,k=F.useRef(null),S=Ue(y,k),E=i(d,v);return F.useEffect(()=>(E.itemMap.set(k,{ref:k,...w}),()=>void E.itemMap.delete(k))),u.jsx(f,{[h]:"",ref:S,children:x})});p.displayName=d;function g(m){const y=i(t+"CollectionConsumer",m);return F.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((E,C)=>w.indexOf(E.ref.current)-w.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:c,ItemSlot:p},g,r]}var w3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=w3.reduce((t,e)=>{const n=Yc(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function qj(t,e){t&&xl.flushSync(()=>t.dispatchEvent(e))}function Gr(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function k3(t,e=globalThis==null?void 0:globalThis.document){const n=Gr(t);b.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 S3="DismissableLayer",cb="dismissableLayer.update",E3="dismissableLayer.pointerDownOutside",C3="dismissableLayer.focusOutside",pE,Uj=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$h=b.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,c=b.useContext(Uj),[d,h]=b.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=b.useState({}),g=Ue(e,C=>h(C)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(y),x=d?m.indexOf(d):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,k=x>=v,S=_3(C=>{const N=C.target,T=[...c.branches].some(M=>M.contains(N));!k||T||(s==null||s(C),o==null||o(C),C.defaultPrevented||a==null||a())},f),E=T3(C=>{const N=C.target;[...c.branches].some(M=>M.contains(N))||(i==null||i(C),o==null||o(C),C.defaultPrevented||a==null||a())},f);return k3(C=>{x===c.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),b.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(pE=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),mE(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=pE)}},[d,f,n,c]),b.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),mE())},[d,c]),b.useEffect(()=>{const C=()=>p({});return document.addEventListener(cb,C),()=>document.removeEventListener(cb,C)},[]),u.jsx(Ee.div,{...l,ref:g,style:{pointerEvents:w?k?"auto":"none":void 0,...t.style},onFocusCapture:ge(t.onFocusCapture,E.onFocusCapture),onBlurCapture:ge(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ge(t.onPointerDownCapture,S.onPointerDownCapture)})});$h.displayName=S3;var N3="DismissableLayerBranch",Vj=b.forwardRef((t,e)=>{const n=b.useContext(Uj),r=b.useRef(null),s=Ue(e,r);return b.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),u.jsx(Ee.div,{...t,ref:s})});Vj.displayName=N3;function _3(t,e=globalThis==null?void 0:globalThis.document){const n=Gr(t),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Hj(E3,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 T3(t,e=globalThis==null?void 0:globalThis.document){const n=Gr(t),r=b.useRef(!1);return b.useEffect(()=>{const s=i=>{i.target&&!r.current&&Hj(C3,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 mE(){const t=new CustomEvent(cb);document.dispatchEvent(t)}function Hj(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?qj(s,i):s.dispatchEvent(i)}var A3=$h,j3=Vj,an=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},R3="Portal",_g=b.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=b.useState(!1);an(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Vw.createPortal(u.jsx(Ee.div,{...r,ref:e}),o):null});_g.displayName=R3;function M3(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var Zo=t=>{const{present:e,children:n}=t,r=O3(e),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),i=Ue(r.ref,P3(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:i}):null};Zo.displayName="Presence";function O3(t){const[e,n]=b.useState(),r=b.useRef(null),s=b.useRef(t),i=b.useRef("none"),o=t?"mounted":"unmounted",[a,l]=M3(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const c=xf(r.current);i.current=a==="mounted"?c:"none"},[a]),an(()=>{const c=r.current,d=s.current;if(d!==t){const f=i.current,p=xf(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),an(()=>{if(e){let c;const d=e.ownerDocument.defaultView??window,h=p=>{const m=xf(r.current).includes(p.animationName);if(p.target===e&&m&&(l("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",c=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=p=>{p.target===e&&(i.current=xf(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function xf(t){return(t==null?void 0:t.animationName)||"none"}function P3(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.
40isReactWarning;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 I3=X0[" useInsertionEffect ".trim().toString()]||an;function vs({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,o]=D3({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:s;{const d=b.useRef(t!==void 0);b.useEffect(()=>{const h=d.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=b.useCallback(d=>{var h;if(a){const f=L3(d)?d(t):d;f!==t&&((h=o.current)==null||h.call(o,f))}else i(d)},[a,t,i,o]);return[l,c]}function D3({defaultProp:t,onChange:e}){const[n,r]=b.useState(t),s=b.useRef(n),i=b.useRef(e);return I3(()=>{i.current=e},[e]),b.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function L3(t){return typeof t=="function"}var Wj=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"}),z3="VisuallyHidden",Tg=b.forwardRef((t,e)=>u.jsx(Ee.span,{...t,ref:e,style:{...Wj,...t.style}}));Tg.displayName=z3;var $3=Tg,Ww="ToastProvider",[Gw,F3,B3]=zh("Toast"),[Gj,rie]=_r("Toast",[B3]),[q3,Ag]=Gj(Ww),Kj=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=b.useState(null),[c,d]=b.useState(0),h=b.useRef(!1),f=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ww}\`. Expected non-empty \`string\`.`),u.jsx(Gw.Provider,{scope:e,children:u.jsx(q3,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:b.useCallback(()=>d(p=>p+1),[]),onToastRemove:b.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};Kj.displayName=Ww;var Jj="ToastViewport",U3=["F8"],ub="toast.viewportPause",db="toast.viewportResume",Qj=b.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=U3,label:s="Notifications ({hotkey})",...i}=t,o=Ag(Jj,n),a=F3(n),l=b.useRef(null),c=b.useRef(null),d=b.useRef(null),h=b.useRef(null),f=Ue(e,h,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;b.useEffect(()=>{const y=v=>{var w;r.length!==0&&r.every(k=>v[k]||v.code===k)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),b.useEffect(()=>{const y=l.current,v=h.current;if(g&&y&&v){const x=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(ub);v.dispatchEvent(E),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(db);v.dispatchEvent(E),o.isClosePausedRef.current=!1}},k=E=>{!y.contains(E.relatedTarget)&&w()},S=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",x),y.addEventListener("focusout",k),y.addEventListener("pointermove",x),y.addEventListener("pointerleave",S),window.addEventListener("blur",x),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",x),y.removeEventListener("focusout",k),y.removeEventListener("pointermove",x),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",x),window.removeEventListener("focus",w)}}},[g,o.isClosePausedRef]);const m=b.useCallback(({tabbingDirection:y})=>{const x=a().map(w=>{const k=w.ref.current,S=[k,...nF(k)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?x.reverse():x).flat()},[a]);return b.useEffect(()=>{const y=h.current;if(y){const v=x=>{var S,E,C;const w=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!w){const N=document.activeElement,T=x.shiftKey;if(x.target===y&&T){(S=c.current)==null||S.focus();return}const A=m({tabbingDirection:T?"backwards":"forwards"}),L=A.findIndex(I=>I===N);tv(A.slice(L+1))?x.preventDefault():T?(E=c.current)==null||E.focus():(C=d.current)==null||C.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[a,m]),u.jsxs(j3,{ref:l,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&u.jsx(hb,{ref:c,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});tv(y)}}),u.jsx(Gw.Slot,{scope:n,children:u.jsx(Ee.ol,{tabIndex:-1,...i,ref:f})}),g&&u.jsx(hb,{ref:d,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});tv(y)}})]})});Qj.displayName=Jj;var Yj="ToastFocusProxy",hb=b.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Ag(Yj,n);return u.jsx(Tg,{"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()}})});hb.displayName=Yj;var Fh="Toast",V3="toast.swipeStart",H3="toast.swipeMove",W3="toast.swipeCancel",G3="toast.swipeEnd",Zj=b.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=vs({prop:r,defaultProp:s??!0,onChange:i,caller:Fh});return u.jsx(Zo,{present:n||a,children:u.jsx(Q3,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Gr(t.onPause),onResume:Gr(t.onResume),onSwipeStart:ge(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ge(t.onSwipeMove,c=>{const{x:d,y:h}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}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:d,y:h}=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",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})})});Zj.displayName=Fh;var[K3,J3]=Gj(Fh,{onClose(){}}),Q3=b.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:p,...g}=t,m=Ag(Fh,n),[y,v]=b.useState(null),x=Ue(e,I=>v(I)),w=b.useRef(null),k=b.useRef(null),S=s||m.duration,E=b.useRef(0),C=b.useRef(S),N=b.useRef(0),{onToastAdd:T,onToastRemove:M}=m,D=Gr(()=>{var U;(y==null?void 0:y.contains(document.activeElement))&&((U=m.viewport)==null||U.focus()),o()}),A=b.useCallback(I=>
40{!I||I===1/0||(window.clearTimeout(N.current),E.current=new Date().getTime(),N.current=window.setTimeout(D,I))},[D]);b.useEffect(()=>{const I=m.viewport;if(I){const U=()=>{A(C.current),c==null||c()},B=()=>{const J=new Date().getTime()-E.current;C.current=C.current-J,window.clearTimeout(N.current),l==null||l()};return I.addEventListener(ub,B),I.addEventListener(db,U),()=>{I.removeEventListener(ub,B),I.removeEventListener(db,U)}}},[m.viewport,S,l,c,A]),b.useEffect(()=>{i&&!m.isClosePausedRef.current&&A(S)},[i,S,m.isClosePausedRef,A]),b.useEffect(()=>(T(),()=>M()),[T,M]);const L=b.useMemo(()=>y?iR(y):null,[y]);return m.viewport?u.jsxs(u.Fragment,{children:[L&&u.jsx(Y3,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),u.jsx(K3,{scope:n,onClose:D,children:xl.createPortal(u.jsx(Gw.ItemSlot,{scope:n,children:u.jsx(A3,{asChild:!0,onEscapeKeyDown:ge(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||D(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(Ee.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...g,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ge(t.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),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 U=I.clientX-w.current.x,B=I.clientY-w.current.y,J=!!k.current,P=["left","right"].includes(m.swipeDirection),z=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,Q=P?z(0,U):0,re=P?0:z(0,B),ce=I.pointerType==="touch"?10:2,ae={x:Q,y:re},Ce={originalEvent:I,delta:ae};J?(k.current=ae,bf(H3,h,Ce,{discrete:!1})):gE(ae,m.swipeDirection,ce)?(k.current=ae,bf(V3,d,Ce,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(U)>ce||Math.abs(B)>ce)&&(w.current=null)}),onPointerUp:ge(t.onPointerUp,I=>{const U=k.current,B=I.target;if(B.hasPointerCapture(I.pointerId)&&B.releasePointerCapture(I.pointerId),k.current=null,w.current=null,U){const J=I.currentTarget,P={originalEvent:I,delta:U};gE(U,m.swipeDirection,m.swipeThreshold)?bf(G3,p,P,{discrete:!0}):bf(W3,f,P,{discrete:!0}),J.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),Y3=t=>{const{__scopeToast:e,children:n,...r}=t,s=Ag(Fh,e),[i,o]=b.useState(!1),[a,l]=b.useState(!1);return eF(()=>o(!0)),b.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:u.jsx(_g,{asChild:!0,children:u.jsx(Tg,{...r,children:i&&u.jsxs(u.Fragment,{children:[s.label," ",n]})})})},Z3="ToastTitle",Xj=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return u.jsx(Ee.div,{...r,ref:e})});Xj.displayName=Z3;var X3="ToastDescription",eR=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return u.jsx(Ee.div,{...r,ref:e})});eR.displayName=X3;var tR="ToastAction",nR=b.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?u.jsx(sR,{altText:n,asChild:!0,children:u.jsx(Kw,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${tR}\`. Expected non-empty \`string\`.`),null)});nR.displayName=tR;var rR="ToastClose",Kw=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=J3(rR,n);return u.jsx(sR,{asChild:!0,children:u.jsx(Ee.button,{type:"button",...r,ref:e,onClick:ge(t.onClick,s.onClose)})})});Kw.displayName=rR;var sR=b.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return u.jsx(Ee.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function iR(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),tF(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(...iR(r))}}),e}function bf(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?qj(s,i):s.dispatchEvent(i)}var gE=(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 eF(t=()=>{}){const e=Gr(t);an(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function tF(t){return t.nodeType===t.ELEMENT_NODE}function nF(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 tv(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var rF=Kj,oR=Qj,aR=Zj,lR=Xj,cR=eR,uR=nR,dR=Kw;function hR(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=hR(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function fR(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=hR(t))&&(r&&(r+=" "),r+=e);return r}const yE=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,vE=fR,Bh=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return vE(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 d=n==null?void 0:n[c],h=i==null?void 0:i[c];if(d===null)return null;const f=yE(d)||yE(h);return s[c][f]}),a=n&&Object.entries(n).reduce((c,d)=>{let[h,f]=d;return f===void 0||(c[h]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(g=>{let[m,y]=g;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...c,h,f]:c},[]);return vE(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const sF=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pR=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var iF={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"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const oF=b.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>b.createElement("svg",{ref:l,...iF,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:pR("lucide",s),...a},[...o.map(([c,d])=>b.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const de=(t,e)=>{const n=b.forwardRef(({className:r,...s},i)=>b.createElement(oF,{ref:i,iconNode:e,className:pR(`lucide-${sF(t)}`,r),...s}));return n.displayName=`${t}`,n};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const Gs=de("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const Pt=de("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const aF=de("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const lF=de("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"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const bl=de("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const cF=de("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const Jw=de("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const Qw=de("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const uF=de("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const dF=de("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const hF=de("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"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const eh=de("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const fF=de("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const Bo=de("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const pF=de("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const nv=de("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"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const mF=de("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"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const gF=de("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const Kp=de("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const yF=de("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const vF=de("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const xF=de("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"}
170]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const bF=de("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"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const qo=de("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const wF=de("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const kF=de("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const SF=de("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"}]]);/**
196 * @license lucide-react v0.462.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const Zc=de("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
201 * @license lucide-react v0.462.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const mR=de("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
206 * @license lucide-react v0.462.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const EF=de("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
211 * @license lucide-react v0.462.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const CF=de("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"}]]);/**
216 * @license lucide-react v0.462.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const NF=de("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"}]]);/**
221 * @license lucide-react v0.462.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const gs=de("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const _F=de("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const TF=de("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"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const Yw=de("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"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const Jp=de("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const yu=de("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const AF=de("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const jF=de("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const RF=de("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"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const MF=de("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const Xc=de("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const xE=de("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const OF=de("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"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const PF=de("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"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const IF=de("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"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const DF=de("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
300kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const LF=de("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const gR=de("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const rv=de("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const zF=de("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const $F=de("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const jg=de("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const FF=de("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const yR=de("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const BF=de("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const qF=de("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}
vendor: 10,220 bytes, lines 350-375
350],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const UF=de("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"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const VF=de("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const HF=de("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const Ks=de("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const vR=de("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Zw="-",WF=t=>{const e=KF(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(Zw);return a[0]===""&&a.length!==1&&a.shift(),xR(a,e)||GF(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},xR=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?xR(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(Zw);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},bE=/^\[(.+)\]$/,GF=t=>{if(bE.test(t)){const e=bE.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},KF=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return QF(Object.entries(t.classGroups),n).forEach(([i,o])=>{fb(o,r,i,e)}),r},fb=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:wE(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(JF(s)){fb(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{fb(o,wE(e,i),n,r)})})},wE=(t,e)=>{let n=t;return e.split(Zw).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},JF=t=>t.isThemeGetter,QF=(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)}}},bR="!",ZF=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let c=0,d=0,h;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(d,y)),d=y+i;continue}if(v==="/"){h=y;continue}}v==="["?c++:v==="]"&&c--}const f=l.length===0?a:a.substring(d),p=f.startsWith(bR),g=p?f.substring(1):f,m=h&&h>d?h-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:o}):o},XF=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},eB=t=>({cache:YF(t.cacheSize),parseClassName:ZF(t),...WF(t)}),tB=/\s+/,nB=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(tB);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let g=!!p,m=r(g?f.substring(0,p):f);if(!m){if(!g){a=c+(a.length>0?" "+a:a);continue}if(m=r(f),!m){a=c+(a.length>0?" "+a:a);continue}g=!1}const y=XF(d).join(":"),v=h?y+bR:y,x=v+m;if(i.includes(x))continue;i.push(x);const w=s(m,g);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 rB(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=wR(e))&&(r&&(r+=" "),r+=n);return r}const wR=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=wR(t[r]))&&(n&&(n+=" "),n+=e);return n};function sB(t,...e){let n,r,s,i=o;function o(l){const c=e.reduce((d,h)=>h(d),t());return n=eB(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 d=nB(l,n);return s(l,d),d}return function(){return i(rB.apply(null,arguments))}}const ht=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},kR=/^\[(?:([a-z-]+):)?(.+)\]$/i,iB=/^\d+\/\d+$/,oB=new Set(["px","full","screen"]),aB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lB=/\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$/,cB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,uB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,si=t=>Sc(t)||oB.has(t)||iB.test(t),$i=t=>vu(t,"length",xB),Sc=t=>!!t&&!Number.isNaN(Number(t)),sv=t=>vu(t,"number",Sc),zu=t=>!!t&&Number.isInteger(Number(t)),hB=t=>t.endsWith("%")&&Sc(t.slice(0,-1)),De=t=>kR.test(t),Fi=t=>aB.test(t),fB=new Set(["length","size","percentage"]),pB=t=>vu(t,fB,SR),mB=t=>vu(t,"position",SR),gB=new Set(["image","url"]),yB=t=>vu(t,gB,wB),vB=t=>vu(t,"",bB),$u=()=>!0,vu=(t,e,n)=>{const r=kR.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},xB=t=>lB.test(t)&&!cB.test(t),SR=()=>!1,bB=t=>uB.test(t),wB=t=>dB.test(t),kB=()=>{const t=ht("colors"),e=ht("spacing"),n=ht("blur"),r=ht("brightness"),s=ht("borderColor"),i=ht("borderRadius"),o=ht("borderSpacing"),a=ht("borderWidth"),l=ht("contrast"),c=ht("grayscale"),d=ht("hueRotate"),h=ht("invert"),f=ht("gap"),p=ht("gradientColorStops"),g=ht("gradientColorStopPositions"),m=ht("inset"),y=ht("margin"),v=ht("opacity"),x=ht("padding"),w=ht("saturate"),k=ht("scale"),S=ht("sepia"),E=ht("skew"),C=ht("space"),N=ht("translate"),T=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",De,e],A=()=>[De,e],L=()=>["",si,$i],I=()=>["auto",Sc,De],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",De],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[Sc,De];return{cacheSize:500,separator:":",theme:{colors:[$u],spacing:[si,$i],blur:["none","",Fi,De],brightness:re(),borderColor:[t],borderRadius:["none","","full",Fi,De],borderSpacing:A(),borderWidth:L(),contrast:re(),grayscale:z(),hueRotate:re(),invert:z(),gap:A(),gradientColorStops:[t],gradientColorStopPositions:[hB,$i],inset:D(),margin:D(),opacity:re(),padding:A(),saturate:re(),scale:re(),sepia:z(),skew:re(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",De]}],container:["container"],columns:[{columns:[Fi]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),De]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",zu,De]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",De]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",zu,De]}],"grid-cols":[{"grid-cols":[$u]}],"col-start-end":[{col:["auto",{span:["full",zu,De]},De]}],"col-start":[{"col-start":I()}
vendor: 9,422 bytes, line 375
375],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[$u]}],"row-start-end":[{row:["auto",{span:[zu,De]},De]}],"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",De]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",De]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],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":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",De,e]}],"min-w":[{"min-w":[De,e,"min","max","fit"]}],"max-w":[{"max-w":[De,e,"none","full","min","max","fit","prose",{screen:[Fi]},Fi]}],h:[{h:[De,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[De,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[De,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[De,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Fi,$i]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",sv]}],"font-family":[{font:[$u]}],"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",De]}],"line-clamp":[{"line-clamp":["none",Sc,sv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",si,De]}],"list-image":[{"list-image":["none",De]}],"list-style-type":[{list:["none","disc","decimal",De]}],"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:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",si,$i]}],"underline-offset":[{"underline-offset":["auto",si,De]}],"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:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De]}],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",De]}],"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:[...U(),mB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yB]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[...B(),"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:B()}],"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:["",...B()]}],"outline-offset":[{"outline-offset":[si,De]}],"outline-w":[{outline:[si,$i]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[si,$i]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Fi,vB]}],"shadow-color":[{shadow:[$u]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Fi,De]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],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":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"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",De]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",De]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",De]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[zu,De]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",De]}],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",De]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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,642 bytes, line 375
375],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",De]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[si,$i,sv]}],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"]}}},SB=sB(kB);function Z(...t){return SB(fR(t))}const EB=rF,ER=b.forwardRef(({className:t,...e},n)=>u.jsx(oR,{ref:n,className:Z("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}));ER.displayName=oR.displayName;const CB=Bh("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"}}),CR=b.forwardRef(({className:t,variant:e,...n},r)=>u.jsx(aR,{ref:r,className:Z(CB({variant:e}),t),...n}));CR.displayName=aR.displayName;const NB=b.forwardRef(({className:t,...e},n)=>u.jsx(uR,{ref:n,className:Z("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}));NB.displayName=uR.displayName;const NR=b.forwardRef(({className:t,...e},n)=>u.jsx(dR,{ref:n,className:Z("absolute right-2 top-2 rounded-md p-1 text-foreground
375/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:u.jsx(vR,{className:"h-4 w-4"})}));NR.displayName=dR.displayName;const _R=b.forwardRef(({className:t,...e},n)=>u.jsx(lR,{ref:n,className:Z("text-sm font-semibold",t),...e}));_R.displayName=lR.displayName;const TR=b.forwardRef(({className:t,...e},n)=>u.jsx(cR,{ref:n,className:Z("text-sm opacity-90",t),...e}));TR.displayName=cR.displayName;function _B(){const{toasts:t}=Lh();return u.jsxs(EB,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return u.jsxs(CR,{...i,children:[u.jsxs("div",{className:"grid gap-1",children:[n&&u.jsx(_R,{children:n}),r&&u.jsx(TR,{children:r})]}),s,u.jsx(NR,{})]},e)}),u.jsx(ER,{})]})}var kE=["light","dark"],TB="(prefers-color-scheme: dark)",AB=b.createContext(void 0),jB={setTheme:t=>{},themes:[]},RB=()=>{var t;return(t=b.useContext(AB))!=null?t:jB};b.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let c=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=s?kE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(g,m=!1,y=!0)=>{let v=o?o[g]:g,x=m?g+"|| ''":`'${v}'`,w="";return s&&y&&!m&&kE.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?m||v?w+=`c.add(${x})`:w+="null":v&&(w+=`d[s](n,${x})`),w},p=t?`!function(){${d}${f(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${TB}',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)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${h}}catch(t){}}();`;return b.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var MB=t=>{switch(t){case"success":return IB;case"info":return LB;case"warning":return DB;case"error":return zB;default:return null}},OB=Array(12).fill(0),PB=({visible:t,className:e})=>F.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},F.createElement("div",{className:"sonner-spinner"},OB.map((n,r)=>F.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),IB=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),DB=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},F.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"})),LB=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),zB=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.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"})),$B=F.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"},F.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),F.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),FB=()=>{let[t,e]=F.useState(document.hidden);return F.useEffect(()=>{let n=()=>{e(document.hidden)};
375return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},pb=1,BB=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:pb++,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],F.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(UB(l)&&!l.ok){s=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:c,description:d})}else if(e.success!==void 0){s=!1;let c=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:c,description:d})}}).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,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:c,description:d})}}).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)||pb++;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}},rr=new BB,qB=(t,e)=>{let n=(e==null?void 0:e.id)||pb++;return rr.addToast({title:t,...e,id:n}),n},UB=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",VB=qB,HB=()=>rr.toasts,WB=()=>rr.getActiveToasts(),SE=Object.assign(VB,{success:rr.success,info:rr.info,warning:rr.warning,error:rr.error,custom:rr.custom,message:rr.message,promise:rr.promise,dismiss:rr.dismiss,loading:rr.loading},{getHistory:HB,getToasts:WB});function GB(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))}GB(`: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;
375left: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}
375: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%);
375--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%)}
376`);function wf(t){return t.label!==void 0}var KB=3,JB="32px",QB="16px",EE=4e3,YB=356,ZB=14,XB=20,e5=200;function Yr(...t){return t.filter(Boolean).join(" ")}function t5(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var n5=t=>{var e,n,r,s,i,o,a,l,c,d,h;let{invert:f,toast:p,unstyled:g,interacting:m,setHeights:y,visibleToasts:v,heights:x,index:w,toasts:k,expanded:S,removeToast:E,defaultRichColors:C,closeButton:N,style:T,cancelButtonStyle:M,actionButtonStyle:D,className:A="",descriptionClassName:L="",duration:I,position:U,gap:B,loadingIcon:J,expandByDefault:P,classNames:z,icons:Q,closeButtonAriaLabel:re="Close toast",pauseWhenPageIsHidden:ce}=t,[ae,Ce]=F.useState(null),[we,Ge]=F.useState(null),[Y,Pe]=F.useState(!1),[Xe,Ie]=F.useState(!1),[pe,Le]=F.useState(!1),[at,vt]=F.useState(!1),[X,it]=F.useState(!1),[ln,zt]=F.useState(0),[cn,_]=F.useState(0),O=F.useRef(p.duration||I||EE),$=F.useRef(null),ee=F.useRef(null),te=w===0,W=w+1<=v,ne=p.type,Ae=p.dismissible!==!1,Qe=p.className||"",un=p.descriptionClassName||"",Tr=F.useMemo(()=>x.findIndex(je=>je.toastId===p.id)||0,[x,p.id]),Kn=F.useMemo(()=>{var je;return(je=p.closeButton)!=null?je:N},[p.closeButton,N]),ia=F.useMemo(()=>p.duration||I||EE,[p.duration,I]),Ar=F.useRef(0),Mn=F.useRef(0),Jn=F.useRef(0),wn=F.useRef(null),[oa,Li]=U.split("-"),Zh=F.useMemo(()=>x.reduce((je,Te,et)=>et>=Tr?je:je+Te.height,0),[x,Tr]),aa=FB(),Cl=p.invert||f,_u=ne==="loading";Mn.current=F.useMemo(()=>Tr*B+Zh,[Tr,Zh]),F.useEffect(()=>{O.current=ia},[ia]),F.useEffect(()=>{Pe(!0)},[]),F.useEffect(()=>{let je=ee.current;if(je){let Te=je.getBoundingClientRect().height;return _(Te),y(et=>[{toastId:p.id,height:Te,position:p.position},...et]),()=>y(et=>et.filter(hr=>hr.toastId!==p.id))}},[y,p.id]),F.useLayoutEffect(()=>{if(!Y)return;let je=ee.current,Te=je.style.height;je.style.height="auto";let et=je.getBoundingClientRect().height;je.style.height=Te,_(et),y(hr=>hr.find(Yn=>Yn.toastId===p.id)?hr.map(Yn=>Yn.toastId===p.id?{...Yn,height:et}:Yn):[{toastId:p.id,height:et,position:p.position},...hr])},[Y,p.title,p.description,y,p.id]);let Qn=F.useCallback(()=>{Ie(!0),zt(Mn.current),y(je=>je.filter(Te=>Te.toastId!==p.id)),setTimeout(()=>{E(p)},e5)},[p,E,y,Mn]);F.useEffect(()=>{if(p.promise&&ne==="loading"||p.duration===1/0||p.type==="loading")return;let je;return S||m||ce&&aa?(()=>{if(Jn.current<Ar.current){let Te=new Date().getTime()-Ar.current;O.current=O.current-Te}
376Jn.current=new Date().getTime()})():O.current!==1/0&&(Ar.current=new Date().getTime(),je=setTimeout(()=>{var Te;(Te=p.onAutoClose)==null||Te.call(p,p),Qn()},O.current)),()=>clearTimeout(je)},[S,m,p,ne,ce,aa,Qn]),F.useEffect(()=>{p.delete&&Qn()},[Qn,p.delete]);function by(){var je,Te,et;return Q!=null&&Q.loading?F.createElement("div",{className:Yr(z==null?void 0:z.loader,(je=p==null?void 0:p.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":ne==="loading"},Q.loading):J?F.createElement("div",{className:Yr(z==null?void 0:z.loader,(Te=p==null?void 0:p.classNames)==null?void 0:Te.loader,"sonner-loader"),"data-visible":ne==="loading"},J):F.createElement(PB,{className:Yr(z==null?void 0:z.loader,(et=p==null?void 0:p.classNames)==null?void 0:et.loader),visible:ne==="loading"})}return F.createElement("li",{tabIndex:0,ref:ee,className:Yr(A,Qe,z==null?void 0:z.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,z==null?void 0:z.default,z==null?void 0:z[ne],(n=p==null?void 0:p.classNames)==null?void 0:n[ne]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:C,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":Y,"data-promise":!!p.promise,"data-swiped":X,"data-removed":Xe,"data-visible":W,"data-y-position":oa,"data-x-position":Li,"data-index":w,"data-front":te,"data-swiping":pe,"data-dismissible":Ae,"data-type":ne,"data-invert":Cl,"data-swipe-out":at,"data-swipe-direction":we,"data-expanded":!!(S||P&&Y),style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${Xe?ln:Mn.current}px`,"--initial-height":P?"auto":`${cn}px`,...T,...p.style},onDragEnd:()=>{Le(!1),Ce(null),wn.current=null},onPointerDown:je=>{_u||!Ae||($.current=new Date,zt(Mn.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(Le(!0),wn.current={x:je.clientX,y:je.clientY}))},onPointerUp:()=>{var je,Te,et,hr;if(at||!Ae)return;wn.current=null;let Yn=Number(((je=ee.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),jr=Number(((Te=ee.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Es=new Date().getTime()-((et=$.current)==null?void 0:et.getTime()),Zn=ae==="x"?Yn:jr,Cs=Math.abs(Zn)/Es;if(Math.abs(Zn)>=XB||Cs>.11){zt(Mn.current),(hr=p.onDismiss)==null||hr.call(p,p),Ge(ae==="x"?Yn>0?"right":"left":jr>0?"down":"up"),Qn(),vt(!0),it(!1);return}Le(!1),Ce(null)},onPointerMove:je=>{var Te,et,hr,Yn;if(!wn.current||!Ae||((Te=window.getSelection())==null?void 0:Te.toString().length)>0)return;let jr=je.clientY-wn.current.y,Es=je.clientX-wn.current.x,Zn=(et=t.swipeDirections)!=null?et:t5(U);!ae&&(Math.abs(Es)>1||Math.abs(jr)>1)&&Ce(Math.abs(Es)>Math.abs(jr)?"x":"y");let Cs={x:0,y:0};ae==="y"?(Zn.includes("top")||Zn.includes("bottom"))&&(Zn.includes("top")&&jr<0||Zn.includes("bottom")&&jr>0)&&(Cs.y=jr):ae==="x"&&(Zn.includes("left")||Zn.includes("right"))&&(Zn.includes("left")&&Es<0||Zn.includes("right")&&Es>0)&&(Cs.x=Es),(Math.abs(Cs.x)>0||Math.abs(Cs.y)>0)&&it(!0),(hr=ee.current)==null||hr.style.setProperty("--swipe-amount-x",`${Cs.x}px`),(Yn=ee.current)==null||Yn.style.setProperty("--swipe-amount-y",`${Cs.y}px`)}},Kn&&!p.jsx?F.createElement("button",{"aria-label":re,"data-disabled":_u,"data-close-button":!0,onClick:_u||!Ae?(
vendor: 5,101 bytes, line 376
376)=>{}:()=>{var je;Qn(),(je=p.onDismiss)==null||je.call(p,p)},className:Yr(z==null?void 0:z.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(i=Q==null?void 0:Q.close)!=null?i:$B):null,p.jsx||b.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:F.createElement(F.Fragment,null,ne||p.icon||p.promise?F.createElement("div",{"data-icon":"",className:Yr(z==null?void 0:z.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||by():null,p.type!=="loading"?p.icon||(Q==null?void 0:Q[ne])||MB(ne):null):null,F.createElement("div",{"data-content":"",className:Yr(z==null?void 0:z.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},F.createElement("div",{"data-title":"",className:Yr(z==null?void 0:z.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?F.createElement("div",{"data-description":"",className:Yr(L,un,z==null?void 0:z.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),b.isValidElement(p.cancel)?p.cancel:p.cancel&&wf(p.cancel)?F.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||M,onClick:je=>{var Te,et;wf(p.cancel)&&Ae&&((et=(Te=p.cancel).onClick)==null||et.call(Te,je),Qn())},className:Yr(z==null?void 0:z.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,b.isValidElement(p.action)?p.action:p.action&&wf(p.action)?F.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||D,onClick:je=>{var Te,et;wf(p.action)&&((et=(Te=p.action).onClick)==null||et.call(Te,je),!je.defaultPrevented&&Qn())},className:Yr(z==null?void 0:z.actionButton,(h=p==null?void 0:p.classNames)==null?void 0:h.actionButton)},p.action.label):null))};function CE(){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 r5(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?QB:JB;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=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 s5=b.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:d="light",richColors:h,duration:f,style:p,visibleToasts:g=KB,toastOptions:m,dir:y=CE(),gap:v=ZB,loadingIcon:x,icons:w,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:S}=t,[E,C]=F.useState([]),N=F.useMemo(()=>Array.from(new Set([r].concat(E.filter(ce=>ce.position).map(ce=>ce.position)))),[E,r]),[T,M]=F.useState([]),[D,A]=F.useState(!1),[L,I]=F.useState(!1),[U,B]=F.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=F.useRef(null),P=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=F.useRef(null),Q=F.useRef(!1),re=F.useCallback(ce=>{C(ae=>{var Ce;return(Ce=ae.find(we=>we.id===ce.id))!=null&&Ce.delete||rr.dismiss(ce.id),ae.filter(({id:we})=>we!==ce.id)})},[]);return F.useEffect(()=>rr.subscribe(ce=>{if(ce.dismiss){C(ae=>ae.map(Ce=>Ce.id===ce.id?{...Ce,delete:!0}:Ce));return}setTimeout(()=>{Vw.flushSync(()=>{C(ae=>{let Ce=ae.findIndex(we=>we.id===ce.id);return Ce!==-1?[...ae.slice(0,Ce),{...ae[Ce],...ce},...ae.slice(Ce+1)]:[ce,...ae]})})})}),[]),F.useEffect(()=>{if(d!=="system"){B(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;let ce=window.matchMedia("(prefers-color-scheme: dark)");try{ce.addEventListener("change",({matches:ae})=>{B(ae?"dark":"light")})}catch{ce.addListener(({matches:Ce})=>{try{B(Ce?"dark":"light")}catch(we){console.error(we)}})}},[d]),F.useEffect(()=>{E.length<=1&&A(!1)},[E]),F.useEffect(()=>{let ce=ae=>{var Ce,we;s.every(Ge=>ae[Ge]||ae.code===Ge)&&(A(!0),(Ce=J.current)==null||Ce.focus()),ae.code==="Escape"&&(document.activeElement===J.current||(we=J.current)!=null&&we.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",ce),()=>document.removeEventListener("keydown",ce)},[s]),F.useEffect(()=>{if(J.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,Q.current=!1)}},[J.current]),F.createElement("section",{ref:e,"aria-label":`${k} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((ce,ae)=>{var Ce;let[we,Ge]=ce.split("-");return E.length?F.createElement("ol",{key:ce,dir:y==="auto"?CE():y,tabIndex:-1,ref:J,className:a,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":we,"data-lifted":D&&E.length>
vendor: 4,255 bytes, line 376
3761&&!i,"data-x-position":Ge,style:{"--front-toast-height":`${((Ce=T[0])==null?void 0:Ce.height)||0}px`,"--width":`${YB}px`,"--gap":`${v}px`,...p,...r5(l,c)},onBlur:Y=>{Q.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(Q.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,z.current=Y.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{L||A(!1)},onDragEnd:()=>A(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},E.filter(Y=>!Y.position&&ae===0||Y.position===ce).map((Y,Pe)=>{var Xe,Ie;return F.createElement(n5,{key:Y.id,icons:w,index:Pe,toast:Y,defaultRichColors:h,duration:(Xe=m==null?void 0:m.duration)!=null?Xe:f,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:g,closeButton:(Ie=m==null?void 0:m.closeButton)!=null?Ie:o,interacting:L,position:ce,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:re,toasts:E.filter(pe=>pe.position==Y.position),heights:T.filter(pe=>pe.position==Y.position),setHeights:M,expandByDefault:i,gap:v,loadingIcon:x,expanded:D,pauseWhenPageIsHidden:S,swipeDirections:t.swipeDirections})})):null}))});const i5=({...t})=>{const{theme:e="system"}=RB();return u.jsx(s5,{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})};var o5=X0[" useId ".trim().toString()]||(()=>{}),a5=0;function Vs(t){const[e,n]=b.useState(o5());return an(()=>{n(r=>r??String(a5++))},[t]),e?`radix-${e}`:""}const l5=["top","right","bottom","left"],Uo=Math.min,gr=Math.max,Qp=Math.round,kf=Math.floor,Hs=t=>({x:t,y:t}),c5={left:"right",right:"left",bottom:"top",top:"bottom"},u5={start:"end",end:"start"};function mb(t,e,n){return gr(t,Uo(e,n))}function Ai(t,e){return typeof t=="function"?t(e):t}function ji(t){return t.split("-")[0]}function xu(t){return t.split("-")[1]}function Xw(t){return t==="x"?"y":"x"}function ek(t){return t==="y"?"height":"width"}const d5=new Set(["top","bottom"]);function Fs(t){return d5.has(ji(t))?"y":"x"}function tk(t){return Xw(Fs(t))}function h5(t,e,n){n===void 0&&(n=!1);const r=xu(t),s=tk(t),i=ek(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Yp(o)),[o,Yp(o)]}function f5(t){const e=Yp(t);return[gb(t),e,gb(e)]}function gb(t){return t.replace(/start|end/g,e=>u5[e])}const NE=["left","right"],_E=["right","left"],p5=["top","bottom"],m5=["bottom","top"];function g5(t,e,n){switch(t){case"top":case"bottom":return n?e?_E:NE:e?NE:_E;case"left":case"right":return e?p5:m5;default:return[]}}function y5(t,e,n,r){const s=xu(t);let i=g5(ji(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(gb)))),i}function Yp(t){return t.replace(/left|right|bottom|top/g,e=>c5[e])}function v5(t){return{top:0,right:0,bottom:0,left:0,...t}}function AR(t){return typeof t!="number"?v5(t):{top:t,right:t,bottom:t,left:t}}function Zp(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 TE(t,e,n){let{reference:r,floating:s}=t;const i=Fs(e),o=tk(e),a=ek(o),l=ji(e),c=i==="y",d=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-s.width,y:h};break;default:p={x:r.x,y:r.y}}switch(xu(e)){case"start":p[o]-=f*(n&&c?-1:1);break;case"end":p[o]+=f*(n&&c?-1:1);break}return p}const x5=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}
vendor: 17,325 bytes, line 376
376=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:d,y:h}=TE(c,r,l),f=r,p={},g=0;for(let m=0;m<a.length;m++){const{name:y,fn:v}=a[m],{x,y:w,data:k,reset:S}=await v({x:d,y:h,initialPlacement:r,placement:f,strategy:s,middlewareData:p,rects:c,platform:o,elements:{reference:t,floating:e}});d=x??d,h=w??h,p={...p,[y]:{...p[y],...k}},S&&g<=50&&(g++,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:d,y:h}=TE(c,f,l)),m=-1)}return{x:d,y:h,placement:f,strategy:s,middlewareData:p}};async function th(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:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=Ai(e,t),g=AR(p),y=a[f?h==="floating"?"reference":"floating":h],v=Zp(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:d,strategy:l})),x=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),k=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},S=Zp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(v.top-S.top+g.top)/k.y,bottom:(S.bottom-v.bottom+g.bottom)/k.y,left:(v.left-S.left+g.left)/k.x,right:(S.right-v.right+g.right)/k.x}}const b5=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:d=0}=Ai(t,e)||{};if(c==null)return{};const h=AR(d),f={x:n,y:r},p=tk(s),g=ek(p),m=await o.getDimensions(c),y=p==="y",v=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",k=i.reference[g]+i.reference[p]-f[p]-i.floating[g],S=f[p]-i.reference[p],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let C=E?E[w]:0;(!C||!await(o.isElement==null?void 0:o.isElement(E)))&&(C=a.floating[w]||i.floating[g]);const N=k/2-S/2,T=C/2-m[g]/2-1,M=Uo(h[v],T),D=Uo(h[x],T),A=M,L=C-m[g]-D,I=C/2-m[g]/2+N,U=mb(A,I,L),B=!l.arrow&&xu(s)!=null&&I!==U&&i.reference[g]/2-(I<A?M:D)-m[g]/2<0,J=B?I<A?I-A:I-L:0;return{[p]:f[p]+J,data:{[p]:U,centerOffset:I-U-J,...B&&{alignmentOffset:J}},reset:B}}}),w5=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:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...y}=Ai(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=ji(s),x=Fs(a),w=ji(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(w||!m?[Yp(a)]:f5(a)),E=g!=="none";!f&&E&&S.push(...y5(a,m,g,k));const C=[a,...S],N=await th(e,y),T=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&T.push(N[v]),h){const I=h5(s,o,k);T.push(N[I[0]],N[I[1]])}if(M=[...M,{placement:s,overflows:T}],!T.every(I=>I<=0)){var D,A;const I=(((D=i.flip)==null?void 0:D.index)||0)+1,U=C[I];if(U&&(!(h==="alignment"?x!==Fs(U):!1)||M.every(P=>P.overflows[0]>0&&Fs(P.placement)===x)))return{data:{index:I,overflows:M},reset:{placement:U}};let B=(A=M.filter(J=>J.overflows[0]<=0).sort((J,P)=>J.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!B)switch(p){case"bestFit":{var L;const J=(L=M.filter(P=>{if(E){const z=Fs(P.placement);return z===x||z==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(z=>z>0).reduce((z,Q)=>z+Q,0)]).sort((P,z)=>P[1]-z[1])[0])==null?void 0:L[0];J&&(B=J);break}case"initialPlacement":B=a;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function AE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function jE(t){return l5.some(e=>t[e]>=0)}const k5=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=Ai(t,e);switch(r){case"referenceHidden":{const i=await th(e,{...s,elementContext:"reference"}),o=AE(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:jE(o)}}}case"escaped":{const i=await th(e,{...s,altBoundary:!0}),o=AE(i,n.floating);return{data:{escapedOffsets:o,escaped:jE(o)}}}default:return{}}}}},jR=new Set(["left","top"]);async function S5(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=ji(n),a=xu(n),l=Fs(n)==="y",c=jR.has(o)?-1:1,d=i&&l?-1:1,h=Ai(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}const E5=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 S5(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}}}}},C5=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:x}=y;return{x:v,y:x}}},...l}=Ai(t,e),c={x:n,y:r},d=await th(e,l),h=Fs(ji(s)),f=Xw(h);let p=c[f],g=c[h];if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[y],w=p-d[v];p=mb(x,p,w)}if(o){const y=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=g+d[y],w=g-d[v];g=mb(x,g,w)}const m=a.fn({...e,[f]:p,[h]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:i,[h]:o}}}}}},N5=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}=Ai(t,e),d={x:n,y:r},h=Fs(s),f=Xw(h);let p=d[f],g=d[h];const m=Ai(a,e),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};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;p<k?p=k:p>S&&(p=S)}if(c){var v,x;const w=f==="y"?"width":"height",k=jR.has(ji(s)),S=i.reference[h]-i.floating[w]+(k&&((v=o.offset)==null?void 0:v[h])||0)+(k?0:y.crossAxis),E=i.reference[h]+i.reference[w]+(k?0:((x=o.offset)==null?void 0:x[h])||0)-(k?y.crossAxis:0);g<S?g=S:g>E&&(g=E)}return{[f]:p,[h]:g}}}},_5=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}=Ai(t,e),d=await th(e,c),h=ji(s),f=xu(s),p=Fs(s)==="y",{width:g,height:m}=i.floating;let y,v;h==="top"||h==="bottom"?(y=h,v=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=h,y=f==="end"?"top":"bottom");const x=m-d.top-d.bottom,w=g-d.left-d.right,k=Uo(m-d[y],x),S=Uo(g-d[v],w),E=!e.middlewareData.shift;let C=k,N=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(N=w),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(C=x),E&&!f){const M=gr(d.left,0),D=gr(d.right,0),A=gr(d.top,0),L=gr(d.bottom,0);p?N=g-2*(M!==0||D!==0?M+D:gr(d.left,d.right)):C=m-2*(A!==0||L!==0?A+L:gr(d.top,d.bottom))}await l({...e,availableWidth:N,availableHeight:C});const T=await o.getDimensions(a.floating);return g!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function Rg(){return typeof window<"u"}function bu(t){return RR(t)?(t.nodeName||"").toLowerCase():"#document"}function kr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zs(t){var e;return(e=(RR(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function RR(t){return Rg()?t instanceof Node||t instanceof kr(t).Node:!1}function xs(t){return Rg()?t instanceof Element||t instanceof kr(t).Element:!1}function Js(t){return Rg()?t instanceof HTMLElement||t instanceof kr(t).HTMLElement:!1}function RE(t){return!Rg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof kr(t).ShadowRoot}const T5=new Set(["inline","contents"]);function qh(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=bs(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!T5.has(s)}const A5=new Set(["table","td","th"]);function j5(t){return A5.has(bu(t))}const R5=[":popover-open",":modal"];function Mg(t){return R5.some(e=>{try{return t.matches(e)}catch{return!1}})}const M5=["transform","translate","scale","rotate","perspective"],O5=["transform","translate","scale","rotate","perspective","filter"],P5=["paint","layout","strict","content"];function nk(t){const e=rk(),n=xs(t)?bs(t):t;return M5.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)||O5.some(r=>(n.willChange||"").includes(r))||P5.some(r=>(n.contain||"").includes(r))}function I5(t){let e=Vo(t);for(;Js(e)&&!eu(e);){if(nk(e))return e;if(Mg(e))return null;e=Vo(e)}return null}function rk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const D5=new Set(["html","body","#document"]);function eu(t){return D5.has(bu(t))}function bs(t){return kr(t).getComputedStyle(t)}function Og(t){return xs(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Vo(t){if(bu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||RE(t)&&t.host||Zs(t);return RE(e)?e.host:e}function MR(t){const e=Vo(t);return eu(e)?t.ownerDocument?t.ownerDocument.body:t.body:Js(e)&&qh(e)?e:MR(e)}function nh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=MR(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=kr(s);if(i){const a=yb(o);return e.concat(o,o.visualViewport||[],qh(s)?s:[],a&&n?nh(a):[])}return e.concat(s,nh(s,[],n))}function yb(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function OR(t){const e=bs(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Js(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=Qp(n)!==i||Qp(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function sk(t){return xs(t)?t:t.contextElement}function Ec(t){const e=sk(t);if(!Js(e))return Hs(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=OR(e);let o=(i?Qp(n.width):n.width)/r,a=(i?Qp(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const L5=Hs(0);function PR(t){const e=kr(t);return!rk()||!e.visualViewport?L5:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function z5(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==kr(t)?!1:e}function el(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=sk(t);let o=Hs(1);e&&(r?xs(r)&&(o=Ec(r)):o=Ec(t));const a=z5(i,n,r)?PR(i):Hs(0);let l=(s.left+a.x)/o.x,c=(s.top+a.y)/o.y,d=s.width/o.x,h=s.height/o.y;if(i){const f=kr(i),p=r&&xs(r)?kr(r):r;let g=f,m=yb(g);for(;m&&r&&p!==g;){const y=Ec(m),v=m.getBoundingClientRect(),x=bs(m),w=v.left+(m.clientLeft+parseFloat(x.paddingLeft))*y.x,k=v.top+(m.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,d*=y.x,h*=y.y,l+=w,c+=k,g=kr(m),m=yb(g)}}return Zp({width:d,height:h,x:l,y:c})}function ik(t,e){const n=Og(t).scrollLeft;return e?e.left+n:el(Zs(t)).left+n}function IR(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=r.left+e.scrollLeft-(n?0:ik(t,r)),i=r.top+e.scrollTop;return{x:s,y:i}}function $5(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Zs(r),a=e?Mg(e.floating):!1;if(r===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Hs(1);const d=Hs(0),h=Js(r);if((h||!h&&!i)&&((bu(r)!=="body"||qh(o))&&(l=Og(r)),Js(r))){const p=el(r);c=Ec(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const f=o&&!h&&!i?IR(o,l,!0):Hs(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}}function F5(t){return Array.from(t.getClientRects())}function B5(t){const e=Zs(t),n=Og(t),r=t.ownerDocument.body,s=gr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=gr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+ik(t);const a=-n.scrollTop;return bs(r).direction==="rtl"&&(o+=gr(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function q5(t,e){const n=kr(t),r=Zs(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=rk();(!c||c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}const U5=new Set(["absolute","fixed"]);function V5(t,e){const n=el(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Js(t)?Ec(t):Hs(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 ME(t,e,n){let r;if(e==="viewport")r=q5(t,n);else if(e==="document")r=B5(Zs(t));else if(xs(e))r=V5(e,n);else{const s=PR(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Zp(r)}function DR(t,e){const n=Vo(t);return n===e||!xs(n)||eu(n)?!1:bs(n).position==="fixed"||DR(n,e)}function H5(t,e){const n=e.get(t);if(n)return n;let r=nh(t,[],!1).filter(a=>xs(a)&&bu(a)!=="body"),s=null;const i=bs(t).position==="fixed";let o=i?Vo(t):t;for(;xs(o)&&!eu(o);){const a=bs(o),l=nk(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&U5.has(s.position)||qh(o)&&!l&&DR(t,o))?r=r.filter(d=>d!==o):s=a,o=Vo(o)}return e.set(t,r),r}function W5(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Mg(e)?[]:H5(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,d)=>{const h=ME(e,d,s);return c.top=gr(h.top,c.top),c.right=Uo(h.right,c.right),c.bottom=Uo(h.bottom,c.bottom),c.left=gr(h.left,c.left),c},ME(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function G5(t){const{width:e,height:n}=OR(t);return{width:e,height:n}}function K5(t,e,n){const r=Js(e),s=Zs(e),i=n==="fixed",o=el(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=Hs(0);function c(){l.x=ik(s)}if(r||!r&&!i)if((bu(e)!=="body"||qh(s))&&(a=Og(e)),r){const p=el(e,!0,i,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else s&&c();i&&!r&&s&&c();const d=s&&!r&&!i?IR(s,a):Hs(0),h=o.left+a.scrollLeft-l.x-d.x,f=o.top+a.scrollTop-l.y-d.y;return{x:h,y:f,width:o.width,height:o.height}}function iv(t){return bs(t).position==="static"}function OE(t,e){if(!Js(t)||bs(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Zs(t)===n&&(n=n.ownerDocument.body),n}function LR(t,e){const n=kr(t);if(Mg(t))return n;if(!Js(t)){let s=Vo(t);for(;s&&!eu(s);){if(xs(s)&&!iv(s))return s;s=Vo(s)}return n}let r=OE(t,e);for(;r&&j5(r)&&iv(r);)r=OE(r,e);return r&&eu(r)&&iv(r)&&!nk(r)?n:r||I5(t)||n}const J5=async function(t){const e=this.getOffsetParent||LR,n=this.getDimensions,r=await n(t.floating);return{reference:K5(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Q5(t){return bs(t).direction==="rtl"}const Y5={convertOffsetParentRelativeRectToViewportRelativeRect:$5,getDocumentElement:Zs,getClippingRect:W5,getOffsetParent:LR,getElementRects:J5,getClientRects:F5,getDimensions:G5,getScale:Ec,isElement:xs,isRTL:Q5};function zR(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Z5(t,e){let n=null,r;const s=Zs(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:d,top:h,width:f,height:p}=c;if(a||e(),!f||!p)return;const g=kf(h),m=kf(s.clientWidth-(d+f)),y=kf(s.clientHeight-(h+p)),v=kf(d),w={rootMargin:-g+"px "+-m+"px "+-y+"px "+-v+"px",threshold:gr(0,Uo(1,l))||1};let k=!0;function S(E){const C=E[0].intersectionRatio;if(C!==l){if(!k)return o();C?o(!1,C):r=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!zR(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 X5(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=sk(t),d=s||i?[...c?nh(c):[],...nh(e)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const h=c&&a?Z5(c,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let g,m=l?el(t):null;l&&y();function y(){const v=el(t);m&&!zR(m,v)&&n(),m=v,g=requestAnimationFrame(y)}return n(),()=>{var v;d.forEach(x=>{s&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),h==null||h(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const eq=E5,tq=C5,nq=w5,rq=_5,sq=k5,PE=b5,iq=N5,oq=(t,e,n)=>{const r=new Map,s={platform:Y5,...n},i={...s.platform,_c:r};return x5(t,e,{...s,platform:i})};var aq=typeof document<"u",lq=function(){},up=aq?b.useLayoutEffect:lq;function Xp(t,e){if(t===e)return!0;
vendor: 14,202 bytes, line 376
376if(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(!Xp(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)&&!Xp(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function $R(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function IE(t,e){const n=$R(t);return Math.round(e*n)/n}function ov(t){const e=b.useRef(t);return up(()=>{e.current=t}),e}function cq(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,[d,h]=b.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);Xp(f,r)||p(r);const[g,m]=b.useState(null),[y,v]=b.useState(null),x=b.useCallback(P=>{P!==E.current&&(E.current=P,m(P))},[]),w=b.useCallback(P=>{P!==C.current&&(C.current=P,v(P))},[]),k=i||g,S=o||y,E=b.useRef(null),C=b.useRef(null),N=b.useRef(d),T=l!=null,M=ov(l),D=ov(s),A=ov(c),L=b.useCallback(()=>{if(!E.current||!C.current)return;const P={placement:e,strategy:n,middleware:f};D.current&&(P.platform=D.current),oq(E.current,C.current,P).then(z=>{const Q={...z,isPositioned:A.current!==!1};I.current&&!Xp(N.current,Q)&&(N.current=Q,xl.flushSync(()=>{h(Q)}))})},[f,e,n,D,A]);up(()=>{c===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[c]);const I=b.useRef(!1);up(()=>(I.current=!0,()=>{I.current=!1}),[]),up(()=>{if(k&&(E.current=k),S&&(C.current=S),k&&S){if(M.current)return M.current(k,S,L);L()}},[k,S,L,M,T]);const U=b.useMemo(()=>({reference:E,floating:C,setReference:x,setFloating:w}),[x,w]),B=b.useMemo(()=>({reference:k,floating:S}),[k,S]),J=b.useMemo(()=>{const P={position:n,left:0,top:0};if(!B.floating)return P;const z=IE(B.floating,d.x),Q=IE(B.floating,d.y);return a?{...P,transform:"translate("+z+"px, "+Q+"px)",...$R(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:Q}},[n,a,B.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:L,refs:U,elements:B,floatingStyles:J}),[d,L,U,B,J])}const uq=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?PE({element:r.current,padding:s}).fn(n):{}:r?PE({element:r,padding:s}).fn(n):{}}}},dq=(t,e)=>({...eq(t),options:[t,e]}),hq=(t,e)=>({...tq(t),options:[t,e]}),fq=(t,e)=>({...iq(t),options:[t,e]}),pq=(t,e)=>({...nq(t),options:[t,e]}),mq=(t,e)=>({...rq(t),options:[t,e]}),gq=(t,e)=>({...sq(t),options:[t,e]}),yq=(t,e)=>({...uq(t),options:[t,e]});var vq="Arrow",FR=b.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return u.jsx(Ee.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});FR.displayName=vq;var xq=FR;function ok(t){const[e,n]=b.useState(void 0);return an(()=>{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 ak="Popper",[BR,Pg]=_r(ak),[bq,qR]=BR(ak),UR=t=>{const{__scopePopper:e,children:n}=t,[r,s]=b.useState(null);return u.jsx(bq,{scope:e,anchor:r,onAnchorChange:s,children:n})};UR.displayName=ak;var VR="PopperAnchor",HR=b.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=qR(VR,n),o=b.useRef(null),a=Ue(e,o);return b.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:u.jsx(Ee.div,{...s,ref:a})});HR.displayName=VR;var lk="PopperContent",[wq,kq]=BR(lk),WR=b.forwardRef((t,e)=>{var Y,Pe,Xe,Ie,pe,Le;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=t,y=qR(lk,n),[v,x]=b.useState(null),w=Ue(e,at=>x(at)),[k,S]=b.useState(null),E=ok(k),C=(E==null?void 0:E.width)??0,N=(E==null?void 0:E.height)??0,T=r+(i!=="center"?"-"+i:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(c)?c:[c],A=D.length>0,L={padding:M,boundary:D.filter(Eq),altBoundary:A},{refs:I,floatingStyles:U,placement:B,isPositioned:J,middlewareData:P}=cq({strategy:"fixed",placement:T,whileElementsMounted:(...at)=>X5(...at,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[dq({mainAxis:s+N,alignmentAxis:o}),l&&hq({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?fq():void 0,...L}),l&&pq({...L}),mq({...L,apply:({elements:at,rects:vt,availableWidth:X,availableHeight:it})=>{const{width:ln,height:zt}=vt.reference,cn=at.floating.style;cn.setProperty("--radix-popper-available-width",`${X}px`),cn.setProperty("--radix-popper-available-height",`${it}px`),cn.setProperty("--radix-popper-anchor-width",`${ln}px`),cn.setProperty("--radix-popper-anchor-height",`${zt}px`)}}),k&&yq({element:k,padding:a}),Cq({arrowWidth:C,arrowHeight:N}),f&&gq({strategy:"referenceHidden",...L})]}),[z,Q]=JR(B),re=Gr(g);an(()=>{J&&(re==null||re())},[J,re]);const ce=(Y=P.arrow)==null?void 0:Y.x,ae=(Pe=P.arrow)==null?void 0:Pe.y,Ce=((Xe=P.arrow)==null?void 0:Xe.centerOffset)!==0,[we,Ge]=b.useState();return an(()=>{v&&Ge(window.getComputedStyle(v).zIndex)},[v]),u.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:J?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(Ie=P.transformOrigin)==null?void 0:Ie.x,(pe=P.transformOrigin)==null?void 0:pe.y].join(" "),...((Le=P.hide)==null?void 0:Le.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:u.jsx(wq,{scope:n,placedSide:z,onArrowChange:S,arrowX:ce,arrowY:ae,shouldHideArrow:Ce,children:u.jsx(Ee.div,{"data-side":z,"data-align":Q,...m,ref:w,style:{...m.style,animation:J?void 0:"none"}})})})});WR.displayName=lk;var GR="PopperArrow",Sq={top:"bottom",right:"left",bottom:"top",left:"right"},KR=b.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=kq(GR,r),o=Sq[i.placedSide];return u.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:u.jsx(xq,{...s,ref:n,style:{...s.style,display:"block"}})})});KR.displayName=GR;function Eq(t){return t!==null}var Cq=t=>({name:"transformOrigin",options:t,fn(e){var y,v,x;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,d]=JR(n),h={start:"0%",center:"50%",end:"100%"}[d],f=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,p=(((x=s.arrow)==null?void 0:x.y)??0)+l/2;let g="",m="";return c==="bottom"?(g=o?h:`${f}px`,m=`${-l}px`):c==="top"?(g=o?h:`${f}px`,m=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,m=o?h:`${p}px`):c==="left"&&(g=`${r.floating.width+l}px`,m=o?h:`${p}px`),{data:{x:g,y:m}}}});function JR(t){const[e,n="center"]=t.split("-");return[e,n]}var Nq=UR,QR=HR,YR=WR,ZR=KR,[Ig,sie]=_r("Tooltip",[Pg]),ck=Pg(),XR="TooltipProvider",_q=700,DE="tooltip.open",[Tq,eM]=Ig(XR),tM=t=>{const{__scopeTooltip:e,delayDuration:n=_q,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=b.useRef(!0),a=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),u.jsx(Tq,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(c=>{a.current=c},[]),disableHoverableContent:s,children:i})};tM.displayName=XR;var nM="Tooltip",[iie,Dg]=Ig(nM),vb="TooltipTrigger",Aq=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Dg(vb,n),i=eM(vb,n),o=ck(n),a=b.useRef(null),l=Ue(e,a,s.onTriggerChange),c=b.useRef(!1),d=b.useRef(!1),h=b.useCallback(()=>c.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(QR,{asChild:!0,...o,children:u.jsx(Ee.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:ge(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ge(t.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ge(t.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ge(t.onFocus,()=>{c.current||s.onOpen()}),onBlur:ge(t.onBlur,s.onClose),onClick:ge(t.onClick,s.onClose)})})});Aq.displayName=vb;var jq="TooltipPortal",[oie,Rq]=Ig(jq,{forceMount:void 0}),tu="TooltipContent",rM=b.forwardRef((t,e)=>{const n=Rq(tu,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=Dg(tu,t.__scopeTooltip);return u.jsx(Zo,{present:r||o.open,children:o.disableHoverableContent?u.jsx(sM,{side:s,...i,ref:e}):u.jsx(Mq,{side:s,...i,ref:e})})}),Mq=b.forwardRef((t,e)=>{const n=Dg(tu,t.__scopeTooltip),r=eM(tu,t.__scopeTooltip),s=b.useRef(null),i=Ue(e,s),[o,a]=b.useState(null),{trigger:l,onClose:c}=n,d=s.current,{onPointerInTransitChange:h}=r,f=b.useCallback(()=>{a(null),h(!1)},[h]),p=b.useCallback((g,m)=>{const y=g.currentTarget,v={x:g.clientX,y:g.clientY},x=Lq(v,y.getBoundingClientRect()),w=zq(v,x),k=$q(m.getBoundingClientRect()),S=Bq([...w,...k]);a(S),h(!0)},[h]);return b.useEffect(()=>()=>f(),[f]),b.useEffect(()=>{if(l&&d){const g=y=>p(y,d),m=y=>p(y,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",m)}}},[l,d,p,f]),b.useEffect(()=>{if(o){const g=m=>{const y=m.target,v={x:m.clientX,y:m.clientY},x=(l==null?void 0:l.contains(y))||(d==null?void 0:d.contains(y)),w=!Fq(v,o);x?f():w&&(f(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,o,c,f]),u.jsx(sM,{...t,ref:i})}),[Oq,Pq]=Ig(nM,{isInside:!1}),Iq=Bj("TooltipContent"),sM=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Dg(tu,n),c=ck(n),{onClose:d}=l;return b.useEffect(()=>(document.addEventListener(DE,d),()=>document.removeEventListener(DE,d)),[d]),b.useEffect(()=>{if(l.trigger){const h=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),u.jsx($h,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:u.jsxs(YR,{"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:[u.jsx(Iq,{children:r}),u.jsx(Oq,{scope:n,isInside:!0,children:u.jsx($3,{id:l.contentId,role:"tooltip",children:s||r})})]})})});rM.displayName=tu;var iM="TooltipArrow",Dq=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=ck(n);return Pq(iM,n).isInside?null:u.jsx(ZR,{...s,...r,ref:e})});Dq.displayName=iM;function Lq(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 zq(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 $q(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 Fq(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,d=a.y,h=l.x,f=l.y;d>r!=f>r&&n<(h-c)*(r-d)/(f-d)+c&&(s=!s)}return s}function Bq(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),qq(e)}function qq(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 Uq=tM,oM=rM;const Vq=Uq,Hq=b.forwardRef(({className:t,sideOffset:e=4,...n},r)=>u.jsx(oM,{ref:r,sideOffset:e,className:Z("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
376de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Hq.displayName=oM.displayName;var wu=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(){}},tl=typeof window>"u"||"Deno"in globalThis;function Ln(){}function Wq(t,e){return typeof t=="function"?t(e):t}function xb(t){return typeof t=="number"&&t>=0&&t!==1/0}function aM(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Mo(t,e){return typeof t=="function"?t(e):t}function Ir(t,e){return typeof t=="function"?t(e):t}function LE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==uk(o,e.options))return!1}else if(!rh(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 zE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(nl(e.options.mutationKey)!==nl(i))return!1}else if(!rh(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function uk(t,e){return((e==null?void 0:e.queryKeyHashFn)||nl)(t)}function nl(t){return JSON.stringify(t,(e,n)=>bb(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function rh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>rh(t[n],e[n])):!1}function lM(t,e){if(t===e)return t;const n=$E(t)&&$E(e);if(n||bb(t)&&bb(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 d=0;d<o;d++){const h=n?d:i[d];(!n&&l.has(h)||n)&&t[h]===void 0&&e[h]===void 0?(a[h]=void 0,c++):(a[h]=lM(t[h],e[h]),a[h]===t[h]&&t[h]!==void 0&&c++)}return s===o&&c===s?t:a}return e}function em(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 $E(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function bb(t){if(!FE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!FE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function FE(t){return Object.prototype.toString.call(t)==="[object Object]"}function Gq(t){return new Promise(e=>{setTimeout(e,t)})}function wb(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?lM(t,e):e}function Kq(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Jq(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var dk=Symbol();function cM(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===dk?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function uM(t,e){return typeof t=="function"?t(...e):!!t}var Ra,oo,Mc,lT,Qq=(lT=class extends wu{constructor(){super();ke(this,Ra);ke(this,oo);ke(this,Mc);se(this,Mc,e=>{if(!tl&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){j(this,oo)||this.setEventListener(j(this,Mc))}onUnsubscribe(){var e;this.hasListeners()||((e=j(this,oo))==null||e.call(this),se(this,oo,void 0))}setEventListener(e){var n;se(this,Mc,e),(n=j(this,oo))==null||n.call(this),se(this,oo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){j(this,Ra)!==e&&(se(this,Ra,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof j(this,Ra)=="boolean"?j(this,Ra):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ra=new WeakMap,oo=new WeakMap,Mc=new WeakMap,lT),hk=new Qq,Oc,ao,Pc,cT,Yq=(cT=class extends wu{constructor(){super();ke(this,Oc,!0);ke(this,ao);ke(this,Pc);se(this,Pc,e=>{if(!tl&&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(){j(this,ao)||this.setEventListener(j(this,Pc))}onUnsubscribe(){var e;this.hasListeners()||((e=j(this,ao))==null||e.call(this),se(this,ao,void 0))}setEventListener(e){var n;se(this,Pc,e),(n=j(this,ao))==null||n.call(this),se(this,ao,e(this.setOnline.bind(this)))}setOnline(e){j(this,Oc)!==e&&(se(this,Oc,e),this.listeners.forEac
vendor: 29,064 bytes, line 376
376h(r=>{r(e)}))}isOnline(){return j(this,Oc)}},Oc=new WeakMap,ao=new WeakMap,Pc=new WeakMap,cT),tm=new Yq;function kb(){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 Zq(t){return Math.min(1e3*2**t,3e4)}function dM(t){return(t??"online")==="online"?tm.isOnline():!0}var hM=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function av(t){return t instanceof hM}function fM(t){let e=!1,n=0,r=!1,s;const i=kb(),o=m=>{var y;r||(f(new hM(m)),(y=t.abort)==null||y.call(t))},a=()=>{e=!0},l=()=>{e=!1},c=()=>hk.isFocused()&&(t.networkMode==="always"||tm.isOnline())&&t.canRun(),d=()=>dM(t.networkMode)&&t.canRun(),h=m=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,m),s==null||s(),i.resolve(m))},f=m=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,m),s==null||s(),i.reject(m))},p=()=>new Promise(m=>{var y;s=v=>{(r||c())&&m(v)},(y=t.onPause)==null||y.call(t)}).then(()=>{var m;s=void 0,r||(m=t.onContinue)==null||m.call(t)}),g=()=>{if(r)return;let m;const y=n===0?t.initialPromise:void 0;try{m=y??t.fn()}catch(v){m=Promise.reject(v)}Promise.resolve(m).then(h).catch(v=>{var E;if(r)return;const x=t.retry??(tl?0:3),w=t.retryDelay??Zq,k=typeof w=="function"?w(n,v):w,S=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,v);if(e||!S){f(v);return}n++,(E=t.onFail)==null||E.call(t,n,v),Gq(k).then(()=>c()?void 0:p()).then(()=>{e?f(v):g()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),i)}}var Xq=t=>setTimeout(t,0);function eU(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=Xq;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 Qt=eU(),Ma,uT,pM=(uT=class{constructor(){ke(this,Ma)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xb(this.gcTime)&&se(this,Ma,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(tl?1/0:5*60*1e3))}clearGcTimeout(){j(this,Ma)&&(clearTimeout(j(this,Ma)),se(this,Ma,void 0))}},Ma=new WeakMap,uT),Ic,Oa,Pr,Pa,Cn,_h,Ia,rs,ci,dT,tU=(dT=class extends pM{constructor(e){super();ke(this,rs);ke(this,Ic);ke(this,Oa);ke(this,Pr);ke(this,Pa);ke(this,Cn);ke(this,_h);ke(this,Ia);se(this,Ia,!1),se(this,_h,e.defaultOptions),this.setOptions(e.options),this.observers=[],se(this,Pa,e.client),se(this,Pr,j(this,Pa).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,se(this,Ic,nU(this.options)),this.state=e.state??j(this,Ic),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=j(this,Cn))==null?void 0:e.promise}setOptions(e){this.options={...j(this,_h),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&j(this,Pr).remove(this)}setData(e,n){const r=wb(this.state.data,e,this.options);return ze(this,rs,ci).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){ze(this,rs,ci).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=j(this,Cn))==null?void 0:r.promise;return(s=j(this,Cn))==null||s.cancel(e),n?n.then(Ln).catch(Ln):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(j(this,Ic))}isActive(){return this.observers.some(e=>Ir(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Mo(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:!aM(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=j(this,Cn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=j(this,Cn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),j(this,Pr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(j(this,Cn)&&(j(this,Ia)?j(this,Cn).cancel({revert:!0}):j(this,Cn).cancelRetry()),this.scheduleGc()),j(this,Pr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ze(this,rs,ci).call(this,{type:"invalidate"})}fetch(e,n){var c,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(j(this,Cn))return j(this,Cn).continueRetry(),j(this,Cn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(se(this,Ia,!0),r.signal)})},i=()=>{const f=cM(this.options,n),g=(()=>{const m={client:j(this,Pa),queryKey:this.queryKey,meta:this.meta};return s(m),m})();return se(this,Ia,!1),this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:j(this,Pa),state:this.state,fetchFn:i};return s(f),f})();(c=this.options.behavior)==null||c.onFetch(a,this),se(this,Oa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&ze(this,rs,ci).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=f=>{var p,g,m,y;av(f)&&f.silent||ze(this,rs,ci).call(this,{type:"error",error:f}),av(f)||((g=(p=j(this,Pr).config).onError)==null||g.call(p,f,this),(y=(m=j(this,Pr).config).onSettled)==null||y.call(m,this.state.data,f,this)),this.scheduleGc()};return se(this,Cn,fM({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,g,m,y;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(v){l(v);return}(g=(p=j(this,Pr).config).onSuccess)==null||g.call(p,f,this),(y=(m=j(this,Pr).config).onSettled)==null||y.call(m,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,p)=>{ze(this,rs,ci).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{ze(this,rs,ci).call(this,{type:"pause"})},onContinue:()=>{ze(this,rs,ci).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),j(this,Cn).start()}},Ic=new WeakMap,Oa=new WeakMap,Pr=new WeakMap,Pa=new WeakMap,Cn=new WeakMap,_h=new WeakMap,Ia=new WeakMap,rs=new WeakSet,ci=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,...mM(r.data,this.options),fetchMeta:e.meta??null};case"success":return se(this,Oa,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 av(s)&&s.revert&&j(this,Oa)?{...j(this,Oa),fetchStatus:"idle"}:{...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),Qt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),j(this,Pr).notify({query:this,type:"updated",action:e})})},dT);function mM(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dM(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function nU(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 Os,hT,rU=(hT=class extends wu{constructor(e={}){super();ke(this,Os);this.config=e,se(this,Os,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??uk(s,n);let o=this.get(i);return o||(o=new tU({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){j(this,Os).has(e.queryHash)||(j(this,Os).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=j(this,Os).get(e.queryHash);n&&(e.destroy(),n===e&&j(this,Os).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Qt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return j(this,Os).get(e)}getAll(){return[...j(this,Os).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>LE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>LE(e,r)):n}notify(e){Qt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Qt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Qt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Os=new WeakMap,hT),Ps,Pn,Da,Is,Vi,fT,sU=(fT=class extends pM{constructor(e){super();ke(this,Is);ke(this,Ps);ke(this,Pn);ke(this,Da);this.mutationId=e.mutationId,se(this,Pn,e.mutationCache),se(this,Ps,[]),this.state=e.state||gM(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){j(this,Ps).includes(e)||(j(this,Ps).push(e),this.clearGcTimeout(),j(this,Pn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){se(this,Ps,j(this,Ps).filter(n=>n!==e)),this.scheduleGc(),j(this,Pn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){j(this,Ps).length||(this.state.status==="pending"?this.scheduleGc():j(this,Pn).remove(this))}continue(){var e;return((e=j(this,Da))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,l,c,d,h,f,p,g,m,y,v,x,w,k,S,E,C,N;const n=()=>{ze(this,Is,Vi).call(this,{type:"continue"})};se(this,Da,fM({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(T,M)=>{ze(this,Is,Vi).call(this,{type:"failed",failureCount:T,error:M})},onPause:()=>{ze(this,Is,Vi).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>j(this,Pn).canRun(this)}));const r=this.state.status==="pending",s=!j(this,Da).canStart();try{if(r)n();else{ze(this,Is,Vi).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=j(this,Pn).config).onMutate)==null?void 0:o.call(i,e,this));const M=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));M!==this.state.context&&ze(this,Is,Vi).call(this,{type:"pending",context:M,variables:e,isPaused:s})}const T=await j(this,Da).start();return await((d=(c=j(this,Pn).config).onSuccess)==null?void 0:d.call(c,T,e,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,T,e,this.state.context)),await((g=(p=j(this,Pn).config).onSettled)==null?void 0:g.call(p,T,null,this.state.variables,this.state.context,this)),await((y=(m=this.options).onSettled)==null?void 0:y.call(m,T,null,e,this.state.context)),ze(this,Is,Vi).call(this,{type:"success",data:T}),T}catch(T){try{throw await((x=(v=j(this,Pn).config).onError)==null?void 0:x.call(v,T,e,this.state.context,this)),await((k=(w=this.options).onError)==null?void 0:k.call(w,T,e,this.state.context)),await((E=(S=j(this,Pn).config).onSettled)==null?void 0:E.call(S,void 0,T,this.state.variables,this.state.context,this)),await((N=(C=this.options).onSettled)==null?void 0:N.call(C,void 0,T,e,this.state.context)),T}finally{ze(this,Is,Vi).call(this,{type:"error",error:T})}}finally{j(this,Pn).runNext(this)}}},Ps=new WeakMap,Pn=new WeakMap,Da=new WeakMap,Is=new WeakSet,Vi=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qt.batch(()=>{j(this,Ps).forEach(r=>{r.onMutationUpdate(e)}),j(this,Pn).notify({mutation:this,type:"updated",action:e})})},fT);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mi,ss,Th,pT,iU=(pT=class extends wu{constructor(e={}){super();ke(this,mi);ke(this,ss);ke(this,Th);this.config=e,se(this,mi,new Set),se(this,ss,new Map),se(this,Th,0)}build(e,n,r){const s=new sU({mutationCache:this,mutationId:++Xh(this,Th)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){j(this,mi).add(e);const n=Sf(e);if(typeof n=="string"){const r=j(this,ss).get(n);r?r.push(e):j(this,ss).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(j(this,mi).delete(e)){const n=Sf(e);if(typeof n=="string"){const r=j(this,ss).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&j(this,ss).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Sf(e);if(typeof n=="string"){const r=j(this,ss).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=Sf(e);if(typeof n=="string"){const s=(r=j(this,ss).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(){Qt.batch(()=>{j(this,mi).forEach(e=>{this.notify({type:"removed",mutation:e})}),j(this,mi).clear(),j(this,ss).clear()})}getAll(){return Array.from(j(this,mi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>zE(n,r))}findAll(e={}){return this.getAll().filter(n=>zE(e,n))}notify(e){Qt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Qt.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ln))))}},mi=new WeakMap,ss=new WeakMap,Th=new WeakMap,pT);function Sf(t){var e;return(e=t.options.scope)==null?void 0:e.id}function BE(t){return{onFetch:(e,n)=>{var d,h,f,p,g;const r=e.options,s=(f=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,i=((p=e.state.data)==null?void 0:p.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},v=cM(e.options,e.fetchOptions),x=async(w,k,S)=>{if(m)return Promise.reject();if(k==null&&w.pages.length)return Promise.resolve(w);const C=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:k,direction:S?"backward":"forward",meta:e.options.meta};return y(D),D})(),N=await v(C),{maxPages:T}=e.options,M=S?Jq:Kq;return{pages:M(w.pages,N,T),pageParams:M(w.pageParams,k,T)}};if(s&&i.length){const w=s==="backward",k=w?oU:qE,S={pages:i,pageParams:o},E=k(r,S);a=await x(S,E,w)}else{const w=t??i.length;do{const k=l===0?o[0]??r.initialPageParam:qE(r,a);if(l>0&&k==null)break;a=await x(a,k),l++}while(l<w)}return a};e.options.persister?e.fetchFn=()=>{var m,y;return(y=(m=e.options).persister)==null?void 0:y.call(m,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function qE(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 oU(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 _t,lo,co,Dc,Lc,uo,zc,$c,mT,aU=(mT=class{constructor(t={}){ke(this,_t);ke(this,lo);ke(this,co);ke(this,Dc);ke(this,Lc);ke(this,uo);ke(this,zc);ke(this,$c);se(this,_t,t.queryCache||new rU),se(this,lo,t.mutationCache||new iU),se(this,co,t.defaultOptions||{}),se(this,Dc,new Map),se(this,Lc,new Map),se(this,uo,0)}mount(){Xh(this,uo)._++,j(this,uo)===1&&(se(this,zc,hk.subscribe(async t=>{t&&(await this.resumePausedMutations(),j(this,_t).onFocus())})),se(this,$c,tm.subscribe(async t=>{t&&(await this.resumePausedMutations(),j(this,_t).onOnline())})))}unmount(){var t,e;Xh(this,uo)._--,j(this,uo)===0&&((t=j(this,zc))==null||t.call(this),se(this,zc,void 0),(e=j(this,$c))==null||e.call(this),se(this,$c,void 0))}isFetching(t){return j(this,_t).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return j(this,lo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=j(this,_t).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=j(this,_t).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Mo(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return j(this,_t).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=j(this,_t).get(r.queryHash),i=s==null?void 0:s.state.data,o=Wq(e,i);if(o!==void 0)return j(this,_t).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return Qt.batch(()=>j(this,_t).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=j(this,_t).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=j(this,_t);Qt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=j(this,_t);return Qt.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Qt.batch(()=>j(this,_t).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Ln).catch(Ln)}invalidateQueries(t,e={}){return Qt.batch(()=>(j(this,_t).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=Qt.batch(()=>j(this,_t).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ln)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ln)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=j(this,_t).build(this,e);return n.isStaleByTime(Mo(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ln).catch(Ln)}fetchInfiniteQuery(t){return t.behavior=BE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ln).catch(Ln)}ensureInfiniteQueryData(t){return t.behavior=BE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return tm.isOnline()?j(this,lo).resumePausedMutations():Promise.resolve()}getQueryCache(){return j(this,_t)}getMutationCache(){return j(this,lo)}getDefaultOptions(){return j(this,co)}setDefaultOptions(t){se(this,co,t)}setQueryDefaults(t,e){j(this,Dc).set(nl(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...j(this,Dc).values()],n={};return e.forEach(r=>{rh(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){j(this,Lc).set(nl(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...j(this,Lc).values()],n={};return e.forEach(r=>{rh(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...j(this,co).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=uk(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===dk&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...j(this,co).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){j(this,_t).clear(),j(this,lo).clear()}},_t=new WeakMap,lo=new WeakMap,co=new WeakMap,Dc=new WeakMap,Lc=new WeakMap,uo=new WeakMap,zc=new WeakMap,$c=new WeakMap,mT),er,He,Ah,In,La,Fc,ho,fo,jh,Bc,qc,za,$a,po,Uc,tt,rd,Sb,Eb,Cb,Nb,_b,Tb,Ab,yM,gT,lU=(gT=class extends wu{constructor(e,n){super();ke(this,tt);ke(this,er);ke(this,He);ke(this,Ah);ke(this,In);ke(this,La);ke(this,Fc);ke(this,ho);ke(this,fo);ke(this,jh);ke(this,Bc);ke(this,qc);ke(this,za);ke(this,$a);ke(this,po);ke(this,Uc,new Set);this.options=n,se(this,er,e),se(this,fo,null),se(this,ho,kb()),this.options.experimental_prefetchInRender||j(this,ho).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&&(j(this,He).addObserver(this),UE(j(this,He),this.options)?ze(this,tt,rd).call(this):this.updateResult(),ze(this,tt,Nb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jb(j(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jb(j(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ze(this,tt,_b).call(this),ze(this,tt,Tb).call(this),j(this,He).removeObserver(this)}setOptions(e){const n=this.options,r=j(this,He);if(this.options=j(this,er).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ir(this.options.enabled,j(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ze(this,tt,Ab).call(this),j(this,He).setOptions(this.options),n._defaulted&&!em(this.options,n)&&j(this,er).getQueryCache().notify({type:"observerOptionsUpdated",query:j(this,He),observer:this});const s=this.hasListeners();s&&VE(j(this,He),r,this.options,n)&&ze(this,tt,rd).call(this),this.updateResult(),s&&(j(this,He)!==r||Ir(this.options.enabled,j(this,He))!==Ir(n.enabled,j(this,He))||Mo(this.options.staleTime,j(this,He))!==Mo(n.staleTime,j(this,He)))&&ze(this,tt,Sb).call(this);const i=ze(this,tt,Eb).call(this);s&&(j(this,He)!==r||Ir(this.options.enabled,j(this,He))!==Ir(n.enabled,j(this,He))||i!==j(this,po))&&ze(this,tt,Cb).call(this,i)}getOptimisticResult(e){const n=j(this,er).getQueryCache().build(j(this,er),e),r=this.createResult(n,e);return uU(this,r)&&(se(this,In,r),se(this,Fc,this.options),se(this,La,j(this,He).state)),r}getCurrentResult(){return j(this,In)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){j(this,Uc).add(e)}getCurrentQuery(){return j(this,He)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=j(this,er).defaultQueryOptions(e),r=j(this,er).getQueryCache().build(j(this,er),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ze(this,tt,rd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),j(this,In)))}createResult(e,n){var T;const r=j(this,He),s=this.options,i=j(this,In),o=j(this,La),a=j(this,Fc),c=e!==r?e.state:j(this,Ah),{state:d}=e;let h={...d},f=!1,p;if(n._optimisticResults){const M=this.hasListeners(),D=!M&&UE(e,n),A=M&&VE(e,r,n,s);(D||A)&&(h={...h,...mM(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:y}=h;p=h.data;let v=!1;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(M=i.data,v=!0):M=typeof n.placeholderData=="function"?n.placeholderData((T=j(this,qc))==null?void 0:T.state.data,j(this,qc)):n.placeholderData,M!==void 0&&(y="success",p=wb(i==null?void 0:i.data,M,n),f=!0)}if(n.select&&p!==void 0&&!v)if(i&&p===(o==null?void 0:o.data)&&n.select===j(this,jh))p=j(this,Bc);else try{se(this,jh,n.select),p=n.select(p),p=wb(i==null?void 0:i.data,p,n),se(this,Bc,p),se(this,fo,null)}catch(M){se(this,fo,M)}j(this,fo)&&(g=j(this,fo),p=j(this,Bc),m=Date.now(),y="error");const x=h.fetchStatus==="fetching",w=y==="pending",k=y==="error",S=w&&x,E=p!==void 0,N={status:y,fetchStatus:h.fetchStatus,isPending:w,isSuccess:y==="success",isError:k,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:h.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:k&&!E,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:k&&E,isStale:fk(e,n),refetch:this.refetch,promise:j(this,ho),isEnabled:Ir(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const M=L=>{N.status==="error"?L.reject(N.error):N.data!==void 0&&L.resolve(N.data)},D=()=>{const L=se(this,ho,N.promise=kb());M(L)},A=j(this,ho);switch(A.status){case"pending":e.queryHash===r.queryHash&&M(A);break;case"fulfilled":(N.status==="error"||N.data!==A.value)&&D();break;case"rejected":(N.status!=="error"||N.error!==A.reason)&&D();break}}return N}updateResult(){const e=j(this,In),n=this.createResult(j(this,He),this.options);if(se(this,La,j(this,He).state),se(this,Fc,this.options),j(this,La).data!==void 0&&se(this,qc,j(this,He)),em(n,e))return;se(this,In,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!j(this,Uc).size)return!0;const o=new Set(i??j(this,Uc));return this.options.throwOnError&&o.add("error"),Object.keys(j(this,In)).some(a=>{const l=a;return j(this,In)[l]!==e[l]&&o.has(l)})};ze(this,tt,yM).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ze(this,tt,Nb).call(this)}},er=new WeakMap,He=new WeakMap,Ah=new WeakMap,In=new WeakMap,La=new WeakMap,Fc=new WeakMap,ho=new WeakMap,fo=new WeakMap,jh=new WeakMap,Bc=new WeakMap,qc=new WeakMap,za=new WeakMap,$a=new WeakMap,po=new WeakMap,Uc=new WeakMap,tt=new WeakSet,rd=function(e){ze(this,tt,Ab).call(this);let n=j(this,He).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Ln)),n},Sb=function(){ze(this,tt,_b).call(this);const e=Mo(this.options.staleTime,j(this,He));if(tl||j(this,In).isStale||!xb(e))return;const r=aM(j(this,In).dataUpdatedAt,e)+1;se(this,za,setTimeout(()=>{j(this,In).isStale||this.updateResult()},r))},Eb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(j(this,He)):this.options.refetchInterval)??!1},Cb=function(e){ze(this,tt,Tb).call(this),se(this,po,e),!(tl||Ir(this.options.enabled,j(this,He))===!1||!xb(j(this,po))||j(this,po)===0)&&se(this,$a,setInterval(()=>{(this.options.refetchIntervalInBackground||hk.isFocused())&&ze(this,tt,rd).call(this)},j(this,po)))},Nb=function(){ze(this,tt,Sb).call(this),ze(this,tt,Cb).call(this,ze(this,tt,Eb).call(this))},_b=function(){j(this,za)&&(clearTimeout(j(this,za)),se(this,za,void 0))},Tb=function(){j(this,$a)&&(clearInterval(j(this,$a)),se(this,$a,void 0))},Ab=function(){const e=j(this,er).getQueryCache().build(j(this,er),this.options);if(e===j(this,He))return;const n=j(this,He);se(this,He,e),se(this,Ah,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},yM=function(e){Qt.batch(()=>
376{e.listeners&&this.listeners.forEach(n=>{n(j(this,In))}),j(this,er).getQueryCache().notify({query:j(this,He),type:"observerResultsUpdated"})})},gT);function cU(t,e){return Ir(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function UE(t,e){return cU(t,e)||t.state.data!==void 0&&jb(t,e,e.refetchOnMount)}function jb(t,e,n){if(Ir(e.enabled,t)!==!1&&Mo(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&fk(t,e)}return!1}function VE(t,e,n,r){return(t!==e||Ir(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&fk(t,n)}function fk(t,e){return Ir(e.enabled,t)!==!1&&t.isStaleByTime(Mo(e.staleTime,t))}function uU(t,e){return!em(t.getCurrentResult(),e)}var mo,go,tr,gi,Ei,dp,Rb,yT,dU=(yT=class extends wu{constructor(n,r){super();ke(this,Ei);ke(this,mo);ke(this,go);ke(this,tr);ke(this,gi);se(this,mo,n),this.setOptions(r),this.bindMethods(),ze(this,Ei,dp).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=j(this,mo).defaultMutationOptions(n),em(this.options,r)||j(this,mo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:j(this,tr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&nl(r.mutationKey)!==nl(this.options.mutationKey)?this.reset():((s=j(this,tr))==null?void 0:s.state.status)==="pending"&&j(this,tr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=j(this,tr))==null||n.removeObserver(this)}onMutationUpdate(n){ze(this,Ei,dp).call(this),ze(this,Ei,Rb).call(this,n)}getCurrentResult(){return j(this,go)}reset(){var n;(n=j(this,tr))==null||n.removeObserver(this),se(this,tr,void 0),ze(this,Ei,dp).call(this),ze(this,Ei,Rb).call(this)}mutate(n,r){var s;return se(this,gi,r),(s=j(this,tr))==null||s.removeObserver(this),se(this,tr,j(this,mo).getMutationCache().build(j(this,mo),this.options)),j(this,tr).addObserver(this),j(this,tr).execute(n)}},mo=new WeakMap,go=new WeakMap,tr=new WeakMap,gi=new WeakMap,Ei=new WeakSet,dp=function(){var r;const n=((r=j(this,tr))==null?void 0:r.state)??gM();se(this,go,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Rb=function(n){Qt.batch(()=>{var r,s,i,o,a,l,c,d;if(j(this,gi)&&this.hasListeners()){const h=j(this,go).variables,f=j(this,go).context;(n==null?void 0:n.type)==="success"?((s=(r=j(this,gi)).onSuccess)==null||s.call(r,n.data,h,f),(o=(i=j(this,gi)).onSettled)==null||o.call(i,n.data,null,h,f)):(n==null?void 0:n.type)==="error"&&((l=(a=j(this,gi)).onError)==null||l.call(a,n.error,h,f),(d=(c=j(this,gi)).onSettled)==null||d.call(c,void 0,n.error,h,f))}this.listeners.forEach(h=>{h(j(this,go))})})},yT),vM=b.createContext(void 0),pk=t=>{const e=b.useContext(vM);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},hU=({client:t,children:e})=>(b.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),u.jsx(vM.Provider,{value:t,children:e})),xM=b.createContext(!1),fU=()=>b.useContext(xM);xM.Provider;function pU(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var mU=b.createContext(pU()),gU=()=>b.useContext(mU),yU=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},vU=t=>{b.useEffect(()=>{t.clearReset()},[t])},xU=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||uM(n,[t.error,r])),bU=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))}},wU=(t,e)=>t.isLoading&&t.isFetching&&!e,kU=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,HE=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function SU(t,e,n){var h,f,p,g,m;const r=fU(),s=gU(),i=pk(),o=i.defaultQueryOptions(t);(f=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,o),o._optimisticResults=r?"isRestoring":"optimistic",bU(o),yU(o,s),vU(s);const a=!i.getQueryCache().get(o.queryHash),[l]=b.useState(()=>new e(i,o)),c=l.getOptimisticResult(o),d=!r&&t.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(y=>{const v=d?l.subscribe(Qt.batchCalls(y)):Ln;return l.updateResult(),v},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setOptions(o)},[o,l]),kU(o,c))throw HE(o,l,s);if(xU({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((g=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,o,c),o.experimental_prefetchInRender&&!tl&&wU(c,r)){const y=a?HE(o,l,s):(m=i.getQueryCache().get(o.queryHash))==null?void 0:m.promise;y==null||y.catch(Ln).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function Xs(t,e){return SU(t,lU)}function EU(t,e){const n=pk(),[r]=b.useState(()=>new dU(n,t));b.useEffect(()=>{r.setOptions(t)},[r,t]);const s=b.useSyncExternalStore(b.useCallback(o=>r.subscribe(Qt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=b.useCallback((o,a)=>{r.mutate(o,a).catch(Ln)},[r]);if(s.error&&uM(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}/**
377 * @remix-run/router v1.23.0
378 *
379 * Copyright (c) Remix Software Inc.
380 *
381 * This source code is licensed under the MIT license found in the
382 * LICENSE.md file in the root directory of this source tree.
383 *
384 * @license MIT
385 */function sh(){return sh=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},sh.apply(this,arguments)}var xo;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(xo||(xo={}));const WE="popstate";function CU(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:o,hash:a}=r.location;return Mb("",{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:nm(s)}return _U(e,n,null,t)}function Ht(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function bM(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function NU(){return Math.random().toString(36).substr(2,8)}function GE(t,e){return{usr:t.state,key:t.key,idx:e}}function Mb(t,e,n,r){return n===void 0&&(n=null),sh({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ku(e):e,{state:n,key:e&&e.key||r||NU()})}function nm(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 ku(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 _U(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=xo.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(sh({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function h(){a=xo.Pop;let y=d(),v=y==null?null:y-c;c=y,l&&l({action:a,location:m.location,delta:v})}function f(y,v){a=xo.Push;let x=Mb(m.location,y,v);c=d()+1;let w=GE(x,c),k=m.createHref(x);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:m.location,delta:1})}function p(y,v){a=xo.Replace;let x=Mb(m.location,y,v);c=d();let w=GE(x,c),k=m.createHref(x);o.replaceState(w,"",k),i&&l&&l({action:a,location:m.location,delta:0})}function g(y){let v=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof y=="string"?y:nm(y);return x=x.replace(/ $/,"%20"),Ht(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let m={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(WE,h),l=y,()=>{s.removeEventListener(WE,h),l=null}},createHref(y){return e(s,y)},createURL:g,encodeLocation(y){let v=g(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:p,go(y){return o.go(y)}};return m}var KE;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(KE||(KE={}));function TU(t,e,n){return n===void 0&&(n="/"),AU(t,e,n,!1)}function AU(t,e,n,r){let s=typeof e=="string"?ku(e):e,i=mk(s.pathname||"/",n);if(i==null)return null;let o=wM(t);jU(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=BU(i);a=$U(o[l],c,r)}return a}function wM(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("/")&&(Ht(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not val
385id. 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=Oo([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(Ht(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),wM(i.children,e,d,c)),!(i.path==null&&!i.index)&&e.push({path:c,score:LU(c,i.index),routesMeta:d})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of kM(i.path))s(i,o,l)}),e}function kM(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=kM(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 jU(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:zU(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const RU=/^:[\w-]+$/,MU=3,OU=2,PU=1,IU=10,DU=-2,JE=t=>t==="*";function LU(t,e){let n=t.split("/"),r=n.length;return n.some(JE)&&(r+=DU),e&&(r+=OU),n.filter(s=>!JE(s)).reduce((s,i)=>s+(RU.test(i)?MU:i===""?PU:IU),r)}function zU(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 $U(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,d=i==="/"?e:e.slice(i.length)||"/",h=QE({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),f=l.route;if(!h&&c&&n&&!r[r.length-1].route.index&&(h=QE({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;
vendor: 6,917 bytes, lines 385-394
385Object.assign(s,h.params),o.push({params:s,pathname:Oo([i,h.pathname]),pathnameBase:HU(Oo([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=Oo([i,h.pathnameBase]))}return o}function QE(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=FU(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,d,h)=>{let{paramName:f,isOptional:p}=d;if(f==="*"){let m=a[h]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const g=a[h];return p&&!g?c[f]=void 0:c[f]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:t}}function FU(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),bM(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 BU(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return bM(!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 mk(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 qU(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?ku(t):t;return{pathname:n?n.startsWith("/")?n:UU(n,e):e,search:WU(r),hash:GU(s)}}function UU(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 lv(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 VU(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function SM(t,e){let n=VU(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function EM(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=ku(t):(s=sh({},t),Ht(!s.pathname||!s.pathname.includes("?"),lv("?","pathname","search",s)),Ht(!s.pathname||!s.pathname.includes("#"),lv("#","pathname","hash",s)),Ht(!s.search||!s.search.includes("#"),lv("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let h=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}a=h>=0?e[h]:"/"}let l=qU(s,a),c=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const Oo=t=>t.join("/").replace(/\/\/+/g,"/"),HU=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),WU=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,GU=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function KU(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const CM=["post","put","patch","delete"];new Set(CM);const JU=["get",...CM];new Set(JU);/**
386 * React Router v6.30.1
387 *
388 * Copyright (c) Remix Software Inc.
389 *
390 * This source code is licensed under the MIT license found in the
391 * LICENSE.md file in the root directory of this source tree.
392 *
393 * @license MIT
394 */function ih(){return ih=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},ih.apply(this,arguments)}const gk=b.createContext(null),QU=b.createContext(null),wl=b.createContext(null),Lg=b.createContext(null),Xo=b.createContext({outlet:null,matches:[],isDataRoute:!1}),NM=b.createContext(null);function YU(t,e){let{relative:n}=e===void 0?{}:e;Uh()||Ht(!1);let{basename:r,navigator:s}=b.useContext(wl),{hash:i,pathname:o,search:a}=TM(t,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:Oo([r,o])),s.createHref({pathname:l,search:a,hash:i})}function Uh(){return b.useContext(Lg)!=null}function ei(){return Uh()||Ht(!1),b.useContext(Lg).location}function _M(t){b.useContext(wl).static||b.useLayoutEffect(t)}function Oi(){let{isDataRoute:t}=b.useContext(Xo);return t?uV():ZU()}function ZU(){Uh()||Ht(!1);let t=b.useContext(gk),{basename:e,future:n,navigator:r}=b.useContext(wl),{matches:s}=b.useContext(Xo),{pathname:i}=ei(),o=JSON.stringify(SM(s,n.v7_relativeSplatPath)),a=b.useRef(!1);return _M(()=>{a.current=!0}),b.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let h=EM(c,JSON.parse(o),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Oo([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,o,i,t])}function yk(){let{matches:t}=b.useContext(Xo),e=t[t.length-1];return e?e.params:{}}function TM(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=b.useContext(wl),{matches:s}=b.useContext(Xo),{pathname:i}=ei(),o=JSON.stringify(SM(s,r.v7_relativeSplatPath));return b.useMemo(()=>EM(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function XU(t,e){return eV(t,e)}function eV(t,e,n,r){Uh()||Ht(!1);let{navigator:s}=b.useContext(wl),{matches:i}=b.useContext(Xo),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=ei(),d;if(e){var h;let y=typeof e=="string"?ku(e):e;l==="/"||(h=y.pathname)!=null&&h.startsWith(l)||Ht(!1),d=y}else d=c;let f=d.pathname||"/",p=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=TU(t,{pathname:p}),m=iV(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Oo([l,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Oo([l,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return e&&m?b.createElement(Lg.Provider,{value:{location:ih({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:xo.Pop}},m):m}function tV(){let t=cV(),e=KU(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 b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application 
394Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},e),n?b.createElement("pre",{style:s},n):null,null)}const nV=b.createElement(tV,null);class rV extends b.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?b.createElement(Xo.Provider,{value:this.props.routeContext},b.createElement(NM.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function sV(t){let{routeContext:e,match:n,children:r}=t,s=b.useContext(gk);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Xo.Provider,{value:e},r)}function iV(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);d>=0||Ht(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(c=d),h.route.id){let{loaderData:f,errors:p}=n,g=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||g){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let p,g=!1,m=null,y=null;n&&(p=a&&h.route.id?a[h.route.id]:void 0,m=h.route.errorElement||nV,l&&(c<0&&f===0?(g=!0,y=null):c===f&&(g=!0,y=h.route.hydrateFallbackElement||null)));let v=e.concat(o.slice(0,f+1)),x=()=>{let w;return p?w=m:g?w=y:h.route.Component?w=b.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=d,b.createElement(sV,{match:h,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?b.createElement(rV,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var AM=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(AM||{}),rm=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}(rm||{});function oV(t){let e=b.useContext(gk);return e||Ht(!1),e}function aV(t){let e=b.useContext(QU);return e||Ht(!1),e}function lV(t){let e=b.useContext(Xo);return e||Ht(!1),e}function jM(t){let e=lV(),n=e.matches[e.matches.length-1];return n.route.id||Ht(!1),n.route.id}function cV(){var t;let e=b.useContext(NM),n=aV(rm.UseRouteError),r=jM(rm.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function uV(){let{router:t}=oV(AM.UseNavigateStable),e=jM(rm.UseNavigateStable),n=b.useRef(!1);return _M(()=>{n.current=!0}),b.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,ih({fromRouteId:e},i)))},[t,e])}function dV(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Nt(t){Ht(!1)}function hV(t){let{basename:e="/",children:n=null,location:r,navigationType:s=xo.Pop,navigator:i,static:o=!1,future:a}=t;Uh()&&Ht(!1);let l=e.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:l,navigator:i,static:o,future:ih({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=ku(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:g="default"}=r,m=b.useMemo(()=>{let y=mk(d,l);return y==null?null:{location:{pathname:y,search:h,hash:f,state:p,key:g},navigationType:s}},[l,d,h,f,p,g,s]);return m==null?null:b.createElement(wl.Provider,{value:c},b.createElement(Lg.Provider,{children:n,value:m}))}function fV(t){let{children:e,location:n}=t;return XU(Ob(e),n)}new Promise(()=>{});function Ob(t,e){e===void 0&&(e=[]);let n=[];
394return b.Children.forEach(t,(r,s)=>{if(!b.isValidElement(r))return;let i=[...e,s];if(r.type===b.Fragment){n.push.apply(n,Ob(r.props.children,i));return}r.type!==Nt&&Ht(!1),!r.props.index||!r.props.children||Ht(!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=Ob(r.props.children,i)),n.push(o)}),n}/**
395 * React Router DOM v6.30.1
396 *
397 * Copyright (c) Remix Software Inc.
398 *
399 * This source code is licensed under the MIT license found in the
400 * LICENSE.md file in the root directory of this source tree.
401 *
402 * @license MIT
403 */function Pb(){return Pb=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},Pb.apply(this,arguments)}function pV(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 mV(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function gV(t,e){return t.button===0&&(!e||e==="_self")&&!mV(t)}function Ib(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function yV(t,e){let n=Ib(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const vV=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],xV="6";try{window.__reactRouterVersion=xV}catch{}const bV="startTransition",YE=X0[bV];function wV(t){let{basename:e,children:n,future:r,window:s}=t,i=b.useRef();i.current==null&&(i.current=CU({window:s,v5Compat:!0}));let o=i.current,[a,l]=b.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},d=b.useCallback(h=>{c&&YE?YE(()=>l(h)):l(h)},[l,c]);return b.useLayoutEffect(()=>o.listen(d),[o,d]),b.useEffect(()=>dV(r),[r]),b.createElement(hV,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const kV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",SV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mt=b.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:h}=e,f=pV(e,vV),{basename:p}=b.useContext(wl),g,m=!1;if(typeof c=="string"&&SV.test(c)&&(g=c,kV))try{let w=new URL(window.location.href),k=c.startsWith("//")?new URL(w.protocol+c):new URL(c),S=mk(k.pathname,p);k.origin===w.origin&&S!=null?c=S+k.search+k.hash:m=!0}catch{}let y=YU(c,{relative:s}),v=EV(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:h});function x(w){r&&r(w),w.defaultPrevented||v(w)}return b.createElement("a",Pb({},f,{href:g||y,onClick:m||i?r:x,ref:n,target:l}))});var ZE;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(ZE||(ZE={}));var XE;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(XE||(XE={}));function EV(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=Oi(),c=ei(),d=TM(t,{relative:o});return b.useCallback(h=>{if(gV(h,n)){h.preventDefault();let f=r!==void 0?r:nm(c)===nm(d);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[c,l,d,r,s,n,t,i,o,a])}function zg(t){let e=b.useRef(Ib(t)),n=b.useRef(!1),r=ei(),s=b.useMemo(()=>yV(r.search,n.current?null:e.current),[r.search]),i=Oi(),o=b.useCallback((a,l)=>{const c=Ib(typeof a=="function"?a(s):a);n.current=!0,i("?"+c,l)},[i,s]);return[s,o]}const CV=()=>{const{pathname:t}=ei();return b.useEffect(()=>{window.scrollTo(0,0)},[t]),null},NV="/assets/wecollect-sdd-logo-JS3AtJpu.png",_V=({disableLink:t=!1})=>{const e=u.jsx("img",{src:NV,alt:"WeCollect & SDD+",className:"h-8 md:h-12 lg:h-14 w-auto"});return t?u.jsx("div",{className:"flex items-center",children:e}):u.jsx(Mt,{to:"/",className:"flex items-center",children:e})},Wt=({hideBackButton:t=!1})=>{const[e,n]=b.useState(!0),[r,s]=b.useState(0),i=ei(),o=Oi(),l=!(i.pathname==="/")&&!t,c=()=>{const d=document.referrer&&document.referrer.includes(window.location.origin)&&window.history.length>2;o(d?-1:"/")};return b.useEffect(()=>{const d=()=>{const h=window.scrollY;h>r&&h>80?n(!1):n(!0),s(h)};return window.addEventListener("scroll",d,{passive:!0}),()=>window.removeEventListener("scroll",d)},[r]),u.jsx("header",{className:`bg-background fixed top-0 left-0 right-0 z-50 transition-transform duration-300 ${e?"translate-y-0":"-translate-y-full"}`,children:u.jsx("div",{className:"w-full px-4 md:px-6 lg:px-8",children:u.jsxs("div",{className:"flex items-center justify-between h-14 md:h-16",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[l&&u.jsx("button",{onClick:c,className:"inline-flex items-center text-muted-foreground hover:text-foreground transition-all group","aria-label":"Zurück",children:u.jsx(Gs,{className:"w-5 h-5 transition-transform group-hover:-translate-x-1"})}),u.jsx("div",{className:"hidden md:block",children:u.jsx(_V,{disableLink:t})}),u.jsx("span",{className:"text-xl md:text-xl lg:text-4xl text-foreground underline decoration-primary decoration-2 underline-offset-4 inline-block -rotate-1",style:{fontFamily:"'Caveat', cursive"},children:"NON à l'initiative SSR"})]}),u.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[u.jsxs("div",{className:"flex items-center text-xs md:text-sm font-medium text-muted-foreground",children:[u.jsx("a",{href:"https://nein-zur-halbierungs-initiative.community/",className:"hover:text-foreground transition-colors",children:"DE"}),u.jsx("span",{className:"mx-1",children:"|"}),u.jsx("span",{className:"text-foreground font-semibold",children:"FR"})]}),u.jsxs("a",{href:"https://www.democratie.ch/dons-contre-initiative-ssr?rnw-payment_type=onetime&rnw-amount=120&mtm_campaign=community_webseite_FR&mtm_source=button_top",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 md:gap-2 bg-accent text-foreground px-3 py-1.5 md:px-4 md:py-2 rounded-full text-xs md:text-sm font-medium hover:bg-accent/90 transition-all",children:[u.jsx(qo,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden md:inline",children:"Donation"})]})]})]})})})},TV="/assets/hero-visual-B-qTbBVr.png",AV=()=>u.jsx("section",{className:"relative overflow-hidden bg-background",children:u.jsx("div",{className:"container max-w-5xl mx-auto px-4 md:px-6 relative z-10",children:u.jsx("div",{className:"flex flex-col py-6 md:py-8",children:u.jsxs("div",{className:"flex flex-col items-center text-center gap-8",children:[u.jsx("div",{className:"w-full max-w-3xl animate-fade-up",style:{animationDelay:"100ms"},children:u.jsxs("div",{className:"relative rounded-2xl overflow-hidden shadow-2xl",children:[u.jsx("img",{src:TV,alt:"Menschen halten Schilder mit Statements zur Medienvielfalt",className:"w-full h-auto object-cover"}),u.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/10 to-transparent"})]})}),u.jsxs("div",{className:"max-w-2xl",children:[u.jsx("h1",{className:"font-sans text-2xl md:text-3xl lg:text-4xl font-semibold text-foreground mb-4 leading-[1.15] animate-fade-up",style:{animationDelay:"200ms"},children:"62% de non: l'initiative SSR clairement rejetée!"}
403),u.jsxs("div",{className:"text-foreground/80 text-base md:text-lg leading-relaxed mb-6 animate-fade-up space-y-4",style:{animationDelay:"300ms"},children:[u.jsx("p",{children:"La SSR est sauvée. Un grand merci pour votre engagement! Ensemble, nous avons mené plus de 60'000 conversations personnelles à la table de la cuisine, au bureau ou à l'arrêt de bus."}),u.jsx("p",{children:"Après la votation, une décision déterminante s'annonce déjà: le Conseil fédéral doit se prononcer sur la concession, et donc sur l'avenir de la SSR."}),u.jsxs("p",{children:["C'est pourquoi nous avons rédigé un court manifeste : ",u.jsx(Mt,{to:"/manifeste",className:"text-primary underline underline-offset-2 hover:text-primary/80 transition-colors",children:"«Une démocratie vivante a besoin d'une SSR forte!»"})]})]}),u.jsx("div",{className:"flex justify-center gap-3 animate-fade-up",style:{animationDelay:"400ms"},children:u.jsxs(Mt,{to:"/manifeste",className:"inline-flex items-center justify-center gap-2 bg-accent text-accent-foreground px-5 py-2.5 md:px-6 md:py-3 rounded-full font-medium hover:bg-accent/90 hover:scale-[1.02] transition-all text-sm md:text-base shadow-elevated",children:["Signer le manifeste maintenant",u.jsx(Pt,{className:"w-4 h-4"})]})})]})]})})})});var Ls=function(){return Ls=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},Ls.apply(this,arguments)};function Su(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 jV(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(d){try{c(r.next(d))}catch(h){o(h)}}function l(d){try{c(r.throw(d))}catch(h){o(h)}}function c(d){d.done?i(d.value):s(d.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}function RV(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))}const MV=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class vk extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class OV extends vk{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class eC extends vk{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class tC extends vk{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Db;(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"})(Db||(Db={}));class PV{constructor(e,{headers:n={},customFetch:r,region:s=Db.Any}={}){this.url=e,this.headers=n,this.region=s,this.fetch=MV(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return jV(this,arguments,void 0,function*(n,r={}){var s;let i,o;try{const{headers:a,method:l,body:c,signal:d,timeout:h}=r;let f={},{region:p}=r;p||(p=this.region);const g=new URL(`${this.url}/${n}`);p&&p!=="any"&&(f["x-region"]=p,g.searchParams.set("forceFunctionRegion",p));let m;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",m=c):typeof c=="string"?(f["Content-Type"]="text/plain",m=c):typeof FormData<"u"&&c instanceof FormData?m=c:(f["Content-Type"]="application/json",m=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?m=JSON.stringify(c):m=c;let y=d;h&&(o=new AbortController,i=setTimeout(()=>
403o.abort(),h),d?(y=o.signal,d.addEventListener("abort",()=>o.abort())):y=o.signal);const v=yield this.fetch(g.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),a),body:m,signal:y}).catch(S=>{throw new OV(S)}),x=v.headers.get("x-relay-error");if(x&&x==="true")throw new eC(v);if(!v.ok)throw new tC(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 tC||a instanceof eC?a.context:void 0}}finally{i&&clearTimeout(i)}})}}var IV=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}},DV=class{constructor(t){var e,n;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,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,d=i.statusText;if(i.ok){var h,f;if(n.method!=="HEAD"){var p;const v=await i.text();v===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((p=n.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?a=v:a=JSON.parse(v))}const m=(h=n.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),y=(f=i.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");m&&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,d="Not Acceptable"):a.length===1?a=a[0]:a=null)}else{var g;const m=await i.text();try{o=JSON.parse(m),Array.isArray(o)&&i.status===404&&(a=[],o=null,c=200,d="OK")}catch{i.status===404&&m===""?(c=204,d="No Content"):o={message:m}}if(o&&n.isMaybeSingle&&(!(o==null||(g=o.details)===null||g===void 0)&&g.includes("0 rows"))&&(o=null,c=200,d="OK"),o&&n.shouldThrowOnError)throw new IV(o)}return{error:o,data:a,count:l,status:c,statusText:d}});return this.shouldThrowOnError||(s=s.catch(i=>{var o;let a="";const l=i==null?void 0:i.cause;if(l){var c,d,h,f;const g=(c=l==null?void 0:l.message)!==null&&c!==void 0?c:"",m=(d=l==null?void 0:l.code)!==null&&d!==void 0?d:"";a=`${(h=i==null?void 0:i.name)!==null&&h!==void 0?h:"FetchError"}: ${i==null?void 0:i.message}`,a+=`
404
405Caused by: ${(f=l==null?void 0:l.name)!==null&&f!==void 0?f:"Error"}: ${g}`,m&&(a+=` (${m})`),l!=null&&l.stack&&(a+=`
406${l.stack}`)}else{var p;a=(p=i==null?void 0:i.stack)!==null&&p!==void 0?p:""}return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:a,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),s.then(t,e)}returns(){return this}overrideTypes(){return this}},LV=class extends DV{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}
406explain({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 nC=new RegExp("[,()]");var Vl=class extends LV{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"&&nC.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"&&nC.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}},zV=class{constructor(t,{headers:e={},schema:n,fetch:r}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r}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 Vl({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch})}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>
4060){const l=[...new Set(a)].map(c=>`"${c}"`);i.searchParams.set("columns",l.join(","))}}return new Vl({method:s,url:i,headers:o,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}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((d,h)=>d.concat(Object.keys(h)),[]);if(c.length>0){const d=[...new Set(c)].map(h=>`"${h}"`);a.searchParams.set("columns",d.join(","))}}return new Vl({method:o,url:a,headers:l,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}update(t,{count:e}={}){var n;const r="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Vl({method:r,url:s,headers:i,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Vl({method:n,url:r,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch})}},$V=class RM{constructor(e,{headers:n={},schema:r,fetch:s}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.fetch=s}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new zV(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new RM(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}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 d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),h=r&&Object.values(n).some(d);h?(a="POST",c=n):r||s?(a=r?"HEAD":"GET",Object.entries(n).filter(([p,g])=>g!==void 0).map(([p,g])=>[p,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([p,g])=>{l.searchParams.append(p,g)})):(a="POST",c=n);const f=new Headers(this.headers);return h?f.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&f.set("Prefer",`count=${i}`),new Vl({method:a,url:l,headers:f,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};class FV{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:
407import ws from "ws"
408new 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+=`
409
410Suggested 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 BV="2.90.1",qV=`realtime-js/${BV}`,MM="1.0.0",UV="2.0.0",rC=MM,Lb=1e4,VV=1e3,HV=100;var Ji;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Ji||(Ji={}));var Kt;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Kt||(Kt={}));var as;(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"})(as||(as={}));var zb;(function(t){t.websocket="websocket"})(zb||(zb={}));var ya;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(ya||(ya={}));class WV{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,d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);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(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+c.length+h.length,p=new ArrayBuffer(this.HEADER_LENGTH+f);let g=new DataView(p),m=0;g.setUint8(m++,this.KINDS.userBroadcastPush),g.setUint8(m++,l.length),g.setUint8(m++,a.length),g.setUint8(m++,o.length),g.setUint8(m++,c.length),g.setUint8(m++,h.length),g.setUint8(m++,n),Array.from(l,v=>g.setUint8(m++,v.charCodeAt(0))),Array.from(a,v=>g.setUint8(m++,v.charCodeAt(0))),Array.from(o,v=>g.setUint8(m++,v.charCodeAt(0))),Array.from(c,v=>g.setUint8(m++,v.charCodeAt(0))),Array.from(h,v=>g.setUint8(m++,v.charCodeAt(0)));var y=new Uint8Array(p.byteLength+r.byteLength);return y.set(new Uint8Array(p),0),y.set(new Uint8Array(r),p.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;
410return 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 d=r.decode(e.slice(l,l+i));l=l+i;const h=r.decode(e.slice(l,l+o));l=l+o;const f=e.slice(l,e.byteLength),p=a===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,g={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(g.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}class OM{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 ut;(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"})(ut||(ut={}));const sC=(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]=GV(o,t,e,s),i),{}):{}},GV=(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)?PM(i,o):$b(o)},PM=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return YV(e,n)}switch(t){case ut.bool:return KV(e);case ut.float4:case ut.float8:case ut.int2:case ut.int4:case ut.int8:case ut.numeric:case ut.oid:return JV(e);case ut.json:case ut.jsonb:return QV(e);case ut.timestamp:return ZV(e);case ut.abstime:case ut.date:case ut.daterange:case ut.int4range:case ut.int8range:case ut.money:case ut.reltime:case ut.text:case ut.time:case ut.timestamptz:case ut.timetz:case ut.tsrange:case ut.tstzrange:return $b(e);default:return $b(e)}},$b=t=>t,KV=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},JV=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},QV=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},YV=(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=>PM(e,a))}return t},ZV=t=>typeof t=="string"?t.replace(" ","T"):t,IM=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 cv{constructor(e,n,r={},s=Lb){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.recHooks=[],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.recHo
410oks.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 iC;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(iC||(iC={}));class wd{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=wd.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=wd.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=wd.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,d)=>{o[c]||(l[c]=d)}),this.map(o,(c,d)=>{const h=i[c];if(h){const f=d.map(y=>y.presence_ref),p=h.map(y=>y.presence_ref),g=d.filter(y=>p.indexOf(y.presence_ref)<0),m=h.filter(y=>f.indexOf(y.presence_ref)<0);g.length>0&&(a[c]=g),m.length>0&&(l[c]=m)}else a[c]=d}),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 d=(c=e[a])!==null&&c!==void 0?c:[];if(e[a]=this.cloneDeep(l),d.length>0){const h=e[a].map(p=>p.presence_ref),f=d.filter(p=>h.indexOf(p.presence_ref)<0);e[a].unshift(...f)}r(a,d,l)}),this.map(o,(a,l)=>{let c=e[a];if(!c)return;const d=l.map(h=>h.presence_ref);c=c.filter(h=>d.indexOf(h.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 oC;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(oC||(oC={}));var kd;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(kd||(kd={}));var hi;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(hi||(hi={}));class hc{constructor(e,n={config:{}},r){var s,i;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=Kt.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 cv(this,as.join,this.params,this.timeout),this.rejoinTimer=new OM(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Kt.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=Kt.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Kt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Kt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Kt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(as.reply,{},(o,a)=>{this._trigger(this._replyEventName(a),o)}),this.presence=new wd(this),this.broadcastEndpointURL=IM(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==Kt.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(p=>p.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[kd.PRESENCE]&&this.bindings[kd.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,h={},f={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:d}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(p=>e==null?void 0:e(hi.CHANNEL_ERROR,p)),this._onClose(()=>e==null?void 0:e(hi.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:p})=>{var g;if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){e==null||e(hi.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,y=(g=m==null?void 0:m.length)!==null&&g!==void 0?g:0,v=[];for(let x=0;x<y;
410x++){const w=m[x],{filter:{event:k,schema:S,table:E,filter:C}}=w,N=p&&p[x];if(N&&N.event===k&&hc.isFilterValueEqual(N.schema,S)&&hc.isFilterValueEqual(N.table,E)&&hc.isFilterValueEqual(N.filter,C))v.push(Object.assign(Object.assign({},w),{id:N.id}));else{this.unsubscribe(),this.state=Kt.errored,e==null||e(hi.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=v,e&&e(hi.SUBSCRIBED);return}}).receive("error",p=>{this.state=Kt.errored,e==null||e(hi.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(hi.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===Kt.joined&&e===kd.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;try{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 
410in 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=Kt.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(as.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(s=>{r=new cv(this,as.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=Kt.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 cv(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>HV){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:d}=as;if(r&&[a,l,c,d].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(p=>{var g,m,y;return((g=p.filter)===null||g===void 0?void 0:g.event)==="*"||((y=(m=p.filter)===null||m===void 0?void 0:m.event)===null||y===void 0?void 0:y.toLocaleLowerCase())===o}).map(p=>p.callback(f,r)):(i=this.bindings[o])===null||i===void 0||i.filter(p=>{var g,m,y,v,x,w,k,S;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const E=p.id,C=(g=p.filter)===null||g===void 0?void 0:g.event;return E&&((m=n.ids)===null||m===void 0?void 0:m.includes(E))&&(C==="*"||(C==null?void 0:C.toLocaleLowerCase())===((y=n.data)===null||y===void 0?void 0:y.type.toLocaleLowerCase()))&&(!(!((v=p.filter)===null||v===void 0)&&v.table)||p.filter.table===((x=n.data)===null||x===void 0?void 0:x.table))}else{const E=(k=(w=p==null?void 0:p.filter)===null||w===void 0?void 0:w.event)===null||k===void 0?void 0:k.toLocaleLowerCase();return E==="*"||E===((S=n==null?void 0:n.event)===null||S===void 0?void 0:S.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof f=="object"&&"ids"in f){const g=f.data,{schema:m,table:y,commit_timestamp:v,type:x,errors:w}=g;f=Object.assign(Object.assign({},{schema:m,table:y,commit_timestamp:v,eventType:x,new:{},old:{},errors:w}),this._getPayloadRecords(g))}p.callback(f,r)})}_isClosed(){return this.state===Kt.closed}_isJoined(){return this.state===Kt.joined}_isJoining(){return this.state===Kt.joining}_isLeaving(){return this.state===Kt.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&&hc.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(as.close,{},e)}_onError(e){this._on(as.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Kt.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=sC(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=sC(e.columns,e.old_record)),n}}const uv=()=>{},Ef={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},XV=[1e3,2e3,5e3,1e4],e6=1e4,t6=`
411  addEventListener("message", (e) => {
412    if (e.data.event === "start") {
413      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
414    }
415  });`;class n6{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=Lb,this.transport=null,this.heartbeatIntervalMs=Ef.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=uv,this.ref=0,this.reconnectTimer=null,this.vsn=rC,this.logger=uv,this.conn=null,this.sendBuffer=[],this.serializer
415=new WV,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}/${zb.websocket}`,this.httpEndpoint=IM(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=FV.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n}
416
417To use Realtime in Node.js, you need to provide a WebSocket implementation:
418
419Option 1: Use Node.js 22+ which has native WebSocket support
420Option 2: Install and provide the "ws" package:
421
422  npm install ws
423
424  import ws from "ws"
425  const client = new RealtimeClient(url, {
426    ...options,
427    transport: ws
428  })`):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 Ji.connecting:return ya.Connecting;case Ji.open:return ya.Open;case Ji.closing:return ya.Closing;default:return ya.Closed}}isConnected(){return this.connectionState()===ya.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,n={config:{}}){const r=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new hc(`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(VV,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},Ef.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>
4280&&(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(d){this.log("error","error in heartbeat callback",d)}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===Ji.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Ji.open||this.conn.readyState===Ji.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.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)}_triggerChanError(){this.channels.forEach(e=>e._trigger(as.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([t6],{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.forEac
428h(s=>{const i={access_token:n,version:qV};n&&s.updateJoinPayload(i),s.joinedOnce&&s._isJoined()&&s._push(as.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 OM(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Ef.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,s,i,o,a,l,c,d,h,f,p;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:Lb,this.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:Ef.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:uv,this.vsn=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:rC,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:g=>XV[g-1]||e6,this.vsn){case MM:this.encode=(d=e==null?void 0:e.encode)!==null&&d!==void 0?d:(g,m)=>m(JSON.stringify(g)),this.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:(g,m)=>m(JSON.parse(g));break;case UV:this.encode=(f=e==null?void 0:e.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p: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 oh=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 r6(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 s6(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 i6(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=r6(t.baseUrl,r,s),l=await s6(t.auth),c=await e(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):void 0}),d=await c.text(),h=(c.headers.get("content-type")||"").includes("application/json"),f=h&&d?JSON.parse(d):d;if(!c.ok){const p=h?f:void 0,g=p==null?void 0:p.error;throw new oh((g==null?void 0:g.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:p})}return{status:c.status,headers:c.headers,data:f}}}}function Cf(t){return t.join("�")}var o6=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Cf(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/${Cf(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Cf(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Cf(t.namespace)}`}),!0}catch(e){if(e instanceof oh&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof oh&&n.status===409)return;throw n}}};function Al(t){return t.join("�")}var a6=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/${Al(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/${Al(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/${Al(t.namespace)}
428/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/${Al(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/${Al(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/${Al(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof oh&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof oh&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},l6=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=i6({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new o6(this.client,e),this.tableOps=new a6(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)}},$g=class extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}};function xt(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var c6=class extends $g{constructor(t,e,n){super(t),this.name="StorageApiError",this.status=e,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Fb=class extends $g{constructor(t,e){super(t),this.name="StorageUnknownError",this.originalError=e}};const xk=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),u6=()=>Response,Bb=t=>{if(Array.isArray(t))return t.map(n=>Bb(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]=Bb(r)}),e},d6=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)},h6=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function ah(t){"@babel/helpers - typeof";return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ah(t)}function f6(t,e){if(ah(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ah(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}
428function p6(t){var e=f6(t,"string");return ah(e)=="symbol"?e:e+""}function m6(t,e,n){return(e=p6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function _e(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?aC(Object(n),!0).forEach(function(r){m6(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):aC(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const dv=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)},g6=async(t,e,n)=>{t instanceof await u6()&&!(n!=null&&n.noResolveJson)?t.json().then(r=>{const s=t.status||500,i=(r==null?void 0:r.statusCode)||s+"";e(new c6(dv(r),s,i))}).catch(r=>{e(new Fb(dv(r),r))}):e(new Fb(dv(t),t))},y6=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!r?s:(d6(r)?(s.headers=_e({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(r)):s.body=r,e!=null&&e.duplex&&(s.duplex=e.duplex),_e(_e({},s),n))};async function Vh(t,e,n,r,s,i){return new Promise((o,a)=>{t(n,y6(e,r,s,i)).then(l=>{if(!l.ok)throw l;return r!=null&&r.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>g6(l,a,r))})}async function lh(t,e,n,r){return Vh(t,"GET",e,n,r)}async function ns(t,e,n,r,s){return Vh(t,"POST",e,r,s,n)}async function qb(t,e,n,r,s){return Vh(t,"PUT",e,r,s,n)}async function v6(t,e,n,r){return Vh(t,"HEAD",e,_e(_e({},n),{},{noResolveJson:!0}),r)}async function bk(t,e,n,r,s){return Vh(t,"DELETE",e,r,s,n)}var x6=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(xt(e))return{data:null,error:e};throw e}}};let DM;DM=Symbol.toStringTag;var b6=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[DM]="BlobDownloadBuilder",this.promise=null}asStream(){return new x6(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(xt(e))return{data:null,error:e};throw e}}};const w6={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},lC={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var k6=class{constructor(t,e={},n,r){this.shouldThrowOnError=!1,this.url=t,this.headers=e,this.bucketId=n,this.fetch=xk(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(t,e,n,r){var s=this;try{let i;const o=_e(_e({},lC),r);let a=_e(_e({},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=_e(_e({},a),r.headers));const c=s._removeEmptyFolders(e),d=s._getFinalPath(c),h=await(t=="PUT"?qb:ns)(s.fetch,`${s.url}/object/${d}`,i,_e({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:c,id:h.Id,fullPath:h.Key},error:null}}catch(i){if(s.shouldThrowOnError)throw i;if(xt(i))return{data:null,error:i};throw i}}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}`);a.searchParams.set("token",e);try{let l;const c=_e({upsert:lC.upsert},r),d=_e(_e({},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,d["cache-control"]=`max-age=${c.cacheControl}`,d["content-type"]=c.contentType),{data:{path:i,fullPath:(await qb(s.fetch,a.toString(),l,{headers:d})).Key},error:null}}catch(l){if(s.shouldThrowOnError)throw l;if(xt(l))return{data:null,error:l};throw l}}async createSignedUploadUrl(t,e){var n=this;try{let r=n._getFinalPath(t);const s=_e({},n.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const i=await ns(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 $g("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:a},error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(xt(r))return{data:null,error:r};throw r}}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;try{return{data:await ns(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}),error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(xt(s))return{data:null,error:s};throw s}}async copy(t,e,n){var r=this;try{return{data:{path:(await ns(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key},error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(xt(s))return{data:null,error:s};throw s}}async createSignedUrl(t,e,n){var r=this;try{let s=r._getFinalPath(t),i=await ns(r.fetch,`${r.url}/object/sign/${s}
428`,_e({expiresIn:e},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${r.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(xt(s))return{data:null,error:s};throw s}}async createSignedUrls(t,e,n){var r=this;try{const s=await ns(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{data:s.map(o=>_e(_e({},o),{},{signedUrl:o.signedURL?encodeURI(`${r.url}${o.signedURL}${i}`):null})),error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(xt(s))return{data:null,error:s};throw s}}download(t,e){const n=typeof(e==null?void 0:e.transform)<"u"?"render/image/authenticated":"object",r=this.transformOptsToQueryString((e==null?void 0:e.transform)||{}),s=r?`?${r}`:"",i=this._getFinalPath(t),o=()=>lh(this.fetch,`${this.url}/${n}/${i}${s}`,{headers:this.headers,noResolveJson:!0});return new b6(o,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);try{return{data:Bb(await lh(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(xt(r))return{data:null,error:r};throw r}}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await v6(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(xt(r)&&r instanceof Fb){const s=r.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:r}}throw r}}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;try{return{data:await bk(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(xt(n))return{data:null,error:n};throw n}}async list(t,e,n){var r=this;try{const s=_e(_e(_e({},w6),e),{},{prefix:t||""});return{data:await ns(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n),error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(xt(s))return{data:null,error:s};throw s}}async listV2(t,e){var n=this;try{const r=_e({},t);return{data:await ns(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(xt(r))return{data:null,error:r};throw r}}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 LM="2.90.1",zM={"X-Client-Info":`storage-js/${LM}`};var S6=class{constructor(t,e={},n,r){this.shouldThrowOnError=!1;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.")),this.url=s.href.replace(/\/$/,""),this.headers=_e(_e({},zM),e),this.fetch=xk(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(t){var e=this;try{const n=e.listBucketOptionsToQueryString(t);return{data:await lh(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(xt(n))return{data:null,error:n};throw n}}async getBucket(t){var e=this;try{return{data:await lh(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(xt(n))return{data:null,error:n};throw n}}async createBucket(t,e={public:!1}){var n=this;try{return{data:await ns(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}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(xt(r))return{data:null,error:r};throw r}}async updateBucket(t,e){var n=this;try{return{data:await qb(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}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(xt(r))return{data:null,error:r};throw r}}async emptyBucket(t){var e=this;try{return{data:await ns(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(xt(n))return{data:null,error:n};throw n}}async deleteBucket(t){var e=this;try{return{data:await bk(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(xt(n))return{data:null,error:n};throw n}}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():""}},E6=class{constructor(t,e={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=_e(_e({},zM),e),this.fetch=xk(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(t){var e=this;try{return{data:await ns(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(xt(n))return{data:null,error:n};throw n}}async listBuckets(t){var e=this;try{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{data:await lh(e.fetch,s,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(xt(n))return{data:null,error:n};throw n}}async deleteBucket(t){var e=this;try{return{data:await bk(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(xt(n))return{data:null,error:n};throw n}}from(t){var e=this;if(!h6(t))throw new $g("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 l6({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}
428),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}}}}})}};const wk={"X-Client-Info":`storage-js/${LM}`,"Content-Type":"application/json"};var $M=class extends Error{constructor(t){super(t),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function yr(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}var hv=class extends $M{constructor(t,e,n){super(t),this.name="StorageVectorsApiError",this.status=e,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},C6=class extends $M{constructor(t,e){super(t),this.name="StorageVectorsUnknownError",this.originalError=e}};const kk=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),N6=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)},cC=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),_6=async(t,e,n)=>{if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(n!=null&&n.noResolveJson)){const r=t.status||500,s=t;if(typeof s.json=="function")s.json().then(i=>{const o=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||r+"";e(new hv(cC(i),r,o))}).catch(()=>{const i=r+"";e(new hv(s.statusText||`HTTP ${r} error`,r,i))});else{const i=r+"";e(new hv(s.statusText||`HTTP ${r} error`,r,i))}}else e(new C6(cC(t),t))},T6=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return r?(N6(r)?(s.headers=_e({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(r)):s.body=r,_e(_e({},s),n)):s};async function A6(t,e,n,r,s,i){return new Promise((o,a)=>{t(n,T6(e,r,s,i)).then(l=>{if(!l.ok)throw l;if(r!=null&&r.noResolveJson)return l;const c=l.headers.get("content-type");return!c||!c.includes("application/json")?{}:l.json()}).then(l=>o(l)).catch(l=>_6(l,a,r))})}async function vr(t,e,n,r,s){return A6(t,"POST",e,r,s,n)}var j6=class{constructor(t,e={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=_e(_e({},wk),e),this.fetch=kk(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(t){var e=this;try{return{data:await vr(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async getIndex(t,e){var n=this;try{return{data:await vr(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(yr(r))return{data:null,error:r};throw r}}async listIndexes(t){var e=this;try{return{data:await vr(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async deleteIndex(t,e){var n=this;try{return{data:await vr(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{},error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(yr(r))return{data:null,error:r};throw r}}},R6=class{constructor(t,e={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=_e(_e({},wk),e),this.fetch=kk(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(t){var e=this;try{if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await vr(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async getVectors(t){var e=this;try{return{data:await vr(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async listVectors(t){var e=this;try{if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
428if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return{data:await vr(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async queryVectors(t){var e=this;try{return{data:await vr(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async deleteVectors(t){var e=this;try{if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await vr(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}},M6=class{constructor(t,e={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=_e(_e({},wk),e),this.fetch=kk(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(t){var e=this;try{return{data:await vr(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async getBucket(t){var e=this;try{return{data:await vr(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async listBuckets(t={}){var e=this;try{return{data:await vr(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}async deleteBucket(t){var e=this;try{return{data:await vr(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(yr(n))return{data:null,error:n};throw n}}},O6=class extends M6{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new P6(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)}},P6=class extends j6{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new I6(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},I6=class extends R6{constructor(t,e,n,r,s){super(t,e,s),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,_e(_e({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},D6=class extends S6{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new k6(this.url,this.headers,t,this.fetch)}get vectors(){return new O6(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new E6(this.url+"/iceberg",this.headers,this.fetch)}};const FM="2.90.1",Hl=30*1e3,Ub=3,fv=Ub*Hl,L6="http://localhost:9999",z6="supabase.auth.token",$6={"X-Client-Info":`gotrue-js/${FM}`},Vb="X-Supabase-Api-Version",BM={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},F6=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,B6=10*60*1e3;
428class ch extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function ye(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class q6 extends ch{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function U6(t){return ye(t)&&t.name==="AuthApiError"}class va extends ch{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class Pi extends ch{constructor(e,n,r,s){super(e,r,s),this.name=n,this.status=r}}class fr extends Pi{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function V6(t){return ye(t)&&t.name==="AuthSessionMissingError"}class jl extends Pi{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Nf extends Pi{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class _f extends Pi{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 H6(t){return ye(t)&&t.name==="AuthImplicitGrantRedirectError"}class uC extends Pi{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 W6 extends Pi{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 Hb extends Pi{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function pv(t){return ye(t)&&t.name==="AuthRetryableFetchError"}class dC extends Pi{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Wb extends Pi{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const sm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),hC=` 	
429\r=`.split(""),G6=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<hC.length;e+=1)t[hC[e].charCodeAt(0)]=-2;for(let e=0;e<sm.length;e+=1)t[sm[e].charCodeAt(0)]=e;return t})();function fC(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(sm[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(sm[r]),e.queuedBits-=6}}function qM(t,e,n){const r=G6[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 pC(t){const e=[],n=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{Q6(o,r,n)};for(let o=0;o<t.length;o+=1)qM(t.charCodeAt(o),s,i);return e.join("")}function K6(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 J6(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}K6(r,e)}}function Q6(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 Cc(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)qM(t.charCodeAt(s),n,r);return new Uint8Array(e)}function Y6(t){const e=[];return J6(t,n=>e.push(n)),new Uint8Array(e)}function Ea(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};return t.forEach(s=>fC(s,n,r)),fC(null,n,r),e.join("")}function Z6(t){return Math.round(Date.now()/1e3)+t}function X6(){return Symbol("auth-callback")}const fn=()=>typeof window<"u"&&typeof document<"u",ca={tested:!1,writable:!1},UM=()=>
429{if(!fn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ca.tested)return ca.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ca.tested=!0,ca.writable=!0}catch{ca.tested=!0,ca.writable=!1}return ca.writable};function eH(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{e[s]=r}),e}const VM=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),tH=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Wl=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},ua=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},hn=async(t,e)=>{await t.removeItem(e)};class Fg{constructor(){this.promise=new Fg.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}Fg.promiseConstructor=Promise;function mv(t){const e=t.split(".");if(e.length!==3)throw new Wb("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!F6.test(e[r]))throw new Wb("JWT not in base64url format");return{header:JSON.parse(pC(e[0])),payload:JSON.parse(pC(e[1])),signature:Cc(e[2]),raw:{header:e[0],payload:e[1]}}}async function nH(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function rH(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 sH(t){return("0"+t.toString(16)).substr(-2)}function iH(){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,sH).join("")}async function oH(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 aH(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 oH(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Rl(t,e,n=!1){const r=iH();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Wl(t,`${e}-code-verifier`,s);const i=await aH(r);return[i,r===i?"plain":"s256"]}const lH=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function cH(t){const e=t.headers.get(Vb);if(!e||!e.match(lH))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function uH(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 dH(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 hH=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ml(t){if(!hH.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function gv(){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 fH(t,e){return new Proxy(t,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;
429if(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 mC(t){return JSON.parse(JSON.stringify(t))}const pa=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),pH=[502,503,504];async function gC(t){var e;if(!tH(t))throw new Hb(pa(t),0);if(pH.includes(t.status))throw new Hb(pa(t),t.status);let n;try{n=await t.json()}catch(i){throw new va(pa(i),i)}let r;const s=cH(t);if(s&&s.getTime()>=BM["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 dC(pa(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new fr}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 dC(pa(n),t.status,n.weak_password.reasons);throw new q6(pa(n),t.status||500,r)}const mH=(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 Ne(t,e,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[Vb]||(i[Vb]=BM["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 gH(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 gH(t,e,n,r,s,i){const o=mH(e,r,s,i);let a;try{a=await t(n,Object.assign({},o))}catch(l){throw console.error(l),new Hb(pa(l),0)}if(a.ok||await gC(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(l){await gC(l)}}function Zr(t){var e;let n=null;xH(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=Z6(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function yC(t){const e=Zr(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 no(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function yH(t){return{data:t,error:null}}function vH(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=t,o=Su(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 vC(t){return t}function xH(t){return t.access_token&&t.refresh_token&&t.expires_in}const yv=["global","local","others"];class bH{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=VM(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,n=yv[0]){if(yv.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${yv.join(", ")}`);try{return await Ne(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ye(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Ne(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:no})}catch(r){if(ye(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=Su(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 Ne(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:vH,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ye(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Ne(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:no})}catch(n){if(ye(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},d=await Ne(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:vC});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>
4290&&(p.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(g.split(";")[1].split("=")[1]);c[`${y}Page`]=m}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(ye(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){Ml(e);try{return await Ne(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:no})}catch(n){if(ye(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){Ml(e);try{return await Ne(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:no})}catch(r){if(ye(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){Ml(e);try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:no})}catch(r){if(ye(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){Ml(e.userId);try{const{data:n,error:r}=await Ne(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(ye(n))return{data:null,error:n};throw n}}async _deleteFactor(e){Ml(e.userId),Ml(e.id);try{return{data:await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(ye(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},d=await Ne(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:vC});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(g.split(";")[1].split("=")[1]);c[`${y}Page`]=m}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(c){if(ye(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(e){try{return await Ne(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Ne(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await Ne(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ye(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Ne(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}}function xC(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const Ol={debug:!!(globalThis&&UM()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class HM extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class wH extends HM{}async function kH(t,e,n){Ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),Ol.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){Ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await n()}finally{Ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw Ol.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new wH(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Ol.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()}}))}function SH(){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 WM(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}
429" is invalid.`);return t.toLowerCase()}function EH(t){return parseInt(t,16)}function CH(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function NH(t){var e;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:c,scheme:d,uri:h,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(!h)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(`
430`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const p=WM(t.address),g=d?`${d}://${r}`:r,m=t.statement?`${t.statement}
431`:"",y=`${g} wants you to sign in with your Ethereum account:
432${p}
433
434${m}`;let v=`URI: ${h}
435Version: ${f}
436Chain ID: ${n}${o?`
437Nonce: ${o}`:""}
438Issued At: ${i.toISOString()}`;if(s&&(v+=`
439Expiration Time: ${s.toISOString()}`),a&&(v+=`
440Not Before: ${a.toISOString()}`),l&&(v+=`
441Request ID: ${l}`),c){let x=`
442Resources:`;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}`);x+=`
443- ${w}`}v+=x}return`${y}
444${v}`}class Bt 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 im extends Bt{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function _H({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 Bt({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 Bt({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 Bt({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 Bt({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 Bt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Bt({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 Bt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Bt({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(GM(o)){if(i.rp.id!==o)return new Bt({message:`The RP ID "${i.rp.id}
444" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Bt({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 Bt({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 Bt({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 Bt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function TH({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 Bt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Bt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(GM(r)){if(n.rpId!==r)return new Bt({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Bt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Bt({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 Bt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class AH{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 jH=new AH;function RH(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=Su(t,["challenge","user","excludeCredentials"]),i=Cc(e).buffer,o=Object.assign(Object.assign({},n),{id:Cc(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:Cc(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function MH(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=Su(t,["challenge","allowCredentials"]),s=Cc(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:Cc(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function OH(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:Ea(new Uint8Array(t.response.attestationObject)),clientDataJSON:Ea(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function PH(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:Ea(new Uint8Array(s.authenticatorData)),clientDataJSON:Ea(new Uint8Array(s.clientDataJSON)),signature:Ea(new Uint8Array(s.signature)),userHandle:s.userHandle?Ea(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function GM(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function bC(){var t,e;return!!(fn()&&"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 IH(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new im("Browser returned unexpected credential type",e)}:{data:null,error:new im("Empty credential response",e)}}catch(e){return{data:null,error:_H({error:e,options:t})}}}async function DH(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new im("Browser returned unexpected credential type",e)}:{data:null,error:new im("Empty credential response",e)}}catch(e){return{data:null,error:TH({error:e,options:t})}}}const LH={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},zH={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function om(...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]=om(a,o):r[i]=om(o)}else r[i]=o}return r}function $H(t,e){return om(LH,t,e||{})}function FH(t,e){return om(zH,t,e||{})}
444class BH{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){try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!o)return{data:null,error:a};const l=s??jH.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:c}=o.webauthn.credential_options.publicKey;c.name||(c.name=`${c.id}:${r}`),c.displayName||(c.displayName=c.name)}switch(o.webauthn.type){case"create":{const c=$H(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:h}=await IH({publicKey:c,signal:l});return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const c=FH(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:h}=await DH(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:c,signal:l}));return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(o){return ye(o)?{data:null,error:o}:{data:null,error:new va("Unexpected error in challenge",o)}}}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 ch("rpId is required for WebAuthn authentication")};try{if(!bC())return{data:null,error:new va("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 ye(o)?{data:null,error:o}:{data:null,error:new va("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 ch("rpId is required for WebAuthn registration")};try{if(!bC())return{data:null,error:new va("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===e&&f.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.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 ye(o)?{data:null,error:o}:{data:null,error:new va("Unexpected error in register",o)}}}}SH();const qH={url:L6,storageKey:z6,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:$6,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function wC(t,e,n){return await n()}const Pl={};class uh{get jwks(){var e,n;return(n=(e=Pl[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){Pl[this.storageKey]=Object.assign(Object.assign({},Pl[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=Pl[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Pl[this.storageKey]=Object.assign(Object.assign({},Pl[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({},qH),e);if(this.storageKey=i.storageKey,this.instanceID=(n=uh.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,uh.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&fn()){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 bH({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=VM(i.fetch),this.lock=i.lock||wC,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&&fn()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=kH:this.lock=wC,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 BH(this)}
444,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:UM()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=xC(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=xC(this.memoryStorage)),fn()&&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),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${FM}) ${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(fn()&&(n=eH(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),fn()&&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),H6(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 ye(n)?this._returnResult({error:n}):this._returnResult({error:new va("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,s;try{const i=await Ne(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:Zr}),{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(ye(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var n,r,s;try{let i;if("email"in e){const{email:d,password:h,options:f}=e;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await Rl(this.storage,this.storageKey)),i=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,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:p,code_challenge_method:g},xform:Zr})}else if("phone"in e){const{phone:d,password:h,options:f}=e;i=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,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:Zr})}else throw new Nf("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await hn(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 hn(this.storage,`${this.storageKey}-code-verifier`),ye(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 Ne(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:yC})}else if("phone"in e){const{phone:i,password:o,options:a}=e;n=await Ne(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:yC})}else throw new Nf("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 jl;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(ye(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,d,h,f;let p,g;if("message"in e)p=e.message,g=e.signature;else{const{chain:m,wallet:y,statement:v,options:x}=e;let w;if(fn())if(typeof y=="object")w=y;else{const T=window;if("ethereum"in T&&typeof T.ethereum=="object"&&"request"in T.ethereum&&typeof T.ethereum.request=="function")w=T.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"||!(x!=null&&x.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=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href),S=await w.request({method:"eth_requestAccounts"}).then(T=>T).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 E=WM(S[0]);let C=(r=x==null?void 0:x.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!C){const T=await w.request({method:"eth_chainId"});C=EH(T)}const N={domain:k.host,address:E,statement:v,uri:k.href,version:"1",chainId:C,nonce:(s=x==null?void 0:x.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=x==null?void 0:x.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=x==null?void 0:x.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=x==null?void 0:x.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=x==null?void 0:x.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(d=x==null?void 0:x.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=NH(N),g=await w.request({method:"personal_sign",params:[CH(p),E]})}try{const{data:m,error:y}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:g}
444,!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Zr});if(y)throw y;if(!m||!m.session||!m.user){const v=new jl;return this._returnResult({data:{user:null,session:null},error:v})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:y})}catch(m){if(ye(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(e){var n,r,s,i,o,a,l,c,d,h,f,p;let g,m;if("message"in e)g=e.message,m=e.signature;else{const{chain:y,wallet:v,statement:x,options:w}=e;let k;if(fn())if(typeof v=="object")k=v;else{const E=window;if("solana"in E&&typeof E.solana=="object"&&("signIn"in E.solana&&typeof E.solana.signIn=="function"||"signMessage"in E.solana&&typeof E.solana.signMessage=="function"))k=E.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof 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);
444if("signIn"in k&&k.signIn){const E=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),x?{statement:x}:null));let C;if(Array.isArray(E)&&E[0]&&typeof E[0]=="object")C=E[0];else if(E&&typeof E=="object"&&"signedMessage"in E&&"signature"in E)C=E;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in C&&"signature"in C&&(typeof C.signedMessage=="string"||C.signedMessage instanceof Uint8Array)&&C.signature instanceof Uint8Array)g=typeof C.signedMessage=="string"?C.signedMessage:new TextDecoder().decode(C.signedMessage),m=C.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${S.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...x?["",x,""]:[""],"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}`]:[],...!((h=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...w.signInWithSolana.resources.map(C=>`- ${C}`)]:[]].join(`
445`);const E=await k.signMessage(new TextEncoder().encode(g),"utf8");if(!E||!(E instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=E}}try{const{data:y,error:v}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:Ea(m)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Zr});if(v)throw v;if(!y||!y.session||!y.user){const x=new jl;return this._returnResult({data:{user:null,session:null},error:x})}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(ye(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async _exchangeCodeForSession(e){const n=await ua(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new W6;const{data:i,error:o}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:Zr});if(await hn(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new jl;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 hn(this.storage,`${this.storageKey}-code-verifier`),ye(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 Ne(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:Zr}),{data:l,error:c}=a;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const d=new jl;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(n){if(ye(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,d=null;this.flowType==="pkce"&&([c,d]=await Rl(this.storage,this.storageKey));const{error:h}=await Ne(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:d},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:a,options:l}=e,{data:c,error:d}=await Ne(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:d})}throw new Nf("You must provide either an email or phone number.")}catch(a){if(await hn(this.storage,`${this.storageKey}-code-verifier`),ye(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 Ne(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Zr});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(ye(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 Rl(this.storage,this.storageKey));const c=await Ne(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:yH});return!((i=c.data)===null||i===void 0)&&i.url&&fn()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(a){if(await hn(this.storage,`${this.storageKey}-code-verifier`),ye(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 fr;const{error:s}=await Ne(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(ye(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 Ne(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 Ne(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 Nf("You must provide either an email or phone number and a type")}catch(n){if(ye(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 ua(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
445id"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<fv:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const o=await ua(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=gv()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=fH(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 Ne(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:no}):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 fr}:await Ne(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:no})})}catch(n){if(ye(n))return V6(n)&&(await this._removeSession(),await hn(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 fr;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&e.email!=null&&([a,l]=await Rl(this.storage,this.storageKey));const{data:c,error:d}=await Ne(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:no});if(d)throw d;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 hn(this.storage,`${this.storageKey}-code-verifier`),ye(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 fr;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=mv(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)throw 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(ye(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 fr;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(ye(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){try{if(!fn())throw new _f("No browser detected.");
445if(e.error||e.error_description||e.error_code)throw new _f(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 uC("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new _f("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 uC("No code detected.");const{data:x,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:x.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 _f("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(a);let f=d+h;l&&(f=parseInt(l));const p=f-d;p*1e3<=Hl&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);const g=f-h;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,f,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,f,d);const{data:m,error:y}=await this._getUser(i);if(y)throw y;const v={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:h,expires_at:f,refresh_token:o,token_type:c,user:m.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(ye(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 ua(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)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&&!(U6(a)&&(a.status===404||a.status===401||a.status===403)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await hn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=X6(),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 Rl(this.storage,this.storageKey,!0));try{return await Ne(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 hn(this.storage,`${this.storageKey}-code-verifier`),ye(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(ye(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,d;const{data:h,error:f}=i;if(f)throw f;const p=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 Ne(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(c=h.session)===null||c===void 0?void 0:c.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return fn()&&!(!((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(ye(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;
445if(s)throw s;const{options:o,provider:a,token:l,access_token:c,nonce:d}=e,h=await Ne(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:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Zr}),{data:f,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new jl}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(s){if(await hn(this.storage,`${this.storageKey}-code-verifier`),ye(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 Ne(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(ye(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 rH(async s=>(s>
4450&&await nH(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Ne(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Zr})),(s,i)=>{const o=200*Math.pow(2,s);return i&&pv(i)&&Date.now()+o-r<Hl})}catch(r){if(this._debug(n,"error",r),ye(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),fn()&&!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 ua(this.storage,this.storageKey);if(s&&this.userStorage){let o=await ua(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Wl(this.userStorage,this.storageKey+"-user",o)),s.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:gv()}else if(s&&!s.user&&!s.user){const o=await ua(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await hn(this.storage,this.storageKey+"-user"),await Wl(this.storage,this.storageKey,s)):s.user=gv()}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()<fv;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${fv}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),pv(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 fr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Fg;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new fr;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),ye(i)){const o={data:null,error:i};return pv(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 hn(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 Wl(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=mC(s);await Wl(this.storage,this.storageKey,i)}else{const s=mC(n);await Wl(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await hn(this.storage,this.storageKey),await hn(this.storage,this.storageKey+"-code-verifier"),await hn(this.storage,this.storageKey+"-user"),this.userStorage&&await hn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&fn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
445catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Hl);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)/Hl);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Hl}ms, refresh threshold is ${Ub} ticks`),s<=Ub&&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 HM)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!fn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),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 Rl(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 Ne(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(ye(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;if(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 Ne(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(ye(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"?OH(e.webauthn.credential_response):PH(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await Ne(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(ye(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 Ne(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:RH(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:MH(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ye(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(){var e,n;const{data:{session:r},error:s}
445=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=mv(r.access_token);let o=null;i.aal&&(o=i.aal);let a=o;((n=(e=r.user.factors)===null||e===void 0?void 0:e.filter(d=>d.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(a="aal2");const c=i.amr||[];return{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:c},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 Ne(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 fr})})}catch(n){if(ye(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 fr});const o=await Ne(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&&fn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ye(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 fr});const o=await Ne(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&&fn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ye(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 Ne(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 fr})})}catch(e){if(ye(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 Ne(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 fr})})}catch(n){if(ye(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+B6>s)return r;const{data:i,error:o}=await Ne(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:p,error:g}
445=await this.getSession();if(g||!p.session)return this._returnResult({data:null,error:g});r=p.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=mv(r);n!=null&&n.allowExpired||uH(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:p}=await this.getUser(r);if(p)throw p;return{data:{claims:i,header:s,signature:o},error:null}}const d=dH(s.alg),h=await crypto.subtle.importKey("jwk",c,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,Y6(`${a}.${l}`)))throw new Wb("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(ye(r))return this._returnResult({data:null,error:r});throw r}}}uh.nextInstanceID={};const UH=uh,VH="2.90.1";let sd="";typeof Deno<"u"?sd="deno":typeof document<"u"?sd="web":typeof navigator<"u"&&navigator.product==="ReactNative"?sd="react-native":sd="node";const HH={"X-Client-Info":`supabase-js-${sd}/${VH}`},WH={headers:HH},GH={schema:"public"},KH={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},JH={};function dh(t){"@babel/helpers - typeof";return dh=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},dh(t)}function QH(t,e){if(dh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(dh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YH(t){var e=QH(t,"string");return dh(e)=="symbol"?e:e+""}function ZH(t,e,n){return(e=YH(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kC(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 Tt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kC(Object(n),!0).forEach(function(r){ZH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kC(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const XH=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),eW=()=>Headers,tW=(t,e,n)=>{const r=XH(n),s=eW();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,Tt(Tt({},o),{},{headers:c}))}};function nW(t){return t.endsWith("/")?t:t+"/"}function rW(t,e){var n,r;const{db:s,auth:i,realtime:o,global:a}=t,{db:l,auth:c,realtime:d,global:h}=e,f={db:Tt(Tt({},l),s),auth:Tt(Tt({},c),i),realtime:Tt(Tt({},d),o),storage:{},global:Tt(Tt(Tt({},h),a),{},{headers:Tt(Tt({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?f.accessToken=t.accessToken:delete f.accessToken,f}function sW(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(nW(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var iW=class extends UH{constructor(t){super(t)}},oW=class{constructor(t,e,n){var r,s;this.supabaseUrl=t,this.supabaseKey=e;const i=sW(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:GH,realtime:JH,auth:Tt(Tt({},KH),{},{storageKey:o}),global:WH},l=rW(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:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=l.auth)!==null&&c!==void 0?c:{},this.headers,l.global.fetch)}this.fetch=tW(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Tt({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&this.accessToken().then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new $V(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new D6(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new PV(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();
445return(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},d,h){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new iW({url:this.authUrl.href,headers:Tt(Tt({},f),d),storageKey:i,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:c,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new n6(this.realtimeUrl.href,Tt(Tt({},t),{},{params:Tt(Tt({},{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 aW=(t,e,n)=>new oW(t,e,n);function lW(){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}lW()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const cW="https://lywsktlewtwbaimmfhfx.supabase.co",uW="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imx5d3NrdGxld3R3YmFpbW1maGZ4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzAzNjQ3MjUsImV4cCI6MjA4NTk0MDcyNX0.xc2Cl-_-z66u1gmeHWv05JDNRjlko54DvNsG680Ab-8",We=aW(cW,uW,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),Bg=()=>{const[t,e]=b.useState({committed_count:0,completed_count:0}),[n,r]=b.useState(!0),s=async()=>{const{data:i,error:o}=await We.from("conversation_stats").select("committed_count, completed_count").single();if(o){console.error("Error fetching conversation stats:",o),r(!1);return}const{data:a,error:l}=await We.from("conversation_commitments").select("talk_number");l&&console.error("Error fetching form commitments:",l);const c=(a==null?void 0:a.reduce((f,p)=>f+(p.talk_number||0),0))||0,d=(i==null?void 0:i.committed_count)||0,h=(i==null?void 0:i.completed_count)||0;e({committed_count:d+c,completed_count:h}),r(!1)};return b.useEffect(()=>{s();const i=setInterval(s,3e4),o=We.channel("conversation_stats_realtime").on("postgres_changes",{event:"INSERT",schema:"public",table:"conversation_commitments"},a=>{const l=a.new.talk_number||0;e(c=>({...c,committed_count:c.committed_count+l}))}).on("postgres_changes",{event:"*",schema:"public",table:"conversation_stats"},()=>{s()}).subscribe();return()=>{clearInterval(i),We.removeChannel(o)}},[]),{stats:t,isLoading:n,refetch:s}},Sk=({targetCount:t=1e5,headline:e="Nous comptons sur toi !",description:n="Notre plan : nous nous mobilisons ensemble pour dire NON à l'initiative SSR à l'aide de 100'000 discussions personnelles.",ctaText:r="Je participe",ctaLink:s="/participer#commitment",hideCta:i=!1,hideHeadline:o=!1})=>{const{stats:a,isLoading:l}=Bg(),[c,d]=b.useState(0),[h,f]=b.useState(0),[p,g]=b.useState(!1),[m,y]=b.useState(!1),v=b.useRef(null),x=Math.min(a.committed_count/t*100,100),w=Math.min(a.completed_count/t*100,100),S=Math.max(w,4),E=x>0&&w>0?x/w:2.5,C=Math.min(S*E,100);b.useEffect(()=>{const T=new IntersectionObserver(([M])=>{M.isIntersecting&&!p&&g(!0)},{threshold:.3});return v.current&&T.observe(v.current),()=>T.disconnect()},[p]),b.useEffect(()=>{if(!p||l||m)return;const T=a.committed_count,M=a.completed_count,D=[{percent:.95,delay:1e3},{percent:.97,delay:3e3},{percent:.98,delay:6e3},{percent:.99,delay:7e3},{percent:1,delay:0}];let A=0;const L=30,I=270;let U=0;const B=setInterval(()=>{U++;const P=U/L,Q=(1-Math.pow(1-P,2))*.95;d(Math.floor(T*Q)),f(Math.floor(M*Q)),U>=L&&(clearInterval(B),J())},I),J=()=>{const P=()=>{if(A>=D.length){y(!0);return}const z=D[A];d(Math.floor(T*z.percent)),f(Math.floor(M*z.percent)),A++,z.delay>0?setTimeout(P,z.delay):y(!0)};P()};return()=>{clearInterval(B)}},[a.committed_count,a.completed_count,p,l,m]),b.useEffect(()=>{m&&(d(a.committed_count),f(a.completed_count))},[a.committed_count,a.completed_count,m]);const N=T=>
445T.toLocaleString("de-CH");return u.jsxs("section",{id:"zaehler",ref:v,className:"bg-primary py-8 md:py-10 relative overflow-hidden",children:[u.jsxs("div",{className:"absolute inset-0 opacity-10",children:[u.jsx("div",{className:"absolute top-0 left-1/4 w-64 h-64 bg-white rounded-full blur-3xl"}),u.jsx("div",{className:"absolute bottom-0 right-1/4 w-48 h-48 bg-white rounded-full blur-3xl"})]}),u.jsx("div",{className:"container max-w-4xl mx-auto px-4 md:px-6 relative z-10",children:u.jsxs("div",{className:`flex flex-col items-center text-center ${o?"gap-4 md:gap-6":"gap-6 md:gap-8"}`,children:[!o&&u.jsxs("div",{className:"max-w-xl",children:[u.jsx("h2",{className:"font-sans text-2xl md:text-4xl font-semibold text-primary-foreground mb-2 md:mb-3",children:e}),u.jsx("p",{className:"text-primary-foreground font-semibold text-base md:text-xl leading-relaxed",children:n})]}),u.jsxs("div",{className:"bg-white rounded-xl md:rounded-2xl p-4 md:p-6 shadow-elevated w-full max-w-sm transition-shadow duration-300 hover:shadow-xl",children:[u.jsx("div",{className:"flex justify-between items-baseline mb-3 md:mb-4",children:u.jsxs("div",{className:"flex gap-4 md:gap-6",children:[u.jsxs("div",{children:[u.jsx("span",{className:"block text-xl md:text-3xl font-bold text-primary tabular-nums",children:N(c)}),u.jsx("span",{className:"text-muted-foreground text-xs mt-0.5 block",children:"promis"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"block text-xl md:text-3xl font-bold text-secondary tabular-nums",children:N(h)}),u.jsx("span",{className:"text-muted-foreground text-xs mt-0.5 block",children:"menées"})]})]})}),u.jsxs("div",{className:"relative h-4 bg-muted rounded-full overflow-hidden",children:[u.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary/40 rounded-full transition-all duration-1000 ease-out",style:{width:p?`${C}%`:"0%"}}),u.jsx("div",{className:"absolute inset-y-0 left-0 bg-secondary rounded-full transition-all duration-1000 ease-out",style:{width:p?`${S}%`:"0%"}})]}),u.jsxs("div",{className:"flex gap-4 mt-3 text-xs text-muted-foreground",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("div",{className:"w-3 h-3 rounded-full bg-secondary"}),u.jsx("span",{children:"menées"})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("div",{className:"w-3 h-3 rounded-full bg-primary/40"}),u.jsx("span",{children:"promis"})]})]})]}),!i&&(s.startsWith("http")?u.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer","aria-label":r,className:"inline-flex items-center justify-center gap-2 bg-accent text-foreground px-6 md:px-8 py-2.5 md:py-3 rounded-full font-semibold text-sm md:text-base hover:scale-105 transition-all duration-300 shadow-elevated hover:shadow-xl",children:[r,u.jsx(Pt,{className:"w-4 h-4"})]}):u.jsxs(Mt,{to:s,"aria-label":r,className:"inline-flex items-center justify-center gap-2 bg-accent text-foreground px-6 md:px-8 py-2.5 md:py-3 rounded-full font-semibold text-sm md:text-base hover:scale-105 transition-all duration-300 shadow-elevated hover:shadow-xl",children:[r,u.jsx(Pt,{className:"w-4 h-4"})]}))]})})]})},dW="/assets/votation-karte-LbeqEhdm.png",hW=()=>u.jsx("section",{className:"py-8 md:py-10 bg-background",children:u.jsx("div",{className:"container max-w-4xl mx-auto px-4 md:px-6",children:u.jsxs("div",{className:"bg-card rounded-xl md:rounded-2xl p-6 md:p-8 shadow-elevated text-center",children:[u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mb-2",children:"Avez-vous déjà reçu votre matériel de vote ?"}),u.jsx("p",{className:"text-muted-foreground text-sm md:text-base mb-5 max-w-lg mx-auto",children:"Merci de nous informer dès qu'il arrive dans votre boîte aux lettres."}),u.jsxs("a",{href:"https://nein-zur-halbierungs-initiative.community/votation",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 bg-accent text-accent-foreground px-6 md:px-8 py-2.5 md:py-3 rounded-full font-semibold text-sm md:text-base hover:scale-105 transition-all duration-300 shadow-elevated hover:shadow-xl mb-6",children:["Vers la carte",u.jsx(Pt,{className:"w-4 h-4"})]}),u.jsx("img",{src:dW,alt:"Carte de la Suisse avec les matériels de vote reçus",className:"w-full max-w-2xl mx-auto rounded-lg"})]})})}),fW=()=>u.jsx("section",{className:"py-10 md:py-12 bg-muted",children:u.jsxs("div",{className:"container max-w-4xl mx-auto px-4 md:px-6 text-center",children:[u.jsx("h2",{className:"font-sans text-3xl md:text-4xl font-semibold text-foreground mb-4",children:"Rester informé·e"}),u.jsx("p",{className:"text-muted-foreground text-lg mb-8 max-w-2xl mx-auto",children:"Recevez des actualités, des pistes de discussion et des analyses sur l'initiative de réduction de moitié."}),u.jsxs(Mt,{to:"/newsletter#newsletter-form",className:"inline-flex items-center justify-center gap-2 bg-primary text-primary-foreground px-8 py-4 rounded-full font-semibold hover:bg-primary/90 hover:scale-[1.02] transition-all shadow-elevated",children:["S'abonner à la newsletter",u.jsx(Pt,{className:"w-4 h-4"})]})]})}),jn=()=>(b.useEffect(()=>{const t="https://form.demokratie.ch/commande-bulletin",e=n=>{const s=n.target.closest(`a[href^="${t}"]`);if(s){const i=new URL(s.href),o=new URLSearchParams(window.location.search);for(const[a,l]of o.entries())a.startsWith("mtm_")&&l&&!i.searchParams.has(a)&&i.searchParams.set(a,l);for(const[a,l]of o.entries())a.startsWith("utm_")&&l&&!i.searchParams.has(a)&&i.searchParams.set(a,l);i.searchParams.has("referrer")||i.searchParams.set("referrer",window.location.href),s.href=i.toString()}};return document.body.addEventListener("click",e),()=>document.body.removeEventListener("click",e)},[]),u.jsx("footer",{className:"py-10 md:py-14 bg-muted",children:u.jsxs("div",{className:"container max-w-4xl mx-auto px-4 md:px-6",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 mb-8 text-center md:text-left",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"font-medium mb-3 text-foreground text-sm uppercase tracking-wider",children:"À propos"}),u.jsxs("nav",{className:"flex flex-col gap-2",children:[u.jsx("a",{href:"https://www.democratie.ch/",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary transition-colors text-sm",children:"Fondation pour la démocratie directe"}),u.jsx("a",{href:"https://www.democratie.ch/contact",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary transition-colors text-sm",children:"Contact"}),u.jsx("a",{href:"https://www.democratie.ch/dons",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary transition-colors text-sm",children:"Soutenir la fondation"}),u.jsx("a",{href:"https://www.democratie.ch/confidentialite",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary transition-colors text-sm",children:"Protection des données"})]})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"font-medium mb-3 text-foreground text-sm uppercase tracking-wider",children:"Campagne de votation"}),u.jsxs("nav",{className:"flex flex-col gap-2",children:[u.jsx("a",{href:"https://non-initiative-ssr.community/participer#commitment",className:"text-muted-foreground hover:text-primary transition-colors text-sm",children:"Participer"}),u.jsx("a",{href:"https://non-initiative-ssr.community/newsletter#newsletter-form",className:"text-muted-foreground hover:text-primary transition-colors text-sm",children:"Newsletter"}),u.jsx("a",{href:"https://www.democratie.ch/dons-contre-initiative-ssr?rnw-payment_type=onetime&rnw-amount=120&mtm_campaign=community_webseite_FR&mtm_source=button_top",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary transition-colors text-sm",children:"Dons"})]})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"font-medium mb-3 text-foreground text-sm uppercase tracking-wider",children:"Dons"}),u.jsxs("div",{className:"text-muted-foreground text-sm space-y-2",children:[u.jsx("p",{children:"Compte de dons"}),u.jsx("p",{children:"Public Beta, 4001 Bâle"}),u.jsx("p",{children:"IBAN : CH16 0900 0000 1532 9904 6"}),u.jsx("a",{href:"https://form.demokratie.ch/commande-bulletin",target:"_blank",rel:"noopener noreferrer",className:"inline-block mt-2 px-3 py-1.5 text-xs font-medium bg-primary/10 hover:bg-primary/20 text-primary rounded-md transition-colors",children:"Commander un bulletin de versement"}),u.jsx("p",{className:"text-xs mt-3",children:"La gestion des dons à la Fondation pour la démocratie directe est assurée par l'Association Public Beta qui est exonérée d'impôts et dont le siège est situé à Bâle."})]})]})]}),u.jsxs("p",{className:"text-muted-foreground text-sm mb-6 text-center",children:["Demandes des médias : Daniel Graf, Fondation pour la démocratie directe, ",u.
445jsx("a",{href:"tel:+41765880968",className:"hover:text-primary transition-colors",children:"+41 76 588 09 68"}),", ",u.jsx("a",{href:"mailto:[email protected]",className:"hover:text-primary transition-colors",children:"[email protected]"})]}),u.jsx("div",{className:"border-t border-border pt-5",children:u.jsx("div",{className:"flex flex-col md:flex-row md:justify-center gap-2 text-xs text-muted-foreground text-center",children:u.jsxs("p",{children:["© 2025 ",u.jsx("a",{href:"https://www.democratie.ch/contact",target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary transition-colors",children:"Fondation pour la démocratie directe"})]})})})]})})),KM=(t,e,n)=>Xs({queryKey:["blog-posts",t,e,n],queryFn:async()=>{let r=We.from("blog_posts").select("*").eq("is_published",!0).order("published_at",{ascending:!1});t&&(r=r.eq("category",t)),r=r.neq("category","qa"),e&&(r=r.limit(e));const{data:s,error:i}=await r;if(i)throw i;return s}}),pW=t=>Xs({queryKey:["blog-post",t],queryFn:async()=>{const{data:e,error:n}=await We.from("blog_posts").select("*").eq("slug",t).eq("is_published",!0).maybeSingle();if(n)throw n;return e},enabled:!!t}),mW=(t,e,n=3)=>Xs({queryKey:["related-posts",t,e],queryFn:async()=>{const{data:r,error:s}=await We.from("blog_posts").select("*").eq("is_published",!0).eq("category",e).neq("category","qa").neq("id",t).order("published_at",{ascending:!1}).limit(n);if(s)throw s;if(r&&r.length>=n)return r;const i=n-((r==null?void 0:r.length)||0),o=[t,...(r==null?void 0:r.map(c=>c.id))||[]],{data:a,error:l}=await We.from("blog_posts").select("*").eq("is_published",!0).neq("category","qa").not("id","in",`(${o.join(",")})`).order("published_at",{ascending:!1}).limit(i);if(l)throw l;return[...r||[],...a||[]]},enabled:!!t}),rl={news:"News",podcast:"Podcast",anleitung:"Anleitung",qa:"Q&A",medien:"Medien"},xa={demokratie:"Demokratie",medien:"Medien",srg:"SRG",finanzierung:"Finanzierung",grundlagen:"Grundlagen"},Ek={news:"bg-blue-100 text-blue-800",podcast:"bg-purple-100 text-purple-800",anleitung:"bg-green-100 text-green-800",qa:"bg-orange-100 text-orange-800",medien:"bg-pink-100 text-pink-800"},gW={image:"Text/Bild",text:"Nur Text"},yW={check:"Check",review:"Review",critical:"Kritisch"},SC={check:"bg-green-500",review:"bg-amber-400",critical:"bg-red-500"},Ck=({post:t,featured:e=!1})=>t.category==="qa"?u.jsx(Mt,{to:`/fragen-antworten/${t.slug}`,onClick:()=>window.scrollTo(0,0),className:`group block bg-card rounded-xl overflow-hidden border border-border shadow-card hover:shadow-card-hover hover:border-primary/30 hover:-translate-y-1 transition-all duration-300 ${e?"md:col-span-2":""}`,children:u.jsxs("div",{className:`p-6 ${e?"md:p-8":""} flex flex-col justify-between h-full min-h-[240px] ${e?"min-h-[280px]":""}`,children:[u.jsxs("div",{className:"flex-1",children:[u.jsx("span",{className:`inline-block px-3 py-1 text-xs font-semibold rounded-full mb-4 ${Ek.qa}`,children:rl.qa}),u.jsx("h3",{className:`font-sans font-bold text-foreground mb-4 leading-tight group-hover:text-primary transition-colors truncate ${e?"text-2xl md:text-3xl":"text-xl"}`,children:t.title}),t.excerpt&&u.jsx("p",{className:`text-muted-foreground leading-relaxed ${e?"text-lg":"text-base"}`,children:t.excerpt})]}),u.jsx("div",{className:"mt-4 text-primary text-sm font-medium group-hover:underline",children:"Mehr erfahren →"})]})}):u.jsxs(Mt,{to:`/blog/${t.slug}`,onClick:()=>window.scrollTo(0,0),className:`group block bg-card rounded-xl overflow-hidden border border-border shadow-card hover:shadow-card-hover hover:border-primary/30 hover:-translate-y-1 transition-all duration-300 ${e?"md:col-span-2":""}`,children:[u.jsx("div",{className:`relative overflow-hidden bg-muted ${e?"aspect-[21/9]":"aspect-[16/9]"}`,children:t.featured_image?u.jsx("img",{src:t.featured_image,alt:t.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}):u.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/10 to-secondary/10",children:u.jsx("span",{className:"text-4xl opacity-50",children:"📝"})})}),u.jsxs("div",{className:"p-4",children:[u.jsx("span",{className:"inline-block px-3 py-1 text-xs font-semibold rounded-full bg-primary text-primary-foreground mb-2",children:rl[t.category]}),u.jsx("h3",{className:`font-sans font-semibold text-foreground mb-1.5 leading-snug group-hover:text-primary transition-colors ${e?"text-2xl":"text-lg"}`,children:t.title}),t.excerpt&&u.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed line-clamp-2",children:t.excerpt})]})]}),Nk=({post:t,index:e=0})=>{const n=t.category==="qa"?`/fragen-antworten/${t.slug}`:`/blog/${t.slug}`;return u.jsxs(Mt,{to:n,onClick:()=>window.scrollTo(0,0),className:"group block bg-card rounded-xl border border-border/50 hover:border-primary/30 hover:shadow-lg transition-all duration-300 animate-fade-up p-5 md:p-6",style:{animationDelay:`${e*80}ms`},children:[u.jsx("div",{className:"flex items-center gap-2 mb-3",children:u.jsx("span",{className:`px-3 py-1 text-xs font-semibold rounded-full ${Ek[t.category]}`,children:rl[t.category]})}),u.jsx("h3",{className:"font-sans font-semibold text-foreground leading-tight mb-2 group-hover:text-primary transition-colors duration-300 text-xl md:text-2xl",children:t.title}),t.excerpt&&u.jsx("p",{className:"text-muted-foreground leading-relaxed text-sm md:text-base mb-3 line-clamp-3",children:t.excerpt}),u.jsxs("div",{className:"flex items-center text-primary opacity-0 group-hover:opacity-100 transition-all duration-300",children:[u.jsx("span",{className:"text-sm font-medium mr-2",children:"Weiterlesen"}),u.jsx(Pt,{className:"w-4 h-4 transition-transform group-hover:translate-x-1"})]})]})};function Ye({className:t,...e}){return u.jsx("div",{className:Z("animate-pulse rounded-md bg-muted",t),...e})}const vW=()=>{const{data:t,isLoading:e}=KM(void 0,3,!0);return e?u.jsx("section",{className:"py-12 md:py-16 bg-background",children:u.jsxs("div",{className:"container max-w-7xl mx-auto px-4 md:px-6",children:[u.jsxs("div",{className:"flex items-center justify-between mb-8",children:[u.jsx(Ye,{className:"h-8 w-48"}),u.jsx(Ye,{className:"h-6 w-32"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3].map(n=>u.jsxs("div",{className:"rounded-xl overflow-hidden border border-border",children:[u.jsx(Ye,{className:"aspect-[16/9]"}),u.jsxs("div",{className:"p-5 space-y-3",children:[u.jsx(Ye,{className:"h-4 w-24"}),u.jsx(Ye,{className:"h-6 w-full"}),u.jsx(Ye,{className:"h-4 w-3/4"})]})]},n))})]})}):!t||t.length===0?null:u.jsx("section",{className:"py-10 md:py-12 bg-background",children:u.jsxs("div",{className:"container max-w-7xl mx-auto px-4 md:px-6",children:[u.jsxs("div",{className:"flex items-center justify-between mb-8",children:[u.jsx("h2",{className:"font-sans text-2xl md:text-3xl font-semibold text-foreground",children:"Aktuelles"}),u.jsxs(Mt,{to:"/blog",onClick:()=>window.scrollTo(0,0),className:"text-primary hover:text-primary/80 font-medium text-sm flex items-center gap-1 group",children:["Alle Beiträge",u.jsx(Pt,{className:"w-4 h-4 transition-transform group-hover:translate-x-1"})]})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.slice(0,3).map((n,r)=>n.homepage_style==="text"?u.jsx(Nk,{post:n,index:r},n.id):u.jsx(Ck,{post:n},n.id))})]})})},_k=Bh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-accent text-accent-foreground hover:bg-accent/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-muted hover:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/90",ghost:"hover:bg-muted hover:text-foreground",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground hover:bg-primary/90"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ve=b.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const o=r?g3:"button";return u.jsx(o,{className:Z(_k({variant:e,size:n,className:t})),ref:i,...s})});ve.displayName="Button";const xW="/assets/pascal-nufer-new-Bkrzrq37.png",Gn=()=>u.jsx("section",{className:"bg-accent py-8 md:py-10",children:u.jsxs("div",{className:"container max-w-5xl mx-auto px-4 md:px-6",children:[u.jsx("h2",{className:"font-handwriting font-bold text-4xl md:text-5xl lg:text-6xl text-center text-foreground mb-6 md:mb-8",children:"100 000 discussions – participez dès maintenant"}),u.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-center gap-6 md:gap-10",children:[u.jsxs("div",{className:"text-center md:text-left max-w-xl order-2 md:order-1",children:[u.jsx("blockquote",{className:"font-caveat text-xl md:text-2xl lg:text-3xl text-foreground leading-snug mb-4",children:"« En tant que journaliste, je parle autour de moi de l'initiative de réduction de moitié et des dangers des fake news. Cela représente au minimum cinq discussions par semaine.»"}),u.jsx("cite",{className:"block text-sm text-muted-foreground not-italic mb-6",children:"— Pascal Nufer, ancien correspondant de la SRF et professeur de journalisme à la ZHAW"}),u.jsx(ve,{asChild:!0,size:"lg",className:"bg-accent-foreground hover:bg-accent-foreground
445/90 text-accent font-semibold",children:u.jsx(Mt,{to:"/participer",children:"Je participe"})})]}),u.jsx("div",{className:"flex-shrink-0 order-1 md:order-2 flex justify-center",children:u.jsx("img",{src:xW,alt:"Pascal Nufer, ehemaliger SRF-Korrespondent für Asien",className:"w-32 md:w-48 lg:w-56"})})]})]})}),vv=768;function bW(){const[t,e]=b.useState(void 0);return b.useEffect(()=>{const n=window.matchMedia(`(max-width: ${vv-1}px)`),r=()=>{e(window.innerWidth<vv)};return n.addEventListener("change",r),e(window.innerWidth<vv),()=>n.removeEventListener("change",r)},[]),!!t}const wW=({id:t,title:e,subtitle:n,badge:r,badgeVariant:s="yellow",children:i,className:o=""})=>{const a=s==="blue"?"bg-sky-500 text-white px-4 py-2 text-xs font-bold mb-4 rotate-[-2deg] shadow-md border-2 border-sky-600":"bg-yellow-400 text-yellow-900 px-4 py-2 text-xs font-bold mb-4 rotate-[-2deg] shadow-md border-2 border-yellow-500";return u.jsx("section",{id:t,className:`py-8 md:py-10 ${o}`,children:u.jsxs("div",{className:"container max-w-6xl mx-auto px-4 md:px-6",children:[u.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[r&&u.jsx("div",{className:`inline-flex items-center gap-2 ${a}`,children:r}),u.jsx("h2",{className:"font-sans text-2xl md:text-3xl font-semibold text-foreground mb-2 leading-tight",children:e}),n&&u.jsx("p",{className:"text-muted-foreground text-base max-w-2xl mx-auto",children:n})]}),i]})})},kW=[{id:"arg-a1-200-franken-fr",type:"argument",title:"« 200 francs, c'est bien assez »",trigger:"« 200 francs, c'est bien assez. La SSR doit simplement économiser comme tout le monde. »",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Comment réagis-tu ?",options:[{id:"q1-a",text:"« La SSR fait déjà des économies. »",einordnung:"Montre de la compréhension, mais reste dans la logique d'économiser.",quality:"neutral"},{id:"q1-b",text:"« 200 francs, ça ressemble à une mesure d'économies, mais c'est, en réalité, diviser son budget par deux. »",einordnung:"Très bien adaptée car clarifie le malentendu de manière factuelle.",quality:"good"},{id:"q1-c",text:"« Pour moi, la question n'est pas tant le montant que l'accès à une information fiable. »",einordnung:"Bien car affirme une position et ouvre la discussion.",quality:"good"}]},{context:"Ton vis-à-vis dit :",question:"« On peut bien raboter un peu partout. »",options:[{id:"q2-a",text:"« Ici, on ne rabote pas un peu, mais on coupe massivement. »",einordnung:"Très bien adaptée car claire, factuelle, met en évidence l'ampleur réelle.",quality:"good"},{id:"q2-b",text:"« Avec deux fois moins de moyens, c'est surtout l'information régionale qui est affectée. »",einordnung:"Bien car concrète et facile à comprendre.",quality:"good"},{id:"q2-c",text:"« Jusqu'à présent, chaque suppression d'émission a suscité un tollé. »",einordnung:"Apporte du contexte, mais déplace le débat vers des émissions particulières.",quality:"neutral"}]}],einordnung:{title:"Résumé",points:["Réduction massive du budget de la SSR","Moins d'information régionale","Les langues minoritaires sont particulièrement touchées","Influence accrue des médias privés","Dépendance accrue envers des contenus étrangers"]},abschluss:{points:[],motivation:"L'enjeu : une information forte et indépendante, provenant de toute la Suisse."},relatedContent:{arguments:["Argument A2"],situations:["Situation famille / autour de la table"],grundlagen:["Base G1"]}},{id:"arg-a3-nutzung-fr",type:"argument",title:"« Je n'utilise pas du tout la SSR »",trigger:"« Je regarde ou j'écoute très peu la SSR. Pourquoi devrais-je payer pour cela ? »",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Comment réagis-tu ?",options:[{id:"q1-a",text:"« De nombreux médias privés utilisent aussi des contenus de la SSR. »",einordnung:"Montre de la compréhension, mais reste dans une logique d'utilisation.",quality:"neutral"},{id:"q1-b",text:"« Il ne s'agit pas d'utilisation, mais d'une infrastructure. »",einordnung:"Très bien : déplace la perspective vers l'infrastru
445cture.",quality:"good"},{id:"q1-c",text:"« Tu en profites malgré tout. »",einordnung:"Bien : met en évidence l'utilité indirecte.",quality:"good"}]},{context:"L'interlocuteur dit :",question:"« Je m'informe en ligne. »",options:[{id:"q2-a",text:"« Justement là, on a besoin de références fiables. »",einordnung:"Très bien : montre la fonction de la SSR dans l'espace numérique.",quality:"good"},{id:"q2-b",text:"« C'est précisément pour cela qu'il est important que la SSR continue de proposer des contenus en ligne. »",einordnung:"Bien : renvoie à l'offre en ligne de la SSR.",quality:"good"},{id:"q2-c",text:"« La SSR doit répondre à tous les comportements d'utilisation, aussi bien hors ligne qu'en ligne. »",einordnung:"Bien : montre l'étendue de l'offre de la SSR.",quality:"neutral"}]}],einordnung:{title:"Résumé",points:["La SSR n'est pas un abonnement, mais une infrastructure","Une base factuelle commune pour les votations","La SSR est présente sur différents canaux","Protection contre la désinformation","Utilité également pour les personnes qui l'utilisent peu"]},abschluss:{points:[],motivation:"L'enjeu : la démocratie ne fonctionne pas selon une logique d'abonnement."},relatedContent:{arguments:["Argument A5"],situations:["Situation cercle d'amis"],grundlagen:["Base G2"]}},{id:"arg-a6-zusammenhalt-fr",type:"argument",title:"« La cohésion de la Suisse est en jeu »",trigger:"« Pourquoi devrais-je payer pour d'autres régions linguistiques ? »",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Comment réagis-tu ?",options:[{id:"q1-a",text:"« On ne perçoit souvent pas l'utilité au quotidien. »",einordnung:"Montre de la compréhension, mais reste défensive.",quality:"neutral"},{id:"q1-b",text:"« Sans la SSR, il n'y aurait pas d'espace public commun. »",einordnung:"Très bien : met en évidence la fonction de cohésion.",quality:"good"},{id:"q1-c",text:"« C'est une question de solidarité. »",einordnung:"Correct sur le fond, mais peut paraître moralisateur.",quality:"neutral"}]},{context:"L'interlocuteur dit :",question:"« Les médias privés pourraient s'en charger. »",options:[{id:"q2-a",text:"« Ils couvrent très peu les autres régions linguistiques. »",einordnung:"Bien : montre la lacune du marché.",quality:"good"},{id:"q2-b",text:"« Ce n'est pas rentable sur le plan économique. »",einordnung:"Très bien : explique le problème structurel.",quality:"good"},{id:"q2-c",text:"« Les médias privés fonctionnent toutefois, contrairement à la SSR, selon une logique de profit. »",einordnung:"Bien : souligne que les médias privés constituent une alternative limitée.",quality:"neutral"}]}],einordnung:{title:"Résumé",points:["La Suisse est quadrilingue","La SSR relie les régions","Les minorités en dépendent particulièrement","Peu ou pas d'alternatives viables sur le marché","Risque de fragmentation médiatique"]},abschluss:{points:[],motivation:"L'enjeu : la cohésion ne se crée pas d'elle-même."},relatedContent:{arguments:[],situations:[],grundlagen:[]}}],SW=[{id:"sit-familie-fr",type:"situation",title:"À table en famille",setting:`Dimanche midi, un repas en famille. La table n'est pas encore desservie : il y a des tasses de café, il reste du dessert, un bol de biscuits... L'ambiance est calme, un peu somnolente. On parle de tout et de rien – travail, projets de vacances, quelque chose entendu aux informations.
446
447Tu écoutes, tu parles peu. C'est convivial. Personne ne cherche à se disputer.`,trigger:"« Franchement : la SSR coûte beaucoup trop cher. 200 francs, c'est bien suffisant. »",triggerContext:"Puis ton oncle dit, en provocant, presque en passant :",triggerOutro:`Quelques personnes acquiescent. Personne ne répond tout de suite. La phrase reste un instant en suspens.
448
449Tu te rends compte que soit la conversation continue comme si de rien n'était, soit tu interviens.`,dialogSteps:[{stepLabel:"Comment entres-tu dans la discussion ?",question:"Comment entres-tu dans la discussion ?",variants:[{id:"d1-a",label:"contextualiser calmement",text:"« 200 francs, ça semble être des économies – mais en réalité, on retirerait presque la moitié du budget à la SSR. »",consequence:"Ta tante lève les yeux. Ce fait n'était pas clair pour tout le monde."},{id:"d1-b",label:"rester personnel",text:"« Je suis moins préoccupé·e par le montant, que par la question de savoir d'où viennent nos informations. »",consequence:"La discussion devient plus personnelle. Tout le monde n'est pas d'accord, mais on t'écoute."}]},{stepLabel:"Décision 2",sceneIntro:"Un·e membre de la famille intervient pendant qu'un·e autre apporte de nouvelles tasses de café :",question:"« Mais a-t-on encore vraiment besoin d'une SSR aussi grande aujourd'hui ? Il y a tellement d'autres offres. »",variants:[{id:"d2-a",label:"évoquer la réalité numérique",text:"« Justement en ligne, il faut des informations fiables venant de Suisse. Sinon, les intox s'imposent plus rapidement. »",consequence:"Le ton devient plus sérieux. Une personne acquiesce."},{id:"d2-b",label:"mettre les régions en avant",text:"« Sans la SSR, il y aurait beaucoup moins d'informations des cantons et des petites régions linguistiques. »",consequence:"Une nouvelle perspective s'installe. Un court silence."}]},{stepLabel:"Décision 3",sceneIntro:"Ton oncle se penche en arrière, presque conciliant :",question:"« De toute façon, chacun·e ne regarde plus que ce qui l'intéresse. »",variants:[{id:"d3-a",label:"conclure calmement",text:"« C'est possible. Mais lors des votations, ça aide de ne pas partir de faits complètement différents. »",consequence:"La discussion se termine calmement. Vous n'êtes pas d'accord, mais respectueux."},{id:"d3-b",label:"laisser volontairement ouvert",text:"« Peut-être. Pour moi, l'important est qu'il existe au moins une référence fiable. »",consequence:"Le sujet reste présent. Il reviendra plus tard."}]}],abschlussStory:{intro:"Le soir, alors que tu es déjà rentré·e chez toi, ton téléphone sonne. Un message de ton oncle :",message:"« À propos de tout à l'heure à table. J'y ai repensé. Finalement, ces 200 francs, ce n'est sans doute pas si simple. »",outro:"Tu souris. Pour l'instant, ça suffit."},beobachtung:{intro:void 0,points:[],outro:"Une conversation comme celle-ci agit rarement immédiatement. Souvent, son effet se déploie plus tard – discrètement, dans la réflexion, loin de la table."},abschluss:{text:`Les discussions familiales ne sont ni des débats ni des votations. Il ne s'agit pas de convaincre, mais de faire naître des réflexions.
450
451Parfois, il suffit qu'une phrase reste en suspens.`,pointsIntro:void 0,points:[]},feedbackLabels:["Important pour la discussion ?","Contenu correct ?","Utile pour tes conversations ?"],relatedContent:{arguments:["A1 – « 200 francs, c'est bien suffisant »"],situations:["S2 – Au travail"],grundlagen:["G1 – L'initiative expliquée"]}},{id:"sit-freunde-fr",type:"situation",title:"Entre amis",setting:"Le soir, quelqu'un apporte des boissons. Vous êtes assis ensemble, les téléphones posés sur la table.",trigger:"« Honnêtement : je m'informe en ligne. Je n'ai pas vraiment besoin de la SSR. »",triggerContext:"Un ami dit :",triggerOutro:"Quelques hochements de tête. Le ton est sûr de lui, pas agressif.",dialogSteps:[{stepLabel:"Comment réagis-tu ?",question:"Comment réagis-tu ?",variants:[{id:"d1-a",label:"demander tranquillement",text:"« Où est-ce que tu t'informes le plus souvent ? »",consequence:"La discussion reste détendue. Ton ami développe."},{id:"d1-b",label:"contextualiser directement",text:"« Être en ligne ne veut pas automatiquement dire être bien informé. »",consequence:"Un léger sourire. C'est clair : une discussion s'engage."}]},{stepLabel:"Décision 2",sceneIntro:"Un autre ami intervient :",question:"« On peut comparer plusieurs sources. Du coup, on n'a plus besoin de la SSR. »",variants:[{id:"d2-a",label:"expliquer calmement",text:"« Pour comparer, il faut des références communes – sinon chacun compare autre chose. »",consequence:"Un court silence. Quelqu'un réfléchit visiblement."},{id:"d2-b",label:"répondre avec humour",text:"« Peut-être – mais TikTok ne fait pas d'analyse de votation. »",consequence:"Rires. L'ambiance reste bonne."}]},{stepLabel:"Décision 3",sceneIntro:"Ton ami se penche en arrière :",question:"« Au final, c'est une question de goût. »",variants:[{id:"d3-a",label:"te positionner clairement",text:"« Pour moi, non. Sans une SSR forte, notre démocratie devient plus vulnérable. »",consequence:"Bref silence. Puis la discussion reprend."},{id:"d3-b",label:"laisser ouvert",text:"« Peut-être. Pour moi, c'est quand même un non. »",consequence:"Pas de dispute. Mais le sujet reste présent."}]}],abschlussStory:void 0,beobachtung:{intro:"Quel que soit le chemin choisi :",points:["Tu es resté authentique","Tu as apporté une perspective claire","L'ambiance ne s'est pas dégradée"],outro:"Entre amis, la crédibilité compte plus que l'argument parfait."},abschluss:{text:"Les discussions entre amis peuvent être directes et imparfaites. On convainc rarement sur-le-champ. Mais on influence la manière dont quelqu'un continue de réfléchir.",pointsIntro:void 0,points:[]},feedbackLabels:["Important pour la discussion ?","Contenu correct ?","Utile pour tes conversations ?"],relatedContent:{arguments:[],situations:[],grundlagen:[]}},{id:"sit-nachbarschaft-fr",type:"situation",title:"Dans le voisinage",setting:`Fin d'après-midi dans le quartier. Tu es dehors devant l'immeuble, le soleil est déjà bas. Quelqu'un arrose des plantes, une autre personne passe avec des sacs de courses. On se connaît, on échange quelques mots – rien de profond.
452
453La discussion dérive brièvement sur la hausse des prix.`,trigger:"« Franchement, 200 francs pour la SSR devraient suffire. Il faut bien économiser partout. »",triggerContext:"Puis une voisine dit, plus en soupirant qu'en militant :",triggerOutro:`Personne ne contredit. La phrase semble raisonnable, presque évidente.
454
455Tu sens que ce n'est pas une prise de position politique – plutôt un ressenti du quotidien.`,dialogSteps:[{stepLabel:"Comment entres-tu dans la discussion ?",question:"Comment entres-tu dans la discussion ?",variants:[{id:"d1-a",label:"montrer de la compréhension, puis contextualiser",text:"« Oui, faire des économies est un sujet partout. Mais pour la SSR, ça ne veut pas dire un peu moins – ça veut dire beaucoup moins de contenu. »",consequence:"La voisine a un bref moment de surprise. La discussion reste calme."},{id:"d1-b",label:"poser une question factuelle",text:"« Tu parles plutôt du montant – ou de ce que la SSR devrait encore pouvoir faire ? »",consequence:"L'affirmation devient plus concrète. On passe du ressenti au fond."}]},{stepLabel:"Décision 2",sceneIntro:"Un voisin intervient en posant son vélo :",question:"« Mais beaucoup de gens ne regardent plus la télévision. »",variants:[{id:"d2-a",label:"élargir calmement",text:"« C'est vrai – mais la SSR, ce n'est plus seulement la télévision. Beaucoup de personnes l'utilisent surtout en ligne. »",consequence:"L'argument paraît moins tranché. Quelqu'un acquiesce."},{id:"d2-b",label:"souligner la fonction démocratique",text:"« Il s'agit moins de regarder que d'avoir des informations fiables avant les votations. »",consequence:"La discussion devient un instant plus sérieuse."}]},{stepLabel:"Décision 3",sceneIntro:"La voisine dit, déjà à moitié sur le départ :",question:"« Au final, chacun doit décider pour soi. »",variants:[{id:"d3-a",label:"conclure calmement",text:"« Bien sûr. Pour moi, l'important est de ne pas économiser au mauvais endroit. »",consequence:"Pas de contradiction. Le sujet reste ouvert."},{id:"d3-b",label:"laisser volontairement ouvert",text:"« Je trouve simplement que cela va au-delà de ces 200 francs. »",consequence:"La phrase reste en tête, même après la séparation."}]}],abschlussStory:{intro:"Quelques jours plus tard, tu croises la voisine par hasard devant les boîtes aux lettres. Elle dit :",message:"« J'ai repensé à ce que tu disais sur la SSR. Tu avais raison – ce n'est sans doute pas si simple que ça avec les économies. »",outro:"Vous échangez encore quelques mots. Le sujet n'est pas clos – mais quelque chose a bougé."},beobachtung:{intro:void 0,points:[],outro:"Les discussions de voisinage sont courtes, anodines – et c'est justement pour cela qu'elles peuvent être efficaces. Une seule phrase peut suffire à ébranler une évidence apparente."},abschluss:{text:"Toutes les conversations n'ont pas besoin de profondeur. Parfois, un simple changement de perspective suffit, au passage.",pointsIntro:void 0,points:[]},feedbackLabels:["Important pour la discussion ?","Contenu correct ?","Utile pour tes conversations ?"],relatedContent:{arguments:[],situations:[],grundlagen:[]}}],EW=[{id:"grund-90sek-fr",type:"grundlagen",title:"L'initiative expliquée",hilftDir:{intro:"Utile pour la discussion lorsqu'on te dit :",triggers:["« Honnêtement, je ne sais pas vraiment de quoi il s'agit avec cette initiative. »","« C'est beaucoup trop compliqué pour moi. »"]},teile:[{title:"Que veut cette initiative ?",intro:"L'initiative SSR exige :",points:["de **réduire massivement** la redevance radio-TV","concrètement de **335 francs/an** actuellement à **200 francs/an**","d'en **exonérer complètement les entreprises**"],outro:"Son objectif est clairement d'**affaiblir la SSR**."},{title:"Qu'est-ce que cela signifie concrètement ?",intro:"Moins d'argent ne signifie pas :",points:["devenir un peu plus efficace","supprimer quelques émissions"],outro:"Mais un **budget réduit de moitié**, moins de personnel, moins de programmes, moins d'informations du terrain. La SSR devrait **réduire radicalement** ses prestations."},{title:"En quoi cela a-t-il une importance politique ?",intro:"La SSR a un **mandat de service public** :",points:["informer sur les votations","couvrir m
455édiatiquement toutes les régions","proposer des programmes dans toutes les langues nationales"],outro:"Ces prestations sont coûteuses, commercialement non rentables et **primordiales pour la démocratie**. Réduire son budget de moitié touche justement le cœur de sa mission."}],quizQuestions:[{question:"Quel est l'impact principal de l'initiative ?",options:[{id:"q1-a",text:"« Elle force la SSR à devenir plus efficace. »",einordnung:"Cela semble plausible, mais davantage d'efficacité ne suffit pas à compenser un budget divisé par 2.",isCorrect:!1},{id:"q1-b",text:"« Elle réduit de moitié les moyens financiers de la SSR. »",einordnung:"Exact. C'est exactement le but de l'initiative.",isCorrect:!0},{id:"q1-c",text:"« Elle économise surtout dans le divertissement. »",einordnung:"C'est illusoire. Tous les domaines de la SSR seraient touchés.",isCorrect:!1}]},{question:"Quelles émissions seraient particulièrement mises sous pression ?",options:[{id:"q2-a",text:"« Les informations régionales dans les quatre langues nationales, et dans la langue des signes. »",einordnung:"Oui. Ces émissions sont coûteuses, mais essentielles à la cohésion nationale.",isCorrect:!0},{id:"q2-b",text:"« Uniquement les droits coûteux de retransmission sportive. »",einordnung:"Réponse un peu courte. Tous les domaines seraient touchés.",isCorrect:!1},{id:"q2-c",text:"« En fait, aucune – le marché y remédiera. »",einordnung:"Réponse illusoire. Les médias privés sont incapables de reprendre la plupart de ces émissions.",isCorrect:!1}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:["A1 – 200 francs, c'est bien assez","A2 – Coupe rase pour le service public"],situations:["S1 – À table en famille"],grundlagen:[]}},{id:"grund-service-fr",type:"grundlagen",title:"Le service public expliqué",hilftDir:{intro:"Utile pour la discussion lorsqu'on te dit :",triggers:["« À quoi sert le service public ? Le marché pourrait aussi s'en charger. »","« La SSR devrait simplement se limiter à l'essentiel. »"]},teile:[{title:"Que signifie le service public ?",intro:"Le service public, c'est :",points:["des médias pour **toutes et tous**, pas seulement pour des client·e·s payant·e·s","des offres qui **ne sont pas orientées vers le profit**","un mandat défini par la loi"],outro:"L'accent est mis sur le **bien commun**, et non sur les clics ou le rendement."},{title:"Que fait partie du service public de la SSR ?",intro:"La SSR doit :",points:["informer de manière factuelle et équilibrée","expliquer et contextualiser les processus politiques","couvrir **toutes les régions**","proposer des contenus dans **toutes les langues nationales**"],outro:"Ce mandat s'applique indépendamment de la taille ou de l'attractivité économique d'une région."},{title:"Pourquoi le marché ne peut-il pas simplement s'en charger ?",intro:"De nombreuses prestations de service public sont :",points:["coûteuses","exigeantes","difficilement finançables"],outro:"Les médias privés doivent fonctionner de manière rentable. Ils se concentrent là où l'audience et les revenus sont possibles. Le service public ne peut pas être remplacé par des acteurs privés."}],quizQuestions:[{question:"Qu'est-ce qui distingue le service public des médias privés ?",options:[{id:"q1-a",text:"« Le service public est de la propagande étatique. »",einordnung:"Un reproche fréquent – en réalité, la SSR est indépendante et légalement tenue à l'équilibre.",isCorrect:!1},{id:"q1-b",text:"« Le service public sert le bien commun, les médias privés suivent une logique de profit. »",einordnung:"C'est précisément sa raison d'être.",isCorrect:!0},{id:"q1-c",text:"« Le service public fausse la concurrence. »",einordnung:"Argument répandu – mais le service public garantit une infrastructure de base, pas des parts de marché.",isCorrect:!1}]},{question:"Dans quels domaines le service public est-il particulièrement pertinent ?",options:[{id:"q2-a",text:"« Information politique, couverture régionale dans toutes les langues nationales. »",einordnung:"Oui. C'est là que le service public est central, car il s'adresse à toutes et tous.",isCorrect:!0},{id:"q2-b",text:"« Uniquement le divertissement. »",einordnung:"Idée compréhensible, mais le divertissement n'en est qu'un élément.",isCorrect:!1},{id:"q2-c",text:"« Uniquement les publics âgés. »",einordnung:"Hypothèse fréquente, mais le service public s'adresse volontairement à toutes les générations.",isCorrect:!1}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:[],situations:[],grundlagen:[]}},{id:"grund-demokratie-fr",type:"grundlagen",title:"SSR & démocratie",hilftDir:{intro:"Utile pour la discussion lorsqu'on te dit :",triggers:["« Je me fais ma propre opinion. Je n'ai pas besoin de la SSR pour ça. »","« Aujourd'hui, il existe suffisamment d'autres sources d'information. »"]},teile:[{title:"De quoi une démocratie directe a-t-elle besoin ?",intro:"En Suisse, nous votons régulièrement sur des objets complexes. Cela nécessite :",points:["des informations fiables","de la mise en perspective plutôt que des gros titres","des points de vue différents","une base factuelle commune"],outro:"Sans cela, la formation de l'opinion devient aléatoire ou biaisée."},{title:"Quel rôle joue la SSR dans ce contexte ?",intro:"La SSR :",points:["informe indépendamment des partis et des groupes économiques","met en perspective les objets politiques","donne la parole à toutes les voix pertinentes","couvre l'actualité de manière continue dans les régions"],outro:"Elle crée un **espace d'information commun** pour l'ensemble de la population."},{title:"Que se passe-t-il sans une SSR forte ?",intro:"Sans une SSR forte :",points:["les médias privés influencent davantage la formation de l'opinion","la visibilité dépend des clics et des algorithmes","la polarisation et la désinformation augmentent"],outro:"Dans une démocratie directe, cela représente un risque structurel."}],quizQuestions:[{question:"Pourquoi l'indépendance est-elle si centrale ?",options:[{id:"q1-a",text:"« L'indépendance protège contre les pressions politiques et économiques. »",einordnung:"C'est précisément pour cela que le mode de financement est déterminant.",isCorrect:!0},{id:"q1-b",text:"« L'indépendance n'est plus pertinente aujourd'hui. »",einordnung:"Une idée compréhensible – mais aujourd'hui, elle est plus importante que jamais.",isCorrect:!1},{id:"q1-c",text:"« L'indépendance rend les médias ennuyeux. »",einordnung:"Un point intéressant – mais l'information doit avant tout orienter, pas divertir.",isCorrect:!1}]},{question:"Quel est le plus grand risque démocratique en cas d'affaiblissement de la SSR ?",options:[{id:"q2-a",text:"« Moins de divertissement à la télévision. »",einordnung:"Ce serait perceptible, mais ce n'est pas l'enjeu principal.",isCorrect:!1},{id:"q2-b",text:"« Davantage d'influence de la logique des clics et des plateformes. »",einordnung:"Oui. Cela transforme profondément la formation de l'opinion.",isCorrect:!0},{id:"q2-c",text:"« Aucun – d'autres médias prendront le relais. »",einordnung:"Ce serait souhaitable, mais l'expérience montre que ce n'est pas réaliste.",isCorrect:!1}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:[],situations:[],grundlagen:[]}}],EC=[{id:"video-confederation-fr",title:"Initiative SSR",subtitle:"La Confédération",youtubeId:"_1XF4zWYPrI",available:!0},{id:"video-easyvote-fr",title:"Initiative SSR",subtitle:"easyvote",youtubeId:"jUtz7PWYy-8",available:!0},{id:"video-davos-fr",title:"Davos 958.5?",subtitle:"Sauvons notre culture",
455youtubeId:"5JX5CpDjltU",available:!0}],Il={arguments:[{id:"arg-a1-200-franken-fr",title:"« 200 francs, c'est bien assez »",available:!0},{id:"arg-a3-nutzung-fr",title:"« Je n'utilise pas la SSR »",available:!0},{id:"arg-a6-zusammenhalt-fr",title:"« Cohésion de la Suisse »",available:!0}],situations:[{id:"sit-familie-fr",title:"À table en famille",available:!0},{id:"sit-freunde-fr",title:"Entre ami·e·s",available:!0},{id:"sit-nachbarschaft-fr",title:"Dans le quartier",available:!0}],grundlagen:[{id:"grund-90sek-fr",title:"L'initiative expliquée",available:!0},{id:"grund-service-fr",title:"Le service public expliqué",available:!0},{id:"grund-demokratie-fr",title:"SSR & démocratie",available:!0}],videos:[{id:"video-confederation-fr",title:"Initiative SSR",available:!0},{id:"video-easyvote-fr",title:"Initiative SSR",available:!0},{id:"video-davos-fr",title:"Davos 958.5?",available:!0}]},Tk=()=>Xs({queryKey:["training-stats"],queryFn:async()=>{const{data:t,error:e}=await We.from("training_module_stats").select("*").order("module_type").order("module_id");if(e)throw e;return t}}),Ak=async(t,e)=>{try{await We.rpc("increment_module_view",{p_module_id:t,p_module_type:e})}catch(n){console.error("Failed to track module view:",n)}},wi=async(t,e,n)=>{try{await We.rpc("record_module_completion",{p_module_id:t,p_module_type:e,p_rating_important:(n==null?void 0:n.important)??null,p_rating_correct:(n==null?void 0:n.correct)??null,p_rating_useful:(n==null?void 0:n.useful)??null})}catch(r){console.error("Failed to track module completion:",r)}},pr="https://halbierungs-initiative-nein.lovable.app/training_fr",CW={"arg-a1-200-franken-fr":`${pr}?module=arg-a1-200-franken-fr`,"arg-a3-nutzung-fr":`${pr}?module=arg-a3-nutzung-fr`,"arg-a6-zusammenhalt-fr":`${pr}?module=arg-a6-zusammenhalt-fr`,"sit-familie-fr":`${pr}?module=sit-familie-fr`,"sit-freunde-fr":`${pr}?module=sit-freunde-fr`,"sit-nachbarschaft-fr":`${pr}?module=sit-nachbarschaft-fr`,"grund-90sek-fr":`${pr}?module=grund-90sek-fr`,"grund-service-fr":`${pr}?module=grund-service-fr`,"grund-demokratie-fr":`${pr}?module=grund-demokratie-fr`},NW={argument:{labelLine1:"Arguments",labelLine2:"trouver",icon:yu,bgColor:"bg-primary/10",textColor:"text-primary"},situation:{labelLine1:"Conversations",labelLine2:"exercer",icon:Ks,bgColor:"bg-accent/20",textColor:"text-accent-foreground"},grundlagen:{labelLine1:"Bases",labelLine2:"comprendre",icon:bl,bgColor:"bg-muted",textColor:"text-muted-foreground"},video:{labelLine1:"Vidéos",labelLine2:"regarder",icon:Xc,bgColor:"bg-red-500/10",textColor:"text-red-600"}},CC={argument:{shortLabel:"Argument",icon:yu,badgeClass:"bg-primary/10 text-primary"},situation:{shortLabel:"Conversation",icon:Ks,badgeClass:"bg-accent/20 text-accent-foreground"},grundlagen:{shortLabel:"Bases",icon:bl,badgeClass:"bg-muted text-muted-foreground"},video:{shortLabel:"Vidéo",icon:Xc,badgeClass:"bg-red-500/10 text-red-600"}},JM=({showCategoryHeader:t=!1,withBackground:e=!1})=>{const n=bW();Tk();const r=b.useMemo(()=>EC.filter(a=>a.available).map(a=>({id:a.id,type:"video",title:a.title,trigger:a.subtitle,available:a.available,avgRating:0,thumbnailUrl:`https://img.youtube.com/vi/${a.youtubeId}/maxresdefault.jpg`})),[]),s=b.useMemo(()=>{const a=(m,y,v)=>y.filter(x=>x.available).map(x=>{var k,S;const w=v.find(E=>E.id===x.id);return{id:x.id,type:m,title:x.title,trigger:m==="grundlagen"?((S=(k=w==null?void 0:w.hilftDir)==null?void 0:k.triggers)==null?void 0:S[0])||"":(w==null?void 0:w.trigger)||"",available:x.available,avgRating:0}}),l=m=>m.length>0?m[Math.floor(Math.random()*m.length)]:void 0,c=a("argument",Il.arguments,kW),d=a("situation",Il.situations,SW),h=a("grundlagen",Il.grundlagen,EW),f=l(c),p=l(d),g=l(h);return[f,p,g].filter(Boolean)},[]),i=b.useMemo(()=>{if(r.length===0)return[];const a=Math.floor(Math.random()*r.length);return[r[a]]},[r,n]),o=e?"bg-muted/40":"";return u.jsxs(wW,{id:"werkzeugkasten",title:"Le meilleur argument pour voter non ?",subtitle:"Apprends à argumenter de manière calme et convaincante.",badge:"🙋🏼‍♀️ Entraînement à la discussion",badgeVariant:"blue",className:o,children:[t&&u.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6",children:["argument","situation","grundlagen","video"].map(a=>{const l=NW[a],c=l.icon,d=a==="argument"?Il.arguments.filter(h=>h.available).length:a==="situation"?Il.situations.filter(h=>h.available).length:a==="grundlagen"?Il.grundlagen.filter(h=>h.available).length:EC.filter(h=>h.available).length;return u.jsxs("a",{href:pr,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 rounded-xl border border-border bg-card hover:border-primary/50 hover:shadow-md transition-all text-left cursor-pointer",children:[u.jsx("div",{className:Z("w-9 h-9 rounded-full flex items-center justify-center shrink-0",l.bgColor),children:u.jsx(c,{className:Z("w-4 h-4",l.textColor)})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"font-semibold text-sm text-foreground",children:l.labelLine1}),u.jsxs("p",{className:"text-sm text-foreground",children:[u.jsx("span",{className:"font-semibold",children:l.labelLine2})," ",u.jsxs("span",{className:"font-normal text-muted-foreground",children:["(",d,")"]})]})]})]},a)})}),u.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[u.jsx("div",{className:"flex flex-col gap-4",children:i.map(a=>{const l=CC.video,c=l.icon;return u.jsxs("a",{href:pr,target:"_blank",rel:"noopener noreferrer",className:Z("group text-left bg-card rounded-xl border border-border p-4 md:p-5 transition-all","hover:border-primary/50 hover:shadow-md"),children:[a.thumbnailUrl&&u.jsxs("div",{className:"relative mb-3 rounded-lg overflow-hidden aspect-video bg-muted",children:[u.jsx("img",{src:a.thumbnailUrl,alt:a.title,className:"w-full h-full object-cover",loading:"lazy"}),u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20 group-hover:bg-black/30 transition-colors",children:u.jsx("div",{className:"w-12 h-12 rounded-full bg-red-600 flex items-center justify-center shadow-lg",children:u.jsx(Xc,{className:"w-5 h-5 text-white fill-white ml-0.5"})})})]}),u.jsx("div",{className:"flex items-center justify-between mb-2",children:u.jsxs("span",{className:Z("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium",l.badgeClass),children:[u.jsx(c,{className:"w-4 h-4"}),l.shortLabel]})}),u.jsx("h3",{className:"font-semibold text-foreground mb-1 group-hover:text-primary transition-colors",children:a.title}),a.trigger&&u.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:a.trigger}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Bo,{className:"w-3.5 h-3.5"}),"2–4 min."]}),u.jsxs("span",{className:"flex items-center gap-1 text-primary group-hover:translate-x-1 transition-transform",children:["Regarder",u.jsx(Pt,{className:"w-3.5 h-3.5"})]})]})]},a.id)})}),u.jsx("div",{className:"flex flex-col gap-4",children:s.map(a=>{const l=CC[a.type],c=l.icon;return u.jsxs("a",{href:CW[a.id]||pr,target:"_blank",rel:"noopener noreferrer",className:Z("group text-left bg-card rounded-xl border border-border p-4 transition-all flex-1","hover:border-primary/50 hover:shadow-md"),children:[u.jsx("div",{className:"flex items-center justify-between mb-2",children:u.jsxs("span",{className:Z("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium",l.badgeClass),children:[u.jsx(c,{className:"w-3.5 h-3.5"}),l.shortLabel]})}),u.jsx("h3",{className:"font-semibold text-sm text-foreground mb-1 group-hover:text-primary transition-colors",children:a.title}),a.trigger&&u.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:a.trigger}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Bo,{className:"w-3 h-3"}),a.type==="situation"?"3 min.":"2 min."]}),u.jsxs("span",{className:"flex items-center gap-1 text-primary group-hover:translate-x-1 transition-transform",children:["Commencer",u.jsx(Pt,{className:"w-3 h-3"})]})]})]},a.id)})})]}),u.jsx("div",{className:"mt-6 text-center",children:u.jsxs("a",{href:pr,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm font-medium text-primary hover:underline",children:["Voir tous les entraînements",u.jsx(Pt,{className:"w-4 h-4"})]})})]})},_W=()=>u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"})," ",u.jsx(AV,{}
455),u.jsx(JM,{showCategoryHeader:!0,withBackground:!0}),u.jsx(Sk,{}),u.jsx(hW,{}),u.jsx(vW,{}),u.jsx("div",{className:"section-divider"}),u.jsx(Gn,{}),u.jsx("div",{className:"section-divider"}),u.jsx(fW,{}),u.jsx(jn,{})]}),TW=()=>u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("article",{className:"max-w-3xl mx-auto px-6 py-12 md:py-16",children:[u.jsx("span",{className:"inline-block text-xs font-medium tracking-wider uppercase bg-accent text-accent-foreground px-2 py-1 rounded mb-4",children:"Verstehen"}),u.jsx("h1",{className:"font-sans text-3xl md:text-4xl lg:text-5xl text-foreground leading-tight mb-6",children:"Warum die Halbierungs-Initiative keine Sparvorlage ist"}),u.jsx("p",{className:"text-lg md:text-xl text-muted-foreground leading-relaxed mb-12",children:"Eine kurze Einordnung, worum es wirklich geht – und worum nicht."}),u.jsx("div",{className:"w-16 h-px bg-accent/30 mb-12"}),u.jsxs("div",{className:"prose prose-lg max-w-none",children:[u.jsx("p",{className:"text-foreground/90 leading-relaxed mb-6",children:"Auf den ersten Blick scheint die Sache einfach: Die Initiative will die Ausgaben für die Entwicklungszusammenarbeit halbieren. Weniger Geld für andere, mehr für uns. Das klingt nach einer nüchternen Budgetfrage."}),u.jsx("p",{className:"text-foreground/90 leading-relaxed mb-6",children:"Doch wer genauer hinschaut, erkennt: Hier geht es nicht primär ums Sparen. Die Schweiz hat kein akutes Finanzproblem, das durch diese Kürzung gelöst würde. Die eingesparten Mittel sind im Verhältnis zum Bundeshaushalt gering."}),u.jsx("h2",{className:"font-sans text-2xl text-foreground mt-12 mb-6",children:"Worum geht es dann?"}),u.jsx("p",{className:"text-foreground/90 leading-relaxed mb-6",children:"Die Initiative stellt eine grundsätzlichere Frage: Welche Rolle soll die Schweiz in der Welt spielen? Wie verstehen wir unsere Verantwortung gegenüber Menschen ausserhalb unserer Grenzen? Was bedeutet internationale Solidarität in einer Zeit, in der viele das Gefühl haben, zuerst an sich selbst denken zu müssen?"}),u.jsx("p",{className:"text-foreground/90 leading-relaxed mb-6",children:"Diese Fragen sind legitim. Sie verdienen eine ehrliche Debatte. Aber sie als reine Sparfrage zu behandeln, verkürzt die Diskussion."}),u.jsx("blockquote",{className:"border-l-2 border-accent pl-6 my-8 italic text-foreground/80",children:"«Die Frage ist nicht, ob wir es uns leisten können. Die Frage ist, wer wir sein wollen.»"}),u.jsx("h2",{className:"font-sans text-2xl text-foreground mt-12 mb-6",children:"Was die Zahlen sagen"}),u.jsx("p",{className:"text-foreground/90 leading-relaxed mb-6",children:"Die Schweiz gibt derzeit etwa 0,4 Prozent ihres Bruttonationaleinkommens für Entwicklungszusammenarbeit aus. Das ist weniger als das international vereinbarte Ziel von 0,7 Prozent, aber mehr als viele andere Länder."}),u.jsx("p",{className:"text-foreground/90 leading-relaxed mb-6",children:"Eine Halbierung würde die Schweiz auf etwa 0,2 Prozent bringen – ans untere Ende der Industrieländer. Nicht aus finanzieller Not, sondern als bewusste Entscheidung."}),u.jsx("h2",{className:"font-sans text-2xl text-foreground mt-12 mb-6",children:"Was das bedeutet"}),u.jsx("p",{className:"text-foreground/90 leading-relaxed mb-6",children:"Entwicklungszusammenarbeit ist keine Wohltätigkeit. Sie ist Teil der Schweizer Aussenpolitik. Sie schafft Stabilität in Regionen, aus denen sonst mehr Menschen fliehen würden. Sie öffnet Märkte für Schweizer Unternehmen. Sie trägt zum internationalen Ansehen bei."}),u.jsx("p",{className:"text-foreground/90 leading-relaxed mb-6",children:"Das heisst nicht, dass jede Kritik an der Entwicklungszusammenarbeit unberechtigt wäre. Es gibt berechtigte Fragen zur Wirksamkeit einzelner Projekte. Aber diese Fragen werden durch eine pauschale Halbierung nicht beantwortet – sie werden umgangen."}),u.jsxs("div",{className:"bg-muted/30 rounded-lg p-6 my-8",children:[u.jsx("h3",{className:"font-sans text-lg text-foreground mb-3",children:"Zusammengefasst"}
vendor: 8,218 bytes, line 455
455),u.jsxs("ul",{className:"space-y-2 text-foreground/90",children:[u.jsx("li",{children:"• Die Initiative ist keine technische Sparmassnahme"}),u.jsx("li",{children:"• Sie stellt grundsätzliche Fragen zur Rolle der Schweiz"}),u.jsx("li",{children:"• Die Debatte verdient mehr als Schlagworte"}),u.jsx("li",{children:"• Wirksamkeitsfragen werden durch Kürzungen nicht gelöst"})]})]})]}),u.jsxs("footer",{className:"mt-16 pt-8 border-t border-border/50",children:[u.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Dieser Text wurde mit Sorgfalt erstellt, um verschiedene Perspektiven einzuordnen. Er erhebt keinen Anspruch auf Vollständigkeit."}),u.jsxs("div",{className:"mt-8",children:[u.jsx("h3",{className:"font-sans text-lg text-foreground mb-4",children:"Weiterführend"}),u.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[u.jsxs(Mt,{to:"/einordnen-medien",className:"group p-4 border border-border/50 rounded-lg hover:border-accent/50 transition-colors",children:[u.jsx("span",{className:"text-xs text-accent uppercase tracking-wider",children:"Einordnen"}),u.jsx("p",{className:"font-sans text-foreground group-hover:text-accent transition-colors mt-1",children:"Was über die Initiative geschrieben wird"})]}),u.jsxs(Mt,{to:"/argumentieren-nein",className:"group p-4 border border-border/50 rounded-lg hover:border-accent/50 transition-colors",children:[u.jsx("span",{className:"text-xs text-accent uppercase tracking-wider",children:"Argumentieren"}),u.jsx("p",{className:"font-sans text-foreground group-hover:text-accent transition-colors mt-1",children:"Das stärkste Nein-Argument"})]})]})]})]})]}),u.jsx(Gn,{}),u.jsx(jn,{})]});var qg="Collapsible",[AW,QM]=_r(qg),[jW,jk]=AW(qg),YM=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=t,[l,c]=vs({prop:r,defaultProp:s??!1,onChange:o,caller:qg});return u.jsx(jW,{scope:n,disabled:i,contentId:Vs(),open:l,onOpenToggle:b.useCallback(()=>c(d=>!d),[c]),children:u.jsx(Ee.div,{"data-state":Mk(l),"data-disabled":i?"":void 0,...a,ref:e})})});YM.displayName=qg;var ZM="CollapsibleTrigger",XM=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=jk(ZM,n);return u.jsx(Ee.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Mk(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:ge(t.onClick,s.onOpenToggle)})});XM.displayName=ZM;var Rk="CollapsibleContent",eO=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=jk(Rk,t.__scopeCollapsible);return u.jsx(Zo,{present:n||s.open,children:({present:i})=>u.jsx(RW,{...r,ref:e,present:i})})});eO.displayName=Rk;var RW=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,o=jk(Rk,n),[a,l]=b.useState(r),c=b.useRef(null),d=Ue(e,c),h=b.useRef(0),f=h.current,p=b.useRef(0),g=p.current,m=o.open||a,y=b.useRef(m),v=b.useRef(void 0);return b.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),an(()=>{const x=c.current;if(x){v.current=v.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();h.current=w.height,p.current=w.width,y.current||(x.style.transitionDuration=v.current.transitionDuration,x.style.animationName=v.current.animationName),l(r)}},[o.open,r]),u.jsx(Ee.div,{"data-state":Mk(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...i,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:m&&s})});function Mk(t){return t?"open":"closed"}var MW=YM,OW=XM,PW=eO,IW=b.createContext(void 0);function Hh(t){const e=b.useContext(IW);return t||e||"ltr"}var ws="Accordion",DW=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ok,LW,zW]=zh(ws),[Ug,lie]=_r(ws,[zW,QM]),Pk=QM(),tO=F.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return u.jsx(Ok.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?u.jsx(qW,{...i,ref:e}):u.jsx(BW,{...s,ref:e})})});tO.displayName=ws;var[nO,$W]=Ug(ws),[rO,FW]=Ug(ws,{collapsible:!1}),BW=F.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...o}=t,[a,l]=vs({prop:n,defaultProp:r??"",onChange:s,caller:ws});return u.jsx(nO,{scope:t.__scopeAccordion,value:F.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:F.useCallback(()=>i&&l(""),[i,l]),children:u.jsx(rO,{scope:t.__scopeAccordion,collapsible:i,children:u.jsx(sO,{...o,ref:e})})})}),qW=F.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[o,a]=vs({prop:n,defaultProp:r??[],onChange:s,caller:ws}),l=F.useCallback(d=>a((h=[])=>[...h,d]),[a]),c=F.useCallback(d=>a((h=[])=>h.filter(f=>f!==d)),[a]);return u.jsx(nO,{scope:t.__scopeAccordion,value:o,onItemOpen:l,onItemClose:c,children:u.jsx(rO,{scope:t.__scopeAccordion,collapsible:!0,children:u.jsx(sO,{...i,ref:e})})})}),[UW,Vg]=Ug(ws),sO=F.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...o}=t,a=F.useRef(null),l=Ue(a,e),c=LW(n),h=Hh(s)==="ltr",f=ge(t.onKeyDown,p=>{var N;if(!DW.includes(p.key))return;const g=p.target,m=c().filter(T=>{var M;return!((M=T.ref.current)!=null&&M.disabled)}),y=m.findIndex(T=>T.ref.current===g),v=m.length;if(y===-1)return;p.preventDefault();let x=y;const w=0,k=v-1,S=()=>{x=y+1,x>k&&(x=w)},E=()=>{x=y-1,x<w&&(x=k)};switch(p.key){case"Home":x=w;break;case"End":x=k;break;case"ArrowRight":i==="horizontal"&&(h?S():E());break;case"ArrowDown":i==="vertical"&&S();break;case"ArrowLeft":i==="horizontal"&&(h?E():S());break;case"ArrowUp":i==="vertical"&&E();break}const C=x%v;(N=m[C].ref.current)==null||N.focus()});return u.jsx(UW,{scope:n,disabled:r,direction:s,orientation:i,children:u.jsx(Ok.Slot,{scope:n,children:u.jsx(Ee.div,{...o,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),am="AccordionItem",[VW,Ik]=Ug(am),iO=F.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...s}=t,i=Vg(am,n),o=$W(am,n),a=Pk(n),l=Vs(),c=r&&o.value.includes(r)||!1,d=i.disabled||t.disabled;return u.jsx(VW,{scope:n,open:c,disabled:d,triggerId:l,children:u.jsx(MW,{"data-orientation":i.orientation,"data-state":dO(c),...a,...s,ref:e,disabled:d,open:c,onOpenChange:h=>{h?o.onItemOpen(r):o.onItemClose(r)}})})});iO.displayName=am;var oO="AccordionHeader",aO=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=Vg(ws,n),i=Ik(oO,n);return u.jsx(Ee.h3,{"data-orientation":s.orientation,"data-state":dO(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});aO.displayName=oO;var Gb="AccordionTrigger",lO=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=Vg(ws,n),i=Ik(Gb,n),o=FW(Gb,n),a=Pk(n);return u.jsx(Ok.ItemSlot,{scope:n,children:u.jsx(OW,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...a,...r,ref:e})})});lO.displayName=Gb;var cO="AccordionContent",uO=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=Vg(ws,n),i=Ik(cO,n),o=Pk(n);return u.jsx(PW,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});uO.displayName=cO;function dO(t){return t?"open":"closed"}var HW=tO,WW=iO,GW=aO,hO=lO,fO=uO;const KW=HW,pO=b.forwardRef(({className:t,...e},n)=>u.jsx(WW,{ref:n,className:Z("border-b",t),...e}));pO.displayName="AccordionItem";const mO=b.forwardRef(({className:t,children:e,...n},r)=>u.jsx(GW,{className:"flex",children:u.jsxs(hO,{ref:r,className:Z("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,u.jsx(Qw,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));mO.displayName=hO.displayName;const gO=b.forwardRef(({className:t,children:e,...n},r)=>u.jsx(fO,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:u.jsx("div",{className:Z("pb-4 pt-0",t),children:e})}));
455gO.displayName=fO.displayName;const JW=[{title:"Demokratie",key:"demokratie",questions:[{question:"Welche Auswirkungen hätte die Initiative auf die Demokratie?",answer:"Die Initiative würde die demokratische Meinungsbildung beeinträchtigen, da unabhängige Medien für eine funktionierende Demokratie essentiell sind."}]},{title:"Medien",key:"medien",questions:[{question:"Wie würde sich die Medienlandschaft verändern?",answer:"Eine Annahme würde zu einem massiven Abbau bei den öffentlich-rechtlichen Medien führen und die Medienvielfalt in der Schweiz gefährden."}]},{title:"SRG",key:"srg",questions:[{question:"Was bedeutet die Initiative für die SRG?",answer:"Die SRG müsste ihr Budget drastisch kürzen, was zu Programmabbau, Stellenstreichungen und einer Reduktion des Angebots führen würde."}]},{title:"Finanzierung",key:"finanzierung",questions:[{question:"Wie finanziert sich die SRG heute?",answer:"Die SRG finanziert sich hauptsächlich über die Medienabgabe (früher Billag-Gebühren), die alle Haushalte und Unternehmen bezahlen."}]},{title:"Grundlagen",key:"grundlagen",questions:[{question:"Was fordert die Halbierungs-Initiative?",answer:"Die Halbierungs-Initiative verlangt eine Kürzung der Medienabgabe auf die Hälfte des bisherigen Betrags."}]}],QW=t=>new DOMParser().parseFromString(t,"text/html").body.textContent||"",YW=()=>{const{data:t,isLoading:e}=Xs({queryKey:["qa-posts"],queryFn:async()=>{const{data:s,error:i}=await We.from("blog_posts").select("id, title, slug, excerpt, short_description, qa_category, content").eq("category","qa").eq("is_published",!0).order("published_at",{ascending:!1});if(i)throw i;return s}}),r=(()=>{if(!t||t.length===0)return JW;const s=["demokratie","medien","srg","finanzierung","grundlagen"],i={demokratie:{title:xa.demokratie,key:"demokratie",questions:[]},medien:{title:xa.medien,key:"medien",questions:[]},srg:{title:xa.srg,key:"srg",questions:[]},finanzierung:{title:xa.finanzierung,key:"finanzierung",questions:[]},grundlagen:{title:xa.grundlagen,key:"grundlagen",questions:[]}};return t.forEach(o=>{o.qa_category&&i[o.qa_category]&&i[o.qa_category].questions.push({question:o.title,answer:o.short_description||QW(o.content),slug:o.slug})}),s.map(o=>i[o]).filter(o=>o.questions.length>0)})();return b.useEffect(()=>{window.scrollTo(0,0)},[]),u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-12",children:[u.jsxs("div",{className:"mb-12 animate-fade-up",children:[u.jsx("h1",{className:"text-4xl md:text-5xl font-sans font-bold text-primary mb-6",children:"Häufige Fragen zur Initiative"}),u.jsxs("div",{className:"prose prose-lg text-muted-foreground max-w-none",children:[u.jsx("p",{children:"Was genau fordert die Halbierungs-Initiative? Welche Auswirkungen hätte eine Annahme? Und wie lässt sich die Debatte einordnen?"}),u.jsx("p",{children:"Wir haben hier die wichtigsten Fragen gesammelt und versuchen, sie möglichst sachlich und verständlich zu beantworten."})]})]}),e&&u.jsx("div",{className:"flex items-center justify-center py-12",children:u.jsx(gs,{className:"w-8 h-8 animate-spin text-primary"})}),!e&&u.jsx("div",{className:"space-y-12",children:r.map((s,i)=>u.jsxs("section",{className:"animate-fade-up",style:{animationDelay:`${(i+1)*100}ms`},children:[u.jsx("h2",{className:"text-2xl md:text-3xl font-sans font-bold text-primary mb-6",children:s.title}),u.jsx(KW,{type:"single",collapsible:!0,className:"space-y-2",children:s.questions.map((o,a)=>u.jsxs(pO,{value:`${s.key}-${a}`,className:"bg-muted/50 rounded-lg border-none px-6 data-[state=open]:bg-muted",children:[u.jsx(mO,{className:"text-left font-sans text-lg font-medium hover:no-underline py-5",children:o.question}),u.jsxs(gO,{className:"text-muted-foreground leading-relaxed pb-5",children:[u.jsx("p",{className:"mb-4",children:o.answer}),o.slug&&u.jsx(Mt,{to:`/fragen-antworten/${o.slug}`,children:u.jsxs(ve,{variant:"outline",size:"sm",className:"gap-2",children:["Mehr erfahren",u.jsx(uF,{className:"w-4 h-4"})]})})]})]},a))})]},s.key))})]}),u.jsx(Gn,{}),u.jsx(jn,{})]})};function ks(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function sl(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const yO=6048e5,ZW=864e5;let XW={};function Hg(){return XW}function hh(t,e){var a,l,c,d;const n=Hg(),r=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,s=ks(t),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function lm(t){return hh(t,{weekStartsOn:1}
vendor: 14,718 bytes, line 455
455)}function vO(t){const e=ks(t),n=e.getFullYear(),r=sl(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=lm(r),i=sl(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=lm(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function NC(t){const e=ks(t);return e.setHours(0,0,0,0),e}function _C(t){const e=ks(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function e8(t,e){const n=NC(t),r=NC(e),s=+n-_C(n),i=+r-_C(r);return Math.round((s-i)/ZW)}function t8(t){const e=vO(t),n=sl(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),lm(n)}function n8(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function r8(t){if(!n8(t)&&typeof t!="number")return!1;const e=ks(t);return!isNaN(Number(e))}function s8(t){const e=ks(t),n=sl(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const i8={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},o8=(t,e,n)=>{let r;const s=i8[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Nc(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const a8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},l8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},c8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},u8={date:Nc({formats:a8,defaultWidth:"full"}),time:Nc({formats:l8,defaultWidth:"full"}),dateTime:Nc({formats:c8,defaultWidth:"full"})},d8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},h8=(t,e,n,r)=>d8[t];function zs(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const f8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},p8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},m8={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},g8={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},y8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},v8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},x8=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},b8={ordinalNumber:x8,era:zs({values:f8,defaultWidth:"wide"}),quarter:zs({values:p8,defaultWidth:"wide",argumentCallback:t=>t-1}),month:zs({values:m8,defaultWidth:"wide"}),day:zs({values:g8,defaultWidth:"wide"}),dayPeriod:zs({values:y8,defaultWidth:"wide",formattingValues:v8,defaultFormattingWidth:"wide"})};function $s(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const o=i[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?k8(a,h=>h.test(o)):w8(a,h=>h.test(o));let c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=e.slice(o.length);return{value:c,rest:d}}}function w8(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function k8(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function xO(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(s.length);return{value:o,rest:a}}}const S8=/^(\d+)(th|st|nd|rd)?/i,E8=/\d+/i,C8={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},N8={any:[/^b/i,/^(a|c)/i]},_8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},T8={any:[/1/i,/2/i,/3/i,/4/i]},A8={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},j8={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},R8={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},M8={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},O8={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},P8={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},I8={ordinalNumber:xO({matchPattern:S8,parsePattern:E8,valueCallback:t=>parseInt(t,10)}),era:$s({matchPatterns:C8,defaultMatchWidth:"wide",parsePatterns:N8,defaultParseWidth:"any"}),quarter:$s({matchPatterns:_8,defaultMatchWidth:"wide",parsePatterns:T8,defaultParseWidth:"any",valueCallback:t=>t+1}),month:$s({matchPatterns:A8,defaultMatchWidth:"wide",parsePatterns:j8,defaultParseWidth:"any"}),day:$s({matchPatterns:R8,defaultMatchWidth:"wide",parsePatterns:M8,defaultParseWidth:"any"}),dayPeriod:$s({matchPatterns:O8,defaultMatchWidth:"any",parsePatterns:P8,defaultParseWidth:"any"})},D8={code:"en-US",formatDistance:o8,formatLong:u8,formatRelative:h8,localize:b8,match:I8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function L8(t){const e=ks(t);return e8(e,s8(e))+1}function z8(t){const e=ks(t),n=+lm(e)-+t8(e);return Math.round(n/yO)+1}function bO(t,e){var d,h,f,p;const n=ks(t),r=n.getFullYear(),s=Hg(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(f=s.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=sl(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=hh(o,e),l=sl(t,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=hh(l,e);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function $8(t,e){var a,l,c,d;const n=Hg(),r=(e==null?void 0:e.firstWeekContainsDate)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,s=bO(t,e),i=sl(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),hh(i,e)}function F8(t,e){const n=ks(t),r=+hh(n,e)-+$8(n,e);return Math.round(r/yO)+1}function rt(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Bi={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return rt(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):rt(n+1,2)},d(t,e){return rt(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return rt(t.getHours()%12||12,e.length)},H(t,e){return rt(t.getHours(),e.length)},m(t,e){return rt(t.getMinutes(),e.length)},s(t,e){return rt(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return rt(s,e.length)}},Dl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},TC={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Bi.y(t,e)},Y:function(t,e,n,r){const s=bO(t,r),i=s>0?s:1-s;if(e==="YY"){const o=i%100;return rt(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):rt(i,e.length)},R:function(t,e){const n=vO(t);return rt(n,e.length)},u:function(t,e){const n=t.getFullYear();return rt(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return rt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return rt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return Bi.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return rt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=F8(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):rt(s,e.length)},I:function(t,e,n){const r=z8(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):rt(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Bi.d(t,e)},D:function(t,e,n){const r=L8(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):rt(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return rt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return rt(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return rt(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=Dl.noon:r===0?s=Dl.midnight:s=r/12>
vendor: 4,560 bytes, line 455
455=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=Dl.evening:r>=12?s=Dl.afternoon:r>=4?s=Dl.morning:s=Dl.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Bi.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Bi.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):rt(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):rt(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Bi.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Bi.s(t,e)},S:function(t,e){return Bi.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return jC(r);case"XXXX":case"XX":return ma(r);case"XXXXX":case"XXX":default:return ma(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return jC(r);case"xxxx":case"xx":return ma(r);case"xxxxx":case"xxx":default:return ma(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+AC(r,":");case"OOOO":default:return"GMT"+ma(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+AC(r,":");case"zzzz":default:return"GMT"+ma(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return rt(r,e.length)},T:function(t,e,n){const r=t.getTime();return rt(r,e.length)}};function AC(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+rt(i,2)}function jC(t,e){return t%60===0?(t>0?"-":"+")+rt(Math.abs(t)/60,2):ma(t,e)}function ma(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=rt(Math.trunc(r/60),2),i=rt(r%60,2);return n+s+e+i}const RC=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},wO=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},B8=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return RC(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",RC(r,e)).replace("{{time}}",wO(s,e))},q8={p:wO,P:B8},U8=/^D+$/,V8=/^Y+$/,H8=["D","DD","YY","YYYY"];function W8(t){return U8.test(t)}function G8(t){return V8.test(t)}function K8(t,e,n){const r=J8(t,e,n);if(console.warn(r),H8.includes(t))throw new RangeError(r)}function J8(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Q8=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Y8=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Z8=/^'([^]*?)'?$/,X8=/''/g,eG=/[a-zA-Z]/;function Wg(t,e,n){var d,h,f,p,g,m,y,v;const r=Hg(),s=(n==null?void 0:n.locale)??r.locale??D8,i=(n==null?void 0:n.firstWeekContainsDate)??((h=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((m=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,a=ks(t);if(!r8(a))throw new RangeError("Invalid time value");let l=e.match(Y8).map(x=>{const w=x[0];if(w==="p"||w==="P"){const k=q8[w];return k(x,s.formatLong)}return x}).join("").match(Q8).map(x=>
455{if(x==="''")return{isToken:!1,value:"'"};const w=x[0];if(w==="'")return{isToken:!1,value:tG(x)};if(TC[w])return{isToken:!0,value:x};if(w.match(eG))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:x}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return l.map(x=>{if(!x.isToken)return x.value;const w=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&G8(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&W8(w))&&K8(w,e,String(t));const k=TC[w[0]];return k(a,w,s.localize,c)}).join("")}function tG(t){const e=t.match(Z8);return e?e[1].replace(X8,"'"):t}const MC={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},nG=(t,e,n)=>{let r;const s=n!=null&&n.addSuffix?MC[t].withPreposition:MC[t].standalone;return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",String(e)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:"vor "+r:r},rG={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},sG={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},iG={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},oG={date:Nc({formats:rG,defaultWidth:"full"}),time:Nc({formats:sG,defaultWidth:"full"}),dateTime:Nc({formats:iG,defaultWidth:"full"})},aG={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},lG=(t,e,n,r)=>aG[t],cG={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},uG={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},Kb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},dG={narrow:Kb.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:Kb.wide},hG={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},fG={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nac
455hm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},pG={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},mG=t=>Number(t)+".",gG={ordinalNumber:mG,era:zs({values:cG,defaultWidth:"wide"}),quarter:zs({values:uG,defaultWidth:"wide",argumentCallback:t=>t-1}),month:zs({values:Kb,formattingValues:dG,defaultWidth:"wide"}),day:zs({values:hG,defaultWidth:"wide"}),dayPeriod:zs({values:fG,defaultWidth:"wide",formattingValues:pG,defaultFormattingWidth:"wide"})},yG=/^(\d+)(\.)?/i,vG=/\d+/i,xG={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},bG={any:[/^v/i,/^n/i]},wG={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},kG={any:[/1/i,/2/i,/3/i,/4/i]},SG={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},EG={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},CG={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},NG={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},_G={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},TG={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},AG={ordinalNumber:xO({matchPattern:yG,parsePattern:vG,valueCallback:t=>parseInt(t)}),era:$s({matchPatterns:xG,defaultMatchWidth:"wide",parsePatterns:bG,defaultParseWidth:"any"}),quarter:$s({matchPatterns:wG,defaultMatchWidth:"wide",parsePatterns:kG,defaultParseWidth:"any",valueCallback:t=>t+1}),month:$s({matchPatterns:SG,defaultMatchWidth:"wide",parsePatterns:EG,defaultParseWidth:"any"}),day:$s({matchPatterns:CG,defaultMatchWidth:"wide",parsePatterns:NG,defaultParseWidth:"any"}),dayPeriod:$s({matchPatterns:_G,defaultMatchWidth:"wide",parsePatterns:TG,defaultParseWidth:"any"})},Gg={code:"de",formatDistance:nG,formatLong:oG,formatRelative:lG,localize:gG,match:AG,options:{weekStartsOn:1,firstWeekContainsDate:4}};/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:kO,setPrototypeOf:OC,isFrozen:jG,getPrototypeOf:RG,getOwnPropertyDescriptor:MG}=Object;let{freeze:Bn,seal:Kr,create:Jb}=Object,{apply:Qb,construct:Yb}=typeof Reflect<"u"&&Reflect;Bn||(Bn=function(e){return e});Kr||(Kr=function(e){return e});Qb||(Qb=function(e,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i];return e.apply(n,s)});Yb||(Yb=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new e(...r)});const Tf=qn(Array.prototype.forEach),OG=qn(Array.prototype.lastIndexOf),PC=qn(Array.prototype.pop),Fu=qn(Array.prototype.push),PG=qn(Array.prototype.splice),hp=qn(String.prototype.toLowerCase),xv=qn(String.prototype.toString),bv=qn(String.prototype.match),Bu=qn(String.prototype.replace),IG=qn(String.prototype.indexOf),DG=qn(String.prototype.trim),Xr=qn(Object.prototype.hasOwnProperty),On=qn(RegExp.prototype.test),qu=LG(TypeError);function qn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return Qb(t,e,r)}}function LG(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Yb(t,n)}}function Be(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hp;OC&&OC(t,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const i=n(s);i!==s&&(jG(e)||(e[r]=i),s=i)}t[s]=!0}return t}function zG(t){for(let e=0;e<t.length;e++)Xr(t,e)||(t[e]=null);return t}function Ts(t){const e=Jb(null);for(const[n,r]of kO(t))Xr(t,n)&&(Array.isArray(r)?e[n]=zG(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=Ts(r):e[n]=r);return e}function Uu(t,e){for(;t!==null;){const r=MG(t,e);if(r){if(r.get)return qn(r.get);if(typeof r.value=="function")return qn(r.value)}t=RG(t)}function n(){return null}return n}const IC=Bn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),wv=Bn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),kv=Bn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$G=Bn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Sv=Bn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),FG=Bn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),DC=Bn(["#text"]),LC=Bn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
455spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ev=Bn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),zC=Bn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Af=Bn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),BG=Kr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qG=Kr(/<%[\w\W]*|[\w\W]*%>/gm),UG=Kr(/\$\{[\w\W]*/gm),VG=Kr(/^data-[\-\w.\u00B7-\uFFFF]+$/),HG=Kr(/^aria-[\-\w]+$/),SO=Kr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WG=Kr(/^(?:\w+script|data):/i),GG=Kr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),EO=Kr(/^html$/i),KG=Kr(/^[a-z][.\w]*(-[.\w]+)+$/i);var $C=Object.freeze({__proto__:null,ARIA_ATTR:HG,ATTR_WHITESPACE:GG,CUSTOM_ELEMENT:KG,DATA_ATTR:VG,DOCTYPE_NAME:EO,ERB_EXPR:qG,IS_ALLOWED_URI:SO,IS_SCRIPT_OR_DATA:WG,MUSTACHE_EXPR:BG,TMPLIT_EXPR:UG});const Vu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},JG=function(){return typeof window>"u"?null:window},QG=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;
vendor: 10,853 bytes, line 455
455const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},FC=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function CO(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:JG();const e=be=>CO(be);if(e.version="3.3.1",e.removed=[],!t||!t.document||t.document.nodeType!==Vu.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,s=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:p}=t,g=l.prototype,m=Uu(g,"cloneNode"),y=Uu(g,"remove"),v=Uu(g,"nextSibling"),x=Uu(g,"childNodes"),w=Uu(g,"parentNode");if(typeof o=="function"){const be=n.createElement("template");be.content&&be.content.ownerDocument&&(n=be.content.ownerDocument)}let k,S="";const{implementation:E,createNodeIterator:C,createDocumentFragment:N,getElementsByTagName:T}=n,{importNode:M}=r;let D=FC();e.isSupported=typeof kO=="function"&&typeof w=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:L,TMPLIT_EXPR:I,DATA_ATTR:U,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:z}=$C;let{IS_ALLOWED_URI:Q}=$C,re=null;const ce=Be({},[...IC,...wv,...kv,...Sv,...DC]);let ae=null;const Ce=Be({},[...LC,...Ev,...zC,...Af]);let we=Object.seal(Jb(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ge=null,Y=null;const Pe=Object.seal(Jb(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Xe=!0,Ie=!0,pe=!1,Le=!0,at=!1,vt=!0,X=!1,it=!1,ln=!1,zt=!1,cn=!1,_=!1,O=!0,$=!1;const ee="user-content-";let te=!0,W=!1,ne={},Ae=null;const Qe=Be({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let un=null;const Tr=Be({},["audio","video","img","source","image","track"]);let Kn=null;const ia=Be({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ar="http://www.w3.org/1998/Math/MathML",Mn="http://www.w3.org/2000/svg",Jn="http://www.w3.org/1999/xhtml";let wn=Jn,oa=!1,Li=null;const Zh=Be({},[Ar,Mn,Jn],xv);let aa=Be({},["mi","mo","mn","ms","mtext"]),Cl=Be({},["annotation-xml"]);const _u=Be({},["title","style","font","a","script"]);let Qn=null;const by=["application/xhtml+xml","text/html"],je="text/html";let Te=null,et=null;const hr=n.createElement("form"),Yn=function(R){return R instanceof RegExp||R instanceof Function},jr=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(et&&et===R)){if((!R||typeof R!="object")&&(R={}),R=Ts(R),Qn=by.indexOf(R.PARSER_MEDIA_TYPE)===-1?je:R.PARSER_MEDIA_TYPE,Te=Qn==="application/xhtml+xml"?xv:hp,re=Xr(R,"ALLOWED_TAGS")?Be({},R.ALLOWED_TAGS,Te):ce,ae=Xr(R,"ALLOWED_ATTR")?Be({},R.ALLOWED_ATTR,Te):Ce,Li=Xr(R,"ALLOWED_NAMESPACES")?Be({},R.ALLOWED_NAMESPACES,xv):Zh,Kn=Xr(R,"ADD_URI_SAFE_ATTR")?Be(Ts(ia),R.ADD_URI_SAFE_ATTR,Te):ia,un=Xr(R,"ADD_DATA_URI_TAGS")?Be(Ts(Tr),R.ADD_DATA_URI_TAGS,Te):Tr,Ae=Xr(R,"FORBID_CONTENTS")?Be({},R.FORBID_CONTENTS,Te):Qe,Ge=Xr(R,"FORBID_TAGS")?Be({},R.FORBID_TAGS,Te):Ts({}),Y=Xr(R,"FORBID_ATTR")?Be({},R.FORBID_ATTR,Te):Ts({}),ne=Xr(R,"USE_PROFILES")?R.USE_PROFILES:!1,Xe=R.ALLOW_ARIA_ATTR!==!1,Ie=R.ALLOW_DATA_ATTR!==!1,pe=R.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=R.ALLOW_SELF_CLOSE_IN_ATTR!==!1,at=R.SAFE_FOR_TEMPLATES||!1,vt=R.SAFE_FOR_XML!==!1,X=R.WHOLE_DOCUMENT||!1,zt=R.RETURN_DOM||!1,cn=R.RETURN_DOM_FRAGMENT||!1,_=R.RETURN_TRUSTED_TYPE||!1,ln=R.FORCE_BODY||!1,O=R.SANITIZE_DOM!==!1,$=R.SANITIZE_NAMED_PROPS||!1,te=R.KEEP_CONTENT!==!1,W=R.IN_PLACE||!1,Q=R.ALLOWED_URI_REGEXP||SO,wn=R.NAMESPACE||Jn,aa=R.MATHML_TEXT_INTEGRATION_POINTS||aa,Cl=R.HTML_INTEGRATION_POINTS||Cl,we=R.CUSTOM_ELEMENT_HANDLING||{},R.CUSTOM_ELEMENT_HANDLING&&Yn(R.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=R.CUSTOM_ELEMENT_HANDLING.tagNameCheck),R.CUSTOM_ELEMENT_HANDLING&&Yn(R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),R.CUSTOM_ELEMENT_HANDLING&&typeof R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(we.allowCustomizedBuiltInElements=R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),at&&(Ie=!1),cn&&(zt=!0),ne&&(re=Be({},DC),ae=[],ne.html===!0&&(Be(re,IC),Be(ae,LC)),ne.svg===!0&&(Be(re,wv),Be(ae,Ev),Be(ae,Af)),ne.svgFilters===!0&&(Be(re,kv),Be(ae,Ev),Be(ae,Af)),ne.mathMl===!0&&(Be(re,Sv),Be(ae,zC),Be(ae,Af))),R.ADD_TAGS&&(typeof R.ADD_TAGS=="function"?Pe.tagCheck=R.ADD_TAGS:(re===ce&&(re=Ts(re)),Be(re,R.ADD_TAGS,Te))),R.ADD_ATTR&&(typeof R.ADD_ATTR=="function"?Pe.attributeCheck=R.ADD_ATTR:(ae===Ce&&(ae=Ts(ae)),Be(ae,R.ADD_ATTR,Te))),R.ADD_URI_SAFE_ATTR&&Be(Kn,R.ADD_URI_SAFE_ATTR,Te),R.FORBID_CONTENTS&&(Ae===Qe&&(Ae=Ts(Ae)),Be(Ae,R.FORBID_CONTENTS,Te)),R.ADD_FORBID_CONTENTS&&(Ae===Qe&&(Ae=Ts(Ae)),Be(Ae,R.ADD_FORBID_CONTENTS,Te)),te&&(re["#text"]=!0),X&&Be(re,["html","head","body"]),re.table&&(Be(re,["tbody"]),delete Ge.tbody),R.TRUSTED_TYPES_POLICY){if(typeof R.TRUSTED_TYPES_POLICY.createHTML!="function")throw qu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof R.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=R.TRUSTED_TYPES_POLICY,S=k.createHTML("")}else k===void 0&&(k=QG(p,s)),k!==null&&typeof S=="string"&&(S=k.createHTML(""));Bn&&Bn(R),et=R}},Es=Be({},[...wv,...kv,...$G]),Zn=Be({},[...Sv,...FG]),Cs=function(R){let G=w(R);(!G||!G.tagName)&&(G={namespaceURI:wn,tagName:"template"});const fe=hp(R.tagName),gt=hp(G.tagName);return Li[R.namespaceURI]?R.namespaceURI===Mn?G.namespaceURI===Jn?fe==="svg":G.namespaceURI===Ar?fe==="svg"&&(gt==="annotation-xml"||aa[gt]):!!Es[fe]:R.namespaceURI===Ar?G.namespaceURI===Jn?fe==="math":G.namespaceURI===Mn?fe==="math"&&Cl[gt]:!!Zn[fe]:R.namespaceURI===Jn?G.namespaceURI===Mn&&!Cl[gt]||G.namespaceURI===Ar&&!aa[gt]?!1:!Zn[fe]&&(_u[fe]||!Es[fe]):!!(Qn==="application/xhtml+xml"&&Li[R.namespaceURI]):!1},Ns=function(R){Fu(e.removed,{element:R});try{w(R).removeChild(R)}catch{y(R)}},la=function(R,G){try{Fu(e.removed,{attribute:G.getAttributeNode(R),from:G})}catch{Fu(e.removed,{attribute:null,from:G})}if(G.removeAttribute(R),R==="is")if(zt||cn)try{Ns(G)}catch{}else try{G.setAttribute(R,"")}catch{}},q1=function(R){let G=null,fe=null;if(ln)R="<remove></remove>"+R;else{const $t=bv(R,/^[\r\n\t ]+/);fe=$t&&$t[0]}Qn==="application/xhtml+xml"&&wn===Jn&&(R='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+R+"</body></html>");const gt=k?k.createHTML(R):R;if(wn===Jn)try{G=new f().parseFromString(gt,Qn)}catch{}if(!G||!G.documentElement){G=E.createDocument(wn,"template",null);try{G.documentElement.innerHTML=oa?S:gt}catch{}}const kn=G.body||G.documentElement;return R&&fe&&kn.insertBefore(n.createTextNode(fe),kn.childNodes[0]||null),wn===Jn?T.call(G,X?"html":"body")[0]:X?G.documentElement:kn},U1=function(R){return C.call(R.ownerDocument||R,R,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},wy=function(R){return R instanceof h&&(typeof R.nodeName!="string"||typeof R.textContent!="string"||typeof R.removeChild!="function"||!(R.attributes instanceof d)||typeof R.removeAttribute!="function"||typeof R.setAttribute!="function"||typeof R.namespaceURI!="string"||typeof R.insertBefore!="function"||typeof R.hasChildNodes!="function")},V1=function(R){return typeof a=="function"&&R instanceof a};function ti(be,R,G){Tf(be,fe=>{fe.call(e,R,G,et)})}const H1=function(R){let G=null;if(ti(D.beforeSanitizeElements,R,null),wy(R))return Ns(R),!0;const fe=Te(R.nodeName);if(ti(D.uponSanitizeElement,R,{tagName:fe,allowedTags:re}),vt&&R.hasChildNodes()&&!V1(R.firstElementChild)&&On(/<[/\w!]/g,R.innerHTML)&&On(/<[/\w!]/g,R.textContent)||R.nodeType===Vu.progressingInstruction||vt&&R.nodeType===Vu.comment&&On(/<[/\w]/g,R.data))return Ns(R),!0;if(!(Pe.tagCheck instanceof Function&&Pe.tagCheck(fe))&&(!re[fe]||Ge[fe])){if(!Ge[fe]&&G1(fe)&&(we.tagNameCheck instanceof RegExp&&On(we.tagNameCheck,fe)||we.tagNameCheck instanceof Function&&we.tagNameCheck(fe)))return!1;if(te&&!Ae[fe]){const gt=w(R)||R.parentNode,kn=x(R)||R.childNodes;if(kn&&gt){const $t=kn.length;for(let Xn=$t-1;Xn>=0;--Xn){const ni=m(kn[Xn],!0);ni.__removalCount=(R.__removalCount||0)+1,gt.insertBefore(ni,v(R))}}}return Ns(R),!0}return R instanceof l&&!Cs(R)||(fe==="noscript"||fe==="noembed"||fe==="noframes")&&On(/<\/no(script|embed|frames)/i,R.innerHTML)?(Ns(R),!0):(at&&R.nodeType===Vu.text&&(G=R.textContent,Tf([A,L,I],gt=>{G=Bu(G,gt," ")}),R.textContent!==G&&(Fu(e.removed,{element:R.cloneNode()}),R.textContent=G)),ti(D.afterSanitizeElements,R,null),!1)},W1=function(R,G,fe){if(O&&(G==="id"||G==="name")&&(fe in n||fe in hr))return!1;if(!(Ie&&!Y[G]&&On(U,G))){if(!(Xe&&On(B,G))){if(!(Pe.attributeCheck instanceof Function&&Pe.attributeCheck(G,R))){if(!ae[G]||Y[G]){if(!(G1(R)&&(we.tagNameCheck instanceof RegExp&&On(we.tagNameCheck,R)||we.tagNameCheck instanceof Function&&we.tagNameCheck(R))&&(we.attributeNameCheck instanceof RegExp&&On(we.attributeNameCheck,G)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(G,R))||G==="is"&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&On(we.tagNameCheck,fe)||we.tagNameCheck instanceof Function&&we.tagNameCheck(fe))))return!1}else if(!Kn[G]){if(!On(Q,Bu(fe,P,""))){if(!((G==="src"||G==="xlink:href"||G==="href")&&R!=="script"&&IG(fe,"data:")===0&&un[R])){if(!(pe&&!On(J,Bu(fe,P,"")))){if(fe)return!1}}}}}}}return!0},G1=function(R){return R!=="annotation-xml"&&bv(R,z)},K1=function(R){ti(D.beforeSanitizeAttributes,R,null);const{attributes:G}=R;if(!G||wy(R))return;const fe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0};let gt=G.length;for(;gt--;){const kn=G[gt],{name:$t,namespaceURI:Xn,value:ni}=kn,Nl=Te($t),ky=ni;let dn=$t==="value"?ky:DG(ky);if(fe.attrName=Nl,fe.attrValue=dn,fe.keepAttr=!0,fe.forceKeepAttr=void 0,ti(D.uponSanitizeAttribute,R,fe),dn=fe.attrValue,$&&(Nl==="id"||Nl==="name")&&(la($t,R),dn=ee+dn),vt&&O
vendor: 6,168 bytes, lines 455-456
455n(/((--!?|])>)|<\/(style|title|textarea)/i,dn)){la($t,R);continue}if(Nl==="attributename"&&bv(dn,"href")){la($t,R);continue}if(fe.forceKeepAttr)continue;if(!fe.keepAttr){la($t,R);continue}if(!Le&&On(/\/>/i,dn)){la($t,R);continue}at&&Tf([A,L,I],Q1=>{dn=Bu(dn,Q1," ")});const J1=Te(R.nodeName);if(!W1(J1,Nl,dn)){la($t,R);continue}if(k&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Xn)switch(p.getAttributeType(J1,Nl)){case"TrustedHTML":{dn=k.createHTML(dn);break}case"TrustedScriptURL":{dn=k.createScriptURL(dn);break}}if(dn!==ky)try{Xn?R.setAttributeNS(Xn,$t,dn):R.setAttribute($t,dn),wy(R)?Ns(R):PC(e.removed)}catch{la($t,R)}}ti(D.afterSanitizeAttributes,R,null)},az=function be(R){let G=null;const fe=U1(R);for(ti(D.beforeSanitizeShadowDOM,R,null);G=fe.nextNode();)ti(D.uponSanitizeShadowNode,G,null),H1(G),K1(G),G.content instanceof i&&be(G.content);ti(D.afterSanitizeShadowDOM,R,null)};return e.sanitize=function(be){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=null,fe=null,gt=null,kn=null;if(oa=!be,oa&&(be="<!-->"),typeof be!="string"&&!V1(be))if(typeof be.toString=="function"){if(be=be.toString(),typeof be!="string")throw qu("dirty is not a string, aborting")}else throw qu("toString is not a function");if(!e.isSupported)return be;if(it||jr(R),e.removed=[],typeof be=="string"&&(W=!1),W){if(be.nodeName){const ni=Te(be.nodeName);if(!re[ni]||Ge[ni])throw qu("root node is forbidden and cannot be sanitized in-place")}}else if(be instanceof a)G=q1("<!---->"),fe=G.ownerDocument.importNode(be,!0),fe.nodeType===Vu.element&&fe.nodeName==="BODY"||fe.nodeName==="HTML"?G=fe:G.appendChild(fe);else{if(!zt&&!at&&!X&&be.indexOf("<")===-1)return k&&_?k.createHTML(be):be;if(G=q1(be),!G)return zt?null:_?S:""}G&&ln&&Ns(G.firstChild);const $t=U1(W?be:G);for(;gt=$t.nextNode();)H1(gt),K1(gt),gt.content instanceof i&&az(gt.content);if(W)return be;if(zt){if(cn)for(kn=N.call(G.ownerDocument);G.firstChild;)kn.appendChild(G.firstChild);else kn=G;return(ae.shadowroot||ae.shadowrootmode)&&(kn=M.call(r,kn,!0)),kn}let Xn=X?G.outerHTML:G.innerHTML;return X&&re["!doctype"]&&G.ownerDocument&&G.ownerDocument.doctype&&G.ownerDocument.doctype.name&&On(EO,G.ownerDocument.doctype.name)&&(Xn="<!DOCTYPE "+G.ownerDocument.doctype.name+`>
456`+Xn),at&&Tf([A,L,I],ni=>{Xn=Bu(Xn,ni," ")}),k&&_?k.createHTML(Xn):Xn},e.setConfig=function(){let be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jr(be),it=!0},e.clearConfig=function(){et=null,it=!1},e.isValidAttribute=function(be,R,G){et||jr({});const fe=Te(be),gt=Te(R);return W1(fe,gt,G)},e.addHook=function(be,R){typeof R=="function"&&Fu(D[be],R)},e.removeHook=function(be,R){if(R!==void 0){const G=OG(D[be],R);return G===-1?void 0:PG(D[be],G,1)[0]}return PC(D[be])},e.removeHooks=function(be){D[be]=[]},e.removeAllHooks=function(){D=FC()},e}var NO=CO();const cm=t=>t?NO.sanitize(t,{ALLOWED_TAGS:["p","br","strong","em","u","s","a","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","img","code","pre","iframe","span","div","figure","figcaption","mark","sub","sup","hr"],ALLOWED_ATTR:["href","src","alt","title","class","id","target","rel","width","height","frameborder","allowfullscreen","allow","style"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ADD_TAGS:["iframe"],ADD_ATTR:["allow","allowfullscreen","frameborder","target"]}):"",_O="https://halbierungs-initiative-nein.lovable.app",YG=`${_O}/og-image.png?v=5`,ZG=()=>{const{slug:t}=yk(),{data:e,isLoading:n}=Xs({queryKey:["qa-post",t],queryFn:async()=>{const{data:a,error:l}=await We.from("blog_posts").select("*").eq("slug",t).eq("category","qa").eq("is_published",!0).maybeSingle();if(l)throw l;return a},enabled:!!t});if(n)return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-12",children:[u.jsx(Ye,{className:"h-6 w-24 mb-4"}),u.jsx(Ye,{className:"h-12 w-3/4 mb-4"}),u.jsx(Ye,{className:"h-5 w-40 mb-8"}),u.jsx(Ye,{className:"aspect-[16/9] w-full rounded-xl mb-8"}),u.jsxs("div",{className:"space-y-4",children:[u.jsx(Ye,{className:"h-4 w-full"}),u.jsx(Ye,{className:"h-4 w-full"}),u.jsx(Ye,{className:"h-4 w-3/4"})]})]})]});if(!e)return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-16 text-center",children:[u.jsx("h1",{className:"text-2xl font-sans font-semibold text-foreground mb-4",children:"Beitrag nicht gefunden"}),u.jsx(Mt,{to:"/fragen-antworten",className:"text-primary hover:underline",children:"Zurück zu den häufigen Fragen"})]})]});const r=e.title,s=e.short_description||e.excerpt||"Nein zur Halbierungs-Initiative",i=e.featured_image||YG,o=`${_O}/qa/${e.slug}`;return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsxs(zj,{children:[u.jsxs("title",{children:[r," – Nein zur Halbierungs-Initiative"]}),u.jsx("meta",{name:"description",content:s}),u.jsx("meta",{property:"og:title",content:r}),u.jsx("meta",{property:"og:description",content:s}),u.jsx("meta",{property:"og:image",content:i}),u.jsx("meta",{property:"og:url",content:o}),u.jsx("meta",{property:"og:type",content:"article"}),u.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),u.jsx("meta",{name:"twitter:title",content:r}),u.jsx("meta",{name:"twitter:description",content:s}),u.jsx("meta",{name:"twitter:image",content:i})]}),u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-8 md:py-10",children:[u.jsxs("article",{className:"animate-fade-up",children:[e.qa_category&&u.jsx("span",{className:"inline-block px-3 py-1 text-sm font-medium bg-accent text-accent-foreground rounded-full mb-3",children:xa[e.qa_category]}),u.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-sans font-bold text-primary mb-4 leading-tight",children:e.title}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground mb-6",children:[e.author&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-medium text-foreground",children:e.author}
456),u.jsx("span",{className:"text-muted-foreground/50",children:"·"})]}),e.published_at&&u.jsx("time",{children:Wg(new Date(e.published_at),"d. MMMM yyyy",{locale:Gg})})]}),e.featured_image&&u.jsx("img",{src:e.featured_image,alt:e.title,className:"w-full aspect-[16/9] object-cover rounded-xl shadow-lg mb-6"}),e.video_url&&u.jsx("div",{className:"mb-6 aspect-video rounded-xl overflow-hidden bg-muted",children:u.jsx("iframe",{src:e.video_url,title:e.title,className:"w-full h-full",allowFullScreen:!0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"})}),e.audio_url&&u.jsx("div",{className:"mb-6 p-5 bg-muted rounded-xl",children:u.jsxs("audio",{controls:!0,className:"w-full",children:[u.jsx("source",{src:e.audio_url}),"Dein Browser unterstützt das Audio-Element nicht."]})}),e.social_embed&&u.jsx("div",{className:"mb-6",dangerouslySetInnerHTML:{__html:cm(e.social_embed)}}),e.short_description&&u.jsx("div",{className:"text-xl text-muted-foreground leading-relaxed mb-6 pb-6 border-b border-border",children:e.short_description}),u.jsx("div",{className:"prose prose-lg max-w-none prose-headings:font-sans prose-headings:text-foreground prose-headings:mt-6 prose-headings:mb-3 prose-p:text-muted-foreground prose-p:mb-4 prose-a:text-primary prose-strong:text-foreground prose-li:text-muted-foreground",dangerouslySetInnerHTML:{__html:cm(e.content)}})]}),u.jsx("div",{className:"mt-10 pt-6 border-t border-border",children:u.jsxs(Mt,{to:"/fragen-antworten",className:"inline-flex items-center gap-2 text-primary hover:text-primary/80 transition-colors font-medium",children:[u.jsx(Gs,{className:"h-4 w-4"}),"Zurück zu den häufigen Fragen"]})})]}),u.jsx(Gn,{}),u.jsx(jn,{})]})};function um(t,[e,n]){return Math.min(n,Math.max(e,t))}function Dk(t){const e=b.useRef({value:t,previous:t});return b.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var TO=["PageUp","PageDown"],AO=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jO={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Eu="Slider",[Zb,XG,e9]=zh(Eu),[RO,cie]=_r(Eu,[e9]),[t9,Kg]=RO(Eu),MO=b.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:d,onValueChange:h=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:g,...m}=t,y=b.useRef(new Set),v=b.useRef(0),w=o==="horizontal"?n9:r9,[k=[],S]=vs({prop:d,defaultProp:c,onChange:D=>{var L;(L=[...y.current][v.current])==null||L.focus(),h(D)}}),E=b.useRef(k);function C(D){const A=l9(k,D);M(D,A)}function N(D){M(D,v.current)}function T(){const D=E.current[v.current];k[v.current]!==D&&f(k)}function M(D,A,{commit:L}={commit:!1}){const I=h9(i),U=f9(Math.round((D-r)/i)*i+r,I),B=um(U,[r,s]);S((J=[])=>{const P=o9(J,B,A);if(d9(P,l*i)){v.current=P.indexOf(B);const z=String(P)!==String(J);return z&&L&&f(P),z?P:J}else return J})}return u.jsx(t9,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:s,valueIndexToChangeRef:v,thumbs:y.current,values:k,orientation:o,form:g,children:u.jsx(Zb.Provider,{scope:t.__scopeSlider,children:u.jsx(Zb.Slot,{scope:t.__scopeSlider,children:u.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...m,ref:e,onPointerDown:ge(m.onPointerDown,()=>{a||(E.current=k)}),min:r,max:s,inverted:p,onSlideStart:a?void 0:C,onSlideMove:a?void 0:N,onSlideEnd:a?void 0:T,onHomeKeyDown:()=>!a&&M(r,0,{commit:!0}),onEndKeyDown:()=>!a&&M(s,k.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:A})=>{if(!a){const U=TO.includes(D.key)||D.shiftKey&&AO.includes(D.key)?10:1,B=v.current,J=k[B],P=i*U*A;M(J+P,B,{commit:!0})}}})})})})});MO.displayName=Eu;var[OO,PO]=RO(Eu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),n9=b.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=t,[h,f]=b.useState(null),p=Ue(e,w=>f(w)),g=b.useRef(void 0),m=Hh(s),y=m==="ltr",v=y&&!i||!y&&i;function x(w){const k=g.current||h.getBoundingClientRect(),S=[0,k.width],C=Lk(S,v?[n,r]:[r,n]);return g.current=k,C(w-k.left)}
456return u.jsx(OO,{scope:t.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:u.jsx(IO,{dir:m,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const k=x(w.clientX);o==null||o(k)},onSlideMove:w=>{const k=x(w.clientX);a==null||a(k)},onSlideEnd:()=>{g.current=void 0,l==null||l()},onStepKeyDown:w=>{const S=jO[v?"from-left":"from-right"].includes(w.key);c==null||c({event:w,direction:S?-1:1})}})})}),r9=b.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...c}=t,d=b.useRef(null),h=Ue(e,d),f=b.useRef(void 0),p=!s;function g(m){const y=f.current||d.current.getBoundingClientRect(),v=[0,y.height],w=Lk(v,p?[r,n]:[n,r]);return f.current=y,w(m-y.top)}return u.jsx(OO,{scope:t.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:u.jsx(IO,{"data-orientation":"vertical",...c,ref:h,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const y=g(m.clientY);i==null||i(y)},onSlideMove:m=>{const y=g(m.clientY);o==null||o(y)},onSlideEnd:()=>{f.current=void 0,a==null||a()},onStepKeyDown:m=>{const v=jO[p?"from-bottom":"from-top"].includes(m.key);l==null||l({event:m,direction:v?-1:1})}})})}),IO=b.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...c}=t,d=Kg(Eu,n);return u.jsx(Ee.span,{...c,ref:e,onKeyDown:ge(t.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(a(h),h.preventDefault()):TO.concat(AO).includes(h.key)&&(l(h),h.preventDefault())}),onPointerDown:ge(t.onPointerDown,h=>{const f=h.target;f.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(f)?f.focus():r(h)}),onPointerMove:ge(t.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:ge(t.onPointerUp,h=>{const f=h.target;f.hasPointerCapture(h.pointerId)&&(f.releasePointerCapture(h.pointerId),i(h))})})}),DO="SliderTrack",LO=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=Kg(DO,n);return u.jsx(Ee.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});LO.displayName=DO;var Xb="SliderRange",zO=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=Kg(Xb,n),i=PO(Xb,n),o=b.useRef(null),a=Ue(e,o),l=s.values.length,c=s.values.map(f=>BO(f,s.min,s.max)),d=l>1?Math.min(...c):0,h=100-Math.max(...c);return u.jsx(Ee.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:a,style:{...t.style,[i.startEdge]:d+"%",[i.endEdge]:h+"%"}})});zO.displayName=Xb;var e0="SliderThumb",$O=b.forwardRef((t,e)=>{const n=XG(t.__scopeSlider),[r,s]=b.useState(null),i=Ue(e,a=>s(a)),o=b.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return u.jsx(s9,{...t,ref:i,index:o})}),s9=b.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,o=Kg(e0,n),a=PO(e0,n),[l,c]=b.useState(null),d=Ue(e,x=>c(x)),h=l?o.form||!!l.closest("form"):!0,f=ok(l),p=o.values[r],g=p===void 0?0:BO(p,o.min,o.max),m=a9(r,o.values.length),y=f==null?void 0:f[a.size],v=y?c9(y,g,a.direction):0;return b.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),u.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${g}% + ${v}px)`},children:[u.jsx(Zb.ItemSlot,{scope:t.__scopeSlider,children:u.jsx(Ee.span,{role:"slider","aria-label":t["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:d,style:p===void 0?{display:"none"}:t.style,onFocus:ge(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),h&&u.jsx(FO,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:p},r)]})});$O.displayName=e0;var i9="RadioBubbleInput",FO=b.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const s=b.useRef(null),i=Ue(s,r),o=Dk(e);return b.useEffect(()=>{const a=s.current;if(!a)return;const l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&d){const h=new Event("input",{bubbles:!0});d.call(a,e),a.dispatchEvent(h)}},[o,e]),u.jsx(Ee.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});FO.displayName=i9;function o9(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function BO(t,e,n){const i=100/(n-e)*(t-e);return um(i,[0,100])}function a9(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function l9(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function c9(t,e,n){const r=t/2,i=Lk([0,50],[0,r]);return(r-i(e)*n)*n}function u9(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function d9(t,e){if(e>0){const n=u9(t);return Math.min(...n)>=e}return!0}function Lk(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function h9(t){return(String(t).split(".")[1]||"").length}function f9(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var qO=MO,p9=LO,m9=zO,g9=$O;const UO=b.forwardRef(({className:t,...e},n)=>u.jsxs(qO,{ref:n,className:Z("relative flex w-full touch-none select-none items-center",t),...e,children:[u.jsx(p9,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:u.jsx(m9,{className:"absolute h-full bg-primary"})}),u.jsx(g9,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));
456UO.displayName=qO.displayName;const y9=()=>{Oi();const t=ei(),[e]=zg(),n=b.useMemo(()=>{const k=e.get("n");if(k){const S=parseInt(k,10);if(!isNaN(S)&&S>=1&&S<=50)return S}return 3},[e]),[r,s]=b.useState(n);b.useEffect(()=>{s(n)},[n]);const{stats:i,isLoading:o}=Bg(),a=b.useRef(null);b.useEffect(()=>{(t.hash==="#commitment"||e.get("n"))&&setTimeout(()=>{var k;(k=a.current)==null||k.scrollIntoView({behavior:"smooth",block:"start"})},100)},[t.hash,e]);const[l,c]=b.useState(!1),[d,h]=b.useState(0),f=b.useRef(0),[p,g]=b.useState(!1),[m,y]=b.useState(!1),v=b.useRef(null),x=k=>{s(k[0]),g(!0),y(!1),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{y(!0)},3e3)},w=()=>!p||m?"Remplis le formulaire et envoie-le.":r>=1&&r<=3?"💪 Bon début – chaque voix compte.":r>=4&&r<=10?"👍 Super – ça fait vraiment la différence.":r>=11&&r<=15?"🚀 Génial ! Ça lance une dynamique.":r>=16&&r<=25?"⚡ Impressionnant ! Tu fais bouger les choses.":r>=26&&r<=35?"🎯 Wow ! C'est comme ça qu'on gagne une votation.":"🎉 C'est ça, la force d'une campagne. Merci !";return b.useEffect(()=>{if(!o&&i.committed_count>0){const k=f.current;if(k>0&&i.committed_count>k){h(i.committed_count-k),c(!0);const S=setTimeout(()=>{c(!1),h(0)},3e3);return()=>clearTimeout(S)}f.current=i.committed_count}},[i.committed_count,o]),b.useEffect(()=>{const k=document.createElement("script");return k.src="https://tally.so/widgets/embed.js",k.async=!0,document.body.appendChild(k),()=>{const S=document.querySelector('script[src="https://tally.so/widgets/embed.js"]');S&&S.parentNode&&S.parentNode.removeChild(S)}},[]),b.useEffect(()=>{const k=S=>{var E,C,N,T,M;(N=(C=(E=S.data)==null?void 0:E.event)==null?void 0:C.startsWith)!=null&&N.call(C,"Tally.")&&console.log("Tally event received:",S.data),(((T=S.data)==null?void 0:T.event)==="Tally.FormSubmitted"||((M=S.data)==null?void 0:M.type)==="form:submit")&&(window.location.href="https://nein-zur-halbierungs-initiative.community/danke?source=participer")};return window.addEventListener("message",k),()=>window.removeEventListener("message",k)},[]),b.useEffect(()=>{typeof window.Tally<"u"&&window.Tally.loadEmbeds()},[r]),u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsx("section",{ref:a,id:"commitment",className:"bg-primary py-5 md:py-10",children:u.jsxs("div",{className:"container max-w-2xl mx-auto px-4 md:px-6",children:[u.jsx("div",{className:"text-center mb-3 md:mb-5",children:u.jsx("h2",{className:"font-sans text-xl md:text-3xl lg:text-4xl font-semibold text-primary-foreground leading-tight",children:"Avec combien de personnes vas-tu parler de l'initiative SSR d'ici au 8 mars ?"})}),u.jsxs("div",{className:"bg-white rounded-2xl shadow-xl overflow-hidden",children:[u.jsxs("div",{className:"p-3 md:p-5",children:[u.jsx("div",{className:"text-center mb-3 md:mb-4",children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 md:gap-2 bg-accent/20 text-accent-foreground text-xs px-2.5 md:px-4 py-1 md:py-2 rounded-full",children:[u.jsx(Jp,{className:"w-3 h-3 md:w-4 md:h-4"}),"Conseil : WhatsApp et les e-mails comptent également."]})}),u.jsxs("div",{className:"bg-muted/30 rounded-xl p-3 md:p-4",children:[u.jsxs("div",{className:"text-center mb-2 md:mb-3",children:[u.jsx("span",{className:"text-3xl md:text-5xl font-bold text-primary tabular-nums leading-none",children:r}),u.jsx("span",{className:"block text-xs md:text-sm text-muted-foreground mt-1",children:r===1?"conversation":"conversations"})]}),u.jsx(UO,{value:[r],onValueChange:x,min:1,max:50,step:1,className:"py-1"}),u.jsxs("div",{className:"flex justify-between mt-1",children:[u.jsx("span",{className:"text-xs text-muted-foreground",children:"1"}),u.jsx("span",{className:"text-xs text-muted-foreground",children:"50"})]}),u.jsx("p",{className:"text-sm text-center text-foreground font-medium mt-3 animate-fade-in",children:w()},`${p}-${m}-${r}`)]})]}),u.jsx("div",{className:"px-4 md:px-5 pt-3 md:pt-4 pb-4 md:pb-5 bg-muted/20",children:u.jsx("iframe",{"data-tally-src":`https://tally.so/embed/Gxde0p?alignLeft=1&hideTitle=1&transparentBackgroun
456d=1&dynamicHeight=1&talk_number=${r}`,loading:"lazy",width:"100%",height:"260",frameBorder:"0",marginHeight:0,marginWidth:0,title:"Je participe !",className:"min-h-[220px]"},`tally-form-${r}`)})]})]})}),u.jsx(jn,{})]})},v9=["all","news","podcast","anleitung","medien"],x9=()=>{const[t,e]=b.useState("all"),{data:n,isLoading:r}=KM(t==="all"?void 0:t,void 0,!0);return u.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("main",{className:"flex-1",children:[u.jsx("section",{className:"py-8 md:py-10 bg-muted/30",children:u.jsxs("div",{className:"container max-w-7xl mx-auto px-4 md:px-6",children:[u.jsx("h1",{className:"font-sans text-3xl md:text-4xl lg:text-5xl font-semibold text-foreground mb-3",children:"Blog & Aktuelles"}),u.jsx("p",{className:"text-muted-foreground text-lg max-w-2xl",children:"Neuigkeiten, Anleitungen, Podcasts und mehr rund um die Halbierungs-Initiative."})]})}),u.jsx("section",{className:"py-4 border-b border-border sticky top-0 bg-background/95 backdrop-blur z-10",children:u.jsx("div",{className:"container max-w-7xl mx-auto px-4 md:px-6",children:u.jsx("div",{className:"flex flex-wrap gap-2",children:v9.map(s=>u.jsx("button",{onClick:()=>e(s),className:`px-4 py-2 rounded-full text-sm font-medium transition-colors ${t===s?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:s==="all"?"Alle":rl[s]},s))})})}),u.jsx("section",{className:"py-8 md:py-10",children:u.jsx("div",{className:"container max-w-7xl mx-auto px-4 md:px-6",children:r?u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3,4,5,6].map(s=>u.jsxs("div",{className:"rounded-xl overflow-hidden border border-border",children:[u.jsx(Ye,{className:"aspect-[16/9]"}),u.jsxs("div",{className:"p-5 space-y-3",children:[u.jsx(Ye,{className:"h-4 w-24"}),u.jsx(Ye,{className:"h-6 w-full"}),u.jsx(Ye,{className:"h-4 w-3/4"})]})]},s))}):n&&n.length>0?u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:n.map((s,i)=>s.homepage_style==="text"?u.jsx(Nk,{post:s,index:i},s.id):u.jsx(Ck,{post:s},s.id))}):u.jsx("div",{className:"text-center py-16",children:u.jsx("p",{className:"text-muted-foreground text-lg",children:"Noch keine Beiträge in dieser Kategorie."})})})})]}),u.jsx(Gn,{}),u.jsx(jn,{})]})},b9=()=>(b.useEffect(()=>{const t=document.createElement("script");return t.src="https://tally.so/widgets/embed.js",t.async=!0,document.body.appendChild(t),()=>{const e=document.querySelector('script[src="https://tally.so/widgets/embed.js"]');e&&e.remove()}},[]),b.useEffect(()=>{window.location.hash==="#newsletter-form"&&setTimeout(()=>{var t;(t=document.getElementById("newsletter-form"))==null||t.scrollIntoView({behavior:"smooth"})},100)},[]),u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsx("main",{className:"py-16 md:py-24",children:u.jsxs("div",{className:"container max-w-2xl mx-auto px-4 md:px-6",children:[u.jsxs("div",{className:"text-center mb-12",children:[u.jsx("h1",{className:"font-sans text-3xl md:text-4xl font-semibold text-foreground mb-4",children:"Rester informé·e"}),u.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"Recevez des actualités, des pistes de discussion et des analyses sur l'initiative de réduction de moitié."})]}),u.jsx("div",{id:"newsletter-form",className:"bg-card rounded-2xl border border-border/50 p-8 md:p-12 shadow-sm",children:u.jsx("iframe",{"data-tally-src":"https://tally.so/embed/7R2XWR?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1",loading:"lazy",width:"100%",height:"200",frameBorder:"0",marginHeight:0,marginWidth:0,title:"Newsletter"})})]})}),u.jsx(Gn,{}),u.jsx(jn,{})]})),w9=()=>{const[t]=zg();return t.get("source"),u.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsx("main",{className:"flex-1 flex items-center justify-center py-6 md:py-10",children:u.jsxs("div",{className:"container max-w-2xl mx-auto px-4 md:px-6 text-center",children:[u.jsx("h1",{className:"font-sans text-2xl md:text-3xl lg:text-4xl font-semibold text-foreground mb-3",children:"Merci beaucoup pour ta participation et ton soutien."}),u.jsx("p",{className:"text-muted-foreground text-base mb-8",children:"Daniel, Lisa & Pascal, équipe de campagne"}),u.jsxs("div",{className:"bg-muted border border-border rounded-2xl p-6 md:p-8 mb-8",children:[u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mb-3",children:"Soutenir la campagne"}),u.jsx("p",{className:"text-muted-foreground mb-6",children:"Notre campagne vit grâce au soutien de personnes engagées. Avec votre don, vous renforcez le service public et la démocratie."}),u.jsxs("a",{href:"https://www.democratie.ch/dons-contre-initiative-ssr?rnw-payment_type=onetime&rnw-amount=120&mtm_campaign=community_webseite_FR&mtm_source=button_top",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-accent text-accent-foreground px-6 py-3 rounded-full text-base font-medium hover:bg-accent/90 transition-all",children:[u.jsx(qo,{className:"w-5 h-5"}),"Je fais un don"]})]})]})}),u.jsx(jn,{})]})},k9="/assets/claudio-kuster-az1nKxqs.jpg",S9="/assets/daniel-graf-ByGHxlgU.jpg",E9="/assets/lucy-koechlin-DgMttods.jpg",C9="/assets/marco-kistler-CUQWgViQ.jpg",N9="/assets/sophie-fuerst-Cetdl_v-.jpg",BC=[{name:"Graf",image:S9},{name:"Köchlin",image:E9},{name:"Kistler",image:C9},{name:"Kuster",image:k9},{name:"Fürst",image:N9}],_9=()=>u.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsx("main",{className:"flex-1 py-12 md:py-16",children:u.jsxs("div",{className:"container max-w-3xl mx-auto px-4 md:px-6",children:[u.jsxs("div",{className:"text-center mb-10 md:mb-12",children:[u.jsx("h1",{className:"font-sans text-3xl md:text-4xl font-semibold text-foreground mb-2",children:"Über uns"}),u.jsx("p",{className:"text-muted-foreground","aria-hidden":"true",children:"Stiftung für direkte Demokratie"})]}),u.jsx("div",{className:"flex justify-center mb-10",children:u.jsx("div",{className:"flex -sp
456ace-x-4",children:BC.map((t,e)=>u.jsx("div",{className:"w-16 h-16 md:w-20 md:h-20 rounded-full overflow-hidden border-3 border-background shadow-lg ring-2 ring-background",style:{zIndex:BC.length-e},children:u.jsx("img",{src:t.image,alt:"Stiftungsrat",className:"w-full h-full object-cover"})},t.name))})}),u.jsxs("div",{className:"space-y-5 text-foreground/90 leading-relaxed text-center max-w-2xl mx-auto mb-12",children:[u.jsxs("p",{children:["Die Abstimmungskampagne gegen die Halbierungs-Initiative wird von der"," ",u.jsx("a",{href:"https://www.demokratie.ch",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:opacity-80",children:"Stiftung für direkte Demokratie"})," ","getragen."]}),u.jsx("p",{children:"Die Stiftung setzt sich für den Schutz der politischen Rechte und für die Weiterentwicklung der direkten Demokratie ein. Gemeinsam suchen wir Verbündete, bauen eine starke Community auf und stellen effiziente Werkzeuge zur Verfügung."}),u.jsxs("p",{children:["Seit 2015 haben wir über die Plattform"," ",u.jsx("a",{href:"https://www.wecollect.ch",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:opacity-80",children:"WeCollect"})," ","mehr als 875'000 Unterschriften für Initiativen und Referenden gesammelt."]})]}),u.jsxs("div",{className:"bg-muted border border-border rounded-2xl p-6 md:p-8 text-center",children:[u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mb-3",children:"Kampagne stärken – jetzt spenden!"}),u.jsx("p",{className:"text-muted-foreground mb-6",children:"Mit deiner Spende ermöglichen wir Materialien, Trainings und die Koordination von 100'000 Gesprächen gegen die Halbierungs-Initiative."}),u.jsxs("a",{href:"https://www.demokratie.ch/spende-gegen-srg-initiative?rnw-payment_type=onetime&rnw-amount=120&mtm_campaign=community_webseite_DE&mtm_source=ueber-uns",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-primary text-primary-foreground px-6 py-3 rounded-full text-base font-medium hover:bg-primary/90 transition-all",children:[u.jsx(qo,{className:"w-5 h-5"}),"Jetzt spenden"]})]})]})}),u.jsx(Gn,{}),u.jsx(jn,{})]});var T9="AspectRatio",VO=b.forwardRef((t,e)=>{const{ratio:n=1/1,style:r,...s}=t;return u.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/n}%`},"data-radix-aspect-ratio-wrapper":"",children:u.jsx(Ee.div,{...s,ref:e,style:{...r,position:"absolute",top:0,right:0,bottom:0,left:0}})})});VO.displayName=T9;var A9=VO;const j9=A9,il=[{id:"arg-a1-200-franken",type:"argument",title:"«200 Franken sind doch genug»",trigger:"«200 Franken sind doch genug. Die SRG muss einfach sparen wie alle anderen auch.»",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Wie reagierst du?",options:[{id:"q1-a",text:"«Die SRG spart ja bereits.»",einordnung:"Zeigt Verständnis, bleibt aber in der Spar-Logik.",quality:"neutral"},{id:"q1-b",text:"«200 Franken klingt nach Sparen – tatsächlich halbiert man damit das Budget.»",einordnung:"Sehr gut geeignet: klärt das Missverständnis sachlich auf.",quality:"good"},{id:"q1-c",text:"«Für mich geht es weniger um den Betrag als um verlässliche Information.»",einordnung:"Gut: zeigt Haltung und öffnet das Gespräch.",quality:"good"}]},{context:"Das Gegenüber sagt:",question:"«Man kann doch überall ein bisschen kürzen.»",options:[{id:"q2-a",text:"«Hier geht es nicht um ein bisschen, sondern um einen massiven Einschnitt.»",einordnung:"Sehr gut geeignet: klar, sachlich, macht den Unterschied sichtbar.",quality:"good"},{id:"q2-b",text:"«Mit halb so viel Geld leidet vor allem die regionale Berichterstattung.»",einordnung:"Gut: konkret und nachvollziehbar.",quality:"good"},{id:"q2-c",text:"«Bis jetzt hat es jedes Mal einen Aufschrei gegeben, wenn eine Sendung gestrichen wurde»",einordnung:"Gibt Kontext, verschiebt die Diskussion aber auf einzelne Sendungen.",quality:"neutral"}]}],einordnung:{title:"Zusammenfassung",points:["Massive Budgetkürzung für die SRG","Weniger regionale Beric
456hterstattung","Minderheitensprachen besonders betroffen","Mehr Einflussmöglichkeit von privaten Medien","Mehr Abhängigkeit von ausländischen Inhalten"]},abschluss:{points:[],motivation:"Worum es geht: starke, unabhängige Information aus der ganzen Schweiz."},relatedContent:{arguments:["Argument A2"],situations:["Situation Familie/Küchentisch"],grundlagen:["Grundlage G1"]}},{id:"arg-a2-kahlschlag",type:"argument",title:"«Die Halbierungs-Initiative ist ein Kahlschlag für den Service public»",trigger:"«Man kann bei der SRG ja ein bisschen sparen. So schlimm wird das nicht.»",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Wie reagierst du?",options:[{id:"q1-a",text:"«Ich verstehe den Impuls – aber hier geht es nicht um ein paar Prozent, sondern um einen spürbaren Einschnitt.»",einordnung:"Zurückhaltend, aber korrekt. Übernimmt das Spar-Framing nicht.",quality:"neutral"},{id:"q1-b",text:"«Das ist kein bisschen Sparen, sondern ein Kahlschlag.»",einordnung:"Sehr gut: benennt die Realität klar und deutlich.",quality:"good"},{id:"q1-c",text:"«Genau diese Kürzung hätte massive Folgen.»",einordnung:"Gut: macht die Dimension sichtbar.",quality:"good"}]},{context:"Das Gegenüber sagt:",question:"«Die wichtigsten Infos bleiben doch.»",options:[{id:"q2-a",text:"«Gerade Information ist teuer: Recherche, Einordnung, Präsenz.»",einordnung:"Sehr gut: erklärt, warum Qualität kostet.",quality:"good"},{id:"q2-b",text:"«Mit halb so viel Geld verschwinden zuerst regionale Angebote.»",einordnung:"Gut: konkret und nachvollziehbar.",quality:"good"},{id:"q2-c",text:"«Das funktioniert vor allem in grossen Regionen – anderswo wird das Angebot schnell dünn.»",einordnung:"Zurückhaltend, aber realistisch. Kein Übernehmen des Gegenarguments.",quality:"neutral"}]}],einordnung:{title:"Zusammenfassung",points:["Massive Budgetkürzung für die SRG","Abbau von Regionalstudios","Weniger Einordnung & Tiefe","Minderheitensprachen verlieren","Private Medie
456n können das nicht ersetzen"]},abschluss:{points:[],motivation:"Worum es geht: Service public ist Infrastruktur, kein Luxus."},relatedContent:{arguments:["Argument A1"],situations:["Situation Arbeitsplatz"],grundlagen:["Grundlage G3"]}},{id:"arg-a3-nutzung",type:"argument",title:"«Ich nutze die SRG gar nicht»",trigger:"«Ich schaue oder höre die SRG kaum. Warum soll ich dafür zahlen?»",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Wie reagierst du?",options:[{id:"q1-a",text:"«Viele private Medien nutzen auch Inhalte der SRG»",einordnung:"Zeigt Verständnis, bleibt aber in der Nutzungs-Logik.",quality:"neutral"},{id:"q1-b",text:"«Es geht nicht um Nutzung, sondern um Grundversorgung.»",einordnung:"Sehr gut: verschiebt die Perspektive auf Infrastruktur.",quality:"good"},{id:"q1-c",text:"«Du profitierst trotzdem davon.»",einordnung:"Gut: macht indirekten Nutzen sichtbar.",quality:"good"}]},{context:"Das Gegenüber sagt:",question:"«Ich informiere mich online.»",options:[{id:"q2-a",text:"«Gerade dort braucht es verlässliche Referenzen.»",einordnung:"Sehr gut: zeigt Funktion der SRG im digitalen Raum.",quality:"good"},{id:"q2-b",text:"«Genau darum ist es wichtig, dass die SRG weiterhin online Inhalte bereitstellt.»",einordnung:"Gut: verweist auf das online Angebot der SRG.",quality:"good"},{id:"q2-c",text:"«Die SRG muss allen Nutzungs-Verhalten gerecht werden, sowohl offline wie online»",einordnung:"Gut: zeigt die Breite des SRG-Angebots.",quality:"good"}]}],einordnung:{title:"Zusammenfassung",points:["SRG ist kein Abo, sondern Infrastruktur","Gemeinsame Faktenbasis für Abstimmungen","Die SRG ist auf verschiedenen Kanälen präsent","Schutz vor Desinformation","Nutzen auch für Wenignutzer:innen"]},abschluss:{points:[],motivation:"Worum es geht: Demokratie funktioniert nicht nach Abo-Logik."},relatedContent:{arguments:["Argument A5"],situations:["Situation Freundeskreis"],grundlagen:["Grundlage G2"]}},{id:"arg-a4-unternehmen",type:"argument",title:"«Unternehmen zahlen doppelt»",trigger:"«Die Unternehmensabgabe ist eine ungerechte Doppelbelastung.»",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Wie reagierst du?",options:[{id:"q1-a",text:"«Ja, das klingt erstmal unfair.»",einordnung:"Zeigt Verständnis, aber verändert den Diskurs nicht.",quality:"neutral"},{id:"q1-b",text:"«Die meisten Unternehmen zahlen heute gar nichts mehr.»",einordnung:"Sehr gut: korrigiert den Irrtum sachlich.",quality:"good"},{id:"q1-c",text:"«Unternehmen profitieren auch vom Mediensystem.»",einordnung:"Gut: erweitert die Perspektive.",quality:"good"}]},{context:"Das Gegenüber sagt:",question:"«Ich sehe nicht ein, warum Unternehmen überhaupt Serafe-Gebühren zahlen sollen.»",options:[{id:"q2-a",text:"«Unternehmen sind Teil derselben gesellschaftlichen Infrastruktur.»",einordnung:"Gut: setzt den Solidaritätsframe, bleibt ruhig und abstrakt.",quality:"good"},{id:"q2-b",text:"«Unternehmen profitieren genauso von verlässlicher Information.»",einordnung:"Sehr gut: benennt den Nutzen direkt, ohne zu rechtfertigen.",quality:"good"},{id:"q2-c",text:"«Eine funktionierende Demokratie ist auch für Unternehmen ein Standortfaktor.»",einordnung:"Sehr gut: verbindet Medien, Wirtschaft und Stabilität.",quality:"good"}]}],einordnung:{title:"Zusammenfassung",points:["Mehrheit der Unternehmen bereits befreit","Weitere Entlastungen beschlossen","Initiative unnötig und überzogen","Auch Unternehmen profitieren von verlässlicher Information","Schwächung der SRG schadet dem gesamten Mediensystem"]},abschluss:{points:[],motivation:"Worum es geht: Verantwortung für eine Infrastruktur, von der auch Unternehmen profitieren."},relatedContent:{arguments:["Argument A8"],situations:["Situation Arbeitsplatz"],grundlagen:["Grundlage G1"]}},{id:"arg-a5-fakenews",type:"argument",title:"«Ohne starke SRG wird unsere Demokratie anfälliger für Fake News»",trigger:"«Es gibt doch genug Informationen im Internet.»",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Wie reagierst du?",options:[{id:"q1-a",text:"«Information gibt es viel, verlässliche weniger.»",einordnung:"Sehr gut: macht den Unterschied 
456sichtbar.",quality:"good"},{id:"q1-b",text:"«Gerade bei Abstimmungen braucht es geprüfte Infos.»",einordnung:"Gut: verbindet mit Demokratie.",quality:"good"},{id:"q1-c",text:"«Nicht alle Personen nutzen das Internet»",einordnung:"Neutral: anerkennt das Problem, ohne Lösung anzubieten.",quality:"neutral"}]},{context:"Das Gegenüber sagt:",question:"«Man kann ja mehrere Quellen vergleichen.»",options:[{id:"q2-a",text:"«Dafür braucht es gemeinsame Referenzen.»",einordnung:"Sehr gut: zeigt die Funktion der SRG.",quality:"good"},{id:"q2-b",text:"«Algorithmen fördern Polarisierung, nicht Einordnung.»",einordnung:"Gut: erklärt das strukturelle Problem.",quality:"good"},{id:"q2-c",text:"«Das funktioniert in der Praxis nur begrenzt.»",einordnung:"Neutral: anerkennt das Problem, ohne Lösung anzubieten.",quality:"neutral"}]}],einordnung:{title:"Zusammenfassung",points:["Zunahme von Desinformation","SRG als glaubwürdige Referenz","Gemeinsame Faktenbasis","Schutz der direkten Demokratie","Unabhängig von Klick- & Werbedruck"]},abschluss:{points:[],motivation:"Worum es geht: Vertrauen ist demokratische Infrastruktur."},relatedContent:{arguments:["Argument A6"],situations:["Situation Social Talk"],grundlagen:["Grundlage G2"]}},{id:"arg-a6-zusammenhalt",type:"argument",title:"«Der Zusammenhalt der Schweiz steht auf dem Spiel»",trigger:"«Warum soll ich für andere Sprachregionen zahlen?»",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Wie reagierst du?",options:[{id:"q1-a",text:"«Man merkt den Nutzen im Alltag oft nicht.»",einordnung:"Zeigt Verständnis, bleibt aber defensiv.",quality:"neutral"},{id:"q1-b",text:"«Ohne SRG gäbe es keine gemeinsame Öffentlichkeit.»",einordnung:"Sehr gut: macht die verbindende Funktion sichtbar.",quality:"good"},{id:"q1-c",text:"«Das ist halt Solidarität.»",einordnung:"Inhaltlich richtig, wirkt aber belehrend.",quality:"poor"}]}
456,{context:"Das Gegenüber sagt:",question:"«Private Medien könnten das übernehmen.»",options:[{id:"q2-a",text:"«Sie berichten kaum aus anderen Sprachregionen.»",einordnung:"Gut: zeigt die Lücke im Markt.",quality:"good"},{id:"q2-b",text:"«Das rechnet sich wirtschaftlich nicht.»",einordnung:"Sehr gut: erklärt das strukturelle Problem.",quality:"good"},{id:"q2-c",text:"«Private Medien arbeiten aber im Gegensatz zu der SRG in einer Profitlogik»",einordnung:"Gut: betont, dass private Medien eine schlechte Alternative sind.",quality:"good"}]}],einordnung:{title:"Zusammenfassung",points:["Schweiz ist viersprachig","SRG verbindet Regionen","Minderheiten besonders abhängig","Keine oder schlechte Alternative im Markt","Gefahr medialer Fragmentierung"]},abschluss:{points:[],motivation:"Worum es geht: Zusammenhalt entsteht nicht von selbst."},relatedContent:{arguments:["Argument A2"],situations:["Situation Familie"],grundlagen:["Grundlage G4"]}},{id:"arg-a7-sparen",type:"argument",title:"«Die Initiative ist unnötig – Sparen läuft bereits»",trigger:"«Die SRG muss endlich gezwungen werden zu sparen.»",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Wie reagierst du?",options:[{id:"q1-a",text:"«Sparen ist grundsätzlich richtig.»",einordnung:"Zeigt Verständnis, übernimmt aber das Framing.",quality:"neutral"},{id:"q1-b",text:"«Die SRG spart bereits massiv.»",einordnung:"Zeigt Verständnis, übernimmt aber das Framing.",quality:"neutral"},{id:"q1-c",text:"«Sparen geht auch mit Abbau einher»",einordnung:"Gut: verschiebt Fokus auf die Folgen",quality:"good"}]},{context:"Das Gegenüber sagt:",question:"«Aber zu langsam.»",options:[{id:"q2-a",text:"«Die Gebühren werden bereits gesenkt.»",einordnung:"Zeigt Verständnis, übernimmt aber das Framing.",quality:"neutral"},{id:"q2-b",text:"«Zusätzliche Kürzungen wären destruktiv.»",einordnung:"Sehr Gut: macht die Konsequenzen sichtbar.",quality:"good"},{id:"q2-c",text:"«Solche Veränderungen brauchen Zeit.»",einordnung:"Neutral: zeigt Verständnis, widerspricht der Forderungen aber nicht.",quality:"neutral"}]}],einordnung:{title:"Zusammenfassung",points:["Gebühren werden schrittweise gesenkt","SRG bereits im Umbau","Initiative schiesst weit übers Ziel hinaus","Konsequenzen von weiterem Sparkurs einschneidend"]},abschluss:{points:[],motivation:"Worum es geht: Veränderungen ja – Kahlschlag nein."},relatedContent:{arguments:["Argument A4"],situations:["Situation Arbeitsplatz"],grundlagen:["Grundlage G1"]}},{id:"arg-a8-kernauftrag",type:"argument",title:"«Kernauftrag-Argument schwächt die Information»",trigger:"«Die SRG soll sich auf Information und Bildung beschränken.»",worumEsGeht:{points:[],outro:""},gespraechsantworten:[],questions:[{question:"Wie reagierst du?",options:[{id:"q1-a",text:"«Das klingt erstmal logisch.»",einordnung:"Zeigt Verständnis, aber übernimmt falsches Framing.",quality:"neutral"},{id:"q1-b",text:"«Ohne Breite erreicht Information kaum Leute.»",einordnung:"Sehr gut: erklärt die Wechselwirkung.",quality:"good"},{id:"q1-c",text:"«Der Auftrag an die SRG wird in Verfassung und Gesetz geregelt»",einordnung:"Zurückhaltend: widerspricht nicht, aber zeigt, dass die Initiative das Problem nicht löst.",quality:"neutral"}]},{context:"Das Gegenüber sagt:",question:"«Information ist doch wichtiger als Unterhaltung.»",options:[{id:"q2-a",text:"«Information braucht Reichweite, um zu wirken.»",einordnung:"Sehr gut: verbindet beide Aspekte.",quality:"good"},{id:"q2-b",text:"«Sonst bleibt sie ein Nischenangebot.»",einordnung:"Gut: macht die Konsequenz sichtbar.",quality:"good"},{id:"q2-c",text:"«Der Auftrag ist breiter angelegt.»",einordnung:"Gut: Verweist sachlich auf die bestehende Logik des Service public.",quality:"good"}]}],einordnung:{title:"Zusammenfassung",points:["Information braucht Publikum","Breite Angebote schaffen Reichweite","Es gibt nicht den einen Kernauftrag","Weniger Wirkung für Demokratie","Kein vergleichbares Modell in der Schweiz"]},abschluss:{points:[],motivation:"Worum es geht: Information wirkt nur, wenn sie Menschen erreicht."},relatedContent:{arguments:["Argument A5"],situations:["Situation Freundeskreis"],grundlagen:["Grundlage G3"]}}],ol=[{id:"sit-familie",type:"situation",title:"Am Küchentisch",setting:`Sonntagmittag bei deiner Familie. Der Tisch ist noch nicht abgeräumt: Kaffeetassen, Dessertreste, irgendwo steht eine Schale mit Guetzli. Die Stimmung ist ruhig, leicht träge. Man redet durcheinander – über Arbeit, Ferienpläne, irgendetwas aus den Nachrichten.
457
458Du hörst zu, sagst wenig. Es ist gemütlich. Niemand sucht Streit.`,trigger:"«Ganz ehrlich: Die SRG ist viel zu teuer. 200 Franken sind doch genug.»",triggerContext:"Dann sagt dein Onkel, eher beiläufig als provokativ:",triggerOutro:`Ein paar nicken. Niemand widerspricht sofort. Der Satz bleibt kurz im Raum stehen.
459
460Du merkst: Jetzt entscheidet sich, ob das Gespräch einfach weiterläuft – oder ob du etwas einbringst.`,dialogSteps:[{stepLabel:"Wie steigst du ein?",question:"Wie steigst du ein?",variants:[{id:"d1-a",label:"ruhig einordnen",text:"«200 Franken klingt nach Sparen – aber damit würde man der SRG fast die Hälfte des Budgets entziehen.»",consequence:"De
460ine Tante schaut auf. Man merkt: Diese Dimension war nicht allen bewusst."},{id:"d1-b",label:"persönlich bleiben",text:"«Mich beschäftigt weniger der Betrag als die Frage, woher wir unsere Informationen bekommen.»",consequence:"Das Gespräch wird persönlicher. Nicht alle sind sofort einverstanden, aber man hört dir zu."}]},{stepLabel:"Entscheidung 2",sceneIntro:"Ein anderes Familienmitglied mischt sich ein, während jemand neue Kaffeetassen holt:",question:"«Aber braucht man heute überhaupt noch so eine grosse SRG? Es gibt doch genug andere Angebote.»",variants:[{id:"d2-a",label:"digitale Realität aufgreifen",text:"«Gerade online braucht es verlässliche Informationen aus der Schweiz. Sonst setzen sich Fake News schneller durch.»",consequence:"Das Gespräch wird ernster. Jemand nickt zustimmend."},{id:"d2-b",label:"Regionen ins Spiel bringen",text:"«Ohne SRG gäbe es viel weniger Berichterstattung aus den Kantonen und kleineren Sprachregionen.»",consequence:"Eine neue Perspektive liegt auf dem Tisch. Für einen Moment sagt niemand etwas."}]},{stepLabel:"Entscheidung 3",sceneIntro:"Dein Onkel lehnt sich zurück, fast schon versöhnlich:",question:"«Am Ende schaut doch jede:r sowieso nur noch das, was einen interessiert.»",variants:[{id:"d3-a",label:"ruhig abrunden",text:"«Mag sein. Aber bei Abstimmungen hilft es, wenn wir nicht völlig unterschiedliche Fakten haben.»",consequence:"Das Gespräch endet ruhig. Ihr seid euch nicht einig, aber respektvoll."},{id:"d3-b",label:"bewusst offen lassen",text:"«Vielleicht. Für mich ist wichtig, dass es wenigstens eine verlässliche Referenz gibt.»",consequence:"Das Thema bleibt hängen. Es kommt später noch einmal darauf zurück."}]}],abschlussStory:{intro:"Am Abend, als du schon zu Hause bist, vibriert dein Handy. Eine Nachricht von deinem Onkel:",message:"«Hey – wegen vorhin am Tisch. Musste noch darüber nachdenken. Ganz so einfach ist das mit den 200 Franken wohl doch nicht.»",outro:"Du lächelst. Mehr braucht es im Moment nicht."},beobachtung:{intro:void 0,points:[],outro:"Ein Gespräch wie dieses wirkt selten sofort. Oft entfaltet sich seine Wirkung erst danach – leise, im Weiterdenken, ausserhalb des Küchentischs."},abschluss:{text:`Familiengespräche sind keine Debatten und keine Abstimmungen. Es geht nicht darum, jemanden zu überzeugen – sondern darum, Gedanken anzustossen.
461
462Manchmal reicht es, wenn ein Satz hängen bleibt.`,pointsIntro:void 0,points:[]},feedbackLabels:["Wichtig für Diskussion?","Inhalt korrekt?","Nützlich für deine Gespräche?"],relatedContent:{arguments:["A1 – «200 Franken sind doch genug»"],situations:["S2 – Arbeitsplatz"],grundlagen:["G1 – Die Halbierungs-Initiative in 90 Sekunden"]}},{id:"sit-arbeit",type:"situation",title:"In der Kaffeepause",setting:`Kaffeepause im Büro. Ihr steht zu dritt in der kleinen Teeküche. Jemand wartet auf den Vollautomaten, jemand scrollt auf dem Handy durch die News. Es ist eine dieser kurzen Pausen zwischen zwei Meetings, in denen man halb abschaltet, halb weiterdenkt.
463
464Du lehnst am Küchentresen, hörst zu. Das Gespräch ist sachlich, ruhig, niemand will provozieren.`,trigger:"«Eigentlich finde ich die Initiative noch sinnvoll. Die SRG sollte sich wieder auf ihren Kernauftrag konzentrieren – Information und Bildung.»",triggerContext:"Dann sagt ein Kollege, fast beiläufig:",triggerOutro:`Niemand widerspricht sofort. Der Satz klingt plausibel, professionell.
465
466Du merkst: Jetzt geht es nicht um Emotionen – sondern um Einordnung.`,dialogSteps:[{stepLabel:"Wie steigst du ein?",question:"Wie steigst du ein?",variants:[{id:"d1-a",label:"zustimmend einordnen",text:"«Der Gedanke klingt logisch – Information ist ja tatsächlich zentral.»",consequence:"De
466in Kollege fühlt sich ernst genommen. Die Stimmung bleibt sachlich."},{id:"d1-b",label:"vorsichtig relativieren",text:"«Die Frage ist halt, ob Information ohne Reichweite wirklich wirkt.»",consequence:"Das Gespräch wird nachdenklicher. Jemand hört genauer zu."}]},{stepLabel:"Entscheidung 2",sceneIntro:"Eine Kollegin stellt ihre Tasse ab und mischt sich ein:",question:"«Unterhaltung und Sport sind doch kein Service public. Darauf könnte man verzichten.»",variants:[{id:"d2-a",label:"Medienlogik erklären",text:"«Gerade diese Inhalte sorgen dafür, dass Information überhaupt viele Menschen erreicht.»",consequence:"Das Argument wirkt neu. Kurz wird es still."},{id:"d2-b",label:"systemisch denken",text:"«Ohne diese Breite würde Information schnell zu einem Nischenangebot.»",consequence:"Das Gespräch bleibt nüchtern, aber die Perspektive erweitert sich."}]},{stepLabel:"Entscheidung 3",sceneIntro:"Kurz bevor ihr auseinandergeht, sagt jemand:",question:"«Aber sparen müsste die SRG trotzdem.»",variants:[{id:"d3-a",label:"differenziert abschliessen",text:"«Sparen muss sie ja bereits – aber eine Halbierung destabilisiert das ganze System.»",consequence:"Gibt Kontext. Das Gespräch endet offen."},{id:"d3-b",label:"professionell offen lassen",text:"«Für mich ist wichtiger, welche Leistungen wir langfristig wollen.»",consequence:"Das Thema bleibt im Raum. Vielleicht wird später weitergeredet."}]}],abschlussStory:{intro:"Am Nachmittag, zwischen zwei Terminen, bekommst du eine kurze Chat-Nachricht von einer Kollegin:",message:"«Hab vorhin noch über unser Gespräch nachgedacht. So klar war mir der Zusammenhang zwischen Reichweite und Information nicht.»",outro:"Du liest die Nachricht – und gehst weiter an deine Arbeit."},beobachtung:{intro:void 0,points:[],outro:"Gespräche am Arbeitsplatz sind selten Orte für Grundsatzentscheide. Sie sind Orte, an denen Perspektiven sichtbar werden."},abschluss:{text:"Manchmal reicht es, wenn ein Argument mitgenommen wird.",pointsIntro:void 0,points:[]},feedbackLabels:["Wichtig für Diskussion?","Inhalt korrekt?","Nützlich für deine Gespräche?"],relatedContent:{arguments:["A8 – Kernauftrag-Argument schwächt die Information"],situations:["S1 – Familie / Küchentisch"],grundlagen:["G3 – Was bedeutet Service public konkret?"]}},{id:"sit-freunde",type:"situation",title:"Unter Freunden",setting:"Abends, irgendwer bringt Getränke. Ihr sitzt zusammen, Handys liegen auf dem Tisch.",trigger:"«Ganz ehrlich: Ich informiere mich online. Die SRG brauche ich eigentlich nicht.»",triggerContext:"Ein Freund sagt:",triggerOutro:"Ein paar nicken. Das klingt selbstbewusst, nicht aggressiv.",dialogSteps:[{stepLabel:"Entscheidung 1",question:"Wie reagierst du?",variants:[{id:"d1-a",label:"locker nachfragen",text:"«Wo informierst du dich denn meistens?»",consequence:"Das Gespräch bleibt entspannt. Dein Freund erklärt mehr."},{id:"d1-b",label:"direkt einordnen",text:"«Online heisst halt nicht automatisch gut informiert.»",consequence:"Leichtes Grinsen. Jetzt ist klar: Das wird eine Diskussion."}]},{stepLabel:"Entscheidung 2",sceneIntro:"Ein anderer Freund mischt sich ein:",question:"«Man kann doch mehrere Quellen vergleichen. Dann braucht es keine SRG mehr.»",variants:[{id:"d2-a",label:"ruhig erklären",text:"«Dafür braucht es gemeinsame Referenzen, sonst vergleichen alle etwas anderes.»",consequence:"Kurze Pause. Jemand denkt sichtbar nach."},{id:"d2-b",label:"humorvoll kontern",text:"«Stimmt – aber TikTok macht keine Abstimmungsanalyse.»",consequence:"Gelächter. Die Stimmung bleibt gut."}]},{stepLabel:"Entscheidung 3",sceneIntro:"Dein Freund lehnt sich zurück:",question:"«Am Ende ist das halt Geschmackssache.»",variants:[{id:"d3-a",label:"klar positionieren",text:"«Für mich nicht. Ohne starke SRG wird unsere Demokratie anfälliger.»",consequence:"Kurze Stille. Dann geht das Gespräch weiter."},{id:"d3-b",label:"entspannt offen lassen",text:"«Kann sein. Für mich ist es trotzdem ein Nein.»",consequence:"Kein Streit. Aber das Thema bleibt hängen."}]}],beobachtung:{intro:"Egal, welchen Weg du wählst:",points:["Du bist authentisch geblieben","Du hast eine klare Perspektive eingebracht","Die Stimmung ist nicht gekippt"],outro:"Im Freundeskreis zählt Glaubwürdigkeit mehr als perfekte Argumente."},abschluss:{text:"Gespräche unter Freund:innen dürfen direkt und unperfekt sein. Man überzeugt hier selten sofort. Aber man prägt, wie jemand weiterdenkt.",pointsIntro:"",points:[]},feedbackLabels:["Wichtig für Diskussion?","Inhalt korrekt?","Nützlich für deine Gespräche?"],relatedContent:{arguments:["A5: Ohne starke SRG wird Demokratie anfälliger","A3: Ich nutze die SRG gar nicht"],situations:["S1: Familie / Küchentisch"],grundlagen:["G2: Warum verlässliche Information wichtig ist"]}},{id:"sit-nachbarschaft",type:"situation",title:"In der Nachbarschaft",setting:`Später Nachmittag im Quartier. Du stehst draussen vor dem Haus, die Sonne ist schon tief. Jemand giesst Pflanzen, jemand anderes kommt mit Einkaufstaschen vorbei. Man kennt sich, wechselt ein paar Worte – nichts Tiefgründiges.
467
468Das Gespräch dreht sich kurz um steigende Preise.`,trigger:"«Also ich finde schon: 200 Franken für die SRG würden doch reichen. Man muss ja überall sparen.»",triggerContext:"Dann sagt eine Nachbarin, eher seufzend als kämpferisch:",triggerOutro:`Niemand widerspricht. Der Satz wirkt vernünftig, fast selbstverständlich.
469
470Du merkst: Das ist kein politisches Statement – eher ein Alltagsgefühl.`,dialogSteps:[{stepLabel:"Wie steigst du ein?",question:"Wie steigst du ein?",variants:[{id:"d1-a",label:"Verständnis zeigen, dann einordnen",text:"«Ja, Sparen ist überall ein Thema. Nur: Bei der SRG bedeutet das halt nicht ein bisschen weniger – sondern massiv weniger Angebot.»",consequence:"Die Nachbarin schaut kurz überrascht. Das Gespräch bleibt ruhig."}
470,{id:"d1-b",label:"sachlich nachfragen",text:"«Meinst du eher den Betrag – oder was die SRG dann noch leisten soll?»",consequence:"Die Aussage wird konkreter. Man kommt vom Bauchgefühl zur Sache."}]},{stepLabel:"Entscheidung 2",sceneIntro:"Ein Nachbar mischt sich ein, lehnt sein Velo an:",question:"«Aber viele schauen doch gar kein Fernsehen mehr.»",variants:[{id:"d2-a",label:"ruhig erweitern",text:"«Stimmt – aber die SRG ist ja längst mehr als Fernsehen. Gerade online nutzen sie viele.»",consequence:"Das Argument wirkt weniger eindeutig. Jemand nickt."},{id:"d2-b",label:"demokratische Funktion betonen",text:"«Es geht weniger ums Schauen – mehr darum, dass wir vor Abstimmungen verlässliche Infos haben.»",consequence:"Das Gespräch wird einen Moment ernster."}]},{stepLabel:"Entscheidung 3",sceneIntro:"Die Nachbarin sagt, schon halb im Aufbruch:",question:"«Am Ende muss ja jede:r selber entscheiden.»",variants:[{id:"d3-a",label:"ruhig abschliessen",text:"«Klar. Für mich ist wichtig, dass wir nicht am falschen Ort sparen.»",consequence:"Kein Widerspruch. Das Thema bleibt offen."},{id:"d3-b",label:"bewusst offen lassen",text:"«Ich finde einfach, es geht um mehr als nur um 200 Franken.»",consequence:"Der Satz bleibt hängen, auch nach dem Abschied."}]}],abschlussStory:{intro:"Ein paar Tage später triffst du die Nachbarin zufällig beim Briefkasten. Sie sagt:",message:"«Ich hab nochmal nachgedacht wegen der SRG. Du hattest recht – ganz so einfach ist das mit dem Sparen wohl nicht.»",outro:"Ihr wechselt noch ein paar Worte. Das Thema ist nicht erledigt – aber ein Gedanke hat sich verschoben."},beobachtung:{intro:void 0,points:[],outro:"Nachbarschaftsgespräche sind kurz, beiläufig – und genau deshalb wirksam. Ein einzelner Satz kann reichen, um ein scheinbar klares Gefühl zu irritieren."},abschluss:{text:"Nicht jedes Gespräch braucht Tiefe. Manchmal genügt ein Perspektivwechsel im Vorbeigehen.",pointsIntro:void 0,points:[]},feedbackLabels:["Wichtig für Diskussion?","Inhalt korrekt?","Nützlich für deine Gespräche?"],relatedContent:{arguments:["A1 – «200 Franken sind doch genug»"],situations:["S1 – Familie / Küchentisch"],grundlagen:["G1 – Die Halbierungs-Initiative in 90 Sekunden"]}},{id:"sit-kita",type:"situation",title:"Beim Abholen in der Kita",setting:`Später Nachmittag in der Kita. Jacken liegen herum, Kinderstimmen, etwas Chaos. Du wartest mit anderen Eltern im Eingangsbereich, während noch Schuhe gesucht werden.
471
472Man spricht über den Tag, über Termine, über das Abendessen.`,trigger:"«Ich hab gelesen, dass man die SRG halbieren will. Ehrlich gesagt: Für Familien wäre das schon eine Entlastung.»",triggerContext:"Dann sagt ein Vater, während er seinem Kind die Mütze aufsetzt:",triggerOutro:"Der Ton ist ruhig. Niemand will diskutieren.",dialogSteps:[{stepLabel:"Wie steigst du ein?",question:"Wie steigst du ein?",variants:[{id:"d1-a",label:"anschlussfähig, aber klar ablehnend",text:"«Ja, Entlastung klingt erst mal gut. Für mich ist die Initiative trotzdem der falsche Weg.»",consequence:"Der Vater fühlt sich nicht angegriffen, merkt aber deine klare Haltung."},{id:"d1-b",label:"sanft verschieben",text:"«Ich hab eher überlegt, was das für Information und Bildung bedeutet.»",consequence:"Das Gespräch bekommt eine neue Richtung."}]},{stepLabel:"Entscheidung 2",sceneIntro:"Eine Mutter mischt sich ein:",question:"«Kinder schauen ja sowieso kaum SRG.»",variants:[{id:"d2-a",label:"ruhig erweitern",text:"«Direkt vielleicht nicht – aber wir als Eltern nutzen die Infos, gerade vor Abstimmungen.»",consequence:"Der Fokus verschiebt sich von Konsum zu Verantwortung."},{id:"d2-b",label:"langfristig denken",text:"«Es geht ja auch darum, was für ein Mediensystem unsere Kinder später vorfinden.»",consequence:"Kurze Stille. Das Argument wirkt ungewohnt."}]},{stepLabel:"Entscheidung 3",sceneIntro:"Die Gruppe löst sich langsam auf, Kinder ziehen Richtung Ausgang.",question:"Wie schliesst du ab?",variants:[{id:"d3-a",label:"leise Position zeigen",text:"«Für mich überwiegt der Wert einer starken SRG.»",consequence:"Keine Diskussion – aber Klarheit."},{id:"d3-b",label:"offen lassen",text:"«Ich finde die Frage komplexer, als sie auf den ersten Blick wirkt.»",consequence:"Das Thema bleibt unausgesprochen präsent."}]}],abschlussStory:{intro:"Ein paar Tage später bekommst du eine Nachricht in der Eltern-WhatsApp-Gruppe:",message:"«Hey, wegen der SRG-Abstimmung – ich hab mir nochmal Gedanken gemacht. Vielleicht geht es wirklich um mehr als nur ums Geld.»",outro:"Du antwortest mit einem kurzen Daumen. Mehr braucht es nicht."},beobachtung:{intro:void 0,points:[],outro:"Elterngespräche sind selten politisch – aber stark wertebasiert. Hier wirken Argumente, die Verantwortung und Zukunft betreffen."},abschluss:{text:"Nicht jede Entscheidung wird im Abstimmungsbüchlein getroffen. Viele entstehen im Alltag – zwischen Jacken, Turnschuhen und Zeitdruck.",pointsIntro:void 0,points:[]},feedbackLabels:["Wichtig für Diskussion?","Inhalt korrekt?","Nützlich für deine Gespräche?"],relatedContent:{arguments:["A3 – «Ich nutze die SRG gar nicht»"],situations:["S3 – Freundeskreis"],grundlagen:["G2 – Service public in 90 Sekunden"]}},{id:"sit-bushaltestelle",type:"situation",title:"An der Bushaltestelle",setting:`Morgen oder später Nachmittag an der Bushaltestelle. Mehrere Leute stehen verteilt, schauen aufs Handy, jemand hört Musik mit Kopfhörern, der Bus hat Verspätung.
473
474Man wartet gemeinsam, schweigend.`,trigger:"«Hast du gesehen? Diese Abstimmung mit den 200 Franken. Eigentlich klingt das noch vernünftig.»",triggerContext:"Dann sagt eine Person neben dir, eher beiläufig als politisch:",triggerOutro:`Niemand reagiert sofort. Der Satz steht im Raum, ohne Druck.
475
476Du merkst: Es ist Smalltalk – aber mit politischem Gehalt.`,dialogSteps:[{stepLabel:"Wie steigst du ein?",question:"Wie steigst du ein?",variants:[{id:"d1-a",label:"ruhig widersprechen, klar positionieren",text:"«Für mich klingt es nur auf den ersten Blick vernünftig. Am Ende würde das die SRG massiv schwächen.»",consequence:"De
476in Gegenüber schaut kurz auf. Das Gespräch bleibt ruhig."},{id:"d1-b",label:"vorsichtig nachfragen",text:"«Was findest du daran genau vernünftig?»",consequence:"Die andere Person präzisiert ihr Bauchgefühl."}]},{stepLabel:"Entscheidung 2",sceneIntro:"Die Person zuckt mit den Schultern:",question:"«Ich nutze die SRG ehrlich gesagt kaum.»",variants:[{id:"d2-a",label:"einordnen statt widersprechen",text:"«Geht mir bei vielem auch so. Für mich geht's trotzdem darum, dass es eine verlässliche Basis für alle gibt.»",consequence:"Das Argument wird breiter, weniger individuell."},{id:"d2-b",label:"demokratischen Kontext setzen",text:"«Bei Abstimmungen nutze ich sie schon – gerade für Einordnung.»",consequence:"Das Gespräch wird sachlicher."}]},{stepLabel:"Entscheidung 3",sceneIntro:"Der Bus kommt in Sichtweite, die Leute rücken näher an den Rand.",question:"«Am Schluss entscheidet das Volk.»",variants:[{id:"d3-a",label:"ruhig abschliessen",text:"«Genau. Deshalb finde ich starke Information so wichtig.»",consequence:"Zustimmung ohne Diskussion."},{id:"d3-b",label:"bewusst offen lassen",text:"«Ich finde, man merkt erst beim Nachdenken, wie viel da dranhängt.»",consequence:"Der Satz bleibt im Raum, auch beim Einsteigen."}]}],abschlussStory:{intro:"Ein paar Tage später sitzt ihr zufällig wieder im selben Bus. Die Person sagt:",message:"«Hey – hab nochmal über unser Gespräch nachgedacht. So einfach ist das mit den 200 Franken wohl doch nicht.»",outro:"Ihr nickt euch zu. Dann ist die Haltestelle da."},beobachtung:{intro:void 0,points:[],outro:"Gespräche an der Bushaltestelle sind kurz und fragmentarisch. Gerade deshalb wirken klare, einfache Sätze."},abschluss:{text:"Nicht jedes Gespräch braucht Tiefe oder Zeit. Manchmal reicht ein Gedanke – zwischen zwei Haltestellen.",pointsIntro:void 0,points:[]},feedbackLabels:["Wichtig für Diskussion?","Inhalt korrekt?","Nützlich für deine Gespräche?"],relatedContent:{arguments:["A1 – «200 Franken sind doch genug»"],situations:["S4 – Nachbarschaft"],grundlagen:["G1 – Die Halbierungs-Initiative in 90 Sekunden"]}},{id:"sit-universitaet",type:"situation",title:"An der Universität",setting:`Später Vormittag an der Universität. Vorlesungspause. Studierende stehen im Gang, einige mit Notizen unter dem Arm, andere mit Kaffeebechern. Gesprächsfetzen über Seminare, Theorien, Prüfungen.
477
478Du hörst zu.`,trigger:"«Die Halbierungs-Initiative finde ich eigentlich plausibel. Medien sollten sich auf Information konzentrieren – Unterhaltung ist ja kein Service public.»",triggerContext:"Dann sagt eine Studentin, sachlich und reflektiert:",triggerOutro:`Mehrere nicken. Der Satz klingt wie aus einem Seminar.
479
480Du merkst: Das ist ein theoretischer Zugang, kein Stammtischargument.`,dialogSteps:[{stepLabel:"Wie steigst du ein?",question:"Wie steigst du ein?",variants:[{id:"d1-a",label:"medienwissenschaftlich einordnen",text:"«Aus medienwissenschaftlicher Sicht funktioniert Information aber nicht isoliert. Öffentlichkeit entsteht nur, wenn Inhalte auch Reichweite haben.»",consequence:"Die Gruppe wird aufmerksamer. Man hört dir zu."},{id:"d1-b",label:"begrifflich nachschärfen",text:"«Was meinst du genau mit Service public?»",consequence:"Das Gespräch verschiebt sich auf eine theoretische Ebene."}]},{stepLabel:"Entscheidung 2",sceneIntro:"Ein Student ergänzt:",question:"«Aber Reichweite kann doch auch der Markt herstellen.»",variants:[{id:"d2-a",label:"Marktlogik vs. Public Value erklären",text:"«Der Markt optimiert Reichweite nach Klicks und Emotionen – nicht nach Relevanz oder Ausgewogenheit.»",consequence:"Das Argument wird analytischer, weniger normativ."},{id:"d2-b",label:"Gatekeeping thematisieren",text:"«Private Plattformen übernehmen Gatekeeping über Algorithmen – ohne demokratischen Auftrag.»",consequence:"Kurze Pause. Das Framing wirkt neu."}]},{stepLabel:"Entscheidung 3",sceneIntro:"Die Diskussion löst sich langsam auf. Jemand sagt, eher skeptisch als ablehnend:",question:"«Aber öffentliche Medien sind doch auch nicht neutral.»",variants:[{id:"d3-a",label:"wisse
480nschaftlich einordnen",text:"«Neutralität ist kein Zustand, sondern ein Verfahren: Transparenz, Ausgewogenheit und überprüfbare Standards.»",consequence:"Die Diskussion verschiebt sich von Meinung zu Qualitätskriterien."},{id:"d3-b",label:"empirisch argumentieren",text:"«Studien zeigen, dass öffentlich-rechtliche Medien höheres Vertrauen geniessen als private oder Plattformen.»",consequence:"Das Argument wirkt evidenzbasiert und schwer zu kontern."}]}],abschlussStory:{intro:"Nach dem Seminar schreibt dir die Studentin eine kurze Nachricht:",message:"«Dein Punkt mit der Reichweite hat mich ins Nachdenken gebracht. Vielleicht ist Service public doch mehr als nur Information.»",outro:"Du antwortest kurz. Manchmal entstehen so die besten Diskussionen."},beobachtung:{intro:void 0,points:[],outro:"In akademischen Kontexten überzeugen keine Parolen. Hier wirken Begriffe wie Reichweite, Gatekeeping, Verfahren und Vertrauen."},abschluss:{text:"Die Frage ist nicht, ob Information wichtig ist. Sondern unter welchen Bedingungen sie gesellschaftlich glaubwürdig und wirksam bleibt.",pointsIntro:void 0,points:[]},feedbackLabels:["Wichtig für Diskussion?","Inhalt korrekt?","Nützlich für deine Gespräche?"],relatedContent:{arguments:["A8 – Kernauftrag-Argument schwächt die Information"],situations:["S4 – Nachbarschaft"],grundlagen:["G5 – Service public & Demokratie"]}}],R9=(t,e)=>{const n=t.toLowerCase();if(e==="argument")return il.find(r=>n.includes(r.title.toLowerCase().slice(0,15))||r.title.toLowerCase().includes(n.slice(0,15)));if(e==="situation")return ol.find(r=>n.includes(r.title.toLowerCase().slice(0,10))||r.title.toLowerCase().includes(n.slice(0,10)));if(e==="grundlagen")return al.find(r=>n.includes(r.title.toLowerCase().slice(0,15))||r.title.toLowerCase().includes(n.slice(0,15)))},ki={arguments:[{id:"arg-a1-200-franken",title:"«200 Franken sind doch genug»",available:!0},{id:"arg-a2-kahlschlag",title:"«Kahlschlag für den Service public»",available:!0},{id:"arg-a3-nutzung",title:"«Ich nutze die SRG gar nicht»",available:!0},{id:"arg-a4-unternehmen",title:"«Unternehmen zahlen doppelt»",available:!0},{id:"arg-a5-fakenews",title:"«Demokratie anfälliger für Fake News»",available:!0},{id:"arg-a6-zusammenhalt",title:"«Zusammenhalt der Schweiz»",available:!0},{id:"arg-a7-sparen",title:"«Sparen läuft bereits»",available:!0},{id:"arg-a8-kernauftrag",title:"«Kernauftrag schwächt Information»",available:!0}],situations:[{id:"sit-familie",title:"Am Küchentisch",available:!0},{id:"sit-arbeit",title:"In der Kaffeepause",available:!0},{id:"sit-freunde",title:"Unter Freunden",available:!0},{id:"sit-nachbarschaft",title:"In der Nachbarschaft",available:!0},{id:"sit-kita",title:"Beim Abholen in der Kita",available:!0},{id:"sit-bushaltestelle",title:"An der Bushaltestelle",available:!0},{id:"sit-universitaet",title:"An der Universität",available:!0}],grundlagen:[{id:"grund-90sek",title:"Die Initiative erklärt",available:!0},{id:"grund-service",title:"Service public erklärt",available:!0},{id:"grund-demokratie",title:"SRG & Demokratie",available:!0},{id:"grund-ausgewogen",title:"Ausgewogenheit der SRG",available:!0},{id:"grund-europa",title:"Europäisches Muster",available:!0},{id:"grund-bundesrat",title:"Die Haltung des Bundesrats",available:!0}]},al=[{id:"grund-90sek",type:"grundlagen",title:"Die Initiative erklärt",hilftDir:{intro:"Das hilft dir im Gespräch, wenn jemand sagt:",triggers:["«Ich habe ehrlich gesagt keine Ahnung, worum es bei dieser Initiative genau geht.»","«Das ist mir alles zu kompliziert.»"]},teile:[{title:"Worum geht es bei der Initiative?",intro:"Die Halbierungs-Initiative verlangt:",points:["dass die Radio- und TV-Abgabe **massiv gesenkt** wird","konkret von heute rund **335 Franken/Jahr auf 200 Franken/Jahr**","zusätzlich sollen **Unternehmen vollständig befreit** werden"],outro:"Das Ziel der Initiative: die SRG **deutlich** zu schwächen."},{title:"Was bedeutet das konkret?",intro:"Weniger Geld heisst nicht:",points:["ein bisschen effizienter werden","ein paar Sendungen streichen"],outro:"Sondern: **rund halb so viel Budget**, weniger Personal, weniger Programme, weniger Berichterstattung vor Ort. Die SRG müsste ihr Angebot **grundlegend reduzieren**."},{title:"Warum ist das politisch relevant?",intro:"Die SRG hat einen **Service-public-Auftrag**:",points:["Information für Abstimmungen","Berichterstattung aus allen Regionen","Angebote in allen Landessprachen"],outro:"Diese Leistungen sind teuer, nicht kommerziell rentabel und für die Demokratie zentral. Eine Halbierung trifft genau diesen Kern."}],quizQuestions:[{question:"Was bewirkt die Initiative in erster Linie?",options:[{id:"q1-a",text:"«Sie zwingt die SRG, effizienter zu werden.»",einordnung:"Das klingt plausibel, greift aber zu kurz. Mehr Effizienz wird eine Halbierung des Budgets nicht kompensieren können.",isCorrect:!1},{id:"q1-b",text:"«Sie halbiert die finanziellen Mittel der SRG.»",einordnung:"Trifft zu. Genau das ist der zentrale Punkt der Initiative.",isCorrect:!0},{id:"q1-c",text:"«Sie spart vor allem bei Unterhaltung.»",einordnung:"Das ist irreführend. Alle Bereiche der SRG wären betroffen.",isCorrect:!1}]},{question:"Welche Leistungen wären besonders unter Druck?",options:[{id:"q2-a",text:"«Regionale Beric
480hterstattung in allen vier Landessprachen inklusive Gebärdensprache.»",einordnung:"Ja. Diese Angebote sind teuer, aber zentral für den Zusammenhalt.",isCorrect:!0},{id:"q2-b",text:"«Nur teure Sportrechte.»",einordnung:"Zu kurz gedacht. Alle Bereiche der SRG wären betroffen.",isCorrect:!1},{id:"q2-c",text:"«Eigentlich keine – der Markt regelt das.»",einordnung:"Das widerspricht der Realität. Private Medien können viele dieser Leistungen nicht übernehmen.",isCorrect:!1}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:["A1: 200 Franken sind doch genug","A2: Kahlschlag für den Service public"],situations:["S1: Am Küchentisch"],grundlagen:[]}},{id:"grund-service",type:"grundlagen",title:"Service public erklärt",hilftDir:{intro:"Das hilft dir im Gespräch, wenn jemand sagt:",triggers:["«Wozu braucht es überhaupt Service public? Das kann doch auch der Markt übernehmen.»","«Die SRG soll sich einfach auf das Nötigste beschränken.»"]},teile:[{title:"Was bedeutet Service public?",intro:"Service public heisst:",points:["Medien für **alle**, nicht nur für zahlende Kund:innen","Angebote, die sich **nicht am Profit** orientieren","ein Auftrag, der gesetzlich festgelegt ist"],outro:"Der Fokus liegt auf dem **Gemeinwohl**, nicht auf Klicks oder Rendite."},{title:"Was gehört zum Service public der SRG?",intro:"Die SRG muss:",points:["sachlich und ausgewogen informieren","politische Prozesse erklären und einordnen","aus **allen Regionen** berichten","Inhalte in **allen Landessprachen** anbieten"],outro:"Dieser Auftrag gilt unabhängig davon, wie gross oder wirtschaftlich attraktiv eine Region ist."},{title:"Warum kann der Markt das nicht einfach übernehmen?",intro:"Viele Service-public-Leistungen sind:",points:["teuer","aufwendig","kaum refinanzierbar"],outro:"Private Medie
480n müssen wirtschaftlich arbeiten. Sie konzentrieren sich dort, wo Reichweite und Einnahmen möglich sind. Service public lässt sich von Privaten nicht ersetzen."}],quizQuestions:[{question:"Was unterscheidet Service public von privaten Medien?",options:[{id:"q1-a",text:"«Service public ist staatliche Propaganda.»",einordnung:"Das klingt nach einem verbreiteten Vorwurf – tatsächlich ist die SRG jedoch unabhängig und gesetzlich zur Ausgewogenheit verpflichtet.",isCorrect:!1},{id:"q1-b",text:"«Service public dient dem Gemeinwohl, private Medien arbeiten nach Profit.»",einordnung:"Genau darum gibt es ihn.",isCorrect:!0},{id:"q1-c",text:"«Service public verzerrt den Wettbewerb.»",einordnung:"Das ist ein verbreitetes Argument – doch Service public sichert Grundversorgung, nicht Marktanteile.",isCorrect:!1}]},{question:"Für welche Bereiche ist der Service public besonders relevant?",options:[{id:"q2-a",text:"«Politische Informationen, Berichterstattung in den Regionen in allen Landessprachen.»",einordnung:"Ja. Genau dort ist Service public zentral, da er ausgewogen und für alle ist.",isCorrect:!0},{id:"q2-b",text:"«Nur Unterhaltung.»",einordnung:"Verständlicher Gedanke, aber Unterhaltung ist lediglich ein Element davon.",isCorrect:!1},{id:"q2-c",text:"«Nur ältere Zielgruppen.»",einordnung:"Das wird oft angenommen, doch Service public richtet sich bewusst an alle Altersgruppen.",isCorrect:!1}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:["A2: Kahlschlag für den Service public"],situations:["S3: Unter Freunden"],grundlagen:["G1: Die Halbierungs-Initiative erklärt"]}},{id:"grund-demokratie",type:"grundlagen",title:"SRG & Demokratie",hilftDir:{intro:"Das hilft dir im Gespräch, wenn jemand sagt:",triggers:["«Ich bilde mir meine Meinung selbst. Dafür brauche ich keine SRG.»","«Heute gibt es doch genug andere Informationsquellen.»"]},teile:[{title:"Was braucht eine direkte Demokratie?",intro:"In der Schweiz stimmen wir regelmässig über komplexe Vorlagen ab. Dafür braucht es:",points:["verlässliche Informationen","Einordnung statt Schlagzeilen","unterschiedliche Perspektiven","eine gemeinsame Faktenbasis"],outro:"Ohne das wird Meinungsbildung zufällig oder verzerrt."},{title:"Welche Rolle spielt die SRG dabei?",intro:"Die SRG:",points:["berichtet unabhängig von Parteien und Konzernen","ordnet politische Vorlagen ein","gibt allen relevanten Stimmen Raum","berichtet kontinuierlich aus den Regionen"],outro:"Sie schafft einen **gemeinsamen Informationsraum** für die ganze Bevölkerung."},{title:"Was passiert ohne starke SRG?",intro:"Ohne starke SRG:",points:["prägen private Medien stärker die Meinungsbildung","entscheiden Klicks und Algorithmen über Sichtbarkeit","nehmen Polarisierung und Desinformation zu"],outro:"Gerade in einer direkten Demokratie ist das ein strukturelles Risiko."}],quizQuestions:[{question:"Warum ist Unabhängigkeit so zentral?",options:[{id:"q1-a",text:"«Unabhängigkeit schützt vor politischem und wirtschaftlichem Druck.»",einordnung:"Genau darum ist die Finanzierung entscheidend.",isCorrect:!0},{id:"q1-b",text:"«Unabhängigkeit ist heute nicht mehr relevant.»",einordnung:"Das ist ein nachvollziehbarer Gedanke – doch gerade heute ist sie so wichtig wie lange nicht.",isCorrect:!1},{id:"q1-c",text:"«Unabhängigkeit macht Medien langweilig.»",einordnung:"Ein interessanter Punkt – doch Information soll primär orientieren, nicht unterhalten.",isCorrect:!1}]},{question:"Was ist die grösste demokratische Gefahr bei einer Schwächung der SRG?",options:[{id:"q2-a",text:"«Weniger Unterhaltung im Fernsehen.»",einordnung:"Das wäre spürbar, ist aber nicht der Kernpunkt.",isCorrect:!1},{id:"q2-b",text:"«Mehr Einfluss von Klicklogik und Plattformen.»",einordnung:"Ja. Das verändert Meinungsbildung grundlegend.",isCorrect:!0},{id:"q2-c",text:"«Gar keine – andere Medien springen ein.»",einordnung:"Das wäre wünschenswert – ist aber unrealistisch, wie Erfahrungen zeigen.",isCorrect:!1}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:["A1: 200 Franken sind doch genug"],situations:["S6: An der Bushaltestelle"],grundlagen:["G2: Service public erklärt"]}},{id:"grund-ausgewogen",type:"grundlagen",title:"Ausgewogenheit der SRG",hilftDir:{intro:"Das hilft dir im Gespräch, wenn jemand sagt:",triggers:["«Die SRG ist doch klar links.»","«Die SRG ist ideologisch und nicht neutral.»","«Private Medie
480n sind ausgewogener als die SRG.»"]},teile:[{title:"Was wird der SRG vorgeworfen?",intro:"Ein zentrales Argument der Halbierungs-Initiative lautet:",points:["die SRG sei politisch einseitig","sie verbreite eine «linke Ideologie»","sie beeinflusse die Meinungsbildung unfair"],outro:"Dieser Vorwurf wird oft wiederholt – aber selten belegt."},{title:"Was zeigt die Forschung?",intro:"Eine Studie des Forschungszentrums Öffentlichkeit und Gesellschaft (fög) der Universität Zürich zeigt:",points:["Die grossen Schweizer Nachrichtenmedien berichten bei Wahlen und Abstimmungen **politisch ausgewogen**","Auf einer Links-Rechts-Skala liegen sie **nahe am politischen Nullpunkt**","Genau dort wird auch die **SRG** verortet"],outro:"Klare ideologische Positionierungen finden sich nur bei wenigen Titeln – die SRG gehört **nicht** dazu."},{title:"Warum ist das demokratisch wichtig?",intro:"Ausgewogene Berichterstattung bedeutet:",points:["sachliche Einordnung statt Zuspitzung","Vergleich von Positionen statt Polarisierung","Orientierung bei komplexen Vorlagen"],outro:"Wer der SRG pauschal Einseitigkeit vorwirft, greift einen **zentralen Pfeiler der demokratischen Infrastruktur** an."}],quizQuestions:[{question:"Wie wird die SRG in der Medienforschung politisch eingeordnet?",options:[{id:"q1-a",text:"«Deutlich links.»",einordnung:"Das wird oft vermutet – wissenschaftlich ist das aber nicht belegt.",isCorrect:!1},{id:"q1-b",text:"«Nahe an der politischen Mitte.»",einordnung:"Genau das zeigt die fög-Studie.",isCorrect:!0},{id:"q1-c",text:"«Stärker ideologisch als private Medien.»",einordnung:"Das klingt plausibel, findet aber in der Forschung keine Bestätigung.",isCorrect:!1}]},{question:"Warum ist ausgewogene Berichterstattung besonders wichtig?",options:[{id:"q2-a",text:"«Damit Medien möglichst allen gefallen.»",einordnung:"Das wäre schön – ist aber nicht der Hauptgrund.",isCorrect:!1},{id:"q2-b",text:"«Damit politische Meinungsbildung auf Fakten basiert.»",einordnung:"Genau darum geht es in einer direkten Demokratie.",isCorrect:!0},{id:"q2-c",text:"«Damit Kritik an Medien überflüssig wird.»",einordnung:"Ein guter Gedanke – aber Kritik bleibt wichtig und legitim.",isCorrect:!1}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:["A3: Ich nutze die SRG gar nicht"],situations:["S4: In der Nachbarschaft"],grundlagen:["G3: SRG & Demokratie in 90 Sekunden"]}},{id:"grund-europa",type:"grundlagen",title:"Europäisches Muster",hilftDir:{intro:"Das hilft dir im Gespräch, wenn jemand sagt:",triggers:["«Bei der Initiative geht es ums Sparen.»","«Das hat nichts mit Demokratie zu tun, das ist einfach Medienkritik.»","«Andere Länder kommen auch ohne starken Service public aus.»"]},teile:[{title:"Was passiert in anderen Ländern?",intro:"In vielen europäischen Ländern gehen rechtspopulistische Parteien gezielt gegen öffentlich-rechtliche Medien vor. Dabei zeigt sich ein wiederkehrendes Muster:",points:["Öffentlich-rechtliche Medien werden als «Elite-Projekt» dargestellt","Ihnen wird politische Einseitigkeit oder Propaganda vorgeworfen","Ziel ist nicht Reform, sondern **Schwächung oder Kontrolle**"],outro:"Diese Strategie ist kein Zufall, sondern systematisch beobachtbar."},{title:"Die Strategie in mehreren Schritten",intro:"Medienforscher:innen beschreiben ein typisches Vorgehen:",points:["**Diffamieren** – Öffentlich-rechtliche Medien werden als «Lügenpresse» oder ideologisch bezeichnet","**Finanziell aushungern** – Wenn Abschaffung nicht durchsetzbar ist, wird das Budget gekürzt","**Politisch kontrollieren** – Aufsichtsgremien und Personal werden politisch umgebaut","**Eigene Medien aufbauen** – Parteinahe Alternativmedien verbreiten ungefilterte Botschaften"],outro:"Dieses Muster findet sich u. a. in Ungarn, Polen, der Slowakei, Österreich und Deutschland."},{title:"Warum ist das auch für die Schweiz relevant?",intro:"Die Halbierungs-Initiative folgt dem gleichen Grundprinzip:",points:["nicht direkte Zensur","sondern **finanzieller Druck**","mit dem Ziel, Reichweite, Qualität und Unabhängigkeit zu schwächen"],outro:"Wo öffentlich-rechtliche Medien geschwächt werden, sinkt die Informationsqualität und Polarisierung nimmt zu. Das betrifft die **Struktur demokratischer Meinungsbildung**."}],quizQuestions:[{question:"Was ist das zentrale Ziel dieser Angriffe?",options:[{id:"q1-a",text:"«Medien effizienter machen.»",einordnung:"Klingt moderat – beschreibt aber nicht das eigentliche Muster.",isCorrect:!1},{id:"q1-b",text:"«Öffentlich-rechtliche Medien politisch schwächen.»",einordnung:"Genau darauf zielt das Vorgehen ab.",isCorrect:!0},{id:"q1-c",text:"«Mehr Medienvielfalt schaffen.»",einordnung:"Das wäre wünschenswert – tritt aber erfahrungsgemäss nicht ein.",isCorrect:!1}]},{question:"Warum ist der finanzielle Hebel so wirksam?",options:[{id:"q2-a",text:"«Weil Geld direkte redaktionelle Weisungen ersetzt.»",einordnung:"Weniger Mittel führen zu Abbau, Vorsicht und Abhängigkeit.",isCorrect:!0},{id:"q2-b",text:"«Weil Medien dann automatisch besser werden.»",einordnung:"Das wäre schön – ist aber nicht zu beobachten.",isCorrect:!1}
480,{id:"q2-c",text:"«Weil private Medien alles übernehmen können.»",einordnung:"Das klingt plausibel, ist aber in der Praxis selten der Fall.",isCorrect:!1}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:["A7: Sparen läuft bereits"],situations:["S1: Am Küchentisch"],grundlagen:["G3: SRG & Demokratie in 90 Sekunden"]}},{id:"grund-bundesrat",type:"grundlagen",title:"Die Haltung des Bundesrats",hilftDir:{intro:"Das hilft dir im Gespräch, wenn jemand sagt:",triggers:["«Was sagt der Bundesrat zur Initiative?»","«Wenn sogar der Bundesrat spart, dann kann man doch auch halbieren.»","«Was wären laut Bundesrat die konkreten Folgen einer Annahme?»"]},teile:[{title:"Wie positionieren sich Bundesrat und Parlament?",intro:"Bundesrat **und** Parlament empfehlen die Halbierungs-Initiative zur **Ablehnung**. Ihre Einschätzung ist klar:",points:["Die Initiative geht **zu weit**","Sie hätte **tiefe Einschnitte** ins Angebot von Radio und Fernsehen zur Folge","Sie würde die SRG strukturell schwächen"],outro:"Gleichzeitig hält der Bundesrat fest: Ja, es gibt Spar- und Reformbedarf – **aber nicht in dieser Radikalität**."},{title:"Was schlägt der Bundesrat stattdessen vor?",intro:"Der Bundesrat hat bereits Massnahmen beschlossen, die Haushalte und Unternehmen entlasten:",points:["Die Abgabe für Haushalte sinkt bis 2029 auf **300 Franken**","Ab 2027 zahlen **weniger Unternehmen** eine Abgabe","Die SRG hat bereits einen **verbindlichen Sparauftrag** und setzt ihn um"],outro:"Dieses Vorgehen bezeichnet der Bundesrat als **ausgewogen**: Entlastung ja – aber ohne den Service public zu zerstören."},{title:"Warum lehnt der Bundesrat die Initiative ab?",intro:"Laut Bundesrat hätte eine Annahme der Initiative folgende Folgen:",points:["Die SRG könnte **nicht mehr in allen Sprachregionen gleichwertige Angebote** bereitstellen","Regionale Standorte müssten geschlossen, die Produktion zentralisiert werden","Das Angebot würde kleiner und unattraktiver","Der Medienkonsum könnte für das Publikum **teurer** werden (mehr Abos, Pay-Angebote)"],outro:"Kurz: Die Initiative würde mehr abbauen, als sie entlastet."}],quizQuestions:[{question:"Wie beurteilt der Bundesrat die Halbierungs-Initiative?",options:[{id:"q1-a",text:"«Sie ist ein sinnvoller Sparvorschlag.»",einordnung:"Das klingt vernünftig – doch genau das bestreitet der Bundesrat.",isCorrect:!1},{id:"q1-b",text:"«Sie geht zu weit und gefährdet das Angebot.»",einordnung:"Das ist die offizielle Einschätzung.",isCorrect:!0},{id:"q1-c",text:"«Sie hat keine grossen Auswirkungen.»",einordnung:"Das wäre beruhigend – entspricht aber nicht der Analyse des Bundesrats.",isCorrect:!1}]},{question:"Was ist der zentrale Unterschied zwischen Initiative und Bundesratslösung?",options:[{id:"q2-a",text:"«Der Bundesrat will gar nicht sparen.»",einordnung:"Das wäre eine verständliche Annahme – doch Sparen ist bereits beschlossen.",isCorrect:!1},{id:"q2-b",text:"«Die Initiative erlaubt der SRG mehr Flexibilität.»",einordnung:"Nachvollziehbar gedacht – doch sie entzieht ihr primär die Mittel.",isCorrect:!1},{id:"q2-c",text:"«Der Bundesrat kombiniert Entlastung mit Erhalt des Service public.»",einordnung:"Genau das ist der Kernpunkt.",isCorrect:!0}]}],abschluss:{text:"",keyPoint:""},relatedContent:{arguments:["A5: Demokratie anfälliger für Fake News"],situations:["S6: An der Bushaltestelle"],grundlagen:["G1: Die Halbierungs-Initiative in 90 Sekunden"]}}],Cv={argument:{label:"Argumente finden",shortLabel:"Argument",description:"Für Einwände und typische Sätze",icon:yu,bgColor:"bg-primary/10",textColor:"text-primary",badgeClass:"bg-primary/10 text-primary"},situation:{label:"Gespräche üben",shortLabel:"Gespräch",description:"Für konkrete Alltagssituationen",icon:Ks,bgColor:"bg-accent/20",textColor:"text-accent-foreground",badgeClass:"bg-accent/20 text-accent-foreground"},grundlagen:{label:"Grundlagen verstehen",shortLabel:"Grundlagen",description:"Kurz und ohne Vorwissen",icon:bl,bgColor:"bg-muted",textColor:"text-muted-foreground",badgeClass:"bg-muted text-muted-foreground"},erklaervideo:{label:"Erklärvideo",shortLabel:"Video",description:"Die wichtigsten Punkte erklärt",icon:Xc,bgColor:"bg-red-500/10",textColor:"text-red-600",badgeClass:"bg-red-500/10 text-red-600"}},jf=(t,e)=>{if(!e)return{stars:4,count:0,avgRating:4};const n=e.find(i=>i.module_id===t);if(!n||n.rating_count===0)return{stars:4,count:0,avgRating:4};const r=n.rating_useful_sum/n.rating_count;let s=2;return r>4.7?s=5:r>4.5?s=4:r>4&&(s=3),{stars:s,count:n.rating_count,avgRating:r}},Hu=[{id:"bGyTMyphcSA",title:"Warum es die SRG unbedingt braucht",subtitle:"Flavien Gousset über die Halbierungs-Initiative"},{id:"HSw00JV9bEU",title:"Halbierungsinitiative erklärt",subtitle:"Der Bund"},{id:"xhhXKHQUXIs",title:"Fakten statt Lärm zu Desinformation",subtitle:"Allianz Pro Medienvielfalt"},{id:"FPsLiNDPzHw",title:"Ursus & Nadeschkin zur Initiative",subtitle:"Satire"}],qC=({video:t,compact:e=!1,autoPlay:n=!1})=>{const[r,s]=b.useState(n),i=`https://img.youtube.com/vi/${t.id}/maxresdefault.jpg`;return b.useEffect(()=>{n&&s(!0)},[n]),u.jsxs("div",{id:t.id==="bGyTMyphcSA"?"video-flavien":void 0,className:Z("bg-card rounded-xl border border-border overflow-hidden",e?"":"md:col-span-2 lg:col-span-3"),children:[u.jsx("div",{className:"p-4 pb-0",children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-red-500/10 text-red-600",children:[u.jsx(Xc,{className:"w-4 h-4"}),"Erklärvideo"]})}),u.jsxs("div",{className:"p-4",children:[u.jsx(j9,{ratio:16/9,className:"rounded-lg overflow-hidden bg-muted",children:r?u.jsx("iframe",{src:`https://www.youtube.com/embed/${t.id}?autoplay=1&rel=0`,title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full"}):u.jsxs("button",{onClick:()=>s(!0),className:"relative w-full h-full group cursor-pointer",children:[u.jsx("img",{src:i,alt:"Video Thumbnail",className:"w-full h-full object-cover"}),u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20 group-hover:bg-black/30 transition-colors",children:u.jsx("div",{className:Z("rounded-full bg-red-600 flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform",e?"w-12 h-12":"w-16 h-16"),children:u.jsx(Xc,{className:Z("text-white fill-white ml-0.5",e?"w-6 h-6":"w-8 h-8")})})})]})}),u.jsx("h3",{className:Z("font-semibold text-foreground mt-3",e?"text-sm line-clamp-2":"text-base"),children:t.title}),u.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-1",children:t.subtitle})]})]})},M9=({onSelectArgument:t,onSelectSituation:e,onSelectGrundlage:n,completedModules:r,initialFilter:s="all",autoPlayVideoId:i})=>{const[o,a]=b.useState(s),{data:l}=Tk(),c=b.useMemo(()=>[...ki.arguments.map(y=>{const v=il.find(x=>x.id===y.id);return{id:y.id,type:"argument",title:y.title,trigger:(v==null?void 0:v.trigger)||"",available:y.available}}),...ki.situations.map(y=>{const v=ol.find(x=>x.id===y.id);return{id:y.id,type:"situation",title:y.title,trigger:(v==null?void 0:v.trigger)||"",available:y.available}}),...ki.grundlagen.map(y=>{var x,w;const v=al.find(k=>k.id===y.id);return{id:y.id,type:"grundlagen",title:y.title,trigger:((w=(x=v==null?void 0:v.hilftDir)==null?void 0:x.triggers)==null?void 0:w[0])||"",available:y.available}})],[]),d=y=>[...y].sort((v,x)=>{const w=jf(v.id,l).avgRating;return jf(x.id,l).avgRating-w}),f=b.useMemo(()=>
480{if(o!=="all")return d(c.filter(N=>N.type===o));const y=d(c.filter(N=>N.type==="argument")),v=d(c.filter(N=>N.type==="situation")),x=d(c.filter(N=>N.type==="grundlagen")),w=[],k={argument:[...y],situation:[...v],grundlagen:[...x]};let S=0,E=null;const C=c.length;for(let N=0;N<C;N++){let T=null,M=null,D=-1;for(const A of["argument","situation","grundlagen"]){if(k[A].length===0)continue;const L=k[A][0],I=jf(L.id,l).avgRating;E===A&&S>=3||I>D&&(D=I,T=L,M=A)}if(!T){for(const A of["argument","situation","grundlagen"])if(k[A].length>0&&A!==E){T=k[A][0],M=A;break}}if(!T){for(const A of["argument","situation","grundlagen"])if(k[A].length>0){T=k[A][0],M=A;break}}T&&M&&(w.push(T),k[M].shift(),E===M?S++:(S=1,E=M))}return w},[c,o,l]),p={all:c.length,argument:c.filter(y=>y.type==="argument").length,situation:c.filter(y=>y.type==="situation").length,grundlagen:c.filter(y=>y.type==="grundlagen").length,erklaervideo:Hu.length},g=y=>{if(y.available)switch(y.type){case"argument":t(y.id);break;case"situation":e(y.id);break;case"grundlagen":n(y.id);break}},m=c.filter(y=>y.available);return m.filter(y=>r.includes(y.id)).length,m.length,u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"hidden md:grid md:grid-cols-4 gap-4",children:["argument","situation","grundlagen","erklaervideo"].map(y=>{const v=Cv[y],x=v.icon,w=o===y;return u.jsxs("button",{onClick:()=>a(y),className:Z("group flex items-center gap-3 p-4 rounded-xl border bg-card text-left transition-all",w?"border-primary/50 ring-2 ring-primary/20":"border-border hover:border-primary/30 hover:shadow-sm"),children:[u.jsx("div",{className:Z("w-10 h-10 rounded-full flex items-center justify-center shrink-0",v.bgColor),children:u.jsx(x,{className:Z("w-5 h-5",v.textColor)})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"font-medium text-sm text-foreground",children:v.label}),u.jsx("p",{className:"text-xs text-muted-foreground",children:v.description})]}),u.jsx(Pt,{className:Z("w-4 h-4 shrink-0 transition-transform",w?"text-primary":"text-muted-foreground/50 group-hover:text-primary group-hover:translate-x-1")})]},y)})}),u.jsxs("div",{className:"flex gap-2 overflow-x-auto pb-2 -mx-4 px-4 md:mx-0 md:px-0 md:justify-center md:flex-wrap md:overflow-visible scrollbar-hide",children:[u.jsxs("button",{onClick:()=>a("all"),className:Z("px-4 py-2 rounded-full text-sm font-medium transition-colors flex items-center gap-2",o==="all"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"),children:["Alle (",p.all,")"]}),["argument","situation","grundlagen","erklaervideo"].map(y=>{const v=Cv[y],x=v.icon;return u.jsxs("button",{onClick:()=>a(y),className:Z("px-4 py-2 rounded-full text-sm font-medium transition-colors flex items-center gap-2",o===y?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"),children:[u.jsx(x,{className:"w-4 h-4"}),v.shortLabel," (",p[y],")"]},y)})]}),o==="erklaervideo"&&u.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Hu.map(y=>u.jsx(qC,{video:y,compact:!0,autoPlay:i===y.id},y.id))}),o!=="erklaervideo"&&u.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:f.map((y,v)=>{const x=Cv[y.type],w=x.icon,k=r.includes(y.id),E=[2,8,14,20].indexOf(v),C=o==="all"&&E!==-1&&E<Hu.length;return u.jsxs("div",{className:"contents",children:[u.jsxs("button",{onClick:()=>g(y),disabled:!y.available,className:Z("group text-left bg-card rounded-xl border p-4 md:p-5 transition-all relative",y.available?"hover:border-primary/50 hover:shadow-md cursor-pointer":"opacity-60 cursor-not-allowed",k?"border-primary/30 bg-primary/5":"border-border"),children:[(()=>{const{stars:N,count:T}=jf(y.id,l);return u.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-1",children:[u.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:5}).map((M,D)=>u.jsx(jg,{className:Z("w-3 h-3",D<N?"fill-yellow-400 text-yellow-400":"text-muted-foreground/30")},D))}),T>0&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",T,")"]})]})})(),u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsxs("span",{className:Z("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium",x.badgeClass),children:[k&&u.jsx(eh,{className:"w-4 h-4 text-primary"}),u.jsx(w,{className:"w-4 h-4"}),x.shortLabel]}),!y.available&&u.jsx(_F,{className:"w-3.5 h-3.5 text-muted-foreground"})]}),u.jsx("h3",{className:Z("font-semibold text-foreground mb-2 transition-colors",y.available&&"group-hover:text-primary"),children:y.title}),y.trigger&&u.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-3",children:y.trigger}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Bo,{className:"w-3.5 h-3.5"}),y.type==="situation"?"3 Min.":"2 Min."]}),y.available&&u.jsxs("span",{className:"flex items-center gap-1 text-primary group-hover:translate-x-1 transition-transform",children:["Starten",u.jsx(Pt,{className:"w-3.5 h-3.5"})]})]})]}),C&&u.jsx(qC,{video:Hu[E],compact:E!==0,autoPlay:i===Hu[E].id})]},y.id)})})]})},qa=b.forwardRef(({className:t,...e},n)=>u.jsx("div",{ref:n,className:Z("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));
480qa.displayName="Card";const fp=b.forwardRef(({className:t,...e},n)=>u.jsx("div",{ref:n,className:Z("flex flex-col space-y-1.5 p-6",t),...e}));fp.displayName="CardHeader";const pp=b.forwardRef(({className:t,...e},n)=>u.jsx("h3",{ref:n,className:Z("text-2xl font-semibold leading-none tracking-tight",t),...e}));pp.displayName="CardTitle";const mp=b.forwardRef(({className:t,...e},n)=>u.jsx("p",{ref:n,className:Z("text-sm text-muted-foreground",t),...e}));mp.displayName="CardDescription";const Ua=b.forwardRef(({className:t,...e},n)=>u.jsx("div",{ref:n,className:Z("p-6 pt-0",t),...e}));Ua.displayName="CardContent";const O9=b.forwardRef(({className:t,...e},n)=>u.jsx("div",{ref:n,className:Z("flex items-center p-6 pt-0",t),...e}));O9.displayName="CardFooter";const P9=Bh("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Sd({className:t,variant:e,...n}){return u.jsx("div",{className:Z(P9({variant:e}),t),...n})}const UC=[{title:"Gratuliere!",icon:qF},{title:"Geschafft!",icon:jF},{title:"Prima!",icon:zF},{title:"Wunderbar!",icon:jg}
vendor: 10,579 bytes, line 480
480,{title:"Gut gemacht!",icon:FF},{title:"Wow, erledigt!",icon:DF},{title:"Toll gemacht!",icon:aF},{title:"Richtig gut!",icon:qo}],zk=()=>{const t=b.useMemo(()=>{const n=Math.floor(Math.random()*UC.length);return UC[n]},[]),e=t.icon;return u.jsxs("div",{className:"space-y-6 text-center py-8",children:[u.jsx("div",{className:"w-16 h-16 mx-auto bg-primary/10 rounded-full flex items-center justify-center",children:u.jsx(e,{className:"w-8 h-8 text-primary"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("h2",{className:"text-xl md:text-2xl font-semibold",children:t.title}),u.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Gib uns doch kurz Feedback! Oder schau dir an, was als Nächstes kommt."})]})]})};var Wh=t=>t.type==="checkbox",Ca=t=>t instanceof Date,zn=t=>t==null;const HO=t=>typeof t=="object";var It=t=>!zn(t)&&!Array.isArray(t)&&HO(t)&&!Ca(t),I9=t=>It(t)&&t.target?Wh(t.target)?t.target.checked:t.target.value:t,D9=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,L9=(t,e)=>t.has(D9(e)),z9=t=>{const e=t.constructor&&t.constructor.prototype;return It(e)&&e.hasOwnProperty("isPrototypeOf")},$k=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xt(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(!($k&&(t instanceof Blob||r))&&(n||It(t)))if(e=n?[]:{},!n&&!z9(t))e=t;else for(const s in t)t.hasOwnProperty(s)&&(e[s]=Xt(t[s]));else return t;return e}var Jg=t=>/^\w*$/.test(t),qt=t=>t===void 0,Fk=t=>Array.isArray(t)?t.filter(Boolean):[],Bk=t=>Fk(t.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(t,e,n)=>{if(!e||!It(t))return n;const r=(Jg(e)?[e]:Bk(e)).reduce((s,i)=>zn(s)?s:s[i],t);return qt(r)||r===t?qt(t[e])?n:t[e]:r},Ms=t=>typeof t=="boolean",lt=(t,e,n)=>{let r=-1;const s=Jg(e)?[e]:Bk(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=It(c)||Array.isArray(c)?c:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;t[a]=l,t=t[a]}};const VC={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},cs={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ii={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},$9=F.createContext(null);$9.displayName="HookFormContext";var F9=(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]!==cs.all&&(e._proxyFormState[o]=!r||cs.all),t[o]}});return s};const B9=typeof window<"u"?F.useLayoutEffect:F.useEffect;var Bs=t=>typeof t=="string",q9=(t,e,n,r,s)=>Bs(t)?(r&&e.watch.add(t),ue(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),ue(n,i))):(r&&(e.watchAll=!0),n),t0=t=>zn(t)||!HO(t);function ro(t,e,n=new WeakSet){if(t0(t)||t0(e))return t===e;if(Ca(t)&&Ca(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];if(Ca(o)&&Ca(a)||It(o)&&It(a)||Array.isArray(o)&&Array.isArray(a)?!ro(o,a,n):o!==a)return!1}}return!0}var WO=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},Ed=t=>Array.isArray(t)?t:[t],HC=()=>{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=[]}}},nr=t=>It(t)&&!Object.keys(t).length,qk=t=>t.type==="file",us=t=>typeof t=="function",dm=t=>{if(!$k)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},GO=t=>t.type==="select-multiple",Uk=t=>t.type==="radio",U9=t=>Uk(t)||Wh(t),Nv=t=>dm(t)&&t.isConnected;function V9(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=qt(t)?r++:t[e[r++]];return t}function H9(t){for(const e in t)if(t.hasOwnProperty(e)&&!qt(t[e]))return!1;return!0}function Ft(t,e){const n=Array.isArray(e)?e:Jg(e)?[e]:Bk(e),r=n.length===1?t:V9(t,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(It(r)&&nr(r)||Array.isArray(r)&&H9(r))&&Ft(t,n.slice(0,-1)),t}var KO=t=>{for(const e in t)if(us(t[e]))return!0;return!1};function hm(t,e={}){const n=Array.isArray(t);if(It(t)||n)for(const r in t)Array.isArray(t[r])||It(t[r])&&!KO(t[r])?(e[r]=Array.isArray(t[r])?[]:{},hm(t[r],e[r])):zn(t[r])||(e[r]=!0);return e}function JO(t,e,n){const r=Array.isArray(t);if(It(t)||r)for(const s in t)Array.isArray(t[s])||It(t[s])&&!KO(t[s])?qt(e)||t0(n[s])?n[s]=Array.isArray(t[s])?hm(t[s],[]):{...hm(t[s])}:JO(t[s],zn(e)?{}:e[s],n[s]):n[s]=!ro(t[s],e[s]);return n}var Wu=(t,e)=>JO(t,e,hm(e));const WC={value:!1,isValid:!1},GC={value:!0,isValid:!0};var QO=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&&!qt(t[0].attributes.value)?qt(t[0].value)||t[0].value===""?GC:{value:t[0].value,isValid:!0}:GC:WC}return WC},YO=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>qt(t)?t:e?t===""?NaN:t&&+t:n&&Bs(t)?new Date(t):r?r(t):t;const KC={isValid:!1,value:null};var ZO=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,KC):KC;function JC(t){const e=t.ref;return qk(e)?e.files:Uk(e)?ZO(t.refs).value:GO(e)?[...e.selectedOptions].map(({value:n})=>n):Wh(e)?QO(t.refs).value:YO(qt(e.value)?t.ref.value:e.value,t)}var W9=(t,e,n,r)=>{const s={};for(const i of t){const o=ue(e,i);o&&lt(s,i,o._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},fm=t=>t instanceof RegExp,Gu=t=>qt(t)?t:fm(t)?t.source:It(t)?fm(t.value)?t.value.source:t.value:t,QC=t=>({isOnSubmit:!t||t===cs.onSubmit,isOnBlur:t===cs.onBlur,isOnChange:t===cs.onChange,isOnAll:t===cs.all,isOnTouch:t===cs.onTouched});const YC="AsyncFunction";var G9=t=>!!t&&!!t.validate&&!!(us(t.validate)&&t.validate.constructor.name===YC||It(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===YC)),K9=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),ZC=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Cd=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=ue(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(Cd(a,e))break}else if(It(a)&&Cd(a,e))break}}};function XC(t,e,n){const r=ue(t,n);if(r||Jg(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=ue(e,i),a=ue(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 J9=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return nr(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(o=>e[o]===(!r||cs.all))},Q9=(t,e,n)=>!t||!e||t===e||Ed(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),Y9=(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,Z9=(t,e)=>!Fk(ue(t,e)).length&&Ft(t,e),X9=(t,e,n)=>{const r=Ed(ue(t,n));return lt(r,"root",e[n]),lt(t,n,r),t},gp=t=>Bs(t);function eN(t,e,n="validate"){if(gp(t)||Array.isArray(t)&&t.every(gp)||Ms(t)&&!t)return{type:n,message:gp(t)?t:"",ref:e}}var Ll=t=>It(t)&&!fm(t)?t:{value:t,message:""},tN=async(t,e,n,r,s,i)=>{const{ref:o,refs:a,required:l,maxLength:c,minLength:d,min:h,max:f,pattern:p,validate:g,name:m,valueAsNumber:y,mount:v}=t._f,x=ue(n,m);if(!v||e.has(m))return{};const w=a?a[0]:o,k=A=>{s&&w.reportValidity&&(w.setCustomValidity(Ms(A)?"":A||""),w.reportValidity())},S={},E=Uk(o),C=Wh(o),N=E||C,T=(y||qk(o))&&qt(o.value)&&qt(x)||dm(o)&&o.value===""||x===""||Array.isArray(x)&&!x.length,M=WO.bind(null,m,r,S),D=(A,L,I,U=ii.maxLength,B=ii.minLength)=>{const J=A?L:I;S[m]={type:A?U:B,message:J,ref:o,...M(A?U:B,J)}};if(i?!Array.isArray(x)||!x.length:l&&(!N&&(T||zn(x))||Ms(x)&&!x||C&&!QO(a).isValid||E&&!ZO(a).isValid)){const{value:A,message:L}=gp(l)?{value:!!l,message:l}:Ll(l);if(A&&(S[m]={type:ii.required,message:L,ref:w,...M(ii.required,L)},!r))return k(L),S}if(!T&&(!zn(h)||!zn(f))){let A,L;const I=Ll(f),U=Ll(h);if(!zn(x)&&!isNaN(x)){const B=o.valueAsNumber||x&&+x;zn(I.value)||(A=B>I.value),zn(U.value)||(L=B<U.value)}else{const B=o.valueAsDate||new Date(x),J=Q=>new Date(new Date().toDateString()+" "+Q),P=o.type=="time",z=o.type=="week";Bs(I.value)&&x&&(A=P?J(x)>J(I.value):z?x>I.value:B>new Date(I.value)),Bs(U.value)&&x&&(L=P?J(x)<J(U.value):z?x<U.value:B<new Date(U.value))}if((A||L)&&(D(!!A,I.message,U.message,ii.max,ii.min),!r))return k(S[m].message),S}if((c||d)&&!T&&(Bs(x)||i&&Array.isArray(x))){const A=Ll(c),L=Ll(d),I=!zn(A.value)&&x.length>+A.value,U=!zn(L.value)&&x.length<+L.value;if((I||U)&&(D(I,A.message,L.message),!r))return k(S[m].message),S}if(p&&!T&&Bs(x)){const{value:A,message:L}=Ll(p);if(fm(A)&&!x.match(A)&&(S[m]={type:ii.pattern,message:L,ref:o,...M(ii.pattern,L)},!r))return k(L),S}if(g){if(us(g)){const A=await g(x,n),L=eN(A,w);if(L&&(S[m]={...L,...M(ii.validate,L.message)},!r))return k(L.message),S}else if(It(g)){let A={};for(const L in g){if(!nr(A)&&!r)break;const I=eN(await g[L](x,n),w,L);I&&(A={...I,...M(L,I.message)},k(I.message),r&&(S[m]=A))}if(!nr(A)&&(S[m]={ref:w,...A},!r))return S}}return k(!0),S};const eK={mode:cs.onSubmit,reValidateMode:cs.onChange,shouldFocusError:!0};function tK(t={}){let e={...eK,...t},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:us(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},s=It(e.defaultValues)||It(e.values)?Xt(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:Xt(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 d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...d};const f={array:HC(),state:HC()},p=e.criteriaMode===cs.all,g=_=>O=>{clearTimeout(c),c=setTimeout(_,O)},m=async _=>{if(!e.disabled&&(d.isValid||h.isValid||_)){const O=e.resolver?nr((await C()).errors):await T(r,!0);O!==n.isValid&&f.state.next({isValid:O})}},y=(_,O)=>{!e.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((_||Array.from(a.mount)).forEac
vendor: 4,305 bytes, line 480
480h($=>{$&&(O?lt(n.validatingFields,$,O):Ft(n.validatingFields,$))}),f.state.next({validatingFields:n.validatingFields,isValidating:!nr(n.validatingFields)}))},v=(_,O=[],$,ee,te=!0,W=!0)=>{if(ee&&$&&!e.disabled){if(o.action=!0,W&&Array.isArray(ue(r,_))){const ne=$(ue(r,_),ee.argA,ee.argB);te&&lt(r,_,ne)}if(W&&Array.isArray(ue(n.errors,_))){const ne=$(ue(n.errors,_),ee.argA,ee.argB);te&&lt(n.errors,_,ne),Z9(n.errors,_)}if((d.touchedFields||h.touchedFields)&&W&&Array.isArray(ue(n.touchedFields,_))){const ne=$(ue(n.touchedFields,_),ee.argA,ee.argB);te&&lt(n.touchedFields,_,ne)}(d.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Wu(s,i)),f.state.next({name:_,isDirty:D(_,O),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else lt(i,_,O)},x=(_,O)=>{lt(n.errors,_,O),f.state.next({errors:n.errors})},w=_=>{n.errors=_,f.state.next({errors:n.errors,isValid:!1})},k=(_,O,$,ee)=>{const te=ue(r,_);if(te){const W=ue(i,_,qt($)?ue(s,_):$);qt(W)||ee&&ee.defaultChecked||O?lt(i,_,O?W:JC(te._f)):I(_,W),o.mount&&m()}},S=(_,O,$,ee,te)=>{let W=!1,ne=!1;const Ae={name:_};if(!e.disabled){if(!$||ee){(d.isDirty||h.isDirty)&&(ne=n.isDirty,n.isDirty=Ae.isDirty=D(),W=ne!==Ae.isDirty);const Qe=ro(ue(s,_),O);ne=!!ue(n.dirtyFields,_),Qe?Ft(n.dirtyFields,_):lt(n.dirtyFields,_,!0),Ae.dirtyFields=n.dirtyFields,W=W||(d.dirtyFields||h.dirtyFields)&&ne!==!Qe}if($){const Qe=ue(n.touchedFields,_);Qe||(lt(n.touchedFields,_,$),Ae.touchedFields=n.touchedFields,W=W||(d.touchedFields||h.touchedFields)&&Qe!==$)}W&&te&&f.state.next(Ae)}return W?Ae:{}},E=(_,O,$,ee)=>{const te=ue(n.errors,_),W=(d.isValid||h.isValid)&&Ms(O)&&n.isValid!==O;if(e.delayError&&$?(l=g(()=>x(_,$)),l(e.delayError)):(clearTimeout(c),l=null,$?lt(n.errors,_,$):Ft(n.errors,_)),($?!ro(te,$):te)||!nr(ee)||W){const ne={...ee,...W&&Ms(O)?{isValid:O}:{},errors:n.errors,name:_};n={...n,...ne},f.state.next(ne)}},C=async _=>{y(_,!0);const O=await e.resolver(i,e.context,W9(_||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return y(_),O},N=async _=>{const{errors:O}=await C(_);if(_)for(const $ of _){const ee=ue(O,$);ee?lt(n.errors,$,ee):Ft(n.errors,$)}else n.errors=O;return O},T=async(_,O,$={valid:!0})=>{for(const ee in _){const te=_[ee];if(te){const{_f:W,...ne}=te;if(W){const Ae=a.array.has(W.name),Qe=te._f&&G9(te._f);Qe&&d.validatingFields&&y([ee],!0);const un=await tN(te,a.disabled,i,p,e.shouldUseNativeValidation&&!O,Ae);if(Qe&&d.validatingFields&&y([ee]),un[W.name]&&($.valid=!1,O))break;!O&&(ue(un,W.name)?Ae?X9(n.errors,un,W.name):lt(n.errors,W.name,un[W.name]):Ft(n.errors,W.name))}!nr(ne)&&await T(ne,O,$)}}return $.valid},M=()=>{for(const _ of a.unMount){const O=ue(r,_);O&&(O._f.refs?O._f.refs.every($=>!Nv($)):!Nv(O._f.ref))&&Y(_)}a.unMount=new Set},D=(_,O)=>!e.disabled&&(_&&O&&lt(i,_,O),!ro(Q(),s)),A=(_,O,$)=>q9(_,a,{...o.mount?i:qt(O)?s:Bs(_)?{[_]:O}:O},$,O),L=_=>Fk(ue(o.mount?i:s,_,e.shouldUnregister?ue(s,_,[]):[])),I=(_,O,$={})=>{const ee=ue(r,_);let te=O;if(ee){const W=ee._f;W&&(!W.disabled&&lt(i,_,YO(O,W)),te=dm(W.ref)&&zn(O)?"":O,GO(W.ref)?[...W.ref.options].forEach(ne=>ne.selected=te.includes(ne.value)):W.refs?Wh(W.ref)?W.refs.forEach(ne=>{(!ne.defaultChecked||!ne.disabled)&&(Array.isArray(te)?ne.checked=!!te.find(Ae=>Ae===ne.value):ne.checked=te===ne.value||!!te)}):W.refs.forEach(ne=>ne.checked=ne.value===te):qk(W.ref)?W.ref.value="":(W.ref.value=te,W.ref.type||f.state.next({name:_,values:Xt(i)})))}($.shouldDirty||$.shouldTouch)&&S(_,te,$.shouldTouch,$.shouldDirty,!0),$.shouldValidate&&z(_)},U=(_,O,$)=>{for(const ee in O){if(!O.hasOwnProperty(ee))return;const te=O[ee],W=_+"."+ee,ne=ue(r,W);(a.array.has(_)||It(te)||ne&&!ne._f)&&!Ca(te)?U(W,te,$):I(W,te,$)}},B=(_,O,$={})=>{const ee=ue(r,_),te=a.array.has(_),W=Xt(O);lt(i,_,W),te?(f.array.next({name:_,values:Xt(i)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&$.shouldDirty&&f.state.next({name:_,dirtyFields:Wu(s,i),isDirty:D(_,W)})):ee&&!ee._f&&!zn(W)?U(_,W,$):I(_,W,$),ZC(_,a)&&f.state.next({...n,name:_}),f.state.next({name:o.mount?_:void 0,values:Xt(i)})},J=async _=>{o.mount=!0;const O=_.target;let $=O.name,ee=!0;const te=ue(r,$),W=Qe=>{ee=Number.isNaN(Qe)||Ca(Qe)&&isNaN(Qe.getTime())||ro(Qe,ue(i,$,Qe))},ne=QC(e.mode),Ae=QC(e.reValidateMode);if(te){let Qe,un;const Tr=O.type?JC(te._f):I9(_),Kn=_.type===VC.BLUR||_.type===VC.FOCUS_OUT,i
vendor: 4,323 bytes, line 480
480a=!K9(te._f)&&!e.resolver&&!ue(n.errors,$)&&!te._f.deps||Y9(Kn,ue(n.touchedFields,$),n.isSubmitted,Ae,ne),Ar=ZC($,a,Kn);lt(i,$,Tr),Kn?(te._f.onBlur&&te._f.onBlur(_),l&&l(0)):te._f.onChange&&te._f.onChange(_);const Mn=S($,Tr,Kn),Jn=!nr(Mn)||Ar;if(!Kn&&f.state.next({name:$,type:_.type,values:Xt(i)}),ia)return(d.isValid||h.isValid)&&(e.mode==="onBlur"?Kn&&m():Kn||m()),Jn&&f.state.next({name:$,...Ar?{}:Mn});if(!Kn&&Ar&&f.state.next({...n}),e.resolver){const{errors:wn}=await C([$]);if(W(Tr),ee){const oa=XC(n.errors,r,$),Li=XC(wn,r,oa.name||$);Qe=Li.error,$=Li.name,un=nr(wn)}}else y([$],!0),Qe=(await tN(te,a.disabled,i,p,e.shouldUseNativeValidation))[$],y([$]),W(Tr),ee&&(Qe?un=!1:(d.isValid||h.isValid)&&(un=await T(r,!0)));ee&&(te._f.deps&&z(te._f.deps),E($,un,Qe,Mn))}},P=(_,O)=>{if(ue(n.errors,O)&&_.focus)return _.focus(),1},z=async(_,O={})=>{let $,ee;const te=Ed(_);if(e.resolver){const W=await N(qt(_)?_:te);$=nr(W),ee=_?!te.some(ne=>ue(W,ne)):$}else _?(ee=(await Promise.all(te.map(async W=>{const ne=ue(r,W);return await T(ne&&ne._f?{[W]:ne}:ne)}))).every(Boolean),!(!ee&&!n.isValid)&&m()):ee=$=await T(r);return f.state.next({...!Bs(_)||(d.isValid||h.isValid)&&$!==n.isValid?{}:{name:_},...e.resolver||!_?{isValid:$}:{},errors:n.errors}),O.shouldFocus&&!ee&&Cd(r,P,_?te:a.mount),ee},Q=_=>{const O={...o.mount?i:s};return qt(_)?O:Bs(_)?ue(O,_):_.map($=>ue(O,$))},re=(_,O)=>({invalid:!!ue((O||n).errors,_),isDirty:!!ue((O||n).dirtyFields,_),error:ue((O||n).errors,_),isValidating:!!ue(n.validatingFields,_),isTouched:!!ue((O||n).touchedFields,_)}),ce=_=>{_&&Ed(_).forEach(O=>Ft(n.errors,O)),f.state.next({errors:_?n.errors:{}})},ae=(_,O,$)=>{const ee=(ue(r,_,{_f:{}})._f||{}).ref,te=ue(n.errors,_)||{},{ref:W,message:ne,type:Ae,...Qe}=te;lt(n.errors,_,{...Qe,...O,ref:ee}),f.state.next({name:_,errors:n.errors,isValid:!1}),$&&$.shouldFocus&&ee&&ee.focus&&ee.focus()},Ce=(_,O)=>us(_)?f.state.subscribe({next:$=>"values"in $&&_(A(void 0,O),$)}):A(_,O,!0),we=_=>f.state.subscribe({next:O=>{Q9(_.name,O.name,_.exact)&&J9(O,_.formState||d,ln,_.reRenderRoot)&&_.callback({values:{...i},...n,...O,defaultValues:s})}}).unsubscribe,Ge=_=>(o.mount=!0,h={...h,..._.formState},we({..._,formState:h})),Y=(_,O={})=>{for(const $ of _?Ed(_):a.mount)a.mount.delete($),a.array.delete($),O.keepValue||(Ft(r,$),Ft(i,$)),!O.keepError&&Ft(n.errors,$),!O.keepDirty&&Ft(n.dirtyFields,$),!O.keepTouched&&Ft(n.touchedFields,$),!O.keepIsValidating&&Ft(n.validatingFields,$),!e.shouldUnregister&&!O.keepDefaultValue&&Ft(s,$);f.state.next({values:Xt(i)}),f.state.next({...n,...O.keepDirty?{isDirty:D()}:{}}),!O.keepIsValid&&m()},Pe=({disabled:_,name:O})=>{(Ms(_)&&o.mount||_||a.disabled.has(O))&&(_?a.disabled.add(O):a.disabled.delete(O))},Xe=(_,O={})=>{let $=ue(r,_);const ee=Ms(O.disabled)||Ms(e.disabled);return lt(r,_,{...$||{},_f:{...$&&$._f?$._f:{ref:{name:_}},name:_,mount:!0,...O}}),a.mount.add(_),$?Pe({disabled:Ms(O.disabled)?O.disabled:e.disabled,name:_}):k(_,!0,O.value),{...ee?{disabled:O.disabled||e.disabled}:{},...e.progressive?{required:!!O.required,min:Gu(O.min),max:Gu(O.max),minLength:Gu(O.minLength),maxLength:Gu(O.maxLength),pattern:Gu(O.pattern)}:{},name:_,onChange:J,onBlur:J,ref:te=>{if(te){Xe(_,O),$=ue(r,_);const W=qt(te.value)&&te.querySelectorAll&&te.querySelectorAll("input,select,textarea")[0]||te,ne=U9(W),Ae=$._f.refs||[];if(ne?Ae.find(Qe=>Qe===W):W===$._f.ref)return;lt(r,_,{_f:{...$._f,...ne?{refs:[...Ae.filter(Nv),W,...Array.isArray(ue(s,_))?[{}]:[]],ref:{type:W.type,name:_}}:{ref:W}}}),k(_,!1,void 0,W)}else $=ue(r,_,{}),$._f&&($._f.mount=!1),(e.shouldUnregister||O.shouldUnregister)&&!(L9(a.array,_)&&o.action)&&a.unMount.add(_)}}},Ie=()=>e.shouldFocusError&&Cd(r,P,a.mount),pe=_=>{Ms(_)&&(f.state.next({disabled:_}),Cd(r,(O,$)=>{const ee=ue(r,$);ee&&(O.disabled=ee._f.disabled||_,Array.isArray(ee._f.refs)&&ee._f.refs.forEach(te=>{te.disabled=ee._f.disabled||_}))},0,!1))},Le=(_,O)=>async $=>{let ee;$&&($.preventDefault&&$.preventDefault(),$.persist&&$.persist());let te=Xt(i);if(f.state.next({isSubmitting:!0}),e.resolver){const{errors:W,values:ne}=await C();n.errors=W,te=Xt(ne)}else await T(r);if(a.disabled.size)for(const W of a.disabled)Ft(te,W);if(Ft(n.errors,"root"),nr(n.errors)){f.state.next({errors:{}});try{await _(te,$)}catch(W){ee=W}}else O&&await O({...n.errors},$),Ie(),setTimeout(Ie);
480if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:nr(n.errors)&&!ee,submitCount:n.submitCount+1,errors:n.errors}),ee)throw ee},at=(_,O={})=>{ue(r,_)&&(qt(O.defaultValue)?B(_,Xt(ue(s,_))):(B(_,O.defaultValue),lt(s,_,Xt(O.defaultValue))),O.keepTouched||Ft(n.touchedFields,_),O.keepDirty||(Ft(n.dirtyFields,_),n.isDirty=O.defaultValue?D(_,Xt(ue(s,_))):D()),O.keepError||(Ft(n.errors,_),d.isValid&&m()),f.state.next({...n}))},vt=(_,O={})=>{const $=_?Xt(_):s,ee=Xt($),te=nr(_),W=te?s:ee;if(O.keepDefaultValues||(s=$),!O.keepValues){if(O.keepDirtyValues){const ne=new Set([...a.mount,...Object.keys(Wu(s,i))]);for(const Ae of Array.from(ne))ue(n.dirtyFields,Ae)?lt(W,Ae,ue(i,Ae)):B(Ae,ue(W,Ae))}else{if($k&&qt(_))for(const ne of a.mount){const Ae=ue(r,ne);if(Ae&&Ae._f){const Qe=Array.isArray(Ae._f.refs)?Ae._f.refs[0]:Ae._f.ref;if(dm(Qe)){const un=Qe.closest("form");if(un){un.reset();break}}}}if(O.keepFieldsRef)for(const ne of a.mount)B(ne,ue(W,ne));else r={}}i=e.shouldUnregister?O.keepDefaultValues?Xt(s):{}:Xt(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=!d.isValid||!!O.keepIsValid||!!O.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:te?!1:O.keepDirty?n.isDirty:!!(O.keepDefaultValues&&!ro(_,s)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:te?{}:O.keepDirtyValues?O.keepDefaultValues&&i?Wu(s,i):n.dirtyFields:O.keepDefaultValues&&_?Wu(s,_):O.keepDirty?n.dirtyFields:{},touchedFields:O.keepTouched?n.touchedFields:{},errors:O.keepErrors?n.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},X=(_,O)=>vt(us(_)?_(i):_,O),it=(_,O={})=>{const $=ue(r,_),ee=$&&$._f;if(ee){const te=ee.refs?ee.refs[0]:ee.ref;te.focus&&(te.focus(),O.shouldSelect&&us(te.select)&&te.select())}},ln=_=>{n={...n,..._}},cn={control:{register:Xe,unregister:Y,getFieldState:re,handleSubmit:Le,setError:ae,_subscribe:we,_runSchema:C,_focusError:Ie,_getWatch:A,_getDirty:D,_setValid:m,_setFieldArray:v,_setDisabledField:Pe,_setErrors:w,_getFieldArray:L,_reset:vt,_resetDefaultValues:()=>us(e.defaultValues)&&e.defaultValues().then(_=>{X(_,e.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:M,_disableForm:pe,_subjects:f,_proxyFormState:d,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:Ge,trigger:z,register:Xe,handleSubmit:Le,watch:Ce,setValue:B,getValues:Q,reset:X,resetField:at,clearErrors:ce,unregister:Y,setError:ae,setFocus:it,getFieldState:re};return{...cn,formControl:cn}}function nK(t={}){const e=F.useRef(void 0),n=F.useRef(void 0),[r,s]=F.useState({isDirty:!1,isValidating:!1,isLoading:us(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:us(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:r},t.defaultValues&&!us(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:o,...a}=tK(t);e.current={...a,formState:r}}const i=e.current.control;return i._options=t,B9(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,o},[i]),F.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),F.useEffect(()=>{t.mode&&(i._options.mode=t.mode),t.reValidateMode&&(i._options.reValidateMode=t.reValidateMode)},[i,t.mode,t.reValidateMode]),F.useEffect(()=>{t.errors&&(i._setErrors(t.errors),i._focusError())},[i,t.errors]),F.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,t.shouldUnregister]),F.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),F.useEffect(()=>{t.values&&!ro(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]),F.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=F9(r,i),e.current}const nN=(t,e,n)=>{if(t&&"reportValidity"in t){const r=ue(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},XO=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?nN(r.ref,n,t):r.refs&&r.refs.forEac
vendor: 3,046 bytes, line 480
480h(s=>nN(s,n,t))}},rK=(t,e)=>{e.shouldUseNativeValidation&&XO(t,e);const n={};for(const r in t){const s=ue(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(sK(e.names||Object.keys(t),r)){const o=Object.assign({},ue(n,r));lt(o,"root",i),lt(n,r,o)}else lt(n,r,i)}return n},sK=(t,e)=>t.some(n=>n.startsWith(e+"."));var iK=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(d){return d.errors.forEach(function(h){return t.push(h)})}),e){var l=n[o].types,c=l&&l[r.code];n[o]=WO(o,e,n,s,c?[].concat(c,r.message):r.message)}t.shift()}return n},oK=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&&XO({},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:rK(iK(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},Ze;(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})(Ze||(Ze={}));var rN;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(rN||(rN={}));const he=Ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qi=t=>{switch(typeof t){case"undefined":return he.undefined;case"string":return he.string;case"number":return Number.isNaN(t)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":return Array.isArray(t)?he.array:t===null?he.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?he.promise:typeof Map<"u"&&t instanceof Map?he.map:typeof Set<"u"&&t instanceof Set?he.set:typeof Date<"u"&&t instanceof Date?he.date:he.object;default:return he.unknown}}
vendor: 4,686 bytes, line 480
480,K=Ze.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 Ri 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 Ri))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ze.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()}}Ri.create=t=>new Ri(t);const n0=(t,e)=>{let n;switch(t.code){case K.invalid_type:t.received===he.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ze.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ze.joinValues(t.keys,", ")}`;break;case K.invalid_union:n="Invalid input";break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ze.joinValues(t.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${Ze.joinValues(t.options)}, received '${t.received}'`;break;case K.invalid_arguments:n="Invalid function arguments";break;case K.invalid_return_type:n="Invalid function return type";break;case K.invalid_date:n="Invalid date";break;case K.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}"`:Ze.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case K.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 K.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 K.custom:n="Invalid input";break;case K.invalid_intersection_types:n="Intersection results could not be merged";break;case K.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case K.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ze.assertNever(t)}return{message:n}};let aK=n0;function lK(){return aK}const cK=t=>
vendor: 26,630 bytes, line 480
480{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 ie(t,e){const n=lK(),r=cK({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===n0?void 0:n0].filter(s=>!!s)});t.common.issues.push(r)}class Er{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Me;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Er.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return Me;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 Me=Object.freeze({status:"aborted"}),id=t=>({status:"dirty",value:t}),Jr=t=>({status:"valid",value:t}),sN=t=>t.status==="aborted",iN=t=>t.status==="dirty",nu=t=>t.status==="valid",pm=t=>typeof Promise<"u"&&t instanceof Promise;var me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(me||(me={}));class Ho{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 oN=(t,e)=>{if(nu(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 Ri(t.common.issues);return this._error=n,this._error}}};function qe(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 Je{get description(){return this._def.description}_getType(e){return Qi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Qi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Er,ctx:{common:e.parent.common,data:e.data,parsedType:Qi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(pm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qi(e)},s=this._parseSync({data:e,path:r.path,parent:r});return oN(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qi(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return nu(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=>nu(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qi(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(pm(s)?s:Promise.resolve(s));return oN(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:K.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 su({schema:this,typeName:Oe.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 Po.create(this,this._def)}nullable(){return iu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ws.create(this)}promise(){return vm.create(this,this._def)}or(e){return gm.create([this,e],this._def)}and(e){return ym.create(this,e,this._def)}transform(e){return new su({...qe(this._def),schema:this,typeName:Oe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new s0({...qe(this._def),innerType:this,defaultValue:n,typeName:Oe.ZodDefault})}brand(){return new MK({typeName:Oe.ZodBranded,type:this,...qe(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new i0({...qe(this._def),innerType:this,catchValue:n,typeName:Oe.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Vk.create(this,e)}readonly(){return o0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const uK=/^c[^\s-]{8,}$/i,dK=/^[0-9a-z]+$/,hK=/^[0-9A-HJKMNP-TV-Z]{26}$/i,fK=/^[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,pK=/^[a-z0-9_-]{21}$/i,mK=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,gK=/^[-+]?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)?)??$/,yK=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _v;const xK=/^(?:(?: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])$/,bK=/^(?:(?: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])$/,wK=/^(([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]))$/,kK=/^(([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])$/,SK=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,EK=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,e2="((\\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])))",CK=new RegExp(`^${e2}$`);function t2(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 NK(t){return new RegExp(`^${t2(t)}$`)}function _K(t){let e=`${e2}T${t2(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 TK(t,e){return!!((e==="v4"||!e)&&xK.test(t)||(e==="v6"||!e)&&wK.test(t))}function AK(t,e){if(!mK.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 jK(t,e){return!!((e==="v4"||!e)&&bK.test(t)||(e==="v6"||!e)&&kK.test(t))}class bo extends Je{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==he.string){const i=this._getOrReturnCtx(e);return ie(i,{code:K.invalid_type,expected:he.string,received:i.parsedType}),Me}const r=new Er;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:K.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),ie(s,{code:K.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?ie(s,{code:K.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&ie(s,{code:K.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")yK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"email",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")_v||(_v=new RegExp(vK,"u")),_v.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"emoji",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")fK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"uuid",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")pK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"nanoid",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")uK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")dK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid2",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")hK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ulid",code:K.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ie(s,{validation:"url",code:K.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),ie(s,{validation:"regex",code:K.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),ie(s,{code:K.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),ie(s,{code:K.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:K.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?_K(i).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:K.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?CK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:K.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?NK(i).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:K.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?gK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"duration",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?TK(e.data,i.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ip",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?AK(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"jwt",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?jK(e.data,i.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cidr",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?SK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"base64",code:K.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?EK.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"base64url",code:K.invalid_string,message:i.message}),r.dirty()):Ze.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:K.invalid_string,...me.errToObj(r)})}_addCheck(e){return new bo({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...me.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,...me.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,...me.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...me.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...me.errToObj(n)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new bo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new bo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new bo({...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}}bo.create=t=>new bo({checks:[],typeName:Oe.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...qe(t)});function RK(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 fh extends Je{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)!==he.number){const i=this._getOrReturnCtx(e);return ie(i,{code:K.invalid_type,expected:he.number,received:i.parsedType}),Me}let r;const s=new Er;for(const i of this._def.checks)i.kind==="int"?Ze.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:K.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),ie(r,{code:K.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),ie(r,{code:K.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?RK(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),ie(r,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:K.not_finite,message:i.message}),s.dirty()):Ze.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,r,s){return new fh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:me.toString(s)}]})}_addCheck(e){return new fh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.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"&&Ze.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)}}fh.create=t=>new fh({checks:[],typeName:Oe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...qe(t)});class ph extends Je{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)!==he.bigint)return this._getInvalidInput(e);let r;const s=new Er;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:K.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),ie(r,{code:K.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),ie(r,{code:K.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ze.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ie(n,{code:K.invalid_type,expected:he.bigint,received:n.parsedType}),Me}gte(e,n){return this.setLimit("min",e,!0,me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,me.toString(n))}setLimit(e,n,r,s){return new ph({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:me.toString(s)}]})}_addCheck(e){return new ph({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:me.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}}ph.create=t=>new ph({checks:[],typeName:Oe.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...qe(t)});class aN extends Je{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==he.boolean){const r=this._getOrReturnCtx(e);return ie(r,{code:K.invalid_type,expected:he.boolean,received:r.parsedType}),Me}return Jr(e.data)}}aN.create=t=>new aN({typeName:Oe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...qe(t)});class mm extends Je{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==he.date){const i=this._getOrReturnCtx(e);return ie(i,{code:K.invalid_type,expected:he.date,received:i.parsedType}),Me}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return ie(i,{code:K.invalid_date}),Me}const r=new Er;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:K.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),ie(s,{code:K.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Ze.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new mm({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:me.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}}mm.create=t=>new mm({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Oe.ZodDate,...qe(t)}
vendor: 17,262 bytes, line 480
480);class lN extends Je{_parse(e){if(this._getType(e)!==he.symbol){const r=this._getOrReturnCtx(e);return ie(r,{code:K.invalid_type,expected:he.symbol,received:r.parsedType}),Me}return Jr(e.data)}}lN.create=t=>new lN({typeName:Oe.ZodSymbol,...qe(t)});class cN extends Je{_parse(e){if(this._getType(e)!==he.undefined){const r=this._getOrReturnCtx(e);return ie(r,{code:K.invalid_type,expected:he.undefined,received:r.parsedType}),Me}return Jr(e.data)}}cN.create=t=>new cN({typeName:Oe.ZodUndefined,...qe(t)});class uN extends Je{_parse(e){if(this._getType(e)!==he.null){const r=this._getOrReturnCtx(e);return ie(r,{code:K.invalid_type,expected:he.null,received:r.parsedType}),Me}return Jr(e.data)}}uN.create=t=>new uN({typeName:Oe.ZodNull,...qe(t)});class dN extends Je{constructor(){super(...arguments),this._any=!0}_parse(e){return Jr(e.data)}}dN.create=t=>new dN({typeName:Oe.ZodAny,...qe(t)});class hN extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Jr(e.data)}}hN.create=t=>new hN({typeName:Oe.ZodUnknown,...qe(t)});class Wo extends Je{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:K.invalid_type,expected:he.never,received:n.parsedType}),Me}}Wo.create=t=>new Wo({typeName:Oe.ZodNever,...qe(t)});class fN extends Je{_parse(e){if(this._getType(e)!==he.undefined){const r=this._getOrReturnCtx(e);return ie(r,{code:K.invalid_type,expected:he.void,received:r.parsedType}),Me}return Jr(e.data)}}fN.create=t=>new fN({typeName:Oe.ZodVoid,...qe(t)});class Ws extends Je{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==he.array)return ie(n,{code:K.invalid_type,expected:he.array,received:n.parsedType}),Me;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(o||a)&&(ie(n,{code:o?K.too_big:K.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&&(ie(n,{code:K.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&&(ie(n,{code:K.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 Ho(n,o,n.path,a)))).then(o=>Er.mergeArray(r,o));const i=[...n.data].map((o,a)=>s.type._parseSync(new Ho(n,o,n.path,a)));return Er.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Ws({...this._def,minLength:{value:e,message:me.toString(n)}})}max(e,n){return new Ws({...this._def,maxLength:{value:e,message:me.toString(n)}})}length(e,n){return new Ws({...this._def,exactLength:{value:e,message:me.toString(n)}})}nonempty(e){return this.min(1,e)}}Ws.create=(t,e)=>new Ws({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Oe.ZodArray,...qe(e)});function Gl(t){if(t instanceof At){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Po.create(Gl(r))}return new At({...t._def,shape:()=>e})}else return t instanceof Ws?new Ws({...t._def,type:Gl(t.element)}):t instanceof Po?Po.create(Gl(t.unwrap())):t instanceof iu?iu.create(Gl(t.unwrap())):t instanceof ll?ll.create(t.items.map(e=>Gl(e))):t}class At extends Je{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=Ze.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==he.object){const c=this._getOrReturnCtx(e);return ie(c,{code:K.invalid_type,expected:he.object,received:c.parsedType}),Me}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wo&&this._def.unknownKeys==="strip"))for(const c in s.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const d=i[c],h=s.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Ho(s,h,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Wo){const c=this._def.unknownKeys;if(c==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(c==="strict")a.length>0&&(ie(s,{code:K.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 d of a){const h=s.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Ho(s,h,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const d of l){const h=await d.key,f=await d.value;c.push({key:h,value:f,alwaysSet:d.alwaysSet})}return c}).then(c=>Er.mergeObjectSync(r,c)):Er.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return me.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:me.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:Oe.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 Ze.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 Ze.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new At({...this._def,shape:()=>n})}deepPartial(){return Gl(this)}partial(e){const n={};for(const r of Ze.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 Ze.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Po;)i=i._def.innerType;n[r]=i}return new At({...this._def,shape:()=>n})}keyof(){return n2(Ze.objectKeys(this.shape))}}At.create=(t,e)=>new At({shape:()=>t,unknownKeys:"strip",catchall:Wo.create(),typeName:Oe.ZodObject,...qe(e)});At.strictCreate=(t,e)=>new At({shape:()=>t,unknownKeys:"strict",catchall:Wo.create(),typeName:Oe.ZodObject,...qe(e)});At.lazycreate=(t,e)=>new At({shape:t,unknownKeys:"strip",catchall:Wo.create(),typeName:Oe.ZodObject,...qe(e)});class gm extends Je{_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 Ri(a.ctx.common.issues));return ie(n,{code:K.invalid_union,unionErrors:o}),Me}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},d=l._parseSync({data:n.data,path:n.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new Ri(l));return ie(n,{code:K.invalid_union,unionErrors:a}),Me}}get options(){return this._def.options}}gm.create=(t,e)=>new gm({options:t,typeName:Oe.ZodUnion,...qe(e)});function r0(t,e){const n=Qi(t),r=Qi(e);if(t===e)return{valid:!0,data:t};if(n===he.object&&r===he.object){const s=Ze.objectKeys(e),i=Ze.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(const a of i){const l=r0(t[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===he.array&&r===he.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=r0(o,a);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return n===he.date&&r===he.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ym extends Je{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(sN(i)||sN(o))return Me;const a=r0(i.value,o.value);return a.valid?((iN(i)||iN(o))&&n.dirty(),{status:n.value,value:a.data}):(ie(r,{code:K.invalid_intersection_types}),Me)};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}))}}ym.create=(t,e,n)=>new ym({left:t,right:e,typeName:Oe.ZodIntersection,...qe(n)});class ll extends Je{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==he.array)return ie(r,{code:K.invalid_type,expected:he.array,received:r.parsedType}),Me;if(r.data.length<this._def.items.length)return ie(r,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Me;!this._def.rest&&r.data.length>this._def.items.length&&(ie(r,{code:K.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 Ho(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Er.mergeArray(n,o)):Er.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new ll({...this._def,rest:e})}}ll.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ll({items:t,typeName:Oe.ZodTuple,rest:null,...qe(e)})};class pN extends Je{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!==he.map)return ie(r,{code:K.invalid_type,expected:he.map,received:r.parsedType}),Me;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:s._parse(new Ho(r,a,r.path,[c,"key"])),value:i._parse(new Ho(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,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return Me;(c.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(c.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return Me;(c.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(c.value,d.value)}return{status:n.value,value:a}}}}pN.create=(t,e,n)=>new pN({valueType:e,keyType:t,typeName:Oe.ZodMap,...qe(n)});class mh extends Je{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==he.set)return ie(r,{code:K.invalid_type,expected:he.set,received:r.parsedType}),Me;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ie(r,{code:K.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&&(ie(r,{code:K.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 d of l){if(d.status==="aborted")return Me;d.status==="dirty"&&n.dirty(),c.add(d.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>i._parse(new Ho(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,n){return new mh({...this._def,minSize:{value:e,message:me.toString(n)}})}max(e,n){return new mh({...this._def,maxSize:{value:e,message:me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}mh.create=(t,e)=>new mh({valueType:t,minSize:null,maxSize:null,typeName:Oe.ZodSet,...qe(e)});class mN extends Je{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})}}mN.create=(t,e)=>new mN({getter:t,typeName:Oe.ZodLazy,...qe(e)});class gN extends Je{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:K.invalid_literal,expected:this._def.value}),Me}return{status:"valid",value:e.data}}get value(){return this._def.value}}gN.create=(t,e)=>new gN({value:t,typeName:Oe.ZodLiteral,...qe(e)});function n2(t,e){return new ru({values:t,typeName:Oe.ZodEnum,...qe(e)})}class ru extends Je{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ie(n,{expected:Ze.joinValues(r),received:n.parsedType,code:K.invalid_type}),Me}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 ie(n,{received:n.data,code:K.invalid_enum_value,options:r}),Me}return Jr(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 ru.create(e,{...this._def,...n})}exclude(e,n=this._def){return ru.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}ru.create=n2;class yN extends Je{_parse(e){const n=Ze.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==he.string&&r.parsedType!==he.number){const s=Ze.objectValues(n);return ie(r,{expected:Ze.joinValues(s),received:r.parsedType,code:K.invalid_type}),Me}if(this._cache||(this._cache=new Set(Ze.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Ze.objectValues(n);return ie(r,{received:r.data,code:K.invalid_enum_value,options:s}),Me}return Jr(e.data)}get enum(){return this._def.values}}yN.create=(t,e)=>new yN({values:t,typeName:Oe.ZodNativeEnum,...qe(e)});class vm extends Je{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==he.promise&&n.common.async===!1)return ie(n,{code:K.invalid_type,expected:he.promise,received:n.parsedType}),Me;const r=n.parsedType===he.promise?n.data:Promise.resolve(n.data);return Jr(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}vm.create=(t,e)=>new vm({type:t,typeName:Oe.ZodPromise,...qe(e)});class su extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Oe.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=>{ie(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 Me;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Me:l.status==="dirty"||n.value==="dirty"?id(l.value):l});{if(n.value==="aborted")return Me;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Me:a.status==="dirty"||n.value==="dirty"?id(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"?Me:(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"?Me:(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(!nu(o))return Me;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=>nu(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:n.value,value:a})):Me);Ze.assertNever(s)}}su.create=(t,e,n)=>new su({schema:t,typeName:Oe.ZodEffects,effect:e,...qe(n)});su.createWithPreprocess=(t,e,n)=>new su({schema:e,effect:{type:"preprocess",transform:t},typeName:Oe.ZodEffects,...qe(n)});class Po extends Je{_parse(e){return this._getType(e)===he.undefined?Jr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Po.create=(t,e)=>new Po({innerType:t,typeName:Oe.ZodOptional,...qe(e)}
480);class iu extends Je{_parse(e){return this._getType(e)===he.null?Jr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}iu.create=(t,e)=>new iu({innerType:t,typeName:Oe.ZodNullable,...qe(e)});class s0 extends Je{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===he.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}s0.create=(t,e)=>new s0({innerType:t,typeName:Oe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...qe(e)});class i0 extends Je{_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 pm(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ri(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ri(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}i0.create=(t,e)=>new i0({innerType:t,typeName:Oe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...qe(e)});class vN extends Je{_parse(e){if(this._getType(e)!==he.nan){const r=this._getOrReturnCtx(e);return ie(r,{code:K.invalid_type,expected:he.nan,received:r.parsedType}),Me}return{status:"valid",value:e.data}}}vN.create=t=>new vN({typeName:Oe.ZodNaN,...qe(t)});class MK extends Je{_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 Vk extends Je{_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"?Me:i.status==="dirty"?(n.dirty(),id(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"?Me: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 Vk({in:e,out:n,typeName:Oe.ZodPipeline})}}class o0 extends Je{_parse(e){const n=this._def.innerType._parse(e),r=s=>(nu(s)&&(s.value=Object.freeze(s.value)),s);return pm(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}o0.create=(t,e)=>new o0({innerType:t,typeName:Oe.ZodReadonly,...qe(e)});At.lazycreate;var Oe;(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"})(Oe||(Oe={}));const zl=bo.create;Wo.create;Ws.create;const OK=At.create;At.strictCreate;gm.create;ym.create;ll.create;ru.create;vm.create;Po.create;iu.create;var Tv="focusScope.autoFocusOnMount",Av="focusScope.autoFocusOnUnmount",xN={bubbles:!1,cancelable:!0},PK="FocusScope",Hk=b.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,l]=b.useState(null),c=Gr(s),d=Gr(i),h=b.useRef(null),f=Ue(e,m=>l(m)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let m=function(w){if(p.paused||!a)return;const k=w.target;a.contains(k)?h.current=k:Hi(h.current,{select:!0})},y=function(w){if(p.paused||!a)return;const k=w.relatedTarget;k!==null&&(a.contains(k)||Hi(h.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Hi(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const x=new MutationObserver(v);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,p.paused]),b.useEffect(()=>{if(a){wN.add(p);
vendor: 4,557 bytes, line 480
480const m=document.activeElement;if(!a.contains(m)){const v=new CustomEvent(Tv,xN);a.addEventListener(Tv,c),a.dispatchEvent(v),v.defaultPrevented||(IK(FK(r2(a)),{select:!0}),document.activeElement===m&&Hi(a))}return()=>{a.removeEventListener(Tv,c),setTimeout(()=>{const v=new CustomEvent(Av,xN);a.addEventListener(Av,d),a.dispatchEvent(v),v.defaultPrevented||Hi(m??document.body,{select:!0}),a.removeEventListener(Av,d),wN.remove(p)},0)}}},[a,c,d,p]);const g=b.useCallback(m=>{if(!n&&!r||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(y&&v){const x=m.currentTarget,[w,k]=DK(x);w&&k?!m.shiftKey&&v===k?(m.preventDefault(),n&&Hi(w,{select:!0})):m.shiftKey&&v===w&&(m.preventDefault(),n&&Hi(k,{select:!0})):v===x&&m.preventDefault()}},[n,r,p.paused]);return u.jsx(Ee.div,{tabIndex:-1,...o,ref:f,onKeyDown:g})});Hk.displayName=PK;function IK(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Hi(r,{select:e}),document.activeElement!==n)return}function DK(t){const e=r2(t),n=bN(e,t),r=bN(e.reverse(),t);return[n,r]}function r2(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 bN(t,e){for(const n of t)if(!LK(n,{upTo:e}))return n}function LK(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 zK(t){return t instanceof HTMLInputElement&&"select"in t}function Hi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&zK(t)&&e&&t.select()}}var wN=$K();function $K(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=kN(t,e),t.unshift(e)},remove(e){var n;t=kN(t,e),(n=t[0])==null||n.resume()}}}function kN(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function FK(t){return t.filter(e=>e.tagName!=="A")}var jv=0;function s2(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??SN()),document.body.insertAdjacentElement("beforeend",t[1]??SN()),jv++,()=>{jv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),jv--}},[])}function SN(){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 yp="right-scroll-bar-position",vp="width-before-scroll-bar",BK="with-scroll-bars-hidden",qK="--removed-body-scroll-bar-size";function Rv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function UK(t,e){var n=b.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 VK=typeof window<"u"?b.useLayoutEffect:b.useEffect,EN=new WeakMap;function HK(t,e){var n=UK(null,function(r){return t.forEach(function(s){return Rv(s,r)})});return VK(function(){var r=EN.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(a){i.has(a)||Rv(a,null)}),i.forEach(function(a){s.has(a)||Rv(a,o)})}EN.set(n,t)},[t]),n}function WK(t){return t}function GK(t,e){e===void 0&&(e=WK);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 d=o;o=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){o.push(d),c()},filter:function(d){return o=o.filter(d),n}}}};return s}function KK(t){t===void 0&&(t={});var e=GK(null);return e.options=Ls({async:!0,ssr:!1},t),e}var i2=function(t){var e=t.sideCar,n=Su(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 b.createElement(r,Ls({},n))};
vendor: 4,539 bytes, lines 480-517
480i2.isSideCarExport=!0;function JK(t,e){return t.useMedium(e),i2}var o2=KK(),Mv=function(){},Qg=b.forwardRef(function(t,e){var n=b.useRef(null),r=b.useState({onScrollCapture:Mv,onWheelCapture:Mv,onTouchMoveCapture:Mv}),s=r[0],i=r[1],o=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,p=t.noRelative,g=t.noIsolation,m=t.inert,y=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,w=t.gapMode,k=Su(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,E=HK([n,e]),C=Ls(Ls({},k),s);return b.createElement(b.Fragment,null,d&&b.createElement(S,{sideCar:o2,removeScrollBar:c,shards:h,noRelative:p,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),o?b.cloneElement(b.Children.only(a),Ls(Ls({},C),{ref:E})):b.createElement(x,Ls({},C,{className:l,ref:E}),a))});Qg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qg.classNames={fullWidth:vp,zeroRight:yp};var QK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function YK(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=QK();return e&&t.setAttribute("nonce",e),t}function ZK(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function XK(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var e7=function(){var t=0,e=null;return{add:function(n){t==0&&(e=YK())&&(ZK(e,n),XK(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},t7=function(){var t=e7();return function(e,n){b.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},a2=function(){var t=t7(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},n7={left:0,top:0,right:0,gap:0},Ov=function(t){return parseInt(t||"",10)||0},r7=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[Ov(n),Ov(r),Ov(s)]},s7=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return n7;var e=r7(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])}},i7=a2(),_c="data-scroll-locked",o7=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
481  .`.concat(BK,` {
482   overflow: hidden `).concat(r,`;
483   padding-right: `).concat(a,"px ").concat(r,`;
484  }
485  body[`).concat(_c,`] {
486    overflow: hidden `).concat(r,`;
487    overscroll-behavior: contain;
488    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
489    padding-left: `.concat(s,`px;
490    padding-top: `).concat(i,`px;
491    padding-right: `).concat(o,`px;
492    margin-left:0;
493    margin-top:0;
494    margin-right: `).concat(a,"px ").concat(r,`;
495    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
496  }
497  
498  .`).concat(yp,` {
499    right: `).concat(a,"px ").concat(r,`;
500  }
501  
502  .`).concat(vp,` {
503    margin-right: `).concat(a,"px ").concat(r,`;
504  }
505  
506  .`).concat(yp," .").concat(yp,` {
507    right: 0 `).concat(r,`;
508  }
509  
510  .`).concat(vp," .").concat(vp,` {
511    margin-right: 0 `).concat(r,`;
512  }
513  
514  body[`).concat(_c,`] {
515    `).concat(qK,": ").concat(a,`px;
516  }
517`)},CN=function(){var t=parseInt(document.body.getAttribute(_c)||"0",10);return isFinite(t)?t:0},a7=function(){b.useEffect(function(){return document.body.setAttribute(_c,(CN()+1).toString()),function(){var t=CN()-1;t<=0?document.body.removeAttribute(_c):document.body.setAttribute(_c,t.toString())}},[])},l7=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;a7();var i=b.useMemo(function(){return s7(s)},[s]);return b.createElement(i7,{styles:o7(i,!e,s,n?"":"!important")})},a0=!1;if(typeof window<"u")try{var Rf=Object.defineProperty({},"passive",{get:function(){return a0=!0,!0}});window.addEventListener("test",Rf,Rf),window.removeEventListener("test",Rf,Rf)}catch{a0=!1}var $l=a0?{passive:!1}:!1,c7=function(t){return t.tagName==="TEXTAREA"},l2=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!c7(t)&&n[e]==="visible")},u7=function(t){return l2(t,"overflowY")},d7=function(t){return l2(t,"overflowX")},NN=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=c2(t,r);
vendor: 4,638 bytes, lines 517-520
517if(s){var i=u2(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},h7=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},f7=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},c2=function(t,e){return t==="v"?u7(e):d7(e)},u2=function(t,e){return t==="v"?h7(e):f7(e)},p7=function(t,e){return t==="h"&&e==="rtl"?-1:1},m7=function(t,e,n,r,s){var i=p7(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,l=e.contains(a),c=!1,d=o>0,h=0,f=0;do{if(!a)break;var p=u2(t,a),g=p[0],m=p[1],y=p[2],v=m-y-i*g;(g||v)&&c2(t,a)&&(h+=v,f+=g);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(c=!0),c},Mf=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_N=function(t){return[t.deltaX,t.deltaY]},TN=function(t){return t&&"current"in t?t.current:t},g7=function(t,e){return t[0]===e[0]&&t[1]===e[1]},y7=function(t){return`
518  .block-interactivity-`.concat(t,` {pointer-events: none;}
519  .allow-interactivity-`).concat(t,` {pointer-events: all;}
520`)},v7=0,Fl=[];function x7(t){var e=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),s=b.useState(v7++)[0],i=b.useState(a2)[0],o=b.useRef(t);b.useEffect(function(){o.current=t},[t]),b.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var m=RV([t.lockRef.current],(t.shards||[]).map(TN),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=b.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var v=Mf(m),x=n.current,w="deltaX"in m?m.deltaX:x[0]-v[0],k="deltaY"in m?m.deltaY:x[1]-v[1],S,E=m.target,C=Math.abs(w)>Math.abs(k)?"h":"v";if("touches"in m&&C==="h"&&E.type==="range")return!1;var N=NN(C,E);if(!N)return!0;if(N?S=C:(S=C==="v"?"h":"v",N=NN(C,E)),!N)return!1;if(!r.current&&"changedTouches"in m&&(w||k)&&(r.current=S),!S)return!0;var T=r.current||S;return m7(T,y,m,T==="h"?w:k,!0)},[]),l=b.useCallback(function(m){var y=m;if(!(!Fl.length||Fl[Fl.length-1]!==i)){var v="deltaY"in y?_N(y):Mf(y),x=e.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&g7(S.delta,v)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(TN).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=b.useCallback(function(m,y,v,x){var w={name:m,delta:y,target:v,should:x,shadowParent:b7(v)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(k){return k!==w})},1)},[]),d=b.useCallback(function(m){n.current=Mf(m),r.current=void 0},[]),h=b.useCallback(function(m){c(m.type,_N(m),m.target,a(m,t.lockRef.current))},[]),f=b.useCallback(function(m){c(m.type,Mf(m),m.target,a(m,t.lockRef.current))},[]);b.useEffect(function(){return Fl.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,$l),document.addEventListener("touchmove",l,$l),document.addEventListener("touchstart",d,$l),function(){Fl=Fl.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,$l),document.removeEventListener("touchmove",l,$l),document.removeEventListener("touchstart",d,$l)}},[]);var p=t.removeScrollBar,g=t.inert;return b.createElement(b.Fragment,null,g?b.createElement(i,{styles:y7(s)}):null,p?b.createElement(l7,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function b7(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const w7=JK(o2,x7);var Wk=b.forwardRef(function(t,e){return b.createElement(Qg,Ls({},t,{ref:e,sideCar:w7}))});Wk.classNames=Qg.classNames;var k7=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Bl=new WeakMap,Of=new WeakMap,Pf={},Pv=0,d2=function(t){return t&&(t.host||d2(t.parentNode))},S7=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=d2(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})},E7=function(t,e,n,r){var s=S7(e,Array.isArray(t)?t:[t]);
vendor: 7,067 bytes, lines 520-524
520Pf[n]||(Pf[n]=new WeakMap);var i=Pf[n],o=[],a=new Set,l=new Set(s),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};s.forEach(c);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(a.has(f))d(f);else try{var p=f.getAttribute(r),g=p!==null&&p!=="false",m=(Bl.get(f)||0)+1,y=(i.get(f)||0)+1;Bl.set(f,m),i.set(f,y),o.push(f),m===1&&g&&Of.set(f,!0),y===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return d(e),a.clear(),Pv++,function(){o.forEach(function(h){var f=Bl.get(h)-1,p=i.get(h)-1;Bl.set(h,f),i.set(h,p),f||(Of.has(h)||h.removeAttribute(r),Of.delete(h)),p||h.removeAttribute(n)}),Pv--,Pv||(Bl=new WeakMap,Bl=new WeakMap,Of=new WeakMap,Pf={})}},h2=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=k7(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),E7(r,s,n,"aria-hidden")):function(){return null}},Yg="Dialog",[f2,p2]=_r(Yg),[C7,Ss]=f2(Yg),m2=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=b.useRef(null),l=b.useRef(null),[c,d]=vs({prop:r,defaultProp:s??!1,onChange:i,caller:Yg});return u.jsx(C7,{scope:e,triggerRef:a,contentRef:l,contentId:Vs(),titleId:Vs(),descriptionId:Vs(),open:c,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(h=>!h),[d]),modal:o,children:n})};m2.displayName=Yg;var g2="DialogTrigger",y2=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ss(g2,n),i=Ue(e,s.triggerRef);return u.jsx(Ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Jk(s.open),...r,ref:i,onClick:ge(t.onClick,s.onOpenToggle)})});y2.displayName=g2;var Gk="DialogPortal",[N7,v2]=f2(Gk,{forceMount:void 0}),x2=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ss(Gk,e);return u.jsx(N7,{scope:e,forceMount:n,children:b.Children.map(r,o=>u.jsx(Zo,{present:n||i.open,children:u.jsx(_g,{asChild:!0,container:s,children:o})}))})};x2.displayName=Gk;var xm="DialogOverlay",b2=b.forwardRef((t,e)=>{const n=v2(xm,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ss(xm,t.__scopeDialog);return i.modal?u.jsx(Zo,{present:r||i.open,children:u.jsx(T7,{...s,ref:e})}):null});b2.displayName=xm;var _7=Yc("DialogOverlay.RemoveScroll"),T7=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ss(xm,n);return u.jsx(Wk,{as:_7,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(Ee.div,{"data-state":Jk(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),cl="DialogContent",w2=b.forwardRef((t,e)=>{const n=v2(cl,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ss(cl,t.__scopeDialog);return u.jsx(Zo,{present:r||i.open,children:i.modal?u.jsx(A7,{...s,ref:e}):u.jsx(j7,{...s,ref:e})})});w2.displayName=cl;var A7=b.forwardRef((t,e)=>{const n=Ss(cl,t.__scopeDialog),r=b.useRef(null),s=Ue(e,n.contentRef,r);return b.useEffect(()=>{const i=r.current;if(i)return h2(i)},[]),u.jsx(k2,{...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())})}),j7=b.forwardRef((t,e)=>{const n=Ss(cl,t.__scopeDialog),r=b.useRef(!1),s=b.useRef(!1);return u.jsx(k2,{...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()}})}),k2=b.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Ss(cl,n),l=b.useRef(null),c=Ue(e,l);return s2(),u.jsxs(u.Fragment,{children:[u.jsx(Hk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:u.jsx($h,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Jk(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(M7,{titleId:a.titleId}),u.jsx(P7,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Kk="DialogTitle",S2=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ss(Kk,n);return u.jsx(Ee.h2,{id:s.titleId,...r,ref:e})});S2.displayName=Kk;var E2="DialogDescription",C2=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ss(E2,n);return u.jsx(Ee.p,{id:s.descriptionId,...r,ref:e})});C2.displayName=E2;var N2="DialogClose",_2=b.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ss(N2,n);return u.jsx(Ee.button,{type:"button",...r,ref:e,onClick:ge(t.onClick,()=>s.onOpenChange(!1))})});_2.displayName=N2;function Jk(t){return t?"open":"closed"}var T2="DialogTitleWarning",[R7,A2]=p3(T2,{contentName:cl,titleName:Kk,docsSlug:"dialog"}),M7=({titleId:t})=>{const e=A2(T2),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
521
522If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
523
524For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return b.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},O7="DialogDescriptionWarning",P7=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${A2(O7).contentName}}.`;return b.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},j2=m2,R2=y2,M2=x2,Qk=b2,Yk=w2,Zk=S2,Xk=C2,e1=_2;const I7=j2,D7=R2,L7=M2,O2=b.forwardRef(({className:t,...e},n)=>u.jsx(Qk,{ref:n,className:Z("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}));O2.displayName=Qk.displayName;const P2=b.forwardRef(({className:t,children:e,...n},r)=>u.jsxs(L7,{children:[u.jsx(O2,{}),u.jsxs(Yk,{ref:r,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,u.jsxs(e1,{className:"absolute right-4 top-4 roun
524ded-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:[u.jsx(vR,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));P2.displayName=Yk.displayName;const I2=({className:t,...e})=>u.jsx("div",{className:Z("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});I2.displayName="DialogHeader";const D2=b.forwardRef(({className:t,...e},n)=>u.jsx(Zk,{ref:n,className:Z("text-lg font-semibold leading-none tracking-tight",t),...e}));D2.displayName=Zk.displayName;const z7=b.forwardRef(({className:t,...e},n)=>u.jsx(Xk,{ref:n,className:Z("text-sm text-muted-foreground",t),...e}));z7.displayName=Xk.displayName;const Tn=b.forwardRef(({className:t,type:e,...n},r)=>u.jsx("input",{type:e,className:Z("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Tn.displayName="Input";const fc=b.forwardRef(({className:t,...e},n)=>u.jsx("textarea",{className:Z("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
524ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));fc.displayName="Textarea";var $7="Label",L2=b.forwardRef((t,e)=>u.jsx(Ee.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())}}));L2.displayName=$7;var z2=L2;const F7=Bh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ot=b.forwardRef(({className:t,...e},n)=>u.jsx(z2,{ref:n,className:Z(F7(),t),...e}));ot.displayName=z2.displayName;const B7=OK({message:zl().trim().min(1,"Bitte Nachricht eingeben").max(5e3,"Nachricht zu lang"),first_name:zl().trim().min(1,"Bitte Vorname eingeben").max(100,"Vorname zu lang"),last_name:zl().trim().min(1,"Bitte Nachname eingeben").max(100,"Nachname zu lang"),email:zl().trim().email("Ungültige E-Mail-Adresse").max(255,"E-Mail zu lang"),phone:zl().trim().max(50,"Telefonnummer zu lang").optional(),website:zl().optional()}),q7=({moduleId:t,children:e})=>{const[n,r]=b.useState(!1),[s,i]=b.useState(!1),{register:o,handleSubmit:a,reset:l,formState:{errors:c}}=nK({resolver:oK(B7)}),d=async h=>{if(h.website&&h.website.trim()!==""){r(!1),l();return}i(!0);try{const f={module_id:t,url:window.location.href,message:h.message,first_name:h.first_name,last_name:h.last_name,email:h.email,phone:h.phone||"",website:h.website||""},{error:p}=await We.functions.invoke("training-feedback",{body:f});if(p)throw p;lb({title:"Feedback gesendet",description:"Vielen Dank für deine Rückmeldung!"}),r(!1),l()}catch(f){console.error("Error sending feedback:",f),lb({title:"Fehler",description:"Feedback konnte nicht gesendet werden. Bitte versuche es später erneut.",variant:"destructive"})}finally{i(!1)}};return u.jsxs(I7,{open:n,onOpenChange:r,children:[u.jsx(D7,{asChild:!0,children:e}),u.jsxs(P2,{className:"sm:max-w-md",children:[u.jsx(I2,{children:u.jsx(D2,{children:"Fehler melden"})}),u.jsxs("form",{onSubmit:a(d),className:"space-y-4",children:[u.jsxs("div",{className:"absolute -left-[9999px]","aria-hidden":"true",children:[u.jsx(ot,{htmlFor:"website",children:"Website (leave empty)"}),u.jsx(Tn,{id:"website",...o("website"),tabIndex:-1,autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ot,{htmlFor:"message",children:"Was ist dir aufgefallen? *"}),u.jsx(fc,{id:"message",...o("message"),placeholder:"Beschreibe den Fehler oder dein Feedback...",className:"min-h-[100px]"}),c.message&&u.jsx("p",{className:"text-sm text-destructive",children:c.message.message})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ot,{htmlFor:"first_name",children:"Vorname *"}),u.jsx(Tn,{id:"first_name",...o("first_name"),placeholder:"Vorname"}),c.first_name&&u.jsx("p",{className:"text-sm text-destructive",children:c.first_name.message})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ot,{htmlFor:"last_name",children:"Nachname *"}),u.jsx(Tn,{id:"last_name",...o("last_name"),placeholder:"Nachname"}),c.last_name&&u.jsx("p",{className:"text-sm text-destructive",children:c.last_name.message})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ot,{htmlFor:"email",children:"E-Mail *"}),u.jsx(Tn,{id:"email",type:"email",...o("email"),placeholder:"[email protected]"}),c.email&&u.jsx("p",{className:"text-sm text-destructive",children:c.email.message})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ot,{htmlFor:"phone",children:"Telefon (optional)"}),u.jsx(Tn,{id:"phone",type:"tel",...o("phone"),placeholder:"+41 79 123 45 67"}),c.phone&&u.jsx("p",{className:"text-sm text-destructive",children:c.phone.message})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx(ve,{type:"button",variant:"outline",onClick:()=>r(!1),disabled:s,children:"Abbrechen"}),u.jsx(ve,{type:"submit",disabled:s,children:s?u.jsxs(u.Fragment,{children:[u.jsx(gs,{className:"w-4 h-4 mr-2 animate-spin"}),"Senden..."]}):"Senden"})]})]})]})]})},AN=["Vorschlag für dich","Schau dir das an","Hilfreich für dich","Magst du mehr wissen"],U7={argument:{shortLabel:"Argument",icon:yu,badgeClass:"bg-primary/10 text-primary"},situation:{shortLabel:"Gespräch",icon:Ks,badgeClass:"bg-accent/20 text-accent-foreground"},grundlagen:{shortLabel:"Grundlagen",icon:bl,badgeClass:"bg-muted text-muted-foreground"}},V7=(t,e)=>{const n=t.match(/arg-a(\d+)/i),r=t.match(/sit-/i),s=t.match(/grund-/i),i="03";return n?`A${n[1].padStart(2,"0")}-${i}`:r?`S${{"sit-familie":"01","sit-arbeit":"02","sit-freunde":"03","sit-nachbarschaft":"04","sit-kita":"
52405","sit-bushaltestelle":"06","sit-universitaet":"07"}[t]||"00"}-${i}`:s?`G${{"grund-90sek":"01","grund-service":"02","grund-demokratie":"03","grund-ausgewogen":"04","grund-europa":"05","grund-bundesrat":"06"}[t]||"00"}-${i}`:t.toUpperCase()},t1=({ratings:t,onRatingChange:e,currentModuleId:n,completedModules:r,onNavigateToModule:s,onNavigateWithCompletion:i})=>{const{stats:o}=Bg(),[a]=b.useState(()=>AN[Math.floor(Math.random()*AN.length)]),l="https://nein-zur-halbierungs-initiative.community/participer",c=b.useMemo(()=>{const f=[...ki.arguments.map(w=>{const k=il.find(S=>S.id===w.id);return{id:w.id,type:"argument",title:w.title,trigger:(k==null?void 0:k.trigger)||"",available:w.available}}),...ki.situations.map(w=>{const k=ol.find(S=>S.id===w.id);return{id:w.id,type:"situation",title:w.title,trigger:(k==null?void 0:k.trigger)||"",available:w.available}}),...ki.grundlagen.map(w=>{var S,E;const k=al.find(C=>C.id===w.id);return{id:w.id,type:"grundlagen",title:w.title,trigger:((E=(S=k==null?void 0:k.hilftDir)==null?void 0:S.triggers)==null?void 0:E[0])||"",available:w.available}})].filter(w=>w.available&&w.id!==n&&!r.includes(w.id)),p=f.filter(w=>w.type==="situation"),g=f.filter(w=>w.type!=="situation"),m=[...p].sort(()=>Math.random()-.5),y=[...g].sort(()=>Math.random()-.5),v=[];m.length>0&&v.push(m[0]);const x=3-v.length;return v.push(...y.slice(0,x)),v.length<3&&m.length>1&&v.push(...m.slice(1,4-v.length)),v.sort(()=>Math.random()-.5)},[n,r]),d=h=>{i?i(h.title,h.type):s==null||s(h.title,h.type)};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"bg-muted/30 rounded-xl p-5 space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"flex justify-center gap-1",children:[1,2,3,4,5].map(h=>u.jsx("button",{onClick:()=>e("nuetzlich",h),className:"p-1.5 hover:scale-110 transition-transform",children:u.jsx(jg,{className:Z("w-6 h-6 transition-colors",h<=(t.nuetzlich||0)?"fill-yellow-400 text-yellow-400":"text-muted-foreground/30")})},h))}),u.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Deine Bewertung"}),u.jsx(q7,{moduleId:n,children:u.jsx("button",{className:"text-xs text-muted-foreground/70 hover:text-primary underline transition-colors block mx-auto mt-1",children:"Fehler? Sag's uns!"})})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(qo,{className:"w-4 h-4 text-primary flex-shrink-0"}),u.jsx("span",{className:"font-medium",children:"Mit wie vielen Menschen sprichst du?"})]}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsx(ve,{variant:"outline",size:"sm",asChild:!0,className:"hover:bg-primary hover:text-primary-foreground border-primary/30",children:u.jsx("a",{href:`${l}?n=3`,target:"_blank",rel:"noopener noreferrer",children:"3 Gespräche"})}),u.jsx(ve,{variant:"outline",size:"sm",asChild:!0,className:"hover:bg-primary hover:text-primary-foreground border-primary/30",children:u.jsx("a",{href:`${l}?n=5`,target:"_blank",rel:"noopener noreferrer",children:"5 Gespräche"})}),u.jsx(ve,{variant:"outline",size:"sm",asChild:!0,className:"hover:bg-primary hover:text-primary-foreground border-primary/30",children:u.jsx("a",{href:`${l}?n=10`,target:"_blank",rel:"noopener noreferrer",children:"10 Gespräche"})})]}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Bereits ",u.jsx("span",{className:"font-semibold text-foreground",children:o.committed_count.toLocaleString("de-CH")})," zugesagte Gespräche"]})]})]}),c.length>0&&u.jsxs("div",{className:"space-y-3 px-5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(mR,{className:"w-4 h-4 text-primary"}),u.jsx("span",{className:"font-medium",children:a})]}),u.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:c.map(h=>{const f=U7[h.type],p=f.icon,g=r.includes(h.id);return u.jsxs("button",{onClick:()=>d(h),className:Z("group text-left bg-card rounded-xl border p-4 transition-all relative","hover:border-primary/50 hover:shadow-md cursor-pointer",g?"border-primary/30 bg-primary/5":"border-border"),children:[u.jsx("span",{className:"absolute top-3 right-3 text-xs text-muted-foreground
524/60 font-mono",children:V7(h.id,h.type)}),g&&u.jsx("div",{className:"absolute top-3 right-10",children:u.jsx(eh,{className:"w-4 h-4 text-primary"})}),u.jsx("div",{className:"flex items-center justify-between mb-2",children:u.jsxs("span",{className:Z("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium",f.badgeClass),children:[u.jsx(p,{className:"w-3.5 h-3.5"}),f.shortLabel]})}),u.jsx("h3",{className:"font-semibold text-foreground mb-1 text-sm group-hover:text-primary transition-colors",children:h.title}),h.trigger&&u.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 mb-2",children:h.trigger}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Bo,{className:"w-3 h-3"}),h.type==="situation"?"3 Min.":"2 Min."]}),u.jsxs("span",{className:"flex items-center gap-1 text-primary group-hover:translate-x-1 transition-transform",children:["Starten",u.jsx(Pt,{className:"w-3 h-3"})]})]})]},h.id)})})]})]})},H7=({module:t,onBack:e,onNavigateToModule:n,completedModules:r=[]})=>{const s=t.coachingHints&&t.coachingHints.length>0,i=t.questions&&t.questions.length>0,o=t.worumEsGeht.points.length>0,a=t.gespraechsantworten.length>0,c=(()=>{const A=["situation"];return o&&A.push("worum"),a&&A.push("antworten"),s?A.push("coaching1","coaching2"):i&&A.push("question1","question2"),A.push("einordnung","congrats","abschluss"),A})(),[d,h]=b.useState(c[0]),[f,p]=b.useState({}),[g,m]=b.useState({}),[y,v]=b.useState({wichtig:0,korrekt:0,nuetzlich:0});b.useEffect(()=>{Ak(t.id,"argument")},[t.id]),b.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[d]);const x=()=>{const A=y.wichtig>0||y.korrekt>0||y.nuetzlich>0;wi(t.id,"argument",A?{important:y.wichtig,correct:y.korrekt,useful:y.nuetzlich}:void 0),e(!0)},w=c.indexOf(d),k=()=>{if(w<c.length-1){if(d==="congrats"){const A=y.wichtig>0||y.korrekt>0||y.nuetzlich>0;wi(t.id,"argument",A?{important:y.wichtig,correct:y.korrekt,useful:y.nuetzlich}:void 0)}h(c[w+1])}},S=(A,L)=>{const I=y.wichtig>0||y.korrekt>0||y.nuetzlich>0;wi(t.id,"argument",I?{important:y.wichtig,correct:y.korrekt,useful:y.nuetzlich}:void 0),n==null||n(A,L)},E=()=>{w>0&&h(c[w-1])},C=()=>{var A;return d==="question1"&&i?f[0]!==void 0:d==="question2"&&i&&((A=t.questions)!=null&&A[1])?f[1]!==void 0:!0},N=(A,L)=>{p(I=>({...I,[A]:L})),m(I=>({...I,[A]:!0}))},T=A=>{switch(A){case"good":return"Wirksam";case"neutral":return"Situationsabhängig";case"poor":return"Eher schwierig"}},M=A=>{if(!t.questions||!t.questions[A])return null;const L=t.questions[A],I=f[A],U=g[A];return u.jsxs("div",{className:"space-y-4 md:space-y-5",children:[L.context&&u.jsxs("div",{className:"bg-muted/50 rounded-lg p-3 md:p-4 border-l-4 border-muted-foreground/30",children:[u.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mb-1",children:L.context}),u.jsx("p",{className:"text-base md:text-lg font-medium italic",children:L.question})]}),!L.context&&u.jsx("h3",{className:"text-base md:text-lg font-semibold",children:L.question}),u.jsx("div",{className:"space-y-2",children:L.options.map((B,J)=>{const P=I===J,z=T(B.quality);return u.jsxs("button",{onClick:()=>
524N(A,J),className:Z("w-full text-left p-3 md:p-4 rounded-lg border transition-all",P?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/30"),children:[u.jsx("p",{className:"italic text-sm md:text-base leading-relaxed",children:B.text}),P&&U&&u.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50",children:[u.jsx("p",{className:"text-sm font-medium mb-1",children:z}),u.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:B.einordnung})]})]},B.id)})}),u.jsx("p",{className:"text-xs text-muted-foreground text-center pt-2",children:"Wähle eine Antwort – es gibt kein «richtig» oder «falsch»."})]})},D=A=>{if(!t.coachingHints||!t.coachingHints[A])return null;const L=t.coachingHints[A];return u.jsxs("div",{className:"space-y-4",children:[u.jsx("h3",{className:"font-semibold text-sm md:text-base",children:L.title}),L.optionHints&&L.optionHints.length>0&&u.jsx("div",{className:"space-y-2",children:L.optionHints.map((I,U)=>u.jsxs("div",{className:"flex items-start gap-3 p-3 bg-muted/30 rounded-lg",children:[u.jsx(Sd,{variant:"outline",className:"text-xs shrink-0",children:I.label}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:["→ ",I.hint]})]},U))}),L.situationalTips&&L.situationalTips.length>0&&u.jsx("div",{className:"space-y-3",children:L.situationalTips.map((I,U)=>u.jsxs("div",{className:"p-3 bg-muted/30 rounded-lg",children:[u.jsxs("p",{className:"text-sm font-medium mb-1",children:[I.condition,":"]}),u.jsx("p",{className:"text-sm text-muted-foreground",children:I.tip})]},U))}),L.note&&u.jsx("p",{className:"text-sm text-muted-foreground italic pt-2 border-t",children:L.note})]})};return u.jsxs("div",{className:"max-w-2xl mx-auto",children:[u.jsx("div",{className:"flex items-center gap-1 mb-4",children:c.map((A,L)=>u.jsx("div",{className:Z("h-1.5 flex-1 rounded-full transition-colors",L<=w?"bg-primary":"bg-muted")},A))}),u.jsxs("div",{className:"flex items-center gap-2 mb-4 md:mb-6",children:[u.jsx(Sd,{variant:"secondary",children:"Argument"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:t.title})]}),u.jsx(qa,{className:"mb-6",children:u.jsxs(Ua,{className:"p-4 md:p-6",children:[d==="situation"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-primary mb-2",children:[u.jsx(Jp,{className:"w-5 h-5"}),u.jsx("span",{className:"font-medium text-sm uppercase tracking-wide",children:"Im Gespräch"})]}),u.jsx("blockquote",{className:"text-lg md:text-xl font-medium italic border-l-4 border-primary pl-4 py-2",children:t.trigger}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Wie gehst du damit um?"})]}),d==="worum"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-primary mb-2",children:[u.jsx(mR,{className:"w-5 h-5"}),u.jsx("span",{className:"font-medium text-sm uppercase tracking-wide",children:"Dahinter steckt oft"})]}),u.jsx("ul",{className:"space-y-2",children:t.worumEsGeht.points.slice(0,3).map((A,L)=>u.jsxs("li",{className:"flex items-start gap-2 text-sm md:text-base",children:[u.jsx("span",{className:"text-primary font-bold mt-0.5",children:"•"}),u.jsx("span",{children:A})]},L))}),u.jsx("p",{className:"text-sm font-medium text-foreground pt-2 border-t",children:t.worumEsGeht.outro})]}),d==="antworten"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold mb-1 text-sm md:text-base",children:"Was du sagen kannst"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Du musst keine Zahlen herunterbeten. Eine ruhige Einordnung reicht oft."})]}),u.jsx("div",{className:"space-y-2",children:t.gespraechsantworten.map((A,L)=>u.jsxs("div",{className:"bg-muted/30 rounded-lg p-3 md:p-4 border",children:[u.jsx(Sd,{variant:"outline",className:"mb-2 text-xs",children:A.label}),u.jsxs("p",{className:"italic text-sm md:text-base leading-relaxed",children:["«",A.text,"»"]})]},L))})]}),d==="coaching1"&&D(0),d==="coaching2"&&D(1),d==="question1"&&M(0),d==="question2"&&M(1),d==="einordnung"&&t.einordnung&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-primary mb-2",children:[u.jsx(kF,{className:"w-5 h-5"}),u.jsx("span",{className:"font-medium text-sm uppercase tracking-wide",children:t.einordnung.title})]}),u.jsx("ul",{className:"space-y-2",children:t.einordnung.points.slice(0,5).map((A,L)=>u.jsxs("li",{className:"flex items-start gap-2 text-sm md:text-base",children:[u.jsx("span",{className:"text-primary font-bold mt-0.5",children:"•"}),u.jsx("span",{children:A})]},L))}),t.einordnung.fazit&&u.jsx("div",{className:"bg-primary/5 rounded-lg p-3 border border-primary/20 mt-3",children:u.jsx("p",{className:"font-medium text-sm md:text-base",children:t.einordnung.fazit})})]}),d==="congrats"&&u.jsx(zk,{}),d==="abschluss"&&u.jsx(t1,{ratings:y,onRatingChange:(A,L)=>v(I=>({...I,[A]:L})),currentModuleId:t.id,completedModules:r,onNavigateToModule:n,onNavigateWithCompletion:S})]})}),d==="abschluss"&&u.jsx("div",{className:"mt-8 py-4 border-t",children:u.jsxs("div",{className:"flex justify-between items-center gap-2",children:[u.jsxs(ve,{variant:"outline",className:"h-11 gap-1",onClick:E,children:[u.jsx(Gs,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Zurück"})]}),u.jsxs(ve,{variant:"ghost",className:"h-11 gap-1 text-muted-foreground",onClick:()=>e(),children:[u.jsx(Zc,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Alle Trainings"})]}),u.jsx(ve,{onClick:x,className:"h-11 gap-1",children:"Fertig"})]})}),d==="abschluss"&&u.jsx("div",{className:"mt-8",children:u.jsx(Gn,{})}),d!=="abschluss"&&u.jsxs("div",{className:"flex justify-between items-center gap-2 mt-6",children:[u.jsxs(ve,{variant:"outline",onClick:()=>w===0?e():E(),className:"h-11 gap-1",children:[u.jsx(Gs,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Zurück"})]}),u.jsxs(ve,{variant:"ghost",onClick:()=>e(),className:"h-11 gap-1 text-muted-foreground",children:[u.jsx(Zc,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Alle Trainings"})]}),u.jsxs(ve,{onClick:k,className:"h-11 gap-1",disabled:!C(),children:[u.jsx("span",{className:"hidden sm:inline",children:"Weiter"}),u.jsx(Pt,{className:"w-4 h-4"})]})]})]})},W7=({module:t,onBack:e,onNavigateToModule:n,completedModules:r=[]})=>{t.dialogSteps.length;const s=["ausgangslage",...t.dialogSteps.map((k,S)=>`dialog${S+1}`),"beobachtung","congrats","abschluss"],[i,o]=b.useState(s[0]),[a,l]=b.useState({}),[c,d]=b.useState({wichtig:0,korrekt:0,nuetzlich:0});b.useEffect(()=>{Ak(t.id,"situation")},[t.id]),b.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[i]);const h=()=>{const k=c.wichtig>0||c.korrekt>0||c.nuetzlich>0;wi(t.id,"situation",k?{important:c.wichtig,correct:c.korrekt,useful:c.nuetzlich}:void 0),e(!0)},f=s.indexOf(i),p=()=>
524{if(f<s.length-1){if(i==="congrats"){const k=c.wichtig>0||c.korrekt>0||c.nuetzlich>0;wi(t.id,"situation",k?{important:c.wichtig,correct:c.korrekt,useful:c.nuetzlich}:void 0)}o(s[f+1])}},g=(k,S)=>{const E=c.wichtig>0||c.korrekt>0||c.nuetzlich>0;wi(t.id,"situation",E?{important:c.wichtig,correct:c.korrekt,useful:c.nuetzlich}:void 0),n==null||n(k,S)},m=()=>{f>0&&o(s[f-1])},y=(k,S)=>{l(E=>({...E,[k]:S}))},v=k=>{const S=t.dialogSteps[k],E=a[k];return S.variants.find(C=>C.id===E),u.jsxs("div",{className:"space-y-5",children:[S.sceneIntro&&u.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-2",children:[u.jsx(Jp,{className:"w-4 h-4"}),u.jsx("span",{className:"text-sm",children:S.sceneIntro})]}),u.jsx("div",{className:"bg-muted/50 rounded-lg p-4 border-l-4 border-primary/50",children:u.jsx("p",{className:"text-base md:text-lg font-medium italic leading-relaxed",children:S.question})}),S.sceneOutro&&u.jsx("p",{className:"text-sm text-muted-foreground",children:S.sceneOutro}),S.stepLabel&&S.stepLabel!==S.question&&u.jsx("p",{className:"text-sm font-medium",children:S.stepLabel}),u.jsx("div",{className:"space-y-3",children:S.variants.map((C,N)=>{const T=E===C.id,M=C.label?`Variante ${N===0?"A":"B"} – ${C.label}`:`Variante ${N===0?"A":"B"}`;return u.jsxs("button",{onClick:()=>y(k,C.id),className:Z("w-full text-left p-4 rounded-lg border transition-all",T?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/30"),children:[u.jsx("div",{className:"flex items-start gap-3",children:u.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0 pt-0.5",children:M})}),u.jsx("p",{className:"italic text-sm md:text-base leading-relaxed mt-2",children:C.text}),T&&u.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50 flex items-start gap-2",children:[u.jsx(Pt,{className:"w-4 h-4 text-primary shrink-0 mt-0.5"}),u.jsx("p",{className:"text-sm text-muted-foreground italic",children:C.consequence})]})]},C.id)})})]})},x=()=>{if(i==="ausgangslage")return u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[u.jsx(Ks,{className:"w-4 h-4"}),u.jsx("span",{className:"text-sm",children:"Szene 1 – Einstieg"})]}),u.jsx("p",{className:"text-sm md:text-base text-muted-foreground leading-relaxed",children:t.setting}),u.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 md:p-5 border-l-4 border-primary/50",children:[t.triggerContext&&u.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:t.triggerContext}),u.jsx("p",{className:"text-base md:text-lg font-medium italic leading-relaxed",children:t.trigger})]}),t.triggerOutro&&u.jsx("p",{className:"text-sm text-muted-foreground",children:t.triggerOutro})]});if(i.startsWith("dialog")){const k=parseInt(i.replace("dialog",""))-1;return v(k)}return i==="beobachtung"?u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[u.jsx(Ks,{className:"w-4 h-4"}),u.jsx("span",{className:"text-sm",children:"Beobachtung"})]}),t.beobachtung.intro&&u.jsx("p",{className:"text-sm text-muted-foreground",children:t.beobachtung.intro}),t.beobachtung.points.length>0&&u.jsx("ul",{className:"space-y-2",children:t.beobachtung.points.map((k,S)=>u.jsxs("li",{className:"flex items-start gap-3 text-sm md:text-base",children:[u.jsx(Jw,{className:"w-4 h-4 text-primary shrink-0 mt-1"}),u.jsx("span",{children:k})]},S))}),u.jsx("p",{className:"text-sm md:text-base text-muted-foreground leading-relaxed",children:t.beobachtung.outro}),t.abschlussStory&&u.jsxs("div",{className:"pt-4 border-t space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[u.jsx(Jp,{className:"w-4 h-4"}),u.jsx("span",{className:"text-sm font-medium",children:"Später am Abend"})]}),u.jsx("p",{className:"text-sm md:text-base text-muted-foreground leading-relaxed",children:t.abschlussStory.intro}),u.jsx("div",{className:"bg-muted/50 rounded-lg p-4 border-l-4 border-primary/50",children:u.jsx("p",{className:"text-base md:text-lg font-medium italic leading-relaxed",children:t.abschlussStory.message})}),u.jsx("p",{className:"text-sm md:text-base text-muted-foreground leading-relaxed",children:t.abschlussStory.outro})]})]}):i==="congrats"?u.jsx(zk,{}):i==="abschluss"?u.jsx(t1,{ratings:c,onRatingChange:(k,S)=>d(E=>({...E,[k]:S})),currentModuleId:t.id,completedModules:r,onNavigateToModule:n,onNavigateWithCompletion:g}):null},w=()=>
524{if(i.startsWith("dialog")){const k=parseInt(i.replace("dialog",""))-1;return!!a[k]}return!0};return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"md:sticky md:top-0 z-10 bg-background/95 backdrop-blur border-b",children:u.jsxs("div",{className:"container max-w-2xl mx-auto px-4 py-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Sd,{variant:"secondary",className:"text-xs",children:"Situation"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:t.title})]}),u.jsxs("span",{className:"text-sm text-muted-foreground",children:[f+1," / ",s.length]})]}),u.jsx("div",{className:"mt-2 h-1 bg-muted rounded-full overflow-hidden",children:u.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${(f+1)/s.length*100}%`}})})]})}),u.jsxs("div",{className:"container max-w-2xl mx-auto px-4 py-6 md:py-8",children:[u.jsx(qa,{className:"border-0 shadow-none bg-transparent",children:u.jsx(Ua,{className:"p-0",children:u.jsx("div",{className:"min-h-[300px]",children:x()})})}),i==="abschluss"&&u.jsx("div",{className:"mt-8 py-4 border-t",children:u.jsxs("div",{className:"flex justify-between items-center gap-2",children:[u.jsxs(ve,{variant:"outline",className:"h-11 gap-1",onClick:m,children:[u.jsx(Gs,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Zurück"})]}),u.jsxs(ve,{variant:"ghost",className:"h-11 gap-1 text-muted-foreground",onClick:()=>e(),children:[u.jsx(Zc,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Alle Trainings"})]}),u.jsx(ve,{className:"h-11 gap-1",onClick:h,children:"Fertig"})]})}),i==="abschluss"&&u.jsx("div",{className:"mt-8",children:u.jsx(Gn,{})})]}),i!=="abschluss"&&u.jsx("div",{className:"md:sticky md:bottom-0 bg-background/95 backdrop-blur border-t mt-6 md:mt-0",children:u.jsx("div",{className:"container max-w-2xl mx-auto px-4 py-3",children:u.jsxs("div",{className:"flex justify-between items-center gap-2",children:[u.jsxs(ve,{variant:"outline",className:"h-11 gap-1",onClick:()=>f===0?e():m(),children:[u.jsx(Gs,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Zurück"})]}),u.jsxs(ve,{variant:"ghost",className:"h-11 gap-1 text-muted-foreground",onClick:()=>e(),children:[u.jsx(Zc,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Alle Trainings"})]}),u.jsxs(ve,{className:"h-11 gap-1",onClick:p,disabled:!w(),children:[u.jsx("span",{className:"hidden sm:inline",children:"Weiter"}),u.jsx(Pt,{className:"w-4 h-4"})]})]})})})]})},jN=["Guter Gedanke – aber nicht ganz.","Nachvollziehbar – trifft es aber nicht ganz.","Verständlich gedacht – stimmt aber so nicht.","Interessanter Ansatz – hier liegt es etwas anders.","Klingt plausibel – ist aber nicht ganz richtig.","Fast – aber nicht ganz.","Auf dem richtigen Weg – aber nicht die beste Antwort."],RN=()=>{const t=Math.floor(Math.random()*jN.length);return jN[t]},G7=({module:t,onBack:e,onNavigateToModule:n,completedModules:r=[]})=>{t.teile.length;const s=t.quizQuestions.length,i=["hilftDir",...t.teile.map((T,M)=>`teil${M+1}`),...s>0?["quizIntro"]:[],...t.quizQuestions.map((T,M)=>`quiz${M+1}`),"congrats","abschluss"],[o,a]=b.useState(i[0]),[l,c]=b.useState({}),[d,h]=b.useState({}),[f,p]=b.useState({wichtig:0,korrekt:0,nuetzlich:0});b.useEffect(()=>{Ak(t.id,"grundlagen")},[t.id]),b.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[o]);const g=()=>{const T=f.wichtig>0||f.korrekt>0||f.nuetzlich>0;wi(t.id,"grundlagen",T?{important:f.wichtig,correct:f.korrekt,useful:f.nuetzlich}:void 0),e(!0)},m=i.indexOf(o),y=()=>{if(m<i.length-1){if(o==="congrats"){const T=f.wichtig>0||f.korrekt>0||f.nuetzlich>0;wi(t.id,"grundlagen",T?{important:f.wichtig,correct:f.korrekt,useful:f.nuetzlich}:void 0)}a(i[m+1])}},v=(T,M)=>{const D=f.wichtig>0||f.korrekt>0||f.nuetzlich>0;wi(t.id,"grundlagen",D?{important:f.wichtig,correct:f.korrekt,useful:f.nuetzlich}:void 0),n==null||n(T,M)},x=()=>{m>0&&a(i[m-1])},w=()=>
524{if(o.startsWith("quiz")&&o!=="quizIntro"){const T=parseInt(o.replace("quiz",""))-1;return!!l[T]}return!0},k=(T,M)=>{c(D=>({...D,[T]:M})),d[T]||h(D=>({...D,[T]:RN()}))},S=T=>T.split(/\*\*(.*?)\*\*/g).map((D,A)=>A%2===1?u.jsx("strong",{children:D},A):D),E=T=>{const M=t.teile[T];return u.jsxs("div",{className:"space-y-5",children:[u.jsx("h2",{className:"text-lg md:text-xl font-semibold",children:M.title}),M.intro&&u.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:S(M.intro)}),u.jsx("ul",{className:"space-y-2",children:M.points.map((D,A)=>u.jsxs("li",{className:"flex items-start gap-3 text-sm md:text-base",children:[u.jsx(Jw,{className:"w-4 h-4 text-primary shrink-0 mt-1"}),u.jsx("span",{children:S(D)})]},A))}),M.outro&&u.jsx("p",{className:"text-sm md:text-base leading-relaxed pt-2",children:S(M.outro)})]})},C=T=>{const M=t.quizQuestions[T],D=l[T];return M.options.find(A=>A.id===D),u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-2",children:[u.jsx(bl,{className:"w-4 h-4"}),u.jsxs("span",{className:"text-sm",children:["Quiz-Frage ",T+1]})]}),u.jsx("h2",{className:"text-lg md:text-xl font-semibold",children:M.question}),u.jsx("div",{className:"space-y-3",children:M.options.map(A=>{const L=D===A.id;return u.jsxs("button",{onClick:()=>k(T,A.id),className:Z("w-full text-left p-4 rounded-lg border transition-all",L?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/30"),children:[u.jsx("p",{className:"text-sm md:text-base",children:A.text}),L&&u.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50 flex items-start gap-2",children:[u.jsx(Pt,{className:"w-4 h-4 text-primary shrink-0 mt-0.5"}),u.jsxs("div",{className:"text-sm text-muted-foreground",children:[A.isCorrect&&u.jsx("span",{className:"font-medium text-primary block mb-1",children:"Genau richtig!"}),!A.isCorrect&&u.jsx("span",{className:"font-medium text-primary block mb-1",children:d[T]||RN()}),u.jsx("span",{children:A.einordnung})]})]})]},A.id)})})]})},N=()=>{if(o==="hilftDir")return u.jsxs("div",{className:"space-y-6",children:[u.jsx("p",{className:"text-base text-muted-foreground",children:t.hilftDir.intro}),u.jsx("ul",{className:"space-y-3",children:t.hilftDir.triggers.map((T,M)=>u.jsxs("li",{className:"flex items-start gap-3 text-base",children:[u.jsx("span",{className:"text-primary/70 shrink-0",children:"—"}),u.jsx("span",{className:"italic text-foreground/90",children:T})]},M))})]});if(o.startsWith("teil")){const T=parseInt(o.replace("teil",""))-1;return E(T)}if(o==="quizIntro")return u.jsxs("div",{className:"space-y-6 text-center py-8",children:[u.jsx("div",{className:"w-16 h-16 mx-auto bg-primary/10 rounded-full flex items-center justify-center",children:u.jsx(fF,{className:"w-8 h-8 text-primary"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("h2",{className:"text-xl md:text-2xl font-semibold",children:"Kurzes Quiz"}),u.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Lass uns jetzt dein Wissen testen. Bereit? Dann weiter!"})]})]});if(o.startsWith("quiz")){const T=parseInt(o.replace("quiz",""))-1;return C(T)}return o==="congrats"?u.jsx(zk,{}):o==="abschluss"?u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-sm md:text-base leading-relaxed",children:S(t.abschluss.text)}),t.abschluss.keyPoint&&u.jsx("div",{className:"bg-primary/5 rounded-lg p-4 border-l-4 border-primary",children:u.jsxs("p",{className:"text-sm md:text-base font-medium",children:["👉 ",t.abschluss.keyPoint]})})]}),u.jsx(t1,{ratings:f,onRatingChange:(T,M)=>p(D=>({...D,[T]:M})),currentModuleId:t.id,completedModules:r,onNavigateToModule:n,onNavigateWithCompletion:v})]}):null};return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"md:sticky md:top-0 z-10 bg-background/95 backdrop-blur border-b",children:u.jsxs("div",{className:"container max-w-2xl mx-auto px-4 py-3",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Sd,{variant:"secondary",className:"text-xs",children:"Grundlagen"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:t.title})]}),u.jsxs("span",{className:"text-sm text-muted-foreground",children:[m+1," / ",i.length]})]}),u.jsx("div",{className:"mt-2 h-1 bg-muted rounded-full overflow-hidden",children:u.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${(m+1)/i.length*100}%`}})})]})}),u.jsxs("div",{className:"container max-w-2xl mx-auto px-4 py-6 md:py-8",children:[u.jsx(qa,{className:"border-0 shadow-none bg-transparent",children:u.jsx(Ua,{className:"p-0",children:u.jsx("div",{className:"min-h-[300px]",children:N()})})}),o==="abschluss"&&u.jsx("div",{className:"mt-8 py-4 border-t",children:u.jsxs("div",{className:"flex justify-between items-center gap-2",children:[u.jsxs(ve,{variant:"outline",className:"h-11 gap-1",onClick:x,children:[u.jsx(Gs,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Zurück"})]}),u.jsxs(ve,{variant:"ghost",className:"h-11 gap-1 text-muted-foreground",onClick:()=>e(),children:[u.jsx(Zc,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Alle Trainings"})]}),u.jsx(ve,{className:"h-11 gap-1",onClick:g,children:"Fertig"})]})}),o==="abschluss"&&u.jsx("div",{className:"mt-8",children:u.jsx(Gn,{})})]}),o!=="abschluss"&&u.jsx("div",{className:"md:sticky md:bottom-0 bg-background/95 backdrop-blur border-t mt
524-6 md:mt-0",children:u.jsx("div",{className:"container max-w-2xl mx-auto px-4 py-3",children:u.jsxs("div",{className:"flex justify-between items-center gap-2",children:[u.jsxs(ve,{variant:"outline",className:"h-11 gap-1",onClick:()=>m===0?e():x(),children:[u.jsx(Gs,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Zurück"})]}),u.jsxs(ve,{variant:"ghost",className:"h-11 gap-1 text-muted-foreground",onClick:()=>e(),children:[u.jsx(Zc,{className:"w-4 h-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Alle Trainings"})]}),u.jsxs(ve,{className:"h-11 gap-1",onClick:y,disabled:!w(),children:[u.jsx("span",{className:"hidden sm:inline",children:"Weiter"}),u.jsx(Pt,{className:"w-4 h-4"})]})]})})})]})},MN="training2-completed-modules",K7=()=>{const t=ei(),[e]=zg(),[n,r]=b.useState("start"),[s,i]=b.useState(null),[o,a]=b.useState(()=>{const E=localStorage.getItem(MN);return E?JSON.parse(E):[]}),[l,c]=b.useState("all"),[d,h]=b.useState(null);b.useEffect(()=>{const E=t.state;E!=null&&E.moduleId&&(E!=null&&E.moduleType)?(i(E.moduleId),r(E.moduleType),window.history.replaceState({},document.title)):E!=null&&E.filterType&&(c(E.filterType),window.history.replaceState({},document.title))},[t.state]),b.useEffect(()=>{e.get("video")==="flavien"&&(h("bGyTMyphcSA"),setTimeout(()=>{const C=document.getElementById("video-flavien");C&&C.scrollIntoView({behavior:"smooth",block:"center"})},100))},[e]),b.useEffect(()=>{e.get("video")||window.scrollTo({top:0,behavior:"instant"})},[e]),b.useEffect(()=>{localStorage.setItem(MN,JSON.stringify(o))},[o]);const f=E=>{o.includes(E)||a(C=>[...C,E])},p=E=>{i(E),r("argument")},g=E=>{i(E),r("situation")},m=E=>{i(E),r("grundlagen")},y=E=>{E&&s&&f(s),r("start"),i(null)},v=b.useCallback((E,C)=>{s&&f(s);const N=R9(E,C);N&&(i(N.id),r(C))},[s]),x=il.find(E=>E.id===s),w=ol.find(E=>E.id===s),k=al.find(E=>E.id===s),S=n!=="start";return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{hideBackButton:S}),u.jsx("div",{className:"h-14 md:h-16"}),n==="start"&&u.jsx("section",{className:"bg-primary py-10 md:py-16",children:u.jsxs("div",{className:"container max-w-4xl mx-auto px-4 md:px-6 text-center",children:[u.jsx("div",{className:"inline-flex items-center gap-2 bg-yellow-400 text-yellow-900 px-4 py-2 text-xs font-bold mb-4 rotate-[-2deg] shadow-md border-2 border-yellow-500",children:"BETA-Version! Community-Testing läuft 👨🏻‍💻"}),u.jsx("h1",{className:"text-2xl md:text-4xl font-bold text-primary-foreground mb-4",children:"Gesprächstraining"}),u.jsx("p",{className:"text-primary-foreground/80 max-w-xl mx-auto",children:"Lerne, ruhig und überzeugend zu argumentieren."})]})}),u.jsx("section",{className:"py-8 md:py-12",children:u.jsxs("div",{className:"container max-w-4xl mx-auto px-4 md:px-6",children:[n==="start"&&u.jsx(M9,{onSelectArgument:p,onSelectSituation:g,onSelectGrundlage:m,completedModules:o,initialFilter:l,autoPlayVideoId:d}),n==="argument"&&x&&u.jsx(H7,{module:x,onBack:E=>y(E),onNavigateToModule:v,completedModules:o},s),n==="situation"&&w&&u.jsx(W7,{module:w,onBack:E=>y(E),onNavigateToModule:v,completedModules:o},s),n==="grundlagen"&&k&&u.jsx(G7,{module:k,onBack:E=>y(E),onNavigateToModule:v,completedModules:o},s)]})}),n==="start"&&u.jsx(Gn,{}),u.jsx(jn,{})]})},J7=()=>u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsx("section",{className:"pt-12 md:pt-16 pb-8 md:pb-12",children:u.jsxs("div",{className:"container max-w-3xl mx-auto px-4 md:px-6",children:[u.jsx("p",{className:"text-primary font-semibold text-sm uppercase tracking-wider mb-3",children:"Manifest"}),u.jsx("h1",{className:"font-sans text-3xl md:text-4xl lg:text-5xl font-bold text-foreground leading-tight",children:"Lebendige Demokratie braucht mehr SRG"}),u.jsx("p",{className:"text-muted-foreground italic mt-3",children:"(V1.3 27.01.2026)"})]})}),u.jsx("article",{className:"pb-12 md:pb-16",children:u.jsx("div",{className:"container max-w-3xl mx-auto px-4 md:px-6",children:u.jsxs("div",{className:"prose prose-lg max-w-none",children:[u.jsx("p",{className:"text-lg text-foreground leading-relaxed mb-6",children:"Am 8. März 2026 entscheiden wir gemeinsam darüber, wie wir uns informieren, wie wir miteinander diskutieren – und wie unsere direkte Demokratie in Zukunft funktioniert."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-6",children:"Die Halbierungs-Initiative will die Finanzierung der SRG radikal kürzen. Was als Entlastung verkauft wird, ist in Wahrheit ein Rückbau des medialen Service public. Die Folgen wären gravierend: weniger verlässliche Information, weniger Einordnung und eine geschwächte demokratische Meinungsbildung."}),u.jsxs("div",{className:"bg-muted/50 border border-border/50 rounded-xl p-6 md:p-8 my-8",children:[u.jsx("h3",{className:"font-sans text-lg md:text-xl font-semibold text-foreground mb-4",children:"Warum ein Manifest?"}),u.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Unser Manifest ist das Fundament unserer C
524ommunity-Kampagne gegen die Halbierungs-Initiative. Es ist kein fertiges Programm, sondern eine Basis für Austausch, Mobilisierung und Weiterentwicklung."})]}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-10",children:"Gerade jetzt braucht die Schweiz nicht weniger, sondern mehr SRG. Eine SRG, die regional verankert ist, digital präsent bleibt und offen ist für die Mitwirkung der Bevölkerung."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mt-10 mb-4",children:"Warum unsere Demokratie starke Medien braucht"}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Unsere direkte Demokratie lebt davon, dass wir uns eine fundierte Meinung bilden können. Dafür braucht es verlässliche Informationen, Einordnung und eine gemeinsame Öffentlichkeit."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Der mediale Service public ist mehr als Nachrichten. Information, Kultur, Bildung, Sport und Unterhaltung gehören zusammen. Das alles braucht es, um eine demokratische Gesellschaft zusammenzuhalten."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Gerade im Zeitalter von Desinformation ist auch Medienbildung zentral. Die SRG ordnet die Berichterstattung aktueller Ereignisse ein, entlarvt Fake News und macht Manipulation sichtbar."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-10",children:"Doch dieser Pfeiler gerät unter Druck. Regionale Medien verschwinden, Desinformation nimmt zu, Plattformen und Algorithmen prägen Debatten. In diesem Umfeld ist ein starker medialer Service public kein Luxus. Er ist demokratische Infrastruktur."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mt-10 mb-4",children:"Regionale Stärke – Demokratie braucht Nähe"}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Demokratische Meinungsbildung findet vor Ort statt: in Gemeinden, Regionen und Kantonen. Doch genau dort ist die Medienvielfalt besonders gefährdet. In vielen Regionen gibt es kaum noch unabhängige Berichterstattung oder nur noch einzelne Anbieter mit faktischem Meinungsmonopol. Das verengt Perspektiven und schwächt den politischen Diskurs."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Hier spielt die SRG eine zentrale Rolle. Formate wie das Regionaljournal oder Schweiz aktuell sorgen dafür, dass politische Entscheidungen, Konflikte und Entwicklungen aus den Regionen sichtbar bleiben – für alle. Sie schaffen Öffentlichkeit dort, wo sie sonst verschwinden würde."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-10",children:"Darum sagen wir klar: Der mediale Service public muss regi
524onal gestärkt werden. Nicht durch Zentralisierung, sondern durch journalistische Präsenz vor Ort. Nicht durch Sparlogik, sondern durch Investitionen in Qualität, Redaktionen und föderale Perspektiven. Eine Demokratie ohne regionale Öffentlichkeit verliert den Kontakt zur Lebensrealität der Bevölkerung."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mt-10 mb-4",children:"Digitalisierung – Service public dort, wo wir sind"}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Unsere Mediennutzung hat sich grundlegend verändert. Ein zukunftsfähiger Service public darf deshalb nicht von TV oder Radio her gedacht werden. Er muss kanalunabhängig sein."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Die SRG muss dort präsent sein, wo wir uns informieren – insbesondere auch für junge Menschen. Mit verständlichen, relevanten und teilbaren Formaten. Mit journalistischen Standards, die auch im digitalen Raum gelten."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-10",children:"Eine geschwächte SRG würde hier zurückfallen und das Feld anderen Akteuren überlassen, die oft auf Aufmerksamkeit und Polarisierung setzen."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mt-10 mb-4",children:"Demokratisierung – eine SRG «zu de Lüt»"}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Service public ist kein Einbahnmodell. Er lebt vom Vertrauen der Bevölkerung – und von ihrer Beteiligung. Viele von uns wollen mehr sein als reine News-Konsument:innen. Wir wollen mitdenken, mitreden, mitgestalten."}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-10",children:"Doch die heutigen Strukturen der SRG mit ihren vier Regionalgesellschaften sind dafür oft zu schwerfällig und zu distanziert. Wir brauchen eine SRG, die näher bei uns ist. Eine SRG, die stärker auf Rückkopplung setzt und zeitgemässe Beteiligung ermöglicht. Demokratisierung heisst dabei breite Verankerung in der Gesellschaft."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mt-10 mb-4",children:"Nicht aus Nostalgie, sondern für die Zukunft"}),u.jsx("p",{className:"text-muted-foreground leading-relaxed mb-4",children:"Darum sagen wir Nein zur Halbierungs-Initiative. Nicht aus Nostalgie, sondern aus Verantwortung für die Zukunft. Wir stehen für eine SRG, die regional präsent ist, digital denkt und demokratisch verankert bleibt. Für eine SRG, die Vielfalt sichtbar macht. Für eine SRG, die unsere direkte Demokratie stärkt."})]})})}),u.jsx(Gn,{}),u.jsx(jn,{})]}),Q7=()=>{const t=Oi();return b.useEffect(()=>{const e=document.createElement("script");e.src="https://tally.so/widgets/embed.js",e.async=!0,document.body.appendChild(e);const n=r=>{var s;((s=r.data)==null?void 0:s.event)==="Tally.FormSubmitted"&&t("/merci")};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n);const r=document.querySelector('script[src="https://tally.so/widgets/embed.js"]');r&&r.remove()}},[t]),u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsx("section",{className:"pt-8 md:pt-12 pb-4 md:pb-6",children:u.jsxs("div",{className:"container max-w-3xl mx-auto px-4 md:px-6",children:[u.jsx("p",{className:"text-primary font-semibold text-sm uppercase tracking-wider mb-2",children:"Manifeste 08.03.2026"}),u.jsx("h1",{className:"font-sans text-3xl md:text-4xl lg:text-5xl font-bold text-foreground leading-tight",children:"Une démocratie vivante a besoin d'une SSR forte"})]})}),u.jsx("article",{className:"pb-8 md:pb-12",children:u.jsx("div",{className:"container max-w-3xl mx-auto px-4 md:px-6",children:u.jsxs("div",{className:"prose prose-lg max-w-none [&_p]:leading-relaxed [&_p]:mb-3 [&_h2]:mt-6 [&_h2]:mb-2",children:[u.jsx("p",{className:"text-lg text-foreground",children:"La population a clairement rejeté l'initiative SSR. Cependant, une décision déterminante s'annonce déjà après la votation : le Conseil fédéral doit se prononcer sur la concession, et donc sur l'avenir de la SSR."}),u.jsx("p",{className:"text-foreground",children:"Et cette fois, nous n'attendons pas de nouvelles attaques ni de nouveaux programmes d'économies. Nous voulons une SSR présente dans les régions, ouverte sur le numérique et solidement ancrée dans la démocratie. La Suisse a besoin d'un service public qui protège et renforce notre démocratie directe."}),u.jsx("p",{className:"text-xl font-semibold text-foreground mt-6 mb-6",children:"Assez défendu. Voici ce que nous voulons 
524:"}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground",children:"1. Renforcer la démocratie directe"}),u.jsx("p",{className:"text-foreground",children:"La SSR est une infrastructure démocratique. Dans une démocratie directe, se forger une opinion suppose une information fiable, une analyse critique et un espace public partagé."}),u.jsx("p",{className:"text-foreground italic",children:"👉 La concession doit renforcer cette infrastructure, et non l'affaiblir."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground",children:"2. Renforcer le journalisme régional"}),u.jsx("p",{className:"text-foreground",children:"La démocratie se joue sur le terrain, dans les communes, les régions et les cantons. C'est là qu'il nous faut un journalisme indépendant et une diversité des médias."}),u.jsx("p",{className:"text-foreground italic",children:"👉 La concession doit garantir et renforcer la présence régionale."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground",children:"3. Un service public numérique"}),u.jsx("p",{className:"text-foreground",children:"Penser le service public uniquement à partir de la télévision et de la radio appartient au passé. La SSR doit être présente là où nous nous informons aujourd'hui : sur nos smartphones, sur les plateformes et dans les réseaux sociaux."}),u.jsx("p",{className:"text-foreground italic",children:"👉 La concession doit permettre un service public numérique fort."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground",children:"4. Les contenus de la SSR pour toutes et tous"}),u.jsx("p",{className:"text-foreground",children:"Nous finançons la SSR ensemble. Elle appartient donc à toutes et tous. Films, audio, transcriptions : ouverts, durables et gratuits."}),u.jsx("p",{className:"text-foreground",children:"Aujourd'hui, les grands groupes médiatiques ont plus facilement accès aux contenus de la SSR que les classes d'école. Ce n'est pas du service public."}),u.jsx("p",{className:"text-foreground italic",children:"👉 La concession doit garantir que tous les contenus de la SSR soient librement accessibles au public."}),u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground",children:"5. Démocratisons la SSR maintenant !"}),u.jsx("p",{className:"text-foreground",children:"La SSR est bien plus qu'une entreprise médiatique. C'est une infrastructure démocratique. Il faut donc renforcer la participation, améliorer la transparence et impliquer davantage la population."}),u.jsx("p",{className:"text-foreground italic",children:"👉 La concession doit encourager la création d'une nouvelle communauté SSR : un réseau national accessible à toutes et tous, composé de citoyen·ne·s qui réfléchissent, participent et contribuent."}),u.jsx("p",{className:"text-lg font-semibold text-foreground mt-6 mb-4",children:"Une démocratie vivante a besoin d'une SSR plus forte."}),u.jsx("div",{className:"mt-6 mb-4",children:u.jsxs("div",{className:"bg-card rounded-2xl border border-border/50 p-5 md:p-6 shadow-sm",children:[u.jsx("h3",{className:"font-sans text-lg md:text-xl font-semibold text-foreground mb-3",children:"👉 Participez ! Signez le manifeste maintenant."}),u.jsx("iframe",{"data-tally-src":"https://tally.so/embed/7R2XWR?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1",loading:"lazy",width:"100%",height:"200",frameBorder:"0",marginHeight:0,marginWidth:0,title:"Manifeste unterzeichnen"})]})}),u.jsxs("div",{className:"grid grid-cols-2 md:flex md:justify-center gap-2 md:gap-3 mt-3 mb-2",children:[u.jsxs("a",{href:"https://wa.me/?text=Manifeste%20pour%20une%20SSR%20forte%20%E2%80%93%20https%3A%2F%2Fnon-initiative-ssr.lovable.app%2Fmanifeste",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 rounded-full border border-border text-sm text-muted-foreground hover:text-foreground hover:border-foreground
524/30 transition-colors no-underline",children:[u.jsx(rv,{className:"w-4 h-4 shrink-0"}),"WhatsApp"]}),u.jsxs("a",{href:"https://t.me/share/url?url=https%3A%2F%2Fnon-initiative-ssr.lovable.app%2Fmanifeste&text=Manifeste%20pour%20une%20SSR%20forte",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 rounded-full border border-border text-sm text-muted-foreground hover:text-foreground hover:border-foreground/30 transition-colors no-underline",children:[u.jsx(rv,{className:"w-4 h-4 shrink-0"}),"Telegram"]}),u.jsxs("a",{href:"https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fnon-initiative-ssr.lovable.app%2Fmanifeste",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 rounded-full border border-border text-sm text-muted-foreground hover:text-foreground hover:border-foreground/30 transition-colors no-underline",children:[u.jsx(rv,{className:"w-4 h-4 shrink-0"}),"Facebook"]}),u.jsxs("a",{href:"mailto:?subject=Manifeste%20pour%20une%20SSR%20forte&body=https%3A%2F%2Fnon-initiative-ssr.lovable.app%2Fmanifeste",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 rounded-full border border-border text-sm text-muted-foreground hover:text-foreground hover:border-foreground
524/30 transition-colors no-underline",children:[u.jsx(Yw,{className:"w-4 h-4 shrink-0"}),"E-mail"]})]})]})})}),u.jsx(Gn,{}),u.jsx(jn,{})]})},Y7="https://www.demokratie.ch/spende-gegen-srg-initiative?rnw-payment_type=onetime&rnw-amount=120&mtm_campaign=community_webseite_DE&mtm_source=form-button-front2",Z7=()=>{const[t]=zg(),[e,n]=b.useState("pending"),[r,s]=b.useState(""),i=b.useRef(!1),o=t.get("n")||"1",a=t.get("uid")||"";t.get("vorname");const l=parseInt(o,10)||1,c=`zusage_${o}_${a||"anon"}`;return b.useEffect(()=>{(async()=>{if(await new Promise(f=>setTimeout(f,500)),i.current)return;if(i.current=!0,r){console.log("Honeypot triggered, silently rejecting"),n("success");return}if(sessionStorage.getItem(c)){console.log("Commitment already submitted in this session, skipping API call"),n("success");return}if(l<1||l>50){console.error("Invalid talk_number:",l),n("error");return}try{const{data:f,error:p}=await We.functions.invoke("direct-commitment",{body:{talk_number:l,user_id:a||null}});if(p){console.error("Commitment submission error:",p),n("error");return}console.log("Commitment submitted successfully:",f),sessionStorage.setItem(c,"true"),n("success")}catch(f){console.error("Commitment submission exception:",f),n("error")}})()},[l,a,c,r]),u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"})," ",u.jsx("section",{className:"py-8 md:py-10 bg-gradient-to-b from-primary/5 to-background",children:u.jsxs("div",{className:"container-narrow text-center",children:[e==="pending"&&u.jsxs("div",{className:"flex flex-col items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 border-4 border-primary border-t-transparent rounded-full animate-spin"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Deine Zusage wird übermittelt..."})]}),e==="success"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-primary/10 mb-4",children:u.jsx(eh,{className:"w-6 h-6 text-primary"})}),u.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground mb-2",children:"Vielen Dank!"}),u.jsxs("p",{className:"text-base md:text-lg text-muted-foreground mb-4",children:["Du hast ",u.jsxs("span",{className:"font-semibold text-primary",children:[l," ",l===1?"Gespräch":"Gespräche"]})," zugesagt."]}),u.jsx("p",{className:"text-base md:text-lg font-medium text-foreground max-w-xl mx-auto leading-relaxed",children:"Gemeinsam schaffen wir 100'000 persönliche Gespräche – für ein Nein zur Halbierungs-Initiative am 8. März."})]}),e==="error"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-full bg-destructive/10 mb-4",children:u.jsx(hF,{className:"w-6 h-6 text-destructive"})}),u.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground mb-2",children:"Etwas ist schiefgelaufen"}),u.jsx("p",{className:"text-base text-muted-foreground mb-3",children:"Deine Zusage konnte leider nicht übermittelt werden."}),u.jsx(ve,{asChild:!0,variant:"outline",size:"sm",children:u.jsx("a",{href:"/participer#commitment",children:"Réessayer"})})]}),u.jsx("input",{type:"text",name:"website",value:r,onChange:d=>s(d.target.value),style:{position:"absolute",left:"-9999px",opacity:0,height:0,width:0,pointerEvents:"none"},tabIndex:-1,autoComplete:"off","aria-hidden":"true"})]})}),e==="success"&&u.jsx(Sk,{hideCta:!0,hideHeadline:!0}),e==="success"&&u.jsx("section",{className:"py-8 md:py-10",children:u.jsx("div",{className:"container-narrow",children:u.jsxs("div",{className:"max-w-lg mx-auto bg-card rounded-xl border border-border p-5 md:p-6 text-center shadow-sm",children:[u.jsx("div",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-rose-100 mb-3",children:u.jsx(qo,{className:"w-5 h-5 text-rose-600"})}),u.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-2",children:"Kampagne stärken – jetzt spenden!"}),u.jsx("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:"Mit deiner Spende ermöglichst du beispielsweise Materialien, Trainings und die Koordination der Gespräche."}),u.jsx(ve,{asChild:!0,className:"gap-2",children:u.jsxs("a",{href:Y7,target:"_blank",rel:"noopener noreferrer",children:[u.jsx(qo,{className:"w-4 h-4"}),"Jetzt spenden"]})})]})})}
524),e==="success"&&u.jsx(JM,{showCategoryHeader:!0,withBackground:!0}),u.jsx(jn,{})]})},X7=()=>u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("main",{className:"container max-w-4xl mx-auto px-4 md:px-6 py-16 md:py-24 text-center",children:[u.jsxs("h1",{className:"font-sans text-3xl md:text-4xl font-semibold text-foreground mb-4 flex flex-col md:flex-row items-center justify-center gap-2 md:gap-3",children:[u.jsx(qo,{className:"w-8 h-8 md:w-10 md:h-10 text-primary"}),"Merci d'avoir voté !"]}),u.jsx("p",{className:"text-muted-foreground text-base md:text-lg max-w-xl mx-auto mb-8",children:"Utilisez notre entraînement aux arguments pour convaincre encore plus de personnes de voter non à l'initiative SSR. Ensemble, nous gagnerons cette votation !"}),u.jsxs("a",{href:"https://nein-zur-halbierungs-initiative.community/training_fr",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 bg-accent text-accent-foreground px-6 md:px-8 py-2.5 md:py-3 rounded-full font-semibold text-sm md:text-base hover:scale-105 transition-all duration-300 shadow-elevated",children:["Tester les arguments",u.jsx(Pt,{className:"w-4 h-4"})]}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 max-w-2xl mx-auto mt-10",children:[u.jsxs("a",{href:"https://halbierungs-initiative-nein.lovable.app/training_fr?module=sit-nachbarschaft-fr",target:"_blank",rel:"noopener noreferrer",className:"group text-left bg-card rounded-xl border border-border p-4 transition-all hover:border-primary/50 hover:shadow-md",children:[u.jsx("div",{className:"flex items-center justify-between mb-2",children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-accent/20 text-accent-foreground",children:[u.jsx(Ks,{className:"w-3.5 h-3.5"}),"Conversation"]})}),u.jsx("h3",{className:"font-semibold text-sm text-foreground mb-1 group-hover:text-primary transition-colors",children:"Dans le quartier"}),u.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:"« C'est une question de solidarité. »"}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Bo,{className:"w-3 h-3"}),"3 min."]}),u.jsxs("span",{className:"flex items-center gap-1 text-primary group-hover:translate-x-1 transition-transform",children:["Commencer ",u.jsx(Pt,{className:"w-3 h-3"})]})]})]}),u.jsxs("a",{href:"https://halbierungs-initiative-nein.lovable.app/training_fr?module=grund-demokratie-fr",target:"_blank",rel:"noopener noreferrer",className:"group text-left bg-card rounded-xl border border-border p-4 transition-all hover:border-primary/50 hover:shadow-md",children:[u.jsx("div",{className:"flex items-center justify-between mb-2",children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium bg-muted text-muted-foreground",children:[u.jsx(bl,{className:"w-3.5 h-3.5"}),"Bases"]})}),u.jsx("h3",{className:"font-semibold text-sm text-foreground mb-1 group-hover:text-primary transition-colors",children:"SSR & démocratie"}),u.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:"Pourquoi la SSR est essentielle pour notre démocratie."}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(Bo,{className:"w-3 h-3"}),"2 min."]}),u.jsxs("span",{className:"flex items-center gap-1 text-primary group-hover:translate-x-1 transition-transform",children:["Commencer ",u.jsx(Pt,{className:"w-3 h-3"})]})]})]})]})]}),u.jsx(Sk,{headline:"Dernière ligne droite !",description:"Ensemble, nous mènerons 100 000 conversations personnelles pour un non à la dangereuse initiative SSR.",ctaText:"Je participe",ctaLink:"https://non-initiative-ssr.community/participer#commitment"}),u.jsx(jn,{})]}),eJ=({currentId:t,category:e})=>{const{data:n,isLoading:r}=mW(t,e);return r?u.jsx("section",{className:"py-12 border-t border-border",children:u.jsxs("div",{className:"container max-w-4xl mx-auto px-4",children:[u.jsx(Ye,{className:"h-8 w-48 mb-8"}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[1,2,3].map(s=>u.jsxs("div",{className:"rounded-xl overflow-hidden border border-border",children:[u.jsx(Ye,{className:"aspect-[16/9]"}),u.jsxs("div",{className:"p-4 space-y-2",children:[u.jsx(Ye,{className:"h-4 w-20"}),u.jsx(Ye,{className:"h-5 w-full"})]})]},s))})]})}):!n||n.length===0?null:u.jsx("section",{className:"py-12 border-t border-border bg-muted/20",children:u.jsxs("div",{className:"container max-w-4xl mx-auto px-4",children:[u.jsx("h2",{className:"font-sans text-xl md:text-2xl font-semibold text-foreground mb-8",children:"Weitere Beiträge"}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:n.map((s,i)=>s.homepage_style==="text"?u.jsx(Nk,{post:s,index:i},s.id):u.jsx(Ck,{post:s},s.id))})]})})},$2="https://halbierungs-initiative-nein.lovable.app",tJ=`${$2}/og-image.png?v=5`,nJ=()=>{const{slug:t}=yk(),{data:e,isLoading:n}=pW(t||"");if(n)return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("article",{className:"max-w-3xl mx-auto px-6 py-12 md:py-16",children:[u.jsx(Ye,{className:"h-4 w-20 mb-4"}),u.jsx(Ye,{className:"h-12 w-3/4 mb-4"}),u.jsx(Ye,{className:"h-6 w-full mb-12"}),u.jsx(Ye,{className:"w-16 h-px mb-12"}),u.jsxs("div",{className:"space-y-4",children:[u.jsx(Ye,{className:"h-4 w-full"}),u.jsx(Ye,{className:"h-4 w-full"}),u.jsx(Ye,{className:"h-4 w-3/4"})]})]})]});if(!e)return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsxs("div",{className:"max-w-3xl mx-auto px-6 py-16 text-center",children:[u.jsx("h1",{className:"font-sans text-2xl font-semibold text-foreground mb-4",children:"Beitrag nicht gefunden"}),u.jsx(Mt,{to:"/blog",className:"text-primary hover:underline",children:"Zurück zur Übersicht"})]})]});const r=e.title,s=e.excerpt||"Nein zur Halbierungs-Initiative",i=e.featured_image||tJ,o=`${$2}/blog/${e.slug}`;return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsxs(zj,{children:[u.jsxs("title",{children:[r," – Nein zur Halbierungs-Initiative"]}),u.jsx("meta",{name:"description",content:s}),u.jsx("meta",{property:"og:title",content:r}),u.jsx("meta",{property:"og:description",content:s}),u.jsx("meta",{property:"og:image",content:i}),u.jsx("meta",{property:"og:url",content:o}),u.jsx("meta",{property:"og:type",content:"article"}),u.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),u.jsx("meta",{name:"twitter:title",content:r}),u.jsx("meta",{name:"twitter:description",content:s}),u.jsx("meta",{name:"twitter:image",content:i})]}),u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),e.show_donation_banner&&u.jsx("div",{className:"bg-muted/50 border-b border-border",children:u.jsxs("div",{className:"max-w-3xl mx-auto px-6 py-4",children:[u.jsxs("p",{className:"text-sm text-foreground text-center",children:[u.jsx("strong",{children:"Diese Kampagne lebt von Menschen wie dir."})," ","Unterstütze das Nein zur Halbierungs-Initiative."]}),u.jsx("div",{className:"text-center mt-3",children:u.jsx("a",{href:"https://www.demokratie.ch/spende-gegen-srg-initiative?rnw-payment_type=onetime&rnw-amount=120&mtm_campaign=community_webseite_DE&mtm_source=blog_beitrag",target:"_blank",rel:"noopener noreferrer",className:"inline-block px-5 py-2 text-sm font-semibold rounded-full bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",children:"Spenden"})})]})}),u.jsxs("article",{className:"max-w-3xl mx-auto px-6 py-8 md:py-12",children:[u.jsx("span",{className:"inline-block text-xs font-medium tracking-wider up
524percase text-accent mb-3",children:rl[e.category]}),u.jsx("h1",{className:"font-sans text-3xl md:text-4xl lg:text-5xl text-foreground leading-tight mb-4",children:e.title}),e.excerpt&&u.jsx("p",{className:"text-lg md:text-xl text-muted-foreground leading-relaxed mb-6",children:e.excerpt}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground mb-8",children:[e.author&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-medium text-foreground",children:e.author}),u.jsx("span",{className:"text-muted-foreground/50",children:"·"})]}),e.published_at&&u.jsx("time",{children:Wg(new Date(e.published_at),"d. MMMM yyyy",{locale:Gg})})]}),u.jsx("div",{className:"w-16 h-px bg-accent/30 mb-8"}),e.featured_image&&u.jsx("div",{className:"mb-8",children:u.jsx("img",{src:e.featured_image,alt:e.title,className:"w-full rounded-lg"})}),e.video_url&&u.jsx("div",{className:"mb-8 aspect-video rounded-lg overflow-hidden bg-muted",children:u.jsx("iframe",{src:e.video_url,title:e.title,className:"w-full h-full",allowFullScreen:!0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"})}),e.audio_url&&u.jsx("div",{className:"mb-8 p-5 bg-muted/30 rounded-lg",children:u.jsxs("audio",{controls:!0,className:"w-full",children:[u.jsx("source",{src:e.audio_url}),"Dein Browser unterstützt das Audio-Element nicht."]})}),e.social_embed&&u.jsx("div",{className:"mb-8",dangerouslySetInnerHTML:{__html:cm(e.social_embed)}}),u.jsx("div",{className:`prose prose-lg max-w-none prose-enhanced
525            prose-headings:font-sans prose-headings:text-foreground prose-headings:mt-8 prose-headings:mb-4
526            prose-p:text-foreground/90 prose-p:leading-relaxed prose-p:mb-4
527            prose-a:text-primary prose-a:no-underline hover:prose-a:underline
528            prose-strong:text-foreground
529            prose-ul:text-foreground/90 prose-ol:text-foreground/90
530            prose-li:mb-2`,dangerouslySetInnerHTML:{__html:cm(e.content)}})]}),u.jsx("div",{className:"max-w-3xl mx-auto px-6 pb-12",children:u.jsx(eJ,{currentId:e.id,category:e.category})}),u.jsx(Gn,{}),u.jsx(jn,{})]})},n1=()=>{const[t,e]=b.useState(null),[n,r]=b.useState(null),[s,i]=b.useState(!0);return b.useEffect(()=>{We.auth.getSession().then(({data:{session:d}})=>{r(d),e((d==null?void 0:d.user)??null),i(!1)});const{data:{subscription:c}}=We.auth.onAuthStateChange((d,h)=>{r(h),e((h==null?void 0:h.user)??null),i(!1)});return()=>c.unsubscribe()},[]),{user:t,session:n,loading:s,signIn:async(c,d)=>{const{error:h}=await We.auth.signInWithPassword({email:c,password:d});return{error:h}},signUp:async(c,d)=>{const{error:h}=await We.auth.signUp({email:c,password:d});return{error:h}},signOut:async()=>{const{error:c}=await We.auth.signOut();return{error:c}}}},Zg=()=>{const{user:t,loading:e}=n1(),{data:n,isLoading:r}=Xs({queryKey:["admin-check",t==null?void 0:t.id],queryFn:async()=>{if(!t)return!1;const{data:s,error:i}=await We.rpc("is_admin",{_user_id:t.id});return i?(console.error("Admin check error:",i),!1):s??!1},enabled:!!t});return{isAdmin:n??!1,isLoading:e||r,user:t}},rJ=()=>{const[t,e]=b.useState(""),[n,r]=b.useState(""),[s,i]=b.useState(!1),{signIn:o}=n1(),{isAdmin:a,isLoading:l,user:c}=Zg(),d=Oi(),{toast:h}=Lh();b.useEffect(()=>{!l&&c&&a&&d("/admin/dashboard")},[a,l,c,d]);const f=async p=>{p.preventDefault(),i(!0);const{error:g}=await o(t,n);if(g){h({title:"Anmeldung fehlgeschlagen",description:g.message,variant:"destructive"}),i(!1);return}i(!1)};return l?u.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:u.jsx(gs,{className:"w-8 h-8 animate-spin text-primary"})}):u.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted/30 px-4",children:u.jsx("div",{className:"w-full max-w-md",children:u.jsxs("div",{className:"bg-card rounded-xl border border-border p-8 shadow-lg",children:[u.jsx("h1",{className:"font-sans text-2xl font-semibold text-foreground mb-2 text-center",children:"Admin-Bereich"}),u.jsx("p",{className:"text-muted-foreground text-center mb-8",children:"Melden Sie sich an, um Blog-Beiträge zu verwalten."}),u.jsxs("form",{onSubmit:f,className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"email",children:"E-Mail"}),u.jsx(Tn,{id:"email",type:"email",value:t,onChange:p=>e(p.target.value),placeholder:"[email protected]",required:!0})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"password",children:"Passwort"}),u.jsx(Tn,{id:"password",type:"password",value:n,onChange:p=>r(p.target.value),placeholder:"••••••••",required:!0})]}),u.jsx(ve,{type:"submit",className:"w-full",disabled:s,children:s?u.jsxs(u.Fragment,{children:[u.jsx(gs,{className:"w-4 h-4 mr-2 animate-spin"}),"Anmelden..."]}):"Anmelden"})]})]})})})},sJ={argument:{label:"Argumente",icon:yu,bgColor:"bg-primary/10",textColor:"text-primary"}
530,situation:{label:"Gespräche",icon:Ks,bgColor:"bg-accent/20",textColor:"text-accent-foreground"},grundlagen:{label:"Grundlagen",icon:bl,bgColor:"bg-muted",textColor:"text-muted-foreground"}},Iv=[...ki.arguments.map(t=>({...t,type:"argument"})),...ki.situations.map(t=>({...t,type:"situation"})),...ki.grundlagen.map(t=>({...t,type:"grundlagen"}))],iJ=(t,e)=>{const n=t.match(/arg-a(\d+)/i),r="02";return n?`A${n[1].padStart(2,"0")}-${r}`:e==="situation"?`S${{"sit-familie":"01","sit-arbeit":"02","sit-freunde":"03"}[t]||"00"}-${r}`:e==="grundlagen"?`G${{"grund-90sek":"01","grund-service":"02","grund-demokratie":"03"}[t]||"00"}-${r}`:t.toUpperCase()},oJ=(t,e)=>e===0?"–":(t/e).toFixed(1),aJ=({value:t})=>{const e=parseFloat(t);return isNaN(e)?u.jsx("span",{className:"text-muted-foreground",children:"–"}):u.jsx("span",{className:Z("font-medium",e>=4?"text-green-600":e>=3?"text-yellow-600":"text-red-600"),children:t})},F2=(t,e)=>{const n=[],r=String(e+1).padStart(2,"0");return n.push(`ARGUMENT A${r}: ${t.title.toUpperCase()}`),n.push("=".repeat(60)),n.push(""),n.push(`ID: ${t.id}`),n.push(""),n.push("---"),n.push(""),n.push("AUSLÖSER"),n.push("-".repeat(20)),n.push(""),n.push(t.trigger),n.push(""),t.questions&&t.questions.length>0&&t.questions.forEach((s,i)=>{n.push("---"),n.push(""),n.push(`FRAGE ${i+1}`),n.push("-".repeat(20)),n.push(""),s.context&&(n.push(`Kontext: ${s.context}`),n.push("")),n.push(s.question),n.push(""),s.options.forEach((o,a)=>{const l=String.fromCharCode(65+a);n.push(`VARIANTE ${l}:`),n.push(o.text),n.push(`→ Einordnung: ${o.einordnung}`),n.push("")})}),t.einordnung&&(n.push("---"),n.push(""),n.push("ZUSAMMENFASSUNG"),n.push("-".repeat(20)),n.push(""),t.einordnung.points.forEach(s=>{n.push(`• ${s}`)}),n.push("")),n.push("---"),n.push(""),n.push("ABSCHLUSS"),n.push("-".repeat(20)),n.push(""),n.push(t.abschluss.motivation),n.push(""),n.push("---"),n.push(""),n.push("VERKNÜPFUNGEN"),n.push("-".repeat(20)),n.push(""),n.push(`- Argumente: ${t.relatedContent.arguments.join(", ")||"–"}`),n.push(`- Situationen: ${t.relatedContent.situations.join(", ")||"–"}`),n.push(`- Grundlagen: ${t.relatedContent.grundlagen.join(", ")||"–"}`),n.push(""),n.push(""),n.join(`
531`)},B2=(t,e)=>{const n=[],r=String(e+1).padStart(2,"0");return n.push(`SITUATION S${r}: ${t.title.toUpperCase()}`),n.push("=".repeat(60)),n.push(""),n.push(`ID: ${t.id}`),n.push(""),n.push("---"),n.push(""),n.push("SETTING & EINSTIEG"),n.push("-".repeat(20)),n.push(""),n.push(t.setting),n.push(""),t.triggerContext&&(n.push(t.triggerContext),n.push("")),n.push(t.trigger),n.push(""),t.triggerOutro&&(n.push(t.triggerOutro),n.push("")),t.dialogSteps.forEach((s,i)=>{n.push("---"),n.push(""),n.push(`ENTSCHEIDUNG ${i+1}${s.stepLabel?`: ${s.stepLabel}`:""}`),n.push("-".repeat(20)),n.push(""),s.sceneIntro&&(n.push(`Szenen-Intro: ${s.sceneIntro}
531`),n.push("")),n.push(s.question),n.push(""),s.variants.forEach((o,a)=>{const l=String.fromCharCode(65+a);n.push(`VARIANTE ${l}${o.label?`: ${o.label}`:""}`),n.push(o.text),n.push(`→ Konsequenz: ${o.consequence}`),n.push("")})}),t.abschlussStory&&(n.push("---"),n.push(""),n.push("ABSCHLUSS-STORY"),n.push("-".repeat(20)),n.push(""),n.push(t.abschlussStory.intro),n.push(""),n.push(t.abschlussStory.message),n.push(""),n.push(t.abschlussStory.outro),n.push("")),n.push("---"),n.push(""),n.push("BEOBACHTUNG"),n.push("-".repeat(20)),n.push(""),t.beobachtung.intro&&(n.push(t.beobachtung.intro),n.push("")),t.beobachtung.points.forEach(s=>{n.push(`• ${s}`)}),t.beobachtung.points.length>0&&n.push(""),n.push(t.beobachtung.outro),n.push(""),n.push("---"),n.push(""),n.push("ABSCHLUSS"),n.push("-".repeat(20)),n.push(""),n.push(t.abschluss.text),t.abschluss.pointsIntro&&(n.push(""),n.push(t.abschluss.pointsIntro)),t.abschluss.points.forEach(s=>{n.push(`• ${s}`)}),n.push(""),n.push("---"),n.push(""),n.push("VERKNÜPFUNGEN"),n.push("-".repeat(20)),n.push(""),n.push(`- Argumente: ${t.relatedContent.arguments.join(", ")||"–"}`),n.push(`- Situationen: ${t.relatedContent.situations.join(", ")||"–"}`),n.push(`- Grundlagen: ${t.relatedContent.grundlagen.join(", ")||"–"}`),n.push(""),n.push(""),n.join(`
532`)},q2=(t,e)=>{const n=[],r=String(e+1).padStart(2,"0");return n.push(`GRUNDLAGEN G${r}: ${t.title.toUpperCase()}`),n.push("=".repeat(60)),n.push(""),n.push(`ID: ${t.id}`),n.push(""),n.push("---"),n.push(""),n.push("HILFT DIR IM GESPRÄCH"),n.push("-".repeat(20)),n.push(""),n.push(t.hilftDir.intro),n.push(""),t.hilftDir.triggers.forEach(s=>{n.push(`• ${s}`)}),n.push(""),t.teile.forEach((s,i)=>{n.push("---"),n.push(""),n.push(`TEIL ${i+1}: ${s.title.toUpperCase()}`),n.push("-".repeat(20)),n.push(""),s.intro&&(n.push(s.intro),n.push("")),s.points.forEach(o=>{n.push(`• ${o}`)}),n.push(""),s.outro&&(n.push(s.outro),n.push(""))}),t.quizQuestions.length>0&&(n.push("---"),n.push(""),n.push("QUIZ"),n.push("-".repeat(20)),n.push(""),t.quizQuestions.forEach((s,i)=>{n.push(`Frage ${i+1}: ${s.question}`),n.push(""),s.options.forEach((o,a)=>{const l=String.fromCharCode(65+a),c=o.isCorrect?" ✓":"";n.push(`${l}) ${o.text}${c}`),n.push(`   → ${o.einordnung}`)}),n.push("")})),n.push("---"),n.push(""),n.push("ABSCHLUSS"),n.push("-".repeat(20)),n.push(""),t.abschluss.text&&n.push(t.abschluss.text),t.abschluss.keyPoint&&n.push(t.abschluss.keyPoint),n.push(""),n.push("---"),n.push(""),n.push("VERKNÜPFUNGEN"),n.push("-".repeat(20)),n.push(""),n.push(`- Argumente: ${t.relatedContent.arguments.join(", ")||"–"}`),n.push(`- Situationen: ${t.relatedContent.situations.join(", ")||"–"}`),n.push(`- Grundlagen: ${t.relatedContent.grundlagen.join(", ")||"–"}`),n.push(""),n.push(""),n.join(`
533`)},lJ=()=>{const t=[];t.push("TRAINING 2.0 – ALLE MODULE"),t.push("=".repeat(60)),t.push(""),t.pu
533sh(`Exportiert am: ${new Date().toLocaleDateString("de-CH",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}`),t.push(""),t.push(""),t.push("█".repeat(60)),t.push("ARGUMENTE"),t.push("█".repeat(60)),t.push(""),t.push(""),il.forEach((o,a)=>{t.push(F2(o,a))}),t.push("█".repeat(60)),t.push("GESPRÄCHE / SITUATIONEN"),t.push("█".repeat(60)),t.push(""),t.push(""),ol.forEach((o,a)=>{t.push(B2(o,a))}),t.push("█".repeat(60)),t.push("GRUNDLAGEN"),t.push("█".repeat(60)),t.push(""),t.push(""),al.forEach((o,a)=>{t.push(q2(o,a))});const e=t.join(`
534`),n="\uFEFF",r=new Blob([n+e],{type:"text/plain;charset=utf-8"}),s=URL.createObjectURL(r),i=document.createElement("a");i.href=s,i.download=`training-module-${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)},cJ=(t,e)=>{let n="",r="";const s="\uFEFF";if(e==="argument"){const l=il.findIndex(c=>c.id===t);l!==-1&&(n=F2(il[l],l),r=`A${String(l+1).padStart(2,"0")}-${t}`)}else if(e==="situation"){const l=ol.findIndex(c=>c.id===t);l!==-1&&(n=B2(ol[l],l),r=`S${String(l+1).padStart(2,"0")}-${t}`)}else if(e==="grundlagen"){const l=al.findIndex(c=>c.id===t);l!==-1&&(n=q2(al[l],l),r=`G${String(l+1).padStart(2,"0")}-${t}`)}if(!n)return;const i=new Blob([s+n],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(i),a=document.createElement("a");a.href=o,a.download=`${r}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)},uJ=()=>{const{data:t,isLoading:e,error:n,refetch:r,isFetching:s}=Tk(),i=new Map;t==null||t.forEach(l=>i.set(l.module_id,l));const o={argument:Iv.filter(l=>l.type==="argument"),situation:Iv.filter(l=>l.type==="situation"),grundlagen:Iv.filter(l=>l.type==="grundlagen")},a={views:(t==null?void 0:t.reduce((l,c)=>l+c.view_count,0))||0,completions:(t==null?void 0:t.reduce((l,c)=>
534l+c.completion_count,0))||0,ratingCount:(t==null?void 0:t.reduce((l,c)=>l+c.rating_count,0))||0};return n?u.jsx("div",{className:"p-4 bg-red-50 text-red-600 rounded-lg",children:"Fehler beim Laden der Statistiken"}):u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h2",{className:"text-xl font-semibold",children:"Training"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(ve,{variant:"outline",size:"sm",onClick:lJ,children:[u.jsx(nv,{className:"w-4 h-4 mr-2"}),"Inhalte exportieren"]}),u.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>r(),disabled:s,children:[u.jsx(IF,{className:Z("w-4 h-4 mr-2",s&&"animate-spin")}),"Aktualisieren"]})]})]}),u.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[u.jsxs("div",{className:"bg-card border rounded-lg p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[u.jsx(Kp,{className:"w-4 h-4"}),u.jsx("span",{className:"text-sm",children:"Aufrufe"})]}),u.jsx("p",{className:"text-2xl font-bold",children:a.views})]}),u.jsxs("div",{className:"bg-card border rounded-lg p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[u.jsx(eh,{className:"w-4 h-4"}),u.jsx("span",{className:"text-sm",children:"Abgeschlossen"})]}),u.jsx("p",{className:"text-2xl font-bold",children:a.completions})]}),u.jsxs("div",{className:"bg-card border rounded-lg p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-1",children:[u.jsx(jg,{className:"w-4 h-4"}),u.jsx("span",{className:"text-sm",children:"Bewertungen"})]}),u.jsx("p",{className:"text-2xl font-bold",children:a.ratingCount})]})]}),["argument","situation","grundlagen"].map(l=>{const c=sJ[l],d=c.icon,h=o[l];return u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:Z("w-8 h-8 rounded-full flex items-center justify-center",c.bgColor),children:u.jsx(d,{className:Z("w-4 h-4",c.textColor)})}),u.jsx("h3",{className:"font-medium",children:c.label})]}),u.jsx("div",{className:"bg-card border rounded-lg overflow-hidden",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"bg-muted/50",children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Modul"}),u.jsx("th",{className:"text-center px-2 py-2 font-medium w-20",children:u.jsx(Kp,{className:"w-4 h-4 mx-auto"})}),u.jsx("th",{className:"text-center px-2 py-2 font-medium w-20",children:u.jsx(eh,{className:"w-4 h-4 mx-auto"})}),u.jsx("th",{className:"text-center px-2 py-2 font-medium w-20",title:"Nützlich (Durchschnitt)",children:u.jsx("span",{className:"text-xs",children:"Nützlich"})}),u.jsx("th",{className:"text-center px-2 py-2 font-medium w-12",title:"Anzahl Bewertungen",children:u.jsx("span",{className:"text-xs",children:"n"})}),u.jsx("th",{className:"text-center px-2 py-2 font-medium w-10",children:u.jsx(nv,{className:"w-3 h-3 mx-auto text-muted-foreground"})})]})}),u.jsx("tbody",{children:e?u.jsx("tr",{children:u.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-muted-foreground",children:"Laden..."})}):h.map(f=>{const p=i.get(f.id),g=iJ(f.id,l);return u.jsxs("tr",{className:"border-t hover:bg-muted/30",children:[u.jsxs("td",{className:"px-4 py-2",children:[u.jsx("span",{className:"font-mono text-xs text-muted-foreground mr-2",children:g}),u.jsx("span",{className:"truncate",children:f.title}),!f.available&&u.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:"(gesperrt)"})]}),u.jsx("td",{className:"text-center px-2 py-2",children:(p==null?void 0:p.view_count)||0}),u.jsx("td",{className:"text-center px-2 py-2",children:(p==null?void 0:p.completion_count)||0}),u.jsx("td",{className:"text-center px-2 py-2",children:u.jsx(aJ,{value:oJ((p==null?void 0:p.rating_useful_sum)||0,(p==null?void 0:p.rating_count)||0)})}),u.jsx("td",{className:"text-center px-2 py-2 text-muted-foreground",children:(p==null?void 0:p.rating_count)||0}),u.jsx("td",{className:"text-center px-1 py-2",children:u.jsx("button",{onClick:()=>cJ(f.id,l),className:"p-1 hover:bg-muted rounded transition-colors",title:"Modul exportieren",children:u.jsx(nv,{className:"w-3 h-3 text-muted-foreground hover:text-foreground"})})})]},f.id)})})]})})]},l)})]})},dJ=()=>{const{toast:t}=Lh(),e=pk(),{data:n,isLoading:r}=Xs({queryKey:["training-feedback"],queryFn:async()=>{const{data:o,error:a}=await We.from("training_feedback").select("*").order("created_at",{ascending:!1});if(a)throw a;return o}}),s=EU({mutationFn:async o=>{const{error:a}=await We.from("training_feedback").delete().eq("id",o);if(a)throw a},onSuccess:()=>
534{e.invalidateQueries({queryKey:["training-feedback"]}),t({title:"Gelöscht",description:"Feedback wurde entfernt."})},onError:()=>{t({title:"Fehler",description:"Löschen fehlgeschlagen.",variant:"destructive"})}}),i=o=>{confirm("Feedback wirklich löschen?")&&s.mutate(o)};return r?u.jsx("div",{className:"space-y-4",children:[1,2,3].map(o=>u.jsx(Ye,{className:"h-32 w-full rounded-lg"},o))}):!n||n.length===0?u.jsx("div",{className:"bg-card rounded-xl border border-border p-12 text-center",children:u.jsx("p",{className:"text-muted-foreground",children:"Noch kein Feedback eingegangen."})}):u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"flex items-center justify-between mb-4",children:u.jsxs("h2",{className:"text-lg font-medium text-foreground",children:["Feedback (",n.length,")"]})}),u.jsx("div",{className:"space-y-4",children:n.map(o=>u.jsx("div",{className:"bg-card rounded-xl border border-border p-5",children:u.jsxs("div",{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-3 mb-2 flex-wrap",children:[u.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium rounded bg-primary/10 text-primary",children:o.module_id}),u.jsx("span",{className:"text-xs text-muted-foreground",children:Wg(new Date(o.created_at),"d. MMM yyyy, HH:mm",{locale:Gg})})]}),u.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap mb-3",children:o.message}),u.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground flex-wrap",children:[u.jsxs("span",{className:"font-medium text-foreground",children:[o.first_name," ",o.last_name]}),u.jsxs("a",{href:`mailto:${o.email}`,className:"inline-flex items-center gap-1 hover:text-foreground",children:[u.jsx(Yw,{className:"w-3 h-3"}),o.email]}),o.phone&&u.jsxs("a",{href:`tel:${o.phone}`,className:"inline-flex items-center gap-1 hover:text-foreground",children:[u.jsx(MF,{className:"w-3 h-3"}),o.phone]}),u.jsxs("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:text-foreground",children:[u.jsx(mF,{className:"w-3 h-3"}),"Seite"]})]})]}),u.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>i(o.id),className:"text-destructive hover:text-destructive shrink-0",children:u.jsx(yR,{className:"w-4 h-4"})})]})},o.id))})]})},hJ=()=>{const[t,e]=b.useState("posts"),{isAdmin:n,isLoading:r,user:s}=Zg(),{signOut:i}=n1(),o=Oi(),{toast:a}=Lh();b.useEffect(()=>{!r&&(!s||!n)&&o("/admin")},[n,r,s,o]);const{data:l,isLoading:c,refetch:d}=Xs({queryKey:["admin-posts"],queryFn:async()=>{const{data:g,error:m}=await We.from("blog_posts").select("*").order("created_at",{ascending:!1});if(m)throw m;return g},enabled:n}),h=async(g,m)=>{if(!confirm(`Möchten Sie den Beitrag "${m}" wirklich löschen?`))return;const{error:y}=await We.from("blog_posts").delete().eq("id",g);if(y){a({title:"Fehler",description:"Der Beitrag konnte nicht gelöscht werden.",variant:"destructive"});return}a({title:"Erfolg",description:"Der Beitrag wurde gelöscht."}),d()},f=async g=>{const m=!g.is_published,{error:y}=await We.from("blog_posts").update({is_published:m,published_at:m?new Date().toISOString():null}).eq("id",g.id);if(y){a({title:"Fehler",description:"Der Status konnte nicht geändert werden.",variant:"destructive"});return}a({title:"Erfolg",description:m?"Beitrag veröffentlicht.":"Beitrag als Entwurf gespeichert."}),d()},p=async()=>{await i(),o("/admin")};return r?u.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:u.jsx(gs,{className:"w-8 h-8 animate-spin text-primary"})}):n?u.jsxs("div",{className:"min-h-screen bg-muted/30",children:[u.jsx("header",{className:"bg-card border-b border-border",children:u.jsxs("div",{className:"container max-w-7xl mx-auto px-4 py-4 flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"font-sans text-xl font-semibold text-foreground",children:"Blog-Verwaltung"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:s==null?void 0:s.email})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx(Mt,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground",children:"Zur Webseite"}),u.jsxs(ve,{variant:"ghost",size:"sm",onClick:p,children:[u.jsx(TF,{className:"w-4 h-4 mr-2"}),"Abmelden"]})]})]})}),u.jsxs("main",{className:"container max-w-7xl mx-auto px-4 py-8",children:[u.jsxs("div",{className:"flex items-center gap-4 mb-8 border-b border-border",children:[u.jsx("button",{onClick:()=>e("posts"),className:`pb-3 px-1 text-sm font-medium border-b-2 transition-colors ${t==="posts"?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"Blog-Beiträge"}),u.jsxs("button",{onClick:()=>e("training"),className:`pb-3 px-1 text-sm font-medium border-b-2 transition-colors flex items-center gap-2 ${t==="training"?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[u.jsx(vF,{className:"w-4 h-4"}),"Training-Statistiken"]}
534),u.jsxs("button",{onClick:()=>e("feedback"),className:`pb-3 px-1 text-sm font-medium border-b-2 transition-colors flex items-center gap-2 ${t==="feedback"?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[u.jsx(yu,{className:"w-4 h-4"}),"Feedback"]})]}),t==="feedback"?u.jsx(dJ,{}):t==="training"?u.jsx(uJ,{}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between mb-8",children:[u.jsx("h2",{className:"text-lg font-medium text-foreground",children:"Alle Beiträge"}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Mt,{to:"/admin/stats",children:u.jsxs(ve,{variant:"outline",children:[u.jsx(cF,{className:"w-4 h-4 mr-2"}),"Gespräche-Zähler"]})}),u.jsx(Mt,{to:"/admin/posts/new",children:u.jsxs(ve,{children:[u.jsx(xE,{className:"w-4 h-4 mr-2"}),"Neuer Beitrag"]})})]})]}),u.jsx("div",{className:"bg-card rounded-xl border border-border overflow-hidden",children:c?u.jsx("div",{className:"p-6 space-y-4",children:[1,2,3].map(g=>u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx(Ye,{className:"h-12 w-12 rounded"}),u.jsxs("div",{className:"flex-1 space-y-2",children:[u.jsx(Ye,{className:"h-4 w-1/3"}),u.jsx(Ye,{className:"h-3 w-1/4"})]})]},g))}):l&&l.length>0?u.jsxs("table",{className:"w-full",children:[u.jsx("thead",{className:"bg-muted/50 border-b border-border",children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-center px-3 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wider w-10"}),u.jsx("th",{className:"text-left px-6 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wider w-16 hidden sm:table-cell",children:"Bild"}),u.jsx("th",{className:"text-left px-6 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Titel"}),u.jsx("th",{className:"text-left px-6 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wider hidden md:table-cell",children:"Kategorie"}),u.jsx("th",{className:"text-left px-6 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wider hidden lg:table-cell",children:"Erstellt"}),u.jsx("th",{className:"text-left px-6 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Status"}),u.jsx("th",{className:"text-right px-6 py-3 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Aktionen"})]})}),u.jsx("tbody",{className:"divide-y divide-border",children:l.map(g=>u.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[u.jsx("td",{className:"px-3 py-4 text-center",children:u.jsx("div",{className:`w-3 h-3 rounded-full mx-auto ${SC[g.review_status]||SC.check}`,title:g.review_status==="check"?"Check":g.review_status==="review"?"Review":"Kritisch"})}),u.jsx("td",{className:"px-6 py-4 hidden sm:table-cell",children:g.featured_image?u.jsx("img",{src:g.featured_image,alt:"",className:"w-12 h-8 object-cover rounded border border-border"}):u.jsx("div",{className:"w-12 h-8 bg-muted rounded border border-border flex items-center justify-center",children:u.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})}),u.jsx("td",{className:"px-6 py-4",children:u.jsxs("div",{children:[u.jsx("p",{className:"font-medium text-foreground line-clamp-1",children:g.title}),u.jsxs("p",{className:"text-sm text-muted-foreground line-clamp-1",children:["/",g.slug]})]})}),u.jsx("td",{className:"px-6 py-4 hidden md:table-cell",children:u.jsx("span",{className:`inline-block px-2 py-1 text-xs font-medium rounded ${Ek[g.category]}`,children:rl[g.category]})}),u.jsx("td",{className:"px-6 py-4 text-sm text-muted-foreground hidden lg:table-cell",children:Wg(new Date(g.created_at),"d. MMM yyyy, HH:mm:ss",{locale:Gg})}),u.jsx("td",{className:"px-6 py-4",children:u.jsx("button",{onClick:()=>f(g),className:`inline-flex items-center gap-1 text-xs font-medium px-2 py-1 rounded ${g.is_published?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"}`,children:g.is_published?u.jsxs(u.Fragment,{children:[u.jsx(Kp,{className:"w-3 h-3"}),"Öffentlich"]}):u.jsxs(u.Fragment,{children:[u.jsx(gF,{className:"w-3 h-3"}),"Entwurf"]})})}),u.jsx("td",{className:"px-6 py-4 text-right",children:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Mt,{to:`/admin/posts/${g.id}`,children:u.jsx(ve,{variant:"ghost",size:"sm",children:u.jsx($F,{className:"w-4 h-4"})})}),u.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>
vendor: 19,228 bytes, line 534
534h(g.id,g.title),className:"text-destructive hover:text-destructive",children:u.jsx(yR,{className:"w-4 h-4"})})]})})]},g.id))})]}):u.jsxs("div",{className:"p-12 text-center",children:[u.jsx("p",{className:"text-muted-foreground mb-4",children:"Noch keine Beiträge vorhanden."}),u.jsx(Mt,{to:"/admin/posts/new",children:u.jsxs(ve,{children:[u.jsx(xE,{className:"w-4 h-4 mr-2"}),"Ersten Beitrag erstellen"]})})]})})]})]})]}):null},fJ=(t,e)=>{const[n,r]=b.useState([]),[s,i]=b.useState(null);b.useEffect(()=>{if(!t||!e)return;const c=`editor:${t}`,d=We.channel(c);return d.on("presence",{event:"sync"},()=>{const h=d.presenceState(),f=[];Object.values(h).forEach(p=>{p.forEach(g=>{f.push({odoorId:g.odoorId,email:g.email,postId:g.postId,joinedAt:g.joinedAt})})}),r(f)}).on("presence",{event:"join"},({newPresences:h})=>{console.log("Editor joined:",h)}).on("presence",{event:"leave"},({leftPresences:h})=>{console.log("Editor left:",h)}).subscribe(async h=>{h==="SUBSCRIBED"&&await d.track({odoorId:crypto.randomUUID(),email:e,postId:t,joinedAt:new Date().toISOString()})}),i(d),()=>{d.unsubscribe()}},[t,e]);const o=n.filter(c=>c.email!==e),a=o.length>0,l=o.length>0?o[0].email:null;return{activeEditors:n,isOtherEditorActive:a,otherEditorEmail:l}};var pJ=[" ","Enter","ArrowUp","ArrowDown"],mJ=[" ","Enter"],ul="Select",[Xg,ey,gJ]=zh(ul),[Cu,uie]=_r(ul,[gJ,Pg]),ty=Pg(),[yJ,ea]=Cu(ul),[vJ,xJ]=Cu(ul),U2=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:h,disabled:f,required:p,form:g}=t,m=ty(e),[y,v]=b.useState(null),[x,w]=b.useState(null),[k,S]=b.useState(!1),E=Hh(c),[C,N]=vs({prop:r,defaultProp:s??!1,onChange:i,caller:ul}),[T,M]=vs({prop:o,defaultProp:a,onChange:l,caller:ul}),D=b.useRef(null),A=y?g||!!y.closest("form"):!0,[L,I]=b.useState(new Set),U=Array.from(L).map(B=>B.props.value).join(";");return u.jsx(Nq,{...m,children:u.jsxs(yJ,{required:p,scope:e,trigger:y,onTriggerChange:v,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:k,onValueNodeHasChildrenChange:S,contentId:Vs(),value:T,onValueChange:M,open:C,onOpenChange:N,dir:E,triggerPointerDownPosRef:D,disabled:f,children:[u.jsx(Xg.Provider,{scope:e,children:u.jsx(vJ,{scope:t.__scopeSelect,onNativeOptionAdd:b.useCallback(B=>{I(J=>new Set(J).add(B))},[]),onNativeOptionRemove:b.useCallback(B=>{I(J=>{const P=new Set(J);return P.delete(B),P})},[]),children:n})}),A?u.jsxs(fP,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:T,onChange:B=>M(B.target.value),disabled:f,form:g,children:[T===void 0?u.jsx("option",{value:""}):null,Array.from(L)]},U):null]})})};U2.displayName=ul;var V2="SelectTrigger",H2=b.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=ty(n),o=ea(V2,n),a=o.disabled||r,l=Ue(e,o.onTriggerChange),c=ey(n),d=b.useRef("touch"),[h,f,p]=mP(m=>{const y=c().filter(w=>!w.disabled),v=y.find(w=>w.value===o.value),x=gP(y,m,v);x!==void 0&&o.onValueChange(x.value)}),g=m=>{a||(o.onOpenChange(!0),p()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return u.jsx(QR,{asChild:!0,...i,children:u.jsx(Ee.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":pP(o.value)?"":void 0,...s,ref:l,onClick:ge(s.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&g(m)}),onPointerDown:ge(s.onPointerDown,m=>{d.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:ge(s.onKeyDown,m=>{const y=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(y&&m.key===" ")&&pJ.includes(m.key)&&(g(),m.preventDefault())})})})});H2.displayName=V2;var W2="SelectValue",G2=b.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=t,l=ea(W2,n),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,h=Ue(e,l.onValueNodeChange);return an(()=>{c(d)},[c,d]),u.jsx(Ee.span,{...a,ref:h,style:{pointerEvents:"none"},children:pP(l.value)?u.jsx(u.Fragment,{children:o}):i})});G2.displayName=W2;var bJ="SelectIcon",K2=b.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return u.jsx(Ee.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});K2.displayName=bJ;var wJ="SelectPortal",J2=t=>u.jsx(_g,{asChild:!0,...t});J2.displayName=wJ;var dl="SelectContent",Q2=b.forwardRef((t,e)=>{const n=ea(dl,t.__scopeSelect),[r,s]=b.useState();if(an(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?xl.createPortal(u.jsx(Y2,{scope:t.__scopeSelect,children:u.jsx(Xg.Slot,{scope:t.__scopeSelect,children:u.jsx("div",{children:t.children})})}),i):null}return u.jsx(Z2,{...t,ref:e})});Q2.displayName=dl;var es=10,[Y2,ta]=Cu(dl),kJ="SelectContentImpl",SJ=Yc("SelectContent.RemoveScroll"),Z2=b.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:y,...v}=t,x=ea(dl,n),[w,k]=b.useState(null),[S,E]=b.useState(null),C=Ue(e,Y=>k(Y)),[N,T]=b.useState(null),[M,D]=b.useState(null),A=ey(n),[L,I]=b.useState(!1),U=b.useRef(!1);b.useEffect(()=>{if(w)return h2(w)},[w]),s2();const B=b.useCallback(Y=>{const[Pe,...Xe]=A().map(Le=>Le.ref.current),[Ie]=Xe.slice(-1),pe=document.activeElement;for(const Le of Y)if(Le===pe||(Le==null||Le.scrollIntoView({block:"nearest"}),Le===Pe&&S&&(S.scrollTop=0),Le===Ie&&S&&(S.scrollTop=S.scrollHeight),Le==null||Le.focus(),document.activeElement!==pe))return},[A,S]),J=b.useCallback(()=>B([N,w]),[B,N,w]);b.useEffect(()=>{L&&J()},[L,J]);const{onOpenChange:P,triggerPointerDownPosRef:z}=x;b.useEffect(()=>{if(w){let Y={x:0,y:0};const Pe=Ie=>{var pe,Le;Y={x:Math.abs(Math.round(Ie.pageX)-(((pe=z.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(Ie.pageY)-(((Le=z.current)==null?void 0:Le.y)??0))}},Xe=Ie=>{Y.x<=10&&Y.y<=10?Ie.preventDefault():w.contains(Ie.target)||P(!1),document.removeEventListener("pointermove",Pe),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",Pe),document.addEventListener("pointerup",Xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Pe),document.removeEventListener("pointerup",Xe,{capture:!0})}}},[w,P,z]),b.useEffect(()=>{const Y=()=>P(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[P]);const[Q,re]=mP(Y=>{const Pe=A().filter(pe=>!pe.disabled),Xe=Pe.find(pe=>pe.ref.current===document.activeElement),Ie=gP(Pe,Y,Xe);Ie&&setTimeout(()=>Ie.ref.current.focus())}),ce=b.useCallback((Y,Pe,Xe)=>{const Ie=!U.current&&!Xe;(x.value!==void 0&&x.value===Pe||Ie)&&(T(Y),Ie&&(U.current=!0))},[x.value]),ae=b.useCallback(()=>w==null?void 0:w.focus(),[w]),Ce=b.useCallback((Y,Pe,Xe)=>{const Ie=!U.current&&!Xe;(x.value!==void 0&&x.value===Pe||Ie)&&D(Y)},[x.value]),we=r==="popper"?l0:X2,Ge=we===l0?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:y}:{};return u.jsx(Y2,{scope:n,content:w,viewport:S,onViewportChange:E,itemRefCallback:ce,selectedItem:N,onItemLeave:ae,itemTextRefCallback:Ce,focusSelectedItem:J,selectedItemText:M,position:r,isPositioned:L,searchRef:Q,children:u.jsx(Wk,{as:SJ,allowPinchZoom:!0,children:u.jsx(Hk,{asChild:!0,trapped:x.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:ge(s,Y=>{var Pe;(Pe=x.trigger)==null||Pe.focus({preventScroll:!0}),Y.preventDefault()}),children:u.jsx($h,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:u.jsx(we,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:Y=>Y.preventDefault(),...v,...Ge,onPlaced:()=>I(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ge(v.onKeyDown,Y=>{const Pe=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!Pe&&Y.key.length===1&&re(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let Ie=A().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(Ie=Ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const pe=Y.target,Le=Ie.indexOf(pe);Ie=Ie.slice(Le+1)}setTimeout(()=>B(Ie)),Y.preventDefault()}})})})})})})});Z2.displayName=kJ;var EJ="SelectItemAlignedPosition",X2=b.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=ea(dl,n),o=ta(dl,n),[a,l]=b.useState(null),[c,d]=b.useState(null),h=Ue(e,C=>d(C)),f=ey(n),p=b.useRef(!1),g=b.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:v,focusSelectedItem:x}=o,w=b.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&y&&v){const C=i.trigger.getBoundingClientRect(),N=c.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),M=v.getBoundingClientRect();if(i.dir!=="rtl"){const pe=M.left-N.left,Le=T.left-pe,at=C.left-Le,vt=C.width+at,X=Math.max(vt,N.width),it=window.innerWidth-es,ln=um(Le,[es,Math.max(es,it-X)]);a.style.minWidth=vt+"px",a.style.left=ln+"px"}else{const pe=N.right-M.right,Le=window.innerWidth-T.right-pe,at=window.innerWidth-C.right-Le,vt=C.width+at,X=Math.max(vt,N.width),it=window.innerWidth-es,ln=um(Le,[es,Math.max(es,it-X)]);a.style.minWidth=vt+"px",a.style.right=ln+"px"}const D=f(),A=window.innerHeight-es*2,L=m.scrollHeight,I=window.getComputedStyle(c),U=parseInt(I.borderTopWidth,10),B=parseInt(I.paddingTop,10),J=parseInt(I.borderBottomWidth,10),P=parseInt(I.paddingBottom,10),z=U+B+L+P+J,Q=Math.min(y.offsetHeight*5,z),re=window.getComputedStyle(m),ce=parseInt(re.paddingTop,10),ae=parseInt(re.paddingBottom,10),Ce=C.top+C.height/2-es,we=A-Ce,Ge=y.offsetHeight/2,Y=y.offsetTop+Ge,Pe=U+B+Y,Xe=z-Pe;if(Pe<=Ce){const pe=D.length>0&&y===D[D.length-1].ref.current;a.style.bottom="0px";const Le=c.clientHeight-m.offsetTop-m.offsetHeight,at=Math.max(we,Ge+(pe?ae:0)+Le+J),vt=Pe+at;a.style.height=vt+"px"}else{const pe=D.length>0&&y===D[0].ref.current;a.style.top="0px";const at=Math.max(Ce,U+m.offsetTop+(pe?ce:0)+Ge)+Xe;a.style.height=at+"px",m.scrollTop=Pe-Ce+m.offsetTop}a.style.margin=`${es}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=A+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,a,c,m,y,v,i.dir,r]);an(()=>w(),[w]);const[k,S]=b.useState();an(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const E=b.useCallback(C=>{C&&g.current===!0&&(w(),x==null||x(),g.current=!1)},[w,x]);return u.jsx(NJ,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:u.jsx(Ee.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});X2.displayName=EJ;var CJ="SelectPopperPosition",l0=b.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=es,...i}=t,o=ty(n);return u.jsx(YR,{...o,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});l0.displayName=CJ;var[NJ,r1]=Cu(dl,{}),c0="SelectViewport",eP=b.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=ta(c0,n),o=r1(c0,n),a=Ue(e,i.onViewportChange),l=b.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(Xg.Slot,{scope:n,children:u.jsx(Ee.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ge(s.onScroll,c=>{const d=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const p=Math.abs(l.current-d.scrollTop);if(p>0){const g=window.innerHeight-es*2,m=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),v=Math.max(m,y);if(v<g){const x=v+p,w=Math.min(g,x),k=x-w;h.style.height=w+"px",h.style.bottom==="0px"&&(d.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});eP.displayName=c0;var tP="SelectGroup",[_J,TJ]=Cu(tP),AJ=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=Vs();return u.jsx(_J,{scope:n,id:s,children:u.jsx(Ee.div,{role:"group","aria-labelledby":s,...r,ref:e})})});AJ.displayName=tP;var nP="SelectLabel",rP=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=TJ(nP,n);return u.jsx(Ee.div,{id:s.id,...r,ref:e})});rP.displayName=nP;var bm="SelectItem",[jJ,sP]=Cu(bm),iP=b.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=t,a=ea(bm,n),l=ta(bm,n),c=a.value===r,[d,h]=b.useState(i??""),[f,p]=b.useState(!1),g=Ue(e,x=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,x,r,s)}),m=Vs(),y=b.useRef("touch"),v=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(jJ,{scope:n,value:r,disabled:s,textId:m,isSelected:c,onItemTextChange:b.useCallback(x=>{h(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:u.jsx(Xg.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:u.jsx(Ee.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:g,onFocus:ge(o.onFocus,()=>p(!0)),onBlur:ge(o.onBlur,()=>p(!1)),onClick:ge(o.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:ge(o.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:ge(o.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:ge(o.onPointerMove,x=>{var w;y.current=x.pointerType,s?(w=l.onItemLeave)==null||w.call(l):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ge(o.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:ge(o.onKeyDown,x=>{var k;((k=l.searchRef)==null?void 0:k.current)!==""&&x.key===" "||(mJ.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});iP.displayName=bm;var od="SelectItemText",oP=b.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,o=ea(od,n),a=ta(od,n),l=sP(od,n),c=xJ(od,n),[d,h]=b.useState(null),f=Ue(e,v=>h(v),l.onItemTextChange,v=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,v,l.value,l.disabled)}),p=d==null?void 0:d.textContent,g=b.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return an(()=>(m(g),()=>y(g)),[m,y,g]),u.jsxs(u.Fragment,{children:[u.jsx(Ee.span,{id:l.textId,...i,ref:f}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?xl.createPortal(i.children,o.valueNode):null]})});oP.displayName=od;var aP="SelectItemIndicator",lP=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return sP(aP,n).isSelected?u.jsx(Ee.span,{"aria-hidden":!0,...r,ref:e}):null});lP.displayName=aP;var u0="SelectScrollUpButton",cP=b.forwardRef((t,e)=>{const n=ta(u0,t.__scopeSelect),r=r1(u0,t.__scopeSelect),[s,i]=b.useState(!1),o=Ue(e,r.onScrollButtonChange);return an(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?u.jsx(dP,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});cP.displayName=u0;var d0="SelectScrollDownButton",uP=b.forwardRef((t,e)=>{const n=ta(d0,t.__scopeSelect),r=r1(d0,t.__scopeSelect),[s,i]=b.useState(!1),o=Ue(e,r.onScrollButtonChange);return an(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?u.jsx(dP,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});uP.displayName=d0;var dP=b.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=ta("SelectScrollButton",n),o=b.useRef(null),a=ey(n),l=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>l(),[l]),an(()=>{var d;const c=a().find(h=>h.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),u.jsx(Ee.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:ge(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ge(s.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ge(s.onPointerLeave,()=>{l()})})}),RJ="SelectSeparator",hP=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return u.jsx(Ee.div,{"aria-hidden":!0,...r,ref:e})});hP.displayName=RJ;var h0="SelectArrow",MJ=b.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=ty(n),i=ea(h0,n),o=ta(h0,n);return i.open&&o.position==="popper"?u.jsx(ZR,{...s,...r,ref:e}):null});MJ.displayName=h0;var OJ="SelectBubbleInput",fP=b.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const s=b.useRef(null),i=Ue(r,s),o=Dk(e);return b.useEffect(()=>{const a=s.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&d){const h=new Event("change",{bubbles:!0});d.call(a,e),a.dispatchEvent(h)}},[o,e]),u.jsx(Ee.select,{...n,style:{...Wj,...n.style},ref:i,defaultValue:e})});fP.displayName=OJ;function pP(t){return t===""||t===void 0}function mP(t){const e=Gr(t),n=b.useRef(""),r=b.useRef(0),s=b.useCallback(o=>{const a=n.current+o;e(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),i=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function gP(t,e,n){const s=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=PJ(t,Math.max(i,0));s.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function PJ(t,e){return t.map((n,r)=>t[(e+r)%t.length])}
vendor: 4,211 bytes, line 534
534var IJ=U2,yP=H2,DJ=G2,LJ=K2,zJ=J2,vP=Q2,$J=eP,xP=rP,bP=iP,FJ=oP,BJ=lP,wP=cP,kP=uP,SP=hP;const Ku=IJ,Ju=DJ,Kl=b.forwardRef(({className:t,children:e,...n},r)=>u.jsxs(yP,{ref:r,className:Z("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,u.jsx(LJ,{asChild:!0,children:u.jsx(Qw,{className:"h-4 w-4 opacity-50"})})]}));Kl.displayName=yP.displayName;const EP=b.forwardRef(({className:t,...e},n)=>u.jsx(wP,{ref:n,className:Z("flex cursor-default items-center justify-center py-1",t),...e,children:u.jsx(dF,{className:"h-4 w-4"})}));EP.displayName=wP.displayName;const CP=b.forwardRef(({className:t,...e},n)=>u.jsx(kP,{ref:n,className:Z("flex cursor-default items-center justify-center py-1",t),...e,children:u.jsx(Qw,{className:"h-4 w-4"})}));CP.displayName=kP.displayName;const Jl=b.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>u.jsx(zJ,{children:u.jsxs(vP,{ref:s,className:Z("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[u.jsx(EP,{}),u.jsx($J,{className:Z("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),u.jsx(CP,{})]})}));Jl.displayName=vP.displayName;const qJ=b.forwardRef(({className:t,...e},n)=>u.jsx(xP,{ref:n,className:Z("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));qJ.displayName=xP.displayName;const ga=b.forwardRef(({className:t,children:e,...n},r)=>u.jsxs(bP,{ref:r,className:Z("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(BJ,{children:u.jsx(Jw,{className:"h-4 w-4"})})}),u.jsx(FJ,{children:e})]}));ga.displayName=bP.displayName;const UJ=b.forwardRef(({className:t,...e},n)=>u.jsx(SP,{ref:n,className:Z("-mx-1 my-1 h-px bg-muted",t),...e}));UJ.displayName=SP.displayName;var ny="Switch",[VJ,die]=_r(ny),[HJ,WJ]=VJ(ny),NP=b.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:l="on",onCheckedChange:c,form:d,...h}=t,[f,p]=b.useState(null),g=Ue(e,w=>p(w)),m=b.useRef(!1),y=f?d||!!f.closest("form"):!0,[v,x]=vs({prop:s,defaultProp:i??!1,onChange:c,caller:ny});return u.jsxs(HJ,{scope:n,checked:v,disabled:a,children:[u.jsx(Ee.button,{type:"button",role:"switch","aria-checked":v,"aria-required":o,"data-state":jP(v),"data-disabled":a?"":void 0,disabled:a,value:l,...h,ref:g,onClick:ge(t.onClick,w=>{x(k=>!k),y&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),y&&u.jsx(AP,{control:f,bubbles:!m.current,name:r,value:l,checked:v,required:o,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});NP.displayName=ny;var _P="SwitchThumb",TP=b.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=WJ(_P,n);return u.jsx(Ee.span,{"data-state":jP(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});TP.displayName=_P;var GJ="SwitchBubbleInput",AP=b.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const o=b.useRef(null),a=Ue(o,i),l=Dk(n),c=ok(e);return b.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(l!==n&&p){const g=new Event("click",{bubbles:r});
534p.call(d,n),d.dispatchEvent(g)}},[l,n,r]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});AP.displayName=GJ;function jP(t){return t?"checked":"unchecked"}var RP=NP,KJ=TP;const f0=b.forwardRef(({className:t,...e},n)=>u.jsx(RP,{className:Z("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...e,ref:n,children:u.jsx(KJ,{className:Z("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));f0.displayName=RP.displayName;const JJ=Bh("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),MP=b.forwardRef(({className:t,variant:e,...n},r)=>u.jsx("div",{ref:r,role:"alert",className:Z(JJ({variant:e}),t),...n}));MP.displayName="Alert";const QJ=b.forwardRef(({className:t,...e},n)=>u.jsx("h5",{ref:n,className:Z("mb-1 font-medium leading-none tracking-tight",t),...e}));QJ.displayName="AlertTitle";const OP=b.forwardRef(({className:t,...e},n)=>u.jsx("div",{ref:n,className:Z("text-sm [&_p]:leading-relaxed",t),...e}));OP.displayName="AlertDescription";var PP={exports:{}},IP={};/**
535 * @license React
536 * use-sync-external-store-shim.production.js
537 *
538 * Copyright (c) Meta Platforms, Inc. and affiliates.
539 *
540 * This source code is licensed under the MIT license found in the
541 * LICENSE file in the root directory of this source tree.
542 */var ou=b;function YJ(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ZJ=typeof Object.is=="function"?Object.is:YJ,XJ=ou.useState,eQ=ou.useEffect,tQ=ou.useLayoutEffect,nQ=ou.useDebugValue;function rQ(t,e){var n=e(),r=XJ({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return tQ(function(){s.value=n,s.getSnapshot=e,Dv(s)&&i({inst:s})},[t,n,e]),eQ(function(){return Dv(s)&&i({inst:s}),t(function(){Dv(s)&&i({inst:s})})},[t]),nQ(n),n}function Dv(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ZJ(t,n)}catch{return!0}}function sQ(t,e){return e()}var iQ=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sQ:rQ;IP.useSyncExternalStore=ou.useSyncExternalStore!==void 0?ou.useSyncExternalStore:iQ;PP.exports=IP;var s1=PP.exports;function mn(t){this.content=t}mn.prototype={constructor:mn,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 mn(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 mn(n)},addToStart:function(t,e){return new mn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new mn(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 mn(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=mn.from(t),t.size?new mn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=mn.from(t),t.size?new mn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=mn.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}};mn.from=function(t){if(t instanceof mn)return t;var e=[];
vendor: 8,620 bytes, line 542
542if(t)for(var n in t)e.push(n,t[n]);return new mn(e)};function DP(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=DP(s.content,i.content,n+1);if(o!=null)return o}n+=s.nodeSize}}function LP(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,d=Math.min(o.text.length,a.text.length);for(;c<d&&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=LP(o.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class q{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 d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,s+d)}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):"":"";a.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 q(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 q(r,s)}cutByIndex(e,n){return e==n?q.empty:e==0&&n==this.content.length?this:new q(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 q(s,i)}addToStart(e){return new q([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new q(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 DP(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return LP(this,e,n,r)}findIndex(e){if(e==0)return If(0,e);if(e==this.size)return If(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?If(n+1,i):If(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 q.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new q(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return q.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 q(n||e,r)}static from(e){if(!e)return q.empty;if(e instanceof q)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new q([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}q.empty=new q([],0);const Lv={index:0,offset:0};function If(t,e){return Lv.index=t,Lv.offset=e,Lv}function wm(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(!wm(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!wm(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ct=class p0{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&&wm(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return p0.none;if(e instanceof p0)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};ct.none=[];class km extends Error{}class oe{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=$P(this.content,e+this.openStart,n);return r&&new oe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new oe(zP(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 oe.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 oe(q.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 oe(e,r,s)}}oe.empty=new oe(q.empty,0,0);function zP(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(zP(i.content,e-s-1,n-s-1)))}function $P(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=$P(o.content,e-i-1,n,o);return a&&t.replaceChild(s,o.copy(a))}function oQ(t,e,n){if(n.openStart>t.depth)throw new km("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new km("Inconsistent open depths");return FP(t,e,n,0)}function FP(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=FP(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 Ha(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=aQ(n,t);return Ha(i,qP(t,o,a,e,r))}else return Ha(i,Sm(t,e,r))}function BP(t,e){if(!e.type.compatibleContent(t.type))throw new km("Cannot join "+e.type.n
vendor: 12,248 bytes, lines 542-543
542ame+" onto "+t.type.name)}function m0(t,e,n){let r=t.node(n);return BP(r,e.node(n)),r}function Va(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 Nd(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&&(Va(t.nodeAfter,r),i++));for(let a=i;a<o;a++)Va(s.child(a),r);e&&e.depth==n&&e.textOffset&&Va(e.nodeBefore,r)}function Ha(t,e){return t.type.checkContent(e),t.copy(e)}function qP(t,e,n,r,s){let i=t.depth>s&&m0(t,e,s+1),o=r.depth>s&&m0(n,r,s+1),a=[];return Nd(null,t,s,a),i&&o&&e.index(s)==n.index(s)?(BP(i,o),Va(Ha(i,qP(t,e,n,r,s+1)),a)):(i&&Va(Ha(i,Sm(t,e,s+1)),a),Nd(e,n,s,a),o&&Va(Ha(o,Sm(n,r,s+1)),a)),Nd(r,null,s,a),new q(a)}function Sm(t,e,n){let r=[];if(Nd(null,t,n,r),t.depth>n){let s=m0(t,e,n+1);Va(Ha(s,Sm(t,e,n+1)),r)}return Nd(e,null,n,r),new q(r)}function aQ(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(q.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class gh{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 ct.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 Em(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 gh(n,r,i)}static resolveCached(e,n){let r=ON.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 ON.set(e,r=new lQ);let s=r.elts[r.i]=gh.resolve(e,n);return r.i=(r.i+1)%cQ,s}}class lQ{constructor(){this.elts=[],this.i=0}}const cQ=12,ON=new WeakMap;class Em{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 uQ=Object.create(null);let Io=class g0{constructor(e,n,r,s=ct.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||q.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&&wm(this.attrs,n||e.defaultAttrs||uQ)&&ct.sameSet(this.marks,r||ct.none)}copy(e=null){return e==this.content?this:new g0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new g0(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 oe.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 oe(c,s.depth-o,i.depth-o)}replace(e,n,r){return oQ(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 gh.resolveCached(this,e)}resolveNoCache(e){return gh.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()+")"),UP(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=q.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=ct.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(!ct.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let 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=q.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};Io.prototype.text=void 0;class Cm extends Io{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):UP(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 Cm(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Cm(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 UP(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class hl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new dQ(e,n);if(r.next==null)return hl.empty;let s=VP(r);r.next&&r.err("Unexpected trailing text");let i=vQ(yQ(s));return xQ(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 q.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:d,next:h}=o.next[c];if(!(d.isText||d.hasRequiredAttrs())&&s.indexOf(h)==-1){s.push(h);let f=i(h,a.concat(d));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(`
543`)}}hl.empty=new hl(!0);class dQ{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?
vendor: 5,506 bytes, line 543
543=\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 VP(t){let e=[];do e.push(hQ(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function hQ(t){let e=[];do e.push(fQ(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function fQ(t){let e=gQ(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=pQ(t,e);else break;return e}function PN(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function pQ(t,e){let n=PN(t),r=n;return t.eat(",")&&(t.next!="}"?r=PN(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function mQ(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 gQ(t){if(t.eat("(")){let e=VP(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=mQ(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 yQ(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 d=n();s(i(o.expr,l),d),l=d}if(o.max==-1)s(i(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let d=n();r(l,d),s(i(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function HP(t,e){return e-t}function IN(t,e){let n=[];return r(e),n.sort(HP);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 vQ(t){let e=Object.create(null);return n(IN(t,0));function n(r){let s=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<s.length;d++)s[d][0]==a&&(c=s[d][1]);IN(t,l).forEach(d=>{c||s.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=e[r.join(",")]=new hl(r.indexOf(t.length-1)>-1);for(let o=0;o<s.length;o++){let a=s[o][1].sort(HP);i.next.push({type:s[o][0],next:e[a.join(",")]||n(a)})}return i}}function xQ(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 WP(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 GP(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 KP(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 JP(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new wQ(t,r,e[r]);return n}let DN=class QP{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=JP(e,r.attrs),this.defaultAttrs=WP(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==hl.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:GP(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Io(this,this.computeAttrs(e),q.from(n),ct.setFrom(r))}createChecked(e=null,n,r){return n=q.from(n),this.checkContent(n),new Io(this,this.computeAttrs(e),n,ct.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=q.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(q.empty,!0);return i?new Io(this,e,n.append(i),ct.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);
vendor: 10,492 bytes, lines 543-545
543if(!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){KP(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:ct.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,o)=>r[i]=new QP(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 bQ(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 wQ{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?bQ(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ry{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=JP(e,s.attrs),this.excluded=null;let i=WP(this.attrs);this.instance=i?new ct(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ct(this,GP(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new ry(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){KP(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class YP{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=mn.from(e.nodes),n.marks=mn.from(e.marks||{}),this.nodes=DN.compile(this.spec.nodes,this),this.marks=ry.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]=hl.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?LN(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:LN(this,o.split(" "))}this.nodeFromJSON=s=>Io.fromJSON(this,s),this.markFromJSON=s=>ct.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 DN){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 Cm(r,r.defaultAttrs,e,ct.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function LN(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],i=t.marks[s],o=i;if(i)n.push(i);else for(let a in t.marks){let 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 kQ(t){return t.tag!=null}function SQ(t){return t.style!=null}let _d=class y0{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(kQ(s))this.tags.push(s);else if(SQ(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 $N(this,n,!1);return r.addAll(e,ct.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new $N(this,n,!0);return r.addAll(e,ct.none,n.from,n.to),oe.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(NQ(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=FN(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=FN(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new y0(e,y0.schemaRules(e)))}};const ZP={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},EQ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},XP={ol:!0,ul:!0},yh=1,v0=2,Td=4;function zN(t,e,n){return e!=null?(e?yh:0)|(e==="full"?v0:0):t&&t.whitespace=="pre"?yh|v0:n&~Td}class Df{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=ct.none,this.match=i||(o&Td?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(q.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&yh)){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=q.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(q.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&&!ZP.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class $N{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=zN(null,n.preserveWhitespace,0)|(r?Td:0);s?i=new Df(s.type,s.attrs,ct.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new Df(null,null,ct.none,!0,null,o):i=new Df(e.schema.topNodeType,null,ct.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&v0?"full":this.localPreserveWS||(s.options&yh)>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,`
544`);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;XP.hasOwnProperty(o)&&this.parser.normalizeLists&&CQ(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:EQ.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,d=this.needsBlock;if(ZP.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 h=l&&l.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),c&&this.sync(i),this.needsBlock=d}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(`
545`),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 545
545if(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=ct.none;for(let a of s.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):BN(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=zN(e,i,o.options);o.options&Td&&o.content.length==0&&(a|=Td);let l=ct.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):BN(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Df(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|=yh)}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 d=l>0||l==0&&s?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!d||d.name!=c&&!d.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,668 bytes, line 545
545if(r.isTextblock&&r.defaultAttrs)return r}}}function CQ(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&XP.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function NQ(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function FN(t){let e={};for(let n in t)e[n]=t[n];return e}function BN(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:d}=a.edge(l);if(c==e||i.indexOf(d)<0&&o(d))return!0}};if(o(s.contentMatch))return!0}}class kl{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=zv(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++],d=this.serializeMark(c,o.isInline,n);d&&(i.push([c,s]),s.appendChild(d.dom),s=d.contentDOM||d.dom)}}s.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:s}=xp(zv(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&&xp(zv(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return xp(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new kl(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=qN(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return qN(e.marks)}}function qN(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function zv(t){return t.document||window.document}const UN=new WeakMap;function _Q(t){let e=UN.get(t);return e===void 0&&UN.set(t,e=TQ(t)),e}function TQ(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 xp(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=_Q(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],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let h in c)if(c[h]!=null){let f=h.indexOf(" ");f>0?l.setAttributeNS(h.slice(0,f),h.slice(f+1),c[h]):h=="style"&&l.style?l.style.cssText=c[h]:l.setAttribute(h,c[h])}}for(let h=d;h<e.length;h++){let f=e[h];if(f===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:g}=xp(t,f,n,r);if(l.appendChild(p),g){if(a)throw new RangeError("Multiple content holes");a=g}}}return{dom:l,contentDOM:a}}const eI=65535,tI=Math.pow(2,16);function AQ(t,e){return t+e*tI}function VN(t){return t&eI}function jQ(t){return(t-(t&eI))/tI}const nI=1,rI=2,bp=4,sI=8;class x0{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&sI)>0}get deletedBefore(){return(this.delInfo&(nI|bp))>0}get deletedAfter(){return(this.delInfo&(rI|bp))>0}get deletedAcross(){return(this.delInfo&bp)>0}}class xr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&xr.empty)return xr.empty}recover(e){let n=0,r=VN(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+jQ(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],d=this.ranges[a+o],h=l+c;if(e<=h){let f=c?e==l?-1:e==h?1:n:n,p=l+s+(f<0?0:d);if(r)return p;let g=e==(n<0?l:h)?null:AQ(a/3,e-l),m=e==l?rI:e==h?nI:bp;return(n<0?e!=l:e!=h)&&(m|=sI),new x0(p,m,g)}s+=d-c}return r?e+s:new x0(e+s,0,null)}touches(e,n){let r=0,s=VN(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],d=l+c;if(e<=d&&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],d=this.ranges[s+r];e(a,a+c,l,l+d),i+=d-c}}invert(){return new xr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?xr.empty:new xr(e<0?[0,-e,0]:[0,0,e])}}xr.empty=new xr([]);class vh{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 vh(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 vh;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 x0(e,s,null)}}const $v=Object.create(null);class Rn{getMap(){return xr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=$v[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 $v)throw new RangeError("Duplicate use of step JSON ID "+e);return $v[e]=n,n.prototype.jsonID=e,n}}class Vt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Vt(e,null)}static fail(e){return new Vt(null,e)}static fromReplace(e,n,r,s){try{return Vt.ok(e.replace(n,r,s))}catch(i){if(i instanceof km)return Vt.fail(i.message);throw i}}}function i1(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(i1(i.content,e,i))),i.isInline&&(i=e(i,n,s)),r.push(i)}return q.fromArray(r)}class wo extends Rn{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 oe(i1(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 Vt.fromReplace(e,this.from,this.to,i)}invert(){return new fs(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 wo(n.pos,r.pos,this.mark)}merge(e){return e instanceof wo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wo(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 wo(n.from,n.to,e.markFromJSON(n.mark))}}Rn.jsonID("addMark",wo);class fs extends Rn{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 oe(i1(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return Vt.fromReplace(e,this.from,this.to,r)}invert(){return new wo(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 fs(n.pos,r.pos,this.mark)}merge(e){return e instanceof fs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fs(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 fs(n.from,n.to,e.markFromJSON(n.mark))}}Rn.jsonID("removeMark",fs);class ko extends Rn{constructor(e,n){super(),this.pos=e,this.mark=n}
vendor: 5,284 bytes, line 545
545apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new oe(q.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 ko(this.pos,n.marks[s]);return new ko(this.pos,this.mark)}}return new fl(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ko(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 ko(n.pos,e.markFromJSON(n.mark))}}Rn.jsonID("addNodeMark",ko);class fl extends Rn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new oe(q.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ko(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new fl(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 fl(n.pos,e.markFromJSON(n.mark))}}Rn.jsonID("removeNodeMark",fl);class tn extends Rn{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&b0(e,this.from,this.to)?Vt.fail("Structure replace would overwrite content"):Vt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xr([this.from,this.to-this.from,this.slice.size])}invert(e){return new tn(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 tn(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof tn)||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?oe.empty:new oe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new tn(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?oe.empty:new oe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new tn(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 tn(n.from,n.to,oe.fromJSON(e,n.slice),!!n.structure)}}Rn.jsonID("replace",tn);class sn extends Rn{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&&(b0(e,this.from,this.gapFrom)||b0(e,this.gapTo,this.to)))return Vt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Vt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Vt.fromReplace(e,this.from,this.to,r):Vt.fail("Content does not fit in gap")}getMap(){return new xr([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 sn(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 sn(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 sn(n.from,n.to,n.gapFrom,n.gapTo,oe.fromJSON(e,n.slice),n.insert,!!n.structure)}}Rn.jsonID("replaceAround",sn);function b0(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 RQ(t,e,n,r){let s=[],i=[],o,a;t.doc.nodesBetween(e,n,(l,c,d)=>
vendor: 7,720 bytes, lines 545-546
545{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,n),g=r.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(g)||(o&&o.to==f&&o.mark.eq(h[m])?o.to=p:s.push(o=new fs(f,p,h[m])));a&&a.to==f?a.to=p:i.push(a=new wo(f,p,r))}}),s.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function MQ(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 ry){let c=o.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.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 d=0;d<l.length;d++){let h=l[d],f;for(let p=0;p<s.length;p++){let g=s[p];g.step==i-1&&h.eq(s[p].style)&&(f=g)}f?(f.to=c,f.step=i):s.push({style:h,from:Math.max(a,e),to:c,step:i})}}}),s.forEach(o=>t.step(new fs(o.from,o.to,o.style)))}function o1(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),d=a+c.nodeSize,h=r.matchType(c.type);if(!h)o.push(new tn(a,d,oe.empty));else{r=h;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new fs(a,d,c.marks[f]));if(s&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,g;for(;f=p.exec(c.text);)g||(g=new oe(q.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new tn(a+f.index,a+f.index+f[0].length,g))}}a=d}if(!r.validEnd){let l=r.fillBefore(q.empty,!0);t.replace(a,a,new oe(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function OQ(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Nu(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||!OQ(o,a,l))break;a&&(s=1),l<o.childCount&&(i=1)}return null}function PQ(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,d=q.empty,h=0;for(let g=i,m=!1;g>n;g--)m||r.index(g)>0?(m=!0,d=q.from(r.node(g).copy(d)),h++):l--;let f=q.empty,p=0;for(let g=i,m=!1;g>n;g--)m||s.after(g+1)<s.end(g)?(m=!0,f=q.from(s.node(g).copy(f)),p++):c++;t.step(new sn(l,c,o,a,new oe(d.append(f),h,p),d.size-h,!0))}function a1(t,e,n=null,r=t){let s=IQ(t,e),i=s&&DQ(r,e);return i?s.map(HN).concat({type:e,attrs:n}).concat(i.map(HN)):null}function HN(t){return{type:t,attrs:null}}function IQ(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 DQ(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 LQ(t,e,n){let r=q.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=q.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new sn(s,i,s,i,new oe(r,0,0),n.length,!0))}function zQ(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)&&$Q(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",g=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!g?c=!1:!p&&g&&(c=!0)}c===!1&&oI(t,o,a,i),o1(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let d=t.mapping.slice(i),h=d.map(a,1),f=d.map(a+o.nodeSize,1);return t.step(new sn(h,f,h+1,f-1,new oe(q.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&iI(t,o,a,i),!1}})}function iI(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 oI(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(`
546`))}})}function $Q(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function FQ(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 sn(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new oe(q.from(o),0,0),1,!0))}function Tc(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,d=n-2;c>i;c--,d--){let h=s.node(c),f=s.index(c);if(h.type.spec.isolating)return!1;let p=h.content.cutByIndex(f,h.childCount),g=r&&r[d+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let m=r&&r[d]||h;if(!h.canReplace(f+1,h.childCount)||!m.type.validContent(p))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 BQ(t,e,n=1,r){let s=t.doc.resolve(e),i=q.empty,o=q.empty;for(let a=s.depth,l=s.depth-n,c=n-1;a>l;a--,c--){i=q.from(s.node(a).copy(i));let d=r&&r[c];o=q.from(d?d.type.create(d.attrs,o):s.node(a).copy(o))}t.step(new tn(e,e,new oe(i.append(o),n,n),!0))}function na(t,e){let n=t.resolve(e),r=n.index();return aI(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function qQ(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 aI(t,e){return!!(t&&e&&!t.isLeaf&&qQ(t,e))}function sy(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&&aI(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 UQ(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(s);d&&!h?r=!1:!d&&h&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);oI(t,d.node(),d.before(),a)}o.inlineContent&&o1(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 tn(c,l.map(e+n,-1),oe.empty,!0)),r===!0){let d=t.doc.resolve(c);iI(t,d.node(),d.before(),t.steps.length)}return t}function VQ(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 lI(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: 11,051 bytes, line 546
546index(o)+(a>0?1:0),c=r.node(o),d=!1;if(i==1)d=c.canReplace(l,l,s);else{let h=c.contentMatchAt(l).findWrapping(s.firstChild.type);d=h&&c.canReplaceWith(l,l,h[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function iy(t,e,n=e,r=oe.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return cI(s,i,r)?new tn(e,n,r):new HQ(s,i,r).fit()}function cI(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class HQ{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=q.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=q.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 oe(i,o,a);return e>-1?new sn(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new tn(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=Fv(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],d,h=null;if(n==1&&(o?c.matchType(o.type)||(h=c.fillBefore(q.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:h};if(n==2&&o&&(d=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:d};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=Fv(e,n);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new oe(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=Fv(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new oe(ad(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new oe(ad(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,c=0,d=[],{match:h,type:f}=this.frontier[n];if(s){for(let m=0;m<s.childCount;m++)d.push(s.child(m));h=h.matchFragment(s)}let p=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let m=a.child(c),y=h.matchType(m.type);if(!y)break;c++,(c>1||l==0||m.content.size)&&(h=y,d.push(uI(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let g=c==a.childCount;g||(p=-1),this.placed=ld(this.placed,n,q.from(d)),this.frontier[n].match=h,g&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=a;m<p;m++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=v.content}this.unplaced=g?e==0?oe.empty:new oe(ad(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new oe(ad(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||!Bv(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=Bv(e,n,s,r,i);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=Bv(e,a,c,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ld(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=ld(this.placed,this.depth,q.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(q.empty,!0);n.childCount&&(this.placed=ld(this.placed,this.frontier.length,n))}}function ad(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ad(t.firstChild.content,e-1,n)))}function ld(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ld(t.lastChild.content,e-1,n)))}function Fv(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function uI(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,uI(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(q.empty,!0)))),t.copy(r)}function Bv(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&&!WQ(n,i.content,o)?a:null}function WQ(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function GQ(t){return t.spec.defining||t.spec.definingForContent}function KQ(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),i=t.doc.resolve(n);if(cI(s,i,r))return t.step(new tn(e,n,r));let o=hI(s,i);o[o.length-1]==0&&o.pop();let a=-(s.depth+1);o.unshift(a);for(let f=s.depth,p=s.pos-1;f>0;f--,p--){let g=s.node(f).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(f)>-1?a=f:s.before(f)==p&&o.splice(1,0,-f)}let l=o.indexOf(a),c=[],d=r.openStart;for(let f=r.content,p=0;;p++){let g=f.firstChild;if(c.push(g),p==r.openStart)break;f=g.content}for(let f=d-1;f>=0;f--){let p=c[f],g=GQ(p.type);if(g&&!p.sameMarkup(s.node(Math.abs(a)-1)))d=f;else if(g||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+d+1)%(r.openStart+1),g=c[p];if(g)for(let m=0;m<o.length;m++){let y=o[(m+l)%o.length],v=!0;y<0&&(v=!1,y=-y);let x=s.node(y-1),w=s.index(y-1);if(x.canReplaceWith(w,w,g.type,g.marks))return t.replace(s.before(y),v?i.after(y):n,new oe(dI(r.content,0,r.openStart,p),p,r.openEnd))}}let h=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>h));f--){let p=o[f];p<0||(e=s.before(p),n=i.after(p))}}function dI(t,e,n,r,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(dI(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(q.empty,!0))}return t}function JQ(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=VQ(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new oe(q.from(r),0,0))}function QQ(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n),i=hI(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 hI(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 Ac extends Rn{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 Vt.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 Vt.fromReplace(e,this.pos,this.pos+1,new oe(q.from(s),0,n.isLeaf?0:1))}getMap(){return xr.empty}invert(e){return new Ac(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 Ac(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 Ac(n.pos,n.attr,n.value)}}Rn.jsonID("attr",Ac);class xh extends Rn{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 Vt.ok(r)}getMap(){return xr.empty}invert(e){return new xh(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 xh(n.attr,n.value)}}Rn.jsonID("docAttr",xh);let au=class extends Error{};au=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};au.prototype=Object.create(Error.prototype);au.prototype.constructor=au;au.prototype.name="TransformError";class fI{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new vh}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new au(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}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=oe.empty){let s=iy(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new oe(q.from(r),0,0))}delete(e,n){return this.replace(e,n,oe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return KQ(this,e,n,r),this}replaceRangeWith(e,n,r){return JQ(this,e,n,r),this}deleteRange(e,n){return QQ(this,e,n),this}lift(e,n){return PQ(this,e,n),this}join(e,n=1){return UQ(this,e,n),this}wrap(e,n){return LQ(this,e,n),this}setBlockType(e,n=e,r,s=null){return zQ(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return FQ(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new Ac(e,n,r)),this}setDocAttribute(e,n){return this.step(new xh(e,n)),this}addNodeMark(e,n){return this.step(new ko(e,n)),this}
vendor: 5,108 bytes, line 546
546removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof ct)n.isInSet(r.marks)&&this.step(new fl(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new fl(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 BQ(this,e,n,r),this}addMark(e,n,r){return RQ(this,e,n,r),this}removeMark(e,n,r){return MQ(this,e,n,r),this}clearIncompatible(e,n,r){return o1(this,e,n,r),this}}const qv=Object.create(null);class Fe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new YQ(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=oe.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],d=e.mapping.slice(i);e.replaceRange(d.map(l.pos),d.map(c.pos),a?oe.empty:n),a==0&&KN(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),d=l.map(a.pos);i?e.deleteRange(c,d):(e.replaceRangeWith(c,d,n),KN(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let s=e.parent.inlineContent?new Re(e):Ql(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?Ql(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Ql(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 qr(e.node(0))}static atStart(e){return Ql(e,e,0,0,1)||new qr(e)}static atEnd(e){return Ql(e,e,e.content.size,e.childCount,-1)||new qr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=qv[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 qv)throw new RangeError("Duplicate use of selection JSON ID "+e);return qv[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Re.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class YQ{constructor(e,n){this.$from=e,this.$to=n}}let WN=!1;function GN(t){!WN&&!t.parent.inlineContent&&(WN=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Re extends Fe{constructor(e,n=e){GN(e),GN(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 Fe.near(r);let s=e.resolve(n.map(this.anchor));return new Re(s.parent.inlineContent?s:r,r)}replace(e,n=oe.empty){if(super.replace(e,n),n==oe.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Re&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new oy(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 Re(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=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(i)n=i.$head;else return Fe.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(Fe.findFrom(e,-r,!0)||Fe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=s<0&&(e=n))),new Re(e,n)}}Fe.jsonID("text",Re);class oy{constructor(e,n){this.anchor=e,this.head=n}map(e){return new oy(e.map(this.anchor),e.map(this.head))}resolve(e){return Re.between(e.resolve(this.anchor),e.resolve(this.head))}}class Se extends Fe{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?Fe.near(i):new Se(i)}content(){return new oe(q.from(this.node),0,0)}eq(e){return e instanceof Se&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new l1(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Se(e.resolve(n.anchor))}static create(e,n){return new Se(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Se.prototype.visible=!1;Fe.jsonID("node",Se);class l1{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new oy(r,r):new l1(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Se.isSelectable(r)?new Se(n):Fe.near(n)}}class qr extends Fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}
vendor: 4,243 bytes, line 546
546replace(e,n=oe.empty){if(n==oe.empty){e.delete(0,e.doc.content.size);let r=Fe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new qr(e)}map(e){return new qr(e)}eq(e){return e instanceof qr}getBookmark(){return ZQ}}Fe.jsonID("all",qr);const ZQ={map(){return this},resolve(t){return new qr(t)}};function Ql(t,e,n,r,s,i=!1){if(e.inlineContent)return Re.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&&Se.isSelectable(a))return Se.create(t,n-(s<0?a.nodeSize:0))}else{let l=Ql(t,a,n+s,s<0?a.childCount:0,s,i);if(l)return l}n+=a.nodeSize*s}return null}function KN(t,e,n){let r=t.steps.length-1;if(r<e)return;let s=t.steps[r];if(!(s instanceof tn||s instanceof sn))return;let i=t.mapping.maps[r],o;i.forEach((a,l,c,d)=>{o==null&&(o=d)}),t.setSelection(Fe.near(t.doc.resolve(o),n))}const JN=1,Lf=2,QN=4;class XQ extends fI{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|JN)&~Lf,this.storedMarks=null,this}get selectionSet(){return(this.updated&JN)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Lf,this}ensureMarks(e){return ct.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&Lf)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Lf,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)||ct.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(Fe.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|=QN,this}get scrolledIntoView(){return(this.updated&QN)>0}}function YN(t,e){return!e||!t?t:t.bind(e)}class cd{constructor(e,n,r){this.name=e,this.init=YN(n.init,r),this.apply=YN(n.apply,r)}}const eY=[new cd("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new cd("selection",{init(t,e){return t.selection||Fe.atStart(e.doc)},apply(t){return t.selection}}),new cd("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new cd("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Uv{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eY.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 cd(r.key,r.spec.state,r))})}}class pc{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
vendor: 14,101 bytes, lines 546-547
546apply(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,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!s){s=[];for(let h=0;h<this.config.plugins.length;h++)s.push(h<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),i=!0}s&&(s[o]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new pc(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 XQ(this)}static create(e){let n=new Uv(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new pc(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 Uv(this.schema,e.plugins),r=n.fields,s=new pc(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 Uv(e.schema,e.plugins),i=new pc(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Io.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=Fe.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 pI(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=pI(s,e,{})),n[r]=s}return n}class Et{constructor(e){this.spec=e,this.props={},e.props&&pI(e.props,this,this.props),this.key=e.key?e.key.key:mI("plugin")}getState(e){return e[this.key]}}const Vv=Object.create(null);function mI(t){return t in Vv?t+"$"+ ++Vv[t]:(Vv[t]=0,t+"$")}class Zt{constructor(e="key"){this.key=mI(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const tY=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function gI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const nY=(t,e,n)=>{let r=gI(t,n);if(!r)return!1;let s=c1(r);if(!s){let o=r.blockRange(),a=o&&Nu(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let i=s.nodeBefore;if(bI(t,s,e,-1))return!0;if(r.parent.content.size==0&&(lu(i,"end")||Se.isSelectable(i)))for(let o=r.depth;;o--){let a=iy(t.doc,r.before(o),r.after(o),oe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(lu(i,"end")?Fe.findFrom(l.doc.resolve(l.mapping.map(s.pos,-1)),-1):Se.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},rY=(t,e,n)=>{let r=gI(t,n);if(!r)return!1;let s=c1(r);return s?yI(t,s,e):!1},sY=(t,e,n)=>{let r=vI(t,n);if(!r)return!1;let s=u1(r);return s?yI(t,s,e):!1};function yI(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let d=s.lastChild;if(!d)return!1;s=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=iy(t.doc,i,l,oe.empty);if(!c||c.from!=i||c instanceof tn&&c.slice.size>=l-i)return!1;if(n){let d=t.tr.step(c);d.setSelection(Re.create(d.doc,i)),n(d.scrollIntoView())}return!0}function lu(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 iY=(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=c1(r)}let o=i&&i.nodeBefore;return!o||!Se.isSelectable(o)?!1:(e&&e(t.tr.setSelection(Se.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function c1(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 vI(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const oY=(t,e,n)=>{let r=vI(t,n);if(!r)return!1;let s=u1(r);if(!s)return!1;let i=s.nodeAfter;if(bI(t,s,e,1))return!0;if(r.parent.content.size==0&&(lu(i,"start")||Se.isSelectable(i))){let o=iy(t.doc,r.before(),r.after(),oe.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(lu(i,"start")?Fe.findFrom(a.doc.resolve(a.mapping.map(s.pos)),1):Se.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},aY=(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=u1(r)}let o=i&&i.nodeAfter;return!o||!Se.isSelectable(o)?!1:(e&&e(t.tr.setSelection(Se.create(t.doc,i.pos)).scrollIntoView()),!0)};function u1(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 lY=(t,e)=>{let n=t.selection,r=n instanceof Se,s;if(r){if(n.node.isTextblock||!na(t.doc,n.from))return!1;s=n.from}else if(s=sy(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(Se.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},cY=(t,e)=>{let n=t.selection,r;if(n instanceof Se){if(n.node.isTextblock||!na(t.doc,n.to))return!1;r=n.to}else if(r=sy(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},uY=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&Nu(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},dY=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
547`).scrollIntoView()),!0)};function xI(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 hY=(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=xI(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(Fe.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},fY=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof qr||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=xI(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(Re.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},pY=(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(Tc(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&Nu(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)},mY=(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(Se.create(t.doc,s))),!0)};function gY(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||na(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function bI(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,a,l=s.type.spec.isolating||i.type.spec.isolating;if(!l&&gY(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 p=e.pos+i.nodeSize,g=q.empty;for(let v=o.length-1;v>=0;v--)g=q.from(o[v].create(null,g));g=q.from(s.copy(g));let m=t.tr.step(new sn(e.pos-1,p,e.pos,p,new oe(g,1,0),o.length,!0)),y=m.doc.resolve(p+2*o.length);y.nodeAfter&&y.nodeAfter.type==s.type&&na(m.doc,y.pos)&&m.join(y.pos),n(m.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&l?null:Fe.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),f=h&&Nu(h);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(h,f).scrollIntoView()),!0;if(c&&lu(i,"start",!0)&&lu(s,"end")){let p=s,g=[];for(;g.push(p),!p.isTextblock;)p=p.lastChild;let m=i,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let v=q.empty;for(let w=g.length-1;w>=0;w--)v=q.from(g[w].copy(v));let x=t.tr.step(new sn(e.pos-g.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new oe(v,g.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function wI(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(Re.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const yY=wI(-1),vY=wI(1);function xY(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),a=o&&a1(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function ZN(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 d=n.doc.resolve(c),h=d.index();s=d.parent.canReplaceWith(h,h+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos: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 bY(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 wY(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function wY(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 Em(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Em(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),s=!0}let a=a1(i,n,r,e);return a?(t&&kY(t,e,a,s,n),!0):!1}function kY(t,e,n,r,s){let i=q.empty;for(let d=n.length-1;d>=0;d--)i=q.from(n[d].type.create(n[d].attrs,i));t.step(new sn(e.start-(r?2:0),e.end,e.start,e.end,new oe(i,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==s&&(o=d+1);let a=n.length-o,l=e.start+n.length-(r?2:0),c=e.parent;for(let d=e.startIndex,h=e.endIndex,f=!0;d<h;d++,f=!1)!f&&Tc(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function SY(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?EY(e,n,t,i):CY(e,n,i):!0:!1}}function EY(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);i<o&&(s.step(new sn(i-1,o,i,o,new oe(q.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Em(s.doc.resolve(r.$from.pos),s.doc.resolve(o),r.depth));const a=Nu(r);if(a==null)return!1;s.lift(r,a);let l=s.doc.resolve(s.mapping.map(i,-1)-1);return na(s.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&s.join(l.pos),e(s.scrollIntoView()),!0}function CY(t,e,n){let r=t.tr,s=n.parent;for(let p=n.end,g=n.endIndex-1,m=n.startIndex;g>m;g--)p-=s.child(g).nodeSize,r.delete(p-1,p+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),d=i.index(-1);if(!c.canReplace(d+(a?0:1),d+1,o.content.append(l?q.empty:q.from(s))))return!1;let h=i.pos,f=h+o.nodeSize;return r.step(new sn(h-(a?1:0),f+(l?1:0),h+1,f-1,new oe((a?q.empty:q.from(s.copy(q.empty))).append(l?q.empty:q.from(s.copy(q.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function NY(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,d=q.from(c?t.create():null),h=new oe(q.from(t.create(null,q.from(a.type.create(null,d)))),c?3:1,0),f=i.start,p=i.end;n(e.tr.step(new sn(f-(c?3:1),p,f,p,h,1,!0)).scrollIntoView())}return!0}}const gn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},cu=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let w0=null;const fi=function(t,e,n){let r=w0||(w0=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},_Y=function(){w0=null},pl=function(t,e,n,r){return n&&(XN(t,e,n,r,-1)||XN(t,e,n,r,1))},TY=/^(img|br|input|textarea|hr)$/i;function XN(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;
vendor: 5,457 bytes, line 547
547if(e==(s<0?0:$r(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Gh(t)||TY.test(t.nodeName)||t.contentEditable=="false")return!1;e=gn(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?$r(t):0}else return!1}}function $r(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function AY(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=$r(t)}else if(t.parentNode&&!Gh(t))e=gn(t),t=t.parentNode;else return null}}function jY(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&&!Gh(t))e=gn(t)+1,t=t.parentNode;else return null}}function RY(t,e,n){for(let r=e==0,s=e==$r(t);r||s;){if(t==n)return!0;let i=gn(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,s=s&&i==$r(t)}}function Gh(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 ay=function(t){return t.focusNode&&pl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ba(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function MY(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function OY(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min($r(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min($r(r.startContainer),r.startOffset)}}}const Qs=typeof navigator<"u"?navigator:null,e_=typeof document<"u"?document:null,ra=Qs&&Qs.userAgent||"",k0=/Edge\/(\d+)/.exec(ra),kI=/MSIE \d/.exec(ra),S0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ra),ur=!!(kI||S0||k0),Do=kI?document.documentMode:S0?+S0[1]:k0?+k0[1]:0,Ur=!ur&&/gecko\/(\d+)/i.test(ra);Ur&&+(/Firefox\/(\d+)/.exec(ra)||[0,0])[1];const E0=!ur&&/Chrome\/(\d+)/.exec(ra),nn=!!E0,SI=E0?+E0[1]:0,bn=!ur&&!!Qs&&/Apple Computer/.test(Qs.vendor),uu=bn&&(/Mobile\/\w+/.test(ra)||!!Qs&&Qs.maxTouchPoints>2),Dr=uu||(Qs?/Mac/.test(Qs.platform):!1),EI=Qs?/Win/.test(Qs.platform):!1,xi=/Android \d/.test(ra),Kh=!!e_&&"webkitFontSmoothing"in e_.documentElement.style,PY=Kh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function IY(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 oi(t,e){return typeof t=="number"?t:t[e]}function DY(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 t_(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=cu(o);continue}let a=o,l=a==i.body,c=l?IY(i):DY(a),d=0,h=0;if(e.top<c.top+oi(r,"top")?h=-(c.top-e.top+oi(s,"top")):e.bottom>c.bottom-oi(r,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+oi(s,"top")-c.top:e.bottom-c.bottom+oi(s,"bottom")),e.left<c.left+oi(r,"left")?d=-(c.left-e.left+oi(s,"left")):e.right>c.right-oi(r,"right")&&(d=e.right-c.right+oi(s,"right")),d||h)if(l)i.defaultView.scrollBy(d,h);else{let p=a.scrollLeft,g=a.scrollTop;h&&(a.scrollTop+=h),d&&(a.scrollLeft+=d);let m=a.scrollLeft-p,y=a.scrollTop-g;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}let f=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:cu(o)}}function LY(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:CI(t.dom)}}function CI(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=cu(r));return e}function zY({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;NI(n,r==0?0:r-e)}function NI(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 ql=null;function $Y(t){if(t.setActive)return t.setActive();if(ql)return t.focus(ql);let e=CI(t);t.focus(ql==null?{get preventScroll(){return ql={preventScroll:!0},!0}}:void 0),ql||(ql=!1,NI(e,0))}function _I(t,e){let n,r=2e8,s,i=0,o=e.top,a=e.top,l,c;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let f;if(d.nodeType==1)f=d.getClientRects();else if(d.nodeType==3)f=fi(d).getClientRects();else continue;for(let p=0;p<f.length;p++){let g=f[p];if(g.top<=o&&g.bottom>=a){o=Math.max(g.bottom,o),a=Math.min(g.top,a);let m=g.left>e.left?g.left-e.left:g.right<e.left?e.left-g.right:0;if(m<r){n=d,r=m,s=m&&n.nodeType==3?{left:g.right<e.left?g.right:g.left,top:e.top}:e,d.nodeType==1&&m&&(i=h+(e.left>=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!l&&g.left<=e.left&&g.right>=e.left&&(l=d,c={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!n&&(e.left>=g.right&&e.top>
vendor: 4,132 bytes, line 547
547=g.top||e.left>=g.left&&e.top>=g.bottom)&&(i=h+1)}}return!n&&l&&(n=l,s=c,r=0),n&&n.nodeType==3?FY(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:_I(n,s)}function FY(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=Wi(r,1);if(o.top!=o.bottom&&d1(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 d1(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function BY(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function qY(t,e,n){let{node:r,offset:s}=_I(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 UY(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>r.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 TI(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(d1(e,c))return TI(o,e,c)}}if((i=(i+1)%r)==s)break}return t}function VY(t,e){let n=t.dom.ownerDocument,r,s=0,i=OY(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(!d1(e,c)||(o=TI(t.dom,e,c),!o))return null}if(bn)for(let c=o;r&&c;c=cu(c))c.draggable&&(r=void 0);if(o=BY(o,e),r){if(Ur&&r.nodeType==1&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let d=r.childNodes[s],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&s++}let c;Kh&&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=UY(t,r,s,e))}a==null&&(a=qY(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function n_(t){return t.top<t.bottom||t.left<t.right}function Wi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(n_(r))return r}return Array.prototype.find.call(n,n_)||t.getBoundingClientRect()}const HY=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function AI(t,e,n){let{node:r,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),o=Kh||Ur;if(r.nodeType==3)if(o&&(HY.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let l=Wi(fi(r,s,s),n);if(Ur&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let c=Wi(fi(r,s-1,s-1),-1);if(c.top==l.top){let d=Wi(fi(r,s,s+1),-1);if(d.top!=l.top)return Qu(d,d.left<c.left)}}return l}else{let l=s,c=s,d=n<0?1:-1;return n<0&&!s?(c++,d=-1):n>=0&&s==r.nodeValue.length?(l--,d=1):n<0?l--:c++,Qu(Wi(fi(r,l,c),d),d<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==$r(r))){let l=r.childNodes[s-1];if(l.nodeType==1)return Hv(l.getBoundingClientRect(),!1)}if(i==null&&s<$r(r)){let l=r.childNodes[s];if(l.nodeType==1)return Hv(l.getBoundingClientRect(),!0)}return Hv(r.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==$r(r))){let l=r.childNodes[s-1],c=l.nodeType==3?fi(l,$r(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Qu(Wi(c,1),!1)}if(i==null&&s<$r(r)){let l=r.childNodes[s];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;
vendor: 7,423 bytes, lines 547-548
547let c=l?l.nodeType==3?fi(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return Qu(Wi(c,-1),!0)}return Qu(Wi(r.nodeType==3?fi(r):r,-n),n>=0)}function Qu(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 Hv(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 jI(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 WY(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return jI(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=AI(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=fi(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const GY=/[\u0590-\u08ac]/;function KY(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?!GY.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:o:jI(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:g,focusOffset:m}=t.domSelectionRange(),y=g&&!p.contains(g.nodeType==1?g:g.parentNode)||l==g&&c==m;try{a.collapse(d,h),l&&(l!=d||c!=h)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let r_=null,s_=null,i_=!1;function JY(t,e,n){return r_==e&&s_==n?i_:(r_=e,s_=n,i_=n=="up"||n=="down"?WY(t,e,n):KY(t,e,n))}const Vr=0,o_=1,Na=2,Ys=3;class Jh{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=Vr,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>gn(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 MI){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 RI&&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?gn(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?gn(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 d=o+l.border;if(e>=d&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let h=a;h>0;h--){let f=this.children[h-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){s=gn(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 d=a+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=gn(h.dom);break}n+=h.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 p=0,g=0;p<this.children.length;p++){let m=this.children[p],y=g+m.size;if(i>g&&o<y)return m.setSelection(e-g-m.border,n-g-m.border,r,s);g=y}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),h=!1;if((Ur||bn)&&e==n){let{node:p,offset:g}=a;if(p.nodeType==3){if(h=!!(g&&p.nodeValue[g-1]==`
548`),h&&g==p.nodeValue.length)for(let m=p,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:gn(y)+1});break}let v=m.pmViewDesc;if(v&&v.node&&v.node.isBlock)break}}else{let m=p.childNodes[g-1];h=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Ur&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(s=!0)}
vendor: 4,185 bytes, line 548
548if(!(s||h&&bn)&&pl(a.node,a.offset,d.anchorNode,d.anchorOffset)&&pl(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(h&&Ur)){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let g=a;a=l,l=g}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}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?Na:o_,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ys:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Na:Ys}r=o}this.dirty=Na}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Na:o_;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class RI extends Jh{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==Vr&&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 QY extends Jh{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 ml extends Jh{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=kl.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ml(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ys||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ys&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Vr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Vr}}slice(e,n,r){let s=ml.create(this.parent,this.mark,!0,r),i=this.children,o=this.size;n<o&&(i=N0(i,n,o,r)),e>0&&(i=N0(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 Lo extends Jh{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),d=c&&c.dom,h=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=kl.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=II(d,r,n),c?l=new YY(e,n,r,s,d,h||null,f,c,i,o+1):n.isText?new ly(e,n,r,s,d,f,i):new Lo(e,n,r,s,d,h||null,f,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;
vendor: 5,107 bytes, line 548
548let 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=()=>q.empty)}return e}matchesNode(e,n,r){return this.dirty==Vr&&e.eq(this.node)&&Nm(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new XY(this,o&&o.node,e);nZ(this.node,this.innerDeco,(c,d,h)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e,d):c.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?ct.none:this.node.child(d).marks,r,e,d),l.placeWidget(c,e,s)},(c,d,h,f)=>{l.syncToMarks(c.marks,r,e,f);let p;l.findNodeMatch(c,d,h,f)||a&&e.state.selection.from>s&&e.state.selection.to<s+c.nodeSize&&(p=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,d,h,p,e)||l.updateNextNode(c,d,h,e,f,s)||l.addNode(c,d,h,e,s),s+=c.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Na)&&(o&&this.protectLocalComposition(e,o),OI(this.contentDOM,this.children,e),uu&&rZ(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof Re)||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=sZ(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 QY(this,i,n,s);e.input.compositionNodes.push(o),this.children=N0(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==Ys||!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=Vr}updateOuterDeco(e){if(Nm(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=PI(this.dom,this.nodeDOM,C0(this.outerDeco,this.node,n),C0(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 a_(t,e,n,r,s){II(r,e,t);let i=new Lo(void 0,t,e,n,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class ly extends Lo{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==Ys||this.dirty!=Vr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Vr||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=Vr,!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 ly(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=Ys)}get domAtom(){return!1}isText(e){return this.node.text==e}}class MI extends Jh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Vr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class YY extends Lo{constructor(e,n,r,s,i,o,a,l,c,d){super(e,n,r,s,i,o,a,c,d),this.spec=l}update(e,n,r,s){if(this.dirty==Ys)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}
vendor: 7,882 bytes, line 548
548setSelection(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 OI(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=l_(r),s=!0;r=r.nextSibling}else s=!0,t.insertBefore(a,r);if(o instanceof ml){let l=r?r.previousSibling:t.lastChild;OI(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=l_(r),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const Ad=function(t){t&&(this.nodeName=t)};Ad.prototype=Object.create(null);const _a=[new Ad];function C0(t,e,n){if(t.length==0)return _a;let r=n?_a[0]:new Ad,s=[r];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&s.push(r=new Ad(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&s.length==1&&s.push(r=new Ad(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 PI(t,e,n,r){if(n==_a&&r==_a)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=_a[0]),s=l}ZY(s,a||_a[0],o)}return s}function ZY(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 II(t,e,n){return PI(t,t,_a,C0(e,n,t.nodeType!=1))}function Nm(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 l_(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class XY{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=eZ(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=Vr,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 d=this.index;d<c;d++){let h=this.top.children[d];if(h.matchesMark(e[o])&&!this.isLocked(h.dom)){l=d;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=ml.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=this.top.children.indexOf(o,this.index);else for(let a=this.index,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==Ys&&o.dom==o.contentDOM&&(o.dirty=Na),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 Lo){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let d=l.dom,h,f=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Ys&&Nm(n,l.outerDeco));if(!f&&l.update(e,n,r,s))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!f&&(h=this.recreateWrapper(l,e,n,r,s,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Na,h.updateChildren(s,o+1),h.dirty=Vr),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)||!Nm(r,e.outerDeco)||!s.eq(e.innerDeco))return null;let a=Lo.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=Lo.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 RI(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 ml;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ly)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((bn||nn)&&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 MI(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 eZ(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 ml)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 tZ(t,e){return t.type.side-e.type.side}function nZ(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,s,e.forChild(i,d),c),i+=d.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let d,h;for(;o<s.length&&s[o].to==i;){let y=s[o++];y.widget&&(d?(h||(h=[d])).push(y):d=y)}if(d)if(h){h.sort(tZ);for(let y=0;y<h.length;y++)n(h[y],c,!!l)}else n(d,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<t.childCount)p=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 g=i+f.nodeSize;if(f.isText){let y=g;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<g&&(l=f.cut(y-i),f=f.cut(0,y-i),g=y,p=-1)}else for(;o<s.length&&s[o].to<g;)o++;let m=f.isInline&&!f.isLeaf?a.filter(y=>!y.inline):a.slice();r(f,m,e.forChild(i,f),p),i=g}}
vendor: 9,551 bytes, line 548
548function rZ(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 sZ(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 N0(t,e,n,r,s){let i=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],c=a,d=a+=l.size;c>=n||d<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),s&&(i.push(s),s=void 0),d>n&&i.push(l.slice(n-c,l.size,r)))}return i}function h1(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(ay(n)){for(l=o;s&&!s.node;)s=s.parent;let h=s.node;if(s&&h.isAtom&&Se.isSelectable(h)&&s.parent&&!(h.isInline&&RY(n.focusNode,n.focusOffset,s.dom))){let f=s.posBefore;c=new Se(o==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,f=o;for(let p=0;p<n.rangeCount;p++){let g=n.getRangeAt(p);h=Math.min(h,t.docView.posFromDOM(g.startContainer,g.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(h<0)return null;[l,o]=f==t.state.selection.anchor?[f,h]:[h,f],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let h=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=f1(t,d,a,h)}return c}function DI(t){return t.editable?t.hasFocus():zI(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Si(t,e=!1){let n=t.state.selection;if(LI(t,n),!!DI(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&nn){let r=t.domSelectionRange(),s=t.domObserver.currentSelection;if(r.anchorNode&&s.anchorNode&&pl(r.anchorNode,r.anchorOffset,s.anchorNode,s.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)oZ(t);else{let{anchor:r,head:s}=n,i,o;c_&&!(n instanceof Re)&&(n.$from.parent.inlineContent||(i=u_(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=u_(t,n.to))),t.docView.setSelection(r,s,t,e),c_&&(i&&d_(i),o&&d_(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&iZ(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const c_=bn||nn&&SI<63;function u_(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(bn&&s&&s.contentEditable=="false")return Wv(s);if((!s||s.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(s)return Wv(s);if(i)return Wv(i)}}function Wv(t){return t.contentEditable="true",bn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function d_(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function iZ(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(()=>{(!DI(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function oZ(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,gn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&ur&&Do<=11&&(n.disabled=!0,n.disabled=!1)}function LI(t,e){if(e instanceof Se){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(h_(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else h_(t)}function h_(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function f1(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||Re.between(e,n,r)}function f_(t){return t.editable&&!t.hasFocus()?!1:zI(t)}function zI(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 aZ(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return pl(e.node,e.offset,n.anchorNode,n.anchorOffset)}function _0(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&&Fe.findFrom(i,e)}function Yi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function p_(t,e,n){let r=t.state.selection;if(r instanceof Re)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 Yi(t,new Re(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=_0(t.state,e);return s&&s instanceof Se?Yi(t,s):!1}else if(!(Dr&&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?Se.isSelectable(i)?Yi(t,new Se(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):Kh?Yi(t,new Re(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Se&&r.node.isInline)return Yi(t,new Re(e>0?r.$to:r.$from));{let s=_0(t.state,e);return s?Yi(t,s):!1}}}function _m(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function jd(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ul(t,e){return e<0?lZ(t):cZ(t)}function lZ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(Ur&&n.nodeType==1&&r<_m(n)&&jd(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(jd(a,-1))s=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if($I(n))break;{let a=n.previousSibling;for(;a&&jd(a,-1);)s=n.parentNode,i=gn(a),a=a.previousSibling;if(a)n=a,r=_m(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?T0(t,n,r):s&&T0(t,s,i)}function cZ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=_m(n),i,o;for(;;)if(r<s){if(n.nodeType!=1)break;let a=n.childNodes[r];if(jd(a,1))i=n,o=++r;else break}else{if($I(n))break;{let a=n.nextSibling;for(;a&&jd(a,1);)i=a.parentNode,o=gn(a)+1,a=a.nextSibling;if(a)n=a,r=0,s=_m(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}i&&T0(t,i,o)}function $I(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function uZ(t,e){for(;t&&e==t.childNodes.length&&!Gh(t);)e=gn(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 dZ(t,e){for(;t&&!e&&!Gh(t);)e=gn(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 T0(t,e,n){if(e.nodeType!=3){let i,o;(o=uZ(e,n))?(e=o,n=0):(i=dZ(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ay(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&&Si(t)},50)}function m_(t,e){let n=t.state.doc.resolve(e);if(!(nn||EI)&&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 g_(t,e,n){let r=t.state.selection;if(r instanceof Re&&!r.empty||n.indexOf("s")>-1||Dr&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=_0(t.state,e);if(o&&o instanceof Se)return Yi(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,a=r instanceof qr?Fe.near(o,e):Fe.findFrom(o,e);return a?Yi(t,a):!1}return!1}function y_(t,e){if(!(t.state.selection instanceof Re))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 v_(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function hZ(t){if(!bn||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;v_(t,r,"true"),setTimeout(()=>v_(t,r,"false"),20)}return!1}function fZ(t){let e="";
vendor: 4,151 bytes, lines 548-551
548return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function pZ(t,e){let n=e.keyCode,r=fZ(e);if(n==8||Dr&&n==72&&r=="c")return y_(t,-1)||Ul(t,-1);if(n==46&&!e.shiftKey||Dr&&n==68&&r=="c")return y_(t,1)||Ul(t,1);if(n==13||n==27)return!0;if(n==37||Dr&&n==66&&r=="c"){let s=n==37?m_(t,t.state.selection.from)=="ltr"?-1:1:-1;return p_(t,s,r)||Ul(t,s)}else if(n==39||Dr&&n==70&&r=="c"){let s=n==39?m_(t,t.state.selection.from)=="ltr"?1:-1:1;return p_(t,s,r)||Ul(t,s)}else{if(n==38||Dr&&n==80&&r=="c")return g_(t,-1,r)||Ul(t,-1);if(n==40||Dr&&n==78&&r=="c")return hZ(t)||g_(t,1,r)||Ul(t,1);if(r==(Dr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function p1(t,e){t.someProp("transformCopied",p=>{e=p(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 p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||kl.fromSchema(t.state.schema),a=HI(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,d,h=0;for(;c&&c.nodeType==1&&(d=VI[c.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let g=a.createElement(d[p]);for(;l.firstChild;)g.appendChild(l.firstChild);l.appendChild(g),h++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
549
550`);return{dom:l,text:f,slice:e}}function FI(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 oe(q.from(t.state.schema.text(e.replace(/\r\n?/g,`
551`))),0,0),t.someProp("transformPasted",f=>{a=f(a,t,!0)}),a;let h=t.someProp("clipboardTextParser",f=>f(e,s,r,t));if(h)a=h;else{let f=s.marks(),{schema:p}=t.state,g=kl.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=o.appendChild(document.createElement("p"));m&&y.appendChild(g.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=vZ(n),Kh&&xZ(o);let c=o&&o.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){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")||_d.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!mZ.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)a=bZ(x_(a,+d[1],+d[2]),d[4]);else if(a=oe.maxOpen(gZ(a.content,s),!0),a.openStart||a.openEnd){let h=0,f=0;for(let p=a.content.firstChild;h<a.openStart&&!p.type.spec.isolating;h++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=x_(a,h,f)}return t.someProp("transformPasted",h=>{a=h(a,t,l)}),a}const mZ=/^(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 gZ(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&&qI(l,i,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=UI(o[o.length-1],i.length));let d=BI(a,l);o.push(d),s=s.matchType(d.type),i=l}}),o)return q.from(o)}return t}function BI(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,q.from(t));return t}function qI(t,e,n,r,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=qI(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(q.from(BI(n,t,s+1))))}}function UI(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,UI(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(q.empty,!0);return t.copy(n.append(r))}
vendor: 4,774 bytes, line 551
551function A0(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=A0(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(q.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function x_(t,e,n){return e<t.openStart&&(t=new oe(A0(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new oe(A0(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const VI={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 b_=null;function HI(){return b_||(b_=document.implementation.createHTMLDocument("title"))}let Gv=null;function yZ(t){let e=window.trustedTypes;return e?(Gv||(Gv=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Gv.createHTML(t)):t}function vZ(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=HI().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),s;if((s=r&&VI[r[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=yZ(t),s)for(let i=0;i<s.length;i++)n=n.querySelector(s[i])||n;return n}function xZ(t){let e=t.querySelectorAll(nn?"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 bZ(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=q.from(l.create(r[a+1],s)),i++,o++}return new oe(s,i,o)}const Un={},Vn={},wZ={touchstart:!0,touchmove:!0};class kZ{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 SZ(t){for(let e in Un){let n=Un[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{CZ(t,r)&&!m1(t,r)&&(t.editable||!(r.type in Vn))&&n(t,r)},wZ[e]?{passive:!0}:void 0)}bn&&t.dom.addEventListener("input",()=>null),j0(t)}function So(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function EZ(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 j0(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>m1(t,r))})}function m1(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function CZ(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 NZ(t,e){!m1(t,e)&&Un[e.type]&&(t.editable||!(e.type in Vn))&&Un[e.type](t,e)}Vn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!GI(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(xi&&nn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),uu&&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,ba(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||pZ(t,n)?n.preventDefault():So(t,"key")};Vn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Vn.keypress=(t,e)=>{let n=e;if(GI(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Dr&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Re)||!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 cy(t){return{left:t.clientX,top:t.clientY}}function _Z(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}
vendor: 21,003 bytes, line 551
551function g1(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 jc(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 TZ(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Se.isSelectable(r)?(jc(t,new Se(n)),!0):!1}function AZ(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof Se&&(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(Se.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?(jc(t,Se.create(t.state.doc,s)),!0):!1}function jZ(t,e,n,r,s){return g1(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?AZ(t,n):TZ(t,n))}function RZ(t,e,n,r){return g1(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function MZ(t,e,n,r){return g1(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||OZ(t,n,r)}function OZ(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(jc(t,Re.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)jc(t,Re.create(r,a+1,a+1+o.content.size));else if(Se.isSelectable(o))jc(t,Se.create(r,a));else continue;return!0}}function y1(t){return Tm(t)}const WI=Dr?"metaKey":"ctrlKey";Un.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=y1(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&_Z(n,t.input.lastClick)&&!n[WI]&&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(cy(n));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new PZ(t,o,n,!!r)):(i=="doubleClick"?RZ:MZ)(t,o.pos,o.inside,n)?n.preventDefault():So(t,"pointer"))};class PZ{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[WI],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);i=d.parent,o=d.depth?d.before():0}const a=s?null:r.target,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 Se&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ur&&!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)),So(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(()=>Si(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(cy(e))),this.updateAllowDefault(e),this.allowDefault||!n?So(this.view,"pointer"):jZ(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||bn&&this.mightDrag&&!this.mightDrag.node.isAtom||nn&&!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)?(jc(this.view,Fe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):So(this.view,"pointer")}move(e){this.updateAllowDefault(e),So(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)}}Un.touchstart=t=>{t.input.lastTouch=Date.now(),y1(t),So(t,"pointer")};Un.touchmove=t=>{t.input.lastTouch=Date.now(),So(t,"pointer")};Un.contextmenu=t=>y1(t);function GI(t,e){return t.composing?!0:bn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const IZ=xi?5e3:-1;Vn.compositionstart=Vn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Re&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||nn&&EI&&DZ(t)))t.markCursor=t.state.storedMarks||n.marks(),Tm(t,!0),t.markCursor=null;else if(Tm(t,!e.selection.empty),Ur&&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}KI(t,IZ)};function DZ(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"}Vn.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++,KI(t,20))};function KI(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Tm(t),e))}function JI(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=zZ());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function LZ(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=AY(e.focusNode,e.focusOffset),r=jY(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 zZ(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Tm(t,e=!1){if(!(xi&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),JI(t),e||t.docView&&t.docView.dirty){let n=h1(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 $Z(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 bh=ur&&Do<15||uu&&PY<604;Un.copy=Vn.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=bh?null:n.clipboardData,o=r.content(),{dom:a,text:l}=p1(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):$Z(t,a),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function FZ(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function BZ(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?wh(t,r.value,null,s,e):wh(t,r.textContent,r.innerHTML,s,e)},50)}function wh(t,e,n,r,s){let i=FI(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,s,i||oe.empty)))return!0;if(!i)return!1;let o=FZ(i),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function QI(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Vn.paste=(t,e)=>{let n=e;if(t.composing&&!xi)return;let r=bh?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&wh(t,QI(r),r.getData("text/html"),s,n)?n.preventDefault():BZ(t,n)};class YI{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const qZ=Dr?"altKey":"ctrlKey";function ZI(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[qZ]}Un.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(cy(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof Se?s.to-1:s.to))){if(r&&r.mightDrag)o=Se.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=Se.create(t.state.doc,h.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:d}=p1(t,a);(!n.dataTransfer.files.length||!nn||SI>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(bh?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",bh||n.dataTransfer.setData("text/plain",c),t.dragging=new YI(d,ZI(t,n),o)};Un.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Vn.dragover=Vn.dragenter=(t,e)=>e.preventDefault();Vn.drop=(t,e)=>{try{UZ(t,e,t.dragging)}finally{t.dragging=null}};function UZ(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(cy(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",p=>{i=p(i,t,!1)}):i=FI(t,QI(e.dataTransfer),bh?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&ZI(t,e));if(t.someProp("handleDrop",p=>p(t,e,i||oe.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let a=i?lI(t.state.doc,s.pos,i):s.pos;a==null&&(a=s.pos);let l=t.state.tr;if(o){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=l.doc;if(d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(h))return;let f=l.doc.resolve(c);if(d&&Se.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new Se(f));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((g,m,y,v)=>p=v),l.setSelection(f1(t,f,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}Un.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())&&Si(t)},20))};Un.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)};Un.beforeinput=(t,e)=>{if(nn&&xi&&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,ba(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 Vn)Un[t]=Vn[t];function kh(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 Am{constructor(e,n){this.toDOM=e,this.spec=n||Wa,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 $n(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Am&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&kh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class zo{constructor(e,n){this.attrs=e,this.spec=n||Wa}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 $n(i,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof zo&&kh(this.attrs,e.attrs)&&kh(this.spec,e.spec)}static is(e){return e.type instanceof zo}destroy(){}}class v1{constructor(e,n){this.attrs=e,this.spec=n||Wa}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 $n(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 v1&&kh(this.attrs,e.attrs)&&kh(this.spec,e.spec)}destroy(){}}class $n{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new $n(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 $n(e,e,new Am(n,r))}static inline(e,n,r,s){return new $n(e,n,new zo(r,s))}static node(e,n,r,s){return new $n(e,n,new v1(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof zo}get widget(){return this.type instanceof Am}}const Yl=[],Wa={};class wt{constructor(e,n){this.local=e.length?e:Yl,this.children=n.length?n:Yl}static create(e,n){return n.length?jm(n,e,0,Wa):Nn}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==Nn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Wa)}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?VZ(this.children,o||[],e,n,r,s,i):o?new wt(o.sort(Ga),Yl):Nn}add(e,n){return n.length?this==Nn?wt.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,d;if(d=eD(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,d,c+1):s.splice(i,0,l,l+a.nodeSize,jm(d,a,c+1,Wa)),i+=3}});let o=XI(i?tD(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new wt(o.length?this.local.concat(o).sort(Ga):this.local,s||this.children)}remove(e){return e.length==0||this==Nn?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 d=0,h;d<e.length;d++)(h=e[d])&&h.from>a&&h.to<l&&(e[d]=null,(o||(o=[])).push(h));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(o,a+1);c!=Nn?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 wt(s,r):Nn}forChild(e,n){if(this==Nn)return this;if(n.isLeaf)return wt.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 zo){let c=Math.max(i,l.from)-i,d=Math.min(o,l.to)-i;c<d&&(s||(s=[])).push(l.copy(c,d))}}if(s){let a=new wt(s.sort(Ga),Yl);return r?new so([a,r]):a}return r||Nn}eq(e){if(this==e)return!0;if(!(e instanceof wt)||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 x1(this.localsInner(e))}localsInner(e){if(this==Nn)return Yl;if(e.inlineContent||!this.local.some(zo.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof zo||n.push(this.local[r]);return n}forEachSet(e){e(this)}}wt.empty=new wt([],[]);wt.removeOverlap=x1;const Nn=wt.empty;class so{constructor(e){this.members=e}map(e,n){const r=this.members.map(s=>s.map(e,n,Wa));return so.from(r)}forChild(e,n){if(n.isLeaf)return wt.empty;let r=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=Nn&&(i instanceof so?r=r.concat(i.members):r.push(i))}return so.from(r)}eq(e){if(!(e instanceof so)||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?x1(r?n:n.sort(Ga)):Yl}static from(e){switch(e.length){case 0:return Nn;case 1:return e[0];default:return new so(e.every(n=>n instanceof wt)?e:e.reduce((n,r)=>n.concat(r instanceof wt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function VZ(t,e,n,r,s,i,o){let a=t.slice();for(let c=0,d=i;c<n.maps.length;c++){let h=0;n.maps[c].forEach((f,p,g,m)=>{let y=m-g-(p-f);for(let v=0;v<a.length;v+=3){let x=a[v+1];if(x<0||f>x+d-h)continue;let w=a[v]+d-h;p>=w?a[v+1]=f<=w?-2:-1:f>=d&&y&&(a[v]+=y,a[v+1]+=y)}h+=y}),d=n.maps[c].map(d,-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 d=n.map(t[c]+i),h=d-s;if(h<0||h>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+i,-1),p=f-s,{index:g,offset:m}=r.content.findIndex(h),y=r.maybeChild(g);if(y&&m==h&&m+y.nodeSize==p){let v=a[c+2].mapInner(n,y,d+1,t[c]+i+1,o);v!=Nn?(a[c]=h,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=HZ(a,t,e,n,s,i,o),d=jm(c,r,0,o);e=d.local;for(let h=0;h<a.length;h+=3)a[h+1]<0&&(a.splice(h,3),h-=3);for(let h=0,f=0;h<d.children.length;h+=3){let p=d.children[h];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,d.children[h],d.children[h+1],d.children[h+2])}}return new wt(e.sort(Ga),a)}function XI(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 $n(s.from+e,s.to+e,s.type))}return n}function HZ(t,e,n,r,s,i,o){function a(l,c){for(let d=0;d<l.local.length;d++){let h=l.local[d].map(r,s,c);h?n.push(h):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+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 eD(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 tD(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function jm(t,e,n,r){let s=[],i=!1;e.forEach((a,l)=>{let c=eD(t,a,l+n);if(c){i=!0;let d=jm(c,a,n+l+1,r);d!=Nn&&s.push(l,l+a.nodeSize,d)}});let o=XI(i?tD(t):t,-n).sort(Ga);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 wt(o,s):Nn}function Ga(t,e){return t.from-e.from||t.to-e.to}function x1(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),w_(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),w_(e,s,r.copy(i.from,r.to)));break}}}return e}function w_(t,e,n){for(;e<t.length&&Ga(n,t[e])>0;)e++;t.splice(e,0,n)}function Kv(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Nn&&e.push(r)}
vendor: 10,173 bytes, line 551
551),t.cursorWrapper&&e.push(wt.create(t.state.doc,[t.cursorWrapper.deco])),so.from(e)}const WZ={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},GZ=ur&&Do<=11;class KZ{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 JZ{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new KZ,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]);ur&&Do<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():bn&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),GZ&&(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,WZ)),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(f_(this.view)){if(this.suppressingSelectionUpdates)return Si(this.view);if(ur&&Do<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&pl(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=cu(i))n.add(i);for(let i=e.anchorNode;i;i=cu(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)&&f_(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let h=this.registerMutation(n[d],l);h&&(i=i<0?h.from:Math.min(h.from,i),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(a=!0))}if(Ur&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,f]=d;h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let f of d){let p=f.parentNode;p&&p.nodeName=="LI"&&(!h||ZZ(e,h)!=p)&&f.remove()}}}else if((nn||bn)&&l.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;h&&h.nodeType==1&&h.contentEditable=="false"&&d.parentNode.removeChild(d)}}let c=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ay(r)&&(c=h1(e))&&c.eq(Fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Si(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,o),QZ(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,XZ(e,l)),this.handleDOMChange(i,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Si(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let h=e.addedNodes[d];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let s=e.previousSibling,i=e.nextSibling;if(ur&&Do<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:h,nextSibling:f}=e.addedNodes[d];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let o=s&&s.parentNode==e.target?gn(s)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?gn(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 k_=new WeakMap,S_=!1;function QZ(t){if(!k_.has(t)&&(k_.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Ur,S_)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."),S_=!0}}function E_(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return pl(o.node,o.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function YZ(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return E_(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?E_(t,n):null}function ZZ(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 XZ(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 eX(t,e,n){let{node:r,fromOffset:s,toOffset:i,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],ay(l)||c.push({node:l.focusNode,offset:l.focusOffset})),nn&&t.input.lastKeyCode===8)for(let y=i;y>s;y--){let v=r.childNodes[y-1],x=v.pmViewDesc;if(v.nodeName=="BR"&&!x){i=y;break}if(!x||x.size)break}let h=t.state.doc,f=t.someProp("domParser")||_d.fromSchema(t.state.schema),p=h.resolve(o),g=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:tX,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=y),g={anchor:y+o,head:v+o}}return{doc:m,sel:g,from:o,to:a}}function tX(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(bn&&/^(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||bn&&/^(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 nX=/^(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 rX(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,N=h1(t,C);if(N&&!t.state.selection.eq(N)){if(nn&&xi&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",M=>M(t,ba(13,"Enter"))))return;let T=t.state.tr.setSelection(N);C=="pointer"?T.setMeta("pointer",!0):C=="key"&&T.scrollIntoView(),i&&T.setMeta("composition",i),t.dispatch(T)}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=eX(t,e,n),d=t.state.doc,h=d.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let g=oX(h.content,c.doc.content,c.from,f,p);if(g&&t.input.domChangeCount++,(uu&&t.input.lastIOSEnter>Date.now()-225||xi)&&s.some(C=>C.nodeType==1&&!nX.test(C.nodeName))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",C=>
vendor: 4,303 bytes, line 551
551C(t,ba(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!g)if(r&&l instanceof Re&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))g={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=C_(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let N=t.state.tr.setSelection(C);i&&N.setMeta("composition",i),t.dispatch(N)}}return}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof Re&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),ur&&Do<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>c.from&&c.doc.textBetween(g.start-c.from-1,g.start-c.from+1)=="  "&&(g.start--,g.endA--,g.endB--);let m=c.doc.resolveNoCache(g.start-c.from),y=c.doc.resolveNoCache(g.endB-c.from),v=d.resolve(g.start),x=m.sameParent(y)&&m.parent.inlineContent&&v.end()>=g.endA;if((uu&&t.input.lastIOSEnter>Date.now()-225&&(!x||s.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!x&&m.pos<c.doc.content.size&&(!m.sameParent(y)||!m.parent.inlineContent)&&m.pos<y.pos&&!/\S/.test(c.doc.textBetween(m.pos,y.pos,"","")))&&t.someProp("handleKeyDown",C=>C(t,ba(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>g.start&&iX(d,g.start,g.endA,m,y)&&t.someProp("handleKeyDown",C=>C(t,ba(8,"Backspace")))){xi&&nn&&t.domObserver.suppressSelectionUpdates();return}nn&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),xi&&!x&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==g.endA&&(g.endB-=2,y=c.doc.resolveNoCache(g.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,ba(13,"Enter"))})},20));let w=g.start,k=g.endA,S=C=>{let N=C||t.state.tr.replace(w,k,c.doc.slice(g.start-c.from,g.endB-c.from));if(c.sel){let T=C_(t,N.doc,c.sel);T&&!(nn&&t.composing&&T.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(T.head==w||T.head==N.mapping.map(k)-1)||ur&&T.empty&&T.head==w)&&N.setSelection(T)}return i&&N.setMeta("composition",i),N.scrollIntoView()},E;if(x)if(m.pos==y.pos){ur&&Do<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Si(t),20));let C=S(t.state.tr.delete(w,k)),N=d.resolve(g.start).marksAcross(d.resolve(g.endA));N&&C.ensureMarks(N),t.dispatch(C)}else if(g.endA==g.endB&&(E=sX(m.parent.content.cut(m.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,g.endA-v.start())))){let C=S(t.state.tr);E.type=="add"?C.addMark(w,k,E.mark):C.removeMark(w,k,E.mark),t.dispatch(C)}else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,y.parentOffset),N=()=>S(t.state.tr.insertText(C,w,k));t.someProp("handleTextInput",T=>T(t,w,k,C,N))||t.dispatch(N())}else t.dispatch(S());else t.dispatch(S())}function C_(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:f1(t,e.resolve(n.anchor),e.resolve(n.head))}function sX(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,a,l;for(let d=0;d<r.length;d++)s=r[d].removeFromSet(s);for(let d=0;d<n.length;d++)i=n[d].removeFromSet(i);if(s.length==1&&i.length==0)a=s[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(s.length==0&&i.length==1)a=i[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(q.from(c).eq(t))return{mark:a,type:o}}function iX(t,e,n,r,s){if(n-e<=s.pos-r.pos||Jv(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(Jv(i,!0,!0));return!o.parent.isTextblock||o.pos>n||Jv(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Jv(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 oX(t,e,n,r,s){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);
vendor: 4,499 bytes, line 551
551if(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&&N_(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&&N_(t.textBetween(i-1,i+1))&&(i+=l?1:-1),o=i+(o-a),a=i}return{start:i,endA:o,endB:a}}function N_(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 nD{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 kZ,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(R_),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=A_(this),T_(this),this.nodeViews=j_(this),this.docView=a_(this.state.doc,__(this),Kv(this),this.dom,this),this.domObserver=new JZ(this,(r,s,i,o)=>rX(this,r,s,i,o)),this.domObserver.start(),SZ(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&&j0(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(R_),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&&(JI(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 p=j_(this);lX(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&j0(this),this.editable=A_(this),T_(this);let l=Kv(this),c=__(this),d=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,c,l);(h||!e.selection.eq(s.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&LY(this);if(o){this.domObserver.stop();let p=h&&(ur||nn)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&aX(s.selection,e.selection);if(h){let g=nn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=LZ(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=a_(e.doc,c,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&aZ(this))?Si(this,p):(LI(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&zY(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 Se){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&t_(this,n.getBoundingClientRect(),e)}else t_(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;
vendor: 5,944 bytes, line 551
551else{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 YI(e.slice,e.move,s<0?void 0:Se.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(ur){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&&$Y(this.dom),Si(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 VY(this,e)}coordsAtPos(e,n=1){return AI(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 JY(this,n||this.state,e)}pasteHTML(e,n){return wh(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return wh(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return p1(this,e)}destroy(){this.docView&&(EZ(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Kv(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,_Y())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return NZ(this,e)}domSelectionRange(){let e=this.domSelection();return e?bn&&this.root.nodeType===11&&MY(this.dom.ownerDocument)==this.dom&&YZ(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}nD.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function __(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"),[$n.node(0,t.state.doc.content.size,e)]}function T_(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:$n.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function A_(t){return!t.someProp("editable",e=>e(t.state)===!1)}function aX(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 j_(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 lX(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 R_(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Go={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Rm={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},cX=typeof navigator<"u"&&/Mac/.test(navigator.platform),uX=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var yn=0;yn<10;yn++)Go[48+yn]=Go[96+yn]=String(yn);for(var yn=1;yn<=24;yn++)Go[yn+111]="F"+yn;for(var yn=65;yn<=90;yn++)Go[yn]=String.fromCharCode(yn+32),Rm[yn]=String.fromCharCode(yn);for(var Qv in Go)Rm.hasOwnProperty(Qv)||(Rm[Qv]=Go[Qv]);function dX(t){var e=cX&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||uX&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Rm:Go)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const hX=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),fX=typeof navigator<"u"&&/Win/.test(navigator.platform);function pX(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))hX?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 mX(t){let e=Object.create(null);for(let n in t)e[pX(n)]=t[n];return e}
vendor: 68,508 bytes, lines 551-626
551function Yv(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 gX(t){return new Et({props:{handleKeyDown:rD(t)}})}function rD(t){let e=mX(t);return function(n,r){let s=dX(r),i,o=e[Yv(s,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let a=e[Yv(s,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(fX&&r.ctrlKey&&r.altKey)&&(i=Go[r.keyCode])&&i!=s){let a=e[Yv(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var yX=Object.defineProperty,b1=(t,e)=>{for(var n in e)yX(t,n,{get:e[n],enumerable:!0})};function uy(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 dy=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 d=a(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:s}=this,{view:i}=r,o=[],a=!!t,l=t||s.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),o.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(n).map(([h,f])=>[h,(...g)=>{const m=this.buildProps(l,e),y=f(...g)(m);return o.push(y),d}])),run:c};return d}createCan(t){const{rawCommands:e,state:n}=this,r=!1,s=t||n.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([a,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:uy({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}},sD={};b1(sD,{blur:()=>vX,clearContent:()=>xX,clearNodes:()=>bX,command:()=>wX,createParagraphNear:()=>kX,cut:()=>SX,deleteCurrentNode:()=>EX,deleteNode:()=>CX,deleteRange:()=>NX,deleteSelection:()=>_X,enter:()=>TX,exitCode:()=>AX,extendMarkRange:()=>jX,first:()=>RX,focus:()=>OX,forEach:()=>PX,insertContent:()=>IX,insertContentAt:()=>zX,joinBackward:()=>BX,joinDown:()=>FX,joinForward:()=>qX,joinItemBackward:()=>UX,joinItemForward:()=>VX,joinTextblockBackward:()=>HX,joinTextblockForward:()=>WX,joinUp:()=>$X,keyboardShortcut:()=>KX,lift:()=>JX,liftEmptyBlock:()=>QX,liftListItem:()=>YX,newlineInCode:()=>ZX,resetAttributes:()=>XX,scrollIntoView:()=>eee,selectAll:()=>tee,selectNodeBackward:()=>nee,selectNodeForward:()=>ree,selectParentNode:()=>see,selectTextblockEnd:()=>iee,selectTextblockStart:()=>oee,setContent:()=>aee,setMark:()=>_ee,setMeta:()=>Tee,setNode:()=>Aee,setNodeSelection:()=>jee,setTextDirection:()=>Ree,setTextSelection:()=>Mee,sinkListItem:()=>Oee,splitBlock:()=>Pee,splitListItem:()=>Iee,toggleList:()=>Dee,toggleMark:()=>Lee,toggleNode:()=>zee,toggleWrap:()=>$ee,undoInputRule:()=>Fee,unsetAllMarks:()=>Bee,unsetMark:()=>qee,unsetTextDirection:()=>Uee,updateAttributes:()=>Vee,wrapIn:()=>Hee,wrapInList:()=>Wee});var vX=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),xX=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),bX=()=>({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:d}=e,h=c.resolve(d.map(l)),f=c.resolve(d.map(l+a.nodeSize)),p=h.blockRange(f);if(!p)return;const g=Nu(p);if(a.type.isTextblock){const{defaultType:m}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(p.start,m)}(g||g===0)&&e.lift(p,g)})}),!0},wX=t=>e=>t(e),kX=()=>({state:t,dispatch:e})=>fY(t,e),SX=(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 Re(r.doc.resolve(Math.max(o-1,0)))),!0},EX=()=>({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 Gt(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 CX=t=>({tr:e,state:n,dispatch:r})=>{const s=Gt(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},NX=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},_X=()=>({state:t,dispatch:e})=>tY(t,e),TX=()=>({commands:t})=>t.keyboardShortcut("Enter"),AX=()=>({state:t,dispatch:e})=>hY(t,e);function w1(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Mm(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:w1(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function iD(t,e,n={}){return t.find(r=>r.type===e&&Mm(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function M_(t,e,n={}){return!!iD(t,e,n)}function k1(t,e,n){var r;if(!t||!e)return;let s=t.parent.childAfter(t.parentOffset);if((!s.node||!s.node.marks.some(d=>d.type===e))&&(s=t.parent.childBefore(t.parentOffset)),!s.node||!s.node.marks.some(d=>d.type===e)||(n=n||((r=s.node.marks[0])==null?void 0:r.attrs),!iD([...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&&M_([...t.parent.child(o-1).marks],e,n);)o-=1,a-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&M_([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Ii(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 jX=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const i=Ii(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:d}=a;if(s){const h=k1(l,i,e);if(h&&h.from<=c&&h.to>=d){const f=Re.create(o,h.from,h.to);n.setSelection(f)}}return!0},RX=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 oD(t){return t instanceof Re}function Ta(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function aD(t,e=null){if(!e)return null;const n=Fe.atStart(t),r=Fe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const s=n.from,i=r.to;return e==="all"?Re.create(t,Ta(0,s,i),Ta(t.content.size,s,i)):Re.create(t,Ta(e,s,i),Ta(e,s,i))}function O_(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Om(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function MX(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var OX=(t=null,e={})=>({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(Om()||O_())&&r.dom.focus(),MX()&&!Om()&&!O_()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!oD(n.state.selection))return o(),!0;const a=aD(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},PX=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),IX=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),lD=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&&lD(r)}return t};function zf(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 lD(n)}function Sh(t,e,n){if(t instanceof Io||t instanceof q)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 q.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),Sh("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,a="";const l=new YP({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?_d.fromSchema(l).parseSlice(zf(t),n.parseOptions):_d.fromSchema(l).parse(zf(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=_d.fromSchema(e);return n.slice?i.parseSlice(zf(t),n.parseOptions).content:i.parse(zf(t),n.parseOptions)}return Sh("",e,n)}function DX(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof tn||s instanceof sn))return;const i=t.mapping.maps[r];let o=0;i.forEach((a,l,c,d)=>{o===0&&(o=d)}),t.setSelection(Fe.near(t.doc.resolve(o),n))}var LX=t=>!("type"in t),zX=(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{Sh(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=Sh(e,i.schema,{parseOptions:c,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(y){return l(y),!1}let{from:d,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;if((LX(a)?a:[a]).forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),d===h&&p){const{parent:y}=r.doc.resolve(d);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(d-=1,h+=1)}let m;if(f){if(Array.isArray(e))m=e.map(y=>y.text||"").join("");else if(e instanceof q){let y="";e.forEach(v=>{v.text&&(y+=v.text)}),m=y}else typeof e=="object"&&e&&e.text?m=e.text:m=e;r.insertText(m,d,h)}else{m=a;const y=r.doc.resolve(d),v=y.node(),x=y.parentOffset===0,w=v.isText||v.isTextblock,k=v.content.size>0;x&&w&&k&&(d=Math.max(0,d-1)),r.replaceWith(d,h,m)}n.updateSelection&&DX(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:m}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:m})}return!0},$X=()=>({state:t,dispatch:e})=>lY(t,e),FX=()=>({state:t,dispatch:e})=>cY(t,e),BX=()=>({state:t,dispatch:e})=>nY(t,e),qX=()=>({state:t,dispatch:e})=>oY(t,e),UX=()=>({state:t,dispatch:e,tr:n})=>{try{const r=sy(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},VX=()=>({state:t,dispatch:e,tr:n})=>{try{const r=sy(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},HX=()=>({state:t,dispatch:e})=>rY(t,e),WX=()=>({state:t,dispatch:e})=>sY(t,e);function cD(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function GX(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))Om()||cD()?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 KX=t=>({editor:e,view:n,tr:r,dispatch:s})=>{const i=GX(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 d=c.map(r.mapping);d&&s&&r.maybeStep(d)}),!0};function Ko(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?Gt(e,t.schema):null,a=[];t.doc.nodesBetween(r,s,(h,f)=>{if(h.isText)return;const p=Math.max(r,f),g=Math.min(s,f+h.nodeSize);a.push({node:h,from:p,to:g})});const l=s-r,c=a.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>Mm(h.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((h,f)=>h+f.to-f.from,0)>=l}var JX=(t,e={})=>({state:n,dispatch:r})=>{const s=Gt(t,n.schema);return Ko(n,s,e)?uY(n,r):!1},QX=()=>({state:t,dispatch:e})=>pY(t,e),YX=t=>({state:e,dispatch:n})=>{const r=Gt(t,e.schema);return SY(r)(e,n)},ZX=()=>({state:t,dispatch:e})=>dY(t,e);function hy(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function P_(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 XX=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=hy(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=Gt(t,r.schema)),a==="mark"&&(o=Ii(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,h)=>{i&&i===d.type&&(l=!0,s&&n.setNodeMarkup(h,void 0,P_(d.attrs,e))),o&&d.marks.length&&d.marks.forEach(f=>{o===f.type&&(l=!0,s&&n.addMark(h,h+d.nodeSize,o.create(P_(f.attrs,e))))})})}),l},eee=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),tee=()=>({tr:t,dispatch:e})=>{if(e){const n=new qr(t.doc);t.setSelection(n)}return!0},nee=()=>({state:t,dispatch:e})=>iY(t,e),ree=()=>({state:t,dispatch:e})=>aY(t,e),see=()=>({state:t,dispatch:e})=>mY(t,e),iee=()=>({state:t,dispatch:e})=>vY(t,e),oee=()=>({state:t,dispatch:e})=>yY(t,e);function R0(t,e,n={},r={}){return Sh(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var aee=(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=R0(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 uD(t,e){const n=Ii(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 dD(t,e){const n=new fI(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function lee(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 cee(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function uee(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 fy(t){return e=>uee(e.$from,t)}function xe(t,e,n){return t.config[e]===void 0&&t.parent?xe(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?xe(t.parent,e,n):null}):t.config[e]}function S1(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=xe(e,"addExtensions",n);return r?[e,...S1(r())]:e}).flat(10)}function E1(t,e){const n=kl.fromSchema(e).serializeFragment(t),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}function hD(t){return typeof t=="function"}function nt(t,e=void 0,...n){return hD(t)?e?t.bind(e)(...n):t(...n):t}function dee(t={}){return Object.keys(t).length===0&&t.constructor===Object}function du(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 fD(t){const e=[],{nodeExtensions:n,markExtensions:r}=du(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:s},l=xe(o,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(h=>{Object.entries(d.attributes).forEach(([f,p])=>{e.push({type:h,name:f,attribute:{...i,...p}})})})})}),s.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=xe(o,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([d,h])=>{const f={...i,...h};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:o.name,name:d,attribute:f})})}),e}function Dt(...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(d=>!l.includes(d));r[s]=[...l,...c].join(" ")}else if(s==="style"){const a=i?i.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[s]?r[s].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[h,f]=d.split(":").map(p=>p.trim());c.set(h,f)}),a.forEach(d=>{const[h,f]=d.split(":").map(p=>p.trim());c.set(h,f)}),r[s]=Array.from(c.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[s]=i}),r},{})}function Eh(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)=>Dt(n,r),{})}function hee(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function I_(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):hee(n.getAttribute(o.name));return a==null?i:{...i,[o.name]:a}},{});return{...r,...s}}}}function D_(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&dee(n)?!1:n!=null))}function L_(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 fee(t,e){var n;const r=fD(t),{nodeExtensions:s,markExtensions:i}=du(t),o=(n=s.find(c=>xe(c,"topNode")))==null?void 0:n.name,a=Object.fromEntries(s.map(c=>{const d=r.filter(v=>v.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((v,x)=>{const w=xe(x,"extendNodeSchema",h);return{...v,...w?w(c):{}}},{}),p=D_({...f,content:nt(xe(c,"content",h)),marks:nt(xe(c,"marks",h)),group:nt(xe(c,"group",h)),inline:nt(xe(c,"inline",h)),atom:nt(xe(c,"atom",h)),selectable:nt(xe(c,"selectable",h)),draggable:nt(xe(c,"draggable",h)),code:nt(xe(c,"code",h)),whitespace:nt(xe(c,"whitespace",h)),linebreakReplacement:nt(xe(c,"linebreakReplacement",h)),defining:nt(xe(c,"defining",h)),isolating:nt(xe(c,"isolating",h)),attrs:Object.fromEntries(d.map(L_))}),g=nt(xe(c,"parseHTML",h));g&&(p.parseDOM=g.map(v=>I_(v,d)));const m=xe(c,"renderHTML",h);m&&(p.toDOM=v=>m({node:v,HTMLAttributes:Eh(v,d)}));const y=xe(c,"renderText",h);return y&&(p.toText=y),[c.name,p]})),l=Object.fromEntries(i.map(c=>{const d=r.filter(y=>y.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,v)=>{const x=xe(v,"extendMarkSchema",h);return{...y,...x?x(c):{}}},{}),p=D_({...f,inclusive:nt(xe(c,"inclusive",h)),excludes:nt(xe(c,"excludes",h)),group:nt(xe(c,"group",h)),spanning:nt(xe(c,"spanning",h)),code:nt(xe(c,"code",h)),attrs:Object.fromEntries(d.map(L_))}),g=nt(xe(c,"parseHTML",h));g&&(p.parseDOM=g.map(y=>I_(y,d)));const m=xe(c,"renderHTML",h);return m&&(p.toDOM=y=>m({mark:y,HTMLAttributes:Eh(y,d)})),[c.name,p]}));return new YP({topNode:o,nodes:a,marks:l})}function pee(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Pm(t){return t.sort((n,r)=>{const s=xe(n,"priority")||100,i=xe(r,"priority")||100;return s>i?-1:s<i?1:0})}function pD(t){const e=Pm(S1(t)),n=pee(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 mD(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=`
552
553`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,s,(l,c,d,h)=>{var f;l.isBlock&&c>r&&(a+=i);const p=o==null?void 0:o[l.type.name];if(p)return d&&(a+=p({node:l,pos:c,parent:d,index:h,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 mee(t,e){const n={from:0,to:t.content.size};return mD(t,n,e)}function gD(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function gee(t,e){const n=Gt(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 yD(t,e){const n=hy(typeof e=="string"?e:e.name,t.schema);return n==="node"?gee(t,e):n==="mark"?uD(t,e):{}}function yee(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 vee(t){const e=yee(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 vD(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),d=e.slice(i).map(l),h=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:h,to:f},newRange:{from:c,to:d}})})}),vee(r)}function C1(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=n.resolve(t),o=k1(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 xee=(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 $f(t,e){return e.nodes[t]||e.marks[t]||null}function wp(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 bee=(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 d=((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?d:d.slice(0,Math.max(0,r-i))}),n};function M0(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?Ii(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>Mm(h.attrs,n,{strict:!1}));let o=0;const a=[];if(s.forEach(({$from:h,$to:f})=>{const p=h.pos,g=f.pos;t.doc.nodesBetween(p,g,(m,y)=>{if(!m.isText&&!m.marks.length)return;const v=Math.max(p,y),x=Math.min(g,y+m.nodeSize),w=x-v;o+=w,a.push(...m.marks.map(k=>({mark:k,from:v,to:x})))})}),o===0)return!1;const l=a.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>Mm(h.mark.attrs,n,{strict:!1})).reduce((h,f)=>h+f.to-f.from,0),c=a.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,f)=>h+f.to-f.from,0);return(l>0?l+c:l)>=o}function wee(t,e,n={}){if(!e)return Ko(t,null,n)||M0(t,null,n);const r=hy(e,t.schema);return r==="node"?Ko(t,e,n):r==="mark"?M0(t,e,n):!1}var kee=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=fy(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)},See=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function z_(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function $_(t,e){const{nodeExtensions:n}=du(e),r=n.find(o=>o.name===t);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=nt(xe(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function py(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&&(py(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function xD(t){return t instanceof Se}var bD=class wD{constructor(e){this.position=e}static fromJSON(e){return new wD(e.position)}toJSON(){return{position:this.position}}};function Eee(t,e){const n=e.mapping.mapResult(t.position);return{position:new bD(n.pos),mapResult:n}}function Cee(t){return new bD(t)}function Nee(t,e,n){var r;const{selection:s}=e;let i=null;if(oD(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,(d,h,f)=>{if(c)return!1;if(d.isInline){const p=!f||f.type.allowsMarkType(n),g=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));c=p&&g}return!c}),c})}var _ee=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:a}=i,l=Ii(t,r.schema);if(s)if(o){const c=uD(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const d=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(d,h,(f,p)=>{const g=Math.max(p,d),m=Math.min(p+f.nodeSize,h);f.marks.find(v=>v.type===l)?f.marks.forEach(v=>{l===v.type&&n.addMark(g,m,l.create({...v.attrs,...e}))}):n.addMark(g,m,l.create(e))})});return Nee(r,n,l)},Tee=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Aee=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=Gt(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})=>ZN(i,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>ZN(i,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},jee=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=Ta(t,0,r.content.size),i=Se.create(r,s);e.setSelection(i)}return!0},Ree=(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},Mee=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Re.atStart(r).from,a=Re.atEnd(r).to,l=Ta(s,o,a),c=Ta(i,o,a),d=Re.create(r,l,c);e.setSelection(d)}return!0},Oee=t=>({state:e,dispatch:n})=>{const r=Gt(t,e.schema);return NY(r)(e,n)};function F_(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 Pee=({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,d=wp(c,a.node().type.name,a.node().attrs);if(i instanceof Se&&i.node.isBlock)return!a.parentOffset||!Tc(o,a.pos)?!1:(r&&(t&&F_(n,s.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:lee(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=h&&f?[{type:f,attrs:d}]:void 0,g=Tc(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!g&&Tc(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(g=!0,p=f?[{type:f,attrs:d}]:void 0),r){if(g&&(i instanceof Re&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),f&&!h&&!a.parentOffset&&a.parent.type!==f)){const m=e.mapping.map(a.before()),y=e.doc.resolve(m);a.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&F_(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return g},Iee=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{var o;const a=Gt(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.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=q.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let N=l.depth-x;N>=l.depth-3;N-=1)v=q.from(l.node(N).copy(v));const w=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,k={...wp(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(q.from(a.createAndFill(null,S)||void 0));const E=l.before(l.depth-(x-1));n.replace(E,l.after(-w),new oe(v,4-x,0));let C=-1;n.doc.nodesBetween(E,n.doc.content.size,(N,T)=>{if(C>-1)return!1;N.isTextblock&&N.content.size===0&&(C=T+1)}),C>-1&&n.setSelection(Re.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,g={...wp(f,h.type.name,h.attrs),...e},m={...wp(f,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const y=p?[{type:a,attrs:g},{type:p,attrs:m}]:[{type:a,attrs:g}];if(!Tc(n.doc,l.pos,2))return!1;if(s){const{selection:v,storedMarks:x}=r,{splittableMarks:w}=i.extensionManager,k=x||v.$to.parentOffset&&v.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!k||!s)return!0;const S=k.filter(E=>w.includes(E.type.name));n.ensureMarks(S)}return!0},Zv=(t,e)=>{const n=fy(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)&&na(t.doc,n.pos)&&t.join(n.pos),!0},Xv=(t,e)=>{const n=fy(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)&&na(t.doc,r)&&t.join(r),!0},Dee=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:f}=s.extensionManager,p=Gt(t,o.schema),g=Gt(e,o.schema),{selection:m,storedMarks:y}=o,{$from:v,$to:x}=m,w=v.blockRange(x),k=y||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const S=fy(E=>$_(E.type.name,h))(m);if(w.depth>=1&&S&&w.depth-S.depth<=1){if(S.node.type===p)return c.liftListItem(g);if($_(S.node.type.name,h)&&p.validContent(S.node.content)&&a)return l().command(()=>(i.setNodeMarkup(S.pos,p),!0)).command(()=>Zv(i,p)).command(()=>Xv(i,p)).run()}return!n||!k||!a?l().command(()=>d().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>Zv(i,p)).command(()=>Xv(i,p)).run():l().command(()=>{const E=d().wrapInList(p,r),C=k.filter(N=>f.includes(N.type.name));return i.ensureMarks(C),E?!0:c.clearNodes()}).wrapInList(p,r).command(()=>Zv(i,p)).command(()=>Xv(i,p)).run()},Lee=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=Ii(t,r.schema);return M0(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},zee=(t,e,n={})=>({state:r,commands:s})=>{const i=Gt(t,r.schema),o=Gt(e,r.schema),a=Ko(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})},$ee=(t,e={})=>({state:n,commands:r})=>{const s=Gt(t,n.schema);return Ko(n,s,e)?r.lift(s):r.wrapIn(s,e)},Fee=()=>({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},Bee=()=>({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},qee=(t,e={})=>({tr:n,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Ii(t,r.schema),{$from:c,empty:d,ranges:h}=a;if(!s)return!0;if(d&&o){let{from:f,to:p}=a;const g=(i=c.marks().find(y=>y.type===l))==null?void 0:i.attrs,m=k1(c,l,g);m&&(f=m.from,p=m.to),n.removeMark(f,p,l)}else h.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},Uee=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},Vee=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=hy(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=Gt(t,r.schema)),a==="mark"&&(o=Ii(t,r.schema));let l=!1;return n.selection.ranges.forEach(c=>{const d=c.$from.pos,h=c.$to.pos;let f,p,g,m;n.selection.empty?r.doc.nodesBetween(d,h,(y,v)=>{i&&i===y.type&&(l=!0,g=Math.max(v,d),m=Math.min(v+y.nodeSize,h),f=v,p=y)}):r.doc.nodesBetween(d,h,(y,v)=>{v<d&&i&&i===y.type&&(l=!0,g=Math.max(v,d),m=Math.min(v+y.nodeSize,h),f=v,p=y),v>=d&&v<=h&&(i&&i===y.type&&(l=!0,s&&n.setNodeMarkup(v,void 0,{...y.attrs,...e})),o&&y.marks.length&&y.marks.forEach(x=>{if(o===x.type&&(l=!0,s)){const w=Math.max(v,d),k=Math.min(v+y.nodeSize,h);n.addMark(w,k,o.create({...x.attrs,...e}))}}))}),p&&(f!==void 0&&s&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(y=>{o===y.type&&s&&n.addMark(g,m,o.create({...y.attrs,...e}))}))}),l},Hee=(t,e={})=>({state:n,dispatch:r})=>{const s=Gt(t,n.schema);return xY(s,e)(n,r)},Wee=(t,e={})=>({state:n,dispatch:r})=>{const s=Gt(t,n.schema);return bY(s,e)(n,r)},Gee=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={}}},my=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},Kee=(t,e)=>{if(w1(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 Ff(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 d=!1;const h=bee(c)+i;return o.forEach(f=>{if(d)return;const p=Kee(h,f.find);if(!p)return;const g=l.state.tr,m=uy({state:l.state,transaction:g}),y={from:r-(p[0].length-i.length),to:s},{commands:v,chain:x,can:w}=new dy({editor:n,state:m});f.handler({state:m,range:y,match:p,commands:v,chain:x,can:w})===null||!g.steps.length||(f.undoable&&g.setMeta(a,{transform:g,from:r,to:s,text:i}),l.dispatch(g),d=!0)}),d}function Jee(t){const{editor:e,rules:n}=t,r=new Et({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:d}=l;typeof d=="string"?d=d:d=E1(q.from(d),o.schema);const{from:h}=l,f=h+d.length;Ff({editor:e,from:h,to:f,text:d,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,a){return Ff({editor:e,from:i,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&Ff({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?Ff({editor:e,from:o.pos,to:o.pos,text:`
554`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Qee(t){return Object.prototype.toString.call(t).slice(8,-1)}function Bf(t){return Qee(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function kD(t,e){const n={...t};return Bf(t)&&Bf(e)&&Object.keys(e).forEach(r=>{Bf(e[r])&&Bf(t[r])?n[r]=kD(t[r],e[r]):n[r]=e[r]}),n}var N1=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{...nt(xe(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...nt(xe(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>kD(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}},Sl=class SD extends N1{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new SD(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 Yee(t){return typeof t=="number"}var Zee=class{constructor(t){this.find=t.find,this.handler=t.handler}},Xee=(t,e,n)=>{if(w1(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 ete(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:c,can:d}=new dy({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,s,(p,g)=>{var m,y,v,x,w;if((y=(m=p.type)==null?void 0:m.spec)!=null&&y.code||!(p.isText||p.isTextblock||p.isInline))return;const k=(w=(x=(v=p.content)==null?void 0:v.size)!=null?x:p.nodeSize)!=null?w:0,S=Math.max(r,g),E=Math.min(s,g+k);if(S>=E)return;const C=p.isText?p.text||"":p.textBetween(S-g,E-g,void 0,"");Xee(C,i.find,o).forEach(T=>{if(T.index===void 0)return;const M=S+T.index+1,D=M+T[0].length,A={from:n.tr.mapping.map(M),to:n.tr.mapping.map(D)},L=i.handler({state:n,range:A,match:T,commands:l,chain:c,can:d,pasteEvent:o,dropEvent:a});h.push(L)})}),h.every(p=>p!==null)}var qf=null,tte=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function nte(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:d,from:h,to:f,rule:p,pasteEvt:g})=>{const m=d.tr,y=uy({state:d,transaction:m});if(!(!ete({editor:e,state:y,from:Math.max(h-1,0),to:f.b-1,rule:p,pasteEvent:g,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(d=>new Et({view(h){const f=g=>{var m;r=(m=h.dom.parentElement)!=null&&m.contains(g.target)?h.dom.parentElement:null,r&&(qf=e)},p=()=>{qf&&(qf=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(h,f)=>{if(i=r===h.dom.parentElement,a=f,!i){const p=qf;p!=null&&p.isEditable&&setTimeout(()=>{const g=p.state.selection;g&&p.commands.deleteRange({from:g.from,to:g.to})},10)}return!1},paste:(h,f)=>{var p;const g=(p=f.clipboardData)==null?void 0:p.getData("text/html");return o=f,s=!!(g!=null&&g.includes("data-pm-slice")),!1}}},appendTransaction:(h,f,p)=>{const g=h[0],m=g.getMeta("uiEvent")==="paste"&&!s,y=g.getMeta("uiEvent")==="drop"&&!i,v=g.getMeta("applyPasteRules"),x=!!v;if(!m&&!y&&!x)return;if(x){let{text:S}=v;typeof S=="string"?S=S:S=E1(q.from(S),p.schema);const{from:E}=v,C=E+S.length,N=tte(S);return l({rule:d,state:p,from:E,to:{b:C},pasteEvt:N})}const w=f.doc.content.findDiffStart(p.doc.content),k=f.doc.content.findDiffEnd(p.doc.content);if(!(!Yee(w)||!k||w===k.b))return l({rule:d,state:p,from:w,to:k,pasteEvt:o})}}))}var gy=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=pD(t),this.schema=fee(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:$f(e.name,this.schema)},r=xe(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Pm([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:$f(r.name,this.schema)},i=[],o=xe(r,"addKeyboardShortcuts",s);let a={};if(r.type==="mark"&&xe(r,"exitable",s)&&(a.ArrowRight=()=>Sl.handleExit({editor:t,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([p,g])=>[p,()=>g({editor:t})]));a={...a,...f}}const l=gX(a);i.push(l);const c=xe(r,"addInputRules",s);if(z_(r,t.options.enableInputRules)&&c){const f=c();if(f&&f.length){const p=Jee({editor:t,rules:f}),g=Array.isArray(p)?p:[p];i.push(...g)}}const d=xe(r,"addPasteRules",s);if(z_(r,t.options.enablePasteRules)&&d){const f=d();if(f&&f.length){const p=nte({editor:t,rules:f});i.push(...p)}}const h=xe(r,"addProseMirrorPlugins",s);if(h){const f=h();i.push(...f)}return i})}get attributes(){return fD(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=du(this.extensions);return Object.fromEntries(e.filter(n=>!!xe(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:Gt(n.name,this.schema)},i=xe(n,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const a=(l,c,d,h,f)=>{const p=Eh(l,r);return o({node:l,view:c,getPos:d,decorations:h,innerDecorations:f,editor:t,extension:n,HTMLAttributes:p})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return Pm([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:$f(s.name,this.schema)},o=xe(s,"dispatchTransaction",i);return o?a=>{o.call(i,{transaction:a,next:r})}:r},t)}get markViews(){const{editor:t}=this,{markExtensions:e}=du(this.extensions);return Object.fromEntries(e.filter(n=>!!xe(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:Ii(n.name,this.schema)},i=xe(n,"addMarkView",s);if(!i)return[];const o=(a,l,c)=>{const d=Eh(a,r);return i()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:h=>{yte(a,t,h)}})};return[n.name,o]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:$f(e.name,this.schema)};e.type==="mark"&&((n=nt(xe(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const s=xe(e,"onBeforeCreate",r),i=xe(e,"onCreate",r),o=xe(e,"onUpdate",r),a=xe(e,"onSelectionUpdate",r),l=xe(e,"onTransaction",r),c=xe(e,"onFocus",r),d=xe(e,"onBlur",r),h=xe(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),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}};gy.resolve=pD;gy.sort=Pm;gy.flatten=S1;var rte={};b1(rte,{ClipboardTextSerializer:()=>CD,Commands:()=>ND,Delete:()=>_D,Drop:()=>TD,Editable:()=>AD,FocusEvents:()=>RD,Keymap:()=>MD,Paste:()=>OD,Tabindex:()=>PD,TextDirection:()=>ID,focusEventsPluginKey:()=>jD});var Lt=class ED extends N1{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new ED(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},CD=Lt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Et({key:new Zt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,{ranges:i}=s,o=Math.min(...i.map(d=>d.$from.pos)),a=Math.max(...i.map(d=>d.$to.pos)),l=gD(n);return mD(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),ND=Lt.create({name:"commands",addCommands(){return{...sD}}}),_D=Lt.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 d=dD(t.before,[t,...e]);vD(d).forEach(p=>{d.mapping.mapResult(p.oldRange.from).deletedAfter&&d.mapping.mapResult(p.oldRange.to).deletedBefore&&d.before.nodesBetween(p.oldRange.from,p.oldRange.to,(g,m)=>{const y=m+g.nodeSize-2,v=p.oldRange.from<=m&&y<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:g,from:m,to:y,newFrom:d.mapping.map(m),newTo:d.mapping.map(y),deletedRange:p.oldRange,newRange:p.newRange,partial:!v,editor:this.editor,transaction:t,combinedTransform:d})})});const f=d.mapping;d.steps.forEach((p,g)=>{var m,y;if(p instanceof fs){const v=f.slice(g).map(p.from,-1),x=f.slice(g).map(p.to),w=f.invert().map(v,-1),k=f.invert().map(x),S=(m=d.doc.nodeAt(v-1))==null?void 0:m.marks.some(C=>C.eq(p.mark)),E=(y=d.doc.nodeAt(x))==null?void 0:y.marks.some(C=>C.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:w,to:k},newRange:{from:v,to:x},partial:!!(E||S),editor:this.editor,transaction:t,combinedTransform:d})}})};(s=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),TD=Lt.create({name:"drop",addProseMirrorPlugins(){return[new Et({key:new Zt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),AD=Lt.create({name:"editable",addProseMirrorPlugins(){return[new Et({key:new Zt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),jD=new Zt("focusEvents"),RD=Lt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Et({key:jD,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}}}})]}}),MD=Lt.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:d,$anchor:h}=l,{pos:f,parent:p}=h,g=h.parent.isTextblock&&f>0?a.doc.resolve(f-1):h,m=g.parent.type.spec.isolating,y=h.pos-h.parentOffset,v=m&&g.parent.childCount===1?y===h.pos:Fe.atStart(c).from===f;return!d||!p.type.isTextblock||p.textContent.length||!v||v&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Om()||cD()?i:s},addProseMirrorPlugins(){return[new Et({key:new Zt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(m=>m.getMeta("composition")))return;const r=t.some(m=>m.docChanged)&&!e.doc.eq(n.doc),s=t.some(m=>m.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:a}=e.selection,l=Fe.atStart(e.doc).from,c=Fe.atEnd(e.doc).to;if(i||!(o===l&&a===c)||!py(n.doc))return;const f=n.tr,p=uy({state:n,transaction:f}),{commands:g}=new dy({editor:this.editor,state:p});if(g.clearNodes(),!!f.steps.length)return f}})]}}),OD=Lt.create({name:"paste",addProseMirrorPlugins(){return[new Et({key:new Zt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),PD=Lt.create({name:"tabindex",addProseMirrorPlugins(){return[new Et({key:new Zt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),ID=Lt.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=du(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 Et({key:new Zt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),ste=class Zl{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 Zl(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 Zl(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 Zl(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=this.pos+r+(i?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!s&&a.depth<=this.depth)return;const l=new Zl(a,this.editor,s,s?n:null);s&&(l.actualDepth=this.depth+1),e.push(new Zl(a,this.editor,s,s?n:null))}),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)}},ite=`.ProseMirror {
555  position: relative;
556}
557
558.ProseMirror {
559  word-wrap: break-word;
560  white-space: pre-wrap;
561  white-space: break-spaces;
562  -webkit-font-variant-ligatures: none;
563  font-variant-ligatures: none;
564  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
565}
566
567.ProseMirror [contenteditable="false"] {
568  white-space: normal;
569}
570
571.ProseMirror [contenteditable="false"] [contenteditable="true"] {
572  white-space: pre-wrap;
573}
574
575.ProseMirror pre {
576  white-space: pre-wrap;
577}
578
579img.ProseMirror-separator {
580  display: inline !important;
581  border: none !important;
582  margin: 0 !important;
583  width: 0 !important;
584  height: 0 !important;
585}
586
587.ProseMirror-gapcursor {
588  display: none;
589  pointer-events: none;
590  position: absolute;
591  margin: 0;
592}
593
594.ProseMirror-gapcursor:after {
595  content: "";
596  display: block;
597  position: absolute;
598  top: -2px;
599  width: 20px;
600  border-top: 1px solid black;
601  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
602}
603
604@keyframes ProseMirror-cursor-blink {
605  to {
606    visibility: hidden;
607  }
608}
609
610.ProseMirror-hideselection *::selection {
611  background: transparent;
612}
613
614.ProseMirror-hideselection *::-moz-selection {
615  background: transparent;
616}
617
618.ProseMirror-hideselection * {
619  caret-color: transparent;
620}
621
622.ProseMirror-focused .ProseMirror-gapcursor {
623  display: block;
624}`;function ote(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 ate=class extends Gee{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:Eee,createMappablePosition:Cee},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=aD(e,this.options.autofocus);this.editorState=pc.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=ote(ite,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}),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=hD(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?[AD,CD.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),ND,RD,MD,PD,TD,OD,_D,ID.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 gy(r,this)}createCommandManager(){this.commandManager=new dy({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=R0(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=R0(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;this.editorView=new nD(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.prependClass(),this.injectCSS();const o=this.view.dom;o.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 d;return(d=this.capturedTransaction)==null?void 0:d.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 yD(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return wee(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return E1(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
625
626`,textSerializers:n={}}=t||{};return mee(this.state.doc,{blockSeparator:e,textSerializers:{...gD(this.schema),...n}})}get isEmpty(){return py(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 ste(e,this)}get $doc(){return this.$pos(0)}};function hu(t){return new my({find:t.find,handler:({state:e,range:n,match:r})=>{const s=nt(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),d=c+o.length;if(C1(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>c).length)return null;d<n.to&&i.delete(d,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 DD(t){return new my({find:t.find,handler:({state:e,range:n,match:r})=>{const s=nt(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 d=o+c;d>a?d=a:a=d+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,o+r[0].length-1),i.replaceWith(d,a,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 O0(t){return new my({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=nt(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 fu(t){return new my({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=nt(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),c=l&&a1(l,t.type,i);if(!c)return null;if(o.wrap(l,c),t.keepMarks&&t.editor){const{selection:h,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,g=f||h.$to.parentOffset&&h.$from.marks();if(g){const m=g.filter(y=>p.includes(y.type.name));o.ensureMarks(m)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,i).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&na(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)},undoable:t.undoable})}var lte=t=>"touches"in t,cte=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=a=>{if(!this.isResizing||!this.activeHandle)return;const l=a.clientX-this.startX,c=a.clientY-this.startY;this.handleResize(l,c)},this.handleTouchMove=a=>{if(!this.isResizing||!this.activeHandle)return;const l=a.touches[0];if(!l)return;const c=l.clientX-this.startX,d=l.clientY-this.startY;this.handleResize(c,d)},this.handleMouseUp=()=>
626{if(!this.isResizing)return;const a=this.element.offsetWidth,l=this.element.offsetHeight;this.onCommit(a,l),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=a=>{a.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=a=>{a.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,s,i,o;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(s=t.options)!=null&&s.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(o=t.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display="flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),s=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),s&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}
626removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,lte(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:s}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(r,s,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,s=this.startHeight;const i=t.includes("right"),o=t.includes("left"),a=t.includes("bottom"),l=t.includes("top");return i?r=this.startWidth+e:o&&(r=this.startWidth-e),a?s=this.startHeight+n:l&&(s=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(s=this.startHeight+(a?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,s,t):{width:r,height:s}}applyConstraints(t,e,n){var r,s,i,o;if(!n){let c=Math.max(this.minSize.width,t),d=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(s=this.maxSize)!=null&&s.height&&(d=Math.min(this.maxSize.height,d)),{width:c,height:d}}let a=t,l=e;return a<this.minSize.width&&(a=this.minSize.width,l=a/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,a=l*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&a>this.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",s=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function ute(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof Se){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 dte={};b1(dte,{createAtomBlockMarkdownSpec:()=>hte,createBlockMarkdownSpec:()=>fte,createInlineMarkdownSpec:()=>gte,parseAttributes:()=>_1,parseIndentedBlocks:()=>P0,renderNestedMarkdownContent:()=>A1,serializeAttributes:()=>T1});function _1(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(d=>d.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,d])=>{var h;const f=parseInt(((h=d.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),p=n[f];p&&(e[c]=p.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();
vendor: 5,805 bytes, lines 626-641
626return l&&l.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function T1(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 hte(t){const{nodeName:e,name:n,parseAttributes:r=_1,serializeAttributes:s=T1,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:a}=t,l=n||e,c=d=>{if(!a)return d;const h={};return a.forEach(f=>{f in d&&(h[f]=d[f])}),h};return{parseMarkdown:(d,h)=>{const f={...i,...d.attributes};return h.createNode(e,f,[])},markdownTokenizer:{name:e,level:"block",start(d){var h;const f=new RegExp(`^:::${l}(?:\\s|$)`,"m"),p=(h=d.match(f))==null?void 0:h.index;return p!==void 0?p:-1},tokenize(d,h,f){const p=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),g=d.match(p);if(!g)return;const m=g[1]||"",y=r(m);if(!o.find(x=>!(x in y)))return{type:e,raw:g[0],attributes:y}}},renderMarkdown:d=>{const h=c(d.attrs||{}),f=s(h),p=f?` {${f}}`:"";return`:::${l}${p} :::`}}}function fte(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=_1,serializeAttributes:i=T1,defaultAttributes:o={},content:a="block",allowedAttributes:l}=t,c=n||e,d=h=>{if(!l)return h;const f={};return l.forEach(p=>{p in h&&(f[p]=h[p])}),f};return{parseMarkdown:(h,f)=>{let p;if(r){const m=r(h);p=typeof m=="string"?[{type:"text",text:m}]:m}else a==="block"?p=f.parseChildren(h.tokens||[]):p=f.parseInline(h.tokens||[]);const g={...o,...h.attributes};return f.createNode(e,g,p)},markdownTokenizer:{name:e,level:"block",start(h){var f;const p=new RegExp(`^:::${c}`,"m"),g=(f=h.match(p))==null?void 0:f.index;return g!==void 0?g:-1},tokenize(h,f,p){var g;const m=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=h.match(m);if(!y)return;const[v,x=""]=y,w=s(x);let k=1;const S=v.length;let E="";const C=/^:::([\w-]*)(\s.*)?/gm,N=h.slice(S);for(C.lastIndex=0;;){const T=C.exec(N);if(T===null)break;const M=T.index,D=T[1];if(!((g=T[2])!=null&&g.endsWith(":::"))){if(D)k+=1;else if(k-=1,k===0){const A=N.slice(0,M);E=A.trim();const L=h.slice(0,S+M+T[0].length);let I=[];if(E)if(a==="block")for(I=p.blockTokens(A),I.forEach(U=>{U.text&&(!U.tokens||U.tokens.length===0)&&(U.tokens=p.inlineTokens(U.text))});I.length>0;){const U=I[I.length-1];if(U.type==="paragraph"&&(!U.text||U.text.trim()===""))I.pop();else break}else I=p.inlineTokens(E);return{type:e,raw:L,attributes:w,content:E,tokens:I}}}}}},renderMarkdown:(h,f)=>{const p=d(h.attrs||{}),g=i(p),m=g?` {${g}}`:"",y=f.renderChildren(h.content||[],`
627
628`);return`:::${c}${m}
629
630${y}
631
632:::`}}}function pte(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 mte(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function gte(t){const{nodeName:e,name:n,getContent:r,parseAttributes:s=pte,serializeAttributes:i=mte,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=t,c=n||e,d=f=>{if(!l)return f;const p={};return l.forEach(g=>{const m=typeof g=="string"?g:g.name,y=typeof g=="string"?void 0:g.skipIfDefault;if(m in f){const v=f[m];if(y!==void 0&&v===y)return;p[m]=v}}),p},h=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,p)=>{const g={...o,...f.attributes};if(a)return p.createNode(e,g);const m=r?r(f):f.content||"";return m?p.createNode(e,g,[p.createTextNode(m)]):p.createNode(e,g,[])},markdownTokenizer:{name:e,level:"inline",start(f){const p=a?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),g=f.match(p),m=g==null?void 0:g.index;return m!==void 0?m:-1},tokenize(f,p,g){const m=a?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),y=f.match(m);if(!y)return;let v="",x="";if(a){const[,k]=y;x=k}else{const[,k,S]=y;x=k,v=S||""}const w=s(x.trim());return{type:e,raw:y[0],content:v.trim(),attributes:w}}},renderMarkdown:f=>{let p="";r?p=r(f):f.content&&f.content.length>0&&(p=f.content.filter(v=>v.type==="text").map(v=>v.text).join(""));const g=d(f.attrs||{}),m=i(g),y=m?` ${m}`:"";return a?`[${c}${y}]`:`[${c}${y}]${p}[/${c}]`}}}function P0(t,e,n){var r,s,i,o;const a=t.split(`
633`),l=[];let c="",d=0;const h=e.baseIndentSize||2;for(;d<a.length;){const f=a[d],p=f.match(e.itemPattern);if(!p){if(l.length>0)break;if(f.trim()===""){d+=1,c=`${c}${f}
634`;continue}else return}const g=e.extractItemData(p),{indentLevel:m,mainContent:y}=g;c=`${c}${f}
635`;const v=[y];for(d+=1;d<a.length;){const S=a[d];if(S.trim()===""){const C=a.slice(d+1).findIndex(M=>M.trim()!=="");if(C===-1)break;if((((s=(r=a[d+1+C].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:s.length)||0)>m){v.push(S),c=`${c}${S}
636`,d+=1;continue}else break}if((((o=(i=S.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>m)v.push(S),c=`${c}${S}
637`,d+=1;else break}let x;const w=v.slice(1);if(w.length>0){const S=w.map(E=>E.slice(m+h)).join(`
638`);S.trim()&&(e.customNestedParser?x=e.customNestedParser(S):x=n.blockTokens(S))}const k=e.createToken(g,x);l.push(k)}if(l.length!==0)return{items:l,raw:c}}function A1(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]),l=[`${s}${a}`];return o&&o.length>0&&o.forEach(c=>{const d=e.renderChildren([c]);if(d){const h=d.split(`
639`).map(f=>f?e.indent(f):"").join(`
640`);l.push(h)}}),l.join(`
641`)}function yte(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((a,l)=>{const c=i.mapping.map(l),d=i.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(p=>{if(p!==o)return!1;h=p}),!h)return;let f=!1;
641if(Object.keys(n).forEach(p=>{n[p]!==h.attrs[p]&&(f=!0)}),f){const p=t.type.create({...t.attrs,...n});i.removeMark(c,d,t.type),i.addMark(c,d,p)}}),i.docChanged&&e.view.dispatch(i)}var dr=class LD extends N1{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new LD(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function gl(t){return new Zee({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=nt(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 d=l.search(/\S/),h=n.from+l.indexOf(a),f=h+a.length;if(C1(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(y=>y===t.type&&y!==g.mark.type)).filter(g=>g.to>h).length)return null;f<n.to&&o.delete(f,n.to),h>n.from&&o.delete(n.from+d,h),c=n.from+d+a.length,o.addMark(n.from+d,c,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:vte,getOwnPropertySymbols:xte}=Object,{hasOwnProperty:bte}=Object.prototype;function ex(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function Uf(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 wte(t){return t!=null?t[Symbol.toStringTag]:void 0}function B_(t){return vte(t).concat(xte(t))}const kte=Object.hasOwn||((t,e)=>bte.call(t,e));function El(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const Ste="__v",Ete="__o",Cte="_owner",{getOwnPropertyDescriptor:q_,keys:U_}=Object;function Nte(t,e){return t.byteLength===e.byteLength&&Im(new Uint8Array(t),new Uint8Array(e))}function _te(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 Tte(t,e){return t.byteLength===e.byteLength&&Im(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Ate(t,e){return El(t.getTime(),e.getTime())}function jte(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function Rte(t,e){return t===e}function V_(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 d=!1,h=0;for(;(a=c.next())&&!a.done;){if(s[h]){h++;continue}const f=o.value,p=a.value;if(n.equals(f[0],p[0],l,h,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){d=s[h]=!0;break}h++}if(!d)return!1;l++}return!0}const Mte=El;function Ote(t,e,n){const r=U_(t);let s=r.length;if(U_(e).length!==s)return!1;for(;s-- >0;)if(!zD(t,e,n,r[s]))return!1;return!0}function Yu(t,e,n){const r=B_(t);let s=r.length;if(B_(e).length!==s)return!1;let i,o,a;for(;s-- >0;)if(i=r[s],!zD(t,e,n,i)||(o=q_(t,i),a=q_(e,i),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function Pte(t,e){return El(t.valueOf(),e.valueOf())}function Ite(t,e){return t.source===e.source&&t.flags===e.flags}function H_(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,d=0;for(;(a=l.next())&&!a.done;){if(!s[d]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){c=s[d]=!0;break}d++}if(!c)return!1}return!0}function Im(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 Dte(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 zD(t,e,n,r){return(r===Cte||r===Ete||r===Ste)&&(t.$$typeof||e.$$typeof)?!0:kte(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const Lte="[object ArrayBuffer]",zte="[object Arguments]",$te="[object Boolean]",Fte="[object DataView]",Bte="[object Date]",qte="[object Error]",Ute="[object Map]",Vte="[object Number]",Hte="[object Object]",Wte="[object RegExp]",Gte="[object Set]",Kte="[object String]",Jte={"[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
641]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Qte="[object URL]",Yte=Object.prototype.toString;function Zte({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:g}){return function(y,v,x){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,x):w==="function"?i(y,v,x):!1;const k=y.constructor;if(k!==v.constructor)return!1;if(k===Object)return l(y,v,x);if(Array.isArray(y))return e(y,v,x);if(k===Date)return r(y,v,x);if(k===RegExp)return d(y,v,x);if(k===Map)return o(y,v,x);if(k===Set)return h(y,v,x);const S=Yte.call(y);if(S===Bte)return r(y,v,x);if(S===Wte)return d(y,v,x);if(S===Ute)return o(y,v,x);if(S===Gte)return h(y,v,x);if(S===Hte)return typeof y.then!="function"&&typeof v.then!="function"&&l(y,v,x);if(S===Qte)return p(y,v,x);if(S===qte)return s(y,v,x);if(S===zte)return l(y,v,x);if(Jte[S])return f(y,v,x);if(S===Lte)return t(y,v,x);if(S===Fte)return n(y,v,x);if(S===$te||S===Vte||S===Kte)return c(y,v,x);if(g){let E=g[S];if(!E){const C=wte(y);C&&(E=g[C])}if(E)return E(y,v,x)}return!1}}function Xte({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:Nte,areArraysEqual:n?Yu:_te,areDataViewsEqual:Tte,areDatesEqual:Ate,areErrorsEqual:jte,areFunctionsEqual:Rte,areMapsEqual:n?ex(V_,Yu):V_,areNumbersEqual:Mte,areObjectsEqual:n?Yu:Ote,arePrimitiveWrappersEqual:Pte,areRegExpsEqual:Ite,areSetsEqual:n?ex(H_,Yu):H_,areTypedArraysEqual:n?ex(Im,Yu):Im,areUrlsEqual:Dte,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=Uf(r.areArraysEqual),i=Uf(r.areMapsEqual),o=Uf(r.areObjectsEqual),a=Uf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:a})}return r}function ene(t){return function(e,n,r,s,i,o,a){return t(e,n,a)}}function tne({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:d}=n();return e(a,l,{cache:c,equals:r,meta:d,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 nne=sa();sa({strict:!0});sa({circular:!0});sa({circular:!0,strict:!0});sa({createInternalComparator:()=>El});sa({strict:!0,createInternalComparator:()=>El});sa({circular:!0,createInternalComparator:()=>El});sa({circular:!0,createInternalComparator:()=>El,strict:!0});function sa(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=Xte(t),o=Zte(i),a=n?n(o):ene(o);return tne({circular:e,comparator:o,createState:r,equals:a,strict:s})}var $D={exports:{}},FD={};/**
642 * @license React
643 * use-sync-external-store-shim/with-selector.production.js
644 *
645 * Copyright (c) Meta Platforms, Inc. and affiliates.
646 *
647 * This source code is licensed under the MIT license found in the
648 * LICENSE file in the root directory of this source tree.
649 */var yy=b,rne=s1;function sne(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ine=typeof Object.is=="function"?Object.is:sne,one=rne.useSyncExternalStore,ane=yy.useRef,lne=yy.useEffect,cne=yy.useMemo,une=yy.useDebugValue;FD.useSyncExternalStoreWithSelector=function(t,e,n,r,s){var i=ane(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=cne(function(){function l(p){if(!c){if(c=!0,d=p,p=r(p),s!==void 0&&o.hasValue){var g=o.value;if(s(g,p))return h=g}return h=p}if(g=h,ine(d,p))return g;var m=r(p);return s!==void 0&&s(g,m)?(d=p,g):(d=p,h=m)}var c=!1,d,h,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=one(t,i[0],i[1]);return lne(function(){o.hasValue=!0,o.value=a},[a]),une(a),a};$D.exports=FD;var dne=$D.exports,hne=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},fne=({contentComponent:t})=>{const e=s1.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return u.jsx(u.Fragment,{children:Object.values(e)})};function pne(){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]:Vw.createPortal(r.reactElement,r.element,n)},t.forEach(s=>s())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(s=>s())}}}
649var mne=class extends F.Component{constructor(t){var e;super(t),this.editorContentRef=F.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=pne(),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 u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:hne(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&u.jsx(fne,{contentComponent:t.contentComponent})]})}},gne=b.forwardRef((t,e)=>{const n=F.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return F.createElement(mne,{key:n,innerRef:e,...t})}),yne=F.memo(gne),vne=typeof window<"u"?b.useLayoutEffect:b.useEffect,xne=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function bne(t){var e;const[n]=b.useState(()=>new xne(t.editor)),r=dne.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:nne);return vne(()=>n.watch(t.editor),[t.editor,n]),b.useDebugValue(r),r}var wne=!1,I0=typeof window>"u",kne=I0||!!(typeof window<"u"&&window.next),Sne=class BD{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 I0||kne?null:this.createEditor();if(this.options.current.immediatelyRender&&I0&&wne)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)}
649,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 ate(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?BD.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Ene(t={},e=[]){const n=b.useRef(t);n.current=t;const[r]=b.useState(()=>new Sne(n)),s=s1.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return b.useDebugValue(s),b.useEffect(r.onRender(e)),bne({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}var Cne=b.createContext({editor:null});Cne.Consumer;var Nne=b.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),_ne=()=>b.useContext(Nne);F.forwardRef((t,e)=>{const{onDragStart:n}=_ne(),r=t.as||"div";return u.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});F.createContext({markViewContentRef:()=>{}});var Dm=(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]},Tne=/^\s*>\s$/,Ane=dr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Dm("blockquote",{...Dt(this.options.HTMLAttributes,t),children:Dm("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach(s=>{const a=e.renderChildren([s]).split(`
650`).map(l=>l.trim()===""?n:`${n} ${l}`);r.push(a.join(`
651`))}),r.join(`
652${n}
653`)},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[fu({find:Tne,type:this.type})]}}),jne=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Rne=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Mne=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,One=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Pne=Sl.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 Dm("strong",{...Dt(this.options.HTMLAttributes,t),children:Dm("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>
vendor: 8,216 bytes, lines 653-674
653e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[hu({find:jne,type:this.type}),hu({find:Mne,type:this.type})]},addPasteRules(){return[gl({find:Rne,type:this.type}),gl({find:One,type:this.type})]}}),Ine=/(^|[^`])`([^`]+)`(?!`)$/,Dne=/(^|[^`])`([^`]+)`(?!`)/g,Lne=Sl.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Dt(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[hu({find:Ine,type:this.type})]},addPasteRules(){return[gl({find:Dne,type:this.type})]}}),tx=4,zne=/^```([a-z]+)?[\s\n]$/,$ne=/^~~~([a-z]+)?[\s\n]$/,Fne=dr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:tx,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",Dt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return((n=t.raw)==null?void 0:n.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(`
654`):r=`\`\`\`${s}
655
656\`\`\``,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:tx,{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:d}=s,p=r.doc.textBetween(c,d,`
657`,`
658`).split(`
659`).map(g=>a+g).join(`
660`);return l.replaceWith(c,d,r.schema.text(p)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:tx,{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,d=i.start(),h=i.end(),p=r.doc.textBetween(d,h,`
661`,`
662`).split(`
663`);let g=0,m=0;const y=c-d;for(let E=0;E<p.length;E+=1){if(m+p[E].length>=y){g=E;break}m+=p[E].length+1}const x=((l=p[g].match(/^ */))==null?void 0:l[0])||"",w=Math.min(x.length,n);if(w===0)return!0;let k=d;for(let E=0;E<g;E+=1)k+=p[E].length+1;return a.delete(k,k+w),c-k<=w&&a.setSelection(Re.create(a.doc,k)),!0}):t.commands.command(({tr:a})=>{const{from:l,to:c}=s,f=r.doc.textBetween(l,c,`
664`,`
665`).split(`
666`).map(p=>{var g;const m=((g=p.match(/^ */))==null?void 0:g[0])||"",y=Math.min(m.length,n);return p.slice(y)}).join(`
667`);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(`
668
669`);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(Fe.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[O0({find:zne,type:this.type,getAttributes:t=>({language:t[1]})}),O0({find:$ne,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Et({key:new Zt("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,`
670`));return o.replaceSelectionWith(this.type.create({language:i},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(Re.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),Bne=dr.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
671
672`):""}),qne=dr.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",Dt(this.options.HTMLAttributes,t)]},renderText(){return`
673`},renderMarkdown:()=>`  
674`,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:d})=>{if(d&&l&&o){const h=l.filter(f=>a.includes(f.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Une=dr.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]}`,Dt(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=>O0({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
674)\\s$`),type:this.type,getAttributes:{level:t}}))}}),Vne=dr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Dt(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!ute(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return xD(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(Re.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(Se.create(o.doc,l.pos)):o.setSelection(Re.create(o.doc,l.pos));else{const d=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,h=d==null?void 0:d.create();h&&(o.insert(c,h),o.setSelection(Re.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[DD({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
vendor: 4,463 bytes, line 674
674ype})]}}),Hne=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Wne=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Gne=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Kne=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Jne=Sl.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",Dt(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[hu({find:Hne,type:this.type}),hu({find:Gne,type:this.type})]},addPasteRules(){return[gl({find:Wne,type:this.type}),gl({find:Kne,type:this.type})]}});const Qne="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
674ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Yne="ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
674ºÐ´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",D0="numeric",L0="ascii",z0="alpha",Rd="asciinumeric",ud="alphanumeric",$0="domain",qD="emoji",Zne="scheme",Xne="slashscheme",nx="whitespace";function ere(t,e){return t in e||(e[t]=[]),e[t]}function Aa(t,e,n){e[D0]&&(e[Rd]=!0,e[ud]=!0),e[L0]&&(e[Rd]=!0,e[z0]=!0),e[Rd]&&(e[ud]=!0),e[z0]&&(e[ud]=!0),e[ud]&&(e[$0]=!0),e[qD]&&(e[$0]=!0);for(const r in e){const s=ere(r,n);s.indexOf(t)<0&&s.push(t)}}function tre(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function ir(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ir.groups={};ir.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||ir.groups;let s;return e&&e.j?s=e:(s=new ir(e),n&&r&&Aa(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||ir.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 ir,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new ir,i){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(tre(o.t,r),n);Aa(i,l,r)}else n&&Aa(i,n,r);o.t=i}return s.j[t]=o,o}};const $e=(t,e,n,r,s)=>t.ta(e,n,r,s),Ct=(t,e,n,r,s)=>t.tr(e,n,r,s),W_=(t,e,n,r,s)=>t.ts(e,n,r,s),V=(t,e,n,r,s)=>t.tt(e,n,r,s),ui="WORD",F0="UWORD",UD="ASCIINUMERICAL",VD="ALPHANUMERICAL",Ch="LOCALHOST",B0="TLD",q0="UTLD",kp="SCHEME",Xl="SLASH_SCHEME",j1="NUM",U0="WS",R1="NL",Md="OPENBRACE",Od="CLOSEBRACE",Lm="OPENBRACKET",zm="CLOSEBRACKET",$m="OPENPAREN",Fm="CLOSEPAREN",Bm="OPENANGLEBRACKET",qm="CLOSEANGLEBRACKET",Um="FULLWIDTHLEFTPAREN",Vm="FULLWIDTHRIGHTPAREN",Hm="LEFTCORNERBRACKET",Wm="RIGHTCORNERBRACKET",Gm="LEFTWHITECORNERBRACKET",Km="RIGHTWHITECORNERBRACKET",Jm="FULLWIDTHLESSTHAN",Qm="FULLWIDTHGREATERTHAN",Ym="AMPERSAND",Zm="APOSTROPHE",Xm="ASTERISK",Zi="AT",eg="BACKSLASH",tg="BACKTICK",ng="CARET",io="COLON",M1="COMMA",rg="DOLLAR",js="DOT",sg="EQUALS",O1="EXCLAMATION",Mr="HYPHEN",Pd="PERCENT",ig="PIPE",og="PLUS",ag="POUND",Id="QUERY",P1="QUOTE",HD="FULLWIDTHMIDDLEDOT",I1="SEMI",Rs="SLASH",Dd="TILDE",lg="UNDERSCORE",WD="EMOJI",cg="SYM";var GD=Object.freeze({__proto__:null,ALPHANUMERICAL:VD,AMPERSAND:Ym,APOSTROPHE:Zm,ASCIINUMERICAL:UD,ASTERISK:Xm,AT:Zi,BACKSLASH:eg,BACKTICK:tg,CARET:ng,CLOSEANGLEBRACKET:qm,CLOSEBRACE:Od,CLOSEBRACKET:zm,CLOSEPAREN:Fm,COLON:io,COMMA:M1,DOLLAR:rg,DOT:js,EMOJI:WD,EQUALS:sg,EXCLAMATION:O1,FULLWIDTHGREATERTHAN:Qm,FULLWIDTHLEFTPAREN:Um,FULLWIDTHLESSTHAN:Jm,FULLWIDTHMIDDLEDOT:HD,FULLWIDTHRIGHTPAREN:Vm,HYPHEN:Mr,LEFTCORNERBRACKET:Hm,LEFTWHITECORNERBRACKET:Gm,LOCALHOST:Ch,NL:R1,NUM:j1,OPENANGLEBRACKET:Bm,OPENBRACE:Md,OPENBRACKET:Lm,OPENPAREN:$m,PERCENT:Pd,PIPE:ig,PLUS:og,POUND:ag,QUERY:Id,QUOTE:P1,RIGHTCORNERBRACKET:Wm,RIGHTWHITECORNERBRACKET:Km,SCHEME:kp,SEMI:I1,SLASH:Rs,SLASH_SCHEME:Xl,SYM:cg,TILDE:Dd,TLD:B0,UNDERSCORE:lg,UTLD:q0,UWORD:F0,WORD:ui,WS:U0});const ai=/[a-z]/,Zu=new RegExp("\\p{L}","u"),rx=new RegExp("\\p{Emoji}","u"),li=/\d/,sx=/\s/,G_="\r",ix=`
675`,nre="️",rre="‍",ox="";let Vf=null,Hf=null;function sre(t=[]){const e={};ir.groups=e;const n=new ir;Vf==null&&(Vf=K_(Qne)),Hf==null&&(Hf=K_(Yne)),V(n,"'",Zm),V(n,"{",Md),V(n,"}",Od),V(n,"[",Lm),V(n,"]",zm),V(n,"(",$m),V(n,")",Fm),V(n,"<",Bm),V(n,">",qm),V(n,"(",Um),V(n,")",Vm),V(n,"「",Hm),V(n,"」",Wm),V(n,"『",Gm),V(n,"』",Km),V(n,"<",Jm),V(n,">",Qm),V(n,"&",Ym),V(n,"*",Xm),V(n,"@",Zi),V(n,"`",tg),V(n,"^",ng),V(n,":",io),V(n,",",M1),V(n,"$",rg),V(n,".",js),V(n,"=",sg),V(n,"!",O1),V(n,"-",Mr),V(n,"%",Pd),V(n,"|",ig),V(n,"+",og),V(n,"#",ag),V(n,"?",Id),V(n,'"',P1),V(n,"/",Rs),V(n,";",I1),V(n,"~",Dd),V(n,"_",lg),V(n,"\\",eg),V(n,"・",HD);const r=Ct(n,li,j1,{[D0]:!0});Ct(r,li,r);const s=Ct(r,ai,UD,{[Rd]:!0}),i=Ct(r,Zu,VD,{[ud]:!0}),o=Ct(n,ai,ui,{[L0]:!0});Ct(o,li,s),Ct(o,ai,o),Ct(s,li,s),Ct(s,ai,s);const a=Ct(n,Zu,F0,{[z0]:!0});Ct(a,ai),Ct(a,li,i),Ct(a,Zu,a),Ct(i,li,i),Ct(i,ai),Ct(i,Zu,i);const l=V(n,ix,R1,{[nx]:!0}),c=V(n,G_,U0,{[nx]:!0}),d=Ct(n,sx,U0,{[nx]:!0});V(n,ox,d),V(c,ix,l),V(c,ox,d),Ct(c,sx,d),V(d,G_),V(d,ix),Ct(d,sx,d),V(d,ox,d);const h=Ct(n,rx,WD,{[qD]:!0});V(h,"#"),Ct(h,rx,h),V(h,nre,h);const f=V(h,rre);V(f,"#"),Ct(f,rx,h);const p=[[ai,o],[li,s]],g=[[ai,null],[Zu,a],[li,i]];for(let m=0;m<Vf.length;m++)qi(n,Vf[m],B0,ui,p);for(let m=0;m<Hf.length;m++)qi(n,Hf[m],q0,F0,g);Aa(B0,{tld:!0,ascii:!0},e),Aa(q0,{utld:!0,alpha:!0},e),qi(n,"file",kp,ui,p),qi(n,"mailto",kp,ui,p),qi(n,"http",Xl,ui,p),qi(n,"https",Xl,ui,p),qi(n,"ftp",Xl,ui,p),qi(n,"ftps",Xl,ui,p),Aa(kp,{scheme:!0,ascii:!0},e),Aa(Xl,{slashscheme:!0,ascii:!0},e),t=t.sort((m,y)=>m[0]>y[0]?1:-1);for(let m=0;m<t.length;m++){const y=t[m][0],x=t[m][1]?{[Zne]:!0}
vendor: 31,574 bytes, lines 675-689
675:{[Xne]:!0};y.indexOf("-")>=0?x[$0]=!0:ai.test(y)?li.test(y)?x[Rd]=!0:x[L0]=!0:x[D0]=!0,W_(n,y,y,x)}return W_(n,"localhost",Ch,{ascii:!0}),n.jd=new ir(cg),{start:n,tokens:Object.assign({groups:e},GD)}}function KD(t,e){const n=ire(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,d=null,h=-1,f=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(h=0,f=0,d=a):h>=0&&(h+=n[o].length,f++),c+=n[o].length,i+=n[o].length,o++;i-=h,o-=f,c-=h,s.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return s}function ire(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 qi(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 ir(r),i.jr=s.slice(),t.j[l]=i),t=i}return i=new ir(n),i.jr=s.slice(),t.j[e[o-1]]=i,i}function K_(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 Nh={defaultProtocol:"http",events:null,format:J_,formatHref:J_,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function D1(t,e=null){let n=Object.assign({},Nh);t&&(n=Object.assign(n,t instanceof D1?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}D1.prototype={o:Nh,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]:Nh[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 J_(t){return t}function JD(t,e){this.t="token",this.v=t,this.tk=e}JD.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=Nh.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),d=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),d&&Object.assign(o,d),{tagName:s,attributes:o,content:i,eventListeners:h}}};function vy(t,e){class n extends JD{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 Q_=vy("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Y_=vy("text"),ore=vy("nl"),Wf=vy("url",{isLink:!0,toHref(t=Nh.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Ch&&t[1].t===io}}),Rr=t=>new ir(t);function are({groups:t}){const e=t.domain.concat([Ym,Xm,Zi,eg,tg,ng,rg,sg,Mr,j1,Pd,ig,og,ag,Rs,cg,Dd,lg]),n=[Zm,io,M1,js,O1,Pd,Id,P1,I1,Bm,qm,Md,Od,zm,Lm,$m,Fm,Um,Vm,Hm,Wm,Gm,Km,Jm,Qm],r=[Ym,Zm,Xm,eg,tg,ng,rg,sg,Mr,Md,Od,Pd,ig,og,ag,Id,Rs,cg,Dd,lg],s=Rr(),i=V(s,Dd);$e(i,r,i),$e(i,t.domain,i);const o=Rr(),a=Rr(),l=Rr();$e(s,t.domain,o),$e(s,t.scheme,a),$e(s,t.slashscheme,l),$e(o,r,i),$e(o,t.domain,o);const c=V(o,Zi);V(i,Zi,c),V(a,Zi,c),V(l,Zi,c);const d=V(i,js);$e(d,r,i),$e(d,t.domain,i);const h=Rr();$e(c,t.domain,h),$e(h,t.domain,h);const f=V(h,js);$e(f,t.domain,h);const p=Rr(Q_);$e(f,t.tld,p),$e(f,t.utld,p),V(c,Ch,p);const g=V(h,Mr);V(g,Mr,g),$e(g,t.domain,h),$e(p,t.domain,h),V(p,js,f),V(p,Mr,g);const m=V(p,io);$e(m,t.numeric,Q_);const y=V(o,Mr),v=V(o,js);V(y,Mr,y),$e(y,t.domain,o),$e(v,r,i),$e(v,t.domain,o);const x=Rr(Wf);$e(v,t.tld,x),$e(v,t.utld,x),$e(x,t.domain,o),$e(x,r,i),V(x,js,v),V(x,Mr,y),V(x,Zi,c);const w=V(x,io),k=Rr(Wf);$e(w,t.numeric,k);const S=Rr(Wf),E=Rr();$e(S,e,S),$e(S,n,E),$e(E,e,S),$e(E,n,E),V(x,Rs,S),V(k,Rs,S);const C=V(a,io),N=V(l,io),T=V(N,Rs),M=V(T,Rs);$e(a,t.domain,o),V(a,js,v),V(a,Mr,y),$e(l,t.domain,o),V(l,js,v),V(l,Mr,y),$e(C,t.domain,S),V(C,Rs,S),V(C,Id,S),$e(M,t.domain,S),$e(M,e,S),V(M,Rs,S);const D=[[Md,Od],[Lm,zm],[$m,Fm],[Bm,qm],[Um,Vm],[Hm,Wm],[Gm,Km],[Jm,Qm]];for(let A=0;A<D.length;A++){const[L,I]=D[A],U=V(S,L);V(E,L,U),V(U,I,S);const B=Rr(Wf);$e(U,e,B);const J=Rr();$e(U,n),$e(B,e,B),$e(B,n,J),$e(J,e,B),$e(J,n,J),V(B,I,S),V(J,I,S)}return V(s,Ch,x),V(s,R1,ore),{start:s,tokens:GD}}function lre(t,e,n){let r=n.length,s=0,i=[],o=[];for(;s<r;){let a=t,l=null,c=null,d=0,h=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,h=a):f>=0&&f++,s++,d++;if(f<0)s-=d,s<r&&(o.push(n[s]),s++);else{o.length>0&&(i.push(ax(Y_,e,o)),o=[]),s-=f,d-=f;const p=h.t,g=n.slice(s-d,s);i.push(ax(p,e,g))}}return o.length>0&&i.push(ax(Y_,e,o)),i}function ax(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 cre=typeof console<"u"&&console&&console.warn||(()=>{}),ure="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",pt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function dre(){return ir.groups={},pt.scanner=null,pt.parser=null,pt.tokenQueue=[],pt.pluginQueue=[],pt.customSchemes=[],pt.initialized=!1,pt}function Z_(t,e=!1){if(pt.initialized&&cre(`linkifyjs: already initialized - will not register custom scheme "${t}" ${ure}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
6761. Must only contain digits, lowercase ASCII letters or "-"
6772. Cannot start or end with "-"
6783. "-" cannot repeat`);pt.customSchemes.push([t,e])}function hre(){pt.scanner=sre(pt.customSchemes);for(let t=0;t<pt.tokenQueue.length;t++)pt.tokenQueue[t][1]({scanner:pt.scanner});pt.parser=are(pt.scanner.tokens);for(let t=0;t<pt.pluginQueue.length;t++)pt.pluginQueue[t][1]({scanner:pt.scanner,parser:pt.parser});return pt.initialized=!0,pt}function L1(t){return pt.initialized||hre(),lre(pt.parser.start,t,KD(pt.scanner.start,t))}L1.scan=KD;function QD(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 D1(n),s=L1(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 z1="[\0-   ᠎ -\u2029  ]",fre=new RegExp(z1),pre=new RegExp(`${z1}$`),mre=new RegExp(z1,"g");function gre(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function yre(t){return new Et({key:new Zt("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=dD(n.doc,[...e]);if(vD(a).forEach(({newRange:c})=>{const d=cee(r.doc,c,p=>p.isTextblock);let h,f;if(d.length>1)h=d[0],f=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const p=r.doc.textBetween(c.from,c.to," "," ");if(!pre.test(p))return;h=d[0],f=r.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&f){const p=f.split(fre).filter(Boolean);if(p.length<=0)return!1;const g=p[p.length-1],m=h.pos+f.lastIndexOf(g);if(!g)return!1;const y=L1(g).map(v=>v.toObject(t.defaultProtocol));if(!gre(y))return!1;y.filter(v=>v.isLink).map(v=>({...v,from:m+v.start+1,to:m+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=>{C1(v.from,v.to,r.doc).some(x=>x.mark.type===t.type)||o.addMark(v.from,v.to,t.type.create({href:v.href}))})}}),!!o.steps.length)return o}})}function vre(t){return new Et({key:new Zt("handleClickLink"),props:{handleClick:(e,n,r)=>{var s,i;if(r.button!==0||!e.editable)return!1;let o=!1;if(t.enableClickSelection&&(o=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{let h=r.target;const f=[];for(;h.nodeName!=="DIV";)f.push(h),h=h.parentNode;a=f.find(p=>p.nodeName==="A")}if(!a)return o;const l=yD(e.state,t.type.name),c=(s=a==null?void 0:a.href)!=null?s:l.href,d=(i=a==null?void 0:a.target)!=null?i:l.target;a&&c&&(window.open(c,d),o=!0)}return o}}})}function xre(t){return new Et({key:new Zt("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(d=>{l+=d.textContent});const c=QD(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c||s!==void 0&&!s(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function da(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(mre,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var YD=Sl.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"){Z_(t);return}Z_(t.scheme,t.optionalSlashes)})},onDestroy(){dre()},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)=>!!da(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}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!da(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=>!!da(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Dt(this.options.HTMLAttributes,t),0]:["a",Dt(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;const r=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${r})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!da(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=>!!da(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[gl({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,s=QD(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!da(o,n),protocols:n,defaultProtocol:r}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(yre({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!da(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(vre({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(xre({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),bre=YD,wre=Object.defineProperty,kre=(t,e)=>{for(var n in e)wre(t,n,{get:e[n],enumerable:!0})},Sre="listItem",X_="textStyle",eT=/^\s*([-+*])\s$/,ZD=dr.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",Dt(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,`
679`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Sre,this.editor.getAttributes(X_)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=fu({find:eT,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=fu({find:eT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(X_),editor:this.editor})),[t]}}),XD=dr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Dt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(s=>s.type==="paragraph"))n=e.parseChildren(t.tokens);else{const s=t.tokens[0];if(s&&s.type==="text"&&s.tokens&&s.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(s.tokens)}],t.tokens.length>1){const o=t.tokens.slice(1),a=e.parseChildren(o);n.push(...a)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>A1(t,e,r=>r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${r.index+1}. `:"- ",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)}}}),Ere={};kre(Ere,{findListItemPos:()=>Qh,getNextListDepth:()=>$1,handleBackspace:()=>V0,handleDelete:()=>H0,hasListBefore:()=>eL,hasListItemAfter:()=>Cre,hasListItemBefore:()=>tL,listItemHasSubList:()=>nL,nextListIsDeeper:()=>rL,nextListIsHigher:()=>sL});var Qh=(t,e)=>{const{$from:n}=e.selection,r=Gt(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}},$1=(t,e)=>{const n=Qh(t,e);if(!n)return!1;const[,r]=xee(e,t,n.$pos.pos+4);return r},eL=(t,e,n)=>{const{$anchor:r}=t.selection,s=Math.max(0,r.pos-2),i=t.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},tL=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((n=s.nodeBefore)==null?void 0:n.type.name)!==t)},nL=(t,e,n)=>{if(!n)return!1;const r=Gt(t,e.schema);let s=!1;return n.descendants(i=>{i.type===r&&(s=!0)}),s},V0=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ko(t.state,e)&&eL(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((f,p)=>{f.type.name===e&&c.push({node:f,pos:p})});const d=c.at(-1);if(!d)return!1;const h=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Ko(t.state,e)||!See(t.state))return!1;const r=Qh(e,t.state);if(!r)return!1;const i=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=nL(e,t.state,i);return tL(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},rL=(t,e)=>{const n=$1(t,e),r=Qh(t,e);return!r||!n?!1:n>r.depth},sL=(t,e)=>{const n=$1(t,e),r=Qh(t,e);return!r||!n?!1:n<r.depth},H0=(t,e)=>{if(!Ko(t.state,e)||!kee(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:rL(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():sL(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},Cre=(t,e)=>{var n;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((n=s.nodeAfter)==null?void 0:n.type.name)!==t)},iL=Lt.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&&H0(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&&H0(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&&V0(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&&V0(t,n,r)&&(e=!0)}),e}}}}),tT=/^(\s*)(\d+)\.\s+(.*)$/,Nre=/^\s/;function _re(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n],i=s.match(tT);if(!i)break;const[,o,a,l]=i,c=o.length;let d=l,h=n+1;const f=[s];for(;h<t.length;){const p=t[h];if(p.match(tT))break;if(p.trim()==="")f.push(p),d+=`
680`,h+=1;else if(p.match(Nre))f.push(p),d+=`
681${p.slice(c+2)}`,h+=1;else break}e.push({indent:c,number:parseInt(a,10),content:d.trim(),raw:f.join(`
682`)}),r=h,n=h}return[e,r]}function oL(t,e,n){var r;const s=[];let i=0;for(;i<t.length;){const o=t[i];if(o.indent===e){const a=o.content.split(`
683`),l=((r=a[0])==null?void 0:r.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.slice(1).join(`
684`).trim();if(d){const p=n.blockTokens(d);c.push(...p)}let h=i+1;const f=[];for(;h<t.length&&t[h].indent>e;)f.push(t[h]),h+=1;if(f.length>0){const p=Math.min(...f.map(m=>m.indent)),g=oL(f,p,n);c.push({type:"list",ordered:!0,start:f[0].number,items:g,raw:f.map(m=>m.raw).join(`
685`)})}s.push({type:"list_item",raw:o.raw,tokens:c}),i=h}else i+=1}return s}function Tre(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 Are="listItem",nT="textStyle",rT=/^(\d+)\.\s$/,aL=dr.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",Dt(this.options.HTMLAttributes,n),0]:["ol",Dt(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?Tre(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,`
686`):"",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(`
687`),[i,o]=_re(s);if(i.length===0)return;const a=oL(i,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:a,raw:s.slice(0,o).join(`
688`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Are,this.editor.getAttributes(nT)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=fu({find:rT,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=fu({find:rT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(nT)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),jre=/^\s*(\[([( |x])?\])\s$/,Rre=dr.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",Dt(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 A1(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=h=>{var f,p;a.ariaLabel=((p=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:p.call(f,h,a.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};c(t),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=n();if(typeof g!="number")return!1;const m=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...m==null?void 0:m.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(([h,f])=>{s.setAttribute(h,f)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,o),s.append(i,l),Object.entries(e).forEach(([h,f])=>{s.setAttribute(h,f)});let d=new Set(Object.keys(e));return{dom:s,contentDOM:l,update:h=>{if(h.type!==this.type)return!1;s.dataset.checked=h.attrs.checked,a.checked=h.attrs.checked,c(h);const f=r.extensionManager.attributes,p=Eh(h,f),g=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return d.forEach(y=>{g.has(y)||(y in m?s.setAttribute(y,m[y]):s.removeAttribute(y))}),Object.entries(p).forEach(([y,v])=>{v==null?y in m?s.setAttribute(y,m[y]):s.removeAttribute(y):s.setAttribute(y,v)}),d=g,!0}}}},addInputRules(){return[fu({find:jre,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Mre=dr.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",Dt(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,`
689`):"",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=P0(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=P0(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()}}});Lt.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(ZD.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(XD.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(iL.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(aL.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Rre.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Mre.configure(this.options.taskList)),t}});var Ore=dr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Dt(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:(t,e)=>!t||!Array.isArray(t.content)?"":e.renderChildren(t.content),addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Pre=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ire=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Dre=Sl.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",Dt(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[hu({find:Pre,type:this.type})]},addPasteRules(){return[gl({find:Ire,type:this.type})]}}),Lre=dr.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),zre=Sl.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",Dt(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 $re(t={}){return new Et({view(e){return new Fre(e,t)}})}class Fre{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}
vendor: 4,300 bytes, line 689
689destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let h=e.nodeBefore,f=e.nodeAfter;if(h||f){let p=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(p){let g=p.getBoundingClientRect(),m=h?g.bottom:g.top;h&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:g.left,right:g.right,top:m-y,bottom:m+y}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:h.left-f,right:h.left+f,top:h.top,bottom:h.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,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),f=h.width/l.offsetWidth,p=h.height/l.offsetHeight;c=h.left-l.scrollLeft*f,d=h.top-l.scrollTop*p}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=lI(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 Rt extends Fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Rt.valid(r)?new Rt(r):Fe.near(r)}content(){return oe.empty}eq(e){return e instanceof Rt&&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 Rt(e.resolve(n.pos))}getBookmark(){return new F1(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!Bre(e)||!qre(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&&Rt.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){i=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let l=e.doc.resolve(s);if(Rt.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!Se.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(Rt.valid(a))return a}return null}}}Rt.prototype.visible=!1;Rt.findFrom=Rt.findGapCursorFrom;Fe.jsonID("gapcursor",Rt);class F1{constructor(e){this.pos=e}map(e){return new F1(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Rt.valid(n)?new Rt(n):Fe.near(n)}}function lL(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function Bre(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||lL(s.type))return!0;
vendor: 18,897 bytes, line 689
689if(s.inlineContent)return!1}}return!0}function qre(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||lL(s.type))return!0;if(s.inlineContent)return!1}}return!0}function Ure(){return new Et({props:{decorations:Gre,createSelectionBetween(t,e,n){return e.pos==n.pos&&Rt.valid(n)?new Rt(n):null},handleClick:Hre,handleKeyDown:Vre,handleDOMEvents:{beforeinput:Wre}}})}const Vre=rD({ArrowLeft:Gf("horiz",-1),ArrowRight:Gf("horiz",1),ArrowUp:Gf("vert",-1),ArrowDown:Gf("vert",1)});function Gf(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 Re){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Rt.findGapCursorFrom(a,e,l);return c?(s&&s(r.tr.setSelection(new Rt(c))),!0):!1}}function Hre(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Rt.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&Se.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Rt(r))),!0)}function Wre(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Rt))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=q.empty;for(let o=r.length-1;o>=0;o--)s=q.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new oe(s,0,0));return i.setSelection(Re.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function Gre(t){if(!(t.selection instanceof Rt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",wt.create(t.doc,[$n.widget(t.selection.head,e,{key:"gapcursor"})])}var ug=200,on=function(){};on.prototype.append=function(e){return e.length?(e=on.from(e),!this.length&&e||e.length<ug&&this.leafAppend(e)||this.length<ug&&e.leafPrepend(this)||this.appendInner(e)):this};on.prototype.prepend=function(e){return e.length?on.from(e).append(this):this};on.prototype.appendInner=function(e){return new Kre(this,e)};on.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?on.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};on.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};on.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)};on.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};on.from=function(e){return e instanceof on?e:e&&e.length?new cL(e):on.empty};var cL=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,a){for(var 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<=ug)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=ug)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}(on);on.empty=new cL([]);var Kre=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}(on);const Jre=500;class ds{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=[],d=[];return this.items.forEach((h,f)=>{if(!h.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,d.push(h);return}if(s){d.push(new Ui(h.map));let p=h.step.map(s.slice(i)),g;p&&o.maybeStep(p).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],c.push(new Ui(g,void 0,void 0,c.length+d.length))),i--,g&&s.appendMap(g,i)}else o.maybeStep(h.step);if(h.selection)return a=s?h.selection.map(s.slice(i)):h.selection,l=new ds(this.items.slice(0,r).append(d.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 d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),f=new Ui(e.mapping.maps[d],h,n),p;(p=l&&l.merge(f))&&(f=p,d?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>Yre&&(a=Qre(a,c),o-=c),new ds(a.append(i),o)}remapping(e,n){let r=new vh;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 ds(this.items.append(e.map(n=>new Ui(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 p=i.getMirror(--l);if(p==null)return;o=Math.min(o,p);let g=i.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(i.slice(l+1,p));y&&a++,r.push(new Ui(g,m,y))}else r.push(new Ui(g))},s);let c=[];for(let f=n;f<o;f++)c.push(new Ui(i.maps[f]));let d=this.items.slice(0,s).append(c).append(r),h=new ds(d,a);return h.emptyItemCount()>Jre&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,a)=>{if(a>=e)s.push(o),o.selection&&i++;else if(o.step){let l=o.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&i++;let h=new Ui(c.invert(),l,d),f,p=s.length-1;(f=s.length&&s[p].merge(h))?s[p]=f:s.push(h)}}else o.map&&r--},this.items.length,0),new ds(on.from(s.reverse()),i)}}ds.empty=new ds(on.empty,0);function Qre(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}let Ui=class uL{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 uL(n.getMap().invert(),n,this.selection)}}};class Xi{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const Yre=20;function Zre(t,e,n,r){let s=n.getMeta(Ka),i;if(s)return s.historyState;n.getMeta(tse)&&(t=new Xi(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Ka))return o.getMeta(Ka).redo?new Xi(t.done.addTransform(n,void 0,r,Sp(e)),t.undone,sT(n.mapping.maps),t.prevTime,t.prevComposition):new Xi(t.done,t.undone.addTransform(n,void 0,r,Sp(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||!Xre(n,t.prevRanges)),c=o?lx(t.prevRanges,n.mapping):sT(n.mapping.maps);return new Xi(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Sp(e)),ds.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Xi(t.done.rebased(n,i),t.undone.rebased(n,i),lx(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Xi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),lx(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Xre(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 sT(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 lx(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 ese(t,e,n){let r=Sp(e),s=Ka.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 Xi(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(o).setMeta(Ka,{redo:n,historyState:l})}let cx=!1,iT=null;function Sp(t){let e=t.plugins;if(iT!=e){cx=!1,iT=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){cx=!0;break}}return cx}const Ka=new Zt("history"),tse=new Zt("closeHistory");function nse(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Et({key:Ka,state:{init(){return new Xi(ds.empty,ds.empty,null,0,-1)},apply(e,n,r){return Zre(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,s=r=="historyUndo"?hL:r=="historyRedo"?fL:null;return!s||!e.editable?!1:(n.preventDefault(),s(e.state,e.dispatch))}}}})}function dL(t,e){return(n,r)=>{let s=Ka.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=ese(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const hL=dL(!1,!0),fL=dL(!0,!0);Lt.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 Et({key:new Zt("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,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>r)}})]}});var rse=Lt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[$re(this.options)]}});Lt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Et({key:new Zt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return wt.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($n.node(c,c+l.nodeSize,{class:this.options.className}))}),wt.create(t,i)}}})]}});var sse=Lt.create({name:"gapCursor",addProseMirrorPlugins(){return[Ure()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=nt(xe(t,"allowGapCursor",n)))!=null?e:null}}}),ise=Lt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Et({key:new Zt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,s=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants((o,a)=>{const l=r>=a&&r<=a+o.nodeSize,c=!o.isLeaf&&py(o);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const h=$n.node(a,a+o.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});s.push(h)}return this.options.includeChildren}),wt.create(t,s)}}})]}});Lt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Et({key:new Zt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||xD(n.selection)||t.view.dragging?null:wt.create(n.doc,[$n.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function oT({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var ose=Lt.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Zt(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 Et({key:e,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:c}=o,d=e.getState(o),h=a.content.size,f=c.nodes[n];if(d)return l.insert(h,f.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!oT({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!oT({node:o,types:r})}}})]}}),ase=Lt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>hL(t,e),redo:()=>({state:t,dispatch:e})=>fL(t,e)}},addProseMirrorPlugins(){return[nse(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()}}}),lse=Lt.create({name:"starterKit",addExtensions(){var t,e,n,r;const s=[];return this.options.bold!==!1&&s.push(Pne.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(Ane.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(ZD.configure(this.options.bulletList)),this.options.code!==!1&&s.push(Lne.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(Fne.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(Bne.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(rse.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(sse.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(qne.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(Une.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(ase.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(Vne.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(Jne.configure(this.options.italic)),this.options.listItem!==!1&&s.push(XD.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(iL.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(YD.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(aL.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(Ore.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(Dre.configure(this.options.strike)),this.options.text!==!1&&s.push(Lre.configure(this.options.text)),this.options.underline!==!1&&s.push(zre.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(ose.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),cse=lse,use=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,dse=dr.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Dt(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const a=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",l=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`}
689,addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:a})=>{const l=document.createElement("img");Object.entries(o).forEach(([h,f])=>{if(f!=null)switch(h){case"width":case"height":break;default:l.setAttribute(h,f);break}}),l.src=o.src;const c=new cte({element:l,editor:a,node:s,getPos:i,onResize:(h,f)=>{l.style.width=`${h}px`,l.style.height=`${f}px`},onCommit:(h,f)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:h,height:f}).run()},onUpdate:(h,f,p)=>h.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),d=c.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",l.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[DD({find:use,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),hse=dse,fse=ise,ux="rovingFocusGroup.onEntryFocus",pse={bubbles:!1,cancelable:!0},Yh="RovingFocusGroup",[W0,pL,mse]=zh(Yh),[gse,mL]=_r(Yh,[mse]),[yse,vse]=gse(Yh),gL=b.forwardRef((t,e)=>u.jsx(W0.Provider,{scope:t.__scopeRovingFocusGroup,children:u.jsx(W0.Slot,{scope:t.__scopeRovingFocusGroup,children:u.jsx(xse,{...t,ref:e})})}));gL.displayName=Yh;var xse=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...h}=t,f=b.useRef(null),p=Ue(e,f),g=Hh(i),[m,y]=vs({prop:o,defaultProp:a??null,onChange:l,caller:Yh}),[v,x]=b.useState(!1),w=Gr(c),k=pL(n),S=b.useRef(!1),[E,C]=b.useState(0);return b.useEffect(()=>{const N=f.current;if(N)return N.addEventListener(ux,w),()=>N.removeEventListener(ux,w)},[w]),u.jsx(yse,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:m,onItemFocus:b.useCallback(N=>y(N),[y]),onItemShiftTab:b.useCallback(()=>x(!0),[]),onFocusableItemAdd:b.useCallback(()=>C(N=>N+1),[]),onFocusableItemRemove:b.useCallback(()=>C(N=>N-1),[]),children:u.jsx(Ee.div,{tabIndex:v||E===0?-1:0,"data-orientation":r,...h,ref:p,style:{outline:"none",...t.style},onMouseDown:ge(t.onMouseDown,()=>{S.current=!0}),onFocus:ge(t.onFocus,N=>{const T=!S.current;if(N.target===N.currentTarget&&T&&!v){const M=new CustomEvent(ux,pse);if(N.currentTarget.dispatchEvent(M),!M.defaultPrevented){const D=k().filter(B=>B.focusable),A=D.find(B=>B.active),L=D.find(B=>B.id===m),U=[A,L,...D].filter(Boolean).map(B=>B.ref.current);xL(U,d)}}S.current=!1}),onBlur:ge(t.onBlur,()=>x(!1))})})}),yL="RovingFocusGroupItem",vL=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...a}=t,l=Vs(),c=i||l,d=vse(yL,n),h=d.currentTabStopId===c,f=pL(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:m}=d;return b.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),u.jsx(W0.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:u.jsx(Ee.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...a,ref:e,onMouseDown:ge(t.onMouseDown,y=>{r?d.onItemFocus(c):y.preventDefault()}),onFocus:ge(t.onFocus,()=>d.onItemFocus(c)),onKeyDown:ge(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=kse(y,d.orientation,d.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=f().filter(k=>k.focusable).map(k=>k.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const k=w.indexOf(y.currentTarget);w=d.loop?Sse(w,k+1):w.slice(k+1)}setTimeout(()=>xL(w))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:m!=null}):o})})});vL.displayName=yL;var bse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wse(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function kse(t,e,n){const r=wse(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e
689==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return bse[r]}function xL(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Sse(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Ese=gL,Cse=vL,xy="Tabs",[Nse,hie]=_r(xy,[mL]),bL=mL(),[_se,B1]=Nse(xy),wL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:l="automatic",...c}=t,d=Hh(a),[h,f]=vs({prop:r,onChange:s,defaultProp:i??"",caller:xy});return u.jsx(_se,{scope:n,baseId:Vs(),value:h,onValueChange:f,orientation:o,dir:d,activationMode:l,children:u.jsx(Ee.div,{dir:d,"data-orientation":o,...c,ref:e})})});wL.displayName=xy;var kL="TabsList",SL=b.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=B1(kL,n),o=bL(n);return u.jsx(Ese,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:u.jsx(Ee.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});SL.displayName=kL;var EL="TabsTrigger",CL=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,o=B1(EL,n),a=bL(n),l=TL(o.baseId,r),c=AL(o.baseId,r),d=r===o.value;return u.jsx(Cse,{asChild:!0,...a,focusable:!s,active:d,children:u.jsx(Ee.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...i,ref:e,onMouseDown:ge(t.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:ge(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:ge(t.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!s&&h&&o.onValueChange(r)})})})});CL.displayName=EL;var NL="TabsContent",_L=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=t,a=B1(NL,n),l=TL(a.baseId,r),c=AL(a.baseId,r),d=r===a.value,h=b.useRef(d);return b.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),u.jsx(Zo,{present:s||d,children:({present:f})=>u.jsx(Ee.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:f&&i})})});_L.displayName=NL;function TL(t,e){return`${t}-trigger-${e}`}function AL(t,e){return`${t}-content-${e}`}var Tse=wL,jL=SL,RL=CL,ML=_L;const Ase=Tse,OL=b.forwardRef(({className:t,...e},n)=>u.jsx(jL,{ref:n,className:Z("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));OL.displayName=jL.displayName;const G0=b.forwardRef(({className:t,...e},n)=>u.jsx(RL,{ref:n,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...e}));G0.displayName=RL.displayName;const K0=b.forwardRef(({className:t,...e},n)=>u.jsx(ML,{ref:n,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));K0.displayName=ML.displayName;const jse=({content:t,onChange:e,placeholder:n="Schreibe hier deinen Inhalt..."})=>{const[r,s]=b.useState("edit"),i=Ene({extensions:[cse.configure({heading:{levels:[2,3]}}),bre.configure({openOnClick:!1,HTMLAttributes:{class:"text-primary underline"}}),hse.configure({HTMLAttributes:{class:"max-w-full rounded-lg my-4"}}),fse.configure({placeholder:n})],content:t,onUpdate:({editor:l})=>{e(l.getHTML())}});b.useEffect(()=>{i&&t!==i.getHTML()&&i.commands.setContent(t)},[t,i]);const o=b.useCallback(()=>{if(!i)return;const l=i.getAttributes("link").href,c=window.prompt("URL eingeben:",l);if(c!==null){if(c===""){i.chain().focus().extendMarkRange("link").unsetLink().run();return}i.chain().focus().extendMarkRange("link").setLink({href:c}).run()}},[i]),a=b.useCallback(()=>
689{if(!i)return;const l=window.prompt("Bild-URL eingeben:");l&&i.chain().focus().setImage({src:l}).run()},[i]);return i?u.jsx("div",{className:"border border-border rounded-lg overflow-hidden",children:u.jsxs(Ase,{value:r,onValueChange:l=>s(l),children:[u.jsx("div",{className:"bg-muted/50 border-b border-border px-2 pt-2 flex items-center justify-between",children:u.jsxs(OL,{className:"h-9",children:[u.jsxs(G0,{value:"edit",className:"gap-1.5 text-xs",children:[u.jsx(RF,{className:"w-3.5 h-3.5"}),"Bearbeiten"]}),u.jsxs(G0,{value:"preview",className:"gap-1.5 text-xs",children:[u.jsx(Kp,{className:"w-3.5 h-3.5"}),"Vorschau"]})]})}),u.jsxs(K0,{value:"edit",className:"mt-0",children:[u.jsxs("div",{className:"bg-muted/30 border-b border-border p-2 flex flex-wrap gap-1",children:[u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().toggleBold().run(),className:i.isActive("bold")?"bg-muted":"",title:"Fett (Ctrl+B)",children:u.jsx(lF,{className:"w-4 h-4"})}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().toggleItalic().run(),className:i.isActive("italic")?"bg-muted":"",title:"Kursiv (Ctrl+I)",children:u.jsx(SF,{className:"w-4 h-4"})}),u.jsx("div",{className:"w-px bg-border mx-1"}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().toggleHeading({level:2}).run(),className:i.isActive("heading",{level:2})?"bg-muted":"",title:"Überschrift 2 (Ctrl+Alt+2)",children:u.jsx(xF,{className:"w-4 h-4"})}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().toggleHeading({level:3}).run(),className:i.isActive("heading",{level:3})?"bg-muted":"",title:"Überschrift 3 (Ctrl+Alt+3)",children:u.jsx(bF,{className:"w-4 h-4"})}),u.jsx("div",{className:"w-px bg-border mx-1"}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().toggleBulletList().run(),className:i.isActive("bulletList")?"bg-muted":"",title:"Aufzählung (Ctrl+Shift+8)",children:u.jsx(NF,{className:"w-4 h-4"})}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().toggleOrderedList().run(),className:i.isActive("orderedList")?"bg-muted":"",title:"Nummerierte Liste (Ctrl+Shift+7)",children:u.jsx(CF,{className:"w-4 h-4"})}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().toggleBlockquote().run(),className:i.isActive("blockquote")?"bg-muted":"",title:"Zitat (Ctrl+Shift+B)",children:u.jsx(OF,{className:"w-4 h-4"})}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().setHorizontalRule().run(),title:"Trennlinie",children:u.jsx(AF,{className:"w-4 h-4"})}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().toggleCodeBlock().run(),className:i.isActive("codeBlock")?"bg-muted":"",title:"Code-Block (Ctrl+Alt+C)",children:u.jsx(pF,{className:"w-4 h-4"})}),u.jsx("div",{className:"w-px bg-border mx-1"}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:o,className:i.isActive("link")?"bg-muted":"",title:"Link hinzufügen",children:u.jsx(EF,{className:"w-4 h-4"})}),i.isActive("link")&&u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().unsetLink().run(),title:"Link entfernen",children:u.jsx(VF,{className:"w-4 h-4"})}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:a,title:"Bild einfügen",children:u.jsx(wF,{className:"w-4 h-4"})}),u.jsx("div",{className:"w-px bg-border mx-1"}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().undo().run(),disabled:!i.can().undo(),title:"Rückgängig (Ctrl+Z)",children:u.jsx(UF,{className:"w-4 h-4"})}),u.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>i.chain().focus().redo().run(),disabled:!i.can().redo(),title:"Wiederholen (Ctrl+Y)",children:u.jsx(PF,{className:"w-4 h-4"})})]}),u.jsx(yne,{editor:i,className:"prose prose-sm max-w-none p-4 min-h-[300px] focus:outline-none [&_.ProseMirror]:min-h-[280px] [&_.ProseMirror]:outline-none [&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground [&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left [&_.ProseMirror_p.is-editor-empty:first-child::before]:
689pointer-events-none [&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0"})]}),u.jsx(K0,{value:"preview",className:"mt-0",children:u.jsx("div",{className:"p-4 min-h-[300px] bg-background",children:t?u.jsx("div",{className:"prose prose-sm max-w-none prose-headings:font-sans prose-headings:font-semibold prose-h2:text-xl prose-h3:text-lg prose-p:text-foreground prose-li:text-foreground prose-strong:text-foreground prose-blockquote:border-l-primary prose-blockquote:bg-muted/50 prose-blockquote:py-1 prose-blockquote:px-4 prose-blockquote:rounded-r prose-a:text-primary prose-hr:border-border prose-pre:bg-muted prose-pre:text-foreground prose-code:text-primary prose-code:bg-muted prose-code:px-1 prose-code:rounded",dangerouslySetInnerHTML:{__html:NO.sanitize(t)}}):u.jsx("p",{className:"text-muted-foreground italic",children:"Noch kein Inhalt vorhanden..."})})})]})}):null},Rse=["news","podcast","anleitung","qa","medien"],Mse=["demokratie","medien","srg","finanzierung","grundlagen"],Ose=["image","text"],Pse=["check","review","critical"],Ise=["Daniel Graf","Lisa Schweizer","Pascal Nufer","Sophie Fürst"],aT=()=>{const{id:t}=yk(),e=!!t,{isAdmin:n,isLoading:r,user:s}=Zg(),i=Oi(),{toast:o}=Lh(),[a,l]=b.useState(""),[c,d]=b.useState(""),[h,f]=b.useState(""),[p,g]=b.useState(""),[m,y]=b.useState("news"),[v,x]=b.useState(""),[w,k]=b.useState(""),[S,E]=b.useState(""),[C,N]=b.useState(""),[T,M]=b.useState(!1),[D,A]=b.useState(""),[L,I]=b.useState(!1),[U,B]=b.useState(!1),[J,P]=b.useState(""),[z,Q]=b.useState(""),[re,ce]=b.useState("image"),[ae,Ce]=b.useState("none"),[we,Ge]=b.useState(!1),[Y,Pe]=b.useState("check"),{isOtherEditorActive:Xe,otherEditorEmail:Ie}=fJ(t,(s==null?void 0:s.email)??null),{data:pe,isLoading:Le}=Xs({queryKey:["admin-post",t],queryFn:async()=>{const{data:X,error:it}=await We.from("blog_posts").select("*").eq("id",t).single();if(it)throw it;return X},enabled:e&&n});b.useEffect(()=>{if(pe&&(l(pe.title),d(pe.slug),f(pe.excerpt||""),g(pe.content),y(pe.category),x(pe.featured_image||""),k(pe.video_url||""),E(pe.audio_url||""),N(pe.social_embed||""),M(pe.is_published),P(pe.qa_category||""),Q(pe.short_description||""),ce(pe.homepage_style||"image"),Ce(pe.author||"none"),Pe(pe.review_status||"check"),Ge(pe.show_donation_banner||!1),pe.published_at)){const X=new Date(pe.published_at),it=new Date(X.getTime()-X.getTimezoneOffset()*6e4);A(it.toISOString().slice(0,16))}},[pe]),b.useEffect(()=>{!r&&(!s||!n)&&i("/admin")},[n,r,s,i]),b.useEffect(()=>{if(!e&&a){const X=a.toLowerCase().replace(/[äÄ]/g,"ae").replace(/[öÖ]/g,"oe").replace(/[üÜ]/g,"ue").replace(/ß/g,"ss").replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");d(X)}},[a,e]);const at=async X=>{var $,ee;const it=($=X.target.files)==null?void 0:$[0];if(!it)return;if(!["image/jpeg","image/jpg","image/png","image/webp","image/gif"].includes(it.type)){o({title:"Ungültiger Dateityp",description:"Erlaubt sind: JPG, PNG, WebP, GIF",variant:"destructive"});return}B(!0);const zt=(ee=it.name.split(".").pop())==null?void 0:ee.toLowerCase(),cn=`${Date.now()}.${zt}`,{error:_}=await We.storage.from("blog-images").upload(cn,it,{contentType:it.type,upsert:!1});if(_){console.error("Upload error:",_),o({title:"Upload fehlgeschlagen",description:_.message,variant:"destructive"}),B(!1);return}const{data:O}=We.storage.from("blog-images").getPublicUrl(cn);x(O.publicUrl),B(!1),o({title:"Erfolg",description:"Bild wurde hochgeladen."})},vt=async X=>{X.preventDefault(),I(!0);const ln={title:a,slug:c,excerpt:h||null,content:p,category:m,featured_image:v||null,video_url:w||null,audio_url:S||null,social_embed:C||null,is_published:T,published_at:D?new Date(D).toISOString():T?new Date().toISOString():null,qa_category:m==="qa"&&J||null,short_description:m==="qa"&&z||null,homepage_style:re,author:ae&&ae!=="none"?ae:null,review_status:Y,show_donation_banner:we};let zt;if(e?{error:zt}=await We.from("blog_posts").update(ln).eq("id",t):{error:zt}=await We.from("blog_posts").insert(ln),zt){o({title:"Fehler",description:zt.message,variant:"destructive"}),I(!1);return}o({title:"Erfolg",description:e?"Beitrag aktualisiert.":"Beitrag erstellt."}),i("/admin/dashboard")};return r||e&&Le?u.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:u.jsx(gs,{className:"w-8 h-8 animate-spin text-primary"})}):n?u.jsxs("div",{className:"min-h-screen bg-muted/30",children:[u.jsx("header",{className:"bg-card border-b border-border",children:u.jsxs("div",{className:"container max-w-4xl mx-auto px-4 py-4 flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx(Mt,{to:"/admin/dashboard",children:u.jsxs(ve,{variant:"ghost",size:"sm",children:[u.jsx(Gs,{className:"w-4 h-4 mr-2"}),"Zurück"]})}),u.jsx("h1",{className:"font-sans text-xl font-semibold text-foreground",children:e?"Beitrag bearbeiten":"Neuer Beitrag"})]}
689),u.jsxs(ve,{onClick:vt,disabled:L,children:[L?u.jsx(gs,{className:"w-4 h-4 mr-2 animate-spin"}):u.jsx(gR,{className:"w-4 h-4 mr-2"}),"Speichern"]})]})}),e&&Xe&&u.jsx("div",{className:"container max-w-4xl mx-auto px-4 pt-4",children:u.jsxs(MP,{variant:"destructive",className:"bg-amber-50 border-amber-200 text-amber-800",children:[u.jsx(Ks,{className:"h-4 w-4"}),u.jsxs(OP,{className:"ml-2",children:[u.jsx("strong",{children:Ie})," bearbeitet diesen Beitrag gerade ebenfalls. Änderungen könnten überschrieben werden."]})]})}),u.jsx("main",{className:"container max-w-4xl mx-auto px-4 py-8",children:u.jsxs("form",{onSubmit:vt,className:"space-y-8",children:[u.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 space-y-6",children:[u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"title",children:"Titel *"}),u.jsx(Tn,{id:"title",value:a,onChange:X=>l(X.target.value),placeholder:"Titel des Beitrags",required:!0,className:"mt-1.5"})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"slug",children:"URL-Slug *"}),u.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[u.jsx("span",{className:"text-muted-foreground text-sm",children:"/blog/"}),u.jsx(Tn,{id:"slug",value:c,onChange:X=>d(X.target.value),placeholder:"url-freundlicher-name",required:!0})]})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"category",children:"Kategorie *"}),u.jsxs(Ku,{value:m,onValueChange:X=>y(X),children:[u.jsx(Kl,{className:"mt-1.5",children:u.jsx(Ju,{})}),u.jsx(Jl,{children:Rse.map(X=>u.jsx(ga,{value:X,children:rl[X]},X))})]})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"homepageStyle",children:"Frontseite-Darstellung"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 mb-2",children:"Wie der Beitrag auf der Startseite angezeigt wird"}),u.jsxs(Ku,{value:re,onValueChange:X=>ce(X),children:[u.jsx(Kl,{className:"mt-1.5",children:u.jsx(Ju,{})}),u.jsx(Jl,{children:Ose.map(X=>u.jsx(ga,{value:X,children:gW[X]},X))})]})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"author",children:"Autor:in"}),u.jsxs(Ku,{value:ae,onValueChange:Ce,children:[u.jsx(Kl,{className:"mt-1.5",children:u.jsx(Ju,{placeholder:"Autor:in wählen (optional)"})}),u.jsxs(Jl,{children:[u.jsx(ga,{value:"none",children:"Kein:e Autor:in"}),Ise.map(X=>u.jsx(ga,{value:X,children:X},X))]})]})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"reviewStatus",children:"Review-Status"}),u.jsxs(Ku,{value:Y,onValueChange:X=>Pe(X),children:[u.jsx(Kl,{className:"mt-1.5",children:u.jsx(Ju,{})}),u.jsx(Jl,{children:Pse.map(X=>u.jsx(ga,{value:X,children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:`w-3 h-3 rounded-full ${X==="check"?"bg-green-500":X==="review"?"bg-amber-400":"bg-red-500"}`}),yW[X]]})},X))})]})]}),u.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-border",children:[u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"donationBanner",className:"cursor-pointer",children:"Spenden-Banner anzeigen"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Zeigt einen Spendenaufruf zwischen Menü und Beitragsinhalt"})]}),u.jsx(f0,{id:"donationBanner",checked:we,onCheckedChange:Ge})]}),m==="qa"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"qaCategory",children:"Q&A-Kategorie *"}),u.jsxs(Ku,{value:J,onValueChange:X=>P(X),children:[u.jsx(Kl,{className:"mt-1.5",children:u.jsx(Ju,{placeholder:"Kategorie wählen..."})}),u.jsx(Jl,{children:Mse.map(X=>u.jsx(ga,{value:X,children:xa[X]},X))})]})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"excerpt",children:"Lead für Karten-Preview *"}),u.jsx(fc,{id:"excerpt",value:h,onChange:X=>f(X.target.value),placeholder:"Kurzer Teaser für die Karten-Vorschau",rows:2,className:"mt-1.5"})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"shortDescription",children:"Kurzbeschreibung für /fragen-antworten *"}),u.jsx(fc,{id:"shortDescription",value:z,onChange:X=>Q(X.target.value),placeholder:"Beschreibung, die auf der FAQ-Seite angezeigt wird",rows:3,className:"mt-1.5"})]})]}),m!=="qa"&&u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"excerpt",children:"Kurzbeschreibung"}),u.jsx(fc,{id:"excerpt",value:h,onChange:X=>f(X.target.value),placeholder:"Kurze Zusammenfassung für Vorschau-Karten",rows:2,className:"mt-1.5"})]}),u.jsxs("div",{children:[u.jsx(ot,{children:"Inhalt *"}
689),u.jsx("div",{className:"mt-1.5",children:u.jsx(jse,{content:p,onChange:g,placeholder:"Schreibe hier deinen Beitrag..."})})]})]}),u.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 space-y-6",children:[u.jsx("h2",{className:"font-medium text-foreground",children:"Medien"}),u.jsxs("div",{children:[u.jsx(ot,{children:"Beitragsbild"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 mb-2",children:"Empfohlen: 1200×675px (16:9) für optimale Darstellung auf Web & Social Media"}),u.jsxs("div",{className:"flex items-center gap-4",children:[v&&u.jsx("img",{src:v,alt:"Vorschau",className:"w-32 h-20 object-cover rounded border"}),u.jsxs("label",{className:"cursor-pointer",children:[u.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-muted rounded-lg hover:bg-muted/80 transition-colors",children:[U?u.jsx(gs,{className:"w-4 h-4 animate-spin"}):u.jsx(HF,{className:"w-4 h-4"}),u.jsx("span",{className:"text-sm",children:"Bild hochladen"})]}),u.jsx("input",{type:"file",accept:"image/*",onChange:at,className:"hidden",disabled:U})]})]}),u.jsx(Tn,{value:v,onChange:X=>x(X.target.value),placeholder:"Oder Bild-URL eingeben",className:"mt-2"})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"videoUrl",children:"Video-URL (YouTube/Vimeo Embed)"}),u.jsx(Tn,{id:"videoUrl",value:w,onChange:X=>k(X.target.value),placeholder:"https://www.youtube.com/embed/...",className:"mt-1.5"})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"audioUrl",children:"Audio-URL"}),u.jsx(Tn,{id:"audioUrl",value:S,onChange:X=>E(X.target.value),placeholder:"https://example.com/audio.mp3",className:"mt-1.5"})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"socialEmbed",children:"Social Media Embed (HTML)"}),u.jsx(fc,{id:"socialEmbed",value:C,onChange:X=>N(X.target.value),placeholder:"<blockquote>...</blockquote>",rows:3,className:"mt-1.5 font-mono text-sm"})]})]}),u.jsxs("div",{className:"bg-card rounded-xl border border-border p-6 space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"font-medium text-foreground",children:"Veröffentlichen"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktivieren, um den Beitrag öffentlich sichtbar zu machen."})]}),u.jsx(f0,{checked:T,onCheckedChange:M})]}),u.jsxs("div",{children:[u.jsx(ot,{htmlFor:"publishedAt",children:"Veröffentlichungsd
689atum"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 mb-2",children:"Bestimmt die Reihenfolge der Beiträge (neuestes zuerst)"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Tn,{id:"publishedAt",type:"datetime-local",value:D,onChange:X=>A(X.target.value),className:"max-w-xs"}),u.jsxs(ve,{type:"button",variant:"outline",size:"sm",onClick:()=>{const X=new Date,it=new Date(X.getTime()-X.getTimezoneOffset()*6e4);A(it.toISOString().slice(0,16))},children:[u.jsx(Bo,{className:"w-4 h-4 mr-1"}),"Jetzt"]})]})]})]})]})})]}):null},Dse=()=>{const[t,e]=b.useState({last24hCount:0,lastCommitmentTalkNumber:0,averageTalkNumber:0,newsletterCount:0,newsletterTalkNumber:0,tallyCount:0,tallyTalkNumber:0}),[n,r]=b.useState(!0),s=async()=>{const i=new Date,o=new Date(i.getTime()-24*60*60*1e3),{data:a,error:l}=await We.from("conversation_commitments").select("talk_number, created_at, source").order("created_at",{ascending:!1});if(l){console.error("Error fetching commitment stats:",l),r(!1);return}if(!a||a.length===0){r(!1);return}const d=a.filter(w=>new Date(w.created_at)>=o).reduce((w,k)=>w+(k.talk_number||0),0),h=a[0],f=h?h.talk_number:0,p=a.reduce((w,k)=>w+(k.talk_number||0),0),g=a.length>0?p/a.length:0,m=a.filter(w=>w.source==="newsletter"),y=a.filter(w=>w.source!=="newsletter"),v=m.reduce((w,k)=>w+(k.talk_number||0),0),x=y.reduce((w,k)=>w+(k.talk_number||0),0);e({last24hCount:d,lastCommitmentTalkNumber:f,averageTalkNumber:Math.round(g*10)/10,newsletterCount:m.length,newsletterTalkNumber:v,tallyCount:y.length,tallyTalkNumber:x}),r(!1)};return b.useEffect(()=>{s();const i=setInterval(s,15e3),o=We.channel("commitment_stats_changes").on("postgres_changes",{event:"INSERT",schema:"public",table:"conversation_commitments"},()=>{s()}).subscribe();return()=>{clearInterval(i),We.removeChannel(o)}},[]),{stats:t,isLoading:n}};var PL="AlertDialog",[Lse,fie]=_r(PL,[p2]),Di=p2(),IL=t=>{const{__scopeAlertDialog:e,...n}=t,r=Di(e);return u.jsx(j2,{...r,...n,modal:!0})};IL.displayName=PL;var zse="AlertDialogTrigger",DL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Di(n);return u.jsx(R2,{...s,...r,ref:e})});DL.displayName=zse;var $se="AlertDialogPortal",LL=t=>{const{__scopeAlertDialog:e,...n}=t,r=Di(e);return u.jsx(M2,{...r,...n})};LL.displayName=$se;var Fse="AlertDialogOverlay",zL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Di(n);return u.jsx(Qk,{...s,...r,ref:e})});zL.displayName=Fse;var Rc="AlertDialogContent",[Bse,qse]=Lse(Rc),Use=Bj("AlertDialogContent"),$L=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Di(n),o=b.useRef(null),a=Ue(e,o),l=b.useRef(null);return u.jsx(R7,{contentName:Rc,titleName:FL,docsSlug:"alert-dialog",children:u.jsx(Bse,{scope:n,cancelRef:l,children:u.jsxs(Yk,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:ge(s.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(Use,{children:r}),u.jsx(Hse,{contentRef:o})]})})})});$L.displayName=Rc;var FL="AlertDialogTitle",BL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Di(n);return u.jsx(Zk,{...s,...r,ref:e})});BL.displayName=FL;var qL="AlertDialogDescription",UL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Di(n);return u.jsx(Xk,{...s,...r,ref:e})});UL.displayName=qL;var Vse="AlertDialogAction",VL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Di(n);return u.jsx(e1,{...s,...r,ref:e})});VL.displayName=Vse;var HL="AlertDialogCancel",WL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=qse(HL,n),i=Di(n),o=Ue(e,s);return u.jsx(e1,{...i,...r,ref:o})});WL.displayName=HL;var Hse=({contentRef:t})=>{const e=`\`${Rc}\` requires a description for the component to be accessible for screen reader users.
690
691You can add a description to the \`${Rc}\` by passing a \`${qL}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
692
693Alternatively, 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 \`${Rc}\`. 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.
694
695For more information, see https://radix-ui.com/primitives/docs/components/
695alert-dialog`;return b.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Wse=IL,Gse=DL,Kse=LL,GL=zL,KL=$L,JL=VL,QL=WL,YL=BL,ZL=UL;const Jse=Wse,Qse=Gse,Yse=Kse,XL=b.forwardRef(({className:t,...e},n)=>u.jsx(GL,{className:Z("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}));XL.displayName=GL.displayName;const ez=b.forwardRef(({className:t,...e},n)=>u.jsxs(Yse,{children:[u.jsx(XL,{}),u.jsx(KL,{ref:n,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));ez.displayName=KL.displayName;const tz=({className:t,...e})=>u.jsx("div",{className:Z("flex flex-col space-y-2 text-center sm:text-left",t),...e});tz.displayName="AlertDialogHeader";const nz=({className:t,...e})=>u.jsx("div",{className:Z("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});nz.displayName="AlertDialogFooter";const rz=b.forwardRef(({className:t,...e},n)=>u.jsx(YL,{ref:n,className:Z("text-lg font-semibold",t),...e}));rz.displayName=YL.displayName;const sz=b.forwardRef(({className:t,...e},n)=>u.jsx(ZL,{ref:n,className:Z("text-sm text-muted-foreground",t),...e}));sz.displayName=ZL.displayName;const iz=b.forwardRef(({className:t,...e},n)=>u.jsx(JL,{ref:n,className:Z(_k(),t),...e}));iz.displayName=JL.displayName;const oz=b.forwardRef(({className:t,...e},n)=>u.jsx(QL,{ref:n,className:Z(_k({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));oz.displayName=QL.displayName;const Zse=()=>{const t=Oi(),{isAdmin:e,isLoading:n}=Zg(),{stats:r,isLoading:s,refetch:i}=Bg(),{stats:o,isLoading:a}=Dse(),[l,c]=b.useState(0),[d,h]=b.useState(0),[f,p]=b.useState(!1),[g,m]=b.useState(!1);b.useEffect(()=>{!n&&!e&&t("/admin")},[e,n,t]),b.useEffect(()=>{r&&(c(r.committed_count),h(r.completed_count))},[r]);const y=async()=>{SE.info("Der Zähler wird automatisch vom DE-Projekt synchronisiert und kann hier nicht manuell geändert werden.")},v=async()=>{SE.info("Der Zähler wird automatisch vom DE-Projekt synchronisiert und kann hier nicht manuell geändert werden.")};return n||s||a?u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsx(gs,{className:"h-8 w-8 animate-spin text-primary"})}):e?u.jsx("div",{className:"min-h-screen bg-muted/30 py-8",children:u.jsxs("div",{className:"container max-w-2xl mx-auto px-4",children:[u.jsxs(ve,{variant:"ghost",onClick:()=>t("/admin"),className:"mb-6",children:[u.jsx(Gs,{className:"h-4 w-4 mr-2"}),"Zurück zum Dashboard"]}),u.jsxs(qa,{className:"mb-6",children:[u.jsxs(fp,{children:[u.jsxs(pp,{className:"font-sans text-2xl flex items-center gap-2",children:[u.jsx(Bo,{className:"h-5 w-5 text-primary"}),"Letzte 24 Stunden"]}),u.jsx(mp,{children:"Echtzeit-Statistiken zu den Formular-Eingaben."})]}),u.jsx(Ua,{children:u.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[u.jsxs("div",{className:"rounded-lg bg-primary/10 p-4 text-center",children:[u.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[u.jsx(BF,{className:"h-4 w-4 text-primary"}),u.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Neue Zusagen"})]}),u.jsx("span",{className:"text-3xl font-bold text-primary",children:o.last24hCount.toLocaleString("de-CH")})]}),u.jsxs("div",{className:"rounded-lg bg-secondary/10 p-4 text-center",children:[u.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[u.jsx(Ks,{className:"h-4 w-4 text-secondary"}),u.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Letzte Zusage"})]}),u.jsx("span",{className:"text-3xl font-bold text-secondary",children:o.lastCommitmentTalkNumber.toLocaleStr
695ing("de-CH")}),u.jsx("span",{className:"text-sm text-muted-foreground ml-1",children:"Gespräche"})]}),u.jsxs("div",{className:"rounded-lg bg-accent/20 p-4 text-center",children:[u.jsx("div",{className:"flex items-center justify-center gap-2 mb-2",children:u.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Ø pro Person"})}),u.jsx("span",{className:"text-3xl font-bold text-accent-foreground",children:o.averageTalkNumber.toLocaleString("de-CH")}),u.jsx("span",{className:"text-sm text-muted-foreground ml-1",children:"Gespräche"})]})]})})]}),u.jsxs(qa,{className:"mb-6",children:[u.jsxs(fp,{children:[u.jsx(pp,{className:"font-sans text-xl flex items-center gap-2",children:"📊 Herkunft der Zusagen"}),u.jsx(mp,{children:"Vergleich zwischen Newsletter-Links und Tally-Formular."})]}),u.jsxs(Ua,{children:[u.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg bg-blue-50 border border-blue-200 p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[u.jsx(Yw,{className:"h-5 w-5 text-blue-600"}),u.jsx("span",{className:"font-medium text-blue-900",children:"Newsletter-Links"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("span",{className:"text-sm text-blue-700",children:"Einträge:"}),u.jsx("span",{className:"text-xl font-bold text-blue-900",children:o.newsletterCount.toLocaleString("de-CH")})]}),u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("span",{className:"text-sm text-blue-700",children:"Gespräche:"}),u.jsx("span",{className:"text-xl font-bold text-blue-900",children:o.newsletterTalkNumber.toLocaleString("de-CH")})]})]})]}),u.jsxs("div",{className:"rounded-lg bg-green-50 border border-green-200 p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[u.jsx(yF,{className:"h-5 w-5 text-green-600"}),u.jsx("span",{className:"font-medium text-green-900",children:"Tally-Formular"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("span",{className:"text-sm text-green-700",children:"Einträge:"}),u.jsx("span",{className:"text-xl font-bold text-green-900",children:o.tallyCount.toLocaleString("de-CH")})]}),u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("span",{className:"text-sm text-green-700",children:"Gespräche:"}),u.jsx("span",{className:"text-xl font-bold text-green-900",children:o.tallyTalkNumber.toLocaleString("de-CH")})]})]})]})]}),u.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"Newsletter-Links: Direkte Zusagen via /zusage mit URL-Parametern. Tally: Formular auf /mitmachen."})]})]}),u.jsxs(qa,{className:"mb-6",children:[u.jsxs(fp,{children:[u.jsx(pp,{className:"font-sans text-2xl",children:"Gespräche-Zähler"}),u.jsx(mp,{children:"Aktualisiere die Anzahl der zugesagten und geführten Gespräche."})]}),u.jsxs(Ua,{className:"space-y-6",children:[u.jsxs("div",{className:"rounded-lg bg-accent/20 p-4 border border-accent",children:[u.jsx("p",{className:"text-sm font-medium text-accent-foreground mb-2",children:"📊 Formular-Eingaben (automatisch):"}),u.jsx("div",{className:"flex gap-6",children:u.jsxs("div",{children:[u.jsx("span",{className:"text-2xl font-bold text-accent-foreground",children:r.committed_count.toLocaleString("de-CH")}),u.jsx("span",{className:"text-sm text-muted-foreground ml-1",children:"zugesagt (von DE synced)"})]})}),u.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Diese Zahl wird automatisch aus den Formular-Eingaben berechnet und zum manuellen Wert addiert."})]}),u.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ot,{htmlFor:"committed",children:"Manuelle Korrektur (zugesagt)"}),u.jsx(Tn,{id:"committed",type:"number",min:0,value:l,onChange:x=>c(parseInt(x.target.value)||0),className:"text-lg font-semibold"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Zusätzliche zugesagte Gespräche (z.B. aus anderen Quellen)."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ot,{htmlFor:"completed",children:"Geführte Gespräche"}),u.jsx(Tn,{id:"completed",type:"number",min:0,value:d,onChange:x=>h(parseInt(x.target.value)||0),className:"text-lg font-semibold"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Anzahl der Gespräche, die bereits geführt wurden."})]})]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx(ve,{onClick:y,disabled:f||g,className:"flex-1",children:f?u.jsxs(u.Fragment,{children:[u.jsx(gs,{className:"h-4 w-4 mr-2 animate-spin"}),"Speichern..."]}):u.jsxs(u.Fragment,{children:[u.jsx(gR,{className:"h-4 w-4 mr-2"}),"Änderungen speichern"]})}),u.jsxs(Jse,{children:[u.jsx(Qse,{asChild:!0,children:u.jsx(ve,{variant:"outline",disabled:f||g||l===0&&d===0,children:g?u.jsx(gs,{className:"h-4 w-4 animate-spin"}
695):u.jsx(LF,{className:"h-4 w-4"})})}),u.jsxs(ez,{children:[u.jsxs(tz,{children:[u.jsx(rz,{children:"Zurücksetzen bestätigen"}),u.jsx(sz,{children:"Möchtest du die manuellen Korrekturen wirklich auf 0 zurücksetzen? Die Formular-Eingaben bleiben erhalten."})]}),u.jsxs(nz,{children:[u.jsx(oz,{children:"Abbrechen"}),u.jsx(iz,{onClick:v,children:"Zurücksetzen"})]})]})]})]})]})]})]})}):null},Xse=()=>{const t=ei();return b.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),u.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[u.jsx(Wt,{}),u.jsx("div",{className:"h-14 md:h-16"}),u.jsx("div",{className:"flex-1 flex items-center justify-center",children:u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),u.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Seite nicht gefunden"}),u.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Zurück zur Startseite"})]})}),u.jsx(Gn,{}),u.jsx(jn,{})]})},eie=new aU,tie=()=>u.jsx(hU,{client:eie,children:u.jsxs(Vq,{children:[u.jsx(_B,{}),u.jsx(i5,{}),u.jsxs(wV,{children:[u.jsx(CV,{}),u.jsxs(fV,{children:[u.jsx(Nt,{path:"/",element:u.jsx(_W,{})}),u.jsx(Nt,{path:"/verstehen",element:u.jsx(TW,{})}),u.jsx(Nt,{path:"/fragen-antworten",element:u.jsx(YW,{})}),u.jsx(Nt,{path:"/fragen-antworten/:slug",element:u.jsx(ZG,{})}),u.jsx(Nt,{path:"/participer",element:u.jsx(y9,{})}),u.jsx(Nt,{path:"/blog",element:u.jsx(x9,{})}),u.jsx(Nt,{path:"/newsletter",element:u.jsx(b9,{})}),u.jsx(Nt,{path:"/merci",element:u.jsx(w9,{})}),u.jsx(Nt,{path:"/ueber-uns",element:u.jsx(_9,{})}),u.jsx(Nt,{path:"/training",element:u.jsx(K7,{})}),u.jsx(Nt,{path:"/manifest",element:u.jsx(J7,{})}),u.jsx(Nt,{path:"/manifeste",element:u.jsx(Q7,{})}),u.jsx(Nt,{path:"/zusage",element:u.jsx(Z7,{})}),u.jsx(Nt,{path:"/voter",element:u.jsx(X7,{})}),u.jsx(Nt,{path:"/blog/:slug",element:u.jsx(nJ,{})}),u.jsx(Nt,{path:"/admin",element:u.jsx(rJ,{})}),u.jsx(Nt,{path:"/admin/dashboard",element:u.jsx(hJ,{})}),u.jsx(Nt,{path:"/admin/stats",element:u.jsx(Zse,{})}),u.jsx(Nt,{path:"/admin/posts/new",element:u.jsx(aT,{})}),u.jsx(Nt,{path:"/admin/posts/:id",element:u.jsx(aT,{})}),u.jsx(Nt,{path:"*",element:u.jsx(Xse,{})})]})]})]})});jj(document.getElementById("root")).render(u.jsx(Lj,{children:u.jsx(tie,{})}));

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.