pillardash-ui-react 0.1.37 → 0.1.39
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 +1 -0
- 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.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -47,5 +47,5 @@ var h={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?sl.exports=function(){if(rl)return al;rl=1;var e=t,n=Ya,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return al.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&u.hasValue){var t=u.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?t:(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,n,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},al}():sl.exports=(ll||(ll=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(new Error);var e=t,n=Ya,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;cl.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h,u=i(null);null===u.current?(h={hasValue:!1,value:null},u.current=h):h=u.current;var p=a((function(){var e,o,i=!1,s=function(t){if(!i){i=!0,e=t;var n=c(t);if(void 0!==d&&h.hasValue){var s=h.value;if(d(s,n))return o=s,s}return o=n,n}var a=o;if(r(e,t))return a;var l=c(t);return void 0!==d&&d(a,l)?a:(e=t,o=l,l)},a=void 0===n?null:n;return[function(){return s(t())},null===a?void 0:function(){return s(a())}]}),[t,n,c,d]),f=p[0],m=p[1],g=o(e,f,m);return s((function(){h.hasValue=!0,h.value=g}),[g]),l(g),g},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),cl);var dl=sl.exports;const hl="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;class ul{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}}const pl="production"!==process.env.NODE_ENV,fl="undefined"==typeof window,ml=fl||Boolean("undefined"!=typeof window&&window.next);class gl{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((e=>e()))}getInitialEditor(){if(void 0===this.options.current.immediatelyRender)return fl||ml?(pl&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&fl&&pl)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onBeforeCreate)||void 0===n?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null===(n=(t=this.options.current).onBlur)||void 0===n?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onCreate)||void 0===n?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null===(n=(t=this.options.current).onDestroy)||void 0===n?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null===(n=(t=this.options.current).onFocus)||void 0===n?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onSelectionUpdate)||void 0===n?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null===(n=(t=this.options.current).onTransaction)||void 0===n?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onUpdate)||void 0===n?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null===(n=(t=this.options.current).onContentError)||void 0===n?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null===(n=(t=this.options.current).onDrop)||void 0===n?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null===(n=(t=this.options.current).onPaste)||void 0===n?void 0:n.call(t,...e)}};return new va(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null===(r=t.extensions)||void 0===r?void 0:r[n])})):e[n]===t[n])))}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===e.length?gl.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}}function yl(e={},n=[]){const r=t.useRef(e);r.current=e;const[o]=t.useState((()=>new gl(r))),i=Ya.useSyncExternalStore(o.subscribe,o.getEditor,o.getServerSnapshot);return t.useDebugValue(i),t.useEffect(o.onRender(n)),function(e){var n;const[r]=t.useState((()=>new ul(e.editor))),o=dl.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,null!==(n=e.equalityFn)&&void 0!==n?n:il);hl((()=>r.watch(e.editor)),[e.editor,r]),t.useDebugValue(o)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}t.createContext({editor:null}).Consumer;const vl=t.createContext({onDragStart:void 0});t.forwardRef(((e,n)=>{const{onDragStart:r}=t.useContext(vl),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));const xl=/^\s*>\s$/,bl=ka.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",cs(this.options.HTMLAttributes,e),0]},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[wa({find:xl,type:this.type})]}}),wl=/(^|[^`])`([^`]+)`(?!`)/,kl=/(^|[^`])`([^`]+)`(?!`)/g,Sl=Cs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",cs(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xa({find:wl,type:this.type})]},addPasteRules(){return[Sa({find:kl,type:this.type})]}}),Cl=/^```([a-z]+)?[\s\n]$/,Ml=/^~~~([a-z]+)?[\s\n]$/,Nl=ka.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",cs(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!i||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;if(!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();if(void 0===s)return!1;return r.nodeAt(s)?e.commands.command((({tr:e})=>(e.setSelection(Rt.near(r.resolve(s))),!0))):e.commands.exitCode()}}},addInputRules(){return[ba({find:Cl,type:this.type,getAttributes:e=>({language:e[1]})}),ba({find:Ml,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Zt({key:new tn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Lt.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function Ol(e={}){return new Zt({view:t=>new Tl(t,e)})}class Tl{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=yt(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)}}const El=As.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Ol(this.options)]}});class Al extends Rt{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Al.valid(n)?new Al(n):Rt.near(n)}content(){return H.empty}eq(e){return e instanceof Al&&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 Al(e.resolve(t.pos))}getBookmark(){return new Dl(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&&Al.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(Al.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!$t.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(Al.valid(s))return s}return null}}}Al.prototype.visible=!1,Al.findFrom=Al.findGapCursorFrom,Rt.jsonID("gapcursor",Al);class Dl{constructor(e){this.pos=e}map(e){return new Dl(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Al.valid(t)?new Al(t):Rt.near(t)}}const jl=Ai({ArrowLeft:Rl("horiz",-1),ArrowRight:Rl("horiz",1),ArrowUp:Rl("vert",-1),ArrowDown:Rl("vert",1)});function Rl(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 Lt){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=Al.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new Al(l))),!0)}}function Il(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Al.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&$t.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new Al(r))),!0)}function Pl(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Al))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=L.empty;for(let e=r.length-1;e>=0;e--)o=L.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new H(o,0,0));return i.setSelection(Lt.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function zl(e){if(!(e.selection instanceof Al))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ho.create(e.doc,[Vo.widget(e.selection.head,t,{key:"gapcursor"})])}const Ll=As.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Zt({props:{decorations:zl,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Al.valid(n)?new Al(n):null,handleClick:Il,handleKeyDown:jl,handleDOMEvents:{beforeinput:Pl}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=us(is(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),Bl=ka.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",cs(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()}}}),$l=ka.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,cs(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>ba({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var Vl=200,Fl=function(){};Fl.prototype.append=function(e){return e.length?(e=Fl.from(e),!this.length&&e||e.length<Vl&&this.leafAppend(e)||this.length<Vl&&e.leafPrepend(this)||this.appendInner(e)):this},Fl.prototype.prepend=function(e){return e.length?Fl.from(e).append(this):this},Fl.prototype.appendInner=function(e){return new Hl(this,e)},Fl.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Fl.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Fl.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Fl.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)},Fl.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},Fl.from=function(e){return e instanceof Fl?e:e&&e.length?new _l(e):Fl.empty};var _l=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<=Vl)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Vl)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}(Fl);Fl.empty=new _l([]);var Hl=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}(Fl);class Wl{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 ql(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 ql(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 Wl(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 ql(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>Jl&&(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 Wl(s.append(o),i)}remapping(e,t){let n=new Ue;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 Wl(this.items.append(e.map((e=>new ql(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 ql(l,i,c))}else n.push(new ql(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new ql(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new Wl(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 ql(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 Wl(Fl.from(r.reverse()),o)}}Wl.empty=new Wl(Fl.empty,0);class ql{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 ql(t.getMap().invert(),t,this.selection)}}}class Kl{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Jl=20;function Ul(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 Gl(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 Xl=!1,Yl=null;function Zl(e){let t=e.plugins;if(Yl!=t){Xl=!1,Yl=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Xl=!0;break}}return Xl}const Ql=new tn("history"),ec=new tn("closeHistory");function tc(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Zt({key:Ql,state:{init:()=>new Kl(Wl.empty,Wl.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(Ql);if(i)return i.historyState;n.getMeta(ec)&&(e=new Kl(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Ql))return s.getMeta(Ql).redo?new Kl(e.done.addTransform(n,void 0,r,Zl(t)),e.undone,Ul(n.mapping.maps),e.prevTime,e.prevComposition):new Kl(e.done,e.undone.addTransform(n,void 0,r,Zl(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Kl(e.done.rebased(n,o),e.undone.rebased(n,o),Gl(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Kl(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Gl(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?Gl(e.prevRanges,n.mapping):Ul(n.mapping.maps);return new Kl(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Zl(t)),Wl.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?rc:"historyRedo"==n?oc:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function nc(e,t){return(n,r)=>{let o=Ql.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=Zl(t),o=Ql.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 Kl(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Ql,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const rc=nc(!1,!0),oc=nc(!0,!0),ic=As.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>rc(e,t),redo:()=>({state:e,dispatch:t})=>oc(e,t)}),addProseMirrorPlugins(){return[tc(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()}}}),sc=ka.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",cs(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:o}=n,i=e();return 0===r.parentOffset?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):n instanceof $t?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.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(Lt.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection($t.create(e.doc,t.pos)):e.setSelection(Lt.create(e.doc,t.pos));else{const o=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();o&&(e.insert(r,o),e.setSelection(Lt.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new xs({find:e.find,handler:({state:t,range:n,match:r})=>{const o=us(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}}),ac=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,lc=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,cc=Cs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",cs(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xa({find:ac,type:this.type})]},addPasteRules(){return[Sa({find:lc,type:this.type})]}}),dc=As.create({name:"starterKit",addExtensions(){const e=[];return!1!==this.options.bold&&e.push(Ta.configure(this.options.bold)),!1!==this.options.blockquote&&e.push(bl.configure(this.options.blockquote)),!1!==this.options.bulletList&&e.push(Da.configure(this.options.bulletList)),!1!==this.options.code&&e.push(Sl.configure(this.options.code)),!1!==this.options.codeBlock&&e.push(Nl.configure(this.options.codeBlock)),!1!==this.options.document&&e.push(ja.configure(this.options.document)),!1!==this.options.dropcursor&&e.push(El.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&e.push(Ll.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&e.push(Bl.configure(this.options.hardBreak)),!1!==this.options.heading&&e.push($l.configure(this.options.heading)),!1!==this.options.history&&e.push(ic.configure(this.options.history)),!1!==this.options.horizontalRule&&e.push(sc.configure(this.options.horizontalRule)),!1!==this.options.italic&&e.push(La.configure(this.options.italic)),!1!==this.options.listItem&&e.push(Ba.configure(this.options.listItem)),!1!==this.options.orderedList&&e.push(Fa.configure(this.options.orderedList)),!1!==this.options.paragraph&&e.push(_a.configure(this.options.paragraph)),!1!==this.options.strike&&e.push(cc.configure(this.options.strike)),!1!==this.options.text&&e.push(Ha.configure(this.options.text)),e}});function hc(t){var n=t.size,r=void 0===n?18:n;return e.jsx("svg",{width:r,height:r,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M6.75 3.75H15.75M2.25 3.75H3.75M6.75 9H15.75M2.25 9H3.75M6.75 14.25H15.75M2.25 14.25H3.75",stroke:"#27272A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function uc(t){var n=t.size,r=void 0===n?18:n;return e.jsx("svg",{width:r,height:r,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.25 4.5H15.75M8.25 9H15.75M8.25 13.5H15.75M2.25 11.25H3.375C3.58425 11.25 3.6885 11.25 3.7755 11.2672C3.95012 11.302 4.11053 11.3877 4.23642 11.5136C4.36231 11.6395 4.44804 11.7999 4.48275 11.9745C4.5 12.0615 4.5 12.165 4.5 12.375C4.5 12.585 4.5 12.6885 4.48275 12.7755C4.44804 12.9501 4.36231 13.1105 4.23642 13.2364C4.11053 13.3623 3.95012 13.448 3.7755 13.4827C3.6885 13.5 3.585 13.5 3.375 13.5C3.165 13.5 3.0615 13.5 2.9745 13.5173C2.79988 13.552 2.63947 13.6377 2.51358 13.7636C2.38769 13.8895 2.30196 14.0499 2.26725 14.2245C2.25 14.3115 2.25 14.415 2.25 14.625V15.3C2.25 15.5122 2.25 15.618 2.316 15.684C2.382 15.75 2.4885 15.75 2.7 15.75H4.5M2.25 2.25H3.15C3.20967 2.25 3.2669 2.27371 3.3091 2.3159C3.35129 2.3581 3.375 2.41533 3.375 2.475V6.75M3.375 6.75H2.25M3.375 6.75H4.5",stroke:"#27272A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var pc=function(n){var r=n.message,o=n.description,i=n.type,s=void 0===i?"info":i,a=n.duration,l=void 0===a?5e3:a,c=n.onClose,d=t.useState(!0),h=d[0],u=d[1],p=t.useState(100),f=p[0],m=p[1],g={success:{icon:e.jsx(v,{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.jsx(y,{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.jsx(M,{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.jsx(O,{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"}};t.useEffect((function(){var e=setTimeout((function(){u(!1),setTimeout((function(){null==c||c()}),300)}),l),t=setInterval((function(){m((function(e){var t=e-100/(l/100);return t<=0?0:t}))}),100);return function(){clearTimeout(e),clearInterval(t)}}),[l,c]);var x=g[s],b=x.icon,w=x.bgColor,k=x.borderColor,S=x.textColor,C=x.iconColor,N=x.progressColor;return e.jsx("div",{className:"fixed right-4 top-4 z-50 transform transition-all duration-300 ".concat(h?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:e.jsxs("div",{className:"flex w-72 rounded-lg border shadow-lg md:w-96 ".concat(k," ").concat(w," p-4"),children:[e.jsx("div",{className:"flex-shrink-0 ".concat(C),children:b}),e.jsxs("div",{className:"ml-3 w-full",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("p",{className:"text-md font-semibold ".concat(S),children:r}),e.jsx("button",{onClick:function(){u(!1),setTimeout((function(){null==c||c()}),300)},className:"text-gray-600 hover:text-gray-600 focus:outline-none",children:e.jsx(E,{className:"h-4 w-4"})})]}),o&&e.jsx("p",{className:"mt-1 text-sm ".concat(S," opacity-80"),children:o}),e.jsx("div",{className:"mt-2 h-1 w-full rounded-full bg-gray-200",children:e.jsx("div",{className:"".concat(N," h-1 rounded-full transition-all duration-100 ease-linear"),style:{width:"".concat(f,"%")}})})]})]})})},fc=null,mc=t.createContext(void 0),gc={success:function(e,t){fc?fc.success(e,t):console.warn("AlertProvider not mounted yet")},error:function(e,t){fc?fc.error(e,t):console.warn("AlertProvider not mounted yet")},info:function(e,t){fc?fc.info(e,t):console.warn("AlertProvider not mounted yet")},warning:function(e,t){fc?fc.warning(e,t):console.warn("AlertProvider not mounted yet")},show:function(e){fc?fc.showAlert(e):console.warn("AlertProvider not mounted yet")}},yc=function(n){var r=n.isOpen,o=n.onClose,i=n.title,s=n.children,a=n.size,l=void 0===a?"md":a,c=n.position,d=void 0===c?"right":c,h=n.showCloseButton,u=void 0===h||h,p=n.closeOnOverlayClick,f=void 0===p||p,m=n.closeOnEscape,g=void 0===m||m,y=n.className,v=void 0===y?"":y,x=n.overlayClassName,b=void 0===x?"":x,w=n.contentClassName,k=void 0===w?"":w,S=n.headerClassName,C=void 0===S?"":S,M=n.footer,N=n.footerClassName,O=void 0===N?"":N,T=n.maxHeight,A=void 0!==T&&T,D=t.useRef(null),j=t.useRef(null);t.useEffect((function(){var e;return r?(j.current=document.activeElement,null===(e=D.current)||void 0===e||e.focus(),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",j.current&&j.current.focus()),function(){document.body.style.overflow="unset"}}),[r]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&g&&o()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,g,o]);var R=function(e){e.target===e.currentTarget&&f&&o()};return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(b),role:"dialog","aria-modal":"true","aria-labelledby":i?"modal-title":void 0,children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-700",onClick:R}),e.jsx("div",{className:"fixed inset-0 flex p-4 ".concat({left:"items-start justify-start",right:"items-start justify-end",center:"items-center justify-center"}[d]),onClick:R,children:e.jsxs("div",{ref:D,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:"max-w-full mx-4"}[l]," bg-white shadow-2xl transform transition-all duration-700 ease-out flex flex-col\n ").concat("left"===d||"right"===d?"h-full ".concat(A?"max-h-screen":""," rounded-2xl"):"rounded-2xl ".concat(A?"max-h-[90vh] overflow-hidden":""),"\n ").concat("center"===d?"animate-in fade-in-0 zoom-in-95":"left"===d?"animate-in slide-in-from-left-full":"animate-in slide-in-from-right-full","\n ").concat(v,"\n "),onClick:function(e){return e.stopPropagation()},children:[(i||u)&&e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 flex-shrink-0 ".concat(C),children:[i&&e.jsx("h2",{id:"modal-title",className:"text-xl font-semibold text-gray-900 truncate pr-4",children:i}),u&&e.jsx("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.jsx(E,{size:20})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto ".concat(A?"overflow-y-auto":""," ").concat(k),children:!A||"left"!==d&&"right"!==d?e.jsx("div",{className:"p-6",children:s}):e.jsx("div",{className:"p-6 min-h-0 flex-1",children:s})}),M&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 bg-gray-50 flex-shrink-0 rounded-2xl ".concat(O),children:M})]})})]}):null};function vc(t){var n=t.currentPage,r=t.totalPages,o=t.totalItems,i=t.itemsPerPage,s=t.onPageChange,l=t.onViewChange,c=t.loading,d=void 0!==c&&c,h=function(e){e>0&&e<=r&&!d&&s&&s(e)},u=(n-1)*i,p=Math.min(u+i,o);return e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white py-3",children:[e.jsxs("div",{className:"flex flex-1 justify-between sm:hidden",children:[e.jsx("button",{onClick:function(){return h(n-1)},disabled:1===n||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===n||d?"cursor-not-allowed opacity-50":""),children:"Previous"}),e.jsx("button",{onClick:function(){return h(n+1)},disabled:n===r||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(n===r||d?"cursor-not-allowed opacity-50":""),children:"Next"})]}),e.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,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.jsx("option",{value:t,children:t},t)}))}),e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700",children:e.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("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"})})})]}),e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsxs("span",{children:[o," Entries"]}),e.jsxs("span",{className:"ml-1",children:["(Showing ",u+1,"-",p," of ",o,")"]})]})]}),e.jsx("div",{children:e.jsxs("nav",{className:"relative z-0 inline-flex gap-2 -space-x-px rounded-md shadow-sm","aria-label":"Pagination",children:[e.jsxs("button",{onClick:function(){return h(n-1)},disabled:1===n||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===n||d?"cursor-not-allowed opacity-50":""),children:[e.jsx("span",{className:"sr-only",children:"Previous"}),e.jsx("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.jsx("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(r<=5)for(var t=1;t<=r;t++)e.push(t);else{var o=Math.max(1,n-2),i=Math.min(r,o+5-1);i-o<4&&(o=Math.max(1,i-5+1));for(t=o;t<=i;t++)e.push(t)}return e}().map((function(t){return e.jsx("button",{onClick:function(){return h(t)},disabled:d,"aria-current":n===t?"page":void 0,className:"relative inline-flex items-center rounded-md border px-4 py-2 text-sm font-semibold ".concat(n===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)})),e.jsxs(a,{onClick:function(){return h(n+1)},disabled:n===r||d,type:"button",variant:"primary",size:"small",outline:!0,children:["Next Page",e.jsx("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.jsx("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 xc(t){var n=t.columns,r=t.rows;return e.jsx(e.Fragment,{children:Array.from({length:r}).map((function(t,r){return e.jsx("tr",{children:Array.from({length:n}).map((function(t,n){return e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:e.jsx("div",{className:"h-4 animate-pulse rounded bg-gray-200"})},"skeleton-cell-".concat(r,"-").concat(n))}))},"skeleton-row-".concat(r))}))})}var bc={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"}},wc={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"}}},kc=function(n){var r=n.variant,o=void 0===r?"text":r,i=n.animation,s=void 0===i?"pulse":i,a=n.size,l=n.width,c=n.height,d=n.count,h=void 0===d?1:d,u=n.className,p=void 0===u?"":u,f=n.shimmer,m=void 0!==f&&f,g=n.borderRadius,y=n.intensity,v=void 0===y?"medium":y,x=n.delay,b=void 0===x?0:x,w=t.useState(0===b),k=w[0],S=w[1];t.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=wc[o],M=t.useMemo((function(){return{width:void 0!==l?"number"==typeof l?"".concat(l,"px"):l:a?bc[a].width:C.defaultSize.width,height:void 0!==c?"number"==typeof c?"".concat(c,"px"):c:a?bc[a].height:C.defaultSize.height}}),[l,c,a,C]);if(t.useEffect((function(){if(b>0){var e=setTimeout((function(){return S(!0)}),b);return function(){return clearTimeout(e)}}}),[b]),!k)return null;var N=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(" ")},O=function(t){return e.jsx("div",{className:"".concat(N()," ").concat(p),style:(n={width:M.width,height:M.height},g&&(n.borderRadius=g),n),"aria-hidden":"true"},t);var n};return h>1?e.jsx("div",{className:"space-y-2",children:Array.from({length:h},(function(e,t){return O(t)}))}):O(0)},Sc=function(t){return e.jsx(kc,j({},t,{variant:"text"}))},Cc=function(t){return e.jsx(kc,j({},t,{variant:"avatar"}))},Mc=function(t){return e.jsx(kc,j({},t,{variant:"button"}))},Nc=function(t){var n=t.showBio,r=void 0===n||n;return e.jsxs("div",{className:"flex items-start space-x-4",children:[e.jsx(Cc,{size:"lg"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Sc,{width:"60%",height:"1.25rem"}),e.jsx(Sc,{width:"40%",height:"1rem",intensity:"light"}),r&&e.jsxs("div",{className:"space-y-1 pt-2",children:[e.jsx(Sc,{width:"100%"}),e.jsx(Sc,{width:"80%"}),e.jsx(Sc,{width:"90%"})]})]})]})},Oc=function(t){var n=t.itemCount,r=void 0===n?3:n,o=t.showAvatar,i=void 0===o||o,s=t.showMeta,a=void 0===s||s;return e.jsx("div",{className:"space-y-4",children:Array.from({length:r},(function(t,n){return e.jsxs("div",{className:"flex items-start space-x-3",children:[i&&e.jsx(Cc,{}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Sc,{width:"75%",height:"1.125rem"}),e.jsx(Sc,{width:"100%",height:"0.875rem",intensity:"light"}),a&&e.jsxs("div",{className:"flex space-x-4",children:[e.jsx(Sc,{width:"3rem",height:"0.75rem",intensity:"light"}),e.jsx(Sc,{width:"4rem",height:"0.75rem",intensity:"light"})]})]})]},n)}))})},Tc=function(t){var n=t.rows,r=void 0===n?5:n,o=t.columns,i=void 0===o?4:o,s=t.showHeader,a=void 0===s||s;return e.jsxs("div",{className:"space-y-3",children:[a&&e.jsx("div",{className:"flex space-x-4",children:Array.from({length:i},(function(t,n){return e.jsx(Sc,{width:"100%",height:"1rem",intensity:"dark"},n)}))}),e.jsx("div",{className:"space-y-2",children:Array.from({length:r},(function(t,n){return e.jsx("div",{className:"flex space-x-4",children:Array.from({length:i},(function(t,n){return e.jsx(Sc,{width:"100%",height:"0.875rem"},n)}))},n)}))})]})};exports.AlertContext=mc,exports.AlertProvider=function(n){var r=n.children,o=t.useState([]),i=o[0],s=o[1],a=t.useCallback((function(e){s((function(t){return t.filter((function(t){return t.id!==e}))}))}),[]),l=t.useCallback((function(e){var t=Math.random().toString(36).substring(2,9),n=j(j({},e),{id:t,onClose:function(){return a(t)}});s((function(e){return R(R([],e,!0),[n],!1)}))}),[a]),c=t.useCallback((function(e){return function(t,n){l({message:t,description:n,type:e})}}),[l]),d={showAlert:l,success:c("success"),error:c("error"),info:c("info"),warning:c("warning")};return fc=d,e.jsxs(mc.Provider,{value:d,children:[r,e.jsx("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.jsx("div",{style:{transform:"translateY(".concat(10*n,"px)"),zIndex:50-n},children:e.jsx(pc,j({},t))},t.id)}))})]})},exports.Button=a,exports.Card=function(t){var n=t.children;return e.jsx("div",{className:"w-full rounded-[20px] border border-[#EEEEF0] bg-white p-4",children:n})},exports.CheckBox=function(n){var r=n.variant,o=void 0===r?"check":r,i=n.size,s=void 0===i?"sm":i,a=n.checked,l=void 0!==a&&a,c=n.disabled,d=void 0!==c&&c,h=n.onChange,u=n.label,p=t.useState(l),f=p[0],m=p[1];t.useEffect((function(){m(l)}),[l]);var g=function(){if(!d){var e=!f;m(e),null==h||h(e)}},y={sm:{container:"h-6 w-6",toggle:"w-10 h-6",toggleCircle:"h-4 w-4"},md:{container:"h-8 w-8",toggle:"w-12 h-7",toggleCircle:"h-5 w-5"},lg:{container:"h-10 w-10",toggle:"w-14 h-8",toggleCircle:"h-6 w-6"}};return e.jsxs("div",{className:"flex items-center gap-2",children:["toggle"===o?e.jsx("div",{className:"relative rounded-full transition-colors ".concat(y[s].toggle," ").concat(f?"bg-primary":"bg-gray-200"," ").concat(d?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:g,children:e.jsx("div",{className:"absolute top-1 transform rounded-full bg-white transition-transform ".concat(y[s].toggleCircle," ").concat(f?"right-1/2 translate-x-full":"left-1"),children:f&&"toggle"===o&&e.jsx("svg",{className:"h-full w-full text-teal-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})})}):e.jsxs("div",{className:"".concat(y[s].container," ").concat("check"===o?"rounded-lg":"rounded-full"," flex items-center justify-center border-2 transition-colors ").concat(f?"border-primary bg-primary":"border-gray-200 bg-gray-50"," ").concat(d?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:g,children:[f&&"check"===o&&e.jsx("svg",{className:"h-3/4 w-3/4 text-white",fill:"none",viewBox:"0 0 28 28",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),f&&"dot"===o&&e.jsx("div",{className:"h-2/4 w-2/4 rounded-full bg-white"})]}),u&&e.jsx("label",{className:"".concat(d?"text-gray-400":"text-gray-700"),children:u})]})},exports.ConfirmationAlert=function(n){var r=n.isOpen,o=n.onConfirm,i=n.onCancel,s=n.title,l=n.message,c=n.confirmText,d=void 0===c?"Confirm":c,h=n.cancelText,u=void 0===h?"Cancel":h,p=n.type,f=void 0===p?"default":p,m=n.showIcon,g=void 0===m||m,y=n.showCloseButton,b=void 0===y||y,w=n.closeOnOverlayClick,k=void 0===w||w,S=n.closeOnEscape,C=void 0===S||S,N=n.isLoading,T=void 0!==N&&N,A=n.className,D=void 0===A?"":A,j=n.overlayClassName,R=void 0===j?"":j,I=n.maxWidth,P=void 0===I?"sm":I,z=t.useRef(null),L=t.useRef(null),B=t.useRef(null);t.useEffect((function(){return r?(B.current=document.activeElement,setTimeout((function(){var e,t,n;"danger"===f?null===(t=null===(e=z.current)||void 0===e?void 0:e.querySelector("[data-cancel-button]"))||void 0===t||t.focus():null===(n=L.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,f]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&C&&!T&&i()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,C,i,T]);var $=function(){T||i()},V={default:{icon:M,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"},danger:{icon:x,iconColor:"text-red-600",iconBg:"bg-red-100",confirmButton:"bg-red-600 hover:bg-red-700 focus:ring-red-500"},warning:{icon:O,iconColor:"text-yellow-600",iconBg:"bg-yellow-100",confirmButton:"bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500"},success:{icon:v,iconColor:"text-green-600",iconBg:"bg-green-100",confirmButton:"bg-green-600 hover:bg-green-700 focus:ring-green-500"},info:{icon:M,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}}[f],F=V.icon;return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(R),role:"dialog","aria-modal":"true","aria-labelledby":s?"confirmation-title":void 0,"aria-describedby":"confirmation-message",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300",onClick:function(e){e.target===e.currentTarget&&k&&!T&&i()}}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:e.jsxs("div",{ref:z,className:"relative w-full ".concat({sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}[P]," 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(D," "),onClick:function(e){return e.stopPropagation()},children:[b&&e.jsx("button",{onClick:$,disabled:T,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.jsx(E,{size:20})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[g&&e.jsx("div",{className:"h-12 w-12 flex-shrink-0 rounded-full ".concat(V.iconBg," flex items-center justify-center"),children:e.jsx(F,{size:24,className:V.iconColor})}),e.jsxs("div",{className:"min-w-0 flex-1 justify-center",children:[s&&e.jsx("h3",{id:"confirmation-title",className:"mb-1 text-center text-lg font-semibold text-gray-900",children:s}),e.jsx("p",{id:"confirmation-message",className:"leading-relaxed text-gray-600",children:l})]})]}),e.jsxs("div",{className:"flex ".concat("justify-center"," mt-6 space-x-3"),children:[e.jsx(a,{variant:"neutral",outline:!0,size:"small","data-cancel-button":"",onClick:$,disabled:T,children:u}),e.jsx("button",{ref:L,onClick:function(){T||o()},disabled:T,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:T?e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):d})]})]})]})})]}):null},exports.EmptyStateCard=D,exports.ExportButton=function(){var n=t.useState(!1),r=n[0],o=n[1],i=t.useRef(null),s=function(e){o(!1)};return t.useEffect((function(){var e=function(e){i.current&&!i.current.contains(e.target)&&o(!1)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]),e.jsxs("div",{className:"relative inline-block",ref:i,children:[e.jsxs("div",{className:"flex",children:[e.jsxs("button",{className:"flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){return s(A.PDF)},children:[e.jsx(b,{className:"mr-2 h-4 w-4"}),"Export"]}),e.jsx("button",{className:"rounded-r-md border border-l-0 border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){o(!r)},children:e.jsx(g,{className:"h-4 w-4"})})]}),r&&e.jsx("div",{className:"absolute right-0 z-10 mt-1 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:e.jsxs("div",{className:"py-1",children:[e.jsxs("button",{onClick:function(){return s(A.PDF)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(S,{className:"mr-2 h-4 w-4"}),"PDF Document"]}),e.jsxs("button",{onClick:function(){return s(A.CSV)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(k,{className:"mr-2 h-4 w-4"}),"CSV Spreadsheet"]}),e.jsxs("button",{onClick:function(){return s(A.EXCEL)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(k,{className:"mr-2 h-4 w-4"}),"Excel Spreadsheet"]})]})})]})},exports.FileUpload=function(n){var r=n.onFileChange,o=t.useState(null),i=o[0],s=o[1],a=t.useState(0),l=a[0],c=a[1];return e.jsx("div",{className:"space-y-4",children:i?e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"mr-3 rounded-lg bg-blue-100 p-2",children:e.jsx(C,{size:24,className:"text-blue-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:i.name}),e.jsxs("p",{className:"text-xs text-gray-500",children:[(i.size/1024).toFixed(2),"KB/",(i.size/1024).toFixed(2),"KB"]})]})]}),e.jsx("button",{onClick:function(){s(null),c(0),r(null)},className:"text-red-500",children:e.jsx(E,{size:16})})]}),e.jsx("div",{className:"h-2.5 w-full rounded-full bg-gray-200",children:e.jsx("div",{className:"h-2.5 rounded-full bg-gray-800",style:{width:"".concat(l,"%")}})}),e.jsxs("p",{className:"mt-1 text-right text-xs text-gray-500",children:[l,"%"]})]}):e.jsxs("div",{className:"rounded-lg border-2 border-dashed border-gray-300 p-8 text-center",onDragOver:function(e){e.preventDefault()},onDrop:function(e){if(e.preventDefault(),e.dataTransfer.files&&e.dataTransfer.files[0]){var t=e.dataTransfer.files[0];s(t),c(10);var n=setInterval((function(){c((function(e){return e>=100?(clearInterval(n),100):e+10}))}),300);r(t)}},children:[e.jsx("p",{className:"cursor-pointer text-teal-600 hover:underline",onClick:function(){var e;return null===(e=document.getElementById("fileInput"))||void 0===e?void 0:e.click()},children:"Click to Upload"}),e.jsx("input",{id:"fileInput",type:"file",className:"hidden",onChange:function(e){if(e.target.files&&e.target.files[0]){var t=e.target.files[0];s(t),c(10);var n=setInterval((function(){c((function(e){return e>=100?(clearInterval(n),100):e+10}))}),300);r(t)}}}),e.jsx("p",{className:"text-gray-500",children:"or drag and drop"}),e.jsx("p",{className:"mt-2 text-sm text-gray-400",children:"(Max. File size: 25 MB)"})]})})},exports.Input=function(t){var n=t.id,r=t.label,o=t.value,i=t.size,s=void 0===i?"md":i,a=t.onChange,l=t.placeholder,c=t.error,d=t.required,h=void 0!==d&&d,u=t.helpText,p=t.type,f=void 0===p?"text":p,m=t.className,g=void 0===m?"":m,y=t.disabled,v=void 0!==y&&y,x=t.icon,b=t.iconPosition,w=void 0===b?"left":b,k=t.rightIcon,S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["id","label","value","size","onChange","placeholder","error","required","helpText","type","className","disabled","icon","iconPosition","rightIcon"]),C={id:n,value:o,onChange:function(e){a&&a(e)},placeholder:l,disabled:v,className:"w-full rounded-[12px] border ".concat({sm:"text-xs px-3 py-1.5 text-sm min-h-[32px]",md:"text-sm px-4 py-2 text-base min-h-[40px]",lg:"text-base px-4 py-3 text-lg min-h-[48px]"}[s]," ").concat(c?"border-red-500":"border-gray-200"," ").concat(v?"bg-gray-100 text-gray-500 placeholder-gray-300":"bg-gray-100 placeholder-gray-400 text-dark"," focus:outline-none focus:ring-1 focus:ring-primary ").concat(g," ").concat(x&&"left"===w?"pl-10":""," ").concat(x&&"right"===w?"pr-10":""),"aria-invalid":!!c,"aria-describedby":c?"".concat(n,"-error"):u?"".concat(n,"-help"):void 0};return e.jsxs("div",{className:"mb-4",children:[r&&e.jsxs("label",{htmlFor:n,className:"mb-1 block text-sm font-medium text-gray-600",children:[r,h&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[x&&"left"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:x}),"textarea"==f?e.jsx("textarea",j({},C,{rows:4,className:"".concat(C.className," resize-none")},S)):e.jsx("input",j({},C,{type:f},S)),x&&"right"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:x}),k&&e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer",children:k})]}),u&&!c&&e.jsx("p",{id:"".concat(n,"-help"),className:"mt-1 text-sm text-gray-500",children:u}),c&&e.jsx("p",{id:"".concat(n,"-error"),className:"mt-1 text-sm text-red-500",children:c})]})},exports.Modal=yc,exports.ModalExample=function(){var n=t.useState(!1),r=n[0],o=n[1],i=t.useState("left"),s=i[0],a=i[1],l=t.useState("md"),c=l[0],d=l[1],h=e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:function(){return o(!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.jsx("button",{onClick:function(){return o(!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 e.jsxs("div",{className:"p-8 space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Position"}),e.jsxs("select",{value:s,onChange:function(e){return a(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"left",children:"Left"}),e.jsx("option",{value:"right",children:"Right"}),e.jsx("option",{value:"center",children:"Center"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Size"}),e.jsxs("select",{value:c,onChange:function(e){return d(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"xs",children:"Extra Small"}),e.jsx("option",{value:"sm",children:"Small"}),e.jsx("option",{value:"md",children:"Medium"}),e.jsx("option",{value:"lg",children:"Large"}),e.jsx("option",{value:"xl",children:"Extra Large"}),e.jsx("option",{value:"2xl",children:"2X Large"}),e.jsx("option",{value:"full",children:"Full Width"})]})]})]}),e.jsx("button",{onClick:function(){return o(!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.jsx(yc,{isOpen:r,onClose:function(){return o(!1)},title:"Example Modal",size:c,position:s,footer:h,maxHeight:"center"!==s,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-gray-600",children:"This is an example of the multipurpose modal component. It supports different sizes, positions, and configurations."}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Features:"}),e.jsxs("ul",{className:"text-sm text-gray-600 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"Multiple sizes (xs, sm, md, lg, xl, 2xl, full)"}),e.jsx("li",{children:"Three positions (left, right, center)"}),e.jsx("li",{children:"Customizable styling with className props"}),e.jsx("li",{children:"Keyboard navigation and accessibility"}),e.jsx("li",{children:"Click outside to close"}),e.jsx("li",{children:"Smooth animations"}),e.jsx("li",{children:"Optional footer with actions"})]})]}),("left"===s||"right"===s)&&e.jsx("div",{className:"space-y-2",children:Array.from({length:20},(function(t,n){return e.jsxs("p",{className:"text-gray-600",children:["This is paragraph ",n+1," to demonstrate scrolling in side panels."]},n)}))})]})})]})},exports.Pagination=vc,exports.SKELETON_LOADER_VERSION="1.0.0",exports.SKELETON_PATTERNS={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}},exports.SKELETON_PRESETS={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"]},exports.Search=function(n){var r=n.placeholder,o=void 0===r?"Search...":r,i=n.onSearch,s=n.className,a=void 0===s?"":s,l=t.useState(""),c=l[0],d=l[1];return e.jsxs("div",{className:"relative ".concat(a),children:[e.jsx("input",{type:"text",value:c,onChange:function(e){e.preventDefault(),d(e.target.value),i(c)},placeholder:o,className:"w-full rounded-lg border border-gray-200 bg-white py-2 pl-8 pr-4 text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),e.jsxs("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 transform text-gray-400",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})]})},exports.Select=function(n){var r,o=n.options,i=n.placeholder,s=void 0===i?"Select an option":i,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,y=void 0!==m&&m,v=n.label,x=n.required,b=n.error,w=n.helpText,k=n.fullWidth,S=void 0===k||k,C=n.searchable,M=void 0!==C&&C,N=n.multiple,O=void 0!==N&&N,T=n.maxSelected,A=n.showSelectedCount,D=void 0!==A&&A,j=n.closeOnSelect,I=void 0===j||j,P=t.useState(!1),z=P[0],L=P[1],B=t.useState(""),$=B[0],V=B[1],F=t.useState((function(){if(!l)return[];if(O&&Array.isArray(l))return l.map((function(e){return o.find((function(t){return t.value===e}))})).filter(Boolean);if(!O&&"string"==typeof l){var e=o.find((function(e){return e.value===l}));return e?[e]:[]}return[]})),_=F[0],H=F[1],W=t.useRef(null),q=M?o.filter((function(e){return(e.label||e.value).toLowerCase().includes($.toLowerCase())})):o;return t.useEffect((function(){var e=function(e){W.current&&!W.current.contains(e.target)&&(L(!1),V(""))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]),e.jsxs("div",{ref:W,className:"".concat(S?"w-full":"w-fit"," mb-4"),children:[v&&e.jsxs("label",{htmlFor:f,className:"mb-1 block text-sm font-medium text-gray-700",children:[v,x&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",className:"flex items-center justify-between rounded-lg border ".concat(b?"border-red-500":"border-gray-200"," bg-white shadow-sm ").concat({sm:"text-xs px-3 py-1.5 text-sm min-h-[32px]",md:"text-sm px-4 py-2 text-base min-h-[40px]",lg:"text-base px-4 py-3 text-lg min-h-[48px]"}[d]," text-gray-700 hover:border-gray-300 focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 ").concat(y?"cursor-not-allowed bg-gray-50 opacity-50":""," ").concat(u," ").concat(S?"w-full":""," transition-all duration-200"),onClick:function(){return!y&&L(!z)},disabled:y,id:f,"aria-haspopup":"listbox","aria-expanded":z,children:[e.jsx("div",{className:"flex-1 flex items-center gap-1 min-w-0",children:O&&_.length>0?e.jsxs("div",{className:"flex flex-wrap gap-1 flex-1",children:[_.slice(0,3).map((function(t){return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary-100 text-primary-800 text-sm rounded-md",children:[e.jsx("span",{className:"truncate max-w-[120px]",children:t.label||t.value}),e.jsx(E,{className:"h-3 w-3 cursor-pointer hover:text-primary-900",onClick:function(e){return function(e,t){t.stopPropagation();var n=_.filter((function(t){return t.value!==e.value}));H(n);var r=O?n.map((function(e){return e.value})):"";a({target:{id:f||"",value:r}})}(t,e)}})]},t.value)})),_.length>3&&e.jsxs("span",{className:"text-sm text-gray-500 px-1",children:["+",_.length-3," more"]})]}):e.jsx("span",{className:"truncate ".concat(0===_.length?"text-gray-400":"text-gray-700"),children:function(){var e,t,n,r;return 0===_.length?s:O?D&&_.length>2?"".concat(_.length," items selected"):_.length<=2?_.map((function(e){return e.label||e.value})).join(", "):"".concat((null===(n=_[0])||void 0===n?void 0:n.label)||(null===(r=_[0])||void 0===r?void 0:r.value)," +").concat(_.length-1," more"):(null===(e=_[0])||void 0===e?void 0:e.label)||(null===(t=_[0])||void 0===t?void 0:t.value)}()})}),e.jsx(g,{className:"ml-2 h-4 w-4 text-gray-400 transition-transform flex-shrink-0 ".concat(z?"rotate-180 transform":"")})]}),z&&e.jsxs("div",{className:"absolute z-50 mt-1 w-full rounded-lg border border-gray-200 bg-white shadow-lg",role:"listbox",children:[M&&e.jsx("div",{className:"sticky top-0 border-b border-gray-100 bg-white p-3",children:e.jsx("input",{type:"text",className:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 transition-all duration-200",placeholder:"Search...",value:$,onChange:function(e){return V(e.target.value)},autoFocus:!0})}),e.jsx("div",{className:"max-h-60 overflow-auto py-1",children:q.length>0?e.jsxs(e.Fragment,{children:[O&&_.length>0&&e.jsxs("div",{className:"px-3 py-2 text-xs text-gray-500 border-b border-gray-100",children:[_.length," selected",T&&" of ".concat(T," max")]}),q.map((function(t){var n=function(e){return _.some((function(t){return t.value===e.value}))}(t),r=t.disabled||T&&!n&&_.length>=T;return e.jsxs("div",{className:"cursor-pointer px-3 py-2 flex items-center justify-between transition-colors duration-150 ".concat(n?"bg-primary-50 text-primary-700":"text-gray-700 hover:bg-gray-50"," ").concat(r?"cursor-not-allowed text-gray-400 hover:bg-white opacity-50":""),onClick:function(){return!r&&function(e){var t;if(!e.disabled){var n;if(O)if(_.some((function(t){return t.value===e.value})))n=_.filter((function(t){return t.value!==e.value}));else{if(T&&_.length>=T)return;n=R(R([],_,!0),[e],!1)}else n=[e];H(n);var r=O?n.map((function(e){return e.value})):(null===(t=n[0])||void 0===t?void 0:t.value)||"";a({target:{id:f||"",value:r}}),O&&!I||(L(!1),V(""))}}(t)},role:"option","aria-selected":n,"aria-disabled":r,children:[e.jsx("span",{className:"flex-1",children:t.label||t.value}),O&&n&&e.jsx("div",{className:"w-4 h-4 bg-primary-500 rounded-sm flex items-center justify-center",children:e.jsx("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},t.value)}))]}):e.jsx("div",{className:"px-3 py-2 text-gray-500 text-center",children:"No options found"})})]})]}),b&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:b}),w&&!b&&e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:w}),p&&e.jsx(e.Fragment,{children:O?_.map((function(t,n){return e.jsx("input",{type:"hidden",name:"".concat(p,"[]"),value:t.value},"".concat(t.value,"-").concat(n))})):e.jsx("input",{type:"hidden",name:p,value:(null===(r=_[0])||void 0===r?void 0:r.value)||""})})]})},exports.SelectButton=function(n){var r=n.options,o=n.placeholder,i=void 0===o?"Select an option":o,s=n.onChange,a=n.value,l=n.size,c=void 0===l?"md":l,d=n.className,h=void 0===d?"":d,u=n.name,p=n.id,f=n.disabled,y=void 0!==f&&f,v=n.label,x=n.required,b=t.useState(!1),w=b[0],k=b[1],S=t.useState(a&&r.find((function(e){return e.value===a}))||null),C=S[0],M=S[1];return e.jsxs("div",{className:"relative inline-block",children:[v&&e.jsxs("label",{htmlFor:p,className:"mb-1 block text-sm font-medium text-gray-700",children:[v,x&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("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"}[c]," text-gray-700 hover:bg-gray-50 focus:outline-none ").concat(y?"cursor-not-allowed opacity-50":""," ").concat(h),onClick:function(){return!y&&k(!w)},disabled:y,id:p,children:[e.jsx("span",{className:"truncate",children:C?(null==C?void 0:C.label)||C.value:i}),e.jsx(g,{className:"ml-2 h-4 w-4 ".concat(w?"rotate-180 transform":"")})]}),w&&e.jsx("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(t){return e.jsxs("div",{className:"cursor-pointer px-3 py-2 hover:bg-gray-100 rounded-lg flex justify-between item-center ".concat((null==C?void 0:C.value)===t.value?"bg-gray-50 text-black":"text-gray-900"),onClick:function(){return function(e){M(e),s(e.value),k(!1)}(t)},children:[e.jsx("div",{children:t.label||t.value}),(null==C?void 0:C.value)===t.value&&e.jsx("div",{children:e.jsx(m,{size:15,className:"text-primary"})})]},t.value)}))}),u&&e.jsx("input",{type:"hidden",name:u,value:(null==C?void 0:C.value)||""})]})},exports.SkeletonAvatar=Cc,exports.SkeletonButton=Mc,exports.SkeletonCard=function(t){return e.jsx(kc,j({},t,{variant:"card"}))},exports.SkeletonImage=function(t){return e.jsx(kc,j({},t,{variant:"image"}))},exports.SkeletonList=Oc,exports.SkeletonLoader=kc,exports.SkeletonLoaderExample=function(){return e.jsxs("div",{className:"bg-white p-5",children:[e.jsx(kc,{variant:"text",width:"200px"}),e.jsx(kc,{variant:"text",count:3}),e.jsx(Cc,{size:"lg"}),e.jsx(Mc,{animation:"wave"}),e.jsx(Nc,{showBio:!0}),e.jsx(Oc,{itemCount:5,showAvatar:!0}),e.jsx(Tc,{rows:5,columns:4}),e.jsx(kc,{variant:"card",shimmer:!0,intensity:"dark",borderRadius:"12px",className:"custom-skeleton"})]})},exports.SkeletonProfile=Nc,exports.SkeletonTable=Tc,exports.SkeletonText=Sc,exports.Table=function(t){var n=t.data,r=t.columns,o=t.itemsPerPage,i=void 0===o?20:o,s=t.onViewChange,a=t.totalItems,l=t.currentPage,c=void 0===l?1:l,d=t.onPageChange,h=t.loading,u=void 0!==h&&h,p=t.showPagination,f=void 0===p||p,m=t.onRowClick,g=a||n.length,y=Math.ceil(g/i),v=n;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"relative overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsx("tr",{children:r.map((function(t,n){return e.jsx("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===r.length-1?"rounded-br-xl rounded-tr-xl":""," "),children:t.title},n)}))})}),e.jsxs("tbody",{className:"divide-y divide-gray-200 bg-white \n ".concat(u?"opacity-50":""," ").concat(m?"cursor-pointer":"","\n "),children:[u&&e.jsx(xc,{columns:r.length,rows:i}),v.length>0?v.map((function(t,n){return e.jsx("tr",{onClick:function(){return function(e){m&&m(e)}(t)},className:"hover:bg-gray-50",children:r.map((function(n,r){return e.jsx("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)})):!u&&e.jsx("tr",{children:e.jsx("td",{colSpan:r.length,children:e.jsx(D,{title:"No Record found"})})})]})]})}),f&&e.jsx(vc,{currentPage:c,totalPages:y,totalItems:g,itemsPerPage:i,onPageChange:d,onViewChange:s,loading:u})]})},exports.TableDropdown=function(n){var r=n.actions,o=n.trigger,i=n.className,s=void 0===i?"":i,a=n.dropdownClassName,l=void 0===a?"":a,c=t.useState(!1),d=c[0],h=c[1],u=t.useRef(null),p=function(){h(!d)},f=function(){h(!1)};return t.useEffect((function(){var e=function(e){u.current&&!u.current.contains(e.target)&&f()};return d&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[d]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&f()};return d&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[d]),e.jsxs("div",{className:"relative inline-block ".concat(s),ref:u,children:[e.jsx("div",{className:"flex",children:o?e.jsx("div",{onClick:p,className:"cursor-pointer",children:o}):e.jsx("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:p,"aria-expanded":d,"aria-haspopup":"true",children:e.jsx(w,{className:"h-4 w-4"})})}),d&&e.jsx("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(l),children:e.jsxs("div",{className:"py-1",role:"menu","aria-orientation":"vertical",children:[r.map((function(t,n){return e.jsxs("button",{className:"flex w-full items-center px-4 py-2 text-left text-sm transition-colors duration-150 ".concat(t.disabled?"cursor-not-allowed bg-gray-50 text-gray-400":"danger"===t.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(),f())}(t)},disabled:t.disabled,role:"menuitem",children:[t.icon&&e.jsx("span",{className:"mr-3 flex-shrink-0",children:t.icon}),t.label]},n)})),0===r.length&&e.jsx("div",{className:"px-4 py-2 text-sm text-gray-500",children:"No actions available"})]})})]})},exports.TableSkeleton=xc,exports.TextEditor=function(t){var n=t.initialContent,r=void 0===n?"":n,o=t.onUpdate,i=yl({extensions:[dc,ja,_a,Ha,Ta,La,Wa,Da,Fa,Ba],content:r,onUpdate:function(e){var t=e.editor;o(t.getHTML())}});return e.jsxs("div",{className:"rounded-lg border",children:[e.jsxs("div",{className:"flex gap-4 border-b bg-gray-50 p-2",children:[e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleBold().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("bold"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(f,{size:18})}),e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleItalic().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("italic"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(N,{size:18})}),e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleUnderline().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("underline"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(T,{size:18})}),e.jsx("span",{className:"mx-2 h-6 border-r"}),e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleBulletList().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("bulletList"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(hc,{})}),e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleOrderedList().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("orderedList"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(uc,{})})]}),e.jsx(nl,{editor:i,className:"min-h-32 p-4"})]})},exports.alert=gc,exports.useAlert=function(){var e=t.useContext(mc);if(void 0===e)throw new Error("useAlert must be used within a AlertProvider");return e};
|
|
50
|
+
*/"production"===process.env.NODE_ENV?sl.exports=function(){if(rl)return al;rl=1;var e=t,n=Ya,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return al.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&u.hasValue){var t=u.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?t:(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,n,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},al}():sl.exports=(ll||(ll=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(new Error);var e=t,n=Ya,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;cl.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h,u=i(null);null===u.current?(h={hasValue:!1,value:null},u.current=h):h=u.current;var p=a((function(){var e,o,i=!1,s=function(t){if(!i){i=!0,e=t;var n=c(t);if(void 0!==d&&h.hasValue){var s=h.value;if(d(s,n))return o=s,s}return o=n,n}var a=o;if(r(e,t))return a;var l=c(t);return void 0!==d&&d(a,l)?a:(e=t,o=l,l)},a=void 0===n?null:n;return[function(){return s(t())},null===a?void 0:function(){return s(a())}]}),[t,n,c,d]),f=p[0],m=p[1],g=o(e,f,m);return s((function(){h.hasValue=!0,h.value=g}),[g]),l(g),g},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),cl);var dl=sl.exports;const hl="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;class ul{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}}const pl="production"!==process.env.NODE_ENV,fl="undefined"==typeof window,ml=fl||Boolean("undefined"!=typeof window&&window.next);class gl{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((e=>e()))}getInitialEditor(){if(void 0===this.options.current.immediatelyRender)return fl||ml?(pl&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&fl&&pl)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onBeforeCreate)||void 0===n?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null===(n=(t=this.options.current).onBlur)||void 0===n?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onCreate)||void 0===n?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null===(n=(t=this.options.current).onDestroy)||void 0===n?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null===(n=(t=this.options.current).onFocus)||void 0===n?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onSelectionUpdate)||void 0===n?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null===(n=(t=this.options.current).onTransaction)||void 0===n?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null===(n=(t=this.options.current).onUpdate)||void 0===n?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null===(n=(t=this.options.current).onContentError)||void 0===n?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null===(n=(t=this.options.current).onDrop)||void 0===n?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null===(n=(t=this.options.current).onPaste)||void 0===n?void 0:n.call(t,...e)}};return new va(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null===(r=t.extensions)||void 0===r?void 0:r[n])})):e[n]===t[n])))}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===e.length?gl.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}}function yl(e={},n=[]){const r=t.useRef(e);r.current=e;const[o]=t.useState((()=>new gl(r))),i=Ya.useSyncExternalStore(o.subscribe,o.getEditor,o.getServerSnapshot);return t.useDebugValue(i),t.useEffect(o.onRender(n)),function(e){var n;const[r]=t.useState((()=>new ul(e.editor))),o=dl.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,null!==(n=e.equalityFn)&&void 0!==n?n:il);hl((()=>r.watch(e.editor)),[e.editor,r]),t.useDebugValue(o)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}t.createContext({editor:null}).Consumer;const vl=t.createContext({onDragStart:void 0});t.forwardRef(((e,n)=>{const{onDragStart:r}=t.useContext(vl),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));const xl=/^\s*>\s$/,bl=ka.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",cs(this.options.HTMLAttributes,e),0]},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[wa({find:xl,type:this.type})]}}),wl=/(^|[^`])`([^`]+)`(?!`)/,kl=/(^|[^`])`([^`]+)`(?!`)/g,Sl=Cs.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",cs(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xa({find:wl,type:this.type})]},addPasteRules(){return[Sa({find:kl,type:this.type})]}}),Cl=/^```([a-z]+)?[\s\n]$/,Ml=/^~~~([a-z]+)?[\s\n]$/,Nl=ka.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",cs(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!i||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;if(!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();if(void 0===s)return!1;return r.nodeAt(s)?e.commands.command((({tr:e})=>(e.setSelection(Rt.near(r.resolve(s))),!0))):e.commands.exitCode()}}},addInputRules(){return[ba({find:Cl,type:this.type,getAttributes:e=>({language:e[1]})}),ba({find:Ml,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Zt({key:new tn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Lt.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function Ol(e={}){return new Zt({view:t=>new Tl(t,e)})}class Tl{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=yt(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)}}const El=As.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Ol(this.options)]}});class Al extends Rt{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Al.valid(n)?new Al(n):Rt.near(n)}content(){return H.empty}eq(e){return e instanceof Al&&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 Al(e.resolve(t.pos))}getBookmark(){return new Dl(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&&Al.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(Al.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!$t.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(Al.valid(s))return s}return null}}}Al.prototype.visible=!1,Al.findFrom=Al.findGapCursorFrom,Rt.jsonID("gapcursor",Al);class Dl{constructor(e){this.pos=e}map(e){return new Dl(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Al.valid(t)?new Al(t):Rt.near(t)}}const jl=Ai({ArrowLeft:Rl("horiz",-1),ArrowRight:Rl("horiz",1),ArrowUp:Rl("vert",-1),ArrowDown:Rl("vert",1)});function Rl(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 Lt){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=Al.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new Al(l))),!0)}}function Il(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Al.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&$t.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new Al(r))),!0)}function Pl(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Al))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=L.empty;for(let e=r.length-1;e>=0;e--)o=L.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new H(o,0,0));return i.setSelection(Lt.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function zl(e){if(!(e.selection instanceof Al))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ho.create(e.doc,[Vo.widget(e.selection.head,t,{key:"gapcursor"})])}const Ll=As.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Zt({props:{decorations:zl,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Al.valid(n)?new Al(n):null,handleClick:Il,handleKeyDown:jl,handleDOMEvents:{beforeinput:Pl}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=us(is(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),Bl=ka.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",cs(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()}}}),$l=ka.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,cs(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>ba({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var Vl=200,Fl=function(){};Fl.prototype.append=function(e){return e.length?(e=Fl.from(e),!this.length&&e||e.length<Vl&&this.leafAppend(e)||this.length<Vl&&e.leafPrepend(this)||this.appendInner(e)):this},Fl.prototype.prepend=function(e){return e.length?Fl.from(e).append(this):this},Fl.prototype.appendInner=function(e){return new Hl(this,e)},Fl.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Fl.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Fl.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Fl.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)},Fl.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},Fl.from=function(e){return e instanceof Fl?e:e&&e.length?new _l(e):Fl.empty};var _l=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<=Vl)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Vl)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}(Fl);Fl.empty=new _l([]);var Hl=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}(Fl);class Wl{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 ql(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 ql(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 Wl(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 ql(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>Jl&&(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 Wl(s.append(o),i)}remapping(e,t){let n=new Ue;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 Wl(this.items.append(e.map((e=>new ql(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 ql(l,i,c))}else n.push(new ql(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new ql(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new Wl(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 ql(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 Wl(Fl.from(r.reverse()),o)}}Wl.empty=new Wl(Fl.empty,0);class ql{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 ql(t.getMap().invert(),t,this.selection)}}}class Kl{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Jl=20;function Ul(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 Gl(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 Xl=!1,Yl=null;function Zl(e){let t=e.plugins;if(Yl!=t){Xl=!1,Yl=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Xl=!0;break}}return Xl}const Ql=new tn("history"),ec=new tn("closeHistory");function tc(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Zt({key:Ql,state:{init:()=>new Kl(Wl.empty,Wl.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(Ql);if(i)return i.historyState;n.getMeta(ec)&&(e=new Kl(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(Ql))return s.getMeta(Ql).redo?new Kl(e.done.addTransform(n,void 0,r,Zl(t)),e.undone,Ul(n.mapping.maps),e.prevTime,e.prevComposition):new Kl(e.done,e.undone.addTransform(n,void 0,r,Zl(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Kl(e.done.rebased(n,o),e.undone.rebased(n,o),Gl(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Kl(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Gl(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?Gl(e.prevRanges,n.mapping):Ul(n.mapping.maps);return new Kl(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Zl(t)),Wl.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?rc:"historyRedo"==n?oc:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function nc(e,t){return(n,r)=>{let o=Ql.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=Zl(t),o=Ql.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 Kl(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Ql,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const rc=nc(!1,!0),oc=nc(!0,!0),ic=As.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>rc(e,t),redo:()=>({state:e,dispatch:t})=>oc(e,t)}),addProseMirrorPlugins(){return[tc(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()}}}),sc=ka.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",cs(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:o}=n,i=e();return 0===r.parentOffset?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):n instanceof $t?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.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(Lt.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection($t.create(e.doc,t.pos)):e.setSelection(Lt.create(e.doc,t.pos));else{const o=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();o&&(e.insert(r,o),e.setSelection(Lt.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new xs({find:e.find,handler:({state:t,range:n,match:r})=>{const o=us(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}}),ac=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,lc=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,cc=Cs.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",cs(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xa({find:ac,type:this.type})]},addPasteRules(){return[Sa({find:lc,type:this.type})]}}),dc=As.create({name:"starterKit",addExtensions(){const e=[];return!1!==this.options.bold&&e.push(Ta.configure(this.options.bold)),!1!==this.options.blockquote&&e.push(bl.configure(this.options.blockquote)),!1!==this.options.bulletList&&e.push(Da.configure(this.options.bulletList)),!1!==this.options.code&&e.push(Sl.configure(this.options.code)),!1!==this.options.codeBlock&&e.push(Nl.configure(this.options.codeBlock)),!1!==this.options.document&&e.push(ja.configure(this.options.document)),!1!==this.options.dropcursor&&e.push(El.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&e.push(Ll.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&e.push(Bl.configure(this.options.hardBreak)),!1!==this.options.heading&&e.push($l.configure(this.options.heading)),!1!==this.options.history&&e.push(ic.configure(this.options.history)),!1!==this.options.horizontalRule&&e.push(sc.configure(this.options.horizontalRule)),!1!==this.options.italic&&e.push(La.configure(this.options.italic)),!1!==this.options.listItem&&e.push(Ba.configure(this.options.listItem)),!1!==this.options.orderedList&&e.push(Fa.configure(this.options.orderedList)),!1!==this.options.paragraph&&e.push(_a.configure(this.options.paragraph)),!1!==this.options.strike&&e.push(cc.configure(this.options.strike)),!1!==this.options.text&&e.push(Ha.configure(this.options.text)),e}});function hc(t){var n=t.size,r=void 0===n?18:n;return e.jsx("svg",{width:r,height:r,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M6.75 3.75H15.75M2.25 3.75H3.75M6.75 9H15.75M2.25 9H3.75M6.75 14.25H15.75M2.25 14.25H3.75",stroke:"#27272A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function uc(t){var n=t.size,r=void 0===n?18:n;return e.jsx("svg",{width:r,height:r,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.25 4.5H15.75M8.25 9H15.75M8.25 13.5H15.75M2.25 11.25H3.375C3.58425 11.25 3.6885 11.25 3.7755 11.2672C3.95012 11.302 4.11053 11.3877 4.23642 11.5136C4.36231 11.6395 4.44804 11.7999 4.48275 11.9745C4.5 12.0615 4.5 12.165 4.5 12.375C4.5 12.585 4.5 12.6885 4.48275 12.7755C4.44804 12.9501 4.36231 13.1105 4.23642 13.2364C4.11053 13.3623 3.95012 13.448 3.7755 13.4827C3.6885 13.5 3.585 13.5 3.375 13.5C3.165 13.5 3.0615 13.5 2.9745 13.5173C2.79988 13.552 2.63947 13.6377 2.51358 13.7636C2.38769 13.8895 2.30196 14.0499 2.26725 14.2245C2.25 14.3115 2.25 14.415 2.25 14.625V15.3C2.25 15.5122 2.25 15.618 2.316 15.684C2.382 15.75 2.4885 15.75 2.7 15.75H4.5M2.25 2.25H3.15C3.20967 2.25 3.2669 2.27371 3.3091 2.3159C3.35129 2.3581 3.375 2.41533 3.375 2.475V6.75M3.375 6.75H2.25M3.375 6.75H4.5",stroke:"#27272A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var pc=function(n){var r=n.message,o=n.description,i=n.type,s=void 0===i?"info":i,a=n.duration,l=void 0===a?5e3:a,c=n.onClose,d=t.useState(!0),h=d[0],u=d[1],p=t.useState(100),f=p[0],m=p[1],g={success:{icon:e.jsx(v,{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.jsx(y,{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.jsx(M,{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.jsx(O,{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"}};t.useEffect((function(){var e=setTimeout((function(){u(!1),setTimeout((function(){null==c||c()}),300)}),l),t=setInterval((function(){m((function(e){var t=e-100/(l/100);return t<=0?0:t}))}),100);return function(){clearTimeout(e),clearInterval(t)}}),[l,c]);var x=g[s],b=x.icon,w=x.bgColor,k=x.borderColor,S=x.textColor,C=x.iconColor,N=x.progressColor;return e.jsx("div",{className:"fixed right-4 top-4 z-50 transform transition-all duration-300 ".concat(h?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:e.jsxs("div",{className:"flex w-72 rounded-lg border shadow-lg md:w-96 ".concat(k," ").concat(w," p-4"),children:[e.jsx("div",{className:"flex-shrink-0 ".concat(C),children:b}),e.jsxs("div",{className:"ml-3 w-full",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("p",{className:"text-md font-semibold ".concat(S),children:r}),e.jsx("button",{onClick:function(){u(!1),setTimeout((function(){null==c||c()}),300)},className:"text-gray-600 hover:text-gray-600 focus:outline-none",children:e.jsx(E,{className:"h-4 w-4"})})]}),o&&e.jsx("p",{className:"mt-1 text-sm ".concat(S," opacity-80"),children:o}),e.jsx("div",{className:"mt-2 h-1 w-full rounded-full bg-gray-200",children:e.jsx("div",{className:"".concat(N," h-1 rounded-full transition-all duration-100 ease-linear"),style:{width:"".concat(f,"%")}})})]})]})})},fc=null,mc=t.createContext(void 0),gc={success:function(e,t){fc?fc.success(e,t):console.warn("AlertProvider not mounted yet")},error:function(e,t){fc?fc.error(e,t):console.warn("AlertProvider not mounted yet")},info:function(e,t){fc?fc.info(e,t):console.warn("AlertProvider not mounted yet")},warning:function(e,t){fc?fc.warning(e,t):console.warn("AlertProvider not mounted yet")},show:function(e){fc?fc.showAlert(e):console.warn("AlertProvider not mounted yet")}},yc=function(n){var r=n.isOpen,o=n.onClose,i=n.title,s=n.children,a=n.size,l=void 0===a?"md":a,c=n.position,d=void 0===c?"right":c,h=n.showCloseButton,u=void 0===h||h,p=n.closeOnOverlayClick,f=void 0===p||p,m=n.closeOnEscape,g=void 0===m||m,y=n.className,v=void 0===y?"":y,x=n.overlayClassName,b=void 0===x?"":x,w=n.contentClassName,k=void 0===w?"":w,S=n.headerClassName,C=void 0===S?"":S,M=n.footer,N=n.footerClassName,O=void 0===N?"":N,T=n.maxHeight,A=void 0!==T&&T,D=t.useRef(null),j=t.useRef(null);t.useEffect((function(){var e;return r?(j.current=document.activeElement,null===(e=D.current)||void 0===e||e.focus(),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",j.current&&j.current.focus()),function(){document.body.style.overflow="unset"}}),[r]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&g&&o()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,g,o]);var R=function(e){e.target===e.currentTarget&&f&&o()};return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(b),role:"dialog","aria-modal":"true","aria-labelledby":i?"modal-title":void 0,children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-700",onClick:R}),e.jsx("div",{className:"fixed inset-0 flex p-4 ".concat({left:"items-start justify-start",right:"items-start justify-end",center:"items-center justify-center"}[d]),onClick:R,children:e.jsxs("div",{ref:D,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:"max-w-full mx-4"}[l]," bg-white shadow-2xl transform transition-all duration-700 ease-out flex flex-col\n ").concat("left"===d||"right"===d?"h-full ".concat(A?"max-h-screen":""," rounded-2xl"):"rounded-2xl ".concat(A?"max-h-[90vh] overflow-hidden":""),"\n ").concat("center"===d?"animate-in fade-in-0 zoom-in-95":"left"===d?"animate-in slide-in-from-left-full":"animate-in slide-in-from-right-full","\n ").concat(v,"\n "),onClick:function(e){return e.stopPropagation()},children:[(i||u)&&e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 flex-shrink-0 ".concat(C),children:[i&&e.jsx("h2",{id:"modal-title",className:"text-xl font-semibold text-gray-900 truncate pr-4",children:i}),u&&e.jsx("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.jsx(E,{size:20})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto ".concat(A?"overflow-y-auto":""," ").concat(k),children:!A||"left"!==d&&"right"!==d?e.jsx("div",{className:"p-6",children:s}):e.jsx("div",{className:"p-6 min-h-0 flex-1",children:s})}),M&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 bg-gray-50 flex-shrink-0 rounded-2xl ".concat(O),children:M})]})})]}):null};function vc(t){var n=t.currentPage,r=t.totalPages,o=t.totalItems,i=t.itemsPerPage,s=t.onPageChange,l=t.onViewChange,c=t.loading,d=void 0!==c&&c,h=function(e){e>0&&e<=r&&!d&&s&&s(e)},u=(n-1)*i,p=Math.min(u+i,o);return e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white py-3",children:[e.jsxs("div",{className:"flex flex-1 justify-between sm:hidden",children:[e.jsx("button",{onClick:function(){return h(n-1)},disabled:1===n||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===n||d?"cursor-not-allowed opacity-50":""),children:"Previous"}),e.jsx("button",{onClick:function(){return h(n+1)},disabled:n===r||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(n===r||d?"cursor-not-allowed opacity-50":""),children:"Next"})]}),e.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,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.jsx("option",{value:t,children:t},t)}))}),e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700",children:e.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("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"})})})]}),e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsxs("span",{children:[o," Entries"]}),e.jsxs("span",{className:"ml-1",children:["(Showing ",u+1,"-",p," of ",o,")"]})]})]}),e.jsx("div",{children:e.jsxs("nav",{className:"relative z-0 inline-flex gap-2 -space-x-px rounded-md shadow-sm","aria-label":"Pagination",children:[e.jsxs("button",{onClick:function(){return h(n-1)},disabled:1===n||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===n||d?"cursor-not-allowed opacity-50":""),children:[e.jsx("span",{className:"sr-only",children:"Previous"}),e.jsx("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.jsx("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(r<=5)for(var t=1;t<=r;t++)e.push(t);else{var o=Math.max(1,n-2),i=Math.min(r,o+5-1);i-o<4&&(o=Math.max(1,i-5+1));for(t=o;t<=i;t++)e.push(t)}return e}().map((function(t){return e.jsx("button",{onClick:function(){return h(t)},disabled:d,"aria-current":n===t?"page":void 0,className:"relative inline-flex items-center rounded-md border px-4 py-2 text-sm font-semibold ".concat(n===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)})),e.jsxs(a,{onClick:function(){return h(n+1)},disabled:n===r||d,type:"button",variant:"primary",size:"small",outline:!0,children:["Next Page",e.jsx("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.jsx("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 xc(t){var n=t.columns,r=t.rows;return e.jsx(e.Fragment,{children:Array.from({length:r}).map((function(t,r){return e.jsx("tr",{children:Array.from({length:n}).map((function(t,n){return e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:e.jsx("div",{className:"h-4 animate-pulse rounded bg-gray-200"})},"skeleton-cell-".concat(r,"-").concat(n))}))},"skeleton-row-".concat(r))}))})}var bc={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"}},wc={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"}}},kc=function(n){var r=n.variant,o=void 0===r?"text":r,i=n.animation,s=void 0===i?"pulse":i,a=n.size,l=n.width,c=n.height,d=n.count,h=void 0===d?1:d,u=n.className,p=void 0===u?"":u,f=n.shimmer,m=void 0!==f&&f,g=n.borderRadius,y=n.intensity,v=void 0===y?"medium":y,x=n.delay,b=void 0===x?0:x,w=t.useState(0===b),k=w[0],S=w[1];t.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=wc[o],M=t.useMemo((function(){return{width:void 0!==l?"number"==typeof l?"".concat(l,"px"):l:a?bc[a].width:C.defaultSize.width,height:void 0!==c?"number"==typeof c?"".concat(c,"px"):c:a?bc[a].height:C.defaultSize.height}}),[l,c,a,C]);if(t.useEffect((function(){if(b>0){var e=setTimeout((function(){return S(!0)}),b);return function(){return clearTimeout(e)}}}),[b]),!k)return null;var N=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(" ")},O=function(t){return e.jsx("div",{className:"".concat(N()," ").concat(p),style:(n={width:M.width,height:M.height},g&&(n.borderRadius=g),n),"aria-hidden":"true"},t);var n};return h>1?e.jsx("div",{className:"space-y-2",children:Array.from({length:h},(function(e,t){return O(t)}))}):O(0)},Sc=function(t){return e.jsx(kc,j({},t,{variant:"text"}))},Cc=function(t){return e.jsx(kc,j({},t,{variant:"avatar"}))},Mc=function(t){return e.jsx(kc,j({},t,{variant:"button"}))},Nc=function(t){var n=t.showBio,r=void 0===n||n;return e.jsxs("div",{className:"flex items-start space-x-4",children:[e.jsx(Cc,{size:"lg"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Sc,{width:"60%",height:"1.25rem"}),e.jsx(Sc,{width:"40%",height:"1rem",intensity:"light"}),r&&e.jsxs("div",{className:"space-y-1 pt-2",children:[e.jsx(Sc,{width:"100%"}),e.jsx(Sc,{width:"80%"}),e.jsx(Sc,{width:"90%"})]})]})]})},Oc=function(t){var n=t.itemCount,r=void 0===n?3:n,o=t.showAvatar,i=void 0===o||o,s=t.showMeta,a=void 0===s||s;return e.jsx("div",{className:"space-y-4",children:Array.from({length:r},(function(t,n){return e.jsxs("div",{className:"flex items-start space-x-3",children:[i&&e.jsx(Cc,{}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Sc,{width:"75%",height:"1.125rem"}),e.jsx(Sc,{width:"100%",height:"0.875rem",intensity:"light"}),a&&e.jsxs("div",{className:"flex space-x-4",children:[e.jsx(Sc,{width:"3rem",height:"0.75rem",intensity:"light"}),e.jsx(Sc,{width:"4rem",height:"0.75rem",intensity:"light"})]})]})]},n)}))})},Tc=function(t){var n=t.rows,r=void 0===n?5:n,o=t.columns,i=void 0===o?4:o,s=t.showHeader,a=void 0===s||s;return e.jsxs("div",{className:"space-y-3",children:[a&&e.jsx("div",{className:"flex space-x-4",children:Array.from({length:i},(function(t,n){return e.jsx(Sc,{width:"100%",height:"1rem",intensity:"dark"},n)}))}),e.jsx("div",{className:"space-y-2",children:Array.from({length:r},(function(t,n){return e.jsx("div",{className:"flex space-x-4",children:Array.from({length:i},(function(t,n){return e.jsx(Sc,{width:"100%",height:"0.875rem"},n)}))},n)}))})]})};exports.AlertContext=mc,exports.AlertProvider=function(n){var r=n.children,o=t.useState([]),i=o[0],s=o[1],a=t.useCallback((function(e){s((function(t){return t.filter((function(t){return t.id!==e}))}))}),[]),l=t.useCallback((function(e){var t=Math.random().toString(36).substring(2,9),n=j(j({},e),{id:t,onClose:function(){return a(t)}});s((function(e){return R(R([],e,!0),[n],!1)}))}),[a]),c=t.useCallback((function(e){return function(t,n){l({message:t,description:n,type:e})}}),[l]),d={showAlert:l,success:c("success"),error:c("error"),info:c("info"),warning:c("warning")};return fc=d,e.jsxs(mc.Provider,{value:d,children:[r,e.jsx("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.jsx("div",{style:{transform:"translateY(".concat(10*n,"px)"),zIndex:50-n},children:e.jsx(pc,j({},t))},t.id)}))})]})},exports.Button=a,exports.Card=function(t){var n=t.children;return e.jsx("div",{className:"w-full rounded-[20px] border border-[#EEEEF0] bg-white p-4",children:n})},exports.CheckBox=function(n){var r=n.variant,o=void 0===r?"check":r,i=n.size,s=void 0===i?"sm":i,a=n.checked,l=void 0!==a&&a,c=n.disabled,d=void 0!==c&&c,h=n.onChange,u=n.label,p=t.useState(l),f=p[0],m=p[1];t.useEffect((function(){m(l)}),[l]);var g=function(){if(!d){var e=!f;m(e),null==h||h(e)}},y={sm:{container:"h-6 w-6",toggle:"w-10 h-6",toggleCircle:"h-4 w-4"},md:{container:"h-8 w-8",toggle:"w-12 h-7",toggleCircle:"h-5 w-5"},lg:{container:"h-10 w-10",toggle:"w-14 h-8",toggleCircle:"h-6 w-6"}};return e.jsxs("div",{className:"flex items-center gap-2",children:["toggle"===o?e.jsx("div",{className:"relative rounded-full transition-colors ".concat(y[s].toggle," ").concat(f?"bg-primary":"bg-gray-200"," ").concat(d?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:g,children:e.jsx("div",{className:"absolute top-1 transform rounded-full bg-white transition-transform ".concat(y[s].toggleCircle," ").concat(f?"right-1/2 translate-x-full":"left-1"),children:f&&"toggle"===o&&e.jsx("svg",{className:"h-full w-full text-teal-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})})}):e.jsxs("div",{className:"".concat(y[s].container," ").concat("check"===o?"rounded-lg":"rounded-full"," flex items-center justify-center border-2 transition-colors ").concat(f?"border-primary bg-primary":"border-gray-200 bg-gray-50"," ").concat(d?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:g,children:[f&&"check"===o&&e.jsx("svg",{className:"h-3/4 w-3/4 text-white",fill:"none",viewBox:"0 0 28 28",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),f&&"dot"===o&&e.jsx("div",{className:"h-2/4 w-2/4 rounded-full bg-white"})]}),u&&e.jsx("label",{className:"".concat(d?"text-gray-400":"text-gray-700"),children:u})]})},exports.ConfirmationAlert=function(n){var r=n.isOpen,o=n.onConfirm,i=n.onCancel,s=n.title,l=n.message,c=n.confirmText,d=void 0===c?"Confirm":c,h=n.cancelText,u=void 0===h?"Cancel":h,p=n.type,f=void 0===p?"default":p,m=n.showIcon,g=void 0===m||m,y=n.showCloseButton,b=void 0===y||y,w=n.closeOnOverlayClick,k=void 0===w||w,S=n.closeOnEscape,C=void 0===S||S,N=n.isLoading,T=void 0!==N&&N,A=n.className,D=void 0===A?"":A,j=n.overlayClassName,R=void 0===j?"":j,I=n.maxWidth,P=void 0===I?"sm":I,z=t.useRef(null),L=t.useRef(null),B=t.useRef(null);t.useEffect((function(){return r?(B.current=document.activeElement,setTimeout((function(){var e,t,n;"danger"===f?null===(t=null===(e=z.current)||void 0===e?void 0:e.querySelector("[data-cancel-button]"))||void 0===t||t.focus():null===(n=L.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,f]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&C&&!T&&i()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,C,i,T]);var $=function(){T||i()},V={default:{icon:M,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"},danger:{icon:x,iconColor:"text-red-600",iconBg:"bg-red-100",confirmButton:"bg-red-600 hover:bg-red-700 focus:ring-red-500"},warning:{icon:O,iconColor:"text-yellow-600",iconBg:"bg-yellow-100",confirmButton:"bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500"},success:{icon:v,iconColor:"text-green-600",iconBg:"bg-green-100",confirmButton:"bg-green-600 hover:bg-green-700 focus:ring-green-500"},info:{icon:M,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}}[f],F=V.icon;return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(R),role:"dialog","aria-modal":"true","aria-labelledby":s?"confirmation-title":void 0,"aria-describedby":"confirmation-message",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300",onClick:function(e){e.target===e.currentTarget&&k&&!T&&i()}}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:e.jsxs("div",{ref:z,className:"relative w-full ".concat({sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}[P]," 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(D," "),onClick:function(e){return e.stopPropagation()},children:[b&&e.jsx("button",{onClick:$,disabled:T,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.jsx(E,{size:20})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[g&&e.jsx("div",{className:"h-12 w-12 flex-shrink-0 rounded-full ".concat(V.iconBg," flex items-center justify-center"),children:e.jsx(F,{size:24,className:V.iconColor})}),e.jsxs("div",{className:"min-w-0 flex-1 justify-center",children:[s&&e.jsx("h3",{id:"confirmation-title",className:"mb-1 text-center text-lg font-semibold text-gray-900",children:s}),e.jsx("p",{id:"confirmation-message",className:"leading-relaxed text-gray-600",children:l})]})]}),e.jsxs("div",{className:"flex ".concat("justify-center"," mt-6 space-x-3"),children:[e.jsx(a,{variant:"neutral",outline:!0,size:"small","data-cancel-button":"",onClick:$,disabled:T,children:u}),e.jsx("button",{ref:L,onClick:function(){T||o()},disabled:T,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:T?e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):d})]})]})]})})]}):null},exports.EmptyStateCard=D,exports.ExportButton=function(){var n=t.useState(!1),r=n[0],o=n[1],i=t.useRef(null),s=function(e){o(!1)};return t.useEffect((function(){var e=function(e){i.current&&!i.current.contains(e.target)&&o(!1)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]),e.jsxs("div",{className:"relative inline-block",ref:i,children:[e.jsxs("div",{className:"flex",children:[e.jsxs("button",{className:"flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){return s(A.PDF)},children:[e.jsx(b,{className:"mr-2 h-4 w-4"}),"Export"]}),e.jsx("button",{className:"rounded-r-md border border-l-0 border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){o(!r)},children:e.jsx(g,{className:"h-4 w-4"})})]}),r&&e.jsx("div",{className:"absolute right-0 z-10 mt-1 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:e.jsxs("div",{className:"py-1",children:[e.jsxs("button",{onClick:function(){return s(A.PDF)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(S,{className:"mr-2 h-4 w-4"}),"PDF Document"]}),e.jsxs("button",{onClick:function(){return s(A.CSV)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(k,{className:"mr-2 h-4 w-4"}),"CSV Spreadsheet"]}),e.jsxs("button",{onClick:function(){return s(A.EXCEL)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(k,{className:"mr-2 h-4 w-4"}),"Excel Spreadsheet"]})]})})]})},exports.FileUpload=function(n){var r=n.onFileChange,o=n.direction,i=void 0===o?"column":o,s=t.useState(null),a=s[0],l=s[1],c=t.useState(0),d=c[0],h=c[1];return e.jsx("div",{className:"space-y-4",children:a?e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"mr-3 rounded-lg bg-blue-100 p-2",children:e.jsx(C,{size:24,className:"text-blue-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:a.name}),e.jsxs("p",{className:"text-xs text-gray-500",children:[(a.size/1024).toFixed(2),"KB/",(a.size/1024).toFixed(2),"KB"]})]})]}),e.jsx("button",{onClick:function(){l(null),h(0),r(null)},className:"text-red-500",children:e.jsx(E,{size:16})})]}),e.jsx("div",{className:"h-2.5 w-full rounded-full bg-gray-200",children:e.jsx("div",{className:"h-2.5 rounded-full bg-gray-800",style:{width:"".concat(d,"%")}})}),e.jsxs("p",{className:"mt-1 text-right text-xs text-gray-500",children:[d,"%"]})]}):e.jsxs("div",{className:"flex flex-".concat(i," gap-4 rounded-lg border-2 border-dashed border-gray-300 p-8 text-center items-center ").concat("row"===i?"justify-center":""),onDragOver:function(e){e.preventDefault()},onDrop:function(e){if(e.preventDefault(),e.dataTransfer.files&&e.dataTransfer.files[0]){var t=e.dataTransfer.files[0];l(t),h(10);var n=setInterval((function(){h((function(e){return e>=100?(clearInterval(n),100):e+10}))}),300);r(t)}},children:[e.jsx("p",{className:"cursor-pointer text-teal-600 hover:underline",onClick:function(){var e;return null===(e=document.getElementById("fileInput"))||void 0===e?void 0:e.click()},children:"Click to Upload"}),e.jsx("input",{id:"fileInput",type:"file",className:"hidden",onChange:function(e){if(e.target.files&&e.target.files[0]){var t=e.target.files[0];l(t),h(10);var n=setInterval((function(){h((function(e){return e>=100?(clearInterval(n),100):e+10}))}),300);r(t)}}}),e.jsx("p",{className:"text-gray-500",children:"or drag and drop"}),e.jsx("p",{className:"text-sm text-gray-400",children:"(Max. File size: 25 MB)"})]})})},exports.Input=function(t){var n=t.id,r=t.label,o=t.value,i=t.size,s=void 0===i?"md":i,a=t.onChange,l=t.placeholder,c=t.error,d=t.required,h=void 0!==d&&d,u=t.helpText,p=t.type,f=void 0===p?"text":p,m=t.className,g=void 0===m?"":m,y=t.disabled,v=void 0!==y&&y,x=t.icon,b=t.iconPosition,w=void 0===b?"left":b,k=t.rightIcon,S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["id","label","value","size","onChange","placeholder","error","required","helpText","type","className","disabled","icon","iconPosition","rightIcon"]),C={id:n,value:o,onChange:function(e){a&&a(e)},placeholder:l,disabled:v,className:"w-full rounded-[12px] border ".concat({sm:"text-xs px-3 py-1.5 text-sm min-h-[32px]",md:"text-sm px-4 py-2 text-base min-h-[40px]",lg:"text-base px-4 py-3 text-lg min-h-[48px]"}[s]," ").concat(c?"border-red-500":"border-gray-200"," ").concat(v?"bg-gray-100 text-gray-500 placeholder-gray-300":"bg-gray-100 placeholder-gray-400 text-dark"," focus:outline-none focus:ring-1 focus:ring-primary ").concat(g," ").concat(x&&"left"===w?"pl-10":""," ").concat(x&&"right"===w?"pr-10":""),"aria-invalid":!!c,"aria-describedby":c?"".concat(n,"-error"):u?"".concat(n,"-help"):void 0};return e.jsxs("div",{className:"mb-4",children:[r&&e.jsxs("label",{htmlFor:n,className:"mb-1 block text-sm font-medium text-gray-600",children:[r,h&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[x&&"left"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:x}),"textarea"==f?e.jsx("textarea",j({},C,{rows:4,className:"".concat(C.className," resize-none")},S)):e.jsx("input",j({},C,{type:f},S)),x&&"right"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:x}),k&&e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer",children:k})]}),u&&!c&&e.jsx("p",{id:"".concat(n,"-help"),className:"mt-1 text-sm text-gray-500",children:u}),c&&e.jsx("p",{id:"".concat(n,"-error"),className:"mt-1 text-sm text-red-500",children:c})]})},exports.Modal=yc,exports.ModalExample=function(){var n=t.useState(!1),r=n[0],o=n[1],i=t.useState("left"),s=i[0],a=i[1],l=t.useState("md"),c=l[0],d=l[1],h=e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:function(){return o(!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.jsx("button",{onClick:function(){return o(!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 e.jsxs("div",{className:"p-8 space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Position"}),e.jsxs("select",{value:s,onChange:function(e){return a(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"left",children:"Left"}),e.jsx("option",{value:"right",children:"Right"}),e.jsx("option",{value:"center",children:"Center"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Size"}),e.jsxs("select",{value:c,onChange:function(e){return d(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"xs",children:"Extra Small"}),e.jsx("option",{value:"sm",children:"Small"}),e.jsx("option",{value:"md",children:"Medium"}),e.jsx("option",{value:"lg",children:"Large"}),e.jsx("option",{value:"xl",children:"Extra Large"}),e.jsx("option",{value:"2xl",children:"2X Large"}),e.jsx("option",{value:"full",children:"Full Width"})]})]})]}),e.jsx("button",{onClick:function(){return o(!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.jsx(yc,{isOpen:r,onClose:function(){return o(!1)},title:"Example Modal",size:c,position:s,footer:h,maxHeight:"center"!==s,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-gray-600",children:"This is an example of the multipurpose modal component. It supports different sizes, positions, and configurations."}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Features:"}),e.jsxs("ul",{className:"text-sm text-gray-600 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"Multiple sizes (xs, sm, md, lg, xl, 2xl, full)"}),e.jsx("li",{children:"Three positions (left, right, center)"}),e.jsx("li",{children:"Customizable styling with className props"}),e.jsx("li",{children:"Keyboard navigation and accessibility"}),e.jsx("li",{children:"Click outside to close"}),e.jsx("li",{children:"Smooth animations"}),e.jsx("li",{children:"Optional footer with actions"})]})]}),("left"===s||"right"===s)&&e.jsx("div",{className:"space-y-2",children:Array.from({length:20},(function(t,n){return e.jsxs("p",{className:"text-gray-600",children:["This is paragraph ",n+1," to demonstrate scrolling in side panels."]},n)}))})]})})]})},exports.Pagination=vc,exports.SKELETON_LOADER_VERSION="1.0.0",exports.SKELETON_PATTERNS={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}},exports.SKELETON_PRESETS={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"]},exports.Search=function(n){var r=n.placeholder,o=void 0===r?"Search...":r,i=n.onSearch,s=n.className,a=void 0===s?"":s,l=t.useState(""),c=l[0],d=l[1];return e.jsxs("div",{className:"relative ".concat(a),children:[e.jsx("input",{type:"text",value:c,onChange:function(e){e.preventDefault(),d(e.target.value),i(c)},placeholder:o,className:"w-full rounded-lg border border-gray-200 bg-white py-2 pl-8 pr-4 text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),e.jsxs("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 transform text-gray-400",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})]})},exports.Select=function(n){var r,o=n.options,i=n.placeholder,s=void 0===i?"Select an option":i,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,y=void 0!==m&&m,v=n.label,x=n.required,b=n.error,w=n.helpText,k=n.fullWidth,S=void 0===k||k,C=n.searchable,M=void 0!==C&&C,N=n.multiple,O=void 0!==N&&N,T=n.maxSelected,A=n.showSelectedCount,D=void 0!==A&&A,j=n.closeOnSelect,I=void 0===j||j,P=t.useState(!1),z=P[0],L=P[1],B=t.useState(""),$=B[0],V=B[1],F=t.useState((function(){if(!l)return[];if(O&&Array.isArray(l))return l.map((function(e){return o.find((function(t){return t.value===e}))})).filter(Boolean);if(!O&&"string"==typeof l){var e=o.find((function(e){return e.value===l}));return e?[e]:[]}return[]})),_=F[0],H=F[1],W=t.useRef(null),q=M?o.filter((function(e){return(e.label||e.value).toLowerCase().includes($.toLowerCase())})):o;return t.useEffect((function(){var e=function(e){W.current&&!W.current.contains(e.target)&&(L(!1),V(""))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]),e.jsxs("div",{ref:W,className:"".concat(S?"w-full":"w-fit"," mb-4"),children:[v&&e.jsxs("label",{htmlFor:f,className:"mb-1 block text-sm font-medium text-gray-700",children:[v,x&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",className:"flex items-center justify-between rounded-lg border ".concat(b?"border-red-500":"border-gray-200"," bg-white shadow-sm ").concat({sm:"text-xs px-3 py-1.5 text-sm min-h-[32px]",md:"text-sm px-4 py-2 text-base min-h-[40px]",lg:"text-base px-4 py-3 text-lg min-h-[48px]"}[d]," text-gray-700 hover:border-gray-300 focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 ").concat(y?"cursor-not-allowed bg-gray-50 opacity-50":""," ").concat(u," ").concat(S?"w-full":""," transition-all duration-200"),onClick:function(){return!y&&L(!z)},disabled:y,id:f,"aria-haspopup":"listbox","aria-expanded":z,children:[e.jsx("div",{className:"flex-1 flex items-center gap-1 min-w-0",children:O&&_.length>0?e.jsxs("div",{className:"flex flex-wrap gap-1 flex-1",children:[_.slice(0,3).map((function(t){return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary-100 text-primary-800 text-sm rounded-md",children:[e.jsx("span",{className:"truncate max-w-[120px]",children:t.label||t.value}),e.jsx(E,{className:"h-3 w-3 cursor-pointer hover:text-primary-900",onClick:function(e){return function(e,t){t.stopPropagation();var n=_.filter((function(t){return t.value!==e.value}));H(n);var r=O?n.map((function(e){return e.value})):"";a({target:{id:f||"",value:r}})}(t,e)}})]},t.value)})),_.length>3&&e.jsxs("span",{className:"text-sm text-gray-500 px-1",children:["+",_.length-3," more"]})]}):e.jsx("span",{className:"truncate ".concat(0===_.length?"text-gray-400":"text-gray-700"),children:function(){var e,t,n,r;return 0===_.length?s:O?D&&_.length>2?"".concat(_.length," items selected"):_.length<=2?_.map((function(e){return e.label||e.value})).join(", "):"".concat((null===(n=_[0])||void 0===n?void 0:n.label)||(null===(r=_[0])||void 0===r?void 0:r.value)," +").concat(_.length-1," more"):(null===(e=_[0])||void 0===e?void 0:e.label)||(null===(t=_[0])||void 0===t?void 0:t.value)}()})}),e.jsx(g,{className:"ml-2 h-4 w-4 text-gray-400 transition-transform flex-shrink-0 ".concat(z?"rotate-180 transform":"")})]}),z&&e.jsxs("div",{className:"absolute z-50 mt-1 w-full rounded-lg border border-gray-200 bg-white shadow-lg",role:"listbox",children:[M&&e.jsx("div",{className:"sticky top-0 border-b border-gray-100 bg-white p-3",children:e.jsx("input",{type:"text",className:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 transition-all duration-200",placeholder:"Search...",value:$,onChange:function(e){return V(e.target.value)},autoFocus:!0})}),e.jsx("div",{className:"max-h-60 overflow-auto py-1",children:q.length>0?e.jsxs(e.Fragment,{children:[O&&_.length>0&&e.jsxs("div",{className:"px-3 py-2 text-xs text-gray-500 border-b border-gray-100",children:[_.length," selected",T&&" of ".concat(T," max")]}),q.map((function(t){var n=function(e){return _.some((function(t){return t.value===e.value}))}(t),r=t.disabled||T&&!n&&_.length>=T;return e.jsxs("div",{className:"cursor-pointer px-3 py-2 flex items-center justify-between transition-colors duration-150 ".concat(n?"bg-primary-50 text-primary-700":"text-gray-700 hover:bg-gray-50"," ").concat(r?"cursor-not-allowed text-gray-400 hover:bg-white opacity-50":""),onClick:function(){return!r&&function(e){var t;if(!e.disabled){var n;if(O)if(_.some((function(t){return t.value===e.value})))n=_.filter((function(t){return t.value!==e.value}));else{if(T&&_.length>=T)return;n=R(R([],_,!0),[e],!1)}else n=[e];H(n);var r=O?n.map((function(e){return e.value})):(null===(t=n[0])||void 0===t?void 0:t.value)||"";a({target:{id:f||"",value:r}}),O&&!I||(L(!1),V(""))}}(t)},role:"option","aria-selected":n,"aria-disabled":r,children:[e.jsx("span",{className:"flex-1",children:t.label||t.value}),O&&n&&e.jsx("div",{className:"w-4 h-4 bg-primary-500 rounded-sm flex items-center justify-center",children:e.jsx("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},t.value)}))]}):e.jsx("div",{className:"px-3 py-2 text-gray-500 text-center",children:"No options found"})})]})]}),b&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:b}),w&&!b&&e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:w}),p&&e.jsx(e.Fragment,{children:O?_.map((function(t,n){return e.jsx("input",{type:"hidden",name:"".concat(p,"[]"),value:t.value},"".concat(t.value,"-").concat(n))})):e.jsx("input",{type:"hidden",name:p,value:(null===(r=_[0])||void 0===r?void 0:r.value)||""})})]})},exports.SelectButton=function(n){var r=n.options,o=n.placeholder,i=void 0===o?"Select an option":o,s=n.onChange,a=n.value,l=n.size,c=void 0===l?"md":l,d=n.className,h=void 0===d?"":d,u=n.name,p=n.id,f=n.disabled,y=void 0!==f&&f,v=n.label,x=n.required,b=t.useState(!1),w=b[0],k=b[1],S=t.useState(a&&r.find((function(e){return e.value===a}))||null),C=S[0],M=S[1];return e.jsxs("div",{className:"relative inline-block",children:[v&&e.jsxs("label",{htmlFor:p,className:"mb-1 block text-sm font-medium text-gray-700",children:[v,x&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("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"}[c]," text-gray-700 hover:bg-gray-50 focus:outline-none ").concat(y?"cursor-not-allowed opacity-50":""," ").concat(h),onClick:function(){return!y&&k(!w)},disabled:y,id:p,children:[e.jsx("span",{className:"truncate",children:C?(null==C?void 0:C.label)||C.value:i}),e.jsx(g,{className:"ml-2 h-4 w-4 ".concat(w?"rotate-180 transform":"")})]}),w&&e.jsx("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(t){return e.jsxs("div",{className:"cursor-pointer px-3 py-2 hover:bg-gray-100 rounded-lg flex justify-between item-center ".concat((null==C?void 0:C.value)===t.value?"bg-gray-50 text-black":"text-gray-900"),onClick:function(){return function(e){M(e),s(e.value),k(!1)}(t)},children:[e.jsx("div",{children:t.label||t.value}),(null==C?void 0:C.value)===t.value&&e.jsx("div",{children:e.jsx(m,{size:15,className:"text-primary"})})]},t.value)}))}),u&&e.jsx("input",{type:"hidden",name:u,value:(null==C?void 0:C.value)||""})]})},exports.SkeletonAvatar=Cc,exports.SkeletonButton=Mc,exports.SkeletonCard=function(t){return e.jsx(kc,j({},t,{variant:"card"}))},exports.SkeletonImage=function(t){return e.jsx(kc,j({},t,{variant:"image"}))},exports.SkeletonList=Oc,exports.SkeletonLoader=kc,exports.SkeletonLoaderExample=function(){return e.jsxs("div",{className:"bg-white p-5",children:[e.jsx(kc,{variant:"text",width:"200px"}),e.jsx(kc,{variant:"text",count:3}),e.jsx(Cc,{size:"lg"}),e.jsx(Mc,{animation:"wave"}),e.jsx(Nc,{showBio:!0}),e.jsx(Oc,{itemCount:5,showAvatar:!0}),e.jsx(Tc,{rows:5,columns:4}),e.jsx(kc,{variant:"card",shimmer:!0,intensity:"dark",borderRadius:"12px",className:"custom-skeleton"})]})},exports.SkeletonProfile=Nc,exports.SkeletonTable=Tc,exports.SkeletonText=Sc,exports.Table=function(t){var n=t.data,r=t.columns,o=t.itemsPerPage,i=void 0===o?20:o,s=t.onViewChange,a=t.totalItems,l=t.currentPage,c=void 0===l?1:l,d=t.onPageChange,h=t.loading,u=void 0!==h&&h,p=t.showPagination,f=void 0===p||p,m=t.onRowClick,g=a||n.length,y=Math.ceil(g/i),v=n;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"relative overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsx("tr",{children:r.map((function(t,n){return e.jsx("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===r.length-1?"rounded-br-xl rounded-tr-xl":""," "),children:t.title},n)}))})}),e.jsxs("tbody",{className:"divide-y divide-gray-200 bg-white \n ".concat(u?"opacity-50":""," ").concat(m?"cursor-pointer":"","\n "),children:[u&&e.jsx(xc,{columns:r.length,rows:i}),v.length>0?v.map((function(t,n){return e.jsx("tr",{onClick:function(){return function(e){m&&m(e)}(t)},className:"hover:bg-gray-50",children:r.map((function(n,r){return e.jsx("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)})):!u&&e.jsx("tr",{children:e.jsx("td",{colSpan:r.length,children:e.jsx(D,{title:"No Record found"})})})]})]})}),f&&e.jsx(vc,{currentPage:c,totalPages:y,totalItems:g,itemsPerPage:i,onPageChange:d,onViewChange:s,loading:u})]})},exports.TableDropdown=function(n){var r=n.actions,o=n.trigger,i=n.className,s=void 0===i?"":i,a=n.dropdownClassName,l=void 0===a?"":a,c=t.useState(!1),d=c[0],h=c[1],u=t.useRef(null),p=function(){h(!d)},f=function(){h(!1)};return t.useEffect((function(){var e=function(e){u.current&&!u.current.contains(e.target)&&f()};return d&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[d]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&f()};return d&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[d]),e.jsxs("div",{className:"relative inline-block ".concat(s),ref:u,children:[e.jsx("div",{className:"flex",children:o?e.jsx("div",{onClick:p,className:"cursor-pointer",children:o}):e.jsx("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:p,"aria-expanded":d,"aria-haspopup":"true",children:e.jsx(w,{className:"h-4 w-4"})})}),d&&e.jsx("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(l),children:e.jsxs("div",{className:"py-1",role:"menu","aria-orientation":"vertical",children:[r.map((function(t,n){return e.jsxs("button",{className:"flex w-full items-center px-4 py-2 text-left text-sm transition-colors duration-150 ".concat(t.disabled?"cursor-not-allowed bg-gray-50 text-gray-400":"danger"===t.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(),f())}(t)},disabled:t.disabled,role:"menuitem",children:[t.icon&&e.jsx("span",{className:"mr-3 flex-shrink-0",children:t.icon}),t.label]},n)})),0===r.length&&e.jsx("div",{className:"px-4 py-2 text-sm text-gray-500",children:"No actions available"})]})})]})},exports.TableSkeleton=xc,exports.TextEditor=function(t){var n=t.initialContent,r=void 0===n?"":n,o=t.onUpdate,i=yl({extensions:[dc,ja,_a,Ha,Ta,La,Wa,Da,Fa,Ba],content:r,onUpdate:function(e){var t=e.editor;o(t.getHTML())}});return e.jsxs("div",{className:"rounded-lg border",children:[e.jsxs("div",{className:"flex gap-4 border-b bg-gray-50 p-2",children:[e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleBold().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("bold"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(f,{size:18})}),e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleItalic().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("italic"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(N,{size:18})}),e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleUnderline().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("underline"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(T,{size:18})}),e.jsx("span",{className:"mx-2 h-6 border-r"}),e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleBulletList().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("bulletList"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(hc,{})}),e.jsx("button",{onClick:function(){return null==i?void 0:i.chain().focus().toggleOrderedList().run()},className:"mx-1 p-1 ".concat((null==i?void 0:i.isActive("orderedList"))?"rounded bg-gray-200":""),type:"button",children:e.jsx(uc,{})})]}),e.jsx(nl,{editor:i,className:"min-h-32 p-4"})]})},exports.alert=gc,exports.useAlert=function(){var e=t.useContext(mc);if(void 0===e)throw new Error("useAlert must be used within a AlertProvider");return e};
|
|
51
51
|
//# sourceMappingURL=index.js.map
|