pillardash-ui-react 0.1.92 → 0.1.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -47,5 +47,5 @@ var C={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"
|
|
|
47
47
|
*
|
|
48
48
|
* This source code is licensed under the MIT license found in the
|
|
49
49
|
* LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/"production"===process.env.NODE_ENV?Qu.exports=function(){if(Ju)return Zu;Ju=1;var e=r,t=Gu,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Zu.useSyncExternalStoreWithSelector=function(e,t,r,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,n(o,e))return t;var r=c(e);return void 0!==d&&d(t,r)?(o=e,t):(o=e,i=r)}var o,i,s=!1,a=void 0===r?null:r;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,r,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},Zu}():Qu.exports=(ep||(ep=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=r,t=Gu,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;tp.useSyncExternalStoreWithSelector=function(e,t,r,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,n(o,e))return t;var r=c(e);return void 0!==d&&d(t,r)?(o=e,t):(o=e,i=r)}var o,i,s=!1,a=void 0===r?null:r;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,r,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),tp);var np=Qu.exports,rp=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},op=({contentComponent:t})=>{const r=Gu.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return e(n,{children:Object.values(r)})};var ip=class extends r.Component{constructor(e){var t;super(e),this.editorContentRef=r.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=function(){const e=new Set;let t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:m.createPortal(r.reactElement,r.element,n)},e.forEach((e=>e()))},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach((e=>e()))}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe((()=>{this.setState((e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0})),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()}))),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(!t)return;if(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!(null==(e=t.options.element)?void 0:e.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:r,innerRef:o,...i}=this.props;return t(n,{children:[e("div",{ref:rp(o,this.editorContentRef),...i}),(null==r?void 0:r.contentComponent)&&e(op,{contentComponent:r.contentComponent})]})}},sp=o(((e,t)=>{const n=r.useMemo((()=>Math.floor(4294967295*Math.random()).toString()),[e.editor]);return r.createElement(ip,{key:n,innerRef:t,...e})})),ap=r.memo(sp),lp="undefined"!=typeof window?h:l,cp=class{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)}}}};var dp="production"!==process.env.NODE_ENV,hp="undefined"==typeof window,up=hp||Boolean("undefined"!=typeof window&&window.next),pp=class e{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){if(hp||up){if(dp)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&hp&&dp)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.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new Dc(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[n])})):e[n]===t[n])))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{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 fp(e={},t=[]){const n=a(e);n.current=e;const[r]=s((()=>new pp(n))),o=Gu.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return d(o),l(r.onRender(t)),function(e){var t;const[n]=s((()=>new cp(e.editor))),r=np.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:Xu);lp((()=>n.watch(e.editor)),[e.editor,n]),d(r)}({editor:o,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),o}u({editor:null}).Consumer;var mp=u({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});r.forwardRef(((t,n)=>{const{onDragStart:r}=p(mp),o=t.as||"div";return e(o,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})})),r.createContext({markViewContentRef:()=>{}});var gp=/^\s*>\s$/,yp=Ic.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return Bc("blockquote",{...va(this.options.HTMLAttributes,e),children:Bc("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[zc({find:gp,type:this.type})]}}),vp=Ic.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",va(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),bp=Ic.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",va(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof $n){const e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){const e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return Ka(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(Pn.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection($n.create(e.doc,t.pos)):e.setSelection(Pn.create(e.doc,t.pos));else{const o=null==(n=t.parent.type.contentMatch.defaultType)?void 0:n.create();o&&(e.insert(r,o),e.setSelection(Pn.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new Ya({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ma(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}}))];var e}});function xp(e={}){return new Xn({view:t=>new wp(t,e)})}class wp{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=gn(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class kp extends Rn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return kp.valid(n)?new kp(n):Rn.near(n)}content(){return Fe.empty}eq(e){return e instanceof kp&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new kp(e.resolve(t.pos))}getBookmark(){return new Np(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&kp.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(kp.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!$n.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let s=e.doc.resolve(r);if(kp.valid(s))return s}return null}}}kp.prototype.visible=!1,kp.findFrom=kp.findGapCursorFrom,Rn.jsonID("gapcursor",kp);class Np{constructor(e){this.pos=e}map(e){return new Np(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return kp.valid(t)?new kp(t):Rn.near(t)}}const Cp=Es({ArrowLeft:Sp("horiz",-1),ArrowRight:Sp("horiz",1),ArrowUp:Sp("vert",-1),ArrowDown:Sp("vert",1)});function Sp(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof Pn){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=kp.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new kp(l))),!0)}}function Mp(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!kp.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&$n.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new kp(r))),!0)}function Tp(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof kp))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=Ie.empty;for(let e=r.length-1;e>=0;e--)o=Ie.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new Fe(o,0,0));return i.setSelection(Pn.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function Op(e){if(!(e.selection instanceof kp))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Fi.create(e.doc,[$i.widget(e.selection.head,t,{key:"gapcursor"})])}var Ep=200,Ap=function(){};Ap.prototype.append=function(e){return e.length?(e=Ap.from(e),!this.length&&e||e.length<Ep&&this.leafAppend(e)||this.length<Ep&&e.leafPrepend(this)||this.appendInner(e)):this},Ap.prototype.prepend=function(e){return e.length?Ap.from(e).append(this):this},Ap.prototype.appendInner=function(e){return new Rp(this,e)},Ap.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Ap.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ap.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ap.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Ap.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Ap.from=function(e){return e instanceof Ap?e:e&&e.length?new Dp(e):Ap.empty};var Dp=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Ep)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Ep)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Ap);Ap.empty=new Dp([]);var Rp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Ap);class Lp{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new zp(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new zp(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new Lp(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),d=new zp(e.mapping.maps[n],c,t);(l=a&&a.merge(d))&&(d=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(d),t&&(i++,t=void 0),r||(a=d)}let l=i-n.depth;return l>Pp&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new Lp(s.append(o),i)}remapping(e,t){let n=new Kt;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Lp(this.items.append(e.map((e=>new zp(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new zp(l,i,c))}else n.push(new zp(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new zp(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new Lp(c,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new zp(s.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new Lp(Ap.from(r.reverse()),o)}}Lp.empty=new Lp(Ap.empty,0);class zp{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new zp(t.getMap().invert(),t,this.selection)}}}class Ip{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Pp=20;function Bp(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,o)=>t.push(r,o)));return t}function $p(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let Vp=!1,jp=null;function Fp(e){let t=e.plugins;if(jp!=t){Vp=!1,jp=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Vp=!0;break}}return Vp}const Hp=new er("history"),_p=new er("closeHistory");function qp(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Xn({key:Hp,state:{init:()=>new Ip(Lp.empty,Lp.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(Hp);if(i)return i.historyState;n.getMeta(_p)&&(e=new Ip(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Hp))return s.getMeta(Hp).redo?new Ip(e.done.addTransform(n,void 0,r,Fp(t)),e.undone,Bp(n.mapping.maps),e.prevTime,e.prevComposition):new Ip(e.done,e.undone.addTransform(n,void 0,r,Fp(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Ip(e.done.rebased(n,o),e.undone.rebased(n,o),$p(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ip(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),$p(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),a=s?$p(e.prevRanges,n.mapping):Bp(n.mapping.maps);return new Ip(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Fp(t)),Lp.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Kp:"historyRedo"==n?Up:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Wp(e,t){return(n,r)=>{let o=Hp.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=Fp(t),o=Hp.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new Ip(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Hp,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const Kp=Wp(!1,!0),Up=Wp(!0,!0);ll.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter((e=>""!==e)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Xn({key:new er("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit;if(null==o||0===o)return void(e=!0);const i=this.storage.characters({node:r.doc});if(i>o){const t=0,n=i-o;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const s=r.tr.deleteRange(t,n);return e=!0,s}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,s=i-(o-n),a=i;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}});var Jp=ll.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[xp(this.options)]}});ll.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Xn({key:new er("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return Fi.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;i.push($i.node(t,t+e.nodeSize,{class:this.options.className}))})),Fi.create(e,i)}}})]}});var Gp=ll.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Xn({props:{decorations:Op,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&kp.valid(n)?new kp(n):null,handleClick:Mp,handleKeyDown:Cp,handleDOMEvents:{beforeinput:Tp}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=ma(ha(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}});function Yp({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}ll.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Xn({key:new er("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&&Wa(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=$i.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})),Fi.create(e,o)}}})]}}),ll.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new Xn({key:new er("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||Ka(n.selection)||e.view.dragging?null:Fi.create(n.doc,[$i.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var Xp=ll.create({name:"trailingNode",addOptions:()=>({node:"paragraph",notAfter:[]}),addProseMirrorPlugins(){const e=new er(this.name),t=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>(this.options.notAfter||[]).concat(this.options.node).includes(e.name)));return[new Xn({key:e,appendTransaction:(t,n,r)=>{const{doc:o,tr:i,schema:s}=r,a=e.getState(r),l=o.content.size,c=s.nodes[this.options.node];if(a)return i.insert(l,c.create())},state:{init:(e,n)=>!Yp({node:n.tr.doc.lastChild,types:t}),apply:(e,n)=>{if(!e.docChanged)return n;return!Yp({node:e.doc.lastChild,types:t})}}})]}}),Qp=ll.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Kp(e,t),redo:()=>({state:e,dispatch:t})=>Up(e,t)}),addProseMirrorPlugins(){return[qp(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Zp=ll.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return!1!==this.options.bold&&o.push(Hc.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(yp.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(Uc.configure(this.options.bulletList)),!1!==this.options.code&&o.push(md.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(bd.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(wd.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(Jp.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(Gp.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(vp.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(Nd.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(Qp.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(bp.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(Ed.configure(this.options.italic)),!1!==this.options.listItem&&o.push(Jc.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(id.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(Au.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(ld.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(zu.configure(this.options.paragraph)),!1!==this.options.strike&&o.push($u.configure(this.options.strike)),!1!==this.options.text&&o.push(ju.configure(this.options.text)),!1!==this.options.underline&&o.push(Hu.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(Xp.configure(null==(r=this.options)?void 0:r.trailingNode)),o}}),ef=function(n){var r=n.initialContent,o=void 0===r?"":r,i=n.onUpdate,s=fp({extensions:[Zp.configure({heading:!1,codeBlock:!1}),kd,Iu,Fu,_c,Ad,_u,Vu,gd,xd.configure({HTMLAttributes:{class:"bg-gray-100 p-3 rounded text-sm font-mono"}}),Cd.configure({levels:[1,2,3]}),ud,Lu,Ru,Du.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline"}})],content:o,onUpdate:function(e){var t=e.editor;i(t.getHTML())},editorProps:{attributes:{class:"prose prose-sm sm:prose lg:prose-lg xl:prose-2xl mx-auto focus:outline-none min-h-[200px] p-4"}},immediatelyRender:!1});return s?t("div",{className:"rounded-lg border border-gray-200 shadow-sm",children:[t("div",{className:"flex flex-wrap items-center gap-1 border-b bg-gray-50 p-3",children:[e("button",{onClick:function(){return s.chain().focus().undo().run()},className:"p-2 rounded hover:bg-gray-200 transition-colors ".concat(s.can().undo()?"":"opacity-50 cursor-not-allowed"),type:"button",disabled:!s.can().undo(),title:"Undo",children:e(ae,{size:16})}),e("button",{onClick:function(){return s.chain().focus().redo().run()},className:"p-2 rounded hover:bg-gray-200 transition-colors ".concat(s.can().redo()?"":"opacity-50 cursor-not-allowed"),type:"button",disabled:!s.can().redo(),title:"Redo",children:e(te,{size:16})}),e("div",{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleHeading({level:1}).run()},className:"p-2 rounded transition-colors ".concat(s.isActive("heading",{level:1})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 1",children:e(q,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleHeading({level:2}).run()},className:"p-2 rounded transition-colors ".concat(s.isActive("heading",{level:2})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 2",children:e(W,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleHeading({level:3}).run()},className:"p-2 rounded transition-colors ".concat(s.isActive("heading",{level:3})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 3",children:e(K,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleBold().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("bold")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Bold",children:e(O,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleItalic().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("italic")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Italic",children:e(J,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleUnderline().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("underline")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Underline",children:e(se,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleStrike().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("strike")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Strikethrough",children:e(re,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleBulletList().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("bulletList")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Bullet List",children:e(X,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleOrderedList().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("orderedList")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Numbered List",children:e(Y,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleCode().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("code")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Inline Code",children:e(I,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleCodeBlock().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("codeBlock")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Code Block",children:e(V,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleBlockquote().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("blockquote")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Quote",children:e(ee,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),s.isActive("link")?e("button",{onClick:function(){null==s||s.chain().focus().unsetLink().run()},className:"p-2 rounded bg-blue-200 text-blue-800 hover:bg-blue-300 transition-colors",type:"button",title:"Remove Link",children:e(G,{size:16})}):e("button",{onClick:function(){var e=window.prompt("Enter URL:");e&&(null==s||s.chain().focus().setLink({href:e}).run())},className:"p-2 rounded hover:bg-gray-200 transition-colors",type:"button",title:"Add Link",children:e(G,{size:16})})]}),e(ap,{editor:s,className:"min-h-[300px] focus-within:bg-white"})]}):e("div",{className:"rounded-lg border bg-gray-50 h-48 animate-pulse"})};function tf(n){var r=n.options,o=n.placeholder,i=void 0===o?"Select an option":o,a=n.onChange,l=n.value,c=n.size,d=void 0===c?"md":c,h=n.className,u=void 0===h?"":h,p=n.name,f=n.id,m=n.disabled,g=void 0!==m&&m,y=n.label,v=n.required,b=s(!1),x=b[0],w=b[1],k=s(l&&r.find((function(e){return e.value===l}))||null),N=k[0],C=k[1];return t("div",{className:"relative inline-block",children:[y&&t("label",{htmlFor:f,className:"mb-1 block text-sm font-medium text-gray-700",children:[y,v&&e("span",{className:"ml-1 text-red-500",children:"*"})]}),t("button",{type:"button",className:"flex w-full items-center justify-between rounded-md border border-gray-200 bg-white shadow-sm ".concat({sm:"px-3 py-2 text-sm",md:"px-4 py-2.5 text-base"}[d]," text-gray-700 hover:bg-gray-50 focus:outline-none ").concat(g?"cursor-not-allowed opacity-50":""," ").concat(u),onClick:function(){return!g&&w(!x)},disabled:g,id:f,children:[e("span",{className:"truncate",children:N?(null==N?void 0:N.label)||N.value:i}),e(A,{className:"ml-2 h-4 w-4 ".concat(x?"rotate-180 transform":"")})]}),x&&e("div",{className:"absolute z-10 mt-1 max-h-60 w-full min-w-[200px] p-1 font-medium text-sm overflow-auto rounded-lg bg-white shadow-xl",children:r.map((function(n){return t("div",{className:"cursor-pointer px-3 py-2 hover:bg-gray-100 rounded-lg flex justify-between item-center ".concat((null==N?void 0:N.value)===n.value?"bg-gray-50 text-black":"text-gray-900"),onClick:function(){return function(e){C(e),a(e.value),w(!1)}(n)},children:[e("div",{children:n.label||n.value}),(null==N?void 0:N.value)===n.value&&e("div",{children:e(E,{size:15,className:"text-primary"})})]},n.value)}))}),p&&e("input",{type:"hidden",name:p,value:(null==N?void 0:N.value)||""})]})}var nf=function(n){var r=n.message,o=n.description,i=n.type,a=void 0===i?"info":i,c=n.duration,d=void 0===c?5e3:c,h=n.onClose,u=s(!0),p=u[0],f=u[1],m=s(100),g=m[0],y=m[1],v={success:{icon:e(L,{className:"h-5 w-5"}),bgColor:"bg-green-50",borderColor:"border-green-300",textColor:"text-green-800",iconColor:"text-green-500",progressColor:"bg-green-500"},error:{icon:e(R,{className:"h-5 w-5"}),bgColor:"bg-rose-50",borderColor:"border-rose-300",textColor:"text-rose-800",iconColor:"text-rose-500",progressColor:"bg-rose-500"},info:{icon:e(U,{className:"h-5 w-5"}),bgColor:"bg-blue-50",borderColor:"border-blue-300",textColor:"text-blue-800",iconColor:"text-blue-500",progressColor:"bg-blue-500"},warning:{icon:e(ie,{className:"h-5 w-5"}),bgColor:"bg-amber-50 ",borderColor:"border-amber-300 ",textColor:"text-amber-800",iconColor:"text-amber-500",progressColor:"bg-amber-500"}};l((function(){var e=setTimeout((function(){f(!1),setTimeout((function(){null==h||h()}),300)}),d),t=setInterval((function(){y((function(e){var t=e-100/(d/100);return t<=0?0:t}))}),100);return function(){clearTimeout(e),clearInterval(t)}}),[d,h]);var b=v[a],x=b.icon,w=b.bgColor,k=b.borderColor,N=b.textColor,C=b.iconColor,S=b.progressColor;return e("div",{className:"fixed right-4 top-4 z-50 transform transition-all duration-300 ".concat(p?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:t("div",{className:"flex w-72 rounded-lg border shadow-lg md:w-96 ".concat(k," ").concat(w," p-4"),children:[e("div",{className:"flex-shrink-0 ".concat(C),children:x}),t("div",{className:"ml-3 w-full",children:[t("div",{className:"flex items-start justify-between",children:[e("div",{className:"text-md font-semibold ".concat(N),children:r}),e("button",{onClick:function(){f(!1),setTimeout((function(){null==h||h()}),300)},className:"text-gray-600 hover:text-gray-600 focus:outline-none",children:e(de,{className:"h-4 w-4"})})]}),o&&e("p",{className:"mt-1 text-sm ".concat(N," opacity-80"),children:o}),e("div",{className:"mt-2 h-1 w-full rounded-full bg-gray-200",children:e("div",{className:"".concat(S," h-1 rounded-full transition-all duration-100 ease-linear"),style:{width:"".concat(g,"%")}})})]})]})})},rf=null,of=u(void 0),sf=function(n){var r=n.children,o=s([]),i=o[0],a=o[1],l=f((function(e){a((function(t){return t.filter((function(t){return t.id!==e}))}))}),[]),c=f((function(e){var t=Math.random().toString(36).substring(2,9),n=me(me({},e),{id:t,onClose:function(){return l(t)}});a((function(e){return ye(ye([],e,!0),[n],!1)}))}),[l]),d=f((function(e){return function(t,n){c({message:t,description:n,type:e})}}),[c]),h={showAlert:c,success:d("success"),error:d("error"),info:d("info"),warning:d("warning")};return rf=h,t(of.Provider,{value:h,children:[r,e("div",{className:"fixed right-4 top-4 z-50 space-y-2 w-full max-w-xs",children:i.map((function(t,n){return e("div",{style:{transform:"translateY(".concat(10*n,"px)"),zIndex:50-n},children:e(nf,me({},t))},t.id)}))})]})},af=function(){var e=p(of);if(void 0===e)throw new Error("useAlert must be used within a AlertProvider");return e},lf={success:function(e,t){rf?rf.success(e,t):console.warn("AlertProvider not mounted yet")},error:function(e,t){rf?rf.error(e,t):console.warn("AlertProvider not mounted yet")},info:function(e,t){rf?rf.info(e,t):console.warn("AlertProvider not mounted yet")},warning:function(e,t){rf?rf.warning(e,t):console.warn("AlertProvider not mounted yet")},show:function(e){rf?rf.showAlert(e):console.warn("AlertProvider not mounted yet")}},cf=function(n){var r=n.isOpen,o=n.onConfirm,i=n.onCancel,s=n.title,c=n.message,d=n.confirmText,h=void 0===d?"Confirm":d,u=n.cancelText,p=void 0===u?"Cancel":u,f=n.type,m=void 0===f?"default":f,g=n.showIcon,y=void 0===g||g,v=n.showCloseButton,b=void 0===v||v,w=n.closeOnOverlayClick,k=void 0===w||w,N=n.closeOnEscape,C=void 0===N||N,S=n.isLoading,M=void 0!==S&&S,T=n.className,O=void 0===T?"":T,E=n.overlayClassName,A=void 0===E?"":E,D=n.maxWidth,R=void 0===D?"sm":D,I=a(null),P=a(null),B=a(null);l((function(){return r?(B.current=document.activeElement,setTimeout((function(){var e,t,n;"danger"===m?null===(t=null===(e=I.current)||void 0===e?void 0:e.querySelector("[data-cancel-button]"))||void 0===t||t.focus():null===(n=P.current)||void 0===n||n.focus()}),100),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",B.current&&B.current.focus()),function(){document.body.style.overflow="unset"}}),[r,m]),l((function(){var e=function(e){"Escape"===e.key&&C&&!M&&i()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,C,i,M]);var $=function(){M||i()},V={default:{icon:U,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"},danger:{icon:z,iconColor:"text-red-600",iconBg:"bg-red-100",confirmButton:"bg-red-600 hover:bg-red-700 focus:ring-red-500"},warning:{icon:ie,iconColor:"text-yellow-600",iconBg:"bg-yellow-100",confirmButton:"bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500"},success:{icon:L,iconColor:"text-green-600",iconBg:"bg-green-100",confirmButton:"bg-green-600 hover:bg-green-700 focus:ring-green-500"},info:{icon:U,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}}[m],j=V.icon;return r?t("div",{className:"fixed inset-0 z-50 ".concat(A),role:"dialog","aria-modal":"true","aria-labelledby":s?"confirmation-title":void 0,"aria-describedby":"confirmation-message",children:[e("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300",onClick:function(e){e.target===e.currentTarget&&k&&!M&&i()}}),e("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:t("div",{ref:I,className:"relative w-full ".concat({sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}[R]," animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-4 transform rounded-2xl bg-white shadow-2xl transition-all duration-300 ease-out ").concat(O," "),onClick:function(e){return e.stopPropagation()},children:[b&&e("button",{onClick:$,disabled:M,className:"absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Close",children:e(de,{size:20})}),t("div",{className:"p-6",children:[t("div",{className:"flex flex-col items-center justify-center space-y-4",children:[y&&e("div",{className:"h-12 w-12 flex-shrink-0 rounded-full ".concat(V.iconBg," flex items-center justify-center"),children:e(j,{size:24,className:V.iconColor})}),t("div",{className:"min-w-0 flex-1 justify-center",children:[s&&e("h3",{id:"confirmation-title",className:"mb-1 text-center text-lg font-semibold text-gray-900",children:s}),e("p",{id:"confirmation-message",className:"leading-relaxed text-gray-600",children:c})]})]}),t("div",{className:"flex ".concat("justify-center"," mt-6 space-x-3"),children:[e(x,{variant:"neutral",outline:!0,size:"small","data-cancel-button":"",onClick:$,disabled:M,children:p}),e("button",{ref:P,onClick:function(){M||o()},disabled:M,className:"flex min-w-[80px] items-center justify-center rounded-xl px-4 py-2 text-sm font-medium text-white transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ".concat(V.confirmButton," "),children:M?e("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):h})]})]})]})})]}):null},df=function(n){var r=n.isOpen,o=n.onClose,i=n.title,s=n.children,c=n.size,d=void 0===c?"md":c,h=n.position,u=void 0===h?"right":h,p=n.showCloseButton,f=void 0===p||p,m=n.closeOnOverlayClick,g=void 0===m||m,y=n.closeOnEscape,v=void 0===y||y,b=n.className,x=void 0===b?"":b,w=n.overlayClassName,k=void 0===w?"":w,N=n.contentClassName,C=void 0===N?"":N,S=n.headerClassName,M=void 0===S?"":S,T=n.footer,O=n.footerClassName,E=void 0===O?"":O,A=n.maxHeight,D=void 0!==A&&A,R=a(null),L=a(null);l((function(){var e;return r?(L.current=document.activeElement,null===(e=R.current)||void 0===e||e.focus(),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",L.current&&L.current.focus()),function(){document.body.style.overflow="unset"}}),[r]),l((function(){var e=function(e){"Escape"===e.key&&v&&o()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,v,o]);var z=function(e){e.target===e.currentTarget&&g&&"full"!==d&&o()};return r?t("div",{className:"fixed inset-0 z-50 ".concat(k),role:"dialog","aria-modal":"true","aria-labelledby":i?"modal-title":void 0,children:["full"!==d&&e("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-700",onClick:z}),e("div",{className:"fixed inset-0 flex ".concat("p-0"," ").concat(function(){if("full"===d)return"items-start justify-start";return{left:"items-start justify-start",right:"items-start justify-end",center:"items-center justify-center"}[u]}()),onClick:z,children:t("div",{ref:R,tabIndex:-1,className:"\n relative w-full ".concat({xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full h-full"}[d]," bg-white shadow-2xl transform transition-all duration-700 ease-out flex flex-col\n ").concat("full"===d?"h-full max-h-screen overflow-hidden":"left"===u||"right"===u?"h-full ".concat(D?"max-h-screen":""):"".concat(D?"max-h-[90vh] overflow-hidden":""),"\n ").concat("full"===d?"animate-in fade-in-0":"center"===u?"animate-in fade-in-0 zoom-in-95":"left"===u?"animate-in slide-in-from-left-full":"animate-in slide-in-from-right-full","\n ").concat(x,"\n "),onClick:function(e){return e.stopPropagation()},children:[(i||f)&&t("div",{className:"flex items-center justify-between px-6 py-3 border-b border-gray-200 flex-shrink-0 ".concat(M),children:[i&&e("h2",{id:"modal-title",className:"text-xl font-semibold text-gray-900 truncate pr-4",children:i}),f&&e("button",{onClick:o,className:"flex items-center justify-center w-8 h-8 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","aria-label":"Close modal",children:e(de,{size:20})})]}),e("div",{className:"flex-1 min-h-0 overflow-y-auto ".concat(D||"full"===d?"overflow-y-auto":""," ").concat(C),children:e("div",D&&("left"===u||"right"===u)||"full"===d?{className:"p-6 min-h-0 flex-1",children:s}:{className:"p-6",children:s})}),T&&e("div",{className:"px-6 py-4 border-t border-gray-200 flex-shrink-0 ".concat(""," ").concat(E),children:T})]})})]}):null},hf=function(){var n=r.useState(!1),o=n[0],i=n[1],s=r.useState("left"),a=s[0],l=s[1],c=r.useState("md"),d=c[0],h=c[1],u=t("div",{className:"flex justify-end space-x-3",children:[e("button",{onClick:function(){return i(!1)},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200",children:"Cancel"}),e("button",{onClick:function(){return i(!1)},className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200",children:"Save Changes"})]});return t("div",{className:"p-8 space-y-4",children:[t("div",{className:"flex flex-wrap gap-4 mb-6",children:[t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Position"}),t("select",{value:a,onChange:function(e){return l(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",disabled:"full"===d,children:[e("option",{value:"left",children:"Left"}),e("option",{value:"right",children:"Right"}),e("option",{value:"center",children:"Center"})]})]}),t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Size"}),t("select",{value:d,onChange:function(e){return h(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[e("option",{value:"xs",children:"Extra Small"}),e("option",{value:"sm",children:"Small"}),e("option",{value:"md",children:"Medium"}),e("option",{value:"lg",children:"Large"}),e("option",{value:"xl",children:"Extra Large"}),e("option",{value:"2xl",children:"2X Large"}),e("option",{value:"full",children:"Full Screen"})]})]})]}),e("button",{onClick:function(){return i(!0)},className:"px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors duration-200 font-medium",children:"Open Modal"}),e(df,{isOpen:o,onClose:function(){return i(!1)},title:"Example Modal",size:d,position:a,footer:u,maxHeight:"center"!==a,children:t("div",{className:"space-y-4",children:[e("p",{className:"text-gray-600",children:"This is an example of the multipurpose modal component. It supports different sizes, positions, and configurations."}),t("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e("h4",{className:"font-medium text-gray-900 mb-2",children:"Features:"}),t("ul",{className:"text-sm text-gray-600 space-y-1 list-disc list-inside",children:[e("li",{children:"Multiple sizes (xs, sm, md, lg, xl, 2xl, full screen)"}),e("li",{children:"Three positions (left, right, center)"}),e("li",{children:"Customizable styling with className props"}),e("li",{children:"Keyboard navigation and accessibility"}),e("li",{children:"Click outside to close (disabled for full screen)"}),e("li",{children:"Smooth animations"}),e("li",{children:"Optional footer with actions"}),e("li",{children:"Full screen mode without margins or border radius"})]})]}),("left"===a||"right"===a||"full"===d)&&e("div",{className:"space-y-2",children:Array.from({length:20},(function(e,n){return t("p",{className:"text-gray-600",children:["This is paragraph ",n+1," to demonstrate scrolling in side panels","full"===d?" and full screen mode":"","."]},n)}))})]})})]})};function uf(n){var r=n.currentPage,o=n.totalPages,i=n.totalItems,s=n.itemsPerPage,a=n.onPageChange,l=n.onViewChange,c=n.loading,d=void 0!==c&&c,h=function(e){e>0&&e<=o&&!d&&a&&a(e)},u=(r-1)*s,p=Math.min(u+s,i);return t("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white py-3",children:[t("div",{className:"flex flex-1 justify-between sm:hidden",children:[e("button",{onClick:function(){return h(r-1)},disabled:1===r||d,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(1===r||d?"cursor-not-allowed opacity-50":""),children:"Previous"}),e("button",{onClick:function(){return h(r+1)},disabled:r===o||d,className:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(r===o||d?"cursor-not-allowed opacity-50":""),children:"Next"})]}),t("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[t("div",{className:"flex items-center justify-center gap-2",children:[t("div",{className:"relative",children:[e("select",{value:s,onChange:function(e){return l&&l(e.target.value)},disabled:d,className:"appearance-none rounded-md border border-gray-300 bg-white py-2 pl-3 pr-8 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[10,20,30,50].map((function(t){return e("option",{value:t,children:t},t)}))}),e("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700",children:e("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20",children:e("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),t("p",{className:"text-sm text-gray-700",children:[t("span",{children:[i," Entries"]}),t("span",{className:"ml-1",children:["(Showing ",u+1,"-",p," of ",i,")"]})]})]}),e("div",{children:t("nav",{className:"relative z-0 inline-flex gap-2 -space-x-px rounded-md shadow-sm","aria-label":"Pagination",children:[t("button",{onClick:function(){return h(r-1)},disabled:1===r||d,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 ".concat(1===r||d?"cursor-not-allowed opacity-50":""),children:[e("span",{className:"sr-only",children:"Previous"}),e("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})]}),function(){var e=[];if(o<=5)for(var t=1;t<=o;t++)e.push(t);else{var n=Math.max(1,r-2),i=Math.min(o,n+5-1);i-n<4&&(n=Math.max(1,i-5+1));for(t=n;t<=i;t++)e.push(t)}return e}().map((function(t){return e("button",{onClick:function(){return h(t)},disabled:d,"aria-current":r===t?"page":void 0,className:"relative inline-flex items-center rounded-md border px-4 py-2 text-sm font-semibold ".concat(r===t?"z-10 border-primary-100 bg-primary-50 text-primary":"border-gray-300 bg-white text-gray-500 hover:bg-gray-50"," ").concat(d?"cursor-not-allowed opacity-50":""),children:t},t)})),t(x,{onClick:function(){return h(r+1)},disabled:r===o||d,type:"button",variant:"primary",size:"small",outline:!0,children:["Next Page",e("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]})})]})]})}function pf(t){var r=t.columns,o=void 0===r?5:r,i=t.rows,s=void 0===i?3:i;return e(n,{children:Array.from({length:s}).map((function(t,n){return e("tr",{children:Array.from({length:o}).map((function(t,r){return e("td",{className:"whitespace-nowrap px-6 py-4",children:e("div",{className:"h-4 animate-pulse rounded bg-gray-200"})},"skeleton-cell-".concat(n,"-").concat(r))}))},"skeleton-row-".concat(n))}))})}function ff(r){var o=r.data,i=r.columns,s=r.itemsPerPage,a=void 0===s?20:s,l=r.onViewChange,c=r.totalItems,d=r.currentPage,h=void 0===d?1:d,u=r.onPageChange,p=r.loading,f=void 0!==p&&p,m=r.showPagination,g=void 0===m||m,y=r.onRowClick,v=r.useCardLayout,b=void 0!==v&&v,x=c||o.length,w=Math.ceil(x/a),k=o,N=function(e){y&&y(e)},C=function(){return t("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:[f&&Array.from({length:a}).map((function(n,r){return e("div",{className:"bg-white rounded-lg border border-gray-200 p-4 animate-pulse",children:e("div",{className:"space-y-3",children:i.slice(0,3).map((function(n,r){return t("div",{className:"flex justify-between items-center",children:[e("div",{className:"h-4 bg-gray-200 rounded w-1/3"}),e("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]},r)}))})},r)})),k.length>0?k.map((function(n,r){return e("div",{onClick:function(){return N(n)},className:"bg-white rounded-lg border border-gray-200 p-4 transition-all duration-200 hover:shadow-md hover:border-gray-300 ".concat(y?"cursor-pointer":""," ").concat(f?"opacity-50":""),children:e("div",{className:"space-y-3",children:i.map((function(r,o){return t("div",{className:"flex justify-between items-start",children:[t("span",{className:"text-sm font-medium text-gray-500 flex-shrink-0 mr-3",children:[r.title,":"]}),e("span",{className:"text-sm text-gray-800 text-right",children:"function"==typeof r.value?r.value(n):n[r.value]})]},o)}))})},r)})):!f&&e("div",{className:"col-span-full",children:e(fe,{title:"No Record found"})})]})};return t(n,{children:[b?C():t(n,{children:[e("div",{className:"hidden md:block",children:e("div",{className:"relative overflow-x-auto",children:t("table",{className:"w-full",children:[e("thead",{children:e("tr",{children:i.map((function(t,n){return e("th",{className:"bg-gray-100 px-6 py-3 text-left text-sm font-semibold tracking-wider text-gray-500 ".concat(t.width||""," ").concat(0===n?"rounded-bl-xl rounded-tl-xl":""," ").concat(n===i.length-1?"rounded-br-xl rounded-tr-xl":""," "),children:t.title},n)}))})}),t("tbody",{className:"divide-y divide-gray-200 bg-white \n ".concat(f?"opacity-50":""," ").concat(y?"cursor-pointer":"","\n "),children:[f&&e(pf,{columns:i.length,rows:a}),k.length>0?k.map((function(t,n){return e("tr",{onClick:function(){return N(t)},className:"hover:bg-gray-50",children:i.map((function(n,r){return e("td",{className:"whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-800",children:"function"==typeof n.value?n.value(t):t[n.value]},r)}))},n)})):!f&&e("tr",{children:e("td",{colSpan:i.length,children:e(fe,{title:"No Record found"})})})]})]})})}),e("div",{className:"block md:hidden",children:C()})]}),g&&e(uf,{currentPage:h,totalPages:w,totalItems:x,itemsPerPage:a,onPageChange:u,onViewChange:l,loading:f})]})}function mf(n){var r=n.actions,o=n.trigger,i=n.className,c=void 0===i?"":i,d=n.dropdownClassName,h=void 0===d?"":d,u=s(!1),p=u[0],f=u[1],m=a(null),g=function(){f(!p)},y=function(){f(!1)};l((function(){var e=function(e){m.current&&!m.current.contains(e.target)&&y()};return p&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[p]),l((function(){var e=function(e){"Escape"===e.key&&y()};return p&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[p]);return t("div",{className:"relative inline-block ".concat(c),ref:m,children:[e("div",{className:"flex",children:o?e("div",{onClick:g,className:"cursor-pointer",children:o}):e("button",{className:"rounded-md border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 transition-colors duration-200 focus:ring-offset-2",onClick:g,"aria-expanded":p,"aria-haspopup":"true",children:e(B,{className:"h-4 w-4"})})}),p&&e("div",{className:"absolute right-0 z-50 mt-1 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ".concat(h),children:t("div",{className:"py-1",role:"menu","aria-orientation":"vertical",children:[r.map((function(n,r){return t("button",{className:"flex w-full items-center px-4 py-2 text-left text-sm transition-colors duration-150 ".concat(n.disabled?"cursor-not-allowed bg-gray-50 text-gray-400":"danger"===n.variant?"text-red-700 hover:bg-red-50 hover:text-red-900":"text-gray-700 hover:bg-gray-100 hover:text-gray-900"," "),onClick:function(){return function(e){e.disabled||(e.onClick(),y())}(n)},disabled:n.disabled,role:"menuitem",children:[n.icon&&e("span",{className:"mr-3 flex-shrink-0",children:n.icon}),n.label]},r)})),0===r.length&&e("div",{className:"px-4 py-2 text-sm text-gray-500",children:"No actions available"})]})})]})}var gf={xs:{width:"4rem",height:"1rem"},sm:{width:"6rem",height:"1.25rem"},md:{width:"8rem",height:"1.5rem"},lg:{width:"12rem",height:"2rem"},xl:{width:"16rem",height:"2.5rem"}},yf={text:{baseClasses:"rounded",defaultSize:{width:"100%",height:"1rem"}},rectangular:{baseClasses:"",defaultSize:{width:"100%",height:"8rem"}},circular:{baseClasses:"rounded-full aspect-square",defaultSize:{width:"3rem",height:"3rem"}},rounded:{baseClasses:"rounded-lg",defaultSize:{width:"100%",height:"6rem"}},card:{baseClasses:"rounded-lg",defaultSize:{width:"100%",height:"12rem"}},avatar:{baseClasses:"rounded-full aspect-square",defaultSize:{width:"2.5rem",height:"2.5rem"}},button:{baseClasses:"rounded-md",defaultSize:{width:"5rem",height:"2.25rem"}},image:{baseClasses:"rounded",defaultSize:{width:"100%",height:"10rem"}},line:{baseClasses:"rounded-full",defaultSize:{width:"100%",height:"0.25rem"}}},vf=function(t){var n=t.variant,o=void 0===n?"text":n,i=t.animation,s=void 0===i?"pulse":i,a=t.size,l=t.width,c=t.height,d=t.count,h=void 0===d?1:d,u=t.className,p=void 0===u?"":u,f=t.shimmer,m=void 0!==f&&f,g=t.borderRadius,y=t.intensity,v=void 0===y?"medium":y,b=t.delay,x=void 0===b?0:b,w=r.useState(0===x),k=w[0],N=w[1];r.useEffect((function(){!function(){if("undefined"!=typeof document&&!document.getElementById("skeleton-loader-styles")){var e=document.createElement("style");e.id="skeleton-loader-styles",e.textContent="\n @keyframes wave {\n 0% { transform: translateX(-100%); }\n 50% { transform: translateX(100%); }\n 100% { transform: translateX(100%); }\n }\n\n @keyframes shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n\n .skeleton-wave {\n animation: wave 1.6s linear infinite;\n position: relative;\n overflow: hidden;\n }\n\n .skeleton-shimmer {\n animation: shimmer 2s ease-in-out infinite;\n background-size: 200% 100%;\n }\n\n .skeleton-wave::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n transparent,\n rgba(255, 255, 255, 0.6),\n transparent\n );\n animation: wave 1.6s linear infinite;\n }\n",document.head.appendChild(e)}}()}),[]);var C=yf[o],S=r.useMemo((function(){return{width:void 0!==l?"number"==typeof l?"".concat(l,"px"):l:a?gf[a].width:C.defaultSize.width,height:void 0!==c?"number"==typeof c?"".concat(c,"px"):c:a?gf[a].height:C.defaultSize.height}}),[l,c,a,C]);if(r.useEffect((function(){if(x>0){var e=setTimeout((function(){return N(!0)}),x);return function(){return clearTimeout(e)}}}),[x]),!k)return null;var M=function(){var e=["block","bg-gray-200",C.baseClasses];switch("pulse"===s?e.push("animate-pulse"):"wave"===s&&e.push("animate-wave"),v){case"light":e.push("bg-gray-100");break;case"medium":e.push("bg-gray-200");break;case"dark":e.push("bg-gray-300")}return m&&e.push("bg-gradient-to-r","from-gray-200","via-gray-100","to-gray-200","bg-200%","animate-shimmer"),e.join(" ")},T=function(t){return e("div",{className:"".concat(M()," ").concat(p),style:(n={width:S.width,height:S.height},g&&(n.borderRadius=g),n),"aria-hidden":"true"},t);var n};return h>1?e("div",{className:"space-y-2",children:Array.from({length:h},(function(e,t){return T(t)}))}):T(0)},bf=function(t){return e(vf,me({},t,{variant:"text"}))},xf=function(t){return e(vf,me({},t,{variant:"avatar"}))},wf=function(t){return e(vf,me({},t,{variant:"button"}))},kf=function(t){return e(vf,me({},t,{variant:"card"}))},Nf=function(t){return e(vf,me({},t,{variant:"image"}))},Cf=function(n){var r=n.showBio,o=void 0===r||r;return t("div",{className:"flex items-start space-x-4",children:[e(xf,{size:"lg"}),t("div",{className:"flex-1 space-y-2",children:[e(bf,{width:"60%",height:"1.25rem"}),e(bf,{width:"40%",height:"1rem",intensity:"light"}),o&&t("div",{className:"space-y-1 pt-2",children:[e(bf,{width:"100%"}),e(bf,{width:"80%"}),e(bf,{width:"90%"})]})]})]})},Sf=function(n){var r=n.itemCount,o=void 0===r?3:r,i=n.showAvatar,s=void 0===i||i,a=n.showMeta,l=void 0===a||a;return e("div",{className:"space-y-4",children:Array.from({length:o},(function(n,r){return t("div",{className:"flex items-start space-x-3",children:[s&&e(xf,{}),t("div",{className:"flex-1 space-y-2",children:[e(bf,{width:"75%",height:"1.125rem"}),e(bf,{width:"100%",height:"0.875rem",intensity:"light"}),l&&t("div",{className:"flex space-x-4",children:[e(bf,{width:"3rem",height:"0.75rem",intensity:"light"}),e(bf,{width:"4rem",height:"0.75rem",intensity:"light"})]})]})]},r)}))})},Mf=function(n){var r=n.rows,o=void 0===r?5:r,i=n.columns,s=void 0===i?4:i,a=n.showHeader;return t("div",{className:"space-y-3",children:[(void 0===a||a)&&e("div",{className:"flex space-x-4",children:Array.from({length:s},(function(t,n){return e(bf,{width:"100%",height:"1rem",intensity:"dark"},n)}))}),e("div",{className:"space-y-2",children:Array.from({length:o},(function(t,n){return e("div",{className:"flex space-x-4",children:Array.from({length:s},(function(t,n){return e(bf,{width:"100%",height:"0.875rem"},n)}))},n)}))})]})},Tf=function(){return t(pe,{children:[e("div",{className:"mb-4",children:e(bf,{width:"180px",height:"28px"})}),t("div",{className:"mt-4 grid grid-cols-1 gap-4",children:[t("div",{className:"rounded-lg bg-blue-50 p-4",children:[e(bf,{width:"40px",height:"32px",className:"mb-1"}),e(bf,{width:"100px",height:"16px"})]}),t("div",{className:"rounded-lg bg-green-50 p-4",children:[e(bf,{width:"40px",height:"32px",className:"mb-1"}),e(bf,{width:"110px",height:"16px"})]}),t("div",{className:"rounded-lg bg-yellow-50 p-4",children:[e(bf,{width:"40px",height:"32px",className:"mb-1"}),e(bf,{width:"120px",height:"16px"})]})]})]})},Of=function(){return t("div",{className:"bg-white p-5",children:[e(vf,{variant:"text",width:"200px"}),e(vf,{variant:"text",count:3}),e(xf,{size:"lg"}),e(wf,{animation:"wave"}),e(Cf,{showBio:!0}),e(Sf,{itemCount:5,showAvatar:!0}),e(Mf,{rows:5,columns:4}),e(vf,{variant:"card",shimmer:!0,intensity:"dark",borderRadius:"12px",className:"custom-skeleton"})]})},Ef="1.0.0",Af={sizes:{xs:{width:"4rem",height:"1rem"},sm:{width:"6rem",height:"1.25rem"},md:{width:"8rem",height:"1.5rem"},lg:{width:"12rem",height:"2rem"},xl:{width:"16rem",height:"2.5rem"}},variants:["text","rectangular","circular","rounded","card","avatar","button","image","line"],animations:["pulse","wave","none"],intensities:["light","medium","dark"]},Df={userProfile:{variant:"avatar",size:"lg",animation:"pulse"},cardTitle:{variant:"text",width:"75%",height:"1.5rem"},cardDescription:{variant:"text",count:2,width:"100%",height:"1rem",intensity:"light"},button:{variant:"button",animation:"wave"},image:{variant:"image",shimmer:!0}},Rf=function(n){var r=n.size,o=void 0===r?"md":r,i=n.variant,s=void 0===i?"pulse":i,a=n.color,l=void 0===a?"primary":a,c=n.fullScreen,d=void 0!==c&&c,h=n.text,u=n.className,p=void 0===u?"":u,f=n.image,m=n.imageEffect,g=void 0===m?"pulse":m,y=l.startsWith("#"),v=function(e){return y?"":{text:"text-".concat(l),bg:"bg-".concat(l),border:"border-".concat(l),borderTop:"border-t-".concat(l),borderRight:"border-r-".concat(l)}[e]||""},b={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12",xl:"w-16 h-16"},x={sm:"w-8 h-8",md:"w-12 h-12",lg:"w-16 h-16",xl:"w-20 h-20"},w=function(){switch(g){case"bounce":return"animate-bounce";case"spin":return"animate-spin";case"float":return"animate-pulse hover:animate-bounce";case"heartbeat":return"animate-ping";default:return"animate-pulse"}},k=function(){return t("div",{className:"relative flex items-center justify-center",children:[e("img",{src:f,alt:"Loading",className:"".concat(x[o]," object-contain ").concat(w()),style:{filter:"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1))",animationDuration:"heartbeat"===g?"1.5s":"bounce"===g?"1s":"2s"}}),"float"===g&&e("div",{className:"absolute inset-0 ".concat(x[o]," rounded-full bg-gradient-to-r from-purple-400 to-blue-400 opacity-20 animate-ping"),style:{animationDuration:"2s"}})]})},N=function(){return t("div",{className:"relative",children:[e("div",{className:"".concat(b[o]," border-4 border-gray-200 rounded-full animate-spin ").concat(y?"":v("borderTop")),style:y?{borderTopColor:l}:{}}),e("div",{className:"absolute inset-0 ".concat(b[o]," border-4 border-transparent rounded-full animate-spin ").concat(y?"":v("borderRight")),style:y?{borderRightColor:l,animationDirection:"reverse",animationDuration:"0.75s"}:{animationDirection:"reverse",animationDuration:"0.75s"}})]})},C=function(){return e("div",{className:"flex space-x-1",children:[0,1,2].map((function(t){return e("div",{className:"".concat("sm"===o?"w-2 h-2":"md"===o?"w-3 h-3":"lg"===o?"w-4 h-4":"w-5 h-5"," rounded-full animate-bounce ").concat(y?"":v("bg")),style:y?{backgroundColor:l,animationDelay:"".concat(.2*t,"s"),animationDuration:"1.4s"}:{animationDelay:"".concat(.2*t,"s"),animationDuration:"1.4s"}},t)}))})},S=function(){return t("div",{className:"relative",children:[e("div",{className:"".concat(b[o]," rounded-full animate-pulse ").concat(y?"":v("bg")),style:y?{backgroundColor:l}:{}}),e("div",{className:"absolute inset-0 ".concat(b[o]," rounded-full animate-ping opacity-30 ").concat(y?"":v("bg")),style:y?{backgroundColor:l}:{}})]})},M=function(){return e("div",{className:"flex space-x-1 items-end",children:[0,1,2,3].map((function(t){return e("div",{className:"".concat("sm"===o?"w-1":"md"===o?"w-1.5":"lg"===o?"w-2":"w-2.5"," rounded-sm animate-pulse ").concat(y?"":v("bg")),style:y?{backgroundColor:l,height:"".concat(20+10*t,"px"),animationDelay:"".concat(.15*t,"s"),animationDuration:"1.2s"}:{height:"".concat(20+10*t,"px"),animationDelay:"".concat(.15*t,"s"),animationDuration:"1.2s"}},t)}))})},T=function(){return t("div",{className:"relative",children:[e("div",{className:"".concat(b[o]," border-4 rounded-full animate-ping ").concat(y?"":v("border")),style:y?{borderColor:l}:{}}),e("div",{className:"absolute inset-2 border-4 rounded-full animate-ping ".concat(y?"":v("border")),style:y?{borderColor:l,animationDelay:"0.5s"}:{animationDelay:"0.5s"}})]})},O=t("div",{className:"flex flex-col items-center justify-center space-y-3 ".concat(p),children:[function(){if("image"===s&&f)return e(k,{});switch(s){case"dots":return e(C,{});case"pulse":return e(S,{});case"bars":return e(M,{});case"ripple":return e(T,{});default:return e(N,{})}}(),h&&e("p",{className:"".concat({sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"}[o]," font-medium animate-pulse ").concat(y?"":v("text")),style:y?{color:l}:{},children:h})]});return d?e("div",{className:"fixed inset-0 bg-white/80 backdrop-blur-sm flex items-center justify-center z-50",children:O}):O},Lf=function(){var n=r.useState("blue-500"),o=n[0],i=n[1],s=r.useState("spinner"),a=s[0],l=s[1],c=r.useState("md"),d=c[0],h=c[1],u=r.useState(!1),p=u[0],f=u[1],m=["spinner","dots","pulse","bars","ripple"];return t("div",{className:"p-8 max-w-4xl mx-auto",children:[e("h1",{className:"text-3xl font-bold text-gray-800 mb-8 text-center",children:"Modern Loading Component"}),t("div",{className:"bg-white rounded-xl shadow-lg p-6 mb-8",children:[e("h2",{className:"text-xl font-semibold text-gray-700 mb-4",children:"Customization"}),t("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Color"}),e("div",{className:"flex flex-wrap gap-2",children:[{name:"Blue",value:"blue-500",hex:"#3B82F6"},{name:"Purple",value:"purple-500",hex:"#8B5CF6"},{name:"Green",value:"green-500",hex:"#10B981"},{name:"Red",value:"red-500",hex:"#EF4444"},{name:"Orange",value:"orange-500",hex:"#F59E0B"},{name:"Pink",value:"pink-500",hex:"#EC4899"},{name:"Indigo",value:"indigo-500",hex:"#6366F1"},{name:"Teal",value:"teal-500",hex:"#14B8A6"}].map((function(t){return e("button",{onClick:function(){return i(t.value)},className:"w-8 h-8 rounded-full border-2 transition-all ".concat(o===t.value?"border-gray-400 scale-110":"border-gray-200"),style:{backgroundColor:t.hex},title:"".concat(t.name," (").concat(t.value,")")},t.value)}))})]}),t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Variant"}),e("select",{value:a,onChange:function(e){return l(e.target.value)},className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:m.map((function(t){return e("option",{value:t,children:t&&(null==t?void 0:t.charAt(0).toUpperCase())+(null==t?void 0:t.slice(1))},t)}))})]}),t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Size"}),e("select",{value:d,onChange:function(e){return h(e.target.value)},className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:["sm","md","lg","xl"].map((function(t){return e("option",{value:t,children:null==t?void 0:t.toUpperCase()},t)}))})]}),t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Full Screen"}),e("button",{onClick:function(){return f(!0)},className:"w-full p-2 bg-gray-600 text-white rounded-md hover:bg-gray-700 transition-colors",children:"Demo Full Screen"})]})]}),t("div",{className:"bg-gray-50 rounded-lg p-8 flex flex-col items-center justify-center min-h-32",children:[e(Rf,{variant:a,size:d,color:o,text:"Loading..."}),e("div",{className:"mt-4 p-3 bg-white rounded-md shadow-sm",children:t("code",{className:"text-sm text-gray-600",children:['color="',o,'"']})})]})]}),t("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[e("h2",{className:"text-xl font-semibold text-gray-700 mb-4",children:"All Variants"}),e("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6",children:m.map((function(n){return t("div",{className:"text-center",children:[e("div",{className:"bg-gray-50 rounded-lg p-4 flex items-center justify-center h-24 mb-2",children:e(Rf,{variant:n,color:o})}),e("p",{className:"text-sm text-gray-600 capitalize",children:n})]},n)}))}),t("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg",children:[e("h3",{className:"font-semibold text-blue-800 mb-2",children:"Usage Examples:"}),t("div",{className:"space-y-2 text-sm",children:[t("div",{className:"bg-white p-2 rounded border",children:[e("code",{className:"text-blue-600",children:"// Tailwind CSS class"}),e("br",{}),e("code",{children:'<Loading color="primary-500" />'})]}),t("div",{className:"bg-white p-2 rounded border",children:[e("code",{className:"text-blue-600",children:"// Hex color"}),e("br",{}),e("code",{children:'<Loading color="#your-brand-color" />'})]}),t("div",{className:"bg-white p-2 rounded border",children:[e("code",{className:"text-blue-600",children:"// Custom Tailwind color"}),e("br",{}),e("code",{children:'<Loading color="emerald-400" variant="dots" />'})]})]})]})]}),p&&e(Rf,{variant:a,size:d,color:o,text:"Loading in full screen...",fullScreen:!0}),p&&e("button",{onClick:function(){return f(!1)},className:"fixed top-4 right-4 z-50 bg-red-500 text-white px-4 py-2 rounded-md hover:bg-red-600 transition-colors",children:"Close Full Screen"})]})},zf=function(n){var r=n.items,o=void 0===r?[]:r,i=n.onBackClick,s=n.showBackButton,a=void 0===s||s,l=n.separator,c=void 0===l?" / ":l,d=n.className;return t("div",{className:"flex gap-2 ".concat(void 0===d?"":d),children:[a&&e("div",{onClick:i,className:"cursor-pointer",children:e(D,{className:"text-gray-500 transition-colors hover:text-gray-700"})}),e("p",{className:"text-gray-400",children:o.map((function(n,r){return t("span",{children:[n.isActive?e("span",{className:"text-primary",children:n.label}):e("span",{className:n.onClick?"cursor-pointer transition-colors hover:text-gray-600":"",onClick:n.onClick,children:n.label}),r<o.length-1&&c]},r)}))})]})},If=function(r){var o=r.children,i=r.content,c=r.position,d=void 0===c?"top":c,h=r.variant,u=void 0===h?"light":h,p=r.size,f=void 0===p?"md":p,m=r.delay,g=void 0===m?200:m,y=r.disabled,v=void 0!==y&&y,b=r.className,x=void 0===b?"":b,w=s(!1),k=w[0],N=w[1],C=s(d),S=C[0],M=C[1],T=a(null),O=a(null),E=a(null);l((function(){if(k&&O.current&&E.current){var e=O.current,t=E.current.getBoundingClientRect(),n=e.getBoundingClientRect(),r=d;"top"===d&&t.top-n.height<10?r="bottom":"bottom"===d&&t.bottom+n.height>window.innerHeight-10?r="top":"left"===d&&t.left-n.width<10?r="right":"right"===d&&t.right+n.width>window.innerWidth-10&&(r="left"),M(r)}}),[k,d]);var A=function(){v||(T.current&&clearTimeout(T.current),T.current=setTimeout((function(){N(!0)}),g))},D=function(){T.current&&clearTimeout(T.current),N(!1)};l((function(){return function(){T.current&&clearTimeout(T.current)}}),[]);var R={dark:{tooltip:"bg-gray-900 text-white border-gray-700",arrow:{top:"border-t-gray-900",bottom:"border-b-gray-900",left:"border-l-gray-900",right:"border-r-gray-900"}},light:{tooltip:"bg-white text-gray-900 border-gray-200 shadow-lg",arrow:{top:"border-t-white",bottom:"border-b-white",left:"border-l-white",right:"border-r-white"}},accent:{tooltip:"bg-blue-600 text-white border-blue-500",arrow:{top:"border-t-blue-600",bottom:"border-b-blue-600",left:"border-l-blue-600",right:"border-r-blue-600"}}};return v||!i?e(n,{children:o}):t("div",{className:"relative inline-block",children:[e("div",{ref:E,onMouseEnter:A,onMouseLeave:D,onFocus:A,onBlur:D,className:"cursor-help",children:o}),k&&t("div",{ref:O,className:"absolute z-50 ".concat({top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"}[S]," ").concat(R[u].tooltip," ").concat({sm:"px-2 py-1 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"}[f]," animate-in fade-in-0 zoom-in-95 max-w-xs whitespace-nowrap break-words rounded-lg border font-medium backdrop-blur-sm duration-200 ").concat(x," "),role:"tooltip","aria-hidden":"false",children:[i,e("div",{className:"absolute h-0 w-0 border-4 ".concat({top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"}[S]," ").concat(R[u].arrow[S]," ")})]})]})},Pf=function(t){var n=t.children,r=t.variant,o=void 0===r?"default":r,i=t.size,s=void 0===i?"md":i,a=t.className,l=void 0===a?"":a,c=t.onClick,d=["inline-flex items-center font-medium rounded-full transition-colors duration-200",{default:"bg-gray-100 text-gray-800 hover:bg-gray-200",secondary:"bg-blue-100 text-blue-800 hover:bg-blue-200",success:"bg-green-100 text-green-800 hover:bg-green-200",warning:"bg-yellow-100 text-yellow-800 hover:bg-yellow-200",error:"bg-red-100 text-red-800 hover:bg-red-200",info:"bg-cyan-100 text-cyan-800 hover:bg-cyan-200"}[o],{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"}[s],c?"cursor-pointer":"",l].filter(Boolean).join(" ");return e("span",{className:d,onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c())}:void 0,children:n})};export{of as AlertContext,sf as AlertProvider,Pf as Badge,zf as Breadcrumb,x as Button,pe as Card,Tf as CardStatsSkeleton,ve as CheckBox,xe as CheckBoxDemo,cf as ConfirmationAlert,Oe as DateTimePicker,Ee as DateTimePickerDemo,fe as EmptyStateCard,ue as ExportButton,Ne as FileUpload,we as FileView,ke as FileViewSystemDemo,Ce as Input,Se as InputWithPrefix,Rf as Loading,Lf as LoadingDemo,df as Modal,hf as ModalExample,uf as Pagination,be as RadioGroup,Ef as SKELETON_LOADER_VERSION,Df as SKELETON_PATTERNS,Af as SKELETON_PRESETS,Ae as Search,De as Select,tf as SelectButton,xf as SkeletonAvatar,wf as SkeletonButton,kf as SkeletonCard,Nf as SkeletonImage,Sf as SkeletonList,vf as SkeletonLoader,Of as SkeletonLoaderExample,Cf as SkeletonProfile,Mf as SkeletonTable,bf as SkeletonText,ff as Table,mf as TableDropdown,pf as TableSkeleton,Me as TagInput,Te as TagInputDemo,ef as TextEditor,If as Tooltip,lf as alert,af as useAlert};
|
|
50
|
+
*/"production"===process.env.NODE_ENV?Qu.exports=function(){if(Ju)return Zu;Ju=1;var e=r,t=Gu,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Zu.useSyncExternalStoreWithSelector=function(e,t,r,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,n(o,e))return t;var r=c(e);return void 0!==d&&d(t,r)?(o=e,t):(o=e,i=r)}var o,i,s=!1,a=void 0===r?null:r;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,r,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},Zu}():Qu.exports=(ep||(ep=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=r,t=Gu,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;tp.useSyncExternalStoreWithSelector=function(e,t,r,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,n(o,e))return t;var r=c(e);return void 0!==d&&d(t,r)?(o=e,t):(o=e,i=r)}var o,i,s=!1,a=void 0===r?null:r;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,r,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),tp);var np=Qu.exports,rp=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},op=({contentComponent:t})=>{const r=Gu.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return e(n,{children:Object.values(r)})};var ip=class extends r.Component{constructor(e){var t;super(e),this.editorContentRef=r.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=function(){const e=new Set;let t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:m.createPortal(r.reactElement,r.element,n)},e.forEach((e=>e()))},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach((e=>e()))}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe((()=>{this.setState((e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0})),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()}))),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(!t)return;if(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!(null==(e=t.options.element)?void 0:e.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:r,innerRef:o,...i}=this.props;return t(n,{children:[e("div",{ref:rp(o,this.editorContentRef),...i}),(null==r?void 0:r.contentComponent)&&e(op,{contentComponent:r.contentComponent})]})}},sp=o(((e,t)=>{const n=r.useMemo((()=>Math.floor(4294967295*Math.random()).toString()),[e.editor]);return r.createElement(ip,{key:n,innerRef:t,...e})})),ap=r.memo(sp),lp="undefined"!=typeof window?h:l,cp=class{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)}}}};var dp="production"!==process.env.NODE_ENV,hp="undefined"==typeof window,up=hp||Boolean("undefined"!=typeof window&&window.next),pp=class e{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){if(hp||up){if(dp)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&hp&&dp)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.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new Dc(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[n])})):e[n]===t[n])))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{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 fp(e={},t=[]){const n=a(e);n.current=e;const[r]=s((()=>new pp(n))),o=Gu.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return d(o),l(r.onRender(t)),function(e){var t;const[n]=s((()=>new cp(e.editor))),r=np.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:Xu);lp((()=>n.watch(e.editor)),[e.editor,n]),d(r)}({editor:o,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),o}u({editor:null}).Consumer;var mp=u({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});r.forwardRef(((t,n)=>{const{onDragStart:r}=p(mp),o=t.as||"div";return e(o,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})})),r.createContext({markViewContentRef:()=>{}});var gp=/^\s*>\s$/,yp=Ic.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return Bc("blockquote",{...va(this.options.HTMLAttributes,e),children:Bc("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[zc({find:gp,type:this.type})]}}),vp=Ic.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",va(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),bp=Ic.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",va(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof $n){const e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){const e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return Ka(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(Pn.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection($n.create(e.doc,t.pos)):e.setSelection(Pn.create(e.doc,t.pos));else{const o=null==(n=t.parent.type.contentMatch.defaultType)?void 0:n.create();o&&(e.insert(r,o),e.setSelection(Pn.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new Ya({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ma(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}}))];var e}});function xp(e={}){return new Xn({view:t=>new wp(t,e)})}class wp{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=gn(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class kp extends Rn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return kp.valid(n)?new kp(n):Rn.near(n)}content(){return Fe.empty}eq(e){return e instanceof kp&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new kp(e.resolve(t.pos))}getBookmark(){return new Np(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&kp.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(kp.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!$n.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let s=e.doc.resolve(r);if(kp.valid(s))return s}return null}}}kp.prototype.visible=!1,kp.findFrom=kp.findGapCursorFrom,Rn.jsonID("gapcursor",kp);class Np{constructor(e){this.pos=e}map(e){return new Np(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return kp.valid(t)?new kp(t):Rn.near(t)}}const Cp=Es({ArrowLeft:Sp("horiz",-1),ArrowRight:Sp("horiz",1),ArrowUp:Sp("vert",-1),ArrowDown:Sp("vert",1)});function Sp(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof Pn){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=kp.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new kp(l))),!0)}}function Mp(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!kp.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&$n.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new kp(r))),!0)}function Tp(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof kp))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=Ie.empty;for(let e=r.length-1;e>=0;e--)o=Ie.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new Fe(o,0,0));return i.setSelection(Pn.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function Op(e){if(!(e.selection instanceof kp))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Fi.create(e.doc,[$i.widget(e.selection.head,t,{key:"gapcursor"})])}var Ep=200,Ap=function(){};Ap.prototype.append=function(e){return e.length?(e=Ap.from(e),!this.length&&e||e.length<Ep&&this.leafAppend(e)||this.length<Ep&&e.leafPrepend(this)||this.appendInner(e)):this},Ap.prototype.prepend=function(e){return e.length?Ap.from(e).append(this):this},Ap.prototype.appendInner=function(e){return new Rp(this,e)},Ap.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Ap.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ap.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ap.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Ap.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Ap.from=function(e){return e instanceof Ap?e:e&&e.length?new Dp(e):Ap.empty};var Dp=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Ep)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Ep)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Ap);Ap.empty=new Dp([]);var Rp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Ap);class Lp{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new zp(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new zp(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new Lp(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),d=new zp(e.mapping.maps[n],c,t);(l=a&&a.merge(d))&&(d=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(d),t&&(i++,t=void 0),r||(a=d)}let l=i-n.depth;return l>Pp&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new Lp(s.append(o),i)}remapping(e,t){let n=new Kt;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Lp(this.items.append(e.map((e=>new zp(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new zp(l,i,c))}else n.push(new zp(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new zp(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new Lp(c,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new zp(s.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new Lp(Ap.from(r.reverse()),o)}}Lp.empty=new Lp(Ap.empty,0);class zp{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new zp(t.getMap().invert(),t,this.selection)}}}class Ip{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Pp=20;function Bp(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,o)=>t.push(r,o)));return t}function $p(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let Vp=!1,jp=null;function Fp(e){let t=e.plugins;if(jp!=t){Vp=!1,jp=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Vp=!0;break}}return Vp}const Hp=new er("history"),_p=new er("closeHistory");function qp(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Xn({key:Hp,state:{init:()=>new Ip(Lp.empty,Lp.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(Hp);if(i)return i.historyState;n.getMeta(_p)&&(e=new Ip(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Hp))return s.getMeta(Hp).redo?new Ip(e.done.addTransform(n,void 0,r,Fp(t)),e.undone,Bp(n.mapping.maps),e.prevTime,e.prevComposition):new Ip(e.done,e.undone.addTransform(n,void 0,r,Fp(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Ip(e.done.rebased(n,o),e.undone.rebased(n,o),$p(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ip(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),$p(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),a=s?$p(e.prevRanges,n.mapping):Bp(n.mapping.maps);return new Ip(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Fp(t)),Lp.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Kp:"historyRedo"==n?Up:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Wp(e,t){return(n,r)=>{let o=Hp.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=Fp(t),o=Hp.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new Ip(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Hp,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const Kp=Wp(!1,!0),Up=Wp(!0,!0);ll.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter((e=>""!==e)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Xn({key:new er("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit;if(null==o||0===o)return void(e=!0);const i=this.storage.characters({node:r.doc});if(i>o){const t=0,n=i-o;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const s=r.tr.deleteRange(t,n);return e=!0,s}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,s=i-(o-n),a=i;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}});var Jp=ll.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[xp(this.options)]}});ll.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Xn({key:new er("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return Fi.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;i.push($i.node(t,t+e.nodeSize,{class:this.options.className}))})),Fi.create(e,i)}}})]}});var Gp=ll.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Xn({props:{decorations:Op,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&kp.valid(n)?new kp(n):null,handleClick:Mp,handleKeyDown:Cp,handleDOMEvents:{beforeinput:Tp}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=ma(ha(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}});function Yp({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}ll.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Xn({key:new er("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&&Wa(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=$i.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})),Fi.create(e,o)}}})]}}),ll.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new Xn({key:new er("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||Ka(n.selection)||e.view.dragging?null:Fi.create(n.doc,[$i.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var Xp=ll.create({name:"trailingNode",addOptions:()=>({node:"paragraph",notAfter:[]}),addProseMirrorPlugins(){const e=new er(this.name),t=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>(this.options.notAfter||[]).concat(this.options.node).includes(e.name)));return[new Xn({key:e,appendTransaction:(t,n,r)=>{const{doc:o,tr:i,schema:s}=r,a=e.getState(r),l=o.content.size,c=s.nodes[this.options.node];if(a)return i.insert(l,c.create())},state:{init:(e,n)=>!Yp({node:n.tr.doc.lastChild,types:t}),apply:(e,n)=>{if(!e.docChanged)return n;return!Yp({node:e.doc.lastChild,types:t})}}})]}}),Qp=ll.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Kp(e,t),redo:()=>({state:e,dispatch:t})=>Up(e,t)}),addProseMirrorPlugins(){return[qp(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Zp=ll.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return!1!==this.options.bold&&o.push(Hc.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(yp.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(Uc.configure(this.options.bulletList)),!1!==this.options.code&&o.push(md.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(bd.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(wd.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(Jp.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(Gp.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(vp.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(Nd.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(Qp.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(bp.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(Ed.configure(this.options.italic)),!1!==this.options.listItem&&o.push(Jc.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(id.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(Au.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(ld.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(zu.configure(this.options.paragraph)),!1!==this.options.strike&&o.push($u.configure(this.options.strike)),!1!==this.options.text&&o.push(ju.configure(this.options.text)),!1!==this.options.underline&&o.push(Hu.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(Xp.configure(null==(r=this.options)?void 0:r.trailingNode)),o}}),ef=function(n){var r=n.initialContent,o=void 0===r?"":r,i=n.onUpdate,s=fp({extensions:[Zp.configure({heading:!1,codeBlock:!1}),kd,Iu,Fu,_c,Ad,_u,Vu,gd,xd.configure({HTMLAttributes:{class:"bg-gray-100 p-3 rounded text-sm font-mono"}}),Cd.configure({levels:[1,2,3]}),ud,Lu,Ru,Du.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline"}})],content:o,onUpdate:function(e){var t=e.editor;i(t.getHTML())},editorProps:{attributes:{class:"prose prose-sm sm:prose lg:prose-lg xl:prose-2xl mx-auto focus:outline-none min-h-[200px] p-4"}},immediatelyRender:!1});return s?t("div",{className:"rounded-lg border border-gray-200 shadow-sm",children:[t("div",{className:"flex flex-wrap items-center gap-1 border-b bg-gray-50 p-3",children:[e("button",{onClick:function(){return s.chain().focus().undo().run()},className:"p-2 rounded hover:bg-gray-200 transition-colors ".concat(s.can().undo()?"":"opacity-50 cursor-not-allowed"),type:"button",disabled:!s.can().undo(),title:"Undo",children:e(ae,{size:16})}),e("button",{onClick:function(){return s.chain().focus().redo().run()},className:"p-2 rounded hover:bg-gray-200 transition-colors ".concat(s.can().redo()?"":"opacity-50 cursor-not-allowed"),type:"button",disabled:!s.can().redo(),title:"Redo",children:e(te,{size:16})}),e("div",{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleHeading({level:1}).run()},className:"p-2 rounded transition-colors ".concat(s.isActive("heading",{level:1})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 1",children:e(q,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleHeading({level:2}).run()},className:"p-2 rounded transition-colors ".concat(s.isActive("heading",{level:2})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 2",children:e(W,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleHeading({level:3}).run()},className:"p-2 rounded transition-colors ".concat(s.isActive("heading",{level:3})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 3",children:e(K,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleBold().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("bold")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Bold",children:e(O,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleItalic().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("italic")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Italic",children:e(J,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleUnderline().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("underline")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Underline",children:e(se,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleStrike().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("strike")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Strikethrough",children:e(re,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleBulletList().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("bulletList")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Bullet List",children:e(X,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleOrderedList().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("orderedList")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Numbered List",children:e(Y,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleCode().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("code")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Inline Code",children:e(I,{size:16})}),e("button",{onClick:function(){return s.chain().focus().toggleCodeBlock().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("codeBlock")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Code Block",children:e(V,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),e("button",{onClick:function(){return s.chain().focus().toggleBlockquote().run()},className:"p-2 rounded transition-colors ".concat(s.isActive("blockquote")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Quote",children:e(ee,{size:16})}),e(ne,{className:"mx-2 h-6 w-px bg-gray-300"}),s.isActive("link")?e("button",{onClick:function(){null==s||s.chain().focus().unsetLink().run()},className:"p-2 rounded bg-blue-200 text-blue-800 hover:bg-blue-300 transition-colors",type:"button",title:"Remove Link",children:e(G,{size:16})}):e("button",{onClick:function(){var e=window.prompt("Enter URL:");e&&(null==s||s.chain().focus().setLink({href:e}).run())},className:"p-2 rounded hover:bg-gray-200 transition-colors",type:"button",title:"Add Link",children:e(G,{size:16})})]}),e(ap,{editor:s,className:"min-h-[300px] focus-within:bg-white"})]}):e("div",{className:"rounded-lg border bg-gray-50 h-48 animate-pulse"})};function tf(n){var r=n.options,o=n.placeholder,i=void 0===o?"Select an option":o,a=n.onChange,l=n.value,c=n.size,d=void 0===c?"md":c,h=n.className,u=void 0===h?"":h,p=n.name,f=n.id,m=n.disabled,g=void 0!==m&&m,y=n.label,v=n.required,b=s(!1),x=b[0],w=b[1],k=s(l&&r.find((function(e){return e.value===l}))||null),N=k[0],C=k[1];return t("div",{className:"relative inline-block",children:[y&&t("label",{htmlFor:f,className:"mb-1 block text-sm font-medium text-gray-700",children:[y,v&&e("span",{className:"ml-1 text-red-500",children:"*"})]}),t("button",{type:"button",className:"flex w-full items-center justify-between rounded-md border border-gray-200 bg-white shadow-sm ".concat({sm:"px-3 py-2 text-sm",md:"px-4 py-2.5 text-base"}[d]," text-gray-700 hover:bg-gray-50 focus:outline-none ").concat(g?"cursor-not-allowed opacity-50":""," ").concat(u),onClick:function(){return!g&&w(!x)},disabled:g,id:f,children:[e("span",{className:"truncate",children:N?(null==N?void 0:N.label)||N.value:i}),e(A,{className:"ml-2 h-4 w-4 ".concat(x?"rotate-180 transform":"")})]}),x&&e("div",{className:"absolute z-10 mt-1 max-h-60 w-full min-w-[200px] p-1 font-medium text-sm overflow-auto rounded-lg bg-white shadow-xl",children:r.map((function(n){return t("div",{className:"cursor-pointer px-3 py-2 hover:bg-gray-100 rounded-lg flex justify-between item-center ".concat((null==N?void 0:N.value)===n.value?"bg-gray-50 text-black":"text-gray-900"),onClick:function(){return function(e){C(e),a(e.value),w(!1)}(n)},children:[e("div",{children:n.label||n.value}),(null==N?void 0:N.value)===n.value&&e("div",{children:e(E,{size:15,className:"text-primary"})})]},n.value)}))}),p&&e("input",{type:"hidden",name:p,value:(null==N?void 0:N.value)||""})]})}var nf=function(n){var r=n.message,o=n.description,i=n.type,a=void 0===i?"info":i,c=n.duration,d=void 0===c?5e3:c,h=n.onClose,u=s(!0),p=u[0],f=u[1],m=s(100),g=m[0],y=m[1],v={success:{icon:e(L,{className:"h-5 w-5"}),bgColor:"bg-green-50",borderColor:"border-green-300",textColor:"text-green-800",iconColor:"text-green-500",progressColor:"bg-green-500"},error:{icon:e(R,{className:"h-5 w-5"}),bgColor:"bg-rose-50",borderColor:"border-rose-300",textColor:"text-rose-800",iconColor:"text-rose-500",progressColor:"bg-rose-500"},info:{icon:e(U,{className:"h-5 w-5"}),bgColor:"bg-blue-50",borderColor:"border-blue-300",textColor:"text-blue-800",iconColor:"text-blue-500",progressColor:"bg-blue-500"},warning:{icon:e(ie,{className:"h-5 w-5"}),bgColor:"bg-amber-50 ",borderColor:"border-amber-300 ",textColor:"text-amber-800",iconColor:"text-amber-500",progressColor:"bg-amber-500"}};l((function(){var e=setTimeout((function(){f(!1),setTimeout((function(){null==h||h()}),300)}),d),t=setInterval((function(){y((function(e){var t=e-100/(d/100);return t<=0?0:t}))}),100);return function(){clearTimeout(e),clearInterval(t)}}),[d,h]);var b=v[a],x=b.icon,w=b.bgColor,k=b.borderColor,N=b.textColor,C=b.iconColor,S=b.progressColor;return e("div",{className:"fixed right-4 top-4 z-50 transform transition-all duration-300 ".concat(p?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:t("div",{className:"flex w-72 rounded-lg border shadow-lg md:w-96 ".concat(k," ").concat(w," p-4"),children:[e("div",{className:"flex-shrink-0 ".concat(C),children:x}),t("div",{className:"ml-3 w-full",children:[t("div",{className:"flex items-start justify-between",children:[e("div",{className:"text-md font-semibold ".concat(N),children:r}),e("button",{onClick:function(){f(!1),setTimeout((function(){null==h||h()}),300)},className:"text-gray-600 hover:text-gray-600 focus:outline-none",children:e(de,{className:"h-4 w-4"})})]}),o&&e("p",{className:"mt-1 text-sm ".concat(N," opacity-80"),children:o}),e("div",{className:"mt-2 h-1 w-full rounded-full bg-gray-200",children:e("div",{className:"".concat(S," h-1 rounded-full transition-all duration-100 ease-linear"),style:{width:"".concat(g,"%")}})})]})]})})},rf=null,of=u(void 0),sf=function(n){var r=n.children,o=s([]),i=o[0],a=o[1],l=f((function(e){a((function(t){return t.filter((function(t){return t.id!==e}))}))}),[]),c=f((function(e){var t=Math.random().toString(36).substring(2,9),n=me(me({},e),{id:t,onClose:function(){return l(t)}});a((function(e){return ye(ye([],e,!0),[n],!1)}))}),[l]),d=f((function(e){return function(t,n){c({message:t,description:n,type:e})}}),[c]),h={showAlert:c,success:d("success"),error:d("error"),info:d("info"),warning:d("warning")};return rf=h,t(of.Provider,{value:h,children:[r,e("div",{className:"fixed right-4 top-4 z-50 space-y-2 w-full max-w-xs",children:i.map((function(t,n){return e("div",{style:{transform:"translateY(".concat(10*n,"px)"),zIndex:50-n},children:e(nf,me({},t))},t.id)}))})]})},af=function(){var e=p(of);if(void 0===e)throw new Error("useAlert must be used within a AlertProvider");return e},lf={success:function(e,t){rf?rf.success(e,t):console.warn("AlertProvider not mounted yet")},error:function(e,t){rf?rf.error(e,t):console.warn("AlertProvider not mounted yet")},info:function(e,t){rf?rf.info(e,t):console.warn("AlertProvider not mounted yet")},warning:function(e,t){rf?rf.warning(e,t):console.warn("AlertProvider not mounted yet")},show:function(e){rf?rf.showAlert(e):console.warn("AlertProvider not mounted yet")}},cf=function(n){var r=n.isOpen,o=n.onConfirm,i=n.onCancel,s=n.title,c=n.message,d=n.confirmText,h=void 0===d?"Confirm":d,u=n.cancelText,p=void 0===u?"Cancel":u,f=n.type,m=void 0===f?"default":f,g=n.showIcon,y=void 0===g||g,v=n.showCloseButton,b=void 0===v||v,w=n.closeOnOverlayClick,k=void 0===w||w,N=n.closeOnEscape,C=void 0===N||N,S=n.isLoading,M=void 0!==S&&S,T=n.className,O=void 0===T?"":T,E=n.overlayClassName,A=void 0===E?"":E,D=n.maxWidth,R=void 0===D?"sm":D,I=a(null),P=a(null),B=a(null);l((function(){return r?(B.current=document.activeElement,setTimeout((function(){var e,t,n;"danger"===m?null===(t=null===(e=I.current)||void 0===e?void 0:e.querySelector("[data-cancel-button]"))||void 0===t||t.focus():null===(n=P.current)||void 0===n||n.focus()}),100),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",B.current&&B.current.focus()),function(){document.body.style.overflow="unset"}}),[r,m]),l((function(){var e=function(e){"Escape"===e.key&&C&&!M&&i()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,C,i,M]);var $=function(){M||i()},V={default:{icon:U,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"},danger:{icon:z,iconColor:"text-red-600",iconBg:"bg-red-100",confirmButton:"bg-red-600 hover:bg-red-700 focus:ring-red-500"},warning:{icon:ie,iconColor:"text-yellow-600",iconBg:"bg-yellow-100",confirmButton:"bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500"},success:{icon:L,iconColor:"text-green-600",iconBg:"bg-green-100",confirmButton:"bg-green-600 hover:bg-green-700 focus:ring-green-500"},info:{icon:U,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}}[m],j=V.icon;return r?t("div",{className:"fixed inset-0 z-50 ".concat(A),role:"dialog","aria-modal":"true","aria-labelledby":s?"confirmation-title":void 0,"aria-describedby":"confirmation-message",children:[e("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300",onClick:function(e){e.target===e.currentTarget&&k&&!M&&i()}}),e("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:t("div",{ref:I,className:"relative w-full ".concat({sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}[R]," animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-4 transform rounded-2xl bg-white shadow-2xl transition-all duration-300 ease-out ").concat(O," "),onClick:function(e){return e.stopPropagation()},children:[b&&e("button",{onClick:$,disabled:M,className:"absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Close",children:e(de,{size:20})}),t("div",{className:"p-6",children:[t("div",{className:"flex flex-col items-center justify-center space-y-4",children:[y&&e("div",{className:"h-12 w-12 flex-shrink-0 rounded-full ".concat(V.iconBg," flex items-center justify-center"),children:e(j,{size:24,className:V.iconColor})}),t("div",{className:"min-w-0 flex-1 justify-center",children:[s&&e("h3",{id:"confirmation-title",className:"mb-1 text-center text-lg font-semibold text-gray-900",children:s}),e("p",{id:"confirmation-message",className:"leading-relaxed text-gray-600",children:c})]})]}),t("div",{className:"flex ".concat("justify-center"," mt-6 space-x-3"),children:[e(x,{variant:"neutral",outline:!0,size:"small","data-cancel-button":"",onClick:$,disabled:M,children:p}),e("button",{ref:P,onClick:function(){M||o()},disabled:M,className:"flex min-w-[80px] items-center justify-center rounded-xl px-4 py-2 text-sm font-medium text-white transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ".concat(V.confirmButton," "),children:M?e("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):h})]})]})]})})]}):null},df=function(n){var r=n.isOpen,o=n.onClose,i=n.title,s=n.children,c=n.size,d=void 0===c?"md":c,h=n.position,u=void 0===h?"right":h,p=n.showCloseButton,f=void 0===p||p,m=n.closeOnOverlayClick,g=void 0===m||m,y=n.closeOnEscape,v=void 0===y||y,b=n.className,x=void 0===b?"":b,w=n.overlayClassName,k=void 0===w?"":w,N=n.contentClassName,C=void 0===N?"":N,S=n.headerClassName,M=void 0===S?"":S,T=n.footer,O=n.footerClassName,E=void 0===O?"":O,A=n.maxHeight,D=void 0!==A&&A,R=a(null),L=a(null);l((function(){var e;return r?(L.current=document.activeElement,null===(e=R.current)||void 0===e||e.focus(),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",L.current&&L.current.focus()),function(){document.body.style.overflow="unset"}}),[r]),l((function(){var e=function(e){"Escape"===e.key&&v&&o()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,v,o]);var z=function(e){e.target===e.currentTarget&&g&&"full"!==d&&o()};return r?t("div",{className:"fixed inset-0 z-50 ".concat(k),role:"dialog","aria-modal":"true","aria-labelledby":i?"modal-title":void 0,children:["full"!==d&&e("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-700",onClick:z}),e("div",{className:"fixed inset-0 flex ".concat("p-0"," ").concat(function(){if("full"===d)return"items-start justify-start";return{left:"items-start justify-start",right:"items-start justify-end",center:"items-center justify-center"}[u]}()),onClick:z,children:t("div",{ref:R,tabIndex:-1,className:"\n relative w-full ".concat({xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full h-full"}[d]," bg-white shadow-2xl transform transition-all duration-700 ease-out flex flex-col\n ").concat("full"===d?"h-full max-h-screen overflow-hidden":"left"===u||"right"===u?"h-full ".concat(D?"max-h-screen":""):"".concat(D?"max-h-[90vh] overflow-hidden":""),"\n ").concat("full"===d?"animate-in fade-in-0":"center"===u?"animate-in fade-in-0 zoom-in-95":"left"===u?"animate-in slide-in-from-left-full":"animate-in slide-in-from-right-full","\n ").concat(x,"\n "),onClick:function(e){return e.stopPropagation()},children:[(i||f)&&t("div",{className:"flex items-center justify-between px-6 py-3 border-b border-gray-200 flex-shrink-0 ".concat(M),children:[i&&e("h2",{id:"modal-title",className:"text-xl font-semibold text-gray-900 truncate pr-4",children:i}),f&&e("button",{onClick:o,className:"flex items-center justify-center w-8 h-8 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","aria-label":"Close modal",children:e(de,{size:20})})]}),e("div",{className:"flex-1 min-h-0 overflow-y-auto ".concat(D||"full"===d?"overflow-y-auto":""," ").concat(C),children:e("div",D&&("left"===u||"right"===u)||"full"===d?{className:"p-6 min-h-0 flex-1",children:s}:{className:"p-6",children:s})}),T&&e("div",{className:"px-6 py-4 border-t border-gray-200 flex-shrink-0 ".concat(""," ").concat(E),children:T})]})})]}):null},hf=function(){var n=r.useState(!1),o=n[0],i=n[1],s=r.useState("left"),a=s[0],l=s[1],c=r.useState("md"),d=c[0],h=c[1],u=t("div",{className:"flex justify-end space-x-3",children:[e("button",{onClick:function(){return i(!1)},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200",children:"Cancel"}),e("button",{onClick:function(){return i(!1)},className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200",children:"Save Changes"})]});return t("div",{className:"p-8 space-y-4",children:[t("div",{className:"flex flex-wrap gap-4 mb-6",children:[t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Position"}),t("select",{value:a,onChange:function(e){return l(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",disabled:"full"===d,children:[e("option",{value:"left",children:"Left"}),e("option",{value:"right",children:"Right"}),e("option",{value:"center",children:"Center"})]})]}),t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Size"}),t("select",{value:d,onChange:function(e){return h(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[e("option",{value:"xs",children:"Extra Small"}),e("option",{value:"sm",children:"Small"}),e("option",{value:"md",children:"Medium"}),e("option",{value:"lg",children:"Large"}),e("option",{value:"xl",children:"Extra Large"}),e("option",{value:"2xl",children:"2X Large"}),e("option",{value:"full",children:"Full Screen"})]})]})]}),e("button",{onClick:function(){return i(!0)},className:"px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors duration-200 font-medium",children:"Open Modal"}),e(df,{isOpen:o,onClose:function(){return i(!1)},title:"Example Modal",size:d,position:a,footer:u,maxHeight:"center"!==a,children:t("div",{className:"space-y-4",children:[e("p",{className:"text-gray-600",children:"This is an example of the multipurpose modal component. It supports different sizes, positions, and configurations."}),t("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e("h4",{className:"font-medium text-gray-900 mb-2",children:"Features:"}),t("ul",{className:"text-sm text-gray-600 space-y-1 list-disc list-inside",children:[e("li",{children:"Multiple sizes (xs, sm, md, lg, xl, 2xl, full screen)"}),e("li",{children:"Three positions (left, right, center)"}),e("li",{children:"Customizable styling with className props"}),e("li",{children:"Keyboard navigation and accessibility"}),e("li",{children:"Click outside to close (disabled for full screen)"}),e("li",{children:"Smooth animations"}),e("li",{children:"Optional footer with actions"}),e("li",{children:"Full screen mode without margins or border radius"})]})]}),("left"===a||"right"===a||"full"===d)&&e("div",{className:"space-y-2",children:Array.from({length:20},(function(e,n){return t("p",{className:"text-gray-600",children:["This is paragraph ",n+1," to demonstrate scrolling in side panels","full"===d?" and full screen mode":"","."]},n)}))})]})})]})};function uf(n){var r=n.currentPage,o=n.totalPages,i=n.totalItems,s=n.itemsPerPage,a=n.onPageChange,l=n.onViewChange,c=n.loading,d=void 0!==c&&c,h=function(e){e>0&&e<=o&&!d&&a&&a(e)},u=(r-1)*s,p=Math.min(u+s,i);return t("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white py-3",children:[t("div",{className:"flex flex-1 justify-between sm:hidden",children:[e("button",{onClick:function(){return h(r-1)},disabled:1===r||d,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(1===r||d?"cursor-not-allowed opacity-50":""),children:"Previous"}),e("button",{onClick:function(){return h(r+1)},disabled:r===o||d,className:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(r===o||d?"cursor-not-allowed opacity-50":""),children:"Next"})]}),t("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[t("div",{className:"flex items-center justify-center gap-2",children:[t("div",{className:"relative",children:[e("select",{value:s,onChange:function(e){return l&&l(e.target.value)},disabled:d,className:"appearance-none rounded-md border border-gray-300 bg-white py-2 pl-3 pr-8 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[10,20,30,50].map((function(t){return e("option",{value:t,children:t},t)}))}),e("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700",children:e("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20",children:e("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),t("p",{className:"text-sm text-gray-700",children:[t("span",{children:[i," Entries"]}),t("span",{className:"ml-1",children:["(Showing ",u+1,"-",p," of ",i,")"]})]})]}),e("div",{children:t("nav",{className:"relative z-0 inline-flex gap-2 -space-x-px rounded-md shadow-sm","aria-label":"Pagination",children:[t("button",{onClick:function(){return h(r-1)},disabled:1===r||d,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 ".concat(1===r||d?"cursor-not-allowed opacity-50":""),children:[e("span",{className:"sr-only",children:"Previous"}),e("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})]}),function(){var e=[];if(o<=5)for(var t=1;t<=o;t++)e.push(t);else{var n=Math.max(1,r-2),i=Math.min(o,n+5-1);i-n<4&&(n=Math.max(1,i-5+1));for(t=n;t<=i;t++)e.push(t)}return e}().map((function(t){return e("button",{onClick:function(){return h(t)},disabled:d,"aria-current":r===t?"page":void 0,className:"relative inline-flex items-center rounded-md border px-4 py-2 text-sm font-semibold ".concat(r===t?"z-10 border-primary-100 bg-primary-50 text-primary":"border-gray-300 bg-white text-gray-500 hover:bg-gray-50"," ").concat(d?"cursor-not-allowed opacity-50":""),children:t},t)})),t(x,{onClick:function(){return h(r+1)},disabled:r===o||d,type:"button",variant:"primary",size:"small",outline:!0,children:["Next Page",e("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]})})]})]})}function pf(t){var r=t.columns,o=void 0===r?5:r,i=t.rows,s=void 0===i?3:i;return e(n,{children:Array.from({length:s}).map((function(t,n){return e("tr",{children:Array.from({length:o}).map((function(t,r){return e("td",{className:"whitespace-nowrap px-6 py-4",children:e("div",{className:"h-4 animate-pulse rounded bg-gray-200"})},"skeleton-cell-".concat(n,"-").concat(r))}))},"skeleton-row-".concat(n))}))})}function ff(r){var o=r.data,i=r.columns,s=r.itemsPerPage,a=void 0===s?20:s,l=r.onViewChange,c=r.totalItems,d=r.currentPage,h=void 0===d?1:d,u=r.onPageChange,p=r.loading,f=void 0!==p&&p,m=r.showPagination,g=void 0===m||m,y=r.onRowClick,v=r.useCardLayout,b=void 0!==v&&v,x=r.emptyState,w=c||o.length,k=Math.ceil(w/a),N=o,C=function(e){y&&y(e)},S=e(fe,{title:"No Record found"}),M=function(){return t("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:[f&&Array.from({length:a}).map((function(n,r){return e("div",{className:"bg-white rounded-lg border border-gray-200 p-4 animate-pulse",children:e("div",{className:"space-y-3",children:i.slice(0,3).map((function(n,r){return t("div",{className:"flex justify-between items-center",children:[e("div",{className:"h-4 bg-gray-200 rounded w-1/3"}),e("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]},r)}))})},r)})),N.length>0?N.map((function(n,r){return e("div",{onClick:function(){return C(n)},className:"bg-white rounded-lg border border-gray-200 p-4 transition-all duration-200 hover:shadow-md hover:border-gray-300 ".concat(y?"cursor-pointer":""," ").concat(f?"opacity-50":""),children:e("div",{className:"space-y-3",children:i.map((function(r,o){return t("div",{className:"flex justify-between items-start",children:[t("span",{className:"text-sm font-medium text-gray-500 flex-shrink-0 mr-3",children:[r.title,":"]}),e("span",{className:"text-sm text-gray-800 text-right",children:"function"==typeof r.value?r.value(n):n[r.value]})]},o)}))})},r)})):!f&&e("div",{className:"col-span-full",children:x||S})]})};return t(n,{children:[b?M():t(n,{children:[e("div",{className:"hidden md:block",children:e("div",{className:"relative overflow-x-auto",children:t("table",{className:"w-full",children:[e("thead",{children:e("tr",{children:i.map((function(t,n){return e("th",{className:"bg-gray-100 px-6 py-3 text-left text-sm font-semibold tracking-wider text-gray-500 ".concat(t.width||""," ").concat(0===n?"rounded-bl-xl rounded-tl-xl":""," ").concat(n===i.length-1?"rounded-br-xl rounded-tr-xl":""," "),children:t.title},n)}))})}),t("tbody",{className:"divide-y divide-gray-200 bg-white \n ".concat(f?"opacity-50":""," ").concat(y?"cursor-pointer":"","\n "),children:[f&&e(pf,{columns:i.length,rows:a}),N.length>0?N.map((function(t,n){return e("tr",{onClick:function(){return C(t)},className:"hover:bg-gray-50",children:i.map((function(n,r){return e("td",{className:"whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-800",children:"function"==typeof n.value?n.value(t):t[n.value]},r)}))},n)})):!f&&e("tr",{children:e("td",{colSpan:i.length,className:"px-6 py-12 text-center",children:x||S})})]})]})})}),e("div",{className:"block md:hidden",children:M()})]}),g&&e(uf,{currentPage:h,totalPages:k,totalItems:w,itemsPerPage:a,onPageChange:u,onViewChange:l,loading:f})]})}function mf(n){var r=n.actions,o=n.trigger,i=n.className,c=void 0===i?"":i,d=n.dropdownClassName,h=void 0===d?"":d,u=s(!1),p=u[0],f=u[1],m=a(null),g=function(){f(!p)},y=function(){f(!1)};l((function(){var e=function(e){m.current&&!m.current.contains(e.target)&&y()};return p&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[p]),l((function(){var e=function(e){"Escape"===e.key&&y()};return p&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[p]);return t("div",{className:"relative inline-block ".concat(c),ref:m,children:[e("div",{className:"flex",children:o?e("div",{onClick:g,className:"cursor-pointer",children:o}):e("button",{className:"rounded-md border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 transition-colors duration-200 focus:ring-offset-2",onClick:g,"aria-expanded":p,"aria-haspopup":"true",children:e(B,{className:"h-4 w-4"})})}),p&&e("div",{className:"absolute right-0 z-50 mt-1 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ".concat(h),children:t("div",{className:"py-1",role:"menu","aria-orientation":"vertical",children:[r.map((function(n,r){return t("button",{className:"flex w-full items-center px-4 py-2 text-left text-sm transition-colors duration-150 ".concat(n.disabled?"cursor-not-allowed bg-gray-50 text-gray-400":"danger"===n.variant?"text-red-700 hover:bg-red-50 hover:text-red-900":"text-gray-700 hover:bg-gray-100 hover:text-gray-900"," "),onClick:function(){return function(e){e.disabled||(e.onClick(),y())}(n)},disabled:n.disabled,role:"menuitem",children:[n.icon&&e("span",{className:"mr-3 flex-shrink-0",children:n.icon}),n.label]},r)})),0===r.length&&e("div",{className:"px-4 py-2 text-sm text-gray-500",children:"No actions available"})]})})]})}var gf={xs:{width:"4rem",height:"1rem"},sm:{width:"6rem",height:"1.25rem"},md:{width:"8rem",height:"1.5rem"},lg:{width:"12rem",height:"2rem"},xl:{width:"16rem",height:"2.5rem"}},yf={text:{baseClasses:"rounded",defaultSize:{width:"100%",height:"1rem"}},rectangular:{baseClasses:"",defaultSize:{width:"100%",height:"8rem"}},circular:{baseClasses:"rounded-full aspect-square",defaultSize:{width:"3rem",height:"3rem"}},rounded:{baseClasses:"rounded-lg",defaultSize:{width:"100%",height:"6rem"}},card:{baseClasses:"rounded-lg",defaultSize:{width:"100%",height:"12rem"}},avatar:{baseClasses:"rounded-full aspect-square",defaultSize:{width:"2.5rem",height:"2.5rem"}},button:{baseClasses:"rounded-md",defaultSize:{width:"5rem",height:"2.25rem"}},image:{baseClasses:"rounded",defaultSize:{width:"100%",height:"10rem"}},line:{baseClasses:"rounded-full",defaultSize:{width:"100%",height:"0.25rem"}}},vf=function(t){var n=t.variant,o=void 0===n?"text":n,i=t.animation,s=void 0===i?"pulse":i,a=t.size,l=t.width,c=t.height,d=t.count,h=void 0===d?1:d,u=t.className,p=void 0===u?"":u,f=t.shimmer,m=void 0!==f&&f,g=t.borderRadius,y=t.intensity,v=void 0===y?"medium":y,b=t.delay,x=void 0===b?0:b,w=r.useState(0===x),k=w[0],N=w[1];r.useEffect((function(){!function(){if("undefined"!=typeof document&&!document.getElementById("skeleton-loader-styles")){var e=document.createElement("style");e.id="skeleton-loader-styles",e.textContent="\n @keyframes wave {\n 0% { transform: translateX(-100%); }\n 50% { transform: translateX(100%); }\n 100% { transform: translateX(100%); }\n }\n\n @keyframes shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n\n .skeleton-wave {\n animation: wave 1.6s linear infinite;\n position: relative;\n overflow: hidden;\n }\n\n .skeleton-shimmer {\n animation: shimmer 2s ease-in-out infinite;\n background-size: 200% 100%;\n }\n\n .skeleton-wave::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n transparent,\n rgba(255, 255, 255, 0.6),\n transparent\n );\n animation: wave 1.6s linear infinite;\n }\n",document.head.appendChild(e)}}()}),[]);var C=yf[o],S=r.useMemo((function(){return{width:void 0!==l?"number"==typeof l?"".concat(l,"px"):l:a?gf[a].width:C.defaultSize.width,height:void 0!==c?"number"==typeof c?"".concat(c,"px"):c:a?gf[a].height:C.defaultSize.height}}),[l,c,a,C]);if(r.useEffect((function(){if(x>0){var e=setTimeout((function(){return N(!0)}),x);return function(){return clearTimeout(e)}}}),[x]),!k)return null;var M=function(){var e=["block","bg-gray-200",C.baseClasses];switch("pulse"===s?e.push("animate-pulse"):"wave"===s&&e.push("animate-wave"),v){case"light":e.push("bg-gray-100");break;case"medium":e.push("bg-gray-200");break;case"dark":e.push("bg-gray-300")}return m&&e.push("bg-gradient-to-r","from-gray-200","via-gray-100","to-gray-200","bg-200%","animate-shimmer"),e.join(" ")},T=function(t){return e("div",{className:"".concat(M()," ").concat(p),style:(n={width:S.width,height:S.height},g&&(n.borderRadius=g),n),"aria-hidden":"true"},t);var n};return h>1?e("div",{className:"space-y-2",children:Array.from({length:h},(function(e,t){return T(t)}))}):T(0)},bf=function(t){return e(vf,me({},t,{variant:"text"}))},xf=function(t){return e(vf,me({},t,{variant:"avatar"}))},wf=function(t){return e(vf,me({},t,{variant:"button"}))},kf=function(t){return e(vf,me({},t,{variant:"card"}))},Nf=function(t){return e(vf,me({},t,{variant:"image"}))},Cf=function(n){var r=n.showBio,o=void 0===r||r;return t("div",{className:"flex items-start space-x-4",children:[e(xf,{size:"lg"}),t("div",{className:"flex-1 space-y-2",children:[e(bf,{width:"60%",height:"1.25rem"}),e(bf,{width:"40%",height:"1rem",intensity:"light"}),o&&t("div",{className:"space-y-1 pt-2",children:[e(bf,{width:"100%"}),e(bf,{width:"80%"}),e(bf,{width:"90%"})]})]})]})},Sf=function(n){var r=n.itemCount,o=void 0===r?3:r,i=n.showAvatar,s=void 0===i||i,a=n.showMeta,l=void 0===a||a;return e("div",{className:"space-y-4",children:Array.from({length:o},(function(n,r){return t("div",{className:"flex items-start space-x-3",children:[s&&e(xf,{}),t("div",{className:"flex-1 space-y-2",children:[e(bf,{width:"75%",height:"1.125rem"}),e(bf,{width:"100%",height:"0.875rem",intensity:"light"}),l&&t("div",{className:"flex space-x-4",children:[e(bf,{width:"3rem",height:"0.75rem",intensity:"light"}),e(bf,{width:"4rem",height:"0.75rem",intensity:"light"})]})]})]},r)}))})},Mf=function(n){var r=n.rows,o=void 0===r?5:r,i=n.columns,s=void 0===i?4:i,a=n.showHeader;return t("div",{className:"space-y-3",children:[(void 0===a||a)&&e("div",{className:"flex space-x-4",children:Array.from({length:s},(function(t,n){return e(bf,{width:"100%",height:"1rem",intensity:"dark"},n)}))}),e("div",{className:"space-y-2",children:Array.from({length:o},(function(t,n){return e("div",{className:"flex space-x-4",children:Array.from({length:s},(function(t,n){return e(bf,{width:"100%",height:"0.875rem"},n)}))},n)}))})]})},Tf=function(){return t(pe,{children:[e("div",{className:"mb-4",children:e(bf,{width:"180px",height:"28px"})}),t("div",{className:"mt-4 grid grid-cols-1 gap-4",children:[t("div",{className:"rounded-lg bg-blue-50 p-4",children:[e(bf,{width:"40px",height:"32px",className:"mb-1"}),e(bf,{width:"100px",height:"16px"})]}),t("div",{className:"rounded-lg bg-green-50 p-4",children:[e(bf,{width:"40px",height:"32px",className:"mb-1"}),e(bf,{width:"110px",height:"16px"})]}),t("div",{className:"rounded-lg bg-yellow-50 p-4",children:[e(bf,{width:"40px",height:"32px",className:"mb-1"}),e(bf,{width:"120px",height:"16px"})]})]})]})},Of=function(){return t("div",{className:"bg-white p-5",children:[e(vf,{variant:"text",width:"200px"}),e(vf,{variant:"text",count:3}),e(xf,{size:"lg"}),e(wf,{animation:"wave"}),e(Cf,{showBio:!0}),e(Sf,{itemCount:5,showAvatar:!0}),e(Mf,{rows:5,columns:4}),e(vf,{variant:"card",shimmer:!0,intensity:"dark",borderRadius:"12px",className:"custom-skeleton"})]})},Ef="1.0.0",Af={sizes:{xs:{width:"4rem",height:"1rem"},sm:{width:"6rem",height:"1.25rem"},md:{width:"8rem",height:"1.5rem"},lg:{width:"12rem",height:"2rem"},xl:{width:"16rem",height:"2.5rem"}},variants:["text","rectangular","circular","rounded","card","avatar","button","image","line"],animations:["pulse","wave","none"],intensities:["light","medium","dark"]},Df={userProfile:{variant:"avatar",size:"lg",animation:"pulse"},cardTitle:{variant:"text",width:"75%",height:"1.5rem"},cardDescription:{variant:"text",count:2,width:"100%",height:"1rem",intensity:"light"},button:{variant:"button",animation:"wave"},image:{variant:"image",shimmer:!0}},Rf=function(n){var r=n.size,o=void 0===r?"md":r,i=n.variant,s=void 0===i?"pulse":i,a=n.color,l=void 0===a?"primary":a,c=n.fullScreen,d=void 0!==c&&c,h=n.text,u=n.className,p=void 0===u?"":u,f=n.image,m=n.imageEffect,g=void 0===m?"pulse":m,y=l.startsWith("#"),v=function(e){return y?"":{text:"text-".concat(l),bg:"bg-".concat(l),border:"border-".concat(l),borderTop:"border-t-".concat(l),borderRight:"border-r-".concat(l)}[e]||""},b={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12",xl:"w-16 h-16"},x={sm:"w-8 h-8",md:"w-12 h-12",lg:"w-16 h-16",xl:"w-20 h-20"},w=function(){switch(g){case"bounce":return"animate-bounce";case"spin":return"animate-spin";case"float":return"animate-pulse hover:animate-bounce";case"heartbeat":return"animate-ping";default:return"animate-pulse"}},k=function(){return t("div",{className:"relative flex items-center justify-center",children:[e("img",{src:f,alt:"Loading",className:"".concat(x[o]," object-contain ").concat(w()),style:{filter:"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1))",animationDuration:"heartbeat"===g?"1.5s":"bounce"===g?"1s":"2s"}}),"float"===g&&e("div",{className:"absolute inset-0 ".concat(x[o]," rounded-full bg-gradient-to-r from-purple-400 to-blue-400 opacity-20 animate-ping"),style:{animationDuration:"2s"}})]})},N=function(){return t("div",{className:"relative",children:[e("div",{className:"".concat(b[o]," border-4 border-gray-200 rounded-full animate-spin ").concat(y?"":v("borderTop")),style:y?{borderTopColor:l}:{}}),e("div",{className:"absolute inset-0 ".concat(b[o]," border-4 border-transparent rounded-full animate-spin ").concat(y?"":v("borderRight")),style:y?{borderRightColor:l,animationDirection:"reverse",animationDuration:"0.75s"}:{animationDirection:"reverse",animationDuration:"0.75s"}})]})},C=function(){return e("div",{className:"flex space-x-1",children:[0,1,2].map((function(t){return e("div",{className:"".concat("sm"===o?"w-2 h-2":"md"===o?"w-3 h-3":"lg"===o?"w-4 h-4":"w-5 h-5"," rounded-full animate-bounce ").concat(y?"":v("bg")),style:y?{backgroundColor:l,animationDelay:"".concat(.2*t,"s"),animationDuration:"1.4s"}:{animationDelay:"".concat(.2*t,"s"),animationDuration:"1.4s"}},t)}))})},S=function(){return t("div",{className:"relative",children:[e("div",{className:"".concat(b[o]," rounded-full animate-pulse ").concat(y?"":v("bg")),style:y?{backgroundColor:l}:{}}),e("div",{className:"absolute inset-0 ".concat(b[o]," rounded-full animate-ping opacity-30 ").concat(y?"":v("bg")),style:y?{backgroundColor:l}:{}})]})},M=function(){return e("div",{className:"flex space-x-1 items-end",children:[0,1,2,3].map((function(t){return e("div",{className:"".concat("sm"===o?"w-1":"md"===o?"w-1.5":"lg"===o?"w-2":"w-2.5"," rounded-sm animate-pulse ").concat(y?"":v("bg")),style:y?{backgroundColor:l,height:"".concat(20+10*t,"px"),animationDelay:"".concat(.15*t,"s"),animationDuration:"1.2s"}:{height:"".concat(20+10*t,"px"),animationDelay:"".concat(.15*t,"s"),animationDuration:"1.2s"}},t)}))})},T=function(){return t("div",{className:"relative",children:[e("div",{className:"".concat(b[o]," border-4 rounded-full animate-ping ").concat(y?"":v("border")),style:y?{borderColor:l}:{}}),e("div",{className:"absolute inset-2 border-4 rounded-full animate-ping ".concat(y?"":v("border")),style:y?{borderColor:l,animationDelay:"0.5s"}:{animationDelay:"0.5s"}})]})},O=t("div",{className:"flex flex-col items-center justify-center space-y-3 ".concat(p),children:[function(){if("image"===s&&f)return e(k,{});switch(s){case"dots":return e(C,{});case"pulse":return e(S,{});case"bars":return e(M,{});case"ripple":return e(T,{});default:return e(N,{})}}(),h&&e("p",{className:"".concat({sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"}[o]," font-medium animate-pulse ").concat(y?"":v("text")),style:y?{color:l}:{},children:h})]});return d?e("div",{className:"fixed inset-0 bg-white/80 backdrop-blur-sm flex items-center justify-center z-50",children:O}):O},Lf=function(){var n=r.useState("blue-500"),o=n[0],i=n[1],s=r.useState("spinner"),a=s[0],l=s[1],c=r.useState("md"),d=c[0],h=c[1],u=r.useState(!1),p=u[0],f=u[1],m=["spinner","dots","pulse","bars","ripple"];return t("div",{className:"p-8 max-w-4xl mx-auto",children:[e("h1",{className:"text-3xl font-bold text-gray-800 mb-8 text-center",children:"Modern Loading Component"}),t("div",{className:"bg-white rounded-xl shadow-lg p-6 mb-8",children:[e("h2",{className:"text-xl font-semibold text-gray-700 mb-4",children:"Customization"}),t("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Color"}),e("div",{className:"flex flex-wrap gap-2",children:[{name:"Blue",value:"blue-500",hex:"#3B82F6"},{name:"Purple",value:"purple-500",hex:"#8B5CF6"},{name:"Green",value:"green-500",hex:"#10B981"},{name:"Red",value:"red-500",hex:"#EF4444"},{name:"Orange",value:"orange-500",hex:"#F59E0B"},{name:"Pink",value:"pink-500",hex:"#EC4899"},{name:"Indigo",value:"indigo-500",hex:"#6366F1"},{name:"Teal",value:"teal-500",hex:"#14B8A6"}].map((function(t){return e("button",{onClick:function(){return i(t.value)},className:"w-8 h-8 rounded-full border-2 transition-all ".concat(o===t.value?"border-gray-400 scale-110":"border-gray-200"),style:{backgroundColor:t.hex},title:"".concat(t.name," (").concat(t.value,")")},t.value)}))})]}),t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Variant"}),e("select",{value:a,onChange:function(e){return l(e.target.value)},className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:m.map((function(t){return e("option",{value:t,children:t&&(null==t?void 0:t.charAt(0).toUpperCase())+(null==t?void 0:t.slice(1))},t)}))})]}),t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Size"}),e("select",{value:d,onChange:function(e){return h(e.target.value)},className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:["sm","md","lg","xl"].map((function(t){return e("option",{value:t,children:null==t?void 0:t.toUpperCase()},t)}))})]}),t("div",{children:[e("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Full Screen"}),e("button",{onClick:function(){return f(!0)},className:"w-full p-2 bg-gray-600 text-white rounded-md hover:bg-gray-700 transition-colors",children:"Demo Full Screen"})]})]}),t("div",{className:"bg-gray-50 rounded-lg p-8 flex flex-col items-center justify-center min-h-32",children:[e(Rf,{variant:a,size:d,color:o,text:"Loading..."}),e("div",{className:"mt-4 p-3 bg-white rounded-md shadow-sm",children:t("code",{className:"text-sm text-gray-600",children:['color="',o,'"']})})]})]}),t("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[e("h2",{className:"text-xl font-semibold text-gray-700 mb-4",children:"All Variants"}),e("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6",children:m.map((function(n){return t("div",{className:"text-center",children:[e("div",{className:"bg-gray-50 rounded-lg p-4 flex items-center justify-center h-24 mb-2",children:e(Rf,{variant:n,color:o})}),e("p",{className:"text-sm text-gray-600 capitalize",children:n})]},n)}))}),t("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg",children:[e("h3",{className:"font-semibold text-blue-800 mb-2",children:"Usage Examples:"}),t("div",{className:"space-y-2 text-sm",children:[t("div",{className:"bg-white p-2 rounded border",children:[e("code",{className:"text-blue-600",children:"// Tailwind CSS class"}),e("br",{}),e("code",{children:'<Loading color="primary-500" />'})]}),t("div",{className:"bg-white p-2 rounded border",children:[e("code",{className:"text-blue-600",children:"// Hex color"}),e("br",{}),e("code",{children:'<Loading color="#your-brand-color" />'})]}),t("div",{className:"bg-white p-2 rounded border",children:[e("code",{className:"text-blue-600",children:"// Custom Tailwind color"}),e("br",{}),e("code",{children:'<Loading color="emerald-400" variant="dots" />'})]})]})]})]}),p&&e(Rf,{variant:a,size:d,color:o,text:"Loading in full screen...",fullScreen:!0}),p&&e("button",{onClick:function(){return f(!1)},className:"fixed top-4 right-4 z-50 bg-red-500 text-white px-4 py-2 rounded-md hover:bg-red-600 transition-colors",children:"Close Full Screen"})]})},zf=function(n){var r=n.items,o=void 0===r?[]:r,i=n.onBackClick,s=n.showBackButton,a=void 0===s||s,l=n.separator,c=void 0===l?" / ":l,d=n.className;return t("div",{className:"flex gap-2 ".concat(void 0===d?"":d),children:[a&&e("div",{onClick:i,className:"cursor-pointer",children:e(D,{className:"text-gray-500 transition-colors hover:text-gray-700"})}),e("p",{className:"text-gray-400",children:o.map((function(n,r){return t("span",{children:[n.isActive?e("span",{className:"text-primary",children:n.label}):e("span",{className:n.onClick?"cursor-pointer transition-colors hover:text-gray-600":"",onClick:n.onClick,children:n.label}),r<o.length-1&&c]},r)}))})]})},If=function(r){var o=r.children,i=r.content,c=r.position,d=void 0===c?"top":c,h=r.variant,u=void 0===h?"light":h,p=r.size,f=void 0===p?"md":p,m=r.delay,g=void 0===m?200:m,y=r.disabled,v=void 0!==y&&y,b=r.className,x=void 0===b?"":b,w=s(!1),k=w[0],N=w[1],C=s(d),S=C[0],M=C[1],T=a(null),O=a(null),E=a(null);l((function(){if(k&&O.current&&E.current){var e=O.current,t=E.current.getBoundingClientRect(),n=e.getBoundingClientRect(),r=d;"top"===d&&t.top-n.height<10?r="bottom":"bottom"===d&&t.bottom+n.height>window.innerHeight-10?r="top":"left"===d&&t.left-n.width<10?r="right":"right"===d&&t.right+n.width>window.innerWidth-10&&(r="left"),M(r)}}),[k,d]);var A=function(){v||(T.current&&clearTimeout(T.current),T.current=setTimeout((function(){N(!0)}),g))},D=function(){T.current&&clearTimeout(T.current),N(!1)};l((function(){return function(){T.current&&clearTimeout(T.current)}}),[]);var R={dark:{tooltip:"bg-gray-900 text-white border-gray-700",arrow:{top:"border-t-gray-900",bottom:"border-b-gray-900",left:"border-l-gray-900",right:"border-r-gray-900"}},light:{tooltip:"bg-white text-gray-900 border-gray-200 shadow-lg",arrow:{top:"border-t-white",bottom:"border-b-white",left:"border-l-white",right:"border-r-white"}},accent:{tooltip:"bg-blue-600 text-white border-blue-500",arrow:{top:"border-t-blue-600",bottom:"border-b-blue-600",left:"border-l-blue-600",right:"border-r-blue-600"}}};return v||!i?e(n,{children:o}):t("div",{className:"relative inline-block",children:[e("div",{ref:E,onMouseEnter:A,onMouseLeave:D,onFocus:A,onBlur:D,className:"cursor-help",children:o}),k&&t("div",{ref:O,className:"absolute z-50 ".concat({top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"}[S]," ").concat(R[u].tooltip," ").concat({sm:"px-2 py-1 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"}[f]," animate-in fade-in-0 zoom-in-95 max-w-xs whitespace-nowrap break-words rounded-lg border font-medium backdrop-blur-sm duration-200 ").concat(x," "),role:"tooltip","aria-hidden":"false",children:[i,e("div",{className:"absolute h-0 w-0 border-4 ".concat({top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"}[S]," ").concat(R[u].arrow[S]," ")})]})]})},Pf=function(t){var n=t.children,r=t.variant,o=void 0===r?"default":r,i=t.size,s=void 0===i?"md":i,a=t.className,l=void 0===a?"":a,c=t.onClick,d=["inline-flex items-center font-medium rounded-full transition-colors duration-200",{default:"bg-gray-100 text-gray-800 hover:bg-gray-200",secondary:"bg-blue-100 text-blue-800 hover:bg-blue-200",success:"bg-green-100 text-green-800 hover:bg-green-200",warning:"bg-yellow-100 text-yellow-800 hover:bg-yellow-200",error:"bg-red-100 text-red-800 hover:bg-red-200",info:"bg-cyan-100 text-cyan-800 hover:bg-cyan-200"}[o],{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"}[s],c?"cursor-pointer":"",l].filter(Boolean).join(" ");return e("span",{className:d,onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c())}:void 0,children:n})};export{of as AlertContext,sf as AlertProvider,Pf as Badge,zf as Breadcrumb,x as Button,pe as Card,Tf as CardStatsSkeleton,ve as CheckBox,xe as CheckBoxDemo,cf as ConfirmationAlert,Oe as DateTimePicker,Ee as DateTimePickerDemo,fe as EmptyStateCard,ue as ExportButton,Ne as FileUpload,we as FileView,ke as FileViewSystemDemo,Ce as Input,Se as InputWithPrefix,Rf as Loading,Lf as LoadingDemo,df as Modal,hf as ModalExample,uf as Pagination,be as RadioGroup,Ef as SKELETON_LOADER_VERSION,Df as SKELETON_PATTERNS,Af as SKELETON_PRESETS,Ae as Search,De as Select,tf as SelectButton,xf as SkeletonAvatar,wf as SkeletonButton,kf as SkeletonCard,Nf as SkeletonImage,Sf as SkeletonList,vf as SkeletonLoader,Of as SkeletonLoaderExample,Cf as SkeletonProfile,Mf as SkeletonTable,bf as SkeletonText,ff as Table,mf as TableDropdown,pf as TableSkeleton,Me as TagInput,Te as TagInputDemo,ef as TextEditor,If as Tooltip,lf as alert,af as useAlert};
|
|
51
51
|
//# sourceMappingURL=index.mjs.map
|