asma-ui-richeditor 0.1.9 → 0.1.10
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.
|
@@ -53,4 +53,4 @@ import e,{forwardRef as t,useRef as n,useState as r,useDebugValue as o,useEffect
|
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the MIT license found in the
|
|
55
55
|
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/"production"===process.env.NODE_ENV?Ta.exports=function(){if(Ca)return Na;Ca=1;var t=e,n=va,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Na.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&u.hasValue){var t=u.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?t:(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,n,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},Na}():Ta.exports=(Aa||(Aa=1,"production"!==process.env.NODE_ENV&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=e,n=va,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;Da.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h,u=i(null);null===u.current?(h={hasValue:!1,value:null},u.current=h):h=u.current;var p=a((function(){var e,o,i=!1,s=function(t){if(!i){i=!0,e=t;var n=c(t);if(void 0!==d&&h.hasValue){var s=h.value;if(d(s,n))return o=s,s}return o=n,n}var a=o;if(r(e,t))return a;var l=c(t);return void 0!==d&&d(a,l)?a:(e=t,o=l,l)},a=void 0===n?null:n;return[function(){return s(t())},null===a?void 0:function(){return s(a())}]}),[t,n,c,d]),f=p[0],m=p[1],g=o(e,f,m);return s((function(){h.hasValue=!0,h.value=g}),[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Da);var Ra=Ta.exports;const Ia=typeof window<"u"?l:i;class Pa{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}}const La="production"!==process.env.NODE_ENV,ja=typeof window>"u",za=ja||!!(typeof window<"u"&&window.next);class $a{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((e=>e()))}getInitialEditor(){if(void 0===this.options.current.immediatelyRender)return ja||za?(La&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&ja&&La)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onBeforeCreate)||void 0===n?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null===(n=(t=this.options.current).onBlur)||void 0===n?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onCreate)||void 0===n?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null===(n=(t=this.options.current).onDestroy)||void 0===n?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null===(n=(t=this.options.current).onFocus)||void 0===n?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onSelectionUpdate)||void 0===n?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null===(n=(t=this.options.current).onTransaction)||void 0===n?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onUpdate)||void 0===n?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null===(n=(t=this.options.current).onContentError)||void 0===n?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null===(n=(t=this.options.current).onDrop)||void 0===n?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null===(n=(t=this.options.current).onPaste)||void 0===n?void 0:n.call(t,...e)}};return new la(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null===(r=t.extensions)||void 0===r?void 0:r[n])})):e[n]===t[n])))}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===e.length?$a.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}}function Ba(e={},t=[]){const s=n(e);s.current=e;const[a]=r((()=>new $a(s))),l=va.useSyncExternalStore(a.subscribe,a.getEditor,a.getServerSnapshot);return o(l),i(a.onRender(t)),function(e){var t;const[n]=r((()=>new Pa(e.editor))),i=Ra.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!==(t=e.equalityFn)&&void 0!==t?t:Ea);Ia((()=>n.watch(e.editor)),[e.editor,n]),o(i)}({editor:l,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),l}s({editor:null}).Consumer;const _a=s({onDragStart:void 0});e.forwardRef(((t,n)=>{const{onDragStart:r}=a(_a),o=t.as||"div";return e.createElement(o,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})}));const Fa=Object.freeze({left:0,top:0,width:16,height:16}),Va=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ha=Object.freeze({...Fa,...Va}),Wa=Object.freeze({...Ha,body:"",hidden:!1});function Ka(e,t){const n=function(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}(e,t);for(const r in Wa)r in Va?r in e&&!(r in n)&&(n[r]=Va[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function qa(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let i={};function s(e){i=Ka(r[e]||o[e],i)}return s(t),n.forEach(s),Ka(e,i)}function Ja(e,t){const n=[];if("object"!=typeof e||"object"!=typeof e.icons)return n;e.not_found instanceof Array&&e.not_found.forEach((e=>{t(e,null),n.push(e)}));const r=function(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);return(t||Object.keys(n).concat(Object.keys(r))).forEach((function e(t){if(n[t])return o[t]=[];if(!(t in o)){o[t]=null;const n=r[t]&&r[t].parent,i=n&&e(n);i&&(o[t]=[n].concat(i))}return o[t]})),o}(e);for(const o in r){const i=r[o];i&&(t(o,qa(e,o,i)),n.push(o))}return n}const Ua=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ga=(e,t,n,r="")=>{const o=e.split(":");if("@"===e.slice(0,1)){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const e=o.pop(),n=o.pop(),i={provider:o.length>0?o[0]:r,prefix:n,name:e};return t&&!Ya(i)?null:i}const i=o[0],s=i.split("-");if(s.length>1){const e={provider:r,prefix:s.shift(),name:s.join("-")};return t&&!Ya(e)?null:e}if(n&&""===r){const e={provider:r,prefix:"",name:i};return t&&!Ya(e,n)?null:e}return null},Ya=(e,t)=>!!e&&!(""!==e.provider&&!e.provider.match(Ua)||!(t&&""===e.prefix||e.prefix.match(Ua))||!e.name.match(Ua)),Qa={provider:"",aliases:{},not_found:{},...Fa};function Xa(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Za(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons||!Xa(e,Qa))return null;const n=t.icons;for(const e in n){const t=n[e];if(!e.match(Ua)||"string"!=typeof t.body||!Xa(t,Wa))return null}const r=t.aliases||Object.create(null);for(const e in r){const t=r[e],o=t.parent;if(!e.match(Ua)||"string"!=typeof o||!n[o]&&!r[o]||!Xa(t,Wa))return null}return t}const el=Object.create(null);function tl(e,t){const n=el[e]||(el[e]=Object.create(null));return n[t]||(n[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function nl(e,t){return Za(t)?Ja(t,((t,n)=>{n?e.icons[t]=n:e.missing.add(t)})):[]}let rl=!1;function ol(e){return"boolean"==typeof e&&(rl=e),rl}function il(e){const t="string"==typeof e?Ga(e,!0,rl):e;if(t){const e=tl(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function sl(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),rl&&!t&&!e.prefix){let t=!1;return Za(e)&&(e.prefix="",Ja(e,((e,n)=>{n&&function(e,t){const n=Ga(e,!0,rl);return!!n&&function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]={...n},!0}catch{}return!1}(tl(n.provider,n.prefix),n.name,t)}(e,n)&&(t=!0)}))),t}const n=e.prefix;if(!Ya({provider:t,prefix:n,name:"a"}))return!1;return!!nl(tl(t,n),e)}const al=Object.freeze({width:null,height:null}),ll=Object.freeze({...al,...Va}),cl=/(-?[0-9.]*[0-9]+[0-9.]*)/g,dl=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function hl(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const r=e.split(cl);if(null===r||!r.length)return e;const o=[];let i=r.shift(),s=dl.test(i);for(;;){if(s){const e=parseFloat(i);isNaN(e)?o.push(i):o.push(Math.ceil(e*t*n)/n)}else o.push(i);if(i=r.shift(),void 0===i)return o.join("");s=!s}}const ul=/\sid="(\S+)"/g,pl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let fl=0;function ml(e,t=pl){const n=[];let r;for(;r=ul.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach((n=>{const r="function"==typeof t?t(n):t+(fl++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+r+o+"$3")})),e=e.replace(new RegExp(o,"g"),"")}const gl=Object.create(null);function yl(e){return gl[e]||gl[""]}function bl(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const vl=Object.create(null),wl=["https://api.simplesvg.com","https://api.unisvg.com"],kl=[];for(;wl.length>0;)1===wl.length||Math.random()>.5?kl.push(wl.shift()):kl.push(wl.pop());function xl(e,t){const n=bl(t);return null!==n&&(vl[e]=n,!0)}function Sl(e){return vl[e]}vl[""]=bl({resources:["https://api.iconify.design"].concat(kl)});let Ol=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch{}})();const Cl={prepare:(e,t,n)=>{const r=[],o=function(e,t){const n=Sl(e);if(!n)return 0;let r;if(n.maxURL){let e=0;n.resources.forEach((t=>{e=Math.max(e,t.length)}));const o=t+".json?icons=";r=n.maxURL-e-n.path.length-o.length}else r=0;return r}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},a=0;return n.forEach(((n,l)=>{a+=n.length+1,a>=o&&l>0&&(r.push(s),s={type:i,provider:e,prefix:t,icons:[]},a=n.length),s.icons.push(n)})),r.push(s),r},send:(e,t,n)=>{if(!Ol)return void n("abort",424);let r=function(e){if("string"==typeof e){const t=Sl(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,n=t.icons.join(",");r+=e+".json?"+new URLSearchParams({icons:n}).toString();break}case"custom":{const e=t.uri;r+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void n("abort",400)}let o=503;Ol(e+r).then((e=>{const t=e.status;if(200===t)return o=501,e.json();setTimeout((()=>{n(function(e){return 404===e}(t)?"abort":"next",t)}))})).then((e=>{"object"==typeof e&&null!==e?setTimeout((()=>{n("success",e)})):setTimeout((()=>{404===e?n("abort",e):n("next",o)}))})).catch((()=>{n("next",o)}))}};function Ml(e,t){e.forEach((e=>{const n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter((e=>e.id!==t)))}))}let El=0;var Tl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Nl(e,t,n,r){const o=e.resources.length,i=e.random?Math.floor(Math.random()*o):e.index;let s;if(e.random){let t=e.resources.slice(0);for(s=[];t.length>1;){const e=Math.floor(Math.random()*t.length);s.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}s=s.concat(t)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let l,c="pending",d=0,h=null,u=[],p=[];function f(){h&&(clearTimeout(h),h=null)}function m(){"pending"===c&&(c="aborted"),f(),u.forEach((e=>{"pending"===e.status&&(e.status="aborted")})),u=[]}function g(e,t){t&&(p=[]),"function"==typeof e&&p.push(e)}function y(){c="failed",p.forEach((e=>{e(void 0,l)}))}function b(){u.forEach((e=>{"pending"===e.status&&(e.status="aborted")})),u=[]}function v(){if("pending"!==c)return;f();const r=s.shift();if(void 0===r)return u.length?void(h=setTimeout((()=>{f(),"pending"===c&&(b(),y())}),e.timeout)):void y();const o={status:"pending",resource:r,callback:(t,n)=>{!function(t,n,r){const o="success"!==n;switch(u=u.filter((e=>e!==t)),c){case"pending":break;case"failed":if(o||!e.dataAfterTimeout)return;break;default:return}if("abort"===n)return l=r,void y();if(o)return l=r,void(u.length||(s.length?v():y()));if(f(),b(),!e.random){const n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}c="completed",p.forEach((e=>{e(r)}))}(o,t,n)}};u.push(o),d++,h=setTimeout(v,e.rotate),n(r,t,o.callback)}return"function"==typeof r&&p.push(r),setTimeout(v),function(){return{startTime:a,payload:t,status:c,queriesSent:d,queriesPending:u.length,subscribe:g,abort:m}}}function Al(e){const t={...Tl,...e};let n=[];function r(){n=n.filter((e=>"pending"===e().status))}return{query:function(e,o,i){const s=Nl(t,e,o,((e,t)=>{r(),i&&i(e,t)}));return n.push(s),s},find:function(e){return n.find((t=>e(t)))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Dl(){}const Rl=Object.create(null);function Il(e,t,n){let r,o;if("string"==typeof e){const t=yl(e);if(!t)return n(void 0,424),Dl;o=t.send;const i=function(e){if(!Rl[e]){const t=Sl(e);if(!t)return;const n={config:t,redundancy:Al(t)};Rl[e]=n}return Rl[e]}(e);i&&(r=i.redundancy)}else{const t=bl(e);if(t){r=Al(t);const n=yl(e.resources?e.resources[0]:"");n&&(o=n.send)}}return r&&o?r.query(t,o,n)().abort:(n(void 0,424),Dl)}const Pl="iconify2",Ll="iconify",jl=Ll+"-count",zl=Ll+"-version",$l=36e5,Bl=168,_l=50;function Fl(e,t){try{return e.getItem(t)}catch{}}function Vl(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Hl(e,t){try{e.removeItem(t)}catch{}}function Wl(e,t){return Vl(e,jl,t.toString())}function Kl(e){return parseInt(Fl(e,jl))||0}const ql={local:!0,session:!0},Jl={local:new Set,session:new Set};let Ul=!1;let Gl=typeof window>"u"?{}:window;function Yl(e){const t=e+"Storage";try{if(Gl&&Gl[t]&&"number"==typeof Gl[t].length)return Gl[t]}catch{}ql[e]=!1}function Ql(e,t){const n=Yl(e);if(!n)return;const r=Fl(n,zl);if(r!==Pl){if(r){const e=Kl(n);for(let t=0;t<e;t++)Hl(n,Ll+t.toString())}return Vl(n,zl,Pl),void Wl(n,0)}const o=Math.floor(Date.now()/$l)-Bl,i=e=>{const r=Ll+e.toString(),i=Fl(n,r);if("string"==typeof i){try{const n=JSON.parse(i);if("object"==typeof n&&"number"==typeof n.cached&&n.cached>o&&"string"==typeof n.provider&&"object"==typeof n.data&&"string"==typeof n.data.prefix&&t(n,e))return!0}catch{}Hl(n,r)}};let s=Kl(n);for(let t=s-1;t>=0;t--)i(t)||(t===s-1?(s--,Wl(n,s)):Jl[e].add(t))}function Xl(){if(!Ul){Ul=!0;for(const e in ql)Ql(e,(e=>{const t=e.data,n=tl(e.provider,t.prefix);if(!nl(n,t).length)return!1;const r=t.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,r):r,!0}))}}function Zl(e,t){function n(n){let r;if(!ql[n]||!(r=Yl(n)))return;const o=Jl[n];let i;if(o.size)o.delete(i=Array.from(o).shift());else if(i=Kl(r),i>=_l||!Wl(r,i+1))return;const s={cached:Math.floor(Date.now()/$l),provider:e.provider,data:t};return Vl(r,Ll+i.toString(),JSON.stringify(s))}Ul||Xl(),t.lastModified&&!function(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const n in ql)Ql(n,(n=>{const r=n.data;return n.provider!==e.provider||r.prefix!==e.prefix||r.lastModified===t}));return!0}(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&delete(t=Object.assign({},t)).not_found,n("local")||n("session"))}function ec(){}function tc(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout((()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout((()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach((t=>{const i=t.icons,s=i.pending.length;i.pending=i.pending.filter((t=>{if(t.prefix!==o)return!0;const s=t.name;if(e.icons[s])i.loaded.push({provider:r,prefix:o,name:s});else{if(!e.missing.has(s))return n=!0,!0;i.missing.push({provider:r,prefix:o,name:s})}return!1})),i.pending.length!==s&&(n||Ml([e],t.id),t.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),t.abort))}))})))}(e)})))}const nc=(e,t)=>{const n=function(e,t=!0,n=!1){const r=[];return e.forEach((e=>{const o="string"==typeof e?Ga(e,t,n):e;o&&r.push(o)})),r}(e,!0,ol()),r=function(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort(((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name)));let r={provider:"",prefix:"",name:""};return e.forEach((e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;const o=e.provider,i=e.prefix,s=e.name,a=n[o]||(n[o]=Object.create(null)),l=a[i]||(a[i]=tl(o,i));let c;c=s in l.icons?t.loaded:""===i||l.missing.has(s)?t.missing:t.pending;const d={provider:o,prefix:i,name:s};c.push(d)})),t}(n);if(!r.pending.length){let e=!0;return t&&setTimeout((()=>{e&&t(r.loaded,r.missing,r.pending,ec)})),()=>{e=!1}}const o=Object.create(null),i=[];let s,a;return r.pending.forEach((e=>{const{provider:t,prefix:n}=e;if(n===a&&t===s)return;s=t,a=n,i.push(tl(t,n));const r=o[t]||(o[t]=Object.create(null));r[n]||(r[n]=[])})),r.pending.forEach((e=>{const{provider:t,prefix:n,name:r}=e,i=tl(t,n),s=i.pendingIcons||(i.pendingIcons=new Set);s.has(r)||(s.add(r),o[t][n].push(r))})),i.forEach((e=>{const{provider:t,prefix:n}=e;o[t][n].length&&function(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout((()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:n}=e,r=e.iconsToLoad;let o;delete e.iconsToLoad,r&&(o=yl(t))&&o.prepare(t,n,r).forEach((n=>{Il(t,n,(t=>{if("object"!=typeof t)n.icons.forEach((t=>{e.missing.add(t)}));else try{const n=nl(e,t);if(!n.length)return;const r=e.pendingIcons;r&&n.forEach((e=>{r.delete(e)})),Zl(e,t)}catch(e){console.error(e)}tc(e)}))}))})))}(e,o[t][n])})),t?function(e,t,n){const r=El++,o=Ml.bind(null,n,r);if(!t.pending.length)return o;const i={id:r,icons:t,callback:e,abort:o};return n.forEach((e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(i)})),o}(t,r,i):ec};const rc=/[\s,]+/;function oc(e,t){t.split(rc).forEach((t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}}))}function ic(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(e){for(;e<0;)e+=4;return e%4}if(""===n){const t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o/=t,o%1==0?r(o):0)}}return t}function sc(e){return'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(e)+'")'}let ac;function lc(e){return void 0===ac&&function(){try{ac=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ac=null}}(),ac?ac.createHTML(e):e}const cc={...ll,inline:!1},dc={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},hc={display:"inline-block"},uc={backgroundColor:"currentColor"},pc={backgroundColor:"transparent"},fc={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},mc={WebkitMask:uc,mask:uc,background:pc};for(const e in mc){const t=mc[e];for(const n in fc)t[e+n]=fc[n]}const gc={...cc,inline:!0};function yc(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const bc=(e,t,n)=>{const r=t.inline?gc:cc,o=function(e,t){const n={...e};for(const e in t){const r=t[e],o=typeof r;e in al?(null===r||r&&("string"===o||"number"===o))&&(n[e]=r):o===typeof n[e]&&(n[e]="rotate"===e?r%4:r)}return n}(r,t),i=t.mode||"svg",s={},a=t.style||{},l={..."svg"===i?dc:{}};if(n){const e=Ga(n,!1,!0);if(e){const t=["iconify"],n=["provider","prefix"];for(const r of n)e[r]&&t.push("iconify--"+e[r]);l.className=t.join(" ")}}for(let e in t){const n=t[e];if(void 0!==n)switch(e){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":l.ref=n;break;case"className":l[e]=(l[e]?l[e]+" ":"")+n;break;case"inline":case"hFlip":case"vFlip":o[e]=!0===n||"true"===n||1===n;break;case"flip":"string"==typeof n&&oc(o,n);break;case"color":s.color=n;break;case"rotate":"string"==typeof n?o[e]=ic(n):"number"==typeof n&&(o[e]=n);break;case"ariaHidden":case"aria-hidden":!0!==n&&"true"!==n&&delete l["aria-hidden"];break;default:void 0===r[e]&&(l[e]=n)}}const d=function(e,t){const n={...Ha,...e},r={...ll,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach((e=>{const t=[],n=e.hFlip,r=e.vFlip;let s,a=e.rotate;switch(n?r?a+=2:(t.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),t.push("scale(-1 1)"),o.top=o.left=0):r&&(t.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),t.push("scale(1 -1)"),o.top=o.left=0),a<0&&(a-=4*Math.floor(a/4)),a%=4,a){case 1:s=o.height/2+o.top,t.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:t.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:s=o.width/2+o.left,t.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}a%2==1&&(o.left!==o.top&&(s=o.left,o.left=o.top,o.top=s),o.width!==o.height&&(s=o.width,o.width=o.height,o.height=s)),t.length&&(i=function(e,t,n){const r=function(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const o=e.indexOf(">",r),i=e.indexOf("</"+t);if(-1===o||-1===i)break;const s=e.indexOf(">",i);if(-1===s)break;n+=e.slice(o+1,i).trim(),e=e.slice(0,r).trim()+e.slice(s+1)}return{defs:n,content:e}}(e);return function(e,t){return e?"<defs>"+e+"</defs>"+t:t}(r.defs,t+r.content+n)}(i,'<g transform="'+t.join(" ")+'">',"</g>"))}));const s=r.width,a=r.height,l=o.width,c=o.height;let d,h;null===s?(h=null===a?"1em":"auto"===a?c:a,d=hl(h,l/c)):(d="auto"===s?l:s,h=null===a?hl(d,c/l):"auto"===a?c:a);const u={},p=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(u[e]=t.toString())};p("width",d),p("height",h);const f=[o.left,o.top,l,c];return u.viewBox=f.join(" "),{attributes:u,viewBox:f,body:i}}(e,o),h=d.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===i){l.style={...s,...a},Object.assign(l,h);let e=0,n=t.id;return"string"==typeof n&&(n=n.replace(/-/g,"_")),l.dangerouslySetInnerHTML={__html:lc(ml(d.body,n?()=>n+"ID"+e++:"iconifyReact"))},c("svg",l)}const{body:u,width:p,height:f}=e,m="mask"===i||"bg"!==i&&-1!==u.indexOf("currentColor"),g=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in t)n+=" "+e+'="'+t[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}(u,{...h,width:p+"",height:f+""});return l.style={...s,"--svg":sc(g),width:yc(h.width),height:yc(h.height),...hc,...m?uc:pc,...a},c("span",l)};var vc;if(ol(!0),vc=Cl,gl[""]=vc,typeof document<"u"&&typeof window<"u"){Xl();const e=window;if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach((e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!sl(e))&&console.error(n)}catch{console.error(n)}}))}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){const n="IconifyProviders["+e+"] is invalid.";try{const r=t[e];if("object"!=typeof r||!r||void 0===r.resources)continue;xl(e,r)||console.error(n)}catch{console.error(n)}}}}function wc(e){const[t,n]=r(!!e.ssr),[o,s]=r({});const[a,l]=r(function(t){if(t){const t=e.icon;if("object"==typeof t)return{name:"",data:t};const n=il(t);if(n)return{name:t,data:n}}return{name:""}}(!!e.ssr));function d(){const e=o.callback;e&&(e(),s({}))}function h(e){if(JSON.stringify(a)!==JSON.stringify(e))return d(),l(e),!0}function u(){var t;const n=e.icon;if("object"==typeof n)return void h({name:"",data:n});const r=il(n);if(h({name:n,data:r}))if(void 0===r){const e=nc([n],u);s({callback:e})}else r&&(null===(t=e.onLoad)||void 0===t||t.call(e,n))}i((()=>(n(!0),d)),[]),i((()=>{t&&u()}),[e.icon,t]);const{name:p,data:f}=a;return f?bc({...Ha,...f},e,p):e.children?e.children:c("span",{})}const kc=t(((e,t)=>wc({...e,_ref:t})));t(((e,t)=>wc({inline:!0,...e,_ref:t})));const xc=e=>T.jsx(f,{...e,sx:{"&.MuiMenuItem-root":{color:"var(--colors-delta-700)",fontSize:"14px",lineHeight:"20px"}},children:e.children}),Sc={small:"10px",normal:"16px",large:"24px",huge:"32px"},Oc=e=>{const{editor:t}=e,[n,o]=r("normal");return l((()=>{const{from:e,to:n}=t.state.selection;t.state.doc.nodesBetween(e-1,n,(e=>{if(e.marks){const t=e.marks.find((e=>"textStyle"===e.type.name)),n=null==t?void 0:t.attrs.fontSize,r=Object.keys(Sc).find((e=>Sc[e]===n))||"normal";o(r)}}))}),[t.state.selection,t.state.doc]),T.jsx(m,{...e,select:!0,size:"small",dataTest:"font-size-select",onChange:e=>{const n=e.target.value;t.chain().focus().setMark("textStyle",{fontSize:Sc[n]}).run(),o(n)},value:n,SelectProps:{IconComponent:()=>null},InputProps:{endAdornment:T.jsx(kc,{icon:"tabler:caret-up-down-filled",className:"chevron-icon"})},sx:{".MuiSelect-select":{border:"none",padding:0,overflow:"hidden",display:"flex",alignItems:"center",color:"var(--colors-delta-700)",fontSize:"14px",lineHeight:"20px"},".MuiOutlinedInput-root":{height:"32px",width:"75px","& .MuiOutlinedInput-notchedOutline":{border:"none"}}},children:e.children})},Cc=({editor:e,onClose:t,error:o,focused:i,openLinkDialog:s,locale:a})=>{const[c,u]=r(0),p=n(null),m=h((()=>"no"===a),[a]),[v,w]=r(!1),[k,S]=r([]);l((()=>{const t=new ResizeObserver((()=>{var t;if(p.current){const n=p.current.clientWidth;w(n<(m?416:420));const r=null==(t=[{width:m?296:300,buttons:3},{width:m?340:342,buttons:4},{width:m?374:378,buttons:5},{width:m?416:420,buttons:6},{width:m?416:420,buttons:7},{width:1/0,buttons:8}].find((e=>n<e.width)))?void 0:t.buttons;u(void 0!==r?r:8);const o=[];Number(r)<8&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:s,selected:e.isActive("link"),children:T.jsx(g,{})},"link")),Number(r)<7&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:()=>e.chain().focus().toggleItalic().run(),selected:e.isActive("italic"),children:T.jsx(kc,{icon:"material-symbols:format-italic",height:20})},"italic")),Number(r)<6&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:()=>e.chain().focus().toggleBold().run(),selected:e.isActive("bold"),children:T.jsx(kc,{icon:"ooui:bold-b"})},"bold")),Number(r)<5&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:()=>e.chain().focus().toggleOrderedList().run(),selected:e.isActive("orderedList"),children:T.jsx(kc,{icon:"mdi:format-list-numbered",fontSize:20})},"ordered")),Number(r)<4&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:()=>e.chain().focus().toggleBulletList().run(),selected:e.isActive("bulletList"),children:T.jsx(kc,{icon:"mdi:format-list-bulleted",fontSize:20})},"bullet")),S(o)}}));return p.current&&t.observe(p.current),()=>t.disconnect()}),[e,s,m]);const{anchorEl:O,open:C,handleClose:M,handleOpen:E}=(()=>{const[e,t]=r(null),n=!!e,o=d((e=>{t(e.currentTarget)}),[]);return{open:n,handleClose:d((()=>{t(null)}),[]),handleOpen:o,anchorEl:e}})();return T.jsx(T.Fragment,{children:T.jsxs("div",{className:A("toolbar",{"toolbar-error":o,"toolbar-focused":i}),ref:p,children:[T.jsxs("div",{className:"flex flex-row items-center gap-1",children:[c>=1&&T.jsx(y,{dataTest:"richeditor-h1-button",size:"small",variant:e.isActive("heading",{level:1})?"text":"textGray",onClick:()=>{e.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),e.chain().focus().toggleHeading({level:1}).run()},children:T.jsx(kc,{icon:"bi:type-h1"})}),c>=2&&T.jsx(y,{dataTest:"richeditor-h2-button",size:"small",variant:e.isActive("heading",{level:2})?"text":"textGray",onClick:()=>{e.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),e.chain().focus().toggleHeading({level:2}).run()},children:T.jsx(kc,{icon:"bi:type-h2"})}),c>=3&&T.jsxs(Oc,{editor:e,children:[T.jsx(xc,{value:"small",children:m?"Liten":"Small"}),T.jsx(xc,{value:"normal",children:"Normal"}),T.jsx(xc,{value:"large",children:m?"Stor":"Large"}),T.jsx(xc,{value:"huge",children:m?"Enorm":"Huge"})]}),c>=4&&T.jsx(y,{dataTest:"richeditor-bullet-list-button",size:"small",variant:e.isActive("bulletList")?"text":"textGray",onClick:()=>e.chain().focus().toggleBulletList().run(),children:T.jsx(kc,{icon:"mdi:format-list-bulleted",fontSize:20})}),c>=5&&T.jsx(y,{dataTest:"richeditor-ordered-list-button",size:"small",variant:e.isActive("orderedList")?"text":"textGray",onClick:()=>e.chain().focus().toggleOrderedList().run(),children:T.jsx(kc,{icon:"mdi:format-list-numbered",fontSize:20})}),c>=6&&T.jsx(y,{dataTest:"richeditor-bold-button",size:"small",variant:e.isActive("bold")?"text":"textGray",onClick:()=>e.chain().focus().toggleBold().run(),children:T.jsx(kc,{icon:"ooui:bold-b"})}),c>=7&&T.jsx(y,{dataTest:"richeditor-italic-button",size:"small",variant:e.isActive("italic")?"text":"textGray",onClick:()=>e.chain().focus().toggleItalic().run(),children:T.jsx(kc,{icon:"material-symbols:format-italic",height:20})}),c>=8&&T.jsx(y,{dataTest:"richeditor-link-button",size:"small",variant:e.isActive("link")?"text":"textGray",onClick:s,children:T.jsx(g,{})}),v&&T.jsxs(T.Fragment,{children:[T.jsx(y,{size:"small",dataTest:"richeditor-more-menu-button",variant:"text",onClick:e=>{e.stopPropagation(),e.preventDefault(),E(e)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:T.jsx(b,{className:"text-delta-800",width:20,height:20})}),T.jsx(x,{open:C,anchorEl:O,onClose:M,onClick:M,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:k})]})]}),T.jsx(y,{dataTest:"richeditor-close-toolbar-button",size:"small",variant:"text",onClick:t,children:m?"Lukk":"Close"})]})})},Mc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ec=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Tc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Nc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Ac=ps.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ca({find:Mc,type:this.type}),ca({find:Tc,type:this.type})]},addPasteRules(){return[ua({find:Ec,type:this.type}),ua({find:Nc,type:this.type})]}}),Dc="textStyle",Rc=/^\s*([-+*])\s$/,Ic=ha.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Dc)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=da({find:Rc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=da({find:Rc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Dc),editor:this.editor})),[e]}}),Pc=ha.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Gi(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>function(e){return new as({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=Xi(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}}),Lc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,jc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,zc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,$c=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Bc=ps.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ca({find:Lc,type:this.type}),ca({find:zc,type:this.type})]},addPasteRules(){return[ua({find:jc,type:this.type}),ua({find:$c,type:this.type})]}}),_c="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Fc="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vc=(e,t)=>{for(const n in t)e[n]=t[n];return e},Hc="numeric",Wc="ascii",Kc="alpha",qc="asciinumeric",Jc="alphanumeric",Uc="domain",Gc="emoji",Yc="scheme",Qc="slashscheme",Xc="whitespace";function Zc(e,t){return e in t||(t[e]=[]),t[e]}function ed(e,t,n){t[Hc]&&(t[qc]=!0,t[Jc]=!0),t[Wc]&&(t[qc]=!0,t[Kc]=!0),t[qc]&&(t[Jc]=!0),t[Kc]&&(t[Jc]=!0),t[Jc]&&(t[Uc]=!0),t[Gc]&&(t[Uc]=!0);for(const r in t){const t=Zc(r,n);t.indexOf(e)<0&&t.push(e)}}function td(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}td.groups={},td.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const r=t.jr[n][0],o=t.jr[n][1];if(o&&r.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||td.groups,t&&t.j?o=t:(o=new td(t),n&&r&&ed(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||td.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let s,a=o.go(e);if(a?(s=new td,Vc(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new td,i){if(r)if(s.t&&"string"==typeof s.t){const e=Vc(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n);ed(i,e,r)}else n&&ed(i,n,r);s.t=i}return o.j[e]=s,s}};const nd=(e,t,n,r,o)=>e.ta(t,n,r,o),rd=(e,t,n,r,o)=>e.tr(t,n,r,o),od=(e,t,n,r,o)=>e.ts(t,n,r,o),id=(e,t,n,r,o)=>e.tt(t,n,r,o),sd="WORD",ad="UWORD",ld="ASCIINUMERICAL",cd="ALPHANUMERICAL",dd="LOCALHOST",hd="TLD",ud="UTLD",pd="SCHEME",fd="SLASH_SCHEME",md="NUM",gd="WS",yd="NL",bd="OPENBRACE",vd="CLOSEBRACE",wd="OPENBRACKET",kd="CLOSEBRACKET",xd="OPENPAREN",Sd="CLOSEPAREN",Od="OPENANGLEBRACKET",Cd="CLOSEANGLEBRACKET",Md="FULLWIDTHLEFTPAREN",Ed="FULLWIDTHRIGHTPAREN",Td="LEFTCORNERBRACKET",Nd="RIGHTCORNERBRACKET",Ad="LEFTWHITECORNERBRACKET",Dd="RIGHTWHITECORNERBRACKET",Rd="FULLWIDTHLESSTHAN",Id="FULLWIDTHGREATERTHAN",Pd="AMPERSAND",Ld="APOSTROPHE",jd="ASTERISK",zd="AT",$d="BACKSLASH",Bd="BACKTICK",_d="CARET",Fd="COLON",Vd="COMMA",Hd="DOLLAR",Wd="DOT",Kd="EQUALS",qd="EXCLAMATION",Jd="HYPHEN",Ud="PERCENT",Gd="PIPE",Yd="PLUS",Qd="POUND",Xd="QUERY",Zd="QUOTE",eh="FULLWIDTHMIDDLEDOT",th="SEMI",nh="SLASH",rh="TILDE",oh="UNDERSCORE",ih="EMOJI",sh="SYM";var ah=Object.freeze({__proto__:null,WORD:sd,UWORD:ad,ASCIINUMERICAL:ld,ALPHANUMERICAL:cd,LOCALHOST:dd,TLD:hd,UTLD:ud,SCHEME:pd,SLASH_SCHEME:fd,NUM:md,WS:gd,NL:yd,OPENBRACE:bd,CLOSEBRACE:vd,OPENBRACKET:wd,CLOSEBRACKET:kd,OPENPAREN:xd,CLOSEPAREN:Sd,OPENANGLEBRACKET:Od,CLOSEANGLEBRACKET:Cd,FULLWIDTHLEFTPAREN:Md,FULLWIDTHRIGHTPAREN:Ed,LEFTCORNERBRACKET:Td,RIGHTCORNERBRACKET:Nd,LEFTWHITECORNERBRACKET:Ad,RIGHTWHITECORNERBRACKET:Dd,FULLWIDTHLESSTHAN:Rd,FULLWIDTHGREATERTHAN:Id,AMPERSAND:Pd,APOSTROPHE:Ld,ASTERISK:jd,AT:zd,BACKSLASH:$d,BACKTICK:Bd,CARET:_d,COLON:Fd,COMMA:Vd,DOLLAR:Hd,DOT:Wd,EQUALS:Kd,EXCLAMATION:qd,HYPHEN:Jd,PERCENT:Ud,PIPE:Gd,PLUS:Yd,POUND:Qd,QUERY:Xd,QUOTE:Zd,FULLWIDTHMIDDLEDOT:eh,SEMI:th,SLASH:nh,TILDE:rh,UNDERSCORE:oh,EMOJI:ih,SYM:sh});const lh=/[a-z]/,ch=/\p{L}/u,dh=/\p{Emoji}/u,hh=/\d/,uh=/\s/,ph="\r",fh="\n",mh="️",gh="",yh="";let bh=null,vh=null;function wh(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(e=>e.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,h=-1,u=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(h=0,u=0,d=a):h>=0&&(h+=n[s].length,u++),c+=n[s].length,i+=n[s].length,s++;i-=h,s-=u,c-=h,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function kh(e,t,n,r,o){let i;const s=t.length;for(let n=0;n<s-1;n++){const s=t[n];e.j[s]?i=e.j[s]:(i=new td(r),i.jr=o.slice(),e.j[s]=i),e=i}return i=new td(n),i.jr=o.slice(),e.j[t[s-1]]=i,i}function xh(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Sh={defaultProtocol:"http",events:null,format:Ch,formatHref:Ch,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Oh(e,t=null){let n=Vc({},Sh);e&&(n=Vc(n,e instanceof Oh?e.o:e));const r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Ch(e){return e}function Mh(e,t){this.t="token",this.v=e,this.tk=t}function Eh(e,t){class n extends Mh{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}Oh.prototype={o:Sh,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o&&("object"==typeof o?(o=n.t in o?o[n.t]:Sh[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o)},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},Mh.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Sh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Vc(s,d),{tagName:o,attributes:s,content:i,eventListeners:h}}};const Th=Eh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Nh=Eh("text"),Ah=Eh("nl"),Dh=Eh("url",{isLink:!0,toHref(e=Sh.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==dd&&e[1].t===Fd}}),Rh=e=>new td(e);function Ih(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}const Ph=typeof console<"u"&&console&&console.warn||(()=>{}),Lh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function jh(e,t=!1){if(Lh.initialized&&Ph(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');Lh.customSchemes.push([e,t])}function zh(){Lh.scanner=function(e=[]){const t={};td.groups=t;const n=new td;null==bh&&(bh=xh(_c)),null==vh&&(vh=xh(Fc)),id(n,"'",Ld),id(n,"{",bd),id(n,"}",vd),id(n,"[",wd),id(n,"]",kd),id(n,"(",xd),id(n,")",Sd),id(n,"<",Od),id(n,">",Cd),id(n,"(",Md),id(n,")",Ed),id(n,"「",Td),id(n,"」",Nd),id(n,"『",Ad),id(n,"』",Dd),id(n,"<",Rd),id(n,">",Id),id(n,"&",Pd),id(n,"*",jd),id(n,"@",zd),id(n,"`",Bd),id(n,"^",_d),id(n,":",Fd),id(n,",",Vd),id(n,"$",Hd),id(n,".",Wd),id(n,"=",Kd),id(n,"!",qd),id(n,"-",Jd),id(n,"%",Ud),id(n,"|",Gd),id(n,"+",Yd),id(n,"#",Qd),id(n,"?",Xd),id(n,'"',Zd),id(n,"/",nh),id(n,";",th),id(n,"~",rh),id(n,"_",oh),id(n,"\\",$d),id(n,"・",eh);const r=rd(n,hh,md,{[Hc]:!0});rd(r,hh,r);const o=rd(r,lh,ld,{[qc]:!0}),i=rd(r,ch,cd,{[Jc]:!0}),s=rd(n,lh,sd,{[Wc]:!0});rd(s,hh,o),rd(s,lh,s),rd(o,hh,o),rd(o,lh,o);const a=rd(n,ch,ad,{[Kc]:!0});rd(a,lh),rd(a,hh,i),rd(a,ch,a),rd(i,hh,i),rd(i,lh),rd(i,ch,i);const l=id(n,fh,yd,{[Xc]:!0}),c=id(n,ph,gd,{[Xc]:!0}),d=rd(n,uh,gd,{[Xc]:!0});id(n,yh,d),id(c,fh,l),id(c,yh,d),rd(c,uh,d),id(d,ph),id(d,fh),rd(d,uh,d),id(d,yh,d);const h=rd(n,dh,ih,{[Gc]:!0});id(h,"#"),rd(h,dh,h),id(h,mh,h);const u=id(h,gh);id(u,"#"),rd(u,dh,h);const p=[[lh,s],[hh,o]],f=[[lh,null],[ch,a],[hh,i]];for(let e=0;e<bh.length;e++)kh(n,bh[e],hd,sd,p);for(let e=0;e<vh.length;e++)kh(n,vh[e],ud,ad,f);ed(hd,{tld:!0,ascii:!0},t),ed(ud,{utld:!0,alpha:!0},t),kh(n,"file",pd,sd,p),kh(n,"mailto",pd,sd,p),kh(n,"http",fd,sd,p),kh(n,"https",fd,sd,p),kh(n,"ftp",fd,sd,p),kh(n,"ftps",fd,sd,p),ed(pd,{scheme:!0,ascii:!0},t),ed(fd,{slashscheme:!0,ascii:!0},t),e=e.sort(((e,t)=>e[0]>t[0]?1:-1));for(let t=0;t<e.length;t++){const r=e[t][0],o=e[t][1]?{[Yc]:!0}:{[Qc]:!0};r.indexOf("-")>=0?o[Uc]=!0:lh.test(r)?hh.test(r)?o[qc]=!0:o[Wc]=!0:o[Hc]=!0,od(n,r,r,o)}return od(n,"localhost",dd,{ascii:!0}),n.jd=new td(sh),{start:n,tokens:Vc({groups:t},ah)}}(Lh.customSchemes);for(let e=0;e<Lh.tokenQueue.length;e++)Lh.tokenQueue[e][1]({scanner:Lh.scanner});Lh.parser=function({groups:e}){const t=e.domain.concat([Pd,jd,zd,$d,Bd,_d,Hd,Kd,Jd,md,Ud,Gd,Yd,Qd,nh,sh,rh,oh]),n=[Fd,Vd,Wd,qd,Ud,Xd,Zd,th,Od,Cd,bd,vd,kd,wd,xd,Sd,Md,Ed,Td,Nd,Ad,Dd,Rd,Id],r=[Pd,Ld,jd,$d,Bd,_d,Hd,Kd,Jd,bd,vd,Ud,Gd,Yd,Qd,Xd,nh,sh,rh,oh],o=Rh(),i=id(o,rh);nd(i,r,i),nd(i,e.domain,i);const s=Rh(),a=Rh(),l=Rh();nd(o,e.domain,s),nd(o,e.scheme,a),nd(o,e.slashscheme,l),nd(s,r,i),nd(s,e.domain,s);const c=id(s,zd);id(i,zd,c),id(a,zd,c),id(l,zd,c);const d=id(i,Wd);nd(d,r,i),nd(d,e.domain,i);const h=Rh();nd(c,e.domain,h),nd(h,e.domain,h);const u=id(h,Wd);nd(u,e.domain,h);const p=Rh(Th);nd(u,e.tld,p),nd(u,e.utld,p),id(c,dd,p);const f=id(h,Jd);id(f,Jd,f),nd(f,e.domain,h),nd(p,e.domain,h),id(p,Wd,u),id(p,Jd,f);const m=id(p,Fd);nd(m,e.numeric,Th);const g=id(s,Jd),y=id(s,Wd);id(g,Jd,g),nd(g,e.domain,s),nd(y,r,i),nd(y,e.domain,s);const b=Rh(Dh);nd(y,e.tld,b),nd(y,e.utld,b),nd(b,e.domain,s),nd(b,r,i),id(b,Wd,y),id(b,Jd,g),id(b,zd,c);const v=id(b,Fd),w=Rh(Dh);nd(v,e.numeric,w);const k=Rh(Dh),x=Rh();nd(k,t,k),nd(k,n,x),nd(x,t,k),nd(x,n,x),id(b,nh,k),id(w,nh,k);const S=id(a,Fd),O=id(l,Fd),C=id(O,nh),M=id(C,nh);nd(a,e.domain,s),id(a,Wd,y),id(a,Jd,g),nd(l,e.domain,s),id(l,Wd,y),id(l,Jd,g),nd(S,e.domain,k),id(S,nh,k),id(S,Xd,k),nd(M,e.domain,k),nd(M,t,k),id(M,nh,k);const E=[[bd,vd],[wd,kd],[xd,Sd],[Od,Cd],[Md,Ed],[Td,Nd],[Ad,Dd],[Rd,Id]];for(let e=0;e<E.length;e++){const[r,o]=E[e],i=id(k,r);id(x,r,i),id(i,o,k);const s=Rh(Dh);nd(i,t,s);const a=Rh();nd(i,n),nd(s,t,s),nd(s,n,a),nd(a,t,s),nd(a,n,a),id(s,o,k),id(a,o,k)}return id(o,dd,b),id(o,yd,Ah),{start:o,tokens:ah}}(Lh.scanner.tokens);for(let e=0;e<Lh.pluginQueue.length;e++)Lh.pluginQueue[e][1]({scanner:Lh.scanner,parser:Lh.parser});return Lh.initialized=!0,Lh}function $h(e){return Lh.initialized||zh(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=e,l=null,c=null,d=0,h=null,u=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(u=0,h=a):u>=0&&u++,o++,d++;if(u<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(Ih(Nh,t,s)),s=[]),o-=u,d-=u;const e=h.t,r=n.slice(o-d,o);i.push(Ih(e,t,r))}}return s.length>0&&i.push(Ih(Nh,t,s)),i}(Lh.parser.start,e,wh(Lh.scanner.start,e))}function Bh(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Oh(n),o=$h(e),i=[];for(let e=0;e<o.length;e++){const n=o[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&i.push(n.toFormattedObject(r))}return i}function _h(e){return new Yt({key:new Zt("autolink"),appendTransaction:(t,n,r)=>{const o=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),i=t.some((e=>e.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(e,t){const n=new Nt(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]);return function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,o)=>{const i=[];if(e.ranges.length)e.forEach(((e,t)=>{i.push({from:e,to:t})}));else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach((({from:e,to:n})=>{const i=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(i,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),Hs(r)}(a).forEach((({newRange:t})=>{const n=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,t,(e=>e.isTextblock));let o,i;if(n.length>1?(o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ")):n.length&&r.doc.textBetween(t.from,t.to," "," ").endsWith(" ")&&(o=n[0],i=r.doc.textBetween(o.pos,t.to,void 0," ")),o&&i){const t=i.split(" ").filter((e=>""!==e));if(t.length<=0)return!1;const n=t[t.length-1],a=o.pos+i.lastIndexOf(n);if(!n)return!1;const l=$h(n).map((t=>t.toObject(e.defaultProtocol)));if(!function(e){return 1===e.length?e[0].isLink:!(3!==e.length||!e[1].isLink)&&["()","[]"].includes(e[0].value+e[2].value)}(l))return!1;l.filter((e=>e.isLink)).map((e=>({...e,from:a+e.start+1,to:a+e.end+1}))).filter((e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code))).filter((t=>e.validate(t.value))).filter((t=>e.shouldAutoLink(t.value))).forEach((t=>{Ws(t.from,t.to,r.doc).some((t=>t.mark.type===e.type))||s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}})),s.steps.length?s:void 0}})}$h.scan=wh;const Fh=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Vh(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach((e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)})),!e||e.replace(Fh,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Hh=ps.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach((e=>{"string"!=typeof e?jh(e.scheme,e.optionalSlashes):jh(e)}))},onDestroy(){td.groups={},Lh.scanner=null,Lh.parser=null,Lh.tokenQueue=[],Lh.pluginQueue=[],Lh.customSchemes=[],Lh.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Vh(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!Vh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!Vh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Gi(this.options.HTMLAttributes,e),0]:["a",Gi(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!Vh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!Vh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ua({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=Bh(e).filter((e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!Vh(e,n),protocols:n,defaultProtocol:r})));o.length&&o.forEach((e=>t.push({text:e.value,data:{href:e.href},index:e.start})))}return t},type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(_h({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Vh(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),!0===this.options.openOnClick&&e.push(function(e){return new Yt({key:new Zt("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button||!t.editable)return!1;let s=r.target;const a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find((e=>"A"===e.nodeName)))return!1;const l=Vs(t.state,e.type.name),c=r.target,d=null!==(o=null==c?void 0:c.href)&&void 0!==o?o:l.href,h=null!==(i=null==c?void 0:c.target)&&void 0!==i?i:l.target;return!(!c||!d||(window.open(d,h),0))}}})}({type:this.type})),this.options.linkOnPaste&&e.push(function(e){return new Yt({key:new Zt("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:o}=t,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((e=>{a+=e.textContent}));const l=Bh(a,{defaultProtocol:e.defaultProtocol}).find((e=>e.isLink&&e.value===a));return!(!a||!l)&&e.editor.commands.setMark(e.type,{href:l.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),Wh=ha.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Gi(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Kh="textStyle",qh=/^(\d+)\.\s$/,Jh=ha.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Gi(this.options.HTMLAttributes,n),0]:["ol",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Kh)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=da({find:qh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=da({find:qh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Kh)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),Uh=ha.create({name:"doc",topNode:!0,content:"block+"}),Gh=ha.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Yh=ha.create({name:"text",group:"inline"}),Qh=ps.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!1}),parseHTML(){return[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach((e=>{var t,n;const r=e.getAttribute("style"),o=null===(n=null===(t=e.parentElement)||void 0===t?void 0:t.closest("span"))||void 0===n?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)}))})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,((t,n)=>{if(t.isTextblock)return!0;t.marks.filter((e=>e.type===this.type)).some((e=>Object.values(e.attrs).some((e=>!!e))))||e.removeMark(n,n+t.nodeSize,this.type)})),!0}}}});var Xh=vs.create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(e){return e.style.fontSize.replace(/['"]+/g,"")},renderHTML:function(e){return e.fontSize?{style:"font-size: "+e.fontSize}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}});const Zh=[Uh,Gh,Yh,Qh],eu=[Pc.configure({levels:[1,2]}),Wh,Ic,Jh,Hh,Ac,Bc,Xh],tu="_link-dialog-container_jjs9w_1",nu=({open:e,setOpen:t,editor:n,locale:o})=>{const[i,s]=r(""),a=h((()=>"no"===o),[o]);l((()=>{if(e){const{from:e,to:t}=n.state.selection;let r=null;n.state.doc.nodesBetween(e-1,t,(e=>{if(e.marks){const t=e.marks.find((e=>"link"===e.type.name));t&&(r=t.attrs.href)}})),s(r||"");const o=document.querySelector('[data-test="link-input-field"]');null==o||o.focus()}}),[e,n]);return T.jsx(v,{open:e,dataTest:"link-modal-rte",onClose:()=>t(!1),className:"z-[99]",dialogTitle:T.jsx("div",{className:"text-gray-700",children:a?"Legg til lenke":"Add link"}),children:T.jsxs("div",{className:tu,children:[T.jsx("div",{className:"link-input-field",children:T.jsx(m,{autoFocus:!0,multiline:!0,className:"w-full",dataTest:"link-input-field",size:"small",sx:{"& .MuiInputBase-root":{minHeight:64,alignItems:"start"}},value:i,onChange:e=>s(e.target.value)})}),T.jsxs("div",{className:"flex gap-2 p-0 w-full justify-end",children:[T.jsx(y,{dataTest:"delete-customer-reject-button",size:"medium",variant:"outlined",onClick:()=>{t(!1),s("")},children:a?"Avbryt":"Cancel"}),T.jsx(y,{dataTest:"delete-customer-confirm-button",size:"medium",variant:"contained",onClick:()=>{n.chain().focus().setLink({href:i}).run(),t(!1),s("")},children:a?"Legg til lenke":"Add link"})]})]})})},ru=vs.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Yt({key:new Zt("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;const i=this.editor.isEmpty;return e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&Us(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=$o.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren})),Fo.create(e,o)}}})]}}),ou=({dataTest:e,id:t,inputRef:o,className:s,editorClassName:a,disabled:l,readOnly:c,error:d,locale:h,title:p,placeholder:f,helperText:m,required:g,maxScrollableHeight:y,toolbarDefaultVisible:b,hideToolbar:v,noDefaultStyles:x,...S})=>{const O=n(),C=Ba({...S,extensions:[ru.configure({placeholder:f}),...Zh,...eu,...S.extensions||[]],shouldRerenderOnTransaction:S.shouldRerenderOnTransaction||!1,immediatelyRender:S.immediatelyRender||!0,editable:S.editable||!l&&!c,onSelectionUpdate:e=>{var t;null==(t=S.onSelectionUpdate)||t.call(S,e),O.current=e.editor.state.selection.anchor,e.editor.commands.focus()}},[S.extensions,S.shouldRerenderOnTransaction,S.immediatelyRender,S.editable,S.content,l,c,f]);i((()=>{void 0!==O.current&&(null==C||C.commands.setTextSelection(O.current))}),[S.content,C]);const[M,E]=r(b),[N,D]=r(!1);u(o,(()=>C));const[R,I]=r(!1);return i((()=>{const e=()=>I(!0),t=()=>I(!1);return null==C||C.on("focus",e),null==C||C.on("blur",t),()=>{null==C||C.off("focus",e),null==C||C.off("blur",t)}}),[C]),C?T.jsxs(T.Fragment,{children:[T.jsxs(w,{className:s,children:[p&&T.jsx("p",{className:"font-semibold text-base text-gray-700 mb-2",children:p}),T.jsxs("div",{className:A(!x&&"rte-wrapper","outlined"===c&&"readonly-outlined","plain"===c&&"readonly-plain",d&&!R&&"error-state",R&&!c&&(d?"error-focused-state":"focused-state")),children:[T.jsx(Oa,{"data-test":e,id:t,className:A("border-none rounded-none",!x&&"core-ui-rte",!v&&!l&&!c&&!M&&"displace-text",!x&&!l&&!c&&"edit-mode",a),editor:C,onClick:()=>null==C?void 0:C.chain().focus().run(),style:{"--max-scrollable-height":y?`${y}${"number"==typeof y?"px":""}`:"none"}}),!v&&!l&&!c&&!M&&T.jsx(kc,{onClick:()=>E(!0),className:"cursor-pointer absolute bottom-2.5 right-4",icon:"material-symbols:format-color-text",color:"var(--colors-gray-700)",height:24,width:24}),!v&&!l&&!c&&M&&T.jsx(Cc,{editor:C,onClose:()=>E(!1),error:d,focused:R,openLinkDialog:()=>D(!0),locale:h})]}),(d||g)&&!c&&T.jsx(k,{error:d,"data-test":`error-${e}`,children:m})]}),T.jsx(nu,{open:N,setOpen:D,editor:C,locale:h})]}):null};export{ou as RichInput};
|
|
56
|
+
*/"production"===process.env.NODE_ENV?Ta.exports=function(){if(Ca)return Na;Ca=1;var t=e,n=va,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Na.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&u.hasValue){var t=u.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?t:(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,n,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},Na}():Ta.exports=(Aa||(Aa=1,"production"!==process.env.NODE_ENV&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=e,n=va,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;Da.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h,u=i(null);null===u.current?(h={hasValue:!1,value:null},u.current=h):h=u.current;var p=a((function(){var e,o,i=!1,s=function(t){if(!i){i=!0,e=t;var n=c(t);if(void 0!==d&&h.hasValue){var s=h.value;if(d(s,n))return o=s,s}return o=n,n}var a=o;if(r(e,t))return a;var l=c(t);return void 0!==d&&d(a,l)?a:(e=t,o=l,l)},a=void 0===n?null:n;return[function(){return s(t())},null===a?void 0:function(){return s(a())}]}),[t,n,c,d]),f=p[0],m=p[1],g=o(e,f,m);return s((function(){h.hasValue=!0,h.value=g}),[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Da);var Ra=Ta.exports;const Ia=typeof window<"u"?l:i;class Pa{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}}const La="production"!==process.env.NODE_ENV,ja=typeof window>"u",za=ja||!!(typeof window<"u"&&window.next);class $a{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((e=>e()))}getInitialEditor(){if(void 0===this.options.current.immediatelyRender)return ja||za?(La&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&ja&&La)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onBeforeCreate)||void 0===n?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null===(n=(t=this.options.current).onBlur)||void 0===n?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onCreate)||void 0===n?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null===(n=(t=this.options.current).onDestroy)||void 0===n?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null===(n=(t=this.options.current).onFocus)||void 0===n?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onSelectionUpdate)||void 0===n?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null===(n=(t=this.options.current).onTransaction)||void 0===n?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onUpdate)||void 0===n?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null===(n=(t=this.options.current).onContentError)||void 0===n?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null===(n=(t=this.options.current).onDrop)||void 0===n?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null===(n=(t=this.options.current).onPaste)||void 0===n?void 0:n.call(t,...e)}};return new la(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null===(r=t.extensions)||void 0===r?void 0:r[n])})):e[n]===t[n])))}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===e.length?$a.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}}function Ba(e={},t=[]){const s=n(e);s.current=e;const[a]=r((()=>new $a(s))),l=va.useSyncExternalStore(a.subscribe,a.getEditor,a.getServerSnapshot);return o(l),i(a.onRender(t)),function(e){var t;const[n]=r((()=>new Pa(e.editor))),i=Ra.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!==(t=e.equalityFn)&&void 0!==t?t:Ea);Ia((()=>n.watch(e.editor)),[e.editor,n]),o(i)}({editor:l,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),l}s({editor:null}).Consumer;const _a=s({onDragStart:void 0});e.forwardRef(((t,n)=>{const{onDragStart:r}=a(_a),o=t.as||"div";return e.createElement(o,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})}));const Fa=Object.freeze({left:0,top:0,width:16,height:16}),Va=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ha=Object.freeze({...Fa,...Va}),Wa=Object.freeze({...Ha,body:"",hidden:!1});function Ka(e,t){const n=function(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}(e,t);for(const r in Wa)r in Va?r in e&&!(r in n)&&(n[r]=Va[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function qa(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let i={};function s(e){i=Ka(r[e]||o[e],i)}return s(t),n.forEach(s),Ka(e,i)}function Ja(e,t){const n=[];if("object"!=typeof e||"object"!=typeof e.icons)return n;e.not_found instanceof Array&&e.not_found.forEach((e=>{t(e,null),n.push(e)}));const r=function(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);return(t||Object.keys(n).concat(Object.keys(r))).forEach((function e(t){if(n[t])return o[t]=[];if(!(t in o)){o[t]=null;const n=r[t]&&r[t].parent,i=n&&e(n);i&&(o[t]=[n].concat(i))}return o[t]})),o}(e);for(const o in r){const i=r[o];i&&(t(o,qa(e,o,i)),n.push(o))}return n}const Ua=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ga=(e,t,n,r="")=>{const o=e.split(":");if("@"===e.slice(0,1)){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const e=o.pop(),n=o.pop(),i={provider:o.length>0?o[0]:r,prefix:n,name:e};return t&&!Ya(i)?null:i}const i=o[0],s=i.split("-");if(s.length>1){const e={provider:r,prefix:s.shift(),name:s.join("-")};return t&&!Ya(e)?null:e}if(n&&""===r){const e={provider:r,prefix:"",name:i};return t&&!Ya(e,n)?null:e}return null},Ya=(e,t)=>!!e&&!(""!==e.provider&&!e.provider.match(Ua)||!(t&&""===e.prefix||e.prefix.match(Ua))||!e.name.match(Ua)),Qa={provider:"",aliases:{},not_found:{},...Fa};function Xa(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Za(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons||!Xa(e,Qa))return null;const n=t.icons;for(const e in n){const t=n[e];if(!e.match(Ua)||"string"!=typeof t.body||!Xa(t,Wa))return null}const r=t.aliases||Object.create(null);for(const e in r){const t=r[e],o=t.parent;if(!e.match(Ua)||"string"!=typeof o||!n[o]&&!r[o]||!Xa(t,Wa))return null}return t}const el=Object.create(null);function tl(e,t){const n=el[e]||(el[e]=Object.create(null));return n[t]||(n[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function nl(e,t){return Za(t)?Ja(t,((t,n)=>{n?e.icons[t]=n:e.missing.add(t)})):[]}let rl=!1;function ol(e){return"boolean"==typeof e&&(rl=e),rl}function il(e){const t="string"==typeof e?Ga(e,!0,rl):e;if(t){const e=tl(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function sl(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),rl&&!t&&!e.prefix){let t=!1;return Za(e)&&(e.prefix="",Ja(e,((e,n)=>{n&&function(e,t){const n=Ga(e,!0,rl);return!!n&&function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]={...n},!0}catch{}return!1}(tl(n.provider,n.prefix),n.name,t)}(e,n)&&(t=!0)}))),t}const n=e.prefix;if(!Ya({provider:t,prefix:n,name:"a"}))return!1;return!!nl(tl(t,n),e)}const al=Object.freeze({width:null,height:null}),ll=Object.freeze({...al,...Va}),cl=/(-?[0-9.]*[0-9]+[0-9.]*)/g,dl=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function hl(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const r=e.split(cl);if(null===r||!r.length)return e;const o=[];let i=r.shift(),s=dl.test(i);for(;;){if(s){const e=parseFloat(i);isNaN(e)?o.push(i):o.push(Math.ceil(e*t*n)/n)}else o.push(i);if(i=r.shift(),void 0===i)return o.join("");s=!s}}const ul=/\sid="(\S+)"/g,pl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let fl=0;function ml(e,t=pl){const n=[];let r;for(;r=ul.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach((n=>{const r="function"==typeof t?t(n):t+(fl++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+r+o+"$3")})),e=e.replace(new RegExp(o,"g"),"")}const gl=Object.create(null);function yl(e){return gl[e]||gl[""]}function bl(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const vl=Object.create(null),wl=["https://api.simplesvg.com","https://api.unisvg.com"],kl=[];for(;wl.length>0;)1===wl.length||Math.random()>.5?kl.push(wl.shift()):kl.push(wl.pop());function xl(e,t){const n=bl(t);return null!==n&&(vl[e]=n,!0)}function Sl(e){return vl[e]}vl[""]=bl({resources:["https://api.iconify.design"].concat(kl)});let Ol=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch{}})();const Cl={prepare:(e,t,n)=>{const r=[],o=function(e,t){const n=Sl(e);if(!n)return 0;let r;if(n.maxURL){let e=0;n.resources.forEach((t=>{e=Math.max(e,t.length)}));const o=t+".json?icons=";r=n.maxURL-e-n.path.length-o.length}else r=0;return r}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},a=0;return n.forEach(((n,l)=>{a+=n.length+1,a>=o&&l>0&&(r.push(s),s={type:i,provider:e,prefix:t,icons:[]},a=n.length),s.icons.push(n)})),r.push(s),r},send:(e,t,n)=>{if(!Ol)return void n("abort",424);let r=function(e){if("string"==typeof e){const t=Sl(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,n=t.icons.join(",");r+=e+".json?"+new URLSearchParams({icons:n}).toString();break}case"custom":{const e=t.uri;r+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void n("abort",400)}let o=503;Ol(e+r).then((e=>{const t=e.status;if(200===t)return o=501,e.json();setTimeout((()=>{n(function(e){return 404===e}(t)?"abort":"next",t)}))})).then((e=>{"object"==typeof e&&null!==e?setTimeout((()=>{n("success",e)})):setTimeout((()=>{404===e?n("abort",e):n("next",o)}))})).catch((()=>{n("next",o)}))}};function Ml(e,t){e.forEach((e=>{const n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter((e=>e.id!==t)))}))}let El=0;var Tl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Nl(e,t,n,r){const o=e.resources.length,i=e.random?Math.floor(Math.random()*o):e.index;let s;if(e.random){let t=e.resources.slice(0);for(s=[];t.length>1;){const e=Math.floor(Math.random()*t.length);s.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}s=s.concat(t)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let l,c="pending",d=0,h=null,u=[],p=[];function f(){h&&(clearTimeout(h),h=null)}function m(){"pending"===c&&(c="aborted"),f(),u.forEach((e=>{"pending"===e.status&&(e.status="aborted")})),u=[]}function g(e,t){t&&(p=[]),"function"==typeof e&&p.push(e)}function y(){c="failed",p.forEach((e=>{e(void 0,l)}))}function b(){u.forEach((e=>{"pending"===e.status&&(e.status="aborted")})),u=[]}function v(){if("pending"!==c)return;f();const r=s.shift();if(void 0===r)return u.length?void(h=setTimeout((()=>{f(),"pending"===c&&(b(),y())}),e.timeout)):void y();const o={status:"pending",resource:r,callback:(t,n)=>{!function(t,n,r){const o="success"!==n;switch(u=u.filter((e=>e!==t)),c){case"pending":break;case"failed":if(o||!e.dataAfterTimeout)return;break;default:return}if("abort"===n)return l=r,void y();if(o)return l=r,void(u.length||(s.length?v():y()));if(f(),b(),!e.random){const n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}c="completed",p.forEach((e=>{e(r)}))}(o,t,n)}};u.push(o),d++,h=setTimeout(v,e.rotate),n(r,t,o.callback)}return"function"==typeof r&&p.push(r),setTimeout(v),function(){return{startTime:a,payload:t,status:c,queriesSent:d,queriesPending:u.length,subscribe:g,abort:m}}}function Al(e){const t={...Tl,...e};let n=[];function r(){n=n.filter((e=>"pending"===e().status))}return{query:function(e,o,i){const s=Nl(t,e,o,((e,t)=>{r(),i&&i(e,t)}));return n.push(s),s},find:function(e){return n.find((t=>e(t)))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Dl(){}const Rl=Object.create(null);function Il(e,t,n){let r,o;if("string"==typeof e){const t=yl(e);if(!t)return n(void 0,424),Dl;o=t.send;const i=function(e){if(!Rl[e]){const t=Sl(e);if(!t)return;const n={config:t,redundancy:Al(t)};Rl[e]=n}return Rl[e]}(e);i&&(r=i.redundancy)}else{const t=bl(e);if(t){r=Al(t);const n=yl(e.resources?e.resources[0]:"");n&&(o=n.send)}}return r&&o?r.query(t,o,n)().abort:(n(void 0,424),Dl)}const Pl="iconify2",Ll="iconify",jl=Ll+"-count",zl=Ll+"-version",$l=36e5,Bl=168,_l=50;function Fl(e,t){try{return e.getItem(t)}catch{}}function Vl(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Hl(e,t){try{e.removeItem(t)}catch{}}function Wl(e,t){return Vl(e,jl,t.toString())}function Kl(e){return parseInt(Fl(e,jl))||0}const ql={local:!0,session:!0},Jl={local:new Set,session:new Set};let Ul=!1;let Gl=typeof window>"u"?{}:window;function Yl(e){const t=e+"Storage";try{if(Gl&&Gl[t]&&"number"==typeof Gl[t].length)return Gl[t]}catch{}ql[e]=!1}function Ql(e,t){const n=Yl(e);if(!n)return;const r=Fl(n,zl);if(r!==Pl){if(r){const e=Kl(n);for(let t=0;t<e;t++)Hl(n,Ll+t.toString())}return Vl(n,zl,Pl),void Wl(n,0)}const o=Math.floor(Date.now()/$l)-Bl,i=e=>{const r=Ll+e.toString(),i=Fl(n,r);if("string"==typeof i){try{const n=JSON.parse(i);if("object"==typeof n&&"number"==typeof n.cached&&n.cached>o&&"string"==typeof n.provider&&"object"==typeof n.data&&"string"==typeof n.data.prefix&&t(n,e))return!0}catch{}Hl(n,r)}};let s=Kl(n);for(let t=s-1;t>=0;t--)i(t)||(t===s-1?(s--,Wl(n,s)):Jl[e].add(t))}function Xl(){if(!Ul){Ul=!0;for(const e in ql)Ql(e,(e=>{const t=e.data,n=tl(e.provider,t.prefix);if(!nl(n,t).length)return!1;const r=t.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,r):r,!0}))}}function Zl(e,t){function n(n){let r;if(!ql[n]||!(r=Yl(n)))return;const o=Jl[n];let i;if(o.size)o.delete(i=Array.from(o).shift());else if(i=Kl(r),i>=_l||!Wl(r,i+1))return;const s={cached:Math.floor(Date.now()/$l),provider:e.provider,data:t};return Vl(r,Ll+i.toString(),JSON.stringify(s))}Ul||Xl(),t.lastModified&&!function(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const n in ql)Ql(n,(n=>{const r=n.data;return n.provider!==e.provider||r.prefix!==e.prefix||r.lastModified===t}));return!0}(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&delete(t=Object.assign({},t)).not_found,n("local")||n("session"))}function ec(){}function tc(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout((()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout((()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach((t=>{const i=t.icons,s=i.pending.length;i.pending=i.pending.filter((t=>{if(t.prefix!==o)return!0;const s=t.name;if(e.icons[s])i.loaded.push({provider:r,prefix:o,name:s});else{if(!e.missing.has(s))return n=!0,!0;i.missing.push({provider:r,prefix:o,name:s})}return!1})),i.pending.length!==s&&(n||Ml([e],t.id),t.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),t.abort))}))})))}(e)})))}const nc=(e,t)=>{const n=function(e,t=!0,n=!1){const r=[];return e.forEach((e=>{const o="string"==typeof e?Ga(e,t,n):e;o&&r.push(o)})),r}(e,!0,ol()),r=function(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort(((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name)));let r={provider:"",prefix:"",name:""};return e.forEach((e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;const o=e.provider,i=e.prefix,s=e.name,a=n[o]||(n[o]=Object.create(null)),l=a[i]||(a[i]=tl(o,i));let c;c=s in l.icons?t.loaded:""===i||l.missing.has(s)?t.missing:t.pending;const d={provider:o,prefix:i,name:s};c.push(d)})),t}(n);if(!r.pending.length){let e=!0;return t&&setTimeout((()=>{e&&t(r.loaded,r.missing,r.pending,ec)})),()=>{e=!1}}const o=Object.create(null),i=[];let s,a;return r.pending.forEach((e=>{const{provider:t,prefix:n}=e;if(n===a&&t===s)return;s=t,a=n,i.push(tl(t,n));const r=o[t]||(o[t]=Object.create(null));r[n]||(r[n]=[])})),r.pending.forEach((e=>{const{provider:t,prefix:n,name:r}=e,i=tl(t,n),s=i.pendingIcons||(i.pendingIcons=new Set);s.has(r)||(s.add(r),o[t][n].push(r))})),i.forEach((e=>{const{provider:t,prefix:n}=e;o[t][n].length&&function(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout((()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:n}=e,r=e.iconsToLoad;let o;delete e.iconsToLoad,r&&(o=yl(t))&&o.prepare(t,n,r).forEach((n=>{Il(t,n,(t=>{if("object"!=typeof t)n.icons.forEach((t=>{e.missing.add(t)}));else try{const n=nl(e,t);if(!n.length)return;const r=e.pendingIcons;r&&n.forEach((e=>{r.delete(e)})),Zl(e,t)}catch(e){console.error(e)}tc(e)}))}))})))}(e,o[t][n])})),t?function(e,t,n){const r=El++,o=Ml.bind(null,n,r);if(!t.pending.length)return o;const i={id:r,icons:t,callback:e,abort:o};return n.forEach((e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(i)})),o}(t,r,i):ec};const rc=/[\s,]+/;function oc(e,t){t.split(rc).forEach((t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}}))}function ic(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(e){for(;e<0;)e+=4;return e%4}if(""===n){const t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o/=t,o%1==0?r(o):0)}}return t}function sc(e){return'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(e)+'")'}let ac;function lc(e){return void 0===ac&&function(){try{ac=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ac=null}}(),ac?ac.createHTML(e):e}const cc={...ll,inline:!1},dc={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},hc={display:"inline-block"},uc={backgroundColor:"currentColor"},pc={backgroundColor:"transparent"},fc={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},mc={WebkitMask:uc,mask:uc,background:pc};for(const e in mc){const t=mc[e];for(const n in fc)t[e+n]=fc[n]}const gc={...cc,inline:!0};function yc(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const bc=(e,t,n)=>{const r=t.inline?gc:cc,o=function(e,t){const n={...e};for(const e in t){const r=t[e],o=typeof r;e in al?(null===r||r&&("string"===o||"number"===o))&&(n[e]=r):o===typeof n[e]&&(n[e]="rotate"===e?r%4:r)}return n}(r,t),i=t.mode||"svg",s={},a=t.style||{},l={..."svg"===i?dc:{}};if(n){const e=Ga(n,!1,!0);if(e){const t=["iconify"],n=["provider","prefix"];for(const r of n)e[r]&&t.push("iconify--"+e[r]);l.className=t.join(" ")}}for(let e in t){const n=t[e];if(void 0!==n)switch(e){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":l.ref=n;break;case"className":l[e]=(l[e]?l[e]+" ":"")+n;break;case"inline":case"hFlip":case"vFlip":o[e]=!0===n||"true"===n||1===n;break;case"flip":"string"==typeof n&&oc(o,n);break;case"color":s.color=n;break;case"rotate":"string"==typeof n?o[e]=ic(n):"number"==typeof n&&(o[e]=n);break;case"ariaHidden":case"aria-hidden":!0!==n&&"true"!==n&&delete l["aria-hidden"];break;default:void 0===r[e]&&(l[e]=n)}}const d=function(e,t){const n={...Ha,...e},r={...ll,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,r].forEach((e=>{const t=[],n=e.hFlip,r=e.vFlip;let s,a=e.rotate;switch(n?r?a+=2:(t.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),t.push("scale(-1 1)"),o.top=o.left=0):r&&(t.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),t.push("scale(1 -1)"),o.top=o.left=0),a<0&&(a-=4*Math.floor(a/4)),a%=4,a){case 1:s=o.height/2+o.top,t.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:t.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:s=o.width/2+o.left,t.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}a%2==1&&(o.left!==o.top&&(s=o.left,o.left=o.top,o.top=s),o.width!==o.height&&(s=o.width,o.width=o.height,o.height=s)),t.length&&(i=function(e,t,n){const r=function(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const o=e.indexOf(">",r),i=e.indexOf("</"+t);if(-1===o||-1===i)break;const s=e.indexOf(">",i);if(-1===s)break;n+=e.slice(o+1,i).trim(),e=e.slice(0,r).trim()+e.slice(s+1)}return{defs:n,content:e}}(e);return function(e,t){return e?"<defs>"+e+"</defs>"+t:t}(r.defs,t+r.content+n)}(i,'<g transform="'+t.join(" ")+'">',"</g>"))}));const s=r.width,a=r.height,l=o.width,c=o.height;let d,h;null===s?(h=null===a?"1em":"auto"===a?c:a,d=hl(h,l/c)):(d="auto"===s?l:s,h=null===a?hl(d,c/l):"auto"===a?c:a);const u={},p=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(u[e]=t.toString())};p("width",d),p("height",h);const f=[o.left,o.top,l,c];return u.viewBox=f.join(" "),{attributes:u,viewBox:f,body:i}}(e,o),h=d.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===i){l.style={...s,...a},Object.assign(l,h);let e=0,n=t.id;return"string"==typeof n&&(n=n.replace(/-/g,"_")),l.dangerouslySetInnerHTML={__html:lc(ml(d.body,n?()=>n+"ID"+e++:"iconifyReact"))},c("svg",l)}const{body:u,width:p,height:f}=e,m="mask"===i||"bg"!==i&&-1!==u.indexOf("currentColor"),g=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in t)n+=" "+e+'="'+t[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}(u,{...h,width:p+"",height:f+""});return l.style={...s,"--svg":sc(g),width:yc(h.width),height:yc(h.height),...hc,...m?uc:pc,...a},c("span",l)};var vc;if(ol(!0),vc=Cl,gl[""]=vc,typeof document<"u"&&typeof window<"u"){Xl();const e=window;if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach((e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!sl(e))&&console.error(n)}catch{console.error(n)}}))}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){const n="IconifyProviders["+e+"] is invalid.";try{const r=t[e];if("object"!=typeof r||!r||void 0===r.resources)continue;xl(e,r)||console.error(n)}catch{console.error(n)}}}}function wc(e){const[t,n]=r(!!e.ssr),[o,s]=r({});const[a,l]=r(function(t){if(t){const t=e.icon;if("object"==typeof t)return{name:"",data:t};const n=il(t);if(n)return{name:t,data:n}}return{name:""}}(!!e.ssr));function d(){const e=o.callback;e&&(e(),s({}))}function h(e){if(JSON.stringify(a)!==JSON.stringify(e))return d(),l(e),!0}function u(){var t;const n=e.icon;if("object"==typeof n)return void h({name:"",data:n});const r=il(n);if(h({name:n,data:r}))if(void 0===r){const e=nc([n],u);s({callback:e})}else r&&(null===(t=e.onLoad)||void 0===t||t.call(e,n))}i((()=>(n(!0),d)),[]),i((()=>{t&&u()}),[e.icon,t]);const{name:p,data:f}=a;return f?bc({...Ha,...f},e,p):e.children?e.children:c("span",{})}const kc=t(((e,t)=>wc({...e,_ref:t})));t(((e,t)=>wc({inline:!0,...e,_ref:t})));const xc=e=>T.jsx(f,{...e,sx:{"&.MuiMenuItem-root":{color:"var(--colors-delta-700)",fontSize:"14px",lineHeight:"20px"}},children:e.children}),Sc={small:"10px",normal:"16px",large:"24px",huge:"32px"},Oc=e=>{const{editor:t}=e,[n,o]=r("normal");return l((()=>{const{from:e,to:n}=t.state.selection;t.state.doc.nodesBetween(e-1,n,(e=>{if(e.marks){const t=e.marks.find((e=>"textStyle"===e.type.name)),n=null==t?void 0:t.attrs.fontSize,r=Object.keys(Sc).find((e=>Sc[e]===n))||"normal";o(r)}}))}),[t.state.selection,t.state.doc]),T.jsx(m,{...e,select:!0,size:"small",dataTest:"font-size-select",onChange:e=>{const n=e.target.value;t.chain().focus().setMark("textStyle",{fontSize:Sc[n]}).run(),o(n)},value:n,SelectProps:{IconComponent:()=>null},InputProps:{endAdornment:T.jsx(kc,{icon:"tabler:caret-up-down-filled",className:"chevron-icon"})},sx:{".MuiSelect-select":{border:"none",padding:0,overflow:"hidden",display:"flex",alignItems:"center",color:"var(--colors-delta-700)",fontSize:"14px",lineHeight:"20px"},".MuiOutlinedInput-root":{height:"32px",width:"75px","& .MuiOutlinedInput-notchedOutline":{border:"none"}}},children:e.children})},Cc=({editor:e,onClose:t,error:o,focused:i,openLinkDialog:s,locale:a})=>{const[c,u]=r(0),p=n(null),m=h((()=>"no"===a),[a]),[v,w]=r(!1),[k,S]=r([]);l((()=>{const t=new ResizeObserver((()=>{var t;if(p.current){const n=p.current.clientWidth;w(n<(m?416:420));const r=null==(t=[{width:m?296:300,buttons:3},{width:m?340:342,buttons:4},{width:m?374:378,buttons:5},{width:m?416:420,buttons:6},{width:m?416:420,buttons:7},{width:1/0,buttons:8}].find((e=>n<e.width)))?void 0:t.buttons;u(void 0!==r?r:8);const o=[];Number(r)<8&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:s,selected:e.isActive("link"),children:T.jsx(g,{})},"link")),Number(r)<7&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:()=>e.chain().focus().toggleItalic().run(),selected:e.isActive("italic"),children:T.jsx(kc,{icon:"material-symbols:format-italic",height:20})},"italic")),Number(r)<6&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:()=>e.chain().focus().toggleBold().run(),selected:e.isActive("bold"),children:T.jsx(kc,{icon:"ooui:bold-b"})},"bold")),Number(r)<5&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:()=>e.chain().focus().toggleOrderedList().run(),selected:e.isActive("orderedList"),children:T.jsx(kc,{icon:"mdi:format-list-numbered",fontSize:20})},"ordered")),Number(r)<4&&o.push(T.jsx(f,{className:"flex items-center justify-center",onClick:()=>e.chain().focus().toggleBulletList().run(),selected:e.isActive("bulletList"),children:T.jsx(kc,{icon:"mdi:format-list-bulleted",fontSize:20})},"bullet")),S(o)}}));return p.current&&t.observe(p.current),()=>t.disconnect()}),[e,s,m]);const{anchorEl:O,open:C,handleClose:M,handleOpen:E}=(()=>{const[e,t]=r(null),n=!!e,o=d((e=>{t(e.currentTarget)}),[]);return{open:n,handleClose:d((()=>{t(null)}),[]),handleOpen:o,anchorEl:e}})();return T.jsx(T.Fragment,{children:T.jsxs("div",{className:A("toolbar",{"toolbar-error":o,"toolbar-focused":i}),ref:p,children:[T.jsxs("div",{className:"flex flex-row items-center gap-1",children:[c>=1&&T.jsx(y,{dataTest:"richeditor-h1-button",size:"small",variant:e.isActive("heading",{level:1})?"text":"textGray",onClick:()=>{e.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),e.chain().focus().toggleHeading({level:1}).run()},children:T.jsx(kc,{icon:"bi:type-h1"})}),c>=2&&T.jsx(y,{dataTest:"richeditor-h2-button",size:"small",variant:e.isActive("heading",{level:2})?"text":"textGray",onClick:()=>{e.chain().focus().setMark("textStyle",{fontSize:void 0}).run(),e.chain().focus().toggleHeading({level:2}).run()},children:T.jsx(kc,{icon:"bi:type-h2"})}),c>=3&&T.jsxs(Oc,{editor:e,children:[T.jsx(xc,{value:"small",children:m?"Liten":"Small"}),T.jsx(xc,{value:"normal",children:"Normal"}),T.jsx(xc,{value:"large",children:m?"Stor":"Large"}),T.jsx(xc,{value:"huge",children:m?"Enorm":"Huge"})]}),c>=4&&T.jsx(y,{dataTest:"richeditor-bullet-list-button",size:"small",variant:e.isActive("bulletList")?"text":"textGray",onClick:()=>e.chain().focus().toggleBulletList().run(),children:T.jsx(kc,{icon:"mdi:format-list-bulleted",fontSize:20})}),c>=5&&T.jsx(y,{dataTest:"richeditor-ordered-list-button",size:"small",variant:e.isActive("orderedList")?"text":"textGray",onClick:()=>e.chain().focus().toggleOrderedList().run(),children:T.jsx(kc,{icon:"mdi:format-list-numbered",fontSize:20})}),c>=6&&T.jsx(y,{dataTest:"richeditor-bold-button",size:"small",variant:e.isActive("bold")?"text":"textGray",onClick:()=>e.chain().focus().toggleBold().run(),children:T.jsx(kc,{icon:"ooui:bold-b"})}),c>=7&&T.jsx(y,{dataTest:"richeditor-italic-button",size:"small",variant:e.isActive("italic")?"text":"textGray",onClick:()=>e.chain().focus().toggleItalic().run(),children:T.jsx(kc,{icon:"material-symbols:format-italic",height:20})}),c>=8&&T.jsx(y,{dataTest:"richeditor-link-button",size:"small",variant:e.isActive("link")?"text":"textGray",onClick:s,children:T.jsx(g,{})}),v&&T.jsxs(T.Fragment,{children:[T.jsx(y,{size:"small",dataTest:"richeditor-more-menu-button",variant:"text",onClick:e=>{e.stopPropagation(),e.preventDefault(),E(e)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:T.jsx(b,{className:"text-delta-800",width:20,height:20})}),T.jsx(x,{open:C,anchorEl:O,onClose:M,onClick:M,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:k})]})]}),T.jsx(y,{dataTest:"richeditor-close-toolbar-button",size:"small",variant:"text",onClick:t,children:m?"Lukk":"Close"})]})})},Mc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ec=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Tc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Nc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Ac=ps.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ca({find:Mc,type:this.type}),ca({find:Tc,type:this.type})]},addPasteRules(){return[ua({find:Ec,type:this.type}),ua({find:Nc,type:this.type})]}}),Dc="textStyle",Rc=/^\s*([-+*])\s$/,Ic=ha.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Dc)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=da({find:Rc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=da({find:Rc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Dc),editor:this.editor})),[e]}}),Pc=ha.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Gi(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>function(e){return new as({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=Xi(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}}),Lc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,jc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,zc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,$c=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Bc=ps.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ca({find:Lc,type:this.type}),ca({find:zc,type:this.type})]},addPasteRules(){return[ua({find:jc,type:this.type}),ua({find:$c,type:this.type})]}}),_c="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Fc="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Vc=(e,t)=>{for(const n in t)e[n]=t[n];return e},Hc="numeric",Wc="ascii",Kc="alpha",qc="asciinumeric",Jc="alphanumeric",Uc="domain",Gc="emoji",Yc="scheme",Qc="slashscheme",Xc="whitespace";function Zc(e,t){return e in t||(t[e]=[]),t[e]}function ed(e,t,n){t[Hc]&&(t[qc]=!0,t[Jc]=!0),t[Wc]&&(t[qc]=!0,t[Kc]=!0),t[qc]&&(t[Jc]=!0),t[Kc]&&(t[Jc]=!0),t[Jc]&&(t[Uc]=!0),t[Gc]&&(t[Uc]=!0);for(const r in t){const t=Zc(r,n);t.indexOf(e)<0&&t.push(e)}}function td(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}td.groups={},td.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const r=t.jr[n][0],o=t.jr[n][1];if(o&&r.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||td.groups,t&&t.j?o=t:(o=new td(t),n&&r&&ed(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||td.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let s,a=o.go(e);if(a?(s=new td,Vc(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new td,i){if(r)if(s.t&&"string"==typeof s.t){const e=Vc(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n);ed(i,e,r)}else n&&ed(i,n,r);s.t=i}return o.j[e]=s,s}};const nd=(e,t,n,r,o)=>e.ta(t,n,r,o),rd=(e,t,n,r,o)=>e.tr(t,n,r,o),od=(e,t,n,r,o)=>e.ts(t,n,r,o),id=(e,t,n,r,o)=>e.tt(t,n,r,o),sd="WORD",ad="UWORD",ld="ASCIINUMERICAL",cd="ALPHANUMERICAL",dd="LOCALHOST",hd="TLD",ud="UTLD",pd="SCHEME",fd="SLASH_SCHEME",md="NUM",gd="WS",yd="NL",bd="OPENBRACE",vd="CLOSEBRACE",wd="OPENBRACKET",kd="CLOSEBRACKET",xd="OPENPAREN",Sd="CLOSEPAREN",Od="OPENANGLEBRACKET",Cd="CLOSEANGLEBRACKET",Md="FULLWIDTHLEFTPAREN",Ed="FULLWIDTHRIGHTPAREN",Td="LEFTCORNERBRACKET",Nd="RIGHTCORNERBRACKET",Ad="LEFTWHITECORNERBRACKET",Dd="RIGHTWHITECORNERBRACKET",Rd="FULLWIDTHLESSTHAN",Id="FULLWIDTHGREATERTHAN",Pd="AMPERSAND",Ld="APOSTROPHE",jd="ASTERISK",zd="AT",$d="BACKSLASH",Bd="BACKTICK",_d="CARET",Fd="COLON",Vd="COMMA",Hd="DOLLAR",Wd="DOT",Kd="EQUALS",qd="EXCLAMATION",Jd="HYPHEN",Ud="PERCENT",Gd="PIPE",Yd="PLUS",Qd="POUND",Xd="QUERY",Zd="QUOTE",eh="FULLWIDTHMIDDLEDOT",th="SEMI",nh="SLASH",rh="TILDE",oh="UNDERSCORE",ih="EMOJI",sh="SYM";var ah=Object.freeze({__proto__:null,WORD:sd,UWORD:ad,ASCIINUMERICAL:ld,ALPHANUMERICAL:cd,LOCALHOST:dd,TLD:hd,UTLD:ud,SCHEME:pd,SLASH_SCHEME:fd,NUM:md,WS:gd,NL:yd,OPENBRACE:bd,CLOSEBRACE:vd,OPENBRACKET:wd,CLOSEBRACKET:kd,OPENPAREN:xd,CLOSEPAREN:Sd,OPENANGLEBRACKET:Od,CLOSEANGLEBRACKET:Cd,FULLWIDTHLEFTPAREN:Md,FULLWIDTHRIGHTPAREN:Ed,LEFTCORNERBRACKET:Td,RIGHTCORNERBRACKET:Nd,LEFTWHITECORNERBRACKET:Ad,RIGHTWHITECORNERBRACKET:Dd,FULLWIDTHLESSTHAN:Rd,FULLWIDTHGREATERTHAN:Id,AMPERSAND:Pd,APOSTROPHE:Ld,ASTERISK:jd,AT:zd,BACKSLASH:$d,BACKTICK:Bd,CARET:_d,COLON:Fd,COMMA:Vd,DOLLAR:Hd,DOT:Wd,EQUALS:Kd,EXCLAMATION:qd,HYPHEN:Jd,PERCENT:Ud,PIPE:Gd,PLUS:Yd,POUND:Qd,QUERY:Xd,QUOTE:Zd,FULLWIDTHMIDDLEDOT:eh,SEMI:th,SLASH:nh,TILDE:rh,UNDERSCORE:oh,EMOJI:ih,SYM:sh});const lh=/[a-z]/,ch=/\p{L}/u,dh=/\p{Emoji}/u,hh=/\d/,uh=/\s/,ph="\r",fh="\n",mh="️",gh="",yh="";let bh=null,vh=null;function wh(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(e=>e.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,h=-1,u=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(h=0,u=0,d=a):h>=0&&(h+=n[s].length,u++),c+=n[s].length,i+=n[s].length,s++;i-=h,s-=u,c-=h,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function kh(e,t,n,r,o){let i;const s=t.length;for(let n=0;n<s-1;n++){const s=t[n];e.j[s]?i=e.j[s]:(i=new td(r),i.jr=o.slice(),e.j[s]=i),e=i}return i=new td(n),i.jr=o.slice(),e.j[t[s-1]]=i,i}function xh(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Sh={defaultProtocol:"http",events:null,format:Ch,formatHref:Ch,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Oh(e,t=null){let n=Vc({},Sh);e&&(n=Vc(n,e instanceof Oh?e.o:e));const r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Ch(e){return e}function Mh(e,t){this.t="token",this.v=e,this.tk=t}function Eh(e,t){class n extends Mh{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}Oh.prototype={o:Sh,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o&&("object"==typeof o?(o=n.t in o?o[n.t]:Sh[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o)},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},Mh.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Sh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Vc(s,d),{tagName:o,attributes:s,content:i,eventListeners:h}}};const Th=Eh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Nh=Eh("text"),Ah=Eh("nl"),Dh=Eh("url",{isLink:!0,toHref(e=Sh.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==dd&&e[1].t===Fd}}),Rh=e=>new td(e);function Ih(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}const Ph=typeof console<"u"&&console&&console.warn||(()=>{}),Lh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function jh(e,t=!1){if(Lh.initialized&&Ph(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');Lh.customSchemes.push([e,t])}function zh(){Lh.scanner=function(e=[]){const t={};td.groups=t;const n=new td;null==bh&&(bh=xh(_c)),null==vh&&(vh=xh(Fc)),id(n,"'",Ld),id(n,"{",bd),id(n,"}",vd),id(n,"[",wd),id(n,"]",kd),id(n,"(",xd),id(n,")",Sd),id(n,"<",Od),id(n,">",Cd),id(n,"(",Md),id(n,")",Ed),id(n,"「",Td),id(n,"」",Nd),id(n,"『",Ad),id(n,"』",Dd),id(n,"<",Rd),id(n,">",Id),id(n,"&",Pd),id(n,"*",jd),id(n,"@",zd),id(n,"`",Bd),id(n,"^",_d),id(n,":",Fd),id(n,",",Vd),id(n,"$",Hd),id(n,".",Wd),id(n,"=",Kd),id(n,"!",qd),id(n,"-",Jd),id(n,"%",Ud),id(n,"|",Gd),id(n,"+",Yd),id(n,"#",Qd),id(n,"?",Xd),id(n,'"',Zd),id(n,"/",nh),id(n,";",th),id(n,"~",rh),id(n,"_",oh),id(n,"\\",$d),id(n,"・",eh);const r=rd(n,hh,md,{[Hc]:!0});rd(r,hh,r);const o=rd(r,lh,ld,{[qc]:!0}),i=rd(r,ch,cd,{[Jc]:!0}),s=rd(n,lh,sd,{[Wc]:!0});rd(s,hh,o),rd(s,lh,s),rd(o,hh,o),rd(o,lh,o);const a=rd(n,ch,ad,{[Kc]:!0});rd(a,lh),rd(a,hh,i),rd(a,ch,a),rd(i,hh,i),rd(i,lh),rd(i,ch,i);const l=id(n,fh,yd,{[Xc]:!0}),c=id(n,ph,gd,{[Xc]:!0}),d=rd(n,uh,gd,{[Xc]:!0});id(n,yh,d),id(c,fh,l),id(c,yh,d),rd(c,uh,d),id(d,ph),id(d,fh),rd(d,uh,d),id(d,yh,d);const h=rd(n,dh,ih,{[Gc]:!0});id(h,"#"),rd(h,dh,h),id(h,mh,h);const u=id(h,gh);id(u,"#"),rd(u,dh,h);const p=[[lh,s],[hh,o]],f=[[lh,null],[ch,a],[hh,i]];for(let e=0;e<bh.length;e++)kh(n,bh[e],hd,sd,p);for(let e=0;e<vh.length;e++)kh(n,vh[e],ud,ad,f);ed(hd,{tld:!0,ascii:!0},t),ed(ud,{utld:!0,alpha:!0},t),kh(n,"file",pd,sd,p),kh(n,"mailto",pd,sd,p),kh(n,"http",fd,sd,p),kh(n,"https",fd,sd,p),kh(n,"ftp",fd,sd,p),kh(n,"ftps",fd,sd,p),ed(pd,{scheme:!0,ascii:!0},t),ed(fd,{slashscheme:!0,ascii:!0},t),e=e.sort(((e,t)=>e[0]>t[0]?1:-1));for(let t=0;t<e.length;t++){const r=e[t][0],o=e[t][1]?{[Yc]:!0}:{[Qc]:!0};r.indexOf("-")>=0?o[Uc]=!0:lh.test(r)?hh.test(r)?o[qc]=!0:o[Wc]=!0:o[Hc]=!0,od(n,r,r,o)}return od(n,"localhost",dd,{ascii:!0}),n.jd=new td(sh),{start:n,tokens:Vc({groups:t},ah)}}(Lh.customSchemes);for(let e=0;e<Lh.tokenQueue.length;e++)Lh.tokenQueue[e][1]({scanner:Lh.scanner});Lh.parser=function({groups:e}){const t=e.domain.concat([Pd,jd,zd,$d,Bd,_d,Hd,Kd,Jd,md,Ud,Gd,Yd,Qd,nh,sh,rh,oh]),n=[Fd,Vd,Wd,qd,Ud,Xd,Zd,th,Od,Cd,bd,vd,kd,wd,xd,Sd,Md,Ed,Td,Nd,Ad,Dd,Rd,Id],r=[Pd,Ld,jd,$d,Bd,_d,Hd,Kd,Jd,bd,vd,Ud,Gd,Yd,Qd,Xd,nh,sh,rh,oh],o=Rh(),i=id(o,rh);nd(i,r,i),nd(i,e.domain,i);const s=Rh(),a=Rh(),l=Rh();nd(o,e.domain,s),nd(o,e.scheme,a),nd(o,e.slashscheme,l),nd(s,r,i),nd(s,e.domain,s);const c=id(s,zd);id(i,zd,c),id(a,zd,c),id(l,zd,c);const d=id(i,Wd);nd(d,r,i),nd(d,e.domain,i);const h=Rh();nd(c,e.domain,h),nd(h,e.domain,h);const u=id(h,Wd);nd(u,e.domain,h);const p=Rh(Th);nd(u,e.tld,p),nd(u,e.utld,p),id(c,dd,p);const f=id(h,Jd);id(f,Jd,f),nd(f,e.domain,h),nd(p,e.domain,h),id(p,Wd,u),id(p,Jd,f);const m=id(p,Fd);nd(m,e.numeric,Th);const g=id(s,Jd),y=id(s,Wd);id(g,Jd,g),nd(g,e.domain,s),nd(y,r,i),nd(y,e.domain,s);const b=Rh(Dh);nd(y,e.tld,b),nd(y,e.utld,b),nd(b,e.domain,s),nd(b,r,i),id(b,Wd,y),id(b,Jd,g),id(b,zd,c);const v=id(b,Fd),w=Rh(Dh);nd(v,e.numeric,w);const k=Rh(Dh),x=Rh();nd(k,t,k),nd(k,n,x),nd(x,t,k),nd(x,n,x),id(b,nh,k),id(w,nh,k);const S=id(a,Fd),O=id(l,Fd),C=id(O,nh),M=id(C,nh);nd(a,e.domain,s),id(a,Wd,y),id(a,Jd,g),nd(l,e.domain,s),id(l,Wd,y),id(l,Jd,g),nd(S,e.domain,k),id(S,nh,k),id(S,Xd,k),nd(M,e.domain,k),nd(M,t,k),id(M,nh,k);const E=[[bd,vd],[wd,kd],[xd,Sd],[Od,Cd],[Md,Ed],[Td,Nd],[Ad,Dd],[Rd,Id]];for(let e=0;e<E.length;e++){const[r,o]=E[e],i=id(k,r);id(x,r,i),id(i,o,k);const s=Rh(Dh);nd(i,t,s);const a=Rh();nd(i,n),nd(s,t,s),nd(s,n,a),nd(a,t,s),nd(a,n,a),id(s,o,k),id(a,o,k)}return id(o,dd,b),id(o,yd,Ah),{start:o,tokens:ah}}(Lh.scanner.tokens);for(let e=0;e<Lh.pluginQueue.length;e++)Lh.pluginQueue[e][1]({scanner:Lh.scanner,parser:Lh.parser});return Lh.initialized=!0,Lh}function $h(e){return Lh.initialized||zh(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=e,l=null,c=null,d=0,h=null,u=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(u=0,h=a):u>=0&&u++,o++,d++;if(u<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(Ih(Nh,t,s)),s=[]),o-=u,d-=u;const e=h.t,r=n.slice(o-d,o);i.push(Ih(e,t,r))}}return s.length>0&&i.push(Ih(Nh,t,s)),i}(Lh.parser.start,e,wh(Lh.scanner.start,e))}function Bh(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Oh(n),o=$h(e),i=[];for(let e=0;e<o.length;e++){const n=o[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&i.push(n.toFormattedObject(r))}return i}function _h(e){return new Yt({key:new Zt("autolink"),appendTransaction:(t,n,r)=>{const o=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),i=t.some((e=>e.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(e,t){const n=new Nt(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]);return function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,o)=>{const i=[];if(e.ranges.length)e.forEach(((e,t)=>{i.push({from:e,to:t})}));else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach((({from:e,to:n})=>{const i=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(i,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),Hs(r)}(a).forEach((({newRange:t})=>{const n=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,t,(e=>e.isTextblock));let o,i;if(n.length>1?(o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ")):n.length&&r.doc.textBetween(t.from,t.to," "," ").endsWith(" ")&&(o=n[0],i=r.doc.textBetween(o.pos,t.to,void 0," ")),o&&i){const t=i.split(" ").filter((e=>""!==e));if(t.length<=0)return!1;const n=t[t.length-1],a=o.pos+i.lastIndexOf(n);if(!n)return!1;const l=$h(n).map((t=>t.toObject(e.defaultProtocol)));if(!function(e){return 1===e.length?e[0].isLink:!(3!==e.length||!e[1].isLink)&&["()","[]"].includes(e[0].value+e[2].value)}(l))return!1;l.filter((e=>e.isLink)).map((e=>({...e,from:a+e.start+1,to:a+e.end+1}))).filter((e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code))).filter((t=>e.validate(t.value))).filter((t=>e.shouldAutoLink(t.value))).forEach((t=>{Ws(t.from,t.to,r.doc).some((t=>t.mark.type===e.type))||s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}})),s.steps.length?s:void 0}})}$h.scan=wh;const Fh=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Vh(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach((e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)})),!e||e.replace(Fh,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Hh=ps.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach((e=>{"string"!=typeof e?jh(e.scheme,e.optionalSlashes):jh(e)}))},onDestroy(){td.groups={},Lh.scanner=null,Lh.parser=null,Lh.tokenQueue=[],Lh.pluginQueue=[],Lh.customSchemes=[],Lh.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Vh(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!Vh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!Vh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Gi(this.options.HTMLAttributes,e),0]:["a",Gi(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!Vh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!Vh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ua({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=Bh(e).filter((e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!Vh(e,n),protocols:n,defaultProtocol:r})));o.length&&o.forEach((e=>t.push({text:e.value,data:{href:e.href},index:e.start})))}return t},type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(_h({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Vh(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),!0===this.options.openOnClick&&e.push(function(e){return new Yt({key:new Zt("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button||!t.editable)return!1;let s=r.target;const a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find((e=>"A"===e.nodeName)))return!1;const l=Vs(t.state,e.type.name),c=r.target,d=null!==(o=null==c?void 0:c.href)&&void 0!==o?o:l.href,h=null!==(i=null==c?void 0:c.target)&&void 0!==i?i:l.target;return!(!c||!d||(window.open(d,h),0))}}})}({type:this.type})),this.options.linkOnPaste&&e.push(function(e){return new Yt({key:new Zt("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:o}=t,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((e=>{a+=e.textContent}));const l=Bh(a,{defaultProtocol:e.defaultProtocol}).find((e=>e.isLink&&e.value===a));return!(!a||!l)&&e.editor.commands.setMark(e.type,{href:l.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),Wh=ha.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Gi(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Kh="textStyle",qh=/^(\d+)\.\s$/,Jh=ha.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Gi(this.options.HTMLAttributes,n),0]:["ol",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Kh)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=da({find:qh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=da({find:qh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Kh)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),Uh=ha.create({name:"doc",topNode:!0,content:"block+"}),Gh=ha.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Yh=ha.create({name:"text",group:"inline"}),Qh=ps.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!1}),parseHTML(){return[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach((e=>{var t,n;const r=e.getAttribute("style"),o=null===(n=null===(t=e.parentElement)||void 0===t?void 0:t.closest("span"))||void 0===n?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)}))})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",Gi(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,((t,n)=>{if(t.isTextblock)return!0;t.marks.filter((e=>e.type===this.type)).some((e=>Object.values(e.attrs).some((e=>!!e))))||e.removeMark(n,n+t.nodeSize,this.type)})),!0}}}});var Xh=vs.create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(e){return e.style.fontSize.replace(/['"]+/g,"")},renderHTML:function(e){return e.fontSize?{style:"font-size: "+e.fontSize}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}});const Zh=[Uh,Gh,Yh,Qh],eu=[Pc.configure({levels:[1,2]}),Wh,Ic,Jh,Hh,Ac,Bc,Xh],tu="_link-dialog-container_jjs9w_1",nu=({open:e,setOpen:t,editor:n,locale:o})=>{const[i,s]=r(""),a=h((()=>"no"===o),[o]);l((()=>{if(e){const{from:e,to:t}=n.state.selection;let r=null;n.state.doc.nodesBetween(e-1,t,(e=>{if(e.marks){const t=e.marks.find((e=>"link"===e.type.name));t&&(r=t.attrs.href)}})),s(r||"");const o=document.querySelector('[data-test="link-input-field"]');null==o||o.focus()}}),[e,n]);return T.jsx(v,{open:e,dataTest:"link-modal-rte",onClose:()=>t(!1),className:"z-[99]",dialogTitle:T.jsx("div",{className:"text-gray-700",children:a?"Legg til lenke":"Add link"}),children:T.jsxs("div",{className:tu,children:[T.jsx("div",{className:"link-input-field",children:T.jsx(m,{autoFocus:!0,multiline:!0,className:"w-full",dataTest:"link-input-field",size:"small",sx:{"& .MuiInputBase-root":{minHeight:64,alignItems:"start"}},value:i,onChange:e=>s(e.target.value)})}),T.jsxs("div",{className:"flex gap-2 p-0 w-full justify-end",children:[T.jsx(y,{dataTest:"delete-customer-reject-button",size:"medium",variant:"outlined",onClick:()=>{t(!1),s("")},children:a?"Avbryt":"Cancel"}),T.jsx(y,{dataTest:"delete-customer-confirm-button",size:"medium",variant:"contained",onClick:()=>{n.chain().focus().setLink({href:i}).run(),t(!1),s("")},children:a?"Legg til lenke":"Add link"})]})]})})},ru=vs.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Yt({key:new Zt("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;const i=this.editor.isEmpty;return e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&Us(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=$o.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren})),Fo.create(e,o)}}})]}}),ou=({dataTest:e,id:t,inputRef:o,className:s,editorClassName:a,disabled:l,readOnly:c,error:d,locale:h,title:p,placeholder:f,helperText:m,required:g,maxScrollableHeight:y,toolbarDefaultVisible:b,hideToolbar:v,noDefaultStyles:x,...S})=>{const O=n(),C=Ba({...S,extensions:[ru.configure({placeholder:f}),...Zh,...eu,...S.extensions||[]],parseOptions:{preserveWhitespace:!0,...S.parseOptions},shouldRerenderOnTransaction:S.shouldRerenderOnTransaction||!1,immediatelyRender:S.immediatelyRender||!0,editable:S.editable||!l&&!c,onSelectionUpdate:e=>{var t;null==(t=S.onSelectionUpdate)||t.call(S,e),O.current=e.editor.state.selection.anchor,e.editor.commands.focus()}},[S.extensions,S.shouldRerenderOnTransaction,S.immediatelyRender,S.editable,S.content,l,c,f]);i((()=>{void 0!==O.current&&(null==C||C.commands.setTextSelection(O.current))}),[S.content,C]);const[M,E]=r(b),[N,D]=r(!1);u(o,(()=>C));const[R,I]=r(!1);return i((()=>{const e=()=>I(!0),t=()=>I(!1);return null==C||C.on("focus",e),null==C||C.on("blur",t),()=>{null==C||C.off("focus",e),null==C||C.off("blur",t)}}),[C]),C?T.jsxs(T.Fragment,{children:[T.jsxs(w,{className:s,children:[p&&T.jsx("p",{className:"font-semibold text-base text-gray-700 mb-2",children:p}),T.jsxs("div",{className:A(!x&&"rte-wrapper","outlined"===c&&"readonly-outlined","plain"===c&&"readonly-plain",d&&!R&&"error-state",R&&!c&&(d?"error-focused-state":"focused-state")),children:[T.jsx(Oa,{"data-test":e,id:t,className:A("border-none rounded-none",!x&&"core-ui-rte",!v&&!l&&!c&&!M&&"displace-text",!x&&!l&&!c&&"edit-mode",a),editor:C,onClick:()=>null==C?void 0:C.chain().focus().run(),style:{"--max-scrollable-height":y?`${y}${"number"==typeof y?"px":""}`:"none"}}),!v&&!l&&!c&&!M&&T.jsx(kc,{onClick:()=>E(!0),className:"cursor-pointer absolute bottom-2.5 right-4",icon:"material-symbols:format-color-text",color:"var(--colors-gray-700)",height:24,width:24}),!v&&!l&&!c&&M&&T.jsx(Cc,{editor:C,onClose:()=>E(!1),error:d,focused:R,openLinkDialog:()=>D(!0),locale:h})]}),(d||g)&&!c&&T.jsx(k,{error:d,"data-test":`error-${e}`,children:m})]}),T.jsx(nu,{open:N,setOpen:D,editor:C,locale:h})]}):null};export{ou as RichInput};
|