@qwanyx/stack 0.2.88 → 0.2.90
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.cjs.js +1 -1
- package/dist/index.esm.js +29 -8
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -80,7 +80,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
80
80
|
flex items-center gap-4 p-4 border-b border-gray-200
|
|
81
81
|
hover:bg-gray-50 transition-colors
|
|
82
82
|
${e?"cursor-pointer":""}
|
|
83
|
-
`,children:[a&&h.jsx("div",{className:"flex-shrink-0",children:h.jsx("img",{src:a,alt:o,className:"w-16 h-16 object-cover rounded-lg"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h3",{className:"font-medium text-gray-900 truncate",children:o}),u&&h.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:u})]}),l&&h.jsx("p",{className:"text-sm text-gray-600 truncate mt-0.5",children:l})]}),e&&h.jsx("div",{className:"flex-shrink-0 text-gray-400",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})}function mf({item:r,onClose:e,title:t=i=>i.title||i.name||i.label||"Detail",image:n=i=>i.image||i.thumbnail||i.photo,fields:s=[]}){if(!r)return null;const i=t(r),o=n(r);return h.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:h.jsxs("div",{className:"bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[h.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[h.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:i}),e&&h.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"p-6",children:[o&&h.jsx("div",{className:"mb-6",children:h.jsx("img",{src:o,alt:i,className:"w-full h-64 object-cover rounded-lg"})}),s.length>0&&h.jsx("div",{className:"space-y-4",children:s.map((l,a)=>{const u=l.value(r);return u==null||u===""?null:h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-500 mb-1",children:l.label}),h.jsx("div",{className:"text-base text-gray-900",children:typeof u=="object"?JSON.stringify(u,null,2):String(u)})]},a)})}),s.length===0&&h.jsx("pre",{className:"bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto",children:JSON.stringify(r,null,2)})]}),e&&h.jsx("div",{className:"sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4",children:h.jsx("button",{onClick:e,className:"w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",children:"Close"})})]})})}const yf={small:"w-32 h-32",medium:"w-48 h-48",large:"w-64 h-64"};function xf(r){const e=[...r];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e}function bf({nodes:r,minInterval:e=3e3,maxInterval:t=6e3,onCardClick:n,cardSize:s="medium",className:i=""}){var S,w;const[o]=b.useState(()=>{if(r.length===0)return[[],[]];const E=xf(r),R=Math.ceil(E.length/2);return console.log("[AnimatedCardFlip] Pools:",{left:E.slice(0,R).map(T=>T.title),right:E.slice(R).map(T=>T.title)}),[E.slice(0,R),E.slice(R)]}),[l,a]=b.useState(0),[u,c]=b.useState(0),[d,f]=b.useState(!1),[p,g]=b.useState(!1),[m,x]=b.useState(!1),[_,y]=b.useState(!1);b.useEffect(()=>{if(o[0].length<=1)return;const E=setInterval(()=>{f(R=>!R),setTimeout(()=>{a(R=>(R+1)%o[0].length),x(R=>!R)},250)},e+Math.random()*(t-e));return()=>clearInterval(E)},[o,e,t]),b.useEffect(()=>{if(o[1].length<=1)return;let E=null;const R=setTimeout(()=>{E=setInterval(()=>{g(T=>!T),setTimeout(()=>{c(T=>(T+1)%o[1].length),y(T=>!T)},250)},e+Math.random()*(t-e))},500);return()=>{clearTimeout(R),E&&clearInterval(E)}},[o,e,t]);const v=(S=o[0])==null?void 0:S[l],C=(w=o[1])==null?void 0:w[u];if(r.length===0||!v)return h.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:h.jsx("p",{className:"text-gray-500",children:"No images available"})});const D=(E,R,T)=>h.jsx("div",{className:`relative ${yf[s]}`,style:{perspective:"1000px"},onClick:()=>n==null?void 0:n(E),children:h.jsx("div",{className:"w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",style:{transform:`rotateY(${R?180:0}deg)`,transition:"transform 0.5s ease-in-out",transformStyle:"preserve-3d"},children:h.jsxs("div",{style:{transform:T?"scaleX(-1)":"scaleX(1)",width:"100%",height:"100%"},children:[h.jsx("img",{src:E.data.image,alt:E.title,className:"w-full h-full object-cover"}),h.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",children:h.jsx("p",{className:"text-white text-sm font-medium truncate",children:E.title})})]})})});return h.jsxs("div",{className:`flex gap-4 justify-center items-center ${i}`,children:[D(v,d,m),C&&D(C,p,_)]})}function $r(r){if(!r)return"";const e=/=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;return r.replace(e,(t,n,s,i)=>{try{if(s.toUpperCase()==="B"){const o=atob(i);return decodeURIComponent(escape(o))}else if(s.toUpperCase()==="Q"){const o=i.replace(/_/g," ").replace(/=([0-9A-Fa-f]{2})/g,(l,a)=>String.fromCharCode(parseInt(a,16)));return decodeURIComponent(escape(o))}}catch(o){console.warn("MIME decode error:",o)}return t}).replace(/\s+/g," ").trim()}const _f={background:"#ffffff",cardBackground:"#ffffff",selectedBackground:"#f5f5f5",unreadBackground:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",danger:"#ef4444"};function vf({baseUrl:r,systemId:e,accountId:t,limit:n=30,folder:s,selectable:i=!0,showDetail:o=!1,showSearch:l=!0,searchQuery:a,onSearchChange:u,emptyMessage:c="No emails",autoLoad:d=!0,onSelect:f,onSelectionChange:p,onDelete:g,onError:m,onLoad:x,renderItem:_,renderDetail:y,renderActions:v,renderEmpty:C,renderLoading:D,theme:S={}}){const w={..._f,...S},[E,R]=b.useState([]),[T,B]=b.useState(!1),[M,j]=b.useState(null),[k,N]=b.useState(new Set),[F,O]=b.useState(null),[V,U]=b.useState(null),[te,q]=b.useState(null),[X,W]=b.useState(!1),[se,ue]=b.useState(""),de=a!==void 0?a:se,pe=ie=>{u?u(ie):ue(ie)},De=b.useMemo(()=>{if(!de.trim())return E;const ie=de.toLowerCase();return E.filter(ce=>$r(ce.from).toLowerCase().includes(ie)||$r(ce.subject).toLowerCase().includes(ie))},[E,de]),xe=b.useMemo(()=>e?new su({baseUrl:r,system_id:e}):null,[r,e]),J=b.useCallback(async()=>{if(xe){B(!0),j(null);try{const ie=await xe.listEmails(t,n,s);ie!=null&&ie.messages&&(R(ie.messages),x==null||x(ie.messages))}catch(ie){const ce=ie instanceof Error?ie:new Error("Failed to fetch emails");j(ce.message),m==null||m(ce)}B(!1)}},[xe,t,n,s,m,x]);b.useEffect(()=>{R([]),N(new Set),U(null),j(null),a===void 0&&ue(""),d&&J()},[s,d]);const Ce=b.useCallback(async ie=>{if(xe){U(ie),q(null),W(!0);try{const ce=await xe.getEmailParsed(t,ie.uid,s||"INBOX");ce!=null&&ce.body&&q(ce.body)}catch(ce){console.error("Failed to fetch email body:",ce)}W(!1)}},[xe,t,s]),ne=b.useCallback(ie=>{f==null||f(ie),o&&Ce(ie)},[f,o,Ce]),Ne=b.useCallback((ie,ce,He)=>{if(!i){f==null||f(ie),o&&Ce(ie);return}const Xe=ie.uid;if(He.shiftKey&&F!==null){const Je=Math.min(F,ce),Nt=Math.max(F,ce),Z=E.slice(Je,Nt+1).map(le=>le.uid),L=new Set(Z);N(L),p==null||p(Array.from(L))}else if(He.ctrlKey||He.metaKey)N(Je=>{const Nt=new Set(Je);return Nt.has(Xe)?Nt.delete(Xe):Nt.add(Xe),p==null||p(Array.from(Nt)),Nt}),O(ce);else{const Je=new Set([Xe]);N(Je),O(ce),p==null||p(Array.from(Je))}},[i,F,E,k,f,p,o]),Se=b.useCallback(async()=>{if(!xe||k.size===0)return;const ie=s||"INBOX";try{const ce=await xe.trashEmails(t,Array.from(k),ie);if(console.log("Trash result:",ce),ce.success&&ce.moved>0){R(Xe=>Xe.filter(Je=>!k.has(Je.uid)));const He=Array.from(k);N(new Set),g==null||g(He)}else j("Failed to move emails to trash")}catch(ce){const He=ce instanceof Error?ce:new Error("Trash failed");console.error("Trash error:",He),j(He.message),m==null||m(He)}},[xe,t,k,s,g,m]),ke=b.useCallback(async()=>{if(!xe||k.size===0)return;const ie=s||"INBOX";try{const ce=await xe.archiveEmails(t,Array.from(k),ie);if(console.log("Archive result:",ce),ce.success&&ce.archived>0){R(Xe=>Xe.filter(Je=>!k.has(Je.uid)));const He=Array.from(k);N(new Set),g==null||g(He)}else j("Failed to archive emails")}catch(ce){const He=ce instanceof Error?ce:new Error("Archive failed");console.error("Archive error:",He),j(He.message),m==null||m(He)}},[xe,t,k,s,g,m]),Ie=b.useCallback(()=>{if(k.size===E.length)N(new Set),p==null||p([]);else{const ie=new Set(E.map(ce=>ce.uid));N(ie),p==null||p(Array.from(ie))}},[E,k.size,p]),Le=b.useCallback(()=>{N(new Set),p==null||p([])},[p]),$e={delete:Se,archive:ke,refresh:J,selectAll:Ie,clearSelection:Le},Y=ie=>{if(!ie)return"";const ce=new Date(ie),He=new Date;return ce.toDateString()===He.toDateString()?ce.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):ce.toLocaleDateString([],{month:"short",day:"numeric"})},P=(ie,ce)=>h.jsx("div",{style:{padding:"12px 16px",background:ce?w.selectedBackground:ie.seen?w.cardBackground:w.unreadBackground,borderBottom:`1px solid ${w.border}`,cursor:"pointer",transition:"background 0.15s ease"},children:h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[h.jsxs("div",{style:{flex:1,minWidth:0},children:[h.jsx("div",{style:{fontSize:"14px",fontWeight:ie.seen?400:600,color:w.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:$r(ie.from).split("@")[0]}),h.jsx("div",{style:{fontSize:"14px",fontWeight:ie.seen?400:500,color:ie.seen?w.textSecondary:w.text,marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:$r(ie.subject)||"(No subject)"})]}),h.jsx("div",{style:{fontSize:"12px",color:w.textSecondary,flexShrink:0},children:Y(ie.date)})]})}),me=ie=>h.jsxs("div",{style:{padding:"24px"},children:[h.jsx("h2",{style:{margin:"0 0 8px",fontSize:"20px",color:w.text},children:$r(ie.subject)||"(No subject)"}),h.jsxs("div",{style:{fontSize:"14px",color:w.textSecondary,marginBottom:"16px"},children:["From: ",$r(ie.from)," • ",new Date(ie.date).toLocaleString()]}),X?h.jsx("div",{style:{fontSize:"14px",color:w.textSecondary},children:"Loading..."}):te?h.jsx("div",{style:{fontSize:"14px",color:w.text},dangerouslySetInnerHTML:{__html:te}}):h.jsx("div",{style:{fontSize:"14px",color:w.textSecondary},children:"No content available"})]}),We=(ie,ce)=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",background:w.cardBackground,borderBottom:`1px solid ${w.border}`},children:[h.jsx("button",{onClick:ce.selectAll,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${w.border}`,borderRadius:"6px",fontSize:"13px",cursor:"pointer",color:w.text},children:ie.length===E.length?"Deselect All":"Select All"}),ie.length>0&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{style:{fontSize:"13px",color:w.textSecondary},children:[ie.length," selected"]}),h.jsx("button",{onClick:ce.archive,title:"Archive",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${w.border}`,borderRadius:"6px",cursor:"pointer",color:w.textSecondary},children:h.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"archive"})}),h.jsx("button",{onClick:ce.delete,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${w.border}`,borderRadius:"6px",cursor:"pointer",color:w.textSecondary},children:h.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"delete"})})]}),h.jsx("div",{style:{flex:1}}),h.jsx("button",{onClick:ce.refresh,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${w.border}`,borderRadius:"6px",cursor:"pointer",color:w.textSecondary},children:h.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"refresh"})})]}),z=()=>h.jsx("div",{style:{padding:"48px",textAlign:"center",color:w.textSecondary},children:c}),ae=()=>h.jsx("div",{style:{padding:"48px",textAlign:"center",color:w.textSecondary},children:"Loading..."}),ge=_||P,ye=y||me,Ue=v||We,mt=C||z,yt=D||ae;return T&&E.length===0?h.jsx("div",{style:{background:w.background,width:"100%",height:"100%"},children:yt()}):h.jsxs("div",{style:{display:"flex",background:w.background,width:"100%",height:"100%"},children:[h.jsxs("div",{style:{flex:o&&V?"0 0 50%":"1",display:"flex",flexDirection:"column",borderRight:o&&V?`1px solid ${w.border}`:"none",overflow:"hidden"},children:[i&&Ue(Array.from(k),$e),l&&h.jsx("div",{style:{padding:"8px 12px",borderBottom:`1px solid ${w.border}`,background:w.background},children:h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",background:"#f5f5f5",borderRadius:"6px"},children:[h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:w.textSecondary,strokeWidth:"2",children:[h.jsx("circle",{cx:"11",cy:"11",r:"8"}),h.jsx("path",{d:"M21 21l-4.35-4.35"})]}),h.jsx("input",{type:"text",placeholder:"Search by email or subject...",value:de,onChange:ie=>pe(ie.target.value),style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:"13px",color:w.text}}),de&&h.jsx("button",{onClick:()=>pe(""),style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"},children:h.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:w.textSecondary,strokeWidth:"2",children:h.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})}),M&&h.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",color:w.danger,fontSize:"14px",borderBottom:`1px solid ${w.border}`},children:M}),h.jsx("div",{style:{flex:1,overflowY:"auto"},children:De.length===0?mt():De.map((ie,ce)=>h.jsx("div",{onClick:He=>Ne(ie,ce,He),onDoubleClick:()=>ne(ie),children:ge(ie,k.has(ie.uid))},ie.uid))})]}),o&&V&&h.jsx("div",{style:{flex:1,overflowY:"auto"},children:ye(V)})]})}function wf({items:r,renderItem:e,onSelectionChange:t,onCurrentChange:n,onAction:s,actions:i=[],emptyMessage:o="No items",showSelectAll:l=!0,className:a=""}){const[u,c]=b.useState(new Set),[d,f]=b.useState(-1),p=r.filter(C=>u.has(C.id)),g=d>=0&&d<p.length?p[d]:null,m=b.useCallback(C=>{c(D=>{const S=new Set(D);return S.has(C)?S.delete(C):S.add(C),t==null||t(Array.from(S)),S})},[t]),x=b.useCallback(()=>{if(u.size===r.length)c(new Set),f(-1),t==null||t([]);else{const C=new Set(r.map(D=>D.id));c(C),r.length>0&&(f(0),n==null||n(r[0],0)),t==null||t(r.map(D=>D.id))}},[r,u.size,t,n]),_=b.useCallback(()=>{if(p.length===0)return;const C=d<=0?p.length-1:d-1;f(C),n==null||n(p[C],C)},[p,d,n]),y=b.useCallback(()=>{if(p.length===0)return;const C=d>=p.length-1?0:d+1;f(C),n==null||n(p[C],C)},[p,d,n]),v=b.useCallback(C=>{s==null||s(C,p,g)},[s,p,g]);return b.useEffect(()=>{p.length===0?f(-1):d>=p.length?f(p.length-1):d<0&&p.length>0&&(f(0),n==null||n(p[0],0))},[p.length,d,n]),r.length===0?h.jsx("div",{className:`text-sm text-neutral-400 text-center py-4 ${a}`,children:o}):h.jsxs("div",{className:`space-y-2 ${a}`,children:[h.jsxs("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[l&&h.jsxs("button",{onClick:x,className:"flex items-center gap-1 hover:text-neutral-700 transition-colors",children:[h.jsx("span",{className:"material-icons text-sm",children:u.size===r.length?"check_box":u.size>0?"indeterminate_check_box":"check_box_outline_blank"}),h.jsx("span",{children:u.size===r.length?"Deselect all":"Select all"})]}),u.size>0&&h.jsxs("span",{className:"text-neutral-400",children:["(",u.size," selected)"]})]}),p.length>1&&h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:_,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Previous",children:h.jsx("span",{className:"material-icons text-sm",children:"chevron_left"})}),h.jsxs("span",{className:"text-xs min-w-[3rem] text-center",children:[d+1," / ",p.length]}),h.jsx("button",{onClick:y,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Next",children:h.jsx("span",{className:"material-icons text-sm",children:"chevron_right"})})]})]}),h.jsx("div",{className:"space-y-1",children:r.map(C=>{const D=u.has(C.id),S=(g==null?void 0:g.id)===C.id;return h.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${S?"bg-blue-50 ring-1 ring-blue-200":D?"bg-neutral-100":"hover:bg-neutral-50"}`,onClick:()=>m(C.id),children:[h.jsx("span",{className:`material-icons text-lg ${D?"text-blue-500":"text-neutral-300"}`,children:D?"check_box":"check_box_outline_blank"}),h.jsx("div",{className:"flex-1 min-w-0",children:e(C,D,S)})]},C.id)})}),i.length>0&&u.size>0&&h.jsx("div",{className:"flex items-center gap-2 pt-2 border-t border-neutral-100",children:i.map(C=>{var S;const D=((S=C.disabled)==null?void 0:S.call(C,p))??!1;return h.jsxs("button",{onClick:()=>v(C.id),disabled:D,className:`flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${D?"bg-neutral-100 text-neutral-400 cursor-not-allowed":"bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,children:[C.icon&&h.jsx("span",{className:"material-icons text-sm",children:C.icon}),C.label]},C.id)})})]})}function Cf(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Sf=Cf(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const fu=b.createContext(null);function kf(r,e){return{getTheme:function(){return e??null}}}function zt(){const r=b.useContext(fu);return r==null&&Sf(8),r}function Hn(r){return{}}const No={},Ef={},hu={},Er={},Kr={},Fn={},Yr={},si={},Ki={},jn={},Ln={},It={},Ro={},Mo={},Df={},pu={},Af={},gu={},Tf={},mu={},yu={},Bs={},Bf={},xu={},bu={},_u={},Nf={},Rf={},Mf={},Ea={},vu={},Ff={},wu={},Cu={},jf={},ii={},Fo={},Yi={},Lf={},Pf={},as={},ls={},If={},Of={},zf={},$t=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,$f=$t&&"documentMode"in document?document.documentMode:null,Mt=$t&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),mr=$t&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ns=!(!$t||!("InputEvent"in window)||$f)&&"getTargetRanges"in new window.InputEvent("input"),oi=$t&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Vn=$t&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,qf=$t&&/Android/.test(navigator.userAgent),Su=$t&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Uf=$t&&qf&&Su,jo=$t&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Su,Gn=1,xr=3,Br=0,ku=1,Zr=2,Wf=0,Hf=1,Vf=2,Rs=4,Ms=8,Lo=128,Gf=112|(3|Rs|Ms)|Lo,Po=1,Io=2,Oo=3,zo=4,$o=5,qo=6,ai=oi||Vn||jo?" ":"",sr=`
|
|
83
|
+
`,children:[a&&h.jsx("div",{className:"flex-shrink-0",children:h.jsx("img",{src:a,alt:o,className:"w-16 h-16 object-cover rounded-lg"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h3",{className:"font-medium text-gray-900 truncate",children:o}),u&&h.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full",children:u})]}),l&&h.jsx("p",{className:"text-sm text-gray-600 truncate mt-0.5",children:l})]}),e&&h.jsx("div",{className:"flex-shrink-0 text-gray-400",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})}function mf({item:r,onClose:e,title:t=i=>i.title||i.name||i.label||"Detail",image:n=i=>i.image||i.thumbnail||i.photo,fields:s=[]}){if(!r)return null;const i=t(r),o=n(r);return h.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:h.jsxs("div",{className:"bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl",children:[h.jsxs("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",children:[h.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:i}),e&&h.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"p-6",children:[o&&h.jsx("div",{className:"mb-6",children:h.jsx("img",{src:o,alt:i,className:"w-full h-64 object-cover rounded-lg"})}),s.length>0&&h.jsx("div",{className:"space-y-4",children:s.map((l,a)=>{const u=l.value(r);return u==null||u===""?null:h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-medium text-gray-500 mb-1",children:l.label}),h.jsx("div",{className:"text-base text-gray-900",children:typeof u=="object"?JSON.stringify(u,null,2):String(u)})]},a)})}),s.length===0&&h.jsx("pre",{className:"bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto",children:JSON.stringify(r,null,2)})]}),e&&h.jsx("div",{className:"sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4",children:h.jsx("button",{onClick:e,className:"w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",children:"Close"})})]})})}const yf={small:"w-24 h-24 sm:w-28 sm:h-28 md:w-32 md:h-32",medium:"w-32 h-32 sm:w-40 sm:h-40 md:w-48 md:h-48",large:"w-40 h-40 sm:w-56 sm:h-56 md:w-64 md:h-64 lg:w-72 lg:h-72"};function xf(r){const e=[...r];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e}function bf({nodes:r,minInterval:e=3e3,maxInterval:t=6e3,onCardClick:n,cardSize:s="medium",className:i=""}){var S,w;const[o]=b.useState(()=>{if(r.length===0)return[[],[]];const E=xf(r),R=Math.ceil(E.length/2);return console.log("[AnimatedCardFlip] Pools:",{left:E.slice(0,R).map(T=>T.title),right:E.slice(R).map(T=>T.title)}),[E.slice(0,R),E.slice(R)]}),[l,a]=b.useState(0),[u,c]=b.useState(0),[d,f]=b.useState(!1),[p,g]=b.useState(!1),[m,x]=b.useState(!1),[_,y]=b.useState(!1);b.useEffect(()=>{if(o[0].length<=1)return;const E=setInterval(()=>{f(R=>!R),setTimeout(()=>{a(R=>(R+1)%o[0].length),x(R=>!R)},250)},e+Math.random()*(t-e));return()=>clearInterval(E)},[o,e,t]),b.useEffect(()=>{if(o[1].length<=1)return;let E=null;const R=setTimeout(()=>{E=setInterval(()=>{g(T=>!T),setTimeout(()=>{c(T=>(T+1)%o[1].length),y(T=>!T)},250)},e+Math.random()*(t-e))},500);return()=>{clearTimeout(R),E&&clearInterval(E)}},[o,e,t]);const v=(S=o[0])==null?void 0:S[l],C=(w=o[1])==null?void 0:w[u];if(r.length===0||!v)return h.jsx("div",{className:`flex items-center justify-center p-8 ${i}`,children:h.jsx("p",{className:"text-gray-500",children:"No images available"})});const D=(E,R,T)=>h.jsx("div",{className:`relative ${yf[s]}`,style:{perspective:"1000px"},onClick:()=>n==null?void 0:n(E),children:h.jsxs("div",{className:"w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",style:{transform:`rotateY(${R?180:0}deg)`,transition:"transform 0.5s ease-in-out",transformStyle:"preserve-3d"},children:[h.jsx("img",{src:E.data.image,alt:E.title,className:"w-full h-full object-cover",style:{transform:T?"scaleX(-1)":"none",transformOrigin:"center"}}),h.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",style:{transform:T?"scaleX(-1)":"none",transformOrigin:"center"},children:h.jsx("p",{className:"text-white text-sm font-medium truncate",children:E.title})})]})});return h.jsxs("div",{className:`flex gap-4 justify-center items-center ${i}`,children:[D(v,d,m),C&&D(C,p,_)]})}function $r(r){if(!r)return"";const e=/=\?([^?]+)\?([BQbq])\?([^?]*)\?=/g;return r.replace(e,(t,n,s,i)=>{try{if(s.toUpperCase()==="B"){const o=atob(i);return decodeURIComponent(escape(o))}else if(s.toUpperCase()==="Q"){const o=i.replace(/_/g," ").replace(/=([0-9A-Fa-f]{2})/g,(l,a)=>String.fromCharCode(parseInt(a,16)));return decodeURIComponent(escape(o))}}catch(o){console.warn("MIME decode error:",o)}return t}).replace(/\s+/g," ").trim()}const _f={background:"#ffffff",cardBackground:"#ffffff",selectedBackground:"#f5f5f5",unreadBackground:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",primary:"#3b82f6",danger:"#ef4444"};function vf({baseUrl:r,systemId:e,accountId:t,limit:n=30,folder:s,selectable:i=!0,showDetail:o=!1,showSearch:l=!0,searchQuery:a,onSearchChange:u,emptyMessage:c="No emails",autoLoad:d=!0,onSelect:f,onSelectionChange:p,onDelete:g,onError:m,onLoad:x,renderItem:_,renderDetail:y,renderActions:v,renderEmpty:C,renderLoading:D,theme:S={}}){const w={..._f,...S},[E,R]=b.useState([]),[T,B]=b.useState(!1),[M,j]=b.useState(null),[k,N]=b.useState(new Set),[F,O]=b.useState(null),[V,U]=b.useState(null),[te,q]=b.useState(null),[X,W]=b.useState(!1),[se,ue]=b.useState(""),de=a!==void 0?a:se,pe=ie=>{u?u(ie):ue(ie)},De=b.useMemo(()=>{if(!de.trim())return E;const ie=de.toLowerCase();return E.filter(ce=>$r(ce.from).toLowerCase().includes(ie)||$r(ce.subject).toLowerCase().includes(ie))},[E,de]),xe=b.useMemo(()=>e?new su({baseUrl:r,system_id:e}):null,[r,e]),J=b.useCallback(async()=>{if(xe){B(!0),j(null);try{const ie=await xe.listEmails(t,n,s);ie!=null&&ie.messages&&(R(ie.messages),x==null||x(ie.messages))}catch(ie){const ce=ie instanceof Error?ie:new Error("Failed to fetch emails");j(ce.message),m==null||m(ce)}B(!1)}},[xe,t,n,s,m,x]);b.useEffect(()=>{R([]),N(new Set),U(null),j(null),a===void 0&&ue(""),d&&J()},[s,d]);const Ce=b.useCallback(async ie=>{if(xe){U(ie),q(null),W(!0);try{const ce=await xe.getEmailParsed(t,ie.uid,s||"INBOX");ce!=null&&ce.body&&q(ce.body)}catch(ce){console.error("Failed to fetch email body:",ce)}W(!1)}},[xe,t,s]),ne=b.useCallback(ie=>{f==null||f(ie),o&&Ce(ie)},[f,o,Ce]),Ne=b.useCallback((ie,ce,He)=>{if(!i){f==null||f(ie),o&&Ce(ie);return}const Xe=ie.uid;if(He.shiftKey&&F!==null){const Je=Math.min(F,ce),Nt=Math.max(F,ce),Z=E.slice(Je,Nt+1).map(le=>le.uid),L=new Set(Z);N(L),p==null||p(Array.from(L))}else if(He.ctrlKey||He.metaKey)N(Je=>{const Nt=new Set(Je);return Nt.has(Xe)?Nt.delete(Xe):Nt.add(Xe),p==null||p(Array.from(Nt)),Nt}),O(ce);else{const Je=new Set([Xe]);N(Je),O(ce),p==null||p(Array.from(Je))}},[i,F,E,k,f,p,o]),Se=b.useCallback(async()=>{if(!xe||k.size===0)return;const ie=s||"INBOX";try{const ce=await xe.trashEmails(t,Array.from(k),ie);if(console.log("Trash result:",ce),ce.success&&ce.moved>0){R(Xe=>Xe.filter(Je=>!k.has(Je.uid)));const He=Array.from(k);N(new Set),g==null||g(He)}else j("Failed to move emails to trash")}catch(ce){const He=ce instanceof Error?ce:new Error("Trash failed");console.error("Trash error:",He),j(He.message),m==null||m(He)}},[xe,t,k,s,g,m]),ke=b.useCallback(async()=>{if(!xe||k.size===0)return;const ie=s||"INBOX";try{const ce=await xe.archiveEmails(t,Array.from(k),ie);if(console.log("Archive result:",ce),ce.success&&ce.archived>0){R(Xe=>Xe.filter(Je=>!k.has(Je.uid)));const He=Array.from(k);N(new Set),g==null||g(He)}else j("Failed to archive emails")}catch(ce){const He=ce instanceof Error?ce:new Error("Archive failed");console.error("Archive error:",He),j(He.message),m==null||m(He)}},[xe,t,k,s,g,m]),Ie=b.useCallback(()=>{if(k.size===E.length)N(new Set),p==null||p([]);else{const ie=new Set(E.map(ce=>ce.uid));N(ie),p==null||p(Array.from(ie))}},[E,k.size,p]),Le=b.useCallback(()=>{N(new Set),p==null||p([])},[p]),$e={delete:Se,archive:ke,refresh:J,selectAll:Ie,clearSelection:Le},Y=ie=>{if(!ie)return"";const ce=new Date(ie),He=new Date;return ce.toDateString()===He.toDateString()?ce.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):ce.toLocaleDateString([],{month:"short",day:"numeric"})},P=(ie,ce)=>h.jsx("div",{style:{padding:"12px 16px",background:ce?w.selectedBackground:ie.seen?w.cardBackground:w.unreadBackground,borderBottom:`1px solid ${w.border}`,cursor:"pointer",transition:"background 0.15s ease"},children:h.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[h.jsxs("div",{style:{flex:1,minWidth:0},children:[h.jsx("div",{style:{fontSize:"14px",fontWeight:ie.seen?400:600,color:w.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:$r(ie.from).split("@")[0]}),h.jsx("div",{style:{fontSize:"14px",fontWeight:ie.seen?400:500,color:ie.seen?w.textSecondary:w.text,marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:$r(ie.subject)||"(No subject)"})]}),h.jsx("div",{style:{fontSize:"12px",color:w.textSecondary,flexShrink:0},children:Y(ie.date)})]})}),me=ie=>h.jsxs("div",{style:{padding:"24px"},children:[h.jsx("h2",{style:{margin:"0 0 8px",fontSize:"20px",color:w.text},children:$r(ie.subject)||"(No subject)"}),h.jsxs("div",{style:{fontSize:"14px",color:w.textSecondary,marginBottom:"16px"},children:["From: ",$r(ie.from)," • ",new Date(ie.date).toLocaleString()]}),X?h.jsx("div",{style:{fontSize:"14px",color:w.textSecondary},children:"Loading..."}):te?h.jsx("div",{style:{fontSize:"14px",color:w.text},dangerouslySetInnerHTML:{__html:te}}):h.jsx("div",{style:{fontSize:"14px",color:w.textSecondary},children:"No content available"})]}),We=(ie,ce)=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",background:w.cardBackground,borderBottom:`1px solid ${w.border}`},children:[h.jsx("button",{onClick:ce.selectAll,style:{padding:"6px 12px",background:"transparent",border:`1px solid ${w.border}`,borderRadius:"6px",fontSize:"13px",cursor:"pointer",color:w.text},children:ie.length===E.length?"Deselect All":"Select All"}),ie.length>0&&h.jsxs(h.Fragment,{children:[h.jsxs("span",{style:{fontSize:"13px",color:w.textSecondary},children:[ie.length," selected"]}),h.jsx("button",{onClick:ce.archive,title:"Archive",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${w.border}`,borderRadius:"6px",cursor:"pointer",color:w.textSecondary},children:h.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"archive"})}),h.jsx("button",{onClick:ce.delete,title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${w.border}`,borderRadius:"6px",cursor:"pointer",color:w.textSecondary},children:h.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"delete"})})]}),h.jsx("div",{style:{flex:1}}),h.jsx("button",{onClick:ce.refresh,title:"Refresh",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",background:"transparent",border:`1px solid ${w.border}`,borderRadius:"6px",cursor:"pointer",color:w.textSecondary},children:h.jsx("span",{className:"material-icons",style:{fontSize:"18px"},children:"refresh"})})]}),z=()=>h.jsx("div",{style:{padding:"48px",textAlign:"center",color:w.textSecondary},children:c}),ae=()=>h.jsx("div",{style:{padding:"48px",textAlign:"center",color:w.textSecondary},children:"Loading..."}),ge=_||P,ye=y||me,Ue=v||We,mt=C||z,yt=D||ae;return T&&E.length===0?h.jsx("div",{style:{background:w.background,width:"100%",height:"100%"},children:yt()}):h.jsxs("div",{style:{display:"flex",background:w.background,width:"100%",height:"100%"},children:[h.jsxs("div",{style:{flex:o&&V?"0 0 50%":"1",display:"flex",flexDirection:"column",borderRight:o&&V?`1px solid ${w.border}`:"none",overflow:"hidden"},children:[i&&Ue(Array.from(k),$e),l&&h.jsx("div",{style:{padding:"8px 12px",borderBottom:`1px solid ${w.border}`,background:w.background},children:h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",background:"#f5f5f5",borderRadius:"6px"},children:[h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:w.textSecondary,strokeWidth:"2",children:[h.jsx("circle",{cx:"11",cy:"11",r:"8"}),h.jsx("path",{d:"M21 21l-4.35-4.35"})]}),h.jsx("input",{type:"text",placeholder:"Search by email or subject...",value:de,onChange:ie=>pe(ie.target.value),style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:"13px",color:w.text}}),de&&h.jsx("button",{onClick:()=>pe(""),style:{border:"none",background:"transparent",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center"},children:h.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:w.textSecondary,strokeWidth:"2",children:h.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]})}),M&&h.jsx("div",{style:{padding:"12px 16px",background:"#fef2f2",color:w.danger,fontSize:"14px",borderBottom:`1px solid ${w.border}`},children:M}),h.jsx("div",{style:{flex:1,overflowY:"auto"},children:De.length===0?mt():De.map((ie,ce)=>h.jsx("div",{onClick:He=>Ne(ie,ce,He),onDoubleClick:()=>ne(ie),children:ge(ie,k.has(ie.uid))},ie.uid))})]}),o&&V&&h.jsx("div",{style:{flex:1,overflowY:"auto"},children:ye(V)})]})}function wf({items:r,renderItem:e,onSelectionChange:t,onCurrentChange:n,onAction:s,actions:i=[],emptyMessage:o="No items",showSelectAll:l=!0,className:a=""}){const[u,c]=b.useState(new Set),[d,f]=b.useState(-1),p=r.filter(C=>u.has(C.id)),g=d>=0&&d<p.length?p[d]:null,m=b.useCallback(C=>{c(D=>{const S=new Set(D);return S.has(C)?S.delete(C):S.add(C),t==null||t(Array.from(S)),S})},[t]),x=b.useCallback(()=>{if(u.size===r.length)c(new Set),f(-1),t==null||t([]);else{const C=new Set(r.map(D=>D.id));c(C),r.length>0&&(f(0),n==null||n(r[0],0)),t==null||t(r.map(D=>D.id))}},[r,u.size,t,n]),_=b.useCallback(()=>{if(p.length===0)return;const C=d<=0?p.length-1:d-1;f(C),n==null||n(p[C],C)},[p,d,n]),y=b.useCallback(()=>{if(p.length===0)return;const C=d>=p.length-1?0:d+1;f(C),n==null||n(p[C],C)},[p,d,n]),v=b.useCallback(C=>{s==null||s(C,p,g)},[s,p,g]);return b.useEffect(()=>{p.length===0?f(-1):d>=p.length?f(p.length-1):d<0&&p.length>0&&(f(0),n==null||n(p[0],0))},[p.length,d,n]),r.length===0?h.jsx("div",{className:`text-sm text-neutral-400 text-center py-4 ${a}`,children:o}):h.jsxs("div",{className:`space-y-2 ${a}`,children:[h.jsxs("div",{className:"flex items-center justify-between text-xs text-neutral-500",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[l&&h.jsxs("button",{onClick:x,className:"flex items-center gap-1 hover:text-neutral-700 transition-colors",children:[h.jsx("span",{className:"material-icons text-sm",children:u.size===r.length?"check_box":u.size>0?"indeterminate_check_box":"check_box_outline_blank"}),h.jsx("span",{children:u.size===r.length?"Deselect all":"Select all"})]}),u.size>0&&h.jsxs("span",{className:"text-neutral-400",children:["(",u.size," selected)"]})]}),p.length>1&&h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:_,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Previous",children:h.jsx("span",{className:"material-icons text-sm",children:"chevron_left"})}),h.jsxs("span",{className:"text-xs min-w-[3rem] text-center",children:[d+1," / ",p.length]}),h.jsx("button",{onClick:y,className:"p-1 hover:bg-neutral-100 rounded transition-colors",title:"Next",children:h.jsx("span",{className:"material-icons text-sm",children:"chevron_right"})})]})]}),h.jsx("div",{className:"space-y-1",children:r.map(C=>{const D=u.has(C.id),S=(g==null?void 0:g.id)===C.id;return h.jsxs("div",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${S?"bg-blue-50 ring-1 ring-blue-200":D?"bg-neutral-100":"hover:bg-neutral-50"}`,onClick:()=>m(C.id),children:[h.jsx("span",{className:`material-icons text-lg ${D?"text-blue-500":"text-neutral-300"}`,children:D?"check_box":"check_box_outline_blank"}),h.jsx("div",{className:"flex-1 min-w-0",children:e(C,D,S)})]},C.id)})}),i.length>0&&u.size>0&&h.jsx("div",{className:"flex items-center gap-2 pt-2 border-t border-neutral-100",children:i.map(C=>{var S;const D=((S=C.disabled)==null?void 0:S.call(C,p))??!1;return h.jsxs("button",{onClick:()=>v(C.id),disabled:D,className:`flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${D?"bg-neutral-100 text-neutral-400 cursor-not-allowed":"bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,children:[C.icon&&h.jsx("span",{className:"material-icons text-sm",children:C.icon}),C.label]},C.id)})})]})}function Cf(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Sf=Cf(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const fu=b.createContext(null);function kf(r,e){return{getTheme:function(){return e??null}}}function zt(){const r=b.useContext(fu);return r==null&&Sf(8),r}function Hn(r){return{}}const No={},Ef={},hu={},Er={},Kr={},Fn={},Yr={},si={},Ki={},jn={},Ln={},It={},Ro={},Mo={},Df={},pu={},Af={},gu={},Tf={},mu={},yu={},Bs={},Bf={},xu={},bu={},_u={},Nf={},Rf={},Mf={},Ea={},vu={},Ff={},wu={},Cu={},jf={},ii={},Fo={},Yi={},Lf={},Pf={},as={},ls={},If={},Of={},zf={},$t=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,$f=$t&&"documentMode"in document?document.documentMode:null,Mt=$t&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),mr=$t&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ns=!(!$t||!("InputEvent"in window)||$f)&&"getTargetRanges"in new window.InputEvent("input"),oi=$t&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Vn=$t&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,qf=$t&&/Android/.test(navigator.userAgent),Su=$t&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Uf=$t&&qf&&Su,jo=$t&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Su,Gn=1,xr=3,Br=0,ku=1,Zr=2,Wf=0,Hf=1,Vf=2,Rs=4,Ms=8,Lo=128,Gf=112|(3|Rs|Ms)|Lo,Po=1,Io=2,Oo=3,zo=4,$o=5,qo=6,ai=oi||Vn||jo?" ":"",sr=`
|
|
84
84
|
|
|
85
85
|
`,Kf=mr?" ":ai,Eu="֑-߿יִ-﷽ﹰ-ﻼ",Du="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Yf=new RegExp("^[^"+Du+"]*["+Eu+"]"),Qf=new RegExp("^[^"+Eu+"]*["+Du+"]"),Nr={bold:1,code:16,highlight:Lo,italic:2,strikethrough:Rs,subscript:32,superscript:64,underline:Ms},Xf={directionless:1,unmergeable:2},Da={center:Io,end:qo,justify:zo,left:Po,right:Oo,start:$o},Jf={[Io]:"center",[qo]:"end",[zo]:"justify",[Po]:"left",[Oo]:"right",[$o]:"start"},Zf={normal:0,segmented:2,token:1},eh={[Wf]:"normal",[Vf]:"segmented",[Hf]:"token"};function th(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var K=th(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Fs(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}const rh=100;let Qi=!1,Uo=0;function nh(r){Uo=r.timeStamp}function Ni(r,e,t){const n=r.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(r===s||n&&r.previousSibling===s)||n&&ui(r,t)!==void 0}function sh(r,e,t){const n=Bt(t._window);let s=null,i=null;n!==null&&n.anchorNode===r&&(s=n.anchorOffset,i=n.focusOffset);const o=r.nodeValue;o!==null&&Ko(e,o,s,i,!1)}function ih(r,e,t){if(H(r)){const n=r.anchor.getNode();if(n.is(t)&&r.format!==n.getFormat())return!1}return e.nodeType===xr&&t.isAttached()}function oh(r,e,t,n){for(let s=r;s&&!bh(s);s=Yn(s)){const i=ui(s,e);if(i!==void 0){const o=dt(i,t);if(o)return ze(o)?void 0:[s,o]}else if(s===n)return[n,Lu(t)]}}function Au(r,e,t){Qi=!0;const n=performance.now()-Uo>rh;try{kt(r,()=>{const s=oe()||function(f){return f.getEditorState().read(()=>{const p=oe();return p!==null?p.clone():null})}(r),i=new Map,o=r.getRootElement(),l=r._editorState,a=r._blockCursorElement;let u=!1,c="";for(let f=0;f<e.length;f++){const p=e[f],g=p.type,m=p.target,x=oh(m,r,l,o);if(!x)continue;const[_,y]=x;if(g==="characterData")n&&Q(y)&&ih(s,m,y)&&sh(m,y,r);else if(g==="childList"){u=!0;const v=p.addedNodes;for(let S=0;S<v.length;S++){const w=v[S],E=Fu(w),R=w.parentNode;if(R!=null&&w!==a&&E===null&&!Ni(w,R,r)){if(mr){const T=w.innerText||w.nodeValue;T&&(c+=T)}R.removeChild(w)}}const C=p.removedNodes,D=C.length;if(D>0){let S=0;for(let w=0;w<D;w++){const E=C[w];(Ni(E,m,r)||a===E)&&(m.appendChild(E),S++)}D!==S&&i.set(_,y)}}}if(i.size>0)for(const[f,p]of i)p.reconcileObservedMutation(f,r);const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const p=d[f],g=p.addedNodes,m=p.target;for(let x=0;x<g.length;x++){const _=g[x],y=_.parentNode;y==null||_.nodeName!=="BR"||Ni(_,m,r)||y.removeChild(_)}}t.takeRecords()}s!==null&&(u&&(s.dirty=!0,Kt(s)),mr&&zu(r)&&s.insertRawText(c))})}finally{Qi=!1}}function Tu(r){const e=r._observer;e!==null&&Au(r,e.takeRecords(),e)}function Bu(r){(function(e){Uo===0&&di(e).addEventListener("textInput",nh,!0)})(r),r._observer=new MutationObserver((e,t)=>{Au(r,e,t)})}function Aa(r,e){const t=r.__mode,n=r.__format,s=r.__style,i=e.__mode,o=e.__format,l=e.__style;return!(t!==null&&t!==i||n!==null&&n!==o||s!==null&&s!==l)}function Ta(r,e){const t=r.mergeWithSibling(e),n=Qe()._normalizedNodes;return n.add(r.__key),n.add(e.__key),t}function Ba(r){let e,t,n=r;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(e=n.getPreviousSibling())!==null&&Q(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Aa(e,n)){n=Ta(e,n);break}break}e.remove()}for(;(t=n.getNextSibling())!==null&&Q(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Aa(n,t)){n=Ta(n,t);break}break}t.remove()}}else n.remove()}function Nu(r){return Na(r.anchor),Na(r.focus),r}function Na(r){for(;r.type==="element";){const e=r.getNode(),t=r.offset;let n,s;if(t===e.getChildrenSize()?(n=e.getChildAtIndex(t-1),s=!0):(n=e.getChildAtIndex(t),s=!1),Q(n)){r.set(n.__key,s?n.getTextContentSize():0,"text");break}if(!I(n))break;r.set(n.__key,s?n.getChildrenSize():0,"element")}}let ah=1;const lh=typeof queueMicrotask=="function"?queueMicrotask:r=>{Promise.resolve().then(r)};function Wo(r){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return ze(en(r))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&li(e)==null)}function Kn(r,e,t){const n=r.getRootElement();try{return n!==null&&n.contains(e)&&n.contains(t)&&e!==null&&!Wo(e)&&Ru(e)===r}catch{return!1}}function Ho(r){return r instanceof mi}function Ru(r){let e=r;for(;e!=null;){const t=li(e);if(Ho(t))return t;e=Yn(e)}return null}function li(r){return r?r.__lexicalEditor:null}function Cr(r){return r.isToken()||r.isSegmented()}function uh(r){return r.nodeType===xr}function js(r){let e=r;for(;e!=null;){if(uh(e))return e;e=e.firstChild}return null}function Ls(r,e,t){const n=Nr[e];if(t!==null&&(r&n)==(t&n))return r;let s=r^n;return e==="subscript"?s&=-65:e==="superscript"&&(s&=-33),s}function Mu(r){return Q(r)||Ar(r)||ze(r)}function ch(r,e){if(e!=null)return void(r.__key=e);vt(),ac();const t=Qe(),n=ar(),s=""+ah++;n._nodeMap.set(s,r),I(r)?t._dirtyElements.set(s,!0):t._dirtyLeaves.add(s),t._cloneNotNeeded.add(s),t._dirtyType=ku,r.__key=s}function Dr(r){const e=r.getParent();if(e!==null){const t=r.getWritable(),n=e.getWritable(),s=r.getPreviousSibling(),i=r.getNextSibling();if(s===null)if(i!==null){const o=i.getWritable();n.__first=i.__key,o.__prev=null}else n.__first=null;else{const o=s.getWritable();if(i!==null){const l=i.getWritable();l.__prev=o.__key,o.__next=l.__key}else o.__next=null;t.__prev=null}if(i===null)if(s!==null){const o=s.getWritable();n.__last=s.__key,o.__next=null}else n.__last=null;else{const o=i.getWritable();if(s!==null){const l=s.getWritable();l.__next=o.__key,o.__prev=l.__key}else o.__prev=null;t.__next=null}n.__size--,t.__parent=null}}function Ps(r){ac();const e=r.getLatest(),t=e.__parent,n=ar(),s=Qe(),i=n._nodeMap,o=s._dirtyElements;t!==null&&function(a,u,c){let d=a;for(;d!==null;){if(c.has(d))return;const f=u.get(d);if(f===void 0)break;c.set(d,!1),d=f.__parent}}(t,i,o);const l=e.__key;s._dirtyType=ku,I(r)?o.set(l,!0):s._dirtyLeaves.add(l)}function lt(r){vt();const e=Qe(),t=e._compositionKey;if(r!==t){if(e._compositionKey=r,t!==null){const n=dt(t);n!==null&&n.getWritable()}if(r!==null){const n=dt(r);n!==null&&n.getWritable()}}}function hr(){return es()?null:Qe()._compositionKey}function dt(r,e){const t=(e||ar())._nodeMap.get(r);return t===void 0?null:t}function Fu(r,e){const t=ui(r,Qe());return t!==void 0?dt(t,e):null}function ui(r,e){return r[`__lexicalKey_${e._key}`]}function en(r,e){let t=r;for(;t!=null;){const n=Fu(t,e);if(n!==null)return n;t=Yn(t)}return null}function ju(r){const e=r._decorators,t=Object.assign({},e);return r._pendingDecorators=t,t}function Ra(r){return r.read(()=>Ge().getTextContent())}function Ge(){return Lu(ar())}function Lu(r){return r._nodeMap.get("root")}function Kt(r){vt();const e=ar();r!==null&&(r.dirty=!0,r.setCachedNodes(null)),e._selection=r}function Hr(r){const e=Qe(),t=function(n,s){let i=n;for(;i!=null;){const o=ui(i,s);if(o!==void 0)return o;i=Yn(i)}return null}(r,e);return t===null?r===e.getRootElement()?dt("root"):null:dt(t)}function Ma(r,e){return e?r.getTextContentSize():0}function Pu(r){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(r)}function Vo(r){const e=[];let t=r;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Iu(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ou(r){return r.nodeType===xr?r.nodeValue:null}function Go(r,e,t){const n=Bt(e._window);if(n===null)return;const s=n.anchorNode;let{anchorOffset:i,focusOffset:o}=n;if(s!==null){let l=Ou(s);const a=en(s);if(l!==null&&Q(a)){if(l===ai&&t){const u=t.length;l=t,i=u,o=u}l!==null&&Ko(a,l,i,o,r)}}}function Ko(r,e,t,n,s){let i=r;if(i.isAttached()&&(s||!i.isDirty())){const o=i.isComposing();let l=e;(o||s)&&e[e.length-1]===ai&&(l=e.slice(0,-1));const a=i.getTextContent();if(s||l!==a){if(l===""){if(lt(null),oi||Vn||jo)i.remove();else{const m=Qe();setTimeout(()=>{m.update(()=>{i.isAttached()&&i.remove()})},20)}return}const u=i.getParent(),c=Zn(),d=i.getTextContentSize(),f=hr(),p=i.getKey();if(i.isToken()||f!==null&&p===f&&!o||H(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===r.__key&&c.anchor.offset===0&&!i.canInsertTextBefore()&&!o||c.focus.key===r.__key&&c.focus.offset===d&&!i.canInsertTextAfter()&&!o))return void i.markDirty();const g=oe();if(!H(g)||t===null||n===null)return void i.setTextContent(l);if(g.setTextNodeRange(i,t,i,n),i.isSegmented()){const m=st(i.getTextContent());i.replace(m),i=m}i.setTextContent(l)}}}function dh(r,e){if(e.isSegmented())return!0;if(!r.isCollapsed())return!1;const t=r.anchor.offset,n=e.getParentOrThrow(),s=e.isToken();return t===0?!e.canInsertTextBefore()||!n.canInsertTextBefore()&&!e.isComposing()||s||function(i){const o=i.getPreviousSibling();return(Q(o)||I(o)&&o.isInline())&&!o.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!n.canInsertTextAfter()&&!e.isComposing()||s)}function Fa(r){return r==="ArrowLeft"}function ja(r){return r==="ArrowRight"}function _n(r,e){return Mt?r:e}function La(r){return r==="Enter"}function fn(r){return r==="Backspace"}function hn(r){return r==="Delete"}function Pa(r,e,t){return r.toLowerCase()==="a"&&_n(e,t)}function fh(){const r=Ge();Kt(Nu(r.select(0,r.getChildrenSize())))}function An(r,e){r.__lexicalClassNameCache===void 0&&(r.__lexicalClassNameCache={});const t=r.__lexicalClassNameCache,n=t[e];if(n!==void 0)return n;const s=r[e];if(typeof s=="string"){const i=Fs(s);return t[e]=i,i}return s}function Yo(r,e,t,n,s){if(t.size===0)return;const i=n.__type,o=n.__key,l=e.get(i);l===void 0&&K(33,i);const a=l.klass;let u=r.get(a);u===void 0&&(u=new Map,r.set(a,u));const c=u.get(o),d=c==="destroyed"&&s==="created";(c===void 0||d)&&u.set(o,d?"updated":s)}function Ia(r,e,t){const n=r.getParent();let s=t,i=r;return n!==null&&(e&&t===0?(s=i.getIndexWithinParent(),i=n):e||t!==i.getChildrenSize()||(s=i.getIndexWithinParent()+1,i=n)),i.getChildAtIndex(e?s-1:s)}function Pn(r,e){const t=r.offset;if(r.type==="element")return Ia(r.getNode(),e,t);{const n=r.getNode();if(e&&t===0||!e&&t===n.getTextContentSize()){const s=e?n.getPreviousSibling():n.getNextSibling();return s===null?Ia(n.getParentOrThrow(),e,n.getIndexWithinParent()+(e?0:1)):s}}return null}function zu(r){const e=di(r).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function re(r,e,t){return cc(r,e,t)}function ci(r){return!pt(r)&&!r.isLastChild()&&!r.isInline()}function Is(r,e){const t=r._keyToDOMMap.get(e);return t===void 0&&K(75,e),t}function Yn(r){const e=r.assignedSlot||r.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Tn(r,e){let t=r.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function di(r){const e=r._window;return e===null&&K(78),e}function hh(r){let e=r.getParentOrThrow();for(;e!==null;){if(Yt(e))return e;e=e.getParentOrThrow()}return e}function Yt(r){return pt(r)||I(r)&&r.isShadowRoot()}function Xt(r){const e=Qe(),t=r.constructor.getType(),n=e._nodes.get(t);n===void 0&&K(200,r.constructor.name,t);const{replace:s,replaceWithKlass:i}=n;if(s!==null){const o=s(r),l=o.constructor;return i!==null?o instanceof i||K(201,i.name,i.getType(),l.name,l.getType(),r.constructor.name,t):o instanceof r.constructor&&l!==r.constructor||K(202,l.name,l.getType(),r.constructor.name,t),o.__key===r.__key&&K(203,r.constructor.name,t,l.name,l.getType()),o}return r}function Ri(r,e){!pt(r.getParent())||I(e)||ze(e)||K(99)}function Mi(r){return(ze(r)||I(r)&&!r.canBeEmpty())&&!r.isInline()}function Qo(r,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const n=r.parentElement;n!==null&&n.removeChild(r)}function ph(r,e,t){let n=r._blockCursorElement;if(H(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const s=t.anchor,i=s.getNode(),o=s.offset;let l=!1,a=null;if(o===i.getChildrenSize())Mi(i.getChildAtIndex(o-1))&&(l=!0);else{const u=i.getChildAtIndex(o);if(u!==null&&Mi(u)){const c=u.getPreviousSibling();(c===null||Mi(c))&&(l=!0,a=r.getElementByKey(u.__key))}}if(l){const u=r.getElementByKey(i.__key);return n===null&&(r._blockCursorElement=n=function(c){const d=c.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let p=d.blockCursor;if(p!==void 0){if(typeof p=="string"){const g=Fs(p);p=d.blockCursor=g}p!==void 0&&f.classList.add(...p)}return f}(r._config)),e.style.caretColor="transparent",void(a===null?u.appendChild(n):u.insertBefore(n,a))}}n!==null&&Qo(n,r,e)}function Bt(r){return $t?(r||window).getSelection():null}function gh(r){return or(r)&&r.tagName==="A"}function or(r){return r.nodeType===1}function Oa(r){return r.nodeType===11}function Xi(r){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return r.nodeName.match(e)!==null}function Os(r){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return r.nodeName.match(e)!==null}function cr(r){if(ze(r)&&!r.isInline())return!0;if(!I(r)||Yt(r))return!1;const e=r.getFirstChild(),t=e===null||Ar(e)||Q(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function pn(r,e){let t=r;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function mh(){return Qe()}const za=new WeakMap,yh=new Map;function xh(r){if(!r._readOnly&&r.isEmpty())return yh;r._readOnly||K(192);let e=za.get(r);if(!e){e=new Map,za.set(r,e);for(const[t,n]of r._nodeMap){const s=n.__type;let i=e.get(s);i||(i=new Map,e.set(s,i)),i.set(t,n)}}return e}function Xo(r){const e=r.constructor.clone(r);return e.afterCloneFrom(r),e}function Jo(r,e){const t=(parseInt(r.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function bh(r){return r.__lexicalUnmanaged===!0}function $u(r,e,t,n,s,i){let o=r.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(I(o)&&$u(o,l,t,n,s,i),t.has(l)||i.delete(l),s.push(l)),o=o.getNextSibling()}}let yr,gt,In,fi,Ji,Zi,Rr,Ot,eo,On,it="",ht="",Ut=null,Ft="",rr="",qu=!1,zn=!1,vs=null;function zs(r,e){const t=Rr.get(r);if(e!==null){const n=no(r);n.parentNode===e&&e.removeChild(n)}if(Ot.has(r)||gt._keyToDOMMap.delete(r),I(t)){const n=qs(t,Rr);to(n,0,n.length-1,null)}t!==void 0&&Yo(On,In,fi,t,"destroyed")}function to(r,e,t,n){let s=e;for(;s<=t;++s){const i=r[s];i!==void 0&&zs(i,n)}}function vr(r,e){r.setProperty("text-align",e)}const _h="40px";function Uu(r,e){const t=yr.theme.indent;if(typeof t=="string"){const s=r.classList.contains(t);e>0&&!s?r.classList.add(t):e<1&&s&&r.classList.remove(t)}const n=getComputedStyle(r).getPropertyValue("--lexical-indent-base-value")||_h;r.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function Wu(r,e){const t=r.style;e===0?vr(t,""):e===Po?vr(t,"left"):e===Io?vr(t,"center"):e===Oo?vr(t,"right"):e===zo?vr(t,"justify"):e===$o?vr(t,"start"):e===qo&&vr(t,"end")}function $s(r,e){const t=Ot.get(r);t===void 0&&K(60);const n=t.createDOM(yr,gt);if(function(s,i,o){const l=o._keyToDOMMap;(function(a,u,c){a[`__lexicalKey_${u._key}`]=c})(i,o,s),l.set(s,i)}(r,n,gt),Q(t)?n.setAttribute("data-lexical-text","true"):ze(t)&&n.setAttribute("data-lexical-decorator","true"),I(t)){const s=t.__indent,i=t.__size;if(s!==0&&Uu(n,s),i!==0){const l=i-1;(function(a,u,c,d){const f=ht;ht="",ro(a,c,0,u,c.getDOMSlot(d)),Vu(c,d),ht=f})(qs(t,Ot),l,t,n)}const o=t.__format;o!==0&&Wu(n,o),t.isInline()||Hu(null,t,n),ci(t)&&(it+=sr,rr+=sr)}else{const s=t.getTextContent();if(ze(t)){const i=t.decorate(gt,yr);i!==null&&Gu(r,i),n.contentEditable="false"}else Q(t)&&(t.isDirectionless()||(ht+=s));it+=s,rr+=s}return e!==null&&e.insertChild(n),Yo(On,In,fi,t,"created"),n}function ro(r,e,t,n,s){const i=it;it="";let o=t;for(;o<=n;++o){$s(r[o],s);const l=Ot.get(r[o]);l!==null&&Q(l)&&(Ut===null&&(Ut=l.getFormat()),Ft===""&&(Ft=l.getStyle()))}ci(e)&&(it+=sr),s.element.__lexicalTextContent=it,it=i+it}function $a(r,e){if(r){const t=r.__last;if(t){const n=e.get(t);if(n)return Ar(n)?"line-break":ze(n)&&n.isInline()?"decorator":null}return"empty"}return null}function Hu(r,e,t){const n=$a(r,Rr),s=$a(e,Ot);n!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Vu(r,e){const t=e.__lexicalDirTextContent||"",n=e.__lexicalDir||"";if(t!==ht||n!==vs){const i=ht==="",o=i?vs:(s=ht,Yf.test(s)?"rtl":Qf.test(s)?"ltr":null);if(o!==n){const l=e.classList,a=yr.theme;let u=n!==null?a[n]:void 0,c=o!==null?a[o]:void 0;if(u!==void 0){if(typeof u=="string"){const d=Fs(u);u=a[n]=d}l.remove(...u)}if(o===null||i&&o==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const d=Fs(c);c=a[o]=d}c!==void 0&&l.add(...c)}e.dir=o}zn||(r.getWritable().__dir=o)}vs=o,e.__lexicalDirTextContent=ht,e.__lexicalDir=o}var s}function vh(r,e,t){const n=ht;var s;ht="",Ut=null,Ft="",function(i,o,l){const a=it,u=i.__size,c=o.__size;it="";const d=l.element;if(u===1&&c===1){const f=i.__first,p=o.__first;if(f===p)vn(f,d);else{const m=no(f),x=$s(p,null);try{d.replaceChild(x,m)}catch(_){if(typeof _=="object"&&_!=null){const y=`${_.toString()} Parent: ${d.tagName}, new child: {tag: ${x.tagName} key: ${p}}, old child: {tag: ${m.tagName}, key: ${f}}.`;throw new Error(y)}throw _}zs(f,null)}const g=Ot.get(p);Q(g)&&(Ut===null&&(Ut=g.getFormat()),Ft===""&&(Ft=g.getStyle()))}else{const f=qs(i,Rr),p=qs(o,Ot);if(f.length!==u&&K(227),p.length!==c&&K(228),u===0)c!==0&&ro(p,o,0,c-1,l);else if(c===0){if(u!==0){const g=l.after==null&&l.before==null&&l.element.__lexicalLineBreak==null;to(f,0,u-1,g?null:d),g&&(d.textContent="")}}else(function(g,m,x,_,y,v){const C=_-1,D=y-1;let S,w,E=v.getFirstChild(),R=0,T=0;for(;R<=C&&T<=D;){const j=m[R],k=x[T];if(j===k)E=Fi(vn(k,v.element)),R++,T++;else{S===void 0&&(S=new Set(m)),w===void 0&&(w=new Set(x));const F=w.has(j),O=S.has(k);if(F)if(O){const V=Is(gt,k);V===E?E=Fi(vn(k,v.element)):(v.withBefore(E).insertChild(V),vn(k,v.element)),R++,T++}else $s(k,v.withBefore(E)),T++;else E=Fi(no(j)),zs(j,v.element),R++}const N=Ot.get(k);N!==null&&Q(N)&&(Ut===null&&(Ut=N.getFormat()),Ft===""&&(Ft=N.getStyle()))}const B=R>C,M=T>D;if(B&&!M){const j=x[D+1],k=j===void 0?null:gt.getElementByKey(j);ro(x,g,T,D,v.withBefore(k))}else M&&!B&&to(m,R,C,v.element)})(o,f,p,u,c,l)}ci(o)&&(it+=sr),d.__lexicalTextContent=it,it=a+it}(r,e,e.getDOMSlot(t)),Vu(e,t),tn(s=e)&&Ut!=null&&Ut!==s.__textFormat&&!zn&&(s.setTextFormat(Ut),s.setTextStyle(Ft)),function(i){tn(i)&&Ft!==""&&Ft!==i.__textStyle&&!zn&&i.setTextStyle(Ft)}(e),ht=n}function qs(r,e){const t=[];let n=r.__first;for(;n!==null;){const s=e.get(n);s===void 0&&K(101),t.push(n),n=s.__next}return t}function vn(r,e){const t=Rr.get(r);let n=Ot.get(r);t!==void 0&&n!==void 0||K(61);const s=qu||Zi.has(r)||Ji.has(r),i=Is(gt,r);if(t===n&&!s){if(I(t)){const o=i.__lexicalTextContent;o!==void 0&&(it+=o,rr+=o);const l=i.__lexicalDirTextContent;l!==void 0&&(ht+=l)}else{const o=t.getTextContent();Q(t)&&!t.isDirectionless()&&(ht+=o),rr+=o,it+=o}return i}if(t!==n&&s&&Yo(On,In,fi,n,"updated"),n.updateDOM(t,i,yr)){const o=$s(r,null);return e===null&&K(62),e.replaceChild(o,i),zs(r,null),o}if(I(t)&&I(n)){const o=n.__indent;o!==t.__indent&&Uu(i,o);const l=n.__format;l!==t.__format&&Wu(i,l),s&&(vh(t,n,i),pt(n)||n.isInline()||Hu(t,n,i)),ci(n)&&(it+=sr,rr+=sr)}else{const o=n.getTextContent();if(ze(n)){const l=n.decorate(gt,yr);l!==null&&Gu(r,l)}else Q(n)&&!n.isDirectionless()&&(ht+=o);it+=o,rr+=o}if(!zn&&pt(n)&&n.__cachedText!==rr){const o=n.getWritable();o.__cachedText=rr,n=o}return i}function Gu(r,e){let t=gt._pendingDecorators;const n=gt._decorators;if(t===null){if(n[r]===e)return;t=ju(gt)}t[r]=e}function Fi(r){let e=r.nextSibling;return e!==null&&e===gt._blockCursorElement&&(e=e.nextSibling),e}function wh(r,e,t,n,s,i){it="",rr="",ht="",qu=n===Zr,vs=null,gt=t,yr=t._config,In=t._nodes,fi=gt._listeners.mutation,Ji=s,Zi=i,Rr=r._nodeMap,Ot=e._nodeMap,zn=e._readOnly,eo=new Map(t._keyToDOMMap);const o=new Map;return On=o,vn("root",null),gt=void 0,In=void 0,Ji=void 0,Zi=void 0,Rr=void 0,Ot=void 0,yr=void 0,eo=void 0,On=void 0,o}function no(r){const e=eo.get(r);return e===void 0&&K(75,r),e}const er=Object.freeze({}),so=30,io=[["keydown",function(r,e){if(Bn=r.timeStamp,Ku=r.key,e.isComposing())return;const{key:t,shiftKey:n,ctrlKey:s,metaKey:i,altKey:o}=r;if(!re(e,Df,r)&&t!=null){if(function(l,a,u,c){return ja(l)&&!a&&!c&&!u}(t,s,o,i))re(e,pu,r);else if(function(l,a,u,c,d){return ja(l)&&!c&&!u&&(a||d)}(t,s,n,o,i))re(e,Af,r);else if(function(l,a,u,c){return Fa(l)&&!a&&!c&&!u}(t,s,o,i))re(e,gu,r);else if(function(l,a,u,c,d){return Fa(l)&&!c&&!u&&(a||d)}(t,s,n,o,i))re(e,Tf,r);else if(function(l,a,u){return function(c){return c==="ArrowUp"}(l)&&!a&&!u}(t,s,i))re(e,mu,r);else if(function(l,a,u){return function(c){return c==="ArrowDown"}(l)&&!a&&!u}(t,s,i))re(e,yu,r);else if(function(l,a){return La(l)&&a}(t,n))Nn=!0,re(e,Bs,r);else if(function(l){return l===" "}(t))re(e,Bf,r);else if(function(l,a){return Mt&&a&&l.toLowerCase()==="o"}(t,s))r.preventDefault(),Nn=!0,re(e,Kr,!0);else if(function(l,a){return La(l)&&!a}(t,n))Nn=!1,re(e,Bs,r);else if(function(l,a,u,c){return Mt?!a&&!u&&(fn(l)||l.toLowerCase()==="h"&&c):!(c||a||u)&&fn(l)}(t,o,i,s))fn(t)?re(e,xu,r):(r.preventDefault(),re(e,Er,!0));else if(function(l){return l==="Escape"}(t))re(e,bu,r);else if(function(l,a,u,c,d){return Mt?!(u||c||d)&&(hn(l)||l.toLowerCase()==="d"&&a):!(a||c||d)&&hn(l)}(t,s,n,o,i))hn(t)?re(e,_u,r):(r.preventDefault(),re(e,Er,!1));else if(function(l,a,u){return fn(l)&&(Mt?a:u)}(t,o,s))r.preventDefault(),re(e,jn,!0);else if(function(l,a,u){return hn(l)&&(Mt?a:u)}(t,o,s))r.preventDefault(),re(e,jn,!1);else if(function(l,a){return Mt&&a&&fn(l)}(t,i))r.preventDefault(),re(e,Ln,!0);else if(function(l,a){return Mt&&a&&hn(l)}(t,i))r.preventDefault(),re(e,Ln,!1);else if(function(l,a,u,c){return l.toLowerCase()==="b"&&!a&&_n(u,c)}(t,o,i,s))r.preventDefault(),re(e,It,"bold");else if(function(l,a,u,c){return l.toLowerCase()==="u"&&!a&&_n(u,c)}(t,o,i,s))r.preventDefault(),re(e,It,"underline");else if(function(l,a,u,c){return l.toLowerCase()==="i"&&!a&&_n(u,c)}(t,o,i,s))r.preventDefault(),re(e,It,"italic");else if(function(l,a,u,c){return l==="Tab"&&!a&&!u&&!c}(t,o,s,i))re(e,Nf,r);else if(function(l,a,u,c){return l.toLowerCase()==="z"&&!a&&_n(u,c)}(t,n,i,s))r.preventDefault(),re(e,Ro,void 0);else if(function(l,a,u,c){return Mt?l.toLowerCase()==="z"&&u&&a:l.toLowerCase()==="y"&&c||l.toLowerCase()==="z"&&c&&a}(t,n,i,s))r.preventDefault(),re(e,Mo,void 0);else{const l=e._editorState._selection;l===null||H(l)?!mr&&Pa(t,i,s)&&(r.preventDefault(),re(e,Yi,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="c"&&(Mt?c:d)}(t,n,i,s)?(r.preventDefault(),re(e,ii,r)):function(a,u,c,d){return!u&&a.toLowerCase()==="x"&&(Mt?c:d)}(t,n,i,s)?(r.preventDefault(),re(e,Fo,r)):Pa(t,i,s)&&(r.preventDefault(),re(e,Yi,r))}(function(l,a,u,c){return l||a||u||c})(s,n,o,i)&&re(e,zf,r)}}],["pointerdown",function(r,e){const t=r.target,n=r.pointerType;t instanceof Node&&n!=="touch"&&kt(e,()=>{ze(en(t))||(ao=!0)})}],["compositionstart",function(r,e){kt(e,()=>{const t=oe();if(H(t)&&!e.isComposing()){const n=t.anchor,s=t.anchor.getNode();lt(n.key),(r.timeStamp<Bn+so||n.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||Q(s)&&s.getStyle()!==t.style)&&re(e,Yr,Kf)}})}],["compositionend",function(r,e){mr?gn=!0:kt(e,()=>{ji(e,r.data)})}],["input",function(r,e){r.stopPropagation(),kt(e,()=>{const t=oe(),n=r.data,s=Ju(r);if(n!=null&&H(t)&&Xu(t,s,n,r.timeStamp,!1)){gn&&(ji(e,n),gn=!1);const i=t.anchor.getNode(),o=Bt(e._window);if(o===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,u=l?t.focus.offset:t.anchor.offset;Ns&&!t.isCollapsed()&&Q(i)&&o.anchorNode!==null&&i.getTextContent().slice(0,a)+n+i.getTextContent().slice(a+u)===Ou(o.anchorNode)||re(e,Yr,n);const c=n.length;mr&&c>1&&r.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),oi||Vn||jo||!e.isComposing()||(Bn=0,lt(null))}else Go(!1,e,n!==null?n:void 0),gn&&(ji(e,n||void 0),gn=!1);vt(),Tu(Qe())}),Wr=null}],["click",function(r,e){kt(e,()=>{const t=oe(),n=Bt(e._window),s=Zn();if(n){if(H(t)){const i=t.anchor,o=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!pt(o)&&Ge().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s)?(n.removeAllRanges(),t.dirty=!0):r.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()&&(I(o)?o.select(0):o.getParentOrThrow().select(0))}else if(r.pointerType==="touch"){const i=n.anchorNode;if(i!==null){const o=i.nodeType;(o===Gn||o===xr)&&Kt(ea(s,n,e,r))}}}re(e,hu,r)})}],["cut",er],["copy",er],["dragstart",er],["dragover",er],["dragend",er],["paste",er],["focus",er],["blur",er],["drop",er]];Ns&&io.push(["beforeinput",(r,e)=>function(t,n){const s=t.inputType,i=Ju(t);s==="deleteCompositionText"||mr&&zu(n)||s!=="insertCompositionText"&&kt(n,()=>{const o=oe();if(s==="deleteContentBackward"){if(o===null){const p=Zn();if(!H(p))return;Kt(p.clone())}if(H(o)){const p=o.anchor.key===o.focus.key;if(l=t.timeStamp,Ku==="MediaLast"&&l<Bn+so&&n.isComposing()&&p){if(lt(null),Bn=0,setTimeout(()=>{kt(n,()=>{lt(null)})},so),H(o)){const g=o.anchor.getNode();g.markDirty(),o.format=g.getFormat(),Q(g)||K(142),o.style=g.getStyle()}}else{lt(null),t.preventDefault();const g=o.anchor.getNode(),m=g.getTextContent(),x=g.canInsertTextAfter(),_=o.anchor.offset===0&&o.focus.offset===m.length;Uf&&p&&!_&&x||re(n,Er,!0)}return}}var l;if(!H(o))return;const a=t.data;Wr!==null&&Go(!1,n,Wr),o.dirty&&Wr===null||!o.isCollapsed()||pt(o.anchor.getNode())||i===null||o.applyDOMRange(i),Wr=null;const u=o.anchor,c=o.focus,d=u.getNode(),f=c.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(t.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":re(n,Yr,t);break;case"insertFromComposition":lt(null),re(n,Yr,t);break;case"insertLineBreak":lt(null),re(n,Kr,!1);break;case"insertParagraph":lt(null),Nn&&!Vn?(Nn=!1,re(n,Kr,!1)):re(n,Fn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":re(n,si,t);break;case"deleteByComposition":(function(p,g){return p!==g||I(p)||I(g)||!p.isToken()||!g.isToken()})(d,f)&&re(n,Ki,t);break;case"deleteByDrag":case"deleteByCut":re(n,Ki,t);break;case"deleteContent":re(n,Er,!1);break;case"deleteWordBackward":re(n,jn,!0);break;case"deleteWordForward":re(n,jn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":re(n,Ln,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":re(n,Ln,!1);break;case"formatStrikeThrough":re(n,It,"strikethrough");break;case"formatBold":re(n,It,"bold");break;case"formatItalic":re(n,It,"italic");break;case"formatUnderline":re(n,It,"underline");break;case"historyUndo":re(n,Ro,void 0);break;case"historyRedo":re(n,Mo,void 0)}else{if(a===`
|
|
86
86
|
`)t.preventDefault(),re(n,Kr,!1);else if(a===sr)t.preventDefault(),re(n,Fn,void 0);else if(a==null&&t.dataTransfer){const p=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(p)}else a!=null&&Xu(o,i,a,t.timeStamp,!0)?(t.preventDefault(),re(n,Yr,a)):Wr=a;Yu=t.timeStamp}})}(r,e)]);let Bn=0,Ku=null,Yu=0,Wr=null;const Us=new WeakMap;let oo=!1,ao=!1,Nn=!1,gn=!1,Qu=[0,"",0,"root",0];function Xu(r,e,t,n,s){const i=r.anchor,o=r.focus,l=i.getNode(),a=Qe(),u=Bt(a._window),c=u!==null?u.anchorNode:null,d=i.key,f=a.getElementByKey(d),p=t.length;return d!==o.key||!Q(l)||(!s&&(!Ns||Yu<n+50)||l.isDirty()&&p<2||Pu(t))&&i.offset!==o.offset&&!l.isComposing()||Cr(l)||l.isDirty()&&p>1||(s||!Ns)&&f!==null&&!l.isComposing()&&c!==js(f)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||l.getFormat()!==r.format||l.getStyle()!==r.style||dh(r,l)}function qa(r,e){return r!==null&&r.nodeValue!==null&&r.nodeType===xr&&e!==0&&e!==r.nodeValue.length}function Ua(r,e,t){const{anchorNode:n,anchorOffset:s,focusNode:i,focusOffset:o}=r;oo&&(oo=!1,qa(n,s)&&qa(i,o))||kt(e,()=>{if(!t)return void Kt(null);if(!Kn(e,n,i))return;const l=oe();if(H(l)){const a=l.anchor,u=a.getNode();if(l.isCollapsed()){r.type==="Range"&&r.anchorNode===r.focusNode&&(l.dirty=!0);const c=di(e).event,d=c?c.timeStamp:performance.now(),[f,p,g,m,x]=Qu,_=Ge(),y=e.isComposing()===!1&&_.getTextContent()==="";if(d<x+200&&a.offset===g&&a.key===m)l.format=f,l.style=p;else if(a.type==="text")Q(u)||K(141),l.format=u.getFormat(),l.style=u.getStyle();else if(a.type==="element"&&!y){const v=a.getNode();l.style="",v instanceof on&&v.getChildrenSize()===0?(l.format=v.getTextFormat(),l.style=v.getTextStyle()):l.format=0}}else{const c=a.key,d=l.focus.key,f=l.getNodes(),p=f.length,g=l.isBackward(),m=g?o:s,x=g?s:o,_=g?d:c,y=g?c:d;let v=Gf,C=!1;for(let D=0;D<p;D++){const S=f[D],w=S.getTextContentSize();if(Q(S)&&w!==0&&!(D===0&&S.__key===_&&m===w||D===p-1&&S.__key===y&&x===0)&&(C=!0,v&=S.getFormat(),v===0))break}l.format=C?v:0}}re(e,No,void 0)})}function Ju(r){if(!r.getTargetRanges)return null;const e=r.getTargetRanges();return e.length===0?null:e[0]}function ji(r,e){const t=r._compositionKey;if(lt(null),t!==null&&e!=null){if(e===""){const n=dt(t),s=js(r.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&Q(n)&&Ko(n,s.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
package/dist/index.esm.js
CHANGED
|
@@ -6609,9 +6609,9 @@ function Sy({
|
|
|
6609
6609
|
] }) });
|
|
6610
6610
|
}
|
|
6611
6611
|
const sf = {
|
|
6612
|
-
small: "w-32 h-32",
|
|
6613
|
-
medium: "w-48 h-48",
|
|
6614
|
-
large: "w-64 h-64"
|
|
6612
|
+
small: "w-24 h-24 sm:w-28 sm:h-28 md:w-32 md:h-32",
|
|
6613
|
+
medium: "w-32 h-32 sm:w-40 sm:h-40 md:w-48 md:h-48",
|
|
6614
|
+
large: "w-40 h-40 sm:w-56 sm:h-56 md:w-64 md:h-64 lg:w-72 lg:h-72"
|
|
6615
6615
|
};
|
|
6616
6616
|
function of(r) {
|
|
6617
6617
|
const e = [...r];
|
|
@@ -6669,7 +6669,7 @@ function ky({
|
|
|
6669
6669
|
className: `relative ${sf[i]}`,
|
|
6670
6670
|
style: { perspective: "1000px" },
|
|
6671
6671
|
onClick: () => n == null ? void 0 : n(E),
|
|
6672
|
-
children: /* @__PURE__ */ h.
|
|
6672
|
+
children: /* @__PURE__ */ h.jsxs(
|
|
6673
6673
|
"div",
|
|
6674
6674
|
{
|
|
6675
6675
|
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
@@ -6678,10 +6678,31 @@ function ky({
|
|
|
6678
6678
|
transition: "transform 0.5s ease-in-out",
|
|
6679
6679
|
transformStyle: "preserve-3d"
|
|
6680
6680
|
},
|
|
6681
|
-
children:
|
|
6682
|
-
/* @__PURE__ */ h.jsx(
|
|
6683
|
-
|
|
6684
|
-
|
|
6681
|
+
children: [
|
|
6682
|
+
/* @__PURE__ */ h.jsx(
|
|
6683
|
+
"img",
|
|
6684
|
+
{
|
|
6685
|
+
src: E.data.image,
|
|
6686
|
+
alt: E.title,
|
|
6687
|
+
className: "w-full h-full object-cover",
|
|
6688
|
+
style: {
|
|
6689
|
+
transform: A ? "scaleX(-1)" : "none",
|
|
6690
|
+
transformOrigin: "center"
|
|
6691
|
+
}
|
|
6692
|
+
}
|
|
6693
|
+
),
|
|
6694
|
+
/* @__PURE__ */ h.jsx(
|
|
6695
|
+
"div",
|
|
6696
|
+
{
|
|
6697
|
+
className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2",
|
|
6698
|
+
style: {
|
|
6699
|
+
transform: A ? "scaleX(-1)" : "none",
|
|
6700
|
+
transformOrigin: "center"
|
|
6701
|
+
},
|
|
6702
|
+
children: /* @__PURE__ */ h.jsx("p", { className: "text-white text-sm font-medium truncate", children: E.title })
|
|
6703
|
+
}
|
|
6704
|
+
)
|
|
6705
|
+
]
|
|
6685
6706
|
}
|
|
6686
6707
|
)
|
|
6687
6708
|
}
|
package/package.json
CHANGED