@remarkablejames/editor 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{ActionMenuButton-DBZjUu-F.js → ActionMenuButton-CpmEfz31.js} +1 -1
- package/lib/{ActionMenuButton-C6jGtl3k.cjs → ActionMenuButton-NfiUDE60.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +2 -2
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +1 -1
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +15 -16
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +31 -32
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +2 -2
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +1 -1
- package/lib/{Drawer-DTCwtJEs.js → Drawer-CayP4Ww4.js} +13 -13
- package/lib/{Drawer-B031ezmA.cjs → Drawer-DlgdaO_B.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +8 -8
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +36 -36
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +3 -3
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +3 -3
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +8 -8
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +2 -2
- package/lib/History.cjs +1 -1
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +1 -1
- package/lib/{Iframe-D-UYBxiv.js → Iframe-C6Sb97KS.js} +5 -5
- package/lib/{Iframe-BUK2pkOL.cjs → Iframe-CANdxSpV.cjs} +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +3 -3
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +19 -19
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +12 -12
- package/lib/{Indent-Bvt-Qwar.js → Indent-CcFe8py3.js} +1 -1
- package/lib/{Indent-_y6N8MIQ.cjs → Indent-DuB2U6Cs.cjs} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +1 -1
- package/lib/{Katex-CJDtvu-v.js → Katex-Bp6AnIUF.js} +3 -4
- package/lib/Katex-DFU1unCm.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +1 -1
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +2 -2
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +1 -1
- package/lib/{LinkEditBlock-Cdqwj_NU.js → LinkEditBlock-BiHumIJR.js} +7 -7
- package/lib/{LinkEditBlock-ewTApx0K.cjs → LinkEditBlock-C2zX0WVK.cjs} +1 -1
- package/lib/Mermaid-B8lQSOGn.cjs +2 -0
- package/lib/{Mermaid-CnMYVX1P.js → Mermaid-Dlx0XTJj.js} +23 -24
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +1 -1
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +1 -1
- package/lib/PaywallSeparator.cjs +1 -0
- package/lib/PaywallSeparator.js +140 -0
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +7 -7
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +2 -2
- package/lib/SlashCommandNodeView-BfWNWGRr.cjs +1 -0
- package/lib/{SlashCommandNodeView-DcoLvt_6.js → SlashCommandNodeView-DzmsYaNc.js} +73 -57
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +1 -1
- package/lib/{Table-B8CHl8jK.cjs → Table-BfM6ywrZ.cjs} +1 -1
- package/lib/{Table-Cu12PvQ_.js → Table-IH34r4jd.js} +2 -2
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +2 -2
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +2 -2
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +1 -1
- package/lib/{Twitter-CrX4XY1j.js → Twitter-FVQKPaq6.js} +7 -7
- package/lib/{Twitter-6HYP_upt.cjs → Twitter-axcoCgD7.cjs} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +3 -3
- package/lib/bubble.cjs +3 -3
- package/lib/bubble.js +81 -83
- package/lib/{dropdown-menu-CVwXaR3Z.js → dropdown-menu-Ce2TorkG.js} +1 -1
- package/lib/{dropdown-menu-XIrQk3jr.cjs → dropdown-menu-DirUyRAI.cjs} +1 -1
- package/lib/extensions/PaywallSeparator/PaywallSeparator.d.ts +35 -0
- package/lib/extensions/PaywallSeparator/components/PaywallIcon.d.ts +2 -0
- package/lib/extensions/PaywallSeparator/components/PaywallSeparatorView.d.ts +17 -0
- package/lib/extensions/PaywallSeparator/components/RichTextPaywallSeparator.d.ts +1 -0
- package/lib/extensions/PaywallSeparator/components/index.d.ts +2 -0
- package/lib/extensions/PaywallSeparator/index.d.ts +1 -0
- package/lib/index-BynXHtjJ.cjs +28 -0
- package/lib/{index-B0d-u29p.js → index-CnKgiZFQ.js} +1201 -1050
- package/lib/index.cjs +1 -1
- package/lib/index.js +27 -27
- package/lib/{popover-0syCfWYi.cjs → popover-BdLwAlrM.cjs} +1 -1
- package/lib/{popover-DDT8YRht.js → popover-BzJyaFvy.js} +1 -1
- package/lib/{separator-D8lOAf8f.cjs → separator-CoQaQmFK.cjs} +1 -1
- package/lib/{separator-DRGTEiX4.js → separator-D-fyzbfx.js} +14 -14
- package/lib/style.css +1 -1
- package/lib/types.d.ts +5 -5
- package/package.json +14 -1
- package/lib/Katex-bJXkt-VP.cjs +0 -4
- package/lib/Mermaid-Dwz9o-yM.cjs +0 -2
- package/lib/SlashCommandNodeView-BMgQJ4xT.cjs +0 -1
- package/lib/index-De9MZVWQ.cjs +0 -28
- package/lib/select-D9wQw2qB.js +0 -120
- package/lib/select-DTNz0ZeE.cjs +0 -1
- package/lib/textarea-DfVzbMr5.js +0 -20
- package/lib/textarea-DpkwluT0.cjs +0 -1
package/lib/Katex-bJXkt-VP.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";const Dr=require("./clsx-CXbNJWDD.cjs"),Y=require("react/jsx-runtime"),Xa=require("katex"),fr=require("react"),nr=require("./index-De9MZVWQ.cjs");require("./theme.cjs");const sn=require("./textarea-DpkwluT0.cjs"),Po=require("./index-DgOXAdKt.cjs");var Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Io(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Ro(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var n=function a(){return this instanceof a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(r).forEach(function(a){var t=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(n,a,t.get?t:{enumerable:!0,get:function(){return r[a]}})}),n}function kt(r,e={}){if(typeof r=="object")return r;try{return JSON.parse(r)}catch{return e}}var ae,ln;function Qa(){if(ln)return ae;ln=1;var r=Object.prototype.toString;return ae=function(n){var a=r.call(n),t=a==="[object Arguments]";return t||(t=a!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&r.call(n.callee)==="[object Function]"),t},ae}var oe,cn;function $o(){if(cn)return oe;cn=1;var r;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=Qa(),t=Object.prototype.propertyIsEnumerable,f=!t.call({toString:null},"toString"),i=t.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(y){var h=y.constructor;return h&&h.prototype===y},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},v=(function(){if(typeof window>"u")return!1;for(var y in window)try{if(!c["$"+y]&&e.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{u(window[y])}catch{return!0}}catch{return!0}return!1})(),p=function(y){if(typeof window>"u"||!v)return u(y);try{return u(y)}catch{return!1}};r=function(h){var S=h!==null&&typeof h=="object",R=n.call(h)==="[object Function]",w=a(h),q=S&&n.call(h)==="[object String]",O=[];if(!S&&!R&&!w)throw new TypeError("Object.keys called on a non-object");var m=i&&R;if(q&&h.length>0&&!e.call(h,0))for(var j=0;j<h.length;++j)O.push(String(j));if(w&&h.length>0)for(var Q=0;Q<h.length;++Q)O.push(String(Q));else for(var H in h)!(m&&H==="prototype")&&e.call(h,H)&&O.push(String(H));if(f)for(var F=p(h),D=0;D<o.length;++D)!(F&&o[D]==="constructor")&&e.call(h,o[D])&&O.push(o[D]);return O}}return oe=r,oe}var ie,pn;function Lt(){if(pn)return ie;pn=1;var r=Array.prototype.slice,e=Qa(),n=Object.keys,a=n?function(i){return n(i)}:$o(),t=Object.keys;return a.shim=function(){if(Object.keys){var i=(function(){var o=Object.keys(arguments);return o&&o.length===arguments.length})(1,2);i||(Object.keys=function(u){return e(u)?t(r.call(u)):t(u)})}else Object.keys=a;return Object.keys||a},ie=a,ie}var ue,yn;function zr(){if(yn)return ue;yn=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return ue=r,ue}var fe,vn;function Ut(){return vn||(vn=1,fe=SyntaxError),fe}var se,gn;function ar(){return gn||(gn=1,se=TypeError),se}var le,hn;function xo(){return hn||(hn=1,le=Object.getOwnPropertyDescriptor),le}var ce,dn;function qr(){if(dn)return ce;dn=1;var r=xo();if(r)try{r([],"length")}catch{r=null}return ce=r,ce}var pe,mn;function Ht(){if(mn)return pe;mn=1;var r=zr(),e=Ut(),n=ar(),a=qr();return pe=function(f,i,o){if(!f||typeof f!="object"&&typeof f!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,y=!!a&&a(f,i);if(r)r(f,i,{configurable:v===null&&y?y.configurable:!v,enumerable:u===null&&y?y.enumerable:!u,value:o,writable:c===null&&y?y.writable:!c});else if(p||!u&&!c&&!v)f[i]=o;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},pe}var ye,Sn;function Gt(){if(Sn)return ye;Sn=1;var r=zr(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},ye=e,ye}var ve,bn;function Pr(){if(bn)return ve;bn=1;var r=Lt(),e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n=Object.prototype.toString,a=Array.prototype.concat,t=Ht(),f=function(c){return typeof c=="function"&&n.call(c)==="[object Function]"},i=Gt()(),o=function(c,v,p,y){if(v in c){if(y===!0){if(c[v]===p)return}else if(!f(y)||!y())return}i?t(c,v,p,!0):t(c,v,p)},u=function(c,v){var p=arguments.length>2?arguments[2]:{},y=r(v);e&&(y=a.call(y,Object.getOwnPropertySymbols(v)));for(var h=0;h<y.length;h+=1)o(c,y[h],v[y[h]],p[y[h]])};return u.supportsDescriptors=!!i,ve=u,ve}var ge={exports:{}},he,An;function zt(){return An||(An=1,he=Object),he}var de,On;function Za(){return On||(On=1,de=Error),de}var me,wn;function Eo(){return wn||(wn=1,me=EvalError),me}var Se,qn;function Bo(){return qn||(qn=1,Se=RangeError),Se}var be,Pn;function jo(){return Pn||(Pn=1,be=ReferenceError),be}var Ae,In;function Mo(){return In||(In=1,Ae=URIError),Ae}var Oe,Rn;function To(){return Rn||(Rn=1,Oe=Math.abs),Oe}var we,$n;function Co(){return $n||($n=1,we=Math.floor),we}var qe,xn;function Do(){return xn||(xn=1,qe=Math.max),qe}var Pe,En;function Fo(){return En||(En=1,Pe=Math.min),Pe}var Ie,Bn;function _o(){return Bn||(Bn=1,Ie=Math.pow),Ie}var Re,jn;function No(){return jn||(jn=1,Re=Math.round),Re}var $e,Mn;function Wo(){return Mn||(Mn=1,$e=Number.isNaN||function(e){return e!==e}),$e}var xe,Tn;function ko(){if(Tn)return xe;Tn=1;var r=Wo();return xe=function(n){return r(n)||n===0?n:n<0?-1:1},xe}var Ee,Cn;function Vr(){return Cn||(Cn=1,Ee=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),a=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var t=42;e[n]=t;for(var f in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,n);if(o.value!==t||o.enumerable!==!0)return!1}return!0}),Ee}var Be,Dn;function Vt(){if(Dn)return Be;Dn=1;var r=typeof Symbol<"u"&&Symbol,e=Vr();return Be=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Be}var je,Fn;function ro(){return Fn||(Fn=1,je=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),je}var Me,_n;function eo(){if(_n)return Me;_n=1;var r=zt();return Me=r.getPrototypeOf||null,Me}var Te,Nn;function Lo(){if(Nn)return Te;Nn=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,a="[object Function]",t=function(u,c){for(var v=[],p=0;p<u.length;p+=1)v[p]=u[p];for(var y=0;y<c.length;y+=1)v[y+u.length]=c[y];return v},f=function(u,c){for(var v=[],p=c,y=0;p<u.length;p+=1,y+=1)v[y]=u[p];return v},i=function(o,u){for(var c="",v=0;v<o.length;v+=1)c+=o[v],v+1<o.length&&(c+=u);return c};return Te=function(u){var c=this;if(typeof c!="function"||e.apply(c)!==a)throw new TypeError(r+c);for(var v=f(arguments,1),p,y=function(){if(this instanceof p){var q=c.apply(this,t(v,arguments));return Object(q)===q?q:this}return c.apply(u,t(v,arguments))},h=n(0,c.length-v.length),S=[],R=0;R<h;R++)S[R]="$"+R;if(p=Function("binder","return function ("+i(S,",")+"){ return binder.apply(this,arguments); }")(y),c.prototype){var w=function(){};w.prototype=c.prototype,p.prototype=new w,w.prototype=null}return p},Te}var Ce,Wn;function Fr(){if(Wn)return Ce;Wn=1;var r=Lo();return Ce=Function.prototype.bind||r,Ce}var De,kn;function Kt(){return kn||(kn=1,De=Function.prototype.call),De}var Fe,Ln;function Jt(){return Ln||(Ln=1,Fe=Function.prototype.apply),Fe}var _e,Un;function Uo(){return Un||(Un=1,_e=typeof Reflect<"u"&&Reflect&&Reflect.apply),_e}var Ne,Hn;function to(){if(Hn)return Ne;Hn=1;var r=Fr(),e=Jt(),n=Kt(),a=Uo();return Ne=a||r.call(n,e),Ne}var We,Gn;function Yt(){if(Gn)return We;Gn=1;var r=Fr(),e=ar(),n=Kt(),a=to();return We=function(f){if(f.length<1||typeof f[0]!="function")throw new e("a function is required");return a(r,n,f)},We}var ke,zn;function Ho(){if(zn)return ke;zn=1;var r=Yt(),e=qr(),n;try{n=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var a=!!n&&e&&e(Object.prototype,"__proto__"),t=Object,f=t.getPrototypeOf;return ke=a&&typeof a.get=="function"?r([a.get]):typeof f=="function"?function(o){return f(o==null?o:t(o))}:!1,ke}var Le,Vn;function Xt(){if(Vn)return Le;Vn=1;var r=ro(),e=eo(),n=Ho();return Le=r?function(t){return r(t)}:e?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return e(t)}:n?function(t){return n(t)}:null,Le}var Ue,Kn;function Qt(){if(Kn)return Ue;Kn=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=Fr();return Ue=n.call(r,e),Ue}var He,Jn;function vr(){if(Jn)return He;Jn=1;var r,e=zt(),n=Za(),a=Eo(),t=Bo(),f=jo(),i=Ut(),o=ar(),u=Mo(),c=To(),v=Co(),p=Do(),y=Fo(),h=_o(),S=No(),R=ko(),w=Function,q=function(T){try{return w('"use strict"; return ('+T+").constructor;")()}catch{}},O=qr(),m=zr(),j=function(){throw new o},Q=O?(function(){try{return arguments.callee,j}catch{try{return O(arguments,"callee").get}catch{return j}}})():j,H=Vt()(),F=Xt(),D=eo(),P=ro(),_=Jt(),L=Kt(),N={},U=typeof Uint8Array>"u"||!F?r:F(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":H&&F?F([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H&&F?F(F([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H||!F?r:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":O,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":t,"%ReferenceError%":f,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H||!F?r:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H&&F?F(""[Symbol.iterator]()):r,"%Symbol%":H?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":Q,"%TypedArray%":U,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":_,"%Object.defineProperty%":m,"%Object.getPrototypeOf%":D,"%Math.abs%":c,"%Math.floor%":v,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":h,"%Math.round%":S,"%Math.sign%":R,"%Reflect.getPrototypeOf%":P};if(F)try{null.error}catch(T){var sr=F(F(T));V["%Error.prototype%"]=sr}var Rr=function T(A){var I;if(A==="%AsyncFunction%")I=q("async function () {}");else if(A==="%GeneratorFunction%")I=q("function* () {}");else if(A==="%AsyncGeneratorFunction%")I=q("async function* () {}");else if(A==="%AsyncGenerator%"){var b=T("%AsyncGeneratorFunction%");b&&(I=b.prototype)}else if(A==="%AsyncIteratorPrototype%"){var E=T("%AsyncGenerator%");E&&F&&(I=F(E.prototype))}return V[A]=I,I},br={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},or=Fr(),G=Qt(),Ar=or.call(L,Array.prototype.concat),$r=or.call(_,Array.prototype.splice),Or=or.call(L,String.prototype.replace),gr=or.call(L,String.prototype.slice),g=or.call(L,RegExp.prototype.exec),d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,$=function(A){var I=gr(A,0,1),b=gr(A,-1);if(I==="%"&&b!=="%")throw new i("invalid intrinsic syntax, expected closing `%`");if(b==="%"&&I!=="%")throw new i("invalid intrinsic syntax, expected opening `%`");var E=[];return Or(A,d,function(z,K,J,X){E[E.length]=J?Or(X,x,"$1"):K||z}),E},M=function(A,I){var b=A,E;if(G(br,b)&&(E=br[b],b="%"+E[0]+"%"),G(V,b)){var z=V[b];if(z===N&&(z=Rr(b)),typeof z>"u"&&!I)throw new o("intrinsic "+A+" exists, but is not available. Please file an issue!");return{alias:E,name:b,value:z}}throw new i("intrinsic "+A+" does not exist!")};return He=function(A,I){if(typeof A!="string"||A.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof I!="boolean")throw new o('"allowMissing" argument must be a boolean');if(g(/^%?[^%]*%?$/,A)===null)throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var b=$(A),E=b.length>0?b[0]:"",z=M("%"+E+"%",I),K=z.name,J=z.value,X=!1,rr=z.alias;rr&&(E=rr[0],$r(b,Ar([0,1],rr)));for(var lr=1,ir=!0;lr<b.length;lr+=1){var er=b[lr],cr=gr(er,0,1),pr=gr(er,-1);if((cr==='"'||cr==="'"||cr==="`"||pr==='"'||pr==="'"||pr==="`")&&cr!==pr)throw new i("property names with quotes must have matching quotes");if((er==="constructor"||!ir)&&(X=!0),E+="."+er,K="%"+E+"%",G(V,K))J=V[K];else if(J!=null){if(!(er in J)){if(!I)throw new o("base intrinsic for "+A+" exists, but the property is not available.");return}if(O&&lr+1>=b.length){var yr=O(J,er);ir=!!yr,ir&&"get"in yr&&!("originalValue"in yr.get)?J=yr.get:J=J[er]}else ir=G(J,er),J=J[er];ir&&!X&&(V[K]=J)}}return J},He}var Ge,Yn;function Go(){if(Yn)return Ge;Yn=1;var r=vr(),e=Ht(),n=Gt()(),a=qr(),t=ar(),f=r("%Math.floor%");return Ge=function(o,u){if(typeof o!="function")throw new t("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||f(u)!==u)throw new t("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],v=!0,p=!0;if("length"in o&&a){var y=a(o,"length");y&&!y.configurable&&(v=!1),y&&!y.writable&&(p=!1)}return(v||p||!c)&&(n?e(o,"length",u,!0,!0):e(o,"length",u)),o},Ge}var ze,Xn;function zo(){if(Xn)return ze;Xn=1;var r=Fr(),e=Jt(),n=to();return ze=function(){return n(r,e,arguments)},ze}var Qn;function jr(){return Qn||(Qn=1,(function(r){var e=Go(),n=zr(),a=Yt(),t=zo();r.exports=function(i){var o=a(arguments),u=i.length-(arguments.length-1);return e(o,1+(u>0?u:0),!0)},n?n(r.exports,"apply",{value:t}):r.exports.apply=t})(ge)),ge.exports}var Ve,Zn;function Z(){if(Zn)return Ve;Zn=1;var r=vr(),e=Yt(),n=e([r("%String.prototype.indexOf%")]);return Ve=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e([i]):i},Ve}var Ke,ra;function no(){if(ra)return Ke;ra=1;var r=Lt(),e=Vr()(),n=Z(),a=zt(),t=n("Array.prototype.push"),f=n("Object.prototype.propertyIsEnumerable"),i=e?a.getOwnPropertySymbols:null;return Ke=function(u,c){if(u==null)throw new TypeError("target must be an object");var v=a(u);if(arguments.length===1)return v;for(var p=1;p<arguments.length;++p){var y=a(arguments[p]),h=r(y),S=e&&(a.getOwnPropertySymbols||i);if(S)for(var R=S(y),w=0;w<R.length;++w){var q=R[w];f(y,q)&&t(h,q)}for(var O=0;O<h.length;++O){var m=h[O];if(f(y,m)){var j=y[m];v[m]=j}}}return v},Ke}var Je,ea;function ao(){if(ea)return Je;ea=1;var r=no(),e=function(){if(!Object.assign)return!1;for(var a="abcdefghijklmnopqrst",t=a.split(""),f={},i=0;i<t.length;++i)f[t[i]]=t[i];var o=Object.assign({},f),u="";for(var c in o)u+=c;return a!==u},n=function(){if(!Object.assign||!Object.preventExtensions)return!1;var a=Object.preventExtensions({1:2});try{Object.assign(a,"xy")}catch{return a[1]==="y"}return!1};return Je=function(){return!Object.assign||e()||n()?r:Object.assign},Je}var Ye,ta;function Vo(){if(ta)return Ye;ta=1;var r=Pr(),e=ao();return Ye=function(){var a=e();return r(Object,{assign:a},{assign:function(){return Object.assign!==a}}),a},Ye}var Xe,na;function Ko(){if(na)return Xe;na=1;var r=Pr(),e=jr(),n=no(),a=ao(),t=Vo(),f=e.apply(a()),i=function(u,c){return f(Object,arguments)};return r(i,{getPolyfill:a,implementation:n,shim:t}),Xe=i,Xe}var Qe,aa;function oo(){if(aa)return Qe;aa=1;var r=vr(),e=jr(),n=e(r("String.prototype.indexOf"));return Qe=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e(i):i},Qe}var Ze,oa;function Jo(){if(oa)return Ze;oa=1;var r=function(){return typeof(function(){}).name=="string"},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch{e=null}r.functionsHaveConfigurableNames=function(){if(!r()||!e)return!1;var t=e(function(){},"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;return r.boundFunctionsHaveNames=function(){return r()&&typeof n=="function"&&(function(){}).bind().name!==""},Ze=r,Ze}var rt,ia;function Yo(){if(ia)return rt;ia=1;var r=Ht(),e=Gt()(),n=Jo().functionsHaveConfigurableNames(),a=ar();return rt=function(f,i){if(typeof f!="function")throw new a("`fn` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||n)&&(e?r(f,"name",i,!0,!0):r(f,"name",i)),f},rt}var et,ua;function io(){if(ua)return et;ua=1;var r=Yo(),e=ar(),n=Object;return et=r(function(){if(this==null||this!==n(this))throw new e("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),et}var tt,fa;function uo(){if(fa)return tt;fa=1;var r=io(),e=Pr().supportsDescriptors,n=Object.getOwnPropertyDescriptor;return tt=function(){if(e&&/a/mig.flags==="gim"){var t=n(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var f="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){f+="d"}}),Object.defineProperty(i,"sticky",{get:function(){f+="y"}}),t.get.call(i),f==="dy")return t.get}}return r},tt}var nt,sa;function Xo(){if(sa)return nt;sa=1;var r=Pr().supportsDescriptors,e=uo(),n=qr(),a=Object.defineProperty,t=Za(),f=Xt(),i=/a/;return nt=function(){if(!r||!f)throw new t("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=e(),c=f(i),v=n(c,"flags");return(!v||v.get!==u)&&a(c,"flags",{configurable:!0,enumerable:!1,get:u}),u},nt}var at,la;function Qo(){if(la)return at;la=1;var r=Pr(),e=jr(),n=io(),a=uo(),t=Xo(),f=e(a());return r(f,{getPolyfill:a,implementation:n,shim:t}),at=f,at}var Cr={exports:{}},ot,ca;function Ir(){if(ca)return ot;ca=1;var r=Vr();return ot=function(){return r()&&!!Symbol.toStringTag},ot}var it,pa;function fo(){if(pa)return it;pa=1;var r=Ir()(),e=Z(),n=e("Object.prototype.toString"),a=function(o){return r&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:n(o)==="[object Arguments]"},t=function(o){return a(o)?!0:o!==null&&typeof o=="object"&&"length"in o&&typeof o.length=="number"&&o.length>=0&&n(o)!=="[object Array]"&&"callee"in o&&n(o.callee)==="[object Function]"},f=(function(){return a(arguments)})();return a.isLegacyArguments=t,it=f?a:t,it}const Zo={},ri=Object.freeze(Object.defineProperty({__proto__:null,default:Zo},Symbol.toStringTag,{value:"Module"})),ei=Ro(ri);var ut,ya;function Kr(){if(ya)return ut;ya=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=r&&e&&typeof e.get=="function"?e.get:null,a=r&&Map.prototype.forEach,t=typeof Set=="function"&&Set.prototype,f=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,i=t&&f&&typeof f.get=="function"?f.get:null,o=t&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,v=typeof WeakSet=="function"&&WeakSet.prototype,p=v?WeakSet.prototype.has:null,y=typeof WeakRef=="function"&&WeakRef.prototype,h=y?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,R=Object.prototype.toString,w=Function.prototype.toString,q=String.prototype.match,O=String.prototype.slice,m=String.prototype.replace,j=String.prototype.toUpperCase,Q=String.prototype.toLowerCase,H=RegExp.prototype.test,F=Array.prototype.concat,D=Array.prototype.join,P=Array.prototype.slice,_=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,V=typeof Symbol=="function"&&typeof Symbol.iterator=="object",sr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===V||!0)?Symbol.toStringTag:null,Rr=Object.prototype.propertyIsEnumerable,br=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(s){return s.__proto__}:null);function or(s,l){if(s===1/0||s===-1/0||s!==s||s&&s>-1e3&&s<1e3||H.call(/e/,l))return l;var C=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof s=="number"){var W=s<0?-_(-s):_(s);if(W!==s){var k=String(W),B=O.call(l,k.length+1);return m.call(k,C,"$&_")+"."+m.call(m.call(B,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(l,C,"$&_")}var G=ei,Ar=G.custom,$r=z(Ar)?Ar:null,Or={__proto__:null,double:'"',single:"'"},gr={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ut=function s(l,C,W,k){var B=C||{};if(X(B,"quoteStyle")&&!X(Or,B.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(X(B,"maxStringLength")&&(typeof B.maxStringLength=="number"?B.maxStringLength<0&&B.maxStringLength!==1/0:B.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var mr=X(B,"customInspect")?B.customInspect:!0;if(typeof mr!="boolean"&&mr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(X(B,"indent")&&B.indent!==null&&B.indent!==" "&&!(parseInt(B.indent,10)===B.indent&&B.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(X(B,"numericSeparator")&&typeof B.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var wr=B.numericSeparator;if(typeof l>"u")return"undefined";if(l===null)return"null";if(typeof l=="boolean")return l?"true":"false";if(typeof l=="string")return xr(l,B);if(typeof l=="number"){if(l===0)return 1/0/l>0?"0":"-0";var tr=String(l);return wr?or(l,tr):tr}if(typeof l=="bigint"){var Sr=String(l)+"n";return wr?or(l,Sr):Sr}var Xr=typeof B.depth>"u"?5:B.depth;if(typeof W>"u"&&(W=0),W>=Xr&&Xr>0&&typeof l=="object")return $(l)?"[Array]":"[Object]";var Er=Oo(B,W);if(typeof k>"u")k=[];else if(ir(k,l)>=0)return"[Circular]";function ur(Br,kr,qo){if(kr&&(k=P.call(k),k.push(kr)),qo){var fn={depth:B.depth};return X(B,"quoteStyle")&&(fn.quoteStyle=B.quoteStyle),s(Br,fn,W+1,k)}return s(Br,B,W+1,k)}if(typeof l=="function"&&!T(l)){var rn=lr(l),en=Nr(l,ur);return"[Function"+(rn?": "+rn:" (anonymous)")+"]"+(en.length>0?" { "+D.call(en,", ")+" }":"")}if(z(l)){var tn=V?m.call(String(l),/^(Symbol\(.*\))_[^)]*$/,"$1"):U.call(l);return typeof l=="object"&&!V?dr(tn):tn}if(hr(l)){for(var Tr="<"+Q.call(String(l.nodeName)),Qr=l.attributes||[],Wr=0;Wr<Qr.length;Wr++)Tr+=" "+Qr[Wr].name+"="+g(d(Qr[Wr].value),"double",B);return Tr+=">",l.childNodes&&l.childNodes.length&&(Tr+="..."),Tr+="</"+Q.call(String(l.nodeName))+">",Tr}if($(l)){if(l.length===0)return"[]";var Zr=Nr(l,ur);return Er&&!Ao(Zr)?"["+Yr(Zr,Er)+"]":"[ "+D.call(Zr,", ")+" ]"}if(A(l)){var re=Nr(l,ur);return!("cause"in Error.prototype)&&"cause"in l&&!Rr.call(l,"cause")?"{ ["+String(l)+"] "+D.call(F.call("[cause]: "+ur(l.cause),re),", ")+" }":re.length===0?"["+String(l)+"]":"{ ["+String(l)+"] "+D.call(re,", ")+" }"}if(typeof l=="object"&&mr){if($r&&typeof l[$r]=="function"&&G)return G(l,{depth:Xr-W});if(mr!=="symbol"&&typeof l.inspect=="function")return l.inspect()}if(er(l)){var nn=[];return a&&a.call(l,function(Br,kr){nn.push(ur(kr,l,!0)+" => "+ur(Br,l))}),Zt("Map",n.call(l),nn,Er)}if(yr(l)){var an=[];return o&&o.call(l,function(Br){an.push(ur(Br,l))}),Zt("Set",i.call(l),an,Er)}if(cr(l))return Jr("WeakMap");if(_r(l))return Jr("WeakSet");if(pr(l))return Jr("WeakRef");if(b(l))return dr(ur(Number(l)));if(K(l))return dr(ur(L.call(l)));if(E(l))return dr(S.call(l));if(I(l))return dr(ur(String(l)));if(typeof window<"u"&&l===window)return"{ [object Window] }";if(typeof globalThis<"u"&&l===globalThis||typeof Gr<"u"&&l===Gr)return"{ [object globalThis] }";if(!M(l)&&!T(l)){var ee=Nr(l,ur),on=br?br(l)===Object.prototype:l instanceof Object||l.constructor===Object,te=l instanceof Object?"":"null prototype",un=!on&&sr&&Object(l)===l&&sr in l?O.call(rr(l),8,-1):te?"Object":"",wo=on||typeof l.constructor!="function"?"":l.constructor.name?l.constructor.name+" ":"",ne=wo+(un||te?"["+D.call(F.call([],un||[],te||[]),": ")+"] ":"");return ee.length===0?ne+"{}":Er?ne+"{"+Yr(ee,Er)+"}":ne+"{ "+D.call(ee,", ")+" }"}return String(l)};function g(s,l,C){var W=C.quoteStyle||l,k=Or[W];return k+s+k}function d(s){return m.call(String(s),/"/g,""")}function x(s){return!sr||!(typeof s=="object"&&(sr in s||typeof s[sr]<"u"))}function $(s){return rr(s)==="[object Array]"&&x(s)}function M(s){return rr(s)==="[object Date]"&&x(s)}function T(s){return rr(s)==="[object RegExp]"&&x(s)}function A(s){return rr(s)==="[object Error]"&&x(s)}function I(s){return rr(s)==="[object String]"&&x(s)}function b(s){return rr(s)==="[object Number]"&&x(s)}function E(s){return rr(s)==="[object Boolean]"&&x(s)}function z(s){if(V)return s&&typeof s=="object"&&s instanceof Symbol;if(typeof s=="symbol")return!0;if(!s||typeof s!="object"||!U)return!1;try{return U.call(s),!0}catch{}return!1}function K(s){if(!s||typeof s!="object"||!L)return!1;try{return L.call(s),!0}catch{}return!1}var J=Object.prototype.hasOwnProperty||function(s){return s in this};function X(s,l){return J.call(s,l)}function rr(s){return R.call(s)}function lr(s){if(s.name)return s.name;var l=q.call(w.call(s),/^function\s*([\w$]+)/);return l?l[1]:null}function ir(s,l){if(s.indexOf)return s.indexOf(l);for(var C=0,W=s.length;C<W;C++)if(s[C]===l)return C;return-1}function er(s){if(!n||!s||typeof s!="object")return!1;try{n.call(s);try{i.call(s)}catch{return!0}return s instanceof Map}catch{}return!1}function cr(s){if(!c||!s||typeof s!="object")return!1;try{c.call(s,c);try{p.call(s,p)}catch{return!0}return s instanceof WeakMap}catch{}return!1}function pr(s){if(!h||!s||typeof s!="object")return!1;try{return h.call(s),!0}catch{}return!1}function yr(s){if(!i||!s||typeof s!="object")return!1;try{i.call(s);try{n.call(s)}catch{return!0}return s instanceof Set}catch{}return!1}function _r(s){if(!p||!s||typeof s!="object")return!1;try{p.call(s,p);try{c.call(s,c)}catch{return!0}return s instanceof WeakSet}catch{}return!1}function hr(s){return!s||typeof s!="object"?!1:typeof HTMLElement<"u"&&s instanceof HTMLElement?!0:typeof s.nodeName=="string"&&typeof s.getAttribute=="function"}function xr(s,l){if(s.length>l.maxStringLength){var C=s.length-l.maxStringLength,W="... "+C+" more character"+(C>1?"s":"");return xr(O.call(s,0,l.maxStringLength),l)+W}var k=gr[l.quoteStyle||"single"];k.lastIndex=0;var B=m.call(m.call(s,k,"\\$1"),/[\x00-\x1f]/g,Mr);return g(B,"single",l)}function Mr(s){var l=s.charCodeAt(0),C={8:"b",9:"t",10:"n",12:"f",13:"r"}[l];return C?"\\"+C:"\\x"+(l<16?"0":"")+j.call(l.toString(16))}function dr(s){return"Object("+s+")"}function Jr(s){return s+" { ? }"}function Zt(s,l,C,W){var k=W?Yr(C,W):D.call(C,", ");return s+" ("+l+") {"+k+"}"}function Ao(s){for(var l=0;l<s.length;l++)if(ir(s[l],`
|
|
2
|
-
`)>=0)return!1;return!0}function Oo(s,l){var C;if(s.indent===" ")C=" ";else if(typeof s.indent=="number"&&s.indent>0)C=D.call(Array(s.indent+1)," ");else return null;return{base:C,prev:D.call(Array(l+1),C)}}function Yr(s,l){if(s.length===0)return"";var C=`
|
|
3
|
-
`+l.prev+l.base;return C+D.call(s,","+C)+`
|
|
4
|
-
`+l.prev}function Nr(s,l){var C=$(s),W=[];if(C){W.length=s.length;for(var k=0;k<s.length;k++)W[k]=X(s,k)?l(s[k],s):""}var B=typeof N=="function"?N(s):[],mr;if(V){mr={};for(var wr=0;wr<B.length;wr++)mr["$"+B[wr]]=B[wr]}for(var tr in s)X(s,tr)&&(C&&String(Number(tr))===tr&&tr<s.length||V&&mr["$"+tr]instanceof Symbol||(H.call(/[^\w$]/,tr)?W.push(l(tr,s)+": "+l(s[tr],s)):W.push(tr+": "+l(s[tr],s))));if(typeof N=="function")for(var Sr=0;Sr<B.length;Sr++)Rr.call(s,B[Sr])&&W.push("["+l(B[Sr])+"]: "+l(s[B[Sr]],s));return W}return ut}var ft,va;function ti(){if(va)return ft;va=1;var r=Kr(),e=ar(),n=function(o,u,c){for(var v=o,p;(p=v.next)!=null;v=p)if(p.key===u)return v.next=p.next,c||(p.next=o.next,o.next=p),p},a=function(o,u){if(o){var c=n(o,u);return c&&c.value}},t=function(o,u,c){var v=n(o,u);v?v.value=c:o.next={key:u,next:o.next,value:c}},f=function(o,u){return o?!!n(o,u):!1},i=function(o,u){if(o)return n(o,u,!0)};return ft=function(){var u,c={assert:function(v){if(!c.has(v))throw new e("Side channel does not contain "+r(v))},delete:function(v){var p=u&&u.next,y=i(u,v);return y&&p&&p===y&&(u=void 0),!!y},get:function(v){return a(u,v)},has:function(v){return f(u,v)},set:function(v,p){u||(u={next:void 0}),t(u,v,p)}};return c},ft}var st,ga;function so(){if(ga)return st;ga=1;var r=vr(),e=Z(),n=Kr(),a=ar(),t=r("%Map%",!0),f=e("Map.prototype.get",!0),i=e("Map.prototype.set",!0),o=e("Map.prototype.has",!0),u=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return st=!!t&&function(){var p,y={assert:function(h){if(!y.has(h))throw new a("Side channel does not contain "+n(h))},delete:function(h){if(p){var S=u(p,h);return c(p)===0&&(p=void 0),S}return!1},get:function(h){if(p)return f(p,h)},has:function(h){return p?o(p,h):!1},set:function(h,S){p||(p=new t),i(p,h,S)}};return y},st}var lt,ha;function ni(){if(ha)return lt;ha=1;var r=vr(),e=Z(),n=Kr(),a=so(),t=ar(),f=r("%WeakMap%",!0),i=e("WeakMap.prototype.get",!0),o=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return lt=f?function(){var p,y,h={assert:function(S){if(!h.has(S))throw new t("Side channel does not contain "+n(S))},delete:function(S){if(f&&S&&(typeof S=="object"||typeof S=="function")){if(p)return c(p,S)}else if(a&&y)return y.delete(S);return!1},get:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?i(p,S):y&&y.get(S)},has:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?u(p,S):!!y&&y.has(S)},set:function(S,R){f&&S&&(typeof S=="object"||typeof S=="function")?(p||(p=new f),o(p,S,R)):a&&(y||(y=a()),y.set(S,R))}};return h}:a,lt}var ct,da;function lo(){if(da)return ct;da=1;var r=ar(),e=Kr(),n=ti(),a=so(),t=ni(),f=t||a||n;return ct=function(){var o,u={assert:function(c){if(!u.has(c))throw new r("Side channel does not contain "+e(c))},delete:function(c){return!!o&&o.delete(c)},get:function(c){return o&&o.get(c)},has:function(c){return!!o&&o.has(c)},set:function(c,v){o||(o=f()),o.set(c,v)}};return u},ct}var pt,ma;function ai(){if(ma)return pt;ma=1;var r=Qt(),e=lo()(),n=ar(),a={assert:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");if(e.assert(t),!a.has(t,f))throw new n("`"+f+"` is not present on `O`")},get:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return i&&i["$"+f]},has:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return!!i&&r(i,"$"+f)},set:function(t,f,i){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var o=e.get(t);o||(o={},e.set(t,o)),o["$"+f]=i}};return Object.freeze&&Object.freeze(a),pt=a,pt}var yt,Sa;function oi(){if(Sa)return yt;Sa=1;var r=ai(),e=Ut(),n=typeof StopIteration=="object"?StopIteration:null;return yt=function(t){if(!n)throw new e("this environment lacks StopIteration");r.set(t,"[[Done]]",!1);var f={next:function(){var o=r.get(this,"[[Iterator]]"),u=!!r.get(o,"[[Done]]");try{return{done:u,value:u?void 0:o.next()}}catch(c){if(r.set(o,"[[Done]]",!0),c!==n)throw c;return{done:!0,value:void 0}}}};return r.set(f,"[[Iterator]]",t),f},yt}var vt,ba;function co(){if(ba)return vt;ba=1;var r={}.toString;return vt=Array.isArray||function(e){return r.call(e)=="[object Array]"},vt}var gt,Aa;function po(){if(Aa)return gt;Aa=1;var r=Z(),e=r("String.prototype.valueOf"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object String]",f=Ir()();return gt=function(o){return typeof o=="string"?!0:!o||typeof o!="object"?!1:f?n(o):a(o)===t},gt}var ht,Oa;function yo(){if(Oa)return ht;Oa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;r||(n=function(i){return!1});var a=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!a&&(n=function(i){return!1}),ht=n||function(i){if(!i||typeof i!="object")return!1;try{if(a.call(i),t)try{t.call(i)}catch{return!0}return i instanceof r}catch{}return!1},ht}var dt,wa;function vo(){if(wa)return dt;wa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;e||(n=function(i){return!1});var a=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!t&&(n=function(i){return!1}),dt=n||function(i){if(!i||typeof i!="object")return!1;try{if(t.call(i),a)try{a.call(i)}catch{return!0}return i instanceof e}catch{}return!1},dt}var qa;function ii(){if(qa)return Cr.exports;qa=1;var r=fo(),e=oi();if(Vt()()||Vr()()){var n=Symbol.iterator;Cr.exports=function(P){if(P!=null&&typeof P[n]<"u")return P[n]();if(r(P))return Array.prototype[n].call(P)}}else{var a=co(),t=po(),f=vr(),i=f("%Map%",!0),o=f("%Set%",!0),u=oo(),c=u("Array.prototype.push"),v=u("String.prototype.charCodeAt"),p=u("String.prototype.slice"),y=function(P,_){var L=P.length;if(_+1>=L)return _+1;var N=v(P,_);if(N<55296||N>56319)return _+1;var U=v(P,_+1);return U<56320||U>57343?_+1:_+2},h=function(P){var _=0;return{next:function(){var N=_>=P.length,U;return N||(U=P[_],_+=1),{done:N,value:U}}}},S=function(P,_){if(a(P)||r(P))return h(P);if(t(P)){var L=0;return{next:function(){var U=y(P,L),V=p(P,L,U);return L=U,{done:U>P.length,value:V}}}}if(_&&typeof P["_es6-shim iterator_"]<"u")return P["_es6-shim iterator_"]()};if(!i&&!o)Cr.exports=function(P){if(P!=null)return S(P,!0)};else{var R=yo(),w=vo(),q=u("Map.prototype.forEach",!0),O=u("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var m=u("Map.prototype.iterator",!0),j=u("Set.prototype.iterator",!0);var Q=u("Map.prototype.@@iterator",!0)||u("Map.prototype._es6-shim iterator_",!0),H=u("Set.prototype.@@iterator",!0)||u("Set.prototype._es6-shim iterator_",!0),F=function(P){if(R(P)){if(m)return e(m(P));if(Q)return Q(P);if(q){var _=[];return q(P,function(N,U){c(_,[U,N])}),h(_)}}if(w(P)){if(j)return e(j(P));if(H)return H(P);if(O){var L=[];return O(P,function(N){c(L,N)}),h(L)}}};Cr.exports=function(P){return F(P)||S(P)}}}return Cr.exports}var mt,Pa;function go(){if(Pa)return mt;Pa=1;var r=function(e){return e!==e};return mt=function(n,a){return n===0&&a===0?1/n===1/a:!!(n===a||r(n)&&r(a))},mt}var St,Ia;function ho(){if(Ia)return St;Ia=1;var r=go();return St=function(){return typeof Object.is=="function"?Object.is:r},St}var bt,Ra;function ui(){if(Ra)return bt;Ra=1;var r=ho(),e=Pr();return bt=function(){var a=r();return e(Object,{is:a},{is:function(){return Object.is!==a}}),a},bt}var At,$a;function fi(){if($a)return At;$a=1;var r=Pr(),e=jr(),n=go(),a=ho(),t=ui(),f=e(a(),Object);return r(f,{getPolyfill:a,implementation:n,shim:t}),At=f,At}var Ot,xa;function mo(){if(xa)return Ot;xa=1;var r=jr(),e=Z(),n=vr(),a=n("%ArrayBuffer%",!0),t=e("ArrayBuffer.prototype.byteLength",!0),f=e("Object.prototype.toString"),i=!!a&&!t&&new a(0).slice,o=!!i&&r(i);return Ot=t||o?function(c){if(!c||typeof c!="object")return!1;try{return t?t(c):o(c,0),!0}catch{return!1}}:a?function(c){return f(c)==="[object ArrayBuffer]"}:function(c){return!1},Ot}var wt,Ea;function si(){if(Ea)return wt;Ea=1;var r=Z(),e=r("Date.prototype.getDay"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object Date]",f=Ir()();return wt=function(o){return typeof o!="object"||o===null?!1:f?n(o):a(o)===t},wt}var qt,Ba;function So(){if(Ba)return qt;Ba=1;var r=Z(),e=Ir()(),n=Qt(),a=qr(),t;if(e){var f=r("RegExp.prototype.exec"),i={},o=function(){throw i},u={toString:o,valueOf:o};typeof Symbol.toPrimitive=="symbol"&&(u[Symbol.toPrimitive]=o),t=function(y){if(!y||typeof y!="object")return!1;var h=a(y,"lastIndex"),S=h&&n(h,"value");if(!S)return!1;try{f(y,u)}catch(R){return R===i}}}else{var c=r("Object.prototype.toString"),v="[object RegExp]";t=function(y){return!y||typeof y!="object"&&typeof y!="function"?!1:c(y)===v}}return qt=t,qt}var Pt,ja;function li(){if(ja)return Pt;ja=1;var r=Z(),e=r("SharedArrayBuffer.prototype.byteLength",!0);return Pt=e?function(a){if(!a||typeof a!="object")return!1;try{return e(a),!0}catch{return!1}}:function(a){return!1},Pt}var It,Ma;function ci(){if(Ma)return It;Ma=1;var r=Z(),e=r("Number.prototype.toString"),n=function(o){try{return e(o),!0}catch{return!1}},a=r("Object.prototype.toString"),t="[object Number]",f=Ir()();return It=function(o){return typeof o=="number"?!0:!o||typeof o!="object"?!1:f?n(o):a(o)===t},It}var Rt,Ta;function pi(){if(Ta)return Rt;Ta=1;var r=Z(),e=r("Boolean.prototype.toString"),n=r("Object.prototype.toString"),a=function(o){try{return e(o),!0}catch{return!1}},t="[object Boolean]",f=Ir()();return Rt=function(o){return typeof o=="boolean"?!0:o===null||typeof o!="object"?!1:f?a(o):n(o)===t},Rt}var Lr={exports:{}},$t,Ca;function yi(){if(Ca)return $t;Ca=1;var r=Z(),e=So(),n=r("RegExp.prototype.exec"),a=ar();return $t=function(f){if(!e(f))throw new a("`regex` must be a RegExp");return function(o){return n(f,o)!==null}},$t}var Da;function vi(){if(Da)return Lr.exports;Da=1;var r=Z(),e=r("Object.prototype.toString"),n=Vt()(),a=yi();if(n){var t=r("Symbol.prototype.toString"),f=a(/^Symbol\(.*\)$/),i=function(u){return typeof u.valueOf()!="symbol"?!1:f(t(u))};Lr.exports=function(u){if(typeof u=="symbol")return!0;if(!u||typeof u!="object"||e(u)!=="[object Symbol]")return!1;try{return i(u)}catch{return!1}}}else Lr.exports=function(u){return!1};return Lr.exports}var Ur={exports:{}},xt,Fa;function gi(){if(Fa)return xt;Fa=1;var r=typeof BigInt<"u"&&BigInt;return xt=function(){return typeof r=="function"&&typeof BigInt=="function"&&typeof r(42)=="bigint"&&typeof BigInt(42)=="bigint"},xt}var _a;function hi(){if(_a)return Ur.exports;_a=1;var r=gi()();if(r){var e=BigInt.prototype.valueOf,n=function(t){try{return e.call(t),!0}catch{}return!1};Ur.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:n(t)}}else Ur.exports=function(t){return!1};return Ur.exports}var Et,Na;function di(){if(Na)return Et;Na=1;var r=po(),e=ci(),n=pi(),a=vi(),t=hi();return Et=function(i){if(i==null||typeof i!="object"&&typeof i!="function")return null;if(r(i))return"String";if(e(i))return"Number";if(n(i))return"Boolean";if(a(i))return"Symbol";if(t(i))return"BigInt"},Et}var Bt,Wa;function mi(){if(Wa)return Bt;Wa=1;var r=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,e=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,n;r||(n=function(i){return!1});var a=r?r.prototype.has:null,t=e?e.prototype.has:null;return!n&&!a&&(n=function(i){return!1}),Bt=n||function(i){if(!i||typeof i!="object")return!1;try{if(a.call(i,a),t)try{t.call(i,t)}catch{return!0}return i instanceof r}catch{}return!1},Bt}var Hr={exports:{}},ka;function Si(){if(ka)return Hr.exports;ka=1;var r=vr(),e=Z(),n=r("%WeakSet%",!0),a=e("WeakSet.prototype.has",!0);if(a){var t=e("WeakMap.prototype.has",!0);Hr.exports=function(i){if(!i||typeof i!="object")return!1;try{if(a(i,a),t)try{t(i,t)}catch{return!0}return i instanceof n}catch{}return!1}}else Hr.exports=function(i){return!1};return Hr.exports}var jt,La;function bi(){if(La)return jt;La=1;var r=yo(),e=vo(),n=mi(),a=Si();return jt=function(f){if(f&&typeof f=="object"){if(r(f))return"Map";if(e(f))return"Set";if(n(f))return"WeakMap";if(a(f))return"WeakSet"}return!1},jt}var Mt,Ua;function Ai(){if(Ua)return Mt;Ua=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,a;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw a}}),a={},e(function(){throw 42},null,n)}catch(O){O!==a&&(e=null)}else e=null;var t=/^\s*class\b/,f=function(m){try{var j=r.call(m);return t.test(j)}catch{return!1}},i=function(m){try{return f(m)?!1:(r.call(m),!0)}catch{return!1}},o=Object.prototype.toString,u="[object Object]",c="[object Function]",v="[object GeneratorFunction]",p="[object HTMLAllCollection]",y="[object HTML document.all class]",h="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var q=document.all;o.call(q)===o.call(document.all)&&(w=function(m){if((R||!m)&&(typeof m>"u"||typeof m=="object"))try{var j=o.call(m);return(j===p||j===y||j===h||j===u)&&m("")==null}catch{}return!1})}return Mt=e?function(m){if(w(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;try{e(m,null,n)}catch(j){if(j!==a)return!1}return!f(m)&&i(m)}:function(m){if(w(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;if(S)return i(m);if(f(m))return!1;var j=o.call(m);return j!==c&&j!==v&&!/^\[object HTML/.test(j)?!1:i(m)},Mt}var Tt,Ha;function Oi(){if(Ha)return Tt;Ha=1;var r=Ai(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,a=function(u,c,v){for(var p=0,y=u.length;p<y;p++)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))},t=function(u,c,v){for(var p=0,y=u.length;p<y;p++)v==null?c(u.charAt(p),p,u):c.call(v,u.charAt(p),p,u)},f=function(u,c,v){for(var p in u)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))};function i(o){return e.call(o)==="[object Array]"}return Tt=function(u,c,v){if(!r(c))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=v),i(u)?a(u,c,p):typeof u=="string"?t(u,c,p):f(u,c,p)},Tt}var Ct,Ga;function wi(){return Ga||(Ga=1,Ct=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ct}var Dt,za;function qi(){if(za)return Dt;za=1;var r=wi(),e=typeof globalThis>"u"?Gr:globalThis;return Dt=function(){for(var a=[],t=0;t<r.length;t++)typeof e[r[t]]=="function"&&(a[a.length]=r[t]);return a},Dt}var Ft,Va;function Pi(){if(Va)return Ft;Va=1;var r=Oi(),e=qi(),n=jr(),a=Z(),t=qr(),f=Xt(),i=a("Object.prototype.toString"),o=Ir()(),u=typeof globalThis>"u"?Gr:globalThis,c=e(),v=a("String.prototype.slice"),p=a("Array.prototype.indexOf",!0)||function(w,q){for(var O=0;O<w.length;O+=1)if(w[O]===q)return O;return-1},y={__proto__:null};o&&t&&f?r(c,function(R){var w=new u[R];if(Symbol.toStringTag in w&&f){var q=f(w),O=t(q,Symbol.toStringTag);if(!O&&q){var m=f(q);O=t(m,Symbol.toStringTag)}y["$"+R]=n(O.get)}}):r(c,function(R){var w=new u[R],q=w.slice||w.set;q&&(y["$"+R]=n(q))});var h=function(w){var q=!1;return r(y,function(O,m){if(!q)try{"$"+O(w)===m&&(q=v(m,1))}catch{}}),q},S=function(w){var q=!1;return r(y,function(O,m){if(!q)try{O(w),q=v(m,1)}catch{}}),q};return Ft=function(w){if(!w||typeof w!="object")return!1;if(!o){var q=v(i(w),8,-1);return p(c,q)>-1?q:q!=="Object"?!1:S(w)}return t?h(w):null},Ft}var _t,Ka;function Ii(){if(Ka)return _t;Ka=1;var r=Z(),e=r("ArrayBuffer.prototype.byteLength",!0),n=mo();return _t=function(t){return n(t)?e?e(t):t.byteLength:NaN},_t}var Nt,Ja;function Ri(){if(Ja)return Nt;Ja=1;var r=Ko(),e=oo(),n=Qo(),a=vr(),t=ii(),f=lo(),i=fi(),o=fo(),u=co(),c=mo(),v=si(),p=So(),y=li(),h=Lt(),S=di(),R=bi(),w=Pi(),q=Ii(),O=e("SharedArrayBuffer.prototype.byteLength",!0),m=e("Date.prototype.getTime"),j=Object.getPrototypeOf,Q=e("Object.prototype.toString"),H=a("%Set%",!0),F=e("Map.prototype.has",!0),D=e("Map.prototype.get",!0),P=e("Map.prototype.size",!0),_=e("Set.prototype.add",!0),L=e("Set.prototype.delete",!0),N=e("Set.prototype.has",!0),U=e("Set.prototype.size",!0);function V(g,d,x,$){for(var M=t(g),T;(T=M.next())&&!T.done;)if(G(d,T.value,x,$))return L(g,T.value),!0;return!1}function sr(g){if(typeof g>"u")return null;if(typeof g!="object")return typeof g=="symbol"?!1:typeof g=="string"||typeof g=="number"?+g==+g:!0}function Rr(g,d,x,$,M,T){var A=sr(x);if(A!=null)return A;var I=D(d,A),b=r({},M,{strict:!1});return typeof I>"u"&&!F(d,A)||!G($,I,b,T)?!1:!F(g,A)&&G($,I,b,T)}function br(g,d,x){var $=sr(x);return $??(N(d,$)&&!N(g,$))}function or(g,d,x,$,M,T){for(var A=t(g),I,b;(I=A.next())&&!I.done;)if(b=I.value,G(x,b,M,T)&&G($,D(d,b),M,T))return L(g,b),!0;return!1}function G(g,d,x,$){var M=x||{};if(M.strict?i(g,d):g===d)return!0;var T=S(g),A=S(d);if(T!==A)return!1;if(!g||!d||typeof g!="object"&&typeof d!="object")return M.strict?i(g,d):g==d;var I=$.has(g),b=$.has(d),E;if(I&&b){if($.get(g)===$.get(d))return!0}else E={};return I||$.set(g,E),b||$.set(d,E),gr(g,d,M,$)}function Ar(g){return!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))}function $r(g,d,x,$){if(U(g)!==U(d))return!1;for(var M=t(g),T=t(d),A,I,b;(A=M.next())&&!A.done;)if(A.value&&typeof A.value=="object")b||(b=new H),_(b,A.value);else if(!N(d,A.value)){if(x.strict||!br(g,d,A.value))return!1;b||(b=new H),_(b,A.value)}if(b){for(;(I=T.next())&&!I.done;)if(I.value&&typeof I.value=="object"){if(!V(b,I.value,x.strict,$))return!1}else if(!x.strict&&!N(g,I.value)&&!V(b,I.value,x.strict,$))return!1;return U(b)===0}return!0}function Or(g,d,x,$){if(P(g)!==P(d))return!1;for(var M=t(g),T=t(d),A,I,b,E,z,K;(A=M.next())&&!A.done;)if(E=A.value[0],z=A.value[1],E&&typeof E=="object")b||(b=new H),_(b,E);else if(K=D(d,E),typeof K>"u"&&!F(d,E)||!G(z,K,x,$)){if(x.strict||!Rr(g,d,E,z,x,$))return!1;b||(b=new H),_(b,E)}if(b){for(;(I=T.next())&&!I.done;)if(E=I.value[0],K=I.value[1],E&&typeof E=="object"){if(!or(b,g,E,K,x,$))return!1}else if(!x.strict&&(!g.has(E)||!G(D(g,E),K,x,$))&&!or(b,g,E,K,r({},x,{strict:!1}),$))return!1;return U(b)===0}return!0}function gr(g,d,x,$){var M,T;if(typeof g!=typeof d||g==null||d==null||Q(g)!==Q(d)||o(g)!==o(d))return!1;var A=u(g),I=u(d);if(A!==I)return!1;var b=g instanceof Error,E=d instanceof Error;if(b!==E||(b||E)&&(g.name!==d.name||g.message!==d.message))return!1;var z=p(g),K=p(d);if(z!==K||(z||K)&&(g.source!==d.source||n(g)!==n(d)))return!1;var J=v(g),X=v(d);if(J!==X||(J||X)&&m(g)!==m(d)||x.strict&&j&&j(g)!==j(d))return!1;var rr=w(g),lr=w(d);if(rr!==lr)return!1;if(rr||lr){if(g.length!==d.length)return!1;for(M=0;M<g.length;M++)if(g[M]!==d[M])return!1;return!0}var ir=Ar(g),er=Ar(d);if(ir!==er)return!1;if(ir||er){if(g.length!==d.length)return!1;for(M=0;M<g.length;M++)if(g[M]!==d[M])return!1;return!0}var cr=c(g),pr=c(d);if(cr!==pr)return!1;if(cr||pr)return q(g)!==q(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);var yr=y(g),_r=y(d);if(yr!==_r)return!1;if(yr||_r)return O(g)!==O(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);if(typeof g!=typeof d)return!1;var hr=h(g),xr=h(d);if(hr.length!==xr.length)return!1;for(hr.sort(),xr.sort(),M=hr.length-1;M>=0;M--)if(hr[M]!=xr[M])return!1;for(M=hr.length-1;M>=0;M--)if(T=hr[M],!G(g[T],d[T],x,$))return!1;var Mr=R(g),dr=R(d);return Mr!==dr?!1:Mr==="Set"||dr==="Set"?$r(g,d,x,$):Mr==="Map"?Or(g,d,x,$):!0}return Nt=function(d,x,$){return G(d,x,$,f())},Nt}var $i=Ri();const xi=Io($i);function Ei(r){return r}function bo(r,e,n,a){const t=Ei,[f,i]=fr.useState(t(n)),o=fr.useRef(f);return fr.useEffect(()=>{const u=()=>{const c={...n,...r.getAttributes(e)};Object.keys(c).forEach(p=>{(c[p]===null||c[p]===void 0)&&(c[p]=n?n[p]:null)});const v=t(c);xi(o.current,v)||(i(v),o.current=v)};return r.on("selectionUpdate",u),r.on("transaction",u),()=>{r.off("selectionUpdate",u),r.off("transaction",u)}},[r,n,e,t]),f}function Bi({node:r}){const{text:e,macros:n}=r.attrs,a=fr.useMemo(()=>{try{return Xa.renderToString(decodeURIComponent(e||""),{macros:kt(decodeURIComponent(n||""))})}catch{return e}},[e,n]),t=fr.useMemo(()=>e.trim()?Y.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:a}}):Y.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[e,a]);return Y.jsx(Dr.NodeViewWrapper,{as:"span",style:{display:"inline-block"},children:t})}function ji(){const{t:r}=Po.useLocale(),[e,n]=fr.useState(!1),a=nr.useButtonProps(Wt.name),{icon:t=void 0,tooltip:f=void 0,tooltipOptions:i={},isActive:o=void 0}=(a==null?void 0:a.componentProps)??{},{editorDisabled:u}=nr.useToggleActive(o),c=nr.useEditorInstance(),v=bo(c,Wt.name,{text:"",macros:""}),{text:p,macros:y}=v,[h,S]=fr.useState(decodeURIComponent(p||"")),[R,w]=fr.useState(decodeURIComponent(y||"")),q=fr.useCallback(()=>{c.chain().focus().setKatex({text:encodeURIComponent(h),macros:encodeURIComponent(R)}).run(),S(""),w(""),n(!1)},[c,h,R]),O=fr.useMemo(()=>{try{return Xa.renderToString(h,{macros:kt(R)})}catch{return h}},[R,h]),m=fr.useMemo(()=>`${h}`.trim()?O:null,[h,O]);return Y.jsxs(nr.Dialog,{onOpenChange:n,open:e,children:[Y.jsx(nr.DialogTrigger,{asChild:!0,disabled:u,children:Y.jsx(nr.ActionButton,{disabled:u,icon:t,tooltip:f,tooltipOptions:i,action:()=>{u||n(!0)}})}),Y.jsxs(nr.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[Y.jsx(nr.DialogTitle,{children:r("editor.formula.dialog.text")}),Y.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:Y.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[Y.jsxs("div",{className:"richtext-flex-1",children:[Y.jsx(nr.Label,{className:"mb-[6px]",children:"Expression"}),Y.jsx(sn.Textarea,{autoFocus:!0,className:"richtext-mb-[10px]",onChange:j=>S(j.target.value),placeholder:"Text",required:!0,rows:10,value:h,style:{color:"hsl(var(--foreground))"}}),Y.jsx(nr.Label,{className:"mb-[6px]",children:"Macros"}),Y.jsx(sn.Textarea,{className:"richtext-flex-1",placeholder:"Macros",rows:10,value:R,onChange:j=>{w(j.target.value)},style:{color:"hsl(var(--foreground))"}})]}),Y.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:m||""},style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"}})]})}),Y.jsx(nr.DialogFooter,{children:Y.jsx(nr.Button,{onClick:q,type:"button",children:"Save changes"})})]})]})}function Ya(r){return e=>e.getAttribute(r)}const Wt=Dr.Node3.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({t:r})=>({componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:r("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:Ya("text")},macros:{default:"",parseHTML:Ya("macros")}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:r}){return["span",Dr.mergeAttributes(this.options&&this.options.HTMLAttributes||{},r)]},addCommands(){return{setKatex:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}},addInputRules(){return[Dr.nodeInputRule({find:/^\$katex\$$/,type:this.type})]},addNodeView(){return Dr.ReactNodeViewRenderer(Bi)}});exports.Katex=Wt;exports.RichTextKatex=ji;exports.safeJSONParse=kt;exports.useAttributes=bo;
|
package/lib/Mermaid-Dwz9o-yM.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var O=Object.create;var A=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var q=(e,i,s,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of $(i))!z.call(e,l)&&l!==s&&A(e,l,{get:()=>i[l],enumerable:!(o=_(i,l))||o.enumerable});return e};var T=(e,i,s)=>(s=e!=null?O(B(e)):{},q(i||!e||!e.__esModule?A(s,"default",{value:e,enumerable:!0}):s,e));const N=require("./clsx-CXbNJWDD.cjs"),t=require("react/jsx-runtime"),r=require("react"),d=require("./index-De9MZVWQ.cjs"),L=require("./textarea-DpkwluT0.cjs"),R=({editor:e,node:i,updateAttributes:s})=>{var n,c;const o=((n=i==null?void 0:i.attrs)==null?void 0:n.code)??v,l=((c=i==null?void 0:i.attrs)==null?void 0:c.align)??"center",[a,M]=r.useState(o),[b,m]=r.useState(""),[y,u]=r.useState(""),[g,f]=r.useState(!1),[h,w]=r.useState(null),[p,S]=r.useState(!0),D=r.useRef(`mermaid-edit-${Math.random().toString(36).slice(2,9)}`),C=r.useCallback(x=>{f(x),x&&M(o)},[o]);r.useEffect(()=>{import("mermaid").then(x=>{const j=x.default;j.initialize({startOnLoad:!1,darkMode:!1,fontSize:12,theme:"base"}),w(j)}).finally(()=>S(!1))},[]),r.useEffect(()=>{if(!h||!g)return;(async()=>{const j=a.trim();if(!j){m(""),u("");return}try{const E=`${D.current}-${Date.now()}`,{svg:H}=await h.render(E,j);m(H),u("")}catch(E){m(""),u((E==null?void 0:E.message)??"Invalid Mermaid syntax")}})()},[a,h,g]);const I=r.useCallback(()=>{a.trim()&&(s?s({code:a}):e==null||e.chain().focus().setMermaid({code:a,align:l}).run(),f(!1))},[e,a,l,s]);return t.jsxs(d.Dialog,{onOpenChange:C,open:g,children:[t.jsx(d.DialogTrigger,{asChild:!0,children:t.jsx(d.ActionButton,{action:()=>f(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(d.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(d.DialogTitle,{children:"Edit Mermaid Diagram"}),t.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:p?t.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-p-10 richtext-text-sm richtext-text-gray-400",children:"Loading Mermaid…"}):t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(L.Textarea,{autoFocus:!0,className:"richtext-flex-1 richtext-font-mono richtext-text-sm",onChange:x=>M(x.target.value),placeholder:v,required:!0,rows:18,value:a,style:{color:"hsl(var(--foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-overflow-auto richtext-rounded-[10px] richtext-p-[10px]",style:{minHeight:400,border:"1px solid hsl(var(--border))",background:"#fff"},children:y?t.jsxs("p",{className:"richtext-max-w-xs richtext-break-words richtext-text-sm richtext-text-red-500",children:["⚠ ",y]}):b?t.jsx("div",{dangerouslySetInnerHTML:{__html:b}}):t.jsx("p",{className:"richtext-text-sm richtext-text-gray-400",children:"Start typing to preview…"})})]})}),t.jsx(d.DialogFooter,{children:t.jsx(d.Button,{disabled:p||!h||!a.trim(),onClick:I,type:"button",children:"Save changes"})})]})]})};function F({editor:e,node:i,updateAttributes:s,selected:o,extension:l}){const[a,M]=r.useState(()=>(e==null?void 0:e.isEditable)??!1);r.useEffect(()=>{const n=()=>M((e==null?void 0:e.isEditable)??!1);return n(),e==null||e.on("editableUpdate",n),e==null||e.on("update",n),()=>{e==null||e.off("editableUpdate",n),e==null||e.off("update",n)}},[e]);const{code:b,align:m,width:y}=i.attrs,u=r.useRef(null),[g,f]=r.useState(""),[h,w]=r.useState(""),[p,S]=r.useState(null),D=r.useRef(`mermaid-view-${Math.random().toString(36).slice(2,9)}`);r.useEffect(()=>{import("mermaid").then(n=>{const c=n.default;c.initialize({startOnLoad:!1,darkMode:!1,fontSize:12,theme:"base"}),S(c)})},[]);const C=r.useCallback(async n=>{if(!(!p||!(n!=null&&n.trim())))try{const c=`${D.current}-${Date.now()}`,{svg:x}=await p.render(c,n);f(x),w("")}catch(c){f(""),w((c==null?void 0:c.message)??"Invalid Mermaid syntax")}},[p]);r.useEffect(()=>{C(b)},[b,C]);const I={textAlign:m??"center",width:y??"100%"};return t.jsx(N.NodeViewWrapper,{className:"mermaid-node-view richtext-relative richtext-my-4",style:I,children:t.jsxs("div",{"data-drag-handle":!0,draggable:a?"true":"false",ref:u,className:["richtext-relative richtext-inline-block richtext-rounded-lg richtext-border richtext-bg-white richtext-p-4 richtext-transition-all",a?o?"richtext-border-gray-300":"richtext-border-transparent":"richtext-pointer-events-none richtext-select-none richtext-border-transparent"].join(" "),style:{maxWidth:"100%"},children:[h?t.jsx("div",{className:"richtext-flex richtext-min-h-[120px] richtext-min-w-[200px] richtext-items-center richtext-justify-center richtext-rounded richtext-bg-red-50 richtext-p-4 richtext-text-sm richtext-text-red-500",children:t.jsxs("span",{children:["⚠ ",h]})}):g?t.jsx("div",{className:"mermaid-svg-container",dangerouslySetInnerHTML:{__html:g}}):t.jsx("div",{className:"richtext-flex richtext-min-h-[120px] richtext-min-w-[200px] richtext-items-center richtext-justify-center richtext-rounded richtext-bg-gray-50 richtext-text-sm richtext-text-gray-400",children:"Rendering…"}),a&&t.jsx("div",{className:"richtext-absolute richtext-right-2 richtext-top-2 richtext-opacity-0 richtext-transition-opacity [.mermaid-node-view:hover_&]:richtext-opacity-100",children:t.jsx(R,{editor:e,node:i,updateAttributes:s,extension:l})})]})})}function U(){const e=d.useEditorInstance(),i=d.useButtonProps(k.name),{tooltipOptions:s={},isActive:o=void 0}=(i==null?void 0:i.componentProps)??{},{editorDisabled:l}=d.useToggleActive(o),[a,M]=r.useState(v),[b,m]=r.useState(""),[y,u]=r.useState(""),[g,f]=r.useState(!1),[h,w]=r.useState(null),[p,S]=r.useState(!0),D=r.useRef(`mermaid-toolbar-${Math.random().toString(36).slice(2,9)}`);r.useEffect(()=>{import("mermaid").then(n=>{const c=n.default;c.initialize({startOnLoad:!1,darkMode:!1,fontSize:12,theme:"base"}),w(c)}).finally(()=>S(!1))},[]),r.useEffect(()=>{if(!h||!g)return;(async()=>{const c=a.trim();if(!c){m(""),u("");return}try{const x=`${D.current}-${Date.now()}`,{svg:j}=await h.render(x,c);m(j),u("")}catch(x){m(""),u((x==null?void 0:x.message)??"Invalid Mermaid syntax")}})()},[a,h,g]);const C=r.useCallback(n=>{f(n),n&&(M(v),m(""),u(""))},[]),I=r.useCallback(()=>{a.trim()&&(e==null||e.chain().focus().setMermaid({code:a,align:"center",width:"100%"}).run(),f(!1))},[e,a]);return t.jsxs(d.Dialog,{onOpenChange:C,open:g,children:[t.jsx(d.DialogTrigger,{asChild:!0,children:t.jsx(d.ActionButton,{disabled:l,icon:"Mermaid",tooltip:"Mermaid",tooltipOptions:s,action:()=>{l||f(!0)}})}),t.jsxs(d.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(d.DialogTitle,{children:"Insert Mermaid Diagram"}),t.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:p?t.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-p-10 richtext-text-sm richtext-text-gray-400",children:"Loading Mermaid…"}):t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(L.Textarea,{autoFocus:!0,className:"richtext-flex-1 richtext-font-mono richtext-text-sm",onChange:n=>M(n.target.value),placeholder:v,required:!0,rows:18,value:a,style:{color:"hsl(var(--foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-overflow-auto richtext-rounded-[10px] richtext-p-[10px]",style:{minHeight:400,border:"1px solid hsl(var(--border))",background:"#fff"},children:y?t.jsxs("p",{className:"richtext-max-w-xs richtext-break-words richtext-text-sm richtext-text-red-500",children:["⚠ ",y]}):b?t.jsx("div",{dangerouslySetInnerHTML:{__html:b}}):t.jsx("p",{className:"richtext-text-sm richtext-text-gray-400",children:"Start typing to preview…"})})]})}),t.jsx(d.DialogFooter,{children:t.jsx(d.Button,{disabled:p||!h||!a.trim(),onClick:I,type:"button",children:"Insert diagram"})})]})]})}const v=`graph TB
|
|
2
|
-
A --> B`,k=N.Node3.create({name:"mermaid",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){return{divider:!1,spacer:!1,HTMLAttributes:{class:"mermaid-node"},button:({editor:e,t:i,extension:s})=>({componentProps:{action:()=>!0,isActive:()=>e.isActive("mermaid"),disabled:!1,editor:e,icon:"Mermaid",tooltip:i("editor.mermaid.tooltip")}})}},addAttributes(){return{code:{default:v,parseHTML:e=>e.getAttribute("data-code")?decodeURIComponent(e.getAttribute("data-code")):v,renderHTML:e=>({"data-code":encodeURIComponent(e.code??"")})},align:{default:"center",parseHTML:e=>e.getAttribute("data-align")??"center",renderHTML:e=>({"data-align":e.align})},width:{default:"100%",parseHTML:e=>e.getAttribute("data-width")??"100%",renderHTML:e=>({"data-width":e.width})}}},parseHTML(){return[{tag:"div[class=mermaid-node]"}]},renderHTML({HTMLAttributes:e,node:i}){const{align:s}=i.attrs,o=s?`text-align: ${s};`:"";return["div",N.mergeAttributes({class:"mermaid-node"},e,{style:o})]},addCommands(){return{setMermaid:e=>({tr:i,commands:s})=>{var o,l,a;return e={code:v,align:"center",width:"100%",...e},((a=(l=(o=i.selection)==null?void 0:o.node)==null?void 0:l.type)==null?void 0:a.name)===this.name?s.updateAttributes(this.name,e):s.insertContent({type:this.name,attrs:e})},setMermaidAlign:e=>({commands:i})=>i.updateAttributes(this.name,{align:e})}},addNodeView(){return N.ReactNodeViewRenderer(F)}});exports.DEFAULT_MERMAID_CODE=v;exports.EditMermaidBlock=R;exports.Mermaid=k;exports.RichTextMermaid=U;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const d=require("react/jsx-runtime"),u=require("react"),x=require("./index-De9MZVWQ.cjs");require("./theme.cjs");const b=require("./index-DgOXAdKt.cjs"),C=require("./index-NsYff_Ni.cjs");function q({t:n}){const a=[{name:"format",title:n("editor.slash.format"),commands:[]},{name:"insert",title:n("editor.slash.insert"),commands:[]}];return b.HEADINGS.forEach(e=>{a[0].commands.push({name:`heading${e}`,label:n(e==="Paragraph"?"editor.paragraph.tooltip":`editor.heading.h${e}.tooltip`),aliases:[`h${e}`,"bt",`bt${e}`],iconName:`Heading${e}`,isActive:t=>e==="Paragraph"?!1:t.isActive("heading",{level:e})||!1,action:({editor:t,range:l})=>{const s=b.HEADINGS.find(m=>t.isActive("heading",{level:m}));if(e==="Paragraph"){s!==void 0&&s!=="Paragraph"&&t.commands.toggleHeading({level:s}),t.chain().focus().deleteRange(l).run();return}if(e){t.chain().focus().deleteRange(l).setHeading({level:e}).run();return}t.chain().focus().deleteRange(l).run()}})}),a[0].commands.push({name:"bulletList",label:n("editor.bulletlist.tooltip"),aliases:["ul","yxlb"],iconName:"List",isActive:e=>e.isActive("bulletList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}}),a[0].commands.push({name:"orderedlist",label:n("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",isActive:e=>e.isActive("orderedList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}}),a[0].commands.push({name:"taskList",label:n("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],isActive:e=>e.isActive("taskList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleTaskList().run()}}),a[0].commands.push({name:"blockquote",label:n("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",isActive:e=>e.isActive("blockquote"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setBlockquote().run()}}),a[0].commands.push({name:"codeBlock",label:n("editor.codeblock.tooltip"),iconName:"Code2",description:"Code block with syntax highlighting",shouldBeHidden:e=>e.isActive("columns"),isActive:e=>e.isActive("codeBlock"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setCodeBlock().run()}}),a[1].commands.push({name:"image",label:n("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).run();const l=x.EVENTS.UPLOAD_IMAGE(e.id);x.emit(l,!0)}}),a[1].commands.push({name:"table",label:n("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}}),a[1].commands.push({name:"horizontalRule",label:n("editor.horizontalrule.tooltip"),iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr","fgx","fg"],action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setHorizontalRule().run()}}),a[1].commands.push({name:"columns",label:n("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",action:({editor:e})=>{e.chain().focus().insertColumns({cols:2}).run()}}),a}function N(n,a){return n.map(t=>({...t,commands:t.commands.filter(l=>{const s=l.label.toLowerCase().trim(),m=a.toLowerCase().trim();if(l.aliases){const f=l.aliases.map(h=>h.toLowerCase().trim()),p=s.match(m),r=f.some(h=>h.match(m));return p||r}return s.match(m)})})).filter(t=>t.commands.length>0)}const y=C.y([]);function L(){const[n,a]=C.V(y);return[n,a]}function j(n,a){const[e]=L(),[t,l]=u.useState(0),[s,m]=u.useState(0),f=u.useRef(null),{t:p}=b.useLocale(),r=N(e,n.query),h=u.useRef([]);u.useImperativeHandle(a,()=>({onKeyDown:v})),u.useEffect(()=>{if(!f.current)return;const o=s*1e3+t,i=h.current[o];i&&i.scrollIntoView({behavior:"smooth",block:"nearest"})},[t,s]);function v({event:o}){return o.key==="ArrowUp"?(A(),!0):o.key==="ArrowDown"?(R(),!0):o.key==="Enter"?(k(),!0):!1}function A(){var c;if(r.length===0)return!1;let o=t-1,i=s;o<0&&(i=s-1,o=((c=r[i])==null?void 0:c.commands.length)-1||0),i<0&&(i=r.length-1,o=r[i].commands.length-1),l(o),m(i)}function R(){if(r.length===0)return!1;const o=r[s].commands;let i=t+1,c=s;o.length-1<i&&(i=0,c=s+1),r.length-1<c&&(c=0),l(i),m(c)}function k(){if(r.length===0||s===-1||t===-1)return!1;w(s,t)}function w(o,i){const c=r[o].commands[i];n==null||n.command(c)}function I(o,i){w(o,i)}function H(o,i,c){h.current[o*1e3+i]=c}return d.jsx("div",{className:"richtext-max-h-[min(80vh,24rem)] richtext-flex-wrap richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none","data-richtext-portal":!0,ref:f,children:r!=null&&r.length?d.jsx("div",{className:"richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5",children:r==null?void 0:r.map((o,i)=>d.jsxs(u.Fragment,{children:[d.jsx(x.Label,{className:"richtext-mx-[4px] richtext-mb-[4px] richtext-mt-[8px] !richtext-text-[0.65rem] richtext-uppercase",children:o.title}),o.commands.map((c,g)=>d.jsxs("button",{onClick:()=>I(i,g),ref:S=>H(i,g,S),className:x.cn("richtext-flex richtext-w-full richtext-items-center richtext-gap-3 richtext-rounded-sm !richtext-border-none !richtext-bg-transparent richtext-px-2 richtext-py-1.5 richtext-text-left richtext-text-sm richtext-text-foreground !richtext-outline-none richtext-transition-colors hover:!richtext-bg-accent",{"bg-item-active":s===i&&t===g}),children:[c.iconUrl&&d.jsx("img",{alt:"",className:"richtext-size-6",src:c.iconUrl}),c.iconName&&d.jsx(x.IconComponent,{className:"!richtext-mr-1 !richtext-text-lg",name:c.iconName}),c.label]},`command-${g}`))]},`slash-${o.title}`))}):d.jsx("div",{className:"richtext-p-3",children:d.jsx("span",{className:"richtext-text-xs richtext-text-foreground",children:p("editor.slash.empty")})})})}const E=u.forwardRef(j);exports.SlashCommandNodeView=E;exports.renderCommandListDefault=q;exports.useFilterCommandList=N;exports.useSignalCommandList=L;
|
package/lib/index-De9MZVWQ.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),b=require("react"),Ze=require("./index-NsYff_Ni.cjs");require("./theme.cjs");const qt=require("@radix-ui/react-dialog"),u=require("lucide-react"),V=require("./clsx-CXbNJWDD.cjs"),Zt=require("react-image-crop"),ft=require("@radix-ui/react-slot"),$=require("./index-DgOXAdKt.cjs"),Yt=require("@radix-ui/react-tooltip"),Kt=require("@radix-ui/react-toggle"),ke=require("@radix-ui/react-icons"),Jt=require("@radix-ui/react-tabs"),Qt=require("@radix-ui/react-checkbox"),er=require("@radix-ui/react-label");function le(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const F=le(b),Z=le(qt),ye=le(Yt),mt=le(Kt),ce=le(Jt),We=le(Qt),gt=le(er),Ye="-",tr=e=>{const t=ir(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const a=l.split(Ye);return a[0]===""&&a.length!==1&&a.shift(),xt(a,t)||rr(l)},getConflictingClassGroupIds:(l,a)=>{const c=r[l]||[];return a&&n[l]?[...c,...n[l]]:c}}},xt=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?xt(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Ye);return(l=t.validators.find(({validator:a})=>a(s)))==null?void 0:l.classGroupId},st=/^\[(.+)\]$/,rr=e=>{if(st.test(e)){const t=st.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},ir=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return or(Object.entries(e.classGroups),r).forEach(([s,l])=>{Ge(l,n,s,t)}),n},Ge=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:at(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(nr(o)){Ge(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,l])=>{Ge(l,at(t,s),r,n)})})},at=(e,t)=>{let r=e;return t.split(Ye).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},nr=e=>e.isThemeGetter,or=(e,t)=>t?e.map(([r,n])=>{const o=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,a])=>[t+l,a])):s);return[r,o]}):e,sr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,l)=>{r.set(s,l),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let l=r.get(s);if(l!==void 0)return l;if((l=n.get(s))!==void 0)return o(s,l),l},set(s,l){r.has(s)?r.set(s,l):o(s,l)}}},pt="!",ar=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],s=t.length,l=a=>{const c=[];let d=0,m=0,p;for(let f=0;f<a.length;f++){let v=a[f];if(d===0){if(v===o&&(n||a.slice(f,f+s)===t)){c.push(a.slice(m,f)),m=f+s;continue}if(v==="/"){p=f;continue}}v==="["?d++:v==="]"&&d--}const h=c.length===0?a:a.substring(m),y=h.startsWith(pt),x=y?h.substring(1):h,k=p&&p>m?p-m:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:k}};return r?a=>r({className:a,parseClassName:l}):l},lr=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},cr=e=>({cache:sr(e.cacheSize),parseClassName:ar(e),...tr(e)}),dr=/\s+/,ur=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,s=[],l=e.trim().split(dr);let a="";for(let c=l.length-1;c>=0;c-=1){const d=l[c],{modifiers:m,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:y}=r(d);let x=!!y,k=n(x?h.substring(0,y):h);if(!k){if(!x){a=d+(a.length>0?" "+a:a);continue}if(k=n(h),!k){a=d+(a.length>0?" "+a:a);continue}x=!1}const f=lr(m).join(":"),v=p?f+pt:f,g=v+k;if(s.includes(g))continue;s.push(g);const S=o(k,x);for(let w=0;w<S.length;++w){const I=S[w];s.push(v+I)}a=d+(a.length>0?" "+a:a)}return a};function hr(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=bt(t))&&(n&&(n+=" "),n+=r);return n}const bt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=bt(e[n]))&&(r&&(r+=" "),r+=t);return r};function fr(e,...t){let r,n,o,s=l;function l(c){const d=t.reduce((m,p)=>p(m),e());return r=cr(d),n=r.cache.get,o=r.cache.set,s=a,a(c)}function a(c){const d=n(c);if(d)return d;const m=ur(c,r);return o(c,m),m}return function(){return s(hr.apply(null,arguments))}}const z=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},vt=/^\[(?:([a-z-]+):)?(.+)\]$/i,mr=/^\d+\/\d+$/,gr=new Set(["px","full","screen"]),xr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pr=/\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$/,br=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,K=e=>he(e)||gr.has(e)||mr.test(e),ee=e=>me(e,"length",Ar),he=e=>!!e&&!Number.isNaN(Number(e)),Pe=e=>me(e,"number",he),ge=e=>!!e&&Number.isInteger(Number(e)),yr=e=>e.endsWith("%")&&he(e.slice(0,-1)),T=e=>vt.test(e),te=e=>xr.test(e),jr=new Set(["length","size","percentage"]),Cr=e=>me(e,jr,wt),kr=e=>me(e,"position",wt),Tr=new Set(["image","url"]),Mr=e=>me(e,Tr,Ir),Sr=e=>me(e,"",Lr),xe=()=>!0,me=(e,t,r)=>{const n=vt.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Ar=e=>pr.test(e)&&!br.test(e),wt=()=>!1,Lr=e=>vr.test(e),Ir=e=>wr.test(e),Nr=()=>{const e=z("colors"),t=z("spacing"),r=z("blur"),n=z("brightness"),o=z("borderColor"),s=z("borderRadius"),l=z("borderSpacing"),a=z("borderWidth"),c=z("contrast"),d=z("grayscale"),m=z("hueRotate"),p=z("invert"),h=z("gap"),y=z("gradientColorStops"),x=z("gradientColorStopPositions"),k=z("inset"),f=z("margin"),v=z("opacity"),g=z("padding"),S=z("saturate"),w=z("scale"),I=z("sepia"),C=z("skew"),N=z("space"),R=z("translate"),H=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",T,t],A=()=>[T,t],j=()=>["",K,ee],M=()=>["auto",he,T],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",T],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[he,T];return{cacheSize:500,separator:":",theme:{colors:[xe],spacing:[K,ee],blur:["none","",te,T],brightness:X(),borderColor:[e],borderRadius:["none","","full",te,T],borderSpacing:A(),borderWidth:j(),contrast:X(),grayscale:U(),hueRotate:X(),invert:U(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[yr,ee],inset:B(),margin:B(),opacity:X(),padding:A(),saturate:X(),scale:X(),sepia:U(),skew:X(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",T]}],container:["container"],columns:[{columns:[te]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"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:[...E(),T]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ge,T]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",T]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",ge,T]}],"grid-cols":[{"grid-cols":[xe]}],"col-start-end":[{col:["auto",{span:["full",ge,T]},T]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[xe]}],"row-start-end":[{row:["auto",{span:[ge,T]},T]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",T]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",T]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",T,t]}],"min-w":[{"min-w":[T,t,"min","max","fit"]}],"max-w":[{"max-w":[T,t,"none","full","min","max","fit","prose",{screen:[te]},te]}],h:[{h:[T,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[T,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[T,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[T,t,"auto","min","max","fit"]}],"font-size":[{text:["base",te,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pe]}],"font-family":[{font:[xe]}],"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",T]}],"line-clamp":[{"line-clamp":["none",he,Pe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",K,T]}],"list-image":[{"list-image":["none",T]}],"list-style-type":[{list:["none","disc","decimal",T]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",K,ee]}],"underline-offset":[{"underline-offset":["auto",K,T]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",T]}],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",T]}],"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:[...E(),kr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Cr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[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:[..._(),"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:_()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[K,T]}],"outline-w":[{outline:[K,ee]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[K,ee]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",te,Sr]}],"shadow-color":[{shadow:[xe]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",te,T]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[S]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",T]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",T]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",T]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[ge,T]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",T]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",T]}],"caret-color":[{caret:[e]}],"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"]}],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",T]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[K,ee,Pe]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},zr=fr(Nr);function D(...e){return zr(V.clsx(e))}let Oe;function Be(){return Oe===void 0&&(Oe=navigator.platform.includes("Mac")),Oe}function yt(e){return`${e}`.toLowerCase()==="mod"?Be()?"⌘":"Ctrl":`${e}`.toLowerCase()==="alt"?Be()?"⌥":"Alt":`${e}`.toLowerCase()==="shift"?Be()?"⇧":"Shift":e}function jt(e){return e.map(yt).join(" ")}const ae=b.forwardRef((e,t)=>{const{icon:r=void 0,tooltip:n=void 0,disabled:o=!1,customClass:s="",loading:l=void 0,shortcutKeys:a=void 0,tooltipOptions:c={},action:d=void 0,isActive:m=void 0,children:p,asChild:h=!1,upload:y=!1,initialDisplayedColor:x=void 0,dataState:k=!1,...f}=e,v=Ke[r],g=h?ft.Slot:Je,S=w=>{if(o){w.preventDefault();return}d==null||d(w)};return i.jsxs(Mt,{children:[i.jsx(St,{asChild:!0,children:i.jsxs(g,{className:D("richtext-h-[32px] richtext-w-[32px]",s),"data-state":k?"on":"off",disabled:o,onClick:S,ref:t,size:"sm",...f,children:[v&&i.jsx(v,{className:"richtext-size-4"}),p]})}),n&&i.jsx(Qe,{...c,className:"richtext-tooltip",children:i.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i.jsx("div",{children:n}),!!(a!=null&&a.length)&&i.jsx("span",{children:jt(a)})]})})]})});function Er(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function Rr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function _r(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-h-4 richtext-w-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function Vr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-h-4 richtext-w-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function Dr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function Me(e){const t=Ke[e.name];return t?i.jsx(t,{onClick:e==null?void 0:e.onClick,className:`richtext-h-4 richtext-w-4 ${(e==null?void 0:e.className)||""}`}):null}function Hr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function Ct(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:i.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function Pr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function Or(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function Br(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function Ur(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6l1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6l-1.4-1.4z"})})}function Fr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function $r(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function Wr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function Gr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function kt(){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[i.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),i.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function Tt(){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[i.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),i.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function Xr(){return i.jsx("svg",{height:"1em",viewBox:"0 0 15 15",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M2.5 10.5H2v.5h.5zm2 0v.5H5v-.5zm9-7h.5v-.207l-.146-.147zm-3-3l.354-.354L10.707 0H10.5zM2 6v4.5h1V6zm.5 5h2v-1h-2zm2.5-.5v-2H4v2zM3 7h2V6H3zM2 5V1.5H1V5zm11-1.5V5h1V3.5zM2.5 1h8V0h-8zm7.646-.146l3 3l.708-.708l-3-3zM2 1.5a.5.5 0 0 1 .5-.5V0A1.5 1.5 0 0 0 1 1.5zM1 12v1.5h1V12zm1.5 3h10v-1h-10zM14 13.5V12h-1v1.5zM12.5 15a1.5 1.5 0 0 0 1.5-1.5h-1a.5.5 0 0 1-.5.5zM1 13.5A1.5 1.5 0 0 0 2.5 15v-1a.5.5 0 0 1-.5-.5zM6 7h3V6H6zm0 4h3v-1H6zm1-4.5v4h1v-4zm3.5.5H13V6h-2.5zM10 6v5h1V6zm.5 3H12V8h-1.5z",fill:"currentColor"})})}function qr(){return i.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[i.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),i.jsx("path",{d:"M5 12V5a2 2 0 0 1 2-2h7l5 5v4M2 21v-6m3 0v6m-3-3h3m15-3v6h2m-9 0v-6l2 3l2-3v6m-9.5-6h3M9 15v6"})]})})}function Zr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:i.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function Yr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[i.jsx("circle",{cx:"10",cy:"24",r:"4"}),i.jsx("circle",{cx:"38",cy:"10",r:"4"}),i.jsx("circle",{cx:"38",cy:"24",r:"4"}),i.jsx("circle",{cx:"38",cy:"38",r:"4"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function Kr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:i.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function Jr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}function Qr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}const Ke={Bold:u.Bold,LoaderCircle:u.LoaderCircle,Italic:u.Italic,Underline:u.Underline,Quote:u.Quote,TextQuote:Rr,Strikethrough:u.Strikethrough,Minus:u.Minus,Eraser:u.Eraser,PaintRoller:u.PaintRoller,Redo2:u.Redo2,Undo2:u.Undo2,AlignCenter:ke.TextAlignCenterIcon,AlignJustify:ke.TextAlignJustifyIcon,AlignLeft:ke.TextAlignLeftIcon,AlignRight:ke.TextAlignRightIcon,ChevronDown:u.ChevronDown,Subscript:u.Subscript,Superscript:u.Superscript,Code:u.Code,Code2:u.CodeXml,Type:u.Type,IndentIncrease:u.IndentIncrease,IndentDecrease:u.IndentDecrease,List:u.List,ListOrdered:u.ListOrdered,ListTodo:u.ListTodo,Link:u.Link,ImageUp:u.ImageUp,Video:u.Video,Maximize:u.Maximize,Minimize:u.Minimize,Table:u.Table,Sparkles:u.Sparkles,Pencil:u.Pencil,Unlink:u.Unlink,BetweenHorizonalEnd:u.BetweenHorizonalEnd,BetweenHorizonalStart:u.BetweenHorizonalStart,BetweenVerticalStart:u.BetweenVerticalStart,BetweenVerticalEnd:u.BetweenVerticalEnd,TableCellsMerge:u.TableCellsMerge,TableCellsSplit:u.TableCellsSplit,Trash2:u.Trash2,Trash:u.Trash,Replace:u.Replace,ChevronsUpDown:u.ChevronsUpDown,LineHeight:Hr,Word:Dr,HeadingParagraph:u.Pilcrow,Heading1:u.Heading1,Heading2:u.Heading2,Heading3:u.Heading3,Heading4:u.Heading4,Heading5:u.Heading5,Heading6:u.Heading6,Columns2:u.Columns2,Columns3:u.Columns3,Columns4:u.Columns4,Plus:u.Plus,Grip:u.GripVertical,Copy:u.Copy,Clipboard:u.Clipboard,PanelLeft:u.PanelLeft,PanelRight:u.PanelRight,Columns:u.Columns2,Iframe:u.Frame,MenuDown:Ct,SizeS:Br,SizeM:Or,SizeL:Pr,AspectRatio:Er,Emoji:u.SmilePlus,DeleteColumn:_r,DeleteRow:Vr,SearchAndReplace:u.Replace,EmojiIcon:u.SmilePlusIcon,KatexIcon:u.Sigma,ExportPdf:kt,ExportWord:Tt,ImportWord:Qr,ColumnAddLeft:Fr,ColumnAddRight:$r,BookMarked:u.BookMarked,Excalidraw:Gr,ZoomIn:u.ZoomIn,ZoomOut:u.ZoomOut,Settings:u.Settings,Eye:u.Eye,TextDirection:Wr,LeftToRight:Zr,RightToLeft:Kr,Attachment:u.Paperclip,AttachmentDownload:u.Download,GifIcon:Xr,ChevronUp:u.ChevronUp,Crop:u.CropIcon,Mermaid:Yr,Twitter:Jr,CodeView:Ur,FlipX:u.FlipVertical,FlipY:u.FlipHorizontal,PencilRuler:u.PencilRuler,WrapText:u.WrapText,Loader:u.Loader2,X:u.X,Html:qr,ExternalLink:u.ExternalLink,Callout:u.NotebookPen},lt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ct=V.clsx,ze=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return ct(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(d=>{const m=r==null?void 0:r[d],p=s==null?void 0:s[d];if(m===null)return null;const h=lt(m)||lt(p);return o[d][h]}),a=r&&Object.entries(r).reduce((d,m)=>{let[p,h]=m;return h===void 0||(d[p]=h),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,m)=>{let{class:p,className:h,...y}=m;return Object.entries(y).every(x=>{let[k,f]=x;return Array.isArray(f)?f.includes({...s,...a}[k]):{...s,...a}[k]===f})?[...d,p,h]:d},[]);return ct(e,l,c,r==null?void 0:r.class,r==null?void 0:r.className)},ei=ze("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background richtext-text-foreground hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-size-10"}},defaultVariants:{variant:"default",size:"default"}}),W=F.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const l=n?ft.Slot:"button";return i.jsx(l,{className:D(ei({variant:t,size:r,className:e})),ref:s,...o})});W.displayName="Button";const re=F.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{ref:n,type:t,className:D("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-transparent richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-1 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),...r}));re.displayName="Input";const ti=ze("richtext-text-sm richtext-font-medium richtext-leading-none richtext-text-foreground peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),fe=F.forwardRef(({className:e,...t},r)=>i.jsx(gt.Root,{className:D(ti(),e),ref:r,...t}));fe.displayName=gt.Root.displayName;const Ee=ce.Root,je=F.forwardRef(({className:e,...t},r)=>i.jsx(ce.List,{ref:r,className:D("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",e),...t}));je.displayName=ce.List.displayName;const J=F.forwardRef(({className:e,...t},r)=>i.jsx(ce.Trigger,{ref:r,className:D("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",e),...t}));J.displayName=ce.Trigger.displayName;const Q=F.forwardRef(({className:e,...t},r)=>i.jsx(ce.Content,{ref:r,className:D("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1",e),...t}));Q.displayName=ce.Content.displayName;const ri=ze("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Je=F.forwardRef(({className:e,variant:t,size:r,...n},o)=>i.jsx(mt.Root,{ref:o,className:D(ri({variant:t,size:r,className:e})),...n}));Je.displayName=mt.Root.displayName;const ii=ye.Provider,Mt=ye.Root,St=ye.Trigger,Qe=F.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(ye.Content,{"data-richtext-portal":!0,ref:n,sideOffset:t,className:D("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border-none richtext-bg-primary richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-primary-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r}));Qe.displayName=ye.Content.displayName;const ni=1,oi=1e6;let Ue=0;function si(){return Ue=(Ue+1)%Number.MAX_SAFE_INTEGER,Ue.toString()}const Fe=new Map;function dt(e){if(Fe.has(e))return;const t=setTimeout(()=>{Fe.delete(e),be({type:"REMOVE_TOAST",toastId:e})},oi);Fe.set(e,t)}function ai(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,ni)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?dt(r):e.toasts.forEach(n=>{dt(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}}const Se=[];let Ae={toasts:[]};function be(e){Ae=ai(Ae,e),Se.forEach(t=>{t(Ae)})}function li({...e}){const t=si(),r=o=>be({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>be({type:"DISMISS_TOAST",toastId:t});return be({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function Re(){const[e,t]=F.useState(Ae);return F.useEffect(()=>(Se.push(t),()=>{const r=Se.indexOf(t);r>-1&&Se.splice(r,1)}),[e]),{...e,toast:li,dismiss:r=>be({type:"DISMISS_TOAST",toastId:r})}}const _e=F.forwardRef(({className:e,...t},r)=>i.jsx(We.Root,{ref:r,className:D("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-p-0 !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-1 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",e),...t,children:i.jsx(We.Indicator,{className:D("!richtext-flex !richtext-items-center !richtext-justify-center !richtext-p-0 !richtext-text-current"),children:i.jsx(u.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));_e.displayName=We.Root.displayName;function ci(e){return e=e||new Map,{all:e,on(t,r){const n=e.get(t);n?n.push(r):e.set(t,[r])},off(t,r){const n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit(t,r){let n=e.get(t);n&&n.slice().map(o=>{o(r)}),n=e.get("*"),n&&n.slice().map(o=>{o(t,r)})}}}const et=ci(),At=b.createContext(et),di=()=>b.useContext(At);function Ve(e,t){const r=di();b.useEffect(()=>(t.map(n=>r.on(n,e)),()=>{t.map(n=>r.off(n,e))}),[r,t,e])}const Lt=et.emit;function ui({children:e}){return i.jsx(At.Provider,{value:et,children:e})}const de=Z.Root,De=Z.Trigger,hi=Z.Portal,It=F.forwardRef(({className:e,...t},r)=>i.jsx(Z.Overlay,{ref:r,className:D("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",e),...t}));It.displayName=Z.Overlay.displayName;const ie=F.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(hi,{"data-richtext-portal":!0,children:[i.jsx(It,{}),i.jsxs(Z.Content,{"data-richtext-portal":!0,ref:n,className:D("richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border !richtext-border-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",e),...r,children:[t,i.jsxs(Z.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[i.jsx(u.X,{className:"richtext-size-4 richtext-text-accent-foreground"}),i.jsx("span",{className:"richtext-sr-only richtext-text-accent-foreground",children:"Close"})]})]})]}));ie.displayName=Z.Content.displayName;function Nt({className:e,...t}){return i.jsx("div",{className:D("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",e),...t})}Nt.displayName="DialogHeader";function tt({className:e,...t}){return i.jsx("div",{className:D("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",e),...t})}tt.displayName="DialogFooter";const ne=F.forwardRef(({className:e,...t},r)=>i.jsx(Z.Title,{ref:r,className:D("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight richtext-text-foreground",e),...t}));ne.displayName=Z.Title.displayName;const fi=F.forwardRef(({className:e,...t},r)=>i.jsx(Z.Description,{className:D("richtext-text-sm richtext-text-muted-foreground",e),ref:r,...t}));fi.displayName=Z.Description.displayName;const mi={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
|
|
2
|
-
<path fill="currentColor" d="M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"></path>
|
|
3
|
-
<path fill="currentColor" d="M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"></path>
|
|
4
|
-
</svg>`,word:`<svg
|
|
5
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
width="1em"
|
|
7
|
-
height="1em"
|
|
8
|
-
className="icon"
|
|
9
|
-
viewBox="0 0 1024 1024"
|
|
10
|
-
>
|
|
11
|
-
<path
|
|
12
|
-
fill="currentColor"
|
|
13
|
-
d="M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"
|
|
14
|
-
/>
|
|
15
|
-
<path
|
|
16
|
-
fill="currentColor"
|
|
17
|
-
d="m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"
|
|
18
|
-
/>
|
|
19
|
-
</svg>`,excel:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',ppt:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'};function gi(e){return e.replace(/^.*\/|\..+$/g,"")}function xi(e){return e.split(".").pop()}function zt(e){return e<1024?`${e} Byte`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function pi(e){return e?e==="application/pdf"?"pdf":e.startsWith("application/")&&[".document","word"].some(t=>e.includes(t))?"word":e.startsWith("application/")&&["presentation"].some(t=>e.includes(t))?"excel":e.startsWith("application/")&&["sheet"].some(t=>e.includes(t))?"ppt":e.startsWith("image")?"image":e.startsWith("audio")?"audio":e.startsWith("video")?"video":"file":"file"}function bi(e){return new Promise(t=>{const r=new FileReader;r.addEventListener("load",()=>{t({alt:e.name,src:r.result})},!1),r.readAsDataURL(e)})}function Et(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],o=atob(r[r.length-1]);let s=o.length;const l=new Uint8Array(s);for(;s--;)l[s]=o.charCodeAt(s);return new File([l],t,{type:n})}function vi(e){const t=mi[e],o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement,s=["svg",{...Array.from(o.attributes).reduce((l,a)=>(l[a.name]=a.value,l),{})}];return Array.from(o.childNodes).forEach(l=>{if(l.nodeType===1){const a=[l.tagName.toLowerCase(),Array.from(l.attributes).reduce((c,d)=>(c[d.name]=d.value,c),{})];l.textContent&&a.push(l.textContent),s.push(a)}}),s}const wi={audio:i.jsx(u.LucideAudioLines,{}),video:i.jsx(u.LucideVideo,{}),file:i.jsx(u.LucideFile,{}),image:i.jsx(u.LucideImage,{}),pdf:i.jsx(kt,{}),word:i.jsx(Tt,{}),excel:i.jsx(u.LucideSheet,{}),ppt:i.jsx(u.LucideTableProperties,{})};function Rt(e,t=!1){const r=pi(e),n=wi[r]||i.jsx(i.Fragment,{});return t?vi(r):n}const yi="_card_1is0r_64",ji="_downloadBtn_1is0r_82",Ci="_cardLeft_1is0r_88",ki="_iconWrap_1is0r_97",Ti="_fileInfo_1is0r_116",Mi="_fileName_1is0r_123",Si="_fileSize_1is0r_133",Ai="_cardPreview_1is0r_145",Li="_actions_1is0r_221",Ii="_cardError_1is0r_236",Ni="_errorText_1is0r_240",q={card:yi,downloadBtn:ji,cardLeft:Ci,iconWrap:ki,fileInfo:Ti,fileName:Mi,fileSize:Si,cardPreview:Ai,actions:Li,cardError:Ii,errorText:Ni};function zi({editor:e,node:t,deleteNode:r,extension:n}){var k;const o=(e==null?void 0:e.isEditable)??!1,{fileName:s,fileSize:l,fileExt:a,fileType:c,id:d,error:m}=t.attrs,{t:p}=$.useLocale(),h=(k=n==null?void 0:n.options)==null?void 0:k.onDownload,y=b.useCallback(()=>r(),[r]),x=b.useCallback(()=>{!d||!h||h({id:d,fileName:s,fileExt:a,fileType:c,fileSize:l})},[d,s,a,c,l,h]);return m&&m!=="null"?i.jsx(V.NodeViewWrapper,{children:i.jsx("div",{className:V.clsx(q.card,q.cardError,"render-wrapper"),children:i.jsx("p",{className:q.errorText,children:m})})}):d?i.jsx(V.NodeViewWrapper,{children:i.jsxs("div",{className:V.clsx(q.card,"render-wrapper",{[q.cardPreview]:!o}),children:[i.jsxs("div",{className:q.cardLeft,children:[i.jsx("div",{className:q.iconWrap,children:Rt(c)}),i.jsxs("div",{className:q.fileInfo,children:[i.jsxs("span",{className:q.fileName,children:[s,".",a]}),i.jsx("span",{className:q.fileSize,children:zt(l)})]})]}),i.jsxs("div",{className:q.actions,children:[h&&i.jsx(ae,{action:x,icon:"AttachmentDownload",tooltip:p("editor.attachment.download"),customClass:o?void 0:q.downloadBtn}),o&&i.jsx(ae,{action:y,icon:"Trash2",tooltip:p("editor.delete")})]})]})}):i.jsx(i.Fragment,{})}function Ei(e){try{return JSON.stringify(e)}catch{return JSON.stringify({})}}function se(e,t=!1){return r=>{const n=e.startsWith("data-")?e:`data-${e}`;let o=decodeURIComponent(r.getAttribute(n));if(o==null||typeof o=="string"&&o==="null")try{const a=r.outerHTML.match(/([\S\s])+?="([\S\s])+?"/g);a&&a.length>0&&(o=(a.map(d=>d.trim()).reduce((d,m)=>{const p=m.indexOf("="),h=[m.slice(0,p),m.slice(p+1).slice(1,-1)];return d[h[0]]=h[1],d},{})[e.toLowerCase()]||"").replaceAll(""",'"'))}catch(l){console.error("Error getDatasetAttribute ",l.message,r)}if(t)try{return JSON.parse(o)}catch{return{}}if(o.includes("%")||o.includes("auto"))return o;const s=Number.parseInt(o);return s!==s?o:s}}function Ri(e){const{attrs:t}=e;return Object.keys(t).reduce((r,n)=>{const o=t[n];if(o==null)return r;let s="";return typeof o=="object"?s=Ei(o):s=o,r[n]=s,r},Object.create(null))}const Ce={UPLOAD_IMAGE:e=>`UPLOAD_IMAGE-${e}`,UPLOAD_VIDEO:e=>`UPLOAD_VIDEO-${e}`,UPLOAD_ATTACHMENT:e=>`UPLOAD_ATTACHMENT-${e}`,EXCALIDRAW:e=>`EXCALIDRAW-${e}`};function _i(e){const{editor:t}=V.useCurrentEditor(),r=F.useMemo(()=>t,[e,t]);return V.useEditorState({editor:r,selector(o){return o.editor?{editor:o.editor,editorState:o.editor.state,canCommand:o.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})||{editor:null}}function Y(){return _i().editor}const _t=Ze.y(!1);function rt(){return Ze.b(_t)}function Vi(){return Ze.S(_t)}const Vt=()=>!1;function Di(e=Vt){const t=rt(),[r,n]=b.useState(()=>{const a=e();return typeof a=="boolean"?!a:a}),o=Y();b.useEffect(()=>{if(!o||!e)return;const a=()=>{const c=e();n(typeof c=="boolean"?!c:c)};return a(),o.on("selectionUpdate",a),o.on("transaction",a),()=>{o.off("selectionUpdate",a),o.off("transaction",a)}},[o,e]);const s=b.useMemo(()=>!t||!o?!0:typeof r=="boolean"?r:!1,[t,o,r]),l=b.useMemo(()=>!t||!o,[t,o]);return{disabled:s,dataState:r,editorDisabled:l}}function ue(e=Vt){const t=rt(),[r,n]=b.useState({}),[o,s]=b.useState(e()),l=Y();b.useEffect(()=>{if(!l||!e)return;const d=()=>{s(e())};return d(),l.on("selectionUpdate",d),()=>{l.off("selectionUpdate",d)}},[r,l,e]);const a=b.useMemo(()=>!t||!l,[t,l]),c=b.useMemo(()=>!t||!l,[t,l]);return{disabled:a,dataState:o,editorDisabled:c,update:()=>n({})}}function oe(e){const t=Y();return b.useMemo(()=>t?t.extensionManager.extensions.find(n=>n.name===e):null,[t,e])}function Hi(e,t,r){return e<t?t:e>r?r:e}const Pi=e=>typeof e=="number",Oi=e=>typeof e=="string",Bi=e=>typeof e=="function";function Ui(e,t="px"){if(!e)return e;const r=Pi(e)?String(e):e,n=Number.parseFloat(r),o=r.match(/[%a-z]+$/i),s=o?o[0]:t;return Number.isNaN(n)?e:n+s}function Fi(e,t){if(!e)return!1;const{extensions:r=[]}=(e==null?void 0:e.extensionManager)??{};return!!r.find(o=>o.name===t)}function $i(e){return e.map(t=>Oi(t)?{value:t,name:t}:t)}function He(e){const t=Y(),r=oe(e),{t:n}=$.useLocale();return b.useMemo(()=>{if(!t||!r||!n)return null;const{button:o}=r.options;return!o||!Bi(o)?null:o({editor:t,extension:r,t:n})},[t,r,n])}function Wi(){const e=He(it.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:o={},action:s=void 0,isActive:l=void 0}=(e==null?void 0:e.componentProps)??{},{editorDisabled:a,update:c}=ue(l),d=()=>{a||s&&(s(),c())};return e?i.jsx(ae,{action:d,disabled:a,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:o}):i.jsx(i.Fragment,{})}const it=V.Node3.create({name:"attachment",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"attachment"},button:({editor:t,t:r})=>({component:ae,componentProps:{action:()=>{const n=Ce.UPLOAD_ATTACHMENT(t.id);Lt(n,!0)},isActive:()=>!1,disabled:!1,icon:"Attachment",tooltip:r("editor.attachment.tooltip")}})}},parseHTML(){return[{tag:"div[class=attachment]"}]},renderHTML({HTMLAttributes:e}){const{id:t="",fileName:r="",fileSize:n="",fileType:o="",fileExt:s=""}=e||{};return["div",V.mergeAttributes(this.options.HTMLAttributes||{},e||{}),t?["span",{class:"attachment__body"},["span",{class:"attachment__icon"},Rt(o,!0)],["span",{class:"attachment__text"},`${r}.${s} (${zt(n)})`]]:["div",{class:"attachment__placeholder"}]]},addAttributes(){return{id:{default:null,parseHTML:se("id")},fileName:{default:null,parseHTML:se("filename")},fileSize:{default:null,parseHTML:se("filesize")},fileType:{default:null,parseHTML:se("filetype")},fileExt:{default:null,parseHTML:se("fileext")},error:{default:null,parseHTML:se("error")}}},addCommands(){return{setAttachment:e=>({chain:t})=>t().insertContent({type:this.name,attrs:e}).run()}},addNodeView(){return V.ReactNodeViewRenderer(zi)}});function Gi(){var f;const{t:e}=$.useLocale(),t=Y(),{editorDisabled:r}=ue(),[n,o]=b.useState(!1),[s,l]=b.useState(!1),[a,c]=b.useState(null),d=b.useRef(null),m=oe(it.name),p=Ce.UPLOAD_ATTACHMENT(t.id);Ve(v=>{v&&(c(null),l(!1),o(!0))},[p]);const h=(f=m==null?void 0:m.options)==null?void 0:f.upload;function y(v){var g;v.preventDefault(),(g=d.current)==null||g.click()}async function x(v){var S;const g=(S=v.target.files)==null?void 0:S[0];if(!g||!t||t.isDestroyed){v.target.value="";return}if(!h){c(e("editor.attachment.error.no_upload_fn")),v.target.value="";return}c(null),l(!0);try{const w=await h(g);t.chain().focus().setAttachment({id:w,fileName:gi(g.name),fileSize:g.size,fileType:g.type,fileExt:xi(g.name)}).run(),o(!1)}catch(w){c(w!=null&&w.message?`${e("editor.attachment.error.upload_failed")}: ${w.message}`:e("editor.attachment.error.upload_failed"))}finally{l(!1),v.target.value=""}}function k(v){s||(o(v),v||c(null))}return r?i.jsx(i.Fragment,{}):i.jsx(de,{onOpenChange:k,open:n,children:i.jsxs(ie,{children:[i.jsx(ne,{children:e("editor.attachment.dialog.title")}),i.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-gap-3",children:[i.jsx("p",{className:"richtext-text-sm richtext-text-muted-foreground",children:e("editor.attachment.dialog.description")}),i.jsx(W,{className:"richtext-w-full",disabled:s,onClick:y,size:"sm",children:e(s?"editor.attachment.uploading":"editor.attachment.dialog.button.choose")}),a&&i.jsx("p",{className:"richtext-text-sm richtext-text-destructive",children:a})]}),i.jsx("input",{hidden:!0,onChange:x,ref:d,type:"file"})]})})}var Xi=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,qi=V.Node3.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",V.mergeAttributes(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,r,n,o,s,l;const a=(r=(t=e.attrs)==null?void 0:t.src)!=null?r:"",c=(o=(n=e.attrs)==null?void 0:n.alt)!=null?o:"",d=(l=(s=e.attrs)==null?void 0:s.title)!=null?l:"";return d?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:o,getPos:s,HTMLAttributes:l,editor:a})=>{const c=document.createElement("img");Object.entries(l).forEach(([p,h])=>{if(h!=null)switch(p){case"width":case"height":break;default:c.setAttribute(p,h);break}}),c.src=l.src;const d=new V.ResizableNodeView({element:c,editor:a,node:o,getPos:s,onResize:(p,h)=>{c.style.width=`${p}px`,c.style.height=`${h}px`},onCommit:(p,h)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:p,height:h}).run()},onUpdate:(p,h,y)=>p.type===o.type,options:{directions:e,min:{width:t,height:r},preserveAspectRatio:n===!0}}),m=d.dom;return m.style.visibility="hidden",m.style.pointerEvents="none",c.onload=()=>{m.style.visibility="",m.style.pointerEvents=""},d}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[V.nodeInputRule({find:Xi,type:this.type,getAttributes:e=>{const[,,t,r,n]=e;return{src:r,alt:t,title:n}}})]}}),Dt=qi,Zi=typeof global=="object"&&global&&global.Object===Object&&global,Yi=typeof self=="object"&&self&&self.Object===Object&&self,Ht=Zi||Yi||Function("return this")(),Le=Ht.Symbol,Pt=Object.prototype,Ki=Pt.hasOwnProperty,Ji=Pt.toString,pe=Le?Le.toStringTag:void 0;function Qi(e){var t=Ki.call(e,pe),r=e[pe];try{e[pe]=void 0;var n=!0}catch{}var o=Ji.call(e);return n&&(t?e[pe]=r:delete e[pe]),o}var en=Object.prototype,tn=en.toString;function rn(e){return tn.call(e)}var nn="[object Null]",on="[object Undefined]",ut=Le?Le.toStringTag:void 0;function Ot(e){return e==null?e===void 0?on:nn:ut&&ut in Object(e)?Qi(e):rn(e)}function Bt(e){return e!=null&&typeof e=="object"}var sn="[object Symbol]";function an(e){return typeof e=="symbol"||Bt(e)&&Ot(e)==sn}var ln=/\s/;function cn(e){for(var t=e.length;t--&&ln.test(e.charAt(t)););return t}var dn=/^\s+/;function un(e){return e&&e.slice(0,cn(e)+1).replace(dn,"")}function Ie(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ht=NaN,hn=/^[-+]0x[0-9a-f]+$/i,fn=/^0b[01]+$/i,mn=/^0o[0-7]+$/i,gn=parseInt;function ve(e){if(typeof e=="number")return e;if(an(e))return ht;if(Ie(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ie(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=un(e);var r=fn.test(e);return r||mn.test(e)?gn(e.slice(2),r?2:8):hn.test(e)?ht:+e}function xn(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}function Ut(e,t,r){return r===void 0&&(r=t,t=void 0),r!==void 0&&(r=ve(r),r=r===r?r:0),t!==void 0&&(t=ve(t),t=t===t?t:0),xn(ve(e),t,r)}var $e=function(){return Ht.Date.now()},pn="Expected a function",bn=Math.max,vn=Math.min;function Ft(e,t,r){var n,o,s,l,a,c,d=0,m=!1,p=!1,h=!0;if(typeof e!="function")throw new TypeError(pn);t=ve(t)||0,Ie(r)&&(m=!!r.leading,p="maxWait"in r,s=p?bn(ve(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h);function y(C){var N=n,R=o;return n=o=void 0,d=C,l=e.apply(R,N),l}function x(C){return d=C,a=setTimeout(v,t),m?y(C):l}function k(C){var N=C-c,R=C-d,H=t-N;return p?vn(H,s-R):H}function f(C){var N=C-c,R=C-d;return c===void 0||N>=t||N<0||p&&R>=s}function v(){var C=$e();if(f(C))return g(C);a=setTimeout(v,k(C))}function g(C){return a=void 0,h&&n?y(C):(n=o=void 0,l)}function S(){a!==void 0&&clearTimeout(a),d=0,n=c=o=a=void 0}function w(){return a===void 0?l:g($e())}function I(){var C=$e(),N=f(C);if(n=arguments,o=this,c=C,N){if(a===void 0)return x(c);if(p)return clearTimeout(a),a=setTimeout(v,t),y(c)}return a===void 0&&(a=setTimeout(v,t)),l}return I.cancel=S,I.flush=w,I}var wn="[object Number]";function Xe(e){return typeof e=="number"||Bt(e)&&Ot(e)==wn}var yn="Expected a function";function qe(e,t,r){var n=!0,o=!0;if(typeof e!="function")throw new TypeError(yn);return Ie(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Ft(e,t,{leading:n,maxWait:t,trailing:o})}const Te={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function jn({src:e,style:t}){return i.jsxs("div",{style:{position:"relative",display:"inline-block",overflow:"hidden",borderRadius:8,background:"hsl(var(--muted, 220 14% 96%))",minHeight:120,minWidth:180,...t},children:[e&&i.jsx("img",{src:e,alt:"","aria-hidden":!0,style:{display:"block",width:"100%",height:"100%",objectFit:"cover",filter:"blur(20px) saturate(0.5)",transform:"scale(1.1)",opacity:.5}}),i.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(110deg, transparent 30%, hsl(var(--muted-foreground, 220 9% 46%) / 0.08) 50%, transparent 70%)",animation:"richtext-skeleton-shimmer 1.8s ease-in-out infinite"}}),i.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,pointerEvents:"none"},children:[i.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"hsl(var(--muted-foreground, 220 9% 46%))",animation:"richtext-skeleton-spin 1s linear infinite"},children:i.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),i.jsx("span",{style:{fontSize:12,fontWeight:500,color:"hsl(var(--muted-foreground, 220 9% 46%))",userSelect:"none"},children:"Uploading…"})]}),i.jsx("style",{children:`
|
|
20
|
-
@keyframes richtext-skeleton-shimmer {
|
|
21
|
-
0% { transform: translateX(-100%); }
|
|
22
|
-
100% { transform: translateX(100%); }
|
|
23
|
-
}
|
|
24
|
-
@keyframes richtext-skeleton-spin {
|
|
25
|
-
from { transform: rotate(0deg); }
|
|
26
|
-
to { transform: rotate(360deg); }
|
|
27
|
-
}
|
|
28
|
-
`})]})}function Cn(e){var H,P,B,A;const[t,r]=b.useState({width:$.IMAGE_MAX_SIZE,height:$.IMAGE_MAX_SIZE}),[n,o]=b.useState({width:0,height:0}),[s]=b.useState([Te.TOP_LEFT,Te.TOP_RIGHT,Te.BOTTOM_LEFT,Te.BOTTOM_RIGHT]),[l,a]=b.useState(!1),[c,d]=b.useState({x:0,y:0,w:0,h:0,dir:""}),{align:m,inline:p,uploading:h}=(H=e==null?void 0:e.node)==null?void 0:H.attrs,y=p&&(m==="left"||m==="right"),x=b.useMemo(()=>{var ot;const{src:j,alt:M,width:E,height:_,flipX:O,flipY:L}=(ot=e==null?void 0:e.node)==null?void 0:ot.attrs,U=Xe(E)?`${E}px`:E,G=Xe(_)?`${_}px`:_,X=[];O&&X.push("rotateX(180deg)"),L&&X.push("rotateY(180deg)");const Xt=X.join(" ");return{src:j||void 0,alt:M||void 0,style:{width:U||void 0,height:G||void 0,transform:Xt||"none",...y?{float:m}:{}}}},[(P=e==null?void 0:e.node)==null?void 0:P.attrs]),k=b.useMemo(()=>{const{style:{width:j}}=x;return{width:j==="100%"?j:void 0}},[x]);function f(j){o({width:j.target.width,height:j.target.height})}function v(){const{editor:j,getPos:M}=e;j.commands.setNodeSelection(M())}const g=b.useCallback(qe(()=>{const{editor:j}=e,{width:M}=getComputedStyle(j.view.dom);r(E=>({...E,width:Number.parseInt(M,10)}))},$.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function S(j,M){j.preventDefault(),j.stopPropagation();const E=n.width,_=n.height,O=E/_;let L=Number(e.node.attrs.width),U=Number(e.node.attrs.height);const G=t.width;L&&!U?(L=L>G?G:L,U=Math.round(L/O)):U&&!L?(L=Math.round(U*O),L=L>G?G:L):!L&&!U?(L=E>G?G:E,U=Math.round(L/O)):L=L>G?G:L,a(!0),d({x:j.clientX,y:j.clientY,w:L,h:U,dir:M})}const w=b.useCallback(qe(j=>{if(j.preventDefault(),j.stopPropagation(),!l)return;const{x:M,w:E,dir:_}=c,O=(j.clientX-M)*(/l/.test(_)?-1:1),L=Ut(E+O,$.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:L,height:null})},$.IMAGE_THROTTLE_WAIT_TIME),[l,c,t,e.updateAttributes]),I=b.useCallback(j=>{j.preventDefault(),j.stopPropagation(),l&&(d({x:0,y:0,w:0,h:0,dir:""}),a(!1),v())},[l,v]),C=b.useCallback(()=>{document==null||document.addEventListener("mousemove",w,!0),document==null||document.addEventListener("mouseup",I,!0)},[w,I]),N=b.useCallback(()=>{document==null||document.removeEventListener("mousemove",w,!0),document==null||document.removeEventListener("mouseup",I,!0)},[w,I]);b.useEffect(()=>(l?C():N(),()=>{N()}),[l,C,N]);const R=b.useMemo(()=>new ResizeObserver(()=>g()),[g]);return b.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),h?i.jsx(V.NodeViewWrapper,{as:p?"span":"div",className:"image-view",style:{float:y?m:void 0,margin:y?m==="left"?"1em 1em 1em 0":"1em 0 1em 1em":void 0,display:p?"inline":"block",textAlign:y?void 0:m,width:((B=x.style)==null?void 0:B.width)??"auto",...y?{}:k},children:i.jsx("div",{style:k,className:"image-view__body",children:i.jsx(jn,{src:x.src,style:x.style})})}):i.jsx(V.NodeViewWrapper,{as:p?"span":"div",className:"image-view",style:{float:y?m:void 0,margin:y?m==="left"?"1em 1em 1em 0":"1em 0 1em 1em":void 0,display:p?"inline":"block",textAlign:y?void 0:m,width:((A=x.style)==null?void 0:A.width)??"auto",...y?{}:k},children:i.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:k,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${l?"image-view__body--resizing":""}`,children:[i.jsx("img",{alt:x.alt,className:"image-view__body__image block",height:"auto",onClick:v,onLoad:f,src:x.src,style:x.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||l)&&i.jsx("div",{className:"image-resizer",children:s==null?void 0:s.map(j=>i.jsx("span",{className:`image-resizer__handler image-resizer__handler--${j}`,onMouseDown:M=>S(M,j)},`image-dir-${j}`))})]})})}function kn(e,t){const r=e.type,n=e.name.toLowerCase(),o=n.split(".").pop();if(!o)return!1;const l=r||{heif:"image/heif",heic:"image/heic",dng:"image/x-adobe-dng",cr2:"image/x-canon-cr2",nef:"image/x-nikon-nef",arw:"image/x-sony-arw",raf:"image/x-fuji-raf",orf:"image/x-olympus-orf"}[o];return t.some(a=>{if(a.startsWith("."))return n.endsWith(a);if(a.endsWith("/*")){const c=a.split("/")[0];return l==null?void 0:l.startsWith(c+"/")}return l===a})}function nt(e,t){const{acceptMimes:r,maxSize:n,t:o,toast:s}=t,l=[];return(Array.isArray(e)?e:Object.values(e)).forEach(c=>{if(!kn(c,r)){t.onError?t.onError({type:"type",message:o("editor.upload.fileTypeNotSupported",{fileName:c.name}),file:c}):s({variant:"destructive",title:o("editor.upload.fileTypeNotSupported",{fileName:c.name})});return}if(c.size>n){const d=(n/1024/1024).toFixed(2);t.onError?t.onError({type:"size",message:o("editor.upload.fileSizeTooBig",{fileName:c.name,size:d}),file:c}):s({variant:"destructive",title:o("editor.upload.fileSizeTooBig",{fileName:c.name,size:d})});return}l.push(c)}),l}function Tn(){const{t:e}=$.useLocale(),{toast:t}=Re(),r=Y(),n=He(we.name),{icon:o,tooltip:s}=(n==null?void 0:n.componentProps)??{},{editorDisabled:l}=ue(),[a,c]=b.useState(!1),d=oe(we.name),[m,p]=b.useState(""),[h,y]=b.useState(""),x=b.useRef(null),k=(d==null?void 0:d.options.defaultInline)||!1,[f,v]=b.useState(k),g=b.useMemo(()=>d==null?void 0:d.options,[d]);function S(C){var B;const N=(B=C==null?void 0:C.target)==null?void 0:B.files;if(!r||r.isDestroyed||N.length===0){C.target.value="";return}const R=nt(N,{acceptMimes:g==null?void 0:g.acceptMimes,maxSize:g==null?void 0:g.maxSize,t:e,toast:t,onError:g.onError});if(R.length<=0){C.target.value="";return}c(!1);const H=h,P=f;if(y(""),v(k),g.upload){const A=g!=null&&g.multiple?R:[R[0]];for(const j of A)r.chain().focus().insertImagePlaceholder({file:j,inline:P,alt:H}).run()}else{const A=g!=null&&g.multiple?R:[R[0]];for(const j of A){const M=URL.createObjectURL(j);r.chain().focus().setImageInline({src:M,inline:P,alt:H}).run()}}C.target.value=""}function w(C){C.preventDefault(),C.stopPropagation(),r.chain().focus().setImageInline({src:m,inline:f,alt:h}).run(),c(!1),v(k),p(""),y("")}function I(C){var N;C.preventDefault(),(N=x.current)==null||N.click()}return n?i.jsxs(de,{onOpenChange:c,open:a,children:[i.jsx(De,{asChild:!0,children:i.jsx(ae,{disabled:l,icon:o,tooltip:s,action:()=>{l||c(!0)}})}),i.jsxs(ie,{children:[i.jsx(ne,{children:e("editor.image.dialog.title")}),i.jsxs(Ee,{activationMode:"manual",defaultValue:g.resourceImage==="both"||g.resourceImage==="upload"?"upload":"link",children:[g.resourceImage==="both"&&i.jsxs(je,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[i.jsx(J,{value:"upload",children:e("editor.image.dialog.tab.upload")}),i.jsx(J,{value:"link",children:e("editor.image.dialog.tab.url")})]}),i.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[i.jsx(_e,{checked:f,onCheckedChange:C=>{v(C)}}),i.jsx(fe,{children:e("editor.link.dialog.inline")})]}),g.enableAlt&&i.jsxs("div",{className:"richtext-my-[10px]",children:[i.jsx(fe,{className:"mb-[6px]",children:e("editor.imageUpload.alt")}),i.jsx(re,{onChange:C=>y(C.target.value),required:!0,type:"text",value:h})]}),i.jsxs(Q,{value:"upload",children:[i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(W,{className:"richtext-mt-1 richtext-w-full",onClick:I,size:"sm",children:e("editor.image.dialog.tab.upload")}),i.jsx($t,{alt:h,disabled:!1,editor:r,imageInline:f,onClose:()=>{y("")}})]}),i.jsx("input",{accept:g.acceptMimes.join(",")||"image/*",multiple:g.multiple,onChange:S,ref:x,style:{display:"none"},type:"file"})]}),i.jsx(Q,{value:"link",children:i.jsx("form",{onSubmit:w,children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(re,{autoFocus:!0,onChange:C=>p(C.target.value),placeholder:e("editor.image.dialog.placeholder"),required:!0,type:"url",value:m}),i.jsx(W,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})]}):i.jsx(i.Fragment,{})}const Mn={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,multiple:!0,resourceImage:"both",defaultInline:!1,enableAlt:!0},we=Dt.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...Mn,...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:r,t:n})=>{var o,s;return{componentProps:{action:()=>!0,upload:r.options.upload,disabled:!((s=(o=t.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:n("editor.image.tooltip")}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),uploading:{default:!1,parseHTML:()=>!1,renderHTML:()=>({})},imageId:{default:null,parseHTML:t=>t.getAttribute("data-image-id"),renderHTML:t=>t.imageId?{"data-image-id":t.imageId}:{}},flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||null;return r?Number.parseInt(r,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})},alt:{default:"",parseHTML:t=>t.getAttribute("alt"),renderHTML:t=>({alt:t.alt})}}},addNodeView(){return V.ReactNodeViewRenderer(Cn)},addCommands(){var r;const e=this.name,t=this.options;return{...(r=this.parent)==null?void 0:r.call(this),setImageInline:n=>({commands:o})=>o.insertContent({type:e,attrs:{...n,imageId:n.imageId??null,inline:n.inline??t.defaultInline}}),insertImagePlaceholder:({file:n,inline:o,alt:s})=>({editor:l,commands:a})=>{const c=URL.createObjectURL(n);if(!a.insertContent({type:e,attrs:{src:c,alt:s??"",inline:o??t.defaultInline,uploading:!0,imageId:null}}))return!1;const m=t.upload;return m&&m(n).then(p=>{const{doc:h}=l.state;let y=null;h.descendants((x,k)=>{if(x.type.name===e&&x.attrs.uploading===!0&&x.attrs.src===c)return y=k,!1}),y!==null&&l.view.dispatch(l.state.tr.setNodeMarkup(y,void 0,{...l.state.doc.nodeAt(y).attrs,src:p.cdnUrl,imageId:p.imageId,uploading:!1})),URL.revokeObjectURL(c)}).catch(p=>{console.error("Image upload failed",p);const{doc:h}=l.state;let y=null;if(h.descendants((x,k)=>{if(x.type.name===e&&x.attrs.uploading===!0&&x.attrs.src===c)return y=k,!1}),y!==null){const x=l.state.doc.nodeAt(y);x&&l.view.dispatch(l.state.tr.delete(y,y+x.nodeSize))}URL.revokeObjectURL(c)}),!0},updateImage:n=>({commands:o})=>o.updateAttributes(this.name,n),setAlignImage:n=>({commands:o})=>o.updateAttributes(this.name,{align:n})}},renderHTML({HTMLAttributes:e}){const{flipX:t,flipY:r,align:n,inline:o}=e,s=o&&(n==="left"||n==="right"),l=t||r?`transform: rotateX(${t?"180":"0"}deg) rotateY(${r?"180":"0"}deg);`:"",a=s?"":`text-align: ${n};`,m=`${s?`float: ${n};`:""}${s?n==="left"?"margin: 1em 1em 1em 0;":"margin: 1em 0 1em 1em;":""}${l}`;return[o?"span":"div",{style:a,class:"image"},["img",V.mergeAttributes({height:"auto",style:m},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span.image img",getAttrs:e=>{var s;const t=e==null?void 0:e.parentElement,r=e==null?void 0:e.getAttribute("width"),n=(e==null?void 0:e.getAttribute("flipx"))||!1,o=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||((s=t==null?void 0:t.style)==null?void 0:s.textAlign)||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:n==="true",flipY:o==="true"}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width"),n=(t==null?void 0:t.getAttribute("flipx"))||!1,o=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:n==="true",flipY:o==="true"}}},{tag:'img[src]:not([src^="data:"])'}]}});function $t({editor:e,imageInline:t,onClose:r,disabled:n,alt:o}){var B,A;const{t:s}=$.useLocale(),{toast:l}=Re(),[a,c]=b.useState(!1),[d,m]=b.useState(!1),p=b.useRef(null),[h,y]=b.useState(),[x,k]=b.useState(""),f=b.useRef(null),[v,g]=b.useState({src:"",file:null}),S=oe(we.name),w=b.useMemo(()=>(S==null?void 0:S.options)??{},[S]);function I(j){if(p.current&&j.width&&j.height){const M=C(p.current,j);k(M)}}function C(j,M){const E=document.createElement("canvas"),_=j.naturalWidth/j.width,O=j.naturalHeight/j.height;E.width=M.width*_,E.height=M.height*O;const L=E.getContext("2d");return L&&(L.imageSmoothingEnabled=!1,L.drawImage(j,M.x*_,M.y*O,M.width*_,M.height*O,0,0,M.width*_,M.height*O)),E.toDataURL("image/png",1)}const N=b.useCallback(()=>{var M;if(d)return;const j=Et(x,((M=v==null?void 0:v.file)==null?void 0:M.name)||"image.png");if(c(!1),g({src:"",file:null}),P(),r(),w.upload)e.chain().focus().insertImagePlaceholder({file:j,inline:t,alt:o}).run();else{const E=URL.createObjectURL(j);e.chain().focus().setImageInline({src:E,inline:t,alt:o}).run()}},[x,e,t,d,r,(B=v==null?void 0:v.file)==null?void 0:B.name,w,o]);function R(j){var M;j.preventDefault(),(M=f.current)==null||M.click()}const H=async j=>{var L;const M=(L=j==null?void 0:j.target)==null?void 0:L.files;if(!e||e.isDestroyed||M.length===0){j.target.value="";return}const E=nt(M,{acceptMimes:w==null?void 0:w.acceptMimes,maxSize:w==null?void 0:w.maxSize,t:s,toast:l,onError:w.onError});if(E.length<=0){j.target.value="";return}const _=E[0],O=await bi(_);c(!0),g({src:O.src,file:_})},P=()=>{f.current&&(f.current.value="")};return i.jsxs(i.Fragment,{children:[i.jsx(W,{className:"richtext-mt-1 richtext-w-full",disabled:n,onClick:R,size:"sm",children:s("editor.image.dialog.tab.uploadCrop")}),i.jsxs(de,{open:a,onOpenChange:j=>{c(j),j||(g({src:"",file:null}),P())},children:[i.jsx(De,{}),i.jsxs(ie,{children:[i.jsx(ne,{children:s("editor.image.dialog.tab.uploadCrop")}),i.jsx("div",{children:v.src&&i.jsx(Zt,{className:"richtext-w-full",crop:h,onChange:j=>y(j),onComplete:j=>I(j),children:i.jsx("img",{alt:"Crop me",ref:p,src:v.src})})}),i.jsxs(tt,{children:[i.jsxs(W,{disabled:d,onClick:()=>{c(!1),g({src:"",file:null}),P()},children:[s("editor.imageUpload.cancel"),i.jsx(Me,{className:"richtext-ml-1",name:"Trash2"})]}),i.jsx(W,{className:"richtext-w-fit",disabled:d||!h,onClick:N,children:d?i.jsxs(i.Fragment,{children:[s("editor.imageUpload.uploading"),i.jsx(Me,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):i.jsxs(i.Fragment,{children:[s("editor.imageUpload.crop"),i.jsx(Me,{className:"richtext-ml-1",name:"Crop"})]})})]})]})]}),i.jsx("input",{accept:((A=w==null?void 0:w.acceptMimes)==null?void 0:A.join(","))||"image/*",multiple:!1,onChange:H,ref:f,style:{display:"none"},type:"file"})]})}function Sn(){const{t:e}=$.useLocale(),{toast:t}=Re(),r=Y(),{editorDisabled:n}=ue(),[o,s]=b.useState(!1),l=Ce.UPLOAD_IMAGE(r.id);Ve(s,[l]);const a=oe(we.name),[c,d]=b.useState(""),[m,p]=b.useState(""),h=b.useRef(null),y=(a==null?void 0:a.options.defaultInline)||!1,[x,k]=b.useState(y),f=b.useMemo(()=>a==null?void 0:a.options,[a]);function v(w){var H;const I=(H=w==null?void 0:w.target)==null?void 0:H.files;if(!r||r.isDestroyed||I.length===0){w.target.value="";return}const C=nt(I,{acceptMimes:f==null?void 0:f.acceptMimes,maxSize:f==null?void 0:f.maxSize,t:e,toast:t,onError:f.onError});if(C.length<=0){w.target.value="";return}s(!1);const N=m,R=x;if(p(""),k(y),f.upload){const P=f!=null&&f.multiple?C:[C[0]];for(const B of P)r.chain().focus().insertImagePlaceholder({file:B,inline:R,alt:N}).run()}else{const P=f!=null&&f.multiple?C:[C[0]];for(const B of P){const A=URL.createObjectURL(B);r.chain().focus().setImageInline({src:A,inline:R,alt:N}).run()}}w.target.value=""}function g(w){w.preventDefault(),w.stopPropagation(),r.chain().focus().setImageInline({src:c,inline:x,alt:m}).run(),s(!1),k(y),d(""),p("")}function S(w){var I;w.preventDefault(),(I=h.current)==null||I.click()}return n?i.jsx(i.Fragment,{}):i.jsx(de,{onOpenChange:s,open:o,children:i.jsxs(ie,{children:[i.jsx(ne,{children:e("editor.image.dialog.title")}),i.jsxs(Ee,{activationMode:"manual",defaultValue:f.resourceImage==="both"||f.resourceImage==="upload"?"upload":"link",children:[f.resourceImage==="both"&&i.jsxs(je,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[i.jsx(J,{value:"upload",children:e("editor.image.dialog.tab.upload")}),i.jsx(J,{value:"link",children:e("editor.image.dialog.tab.url")})]}),i.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[i.jsx(_e,{checked:x,onCheckedChange:w=>{k(w)}}),i.jsx(fe,{children:e("editor.link.dialog.inline")})]}),f.enableAlt&&i.jsxs("div",{className:"richtext-my-[10px]",children:[i.jsx(fe,{className:"mb-[6px]",children:e("editor.imageUpload.alt")}),i.jsx(re,{onChange:w=>p(w.target.value),required:!0,type:"text",value:m})]}),i.jsxs(Q,{value:"upload",children:[i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(W,{className:"richtext-mt-1 richtext-w-full",onClick:S,size:"sm",children:e("editor.image.dialog.tab.upload")}),i.jsx($t,{alt:m,disabled:!1,editor:r,imageInline:x,onClose:()=>{p("")}})]}),i.jsx("input",{accept:f.acceptMimes.join(",")||"image/*",multiple:f.multiple,onChange:v,ref:h,style:{display:"none"},type:"file"})]}),i.jsx(Q,{value:"link",children:i.jsx("form",{onSubmit:g,children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(re,{autoFocus:!0,onChange:w=>d(w.target.value),placeholder:e("editor.image.dialog.placeholder"),required:!0,type:"url",value:c}),i.jsx(W,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})})}function Wt(e,t){let r;try{r=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const o=n.replace(/\./g,String.raw`\.`).replace(/\*/g,".*");return new RegExp(`^${o}$`).test(r.hostname)}return r.hostname.includes(n)})}function An(){const{t:e}=$.useLocale(),t=Y(),r=He(Ne.name),{icon:n,tooltip:o}=(r==null?void 0:r.componentProps)??{},{editorDisabled:s}=ue(),[l,a]=b.useState(""),c=b.useRef(null),[d,m]=b.useState(""),[p,h]=b.useState(!1),y=oe(Ne.name),x=b.useMemo(()=>(y==null?void 0:y.options)??{},[y]);async function k(g){var C;const S=(C=g==null?void 0:g.target)==null?void 0:C.files;if(!t||t.isDestroyed||S.length===0)return;const w=S[0];let I="";x.upload?I=await x.upload(w):I=URL.createObjectURL(w),t.chain().focus().setVideo({src:I,width:"100%"}).run(),h(!1)}function f(g){g.preventDefault(),g.stopPropagation(),l&&(t.chain().focus().setVideo({src:l,width:"100%"}).run(),h(!1),a(""))}function v(g){var S;g.preventDefault(),(S=c.current)==null||S.click()}return i.jsxs(de,{onOpenChange:h,open:p,children:[i.jsx(De,{asChild:!0,children:i.jsx(ae,{disabled:s,icon:n,tooltip:o,action:()=>{s||h(!0)}})}),i.jsxs(ie,{children:[i.jsx(ne,{children:e("editor.video.dialog.title")}),i.jsxs(Ee,{activationMode:"manual",defaultValue:(x==null?void 0:x.resourceVideo)==="both"||(x==null?void 0:x.resourceVideo)==="upload"?"upload":"link",children:[i.jsxs(je,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((x==null?void 0:x.resourceVideo)==="both"||(x==null?void 0:x.resourceVideo)==="upload")&&i.jsx(J,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((x==null?void 0:x.resourceVideo)==="both"||(x==null?void 0:x.resourceVideo)==="link")&&i.jsx(J,{value:"link",children:e("editor.video.dialog.link")})]}),i.jsxs(Q,{value:"upload",children:[i.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:i.jsx(W,{className:"richtext-mt-1 richtext-w-full",onClick:v,size:"sm",children:e("editor.video.dialog.tab.upload")})}),i.jsx("input",{accept:"video/*",multiple:!0,onChange:k,ref:c,type:"file",style:{display:"none"}})]}),i.jsxs(Q,{value:"link",children:[i.jsx("div",{children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(re,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:l,onBlur:g=>{const S=g.target.value,w=x.videoProviders||["."];S&&!Wt(S,w)?m("Invalid video URL"):m("")},onChange:g=>{a(g.target.value)}}),i.jsx(W,{onClick:f,type:"button",children:e("editor.video.dialog.button.apply")})]})}),d&&i.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:d})]})]})]})]})}function Ln(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const r=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(r){const o=r[1],s=r[2];s?e=`https://player.vimeo.com/video/${o}?h=${s}`:e=`https://player.vimeo.com/video/${o}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const Ne=V.Node3.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:$.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var r,n;return{componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(r=e.can()).setVideo)!=null&&n.call(r,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?Ln(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:Ui(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:r="center"}=e??{},n={...e,width:"100%",height:"100%"},o=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,s=`flex: 1;padding-bottom: ${9/16*100}%;`,m=["div",{style:`display: flex; justify-content: ${r};`},["div",{style:o},["div",{style:s}],["iframe",n]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},m]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});function In(){const{t:e}=$.useLocale(),t=Y(),{editorDisabled:r}=ue(),[n,o]=b.useState(""),s=b.useRef(null),[l,a]=b.useState(""),[c,d]=b.useState(!1),m=oe(Ne.name),p=Ce.UPLOAD_VIDEO(t.id);Ve(d,[p]);const h=b.useMemo(()=>(m==null?void 0:m.options)??{},[m]);async function y(f){var w;const v=(w=f==null?void 0:f.target)==null?void 0:w.files;if(!t||t.isDestroyed||v.length===0)return;const g=v[0];let S="";h.upload?S=await h.upload(g):S=URL.createObjectURL(g),t.chain().focus().setVideo({src:S,width:"100%"}).run(),d(!1)}function x(f){f.preventDefault(),f.stopPropagation(),n&&(t.chain().focus().setVideo({src:n,width:"100%"}).run(),d(!1),o(""))}function k(f){var v;f.preventDefault(),(v=s.current)==null||v.click()}return r?i.jsx(i.Fragment,{}):i.jsx(de,{onOpenChange:d,open:c,children:i.jsxs(ie,{children:[i.jsx(ne,{children:e("editor.video.dialog.title")}),i.jsxs(Ee,{activationMode:"manual",defaultValue:(h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="upload"?"upload":"link",children:[i.jsxs(je,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="upload")&&i.jsx(J,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="link")&&i.jsx(J,{value:"link",children:e("editor.video.dialog.link")})]}),i.jsxs(Q,{value:"upload",children:[i.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:i.jsx(W,{className:"richtext-mt-1 richtext-w-full",onClick:k,size:"sm",children:e("editor.video.dialog.tab.upload")})}),i.jsx("input",{accept:"video/*",multiple:!0,onChange:y,ref:s,type:"file",style:{display:"none"}})]}),i.jsxs(Q,{value:"link",children:[i.jsx("div",{children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(re,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:n,onBlur:f=>{const v=f.target.value,g=h.videoProviders||["."];v&&!Wt(v,g)?a("Invalid video URL"):a("")},onChange:f=>{o(f.target.value)}}),i.jsx(W,{onClick:x,type:"button",children:e("editor.video.dialog.button.apply")})]})}),l&&i.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:l})]})]})]})})}function Gt(){return i.jsxs(i.Fragment,{children:[i.jsx(Sn,{}),i.jsx(In,{}),i.jsx(Gi,{})]})}process.env.NODE_ENV!=="production"&&(Gt.displayName="SlashDialogTrigger");exports.ActionButton=ae;exports.Attachment=it;exports.Button=W;exports.Checkbox=_e;exports.Dialog=de;exports.DialogContent=ie;exports.DialogFooter=tt;exports.DialogHeader=Nt;exports.DialogTitle=ne;exports.DialogTrigger=De;exports.EVENTS=Ce;exports.IconComponent=Me;exports.Image=we;exports.Input=re;exports.Label=fe;exports.MenuDown=Ct;exports.ReactBusProvider=ui;exports.RichTextAttachment=Wi;exports.RichTextImage=Tn;exports.RichTextVideo=An;exports.SlashDialogTrigger=Gt;exports.Toggle=Je;exports.Tooltip=Mt;exports.TooltipContent=Qe;exports.TooltipProvider=ii;exports.TooltipTrigger=St;exports.Video=Ne;exports.clamp=Hi;exports.clamp$1=Ut;exports.cn=D;exports.cva=ze;exports.dataURLtoFile=Et;exports.debounce=Ft;exports.emit=Lt;exports.ensureNameValueOptions=$i;exports.getDatasetAttribute=se;exports.getShortcutKey=yt;exports.getShortcutKeys=jt;exports.hasExtension=Fi;exports.icons=Ke;exports.index_default=Dt;exports.isNumber=Xe;exports.nodeAttrsToDataset=Ri;exports.throttle=qe;exports.useActive=Di;exports.useButtonProps=He;exports.useEditableEditor=rt;exports.useEditorInstance=Y;exports.useExtension=oe;exports.useListener=Ve;exports.useStoreEditableEditor=Vi;exports.useToast=Re;exports.useToggleActive=ue;
|