Files
Gnuboard7/templates/_bundled/sirsoft-basic/dist/js/components.iife.js
T
2026-04-21 12:50:07 +09:00

88 lines
330 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var SirsoftBasic=(function(R,d,x,Jt){"use strict";function pc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const _=pc(x),mc=()=>window.G7Core,Q=x.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=mc()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return d.jsx("button",{ref:a,className:l,...o,children:e})});Q.displayName="Button";const j=x.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("div",{ref:n,className:t,...r,children:e})),re=({children:e,className:t="",...r})=>d.jsx("span",{className:t,...r,children:e}),cn=({children:e,className:t="",...r})=>d.jsx("svg",{className:t,...r,children:e}),vt=x.forwardRef(({label:e,error:t,className:r="",onChange:n,onKeyPress:o,value:a,defaultValue:s,type:l="text",checked:f,defaultChecked:g,...c},i)=>{const u=l==="radio"||l==="checkbox",h=x.useRef(!1),p=x.useRef(null);x.useImperativeHandle(i,()=>p.current);const[y,w]=x.useState(a??s??"");x.useEffect(()=>{!u&&!h.current&&a!==void 0&&w(a)},[a,u]);const b=x.useCallback(()=>{h.current=!0},[]),I=x.useCallback(v=>{if(h.current=!1,n){const D=v.target.value;w(D);const A=new Event("change",{bubbles:!0});Object.defineProperty(A,"target",{writable:!1,value:{value:D}}),Object.defineProperty(A,"currentTarget",{writable:!1,value:{value:D}}),n(A)}},[n]),S=x.useCallback(v=>{const D=v.target.value;w(D),!h.current&&n&&n(v)},[n]),M=x.useCallback(v=>{h.current||o&&o(v)},[o]),{loadingactions:L,formdata:E,...T}=c;if(u)return d.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:g,value:a,...T});const m=a!==void 0?{value:y}:{defaultValue:s};return d.jsx("input",{ref:p,type:l,className:r,onChange:S,onKeyPress:M,onCompositionStart:b,onCompositionEnd:I,...m,...T})});vt.displayName="Input";const Oa=x.forwardRef(({accept:e,maxSize:t,onChange:r,onError:n,buttonText:o="Browse",placeholder:a="No file selected",className:s="",disabled:l,...f},g)=>{const c=x.useRef(null),i=g||c,[u,h]=x.useState(""),p=x.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),y=x.useCallback(b=>{const I=b.target.files?.[0]||null;if(!I){h(""),r?.(null);return}if(t&&I.size>t*1024*1024){const S=`File size exceeds ${t}MB limit`;n?.(S),i.current&&(i.current.value=""),h("");return}h(I.name),r?.(I)},[t,r,n,i]),w=x.useCallback(b=>{b.stopPropagation(),i.current&&(i.current.value=""),h(""),r?.(null)},[r,i]);return d.jsxs(j,{className:`flex items-center gap-2 ${s}`,children:[d.jsx(vt,{ref:i,type:"file",accept:e,onChange:y,disabled:l,className:"hidden",...f}),d.jsx(Q,{type:"button",onClick:p,disabled:l,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:o}),d.jsx(re,{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:u||a}),u&&!l&&d.jsx(Q,{type:"button",onClick:w,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:d.jsx(cn,{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});Oa.displayName="FileInput";var Je=(e=>(e.User="fa-user",e.Users="fa-users",e.UserCircle="fa-user-circle",e.UserPlus="fa-user-plus",e.UserMinus="fa-user-minus",e.UserShield="fa-user-shield",e.Search="fa-search",e.Edit="fa-edit",e.Pencil="fa-pencil-alt",e.Trash="fa-trash",e.Save="fa-save",e.Plus="fa-plus",e.Minus="fa-minus",e.Check="fa-check",e.Times="fa-times",e.Download="fa-download",e.Upload="fa-upload",e.Copy="fa-copy",e.ExternalLink="fa-external-link-alt",e.Home="fa-home",e.ChevronLeft="fa-chevron-left",e.ChevronRight="fa-chevron-right",e.ChevronUp="fa-chevron-up",e.ChevronDown="fa-chevron-down",e.AngleLeft="fa-angle-left",e.AngleRight="fa-angle-right",e.AngleUp="fa-angle-up",e.AngleDown="fa-angle-down",e.ArrowUp="fa-arrow-up",e.ArrowDown="fa-arrow-down",e.ArrowLeft="fa-arrow-left",e.ArrowRight="fa-arrow-right",e.Bars="fa-bars",e.EllipsisVertical="fa-ellipsis-v",e.EllipsisHorizontal="fa-ellipsis-h",e.CheckCircle="fa-check-circle",e.TimesCircle="fa-times-circle",e.ExclamationCircle="fa-exclamation-circle",e.ExclamationTriangle="fa-exclamation-triangle",e.InfoCircle="fa-info-circle",e.QuestionCircle="fa-question-circle",e.XCircle="fa-times-circle",e.ShoppingCart="fa-shopping-cart",e.ShoppingBag="fa-shopping-bag",e.CreditCard="fa-credit-card",e.Tag="fa-tag",e.Tags="fa-tags",e.File="fa-file",e.FileAlt="fa-file-alt",e.Folder="fa-folder",e.FolderOpen="fa-folder-open",e.Envelope="fa-envelope",e.Phone="fa-phone",e.Comment="fa-comment",e.Comments="fa-comments",e.Cog="fa-cog",e.Cogs="fa-cogs",e.Settings="fa-cog",e.Wrench="fa-wrench",e.Sliders="fa-sliders-h",e.Image="fa-image",e.Images="fa-images",e.Video="fa-video",e.Camera="fa-camera",e.Heart="fa-heart",e.Star="fa-star",e.ThumbsUp="fa-thumbs-up",e.ThumbsDown="fa-thumbs-down",e.Share="fa-share",e.Clock="fa-clock",e.Calendar="fa-calendar",e.CalendarAlt="fa-calendar-alt",e.Lock="fa-lock",e.Unlock="fa-unlock",e.Eye="fa-eye",e.EyeSlash="fa-eye-slash",e.Bell="fa-bell",e.Flag="fa-flag",e.Map="fa-map",e.MapMarker="fa-map-marker-alt",e.Globe="fa-globe",e.Link="fa-link",e.Unlink="fa-unlink",e.Sun="fa-sun",e.Moon="fa-moon",e.ChartBar="fa-chart-bar",e.ChartLine="fa-chart-line",e.ChartPie="fa-chart-pie",e.ChartArea="fa-chart-area",e.Spinner="fa-spinner",e.CircleNotch="fa-circle-notch",e.CheckBadge="fa-badge-check",e.BellSlash="fa-bell-slash",e.BookOpen="fa-book-open",e.Building="fa-building",e.FileCircleCheck="fa-file-circle-check",e.WandMagicSparkles="fa-wand-magic-sparkles",e.UserXmark="fa-user-xmark",e.Cube="fa-cube",e.Cubes="fa-cubes",e.Plug="fa-plug",e.PuzzlePiece="fa-puzzle-piece",e.Fire="fa-fire",e.CommentDots="fa-comment-dots",e.DollarSign="fa-dollar-sign",e.Bars2="fa-bars",e.X="fa-times",e.List="fa-list",e.ThLarge="fa-th-large",e.Inbox="fa-inbox",e.Box="fa-box",e.PaperPlane="fa-paper-plane",e.FileText="fa-file-alt",e.Paperclip="fa-paperclip",e.Truck="fa-truck",e.Sync="fa-sync",e.RotateLeft="fa-rotate-left",e.MapPin="fa-map-marker-alt",e.HelpCircle="fa-question-circle",e))(Je||{});const bc={user:"fa-user",users:"fa-users","user-circle":"fa-user-circle","user-plus":"fa-user-plus","user-minus":"fa-user-minus","user-shield":"fa-user-shield",search:"fa-search",edit:"fa-edit",pencil:"fa-pencil-alt",trash:"fa-trash",save:"fa-save",plus:"fa-plus",minus:"fa-minus",check:"fa-check",times:"fa-times",download:"fa-download",upload:"fa-upload",copy:"fa-copy","external-link":"fa-external-link-alt",home:"fa-home","chevron-left":"fa-chevron-left","chevron-right":"fa-chevron-right","chevron-up":"fa-chevron-up","chevron-down":"fa-chevron-down","angle-left":"fa-angle-left","angle-right":"fa-angle-right","angle-up":"fa-angle-up","angle-down":"fa-angle-down","arrow-up":"fa-arrow-up","arrow-down":"fa-arrow-down","arrow-left":"fa-arrow-left","arrow-right":"fa-arrow-right",bars:"fa-bars","ellipsis-vertical":"fa-ellipsis-v","ellipsis-v":"fa-ellipsis-v","ellipsis-horizontal":"fa-ellipsis-h","ellipsis-h":"fa-ellipsis-h","check-circle":"fa-check-circle","times-circle":"fa-times-circle","x-circle":"fa-times-circle","exclamation-circle":"fa-exclamation-circle","exclamation-triangle":"fa-exclamation-triangle","info-circle":"fa-info-circle","question-circle":"fa-question-circle","shopping-cart":"fa-shopping-cart","shopping-bag":"fa-shopping-bag","credit-card":"fa-credit-card",tag:"fa-tag",tags:"fa-tags",file:"fa-file","file-alt":"fa-file-alt",folder:"fa-folder","folder-open":"fa-folder-open",envelope:"fa-envelope",phone:"fa-phone",comment:"fa-comment",comments:"fa-comments",cog:"fa-cog",cogs:"fa-cogs",settings:"fa-cog",wrench:"fa-wrench",sliders:"fa-sliders-h",image:"fa-image",images:"fa-images",video:"fa-video",camera:"fa-camera",heart:"fa-heart",star:"fa-star","thumbs-up":"fa-thumbs-up","thumbs-down":"fa-thumbs-down",share:"fa-share",clock:"fa-clock",calendar:"fa-calendar","calendar-alt":"fa-calendar-alt",lock:"fa-lock",unlock:"fa-unlock",eye:"fa-eye","eye-slash":"fa-eye-slash",bell:"fa-bell",flag:"fa-flag",map:"fa-map","map-marker":"fa-map-marker-alt",globe:"fa-globe",link:"fa-link",unlink:"fa-unlink",sun:"fa-sun",moon:"fa-moon","chart-bar":"fa-chart-bar","chart-line":"fa-chart-line","chart-pie":"fa-chart-pie","chart-area":"fa-chart-area",spinner:"fa-spinner","circle-notch":"fa-circle-notch","check-badge":"fa-badge-check","badge-check":"fa-badge-check",cube:"fa-cube",cubes:"fa-cubes",plug:"fa-plug","puzzle-piece":"fa-puzzle-piece",flame:"fa-fire",fire:"fa-fire","message-square":"fa-comment-dots","dollar-sign":"fa-dollar-sign",menu:"fa-bars",x:"fa-times",list:"fa-list","layout-grid":"fa-th-large","th-large":"fa-th-large",grid:"fa-th-large",inbox:"fa-inbox",package:"fa-box",box:"fa-box",send:"fa-paper-plane","paper-plane":"fa-paper-plane","file-text":"fa-file-alt",paperclip:"fa-paperclip",truck:"fa-truck","refresh-cw":"fa-sync",sync:"fa-sync","undo-2":"fa-rotate-left","rotate-left":"fa-rotate-left","map-pin":"fa-map-marker-alt","help-circle":"fa-question-circle","alert-triangle":"fa-exclamation-triangle","bell-off":"fa-bell-slash","book-open":"fa-book-open",building:"fa-building","edit-2":"fa-edit","edit-3":"fa-edit","file-check":"fa-file-circle-check",mail:"fa-envelope",sparkles:"fa-wand-magic-sparkles","trash-2":"fa-trash","user-x":"fa-user-xmark"},ue=({name:e,iconStyle:t="solid",size:r,color:n,spin:o=!1,pulse:a=!1,fixedWidth:s=!1,ariaLabel:l,className:f="",style:g,...c})=>{const i={solid:"fas",regular:"far",light:"fal",duotone:"fad",brands:"fab"},u=typeof e=="string"?e:String(e),h=bc[u],p=h?String(h).replace(/^fa-/,""):u.replace(/^fa-/,""),y=[i[t],`fa-${p}`,r&&`fa-${r}`,o&&"fa-spin",a&&"fa-pulse",s&&"fa-fw",n,f].filter(Boolean).join(" "),w=l||p.replace(/-/g," ");return d.jsx("i",{className:y,style:g,"aria-label":w,role:"img",...c})},mr=(e,t)=>window.G7Core?.t?.(e,t)??e,Qn={minLength:{key:"minLength",labelKey:"auth.password_input.rules.minLength",defaultParam:6,validate:(e,t=6)=>e.length>=t},maxLength:{key:"maxLength",labelKey:"auth.password_input.rules.maxLength",defaultParam:20,validate:(e,t=20)=>e.length<=t},hasUppercase:{key:"hasUppercase",labelKey:"auth.password_input.rules.hasUppercase",validate:e=>/[A-Z]/.test(e)},hasLowercase:{key:"hasLowercase",labelKey:"auth.password_input.rules.hasLowercase",validate:e=>/[a-z]/.test(e)},hasNumber:{key:"hasNumber",labelKey:"auth.password_input.rules.hasNumber",validate:e=>/[0-9]/.test(e)},hasSpecial:{key:"hasSpecial",labelKey:"auth.password_input.rules.hasSpecial",validate:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)},noSpaces:{key:"noSpaces",labelKey:"auth.password_input.rules.noSpaces",validate:e=>!/\s/.test(e)},minTypes:{key:"minTypes",labelKey:"auth.password_input.rules.minTypes",defaultParam:3,validate:(e,t=3)=>{let r=0;return/[A-Z]/.test(e)&&r++,/[a-z]/.test(e)&&r++,/[0-9]/.test(e)&&r++,/[!@#$%^&*(),.?":{}|<>]/.test(e)&&r++,r>=t}}},Da=[Qn.minLength];function yc(e){const[t,r]=e.split(":"),n=Qn[t];if(!n)return null;const o=r?parseInt(r,10):n.defaultParam;return{rule:n,param:isNaN(o)?n.defaultParam:o}}const Ia=x.forwardRef(({label:e,error:t,showToggle:r=!0,showValidation:n=!1,isConfirmField:o=!1,confirmTarget:a,onMatchChange:s,onValidityChange:l,rules:f,enableRules:g,showRules:c,wrapperClassName:i="",validationClassName:u="",className:h="",onChange:p,value:y,defaultValue:w,disabled:b,...I},S)=>{const M=x.useRef(null);x.useImperativeHandle(S,()=>M.current);const[L,E]=x.useState(!1),[T,m]=x.useState(!1),[v,D]=x.useState(y??w??"");x.useEffect(()=>{y!==void 0&&D(y)},[y]);const A=x.useMemo(()=>f&&f.length>0?f.map(z=>({rule:z,param:z.defaultParam})):g&&g.length>0?g.map(z=>yc(z)).filter(z=>z!==null):Da.map(z=>({rule:z,param:z.defaultParam})),[f,g]),F=x.useMemo(()=>!c||c.length===0?A:A.filter(z=>c.includes(z.rule.key)),[A,c]),P=x.useMemo(()=>!n||o?{}:F.reduce((z,{rule:W,param:V})=>(z[W.key]=W.validate(v,V),z),{}),[v,F,n,o]),O=x.useMemo(()=>!o||a===void 0?!0:v===a&&v.length>0,[o,v,a]),N=x.useMemo(()=>n?Object.values(P).every(z=>z):!0,[P,n]);x.useEffect(()=>{if(l&&n&&!o){const z=Object.entries(P).filter(([,W])=>!W).map(([W])=>W);l(N,z)}},[N,P,l,n,o]),x.useEffect(()=>{s&&o&&s(O)},[O,s,o]);const C=x.useCallback(()=>{E(z=>!z)},[]),k=x.useCallback(z=>{const W=z.target.value;D(W),p&&p(z)},[p]),U=x.useCallback(z=>{m(z.getModifierState("CapsLock"))},[]),{loadingactions:$,formdata:G,...K}=I;return d.jsxs("div",{className:`relative ${i}`,children:[d.jsxs("div",{className:"relative",children:[d.jsx("input",{ref:M,type:L?"text":"password",className:`${h} ${r?"pr-10":""}`,value:y!==void 0?y:void 0,defaultValue:y===void 0?w:void 0,onChange:k,onKeyDown:U,onKeyUp:U,disabled:b,...K}),r&&d.jsx("button",{type:"button",onClick:C,disabled:b,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 disabled:opacity-50 disabled:cursor-not-allowed dark:disabled:opacity-50","aria-label":mr(L?"auth.password_input.hide":"auth.password_input.show"),children:d.jsx(ue,{name:L?"eye-slash":"eye",className:"w-5 h-5"})})]}),T&&!L&&d.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-sm text-yellow-600 dark:text-yellow-400",children:[d.jsx(ue,{name:"triangle-exclamation",className:"w-4 h-4"}),d.jsx("span",{children:mr("auth.password_input.caps_lock_on")})]}),o&&a!==void 0&&v.length>0&&d.jsxs("div",{className:`mt-2 flex items-center gap-1.5 text-sm ${O?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[d.jsx(ue,{name:O?"check-circle":"xmark-circle",className:"w-4 h-4"}),d.jsx("span",{children:mr(O?"auth.password_input.match":"auth.password_input.mismatch")})]}),n&&!o&&v.length>0&&d.jsx("div",{className:`mt-2 space-y-1 ${u}`,children:F.map(({rule:z,param:W})=>{const V=P[z.key],B=W!==void 0?{count:W}:void 0;return d.jsxs("div",{className:`flex items-center gap-1.5 text-sm ${V?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400"}`,children:[d.jsx(ue,{name:V?"check-circle":"circle",className:"w-4 h-4"}),d.jsx("span",{children:mr(z.labelKey,B)})]},z.key)})}),t&&d.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:t})]})});Ia.displayName="PasswordInput";const Jn=({label:e,error:t,className:r="",onChange:n,value:o,defaultValue:a,...s})=>{const l=x.useRef(!1),f=x.useRef(null),[g,c]=x.useState(o??a??"");x.useEffect(()=>{!l.current&&o!==void 0&&c(o)},[o]);const i=x.useCallback(()=>{l.current=!0},[]),u=x.useCallback(I=>{if(l.current=!1,n){const S=I.target.value;c(S);const M=new Event("change",{bubbles:!0});Object.defineProperty(M,"target",{writable:!1,value:{value:S}}),Object.defineProperty(M,"currentTarget",{writable:!1,value:{value:S}}),n(M)}},[n]),h=x.useCallback(I=>{const S=I.target.value;c(S),!l.current&&n&&n(I)},[n]),{loadingactions:p,formdata:y,...w}=s,b=o!==void 0?{value:g}:{defaultValue:a};return d.jsx("textarea",{ref:f,className:r,onChange:h,onCompositionStart:i,onCompositionEnd:u,...b,...w})},br=({children:e,className:t="",...r})=>d.jsx("label",{className:t,...r,children:e}),It=({children:e,className:t="",...r})=>d.jsx("p",{className:t,...r,children:e}),Wt=({className:e="",alt:t="",...r})=>d.jsx("img",{className:e,alt:t,...r}),vc=({children:e,className:t="",...r})=>d.jsx("h1",{className:t,...r,children:e}),Pa=({children:e,className:t="",...r})=>d.jsx("h2",{className:t,...r,children:e}),dn=({children:e,className:t="",...r})=>d.jsx("h3",{className:t,...r,children:e}),La=({children:e,className:t="",...r})=>d.jsx("h4",{className:t,...r,children:e}),Rn=({children:e,className:t="",...r})=>d.jsx("ul",{className:t,...r,children:e}),wc=({children:e,className:t="",...r})=>d.jsx("ol",{className:t,...r,children:e}),Xt=({children:e,className:t="",...r})=>d.jsx("li",{className:t,...r,children:e}),eo=({children:e,className:t="",...r})=>d.jsx("a",{className:t,...r,children:e}),to=({children:e,className:t="",...r})=>d.jsx("form",{className:t,...r,children:e}),xc=window.G7Core?.createLogger?.("Comp:Select")??{log:(...e)=>console.log("[Comp:Select]",...e),warn:(...e)=>console.warn("[Comp:Select]",...e),error:(...e)=>console.error("[Comp:Select]",...e)};function kc(e){return{ko:"한국어",en:"English",ja:"日本語",zh:"中文",es:"Español",fr:"Français",de:"Deutsch"}[e]||e}const Fa=({children:e,label:t,error:r,options:n,className:o="",value:a,onChange:s,disabled:l,searchable:f=!1,searchPlaceholder:g,...c})=>{const[i,u]=x.useState(!1),[h,p]=x.useState(""),[y,w]=x.useState(null),b=x.useRef(null),I=x.useRef(null),S=x.useRef(null),M=x.useRef(null),L=x.useMemo(()=>n?Array.isArray(n)?n.length===0?[]:typeof n[0]=="string"?n.map(O=>({value:O,label:kc(O)})):n:(xc.warn("options prop is not an array:",n),null):null,[n]),E=x.useMemo(()=>L&&L.find(N=>String(N.value)===String(a))?.label||"",[L,a]),T=x.useMemo(()=>{if(!L)return null;if(!f||h.trim()==="")return L;const O=h.trim().toLowerCase();return L.filter(N=>N.label.toLowerCase().includes(O)||String(N.value).toLowerCase().includes(O))},[L,f,h]);x.useEffect(()=>{if(i&&f){p("");const O=setTimeout(()=>S.current?.focus(),0);return()=>clearTimeout(O)}i||p("")},[i,f]);const m=x.useCallback(()=>{if(!I.current)return;const O=I.current.getBoundingClientRect(),N=window.innerHeight-O.bottom,k=N<280&&O.top>N;w(k?{bottom:window.innerHeight-O.top+4,left:O.left,width:O.width}:{top:O.bottom+4,left:O.left,width:O.width})},[]);x.useEffect(()=>{if(!i){w(null);return}return m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[i,m]),x.useEffect(()=>{const O=N=>{const C=N.target;b.current&&!b.current.contains(C)&&(!M.current||!M.current.contains(C))&&u(!1)};return i&&document.addEventListener("mousedown",O),()=>{document.removeEventListener("mousedown",O)}},[i]),x.useEffect(()=>{const O=N=>{N.key==="Escape"&&i&&(u(!1),I.current?.focus())};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[i]);const v=()=>{l||u(!i)},D=O=>{s&&s({target:{value:O},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),u(!1),I.current?.focus()};if(!L)return d.jsx("select",{className:o,value:a,onChange:s,disabled:l,...c,children:e});const A=o&&o.includes("bg-"),F=o&&/text-(gray|red|blue|green|yellow|white|black|indigo|purple|pink|orange|amber|emerald|teal|cyan|slate)-\d+|text-white|text-black/.test(o),P=A?`${o}${F?"":" text-gray-700 dark:text-gray-200"}`:`w-full px-4 py-2.5 bg-gray-100 dark:bg-gray-700 border-0 rounded-xl text-gray-700 dark:text-gray-200 font-medium focus:ring-2 focus:ring-blue-500 focus:outline-none ${o}`;return d.jsxs(j,{ref:b,className:"relative",children:[d.jsxs(Q,{ref:I,type:"button",onClick:v,disabled:l,className:`${P} flex items-center justify-between gap-2 text-left cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,"aria-haspopup":"listbox","aria-expanded":i,children:[d.jsx(re,{className:"truncate",children:E||" "}),d.jsx(cn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${i?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),i&&y&&Jt.createPortal(d.jsxs(j,{ref:M,className:"fixed z-[9999] bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",style:{top:y.top,bottom:y.bottom,left:y.left,width:y.width},role:"listbox",children:[f&&d.jsx(j,{className:"p-2 border-b border-gray-200 dark:border-gray-600",children:d.jsx(vt,{ref:S,type:"text",value:h,onChange:O=>p(O.target.value),placeholder:g??"Search...",className:"w-full px-3 py-2 bg-gray-100 dark:bg-gray-700 border-0 rounded-lg text-sm text-gray-700 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:outline-none",role:"searchbox","aria-label":g??"Search"})}),d.jsxs(j,{className:"py-2 max-h-60 overflow-auto",children:[T&&T.length===0&&d.jsx(j,{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400 text-center",children:h?"No results":""}),(T??[]).map(O=>{const N=String(O.value)===String(a);return d.jsxs(Q,{type:"button",onClick:()=>!O.disabled&&D(O.value),disabled:O.disabled,className:`w-full px-4 py-3 text-left flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${N?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-700 dark:text-gray-200"} ${O.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,role:"option","aria-selected":N,children:[d.jsx(re,{children:O.label}),N&&d.jsx(cn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},O.value)})]})]}),document.body)]})},Cc=({children:e,className:t="",...r})=>d.jsx("option",{className:t,...r,children:e}),Sc=({children:e,className:t="",...r})=>d.jsx("optgroup",{className:t,...r,children:e}),Ua=x.forwardRef(({label:e,className:t="",...r},n)=>d.jsx("input",{ref:n,type:"checkbox",className:t,...r}));Ua.displayName="Checkbox";const Ec=({children:e,className:t="",...r})=>d.jsx("table",{className:t,...r,children:e}),_c=({children:e,className:t="",...r})=>d.jsx("thead",{className:t,...r,children:e}),Tc=({children:e,className:t="",...r})=>d.jsx("tbody",{className:t,...r,children:e}),Nc=({children:e,className:t="",...r})=>d.jsx("tr",{className:t,...r,children:e}),Ac=({children:e,className:t="",...r})=>d.jsx("th",{className:t,...r,children:e}),Mc=({children:e,className:t="",...r})=>d.jsx("td",{className:t,...r,children:e}),Lr=x.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("nav",{ref:n,className:t,...r,children:e}));Lr.displayName="Nav";const $a=({children:e,className:t="",...r})=>d.jsx("section",{className:t,...r,children:e}),Oc=({children:e,className:t="",...r})=>d.jsx("code",{className:t,...r,children:e}),za=x.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("footer",{ref:n,className:t,...r,children:e})),Ha=x.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("header",{ref:n,className:t,...r,children:e})),un=x.forwardRef(({className:e="",...t},r)=>d.jsx("hr",{ref:r,className:e,...t})),ja=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,ro=e=>{const t=ja(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},Dc=()=>{const e=localStorage.getItem("g7_color_scheme");return e&&["auto","light","dark"].includes(e)?e:"auto"},fn=({onThemeChange:e,className:t="",autoText:r="System",lightText:n="Light",darkText:o="Dark"})=>{const a=Dc(),[s,l]=x.useState(a),[f,g]=x.useState(!1),c=x.useRef(null);x.useEffect(()=>{ro(s)},[]),x.useEffect(()=>{if(s!=="auto")return;const h=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{ro("auto")};return h.addEventListener("change",p),()=>h.removeEventListener("change",p)},[s]),x.useEffect(()=>{const h=p=>{c.current&&!c.current.contains(p.target)&&g(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);const i=h=>{l(h),localStorage.setItem("g7_color_scheme",h),ro(h),g(!1),e?.(h)},u=()=>ja(s)==="dark"?Je.Moon:Je.Sun;return d.jsxs(j,{ref:c,className:`relative ${t}`,children:[d.jsx(Q,{onClick:()=>g(!f),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors text-gray-600 dark:text-gray-400","aria-label":"Toggle theme",children:d.jsx(ue,{name:u(),className:"w-5 h-5"})}),f&&d.jsx(j,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:d.jsxs(j,{className:"py-2",children:[d.jsxs(Q,{onClick:()=>i("auto"),className:`
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
${s==="auto"?"bg-gray-50 dark:bg-gray-700":""}
`,children:[d.jsx(ue,{name:Je.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(re,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),s==="auto"&&d.jsx(ue,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(Q,{onClick:()=>i("light"),className:`
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
${s==="light"?"bg-gray-50 dark:bg-gray-700":""}
`,children:[d.jsx(ue,{name:Je.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(re,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),s==="light"&&d.jsx(ue,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(Q,{onClick:()=>i("dark"),className:`
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
${s==="dark"?"bg-gray-50 dark:bg-gray-700":""}
`,children:[d.jsx(ue,{name:Je.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(re,{className:"flex-1 text-left text-gray-900 dark:text-white",children:o}),s==="dark"&&d.jsx(ue,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Ic=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:fn,default:fn},Symbol.toStringTag,{value:"Module"})),Ba={xs:"w-6 h-6 text-xs",sm:"w-8 h-8 text-sm",md:"w-10 h-10 text-base",lg:"w-12 h-12 text-lg",xl:"w-16 h-16 text-xl","2xl":"w-24 h-24 text-2xl","3xl":"w-32 h-32 text-3xl","4xl":"w-40 h-40 text-4xl","5xl":"w-48 h-48 text-5xl"},Pc="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",Lc="grayscale opacity-50",no={normal:"bg-gradient-to-br from-blue-500 to-purple-600",withdrawn:"bg-gray-300 dark:bg-gray-600",guest:"bg-gray-200 dark:bg-gray-700"},Fr=({author:e,name:t,avatar:r,size:n="md",className:o="",text:a,isWithdrawn:s=!1,isGuest:l=!1})=>{const f=r??e?.avatar,g=a??t??e?.name??"?",c=s||e?.status==="withdrawn",i=l||e?.is_guest||!1,u=x.useMemo(()=>[Ba[n]||Ba.md,Pc,c?Lc:"",o].filter(Boolean).join(" "),[n,c,o]),h=i?no.guest:c?no.withdrawn:no.normal,p=()=>i?d.jsx(j,{className:`w-full h-full flex items-center justify-center ${h}`,children:d.jsx(ue,{name:"user",className:"text-gray-400 dark:text-gray-500"})}):c?d.jsx(j,{className:`w-full h-full flex items-center justify-center ${h}`,children:d.jsx(ue,{name:"user",className:"text-gray-500 dark:text-gray-400"})}):d.jsx(j,{className:`w-full h-full flex items-center justify-center text-white font-semibold ${h}`,children:g.charAt(0).toUpperCase()});return d.jsx(j,{className:u,children:f&&!i&&!c?d.jsx(Wt,{src:f,alt:g,className:"w-full h-full object-cover"}):p()})},Fc=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Fr},Symbol.toStringTag,{value:"Module"})),hn=({notifications:e=[],unreadCount:t=0,hasMore:r=!1,loading:n=!1,titleText:o="알림",emptyText:a="알림이 없습니다.",markAllReadText:s="모두 읽음",deleteAllText:l="모두 삭제",unreadOnlyText:f="안 읽은 알림만",unreadOnly:g=!1,onNotificationClick:c,onClose:i,onLoadMore:u,onMarkAllRead:h,onDeleteAll:p,onDelete:y,onUnreadOnlyToggle:w,dropdownAlign:b="right",className:I=""})=>{const[S,M]=x.useState(!1),L=x.useRef(null),E=x.useRef(null),T=x.useRef(null),m=x.useRef(null),v=x.useRef(new Set),D=x.useRef(u),A=x.useRef(r),F=x.useRef(n),P=x.useRef(e.length),O=x.useRef(-1);x.useEffect(()=>{D.current=u,A.current=r,F.current=n,P.current=e.length}),x.useEffect(()=>{if(!m.current||!T.current||!S)return;O.current=-1;const U=new IntersectionObserver(([$])=>{$.isIntersecting&&(F.current||!A.current||O.current!==P.current&&(O.current=P.current,D.current?.()))},{root:T.current,threshold:.1});return U.observe(m.current),()=>U.disconnect()},[S]),x.useEffect(()=>{if(!T.current||!S)return;const U=new IntersectionObserver(G=>{G.forEach(K=>{const z=K.target.getAttribute("data-notification-id"),W=K.target.getAttribute("data-unread")==="true";z&&W&&K.isIntersecting&&v.current.add(z)})},{root:T.current,threshold:.5});return T.current.querySelectorAll("[data-notification-id]").forEach(G=>U.observe(G)),()=>U.disconnect()},[S,e]);const N=t>0?t:e.filter(U=>!U.read).length,C=x.useCallback(()=>{if(S){if(N>0){const U=Array.from(v.current).filter($=>{const G=e.find(K=>String(K.id)===String($));return G&&!G.read});U.length>0&&i?.(U)}v.current.clear(),M(!1)}},[S,i,N,e]);x.useEffect(()=>{if(!S)return;const U=$=>{L.current&&!L.current.contains($.target)&&C()};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[S,C]);const k=x.useCallback(()=>{S?C():M(!0)},[S,C]);return x.useLayoutEffect(()=>{const U=E.current;if(!S||!U)return;U.style.transform="";const $=U.getBoundingClientRect(),G=typeof window<"u"?window.innerWidth:0;if($.width===0&&$.height===0)return;const K=8;let z=0;$.right>G-K?z=-($.right-(G-K)):$.left<K&&(z=K-$.left),z!==0&&(U.style.transform=`translateX(${z}px)`)},[S,b,e.length]),d.jsxs(j,{ref:L,className:`relative ${I}`,children:[d.jsxs(Q,{onClick:k,className:"relative p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors cursor-pointer","aria-label":o,children:[d.jsx(ue,{name:Je.Bell,className:"w-5 h-5"}),N>0&&d.jsx(re,{className:"absolute -top-1 -right-1 w-5 h-5 flex items-center justify-center text-xs font-bold text-white bg-red-500 rounded-full",children:N>99?"99+":N})]}),S&&d.jsxs(j,{ref:E,className:`absolute ${b==="left"?"left-0":"right-0"} mt-2 w-80 max-w-[calc(100vw-1rem)] bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50`,children:[d.jsxs(j,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between gap-2",children:[d.jsxs(j,{className:"flex items-center gap-3 min-w-0",children:[d.jsx(re,{className:"font-semibold text-gray-900 dark:text-white",children:o}),w&&d.jsxs(j,{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>w(!g),children:[d.jsx(vt,{type:"checkbox",checked:g,onChange:U=>{U.stopPropagation(),w(U.target.checked)},onClick:U=>U.stopPropagation(),className:"w-3.5 h-3.5 rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500 cursor-pointer"}),d.jsx(re,{className:"text-xs text-gray-600 dark:text-gray-400",children:f})]})]}),d.jsxs(j,{className:"flex items-center gap-3 flex-shrink-0",children:[h&&N>0&&d.jsx(Q,{onClick:()=>{h(),v.current.clear()},className:"text-xs text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 hover:underline cursor-pointer",children:s}),p&&e.length>0&&d.jsx(Q,{onClick:()=>{p()},className:"text-xs text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300 hover:underline cursor-pointer",children:l})]})]}),d.jsx(j,{ref:T,className:"max-h-96 overflow-y-auto",children:e.length===0&&!n?d.jsx(j,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:d.jsx(re,{children:a})}):d.jsxs(d.Fragment,{children:[e.map(U=>{const $=!U.read;return d.jsxs(j,{"data-notification-id":U.id,"data-unread":$?"true":"false",onClick:()=>{U.onClick?.(),c?.(U),M(!1)},className:`group flex items-start gap-3 px-4 py-3 text-left border-b border-gray-100 dark:border-gray-700 transition-colors cursor-pointer ${$?"bg-blue-50/70 dark:bg-blue-900/20 hover:bg-blue-50 dark:hover:bg-blue-900/30":"bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700/50 opacity-70"}`,children:[U.iconName&&d.jsx(ue,{name:U.iconName,className:`w-5 h-5 mt-0.5 flex-shrink-0 ${$?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"}`}),d.jsxs(j,{className:"flex-1 min-w-0",children:[d.jsx(j,{className:`text-sm truncate ${$?"font-semibold text-gray-900 dark:text-white":"font-normal text-gray-600 dark:text-gray-400"}`,children:U.title}),d.jsx(j,{className:`text-sm mt-1 line-clamp-2 ${$?"text-gray-700 dark:text-gray-300":"text-gray-500 dark:text-gray-500"}`,children:U.message}),d.jsx(j,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1 font-mono",children:U.time})]}),d.jsxs(j,{className:"flex flex-col items-center gap-2 flex-shrink-0",children:[$&&d.jsx(re,{className:"w-2 h-2 bg-blue-500 rounded-full mt-1.5"}),y&&d.jsx(Q,{onClick:G=>{G.stopPropagation(),y(U)},className:"p-1 text-gray-400 dark:text-gray-500 hover:text-red-600 dark:hover:text-red-400 rounded hover:bg-red-50 dark:hover:bg-red-900/20 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Delete notification",children:d.jsx(ue,{name:Je.Trash,className:"w-4 h-4"})})]})]},U.id)}),r&&d.jsx(j,{ref:m,className:"px-4 py-3 text-center",children:n?d.jsx(re,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."}):d.jsx(re,{className:"text-sm text-gray-400 dark:text-gray-500"})}),n&&!r&&e.length>0&&d.jsx(j,{className:"px-4 py-2 text-center",children:d.jsx(re,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."})})]})})]})]})},Uc=Object.freeze(Object.defineProperty({__proto__:null,NotificationCenter:hn,default:hn},Symbol.toStringTag,{value:"Module"})),Ye=(e,t)=>window.G7Core?.t?.(e,t)??e,wt=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},Ga=({logo:e,siteName:t="그누보드7",user:r,cartCount:n=0,notificationCount:o=0,boards:a=[],maxVisibleBoards:s=5,onMobileMenuOpen:l,availableLocales:f=[],currentLocale:g="ko",shopBase:c="/shop",className:i="",notifications:u=[],notificationHasMore:h=!1,notificationLoading:p=!1,notificationUnreadOnly:y=!1,notificationTitleText:w,notificationEmptyText:b,notificationMarkAllReadText:I,notificationDeleteAllText:S,notificationUnreadOnlyText:M,onNotificationClose:L,onNotificationClick:E,onNotificationLoadMore:T,onNotificationMarkAllRead:m,onNotificationDeleteAll:v,onNotificationDelete:D,onNotificationUnreadOnlyToggle:A})=>{const[F,P]=x.useState(""),[O,N]=x.useState(!1),[C,k]=x.useState(!1),[U,$]=x.useState({top:0,left:0}),[G,K]=x.useState(window.location.pathname),z=x.useRef(null),W=x.useRef(null),B=window.G7Core?.useResponsive,Z=B?.(),pe=Z?Z.width<768:typeof window<"u"&&window.innerWidth<768;x.useEffect(()=>{const J=()=>K(window.location.pathname);window.addEventListener("popstate",J);const he=history.pushState;return history.pushState=function(...xe){he.apply(this,xe),K(window.location.pathname)},()=>{window.removeEventListener("popstate",J),history.pushState=he}},[]);const ie=(J,he=!1)=>he?G===J:G===J||G.startsWith(J+"/"),fe=()=>{const J=c==="/"?"":c;return G.startsWith(`${J}/products`)||G.startsWith(`${J}/cart`)||G.startsWith(`${J}/checkout`)||G.startsWith(`${J}/category`)},ee=J=>{const he="px-3 py-2 text-sm font-medium whitespace-nowrap cursor-pointer rounded-lg transition-colors";return J?`${he} bg-gray-900 text-white dark:bg-white dark:text-gray-900`:`${he} text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800`};x.useEffect(()=>{const J=he=>{z.current&&!z.current.contains(he.target)&&N(!1),W.current&&!W.current.contains(he.target)&&k(!1)};return document.addEventListener("mousedown",J),()=>document.removeEventListener("mousedown",J)},[]);const _e=a.slice(0,s),ye=a.slice(s),He=J=>{J.preventDefault(),F.trim()&&wt(`/search?q=${encodeURIComponent(F)}`)},Fe=async()=>{window.G7Core?.dispatch?.({handler:"logout"})},ve=J=>{window.G7Core?.dispatch?.({handler:"setLocale",target:J}),N(!1)};return d.jsxs(Ha,{className:`sticky top-0 z-50 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 ${i}`,children:[d.jsx(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs(j,{className:"flex items-center justify-between h-16",children:[d.jsx(Q,{onClick:()=>wt("/"),className:"flex items-center gap-2 flex-shrink-0 cursor-pointer",children:e?d.jsx(Wt,{src:e,alt:t,className:"h-8"}):d.jsx(re,{className:"text-xl font-bold text-gray-900 dark:text-white",children:t})}),!pe&&d.jsx(to,{onSubmit:He,className:"flex flex-1 max-w-lg mx-8",children:d.jsxs(j,{className:"relative w-full",children:[d.jsx(vt,{type:"text",value:F,onChange:J=>P(J.target.value),placeholder:Ye("common.search_placeholder"),className:"w-full px-4 py-2 pl-10 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}),d.jsx(ue,{name:"search",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500"})]})}),d.jsxs(j,{className:"flex items-center gap-2",children:[d.jsx(fn,{autoText:Ye("common.theme.auto"),lightText:Ye("common.theme.light"),darkText:Ye("common.theme.dark")}),r?.uuid&&d.jsx(hn,{notifications:u,unreadCount:o,hasMore:h,loading:p,unreadOnly:y,titleText:w??Ye("mypage.notifications.title"),emptyText:b??Ye("mypage.notifications.empty"),markAllReadText:I??Ye("mypage.notifications.mark_all_read"),deleteAllText:S??Ye("mypage.notifications.delete_all"),unreadOnlyText:M??Ye("mypage.notifications.unread_only"),onClose:L,onNotificationClick:E,onLoadMore:T,onMarkAllRead:m,onDeleteAll:v,onDelete:D,onUnreadOnlyToggle:A,dropdownAlign:"right"}),d.jsxs(Q,{onClick:()=>wt(`${c}/cart`),className:"relative p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:[d.jsx(ue,{name:"shopping-cart",className:"w-5 h-5"}),n>0&&d.jsx(re,{className:"absolute -top-1 -right-1 w-5 h-5 flex items-center justify-center text-xs bg-blue-500 text-white rounded-full",children:n>99?"99+":n})]}),r?.uuid?d.jsxs(j,{ref:z,className:"relative",children:[d.jsxs(Q,{onClick:()=>N(!O),className:"flex items-center gap-2 p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white",children:[d.jsx(Fr,{avatar:r.avatar,name:r.name,size:"sm"}),d.jsx(re,{className:"hidden sm:inline text-sm font-medium",children:r.name}),d.jsx(ue,{name:"chevron-down",className:"w-4 h-4"})]}),O&&d.jsxs(j,{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg py-1 z-50",children:[d.jsx(j,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:d.jsxs(j,{className:"flex items-center gap-3",children:[d.jsx(Fr,{avatar:r.avatar,name:r.name,size:"md"}),d.jsxs(j,{children:[d.jsx(j,{className:"text-sm font-medium text-gray-900 dark:text-white",children:r.name}),d.jsx(j,{className:"text-xs text-gray-500 dark:text-gray-400",children:Ye("common.member")})]})]})}),d.jsxs(j,{className:"py-1",children:[r.is_admin&&d.jsxs(d.Fragment,{children:[d.jsxs(eo,{href:"/admin",className:"block w-full text-left px-4 py-2 text-sm text-blue-600 dark:text-blue-400 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer font-medium",children:[d.jsx(ue,{name:"settings",className:"inline w-4 h-4 mr-2"}),Ye("common.admin_menu")]}),d.jsx(un,{className:"my-1 border-gray-200 dark:border-gray-700"})]}),d.jsxs(Q,{onClick:()=>{wt("/mypage"),N(!1)},className:"block w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[d.jsx(ue,{name:"user",className:"inline w-4 h-4 mr-2"}),Ye("common.mypage")]}),d.jsxs(Q,{onClick:()=>{wt("/mypage/orders"),N(!1)},className:"block w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[d.jsx(ue,{name:"shopping-bag",className:"inline w-4 h-4 mr-2"}),Ye("mypage.tabs.orders")]}),d.jsxs(Q,{onClick:()=>{wt("/mypage/wishlist"),N(!1)},className:"block w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[d.jsx(ue,{name:"heart",className:"inline w-4 h-4 mr-2"}),Ye("mypage.tabs.wishlist")]})]}),f&&f.length>1&&d.jsxs(d.Fragment,{children:[d.jsx(un,{className:"my-1 border-gray-200 dark:border-gray-700"}),d.jsxs(j,{className:"py-1",children:[d.jsx(j,{className:"px-4 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase",children:Ye("common.language")}),f.map(J=>d.jsxs(Q,{onClick:()=>ve(J),className:`block w-full text-left px-4 py-2 text-sm cursor-pointer ${J===g?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[d.jsx(ue,{name:"globe",className:"inline w-4 h-4 mr-2"}),J==="ko"?"한국어":J==="en"?"English":J.toUpperCase()]},J))]})]}),d.jsx(un,{className:"my-1 border-gray-200 dark:border-gray-700"}),d.jsxs(Q,{onClick:Fe,className:"block w-full text-left px-4 py-2 text-sm text-red-600 dark:text-red-400 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[d.jsx(ue,{name:"log-out",className:"inline w-4 h-4 mr-2"}),Ye("auth.logout")]})]})]}):d.jsxs(j,{className:"flex items-center gap-2",children:[d.jsx(Q,{onClick:()=>wt("/login"),className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:Ye("auth.login")}),d.jsx(Q,{onClick:()=>wt("/register"),className:"px-4 py-2 text-sm font-medium text-white bg-emerald-500 rounded-lg hover:bg-emerald-600 cursor-pointer",children:Ye("auth.register_link")})]}),pe&&d.jsx(Q,{onClick:l,className:"p-2 text-gray-600 dark:text-gray-400",children:d.jsx(ue,{name:"menu",className:"w-6 h-6"})})]})]})}),!pe&&d.jsx(Lr,{className:"border-t border-gray-200 dark:border-gray-800",children:d.jsx(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs(j,{className:"flex items-center gap-1 h-12 overflow-x-auto",children:[d.jsx(Q,{onClick:()=>wt("/"),className:ee(ie("/",!0)),children:Ye("nav.home")}),d.jsxs(Q,{onClick:()=>wt("/boards/popular"),className:`flex items-center gap-1 ${ee(ie("/boards/popular"))}`,children:[d.jsx(re,{className:"text-orange-500",children:"🔥"}),Ye("nav.popular")]}),d.jsxs(Q,{onClick:()=>wt(`${c==="/"?"":c}/products`),className:`flex items-center gap-1 ${ee(fe())}`,children:[d.jsx(re,{children:"🛒"}),Ye("nav.shop")]}),_e.map(J=>d.jsxs(Q,{onClick:()=>wt(`/board/${J.slug}`),className:ee(ie(`/board/${J.slug}`)),children:[J.icon&&d.jsx(re,{className:"mr-1",children:J.icon}),J.name]},J.id)),ye.length>0&&d.jsxs(j,{ref:W,className:"relative",children:[d.jsxs(Q,{onClick:()=>{if(!C&&W.current){const J=W.current.getBoundingClientRect();$({top:J.bottom+4,left:J.left})}k(!C)},className:"flex items-center gap-1 px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white",children:[Ye("nav.more"),d.jsx(ue,{name:"chevron-down",className:"w-4 h-4"})]}),C&&d.jsx(j,{className:"fixed w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg py-1 z-50",style:{top:`${U.top}px`,left:`${U.left}px`},children:ye.map(J=>{const he=ie(`/board/${J.slug}`);return d.jsxs(Q,{onClick:()=>{wt(`/board/${J.slug}`),k(!1)},className:`block w-full text-left px-4 py-2 text-sm cursor-pointer ${he?"bg-gray-900 text-white dark:bg-white dark:text-gray-900":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[J.icon&&d.jsx(re,{className:"mr-1",children:J.icon}),J.name]},J.id)})})]})]})})})]})},$c=Object.freeze(Object.defineProperty({__proto__:null,default:Ga},Symbol.toStringTag,{value:"Module"})),xt=(e,t)=>window.G7Core?.t?.(e,t)??e,zc=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},Wa=({siteName:e="그누보드7",siteDescription:t,copyrightText:r,socialLinks:n={},linkGroups:o,className:a=""})=>{const s=new Date().getFullYear(),l=[{title:xt("footer.community"),links:[{label:xt("nav.home"),href:"/"},{label:xt("nav.popular"),href:"/boards/popular"},{label:xt("footer.all_boards"),href:"/boards"}]},{title:xt("footer.info"),links:[{label:xt("footer.about"),href:"/page/about"},{label:xt("footer.faq"),href:"/page/faq"},{label:xt("footer.contact"),href:"/page/contact"}]},{title:xt("footer.policy"),links:[{label:xt("footer.terms"),href:"/page/terms"},{label:xt("footer.privacy"),href:"/page/privacy"},{label:xt("footer.refund"),href:"/page/refund"}]}],f=o||l,g={github:"github",twitter:"twitter",discord:"discord",facebook:"facebook",instagram:"instagram"};return d.jsx(za,{className:`bg-gray-50 dark:bg-gray-900 border-t border-gray-200 dark:border-gray-800 ${a}`,children:d.jsxs(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[d.jsxs(j,{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-8",children:[d.jsxs(j,{className:"lg:col-span-2",children:[d.jsx(dn,{className:"text-lg font-bold text-gray-900 dark:text-white",children:e}),t&&d.jsx(It,{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:t}),d.jsx(j,{className:"mt-4 flex items-center gap-4",children:Object.entries(n).map(([c,i])=>i?d.jsx(eo,{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200","aria-label":c,children:d.jsx(ue,{name:g[c],className:"w-5 h-5"})},c):null)})]}),f.map((c,i)=>d.jsxs(j,{children:[d.jsx(La,{className:"text-sm font-semibold text-gray-900 dark:text-white uppercase tracking-wider",children:c.title}),d.jsx(Rn,{className:"mt-4 space-y-2",children:c.links.map((u,h)=>d.jsx(Xt,{children:d.jsx(Q,{onClick:()=>zc(u.href),className:"text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:u.label})},h))})]},i))]}),d.jsxs(j,{className:"mt-8 pt-8 border-t border-gray-200 dark:border-gray-800 flex flex-col sm:flex-row justify-between items-center gap-4",children:[d.jsx(It,{className:"text-sm text-gray-500 dark:text-gray-400",children:r||`© ${s} ${e}. All rights reserved.`}),d.jsx(It,{className:"text-sm text-gray-500 dark:text-gray-400",children:xt("footer.powered_by")})]})]})})},Hc=Object.freeze(Object.defineProperty({__proto__:null,default:Wa},Symbol.toStringTag,{value:"Module"})),Pt=(e,t)=>window.G7Core?.t?.(e,t)??e,_t=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},Ka=({isOpen:e,onClose:t,logo:r,siteName:n="그누보드7",user:o,boards:a=[],cartCount:s=0})=>{const l=x.useRef(null),g=window.G7Core?.useResponsive,c=g?.(),i=c?c.width<1024:typeof window<"u"&&window.innerWidth<1024;x.useEffect(()=>{const h=p=>{p.key==="Escape"&&t()};return e&&(document.addEventListener("keydown",h),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",h),document.body.style.overflow=""}},[e,t]);const u=h=>{h.target===h.currentTarget&&t()};return!e||!i?null:d.jsxs(j,{className:"fixed inset-0 z-50",onClick:u,children:[d.jsx(j,{className:"fixed inset-0 bg-black/50 transition-opacity"}),d.jsxs(j,{ref:l,className:`fixed inset-y-0 left-0 w-80 max-w-[85vw] bg-white dark:bg-gray-900 shadow-xl transform transition-transform duration-300 ${e?"translate-x-0":"-translate-x-full"}`,children:[d.jsxs(j,{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-800",children:[d.jsx(Q,{onClick:()=>{t(),_t("/")},className:"flex items-center gap-2 cursor-pointer",children:r?d.jsx(Wt,{src:r,alt:n,className:"h-8"}):d.jsx(re,{className:"text-xl font-bold text-gray-900 dark:text-white",children:n})}),d.jsx(Q,{onClick:t,className:"p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200","aria-label":"메뉴 닫기",children:d.jsx(ue,{name:"x",className:"w-6 h-6"})})]}),o?d.jsx(j,{className:"p-4 border-b border-gray-200 dark:border-gray-800",children:d.jsxs(j,{className:"flex items-center gap-3",children:[o.avatar?d.jsx(Wt,{src:o.avatar,alt:o.name,className:"w-12 h-12 rounded-full"}):d.jsx(j,{className:"w-12 h-12 rounded-full bg-blue-500 flex items-center justify-center text-white text-lg font-medium",children:(o.name||"U").charAt(0).toUpperCase()}),d.jsxs(j,{children:[d.jsx(It,{className:"font-medium text-gray-900 dark:text-white",children:o.name}),d.jsx(Q,{onClick:()=>{t(),_t("/mypage")},className:"text-sm text-blue-600 dark:text-blue-400 hover:underline cursor-pointer",children:Pt("common.mypage")})]})]})}):d.jsx(j,{className:"p-4 border-b border-gray-200 dark:border-gray-800",children:d.jsxs(j,{className:"flex gap-2",children:[d.jsx(Q,{onClick:()=>{t(),_t("/login")},className:"flex-1 py-2 text-center text-sm font-medium text-white bg-gray-900 dark:bg-white dark:text-gray-900 rounded-lg cursor-pointer",children:Pt("auth.login")}),d.jsx(Q,{onClick:()=>{t(),_t("/register")},className:"flex-1 py-2 text-center text-sm font-medium text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer",children:Pt("auth.register")})]})}),d.jsx(Lr,{className:"p-4 overflow-y-auto max-h-[calc(100vh-200px)]",children:d.jsxs(Rn,{className:"space-y-1",children:[d.jsx(Xt,{children:d.jsxs(Q,{onClick:()=>{t(),_t("/")},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[d.jsx(ue,{name:"home",className:"w-5 h-5"}),Pt("nav.home")]})}),d.jsx(Xt,{children:d.jsxs(Q,{onClick:()=>{t(),_t("/popular")},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[d.jsx(re,{className:"text-orange-500",children:"🔥"}),Pt("nav.popular")]})}),d.jsx(Xt,{children:d.jsxs(Q,{onClick:()=>{t(),_t("/shop")},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[d.jsx(re,{children:"🛒"}),Pt("nav.shop")]})}),d.jsx(Xt,{children:d.jsxs(Q,{onClick:()=>{t(),_t("/cart")},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[d.jsx(ue,{name:"shopping-cart",className:"w-5 h-5"}),Pt("nav.cart"),s>0&&d.jsx(re,{className:"ml-auto px-2 py-0.5 text-xs bg-blue-500 text-white rounded-full",children:s})]})}),d.jsx(Xt,{className:"my-4 border-t border-gray-200 dark:border-gray-800"}),d.jsx(Xt,{className:"px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:Pt("nav.boards")}),a.map(h=>d.jsx(Xt,{children:d.jsxs(Q,{onClick:()=>{t(),_t(`/board/${h.slug}`)},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[h.icon&&d.jsx(re,{children:h.icon}),h.name]})},h.id))]})}),d.jsx(j,{className:"absolute bottom-0 left-0 right-0 p-4 border-t border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900",children:d.jsxs(j,{className:"flex items-center justify-between text-sm text-gray-500 dark:text-gray-400",children:[d.jsx(Q,{onClick:()=>{t(),_t("/about")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Pt("footer.about")}),d.jsx(Q,{onClick:()=>{t(),_t("/terms")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Pt("footer.terms")}),d.jsx(Q,{onClick:()=>{t(),_t("/privacy")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Pt("footer.privacy")})]})})]})]})},jc=Object.freeze(Object.defineProperty({__proto__:null,default:Ka},Symbol.toStringTag,{value:"Module"}));const{entries:Va,setPrototypeOf:Ya,isFrozen:Bc,getPrototypeOf:Gc,getOwnPropertyDescriptor:Wc}=Object;let{freeze:ut,seal:Tt,create:oo}=Object,{apply:ao,construct:so}=typeof Reflect<"u"&&Reflect;ut||(ut=function(t){return t}),Tt||(Tt=function(t){return t}),ao||(ao=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return t.apply(r,o)}),so||(so=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return new t(...n)});const gn=ht(Array.prototype.forEach),Kc=ht(Array.prototype.lastIndexOf),Xa=ht(Array.prototype.pop),Ur=ht(Array.prototype.push),Vc=ht(Array.prototype.splice),pn=ht(String.prototype.toLowerCase),lo=ht(String.prototype.toString),io=ht(String.prototype.match),$r=ht(String.prototype.replace),Yc=ht(String.prototype.indexOf),Xc=ht(String.prototype.trim),Lt=ht(Object.prototype.hasOwnProperty),ft=ht(RegExp.prototype.test),zr=Zc(TypeError);function ht(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return ao(e,t,n)}}function Zc(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return so(e,r)}}function Ae(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pn;Ya&&Ya(e,null);let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const a=r(o);a!==o&&(Bc(t)||(t[n]=a),o=a)}e[o]=!0}return e}function qc(e){for(let t=0;t<e.length;t++)Lt(e,t)||(e[t]=null);return e}function Kt(e){const t=oo(null);for(const[r,n]of Va(e))Lt(e,r)&&(Array.isArray(n)?t[r]=qc(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Kt(n):t[r]=n);return t}function Hr(e,t){for(;e!==null;){const n=Wc(e,t);if(n){if(n.get)return ht(n.get);if(typeof n.value=="function")return ht(n.value)}e=Gc(e)}function r(){return null}return r}const Za=ut(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),co=ut(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),uo=ut(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Qc=ut(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fo=ut(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Jc=ut(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qa=ut(["#text"]),Qa=ut(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ho=ut(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ja=ut(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),mn=ut(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Rc=Tt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ed=Tt(/<%[\w\W]*|[\w\W]*%>/gm),td=Tt(/\$\{[\w\W]*/gm),rd=Tt(/^data-[\-\w.\u00B7-\uFFFF]+$/),nd=Tt(/^aria-[\-\w]+$/),Ra=Tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),od=Tt(/^(?:\w+script|data):/i),ad=Tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),es=Tt(/^html$/i),sd=Tt(/^[a-z][.\w]*(-[.\w]+)+$/i);var ts=Object.freeze({__proto__:null,ARIA_ATTR:nd,ATTR_WHITESPACE:ad,CUSTOM_ELEMENT:sd,DATA_ATTR:rd,DOCTYPE_NAME:es,ERB_EXPR:ed,IS_ALLOWED_URI:Ra,IS_SCRIPT_OR_DATA:od,MUSTACHE_EXPR:Rc,TMPLIT_EXPR:td});const jr={element:1,text:3,progressingInstruction:7,comment:8,document:9},ld=function(){return typeof window>"u"?null:window},id=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(n=r.getAttribute(o));const a="dompurify"+(n?"#"+n:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},rs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ns(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ld();const t=ge=>ns(ge);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==jr.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,o=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:f,NodeFilter:g,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:i,DOMParser:u,trustedTypes:h}=e,p=f.prototype,y=Hr(p,"cloneNode"),w=Hr(p,"remove"),b=Hr(p,"nextSibling"),I=Hr(p,"childNodes"),S=Hr(p,"parentNode");if(typeof s=="function"){const ge=r.createElement("template");ge.content&&ge.content.ownerDocument&&(r=ge.content.ownerDocument)}let M,L="";const{implementation:E,createNodeIterator:T,createDocumentFragment:m,getElementsByTagName:v}=r,{importNode:D}=n;let A=rs();t.isSupported=typeof Va=="function"&&typeof S=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:P,TMPLIT_EXPR:O,DATA_ATTR:N,ARIA_ATTR:C,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:$}=ts;let{IS_ALLOWED_URI:G}=ts,K=null;const z=Ae({},[...Za,...co,...uo,...fo,...qa]);let W=null;const V=Ae({},[...Qa,...ho,...Ja,...mn]);let B=Object.seal(oo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Z=null,pe=null;const ie=Object.seal(oo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let fe=!0,ee=!0,_e=!1,ye=!0,He=!1,Fe=!0,ve=!1,J=!1,he=!1,xe=!1,Ue=!1,Le=!1,Y=!0,te=!1;const de="user-content-";let ae=!0,Ee=!1,je={},ze=null;const Me=Ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Xe=null;const $e=Ae({},["audio","video","img","source","image","track"]);let X=null;const ne=Ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ce="http://www.w3.org/1998/Math/MathML",se="http://www.w3.org/2000/svg",oe="http://www.w3.org/1999/xhtml";let Ne=oe,we=!1,ke=null;const Ce=Ae({},[ce,se,oe],lo);let Ie=Ae({},["mi","mo","mn","ms","mtext"]),Be=Ae({},["annotation-xml"]);const Se=Ae({},["title","style","font","a","script"]);let me=null;const Te=["application/xhtml+xml","text/html"],Ke="text/html";let De=null,Ge=null;const qe=r.createElement("form"),Zt=function(H){return H instanceof RegExp||H instanceof Function},Ze=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ge&&Ge===H)){if((!H||typeof H!="object")&&(H={}),H=Kt(H),me=Te.indexOf(H.PARSER_MEDIA_TYPE)===-1?Ke:H.PARSER_MEDIA_TYPE,De=me==="application/xhtml+xml"?lo:pn,K=Lt(H,"ALLOWED_TAGS")?Ae({},H.ALLOWED_TAGS,De):z,W=Lt(H,"ALLOWED_ATTR")?Ae({},H.ALLOWED_ATTR,De):V,ke=Lt(H,"ALLOWED_NAMESPACES")?Ae({},H.ALLOWED_NAMESPACES,lo):Ce,X=Lt(H,"ADD_URI_SAFE_ATTR")?Ae(Kt(ne),H.ADD_URI_SAFE_ATTR,De):ne,Xe=Lt(H,"ADD_DATA_URI_TAGS")?Ae(Kt($e),H.ADD_DATA_URI_TAGS,De):$e,ze=Lt(H,"FORBID_CONTENTS")?Ae({},H.FORBID_CONTENTS,De):Me,Z=Lt(H,"FORBID_TAGS")?Ae({},H.FORBID_TAGS,De):Kt({}),pe=Lt(H,"FORBID_ATTR")?Ae({},H.FORBID_ATTR,De):Kt({}),je=Lt(H,"USE_PROFILES")?H.USE_PROFILES:!1,fe=H.ALLOW_ARIA_ATTR!==!1,ee=H.ALLOW_DATA_ATTR!==!1,_e=H.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=H.ALLOW_SELF_CLOSE_IN_ATTR!==!1,He=H.SAFE_FOR_TEMPLATES||!1,Fe=H.SAFE_FOR_XML!==!1,ve=H.WHOLE_DOCUMENT||!1,xe=H.RETURN_DOM||!1,Ue=H.RETURN_DOM_FRAGMENT||!1,Le=H.RETURN_TRUSTED_TYPE||!1,he=H.FORCE_BODY||!1,Y=H.SANITIZE_DOM!==!1,te=H.SANITIZE_NAMED_PROPS||!1,ae=H.KEEP_CONTENT!==!1,Ee=H.IN_PLACE||!1,G=H.ALLOWED_URI_REGEXP||Ra,Ne=H.NAMESPACE||oe,Ie=H.MATHML_TEXT_INTEGRATION_POINTS||Ie,Be=H.HTML_INTEGRATION_POINTS||Be,B=H.CUSTOM_ELEMENT_HANDLING||{},H.CUSTOM_ELEMENT_HANDLING&&Zt(H.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=H.CUSTOM_ELEMENT_HANDLING.tagNameCheck),H.CUSTOM_ELEMENT_HANDLING&&Zt(H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),H.CUSTOM_ELEMENT_HANDLING&&typeof H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(B.allowCustomizedBuiltInElements=H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),He&&(ee=!1),Ue&&(xe=!0),je&&(K=Ae({},qa),W=[],je.html===!0&&(Ae(K,Za),Ae(W,Qa)),je.svg===!0&&(Ae(K,co),Ae(W,ho),Ae(W,mn)),je.svgFilters===!0&&(Ae(K,uo),Ae(W,ho),Ae(W,mn)),je.mathMl===!0&&(Ae(K,fo),Ae(W,Ja),Ae(W,mn))),H.ADD_TAGS&&(typeof H.ADD_TAGS=="function"?ie.tagCheck=H.ADD_TAGS:(K===z&&(K=Kt(K)),Ae(K,H.ADD_TAGS,De))),H.ADD_ATTR&&(typeof H.ADD_ATTR=="function"?ie.attributeCheck=H.ADD_ATTR:(W===V&&(W=Kt(W)),Ae(W,H.ADD_ATTR,De))),H.ADD_URI_SAFE_ATTR&&Ae(X,H.ADD_URI_SAFE_ATTR,De),H.FORBID_CONTENTS&&(ze===Me&&(ze=Kt(ze)),Ae(ze,H.FORBID_CONTENTS,De)),H.ADD_FORBID_CONTENTS&&(ze===Me&&(ze=Kt(ze)),Ae(ze,H.ADD_FORBID_CONTENTS,De)),ae&&(K["#text"]=!0),ve&&Ae(K,["html","head","body"]),K.table&&(Ae(K,["tbody"]),delete Z.tbody),H.TRUSTED_TYPES_POLICY){if(typeof H.TRUSTED_TYPES_POLICY.createHTML!="function")throw zr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof H.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw zr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=H.TRUSTED_TYPES_POLICY,L=M.createHTML("")}else M===void 0&&(M=id(h,o)),M!==null&&typeof L=="string"&&(L=M.createHTML(""));ut&&ut(H),Ge=H}},jt=Ae({},[...co,...uo,...Qc]),St=Ae({},[...fo,...Jc]),Bt=function(H){let q=S(H);(!q||!q.tagName)&&(q={namespaceURI:Ne,tagName:"template"});const le=pn(H.tagName),Ve=pn(q.tagName);return ke[H.namespaceURI]?H.namespaceURI===se?q.namespaceURI===oe?le==="svg":q.namespaceURI===ce?le==="svg"&&(Ve==="annotation-xml"||Ie[Ve]):!!jt[le]:H.namespaceURI===ce?q.namespaceURI===oe?le==="math":q.namespaceURI===se?le==="math"&&Be[Ve]:!!St[le]:H.namespaceURI===oe?q.namespaceURI===se&&!Be[Ve]||q.namespaceURI===ce&&!Ie[Ve]?!1:!St[le]&&(Se[le]||!jt[le]):!!(me==="application/xhtml+xml"&&ke[H.namespaceURI]):!1},ct=function(H){Ur(t.removed,{element:H});try{S(H).removeChild(H)}catch{w(H)}},Et=function(H,q){try{Ur(t.removed,{attribute:q.getAttributeNode(H),from:q})}catch{Ur(t.removed,{attribute:null,from:q})}if(q.removeAttribute(H),H==="is")if(xe||Ue)try{ct(q)}catch{}else try{q.setAttribute(H,"")}catch{}},Gt=function(H){let q=null,le=null;if(he)H="<remove></remove>"+H;else{const Qe=io(H,/^[\r\n\t ]+/);le=Qe&&Qe[0]}me==="application/xhtml+xml"&&Ne===oe&&(H='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+H+"</body></html>");const Ve=M?M.createHTML(H):H;if(Ne===oe)try{q=new u().parseFromString(Ve,me)}catch{}if(!q||!q.documentElement){q=E.createDocument(Ne,"template",null);try{q.documentElement.innerHTML=we?L:Ve}catch{}}const dt=q.body||q.documentElement;return H&&le&&dt.insertBefore(r.createTextNode(le),dt.childNodes[0]||null),Ne===oe?v.call(q,ve?"html":"body")[0]:ve?q.documentElement:dt},rr=function(H){return T.call(H.ownerDocument||H,H,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},pr=function(H){return H instanceof i&&(typeof H.nodeName!="string"||typeof H.textContent!="string"||typeof H.removeChild!="function"||!(H.attributes instanceof c)||typeof H.removeAttribute!="function"||typeof H.setAttribute!="function"||typeof H.namespaceURI!="string"||typeof H.insertBefore!="function"||typeof H.hasChildNodes!="function")},ic=function(H){return typeof l=="function"&&H instanceof l};function qt(ge,H,q){gn(ge,le=>{le.call(t,H,q,Ge)})}const cc=function(H){let q=null;if(qt(A.beforeSanitizeElements,H,null),pr(H))return ct(H),!0;const le=De(H.nodeName);if(qt(A.uponSanitizeElement,H,{tagName:le,allowedTags:K}),Fe&&H.hasChildNodes()&&!ic(H.firstElementChild)&&ft(/<[/\w!]/g,H.innerHTML)&&ft(/<[/\w!]/g,H.textContent)||H.nodeType===jr.progressingInstruction||Fe&&H.nodeType===jr.comment&&ft(/<[/\w]/g,H.data))return ct(H),!0;if(!(ie.tagCheck instanceof Function&&ie.tagCheck(le))&&(!K[le]||Z[le])){if(!Z[le]&&uc(le)&&(B.tagNameCheck instanceof RegExp&&ft(B.tagNameCheck,le)||B.tagNameCheck instanceof Function&&B.tagNameCheck(le)))return!1;if(ae&&!ze[le]){const Ve=S(H)||H.parentNode,dt=I(H)||H.childNodes;if(dt&&Ve){const Qe=dt.length;for(let yt=Qe-1;yt>=0;--yt){const Qt=y(dt[yt],!0);Qt.__removalCount=(H.__removalCount||0)+1,Ve.insertBefore(Qt,b(H))}}}return ct(H),!0}return H instanceof f&&!Bt(H)||(le==="noscript"||le==="noembed"||le==="noframes")&&ft(/<\/no(script|embed|frames)/i,H.innerHTML)?(ct(H),!0):(He&&H.nodeType===jr.text&&(q=H.textContent,gn([F,P,O],Ve=>{q=$r(q,Ve," ")}),H.textContent!==q&&(Ur(t.removed,{element:H.cloneNode()}),H.textContent=q)),qt(A.afterSanitizeElements,H,null),!1)},dc=function(H,q,le){if(Y&&(q==="id"||q==="name")&&(le in r||le in qe))return!1;if(!(ee&&!pe[q]&&ft(N,q))){if(!(fe&&ft(C,q))){if(!(ie.attributeCheck instanceof Function&&ie.attributeCheck(q,H))){if(!W[q]||pe[q]){if(!(uc(H)&&(B.tagNameCheck instanceof RegExp&&ft(B.tagNameCheck,H)||B.tagNameCheck instanceof Function&&B.tagNameCheck(H))&&(B.attributeNameCheck instanceof RegExp&&ft(B.attributeNameCheck,q)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(q,H))||q==="is"&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&ft(B.tagNameCheck,le)||B.tagNameCheck instanceof Function&&B.tagNameCheck(le))))return!1}else if(!X[q]){if(!ft(G,$r(le,U,""))){if(!((q==="src"||q==="xlink:href"||q==="href")&&H!=="script"&&Yc(le,"data:")===0&&Xe[H])){if(!(_e&&!ft(k,$r(le,U,"")))){if(le)return!1}}}}}}}return!0},uc=function(H){return H!=="annotation-xml"&&io(H,$)},fc=function(H){qt(A.beforeSanitizeAttributes,H,null);const{attributes:q}=H;if(!q||pr(H))return;const le={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let Ve=q.length;for(;Ve--;){const dt=q[Ve],{name:Qe,namespaceURI:yt,value:Qt}=dt,Pr=De(Qe),Ma=Qt;let at=Qe==="value"?Ma:Xc(Ma);if(le.attrName=Pr,le.attrValue=at,le.keepAttr=!0,le.forceKeepAttr=void 0,qt(A.uponSanitizeAttribute,H,le),at=le.attrValue,te&&(Pr==="id"||Pr==="name")&&(Et(Qe,H),at=de+at),Fe&&ft(/((--!?|])>)|<\/(style|title|textarea)/i,at)){Et(Qe,H);continue}if(Pr==="attributename"&&io(at,"href")){Et(Qe,H);continue}if(le.forceKeepAttr)continue;if(!le.keepAttr){Et(Qe,H);continue}if(!ye&&ft(/\/>/i,at)){Et(Qe,H);continue}He&&gn([F,P,O],gc=>{at=$r(at,gc," ")});const hc=De(H.nodeName);if(!dc(hc,Pr,at)){Et(Qe,H);continue}if(M&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!yt)switch(h.getAttributeType(hc,Pr)){case"TrustedHTML":{at=M.createHTML(at);break}case"TrustedScriptURL":{at=M.createScriptURL(at);break}}if(at!==Ma)try{yt?H.setAttributeNS(yt,Qe,at):H.setAttribute(Qe,at),pr(H)?ct(H):Xa(t.removed)}catch{Et(Qe,H)}}qt(A.afterSanitizeAttributes,H,null)},W0=function ge(H){let q=null;const le=rr(H);for(qt(A.beforeSanitizeShadowDOM,H,null);q=le.nextNode();)qt(A.uponSanitizeShadowNode,q,null),cc(q),fc(q),q.content instanceof a&&ge(q.content);qt(A.afterSanitizeShadowDOM,H,null)};return t.sanitize=function(ge){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=null,le=null,Ve=null,dt=null;if(we=!ge,we&&(ge="<!-->"),typeof ge!="string"&&!ic(ge))if(typeof ge.toString=="function"){if(ge=ge.toString(),typeof ge!="string")throw zr("dirty is not a string, aborting")}else throw zr("toString is not a function");if(!t.isSupported)return ge;if(J||Ze(H),t.removed=[],typeof ge=="string"&&(Ee=!1),Ee){if(ge.nodeName){const Qt=De(ge.nodeName);if(!K[Qt]||Z[Qt])throw zr("root node is forbidden and cannot be sanitized in-place")}}else if(ge instanceof l)q=Gt("<!---->"),le=q.ownerDocument.importNode(ge,!0),le.nodeType===jr.element&&le.nodeName==="BODY"||le.nodeName==="HTML"?q=le:q.appendChild(le);else{if(!xe&&!He&&!ve&&ge.indexOf("<")===-1)return M&&Le?M.createHTML(ge):ge;if(q=Gt(ge),!q)return xe?null:Le?L:""}q&&he&&ct(q.firstChild);const Qe=rr(Ee?ge:q);for(;Ve=Qe.nextNode();)cc(Ve),fc(Ve),Ve.content instanceof a&&W0(Ve.content);if(Ee)return ge;if(xe){if(Ue)for(dt=m.call(q.ownerDocument);q.firstChild;)dt.appendChild(q.firstChild);else dt=q;return(W.shadowroot||W.shadowrootmode)&&(dt=D.call(n,dt,!0)),dt}let yt=ve?q.outerHTML:q.innerHTML;return ve&&K["!doctype"]&&q.ownerDocument&&q.ownerDocument.doctype&&q.ownerDocument.doctype.name&&ft(es,q.ownerDocument.doctype.name)&&(yt="<!DOCTYPE "+q.ownerDocument.doctype.name+`>
`+yt),He&&gn([F,P,O],Qt=>{yt=$r(yt,Qt," ")}),M&&Le?M.createHTML(yt):yt},t.setConfig=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ze(ge),J=!0},t.clearConfig=function(){Ge=null,J=!1},t.isValidAttribute=function(ge,H,q){Ge||Ze({});const le=De(ge),Ve=De(H);return dc(le,Ve,q)},t.addHook=function(ge,H){typeof H=="function"&&Ur(A[ge],H)},t.removeHook=function(ge,H){if(H!==void 0){const q=Kc(A[ge],H);return q===-1?void 0:Vc(A[ge],q,1)[0]}return Xa(A[ge])},t.removeHooks=function(ge){A[ge]=[]},t.removeAllHooks=function(){A=rs()},t}var os=ns();const cd=e=>window.G7Core?.state?.get?.(e),dd=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},ud=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},as=({product:e,onClick:t,shopBase:r="/shop",className:n=""})=>{const o=cd("preferredCurrency")||"KRW",a=w=>{const b=`multi_currency_${w}`,I=e[b];if(I&&I[o])return I[o].formatted;const S=`${w}_formatted`;return e[S]},s=e.name_localized??(typeof e.name=="string"?e.name:"")??"",l=a("selling_price"),f=a("list_price"),g=e.discount_rate&&e.discount_rate>0,c=e.sales_status&&e.sales_status!=="on_sale",i=e.labels??[],u=w=>os.sanitize(w,{ALLOWED_TAGS:["mark"],ALLOWED_ATTR:[]}),h=e.name_highlighted,p=e.description_highlighted??e.short_description,y=()=>{t?t(e.id):dd(`${r==="/"?"":r}/products/${e.id}`)};return d.jsxs(Q,{onClick:y,className:`block w-full text-left group bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow cursor-pointer ${n}`,children:[d.jsxs(j,{className:"relative aspect-square overflow-hidden bg-gray-100 dark:bg-gray-700",children:[d.jsx(Wt,{src:e.thumbnail_url,alt:s,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",loading:"lazy"}),c&&d.jsx(j,{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:d.jsx(re,{className:`text-lg font-bold ${e.sales_status==="sold_out"?"text-red-300":e.sales_status==="suspended"?"text-amber-300":"text-blue-300"}`,style:{textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:e.sales_status_label??e.sales_status})}),g&&e.sales_status!=="sold_out"&&e.sales_status!=="suspended"&&d.jsxs(re,{className:"absolute top-2 left-2 px-2 py-1 bg-red-500 text-white text-xs font-bold rounded",children:[e.discount_rate,"%"]}),i.length>0&&d.jsx(j,{className:"absolute bottom-2 right-2 flex gap-1 flex-wrap justify-end",children:i.map((w,b)=>d.jsx(re,{className:"text-xs text-white font-medium px-1.5 py-0.5 rounded",style:{backgroundColor:w.color||"#6b7280"},children:w.name},b))})]}),d.jsxs(j,{className:"p-4",children:[d.jsxs(j,{className:"flex items-center gap-1.5 flex-wrap",children:[e.primary_category&&d.jsx(re,{className:"inline-block text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 px-2 py-0.5 rounded",children:e.primary_category}),e.brand_name&&d.jsx(re,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.brand_name})]}),h?d.jsx(j,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:u(h)}}):d.jsx(dn,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1",children:s}),p&&d.jsx(j,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 line-clamp-2 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:u(p)}}),d.jsxs(j,{className:"mt-1.5 flex items-center gap-1",children:[ud(e.rating_avg??0).map((w,b)=>d.jsxs(re,{className:`text-xs ${w==="empty"?"text-gray-300 dark:text-gray-600":"text-yellow-400"}`,children:[w==="full"&&d.jsx("i",{className:"fa-solid fa-star"}),w==="half"&&d.jsx("i",{className:"fa-solid fa-star-half-stroke"}),w==="empty"&&d.jsx("i",{className:"fa-regular fa-star"})]},b)),d.jsx(re,{className:"text-xs text-gray-600 dark:text-gray-400 ml-0.5",children:(e.rating_avg??0).toFixed(1)}),d.jsxs(re,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",e.review_count??0,")"]})]}),d.jsxs(j,{className:"mt-2 flex items-baseline gap-2",children:[d.jsx(re,{className:"font-bold text-gray-900 dark:text-white",children:l}),f&&g&&d.jsx(re,{className:"text-sm text-gray-500 dark:text-gray-400 line-through",children:f})]})]})]})},fd=Object.freeze(Object.defineProperty({__proto__:null,default:as},Symbol.toStringTag,{value:"Module"})),ss="carousel",Br="controller",hd="navigation",gd="no-scroll",go="portal",pd="root",ls="toolbar",md="counter",Gr="fullscreen",is="slideshow",Wr="thumbnails",cs="zoom",yr="loading",po="playing",Kr="error",Vr="complete",bd="placeholder",Yr=e=>`active-slide-${e}`,yd=Yr(yr),vd=Yr(po),wd=Yr(Kr),xd=Yr(Vr),ds="fullsize",vr="flex_center",kd="no_scroll",us="no_scroll_padding",mo="slide",fs="slide_wrapper",Cd="slide_wrapper_interactive",Rt="prev",er="next",bo="swipe",wr="close",hs="onPointerDown",gs="onPointerMove",ps="onPointerUp",ms="onPointerLeave",bs="onPointerCancel",yo="onKeyDown",Sd="onKeyUp",vo="onWheel",Ed="Escape",_d="ArrowLeft",Td="ArrowRight",Nd="button",bn="icon",ys="contain",vs="cover",ws="Unknown action type",xs="yarl__";function st(...e){return[...e].filter(Boolean).join(" ")}function be(e){return`${xs}${e}`}function We(e){return`--${xs}${e}`}function nr(e,t){return`${e}${t?`_${t}`:""}`}function or(e){return t=>nr(e,t)}function ar(e,t){var r;return(r=e?.[t])!==null&&r!==void 0?r:t}function ks(e,t,r){return ar(e,"{index} of {total}").replace(/\{index}/g,`${Co(r,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function xr(...e){return()=>{e.forEach(t=>{t()})}}function Nt(e,t,r){return()=>{const n=_.useContext(r);if(!n)throw new Error(`${e} must be used within a ${t}.Provider`);return n}}function wo(){return typeof window<"u"}function xo(e,t=0){const r=10**t;return Math.round((e+Number.EPSILON)*r)/r}function sr(e){return e.type===void 0||e.type==="image"}function ko(e,t){return e.imageFit===vs||e.imageFit!==ys&&t===vs}function yn(e){return typeof e=="string"?Number.parseInt(e,10):e}function vn(e){if(typeof e=="number")return{pixel:e};if(typeof e=="string"){const t=yn(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function Ad(e,t){const r=vn(t),n=r.percent!==void 0?e.width/100*r.percent:r.pixel;return{width:Math.max(e.width-2*n,0),height:Math.max(e.height-2*n,0)}}function Md(){return(wo()?window?.devicePixelRatio:void 0)||1}function Co(e,t){return t>0?(e%t+t)%t:0}function So(e){return e.length>0}function Eo(e,t){return e[Co(t,e.length)]}function _o(e,t){return So(e)?Eo(e,t):void 0}function Cs(e){return sr(e)?e.src:void 0}function wn(e,t,r){if(!r)return e;const{buttons:n,...o}=e,a=n.findIndex(l=>l===t),s=_.isValidElement(r)?_.cloneElement(r,{key:t},null):r;if(a>=0){const l=[...n];return l.splice(a,1,s),{buttons:l,...o}}return{buttons:[s,...n],...o}}function Ss(e,t,r=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),r))}const Od=Number(_.version.split(".")[0])>=19;function Dd(e){return{inert:Od?e:e?"":void 0}}function Id(e){e.scrollTop}const To={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[wr]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:ys,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function At(e,t){return{name:e,component:t}}function et(e,t){return{module:e,children:t}}function Es(e,t,r){return e.module.name===t?r(e):e.children?[et(e.module,e.children.flatMap(n=>{var o;return(o=Es(n,t,r))!==null&&o!==void 0?o:[]}))]:[e]}function kr(e,t,r){return e.flatMap(n=>{var o;return(o=Es(n,t,r))!==null&&o!==void 0?o:[]})}function Pd(e,t=[],r=[]){let n=e;const o=h=>{const p=[...n];for(;p.length>0;){const y=p.pop();if(y?.module.name===h)return!0;y?.children&&p.push(...y.children)}return!1},a=(h,p)=>{if(h===""){n=[et(p,n)];return}n=kr(n,h,y=>[et(p,[y])])},s=(h,p)=>{n=kr(n,h,y=>[et(y.module,[et(p,y.children)])])},l=(h,p,y)=>{n=kr(n,h,w=>{var b;return[et(w.module,[...y?[et(p)]:[],...(b=w.children)!==null&&b!==void 0?b:[],...y?[]:[et(p)]])]})},f=(h,p,y)=>{n=kr(n,h,w=>[...y?[et(p)]:[],w,...y?[]:[et(p)]])},g=h=>{s(Br,h)},c=(h,p)=>{n=kr(n,h,y=>[et(p,y.children)])},i=h=>{n=kr(n,h,p=>p.children)},u=h=>{r.push(h)};return t.forEach(h=>{h({contains:o,addParent:a,append:s,addChild:l,addSibling:f,addModule:g,replace:c,remove:i,augment:u})}),{config:n,augmentation:h=>r.reduce((p,y)=>y(p),h)}}const _s=_.createContext(null),No=Nt("useA11yContext","A11yContext",_s);function Ld({children:e}){const[t,r]=_.useState(!1),[n,o]=_.useState(!1),a=_.useMemo(()=>({focusWithin:t,trackFocusWithin:(l,f)=>{const g=c=>i=>{var u;i.currentTarget.contains(i.relatedTarget)||r(c),(u=c?l:f)===null||u===void 0||u(i)};return{onFocus:g(!0),onBlur:g(!1)}},autoPlaying:n,setAutoPlaying:o}),[t,n]);return _.createElement(_s.Provider,{value:a},e)}const Ts=_.createContext(null),Cr=Nt("useDocument","DocumentContext",Ts);function Fd({nodeRef:e,children:t}){const r=_.useMemo(()=>{const n=a=>{var s;return((s=a||e.current)===null||s===void 0?void 0:s.ownerDocument)||document};return{getOwnerDocument:n,getOwnerWindow:a=>{var s;return((s=n(a))===null||s===void 0?void 0:s.defaultView)||window}}},[e]);return _.createElement(Ts.Provider,{value:r},t)}const Ns=_.createContext(null),Sr=Nt("useEvents","EventsContext",Ns);function Ud({children:e}){const[t]=_.useState({});_.useEffect(()=>()=>{Object.keys(t).forEach(n=>delete t[n])},[t]);const r=_.useMemo(()=>{const n=(s,l)=>{var f;(f=t[s])===null||f===void 0||f.splice(0,t[s].length,...t[s].filter(g=>g!==l))};return{publish:(...[s,l])=>{var f;(f=t[s])===null||f===void 0||f.forEach(g=>g(l))},subscribe:(s,l)=>(t[s]||(t[s]=[]),t[s].push(l),()=>n(s,l)),unsubscribe:n}},[t]);return _.createElement(Ns.Provider,{value:r},e)}const As=_.createContext(null),tt=Nt("useLightboxProps","LightboxPropsContext",As);function Ms({children:e,...t}){return _.createElement(As.Provider,{value:t},e)}const Os=_.createContext(null),Mt=Nt("useLightboxState","LightboxStateContext",Os),Ds=_.createContext(null),$d=Nt("useLightboxDispatch","LightboxDispatchContext",Ds);function zd(e,t){switch(t.type){case"swipe":{const{slides:r}=e,n=t?.increment||0,o=e.globalIndex+n,a=Co(o,r.length),s=_o(r,a),l=n||t.duration!==void 0?{increment:n,duration:t.duration,easing:t.easing}:void 0;return{slides:r,currentIndex:a,globalIndex:o,currentSlide:s,animation:l}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:_o(t.slides,t.index)}:e;default:throw new Error(ws)}}function Hd({slides:e,index:t,children:r}){const[n,o]=_.useReducer(zd,{slides:e,currentIndex:t,globalIndex:t,currentSlide:_o(e,t)});_.useEffect(()=>{o({type:"update",slides:e,index:t})},[e,t]);const a=_.useMemo(()=>({...n,state:n,dispatch:o}),[n,o]);return _.createElement(Ds.Provider,{value:o},_.createElement(Os.Provider,{value:a},r))}const Is=_.createContext(null),Xr=Nt("useTimeouts","TimeoutsContext",Is);function jd({children:e}){const[t]=_.useState([]);_.useEffect(()=>()=>{t.forEach(n=>window.clearTimeout(n)),t.splice(0,t.length)},[t]);const r=_.useMemo(()=>{const n=s=>{t.splice(0,t.length,...t.filter(l=>l!==s))};return{setTimeout:(s,l)=>{const f=window.setTimeout(()=>{n(f),s()},l);return t.push(f),f},clearTimeout:s=>{s!==void 0&&(n(s),window.clearTimeout(s))}}},[t]);return _.createElement(Is.Provider,{value:r},e)}const Er=_.forwardRef(function({label:t,className:r,icon:n,renderIcon:o,onClick:a,style:s,...l},f){const{styles:g,labels:c}=tt(),i=ar(c,t);return _.createElement("button",{ref:f,type:"button",title:i,"aria-label":i,className:st(be(Nd),r),onClick:a,style:{...s,...g.button},...l},o?o():_.createElement(n,{className:be(bn),style:g.icon}))});function Ps(e,t){const r=n=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...n},t);return r.displayName=e,r}function gt(e,t){return Ps(e,_.createElement("g",{fill:"currentColor"},_.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}function Bd(e,t){return Ps(e,_.createElement(_.Fragment,null,_.createElement("defs",null,_.createElement("mask",{id:"strike"},_.createElement("path",{d:"M0 0h24v24H0z",fill:"white"}),_.createElement("path",{d:"M0 0L24 24",stroke:"black",strokeWidth:4}))),_.createElement("path",{d:"M0.70707 2.121320L21.878680 23.292883",stroke:"currentColor",strokeWidth:2}),_.createElement("g",{fill:"currentColor",mask:"url(#strike)"},_.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t)))}const Gd=gt("Close",_.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),Wd=gt("Previous",_.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),Kd=gt("Next",_.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),Vd=gt("Loading",_.createElement(_.Fragment,null,Array.from({length:8}).map((e,t,r)=>_.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/r.length*(t+1),transform:`rotate(${360/r.length*t}, 12, 12)`})))),Yd=gt("Error",_.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),Ft=wo()?_.useLayoutEffect:_.useEffect;function Ao(){const[e,t]=_.useState(!1);return _.useEffect(()=>{var r,n;const o=(r=window.matchMedia)===null||r===void 0?void 0:r.call(window,"(prefers-reduced-motion: reduce)");t(o?.matches);const a=s=>t(s.matches);return(n=o?.addEventListener)===null||n===void 0||n.call(o,"change",a),()=>{var s;return(s=o?.removeEventListener)===null||s===void 0?void 0:s.call(o,"change",a)}},[]),e}function Xd(e){let t=0,r=0,n=0;const a=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(a){const s=a[1].split(",").map(yn);s.length===6?(t=s[4],r=s[5]):s.length===16&&(t=s[12],r=s[13],n=s[14])}return{x:t,y:r,z:n}}function Mo(e,t){const r=_.useRef(void 0),n=_.useRef(void 0),o=Ao();return Ft(()=>{var a,s,l;if(e.current&&r.current!==void 0&&!o){const{keyframes:f,duration:g,easing:c,onfinish:i}=t(r.current,e.current.getBoundingClientRect(),Xd(e.current))||{};if(f&&g){(a=n.current)===null||a===void 0||a.cancel(),n.current=void 0;try{n.current=(l=(s=e.current).animate)===null||l===void 0?void 0:l.call(s,f,{duration:g,easing:c})}catch(u){console.error(u)}n.current&&(n.current.onfinish=()=>{n.current=void 0,i?.()})}}r.current=void 0}),{prepareAnimation:a=>{r.current=a},isAnimationPlaying:()=>{var a;return((a=n.current)===null||a===void 0?void 0:a.playState)==="running"}}}function Ls(){const e=_.useRef(null),t=_.useRef(void 0),[r,n]=_.useState();return{setContainerRef:_.useCallback(a=>{e.current=a,t.current&&(t.current.disconnect(),t.current=void 0);const s=()=>{if(a){const l=window.getComputedStyle(a),f=g=>parseFloat(g)||0;n({width:Math.round(a.clientWidth-f(l.paddingLeft)-f(l.paddingRight)),height:Math.round(a.clientHeight-f(l.paddingTop)-f(l.paddingBottom))})}else n(void 0)};s(),a&&typeof ResizeObserver<"u"&&(t.current=new ResizeObserver(s),t.current.observe(a))},[]),containerRef:e,containerRect:r}}function xn(){const e=_.useRef(void 0),{setTimeout:t,clearTimeout:r}=Xr();return _.useCallback((n,o)=>{r(e.current),e.current=t(n,o>0?o:0)},[t,r])}function Oe(e){const t=_.useRef(e);return Ft(()=>{t.current=e}),_.useCallback((...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function Fs(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Oo(e,t){return _.useMemo(()=>e==null&&t==null?null:r=>{Fs(e,r),Fs(t,r)},[e,t])}function Us(e,t=!1){const r=_.useRef(!1);Ft(()=>{t&&r.current&&(r.current=!1,e())},[t,e]);const n=_.useCallback(()=>{r.current=!0},[]),o=_.useCallback(()=>{r.current=!1},[]);return{onFocus:n,onBlur:o}}function kn(){const[e,t]=_.useState(!1);return Ft(()=>{t(window.getComputedStyle(window.document.documentElement).direction==="rtl")},[]),e}function $s(){const[e]=_.useState({}),t=_.useCallback((o,a)=>{var s;(s=e[o])===null||s===void 0||s.forEach(l=>{a.isPropagationStopped()||l(a)})},[e]),r=_.useMemo(()=>({onPointerDown:o=>t(hs,o),onPointerMove:o=>t(gs,o),onPointerUp:o=>t(ps,o),onPointerLeave:o=>t(ms,o),onPointerCancel:o=>t(bs,o),onKeyDown:o=>t(yo,o),onKeyUp:o=>t(Sd,o),onWheel:o=>t(vo,o)}),[t]),n=_.useCallback((o,a)=>(e[o]||(e[o]=[]),e[o].unshift(a),()=>{const s=e[o];s&&s.splice(0,s.length,...s.filter(l=>l!==a))}),[e]);return{registerSensors:r,subscribeSensors:n}}function zs(e,t){const r=_.useRef(0),n=xn(),o=Oe((...a)=>{r.current=Date.now(),e(a)});return _.useCallback((...a)=>{n(()=>{o(a)},t-(Date.now()-r.current))},[t,o,n])}const Do=or("slide"),Io=or("slide_image");function lr({slide:e,offset:t,render:r,rect:n,imageFit:o,imageProps:a,onClick:s,onLoad:l,onError:f,style:g}){var c,i,u,h,p,y,w,b;const[I,S]=_.useState(yr),{publish:M}=Sr(),{setTimeout:L}=Xr(),E=_.useRef(null);_.useEffect(()=>{t===0&&M(Yr(I))},[t,I,M]);const T=Oe(z=>{("decode"in z?z.decode():Promise.resolve()).catch(()=>{}).then(()=>{z.parentNode&&(S(Vr),L(()=>{l?.(z)},0))})}),m=_.useCallback(z=>{E.current=z,z?.complete&&T(z)},[T]),v=_.useCallback(z=>{T(z.currentTarget)},[T]),D=Oe(()=>{S(Kr),f?.()}),A=ko(e,o),F=(z,W)=>Number.isFinite(z)?z:W,P=F(Math.max(...((i=(c=e.srcSet)===null||c===void 0?void 0:c.map(z=>z.width))!==null&&i!==void 0?i:[]).concat(e.width?[e.width]:[]).filter(Boolean)),((u=E.current)===null||u===void 0?void 0:u.naturalWidth)||0),O=F(Math.max(...((p=(h=e.srcSet)===null||h===void 0?void 0:h.map(z=>z.height))!==null&&p!==void 0?p:[]).concat(e.height?[e.height]:[]).filter(Boolean)),((y=E.current)===null||y===void 0?void 0:y.naturalHeight)||0),N=P&&O?{maxWidth:`min(${P}px, 100%)`,maxHeight:`min(${O}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},C=(w=e.srcSet)===null||w===void 0?void 0:w.sort((z,W)=>z.width-W.width).map(z=>`${z.src} ${z.width}w`).join(", "),k=()=>n&&!A&&e.width&&e.height?n.height/e.height*e.width:Number.MAX_VALUE,U=C&&n&&wo()?`${Math.round(Math.min(k(),n.width))}px`:void 0,{style:$,className:G,...K}=a||{};return _.createElement(_.Fragment,null,_.createElement("img",{ref:m,onLoad:v,onError:D,onClick:s,draggable:!1,className:st(be(Io()),A&&be(Io("cover")),I!==Vr&&be(Io("loading")),G),style:{...N,...g,...$},...K,alt:(b=e.alt)!==null&&b!==void 0?b:"",sizes:U,srcSet:C,src:e.src}),I!==Vr&&_.createElement("div",{className:be(Do(bd))},I===yr&&(r?.iconLoading?r.iconLoading():_.createElement(Vd,{className:st(be(bn),be(Do(yr)))})),I===Kr&&(r?.iconError?r.iconError():_.createElement(Yd,{className:st(be(bn),be(Do(Kr)))}))))}const Zd=_.forwardRef(function({className:t,children:r,onFocus:n,onBlur:o,...a},s){const l=_.useRef(null),{trackFocusWithin:f}=No();return _.createElement(Fd,{nodeRef:l},_.createElement("div",{ref:Oo(s,l),className:st(be("root"),t),...f(n,o),...a},r))});var lt;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL",e[e.ANIMATION=3]="ANIMATION"})(lt||(lt={}));function Hs(e,t,r,n,o){_.useEffect(()=>o?()=>{}:xr(e(hs,t),e(gs,r),e(ps,n),e(ms,n),e(bs,n)),[e,t,r,n,o])}var Ut;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"})(Ut||(Ut={}));const Po=30;function qd({disableSwipeNavigation:e,closeOnBackdropClick:t},r,n,o,a,s,l,f,g,c,i,u,h,p,y,w){const b=_.useRef(0),I=_.useRef([]),S=_.useRef(void 0),M=_.useRef(0),L=_.useRef(Ut.NONE),E=_.useCallback(P=>{S.current===P.pointerId&&(S.current=void 0,L.current=Ut.NONE);const O=I.current;O.splice(0,O.length,...O.filter(N=>N.pointerId!==P.pointerId))},[]),T=_.useCallback(P=>{E(P),P.persist(),I.current.push(P)},[E]),m=_.useCallback(P=>I.current.find(({pointerId:O})=>P.pointerId===O),[]),v=Oe(P=>{T(P)}),D=(P,O)=>i&&P>O||c&&P<-O,A=Oe(P=>{const O=m(P);if(O)if(S.current===P.pointerId){const N=Date.now()-M.current,C=b.current;L.current===Ut.SWIPE?Math.abs(C)>.3*o||Math.abs(C)>5&&N<a?f(C,N):g(C):L.current===Ut.PULL&&(D(C,2*Po)?p(C,N):y(C)),b.current=0,L.current=Ut.NONE}else{const{target:N}=P;t&&N instanceof HTMLElement&&N===O.target&&(N.classList.contains(be(mo))||N.classList.contains(be(fs)))&&w()}E(P)}),F=Oe(P=>{const O=m(P);if(O){const N=S.current===P.pointerId;if(P.buttons===0){N&&b.current!==0?A(P):E(O);return}const C=P.clientX-O.clientX,k=P.clientY-O.clientY;if(S.current===void 0){const U=$=>{T(P),S.current=P.pointerId,M.current=Date.now(),L.current=$};Math.abs(C)>Math.abs(k)&&Math.abs(C)>Po&&n(C)?e||(U(Ut.SWIPE),s()):Math.abs(k)>Math.abs(C)&&D(k,Po)&&(U(Ut.PULL),u())}else N&&(L.current===Ut.SWIPE?(b.current=C,l(C)):L.current===Ut.PULL&&(b.current=k,h(k)))}});Hs(r,v,F,A)}function Qd({preventDefaultWheelX:e,preventDefaultWheelY:t}){const r=_.useRef(null),n=Oe(o=>{const a=Math.abs(o.deltaX)>Math.abs(o.deltaY);(a&&e||!a&&t||o.ctrlKey)&&o.preventDefault()});return _.useCallback(o=>{var a;o?o.addEventListener("wheel",n,{passive:!1}):(a=r.current)===null||a===void 0||a.removeEventListener("wheel",n),r.current=o},[n])}function Jd(e,t,r,n,o,a,s,l,f){const g=_.useRef(0),c=_.useRef(0),i=_.useRef(void 0),u=_.useRef(void 0),h=_.useRef(0),p=_.useRef(void 0),y=_.useRef(0),{setTimeout:w,clearTimeout:b}=Xr(),I=_.useCallback(()=>{i.current&&(b(i.current),i.current=void 0)},[b]),S=_.useCallback(()=>{u.current&&(b(u.current),u.current=void 0)},[b]),M=Oe(()=>{e!==lt.SWIPE&&(g.current=0,y.current=0,I(),S())});_.useEffect(M,[e,M]);const L=Oe(T=>{u.current=void 0,g.current===T&&f(g.current)}),E=Oe(T=>{if(T.ctrlKey||Math.abs(T.deltaY)>Math.abs(T.deltaX))return;const m=v=>{h.current=v,b(p.current),p.current=v>0?w(()=>{h.current=0,p.current=void 0},300):void 0};if(e===lt.NONE){if(Math.abs(T.deltaX)<=1.2*Math.abs(h.current)){m(T.deltaX);return}if(!r(-T.deltaX))return;if(c.current+=T.deltaX,I(),Math.abs(c.current)>30)c.current=0,m(0),y.current=Date.now(),a();else{const v=c.current;i.current=w(()=>{i.current=void 0,v===c.current&&(c.current=0)},o)}}else if(e===lt.SWIPE){let v=g.current-T.deltaX;if(v=Math.min(Math.abs(v),n)*Math.sign(v),g.current=v,s(v),S(),Math.abs(v)>.2*n){m(T.deltaX),l(v,Date.now()-y.current);return}u.current=w(()=>L(v),2*o)}else m(T.deltaX)});_.useEffect(()=>t(vo,E),[t,E])}const js=or("container"),Bs=_.createContext(null),$t=Nt("useController","ControllerContext",Bs);function Rd({children:e,...t}){var r;const{carousel:n,animation:o,controller:a,on:s,styles:l,render:f}=t,{closeOnPullUp:g,closeOnPullDown:c,preventDefaultWheelX:i,preventDefaultWheelY:u}=a,[h,p]=_.useState(),y=Mt(),w=$d(),[b,I]=_.useState(lt.NONE),S=_.useRef(0),M=_.useRef(0),L=_.useRef(1),{registerSensors:E,subscribeSensors:T}=$s(),{subscribe:m,publish:v}=Sr(),D=xn(),A=xn(),F=xn(),{containerRef:P,setContainerRef:O,containerRect:N}=Ls(),C=Oo(Qd({preventDefaultWheelX:i,preventDefaultWheelY:u}),O),k=_.useRef(null),U=Oo(k,void 0),{getOwnerDocument:$}=Cr(),G=kn(),K=Y=>(G?-1:1)*(typeof Y=="number"?Y:1),z=Oe(()=>{var Y;return(Y=P.current)===null||Y===void 0?void 0:Y.focus()}),W=Oe(()=>t),V=Oe(()=>y),B=_.useCallback(Y=>v(Rt,Y),[v]),Z=_.useCallback(Y=>v(er,Y),[v]),pe=_.useCallback(()=>v(wr),[v]),ie=Y=>!(n.finite&&(K(Y)>0&&y.currentIndex===0||K(Y)<0&&y.currentIndex===y.slides.length-1)),fe=Y=>{var te;S.current=Y,(te=P.current)===null||te===void 0||te.style.setProperty(We("swipe_offset"),`${Math.round(Y)}px`)},ee=Y=>{var te,de;M.current=Y,L.current=(()=>{const je=c&&Y>0?Y:g&&Y<0?-Y:0;return Math.min(Math.max(xo(1-je/60*(1-.5),2),.5),1)})(),(te=P.current)===null||te===void 0||te.style.setProperty(We("pull_offset"),`${Math.round(Y)}px`),(de=P.current)===null||de===void 0||de.style.setProperty(We("pull_opacity"),`${L.current}`)},{prepareAnimation:_e}=Mo(k,(Y,te,de)=>{if(k.current&&N)return{keyframes:[{transform:`translate(0, ${Y.rect.y-te.y+de.y}px)`,opacity:Y.opacity},{transform:"translate(0, 0)",opacity:1}],duration:Y.duration,easing:o.easing.fade}}),ye=(Y,te)=>{if(g||c){ee(Y);let de=0;k.current&&(de=o.fade*(te?2:1),_e({rect:k.current.getBoundingClientRect(),opacity:L.current,duration:de})),F(()=>{ee(0),I(lt.NONE)},de),I(lt.ANIMATION),te||pe()}},{prepareAnimation:He,isAnimationPlaying:Fe}=Mo(k,(Y,te,de)=>{var ae;if(k.current&&N&&(!((ae=y.animation)===null||ae===void 0)&&ae.duration)){const Ee=vn(n.spacing),je=(Ee.percent?Ee.percent*N.width/100:Ee.pixel)||0;return{keyframes:[{transform:`translate(${K(y.globalIndex-Y.index)*(N.width+je)+Y.rect.x-te.x+de.x}px, 0)`},{transform:"translate(0, 0)"}],duration:y.animation.duration,easing:y.animation.easing}}}),ve=Oe(Y=>{var te,de;const ae=Y.offset||0,Ee=ae?o.swipe:(te=o.navigation)!==null&&te!==void 0?te:o.swipe,je=!ae&&!Fe()?o.easing.navigation:o.easing.swipe;let{direction:ze}=Y;const Me=(de=Y.count)!==null&&de!==void 0?de:1;let Xe=lt.ANIMATION,$e=Ee*Me;if(!ze){const ne=N?.width,ce=Y.duration||0,se=ne?Ee/ne*Math.abs(ae):Ee;Me!==0?(ce<se?$e=$e/se*Math.max(ce,se/5):ne&&($e=Ee/ne*(ne-Math.abs(ae))),ze=K(ae)>0?Rt:er):$e=Ee/2}let X=0;ze===Rt?ie(K(1))?X=-Me:(Xe=lt.NONE,$e=Ee):ze===er&&(ie(K(-1))?X=Me:(Xe=lt.NONE,$e=Ee)),$e=Math.round($e),A(()=>{fe(0),I(lt.NONE)},$e),k.current&&He({rect:k.current.getBoundingClientRect(),index:y.globalIndex}),I(Xe),v(bo,{type:"swipe",increment:X,duration:$e,easing:je})});_.useEffect(()=>{var Y,te;!((Y=y.animation)===null||Y===void 0)&&Y.increment&&(!((te=y.animation)===null||te===void 0)&&te.duration)&&D(()=>w({type:"swipe",increment:0}),y.animation.duration)},[y.animation,w,D]);const J=[T,ie,N?.width||0,o.swipe,()=>I(lt.SWIPE),Y=>fe(Y),(Y,te)=>ve({offset:Y,duration:te,count:1}),Y=>ve({offset:Y,count:0})],he=[()=>{c&&I(lt.PULL)},Y=>ee(Y),Y=>ye(Y),Y=>ye(Y,!0)];qd(a,...J,g,c,...he,pe),Jd(b,...J);const xe=Oe(()=>{a.focus&&$().querySelector(`.${be(go)} .${be(js())}`)&&z()});_.useEffect(xe,[xe]);const Ue=Oe(()=>{var Y;(Y=s.view)===null||Y===void 0||Y.call(s,{index:y.currentIndex})});_.useEffect(Ue,[y.globalIndex,Ue]),_.useEffect(()=>xr(m(Rt,Y=>ve({direction:Rt,...Y})),m(er,Y=>ve({direction:er,...Y})),m(bo,Y=>w(Y))),[m,ve,w]);const Le=_.useMemo(()=>({prev:B,next:Z,close:pe,focus:z,slideRect:N?Ad(N,n.padding):{width:0,height:0},containerRect:N||{width:0,height:0},subscribeSensors:T,containerRef:P,setCarouselRef:U,toolbarWidth:h,setToolbarWidth:p}),[B,Z,pe,z,T,N,P,U,h,p,n.padding]);return _.useImperativeHandle(a.ref,()=>({prev:B,next:Z,close:pe,focus:z,getLightboxProps:W,getLightboxState:V}),[B,Z,pe,z,W,V]),_.createElement("div",{ref:C,className:st(be(js()),be(vr)),style:{...b===lt.SWIPE?{[We("swipe_offset")]:`${Math.round(S.current)}px`}:null,...b===lt.PULL?{[We("pull_offset")]:`${Math.round(M.current)}px`,[We("pull_opacity")]:`${L.current}`}:null,...a.touchAction!=="none"?{[We("controller_touch_action")]:a.touchAction}:null,...l.container},tabIndex:-1,...E},N&&_.createElement(Bs.Provider,{value:Le},e,(r=f.controls)===null||r===void 0?void 0:r.call(f)))}const eu=At(Br,Rd);function ir(e){return nr(ss,e)}function Gs(e){return nr(mo,e)}function tu({slide:e,offset:t}){const r=_.useRef(null),{currentIndex:n,slides:o}=Mt(),{slideRect:a,focus:s}=$t(),{render:l,carousel:{imageFit:f,imageProps:g},on:{click:c},styles:{slide:i},labels:u}=tt(),{getOwnerDocument:h}=Cr(),p=t!==0;_.useEffect(()=>{var w;p&&(!((w=r.current)===null||w===void 0)&&w.contains(h().activeElement))&&s()},[p,s,h]);const y=()=>{var w,b,I,S;let M=(w=l.slide)===null||w===void 0?void 0:w.call(l,{slide:e,offset:t,rect:a});return!M&&sr(e)&&(M=_.createElement(lr,{slide:e,offset:t,render:l,rect:a,imageFit:f,imageProps:g,onClick:p?void 0:()=>c?.({index:n})})),M?_.createElement(_.Fragment,null,(b=l.slideHeader)===null||b===void 0?void 0:b.call(l,{slide:e}),((I=l.slideContainer)!==null&&I!==void 0?I:(({children:L})=>L))({slide:e,children:M}),(S=l.slideFooter)===null||S===void 0?void 0:S.call(l,{slide:e})):null};return _.createElement("div",{ref:r,className:st(be(Gs()),!p&&be(Gs("current")),be(vr)),...Dd(p),style:i,role:"group","aria-roledescription":ar(u,"Slide"),"aria-label":ks(u,o,n+t)},y())}function ru(){const e=tt().styles.slide;return _.createElement("div",{className:be(mo),style:e})}function nu({carousel:e,labels:t}){const{slides:r,currentIndex:n,globalIndex:o}=Mt(),{setCarouselRef:a}=$t(),{autoPlaying:s,focusWithin:l}=No(),f=vn(e.spacing),g=vn(e.padding),c=Ss(e,r,1),i=[];if(So(r))for(let u=n-c;u<=n+c;u+=1){const h=Eo(r,u),p=o-n+u,y=e.finite&&(u<0||u>r.length-1);i.push(y?{key:p}:{key:[`${p}`,Cs(h)].filter(Boolean).join("|"),offset:u-n,slide:h})}return _.createElement("div",{ref:a,className:st(be(ir()),i.length>0&&be(ir("with_slides"))),style:{[`${We(ir("slides_count"))}`]:i.length,[`${We(ir("spacing_px"))}`]:f.pixel||0,[`${We(ir("spacing_percent"))}`]:f.percent||0,[`${We(ir("padding_px"))}`]:g.pixel||0,[`${We(ir("padding_percent"))}`]:g.percent||0},role:"region","aria-live":s&&!l?"off":"polite","aria-roledescription":ar(t,"Carousel"),"aria-label":ar(t,"Photo gallery")},i.map(({key:u,slide:h,offset:p})=>h?_.createElement(tu,{key:u,slide:h,offset:p}):_.createElement(ru,{key:u})))}const ou=At(ss,nu);function Ws(){const{carousel:e}=tt(),{slides:t,currentIndex:r}=Mt(),n=t.length===0||e.finite&&r===0,o=t.length===0||e.finite&&r===t.length-1;return{prevDisabled:n,nextDisabled:o}}function Ks(e){var t;const r=kn(),{publish:n}=Sr(),{animation:o}=tt(),{prevDisabled:a,nextDisabled:s}=Ws(),l=((t=o.navigation)!==null&&t!==void 0?t:o.swipe)/2,f=zs(()=>n(Rt),l),g=zs(()=>n(er),l),c=Oe(i=>{switch(i.key){case Ed:n(wr);break;case _d:(r?s:a)||(r?g:f)();break;case Td:(r?a:s)||(r?f:g)();break}});_.useEffect(()=>e(yo,c),[e,c])}function Vs({label:e,icon:t,renderIcon:r,action:n,onClick:o,disabled:a,style:s}){return _.createElement(Er,{label:e,icon:t,renderIcon:r,className:be(`navigation_${n}`),disabled:a,onClick:o,style:s,...Us($t().focus,a)})}function au({render:{buttonPrev:e,buttonNext:t,iconPrev:r,iconNext:n},styles:o}){const{prev:a,next:s,subscribeSensors:l}=$t(),{prevDisabled:f,nextDisabled:g}=Ws();return Ks(l),_.createElement(_.Fragment,null,e?e():_.createElement(Vs,{label:"Previous",action:Rt,icon:Wd,renderIcon:r,style:o.navigationPrev,disabled:f,onClick:a}),t?t():_.createElement(Vs,{label:"Next",action:er,icon:Kd,renderIcon:n,style:o.navigationNext,disabled:g,onClick:s}))}const su=At(hd,au),Ys=be(kd),lu=be(us);function iu(e){return"style"in e}function Xs(e,t,r){const n=window.getComputedStyle(e),o=r?"padding-left":"padding-right",a=r?n.paddingLeft:n.paddingRight,s=e.style.getPropertyValue(o);return e.style.setProperty(o,`${(yn(a)||0)+t}px`),()=>{s?e.style.setProperty(o,s):e.style.removeProperty(o)}}function cu({noScroll:{disabled:e},children:t}){const r=kn(),{getOwnerDocument:n,getOwnerWindow:o}=Cr();return _.useEffect(()=>{if(e)return()=>{};const a=[],s=o(),{body:l,documentElement:f}=n(),g=Math.round(s.innerWidth-f.clientWidth);if(g>0){a.push(Xs(l,g,r));const c=l.getElementsByTagName("*");for(let i=0;i<c.length;i+=1){const u=c[i];iu(u)&&s.getComputedStyle(u).getPropertyValue("position")==="fixed"&&!u.classList.contains(lu)&&a.push(Xs(u,g,r))}}return l.classList.add(Ys),()=>{l.classList.remove(Ys),a.forEach(c=>c())}},[r,e,n,o]),_.createElement(_.Fragment,null,t)}const du=At(gd,cu);function Zs(e){return nr(go,e)}function qs(e,t,r){const n=e.getAttribute(t);return e.setAttribute(t,r),()=>{n?e.setAttribute(t,n):e.removeAttribute(t)}}function uu({children:e,animation:t,styles:r,className:n,on:o,portal:a,close:s,labels:l}){const[f,g]=_.useState(!1),[c,i]=_.useState(!1),u=_.useRef([]),h=_.useRef(null),{setTimeout:p}=Xr(),{subscribe:y}=Sr(),b=Ao()?0:t.fade;_.useEffect(()=>(g(!0),()=>{g(!1),i(!1)}),[]);const I=Oe(()=>{u.current.forEach(E=>E()),u.current=[]}),S=Oe(()=>{var E;i(!1),I(),(E=o.exiting)===null||E===void 0||E.call(o),p(()=>{var T;(T=o.exited)===null||T===void 0||T.call(o),s()},b)});_.useEffect(()=>y(wr,S),[y,S]);const M=Oe(E=>{var T,m,v;Id(E),i(!0),(T=o.entering)===null||T===void 0||T.call(o);const D=(v=(m=E.parentNode)===null||m===void 0?void 0:m.children)!==null&&v!==void 0?v:[];for(let A=0;A<D.length;A+=1){const F=D[A];["TEMPLATE","SCRIPT","STYLE"].indexOf(F.tagName)===-1&&F!==E&&(u.current.push(qs(F,"inert","")),u.current.push(qs(F,"aria-hidden","true")))}u.current.push(()=>{var A,F;(F=(A=h.current)===null||A===void 0?void 0:A.focus)===null||F===void 0||F.call(A)}),p(()=>{var A;(A=o.entered)===null||A===void 0||A.call(o)},b)}),L=_.useCallback(E=>{E?M(E):I()},[M,I]);return f?Jt.createPortal(_.createElement(Zd,{ref:L,className:st(n,be(Zs()),be(us),c&&be(Zs("open"))),"aria-modal":!0,role:"dialog","aria-label":ar(l,"Lightbox"),style:{...t.fade!==To.animation.fade?{[We("fade_animation_duration")]:`${b}ms`}:null,...t.easing.fade!==To.animation.easing.fade?{[We("fade_animation_timing_function")]:t.easing.fade}:null,...r.root},onFocus:E=>{h.current||(h.current=E.relatedTarget)}},e),a.root||document.body):null}const fu=At(go,uu);function hu({children:e}){return _.createElement(_.Fragment,null,e)}const gu=At(pd,hu);function pu(e){return nr(ls,e)}function mu({toolbar:{buttons:e},render:{buttonClose:t,iconClose:r},styles:n}){const{close:o,setToolbarWidth:a}=$t(),{setContainerRef:s,containerRect:l}=Ls();Ft(()=>{a(l?.width)},[a,l?.width]);const f=()=>t?t():_.createElement(Er,{key:wr,label:"Close",icon:Gd,renderIcon:r,onClick:o});return _.createElement("div",{ref:s,style:n.toolbar,className:be(pu())},e?.map(g=>g===wr?f():g))}const bu=At(ls,mu);function Qs(e,t){var r;return _.createElement(e.module.component,{key:e.module.name,...t},(r=e.children)===null||r===void 0?void 0:r.map(n=>Qs(n,t)))}function yu(e,t={}){const{easing:r,...n}=e,{easing:o,...a}=t;return{easing:{...r,...o},...n,...a}}function vu({carousel:e,animation:t,render:r,toolbar:n,controller:o,noScroll:a,on:s,plugins:l,slides:f,index:g,...c}){const{animation:i,carousel:u,render:h,toolbar:p,controller:y,noScroll:w,on:b,slides:I,index:S,plugins:M,...L}=To,{config:E,augmentation:T}=Pd([et(fu,[et(du,[et(eu,[et(ou),et(bu),et(su)])])])],l||M),m=T({animation:yu(i,t),carousel:{...u,...e},render:{...h,...r},toolbar:{...p,...n},controller:{...y,...o},noScroll:{...w,...a},on:{...b,...s},...L,...c});return m.open?_.createElement(Ms,{...m},_.createElement(Hd,{slides:f||I,index:yn(g||S)},_.createElement(jd,null,_.createElement(Ud,null,_.createElement(Ld,null,Qs(et(gu,E),m)))))):null}const wu={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1};function xu(e){return Math.min(Math.max(e,Number.EPSILON),1)}function Js(e){const{minZoom:t,...r}={...wu,...e};return{minZoom:xu(t),...r}}function ku(e,t,r,n){const o=_.useRef(void 0),a=_.useRef(void 0),{zoom:s}=tt().animation,l=Ao(),f=Oe(()=>{var g,c,i;if((g=o.current)===null||g===void 0||g.cancel(),o.current=void 0,a.current&&n?.current){try{o.current=(i=(c=n.current).animate)===null||i===void 0?void 0:i.call(c,[{transform:a.current},{transform:`scale(${e}) translateX(${t}px) translateY(${r}px)`}],{duration:l?0:s??500,easing:o.current?"ease-out":"ease-in-out"})}catch(u){console.error(u)}a.current=void 0,o.current&&(o.current.onfinish=()=>{o.current=void 0})}});return Ft(f,[e,t,r,f]),_.useCallback(()=>{a.current=n?.current?window.getComputedStyle(n.current).transform:void 0},[n])}function Cu(e,t){const{on:r}=tt(),n=Oe(()=>{var o;t||(o=r.zoom)===null||o===void 0||o.call(r,{zoom:e})});_.useEffect(n,[e,n])}function Cn(){const{zoom:e}=tt();return Js(e)}function Su(e,t){var r,n;let o={width:0,height:0},a={width:0,height:0};const{currentSlide:s}=Mt(),{imageFit:l}=tt().carousel,{maxZoomPixelRatio:f}=Cn();if(e&&s){const c={...s,...t};if(sr(c)){const i=ko(c,l),u=Math.max(...(((r=c.srcSet)===null||r===void 0?void 0:r.map(p=>p.width))||[]).concat(c.width?[c.width]:[])),h=Math.max(...(((n=c.srcSet)===null||n===void 0?void 0:n.map(p=>p.height))||[]).concat(c.height?[c.height]:[]));u>0&&h>0&&e.width>0&&e.height>0&&(a=i?{width:Math.round(Math.min(u,e.width/e.height*h)),height:Math.round(Math.min(h,e.height/e.width*u))}:{width:u,height:h},a={width:a.width*f,height:a.height*f},o=i?{width:Math.min(e.width,a.width,u),height:Math.min(e.height,a.height,h)}:{width:Math.round(Math.min(e.width,e.height/h*u,u)),height:Math.round(Math.min(e.height,e.width/u*h,h))})}}const g=o.width?Math.max(xo(a.width/o.width,5),1):1;return{imageRect:o,maxZoom:g}}function Rs(e,t){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)}function el(e,t,r=100,n=2){return e*Math.min(1+Math.abs(t/r),n)**Math.sign(t)}function Eu(e,t,r,n,o,a,s,l,f){const g=_.useRef([]),c=_.useRef(0),i=_.useRef(void 0),{globalIndex:u}=Mt(),{getOwnerWindow:h}=Cr(),{containerRef:p,subscribeSensors:y}=$t(),{keyboardMoveDistance:w,zoomInMultiplier:b,wheelZoomDistanceFactor:I,scrollToZoom:S,doubleTapDelay:M,doubleClickDelay:L,doubleClickMaxStops:E,pinchZoomDistanceFactor:T,pinchZoomV4:m}=Cn(),v=_.useCallback(U=>{if(p.current){const{pageX:$,pageY:G}=U,{scrollX:K,scrollY:z}=h(),{left:W,top:V,width:B,height:Z}=p.current.getBoundingClientRect();return[$-W-K-B/2,G-V-z-Z/2]}return[]},[p,h]),D=Oe(U=>{const{key:$,metaKey:G,ctrlKey:K}=U,z=G||K,W=()=>{U.preventDefault(),U.stopPropagation()};if(e>1){const V=(B,Z)=>{W(),l(B,Z)};$==="ArrowDown"?V(0,w):$==="ArrowUp"?V(0,-w):$==="ArrowLeft"?V(-w,0):$==="ArrowRight"&&V(w,0)}$==="+"||z&&$==="="?(W(),o()):$==="-"||z&&$==="_"?(W(),a()):z&&$==="0"&&(W(),s(1))}),A=Oe(U=>{if((U.ctrlKey||S)&&Math.abs(U.deltaY)>Math.abs(U.deltaX)){U.stopPropagation(),s(el(e,-U.deltaY,I),!0,...v(U));return}e>1&&(U.stopPropagation(),S||l(U.deltaX,U.deltaY))}),F=_.useCallback(U=>{const $=g.current;$.splice(0,$.length,...$.filter(G=>G.pointerId!==U.pointerId))},[]),P=_.useCallback(U=>{F(U),U.persist(),g.current.push(U)},[F]),O=Oe(U=>{var $;const G=g.current;if(U.pointerType==="mouse"&&U.buttons>1||!(!(($=f?.current)===null||$===void 0)&&$.contains(U.target)))return;e>1&&U.stopPropagation();const{timeStamp:K}=U;if(G.length===0&&K-c.current<(U.pointerType==="touch"?M:L)){c.current=0;const z=e>=1?e!==r?e*Math.max(r**(1/E),b):1:e!==t?e/Math.max(t**(-1/E),b):1;s(z,!1,...v(U))}else c.current=K;if(P(U),G.length===2){const z=Rs(G[0],G[1]);i.current={previousDistance:z,initialDistance:Math.max(z,1),initialZoom:e}}}),N=Oe(U=>{const $=g.current,G=$.find(K=>K.pointerId===U.pointerId);if($.length===2&&i.current){U.stopPropagation(),P(U);const K=Rs($[0],$[1]),z=m?i.current.initialZoom/i.current.initialDistance*K:el(e,K-i.current.previousDistance,T);s(z,!0,...$.map(W=>v(W)).reduce((W,V)=>V.map((B,Z)=>W[Z]+B/2))),i.current.previousDistance=K;return}e>1&&(U.stopPropagation(),G&&($.length===1&&l((G.clientX-U.clientX)/e,(G.clientY-U.clientY)/e),P(U)))}),C=_.useCallback(U=>{const $=g.current;$.length===2&&$.find(G=>G.pointerId===U.pointerId)&&(i.current=void 0),F(U)},[F]),k=_.useCallback(()=>{const U=g.current;U.splice(0,U.length),c.current=0,i.current=void 0},[]);Hs(y,O,N,C,n),_.useEffect(k,[u,k]),_.useEffect(()=>n?()=>{}:xr(k,y(yo,D),y(vo,A)),[n,y,k,D,A])}function _u(e,t,r){const[n,o]=_.useState(1),[a,s]=_.useState(0),[l,f]=_.useState(0),g=ku(n,a,l,r),{currentSlide:c,globalIndex:i}=Mt(),{containerRect:u,slideRect:h}=$t(),{minZoom:p,zoomInMultiplier:y}=Cn(),w=c&&sr(c)?c.src:void 0,b=!w||!r?.current;Ft(()=>{o(1),s(0),f(0)},[i,w]);const I=_.useCallback((T,m,v)=>{const D=v||n,A=a-(T||0),F=l-(m||0),P=(e.width*D-h.width)/2/D,O=(e.height*D-h.height)/2/D;s(Math.min(Math.abs(A),Math.max(P,0))*Math.sign(A)),f(Math.min(Math.abs(F),Math.max(O,0))*Math.sign(F))},[n,a,l,h,e.width,e.height]),S=_.useCallback((T,m,v,D)=>{const A=xo(T+.01<t?T-.01>p?T:p:t,5);m||g(),I(v?v*(1/n-1/A):0,D?D*(1/n-1/A):0,A),o(A)},[n,p,t,I,g]),M=Oe(()=>{n>1&&(n>t&&S(t,!0),I())});Ft(M,[u.width,u.height,M]);const L=_.useCallback(()=>{const T=n*y;S(n<1&&T>1?1:T)},[n,y,S]),E=_.useCallback(()=>{const T=n/y;S(n>1&&T<1?1:T)},[n,y,S]);return{zoom:n,offsetX:a,offsetY:l,disabled:b,changeOffsets:I,changeZoom:S,zoomIn:L,zoomOut:E}}const tl=_.createContext(null),Lo=Nt("useZoom","ZoomControllerContext",tl);function Tu({children:e}){const[t,r]=_.useState(),{slideRect:n}=$t(),{ref:o,minZoom:a}=Cn(),{imageRect:s,maxZoom:l}=Su(n,t?.imageDimensions),{zoom:f,offsetX:g,offsetY:c,disabled:i,changeZoom:u,changeOffsets:h,zoomIn:p,zoomOut:y}=_u(s,l,t?.zoomWrapperRef);Cu(f,i),Eu(f,a,l,i,p,y,u,h,t?.zoomWrapperRef);const w=_.useMemo(()=>({zoom:f,minZoom:a,maxZoom:l,offsetX:g,offsetY:c,disabled:i,zoomIn:p,zoomOut:y,changeZoom:u}),[f,a,l,g,c,i,p,y,u]);_.useImperativeHandle(o,()=>w,[w]);const b=_.useMemo(()=>({...w,setZoomWrapper:r}),[w,r]);return _.createElement(tl.Provider,{value:b},e)}const Nu=gt("ZoomIn",_.createElement(_.Fragment,null,_.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),_.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),Au=gt("ZoomOut",_.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),rl=_.forwardRef(function({zoomIn:t,onLoseFocus:r},n){const o=_.useRef(!1),a=_.useRef(!1),{zoom:s,minZoom:l,maxZoom:f,zoomIn:g,zoomOut:c,disabled:i}=Lo(),{render:u}=tt(),h=i||(t?s>=f:s<=l);return _.useEffect(()=>{h&&o.current&&a.current&&r(),h||(o.current=!0)},[h,r]),_.createElement(Er,{ref:n,disabled:h,label:t?"Zoom in":"Zoom out",icon:t?Nu:Au,renderIcon:t?u.iconZoomIn:u.iconZoomOut,onClick:t?g:c,onFocus:()=>{a.current=!0},onBlur:()=>{a.current=!1}})});function Mu(){const e=_.useRef(null),t=_.useRef(null),{focus:r}=$t(),n=_.useCallback(s=>{var l,f;!((l=s.current)===null||l===void 0)&&l.disabled?r():(f=s.current)===null||f===void 0||f.focus()},[r]),o=_.useCallback(()=>n(e),[n]),a=_.useCallback(()=>n(t),[n]);return _.createElement(_.Fragment,null,_.createElement(rl,{zoomIn:!0,ref:e,onLoseFocus:a}),_.createElement(rl,{ref:t,onLoseFocus:o}))}function Ou(){const{render:e}=tt(),t=Lo();return e.buttonZoom?_.createElement(_.Fragment,null,e.buttonZoom(t)):_.createElement(Mu,null)}function Du(e){var t;return(((t=e.srcSet)===null||t===void 0?void 0:t.length)||0)>0}function Iu({current:e,preload:t},{type:r,source:n}){switch(r){case"fetch":return e?{current:e,preload:n}:{current:n};case"done":return n===t?{current:n}:{current:e,preload:t};default:throw new Error(ws)}}function Pu(e){var t,r;const[{current:n,preload:o},a]=_.useReducer(Iu,{}),{slide:s,rect:l,imageFit:f,render:g,interactive:c}=e,i=s.srcSet.sort((L,E)=>L.width-E.width),u=(t=s.width)!==null&&t!==void 0?t:i[i.length-1].width,h=(r=s.height)!==null&&r!==void 0?r:i[i.length-1].height,p=ko(s,f),y=Math.max(...i.map(L=>L.width)),w=Math.min((p?Math.max:Math.min)(l.width,u*(l.height/h)),y),b=Md(),I=Oe(()=>{var L;const E=(L=i.find(T=>T.width>=w*b))!==null&&L!==void 0?L:i[i.length-1];(!n||i.findIndex(T=>T.src===n)<i.findIndex(T=>T===E))&&a({type:"fetch",source:E.src})});Ft(I,[l.width,l.height,b,I]);const S=Oe(L=>a({type:"done",source:L})),M={WebkitTransform:c?"initial":"translateZ(0)"};return p||Object.assign(M,l.width/l.height<u/h?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),_.createElement(_.Fragment,null,o&&o!==n&&_.createElement(lr,{key:"preload",...e,offset:void 0,slide:{...s,src:o,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...M},onLoad:()=>S(o),render:{...g,iconLoading:()=>null,iconError:()=>null}}),n&&_.createElement(lr,{key:"current",...e,slide:{...s,src:n,srcSet:void 0},style:M}))}function Lu({render:e,slide:t,offset:r,rect:n}){var o;const[a,s]=_.useState(),l=_.useRef(null),{zoom:f,maxZoom:g,offsetX:c,offsetY:i,setZoomWrapper:u}=Lo(),h=f>1,{carousel:p,on:y}=tt(),{currentIndex:w}=Mt();Ft(()=>r===0?(u({zoomWrapperRef:l,imageDimensions:a}),()=>u(void 0)):()=>{},[r,a,u]);let b=(o=e.slide)===null||o===void 0?void 0:o.call(e,{slide:t,offset:r,rect:n,zoom:f,maxZoom:g});if(!b&&sr(t)){const I={slide:t,offset:r,rect:n,render:e,imageFit:p.imageFit,imageProps:p.imageProps,onClick:r===0?()=>{var S;return(S=y.click)===null||S===void 0?void 0:S.call(y,{index:w})}:void 0};b=Du(t)?_.createElement(Pu,{...I,slide:t,interactive:h,rect:r===0?{width:n.width*f,height:n.height*f}:n}):_.createElement(lr,{onLoad:S=>s({width:S.naturalWidth,height:S.naturalHeight}),...I})}return b?_.createElement("div",{ref:l,className:st(be(ds),be(vr),be(fs),h&&be(Cd)),style:r===0?{transform:`scale(${f}) translateX(${c}px) translateY(${i}px)`}:void 0},b):null}const Fu=({augment:e,addModule:t})=>{e(({zoom:r,toolbar:n,render:o,controller:a,...s})=>{const l=Js(r);return{zoom:l,toolbar:wn(n,cs,_.createElement(Ou,null)),render:{...o,slide:f=>{var g;return sr(f.slide)?_.createElement(Lu,{render:o,...f}):(g=o.slide)===null||g===void 0?void 0:g.call(o,f)}},controller:{...a,preventDefaultWheelY:l.scrollToZoom},...s}}),t(At(cs,Tu))},Uu={separator:"/",container:{}},nl=e=>({...Uu,...e});function $u({counter:e}){const{slides:t,currentIndex:r}=Mt(),{separator:n,container:{className:o,...a},className:s,...l}=nl(e);return t.length===0?null:_.createElement("div",{className:st(be("counter"),o||s),...l,...a,"aria-hidden":!0},r+1," ",n," ",t.length)}function zu({augment:e,addChild:t}){e(({counter:r,...n})=>({counter:nl(r),...n})),t(Br,At(md,$u))}const Hu={autoplay:!1,delay:3e3,ref:null},ol=e=>({...Hu,...e}),al=_.createContext(null),ju=Nt("useSlideshow","SlideshowContext",al);function Bu({slideshow:e,carousel:{finite:t},on:r,children:n}){const{autoplay:o,delay:a,ref:s}=ol(e),l=_.useRef(o),[f,g]=_.useState(o),c=_.useRef(void 0),i=_.useRef(void 0),{slides:u,currentIndex:h}=Mt(),{setTimeout:p,clearTimeout:y}=Xr(),{subscribe:w}=Sr(),{next:b}=$t(),{setAutoPlaying:I}=No();_.useEffect(()=>I(f),[f,I]);const S=u.length===0||t&&h===u.length-1,M=_.useCallback(()=>{!f&&!S&&g(!0)},[f,S]),L=_.useCallback(()=>{f&&g(!1)},[f]),E=_.useCallback(()=>{y(c.current),c.current=void 0},[y]),T=Oe(()=>{E(),!(!f||S||i.current===yr||i.current===po)&&(c.current=p(()=>{f&&(i.current=void 0,b())},a))});_.useEffect(T,[h,f,T]),_.useEffect(()=>{f&&S&&g(!1)},[h,f,S]);const m=Oe(()=>{var A;return(A=r.slideshowStart)===null||A===void 0?void 0:A.call(r)}),v=Oe(()=>{var A;return(A=r.slideshowStop)===null||A===void 0?void 0:A.call(r)});_.useEffect(()=>{f?m():l.current&&v(),l.current=f},[f,m,v]),_.useEffect(()=>xr(E,w(yd,()=>{i.current=yr,E()}),w(vd,()=>{i.current=po,E()}),w(wd,()=>{i.current=Kr,T()}),w(xd,()=>{i.current=Vr,T()})),[w,E,T]);const D=_.useMemo(()=>({playing:f,disabled:S,play:M,pause:L}),[f,S,M,L]);return _.useImperativeHandle(s,()=>D,[D]),_.createElement(al.Provider,{value:D},n)}const Gu=gt("Play",_.createElement("path",{d:"M8 5v14l11-7z"})),Wu=gt("Pause",_.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}));function Ku(){const{playing:e,disabled:t,play:r,pause:n}=ju(),{render:o}=tt(),a=Us($t().focus,t);return o.buttonSlideshow?_.createElement(_.Fragment,null,o.buttonSlideshow({playing:e,disabled:t,play:r,pause:n})):_.createElement(Er,{label:e?"Pause":"Play",icon:e?Wu:Gu,renderIcon:e?o.iconSlideshowPause:o.iconSlideshowPlay,onClick:e?n:r,disabled:t,...a})}function Vu({augment:e,addModule:t}){e(({slideshow:r,toolbar:n,...o})=>({toolbar:wn(n,is,_.createElement(Ku,null)),slideshow:ol(r),...o})),t(At(is,Bu))}const Yu={auto:!1,ref:null},sl=e=>({...Yu,...e}),ll=_.createContext(null),Xu=Nt("useFullscreen","FullscreenContext",ll);function Zu({fullscreen:e,on:t,children:r}){const{auto:n,ref:o}=sl(e),a=_.useRef(null),[s,l]=_.useState(),[f,g]=_.useState(!1),c=_.useRef(!1),{getOwnerDocument:i}=Cr();Ft(()=>{var S,M,L,E;const T=i();l(!((E=(L=(M=(S=T.fullscreenEnabled)!==null&&S!==void 0?S:T.webkitFullscreenEnabled)!==null&&M!==void 0?M:T.mozFullScreenEnabled)!==null&&L!==void 0?L:T.msFullscreenEnabled)!==null&&E!==void 0&&E))},[i]);const u=_.useCallback(()=>{var S;const M=i(),L=M.fullscreenElement||M.webkitFullscreenElement||M.mozFullScreenElement||M.msFullscreenElement;return((S=L?.shadowRoot)===null||S===void 0?void 0:S.fullscreenElement)||L},[i]),h=_.useCallback(()=>{const S=a.current;try{S.requestFullscreen?S.requestFullscreen().catch(()=>{}):S.webkitRequestFullscreen?S.webkitRequestFullscreen():S.mozRequestFullScreen?S.mozRequestFullScreen():S.msRequestFullscreen&&S.msRequestFullscreen()}catch{}},[]),p=_.useCallback(()=>{if(!u())return;const S=i();try{S.exitFullscreen?S.exitFullscreen().catch(()=>{}):S.webkitExitFullscreen?S.webkitExitFullscreen():S.mozCancelFullScreen?S.mozCancelFullScreen():S.msExitFullscreen&&S.msExitFullscreen()}catch{}},[u,i]);_.useEffect(()=>{const S=i(),M=()=>{g(u()===a.current)};return xr(...["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].map(L=>(S.addEventListener(L,M),()=>S.removeEventListener(L,M))))},[u,i]);const y=Oe(()=>{var S;return(S=t.enterFullscreen)===null||S===void 0?void 0:S.call(t)}),w=Oe(()=>{var S;return(S=t.exitFullscreen)===null||S===void 0?void 0:S.call(t)});_.useEffect(()=>{f&&(c.current=!0),c.current&&(f?y:w)()},[f,y,w]);const b=Oe(()=>{var S;return(S=n?h:null)===null||S===void 0||S(),p});_.useEffect(b,[b]);const I=_.useMemo(()=>({fullscreen:f,disabled:s,enter:h,exit:p}),[f,s,h,p]);return _.useImperativeHandle(o,()=>I,[I]),_.createElement("div",{ref:a,className:st(be(Gr),be(ds))},_.createElement(ll.Provider,{value:I},r))}const qu=gt("EnterFullscreen",_.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})),Qu=gt("ExitFullscreen",_.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));function Ju(){var e;const{fullscreen:t,disabled:r,enter:n,exit:o}=Xu(),{render:a}=tt();return r?null:a.buttonFullscreen?_.createElement(_.Fragment,null,(e=a.buttonFullscreen)===null||e===void 0?void 0:e.call(a,{fullscreen:t,disabled:r,enter:n,exit:o})):_.createElement(Er,{disabled:r,label:t?"Exit Fullscreen":"Enter Fullscreen",icon:t?Qu:qu,renderIcon:t?a.iconExitFullscreen:a.iconEnterFullscreen,onClick:t?o:n})}function Ru({augment:e,contains:t,addParent:r}){e(({fullscreen:n,toolbar:o,...a})=>({toolbar:wn(o,Gr,_.createElement(Ju,null)),fullscreen:sl(n),...a})),r(t(Wr)?Wr:Br,At(Gr,Zu))}const cr={ref:null,position:"bottom",width:120,height:80,border:1,borderRadius:4,padding:4,gap:16,imageFit:"contain",vignette:!0,hidden:!1,showToggle:!1},Fo=e=>({...cr,...e});function il(){const{thumbnails:e}=tt();return Fo(e)}const dr=e=>nr(Wr,e),rt=e=>dr(nr("thumbnail",e)),ef=gt("VideoThumbnail",_.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})),tf=gt("UnknownThumbnail",_.createElement("path",{d:"M23 18V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zM8.5 12.5l2.5 3.01L14.5 11l4.5 6H5l3.5-4.5z"}));function rf({slide:e,render:t,rect:r,imageFit:n}){var o;const a=(o=t.thumbnail)===null||o===void 0?void 0:o.call(t,{slide:e,render:t,rect:r,imageFit:n});if(a)return a;const s={render:t,rect:r,imageFit:n};if(e.thumbnail)return _.createElement(lr,{slide:{src:e.thumbnail},...s});if(sr(e))return _.createElement(lr,{slide:e,...s});const l=be(rt(bn));return e.type==="video"?_.createElement(_.Fragment,null,e.poster&&_.createElement(lr,{slide:{src:e.poster},...s}),_.createElement(ef,{className:l})):_.createElement(tf,{className:l})}const nf=or("active"),Uo=or("fadein"),$o=or("fadeout"),of=or("placeholder"),cl="delay",dl="duration";function af({slide:e,index:t,onClick:r,fadeIn:n,fadeOut:o,placeholder:a,onLoseFocus:s}){const l=_.useRef(null),{render:f,styles:g,labels:c}=tt(),{slides:i,globalIndex:u}=Mt(),{getOwnerDocument:h}=Cr(),{width:p,height:y,imageFit:w}=il(),b={width:p,height:y},I=t===u,S=Oe(s);return _.useEffect(()=>{o&&h().activeElement===l.current&&S()},[o,S,h]),_.createElement("button",{ref:l,type:"button",className:st(be(vr),be(rt()),I&&be(rt(nf())),n&&be(rt(Uo())),o&&be(rt($o())),a&&be(rt(of()))),style:{...n?{[We(rt(Uo(dl)))]:`${n.duration}ms`,[We(rt(Uo(cl)))]:`${n.delay}ms`}:null,...o?{[We(rt($o(dl)))]:`${o.duration}ms`,[We(rt($o(cl)))]:`${o.delay}ms`}:null,...g.thumbnail},onClick:r,"aria-current":I?!0:void 0,"aria-label":ks(c,i,t)},e&&rf({slide:e,render:f,rect:b,imageFit:w}))}function ul(e){return["top","bottom"].includes(e)}function fl(e,t){return t+2*(e.border+e.padding)+e.gap}function sf(e){const{thumbnail:t,poster:r}=e||{thumbnail:"placeholder"};return typeof t=="string"&&t||typeof r=="string"&&r||e&&Cs(e)||void 0}function hl({visible:e,containerRef:t}){const r=_.useRef(null),n=kn(),{publish:o,subscribe:a}=Sr(),{carousel:s,styles:l,labels:f}=tt(),{slides:g,globalIndex:c,animation:i}=Mt(),{registerSensors:u,subscribeSensors:h}=$s();Ks(h);const p=il(),{position:y,width:w,height:b,border:I,borderStyle:S,borderColor:M,borderRadius:L,padding:E,gap:T,vignette:m}=p,v=i?.duration!==void 0&&i?.increment||0,D=i?.duration||0,{prepareAnimation:A}=Mo(r,C=>({keyframes:ul(y)?[{transform:`translateX(${(n?-1:1)*fl(p,w)*v+C}px)`},{transform:"translateX(0)"}]:[{transform:`translateY(${fl(p,b)*v+C}px)`},{transform:"translateY(0)"}],duration:D,easing:i?.easing})),F=Oe(()=>{let C=0;if(t.current&&r.current){const k=t.current.getBoundingClientRect(),U=r.current.getBoundingClientRect();C=ul(y)?U.left-k.left-(k.width-U.width)/2:U.top-k.top-(k.height-U.height)/2}A(C)});_.useEffect(()=>xr(a(bo,F)),[a,F]);const P=Ss(s,g),O=[];if(So(g))for(let C=c-P-Math.abs(v);C<=c+P+Math.abs(v);C+=1){const U=s.finite&&(C<0||C>g.length-1)||v<0&&C<c-P||v>0&&C>c+P?null:Eo(g,C),$=[`${C}`,sf(U)].filter(Boolean).join("|");O.push({key:$,index:C,slide:U})}const N=C=>()=>{C>c?o(er,{count:C-c}):C<c&&o(Rt,{count:c-C})};return _.createElement("div",{className:st(be(dr("container")),be(vr)),style:{...e?null:{display:"none"},...w!==cr.width?{[We(rt("width"))]:`${w}px`}:null,...b!==cr.height?{[We(rt("height"))]:`${b}px`}:null,...I!==cr.border?{[We(rt("border"))]:`${I}px`}:null,...S?{[We(rt("border_style"))]:S}:null,...M?{[We(rt("border_color"))]:M}:null,...L!==cr.borderRadius?{[We(rt("border_radius"))]:`${L}px`}:null,...E!==cr.padding?{[We(rt("padding"))]:`${E}px`}:null,...T!==cr.gap?{[We(rt("gap"))]:`${T}px`}:null,...l.thumbnailsContainer}},_.createElement("nav",{ref:r,style:l.thumbnailsTrack,className:st(be(dr("track")),be(vr)),"aria-label":ar(f,"Thumbnails"),tabIndex:-1,...u},O.map(({key:C,index:k,slide:U})=>{const $=D/Math.abs(v||1),G=v>0&&k>c+P-v&&k<=c+P||v<0&&k<c-P-v&&k>=c-P?{duration:$,delay:((v>0?k-(c+P-v):c-P-v-k)-1)*$}:void 0,K=v>0&&k<c-P||v<0&&k>c+P?{duration:$,delay:(v>0?v-(c-P-k):-v-(k-(c+P)))*$}:void 0;return _.createElement(af,{key:C,index:k,slide:U,fadeIn:G,fadeOut:K,placeholder:!U,onClick:N(k),onLoseFocus:()=>{var z;return(z=r.current)===null||z===void 0?void 0:z.focus()}})})),m&&_.createElement("div",{className:be(dr("vignette"))}))}const gl=_.createContext(null),lf=Nt("useThumbnails","ThumbnailsContext",gl);function cf({children:e,...t}){const{ref:r,position:n,hidden:o}=Fo(t.thumbnails),[a,s]=_.useState(!o),l=_.useRef(null),f=_.useMemo(()=>({visible:a,show:()=>s(!0),hide:()=>s(!1)}),[a]);return _.useImperativeHandle(r,()=>f,[f]),_.createElement(Ms,{...t},_.createElement(gl.Provider,{value:f},_.createElement("div",{ref:l,className:st(be(dr()),be(dr(`${n}`)))},["start","top"].includes(n)&&_.createElement(hl,{containerRef:l,visible:a}),_.createElement("div",{className:be(dr("wrapper"))},e),["end","bottom"].includes(n)&&_.createElement(hl,{containerRef:l,visible:a}))))}const pl=()=>_.createElement(_.Fragment,null,_.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),_.createElement("path",{d:"M5 14h4v3h-4zM10 14h4v3h-4zM15 14h4v3h-4z"})),df=gt("ThumbnailsVisible",pl()),uf=Bd("ThumbnailsHidden",pl());function ff(){const{visible:e,show:t,hide:r}=lf(),{render:n}=tt();return n.buttonThumbnails?_.createElement(_.Fragment,null,n.buttonThumbnails({visible:e,show:t,hide:r})):_.createElement(Er,{label:e?"Hide thumbnails":"Show thumbnails",icon:e?df:uf,renderIcon:e?n.iconThumbnailsVisible:n.iconThumbnailsHidden,onClick:e?r:t})}function hf({augment:e,contains:t,append:r,addParent:n}){e(({thumbnails:a,toolbar:s,...l})=>{const f=Fo(a);return{toolbar:wn(s,Wr,f.showToggle?_.createElement(ff,null):null),thumbnails:f,...l}});const o=At(Wr,cf);t(Gr)?r(Gr,o):n(Br,o)}const Ot=({className:e="",children:t,style:r,...n})=>d.jsx("i",{className:e,style:r,...n,children:t}),zo=window.G7Core,Ho=(e,t)=>zo?.t?.(e,t)??e,gf=async(e,t)=>{try{const r=await zo.api.get(e,{responseType:"blob"});if(r){const n=URL.createObjectURL(r),o=document.createElement("a");o.href=n,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(n)}}catch(r){console.error("Failed to download file:",r),zo?.toast?.error?.(Ho("common.download_failed"))}},pf=(e,t)=>{const r=document.createElement("a");r.href=e,r.download=t,r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r)},ml=async e=>{const t=e.downloadUrl||e.src,r=e.filename||e.title||"image";e.downloadRequiresAuth?await gf(t,r):pf(t,r)},mf=({image:e,index:t,onDownload:r})=>{const[n,o]=x.useState(!1),a=async s=>{if(s.stopPropagation(),r){r(e,t);return}o(!0);try{await ml(e)}finally{o(!1)}};return d.jsx(Q,{type:"button",onClick:a,disabled:n,className:"yarl__button flex items-center justify-center","aria-label":Ho("common.download"),title:Ho("common.download"),children:n?d.jsx(Ot,{className:"fa-solid fa-spinner fa-spin text-white"}):d.jsx(Ot,{className:"fa-solid fa-download text-white"})})},_r=({images:e,isOpen:t,onClose:r,startIndex:n=0,enableZoom:o=!0,enableSlideshow:a=!1,enableFullscreen:s=!0,showCounter:l=!0,showDownload:f=!0,showThumbnails:g=!0,onDownload:c})=>{const[i,u]=x.useState(n),h=x.useRef(n),p=e.map(b=>({src:b.src,title:b.title,description:b.description})),y=[];o&&y.push(Fu),a&&y.push(Vu),s&&y.push(Ru),l&&y.push(zu),g&&y.push(hf);const w=e[i];return x.useEffect(()=>{h.current=i},[i]),d.jsx(vu,{open:t,close:r,slides:p,index:i,plugins:y,on:{view:({index:b})=>{b!==h.current&&u(b)}},zoom:{maxZoomPixelRatio:3,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:300,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,scrollToZoom:!0},carousel:{finite:!0,preload:2,padding:"16px",spacing:"30%"},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},controller:{closeOnBackdropClick:!0,closeOnPullDown:!0,closeOnPullUp:!0},thumbnails:{position:"bottom",width:120,height:80,border:2,borderRadius:4,padding:4,gap:16,showToggle:!1,vignette:!0},toolbar:{buttons:[f&&w&&d.jsx(mf,{image:w,index:i,onDownload:c},"download"),"close"].filter(Boolean)},styles:{container:{backgroundColor:"rgba(0, 0, 0, 0.9)"}}})},bl=()=>{const[e,t]=x.useState(!1),[r,n]=x.useState([]),[o,a]=x.useState(0),s=x.useCallback((f,g=0)=>{n(f),a(g),t(!0)},[]),l=x.useCallback(()=>{t(!1)},[]);return{isOpen:e,openGallery:s,closeGallery:l,galleryProps:{images:r,isOpen:e,onClose:l,startIndex:o}}};_r.displayName="ImageGallery";const yl=Object.freeze(Object.defineProperty({__proto__:null,ImageGallery:_r,default:_r,executeImageDownload:ml,useImageGallery:bl},Symbol.toStringTag,{value:"Module"})),bf=window.G7Core,jo=(e,t)=>bf?.t?.(e,t)??e,Sn=e=>e.url??e.download_url,En=({images:e=[],className:t=""})=>{const[r,n]=x.useState(0),{openGallery:o,galleryProps:a}=bl(),s=x.useMemo(()=>e.map(f=>({src:Sn(f),title:f.alt_text_current??"",thumbnail:Sn(f),downloadUrl:f.download_url,filename:f.alt_text_current??`image-${f.id}`})),[e]);if(!e||e.length===0)return d.jsx(j,{className:`flex items-center justify-center bg-gray-100 dark:bg-gray-700 rounded-lg aspect-square ${t}`,children:d.jsxs(j,{className:"text-center text-gray-400 dark:text-gray-500",children:[d.jsx(ue,{name:"image",size:"3x",className:"mb-3 opacity-50"}),d.jsx(j,{className:"text-sm",children:jo("shop.no_image")})]})});const l=e[r]??e[0];return d.jsxs(j,{className:t,children:[d.jsx(j,{className:"relative overflow-hidden rounded-lg bg-gray-100 dark:bg-gray-700 aspect-square mb-3",children:d.jsx(Q,{type:"button",className:"w-full h-full cursor-zoom-in block",onClick:()=>o(s,r),"aria-label":jo("shop.view_image"),children:d.jsx(Wt,{src:Sn(l),alt:l.alt_text_current??"",className:"w-full h-full object-contain"})})}),e.length>1&&d.jsx(j,{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((f,g)=>d.jsx(Q,{type:"button",className:`flex-shrink-0 w-16 h-16 rounded-md overflow-hidden border-2 transition-colors cursor-pointer ${g===r?"border-gray-900 dark:border-white":"border-gray-200 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-400"}`,onClick:()=>n(g),"aria-label":f.alt_text_current??`${jo("shop.image")} ${g+1}`,children:d.jsx(Wt,{src:Sn(f),alt:f.alt_text_current??"",className:"w-full h-full object-cover"})},f.id))}),d.jsx(_r,{...a})]})};En.displayName="ProductImageViewer";const yf=Object.freeze(Object.defineProperty({__proto__:null,ProductImageViewer:En,default:En},Symbol.toStringTag,{value:"Module"})),vl=({value:e,min:t=1,max:r=999,onChange:n,size:o="md",disabled:a=!1,className:s=""})=>{const f={sm:{container:"h-8",button:"w-8 h-8 text-sm",input:"w-10 text-sm"},md:{container:"h-10",button:"w-10 h-10",input:"w-14"},lg:{container:"h-12",button:"w-12 h-12 text-lg",input:"w-16 text-lg"}}[o],g=()=>{e>t&&!a&&n(e-1)},c=()=>{e<r&&!a&&n(e+1)},i=y=>{const w=parseInt(y.target.value,10);if(!isNaN(w)){const b=Math.max(t,Math.min(r,w));n(b)}},u=y=>{const w=parseInt(y.target.value,10);isNaN(w)||w<t?n(t):w>r&&n(r)},h=a||e<=t,p=a||e>=r;return d.jsxs(j,{className:`inline-flex items-center border border-gray-300 dark:border-gray-600 rounded-lg ${f.container} ${s}`,children:[d.jsx(Q,{type:"button",onClick:g,disabled:h,className:`${f.button} flex items-center justify-center text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-l-lg transition-colors`,"aria-label":"수량 감소",children:d.jsx(ue,{name:"minus",className:"w-4 h-4"})}),d.jsx(vt,{type:"number",value:e,onChange:i,onBlur:u,min:t,max:r,disabled:a,className:`${f.input} text-center border-x border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`,"aria-label":"수량"}),d.jsx(Q,{type:"button",onClick:c,disabled:p,className:`${f.button} flex items-center justify-center text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-r-lg transition-colors`,"aria-label":"수량 증가",children:d.jsx(ue,{name:"plus",className:"w-4 h-4"})})]})},vf=Object.freeze(Object.defineProperty({__proto__:null,default:vl},Symbol.toStringTag,{value:"Module"})),wf=window.G7Core?.createLogger?.("Comp:PostReactions")??{log:(...e)=>console.log("[Comp:PostReactions]",...e),warn:(...e)=>console.warn("[Comp:PostReactions]",...e),error:(...e)=>console.error("[Comp:PostReactions]",...e)},wl=(e,t)=>window.G7Core?.t?.(e,t)??e,xf=[{type:"like",emoji:"👍",labelKey:"board.reactions.like",activeColor:"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400"},{type:"funny",emoji:"😂",labelKey:"board.reactions.funny",activeColor:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-600 dark:text-yellow-400"},{type:"agree",emoji:"👌",labelKey:"board.reactions.agree",activeColor:"bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400"},{type:"thanks",emoji:"🙏",labelKey:"board.reactions.thanks",activeColor:"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400"},{type:"wow",emoji:"😮",labelKey:"board.reactions.wow",activeColor:"bg-orange-100 dark:bg-orange-900/30 text-orange-600 dark:text-orange-400"}],xl=({reactions:e,userReaction:t,postId:r,onReact:n,size:o="md",className:a=""})=>{const s={sm:"px-2 py-1 text-xs gap-1",md:"px-3 py-1.5 text-sm gap-1.5",lg:"px-4 py-2 text-base gap-2"},l={sm:"text-sm",md:"text-base",lg:"text-lg"},f=c=>e.find(u=>u.type===c)?.count??0,g=async c=>{if(n){n(c);return}try{if(!(await fetch(`/api/posts/${r}/reactions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:c}),credentials:"include"})).ok)throw new Error("리액션 처리 실패");window.location.reload()}catch(i){wf.error("리액션 오류:",i)}};return d.jsx(j,{className:`flex flex-wrap gap-2 ${a}`,children:xf.map(c=>{const i=f(c.type),u=t===c.type;return d.jsxs(Q,{onClick:()=>g(c.type),className:`
inline-flex items-center rounded-full border transition-colors
${s[o]}
${u?`${c.activeColor} border-transparent`:"border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}
`,title:wl(c.labelKey),children:[d.jsx(re,{className:l[o],children:c.emoji}),d.jsx(re,{children:wl(c.labelKey)}),i>0&&d.jsx(re,{className:"font-medium",children:i})]},c.type)})})},kf=Object.freeze(Object.defineProperty({__proto__:null,default:xl},Symbol.toStringTag,{value:"Module"})),_n=window.G7Core?.createLogger?.("Comp:RichTextEditor")??{log:(...e)=>console.log("[Comp:RichTextEditor]",...e),warn:(...e)=>console.warn("[Comp:RichTextEditor]",...e),error:(...e)=>console.error("[Comp:RichTextEditor]",...e)},kt=(e,t)=>window.G7Core?.t?.(e,t)??e,kl=({name:e,initialValue:t="",placeholder:r,onChange:n,imageUploadUrl:o="/api/upload/image",minHeight:a="300px",disabled:s=!1,className:l=""})=>{const f=x.useRef(null),[g,c]=x.useState(t),[i,u]=x.useState(!1),[h,p]=x.useState(!1),[y,w]=x.useState("");x.useEffect(()=>{f.current&&!f.current.innerHTML&&(f.current.innerHTML=t)},[t]),x.useEffect(()=>{n&&n(g)},[g,n]);const b=m=>{_n.log("Apply format:",m)},I=async m=>{const v=new FormData;v.append("file",m);try{const D=await fetch(o,{method:"POST",body:v,credentials:"include"});if(!D.ok)throw new Error("업로드 실패");const A=await D.json();_n.log("Image uploaded:",A.url)}catch(D){_n.error("이미지 업로드 오류:",D)}},S=m=>{const v=m.target.files?.[0];v&&I(v)},M=()=>{y&&(_n.log("Insert link:",y),p(!1),w(""))},L=[{format:"bold",icon:"B",title:kt("editor.toolbar.bold")},{format:"italic",icon:"I",title:kt("editor.toolbar.italic")},{format:"underline",icon:"U",title:kt("editor.toolbar.underline")},{format:"strike",icon:"S",title:kt("editor.toolbar.strike")},{format:"code",icon:"</>",title:kt("editor.toolbar.code")}],E=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],T=[{format:"bulletList",icon:"•",title:kt("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:kt("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:kt("editor.toolbar.blockquote")}];return d.jsxs(j,{className:`border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden ${l}`,children:[d.jsxs(j,{className:"flex flex-wrap items-center gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:L.map(m=>d.jsx(Q,{type:"button",onClick:()=>b(m.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:m.title,children:m.icon},m.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:E.map(m=>d.jsx(Q,{type:"button",onClick:()=>b(m.format),disabled:s,className:"px-2 h-8 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",children:m.label},m.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:T.map(m=>d.jsx(Q,{type:"button",onClick:()=>b(m.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:m.title,children:m.icon},m.format))}),d.jsxs(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[d.jsx(Q,{type:"button",onClick:()=>p(!0),disabled:s,className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:kt("editor.toolbar.link"),children:"🔗"}),d.jsxs(br,{className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded cursor-pointer",children:["🖼",d.jsx(vt,{type:"file",accept:"image/*",onChange:S,disabled:s,className:"hidden"})]})]}),d.jsxs(Q,{type:"button",onClick:()=>u(!i),disabled:s,className:`px-2 h-8 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50 ${i?"bg-gray-200 dark:bg-gray-700":""}`,children:["</>",kt("editor.toolbar.code_view")]})]}),i?d.jsx(Jn,{value:g,onChange:m=>c(m.target.value),placeholder:r,disabled:s,className:"w-full p-4 bg-gray-900 text-gray-100 font-mono text-sm focus:outline-none resize-none",style:{minHeight:a}}):d.jsx(j,{ref:f,contentEditable:!s,onInput:m=>c(m.currentTarget.innerHTML),className:"p-4 bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:outline-none prose dark:prose-invert max-w-none",style:{minHeight:a},"data-placeholder":r}),d.jsx(vt,{type:"hidden",name:e,value:g}),h&&d.jsx(j,{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs(j,{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96",children:[d.jsx(dn,{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:kt("editor.link_modal.title")}),d.jsx(vt,{type:"url",value:y,onChange:m=>w(m.target.value),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white mb-4"}),d.jsxs(j,{className:"flex justify-end gap-2",children:[d.jsx(Q,{type:"button",onClick:()=>{p(!1),w("")},className:"px-4 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg",children:kt("common.cancel")}),d.jsx(Q,{type:"button",onClick:M,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700",children:kt("editor.link_modal.insert")})]})]})})]})},Cf=Object.freeze(Object.defineProperty({__proto__:null,default:kl},Symbol.toStringTag,{value:"Module"})),Bo=({content:e,text:t,isHtml:r=!0,className:n="",purifyConfig:o})=>{const a=t??e??"";if(!a||a.trim()==="")return null;if(!r){const g=`
whitespace-pre-wrap
text-gray-900 dark:text-gray-100
font-sans
${n}
`.trim().replace(/\s+/g," ");return d.jsx(j,{className:g,children:a})}const s={FORBID_TAGS:["script","noscript","iframe","frame","frameset","object","embed","applet","portal","form","input","textarea","select","button","style","link","meta","base","body","head","html","title","svg","math","audio","video","source","track","canvas","details","dialog","plaintext","xmp","listing","marquee","noframes","noembed","template","slot"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","ontoggle","oncanplay","onloadstart","formaction","xlink:href","action"],ALLOW_DATA_ATTR:!0,ADD_ATTR:["target"]},l=x.useMemo(()=>{const g=o?{...s,...o,FORBID_TAGS:[...s.FORBID_TAGS,...o.FORBID_TAGS||[]],FORBID_ATTR:[...s.FORBID_ATTR,...o.FORBID_ATTR||[]]}:s;return os.sanitize(a,g).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(i,u,h,p)=>(h.startsWith("http://")||h.startsWith("https://"))&&!i.includes("rel=")?`<a ${u}href="${h}"${p} rel="noopener noreferrer">`:i)},[a,o]),f=`
prose dark:prose-invert max-w-none
prose-p:my-2
prose-headings:font-bold prose-headings:mt-6 prose-headings:mb-4
prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg
prose-a:text-blue-600 dark:prose-a:text-blue-400
prose-a:no-underline hover:prose-a:underline
prose-blockquote:border-l-4 prose-blockquote:border-gray-300 dark:prose-blockquote:border-gray-600
prose-blockquote:pl-4 prose-blockquote:italic
prose-code:bg-gray-100 dark:prose-code:bg-gray-800
prose-code:px-1 prose-code:py-0.5 prose-code:rounded
prose-pre:bg-gray-100 dark:prose-pre:bg-gray-800
prose-pre:p-4 prose-pre:rounded-lg prose-pre:overflow-x-auto
[&_table]:w-full [&_table]:border-collapse [&_table]:border [&_table]:border-gray-300
dark:[&_table]:border-gray-600
[&_th]:border [&_th]:border-gray-300 [&_th]:px-4 [&_th]:py-2 [&_th]:bg-gray-100 [&_th]:text-left
dark:[&_th]:border-gray-600 dark:[&_th]:bg-gray-800
[&_td]:border [&_td]:border-gray-300 [&_td]:px-4 [&_td]:py-2
dark:[&_td]:border-gray-600
[&_tr:hover]:bg-gray-50 dark:[&_tr:hover]:bg-gray-700/50
after:content-[''] after:block after:clear-both
${n}
`.trim().replace(/\s+/g," ");return d.jsx(j,{className:f,dangerouslySetInnerHTML:{__html:l}})},Sf=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:Bo},Symbol.toStringTag,{value:"Module"})),Go=()=>window.G7Core,Wo=(e,t)=>Go()?.t?.(e,t)??e,Cl=({content:e="",onChange:t,isHtml:r=!1,onIsHtmlChange:n,rows:o=15,placeholder:a="",label:s,showHtmlModeToggle:l=!0,contentClassName:f="",purifyConfig:g,className:c="",name:i="content",htmlFieldName:u="content_mode",readOnly:h=!1})=>{const[p,y]=x.useState(r),[w,b]=x.useState(e),[I,S]=x.useState(!1);x.useEffect(()=>{y(r)},[r]),x.useEffect(()=>{b(e)},[e]);const M=x.useCallback(T=>{const m=T.target.value;if(b(m),t){const v=Go()?.createChangeEvent?.({value:m,name:i,type:"textarea"})??{target:{name:i,value:m}};t(v)}},[t,i]),L=x.useCallback(T=>{const m=T.target.checked;if(y(m),m||S(!1),n){const v=Go()?.createChangeEvent?.({checked:m,name:u,type:"checkbox"})??{target:{name:u,checked:m}};n(v)}},[n,u]),E=x.useCallback(()=>{S(T=>!T)},[]);return d.jsxs(j,{className:`space-y-2 ${c}`,children:[d.jsxs(j,{className:"flex items-center justify-between",children:[s&&d.jsx(br,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s}),d.jsxs(j,{className:"flex items-center gap-3",children:[p&&!h&&d.jsx(Q,{type:"button",onClick:E,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${I?"text-gray-700 dark:text-gray-200 bg-gray-200 dark:bg-gray-600 border border-gray-300 dark:border-gray-500 hover:bg-gray-300 dark:hover:bg-gray-500 focus:ring-gray-400 dark:focus:ring-gray-500":"text-blue-600 dark:text-blue-400 bg-white dark:bg-gray-700 border border-blue-300 dark:border-blue-600 hover:bg-blue-50 dark:hover:bg-gray-600 focus:ring-blue-500 dark:focus:ring-blue-600"}`,children:Wo(I?"common.preview_off":"common.preview")}),l&&d.jsxs(br,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[d.jsx(vt,{type:"checkbox",name:u,checked:p,onChange:L,disabled:h,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),d.jsx(j,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:Wo("common.html_mode")})]})]})]}),!I&&d.jsx(Jn,{name:i,value:w,onChange:M,placeholder:a,rows:o,readOnly:h,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${p?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`}),I&&d.jsx(j,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:d.jsx(Bo,{content:w,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:g})})]})},Ef=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:Cl},Symbol.toStringTag,{value:"Module"})),Sl=e=>window.G7Core?.t?.(e)??e,Ko=({maxHeight:e=500,expandText:t,collapseText:r,className:n="",children:o})=>{const[a,s]=x.useState(!1),[l,f]=x.useState(!1),g=x.useRef(null),c=x.useCallback(()=>{if(g.current){const p=g.current.scrollHeight;f(p>e)}},[e]);x.useEffect(()=>{c();const p=g.current;if(!p)return;const y=p.querySelectorAll("img");y.forEach(b=>{b.complete||b.addEventListener("load",c)});let w=null;return typeof ResizeObserver<"u"&&(w=new ResizeObserver(c),w.observe(p)),()=>{y.forEach(b=>{b.removeEventListener("load",c)}),w?.disconnect()}},[c,o]);const i=()=>{s(p=>!p)},u=t||Sl("sirsoft-ecommerce.shop.product.expand_detail"),h=r||Sl("sirsoft-ecommerce.shop.product.collapse_detail");return d.jsxs(j,{className:n,children:[d.jsxs(j,{className:"relative",children:[d.jsx(j,{ref:g,className:!a&&l?"overflow-hidden transition-[max-height] duration-300 ease-in-out":"transition-[max-height] duration-300 ease-in-out",style:!a&&l?{maxHeight:`${e}px`}:void 0,children:o}),!a&&l&&d.jsx(j,{className:"absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-t from-white dark:from-gray-900 to-transparent pointer-events-none"})]}),l&&d.jsxs(Q,{type:"button",onClick:i,className:"flex items-center justify-center w-full py-3.5 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer gap-1.5",children:[d.jsx(re,{className:"text-sm font-semibold text-gray-600 dark:text-gray-400",children:a?h:u}),d.jsx(ue,{name:a?"chevron-up":"chevron-down",size:"sm"})]})]})},_f=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:Ko,default:Ko},Symbol.toStringTag,{value:"Module"})),Tf=(e,t)=>window.G7Core?.t?.(e,t)??e,Vo=({isOpen:e,onClose:t,title:r,icon:n,iconClassName:o="text-gray-500 dark:text-gray-400",closeOnBackdropClick:a=!0,closeOnOverlayClick:s,showCloseButton:l=!0,closeOnEscape:f=!0,children:g,width:c="500px",className:i="",style:u})=>{const h=s!==void 0?s:a,p=x.useRef(null),y=x.useRef(null);if(x.useEffect(()=>{const b=I=>{I.key==="Escape"&&e&&f&&t()};if(e&&f)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,t,f]),x.useEffect(()=>{if(e&&p.current){y.current=document.activeElement;const b=p.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),I=b[0],S=b[b.length-1];I?.focus();const M=L=>{L.key==="Tab"&&(L.shiftKey?document.activeElement===I&&(L.preventDefault(),S?.focus()):document.activeElement===S&&(L.preventDefault(),I?.focus()))};return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M),y.current?.focus()}}},[e]),x.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const w=u?.zIndex??50;return d.jsxs(j,{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:w},onClick:h?t:void 0,children:[d.jsx(j,{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),d.jsxs(j,{ref:p,className:`relative bg-white dark:bg-gray-800 rounded-lg shadow-xl max-h-[90vh] overflow-hidden ${i}`,style:{width:c,...u?{...u,zIndex:void 0}:{}},onClick:b=>b.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":r?"modal-title":void 0,children:[(r||n||l)&&d.jsxs(j,{className:"flex items-center justify-between p-4",children:[(r||n)&&d.jsxs(j,{id:"modal-title",className:"flex items-center gap-3 text-lg font-semibold text-gray-900 dark:text-white",children:[n&&d.jsx(ue,{name:n,size:"md",className:o}),r]}),l&&d.jsx(Q,{onClick:t,className:"ml-auto text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 focus:outline-none","aria-label":Tf("common.close_modal"),children:d.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsx(j,{className:"px-6 py-4 overflow-y-auto max-h-[calc(90vh-140px)]",children:g})]})]})},Nf=Object.freeze(Object.defineProperty({__proto__:null,Modal:Vo},Symbol.toStringTag,{value:"Module"})),Yo=(e,t)=>window.G7Core?.t?.(e,t)??e,Xo=({isOpen:e,onClose:t,title:r,message:n,confirmText:o,cancelText:a,onConfirm:s,onCancel:l,confirmButtonVariant:f="primary",cancelButtonVariant:g="secondary",width:c="500px",closeOnOverlay:i=!0,isLoading:u=!1,loadingText:h})=>{const p=o??Yo("common.confirm"),y=a??Yo("common.cancel"),w=h??Yo("common.loading"),b=()=>{s()},I=()=>{u||(l?.(),t())},S=()=>{u||t()},M={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"};return d.jsxs(Vo,{isOpen:e,onClose:S,title:r,width:c,children:[d.jsx(j,{className:"py-2",children:typeof n=="string"?d.jsx(It,{className:"text-gray-700 dark:text-gray-300",children:n}):n}),d.jsxs(j,{className:"flex justify-end gap-3 mt-6",children:[d.jsx(Q,{onClick:I,disabled:u,className:"px-4 py-2 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:d.jsx(re,{children:y})}),d.jsxs(Q,{onClick:b,disabled:u,className:`flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed ${M[f]}`,children:[u&&d.jsx(Ot,{className:"fa-solid fa-spinner w-4 h-4 animate-spin"}),d.jsx(re,{children:u?w:p})]})]})]})},Af=Object.freeze(Object.defineProperty({__proto__:null,ConfirmDialog:Xo},Symbol.toStringTag,{value:"Module"})),El=x.createContext(null),_l=({value:e,children:t})=>d.jsx(El.Provider,{value:e,children:t}),Mf=()=>{const e=x.useContext(El);if(!e)throw new Error("useFileUploaderContext must be used within FileUploaderProvider");return e};function Of(e,t){return t.forEach((function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach((function(n){if(n!=="default"&&!(n in e)){var o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return r[n]}})}}))})),Object.freeze(e)}function Tl(e,t){return new Promise((function(r,n){let o;return Df(e).then((function(a){try{return o=a,r(new Blob([t.slice(0,2),o,t.slice(2)],{type:"image/jpeg"}))}catch(s){return n(s)}}),n)}))}const Df=e=>new Promise(((t,r)=>{const n=new FileReader;n.addEventListener("load",(({target:{result:o}})=>{const a=new DataView(o);let s=0;if(a.getUint16(s)!==65496)return r("not a valid JPEG");for(s+=2;;){const l=a.getUint16(s);if(l===65498)break;const f=a.getUint16(s+2);if(l===65505&&a.getUint32(s+4)===1165519206){const g=s+10;let c;switch(a.getUint16(g)){case 18761:c=!0;break;case 19789:c=!1;break;default:return r("TIFF header contains invalid endian")}if(a.getUint16(g+2,c)!==42)return r("TIFF header contains invalid version");const i=a.getUint32(g+4,c),u=g+i+2+12*a.getUint16(g+i,c);for(let h=g+i+2;h<u;h+=12)if(a.getUint16(h,c)==274){if(a.getUint16(h+2,c)!==3)return r("Orientation data type is invalid");if(a.getUint32(h+4,c)!==1)return r("Orientation data count is invalid");a.setUint16(h+8,1,c);break}return t(o.slice(s,s+2+f))}s+=2+f}return t(new Blob)})),n.readAsArrayBuffer(e)}));var Tn={},If={get exports(){return Tn},set exports(e){Tn=e}};(function(e){var t,r,n={};If.exports=n,n.parse=function(o,a){for(var s=n.bin.readUshort,l=n.bin.readUint,f=0,g={},c=new Uint8Array(o),i=c.length-4;l(c,i)!=101010256;)i--;f=i,f+=4;var u=s(c,f+=4);s(c,f+=2);var h=l(c,f+=2),p=l(c,f+=4);f+=4,f=p;for(var y=0;y<u;y++){l(c,f),f+=4,f+=4,f+=4,l(c,f+=4),h=l(c,f+=4);var w=l(c,f+=4),b=s(c,f+=4),I=s(c,f+2),S=s(c,f+4);f+=6;var M=l(c,f+=8);f+=4,f+=b+I+S,n._readLocal(c,M,g,h,w,a)}return g},n._readLocal=function(o,a,s,l,f,g){var c=n.bin.readUshort,i=n.bin.readUint;i(o,a),c(o,a+=4),c(o,a+=2);var u=c(o,a+=2);i(o,a+=2),i(o,a+=4),a+=4;var h=c(o,a+=8),p=c(o,a+=2);a+=2;var y=n.bin.readUTF8(o,a,h);if(a+=h,a+=p,g)s[y]={size:f,csize:l};else{var w=new Uint8Array(o.buffer,a);if(u==0)s[y]=new Uint8Array(w.buffer.slice(a,a+l));else{if(u!=8)throw"unknown compression method: "+u;var b=new Uint8Array(f);n.inflateRaw(w,b),s[y]=b}}},n.inflateRaw=function(o,a){return n.F.inflate(o,a)},n.inflate=function(o,a){return o[0],o[1],n.inflateRaw(new Uint8Array(o.buffer,o.byteOffset+2,o.length-6),a)},n.deflate=function(o,a){a==null&&(a={level:6});var s=0,l=new Uint8Array(50+Math.floor(1.1*o.length));l[s]=120,l[s+1]=156,s+=2,s=n.F.deflateRaw(o,l,s,a.level);var f=n.adler(o,0,o.length);return l[s+0]=f>>>24&255,l[s+1]=f>>>16&255,l[s+2]=f>>>8&255,l[s+3]=f>>>0&255,new Uint8Array(l.buffer,0,s+4)},n.deflateRaw=function(o,a){a==null&&(a={level:6});var s=new Uint8Array(50+Math.floor(1.1*o.length)),l=n.F.deflateRaw(o,s,l,a.level);return new Uint8Array(s.buffer,0,l)},n.encode=function(o,a){a==null&&(a=!1);var s=0,l=n.bin.writeUint,f=n.bin.writeUshort,g={};for(var c in o){var i=!n._noNeed(c)&&!a,u=o[c],h=n.crc.crc(u,0,u.length);g[c]={cpr:i,usize:u.length,crc:h,file:i?n.deflateRaw(u):u}}for(var c in g)s+=g[c].file.length+30+46+2*n.bin.sizeUTF8(c);s+=22;var p=new Uint8Array(s),y=0,w=[];for(var c in g){var b=g[c];w.push(y),y=n._writeHeader(p,y,c,b,0)}var I=0,S=y;for(var c in g)b=g[c],w.push(y),y=n._writeHeader(p,y,c,b,1,w[I++]);var M=y-S;return l(p,y,101010256),y+=4,f(p,y+=4,I),f(p,y+=2,I),l(p,y+=2,M),l(p,y+=4,S),y+=4,y+=2,p.buffer},n._noNeed=function(o){var a=o.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(a)!=-1},n._writeHeader=function(o,a,s,l,f,g){var c=n.bin.writeUint,i=n.bin.writeUshort,u=l.file;return c(o,a,f==0?67324752:33639248),a+=4,f==1&&(a+=2),i(o,a,20),i(o,a+=2,0),i(o,a+=2,l.cpr?8:0),c(o,a+=2,0),c(o,a+=4,l.crc),c(o,a+=4,u.length),c(o,a+=4,l.usize),i(o,a+=4,n.bin.sizeUTF8(s)),i(o,a+=2,0),a+=2,f==1&&(a+=2,a+=2,c(o,a+=6,g),a+=4),a+=n.bin.writeUTF8(o,a,s),f==0&&(o.set(u,a),a+=u.length),a},n.crc={table:(function(){for(var o=new Uint32Array(256),a=0;a<256;a++){for(var s=a,l=0;l<8;l++)1&s?s=3988292384^s>>>1:s>>>=1;o[a]=s}return o})(),update:function(o,a,s,l){for(var f=0;f<l;f++)o=n.crc.table[255&(o^a[s+f])]^o>>>8;return o},crc:function(o,a,s){return 4294967295^n.crc.update(4294967295,o,a,s)}},n.adler=function(o,a,s){for(var l=1,f=0,g=a,c=a+s;g<c;){for(var i=Math.min(g+5552,c);g<i;)f+=l+=o[g++];l%=65521,f%=65521}return f<<16|l},n.bin={readUshort:function(o,a){return o[a]|o[a+1]<<8},writeUshort:function(o,a,s){o[a]=255&s,o[a+1]=s>>8&255},readUint:function(o,a){return 16777216*o[a+3]+(o[a+2]<<16|o[a+1]<<8|o[a])},writeUint:function(o,a,s){o[a]=255&s,o[a+1]=s>>8&255,o[a+2]=s>>16&255,o[a+3]=s>>24&255},readASCII:function(o,a,s){for(var l="",f=0;f<s;f++)l+=String.fromCharCode(o[a+f]);return l},writeASCII:function(o,a,s){for(var l=0;l<s.length;l++)o[a+l]=s.charCodeAt(l)},pad:function(o){return o.length<2?"0"+o:o},readUTF8:function(o,a,s){for(var l,f="",g=0;g<s;g++)f+="%"+n.bin.pad(o[a+g].toString(16));try{l=decodeURIComponent(f)}catch{return n.bin.readASCII(o,a,s)}return l},writeUTF8:function(o,a,s){for(var l=s.length,f=0,g=0;g<l;g++){var c=s.charCodeAt(g);if((4294967168&c)==0)o[a+f]=c,f++;else if((4294965248&c)==0)o[a+f]=192|c>>6,o[a+f+1]=128|c>>0&63,f+=2;else if((4294901760&c)==0)o[a+f]=224|c>>12,o[a+f+1]=128|c>>6&63,o[a+f+2]=128|c>>0&63,f+=3;else{if((4292870144&c)!=0)throw"e";o[a+f]=240|c>>18,o[a+f+1]=128|c>>12&63,o[a+f+2]=128|c>>6&63,o[a+f+3]=128|c>>0&63,f+=4}}return f},sizeUTF8:function(o){for(var a=o.length,s=0,l=0;l<a;l++){var f=o.charCodeAt(l);if((4294967168&f)==0)s++;else if((4294965248&f)==0)s+=2;else if((4294901760&f)==0)s+=3;else{if((4292870144&f)!=0)throw"e";s+=4}}return s}},n.F={},n.F.deflateRaw=function(o,a,s,l){var f=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][l],g=n.F.U,c=n.F._goodIndex;n.F._hash;var i=n.F._putsE,u=0,h=s<<3,p=0,y=o.length;if(l==0){for(;u<y;)i(a,h,u+(A=Math.min(65535,y-u))==y?1:0),h=n.F._copyExact(o,u,A,a,h+8),u+=A;return h>>>3}var w=g.lits,b=g.strt,I=g.prev,S=0,M=0,L=0,E=0,T=0,m=0;for(y>2&&(b[m=n.F._hash(o,0)]=0),u=0;u<y;u++){if(T=m,u+1<y-2){m=n.F._hash(o,u+1);var v=u+1&32767;I[v]=b[m],b[m]=v}if(p<=u){(S>14e3||M>26697)&&y-u>100&&(p<u&&(w[S]=u-p,S+=2,p=u),h=n.F._writeBlock(u==y-1||p==y?1:0,w,S,E,o,L,u-L,a,h),S=M=E=0,L=u);var D=0;u<y-2&&(D=n.F._bestMatch(o,u,I,T,Math.min(f[2],y-u),f[3]));var A=D>>>16,F=65535&D;if(D!=0){F=65535&D;var P=c(A=D>>>16,g.of0);g.lhst[257+P]++;var O=c(F,g.df0);g.dhst[O]++,E+=g.exb[P]+g.dxb[O],w[S]=A<<23|u-p,w[S+1]=F<<16|P<<8|O,S+=2,p=u+A}else g.lhst[o[u]]++;M++}}for(L==u&&o.length!=0||(p<u&&(w[S]=u-p,S+=2,p=u),h=n.F._writeBlock(1,w,S,E,o,L,u-L,a,h),S=0,M=0,S=M=E=0,L=u);(7&h)!=0;)h++;return h>>>3},n.F._bestMatch=function(o,a,s,l,f,g){var c=32767&a,i=s[c],u=c-i+32768&32767;if(i==c||l!=n.F._hash(o,a-u))return 0;for(var h=0,p=0,y=Math.min(32767,a);u<=y&&--g!=0&&i!=c;){if(h==0||o[a+h]==o[a+h-u]){var w=n.F._howLong(o,a,u);if(w>h){if(p=u,(h=w)>=f)break;u+2<w&&(w=u+2);for(var b=0,I=0;I<w-2;I++){var S=a-u+I+32768&32767,M=S-s[S]+32768&32767;M>b&&(b=M,i=S)}}}u+=(c=i)-(i=s[c])+32768&32767}return h<<16|p},n.F._howLong=function(o,a,s){if(o[a]!=o[a-s]||o[a+1]!=o[a+1-s]||o[a+2]!=o[a+2-s])return 0;var l=a,f=Math.min(o.length,a+258);for(a+=3;a<f&&o[a]==o[a-s];)a++;return a-l},n.F._hash=function(o,a){return(o[a]<<8|o[a+1])+(o[a+2]<<4)&65535},n.saved=0,n.F._writeBlock=function(o,a,s,l,f,g,c,i,u){var h,p,y,w,b,I,S,M,L,E=n.F.U,T=n.F._putsF,m=n.F._putsE;E.lhst[256]++,p=(h=n.F.getTrees())[0],y=h[1],w=h[2],b=h[3],I=h[4],S=h[5],M=h[6],L=h[7];var v=32+((u+3&7)==0?0:8-(u+3&7))+(c<<3),D=l+n.F.contSize(E.fltree,E.lhst)+n.F.contSize(E.fdtree,E.dhst),A=l+n.F.contSize(E.ltree,E.lhst)+n.F.contSize(E.dtree,E.dhst);A+=14+3*S+n.F.contSize(E.itree,E.ihst)+(2*E.ihst[16]+3*E.ihst[17]+7*E.ihst[18]);for(var F=0;F<286;F++)E.lhst[F]=0;for(F=0;F<30;F++)E.dhst[F]=0;for(F=0;F<19;F++)E.ihst[F]=0;var P=v<D&&v<A?0:D<A?1:2;if(T(i,u,o),T(i,u+1,P),u+=3,P==0){for(;(7&u)!=0;)u++;u=n.F._copyExact(f,g,c,i,u)}else{var O,N;if(P==1&&(O=E.fltree,N=E.fdtree),P==2){n.F.makeCodes(E.ltree,p),n.F.revCodes(E.ltree,p),n.F.makeCodes(E.dtree,y),n.F.revCodes(E.dtree,y),n.F.makeCodes(E.itree,w),n.F.revCodes(E.itree,w),O=E.ltree,N=E.dtree,m(i,u,b-257),m(i,u+=5,I-1),m(i,u+=5,S-4),u+=4;for(var C=0;C<S;C++)m(i,u+3*C,E.itree[1+(E.ordr[C]<<1)]);u+=3*S,u=n.F._codeTiny(M,E.itree,i,u),u=n.F._codeTiny(L,E.itree,i,u)}for(var k=g,U=0;U<s;U+=2){for(var $=a[U],G=$>>>23,K=k+(8388607&$);k<K;)u=n.F._writeLit(f[k++],O,i,u);if(G!=0){var z=a[U+1],W=z>>16,V=z>>8&255,B=255&z;m(i,u=n.F._writeLit(257+V,O,i,u),G-E.of0[V]),u+=E.exb[V],T(i,u=n.F._writeLit(B,N,i,u),W-E.df0[B]),u+=E.dxb[B],k+=G}}u=n.F._writeLit(256,O,i,u)}return u},n.F._copyExact=function(o,a,s,l,f){var g=f>>>3;return l[g]=s,l[g+1]=s>>>8,l[g+2]=255-l[g],l[g+3]=255-l[g+1],g+=4,l.set(new Uint8Array(o.buffer,a,s),g),f+(s+4<<3)},n.F.getTrees=function(){for(var o=n.F.U,a=n.F._hufTree(o.lhst,o.ltree,15),s=n.F._hufTree(o.dhst,o.dtree,15),l=[],f=n.F._lenCodes(o.ltree,l),g=[],c=n.F._lenCodes(o.dtree,g),i=0;i<l.length;i+=2)o.ihst[l[i]]++;for(i=0;i<g.length;i+=2)o.ihst[g[i]]++;for(var u=n.F._hufTree(o.ihst,o.itree,7),h=19;h>4&&o.itree[1+(o.ordr[h-1]<<1)]==0;)h--;return[a,s,u,f,c,h,l,g]},n.F.getSecond=function(o){for(var a=[],s=0;s<o.length;s+=2)a.push(o[s+1]);return a},n.F.nonZero=function(o){for(var a="",s=0;s<o.length;s+=2)o[s+1]!=0&&(a+=(s>>1)+",");return a},n.F.contSize=function(o,a){for(var s=0,l=0;l<a.length;l++)s+=a[l]*o[1+(l<<1)];return s},n.F._codeTiny=function(o,a,s,l){for(var f=0;f<o.length;f+=2){var g=o[f],c=o[f+1];l=n.F._writeLit(g,a,s,l);var i=g==16?2:g==17?3:7;g>15&&(n.F._putsE(s,l,c,i),l+=i)}return l},n.F._lenCodes=function(o,a){for(var s=o.length;s!=2&&o[s-1]==0;)s-=2;for(var l=0;l<s;l+=2){var f=o[l+1],g=l+3<s?o[l+3]:-1,c=l+5<s?o[l+5]:-1,i=l==0?-1:o[l-1];if(f==0&&g==f&&c==f){for(var u=l+5;u+2<s&&o[u+2]==f;)u+=2;(h=Math.min(u+1-l>>>1,138))<11?a.push(17,h-3):a.push(18,h-11),l+=2*h-2}else if(f==i&&g==f&&c==f){for(u=l+5;u+2<s&&o[u+2]==f;)u+=2;var h=Math.min(u+1-l>>>1,6);a.push(16,h-3),l+=2*h-2}else a.push(f,0)}return s>>>1},n.F._hufTree=function(o,a,s){var l=[],f=o.length,g=a.length,c=0;for(c=0;c<g;c+=2)a[c]=0,a[c+1]=0;for(c=0;c<f;c++)o[c]!=0&&l.push({lit:c,f:o[c]});var i=l.length,u=l.slice(0);if(i==0)return 0;if(i==1){var h=l[0].lit;return u=h==0?1:0,a[1+(h<<1)]=1,a[1+(u<<1)]=1,1}l.sort((function(M,L){return M.f-L.f}));var p=l[0],y=l[1],w=0,b=1,I=2;for(l[0]={lit:-1,f:p.f+y.f,l:p,r:y,d:0};b!=i-1;)p=w!=b&&(I==i||l[w].f<l[I].f)?l[w++]:l[I++],y=w!=b&&(I==i||l[w].f<l[I].f)?l[w++]:l[I++],l[b++]={lit:-1,f:p.f+y.f,l:p,r:y};var S=n.F.setDepth(l[b-1],0);for(S>s&&(n.F.restrictDepth(u,s,S),S=s),c=0;c<i;c++)a[1+(u[c].lit<<1)]=u[c].d;return S},n.F.setDepth=function(o,a){return o.lit!=-1?(o.d=a,a):Math.max(n.F.setDepth(o.l,a+1),n.F.setDepth(o.r,a+1))},n.F.restrictDepth=function(o,a,s){var l=0,f=1<<s-a,g=0;for(o.sort((function(i,u){return u.d==i.d?i.f-u.f:u.d-i.d})),l=0;l<o.length&&o[l].d>a;l++){var c=o[l].d;o[l].d=a,g+=f-(1<<s-c)}for(g>>>=s-a;g>0;)(c=o[l].d)<a?(o[l].d++,g-=1<<a-c-1):l++;for(;l>=0;l--)o[l].d==a&&g<0&&(o[l].d--,g++);g!=0&&console.log("debt left")},n.F._goodIndex=function(o,a){var s=0;return a[16|s]<=o&&(s|=16),a[8|s]<=o&&(s|=8),a[4|s]<=o&&(s|=4),a[2|s]<=o&&(s|=2),a[1|s]<=o&&(s|=1),s},n.F._writeLit=function(o,a,s,l){return n.F._putsF(s,l,a[o<<1]),l+a[1+(o<<1)]},n.F.inflate=function(o,a){var s=Uint8Array;if(o[0]==3&&o[1]==0)return a||new s(0);var l=n.F,f=l._bitsF,g=l._bitsE,c=l._decodeTiny,i=l.makeCodes,u=l.codes2map,h=l._get17,p=l.U,y=a==null;y&&(a=new s(o.length>>>2<<3));for(var w,b,I=0,S=0,M=0,L=0,E=0,T=0,m=0,v=0,D=0;I==0;)if(I=f(o,D,1),S=f(o,D+1,2),D+=3,S!=0){if(y&&(a=n.F._check(a,v+131072)),S==1&&(w=p.flmap,b=p.fdmap,T=511,m=31),S==2){M=g(o,D,5)+257,L=g(o,D+5,5)+1,E=g(o,D+10,4)+4,D+=14;for(var A=0;A<38;A+=2)p.itree[A]=0,p.itree[A+1]=0;var F=1;for(A=0;A<E;A++){var P=g(o,D+3*A,3);p.itree[1+(p.ordr[A]<<1)]=P,P>F&&(F=P)}D+=3*E,i(p.itree,F),u(p.itree,F,p.imap),w=p.lmap,b=p.dmap,D=c(p.imap,(1<<F)-1,M+L,o,D,p.ttree);var O=l._copyOut(p.ttree,0,M,p.ltree);T=(1<<O)-1;var N=l._copyOut(p.ttree,M,L,p.dtree);m=(1<<N)-1,i(p.ltree,O),u(p.ltree,O,w),i(p.dtree,N),u(p.dtree,N,b)}for(;;){var C=w[h(o,D)&T];D+=15&C;var k=C>>>4;if(!(k>>>8))a[v++]=k;else{if(k==256)break;var U=v+k-254;if(k>264){var $=p.ldef[k-257];U=v+($>>>3)+g(o,D,7&$),D+=7&$}var G=b[h(o,D)&m];D+=15&G;var K=G>>>4,z=p.ddef[K],W=(z>>>4)+f(o,D,15&z);for(D+=15&z,y&&(a=n.F._check(a,v+131072));v<U;)a[v]=a[v++-W],a[v]=a[v++-W],a[v]=a[v++-W],a[v]=a[v++-W];v=U}}}else{(7&D)!=0&&(D+=8-(7&D));var V=4+(D>>>3),B=o[V-4]|o[V-3]<<8;y&&(a=n.F._check(a,v+B)),a.set(new s(o.buffer,o.byteOffset+V,B),v),D=V+B<<3,v+=B}return a.length==v?a:a.slice(0,v)},n.F._check=function(o,a){var s=o.length;if(a<=s)return o;var l=new Uint8Array(Math.max(s<<1,a));return l.set(o,0),l},n.F._decodeTiny=function(o,a,s,l,f,g){for(var c=n.F._bitsE,i=n.F._get17,u=0;u<s;){var h=o[i(l,f)&a];f+=15&h;var p=h>>>4;if(p<=15)g[u]=p,u++;else{var y=0,w=0;p==16?(w=3+c(l,f,2),f+=2,y=g[u-1]):p==17?(w=3+c(l,f,3),f+=3):p==18&&(w=11+c(l,f,7),f+=7);for(var b=u+w;u<b;)g[u]=y,u++}}return f},n.F._copyOut=function(o,a,s,l){for(var f=0,g=0,c=l.length>>>1;g<s;){var i=o[g+a];l[g<<1]=0,l[1+(g<<1)]=i,i>f&&(f=i),g++}for(;g<c;)l[g<<1]=0,l[1+(g<<1)]=0,g++;return f},n.F.makeCodes=function(o,a){for(var s,l,f,g,c=n.F.U,i=o.length,u=c.bl_count,h=0;h<=a;h++)u[h]=0;for(h=1;h<i;h+=2)u[o[h]]++;var p=c.next_code;for(s=0,u[0]=0,l=1;l<=a;l++)s=s+u[l-1]<<1,p[l]=s;for(f=0;f<i;f+=2)(g=o[f+1])!=0&&(o[f]=p[g],p[g]++)},n.F.codes2map=function(o,a,s){for(var l=o.length,f=n.F.U.rev15,g=0;g<l;g+=2)if(o[g+1]!=0)for(var c=g>>1,i=o[g+1],u=c<<4|i,h=a-i,p=o[g]<<h,y=p+(1<<h);p!=y;)s[f[p]>>>15-a]=u,p++},n.F.revCodes=function(o,a){for(var s=n.F.U.rev15,l=15-a,f=0;f<o.length;f+=2){var g=o[f]<<a-o[f+1];o[f]=s[g]>>>l}},n.F._putsE=function(o,a,s){s<<=7&a;var l=a>>>3;o[l]|=s,o[l+1]|=s>>>8},n.F._putsF=function(o,a,s){s<<=7&a;var l=a>>>3;o[l]|=s,o[l+1]|=s>>>8,o[l+2]|=s>>>16},n.F._bitsE=function(o,a,s){return(o[a>>>3]|o[1+(a>>>3)]<<8)>>>(7&a)&(1<<s)-1},n.F._bitsF=function(o,a,s){return(o[a>>>3]|o[1+(a>>>3)]<<8|o[2+(a>>>3)]<<16)>>>(7&a)&(1<<s)-1},n.F._get17=function(o,a){return(o[a>>>3]|o[1+(a>>>3)]<<8|o[2+(a>>>3)]<<16)>>>(7&a)},n.F._get25=function(o,a){return(o[a>>>3]|o[1+(a>>>3)]<<8|o[2+(a>>>3)]<<16|o[3+(a>>>3)]<<24)>>>(7&a)},n.F.U=(t=Uint16Array,r=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new t(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new r(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new r(286),dhst:new r(30),ihst:new r(19),lits:new r(15e3),strt:new t(65536),prev:new t(32768)}),(function(){for(var o=n.F.U,a=0;a<32768;a++){var s=a;s=(4278255360&(s=(4042322160&(s=(3435973836&(s=(2863311530&s)>>>1|(1431655765&s)<<1))>>>2|(858993459&s)<<2))>>>4|(252645135&s)<<4))>>>8|(16711935&s)<<8,o.rev15[a]=(s>>>16|s<<16)>>>17}function l(f,g,c){for(;g--!=0;)f.push(0,c)}for(a=0;a<32;a++)o.ldef[a]=o.of0[a]<<3|o.exb[a],o.ddef[a]=o.df0[a]<<4|o.dxb[a];l(o.fltree,144,8),l(o.fltree,112,9),l(o.fltree,24,7),l(o.fltree,8,8),n.F.makeCodes(o.fltree,9),n.F.codes2map(o.fltree,9,o.flmap),n.F.revCodes(o.fltree,9),l(o.fdtree,32,5),n.F.makeCodes(o.fdtree,5),n.F.codes2map(o.fdtree,5,o.fdmap),n.F.revCodes(o.fdtree,5),l(o.itree,19,0),l(o.ltree,286,0),l(o.dtree,30,0),l(o.ttree,320,0)})()})();var Pf=Of({__proto__:null,default:Tn},[Tn]);const zt=(function(){var e={nextZero(c,i){for(;c[i]!=0;)i++;return i},readUshort:(c,i)=>c[i]<<8|c[i+1],writeUshort(c,i,u){c[i]=u>>8&255,c[i+1]=255&u},readUint:(c,i)=>16777216*c[i]+(c[i+1]<<16|c[i+2]<<8|c[i+3]),writeUint(c,i,u){c[i]=u>>24&255,c[i+1]=u>>16&255,c[i+2]=u>>8&255,c[i+3]=255&u},readASCII(c,i,u){let h="";for(let p=0;p<u;p++)h+=String.fromCharCode(c[i+p]);return h},writeASCII(c,i,u){for(let h=0;h<u.length;h++)c[i+h]=u.charCodeAt(h)},readBytes(c,i,u){const h=[];for(let p=0;p<u;p++)h.push(c[i+p]);return h},pad:c=>c.length<2?`0${c}`:c,readUTF8(c,i,u){let h,p="";for(let y=0;y<u;y++)p+=`%${e.pad(c[i+y].toString(16))}`;try{h=decodeURIComponent(p)}catch{return e.readASCII(c,i,u)}return h}};function t(c,i,u,h){const p=i*u,y=a(h),w=Math.ceil(i*y/8),b=new Uint8Array(4*p),I=new Uint32Array(b.buffer),{ctype:S}=h,{depth:M}=h,L=e.readUshort;if(S==6){const $=p<<2;if(M==8)for(var E=0;E<$;E+=4)b[E]=c[E],b[E+1]=c[E+1],b[E+2]=c[E+2],b[E+3]=c[E+3];if(M==16)for(E=0;E<$;E++)b[E]=c[E<<1]}else if(S==2){const $=h.tabs.tRNS;if($==null){if(M==8)for(E=0;E<p;E++){var T=3*E;I[E]=255<<24|c[T+2]<<16|c[T+1]<<8|c[T]}if(M==16)for(E=0;E<p;E++)T=6*E,I[E]=255<<24|c[T+4]<<16|c[T+2]<<8|c[T]}else{var m=$[0];const G=$[1],K=$[2];if(M==8)for(E=0;E<p;E++){var v=E<<2;T=3*E,I[E]=255<<24|c[T+2]<<16|c[T+1]<<8|c[T],c[T]==m&&c[T+1]==G&&c[T+2]==K&&(b[v+3]=0)}if(M==16)for(E=0;E<p;E++)v=E<<2,T=6*E,I[E]=255<<24|c[T+4]<<16|c[T+2]<<8|c[T],L(c,T)==m&&L(c,T+2)==G&&L(c,T+4)==K&&(b[v+3]=0)}}else if(S==3){const $=h.tabs.PLTE,G=h.tabs.tRNS,K=G?G.length:0;if(M==1)for(var D=0;D<u;D++){var A=D*w,F=D*i;for(E=0;E<i;E++){v=F+E<<2;var P=3*(O=c[A+(E>>3)]>>7-((7&E)<<0)&1);b[v]=$[P],b[v+1]=$[P+1],b[v+2]=$[P+2],b[v+3]=O<K?G[O]:255}}if(M==2)for(D=0;D<u;D++)for(A=D*w,F=D*i,E=0;E<i;E++)v=F+E<<2,P=3*(O=c[A+(E>>2)]>>6-((3&E)<<1)&3),b[v]=$[P],b[v+1]=$[P+1],b[v+2]=$[P+2],b[v+3]=O<K?G[O]:255;if(M==4)for(D=0;D<u;D++)for(A=D*w,F=D*i,E=0;E<i;E++)v=F+E<<2,P=3*(O=c[A+(E>>1)]>>4-((1&E)<<2)&15),b[v]=$[P],b[v+1]=$[P+1],b[v+2]=$[P+2],b[v+3]=O<K?G[O]:255;if(M==8)for(E=0;E<p;E++){var O;v=E<<2,P=3*(O=c[E]),b[v]=$[P],b[v+1]=$[P+1],b[v+2]=$[P+2],b[v+3]=O<K?G[O]:255}}else if(S==4){if(M==8)for(E=0;E<p;E++){v=E<<2;var N=c[C=E<<1];b[v]=N,b[v+1]=N,b[v+2]=N,b[v+3]=c[C+1]}if(M==16)for(E=0;E<p;E++){var C;v=E<<2,N=c[C=E<<2],b[v]=N,b[v+1]=N,b[v+2]=N,b[v+3]=c[C+2]}}else if(S==0)for(m=h.tabs.tRNS?h.tabs.tRNS:-1,D=0;D<u;D++){const $=D*w,G=D*i;if(M==1)for(var k=0;k<i;k++){var U=(N=255*(c[$+(k>>>3)]>>>7-(7&k)&1))==255*m?0:255;I[G+k]=U<<24|N<<16|N<<8|N}else if(M==2)for(k=0;k<i;k++)U=(N=85*(c[$+(k>>>2)]>>>6-((3&k)<<1)&3))==85*m?0:255,I[G+k]=U<<24|N<<16|N<<8|N;else if(M==4)for(k=0;k<i;k++)U=(N=17*(c[$+(k>>>1)]>>>4-((1&k)<<2)&15))==17*m?0:255,I[G+k]=U<<24|N<<16|N<<8|N;else if(M==8)for(k=0;k<i;k++)U=(N=c[$+k])==m?0:255,I[G+k]=U<<24|N<<16|N<<8|N;else if(M==16)for(k=0;k<i;k++)N=c[$+(k<<1)],U=L(c,$+(k<<1))==m?0:255,I[G+k]=U<<24|N<<16|N<<8|N}return b}function r(c,i,u,h){const p=a(c),y=Math.ceil(u*p/8),w=new Uint8Array((y+1+c.interlace)*h);return i=c.tabs.CgBI?o(i,w):n(i,w),c.interlace==0?i=s(i,c,0,u,h):c.interlace==1&&(i=(function(I,S){const M=S.width,L=S.height,E=a(S),T=E>>3,m=Math.ceil(M*E/8),v=new Uint8Array(L*m);let D=0;const A=[0,0,4,0,2,0,1],F=[0,4,0,2,0,1,0],P=[8,8,8,4,4,2,2],O=[8,8,4,4,2,2,1];let N=0;for(;N<7;){const k=P[N],U=O[N];let $=0,G=0,K=A[N];for(;K<L;)K+=k,G++;let z=F[N];for(;z<M;)z+=U,$++;const W=Math.ceil($*E/8);s(I,S,D,$,G);let V=0,B=A[N];for(;B<L;){let Z=F[N],pe=D+V*W<<3;for(;Z<M;){var C;if(E==1&&(C=(C=I[pe>>3])>>7-(7&pe)&1,v[B*m+(Z>>3)]|=C<<7-((7&Z)<<0)),E==2&&(C=(C=I[pe>>3])>>6-(7&pe)&3,v[B*m+(Z>>2)]|=C<<6-((3&Z)<<1)),E==4&&(C=(C=I[pe>>3])>>4-(7&pe)&15,v[B*m+(Z>>1)]|=C<<4-((1&Z)<<2)),E>=8){const ie=B*m+Z*T;for(let fe=0;fe<T;fe++)v[ie+fe]=I[(pe>>3)+fe]}pe+=E,Z+=U}V++,B+=k}$*G!=0&&(D+=G*(1+W)),N+=1}return v})(i,c)),i}function n(c,i){return o(new Uint8Array(c.buffer,2,c.length-6),i)}var o=(function(){const c={H:{}};return c.H.N=function(i,u){const h=Uint8Array;let p,y,w=0,b=0,I=0,S=0,M=0,L=0,E=0,T=0,m=0;if(i[0]==3&&i[1]==0)return u||new h(0);const v=c.H,D=v.b,A=v.e,F=v.R,P=v.n,O=v.A,N=v.Z,C=v.m,k=u==null;for(k&&(u=new h(i.length>>>2<<5));w==0;)if(w=D(i,m,1),b=D(i,m+1,2),m+=3,b!=0){if(k&&(u=c.H.W(u,T+(1<<17))),b==1&&(p=C.J,y=C.h,L=511,E=31),b==2){I=A(i,m,5)+257,S=A(i,m+5,5)+1,M=A(i,m+10,4)+4,m+=14;let $=1;for(var U=0;U<38;U+=2)C.Q[U]=0,C.Q[U+1]=0;for(U=0;U<M;U++){const z=A(i,m+3*U,3);C.Q[1+(C.X[U]<<1)]=z,z>$&&($=z)}m+=3*M,P(C.Q,$),O(C.Q,$,C.u),p=C.w,y=C.d,m=F(C.u,(1<<$)-1,I+S,i,m,C.v);const G=v.V(C.v,0,I,C.C);L=(1<<G)-1;const K=v.V(C.v,I,S,C.D);E=(1<<K)-1,P(C.C,G),O(C.C,G,p),P(C.D,K),O(C.D,K,y)}for(;;){const $=p[N(i,m)&L];m+=15&$;const G=$>>>4;if(!(G>>>8))u[T++]=G;else{if(G==256)break;{let K=T+G-254;if(G>264){const Z=C.q[G-257];K=T+(Z>>>3)+A(i,m,7&Z),m+=7&Z}const z=y[N(i,m)&E];m+=15&z;const W=z>>>4,V=C.c[W],B=(V>>>4)+D(i,m,15&V);for(m+=15&V;T<K;)u[T]=u[T++-B],u[T]=u[T++-B],u[T]=u[T++-B],u[T]=u[T++-B];T=K}}}}else{(7&m)!=0&&(m+=8-(7&m));const $=4+(m>>>3),G=i[$-4]|i[$-3]<<8;k&&(u=c.H.W(u,T+G)),u.set(new h(i.buffer,i.byteOffset+$,G),T),m=$+G<<3,T+=G}return u.length==T?u:u.slice(0,T)},c.H.W=function(i,u){const h=i.length;if(u<=h)return i;const p=new Uint8Array(h<<1);return p.set(i,0),p},c.H.R=function(i,u,h,p,y,w){const b=c.H.e,I=c.H.Z;let S=0;for(;S<h;){const M=i[I(p,y)&u];y+=15&M;const L=M>>>4;if(L<=15)w[S]=L,S++;else{let E=0,T=0;L==16?(T=3+b(p,y,2),y+=2,E=w[S-1]):L==17?(T=3+b(p,y,3),y+=3):L==18&&(T=11+b(p,y,7),y+=7);const m=S+T;for(;S<m;)w[S]=E,S++}}return y},c.H.V=function(i,u,h,p){let y=0,w=0;const b=p.length>>>1;for(;w<h;){const I=i[w+u];p[w<<1]=0,p[1+(w<<1)]=I,I>y&&(y=I),w++}for(;w<b;)p[w<<1]=0,p[1+(w<<1)]=0,w++;return y},c.H.n=function(i,u){const h=c.H.m,p=i.length;let y,w,b,I;const S=h.j;for(var M=0;M<=u;M++)S[M]=0;for(M=1;M<p;M+=2)S[i[M]]++;const L=h.K;for(y=0,S[0]=0,w=1;w<=u;w++)y=y+S[w-1]<<1,L[w]=y;for(b=0;b<p;b+=2)I=i[b+1],I!=0&&(i[b]=L[I],L[I]++)},c.H.A=function(i,u,h){const p=i.length,y=c.H.m.r;for(let w=0;w<p;w+=2)if(i[w+1]!=0){const b=w>>1,I=i[w+1],S=b<<4|I,M=u-I;let L=i[w]<<M;const E=L+(1<<M);for(;L!=E;)h[y[L]>>>15-u]=S,L++}},c.H.l=function(i,u){const h=c.H.m.r,p=15-u;for(let y=0;y<i.length;y+=2){const w=i[y]<<u-i[y+1];i[y]=h[w]>>>p}},c.H.M=function(i,u,h){h<<=7&u;const p=u>>>3;i[p]|=h,i[p+1]|=h>>>8},c.H.I=function(i,u,h){h<<=7&u;const p=u>>>3;i[p]|=h,i[p+1]|=h>>>8,i[p+2]|=h>>>16},c.H.e=function(i,u,h){return(i[u>>>3]|i[1+(u>>>3)]<<8)>>>(7&u)&(1<<h)-1},c.H.b=function(i,u,h){return(i[u>>>3]|i[1+(u>>>3)]<<8|i[2+(u>>>3)]<<16)>>>(7&u)&(1<<h)-1},c.H.Z=function(i,u){return(i[u>>>3]|i[1+(u>>>3)]<<8|i[2+(u>>>3)]<<16)>>>(7&u)},c.H.i=function(i,u){return(i[u>>>3]|i[1+(u>>>3)]<<8|i[2+(u>>>3)]<<16|i[3+(u>>>3)]<<24)>>>(7&u)},c.H.m=(function(){const i=Uint16Array,u=Uint32Array;return{K:new i(16),j:new i(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new i(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new u(32),J:new i(512),_:[],h:new i(32),$:[],w:new i(32768),C:[],v:[],d:new i(32768),D:[],u:new i(512),Q:[],r:new i(32768),s:new u(286),Y:new u(30),a:new u(19),t:new u(15e3),k:new i(65536),g:new i(32768)}})(),(function(){const i=c.H.m;for(var u=0;u<32768;u++){let p=u;p=(2863311530&p)>>>1|(1431655765&p)<<1,p=(3435973836&p)>>>2|(858993459&p)<<2,p=(4042322160&p)>>>4|(252645135&p)<<4,p=(4278255360&p)>>>8|(16711935&p)<<8,i.r[u]=(p>>>16|p<<16)>>>17}function h(p,y,w){for(;y--!=0;)p.push(0,w)}for(u=0;u<32;u++)i.q[u]=i.S[u]<<3|i.T[u],i.c[u]=i.p[u]<<4|i.z[u];h(i._,144,8),h(i._,112,9),h(i._,24,7),h(i._,8,8),c.H.n(i._,9),c.H.A(i._,9,i.J),c.H.l(i._,9),h(i.$,32,5),c.H.n(i.$,5),c.H.A(i.$,5,i.h),c.H.l(i.$,5),h(i.Q,19,0),h(i.C,286,0),h(i.D,30,0),h(i.v,320,0)})(),c.H.N})();function a(c){return[1,null,3,1,2,null,4][c.ctype]*c.depth}function s(c,i,u,h,p){let y=a(i);const w=Math.ceil(h*y/8);let b,I;y=Math.ceil(y/8);let S=c[u],M=0;if(S>1&&(c[u]=[0,0,1][S-2]),S==3)for(M=y;M<w;M++)c[M+1]=c[M+1]+(c[M+1-y]>>>1)&255;for(let L=0;L<p;L++)if(b=u+L*w,I=b+L+1,S=c[I-1],M=0,S==0)for(;M<w;M++)c[b+M]=c[I+M];else if(S==1){for(;M<y;M++)c[b+M]=c[I+M];for(;M<w;M++)c[b+M]=c[I+M]+c[b+M-y]}else if(S==2)for(;M<w;M++)c[b+M]=c[I+M]+c[b+M-w];else if(S==3){for(;M<y;M++)c[b+M]=c[I+M]+(c[b+M-w]>>>1);for(;M<w;M++)c[b+M]=c[I+M]+(c[b+M-w]+c[b+M-y]>>>1)}else{for(;M<y;M++)c[b+M]=c[I+M]+l(0,c[b+M-w],0);for(;M<w;M++)c[b+M]=c[I+M]+l(c[b+M-y],c[b+M-w],c[b+M-y-w])}return c}function l(c,i,u){const h=c+i-u,p=h-c,y=h-i,w=h-u;return p*p<=y*y&&p*p<=w*w?c:y*y<=w*w?i:u}function f(c,i,u){u.width=e.readUint(c,i),i+=4,u.height=e.readUint(c,i),i+=4,u.depth=c[i],i++,u.ctype=c[i],i++,u.compress=c[i],i++,u.filter=c[i],i++,u.interlace=c[i],i++}function g(c,i,u,h,p,y,w,b,I){const S=Math.min(i,p),M=Math.min(u,y);let L=0,E=0;for(let N=0;N<M;N++)for(let C=0;C<S;C++)if(w>=0&&b>=0?(L=N*i+C<<2,E=(b+N)*p+w+C<<2):(L=(-b+N)*i-w+C<<2,E=N*p+C<<2),I==0)h[E]=c[L],h[E+1]=c[L+1],h[E+2]=c[L+2],h[E+3]=c[L+3];else if(I==1){var T=c[L+3]*.00392156862745098,m=c[L]*T,v=c[L+1]*T,D=c[L+2]*T,A=h[E+3]*(1/255),F=h[E]*A,P=h[E+1]*A,O=h[E+2]*A;const k=1-T,U=T+A*k,$=U==0?0:1/U;h[E+3]=255*U,h[E+0]=(m+F*k)*$,h[E+1]=(v+P*k)*$,h[E+2]=(D+O*k)*$}else if(I==2)T=c[L+3],m=c[L],v=c[L+1],D=c[L+2],A=h[E+3],F=h[E],P=h[E+1],O=h[E+2],T==A&&m==F&&v==P&&D==O?(h[E]=0,h[E+1]=0,h[E+2]=0,h[E+3]=0):(h[E]=m,h[E+1]=v,h[E+2]=D,h[E+3]=T);else if(I==3){if(T=c[L+3],m=c[L],v=c[L+1],D=c[L+2],A=h[E+3],F=h[E],P=h[E+1],O=h[E+2],T==A&&m==F&&v==P&&D==O)continue;if(T<220&&A>20)return!1}return!0}return{decode:function(i){const u=new Uint8Array(i);let h=8;const p=e,y=p.readUshort,w=p.readUint,b={tabs:{},frames:[]},I=new Uint8Array(u.length);let S,M=0,L=0;const E=[137,80,78,71,13,10,26,10];for(var T=0;T<8;T++)if(u[T]!=E[T])throw"The input is not a PNG file!";for(;h<u.length;){const N=p.readUint(u,h);h+=4;const C=p.readASCII(u,h,4);if(h+=4,C=="IHDR")f(u,h,b);else if(C=="iCCP"){for(var m=h;u[m]!=0;)m++;p.readASCII(u,h,m-h),u[m+1];const k=u.slice(m+2,h+N);let U=null;try{U=n(k)}catch{U=o(k)}b.tabs[C]=U}else if(C=="CgBI")b.tabs[C]=u.slice(h,h+4);else if(C=="IDAT"){for(T=0;T<N;T++)I[M+T]=u[h+T];M+=N}else if(C=="acTL")b.tabs[C]={num_frames:w(u,h),num_plays:w(u,h+4)},S=new Uint8Array(u.length);else if(C=="fcTL"){L!=0&&((O=b.frames[b.frames.length-1]).data=r(b,S.slice(0,L),O.rect.width,O.rect.height),L=0);const k={x:w(u,h+12),y:w(u,h+16),width:w(u,h+4),height:w(u,h+8)};let U=y(u,h+22);U=y(u,h+20)/(U==0?100:U);const $={rect:k,delay:Math.round(1e3*U),dispose:u[h+24],blend:u[h+25]};b.frames.push($)}else if(C=="fdAT"){for(T=0;T<N-4;T++)S[L+T]=u[h+T+4];L+=N-4}else if(C=="pHYs")b.tabs[C]=[p.readUint(u,h),p.readUint(u,h+4),u[h+8]];else if(C=="cHRM")for(b.tabs[C]=[],T=0;T<8;T++)b.tabs[C].push(p.readUint(u,h+4*T));else if(C=="tEXt"||C=="zTXt"){b.tabs[C]==null&&(b.tabs[C]={});var v=p.nextZero(u,h),D=p.readASCII(u,h,v-h),A=h+N-v-1;if(C=="tEXt")P=p.readASCII(u,v+1,A);else{var F=n(u.slice(v+2,v+2+A));P=p.readUTF8(F,0,F.length)}b.tabs[C][D]=P}else if(C=="iTXt"){b.tabs[C]==null&&(b.tabs[C]={}),v=0,m=h,v=p.nextZero(u,m),D=p.readASCII(u,m,v-m);const k=u[m=v+1];var P;u[m+1],m+=2,v=p.nextZero(u,m),p.readASCII(u,m,v-m),m=v+1,v=p.nextZero(u,m),p.readUTF8(u,m,v-m),A=N-((m=v+1)-h),k==0?P=p.readUTF8(u,m,A):(F=n(u.slice(m,m+A)),P=p.readUTF8(F,0,F.length)),b.tabs[C][D]=P}else if(C=="PLTE")b.tabs[C]=p.readBytes(u,h,N);else if(C=="hIST"){const k=b.tabs.PLTE.length/3;for(b.tabs[C]=[],T=0;T<k;T++)b.tabs[C].push(y(u,h+2*T))}else if(C=="tRNS")b.ctype==3?b.tabs[C]=p.readBytes(u,h,N):b.ctype==0?b.tabs[C]=y(u,h):b.ctype==2&&(b.tabs[C]=[y(u,h),y(u,h+2),y(u,h+4)]);else if(C=="gAMA")b.tabs[C]=p.readUint(u,h)/1e5;else if(C=="sRGB")b.tabs[C]=u[h];else if(C=="bKGD")b.ctype==0||b.ctype==4?b.tabs[C]=[y(u,h)]:b.ctype==2||b.ctype==6?b.tabs[C]=[y(u,h),y(u,h+2),y(u,h+4)]:b.ctype==3&&(b.tabs[C]=u[h]);else if(C=="IEND")break;h+=N,p.readUint(u,h),h+=4}var O;return L!=0&&((O=b.frames[b.frames.length-1]).data=r(b,S.slice(0,L),O.rect.width,O.rect.height)),b.data=r(b,I,b.width,b.height),delete b.compress,delete b.interlace,delete b.filter,b},toRGBA8:function(i){const u=i.width,h=i.height;if(i.tabs.acTL==null)return[t(i.data,u,h,i).buffer];const p=[];i.frames[0].data==null&&(i.frames[0].data=i.data);const y=u*h*4,w=new Uint8Array(y),b=new Uint8Array(y),I=new Uint8Array(y);for(let M=0;M<i.frames.length;M++){const L=i.frames[M],E=L.rect.x,T=L.rect.y,m=L.rect.width,v=L.rect.height,D=t(L.data,m,v,i);if(M!=0)for(var S=0;S<y;S++)I[S]=w[S];if(L.blend==0?g(D,m,v,w,u,h,E,T,0):L.blend==1&&g(D,m,v,w,u,h,E,T,1),p.push(w.buffer.slice(0)),L.dispose!=0){if(L.dispose==1)g(b,m,v,w,u,h,E,T,0);else if(L.dispose==2)for(S=0;S<y;S++)w[S]=I[S]}}return p},_paeth:l,_copyTile:g,_bin:e}})();(function(){const{_copyTile:e}=zt,{_bin:t}=zt,r=zt._paeth;var n={table:(function(){const m=new Uint32Array(256);for(let v=0;v<256;v++){let D=v;for(let A=0;A<8;A++)1&D?D=3988292384^D>>>1:D>>>=1;m[v]=D}return m})(),update(m,v,D,A){for(let F=0;F<A;F++)m=n.table[255&(m^v[D+F])]^m>>>8;return m},crc:(m,v,D)=>4294967295^n.update(4294967295,m,v,D)};function o(m,v,D,A){v[D]+=m[0]*A>>4,v[D+1]+=m[1]*A>>4,v[D+2]+=m[2]*A>>4,v[D+3]+=m[3]*A>>4}function a(m){return Math.max(0,Math.min(255,m))}function s(m,v){const D=m[0]-v[0],A=m[1]-v[1],F=m[2]-v[2],P=m[3]-v[3];return D*D+A*A+F*F+P*P}function l(m,v,D,A,F,P,O){O==null&&(O=1);const N=A.length,C=[];for(var k=0;k<N;k++){const B=A[k];C.push([B>>>0&255,B>>>8&255,B>>>16&255,B>>>24&255])}for(k=0;k<N;k++){let B=4294967295;for(var U=0,$=0;$<N;$++){var G=s(C[k],C[$]);$!=k&&G<B&&(B=G,U=$)}}const K=new Uint32Array(F.buffer),z=new Int16Array(v*D*4),W=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(k=0;k<W.length;k++)W[k]=255*((W[k]+.5)/16-.5);for(let B=0;B<D;B++)for(let Z=0;Z<v;Z++){var V;k=4*(B*v+Z),O!=2?V=[a(m[k]+z[k]),a(m[k+1]+z[k+1]),a(m[k+2]+z[k+2]),a(m[k+3]+z[k+3])]:(G=W[4*(3&B)+(3&Z)],V=[a(m[k]+G),a(m[k+1]+G),a(m[k+2]+G),a(m[k+3]+G)]),U=0;let pe=16777215;for($=0;$<N;$++){const ee=s(V,C[$]);ee<pe&&(pe=ee,U=$)}const ie=C[U],fe=[V[0]-ie[0],V[1]-ie[1],V[2]-ie[2],V[3]-ie[3]];O==1&&(Z!=v-1&&o(fe,z,k+4,7),B!=D-1&&(Z!=0&&o(fe,z,k+4*v-4,3),o(fe,z,k+4*v,5),Z!=v-1&&o(fe,z,k+4*v+4,1))),P[k>>2]=U,K[k>>2]=A[U]}}function f(m,v,D,A,F){F==null&&(F={});const{crc:P}=n,O=t.writeUint,N=t.writeUshort,C=t.writeASCII;let k=8;const U=m.frames.length>1;let $,G=!1,K=33+(U?20:0);if(F.sRGB!=null&&(K+=13),F.pHYs!=null&&(K+=21),F.iCCP!=null&&($=pako.deflate(F.iCCP),K+=21+$.length+4),m.ctype==3){for(var z=m.plte.length,W=0;W<z;W++)m.plte[W]>>>24!=255&&(G=!0);K+=8+3*z+4+(G?8+1*z+4:0)}for(var V=0;V<m.frames.length;V++)U&&(K+=38),K+=(ie=m.frames[V]).cimg.length+12,V!=0&&(K+=4);K+=12;const B=new Uint8Array(K),Z=[137,80,78,71,13,10,26,10];for(W=0;W<8;W++)B[W]=Z[W];if(O(B,k,13),k+=4,C(B,k,"IHDR"),k+=4,O(B,k,v),k+=4,O(B,k,D),k+=4,B[k]=m.depth,k++,B[k]=m.ctype,k++,B[k]=0,k++,B[k]=0,k++,B[k]=0,k++,O(B,k,P(B,k-17,17)),k+=4,F.sRGB!=null&&(O(B,k,1),k+=4,C(B,k,"sRGB"),k+=4,B[k]=F.sRGB,k++,O(B,k,P(B,k-5,5)),k+=4),F.iCCP!=null){const fe=13+$.length;O(B,k,fe),k+=4,C(B,k,"iCCP"),k+=4,C(B,k,"ICC profile"),k+=11,k+=2,B.set($,k),k+=$.length,O(B,k,P(B,k-(fe+4),fe+4)),k+=4}if(F.pHYs!=null&&(O(B,k,9),k+=4,C(B,k,"pHYs"),k+=4,O(B,k,F.pHYs[0]),k+=4,O(B,k,F.pHYs[1]),k+=4,B[k]=F.pHYs[2],k++,O(B,k,P(B,k-13,13)),k+=4),U&&(O(B,k,8),k+=4,C(B,k,"acTL"),k+=4,O(B,k,m.frames.length),k+=4,O(B,k,F.loop!=null?F.loop:0),k+=4,O(B,k,P(B,k-12,12)),k+=4),m.ctype==3){for(O(B,k,3*(z=m.plte.length)),k+=4,C(B,k,"PLTE"),k+=4,W=0;W<z;W++){const fe=3*W,ee=m.plte[W],_e=255&ee,ye=ee>>>8&255,He=ee>>>16&255;B[k+fe+0]=_e,B[k+fe+1]=ye,B[k+fe+2]=He}if(k+=3*z,O(B,k,P(B,k-3*z-4,3*z+4)),k+=4,G){for(O(B,k,z),k+=4,C(B,k,"tRNS"),k+=4,W=0;W<z;W++)B[k+W]=m.plte[W]>>>24&255;k+=z,O(B,k,P(B,k-z-4,z+4)),k+=4}}let pe=0;for(V=0;V<m.frames.length;V++){var ie=m.frames[V];U&&(O(B,k,26),k+=4,C(B,k,"fcTL"),k+=4,O(B,k,pe++),k+=4,O(B,k,ie.rect.width),k+=4,O(B,k,ie.rect.height),k+=4,O(B,k,ie.rect.x),k+=4,O(B,k,ie.rect.y),k+=4,N(B,k,A[V]),k+=2,N(B,k,1e3),k+=2,B[k]=ie.dispose,k++,B[k]=ie.blend,k++,O(B,k,P(B,k-30,30)),k+=4);const fe=ie.cimg;O(B,k,(z=fe.length)+(V==0?0:4)),k+=4;const ee=k;C(B,k,V==0?"IDAT":"fdAT"),k+=4,V!=0&&(O(B,k,pe++),k+=4),B.set(fe,k),k+=z,O(B,k,P(B,ee,k-ee)),k+=4}return O(B,k,0),k+=4,C(B,k,"IEND"),k+=4,O(B,k,P(B,k-4,4)),k+=4,B.buffer}function g(m,v,D){for(let A=0;A<m.frames.length;A++){const F=m.frames[A];F.rect.width;const P=F.rect.height,O=new Uint8Array(P*F.bpl+P);F.cimg=h(F.img,P,F.bpp,F.bpl,O,v,D)}}function c(m,v,D,A,F){const P=F[0],O=F[1],N=F[2],C=F[3],k=F[4],U=F[5];let $=6,G=8,K=255;for(var z=0;z<m.length;z++){const J=new Uint8Array(m[z]);for(var W=J.length,V=0;V<W;V+=4)K&=J[V+3]}const B=K!=255,Z=(function(he,xe,Ue,Le,Y,te){const de=[];for(var ae=0;ae<he.length;ae++){const $e=new Uint8Array(he[ae]),X=new Uint32Array($e.buffer);var Ee;let ne=0,ce=0,se=xe,oe=Ue,Ne=Le?1:0;if(ae!=0){const we=te||Le||ae==1||de[ae-2].dispose!=0?1:2;let ke=0,Ce=1e9;for(let Ie=0;Ie<we;Ie++){var je=new Uint8Array(he[ae-1-Ie]);const Be=new Uint32Array(he[ae-1-Ie]);let Se=xe,me=Ue,Te=-1,Ke=-1;for(let Ge=0;Ge<Ue;Ge++)for(let qe=0;qe<xe;qe++)X[Me=Ge*xe+qe]!=Be[Me]&&(qe<Se&&(Se=qe),qe>Te&&(Te=qe),Ge<me&&(me=Ge),Ge>Ke&&(Ke=Ge));Te==-1&&(Se=me=Te=Ke=0),Y&&((1&Se)==1&&Se--,(1&me)==1&&me--);const De=(Te-Se+1)*(Ke-me+1);De<Ce&&(Ce=De,ke=Ie,ne=Se,ce=me,se=Te-Se+1,oe=Ke-me+1)}je=new Uint8Array(he[ae-1-ke]),ke==1&&(de[ae-1].dispose=2),Ee=new Uint8Array(se*oe*4),e(je,xe,Ue,Ee,se,oe,-ne,-ce,0),Ne=e($e,xe,Ue,Ee,se,oe,-ne,-ce,3)?1:0,Ne==1?u($e,xe,Ue,Ee,{x:ne,y:ce,width:se,height:oe}):e($e,xe,Ue,Ee,se,oe,-ne,-ce,0)}else Ee=$e.slice(0);de.push({rect:{x:ne,y:ce,width:se,height:oe},img:Ee,blend:Ne,dispose:0})}if(Le)for(ae=0;ae<de.length;ae++){if((Xe=de[ae]).blend==1)continue;const $e=Xe.rect,X=de[ae-1].rect,ne=Math.min($e.x,X.x),ce=Math.min($e.y,X.y),se={x:ne,y:ce,width:Math.max($e.x+$e.width,X.x+X.width)-ne,height:Math.max($e.y+$e.height,X.y+X.height)-ce};de[ae-1].dispose=1,ae-1!=0&&i(he,xe,Ue,de,ae-1,se,Y),i(he,xe,Ue,de,ae,se,Y)}let ze=0;if(he.length!=1)for(var Me=0;Me<de.length;Me++){var Xe;ze+=(Xe=de[Me]).rect.width*Xe.rect.height}return de})(m,v,D,P,O,N),pe={},ie=[],fe=[];if(A!=0){const J=[];for(V=0;V<Z.length;V++)J.push(Z[V].img.buffer);const he=(function(Y){let te=0;for(var de=0;de<Y.length;de++)te+=Y[de].byteLength;const ae=new Uint8Array(te);let Ee=0;for(de=0;de<Y.length;de++){const je=new Uint8Array(Y[de]),ze=je.length;for(let Me=0;Me<ze;Me+=4){let Xe=je[Me],$e=je[Me+1],X=je[Me+2];const ne=je[Me+3];ne==0&&(Xe=$e=X=0),ae[Ee+Me]=Xe,ae[Ee+Me+1]=$e,ae[Ee+Me+2]=X,ae[Ee+Me+3]=ne}Ee+=ze}return ae.buffer})(J),xe=y(he,A);for(V=0;V<xe.plte.length;V++)ie.push(xe.plte[V].est.rgba);let Ue=0;for(V=0;V<Z.length;V++){const Le=(_e=Z[V]).img.length;var ee=new Uint8Array(xe.inds.buffer,Ue>>2,Le>>2);fe.push(ee);const Y=new Uint8Array(xe.abuf,Ue,Le);U&&l(_e.img,_e.rect.width,_e.rect.height,ie,Y,ee),_e.img.set(Y),Ue+=Le}}else for(z=0;z<Z.length;z++){var _e=Z[z];const J=new Uint32Array(_e.img.buffer);var ye=_e.rect.width;for(W=J.length,ee=new Uint8Array(W),fe.push(ee),V=0;V<W;V++){const he=J[V];if(V!=0&&he==J[V-1])ee[V]=ee[V-1];else if(V>ye&&he==J[V-ye])ee[V]=ee[V-ye];else{let xe=pe[he];if(xe==null&&(pe[he]=xe=ie.length,ie.push(he),ie.length>=300))break;ee[V]=xe}}}const He=ie.length;for(He<=256&&k==0&&(G=He<=2?1:He<=4?2:He<=16?4:8,G=Math.max(G,C)),z=0;z<Z.length;z++){(_e=Z[z]).rect.x,_e.rect.y,ye=_e.rect.width;const J=_e.rect.height;let he=_e.img;new Uint32Array(he.buffer);let xe=4*ye,Ue=4;if(He<=256&&k==0){xe=Math.ceil(G*ye/8);var Fe=new Uint8Array(xe*J);const Le=fe[z];for(let Y=0;Y<J;Y++){V=Y*xe;const te=Y*ye;if(G==8)for(var ve=0;ve<ye;ve++)Fe[V+ve]=Le[te+ve];else if(G==4)for(ve=0;ve<ye;ve++)Fe[V+(ve>>1)]|=Le[te+ve]<<4-4*(1&ve);else if(G==2)for(ve=0;ve<ye;ve++)Fe[V+(ve>>2)]|=Le[te+ve]<<6-2*(3&ve);else if(G==1)for(ve=0;ve<ye;ve++)Fe[V+(ve>>3)]|=Le[te+ve]<<7-1*(7&ve)}he=Fe,$=3,Ue=1}else if(B==0&&Z.length==1){Fe=new Uint8Array(ye*J*3);const Le=ye*J;for(V=0;V<Le;V++){const Y=3*V,te=4*V;Fe[Y]=he[te],Fe[Y+1]=he[te+1],Fe[Y+2]=he[te+2]}he=Fe,$=2,Ue=3,xe=3*ye}_e.img=he,_e.bpl=xe,_e.bpp=Ue}return{ctype:$,depth:G,plte:ie,frames:Z}}function i(m,v,D,A,F,P,O){const N=Uint8Array,C=Uint32Array,k=new N(m[F-1]),U=new C(m[F-1]),$=F+1<m.length?new N(m[F+1]):null,G=new N(m[F]),K=new C(G.buffer);let z=v,W=D,V=-1,B=-1;for(let pe=0;pe<P.height;pe++)for(let ie=0;ie<P.width;ie++){const fe=P.x+ie,ee=P.y+pe,_e=ee*v+fe,ye=K[_e];ye==0||A[F-1].dispose==0&&U[_e]==ye&&($==null||$[4*_e+3]!=0)||(fe<z&&(z=fe),fe>V&&(V=fe),ee<W&&(W=ee),ee>B&&(B=ee))}V==-1&&(z=W=V=B=0),O&&((1&z)==1&&z--,(1&W)==1&&W--),P={x:z,y:W,width:V-z+1,height:B-W+1};const Z=A[F];Z.rect=P,Z.blend=1,Z.img=new Uint8Array(P.width*P.height*4),A[F-1].dispose==0?(e(k,v,D,Z.img,P.width,P.height,-P.x,-P.y,0),u(G,v,D,Z.img,P)):e(G,v,D,Z.img,P.width,P.height,-P.x,-P.y,0)}function u(m,v,D,A,F){e(m,v,D,A,F.width,F.height,-F.x,-F.y,2)}function h(m,v,D,A,F,P,O){const N=[];let C,k=[0,1,2,3,4];P!=-1?k=[P]:(v*A>5e5||D==1)&&(k=[0]),O&&(C={level:0});const U=Pf;for(var $=0;$<k.length;$++){for(let z=0;z<v;z++)p(F,m,z,A,D,k[$]);N.push(U.deflate(F,C))}let G,K=1e9;for($=0;$<N.length;$++)N[$].length<K&&(G=$,K=N[$].length);return N[G]}function p(m,v,D,A,F,P){const O=D*A;let N=O+D;if(m[N]=P,N++,P==0)if(A<500)for(var C=0;C<A;C++)m[N+C]=v[O+C];else m.set(new Uint8Array(v.buffer,O,A),N);else if(P==1){for(C=0;C<F;C++)m[N+C]=v[O+C];for(C=F;C<A;C++)m[N+C]=v[O+C]-v[O+C-F]+256&255}else if(D==0){for(C=0;C<F;C++)m[N+C]=v[O+C];if(P==2)for(C=F;C<A;C++)m[N+C]=v[O+C];if(P==3)for(C=F;C<A;C++)m[N+C]=v[O+C]-(v[O+C-F]>>1)+256&255;if(P==4)for(C=F;C<A;C++)m[N+C]=v[O+C]-r(v[O+C-F],0,0)+256&255}else{if(P==2)for(C=0;C<A;C++)m[N+C]=v[O+C]+256-v[O+C-A]&255;if(P==3){for(C=0;C<F;C++)m[N+C]=v[O+C]+256-(v[O+C-A]>>1)&255;for(C=F;C<A;C++)m[N+C]=v[O+C]+256-(v[O+C-A]+v[O+C-F]>>1)&255}if(P==4){for(C=0;C<F;C++)m[N+C]=v[O+C]+256-r(0,v[O+C-A],0)&255;for(C=F;C<A;C++)m[N+C]=v[O+C]+256-r(v[O+C-F],v[O+C-A],v[O+C-F-A])&255}}}function y(m,v){const D=new Uint8Array(m),A=D.slice(0),F=new Uint32Array(A.buffer),P=w(A,v),O=P[0],N=P[1],C=D.length,k=new Uint8Array(C>>2);let U;if(D.length<2e7)for(var $=0;$<C;$+=4)U=b(O,G=D[$]*.00392156862745098,K=D[$+1]*.00392156862745098,z=D[$+2]*.00392156862745098,W=D[$+3]*.00392156862745098),k[$>>2]=U.ind,F[$>>2]=U.est.rgba;else for($=0;$<C;$+=4){var G=D[$]*.00392156862745098,K=D[$+1]*(1/255),z=D[$+2]*(1/255),W=D[$+3]*(1/255);for(U=O;U.left;)U=I(U.est,G,K,z,W)<=0?U.left:U.right;k[$>>2]=U.ind,F[$>>2]=U.est.rgba}return{abuf:A.buffer,inds:k,plte:N}}function w(m,v,D){D==null&&(D=1e-4);const A=new Uint32Array(m.buffer),F={i0:0,i1:m.length,bst:null,est:null,tdst:0,left:null,right:null};F.bst=L(m,F.i0,F.i1),F.est=E(F.bst);const P=[F];for(;P.length<v;){let N=0,C=0;for(var O=0;O<P.length;O++)P[O].est.L>N&&(N=P[O].est.L,C=O);if(N<D)break;const k=P[C],U=S(m,A,k.i0,k.i1,k.est.e,k.est.eMq255);if(k.i0>=U||k.i1<=U){k.est.L=0;continue}const $={i0:k.i0,i1:U,bst:null,est:null,tdst:0,left:null,right:null};$.bst=L(m,$.i0,$.i1),$.est=E($.bst);const G={i0:U,i1:k.i1,bst:null,est:null,tdst:0,left:null,right:null};for(G.bst={R:[],m:[],N:k.bst.N-$.bst.N},O=0;O<16;O++)G.bst.R[O]=k.bst.R[O]-$.bst.R[O];for(O=0;O<4;O++)G.bst.m[O]=k.bst.m[O]-$.bst.m[O];G.est=E(G.bst),k.left=$,k.right=G,P[C]=$,P.push(G)}for(P.sort(((N,C)=>C.bst.N-N.bst.N)),O=0;O<P.length;O++)P[O].ind=O;return[F,P]}function b(m,v,D,A,F){if(m.left==null)return m.tdst=(function($,G,K,z,W){const V=G-$[0],B=K-$[1],Z=z-$[2],pe=W-$[3];return V*V+B*B+Z*Z+pe*pe})(m.est.q,v,D,A,F),m;const P=I(m.est,v,D,A,F);let O=m.left,N=m.right;P>0&&(O=m.right,N=m.left);const C=b(O,v,D,A,F);if(C.tdst<=P*P)return C;const k=b(N,v,D,A,F);return k.tdst<C.tdst?k:C}function I(m,v,D,A,F){const{e:P}=m;return P[0]*v+P[1]*D+P[2]*A+P[3]*F-m.eMq}function S(m,v,D,A,F,P){for(A-=4;D<A;){for(;M(m,D,F)<=P;)D+=4;for(;M(m,A,F)>P;)A-=4;if(D>=A)break;const O=v[D>>2];v[D>>2]=v[A>>2],v[A>>2]=O,D+=4,A-=4}for(;M(m,D,F)>P;)D-=4;return D+4}function M(m,v,D){return m[v]*D[0]+m[v+1]*D[1]+m[v+2]*D[2]+m[v+3]*D[3]}function L(m,v,D){const A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],F=[0,0,0,0],P=D-v>>2;for(let O=v;O<D;O+=4){const N=m[O]*.00392156862745098,C=m[O+1]*(1/255),k=m[O+2]*(1/255),U=m[O+3]*(1/255);F[0]+=N,F[1]+=C,F[2]+=k,F[3]+=U,A[0]+=N*N,A[1]+=N*C,A[2]+=N*k,A[3]+=N*U,A[5]+=C*C,A[6]+=C*k,A[7]+=C*U,A[10]+=k*k,A[11]+=k*U,A[15]+=U*U}return A[4]=A[1],A[8]=A[2],A[9]=A[6],A[12]=A[3],A[13]=A[7],A[14]=A[11],{R:A,m:F,N:P}}function E(m){const{R:v}=m,{m:D}=m,{N:A}=m,F=D[0],P=D[1],O=D[2],N=D[3],C=A==0?0:1/A,k=[v[0]-F*F*C,v[1]-F*P*C,v[2]-F*O*C,v[3]-F*N*C,v[4]-P*F*C,v[5]-P*P*C,v[6]-P*O*C,v[7]-P*N*C,v[8]-O*F*C,v[9]-O*P*C,v[10]-O*O*C,v[11]-O*N*C,v[12]-N*F*C,v[13]-N*P*C,v[14]-N*O*C,v[15]-N*N*C],U=k,$=T;let G=[Math.random(),Math.random(),Math.random(),Math.random()],K=0,z=0;if(A!=0)for(let V=0;V<16&&(G=$.multVec(U,G),z=Math.sqrt($.dot(G,G)),G=$.sml(1/z,G),!(V!=0&&Math.abs(z-K)<1e-9));V++)K=z;const W=[F*C,P*C,O*C,N*C];return{Cov:k,q:W,e:G,L:K,eMq255:$.dot($.sml(255,W),G),eMq:$.dot(G,W),rgba:(Math.round(255*W[3])<<24|Math.round(255*W[2])<<16|Math.round(255*W[1])<<8|Math.round(255*W[0])<<0)>>>0}}var T={multVec:(m,v)=>[m[0]*v[0]+m[1]*v[1]+m[2]*v[2]+m[3]*v[3],m[4]*v[0]+m[5]*v[1]+m[6]*v[2]+m[7]*v[3],m[8]*v[0]+m[9]*v[1]+m[10]*v[2]+m[11]*v[3],m[12]*v[0]+m[13]*v[1]+m[14]*v[2]+m[15]*v[3]],dot:(m,v)=>m[0]*v[0]+m[1]*v[1]+m[2]*v[2]+m[3]*v[3],sml:(m,v)=>[m*v[0],m*v[1],m*v[2],m*v[3]]};zt.encode=function(v,D,A,F,P,O,N){F==null&&(F=0),N==null&&(N=!1);const C=c(v,D,A,F,[!1,!1,!1,0,N,!1]);return g(C,-1),f(C,D,A,P,O)},zt.encodeLL=function(v,D,A,F,P,O,N,C){const k={ctype:0+(F==1?0:2)+(P==0?0:4),depth:O,frames:[]},U=(F+P)*O,$=U*D;for(let G=0;G<v.length;G++)k.frames.push({rect:{x:0,y:0,width:D,height:A},img:new Uint8Array(v[G]),blend:0,dispose:1,bpp:Math.ceil(U/8),bpl:Math.ceil($/8)});return g(k,0,!0),f(k,D,A,N,C)},zt.encode.compress=c,zt.encode.dither=l,zt.quantize=y,zt.quantize.getKDtree=w,zt.quantize.getNearest=b})();const Nl={toArrayBuffer(e,t){const r=e.width,n=e.height,o=r<<2,a=e.getContext("2d").getImageData(0,0,r,n),s=new Uint32Array(a.data.buffer),l=(32*r+31)/32<<2,f=l*n,g=122+f,c=new ArrayBuffer(g),i=new DataView(c),u=1<<20;let h,p,y,w,b=u,I=0,S=0,M=0;function L(m){i.setUint16(S,m,!0),S+=2}function E(m){i.setUint32(S,m,!0),S+=4}function T(m){S+=m}L(19778),E(g),T(4),E(122),E(108),E(r),E(-n>>>0),L(1),L(32),E(3),E(f),E(2835),E(2835),T(8),E(16711680),E(65280),E(255),E(4278190080),E(1466527264),(function m(){for(;I<n&&b>0;){for(w=122+I*l,h=0;h<o;)b--,p=s[M++],y=p>>>24,i.setUint32(w+h,p<<8|y),h+=4;I++}M<s.length?(b=u,setTimeout(m,Nl._dly)):t(c)})()},toBlob(e,t){this.toArrayBuffer(e,(r=>{t(new Blob([r],{type:"image/bmp"}))}))},_dly:9};var pt={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Lf={[pt.CHROME]:16384,[pt.FIREFOX]:11180,[pt.DESKTOP_SAFARI]:16384,[pt.IE]:8192,[pt.IOS]:4096,[pt.ETC]:8192};const Zo=typeof window<"u",Al=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Nn=Zo&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Ff=(Zo||Al)&&(Nn&&Nn.getOriginalSymbol(window,"File")||typeof File<"u"&&File),Ml=(Zo||Al)&&(Nn&&Nn.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function qo(e,t,r=Date.now()){return new Promise((n=>{const o=e.split(","),a=o[0].match(/:(.*?);/)[1],s=globalThis.atob(o[1]);let l=s.length;const f=new Uint8Array(l);for(;l--;)f[l]=s.charCodeAt(l);const g=new Blob([f],{type:a});g.name=t,g.lastModified=r,n(g)}))}function Ol(e){return new Promise(((t,r)=>{const n=new Ml;n.onload=()=>t(n.result),n.onerror=o=>r(o),n.readAsDataURL(e)}))}function Dl(e){return new Promise(((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=o=>r(o),n.src=e}))}function ur(){if(ur.cachedResult!==void 0)return ur.cachedResult;let e=pt.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=pt.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=pt.IOS:/Safari/i.test(t)?e=pt.DESKTOP_SAFARI:/Firefox/i.test(t)?e=pt.FIREFOX:(/MSIE/i.test(t)||document.documentMode)&&(e=pt.IE),ur.cachedResult=e,ur.cachedResult}function Il(e,t){const r=ur(),n=Lf[r];let o=e,a=t,s=o*a;const l=o>a?a/o:o/a;for(;s>n*n;){const f=(n+o)/2,g=(n+a)/2;f<g?(a=g,o=g*l):(a=f*l,o=f),s=o*a}return{width:o,height:a}}function An(e,t){let r,n;try{if(r=new OffscreenCanvas(e,t),n=r.getContext("2d"),n===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{r=document.createElement("canvas"),n=r.getContext("2d")}return r.width=e,r.height=t,[r,n]}function Pl(e,t){const{width:r,height:n}=Il(e.width,e.height),[o,a]=An(r,n);return t&&/jpe?g/.test(t)&&(a.fillStyle="white",a.fillRect(0,0,o.width,o.height)),a.drawImage(e,0,0,o.width,o.height),o}function Mn(){return Mn.cachedResult!==void 0||(Mn.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),Mn.cachedResult}function On(e,t={}){return new Promise((function(r,n){let o,a;var s=function(){try{return a=Pl(o,t.fileType||e.type),r([o,a])}catch(f){return n(f)}},l=function(f){try{var g=function(c){try{throw c}catch(i){return n(i)}};try{let c;return Ol(e).then((function(i){try{return c=i,Dl(c).then((function(u){try{return o=u,(function(){try{return s()}catch(h){return n(h)}})()}catch(h){return g(h)}}),g)}catch(u){return g(u)}}),g)}catch(c){g(c)}}catch(c){return n(c)}};try{if(Mn()||[pt.DESKTOP_SAFARI,pt.MOBILE_SAFARI].includes(ur()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then((function(f){try{return o=f,s()}catch{return l()}}),l)}catch{l()}}))}function Dn(e,t,r,n,o=1){return new Promise((function(a,s){let l;if(t==="image/png"){let g,c,i;return g=e.getContext("2d"),{data:c}=g.getImageData(0,0,e.width,e.height),i=zt.encode([c.buffer],e.width,e.height,4096*o),l=new Blob([i],{type:t}),l.name=r,l.lastModified=n,f.call(this)}{let g=function(){return f.call(this)};if(t==="image/bmp")return new Promise((c=>Nl.toBlob(e,c))).then(function(c){try{return l=c,l.name=r,l.lastModified=n,g.call(this)}catch(i){return s(i)}}.bind(this),s);{let c=function(){return g.call(this)};if(typeof OffscreenCanvas=="function"&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:o}).then(function(i){try{return l=i,l.name=r,l.lastModified=n,c.call(this)}catch(u){return s(u)}}.bind(this),s);{let i;return i=e.toDataURL(t,o),qo(i,r,n).then(function(u){try{return l=u,c.call(this)}catch(h){return s(h)}}.bind(this),s)}}}function f(){return a(l)}}))}function Vt(e){e.width=0,e.height=0}function Tr(){return new Promise((function(e,t){let r,n,o,a;return Tr.cachedResult!==void 0?e(Tr.cachedResult):qo("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(s){try{return r=s,On(r).then((function(l){try{return n=l[1],Dn(n,r.type,r.name,r.lastModified).then((function(f){try{return o=f,Vt(n),On(o).then((function(g){try{return a=g[0],Tr.cachedResult=a.width===1&&a.height===2,e(Tr.cachedResult)}catch(c){return t(c)}}),t)}catch(g){return t(g)}}),t)}catch(f){return t(f)}}),t)}catch(l){return t(l)}}),t)}))}function Ll(e){return new Promise(((t,r)=>{const n=new Ml;n.onload=o=>{const a=new DataView(o.target.result);if(a.getUint16(0,!1)!=65496)return t(-2);const s=a.byteLength;let l=2;for(;l<s;){if(a.getUint16(l+2,!1)<=8)return t(-1);const f=a.getUint16(l,!1);if(l+=2,f==65505){if(a.getUint32(l+=2,!1)!=1165519206)return t(-1);const g=a.getUint16(l+=6,!1)==18761;l+=a.getUint32(l+4,g);const c=a.getUint16(l,g);l+=2;for(let i=0;i<c;i++)if(a.getUint16(l+12*i,g)==274)return t(a.getUint16(l+12*i+8,g))}else{if((65280&f)!=65280)break;l+=a.getUint16(l,!1)}}return t(-1)},n.onerror=o=>r(o),n.readAsArrayBuffer(e)}))}function Fl(e,t){const{width:r}=e,{height:n}=e,{maxWidthOrHeight:o}=t;let a,s=e;return isFinite(o)&&(r>o||n>o)&&([s,a]=An(r,n),r>n?(s.width=o,s.height=n/r*o):(s.width=r/n*o,s.height=o),a.drawImage(e,0,0,s.width,s.height),Vt(e)),s}function Ul(e,t){const{width:r}=e,{height:n}=e,[o,a]=An(r,n);switch(t>4&&t<9?(o.width=n,o.height=r):(o.width=r,o.height=n),t){case 2:a.transform(-1,0,0,1,r,0);break;case 3:a.transform(-1,0,0,-1,r,n);break;case 4:a.transform(1,0,0,-1,0,n);break;case 5:a.transform(0,1,1,0,0,0);break;case 6:a.transform(0,1,-1,0,n,0);break;case 7:a.transform(0,-1,-1,0,n,r);break;case 8:a.transform(0,-1,1,0,0,r)}return a.drawImage(e,0,0,r,n),Vt(e),o}function $l(e,t,r=0){return new Promise((function(n,o){let a,s,l,f,g,c,i,u,h,p,y,w,b,I,S,M,L,E,T,m;function v(A=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;a+=A,t.onProgress(Math.min(a,100))}function D(A){if(t.signal&&t.signal.aborted)throw t.signal.reason;a=Math.min(Math.max(A,a),100),t.onProgress(a)}return a=r,s=t.maxIteration||10,l=1024*t.maxSizeMB*1024,v(),On(e,t).then(function(A){try{return[,f]=A,v(),g=Fl(f,t),v(),new Promise((function(F,P){var O;if(!(O=t.exifOrientation))return Ll(e).then(function(C){try{return O=C,N.call(this)}catch(k){return P(k)}}.bind(this),P);function N(){return F(O)}return N.call(this)})).then(function(F){try{return c=F,v(),Tr().then(function(P){try{return i=P?g:Ul(g,c),v(),u=t.initialQuality||1,h=t.fileType||e.type,Dn(i,h,e.name,e.lastModified,u).then(function(O){try{{let C=function(){if(s--&&(S>l||S>b)){let U,$;return U=m?.95*T.width:T.width,$=m?.95*T.height:T.height,[L,E]=An(U,$),E.drawImage(T,0,0,U,$),u*=h==="image/png"?.85:.95,Dn(L,h,e.name,e.lastModified,u).then((function(G){try{return M=G,Vt(T),T=L,S=M.size,D(Math.min(99,Math.floor((I-S)/(I-l)*100))),C}catch(K){return o(K)}}),o)}return[1]},k=function(){return Vt(T),Vt(L),Vt(g),Vt(i),Vt(f),D(100),n(M)};if(p=O,v(),y=p.size>l,w=p.size>e.size,!y&&!w)return D(100),n(p);var N;return b=e.size,I=p.size,S=I,T=i,m=!t.alwaysKeepResolution&&y,(N=function(U){for(;U;){if(U.then)return void U.then(N,o);try{if(U.pop){if(U.length)return U.pop()?k.call(this):U;U=C}else U=U.call(this)}catch($){return o($)}}}.bind(this))(C)}}catch(C){return o(C)}}.bind(this),o)}catch(O){return o(O)}}.bind(this),o)}catch(P){return o(P)}}.bind(this),o)}catch(F){return o(F)}}.bind(this),o)}))}const Uf=`
let scriptImported = false
self.addEventListener('message', async (e) => {
const { file, id, imageCompressionLibUrl, options } = e.data
options.onProgress = (progress) => self.postMessage({ progress, id })
try {
if (!scriptImported) {
// console.log('[worker] importScripts', imageCompressionLibUrl)
self.importScripts(imageCompressionLibUrl)
scriptImported = true
}
// console.log('[worker] self', self)
const compressedFile = await imageCompression(file, options)
self.postMessage({ file: compressedFile, id })
} catch (e) {
// console.error('[worker] error', e)
self.postMessage({ error: e.message + '\\n' + e.stack, id })
}
})
`;let Qo;function $f(e,t){return new Promise(((r,n)=>{Qo||(Qo=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(Uf));const o=new Worker(Qo);o.addEventListener("message",(function(s){if(t.signal&&t.signal.aborted)o.terminate();else if(s.data.progress===void 0){if(s.data.error)return n(new Error(s.data.error)),void o.terminate();r(s.data.file),o.terminate()}else t.onProgress(s.data.progress)})),o.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",(()=>{n(t.signal.reason),o.terminate()})),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function it(e,t){return new Promise((function(r,n){let o,a,s,l,f,g;if(o={...t},s=0,{onProgress:l}=o,o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,f=typeof o.useWebWorker!="boolean"||o.useWebWorker,delete o.useWebWorker,o.onProgress=h=>{s=h,typeof l=="function"&&l(s)},!(e instanceof Blob||e instanceof Ff))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(g=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!f||typeof Worker!="function"||g)return $l(e,o).then(function(h){try{return a=h,u.call(this)}catch(p){return n(p)}}.bind(this),n);var c=function(){try{return u.call(this)}catch(h){return n(h)}}.bind(this),i=function(h){try{return $l(e,o).then((function(p){try{return a=p,c()}catch(y){return n(y)}}),n)}catch(p){return n(p)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",$f(e,o).then((function(h){try{return a=h,c()}catch{return i()}}),i)}catch{i()}function u(){try{a.name=e.name,a.lastModified=e.lastModified}catch{}try{o.preserveExif&&e.type==="image/jpeg"&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(a=Tl(e,a))}catch{}return r(a)}}))}it.getDataUrlFromFile=Ol,it.getFilefromDataUrl=qo,it.loadImage=Dl,it.drawImageInCanvas=Pl,it.drawFileInCanvas=On,it.canvasToFile=Dn,it.getExifOrientation=Ll,it.handleMaxWidthOrHeight=Fl,it.followExifOrientation=Ul,it.cleanupCanvasMemory=Vt,it.isAutoOrientationInBrowser=Tr,it.approximateBelowMaximumCanvasSizeOfBrowser=Il,it.copyExifWithoutOrientation=Tl,it.getBrowserName=ur,it.version="2.0.2";const zf=window.G7Core,In=e=>{const t=["B","KB","MB","GB"];let r=0,n=e;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(2)} ${t[r]}`},zl=e=>{if(e&&typeof e=="object"){const t=e;if(t.response?.data?.message)return t.response.data.message;if(t.response?.data?.errors){const r=Object.values(t.response.data.errors)[0];if(Array.isArray(r)&&r[0])return r[0]}if(t.message)return t.message}return e instanceof Error?e.message:"업로드 실패"},Hl=e=>e?e.startsWith("image/")?"fa-file-image":e.startsWith("video/")?"fa-file-video":e.startsWith("audio/")?"fa-file-audio":e==="application/pdf"?"fa-file-pdf":e.includes("word")||e.includes("document")?"fa-file-word":e.includes("excel")||e.includes("spreadsheet")?"fa-file-excel":e.includes("zip")||e.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",nt=(e,t)=>zf?.t?.(e,t)??e,fr=window.G7Core;function jl(e){const{attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:g,autoUpload:c,initialFiles:i,endpoints:u,onFilesChange:h,onUploadComplete:p,onUploadError:y,onRemove:w,onReorder:b,uploadTriggerEvent:I,confirmBeforeRemove:S,uploadParams:M}=e,[L,E]=x.useState(i),[T,m]=x.useState([]),[v,D]=x.useState(!1),A=x.useRef(null),F=x.useRef(0),P=x.useRef(new Set),O=x.useRef(new Map),[N,C]=x.useState(!1),[k,U]=x.useState(null),[$,G]=x.useState(!1),K=x.useRef(!1),[z,W]=x.useState([]),V=x.useRef(i),[B,Z]=x.useState(!1),[pe,ie]=x.useState(0),fe=x.useRef(0),[ee,_e]=x.useState(new Map),ye=x.useRef(new Map);x.useEffect(()=>{h?.(T)},[T,h]);const He=x.useMemo(()=>{const X=V.current;return X===i?X:X.length!==i.length?(V.current=i,i):X.length===0&&i.length===0?X:i.some((ce,se)=>ce.id!==X[se]?.id)?(V.current=i,i):X},[i]);x.useEffect(()=>{if(K.current)return;const X=He.filter(se=>!P.current.has(se.id)&&(!se.hash||!P.current.has(se.hash))),ne=new Set(X.map(se=>se.id)),ce=Array.from(O.current.values()).filter(se=>!ne.has(se.id)&&!P.current.has(se.id));E([...X,...ce])},[He]);const Fe=x.useCallback(async X=>{const ne={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0};return await it(X,ne)},[f]),ve=x.useCallback(async X=>{const ne=L.length+T.length,ce=o-ne,se=Array.from(X).slice(0,ce);for(const oe of se){if(oe.size>a*1024*1024){y?.(`[${oe.name}] 파일 크기(${In(oe.size)})가 최대 허용 크기(${a}MB)를 초과합니다.`,oe);continue}if(l){const we="."+oe.name.split(".").pop()?.toLowerCase();if(!l.split(",").map(Ie=>Ie.trim().toLowerCase()).some(Ie=>{if(Ie.includes("/")){if(Ie.endsWith("/*")){const Be=Ie.slice(0,-2);return oe.type.toLowerCase().startsWith(Be+"/")}return oe.type.toLowerCase()===Ie}return we===Ie})){y?.(`[${oe.name}] 허용되지 않는 파일 형식입니다. (허용: ${l})`,oe);continue}}const Ne={id:`pending-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,file:oe,original_filename:oe.name,mime_type:oe.type,size:oe.size,size_formatted:In(oe.size),status:"pending",progress:0};if(oe.type.startsWith("image/")&&(Ne.preview=URL.createObjectURL(oe)),m(we=>[...we,Ne]),oe.type.startsWith("image/")&&f){m(we=>we.map(ke=>ke.id===Ne.id?{...ke,status:"compressing"}:ke));try{const we=await Fe(oe);m(ke=>ke.map(Ce=>Ce.id===Ne.id?{...Ce,compressedBlob:we,size:we.size,size_formatted:In(we.size),status:"pending",progress:0}:Ce))}catch{m(we=>we.map(ke=>ke.id===Ne.id?{...ke,status:"error",error:"이미지 압축 실패"}:ke))}}}},[L.length,T.length,o,a,l,f,Fe,y]),J=x.useCallback(async X=>{const ne=new FormData,ce=X.compressedBlob?new File([X.compressedBlob],X.original_filename,{type:X.mime_type}):X.file;ne.append("file",ce),t&&ne.append("attachmentable_type",t),r&&ne.append("attachmentable_id",String(r)),ne.append("collection",n),g.forEach(se=>{ne.append("role_ids[]",String(se))}),M&&Object.entries(M).forEach(([se,oe])=>{ne.append(se,oe)});try{const se=await fr.api.post(u.upload,ne,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:Ne=>{const we=Math.round(Ne.loaded*100/(Ne.total??1));m(ke=>ke.map(Ce=>Ce.id===X.id?{...Ce,progress:we}:Ce))}});return se?.data?.data??se?.data}catch(se){const oe=zl(se);throw new Error(oe)}},[t,r,n,g,u.upload]),he=x.useCallback(async()=>{const X=T.filter(we=>we.status==="pending"||we.status==="error");if(X.length===0)return[];const ne=[],ce=new Map,se=[...X],oe=async()=>{for(;se.length>0&&F.current<s;){const we=se.shift();F.current++,m(ke=>ke.map(Ce=>Ce.id===we.id?{...Ce,status:"uploading",progress:0}:Ce));try{const ke=await J(we);if(ke)ne.push(ke),ce.set(String(we.id),String(ke.hash)),O.current.set(ke.id,ke),m(Ce=>Ce.filter(Ie=>Ie.id!==we.id)),E(Ce=>[...Ce,ke]),W(Ce=>{if(Ce.length===0)return Ce;const Ie=String(we.id);return Ce.some(Se=>String(Se)===Ie)?Ce.map(Se=>String(Se)===Ie?String(ke.hash):Se):Ce}),we.preview&&URL.revokeObjectURL(we.preview);else{const Ce=nt("attachment.upload_response_invalid");m(Ie=>Ie.map(Be=>Be.id===we.id?{...Be,status:"error",error:Ce}:Be)),y?.(`[${we.original_filename}] ${Ce}`,we.file)}}catch(ke){const Ce=ke instanceof Error?ke.message:"업로드 실패";m(Ie=>Ie.map(Be=>Be.id===we.id?{...Be,status:"error",error:Ce}:Be)),y?.(`[${we.original_filename}] ${Ce}`,we.file)}finally{F.current--}}},Ne=Array(Math.min(s,X.length)).fill(null).map(()=>oe());if(await Promise.all(Ne),ne.length>0&&(p?.(ne),u.reorder&&z.length>0&&b)){const we=[...L,...ne],ke=z.map(Be=>ce.get(String(Be))??Be),Ce=new Map(ke.map((Be,Se)=>[String(Be),Se])),Ie=[...we].sort((Be,Se)=>{const me=Ce.get(String(Be.hash))??we.length,Te=Ce.get(String(Se.hash))??we.length;return me-Te}).map((Be,Se)=>({...Be,sort_order:Se,order:Se+1}));b(Ie)}return ne},[T,s,J,p,y,z,L,b,u.reorder]);x.useEffect(()=>{if(!I)return;const X=fr.componentEvent.on(I,async()=>{const ne=await he();return{uploadedAttachments:ne,existingFiles:L,allFiles:[...L,...ne]}});return()=>{X()}},[I,he,L]),x.useEffect(()=>{c&&T.some(X=>X.status==="pending")&&he()},[c,T,he]);const xe=x.useCallback(async X=>{G(!0);try{if(X.id&&u.delete){const ce=u.delete.replace(":id",String(X.id));await fr.api.delete(ce)}const ne=X.hash||X.id;X.id&&(P.current.add(X.id),O.current.delete(X.id)),X.hash&&P.current.add(X.hash),E(ce=>ce.filter(se=>(se.hash||se.id)!==ne)),w?.(X.hash||X.id),C(!1),U(null)}catch{console.error("첨부파일 삭제 실패")}finally{G(!1)}},[w,u.delete]),Ue=x.useCallback(async X=>{"hash"in X?S?(U(X),C(!0)):await xe(X):(X.preview&&URL.revokeObjectURL(X.preview),m(ne=>ne.filter(ce=>ce.id!==X.id)))},[S,xe]),Le=x.useCallback(X=>{m(ne=>ne.map(ce=>ce.id===X.id?{...ce,status:"pending",error:void 0}:ce))},[]),Y=x.useCallback(async X=>{const{arrayMove:ne}=await Promise.resolve().then(()=>wg),{active:ce,over:se}=X;if(!se||ce.id===se.id)return;const oe=[...L,...T];let Ne;if(z.length===0)Ne=oe;else{const me=new Map(z.map((Te,Ke)=>[String(Te),Ke]));Ne=[...oe].sort((Te,Ke)=>{const De="hash"in Te?String(Te.hash):String(Te.id),Ge="hash"in Ke?String(Ke.hash):String(Ke.id);return(me.get(De)??oe.length)-(me.get(Ge)??oe.length)})}const we=Ne.findIndex(me=>"hash"in me?me.hash===ce.id:me.id===ce.id),ke=Ne.findIndex(me=>"hash"in me?me.hash===se.id:me.id===se.id),Ce=ne(Ne,we,ke);W(Ce.map(me=>"hash"in me?me.hash:me.id));const Ie=Ce.filter(me=>"hash"in me),Be=Ce.filter(me=>!("hash"in me));K.current=!0,E(Ie),m(Be);const Se=Ie.map((me,Te)=>({...me,sort_order:Te,order:Te+1}));if(Ie.length>0&&u.reorder){const me=Ie.map((Te,Ke)=>({id:Te.id,order:Ke+1}));try{const Te=await fr.api.patch(u.reorder,{order:me});fr.toast.success(Te.message)}catch(Te){const Ke=Te instanceof Error?Te.message:nt("attachment.reorder_failed");fr.toast.error(Ke)}}b?.(Se)},[L,T,z,u.reorder,b]),te=x.useMemo(()=>[...L,...T].filter(X=>"is_image"in X?X.is_image:X.mime_type?.startsWith("image/")??!1),[L,T]),de=x.useCallback(X=>{const ne=te.findIndex(ce=>"hash"in X&&"hash"in ce?ce.hash===X.hash:"id"in X&&"id"in ce&&!("hash"in X)&&!("hash"in ce)?ce.id===X.id:!1);ne!==-1&&(fe.current+=1,ie(ne),Z(!0))},[te]);x.useEffect(()=>{let X=!1;return(async()=>{const ce=L.filter(oe=>oe.is_image),se=new Set(ce.map(oe=>oe.id));for(const[oe,Ne]of ye.current)se.has(oe)||(URL.revokeObjectURL(Ne),ye.current.delete(oe));for(const oe of ce){if(X)break;if(!ye.current.has(oe.id))try{const Ne=await fr.api.get(oe.download_url,{responseType:"blob"});if(!X&&Ne){const we=URL.createObjectURL(Ne);ye.current.set(oe.id,we),_e(new Map(ye.current))}}catch(Ne){console.error("Failed to load authenticated image:",Ne)}}})(),()=>{X=!0}},[L]),x.useEffect(()=>()=>{ye.current.forEach(X=>URL.revokeObjectURL(X)),ye.current.clear()},[]);const ae=x.useCallback(async X=>{const{executeImageDownload:ne}=await Promise.resolve().then(()=>yl);await ne({src:X.download_url,downloadUrl:X.download_url,filename:X.original_filename,downloadRequiresAuth:!0})},[]),Ee=x.useMemo(()=>{const X=[...L,...T];if(z.length===0)return X;const ne=new Map(z.map((ce,se)=>[String(ce),se]));return[...X].sort((ce,se)=>{const oe="hash"in ce?String(ce.hash):String(ce.id),Ne="hash"in se?String(se.hash):String(se.id),we=ne.get(oe)??X.length,ke=ne.get(Ne)??X.length;return we-ke})},[L,T,z]),je=Ee.length,ze=je>0,Me=je<o,Xe=x.useCallback(()=>m([]),[]),$e=x.useCallback(()=>T,[T]);return{existingFiles:L,pendingFiles:T,isDragOver:v,setIsDragOver:D,isDeleting:$,totalCount:je,hasFiles:ze,canAddMore:Me,allItems:Ee,imageFiles:te,handleFiles:ve,handleRemove:Ue,handleRetry:Le,handleUploadAll:he,handleOpenGallery:de,handleDownload:ae,handleDragEnd:Y,inputRef:A,galleryOpen:B,setGalleryOpen:Z,galleryStartIndex:pe,galleryKeyRef:fe,confirmDialogOpen:N,setConfirmDialogOpen:C,itemToDelete:k,executeRemoveAttachment:xe,authenticatedImageUrls:ee,clear:Xe,getPendingFiles:$e}}const Bl=({isDragOver:e,canAddMore:t,onFiles:r,setIsDragOver:n,inputRef:o,accept:a,maxFiles:s,maxSize:l,children:f})=>d.jsxs(j,{className:`
relative border-2 border-dashed rounded-lg transition-colors
${e?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
`,onDragOver:g=>{g.preventDefault(),t&&n(!0)},onDragLeave:()=>n(!1),onDrop:g=>{g.preventDefault(),n(!1),t&&r(g.dataTransfer.files)},children:[d.jsx("input",{ref:o,type:"file",multiple:!0,accept:a,onChange:g=>g.target.files&&r(g.target.files),className:"hidden"}),!f&&d.jsxs(j,{className:"p-8 text-center cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:()=>o.current?.click(),children:[d.jsx(Ot,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),d.jsx(It,{className:"text-sm text-gray-600 dark:text-gray-400",children:nt("attachment.drop_or_click")}),d.jsxs(It,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[nt("attachment.upload_limit",{maxFiles:s,maxSize:l}),a&&` (${a})`]})]}),f]});function Hf(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return x.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Pn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Nr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Jo(e){return"nodeType"in e}function mt(e){var t,r;return e?Nr(e)?e:Jo(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Ro(e){const{Document:t}=mt(e);return e instanceof t}function Zr(e){return Nr(e)?!1:e instanceof mt(e).HTMLElement}function Gl(e){return e instanceof mt(e).SVGElement}function Ar(e){return e?Nr(e)?e.document:Jo(e)?Ro(e)?e:Zr(e)||Gl(e)?e.ownerDocument:document:document:document}const Yt=Pn?x.useLayoutEffect:x.useEffect;function ea(e){const t=x.useRef(e);return Yt(()=>{t.current=e}),x.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function jf(){const e=x.useRef(null),t=x.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function qr(e,t){t===void 0&&(t=[e]);const r=x.useRef(e);return Yt(()=>{r.current!==e&&(r.current=e)},t),r}function Qr(e,t){const r=x.useRef();return x.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Ln(e){const t=ea(e),r=x.useRef(null),n=x.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function ta(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let ra={};function Jr(e,t){return x.useMemo(()=>{if(t)return t;const r=ra[e]==null?0:ra[e]+1;return ra[e]=r,e+"-"+r},[e,t])}function Wl(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,s)=>{const l=Object.entries(s);for(const[f,g]of l){const c=a[f];c!=null&&(a[f]=c+e*g)}return a},{...t})}}const Mr=Wl(1),Rr=Wl(-1);function Bf(e){return"clientX"in e&&"clientY"in e}function na(e){if(!e)return!1;const{KeyboardEvent:t}=mt(e.target);return t&&e instanceof t}function Gf(e){if(!e)return!1;const{TouchEvent:t}=mt(e.target);return t&&e instanceof t}function oa(e){if(Gf(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Bf(e)?{x:e.clientX,y:e.clientY}:null}const en=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[en.Translate.toString(e),en.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Kl="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Wf(e){return e.matches(Kl)?e:e.querySelector(Kl)}const Kf={display:"none"};function Vf(e){let{id:t,value:r}=e;return x.createElement("div",{id:t,style:Kf},r)}function Yf(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return x.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function Xf(){const[e,t]=x.useState("");return{announce:x.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Vl=x.createContext(null);function Zf(e){const t=x.useContext(Vl);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function qf(){const[e]=x.useState(()=>new Set),t=x.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[x.useCallback(n=>{let{type:o,event:a}=n;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const Qf={draggable:`
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
`},Jf={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Rf(e){let{announcements:t=Jf,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=Qf}=e;const{announce:a,announcement:s}=Xf(),l=Jr("DndLiveRegion"),[f,g]=x.useState(!1);if(x.useEffect(()=>{g(!0)},[]),Zf(x.useMemo(()=>({onDragStart(i){let{active:u}=i;a(t.onDragStart({active:u}))},onDragMove(i){let{active:u,over:h}=i;t.onDragMove&&a(t.onDragMove({active:u,over:h}))},onDragOver(i){let{active:u,over:h}=i;a(t.onDragOver({active:u,over:h}))},onDragEnd(i){let{active:u,over:h}=i;a(t.onDragEnd({active:u,over:h}))},onDragCancel(i){let{active:u,over:h}=i;a(t.onDragCancel({active:u,over:h}))}}),[a,t])),!f)return null;const c=x.createElement(x.Fragment,null,x.createElement(Vf,{id:n,value:o.draggable}),x.createElement(Yf,{id:l,announcement:s}));return r?Jt.createPortal(c,r):c}var Re;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Re||(Re={}));function Fn(){}function Yl(e,t){return x.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function eh(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return x.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Ht=Object.freeze({x:0,y:0});function Xl(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Zl(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function th(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ql(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function Ql(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Jl(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const rh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Jl(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const g=Xl(Jl(f),o);a.push({id:l,data:{droppableContainer:s,value:g}})}}return a.sort(Zl)},nh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ql(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const g=ql(f),c=o.reduce((u,h,p)=>u+Xl(g[p],h),0),i=Number((c/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(Zl)};function oh(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-n,l=a-r;if(n<o&&r<a){const f=t.width*t.height,g=e.width*e.height,c=s*l,i=c/(f+g-c);return Number(i.toFixed(4))}return 0}const ah=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:s}=a,l=r.get(s);if(l){const f=oh(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(th)};function sh(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Rl(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ht}function lh(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const ih=lh(1);function ch(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function dh(e,t,r){const n=ch(t);if(!n)return e;const{scaleX:o,scaleY:a,x:s,y:l}=n,f=e.left-s-(1-o)*parseFloat(r),g=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),c=o?e.width/o:e.width,i=a?e.height/a:e.height;return{width:c,height:i,top:g,right:f+c,bottom:g+i,left:f}}const uh={ignoreTransform:!1};function Or(e,t){t===void 0&&(t=uh);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:c}=mt(e).getComputedStyle(e);g&&(r=dh(r,g,c))}const{top:n,left:o,width:a,height:s,bottom:l,right:f}=r;return{top:n,left:o,width:a,height:s,bottom:l,right:f}}function ei(e){return Or(e,{ignoreTransform:!0})}function fh(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function hh(e,t){return t===void 0&&(t=mt(e).getComputedStyle(e)),t.position==="fixed"}function gh(e,t){t===void 0&&(t=mt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function Un(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(Ro(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!Zr(o)||Gl(o)||r.includes(o))return r;const a=mt(e).getComputedStyle(o);return o!==e&&gh(o,a)&&r.push(o),hh(o,a)?r:n(o.parentNode)}return e?n(e):r}function ti(e){const[t]=Un(e,1);return t??null}function aa(e){return!Pn||!e?null:Nr(e)?e:Jo(e)?Ro(e)||e===Ar(e).scrollingElement?window:Zr(e)?e:null:null}function ri(e){return Nr(e)?e.scrollX:e.scrollLeft}function ni(e){return Nr(e)?e.scrollY:e.scrollTop}function sa(e){return{x:ri(e),y:ni(e)}}var ot;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ot||(ot={}));function oi(e){return!Pn||!e?!1:e===document.scrollingElement}function ai(e){const t={x:0,y:0},r=oi(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,l=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:s,isRight:l,maxScroll:n,minScroll:t}}const ph={x:.2,y:.2};function mh(e,t,r,n,o){let{top:a,left:s,right:l,bottom:f}=r;n===void 0&&(n=10),o===void 0&&(o=ph);const{isTop:g,isBottom:c,isLeft:i,isRight:u}=ai(e),h={x:0,y:0},p={x:0,y:0},y={height:t.height*o.y,width:t.width*o.x};return!g&&a<=t.top+y.height?(h.y=ot.Backward,p.y=n*Math.abs((t.top+y.height-a)/y.height)):!c&&f>=t.bottom-y.height&&(h.y=ot.Forward,p.y=n*Math.abs((t.bottom-y.height-f)/y.height)),!u&&l>=t.right-y.width?(h.x=ot.Forward,p.x=n*Math.abs((t.right-y.width-l)/y.width)):!i&&s<=t.left+y.width&&(h.x=ot.Backward,p.x=n*Math.abs((t.left+y.width-s)/y.width)),{direction:h,speed:p}}function bh(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function si(e){return e.reduce((t,r)=>Mr(t,sa(r)),Ht)}function yh(e){return e.reduce((t,r)=>t+ri(r),0)}function vh(e){return e.reduce((t,r)=>t+ni(r),0)}function wh(e,t){if(t===void 0&&(t=Or),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);ti(e)&&(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const xh=[["x",["left","right"],yh],["y",["top","bottom"],vh]];class la{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Un(r),o=si(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of xh)for(const f of s)Object.defineProperty(this,f,{get:()=>{const g=l(n),c=o[a]-g;return this.rect[f]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class tn{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function kh(e){const{EventTarget:t}=mt(e);return e instanceof t?e:Ar(e)}function ia(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Dt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Dt||(Dt={}));function li(e){e.preventDefault()}function Ch(e){e.stopPropagation()}var Pe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Pe||(Pe={}));const ii={start:[Pe.Space,Pe.Enter],cancel:[Pe.Esc],end:[Pe.Space,Pe.Enter,Pe.Tab]},Sh=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Pe.Right:return{...r,x:r.x+25};case Pe.Left:return{...r,x:r.x-25};case Pe.Down:return{...r,y:r.y+25};case Pe.Up:return{...r,y:r.y-25}}};class ca{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new tn(Ar(r)),this.windowListeners=new tn(mt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Dt.Resize,this.handleCancel),this.windowListeners.add(Dt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Dt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&wh(n),r(Ht)}handleKeyDown(t){if(na(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=ii,coordinateGetter:s=Sh,scrollBehavior:l="smooth"}=o,{code:f}=t;if(a.end.includes(f)){this.handleEnd(t);return}if(a.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:g}=n.current,c=g?{x:g.left,y:g.top}:Ht;this.referenceCoordinates||(this.referenceCoordinates=c);const i=s(t,{active:r,context:n.current,currentCoordinates:c});if(i){const u=Rr(i,c),h={x:0,y:0},{scrollableAncestors:p}=n.current;for(const y of p){const w=t.code,{isTop:b,isRight:I,isLeft:S,isBottom:M,maxScroll:L,minScroll:E}=ai(y),T=bh(y),m={x:Math.min(w===Pe.Right?T.right-T.width/2:T.right,Math.max(w===Pe.Right?T.left:T.left+T.width/2,i.x)),y:Math.min(w===Pe.Down?T.bottom-T.height/2:T.bottom,Math.max(w===Pe.Down?T.top:T.top+T.height/2,i.y))},v=w===Pe.Right&&!I||w===Pe.Left&&!S,D=w===Pe.Down&&!M||w===Pe.Up&&!b;if(v&&m.x!==i.x){const A=y.scrollLeft+u.x,F=w===Pe.Right&&A<=L.x||w===Pe.Left&&A>=E.x;if(F&&!u.y){y.scrollTo({left:A,behavior:l});return}F?h.x=y.scrollLeft-A:h.x=w===Pe.Right?y.scrollLeft-L.x:y.scrollLeft-E.x,h.x&&y.scrollBy({left:-h.x,behavior:l});break}else if(D&&m.y!==i.y){const A=y.scrollTop+u.y,F=w===Pe.Down&&A<=L.y||w===Pe.Up&&A>=E.y;if(F&&!u.x){y.scrollTo({top:A,behavior:l});return}F?h.y=y.scrollTop-A:h.y=w===Pe.Down?y.scrollTop-L.y:y.scrollTop-E.y,h.y&&y.scrollBy({top:-h.y,behavior:l});break}}this.handleMove(t,Mr(Rr(i,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}ca.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=ii,onActivation:o}=t,{active:a}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function ci(e){return!!(e&&"distance"in e)}function di(e){return!!(e&&"delay"in e)}class da{constructor(t,r,n){var o;n===void 0&&(n=kh(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:s}=a;this.props=t,this.events=r,this.document=Ar(s),this.documentListeners=new tn(this.document),this.listeners=new tn(n),this.windowListeners=new tn(mt(s)),this.initialCoordinates=(o=oa(a))!=null?o:Ht,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Dt.Resize,this.handleCancel),this.windowListeners.add(Dt.DragStart,li),this.windowListeners.add(Dt.VisibilityChange,this.handleCancel),this.windowListeners.add(Dt.ContextMenu,li),this.documentListeners.add(Dt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(di(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(ci(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Dt.Click,Ch,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Dt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!o)return;const f=(r=oa(t))!=null?r:Ht,g=Rr(o,f);if(!n&&l){if(ci(l)){if(l.tolerance!=null&&ia(g,l.tolerance))return this.handleCancel();if(ia(g,l.distance))return this.handleStart()}if(di(l)&&ia(g,l.tolerance))return this.handleCancel();this.handlePending(l,g);return}t.cancelable&&t.preventDefault(),s(f)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Pe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Eh={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ua extends da{constructor(t){const{event:r}=t,n=Ar(r.target);super(t,Eh,n)}}ua.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n?.({event:r}),!0)}}];const _h={move:{name:"mousemove"},end:{name:"mouseup"}};var fa;(function(e){e[e.RightClick=2]="RightClick"})(fa||(fa={}));class Th extends da{constructor(t){super(t,_h,Ar(t.event.target))}}Th.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===fa.RightClick?!1:(n?.({event:r}),!0)}}];const ha={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Nh extends da{constructor(t){super(t,ha)}static setup(){return window.addEventListener(ha.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ha.move.name,t)};function t(){}}}Nh.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n?.({event:r}),!0)}}];var rn;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(rn||(rn={}));var $n;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})($n||($n={}));function Ah(e){let{acceleration:t,activator:r=rn.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:s=5,order:l=$n.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:c,delta:i,threshold:u}=e;const h=Oh({delta:i,disabled:!a}),[p,y]=jf(),w=x.useRef({x:0,y:0}),b=x.useRef({x:0,y:0}),I=x.useMemo(()=>{switch(r){case rn.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case rn.DraggableRect:return o}},[r,o,f]),S=x.useRef(null),M=x.useCallback(()=>{const E=S.current;if(!E)return;const T=w.current.x*b.current.x,m=w.current.y*b.current.y;E.scrollBy(T,m)},[]),L=x.useMemo(()=>l===$n.TreeOrder?[...g].reverse():g,[l,g]);x.useEffect(()=>{if(!a||!g.length||!I){y();return}for(const E of L){if(n?.(E)===!1)continue;const T=g.indexOf(E),m=c[T];if(!m)continue;const{direction:v,speed:D}=mh(E,m,I,t,u);for(const A of["x","y"])h[A][v[A]]||(D[A]=0,v[A]=0);if(D.x>0||D.y>0){y(),S.current=E,p(M,s),w.current=D,b.current=v;return}}w.current={x:0,y:0},b.current={x:0,y:0},y()},[t,M,n,y,a,s,JSON.stringify(I),JSON.stringify(h),p,g,L,c,JSON.stringify(u)])}const Mh={x:{[ot.Backward]:!1,[ot.Forward]:!1},y:{[ot.Backward]:!1,[ot.Forward]:!1}};function Oh(e){let{delta:t,disabled:r}=e;const n=ta(t);return Qr(o=>{if(r||!n||!o)return Mh;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ot.Backward]:o.x[ot.Backward]||a.x===-1,[ot.Forward]:o.x[ot.Forward]||a.x===1},y:{[ot.Backward]:o.y[ot.Backward]||a.y===-1,[ot.Forward]:o.y[ot.Forward]||a.y===1}}},[r,t,n])}function Dh(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Qr(o=>{var a;return t==null?null:(a=n??o)!=null?a:null},[n,t])}function Ih(e,t){return x.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...a]},[]),[e,t])}var nn;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(nn||(nn={}));var ga;(function(e){e.Optimized="optimized"})(ga||(ga={}));const ui=new Map;function Ph(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,s]=x.useState(null),{frequency:l,measure:f,strategy:g}=o,c=x.useRef(e),i=w(),u=qr(i),h=x.useCallback(function(b){b===void 0&&(b=[]),!u.current&&s(I=>I===null?b:I.concat(b.filter(S=>!I.includes(S))))},[u]),p=x.useRef(null),y=Qr(b=>{if(i&&!r)return ui;if(!b||b===ui||c.current!==e||a!=null){const I=new Map;for(let S of e){if(!S)continue;if(a&&a.length>0&&!a.includes(S.id)&&S.rect.current){I.set(S.id,S.rect.current);continue}const M=S.node.current,L=M?new la(f(M),M):null;S.rect.current=L,L&&I.set(S.id,L)}return I}return b},[e,a,r,i,f]);return x.useEffect(()=>{c.current=e},[e]),x.useEffect(()=>{i||h()},[r,i]),x.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),x.useEffect(()=>{i||typeof l!="number"||p.current!==null||(p.current=setTimeout(()=>{h(),p.current=null},l))},[l,i,h,...n]),{droppableRects:y,measureDroppableContainers:h,measuringScheduled:a!=null};function w(){switch(g){case nn.Always:return!1;case nn.BeforeDragging:return r;default:return!r}}}function fi(e,t){return Qr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Lh(e,t){return fi(e,t)}function Fh(e){let{callback:t,disabled:r}=e;const n=ea(t),o=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return x.useEffect(()=>()=>o?.disconnect(),[o]),o}function zn(e){let{callback:t,disabled:r}=e;const n=ea(t),o=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return x.useEffect(()=>()=>o?.disconnect(),[o]),o}function Uh(e){return new la(Or(e),e)}function hi(e,t,r){t===void 0&&(t=Uh);const[n,o]=x.useState(null);function a(){o(f=>{if(!e)return null;if(e.isConnected===!1){var g;return(g=f??r)!=null?g:null}const c=t(e);return JSON.stringify(f)===JSON.stringify(c)?f:c})}const s=Fh({callback(f){if(e)for(const g of f){const{type:c,target:i}=g;if(c==="childList"&&i instanceof HTMLElement&&i.contains(e)){a();break}}}}),l=zn({callback:a});return Yt(()=>{a(),e?(l?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),s?.disconnect())},[e]),n}function $h(e){const t=fi(e);return Rl(e,t)}const gi=[];function zh(e){const t=x.useRef(e),r=Qr(n=>e?n&&n!==gi&&e&&t.current&&e.parentNode===t.current.parentNode?n:Un(e):gi,[e]);return x.useEffect(()=>{t.current=e},[e]),r}function Hh(e){const[t,r]=x.useState(null),n=x.useRef(e),o=x.useCallback(a=>{const s=aa(a.target);s&&r(l=>l?(l.set(s,sa(s)),new Map(l)):null)},[]);return x.useEffect(()=>{const a=n.current;if(e!==a){s(a);const l=e.map(f=>{const g=aa(f);return g?(g.addEventListener("scroll",o,{passive:!0}),[g,sa(g)]):null}).filter(f=>f!=null);r(l.length?new Map(l):null),n.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(f=>{const g=aa(f);g?.removeEventListener("scroll",o)})}},[o,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Mr(a,s),Ht):si(e):Ht,[e,t])}function pi(e,t){t===void 0&&(t=[]);const r=x.useRef(null);return x.useEffect(()=>{r.current=null},t),x.useEffect(()=>{const n=e!==Ht;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Rr(e,r.current):Ht}function jh(e){x.useEffect(()=>{if(!Pn)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function Bh(e,t){return x.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=s=>{a(s,t)},r},{}),[e,t])}function mi(e){return x.useMemo(()=>e?fh(e):null,[e])}const bi=[];function Gh(e,t){t===void 0&&(t=Or);const[r]=e,n=mi(r?mt(r):null),[o,a]=x.useState(bi);function s(){a(()=>e.length?e.map(f=>oi(f)?n:new la(t(f),f)):bi)}const l=zn({callback:s});return Yt(()=>{l?.disconnect(),s(),e.forEach(f=>l?.observe(f))},[e]),o}function Wh(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Zr(t)?t:e}function Kh(e){let{measure:t}=e;const[r,n]=x.useState(null),o=x.useCallback(g=>{for(const{target:c}of g)if(Zr(c)){n(i=>{const u=t(c);return i?{...i,width:u.width,height:u.height}:u});break}},[t]),a=zn({callback:o}),s=x.useCallback(g=>{const c=Wh(g);a?.disconnect(),c&&a?.observe(c),n(c?t(c):null)},[t,a]),[l,f]=Ln(s);return x.useMemo(()=>({nodeRef:l,rect:r,setRef:f}),[r,l,f])}const Vh=[{sensor:ua,options:{}},{sensor:ca,options:{}}],Yh={current:{}},Hn={draggable:{measure:ei},droppable:{measure:ei,strategy:nn.WhileDragging,frequency:ga.Optimized},dragOverlay:{measure:Or}};class on extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Xh={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new on,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Fn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Hn,measureDroppableContainers:Fn,windowRect:null,measuringScheduled:!1},Zh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Fn,draggableNodes:new Map,over:null,measureDroppableContainers:Fn},jn=x.createContext(Zh),yi=x.createContext(Xh);function qh(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new on}}}function Qh(e,t){switch(t.type){case Re.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Re.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Re.DragEnd:case Re.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Re.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new on(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Re.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const s=new on(e.droppable.containers);return s.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Re.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new on(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Jh(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=x.useContext(jn),a=ta(n),s=ta(r?.id);return x.useEffect(()=>{if(!t&&!n&&a&&s!=null){if(!na(a)||document.activeElement===a.target)return;const l=o.get(s);if(!l)return;const{activatorNode:f,node:g}=l;if(!f.current&&!g.current)return;requestAnimationFrame(()=>{for(const c of[f.current,g.current]){if(!c)continue;const i=Wf(c);if(i){i.focus();break}}})}},[n,t,o,s,a]),null}function Rh(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function eg(e){return x.useMemo(()=>({draggable:{...Hn.draggable,...e?.draggable},droppable:{...Hn.droppable,...e?.droppable},dragOverlay:{...Hn.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function tg(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=x.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;Yt(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!n)return;const g=t?.node.current;if(!g||g.isConnected===!1)return;const c=r(g),i=Rl(c,n);if(s||(i.x=0),l||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){const u=ti(g);u&&u.scrollBy({top:i.y,left:i.x})}},[t,s,l,n,r])}const vi=x.createContext({...Ht,scaleX:1,scaleY:1});var tr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(tr||(tr={}));const rg=x.memo(function(t){var r,n,o,a;let{id:s,accessibility:l,autoScroll:f=!0,children:g,sensors:c=Vh,collisionDetection:i=ah,measuring:u,modifiers:h,...p}=t;const y=x.useReducer(Qh,void 0,qh),[w,b]=y,[I,S]=qf(),[M,L]=x.useState(tr.Uninitialized),E=M===tr.Initialized,{draggable:{active:T,nodes:m,translate:v},droppable:{containers:D}}=w,A=T!=null?m.get(T):null,F=x.useRef({initial:null,translated:null}),P=x.useMemo(()=>{var Se;return T!=null?{id:T,data:(Se=A?.data)!=null?Se:Yh,rect:F}:null},[T,A]),O=x.useRef(null),[N,C]=x.useState(null),[k,U]=x.useState(null),$=qr(p,Object.values(p)),G=Jr("DndDescribedBy",s),K=x.useMemo(()=>D.getEnabled(),[D]),z=eg(u),{droppableRects:W,measureDroppableContainers:V,measuringScheduled:B}=Ph(K,{dragging:E,dependencies:[v.x,v.y],config:z.droppable}),Z=Dh(m,T),pe=x.useMemo(()=>k?oa(k):null,[k]),ie=Be(),fe=Lh(Z,z.draggable.measure);tg({activeNode:T!=null?m.get(T):null,config:ie.layoutShiftCompensation,initialRect:fe,measure:z.draggable.measure});const ee=hi(Z,z.draggable.measure,fe),_e=hi(Z?Z.parentElement:null),ye=x.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:m,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),He=D.getNodeFor((r=ye.current.over)==null?void 0:r.id),Fe=Kh({measure:z.dragOverlay.measure}),ve=(n=Fe.nodeRef.current)!=null?n:Z,J=E?(o=Fe.rect)!=null?o:ee:null,he=!!(Fe.nodeRef.current&&Fe.rect),xe=$h(he?null:ee),Ue=mi(ve?mt(ve):null),Le=zh(E?He??Z:null),Y=Gh(Le),te=Rh(h,{transform:{x:v.x-xe.x,y:v.y-xe.y,scaleX:1,scaleY:1},activatorEvent:k,active:P,activeNodeRect:ee,containerNodeRect:_e,draggingNodeRect:J,over:ye.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:Le,scrollableAncestorRects:Y,windowRect:Ue}),de=pe?Mr(pe,v):null,ae=Hh(Le),Ee=pi(ae),je=pi(ae,[ee]),ze=Mr(te,Ee),Me=J?ih(J,te):null,Xe=P&&Me?i({active:P,collisionRect:Me,droppableRects:W,droppableContainers:K,pointerCoordinates:de}):null,$e=Ql(Xe,"id"),[X,ne]=x.useState(null),ce=he?te:Mr(te,je),se=sh(ce,(a=X?.rect)!=null?a:null,ee),oe=x.useRef(null),Ne=x.useCallback((Se,me)=>{let{sensor:Te,options:Ke}=me;if(O.current==null)return;const De=m.get(O.current);if(!De)return;const Ge=Se.nativeEvent,qe=new Te({active:O.current,activeNode:De,event:Ge,options:Ke,context:ye,onAbort(Ze){if(!m.get(Ze))return;const{onDragAbort:St}=$.current,Bt={id:Ze};St?.(Bt),I({type:"onDragAbort",event:Bt})},onPending(Ze,jt,St,Bt){if(!m.get(Ze))return;const{onDragPending:Et}=$.current,Gt={id:Ze,constraint:jt,initialCoordinates:St,offset:Bt};Et?.(Gt),I({type:"onDragPending",event:Gt})},onStart(Ze){const jt=O.current;if(jt==null)return;const St=m.get(jt);if(!St)return;const{onDragStart:Bt}=$.current,ct={activatorEvent:Ge,active:{id:jt,data:St.data,rect:F}};Jt.unstable_batchedUpdates(()=>{Bt?.(ct),L(tr.Initializing),b({type:Re.DragStart,initialCoordinates:Ze,active:jt}),I({type:"onDragStart",event:ct}),C(oe.current),U(Ge)})},onMove(Ze){b({type:Re.DragMove,coordinates:Ze})},onEnd:Zt(Re.DragEnd),onCancel:Zt(Re.DragCancel)});oe.current=qe;function Zt(Ze){return async function(){const{active:St,collisions:Bt,over:ct,scrollAdjustedTranslate:Et}=ye.current;let Gt=null;if(St&&Et){const{cancelDrop:rr}=$.current;Gt={activatorEvent:Ge,active:St,collisions:Bt,delta:Et,over:ct},Ze===Re.DragEnd&&typeof rr=="function"&&await Promise.resolve(rr(Gt))&&(Ze=Re.DragCancel)}O.current=null,Jt.unstable_batchedUpdates(()=>{b({type:Ze}),L(tr.Uninitialized),ne(null),C(null),U(null),oe.current=null;const rr=Ze===Re.DragEnd?"onDragEnd":"onDragCancel";if(Gt){const pr=$.current[rr];pr?.(Gt),I({type:rr,event:Gt})}})}}},[m]),we=x.useCallback((Se,me)=>(Te,Ke)=>{const De=Te.nativeEvent,Ge=m.get(Ke);if(O.current!==null||!Ge||De.dndKit||De.defaultPrevented)return;const qe={active:Ge};Se(Te,me.options,qe)===!0&&(De.dndKit={capturedBy:me.sensor},O.current=Ke,Ne(Te,me))},[m,Ne]),ke=Ih(c,we);jh(c),Yt(()=>{ee&&M===tr.Initializing&&L(tr.Initialized)},[ee,M]),x.useEffect(()=>{const{onDragMove:Se}=$.current,{active:me,activatorEvent:Te,collisions:Ke,over:De}=ye.current;if(!me||!Te)return;const Ge={active:me,activatorEvent:Te,collisions:Ke,delta:{x:ze.x,y:ze.y},over:De};Jt.unstable_batchedUpdates(()=>{Se?.(Ge),I({type:"onDragMove",event:Ge})})},[ze.x,ze.y]),x.useEffect(()=>{const{active:Se,activatorEvent:me,collisions:Te,droppableContainers:Ke,scrollAdjustedTranslate:De}=ye.current;if(!Se||O.current==null||!me||!De)return;const{onDragOver:Ge}=$.current,qe=Ke.get($e),Zt=qe&&qe.rect.current?{id:qe.id,rect:qe.rect.current,data:qe.data,disabled:qe.disabled}:null,Ze={active:Se,activatorEvent:me,collisions:Te,delta:{x:De.x,y:De.y},over:Zt};Jt.unstable_batchedUpdates(()=>{ne(Zt),Ge?.(Ze),I({type:"onDragOver",event:Ze})})},[$e]),Yt(()=>{ye.current={activatorEvent:k,active:P,activeNode:Z,collisionRect:Me,collisions:Xe,droppableRects:W,draggableNodes:m,draggingNode:ve,draggingNodeRect:J,droppableContainers:D,over:X,scrollableAncestors:Le,scrollAdjustedTranslate:ze},F.current={initial:J,translated:Me}},[P,Z,Xe,Me,m,ve,J,W,D,X,Le,ze]),Ah({...ie,delta:v,draggingRect:Me,pointerCoordinates:de,scrollableAncestors:Le,scrollableAncestorRects:Y});const Ce=x.useMemo(()=>({active:P,activeNode:Z,activeNodeRect:ee,activatorEvent:k,collisions:Xe,containerNodeRect:_e,dragOverlay:Fe,draggableNodes:m,droppableContainers:D,droppableRects:W,over:X,measureDroppableContainers:V,scrollableAncestors:Le,scrollableAncestorRects:Y,measuringConfiguration:z,measuringScheduled:B,windowRect:Ue}),[P,Z,ee,k,Xe,_e,Fe,m,D,W,X,V,Le,Y,z,B,Ue]),Ie=x.useMemo(()=>({activatorEvent:k,activators:ke,active:P,activeNodeRect:ee,ariaDescribedById:{draggable:G},dispatch:b,draggableNodes:m,over:X,measureDroppableContainers:V}),[k,ke,P,ee,b,G,m,X,V]);return x.createElement(Vl.Provider,{value:S},x.createElement(jn.Provider,{value:Ie},x.createElement(yi.Provider,{value:Ce},x.createElement(vi.Provider,{value:se},g)),x.createElement(Jh,{disabled:l?.restoreFocus===!1})),x.createElement(Rf,{...l,hiddenTextDescribedById:G}));function Be(){const Se=N?.autoScrollEnabled===!1,me=typeof f=="object"?f.enabled===!1:f===!1,Te=E&&!Se&&!me;return typeof f=="object"?{...f,enabled:Te}:{enabled:Te}}}),ng=x.createContext(null),wi="button",og="Draggable";function ag(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=Jr(og),{activators:s,activatorEvent:l,active:f,activeNodeRect:g,ariaDescribedById:c,draggableNodes:i,over:u}=x.useContext(jn),{role:h=wi,roleDescription:p="draggable",tabIndex:y=0}=o??{},w=f?.id===t,b=x.useContext(w?vi:ng),[I,S]=Ln(),[M,L]=Ln(),E=Bh(s,t),T=qr(r);Yt(()=>(i.set(t,{id:t,key:a,node:I,activatorNode:M,data:T}),()=>{const v=i.get(t);v&&v.key===a&&i.delete(t)}),[i,t]);const m=x.useMemo(()=>({role:h,tabIndex:y,"aria-disabled":n,"aria-pressed":w&&h===wi?!0:void 0,"aria-roledescription":p,"aria-describedby":c.draggable}),[n,h,y,w,p,c.draggable]);return{active:f,activatorEvent:l,activeNodeRect:g,attributes:m,isDragging:w,listeners:n?void 0:E,node:I,over:u,setNodeRef:S,setActivatorNodeRef:L,transform:b}}function sg(){return x.useContext(yi)}const lg="Droppable",ig={timeout:25};function cg(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=Jr(lg),{active:s,dispatch:l,over:f,measureDroppableContainers:g}=x.useContext(jn),c=x.useRef({disabled:r}),i=x.useRef(!1),u=x.useRef(null),h=x.useRef(null),{disabled:p,updateMeasurementsFor:y,timeout:w}={...ig,...o},b=qr(y??n),I=x.useCallback(()=>{if(!i.current){i.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{g(Array.isArray(b.current)?b.current:[b.current]),h.current=null},w)},[w]),S=zn({callback:I,disabled:p||!s}),M=x.useCallback((m,v)=>{S&&(v&&(S.unobserve(v),i.current=!1),m&&S.observe(m))},[S]),[L,E]=Ln(M),T=qr(t);return x.useEffect(()=>{!S||!L.current||(S.disconnect(),i.current=!1,S.observe(L.current))},[L,S]),x.useEffect(()=>(l({type:Re.RegisterDroppable,element:{id:n,key:a,disabled:r,node:L,rect:u,data:T}}),()=>l({type:Re.UnregisterDroppable,key:a,id:n})),[n]),x.useEffect(()=>{r!==c.current.disabled&&(l({type:Re.SetDroppableDisabled,id:n,key:a,disabled:r}),c.current.disabled=r)},[n,a,r,l]),{active:s,rect:u,isOver:f?.id===n,node:L,over:f,setNodeRef:E}}function pa(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function dg(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function Bn(e){return e!==null&&e>=0}function ug(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function fg(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Gn=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=pa(t,n,r),s=t[o],l=a[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},xi="Sortable",ki=x.createContext({activeIndex:-1,containerId:xi,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Gn,disabled:{draggable:!1,droppable:!1}});function Ci(e){let{children:t,id:r,items:n,strategy:o=Gn,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:f,over:g,measureDroppableContainers:c}=sg(),i=Jr(xi,r),u=l.rect!==null,h=x.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),p=s!=null,y=s?h.indexOf(s.id):-1,w=g?h.indexOf(g.id):-1,b=x.useRef(h),I=!ug(h,b.current),S=w!==-1&&y===-1||I,M=fg(a);Yt(()=>{I&&p&&c(h)},[I,h,p,c]),x.useEffect(()=>{b.current=h},[h]);const L=x.useMemo(()=>({activeIndex:y,containerId:i,disabled:M,disableTransforms:S,items:h,overIndex:w,useDragOverlay:u,sortedRects:dg(h,f),strategy:o}),[y,i,M.draggable,M.droppable,S,h,w,f,u,o]);return x.createElement(ki.Provider,{value:L},t)}const Si=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return pa(r,n,o).indexOf(t)},Ei=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:s,previousItems:l,previousContainerId:f,transition:g}=e;return!g||!n||l!==a&&o===s?!1:r?!0:s!==o&&t===f},hg={duration:200,easing:"ease"},_i="transform",gg=en.Transition.toString({property:_i,duration:0,easing:"linear"}),pg={roleDescription:"sortable"};function mg(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,s]=x.useState(null),l=x.useRef(r);return Yt(()=>{if(!t&&r!==l.current&&n.current){const f=o.current;if(f){const g=Or(n.current,{ignoreTransform:!0}),c={x:f.left-g.left,y:f.top-g.top,scaleX:f.width/g.width,scaleY:f.height/g.height};(c.x||c.y)&&s(c)}}r!==l.current&&(l.current=r)},[t,r,n,o]),x.useEffect(()=>{a&&s(null)},[a]),a}function Ti(e){let{animateLayoutChanges:t=Ei,attributes:r,disabled:n,data:o,getNewIndex:a=Si,id:s,strategy:l,resizeObserverConfig:f,transition:g=hg}=e;const{items:c,containerId:i,activeIndex:u,disabled:h,disableTransforms:p,sortedRects:y,overIndex:w,useDragOverlay:b,strategy:I}=x.useContext(ki),S=bg(n,h),M=c.indexOf(s),L=x.useMemo(()=>({sortable:{containerId:i,index:M,items:c},...o}),[i,o,M,c]),E=x.useMemo(()=>c.slice(c.indexOf(s)),[c,s]),{rect:T,node:m,isOver:v,setNodeRef:D}=cg({id:s,data:L,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...f}}),{active:A,activatorEvent:F,activeNodeRect:P,attributes:O,setNodeRef:N,listeners:C,isDragging:k,over:U,setActivatorNodeRef:$,transform:G}=ag({id:s,data:L,attributes:{...pg,...r},disabled:S.draggable}),K=Hf(D,N),z=!!A,W=z&&!p&&Bn(u)&&Bn(w),V=!b&&k,B=V&&W?G:null,pe=W?B??(l??I)({rects:y,activeNodeRect:P,activeIndex:u,overIndex:w,index:M}):null,ie=Bn(u)&&Bn(w)?a({id:s,items:c,activeIndex:u,overIndex:w}):M,fe=A?.id,ee=x.useRef({activeId:fe,items:c,newIndex:ie,containerId:i}),_e=c!==ee.current.items,ye=t({active:A,containerId:i,isDragging:k,isSorting:z,id:s,index:M,items:c,newIndex:ee.current.newIndex,previousItems:ee.current.items,previousContainerId:ee.current.containerId,transition:g,wasDragging:ee.current.activeId!=null}),He=mg({disabled:!ye,index:M,node:m,rect:T});return x.useEffect(()=>{z&&ee.current.newIndex!==ie&&(ee.current.newIndex=ie),i!==ee.current.containerId&&(ee.current.containerId=i),c!==ee.current.items&&(ee.current.items=c)},[z,ie,i,c]),x.useEffect(()=>{if(fe===ee.current.activeId)return;if(fe!=null&&ee.current.activeId==null){ee.current.activeId=fe;return}const ve=setTimeout(()=>{ee.current.activeId=fe},50);return()=>clearTimeout(ve)},[fe]),{active:A,activeIndex:u,attributes:O,data:L,rect:T,index:M,newIndex:ie,items:c,isOver:v,isSorting:z,isDragging:k,listeners:C,node:m,overIndex:w,over:U,setNodeRef:K,setActivatorNodeRef:$,setDroppableNodeRef:D,setDraggableNodeRef:N,transform:He??pe,transition:Fe()};function Fe(){if(He||_e&&ee.current.newIndex===M)return gg;if(!(V&&!na(F)||!g)&&(z||ye))return en.Transition.toString({...g,property:_i})}}function bg(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(n=e?.droppable)!=null?n:t.droppable}}function an(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const yg=[Pe.Down,Pe.Right,Pe.Up,Pe.Left],Ni=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(yg.includes(e.code)){if(e.preventDefault(),!r||!n)return;const f=[];a.getEnabled().forEach(i=>{if(!i||i!=null&&i.disabled)return;const u=o.get(i.id);if(u)switch(e.code){case Pe.Down:n.top<u.top&&f.push(i);break;case Pe.Up:n.top>u.top&&f.push(i);break;case Pe.Left:n.left>u.left&&f.push(i);break;case Pe.Right:n.left<u.left&&f.push(i);break}});const g=nh({collisionRect:n,droppableRects:o,droppableContainers:f});let c=Ql(g,"id");if(c===s?.id&&g.length>1&&(c=g[1].id),c!=null){const i=a.get(r.id),u=a.get(c),h=u?o.get(u.id):null,p=u?.node.current;if(p&&h&&i&&u){const w=Un(p).some((E,T)=>l[T]!==E),b=Ai(i,u),I=vg(i,u),S=w||!b?{x:0,y:0}:{x:I?n.width-h.width:0,y:I?n.height-h.height:0},M={x:h.left,y:h.top};return S.x&&S.y?M:Rr(M,S)}}}};function Ai(e,t){return!an(e)||!an(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function vg(e,t){return!an(e)||!an(t)||!Ai(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const wg=Object.freeze(Object.defineProperty({__proto__:null,SortableContext:Ci,arrayMove:pa,defaultAnimateLayoutChanges:Ei,defaultNewIndexGetter:Si,hasSortableData:an,rectSortingStrategy:Gn,sortableKeyboardCoordinates:Ni,useSortable:Ti},Symbol.toStringTag,{value:"Module"})),xg=window.G7Core,Mi=({file:e,onRemove:t,onRetry:r,onImageClick:n,onDownload:o,isPrimary:a,onPrimaryClick:s})=>{const{attributes:l,listeners:f,setNodeRef:g,transform:c,transition:i,isDragging:u}=Ti({id:"hash"in e?e.hash:e.id}),h={transform:en.Transform.toString(c),transition:i,opacity:u?.5:1},p="status"in e&&e.status!==void 0,y=p?e.status:"done",w=y==="uploading",b=y==="compressing",I=y==="error",S=p?e.progress:100,M=p?e.preview:void 0,L=p?e.mime_type?.startsWith("image/")??!1:e.is_image,[E,T]=x.useState(void 0),m=!p&&L?e.download_url:void 0;x.useEffect(()=>{if(!m){T(void 0);return}let D=!0,A;return(async()=>{try{const P=await xg.api.get(m,{responseType:"blob"});D&&P&&(A=URL.createObjectURL(P),T(A))}catch(P){console.error("Failed to load authenticated image:",P)}})(),()=>{D=!1,A&&URL.revokeObjectURL(A)}},[m]);const v=E;return d.jsxs(j,{ref:g,style:h,className:"relative group bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[d.jsxs(j,{className:`aspect-square w-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 relative ${L||!p?"cursor-pointer":""}`,onClick:()=>{w||b||(L&&n?n():!p&&o&&o())},children:[M||v?d.jsx(Wt,{src:M||v,alt:e.original_filename,className:"w-full h-full object-cover"}):d.jsx(Ot,{className:`fa-solid ${Hl(e.mime_type)} text-4xl text-gray-400 dark:text-gray-500`}),(w||b)&&d.jsxs(j,{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center",children:[d.jsx(j,{className:"w-3/4 h-2 bg-gray-700 rounded-full overflow-hidden",children:d.jsx(j,{className:"h-full bg-blue-500 transition-all",style:{width:`${S}%`}})}),d.jsxs(re,{className:"text-white text-xs mt-1",children:[S,"%"]})]}),I&&d.jsx(j,{className:"absolute inset-0 bg-red-500/50 flex items-center justify-center",children:d.jsx(Ot,{className:"fa-solid fa-exclamation-triangle text-2xl text-white"})}),s&&d.jsx(Q,{type:"button",onClick:D=>{D.stopPropagation(),s()},className:`absolute top-1.5 left-1.5 z-10 p-1 rounded-full transition-colors ${a?"bg-yellow-500 text-white":"bg-gray-800/50 text-gray-300 hover:bg-yellow-500 hover:text-white opacity-0 group-hover:opacity-100"}`,title:nt(a?"attachment.primary_image":"attachment.set_as_primary"),children:d.jsx(Ot,{className:"fa-solid fa-star text-xs"})}),d.jsxs(j,{className:"absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-start justify-end p-1 gap-1 opacity-0 group-hover:opacity-100",children:[d.jsx(Q,{type:"button",...l,...f,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-gray-600 dark:text-gray-300 hover:bg-white cursor-grab active:cursor-grabbing",title:nt("attachment.drag_to_reorder"),onClick:D=>D.stopPropagation(),children:d.jsx(Ot,{className:"fa-solid fa-grip-vertical text-sm"})}),!p&&o&&d.jsx(Q,{type:"button",onClick:D=>{D.stopPropagation(),o()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-blue-500 hover:bg-white",title:nt("common.download"),children:d.jsx(Ot,{className:"fa-solid fa-download text-sm"})}),I&&r&&d.jsx(Q,{type:"button",onClick:D=>{D.stopPropagation(),r()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-orange-500 hover:bg-white",title:nt("common.retry"),children:d.jsx(Ot,{className:"fa-solid fa-arrow-rotate-right text-sm"})}),d.jsx(Q,{type:"button",onClick:D=>{D.stopPropagation(),t()},disabled:w||b,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-red-500 hover:bg-white disabled:opacity-50",title:nt("common.delete"),children:d.jsx(Ot,{className:"fa-solid fa-times text-sm"})})]})]}),d.jsxs(j,{className:`p-2 ${!p&&o?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,onClick:()=>{!p&&o&&o()},children:[d.jsx(It,{className:"text-xs font-medium text-gray-900 dark:text-white truncate",title:e.original_filename,children:e.original_filename}),d.jsx(It,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.size_formatted})]})]})},Oi=({allItems:e,canAddMore:t,totalCount:r,maxFiles:n,maxSize:o,accept:a,onRemove:s,onRetry:l,onImageClick:f,onDownload:g,onDragEnd:c,onAddClick:i,enablePrimarySelection:u,primaryFileId:h,onPrimaryChange:p})=>{const y=eh(Yl(ua,{activationConstraint:{distance:8}}),Yl(ca,{coordinateGetter:Ni}));return d.jsxs(j,{className:"p-3",children:[d.jsx(rg,{sensors:y,collisionDetection:rh,onDragEnd:c,children:d.jsx(Ci,{items:e.map(w=>"hash"in w?w.hash:w.id),strategy:Gn,children:d.jsxs(j,{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:[e.map(w=>{const b="hash"in w,I=b?w.is_image:w.mime_type?.startsWith("image/")??!1;return d.jsx(Mi,{file:w,onRemove:()=>s(w),onRetry:"status"in w&&w.status==="error"?()=>l(w):void 0,onImageClick:I?()=>f(w):void 0,onDownload:b?()=>g(w):void 0,isPrimary:u&&b&&(w.hash||w.id)===h,onPrimaryClick:u&&b?()=>p?.(w.hash||w.id):void 0},b?w.hash:w.id)}),t&&d.jsxs(j,{className:"aspect-square flex flex-col items-center justify-center border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer hover:border-gray-400 dark:hover:border-gray-500 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:i,children:[d.jsx(Ot,{className:"fa-solid fa-plus text-2xl text-gray-400 dark:text-gray-500 mb-1"}),d.jsx(re,{className:"text-xs text-gray-500 dark:text-gray-400",children:nt("common.add")})]})]})})}),d.jsxs(j,{className:"mt-3 pt-3 border-t border-gray-200 dark:border-gray-700 flex justify-between items-center text-xs text-gray-500 dark:text-gray-400",children:[d.jsx(re,{children:nt("attachment.attached_count",{count:r,max:n})}),d.jsxs(re,{children:[nt("attachment.max_size",{size:o}),a&&` (${a})`]})]})]})},kg=[],Cg=[],Wn=x.forwardRef(({uploadTriggerEvent:e,attachmentableType:t,attachmentableId:r,collection:n="default",maxFiles:o=10,maxSize:a=10,maxConcurrentUploads:s=3,accept:l,imageCompression:f,roleIds:g=Cg,autoUpload:c=!0,onFilesChange:i,onChange:u,onUploadComplete:h,onUploadError:p,onRemove:y,onReorder:w,initialFiles:b=kg,className:I="",confirmBeforeRemove:S=!1,confirmRemoveTitle:M,confirmRemoveMessage:L,apiEndpoints:E,uploadParams:T,enablePrimarySelection:m=!1,primaryFileId:v,onPrimaryChange:D},A)=>{const F={upload:E?.upload??"/api/attachments",delete:E?.delete??"/api/attachments/:id",reorder:E?.reorder??"/api/attachments/reorder"},P=x.useRef(u??i);P.current=u??i;const O=x.useCallback(U=>{const $=P.current;if(!$)return;$({target:{value:U,files:U},preventDefault:()=>{},stopPropagation:()=>{}})},[]),N=jl({attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:g,autoUpload:c,initialFiles:b,endpoints:F,onFilesChange:O,onUploadComplete:h,onUploadError:p,onRemove:y,onReorder:w,uploadTriggerEvent:e,confirmBeforeRemove:S,uploadParams:T});x.useImperativeHandle(A,()=>({uploadAll:N.handleUploadAll,clear:N.clear,getPendingFiles:N.getPendingFiles}));const C=x.useMemo(()=>N.imageFiles.map(U=>{const $=!("hash"in U),G=U,K=U;return $?{src:G.preview||"",filename:G.original_filename,title:G.original_filename,downloadRequiresAuth:!1}:{src:N.authenticatedImageUrls.get(K.id)||K.download_url,downloadUrl:K.download_url,filename:K.original_filename,title:K.original_filename,downloadRequiresAuth:!0}}),[N.imageFiles,N.authenticatedImageUrls]),k=x.useMemo(()=>({existingFiles:N.existingFiles,pendingFiles:N.pendingFiles,isDragOver:N.isDragOver,isDeleting:N.isDeleting,maxFiles:o,maxSize:a,accept:l,endpoints:F,confirmBeforeRemove:S,totalCount:N.totalCount,hasFiles:N.hasFiles,canAddMore:N.canAddMore,allItems:N.allItems,imageFiles:N.imageFiles,handleFiles:N.handleFiles,handleRemove:N.handleRemove,handleRetry:N.handleRetry,handleUploadAll:N.handleUploadAll,handleOpenGallery:N.handleOpenGallery,handleDownload:N.handleDownload,handleDragEnd:N.handleDragEnd,setIsDragOver:N.setIsDragOver,inputRef:N.inputRef,galleryOpen:N.galleryOpen,setGalleryOpen:N.setGalleryOpen,galleryStartIndex:N.galleryStartIndex,galleryKeyRef:N.galleryKeyRef,confirmDialogOpen:N.confirmDialogOpen,setConfirmDialogOpen:N.setConfirmDialogOpen,itemToDelete:N.itemToDelete,executeRemoveAttachment:N.executeRemoveAttachment,authenticatedImageUrls:N.authenticatedImageUrls}),[N,o,a,l,F,S]);return d.jsx(_l,{value:k,children:d.jsxs(j,{className:I,children:[d.jsx(Bl,{isDragOver:N.isDragOver,canAddMore:N.canAddMore,onFiles:N.handleFiles,setIsDragOver:N.setIsDragOver,inputRef:N.inputRef,accept:l,maxFiles:o,maxSize:a,children:N.hasFiles&&d.jsx(Oi,{allItems:N.allItems,canAddMore:N.canAddMore,totalCount:N.totalCount,maxFiles:o,maxSize:a,accept:l,onRemove:N.handleRemove,onRetry:N.handleRetry,onImageClick:N.handleOpenGallery,onDownload:N.handleDownload,onDragEnd:N.handleDragEnd,onAddClick:()=>N.inputRef.current?.click(),enablePrimarySelection:m,primaryFileId:v,onPrimaryChange:D})}),S&&d.jsx(Xo,{isOpen:N.confirmDialogOpen,onClose:()=>{N.isDeleting||N.setConfirmDialogOpen(!1)},title:M??nt("attachment.delete_confirm_title"),message:L??nt("attachment.delete_confirm_message"),confirmText:nt("common.delete"),confirmButtonVariant:"danger",onConfirm:()=>{N.itemToDelete&&N.executeRemoveAttachment(N.itemToDelete)},isLoading:N.isDeleting,loadingText:nt("attachment.deleting")}),C.length>0&&N.galleryOpen&&d.jsx(_r,{images:C,isOpen:!0,onClose:()=>N.setGalleryOpen(!1),startIndex:N.galleryStartIndex,showDownload:!0},`gallery-${N.galleryKeyRef.current}`)]})})});Wn.displayName="FileUploader";const Sg=Object.freeze(Object.defineProperty({__proto__:null,FileDropZone:Bl,FileList:Oi,FileUploader:Wn,FileUploaderProvider:_l,SortableThumbnailItem:Mi,default:Wn,extractErrorMessage:zl,fileUploaderT:nt,formatFileSize:In,getFileIcon:Hl,useFileUploader:jl,useFileUploaderContext:Mf},Symbol.toStringTag,{value:"Module"})),Di=({provider:e,className:t="w-5 h-5"})=>{switch(e){case"google":return d.jsxs("svg",{className:t,viewBox:"0 0 24 24",children:[d.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),d.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),d.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),d.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]});case"naver":return d.jsx("svg",{className:t,viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M16.273 12.845L7.376 0H0v24h7.727V11.155L16.624 24H24V0h-7.727z"})});case"kakao":return d.jsx("svg",{className:t,viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M12 3c5.799 0 10.5 3.664 10.5 8.185 0 4.52-4.701 8.184-10.5 8.184a13.5 13.5 0 0 1-1.727-.11l-4.408 2.883c-.501.265-.678.236-.472-.413l.892-3.678c-2.88-1.46-4.785-3.99-4.785-6.866C1.5 6.665 6.201 3 12 3zm5.519 8.625h-.634v2.916h-.97v-2.916h-.633v-.848h2.237v.848zm-3.294 2.916h-.97V10.77h.97v3.771zm-1.97 0h-.97v-2.77l-.658 1.53h-.629l-.665-1.53v2.77h-.97V10.77h1.13l.822 1.912.814-1.912h1.126v3.771zm-4.49 0h-.97V10.77h.97v3.771z"})});case"facebook":return d.jsx("svg",{className:t,viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})});case"apple":return d.jsx("svg",{className:t,viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})});default:return null}},Ii=(e,t)=>window.G7Core?.t?.(e,t)??e,Eg=[{id:"google",name:"Google",color:"bg-white dark:bg-gray-800",textColor:"text-gray-700 dark:text-gray-300"},{id:"naver",name:"네이버",color:"bg-[#03C75A]",textColor:"text-white"},{id:"kakao",name:"카카오",color:"bg-[#FEE500]",textColor:"text-[#000000]/85"},{id:"facebook",name:"Facebook",color:"bg-[#1877F2]",textColor:"text-white"},{id:"apple",name:"Apple",color:"bg-black dark:bg-white",textColor:"text-white dark:text-black"}],Pi=({providers:e=["google","naver","kakao"],mode:t="login",variant:r="full",className:n=""})=>{const o=l=>{const f=encodeURIComponent(window.location.href);window.location.href=`/api/auth/${l}?redirect=${f}`},a=l=>t==="register"?Ii("auth.social.register_with",{provider:l}):Ii("auth.social.login_with",{provider:l}),s=Eg.filter(l=>e.includes(l.id));return r==="icon"?d.jsx(j,{className:`flex justify-center gap-4 ${n}`,children:s.map(l=>d.jsx(Q,{onClick:()=>o(l.id),className:`w-12 h-12 flex items-center justify-center rounded-full ${l.color} ${l.textColor} border border-gray-200 dark:border-gray-700 hover:opacity-90 transition-opacity`,"aria-label":a(l.name),children:d.jsx(Di,{provider:l.id,className:"w-5 h-5"})},l.id))}):d.jsx(j,{className:`space-y-3 ${n}`,children:s.map(l=>d.jsxs(Q,{onClick:()=>o(l.id),className:`w-full flex items-center justify-center gap-3 px-4 py-3 rounded-lg font-medium border border-gray-200 dark:border-gray-700 ${l.color} ${l.textColor} hover:opacity-90 transition-opacity`,children:[d.jsx(Di,{provider:l.id,className:"w-5 h-5"}),d.jsx(re,{children:a(l.name)})]},l.id))})},_g=Object.freeze(Object.defineProperty({__proto__:null,default:Pi},Symbol.toStringTag,{value:"Module"})),Tg=(e,t)=>window.G7Core?.t?.(e,t)??e,Ng={success:Je.CheckCircle,error:Je.XCircle,warning:Je.ExclamationTriangle,info:Je.InfoCircle},Li={success:{bg:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800",text:"text-green-800 dark:text-green-300"},error:{bg:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",text:"text-red-800 dark:text-red-300"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800",text:"text-yellow-800 dark:text-yellow-300"},info:{bg:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",text:"text-blue-800 dark:text-blue-300"}},Ag={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"},ma=({toasts:e,position:t="bottom-center",duration:r=3e3,onRemove:n})=>{const[o,a]=x.useState(new Map),s=x.useCallback(l=>{a(f=>{const g=new Map(f);return g.set(l,!1),g}),setTimeout(()=>{if(n)n(l);else{const f=window.G7Core;f?.state?.update&&f.state.update(g=>({toasts:(Array.isArray(g.toasts)?g.toasts:[]).filter(i=>i.id!==l)}))}},300)},[n]);return x.useEffect(()=>{!e||e.length===0||e.forEach(l=>{if(o.has(l.id))return;a(g=>{const c=new Map(g);return c.set(l.id,!0),c});const f=l.duration||r;f>0&&setTimeout(()=>{s(l.id)},f)})},[e,r,s,o]),!e||e.length===0?null:d.jsx(j,{className:`fixed z-[9999] flex flex-col gap-2 ${Ag[t]}`,"aria-live":"polite","aria-atomic":"true",children:e.map(l=>d.jsx(Mg,{toast:l,position:t,isVisible:o.get(l.id)??!0,onClose:()=>s(l.id)},l.id))})},Mg=({toast:e,position:t,isVisible:r,onClose:n})=>{const o=Li[e.type]||Li.info,a=e.icon?e.icon:Ng[e.type],s=t.startsWith("bottom")?"translate-y-2":"-translate-y-2";return d.jsxs(j,{className:`
flex items-center gap-3 p-4 rounded-lg border shadow-lg
min-w-[300px] max-w-md
transition-all duration-300
${o.bg}
${r?"opacity-100 translate-y-0":`opacity-0 ${s}`}
`,role:"alert",children:[d.jsx(ue,{name:a,className:`w-5 h-5 flex-shrink-0 ${o.text}`}),d.jsx(re,{className:`flex-1 text-sm font-medium ${o.text}`,children:e.message}),d.jsx(Q,{onClick:n,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${o.text} focus:outline-none`,"aria-label":Tg("common.close"),children:d.jsx(ue,{name:Je.Times,className:"w-4 h-4"})})]})},Og=Object.freeze(Object.defineProperty({__proto__:null,Toast:ma,default:ma},Symbol.toStringTag,{value:"Module"})),Dg=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...e)=>console.log("[Comp:PageTransition]",...e),warn:(...e)=>console.warn("[Comp:PageTransition]",...e),error:(...e)=>console.error("[Comp:PageTransition]",...e)},ba=({className:e="",style:t})=>{const[r,n]=x.useState(!1);return x.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){Dg.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{n(s)})},[]),r?d.jsxs(j,{className:`fixed top-0 left-0 right-0 z-50 ${e}`,style:t,role:"progressbar","aria-label":"페이지 로딩 중",children:[d.jsx(j,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:d.jsx(j,{className:"h-full bg-blue-700 animate-[loading_1.5s_ease-in-out_infinite]",style:{width:"30%",animation:"loading 1.5s ease-in-out infinite"}})}),d.jsx("style",{children:`
@keyframes loading {
0% {
transform: translateX(-100%);
}
50% {
transform: translateX(300%);
}
100% {
transform: translateX(-100%);
}
}
`})]}):null},Ig=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:ba,default:ba},Symbol.toStringTag,{value:"Module"})),Fi=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},ya=({className:e="",style:t})=>{const[r,n]=x.useState(!1);return x.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){Fi.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{Fi.log("isPending changed:",s),n(s)})},[]),r?d.jsx(j,{className:`fixed inset-0 z-40 bg-white/30 dark:bg-gray-900/30 backdrop-blur-sm transition-opacity duration-150 pointer-events-none ${e}`,style:t,role:"status","aria-label":"페이지 전환 중","data-testid":"page-transition-blur"}):null},Pg=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:ya,default:ya},Symbol.toStringTag,{value:"Module"})),Ui={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},$i=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),Lg=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),Fg=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),Ug=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),$g=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),zi={DataGrid:(e,t)=>d.jsxs("div",{className:"w-full border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-10 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 ${e}`,children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-24 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-20 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"})]})}),Array.from({length:t},(r,n)=>d.jsx("div",{className:`h-12 border-b border-gray-100 dark:border-gray-800 ${e}`,style:{animationDelay:`${n*75}ms`},children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 flex-1 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-100 dark:bg-gray-800 rounded"}),d.jsx("div",{className:"h-3 w-14 bg-gray-100 dark:bg-gray-800 rounded"})]})},n))]}),Pagination:e=>d.jsx("div",{className:"flex justify-center gap-1.5 py-3",children:Array.from({length:5},(t,r)=>d.jsx("div",{className:`w-8 h-8 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),Tabs:e=>d.jsxs("div",{children:[d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2 mb-3",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),d.jsx("div",{className:`h-32 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]}),TabNavigation:e=>d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),ProductCard:e=>d.jsxs("div",{className:"rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-48 w-full bg-gray-200 dark:bg-gray-700 ${e}`}),d.jsxs("div",{className:"p-3 space-y-2",children:[d.jsx("div",{className:`h-3.5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:`h-4 w-1/3 bg-gray-300 dark:bg-gray-600 rounded ${e}`})]})]}),UserInfo:e=>d.jsx("div",{className:`h-3 w-14 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),QuantitySelector:e=>d.jsx("div",{className:`h-9 w-28 bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 ${e}`}),Header:e=>d.jsx("header",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:d.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs("div",{className:"flex items-center justify-between h-16",children:[d.jsxs("div",{className:"flex items-center gap-8",children:[d.jsx("div",{className:`h-8 w-24 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:"hidden lg:flex items-center gap-6",children:Array.from({length:4},(t,r)=>d.jsx("div",{className:`h-3.5 w-16 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))})]}),d.jsx("div",{className:"flex items-center gap-4",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-8 w-8 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))})]})})}),Footer:e=>d.jsx("footer",{className:"bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 mt-auto",children:d.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:d.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d.jsx("div",{className:`h-4 w-32 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:`h-3 w-48 bg-gray-100 dark:bg-gray-800 rounded ${e}`}),d.jsx("div",{className:"flex gap-3",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))}),d.jsx("div",{className:`h-3 w-40 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]})})}),Modal:()=>d.jsx(d.Fragment,{}),Toast:()=>d.jsx(d.Fragment,{}),ConfirmDialog:()=>d.jsx(d.Fragment,{})};function zg(e){if(!e||e.length===0)return[];const t=e.filter(n=>n.if),r=e.filter(n=>!n.if);if(r.length>0&&t.length>0){const n=t.filter(o=>!Hi(o.if));return n.length>1&&Hg(n)?[...r,ji(n)]:[...r,...n]}if(t.length>1&&r.length===0){const n=t.filter(o=>!Hi(o.if));return n.length===0?[]:n.length===1?n:[ji(n)]}return e}function Hi(e){const t=e.replace(/^\{\{|\}\}$/g,"").trim();return t.startsWith("!")||/\b(hasError|isError|isLoading|error|Error)\b/.test(t)||/===\s*0\s*(\)|\}|$)/.test(t)}function Hg(e){if(e.length<2)return!1;const t=[];for(const n of e){const o=(n.if||"").replace(/^\{\{|\}\}$/g,"").trim(),a=o.match(/^(.+?)\s*===\s*['"]/);if(a)t.push(a[1].trim());else{const s=o.match(/(.+?)\s*===\s*['"]/);if(!s)return!1;t.push(s[1].trim())}}const r=t[0];return t.every(n=>n===r)}function ji(e){return e.reduce((t,r)=>va(r)>va(t)?r:t)}function va(e){return e.children?e.children.length+e.children.reduce((t,r)=>t+va(r),0):0}function jg(e){return e.includes("{{")?e.replace(/\{\{([^}]+)\}\}/g,(t,r)=>{const n=r.match(/\?[\s]*['"]([^'"]*)['"]\s*:\s*['"]/);return n?n[1]:""}):e}function wa(e,t){if(!e)return"";let r=e;return r=r.replace(/\b(bg-\S+|text-\S+|border\b|border-\S+|shadow\S*|ring-\S+|outline-\S+|divide-\S+|opacity-\S+|font-\S+|tracking-\S+|leading-\S+|whitespace-\S+|truncate|line-clamp-\S+|underline|no-underline|decoration-\S+|cursor-\S+|hover:\S+|focus:\S+|active:\S+|group-hover:\S+|transition\S*|duration-\S+|ease-\S+|animate-\S+|dark:\S+)\b/g,"").replace(/\s{2,}/g," ").trim(),(t==="Grid"||/\bgrid-cols-\d/.test(r))&&(r=r.replace(/\bgrid-cols-(\d+)/g,(n,o)=>{const a=parseInt(o);return a>4?`grid-cols-${Math.ceil(a/2)}`:`grid-cols-${a}`})),r}function Bg(e){const{name:t,props:r}=e;if(!r||!t)return"";const n=[];if(t==="Flex"){n.push("flex");const o=r.direction||"row",a={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"};a[o]&&n.push(a[o]);const s=r.justify||"start",l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};l[s]&&n.push(l[s]);const f=r.align||"stretch",g={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};g[f]&&n.push(g[f]);const c=r.wrap||"nowrap",i={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};i[c]&&n.push(i[c]),r.gap&&r.gap>0&&n.push(`gap-${r.gap}`)}if(t==="Grid"){n.push("grid");const o=r.cols||1;if(n.push(`grid-cols-${o}`),r.responsive){const a=r.responsive;a.sm&&n.push(`sm:grid-cols-${a.sm}`),a.md&&n.push(`md:grid-cols-${a.md}`),a.lg&&n.push(`lg:grid-cols-${a.lg}`),a.xl&&n.push(`xl:grid-cols-${a.xl}`),a["2xl"]&&n.push(`2xl:grid-cols-${a["2xl"]}`)}r.gap!==void 0&&r.gap>0&&n.push(`gap-${r.gap}`),r.rowGap!==void 0&&r.rowGap>0&&n.push(`gap-y-${r.rowGap}`),r.colGap!==void 0&&r.colGap>0&&n.push(`gap-x-${r.colGap}`)}return n.join(" ")}function Gg(e){switch(e){case"pulse":return"animate-pulse";case"wave":return"animate-pulse";case"none":return"";default:return"animate-pulse"}}function Kn(e,t,r,n){return!e||e.length===0?[]:zg(e).map((a,s)=>Bi(a,t,r,s,n))}function Wg(e,t){const r=e.props?.className||e.className||"";return e.responsive?t>=1024&&e.responsive.desktop?.props?.className?e.responsive.desktop.props.className:t>=768&&e.responsive.tablet?.props?.className?e.responsive.tablet.props.className:r:r}function Kg(e,t){const r=e.split(/\s+/).filter(Boolean),n=[],o=[];for(const f of r){const g=f.match(/^(sm|md|lg|xl|2xl):(.+)$/);if(g){const[,c,i]=g;if($i.has(i)){n.push({breakpoint:Ui[c]||0,display:i});continue}(Ui[c]||0)<=t&&o.push(i);continue}if($i.has(f)){n.push({breakpoint:0,display:f});continue}o.push(f)}if(n.length===0)return{visible:!0,className:e};n.sort((f,g)=>f.breakpoint-g.breakpoint);let a="";for(const f of n)f.breakpoint<=t&&(a=f.display);a||(a=n[0].display);const s=a!=="hidden",l=s?[a,...o].join(" "):"";return{visible:s,className:l}}function Vg(e){const t=e.match(/\bgrid-cols-\[([^\]]+)\]/);if(!t)return{className:e};const r=t[1].replace(/_/g," ");return{className:e.replace(/\bgrid-cols-\[([^\]]+)\]/,"").replace(/\s{2,}/g," ").trim(),style:{gridTemplateColumns:r}}}function Bi(e,t,r,n,o){const{name:a,children:s,iteration:l}=e,f=Wg(e,o),g=Bg(e),c=g?`${g} ${f}`.trim():f,i=jg(c),u=Kg(i,o);if(!a||!u.visible)return null;const h=u.className;if(l)return d.jsx(x.Fragment,{children:Array.from({length:r},(y,w)=>Bi({...e,iteration:void 0},t,r,w,o))},n);if(zi[a])return d.jsx("div",{className:h,children:zi[a](t,r)},n);if(Lg.has(a)){const y=wa(h,a);if(!s||s.length===0){const M=/\b(h-\S|w-\S)/.test(y)?`${y} bg-gray-200 dark:bg-gray-700 rounded ${t}`:`${y} h-3.5 w-full bg-gray-200 dark:bg-gray-700 rounded ${t}`.trim();return d.jsx("div",{className:M},n)}const w=Kn(s,t,r,o);if(!(w.length>0&&w.some(S=>S!==null)))return null;const I=Vg(y);return d.jsx("div",{className:I.className,style:I.style,children:w},n)}const p=wa(h,a);if(Fg.has(a)){const y={H1:"h-7",H2:"h-6",H3:"h-5",H4:"h-5",H5:"h-4",H6:"h-4",P:"h-3.5",Span:"h-3",Label:"h-3",A:"h-3.5",Badge:"h-5 w-16"},w={H1:"w-3/5",H2:"w-2/5",H3:"w-1/3",H4:"w-1/3",H5:"w-1/4",H6:"w-1/4",P:"w-full",Span:"w-1/4",Label:"w-1/4",A:"w-1/3",Strong:"w-1/5",Em:"w-1/4",Small:"w-1/5",Badge:"w-16"},b=y[a]||"h-3.5",I=w[a]||"w-full",S=a.startsWith("H")?"mb-2 mt-1":"mb-1.5";return d.jsx("div",{className:`${b} ${I} bg-gray-200 dark:bg-gray-700 rounded ${t} ${S} ${p}`.trim()},n)}if(Ug.has(a))return a==="Textarea"?d.jsx("div",{className:`h-20 w-full bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 mb-2 ${t}`},n):a==="Checkbox"||a==="Radio"||a==="Toggle"?d.jsx("div",{className:`h-5 w-5 bg-gray-200 dark:bg-gray-700 rounded mb-1.5 ${t}`},n):d.jsx("div",{className:`h-9 w-full bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 mb-2 ${t}`},n);if($g.has(a))return a==="Avatar"||a==="AvatarUploader"?d.jsx("div",{className:`h-10 w-10 bg-gray-200 dark:bg-gray-700 rounded-full ${t}`},n):a==="ProductImageViewer"?d.jsx("div",{className:`h-80 w-full bg-gray-200 dark:bg-gray-700 rounded ${t}`},n):d.jsx("div",{className:`h-40 w-full bg-gray-200 dark:bg-gray-700 rounded mb-2 ${t}`},n);if(a==="Button"){if(s&&s.length>0){const y=wa(h,a),w=Kn(s,t,r,o);if(!(w.length>0&&w.some(M=>M!==null)))return null;const S=/\b(border|rounded|px-\d|py-\d)/.test(f)?"border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50 rounded-lg":"";return d.jsx("div",{className:`${y} ${S}`.trim(),children:w},n)}return d.jsx("div",{className:`h-9 w-24 bg-gray-200 dark:bg-gray-700 rounded ${t}`},n)}return a==="Icon"?d.jsx("div",{className:`h-5 w-5 bg-gray-200 dark:bg-gray-700 rounded ${t}`},n):s&&s.length>0?d.jsx("div",{className:p,children:Kn(s,t,r,o)},n):d.jsx("div",{className:`h-3.5 w-full bg-gray-200 dark:bg-gray-700 rounded mb-1.5 ${t}`},n)}const xa=({components:e,options:t})=>{const r=Gg(t.animation),o=window.G7Core?.useResponsive,a=o?.(),s=a?a.width:typeof window<"u"?window.innerWidth:1024;return d.jsx("div",{className:"w-full",role:"status","aria-busy":"true","aria-label":"Loading...",children:Kn(e,r,t.iteration_count,s)})},Yg=Object.freeze(Object.defineProperty({__proto__:null,PageSkeleton:xa,default:xa},Symbol.toStringTag,{value:"Module"})),Xg=(e,t)=>window.G7Core?.t?.(e,t)??e,Gi=({options:e})=>{const t=document.documentElement.classList.contains("dark"),r=t?"rgb(17,24,39)":"rgb(249,250,251)",n=t?"#6b7280":"#9ca3af",o=t?"#9ca3af":"#6b7280";return d.jsxs("div",{style:{position:"absolute",inset:0,zIndex:2147483647,overflow:"hidden",background:r,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",paddingTop:"15%",gap:"12px"},children:[d.jsx("div",{style:{width:"32px",height:"32px",border:`3px solid ${n}`,borderTopColor:"transparent",borderRadius:"50%",animation:"g7-spin 0.8s linear infinite"}}),d.jsx("span",{style:{color:o,fontSize:"14px"},children:e?.text||Xg("nav.loading")})]})},Zg=Object.freeze(Object.defineProperty({__proto__:null,default:Gi},Symbol.toStringTag,{value:"Module"})),Dr=(e,t)=>window.G7Core?.t?.(e,t)??e,Wi=({currentPage:e,totalPages:t,onPageChange:r,maxVisiblePages:n=5,showFirstLast:o=!0,className:a="",style:s,prevText:l,nextText:f})=>{const g=x.useMemo(()=>{const h=[];if(t<=n+2)for(let p=1;p<=t;p++)h.push(p);else{const p=Math.floor(n/2);let y=Math.max(2,e-p),w=Math.min(t-1,e+p);e<=p+1?w=n:e>=t-p&&(y=t-n+1),h.push(1),y>2&&h.push("...");for(let b=y;b<=w;b++)h.push(b);w<t-1&&h.push("..."),t>1&&h.push(t)}return h},[e,t,n]),c=h=>{h<1||h>t||h===e||r(h)},i=()=>{e>1&&r(e-1)},u=()=>{e<t&&r(e+1)};return d.jsxs(j,{className:`flex items-center gap-2 ${a}`,style:s,role:"navigation","aria-label":Dr("common.pagination"),children:[o&&d.jsx(Q,{onClick:()=>c(1),disabled:e===1,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800","aria-label":Dr("common.first_page"),children:"«"}),d.jsx(Q,{onClick:i,disabled:e===1,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800","aria-label":Dr("common.prev_page"),children:l||d.jsx(d.Fragment,{children:"‹"})}),d.jsx(j,{className:"flex items-center gap-1",children:g.map((h,p)=>{if(h==="...")return d.jsx(re,{className:"px-3 py-1 text-sm text-gray-500 dark:text-gray-400",children:"..."},`ellipsis-${p}`);const y=h,w=y===e;return d.jsx(Q,{onClick:()=>c(y),className:`px-3 py-1 text-sm border rounded ${w?"bg-blue-500 dark:bg-blue-600 text-white border-blue-500 dark:border-blue-600":"border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800"}`,"aria-label":Dr("common.page_n",{n:y}),"aria-current":w?"page":void 0,children:y},y)})}),d.jsx(Q,{onClick:u,disabled:e===t,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800","aria-label":Dr("common.next_page"),children:f||d.jsx(d.Fragment,{children:"›"})}),o&&d.jsx(Q,{onClick:()=>c(t),disabled:e===t,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800","aria-label":Dr("common.last_page"),children:"»"})]})},qg=Object.freeze(Object.defineProperty({__proto__:null,Pagination:Wi},Symbol.toStringTag,{value:"Module"})),Ki=(e,t)=>window.G7Core?.t?.(e,t)??e,Vi=({name:e="search",placeholder:t,value:r,onChange:n,onSubmit:o,showButton:a=!1,suggestions:s=[],onSuggestionClick:l,showSuggestions:f=!1,className:g="",style:c})=>{const i=t??Ki("common.search_placeholder"),[u,h]=x.useState(""),[p,y]=x.useState(!1),w=x.useRef(null),b=x.useRef(""),I=r!==void 0?r:u,S=f&&p&&s.length>0&&I.length>0;x.useEffect(()=>{r!==void 0&&(b.current=r)},[r]);const M=T=>{const m=T.target.value;h(m),n?.(T),b.current!==""&&m===""&&!T.nativeEvent.inputType&&setTimeout(()=>{const v=w.current?.querySelector("form");v&&v.requestSubmit()},0),b.current=m},L=T=>{h(T.text);const m={target:{value:T.text,name:e}};n?.(m),l?.(T),y(!1)},E=T=>{T.preventDefault(),o?.(T)};return d.jsxs(j,{ref:w,className:`relative ${g}`,style:c,children:[d.jsx(to,{onSubmit:E,className:"relative",children:d.jsxs(j,{className:`relative flex items-center ${a?"gap-2":""}`,children:[d.jsxs(j,{className:"relative flex-1",children:[d.jsx(j,{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",children:d.jsx(ue,{name:Je.Search,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),d.jsx(vt,{type:"search",name:e,value:I,onChange:M,onFocus:()=>y(!0),onBlur:()=>setTimeout(()=>y(!1),200),placeholder:i,className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white text-sm"})]}),a&&d.jsx(Q,{type:"submit",className:"px-4 py-2 bg-gray-800 dark:bg-gray-600 text-white rounded-lg hover:bg-gray-900 dark:hover:bg-gray-500 transition-colors text-sm font-medium cursor-pointer h-[42px]",children:Ki("common.search")})]})}),S&&d.jsx(j,{className:"absolute z-10 w-full mt-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-64 overflow-y-auto",children:s.map(T=>d.jsx(j,{className:"px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer border-b border-gray-100 dark:border-gray-700 last:border-b-0 transition-colors",onClick:()=>L(T),children:d.jsxs(j,{className:"flex items-center gap-2",children:[d.jsx(ue,{name:Je.Search,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),d.jsx(re,{className:"text-sm text-gray-700 dark:text-gray-300",children:T.text})]})},T.id))})]})},Qg=Object.freeze(Object.defineProperty({__proto__:null,SearchBar:Vi},Symbol.toStringTag,{value:"Module"})),bt=window.G7Core,Jg={sm:"md",md:"lg",lg:"xl",xl:"2xl","2xl":"3xl"};function ka({src:e,fallbackText:t="U",size:r="lg",uploadEndpoint:n="/api/me/avatar",deleteEndpoint:o="/api/me/avatar",onUploadSuccess:a,onUploadError:s,onDeleteSuccess:l,onDeleteError:f,showDeleteButton:g=!0,accept:c="image/*",maxSize:i=5,className:u="",uploadButtonText:h,deleteButtonText:p,readOnly:y=!1,confirmDelete:w=!0,deleteConfirmMessage:b,confirmUpload:I=!0,uploadConfirmMessage:S,uploadSuccessActions:M,uploadErrorActions:L,deleteSuccessActions:E,deleteErrorActions:T}){const m=x.useRef(null),[v,D]=x.useState(!1),[A,F]=x.useState(!1),[P,O]=x.useState(void 0),[N,C]=x.useState(null),[k,U]=x.useState(!1),[$,G]=x.useState(!1),[K,z]=x.useState(null),[W,V]=x.useState(null),B=x.useRef(`avatar-upload-${Math.random().toString(36).slice(2,11)}`).current;x.useEffect(()=>{if(K){const Y=URL.createObjectURL(K);return V(Y),()=>URL.revokeObjectURL(Y)}else V(null)},[K]);const Z=x.useCallback(Y=>bt?.t?.(Y)??Y,[]),pe=x.useCallback(()=>{const Y=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return Y?decodeURIComponent(Y[1]):null},[]),ie=x.useCallback(()=>bt?.api?.getToken?.()??null,[]),fe=x.useCallback(async Y=>{G(!1),z(null),D(!0),C(null);try{const te=new FormData;te.append("avatar",Y);const de=pe(),ae=ie(),Ee=await fetch(n,{method:"POST",headers:{Accept:"application/json",...de&&{"X-XSRF-TOKEN":de},...ae&&{Authorization:`Bearer ${ae}`}},credentials:"include",body:te});if(!Ee.ok){const Me=await Ee.json().catch(()=>({}));throw new Error(Me.message||Z("attachment.upload_failed"))}const je=await Ee.json(),ze=je.data||je;ze.avatar&&O(ze.avatar),a?.(ze),bt?.toast?.success?.(Z("mypage.profile.avatar_uploaded")),M?.length?M.forEach(Me=>bt?.dispatch?.(Me)):bt?.refetchDataSource?.("user")}catch(te){const de=te instanceof Error?te:new Error(String(te));C(de.message),s?.(de),bt?.toast?.error?.(de.message),L?.length&&L.forEach(ae=>bt?.dispatch?.(ae))}finally{D(!1),m.current&&(m.current.value="")}},[n,a,s,pe,ie,Z]),ee=x.useCallback(async Y=>{const te=Y.target.files?.[0];if(!te)return;C(null);const de=i*1024*1024;if(te.size>de){const ae=new Error(Z("attachment.file_too_large").replace(":max",`${i}MB`));C(ae.message),s?.(ae),bt?.toast?.error?.(ae.message);return}if(c&&!te.type.match(c.replace("*",".*"))){const ae=new Error(Z("attachment.invalid_file_type"));C(ae.message),s?.(ae),bt?.toast?.error?.(ae.message);return}I?(z(te),G(!0)):fe(te)},[i,c,s,I,fe,Z]),_e=x.useCallback(async()=>{U(!1),F(!0),C(null);try{const Y=pe(),te=ie(),de=await fetch(o,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",...Y&&{"X-XSRF-TOKEN":Y},...te&&{Authorization:`Bearer ${te}`}},credentials:"include"});if(!de.ok){const ae=await de.json().catch(()=>({}));throw new Error(ae.message||Z("attachment.delete_failed"))}O(null),l?.(),bt?.toast?.success?.(Z("mypage.profile.avatar_deleted")),E?.length?E.forEach(ae=>bt?.dispatch?.(ae)):bt?.refetchDataSource?.("user")}catch(Y){const te=Y instanceof Error?Y:new Error(String(Y));C(te.message),f?.(te),bt?.toast?.error?.(te.message),T?.length&&T.forEach(de=>bt?.dispatch?.(de))}finally{F(!1)}},[o,l,f,pe,ie,Z]),ye=x.useCallback(()=>{w?U(!0):_e()},[w,_e]),He=x.useCallback(()=>{U(!1)},[]),Fe=x.useCallback(()=>{G(!1),z(null),m.current&&(m.current.value="")},[]),ve=x.useCallback(()=>{K&&fe(K)},[K,fe]),J=P===void 0?e:P,he=!!J,xe=Jg[r]||"lg",Ue=k||$,Le=()=>d.jsxs(j,{className:"flex items-center justify-center gap-2",children:[d.jsx(vt,{ref:m,id:B,type:"file",accept:c,className:"hidden",onChange:ee,disabled:v}),!he&&d.jsxs(br,{htmlFor:B,className:`inline-flex items-center gap-2 px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg text-sm font-medium hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer ${v?"opacity-50 cursor-not-allowed":""}`,children:[v?d.jsx(ue,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(ue,{name:"image",size:"sm"}),d.jsx(re,{children:h||Z("mypage.profile.register_avatar")})]}),he&&d.jsxs(d.Fragment,{children:[d.jsxs(br,{htmlFor:B,className:`inline-flex items-center gap-2 px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg text-sm font-medium hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer ${v?"opacity-50 cursor-not-allowed":""}`,children:[v?d.jsx(ue,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(ue,{name:"upload",size:"sm"}),d.jsx(re,{children:h||Z("common.change")})]}),g&&d.jsxs(Q,{type:"button",className:"inline-flex items-center gap-2 px-4 py-2 border border-red-300 dark:border-red-600 text-red-600 dark:text-red-400 rounded-lg text-sm font-medium hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:ye,disabled:A,children:[A?d.jsx(ue,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(ue,{name:"trash-2",size:"sm"}),d.jsx(re,{children:p||Z("common.delete")})]})]})]});return d.jsxs(j,{className:`flex flex-col items-center gap-3 ${u}`,children:[$&&W?d.jsxs(j,{className:"relative",children:[d.jsx(Wt,{src:W,alt:"Preview",className:`rounded-full object-cover ${r==="sm"?"w-10 h-10":r==="md"?"w-12 h-12":r==="lg"?"w-16 h-16":r==="xl"?"w-24 h-24":"w-32 h-32"}`}),d.jsx(j,{className:"absolute inset-0 rounded-full bg-blue-500/20 border-2 border-blue-500 border-dashed"})]}):d.jsx(Fr,{avatar:J||void 0,name:t,size:xe}),!y&&d.jsxs(j,{className:"w-[220px] flex flex-col items-center gap-2",children:[$&&K&&d.jsxs(j,{className:"w-full p-3 bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-lg",children:[d.jsxs(j,{className:"flex items-center gap-2 mb-2",children:[d.jsx(ue,{name:"upload",size:"sm",className:"text-blue-600 dark:text-blue-400 shrink-0"}),d.jsx(re,{className:"text-sm font-medium text-blue-800 dark:text-blue-300",children:S||Z("mypage.profile.upload_avatar_confirm")})]}),d.jsxs(j,{className:"text-xs text-blue-600 dark:text-blue-400 truncate mb-3",title:K.name,children:[K.name," (",(K.size/1024/1024).toFixed(2),"MB)"]}),d.jsxs(j,{className:"grid grid-cols-2 gap-2",children:[d.jsxs(Q,{type:"button",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium transition-colors disabled:opacity-50",onClick:ve,disabled:v,children:[v?d.jsx(ue,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(ue,{name:"check",size:"sm"}),d.jsx(re,{children:Z("common.confirm")})]}),d.jsx(Q,{type:"button",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-md text-sm font-medium hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",onClick:Fe,children:d.jsx(re,{children:Z("common.cancel")})})]})]}),k&&d.jsxs(j,{className:"w-full p-3 bg-red-50 dark:bg-red-950/50 border border-red-200 dark:border-red-800 rounded-lg",children:[d.jsxs(j,{className:"flex items-center gap-2 mb-2",children:[d.jsx(ue,{name:"alert-triangle",size:"sm",className:"text-red-600 dark:text-red-400 shrink-0"}),d.jsx(re,{className:"text-sm font-medium text-red-800 dark:text-red-300",children:b||Z("mypage.profile.delete_avatar_confirm")})]}),d.jsxs(j,{className:"grid grid-cols-2 gap-2",children:[d.jsxs(Q,{type:"button",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 bg-red-600 hover:bg-red-700 text-white rounded-md text-sm font-medium transition-colors disabled:opacity-50",onClick:_e,disabled:A,children:[A?d.jsx(ue,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(ue,{name:"trash-2",size:"sm"}),d.jsx(re,{children:Z("common.delete")})]}),d.jsx(Q,{type:"button",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-md text-sm font-medium hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",onClick:He,children:d.jsx(re,{children:Z("common.cancel")})})]})]}),!Ue&&Le()]}),N&&!Ue&&d.jsxs(j,{className:"flex items-center gap-2 text-sm text-red-600 dark:text-red-400",children:[d.jsx(ue,{name:"alert-circle",size:"sm"}),d.jsx(re,{children:N})]})]})}const Rg=Object.freeze(Object.defineProperty({__proto__:null,AvatarUploader:ka,default:ka},Symbol.toStringTag,{value:"Module"})),Yi=()=>window.G7Core,Vn=(e,t)=>window.G7Core?.t?.(e,t)??e,Xi={horizontal:"flex items-center gap-1.5",vertical:"flex flex-col items-start"},e0=()=>[{key:"view_profile",label:Vn("userinfo.view_profile"),icon:"user",path:"/users/{{userId}}"},{key:"view_posts",label:Vn("userinfo.view_posts"),icon:"file-lines",path:"/users/{{userId}}/posts"}],Ca=({text:e,title:t})=>e?d.jsx(re,{className:"text-sm text-gray-500 dark:text-gray-400",title:t,children:e}):null,Zi=({author:e,name:t,userId:r,subText:n,subTextTitle:o,isGuest:a=!1,isWithdrawn:s=!1,showDropdown:l=!0,clickable:f=!0,profilePath:g="/users/{userId}",className:c="",layout:i="vertical",text:u,stopPropagation:h=!1,menuItems:p,hideMenuItems:y=[],appendMenuItems:w=[]})=>{const b=r??e?.uuid,I=a||e?.is_guest||!1,S=s||e?.status==="withdrawn",M=S?Vn("userinfo.withdrawn_user"):u??t??e?.name??"",[L,E]=x.useState(!1),[T,m]=x.useState({top:0,left:0}),v=x.useRef(null),D=x.useRef(null),A=x.useRef(null),F=g.replace("{userId}",String(b??"")),P=`${Xi[i]} ${c}`;x.useEffect(()=>{if(!L)return;const z=V=>{const B=V.target,Z=v.current?.contains(B),pe=D.current?.contains(B);!Z&&!pe&&E(!1)},W=()=>E(!1);return document.addEventListener("mousedown",z),window.addEventListener("scroll",W,!0),window.addEventListener("resize",W),()=>{document.removeEventListener("mousedown",z),window.removeEventListener("scroll",W,!0),window.removeEventListener("resize",W)}},[L]);const O=x.useCallback(()=>{if(p&&p.length>0)return p.filter(V=>V.show!==!1);let W=e0().filter(V=>!y.includes(V.key)&&V.show!==!1);return w&&w.length>0&&(W=[...W,...w.filter(V=>V.show!==!1)]),W},[p,y,w]),N=x.useCallback(()=>{if(A.current){const z=A.current.getBoundingClientRect();m({top:z.bottom+4,left:z.left})}},[]),C=x.useCallback((z,W)=>{if(W.stopPropagation(),W.preventDefault(),E(!1),z.onClick)z.onClick();else if(z.path){const V=z.path.replace(/\{\{userId\}\}/g,String(b??"")),B=Yi();B?.navigate?B.navigate(V):window.location.href=V}},[b]),k=x.useCallback(z=>{z.preventDefault(),h&&z.stopPropagation(),!(I||!b)&&(l?(L||N(),E(W=>!W)):f&&Yi()?.navigate?.(F))},[h,I,b,l,L,N,f,F]);if(I||!b)return d.jsxs(j,{className:P,children:[d.jsxs(j,{className:"flex items-center gap-1.5 text-gray-400 dark:text-gray-500",children:[d.jsx(re,{children:M}),d.jsx(re,{className:"text-xs px-1.5 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded",children:Vn("userinfo.guest_badge")})]}),d.jsx(Ca,{text:n,title:o})]});if(S)return d.jsxs(j,{className:P,children:[d.jsx(re,{className:"text-gray-400 dark:text-gray-500 line-through",children:M}),d.jsx(Ca,{text:n,title:o})]});const U=O(),G=/\btext-\S+/.test(c)?"":"text-gray-900 dark:text-white",K=l||f?`${G} hover:text-blue-600 dark:hover:text-blue-400 cursor-pointer font-medium`.trim():`${G} font-medium`.trim();return d.jsxs(j,{ref:v,className:`relative inline-block ${c}`,children:[d.jsxs(j,{className:Xi[i],children:[d.jsx(Q,{ref:A,onClick:k,className:K,children:M}),d.jsx(Ca,{text:n,title:o})]}),l&&L&&U.length>0&&Jt.createPortal(d.jsx(j,{ref:D,className:"fixed w-40 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg py-1 z-[9999]",style:{top:T.top,left:T.left},"data-testid":"author-dropdown-menu",children:U.map(z=>d.jsxs(Q,{onClick:W=>C(z,W),className:"flex items-center justify-start gap-2 w-full text-left px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer","data-testid":`menu-item-${z.key}`,children:[z.icon&&d.jsx(ue,{name:z.icon,className:"w-4 h-4"}),d.jsx(re,{children:z.label})]},z.key))}),document.body)]})},t0=Object.freeze(Object.defineProperty({__proto__:null,UserInfo:Zi},Symbol.toStringTag,{value:"Module"})),qi=({tabs:e,activeTabId:t,onTabChange:r,variant:n="underline",className:o="",style:a,hiddenTabIds:s=[],mobileBreakpoint:l=768})=>{const g=window.G7Core?.useResponsive,c=g?.(),i=c?c.width<l:typeof window<"u"&&window.innerWidth<l,u=b=>{!b.disabled&&b.id!==t&&r?.(b.id)},h=b=>{const I=b.target.value,S=Number(I),M=typeof I=="string"&&I!==""&&!Number.isNaN(S)?S:I,L=e.find(E=>String(E.id)===String(M));L&&u(L)},p=s.length>0?e.filter(b=>!s.includes(b.id)):e;if(i)return d.jsx(j,{className:`relative ${o}`,style:a,children:d.jsx(Fa,{value:t!==void 0?String(t):"",onChange:h,options:p.map(b=>({value:String(b.id),label:b.badge!==void 0?`${b.label} (${b.badge})`:b.label,disabled:b.disabled})),className:"w-full"})});const y=b=>{const I=b.id===t,S="flex items-center gap-2 px-3 py-2 font-medium text-sm transition-all shrink-0 whitespace-nowrap";if(b.disabled)return`${S} opacity-50 cursor-not-allowed text-gray-400 dark:text-gray-600`;switch(n){case"pills":return I?`${S} bg-blue-600 dark:bg-blue-500 text-white rounded-lg`:`${S} text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg`;case"underline":return I?`${S} text-gray-900 dark:text-white border-b-2 border-gray-900 dark:border-white`:`${S} text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 border-b-2 border-transparent hover:border-gray-300 dark:hover:border-gray-600`;default:return I?`${S} text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-b-2 border-blue-600 dark:border-blue-400`:`${S} text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700 border-b-2 border-transparent`}},w=n==="underline"?"flex gap-0 border-b border-gray-200 dark:border-gray-700":"flex gap-2";return d.jsx(j,{className:`relative ${o}`,style:a,children:d.jsx(Lr,{className:w,children:p.map(b=>d.jsxs(Q,{type:"button",onClick:()=>u(b),disabled:b.disabled,className:y(b),children:[b.iconName&&d.jsx(ue,{name:b.iconName,size:"sm"}),d.jsx(re,{children:b.label}),b.badge!==void 0&&d.jsx(j,{className:"flex items-center justify-center min-w-5 h-5 px-1.5 bg-red-500 text-white text-xs font-bold rounded-full",children:d.jsx(re,{children:b.badge})})]},b.id))})})},r0=Object.freeze(Object.defineProperty({__proto__:null,TabNavigation:qi},Symbol.toStringTag,{value:"Module"})),n0={Header:()=>Promise.resolve().then(()=>$c),Footer:()=>Promise.resolve().then(()=>Hc),MobileNav:()=>Promise.resolve().then(()=>jc),NotificationCenter:()=>Promise.resolve().then(()=>Uc),ProductCard:()=>Promise.resolve().then(()=>fd),ImageGallery:()=>Promise.resolve().then(()=>yl),ProductImageViewer:()=>Promise.resolve().then(()=>yf),QuantitySelector:()=>Promise.resolve().then(()=>vf),PostReactions:()=>Promise.resolve().then(()=>kf),RichTextEditor:()=>Promise.resolve().then(()=>Cf),HtmlContent:()=>Promise.resolve().then(()=>Sf),HtmlEditor:()=>Promise.resolve().then(()=>Ef),ExpandableContent:()=>Promise.resolve().then(()=>_f),FileUploader:()=>Promise.resolve().then(()=>Sg),ConfirmDialog:()=>Promise.resolve().then(()=>Af),SocialLoginButtons:()=>Promise.resolve().then(()=>_g),Toast:()=>Promise.resolve().then(()=>Og),PageTransitionIndicator:()=>Promise.resolve().then(()=>Ig),PageTransitionBlur:()=>Promise.resolve().then(()=>Pg),PageSkeleton:()=>Promise.resolve().then(()=>Yg),PageLoading:()=>Promise.resolve().then(()=>Zg),ThemeToggle:()=>Promise.resolve().then(()=>Ic),Pagination:()=>Promise.resolve().then(()=>qg),SearchBar:()=>Promise.resolve().then(()=>Qg),Avatar:()=>Promise.resolve().then(()=>Fc),AvatarUploader:()=>Promise.resolve().then(()=>Rg),UserInfo:()=>Promise.resolve().then(()=>t0),Modal:()=>Promise.resolve().then(()=>Nf),TabNavigation:()=>Promise.resolve().then(()=>r0)},o0=({id:e,className:t,style:r,children:n})=>d.jsx(j,{id:e,className:t,style:r,children:n}),a0=({children:e,cols:t=1,responsive:r,gap:n,rowGap:o,colGap:a,autoRows:s,autoCols:l,flow:f="row",className:g="",style:c,onClick:i})=>{const u=["grid"];if(t&&u.push(`grid-cols-${t}`),r&&(r.sm&&u.push(`sm:grid-cols-${r.sm}`),r.md&&u.push(`md:grid-cols-${r.md}`),r.lg&&u.push(`lg:grid-cols-${r.lg}`),r.xl&&u.push(`xl:grid-cols-${r.xl}`),r["2xl"]&&u.push(`2xl:grid-cols-${r["2xl"]}`)),n!==void 0&&n>0&&u.push(`gap-${n}`),o!==void 0&&o>0&&u.push(`gap-y-${o}`),a!==void 0&&a>0&&u.push(`gap-x-${a}`),s){const p={auto:"auto-rows-auto",min:"auto-rows-min",max:"auto-rows-max",fr:"auto-rows-fr"};u.push(p[s])}if(l){const p={auto:"auto-cols-auto",min:"auto-cols-min",max:"auto-cols-max",fr:"auto-cols-fr"};u.push(p[l])}const h={row:"grid-flow-row",col:"grid-flow-col",dense:"grid-flow-dense","row-dense":"grid-flow-row-dense","col-dense":"grid-flow-col-dense"};return u.push(h[f]),g&&u.push(g),d.jsx(j,{className:u.join(" "),style:c,onClick:i,children:e})},s0=({children:e,direction:t="row",justify:r="start",align:n="stretch",wrap:o="nowrap",gap:a=0,grow:s=!1,shrink:l=!0,className:f="",style:g,onClick:c})=>{const i=["flex"],u={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"};i.push(u[t]);const h={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};i.push(h[o]);const p={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};i.push(p[r]);const y={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};return i.push(y[n]),a>0&&i.push(`gap-${a}`),s===!0?i.push("flex-grow"):typeof s=="number"&&s>0&&i.push(`flex-grow-${s}`),l===!1?i.push("shrink-0"):l===!0?i.push("flex-shrink"):typeof l=="number"&&l>0&&i.push(`flex-shrink-${l}`),f&&i.push(f),d.jsx(j,{className:i.join(" "),style:g,onClick:c,children:e})},l0=({title:e,subtitle:t,children:r,padding:n="md",background:o="none",maxWidth:a,centered:s=!1,border:l=!1,shadow:f="none",rounded:g=!1,className:c="",style:i,onClick:u})=>{const h=[],p={none:"p-0",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"};h.push(p[n]);const y={none:"",white:"bg-white dark:bg-gray-700",gray:"bg-gray-50 dark:bg-gray-800",primary:"bg-blue-50 dark:bg-blue-900/20",secondary:"bg-gray-50 dark:bg-gray-800"};if(o!=="none"&&h.push(y[o]),a){const b={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full"};h.push(b[a])}s&&h.push("mx-auto"),l&&h.push("border","border-gray-200","dark:border-gray-700");const w={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"};return f!=="none"&&h.push(w[f]),g&&h.push("rounded-lg"),c&&h.push(c),d.jsxs($a,{className:h.join(" "),style:i,onClick:u,children:[(e||t)&&d.jsxs(j,{className:"mb-4",children:[e&&d.jsx(Pa,{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e}),t&&d.jsx(It,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:t})]}),r]})},i0=({leftWidth:e="250px",rightWidth:t="300px",leftSlot:r,centerSlot:n,rightSlot:o,className:a="",style:s})=>{const l=`flex flex-row w-full h-full ${a}`.trim(),f={width:e,flexShrink:0},g={flex:1,minWidth:0},c={width:t,flexShrink:0};return d.jsxs(j,{className:l,style:s,children:[d.jsx(j,{className:"flex flex-col",style:f,children:r}),d.jsx(j,{className:"flex flex-col",style:g,children:n}),d.jsx(j,{className:"flex flex-col",style:c,children:o})]})},c0={identifier:"sirsoft-basic",vendor:"sirsoft",name:{ko:"Basic",en:"Basic"},version:"1.0.0-beta.2",license:"MIT",description:{ko:"그누보드7 기본 사용자 템플릿",en:"Gnuboard7 default user template"},type:"user",locales:["ko","en"],author:{name:"sirsoft",email:"contact@sirsoft.com",url:"https://sirsoft.com"},release_date:"2026-01-07",g7_version:">=7.0.0-beta.2",dependencies:{modules:{"sirsoft-board":">=1.0.0-beta.2","sirsoft-ecommerce":">=1.0.0-beta.2","sirsoft-page":">=1.0.0-beta.2"},plugins:{"sirsoft-daum_postcode":">=1.0.0-beta.2"}},assets:{css:["dist/css/components.css"],js:["dist/js/components.iife.js"],fonts:[],images:[]},components:{basic:["a","button","checkbox","div","form","h1","h2","h3","h4","hr","icon","img","input","label","li","nav","p","section","select","span","svg","table","tbody","td","textarea","th","thead","tr","ul"],composite:["header","footer","mobile-nav","product-card","rich-text-editor","image-gallery","quantity-selector","post-reactions","social-login-buttons","file-uploader","card","modal","toast","pagination","stat-card","status-badge","tab-navigation","empty-state","loading-spinner","breadcrumb","search-bar","dropdown"],layout:["container","flex","grid","section"]},preview:{thumbnail:"preview/thumbnail.png",screenshots:["preview/screenshot1.png","preview/screenshot2.png"]},error_config:{layouts:{401:"401",403:"403",404:"404",500:"500",503:"503",maintenance:"maintenance"}},features:{dark_mode:!0,responsive:!0,multi_language:!0,multi_currency:!0},github_url:"https://github.com/gnuboard/g7-template-sirsoft-basic",github_changelog_url:"https://github.com/gnuboard/g7-template-sirsoft-basic/blob/main/CHANGELOG.md"},Qi={KRW:{locale:"ko-KR",decimals:0},USD:{locale:"en-US",decimals:2},JPY:{locale:"ja-JP",decimals:0},CNY:{locale:"zh-CN",decimals:2},EUR:{locale:"de-DE",decimals:2}};function Yn(e,t="KRW"){if(!Number.isFinite(e))return"0";const r=Qi[t]||Qi.KRW;try{return new Intl.NumberFormat(r.locale,{style:"currency",currency:t,minimumFractionDigits:r.decimals,maximumFractionDigits:r.decimals}).format(e)}catch{return e.toLocaleString()+(t==="KRW"?"원":"")}}function Ji(e,t){if(!e)return;const r={};for(const[n,o]of Object.entries(e)){const s=(o?.value??o?.price??0)*t;r[n]={value:s,formatted:Yn(s,n)}}return r}function Xn(e){return e.name_localized?e.name_localized:typeof e.name=="string"?e.name:e.name?.ko??""}function d0(e,t,r){if(t&&r in t)return t[r];if(Array.isArray(e)){const n=e.find(o=>typeof o.key=="string"?o.key===r:o.key?.ko===r||Object.values(o.key).includes(r));return n?typeof n.value=="string"?n.value:n.value?.ko??Object.values(n.value)[0]:void 0}return e[r]}function u0(e,t){if(t)return t;if(!Array.isArray(e))return e;const r={};for(const n of e){const o=typeof n.key=="string"?n.key:n.key?.ko??Object.values(n.key)[0]??"",a=typeof n.value=="string"?n.value:n.value?.ko??Object.values(n.value)[0]??"";o&&(r[o]=a)}return r}function f0(e,t,r){return r.find(n=>!n?.option_values||!n?.is_active?!1:e.every(o=>{const a=Xn(o),s=t?.[a];return d0(n.option_values,n.option_values_localized,a)===s}))}function h0(e,t){const r=e.params;if(!r)return;const{optionGroups:n,options:o,selectedOptionItems:a,preferredCurrency:s}=r;let l;if(r.newGroupName&&r.newValue?l={...r.currentSelection??{},[r.newGroupName]:r.newValue}:l=r.currentSelection??{},!n?.every(w=>{const b=Xn(w);return l?.[b]}))return;const g=f0(n,l,o??[]);if(!g){t.setState?.({currentSelection:{},__mergeMode:"shallow"});return}const c=n.map(w=>l[Xn(w)]).join("_"),i=a??[];if(i.find(w=>w.id===c)){const w=window.G7Core;w?.toast?.warning?.(w?.t?.("sirsoft-ecommerce.shop.already_added_option")??"이미 추가된 옵션입니다."),t.setState?.({currentSelection:{},__mergeMode:"shallow"});return}const h=g.selling_price??0,p={};n.forEach(w=>{const b=Xn(w);p[b]=l[b]});const y={id:c,optionId:g.id,options:p,optionValues:u0(g.option_values,g.option_values_localized),quantity:1,stock:g.stock_quantity??999,unitPrice:h,unitPriceFormatted:Yn(h,s),totalPrice:h,totalPriceFormatted:Yn(h,s),multiCurrencyUnitPrice:g.multi_currency_selling_price,multiCurrencyTotalPrice:Ji(g.multi_currency_selling_price,1)};t.setState?.({selectedOptionItems:[...i,y],currentSelection:{},__mergeMode:"shallow"})}function g0(e,t){const r=e.params;if(!r)return;const{selectedOptionItems:n,preferredCurrency:o}=r,a=Number(r.itemIndex)||0,s=Number(r.newQuantity)||1,l=(n??[]).map((f,g)=>{if(g!==a)return f;const i=(f?.unitPrice??0)*s;return{...f,quantity:s,totalPrice:i,totalPriceFormatted:Yn(i,o),multiCurrencyTotalPrice:Ji(f?.multiCurrencyUnitPrice,s)}});t.setState?.({selectedOptionItems:l})}const sn=window.G7Core?.createLogger?.("Handler:Cart")??{log:(...e)=>console.log("[Handler:Cart]",...e),warn:(...e)=>console.warn("[Handler:Cart]",...e),error:(...e)=>console.error("[Handler:Cart]",...e)};function hr(e){const t=window.G7Core;t?.state?.setLocal?(t.state.setLocal(e),sn.log("Local state updated:",e)):sn.warn("G7Core.state.setLocal not available")}function Ri(){return window.G7Core?.state?.getLocal?.()||{}}function p0(){return window.G7Core?.state?.get?.()||{}}function m0(e,t="info"){const r=window.G7Core;r?.toast?.show?r.toast.show(e,t):sn.warn("G7Core.toast.show not available, message:",e)}function b0(e){const t=window.G7Core;return t?.t?t.t(e):e}function ec(){const e=window.G7Core;if(e?.dispatch){const r=Ri().selectedItems||[];e.dispatch({handler:"refetchDataSource",params:{dataSourceId:"cartItems"}}),sn.log("Refetching cartItems with selected_ids:",r)}else sn.warn("G7Core.dispatch not available")}function y0(e,t){const{itemId:r,selectedItems:n}=e?.params||{},o=n||[];let a;o.includes(r)?a=o.filter(g=>g!==r):a=[...o,r];const l=p0().cartItems?.data?.items||[],f=l.length>0&&a.length===l.length;hr({selectedItems:a,allSelected:f,selectedCount:a.length}),ec()}function v0(e,t){const{allItemIds:r,isSelected:n}=e?.params||{};hr({selectedItems:n?r:[],allSelected:n,selectedCount:n?r.length:0}),ec()}function w0(e,t){const{optionName:r,optionValue:n}=e?.params||{},a=Ri().selectedOptions||{};hr({selectedOptions:{...a,[r]:n}})}function x0(e,t){const{targetIds:r}=e?.params||{};if(!r||r.length===0){m0(b0("shop.cart.select_items_to_delete"),"warning");return}hr({deleteModal:{visible:!0,targetIds:r}})}function k0(e,t){const{targetItem:r}=e?.params||{};hr({optionModal:{visible:!0,targetItem:r},selectedOptions:r?.options||{},selectedQuantity:r?.quantity})}function C0(e,t){const{selectedItems:r}=e?.params||{};if(!r||r.length===0){hr({isCalculating:!1});return}hr({isCalculating:!0})}const gr=window.G7Core?.createLogger?.("Handler:CartOptionChange")??{log:(...e)=>console.log("[Handler:CartOptionChange]",...e),warn:(...e)=>console.warn("[Handler:CartOptionChange]",...e),error:(...e)=>console.error("[Handler:CartOptionChange]",...e)};function Sa(e){return e.name_localized?e.name_localized:typeof e.name=="string"?e.name:e.name?.ko??""}function S0(e,t,r){if(t&&r in t)return t[r];if(Array.isArray(e)){const n=e.find(o=>typeof o.key=="string"?o.key===r:o.key?.ko===r||Object.values(o.key).includes(r));return n?typeof n.value=="string"?n.value:n.value?.ko??Object.values(n.value)[0]:void 0}return e[r]}function tc(e,t,r){return!e||!t?.length?null:t.every(a=>{const s=Sa(a);return e[s]})?r?.find(a=>t.every(s=>{const l=Sa(s);return S0(a.option_values,a.option_values_localized,l)===e[l]}))||null:(gr.log("Not all options selected yet"),null)}function E0(e,t){const{selectedOptions:r,optionGroups:n,options:o}=e?.params||{};gr.log("findMatchingOption called:",{selectedOptions:r,optionGroups:n,optionsCount:o?.length});const a=tc(r,n,o);return gr.log("Matched option:",a),{matchedOption:a}}function _0(e,t){const{currentOptionValues:r,optionGroups:n,options:o}=e?.params||{};if(gr.log("initCartOptionSelection called:",{currentOptionValues:r,optionGroups:n,optionsCount:o?.length}),!n?.length||!r)return gr.log("No option groups or current values, returning empty"),{selectedOptions:{},matchedOption:null};const a={};for(const l of n){const f=Sa(l),g=r[f],c=l.values_localized??(Array.isArray(l.values)?l.values.map(i=>typeof i=="string"?i:i?.ko??""):[]);g&&c.includes(g)&&(a[f]=g)}gr.log("Initial selectedOptions:",a);const s=tc(a,n,o||[]);return gr.log("Matched option:",s),{selectedOptions:a,matchedOption:s}}const ln="g7_cart_key",T0="/api/modules/sirsoft-ecommerce/cart/key",Ct=window.G7Core?.createLogger?.("Handler:Storage")??{log:(...e)=>console.log("[Handler:Storage]",...e),warn:(...e)=>console.warn("[Handler:Storage]",...e),error:(...e)=>console.error("[Handler:Storage]",...e)};async function rc(){try{const e=await fetch(T0,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}});return e.ok?(await e.json()).data?.cart_key||null:(Ct.error("Failed to issue cartKey from API:",e.status),null)}catch(e){return Ct.error("Error issuing cartKey from API:",e),null}}function Ea(e){const t=window.G7Core;t?.state?.set?(t.state.set(e),Ct.log("Global state updated:",e)):Ct.warn("G7Core.state.set not available")}function N0(){try{const e=window.G7Config;return e?.user?e.user:(window.G7Core?.state?.get?.()||{}).currentUser||null}catch{return null}}async function A0(e,t){let r=null;try{r=localStorage.getItem(ln)}catch{}if(r)Ct.log("Existing cartKey loaded:",r);else if(r=await rc(),r)try{localStorage.setItem(ln,r),Ct.log("New cartKey issued from API:",r)}catch{}else Ct.error("Failed to issue cartKey from API");Ea({cartKey:r})}function M0(e,t){try{return localStorage.getItem(ln)}catch{return null}}function nc(e,t){try{localStorage.removeItem(ln),Ct.log("cartKey removed from localStorage")}catch{}Ea({cartKey:null})}async function O0(e,t){if(N0()){nc();return}const n=await rc();if(n){try{localStorage.setItem(ln,n),Ct.log("New cartKey regenerated from API:",n)}catch{}Ea({cartKey:n})}else Ct.error("Failed to regenerate cartKey from API")}function D0(e,t){const{key:r,value:n}=e?.params||{};if(!r){Ct.warn("saveToStorage: key is required");return}try{localStorage.setItem(r,n),Ct.log("Saved to storage:",r,n)}catch{}}function I0(e,t){const{key:r,defaultValue:n}=e?.params||{};if(!r)return Ct.warn("loadFromStorage: key is required"),n||null;try{return localStorage.getItem(r)||n||null}catch{return n||null}}function P0(e,t){const{product:r,priceField:n,currencyCode:o}=e,a=o||t.getState("_global.preferredCurrency")||"KRW",s=`multi_currency_${n}`,l=r[s];if(l&&l[a])return l[a].formatted;const f=`${n}_formatted`;return r[f]||String(r[n])}const _a={KRW:{code:"KRW",symbol:"₩",locale:"ko-KR",decimals:0},USD:{code:"USD",symbol:"$",locale:"en-US",decimals:2},JPY:{code:"JPY",symbol:"¥",locale:"ja-JP",decimals:0},CNY:{code:"CNY",symbol:"¥",locale:"zh-CN",decimals:2},EUR:{code:"EUR",symbol:"€",locale:"de-DE",decimals:2}};function L0(e,t){const{value:r,currencyCode:n,locale:o}=e,a=n||t.getState("_global.preferredCurrency")||"KRW",s=_a[a]||_a.KRW,l=o||s.locale;try{return new Intl.NumberFormat(l,{style:"currency",currency:s.code,minimumFractionDigits:s.decimals,maximumFractionDigits:s.decimals}).format(r)}catch{const f=r.toLocaleString(void 0,{minimumFractionDigits:s.decimals,maximumFractionDigits:s.decimals});return`${s.symbol}${f}`}}function F0(e){return _a[e]?.symbol||e}const Ta=window.G7Core?.createLogger?.("Handler:Currency")??{log:(...e)=>console.log("[Handler:Currency]",...e),warn:(...e)=>console.warn("[Handler:Currency]",...e),error:(...e)=>console.error("[Handler:Currency]",...e)},oc="g7_preferred_currency",U0="KRW";function $0(e,t){const{defaultCurrency:r=U0}=e;let n=r;try{if(typeof window<"u"&&window.localStorage){const o=localStorage.getItem(oc);o&&ac(o)&&(n=o)}}catch{Ta.warn("localStorage 접근 불가, 기본 통화 사용:",r)}return t.setState("global",{preferredCurrency:n}),n}function z0(e,t){const{currencyCode:r}=e;if(!ac(r)){Ta.warn("유효하지 않은 통화 코드:",r);return}try{typeof window<"u"&&window.localStorage&&localStorage.setItem(oc,r)}catch{Ta.warn("localStorage 저장 실패")}t.setState("global",{preferredCurrency:r})}function ac(e){return["KRW","USD","JPY","CNY","EUR"].includes(e)}const Ir=window.G7Core?.createLogger?.("Handler:SetTheme")??{log:(...e)=>console.log("[Handler:SetTheme]",...e),warn:(...e)=>console.warn("[Handler:SetTheme]",...e),error:(...e)=>console.error("[Handler:SetTheme]",...e)},Na=["auto","light","dark"],sc="g7_color_scheme",H0=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,Zn=e=>{const t=H0(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};function j0(){try{const e=localStorage.getItem(sc),t=e&&Na.includes(e)?e:"auto";Zn(t),Ir.log("Initial theme applied:",t)}catch(e){Ir.warn("Failed to load initial theme:",e),Zn("auto")}}async function B0(e,t){const r=e?.target;if(r&&typeof r=="string"&&Na.includes(r)){Zn(r);return}j0()}async function G0(e,t){let r;if(e?.target&&typeof e.target=="string"&&!e.target.includes("{{")&&(r=e.target),!r||typeof r!="string"){Ir.warn("Invalid theme:",r);return}if(!Na.includes(r)){Ir.warn("Unsupported theme:",r);return}const n=r;try{localStorage.setItem(sc,n)}catch(o){Ir.error("Failed to save theme to localStorage:",o);return}Zn(n),Ir.log("Theme changed to:",n)}const qn={"sirsoft-basic.addSelectedItemIfComplete":h0,"sirsoft-basic.updateSelectedItemQuantity":g0,"sirsoft-basic.getDisplayPrice":P0,"sirsoft-basic.formatCurrency":L0,"sirsoft-basic.getCurrencySymbol":F0,"sirsoft-basic.loadPreferredCurrency":$0,"sirsoft-basic.savePreferredCurrency":z0,setTheme:G0,initTheme:B0,toggleCartItemSelection:y0,selectAllCartItems:v0,setCartOption:w0,openCartDeleteModal:x0,openCartOptionModal:k0,recalculateCart:C0,findMatchingOption:E0,initCartOptionSelection:_0,initCartKey:A0,getCartKey:M0,clearCartKey:nc,regenerateCartKey:O0,saveToStorage:D0,loadFromStorage:I0},Aa=window.G7Core?.createLogger?.("Template:sirsoft-basic")??{log:(...e)=>console.log("[Template:sirsoft-basic]",...e),warn:(...e)=>console.warn("[Template:sirsoft-basic]",...e),error:(...e)=>console.error("[Template:sirsoft-basic]",...e)};typeof window<"u"&&(window.G7TemplateHandlers=qn);function lc(){if(typeof window<"u"){let e=0;const t=50,r=()=>{const n=window.G7Core?.getActionDispatcher?.();n?(Object.entries(qn).forEach(([o,a])=>{n.registerHandler(o,a)}),Aa.log(`${Object.keys(qn).length} custom handler(s) registered:`,Object.keys(qn))):(e++,e<=t?(Aa.warn(`ActionDispatcher not found, retrying... (${e}/${t})`),setTimeout(r,100)):Aa.error("Failed to register handlers: ActionDispatcher not available after maximum retries"))};document.readyState==="complete"?r():window.addEventListener("load",r)}}return lc(),R.A=eo,R.Avatar=Fr,R.AvatarUploader=ka,R.BasicFooter=za,R.BasicHeader=Ha,R.Button=Q,R.Checkbox=Ua,R.Code=Oc,R.ConfirmDialog=Xo,R.Container=o0,R.Div=j,R.ExpandableContent=Ko,R.FileInput=Oa,R.FileUploader=Wn,R.Flex=s0,R.Footer=Wa,R.Form=to,R.Grid=a0,R.H1=vc,R.H2=Pa,R.H3=dn,R.H4=La,R.Header=Ga,R.Hr=un,R.HtmlContent=Bo,R.HtmlEditor=Cl,R.Icon=ue,R.IconName=Je,R.ImageGallery=_r,R.Img=Wt,R.Input=vt,R.Label=br,R.Li=Xt,R.MobileNav=Ka,R.Modal=Vo,R.Nav=Lr,R.NotificationCenter=hn,R.Ol=wc,R.Optgroup=Sc,R.Option=Cc,R.P=It,R.PageLoading=Gi,R.PageSkeleton=xa,R.PageTransitionBlur=ya,R.PageTransitionIndicator=ba,R.Pagination=Wi,R.PasswordInput=Ia,R.PostReactions=xl,R.ProductCard=as,R.ProductImageViewer=En,R.QuantitySelector=vl,R.RichTextEditor=kl,R.SearchBar=Vi,R.Section=$a,R.SectionLayout=l0,R.Select=Fa,R.SocialLoginButtons=Pi,R.Span=re,R.Svg=cn,R.TabNavigation=qi,R.Table=Ec,R.Tbody=Tc,R.Td=Mc,R.Textarea=Jn,R.Th=Ac,R.Thead=_c,R.ThemeToggle=fn,R.ThreeColumnLayout=i0,R.Toast=ma,R.Tr=Nc,R.Ul=Rn,R.UserInfo=Zi,R.availablePasswordRules=Qn,R.compositeComponents=n0,R.defaultPasswordRules=Da,R.initTemplate=lc,R.templateMetadata=c0,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),R})({},ReactJSXRuntime,React,ReactDOM);
//# sourceMappingURL=components.iife.js.map