7.0.7 페이로드 전수 검증에서 발견된 error 4건·warn 14건을 릴리즈 전에 처리했다. 미출시 분량의 자체 결함(회원 통합검색 500, 관리자 스코프 403 의 500 위장 등)이므로 페이로드에 합류시키고, 출시 대상 26개 CHANGELOG 의 버전 섹션 날짜를 2026-08-18 로 정렬했다. - 통합검색 import 복원 + 이커머스 관리자 typed 403 catch 대칭(테스트 동반) - admin 판정 스니핑 사설 사본 전수 수렴(BoardResource) + 조건 스캔 테스트 - 스케줄 인터프리터 변형 표기(확장자·버전 접미사) 정규화 차단 - ckeditor5 참조 판정 배치화·fail-safe, 결제 플러그인 진단 페이로드 대칭 - 템플릿 다크 대비·상태 Select value-제어 + --production 재빌드 - Upgrade_7_0_7 잔존 중복 색인 정리 스텝, API 문서·i18n(ko/en/ja) 동기
283 lines
702 KiB
JavaScript
283 lines
702 KiB
JavaScript
var SirsoftAdminBasic=(function(R,h,v,Dn){"use strict";var VT=Object.defineProperty;var zT=(R,h,v)=>h in R?VT(R,h,{enumerable:!0,configurable:!0,writable:!0,value:v}):R[h]=v;var Pe=(R,h,v)=>zT(R,typeof h!="symbol"?h+"":h,v);var Aa,hr;function Jm(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const $=Jm(v),Rm=()=>window.G7Core,oe=v.forwardRef(({children:t,variant:e="primary",size:n="md",className:r="",...s},o)=>{const i="button",a=Rm()?.style?.mergeClasses?.(i,r)??`${i} ${r}`;return h.jsx("button",{ref:o,className:a,...s,children:t})});oe.displayName="Button";const Nd=v.forwardRef(({accept:t,maxSize:e,onChange:n,onError:r,buttonText:s="Browse",placeholder:o="No file selected",className:i="",disabled:a,...l},c)=>{const d=v.useRef(null),u=c||d,[f,g]=v.useState(""),m={},p={};Object.entries(l).forEach(([x,E])=>{x.startsWith("data-editor-")||x==="id"||x==="onMouseMove"||x==="onMouseLeave"?m[x]=E:p[x]=E});const y=v.useCallback(()=>{!a&&u.current&&u.current.click()},[a,u]),b=v.useCallback(x=>{const E=x.target.files?.[0]||null;if(!E){g(""),n?.({target:{value:null,name:""}});return}if(e&&E.size>e*1024*1024){const S=`File size exceeds ${e}MB limit`;r?.(S),u.current&&(u.current.value=""),g("");return}g(E.name),n?.({target:{value:E,name:E.name}})},[e,n,r,u]),_=v.useCallback(x=>{x.stopPropagation(),u.current&&(u.current.value=""),g(""),n?.({target:{value:null,name:""}})},[n,u]);return h.jsxs("div",{className:`flex items-center gap-2 ${i}`,...m,children:[h.jsx("input",{ref:u,type:"file",accept:t,onChange:b,disabled:a,className:"hidden",...p}),h.jsx("button",{type:"button",onClick:y,disabled:a,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:s}),h.jsx("span",{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:f||o}),f&&!a&&h.jsx("button",{type:"button",onClick:_,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});Nd.displayName="FileInput";const eb=t=>t==="checkbox"?"checkbox":t==="radio"?"radio":"input",tb=(t,e)=>{const n=eb(t);return e?e.split(/\s+/).filter(Boolean).includes(n)?e:`${n} ${e}`:n},wt=v.forwardRef(({label:t,error:e,className:n="",onChange:r,onKeyPress:s,value:o,defaultValue:i,type:a="text",checked:l,defaultChecked:c,...d},u)=>{const f=a==="radio"||a==="checkbox",g=tb(a,n),m=v.useRef(!1),p=v.useRef(null);v.useImperativeHandle(u,()=>p.current);const[y,b]=v.useState(o??i??"");v.useEffect(()=>{if(!f&&!m.current&&o!==void 0){if(p.current&&document.activeElement===p.current)return;b(o)}},[o,f]);const _=v.useCallback(()=>{m.current=!0},[]),x=v.useCallback(M=>{if(m.current=!1,r){const T=M.target.value;b(T);const L=new Event("change",{bubbles:!0});Object.defineProperty(L,"target",{writable:!1,value:{value:T}}),Object.defineProperty(L,"currentTarget",{writable:!1,value:{value:T}}),r(L)}},[r]),E=v.useCallback(M=>{const T=M.target.value;b(T),!m.current&&r&&r(M)},[r]),S=v.useCallback(M=>{m.current||s&&s(M)},[s]),{loadingactions:w,formdata:N,...C}=d;if(f)return h.jsx("input",{ref:p,type:a,className:g,onChange:r,checked:l,defaultChecked:c,value:o,...C});const k=o!==void 0?{value:y}:{defaultValue:i};return h.jsx("input",{ref:p,type:a,className:g,onChange:E,onKeyPress:S,onCompositionStart:_,onCompositionEnd:x,...k,...C})});wt.displayName="Input";const Rn=({label:t,error:e,className:n="",onChange:r,value:s,defaultValue:o,...i})=>{const a=v.useRef(!1),l=v.useRef(null),[c,d]=v.useState(s??o??"");v.useEffect(()=>{!a.current&&s!==void 0&&d(s)},[s]);const u=v.useCallback(()=>{a.current=!0},[]),f=v.useCallback(E=>{if(a.current=!1,r){const S=E.target.value;d(S);const w=new Event("change",{bubbles:!0});Object.defineProperty(w,"target",{writable:!1,value:{value:S}}),Object.defineProperty(w,"currentTarget",{writable:!1,value:{value:S}}),r(w)}},[r]),g=v.useCallback(E=>{const S=E.target.value;d(S),!a.current&&r&&r(E)},[r]),{loadingactions:m,formdata:p,...y}=i,b=s!==void 0?{value:c}:{defaultValue:o},x=(n??"").split(/\s+/).filter(Boolean).includes("textarea")?n??"":["textarea",n].filter(Boolean).join(" ");return h.jsx("textarea",{ref:l,className:x,onChange:g,onCompositionStart:u,onCompositionEnd:f,...b,...y})},on=({children:t,className:e="",...n})=>h.jsx("label",{className:e,...n,children:t}),I=v.forwardRef(({children:t,className:e="",...n},r)=>h.jsx("div",{ref:r,className:e,...n,children:t})),Q=({children:t,className:e="",...n})=>h.jsx("span",{className:e,...n,children:t}),yt=({children:t,className:e="",...n})=>h.jsx("p",{className:e,...n,children:t}),kn=({className:t="",alt:e="",...n})=>h.jsx("img",{className:t,alt:e,...n}),Pa=({children:t,className:e="",...n})=>h.jsx("h1",{className:e,...n,children:t}),er=({children:t,className:e="",...n})=>h.jsx("h2",{className:e,...n,children:t}),$r=({children:t,className:e="",...n})=>h.jsx("h3",{className:e,...n,children:t}),Od=({children:t,className:e="",...n})=>h.jsx("h4",{className:e,...n,children:t}),$a=({children:t,className:e="",...n})=>h.jsx("ul",{className:e,...n,children:t}),nb=({children:t,className:e="",...n})=>h.jsx("ol",{className:e,...n,children:t}),Fa=({children:t,className:e="",...n})=>h.jsx("li",{className:e,...n,children:t}),Fr=({children:t,className:e="",...n})=>h.jsx("a",{className:e,...n,children:t}),Va=({children:t,className:e="",...n})=>h.jsx("form",{className:e,...n,children:t}),Wn=({children:t,className:e="",...n})=>h.jsx("svg",{className:e,...n,children:t}),rb=window.G7Core?.createLogger?.("Comp:Select")??{log:(...t)=>console.log("[Comp:Select]",...t),warn:(...t)=>console.warn("[Comp:Select]",...t),error:(...t)=>console.error("[Comp:Select]",...t)};function sb(t){const e=window.G7Core?.state?.get?.("_global.appConfig.localeNames")?.[t];return e||{ko:"한국어",en:"English",ja:"日本語",zh:"中文",es:"Español",fr:"Français",de:"Deutsch"}[t]||t}const Vr=({children:t,label:e,error:n,options:r,className:s="",value:o,onChange:i,disabled:a,searchable:l=!1,searchPlaceholder:c,editorAttrs:d,...u})=>{const[f,g]=v.useState(!1),[m,p]=v.useState(""),[y,b]=v.useState(null),_=v.useRef(null),x=v.useRef(null),E=v.useRef(null),S=v.useRef(null),w=v.useMemo(()=>r?Array.isArray(r)?r.length===0?[]:typeof r[0]=="string"?r.map(O=>({value:O,label:sb(O)})):r:(rb.warn("options prop is not an array:",r),null):null,[r]),N=v.useMemo(()=>w&&w.find(V=>String(V.value)===String(o))?.label||"",[w,o]),C=v.useMemo(()=>{if(!w)return null;if(!l||m.trim()==="")return w;const O=m.trim().toLowerCase();return w.filter(V=>V.label.toLowerCase().includes(O)||String(V.value).toLowerCase().includes(O))},[w,l,m]);v.useEffect(()=>{if(f&&l){p("");const O=setTimeout(()=>E.current?.focus(),0);return()=>clearTimeout(O)}f||p("")},[f,l]);const k=v.useCallback(()=>{if(!x.current)return;const O=x.current.getBoundingClientRect(),V=window.innerHeight-O.bottom,W=V<280&&O.top>V;b(W?{bottom:window.innerHeight-O.top+4,left:O.left,width:O.width}:{top:O.bottom+4,left:O.left,width:O.width})},[]);v.useEffect(()=>{if(!f){b(null);return}return k(),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[f,k]),v.useEffect(()=>{const O=V=>{const H=V.target;_.current&&!_.current.contains(H)&&(!S.current||!S.current.contains(H))&&g(!1)};return f&&document.addEventListener("mousedown",O),()=>{document.removeEventListener("mousedown",O)}},[f]),v.useEffect(()=>{const O=V=>{V.key==="Escape"&&f&&(g(!1),x.current?.focus())};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[f]);const M=()=>{a||g(!f)},T=O=>{i&&i({target:{value:O},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),g(!1),x.current?.focus()};if(!w){const V=(s??"").split(/\s+/).filter(Boolean).includes("select")?s??"":["select",s].filter(Boolean).join(" ");return h.jsx("select",{className:V,value:o,onChange:i,disabled:a,...d,...u,children:t})}const L=(s??"").split(/\s+/).filter(O=>O&&!O.includes(":")).join(" "),P=L.includes("bg-"),F=/text-(gray|red|blue|green|yellow|white|black|indigo|purple|pink|orange|amber|emerald|teal|cyan|slate)-\d+|text-white|text-black/.test(L),D=P?`${s}${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-sm text-gray-700 dark:text-gray-200 font-medium focus:ring-2 focus:ring-blue-500 focus:outline-none ${s}`,A={...d,...u};return h.jsxs(I,{ref:_,className:"relative",...A,children:[h.jsxs(oe,{ref:x,type:"button",onClick:M,disabled:a,className:`${D} flex items-center justify-between gap-2 text-left cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,"aria-haspopup":"listbox","aria-expanded":f,children:[h.jsx(Q,{className:"truncate",children:N||" "}),h.jsx(Wn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&y&&Dn.createPortal(h.jsxs(I,{ref:S,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:[l&&h.jsx(I,{className:"p-2 border-b border-gray-200 dark:border-gray-600",children:h.jsx(wt,{ref:E,type:"text",value:m,onChange:O=>p(O.target.value),placeholder:c??"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":c??"Search"})}),h.jsxs(I,{className:"py-2 max-h-60 overflow-auto",children:[C&&C.length===0&&h.jsx(I,{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400 text-center",children:m?"No results":""}),(C??[]).map(O=>{const V=String(O.value)===String(o);return h.jsxs(oe,{type:"button",onClick:()=>!O.disabled&&T(O.value),disabled:O.disabled,className:`w-full px-4 py-3 text-left text-sm flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${V?"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":V,children:[h.jsx(Q,{children:O.label}),V&&h.jsx(Wn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},O.value)})]})]}),document.body)]})},ob=({children:t,className:e="",...n})=>h.jsx("option",{className:e,...n,children:t}),ib=({children:t,className:e="",...n})=>h.jsx("optgroup",{className:e,...n,children:t}),Cn=v.forwardRef(({label:t,className:e="",indeterminate:n=!1,...r},s)=>{const o=v.useRef(null),i=a=>{o.current=a,typeof s=="function"?s(a):s&&(s.current=a)};return v.useEffect(()=>{o.current&&(o.current.indeterminate=n)},[n]),h.jsx("input",{ref:i,type:"checkbox",className:e,...r})});Cn.displayName="Checkbox";const za=({children:t,className:e="",...n})=>h.jsx("table",{className:e,...n,children:t}),Ha=({children:t,className:e="",...n})=>h.jsx("thead",{className:e,...n,children:t}),Ua=({children:t,className:e="",...n})=>h.jsx("tbody",{className:e,...n,children:t}),Ba=({children:t,className:e="",...n})=>h.jsx("tfoot",{className:e,...n,children:t}),tr=({children:t,className:e="",...n})=>h.jsx("tr",{className:e,...n,children:t}),zr=({children:t,className:e="",...n})=>h.jsx("th",{className:e,...n,children:t}),Jt=({children:t,className:e="",...n})=>h.jsx("td",{className:e,...n,children:t}),Po=({children:t,className:e="",...n})=>h.jsx("nav",{className:e,...n,children:t}),Td=({children:t,className:e="",...n})=>h.jsx("section",{className:e,...n,children:t}),re=({name:t,iconStyle:e="solid",size:n,color:r,spin:s=!1,pulse:o=!1,fixedWidth:i=!1,ariaLabel:a,className:l="",style:c,...d})=>{const u={solid:"fas",regular:"far",light:"fal",duotone:"fad",brands:"fab"},f={"fa-solid":"solid","fa-regular":"regular","fa-light":"light","fa-duotone":"duotone","fa-brands":"brands"},g=typeof t=="string"?t:String(t);let m=e,p=g;for(const[_,x]of Object.entries(f))if(g.startsWith(_+" ")){m=x,p=g.substring(_.length+1);break}p=p.replace(/^fa-/,"");const y=[u[m],`fa-${p}`,n&&`fa-${n}`,s&&"fa-spin",o&&"fa-pulse",i&&"fa-fw",r,l].filter(Boolean).join(" "),b=a||p.replace(/-/g," ");return h.jsx("i",{className:y,style:c,"aria-label":b,role:"img",...d})},ab={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"},Ad={xs:"xs",sm:"sm",md:void 0,lg:"lg",xl:"2x"},lb=({icon:t,size:e="md",className:n="",color:r,ariaLabel:s})=>{const o=t.indexOf(":"),i=t.startsWith("fa-")||t.startsWith("fas ")||t.startsWith("far ")||t.startsWith("fab ")||t.startsWith("fal ")||t.startsWith("fad ");let a,l;i?(a="fa",l=t):o>0?(a=t.substring(0,o),l=t.substring(o+1)):(a="fa",l=t);const c=ab[e],d=r||"";switch(a){case"fa":return h.jsx(re,{name:l,size:Ad[e],className:n,color:r,ariaLabel:s});case"svg":return h.jsx("img",{src:l,className:`${c} ${d} ${n}`.trim(),alt:s||"","aria-label":s,role:"img"});case"img":return h.jsx("img",{src:l,className:`${c} ${n}`.trim(),alt:s||"",role:"img"});default:return h.jsx(re,{name:t,size:Ad[e],className:n,color:r,ariaLabel:s})}},cb=({children:t,className:e="",...n})=>h.jsx("code",{className:e,...n,children:t}),db=({children:t,className:e="",...n})=>h.jsx("pre",{className:e,...n,children:t}),ub=({children:t})=>h.jsx(h.Fragment,{children:t}),fb=({className:t="",...e})=>h.jsx("hr",{className:t,...e}),gt=({className:t="",children:e,style:n,...r})=>h.jsx("i",{className:t,style:n,...r,children:e});var de=(t=>(t.User="fa-user",t.Users="fa-users",t.UserCircle="fa-user-circle",t.UserPlus="fa-user-plus",t.UserMinus="fa-user-minus",t.UserShield="fa-user-shield",t.Search="fa-search",t.Edit="fa-edit",t.Pencil="fa-pencil-alt",t.Trash="fa-trash",t.Save="fa-save",t.Plus="fa-plus",t.Minus="fa-minus",t.Check="fa-check",t.Times="fa-times",t.Download="fa-download",t.Upload="fa-upload",t.Copy="fa-copy",t.ExternalLink="fa-external-link-alt",t.Home="fa-home",t.CaretRight="fa-caret-right",t.CaretDown="fa-caret-down",t.ChevronLeft="fa-chevron-left",t.ChevronRight="fa-chevron-right",t.ChevronUp="fa-chevron-up",t.ChevronDown="fa-chevron-down",t.AngleLeft="fa-angle-left",t.AngleRight="fa-angle-right",t.AngleUp="fa-angle-up",t.AngleDown="fa-angle-down",t.ArrowUp="fa-arrow-up",t.ArrowDown="fa-arrow-down",t.ArrowLeft="fa-arrow-left",t.ArrowRight="fa-arrow-right",t.Bars="fa-bars",t.EllipsisVertical="fa-ellipsis-v",t.EllipsisHorizontal="fa-ellipsis-h",t.CheckCircle="fa-check-circle",t.TimesCircle="fa-times-circle",t.ExclamationCircle="fa-exclamation-circle",t.ExclamationTriangle="fa-exclamation-triangle",t.InfoCircle="fa-info-circle",t.QuestionCircle="fa-question-circle",t.XCircle="fa-times-circle",t.ShoppingCart="fa-shopping-cart",t.ShoppingBag="fa-shopping-bag",t.CreditCard="fa-credit-card",t.Tag="fa-tag",t.Tags="fa-tags",t.File="fa-file",t.FileAlt="fa-file-alt",t.Folder="fa-folder",t.FolderOpen="fa-folder-open",t.Envelope="fa-envelope",t.Phone="fa-phone",t.Comment="fa-comment",t.Comments="fa-comments",t.Cog="fa-cog",t.Cogs="fa-cogs",t.Settings="fa-cog",t.Wrench="fa-wrench",t.Sliders="fa-sliders-h",t.Image="fa-image",t.Images="fa-images",t.Video="fa-video",t.Camera="fa-camera",t.Heart="fa-heart",t.Star="fa-star",t.ThumbsUp="fa-thumbs-up",t.ThumbsDown="fa-thumbs-down",t.Share="fa-share",t.Clock="fa-clock",t.Calendar="fa-calendar",t.CalendarAlt="fa-calendar-alt",t.Lock="fa-lock",t.Unlock="fa-unlock",t.Eye="fa-eye",t.EyeSlash="fa-eye-slash",t.Bell="fa-bell",t.Flag="fa-flag",t.Map="fa-map",t.MapMarker="fa-map-marker-alt",t.Globe="fa-globe",t.Link="fa-link",t.Unlink="fa-unlink",t.Sun="fa-sun",t.Moon="fa-moon",t.ChartBar="fa-chart-bar",t.ChartLine="fa-chart-line",t.ChartPie="fa-chart-pie",t.ChartArea="fa-chart-area",t.Spinner="fa-spinner",t.CircleNotch="fa-circle-notch",t.CheckBadge="fa-badge-check",t.Cube="fa-cube",t.Cubes="fa-cubes",t.Plug="fa-plug",t.PuzzlePiece="fa-puzzle-piece",t.Palette="fa-palette",t))(de||{});const hb=({title:t,content:e,imageUrl:n,imageAlt:r="",className:s="",onClick:o,style:i,id:a,editorAttrs:l})=>h.jsxs(I,{className:`card-clickable ${s}`,onClick:o,style:i,id:a,...l,children:[n&&h.jsx(I,{className:"w-full",children:h.jsx(kn,{src:n,alt:r,className:"card-image"})}),h.jsxs(I,{className:"p-4",children:[t&&h.jsx(er,{className:"card-title",children:t}),e&&h.jsx(yt,{className:"card-content",children:e})]})]}),Cs=({items:t,triggerLabel:e="작업",triggerIconName:n=de.EllipsisVertical,position:r="right",className:s="",style:o,children:i,onItemClick:a,id:l,editorAttrs:c})=>{const[d,u]=v.useState(!1),[f,g]=v.useState({top:0,left:0}),m=v.useRef(null),p=v.useRef(null),y=v.useCallback(()=>{if(!m.current)return;const x=m.current.getBoundingClientRect(),E=224;let S=r==="right"?x.right-E:x.left;const w=x.bottom+8;S<8&&(S=8),S+E>window.innerWidth-8&&(S=window.innerWidth-E-8),g({top:w,left:S})},[r]);v.useEffect(()=>{d&&y()},[d,y]),v.useEffect(()=>{if(!d)return;const x=()=>{u(!1)};return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[d]),v.useEffect(()=>{const x=E=>{const S=E.target,w=m.current?.contains(S),N=p.current?.contains(S);!w&&!N&&u(!1)};return d&&document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[d]);const b=x=>{x.disabled||(x.onClick&&x.onClick(),a&&a(x.id,x),u(!1))},_=d?Dn.createPortal(h.jsx("div",{ref:p,className:"fixed z-[9999] w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",style:{top:f.top,left:f.left},children:t.filter(x=>x.if!==!1).map(x=>{if(x.divider)return h.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600 my-1"},x.id);const E=x.variant==="danger"?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",S=x.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer";return h.jsxs("div",{onClick:()=>b(x),className:`flex items-center gap-3 px-4 py-3 transition-colors ${E} ${S}`,children:[x.iconName&&h.jsx(re,{name:x.iconName,className:"w-4 h-4"}),h.jsx("span",{className:"text-sm font-medium",children:x.label})]},x.id)})}),document.body):null;return h.jsxs(I,{className:`relative inline-block ${s}`,style:o,id:l,...c,children:[i?h.jsx(I,{ref:m,onClick:()=>u(!d),className:"cursor-pointer",children:i}):h.jsxs(oe,{ref:m,onClick:()=>u(!d),className:"flex items-center gap-2 px-2 py-1 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[e&&h.jsx(Q,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:e}),n&&h.jsx(re,{name:n,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})]}),_]})},Hr=(t,e)=>window.G7Core?.t?.(t,e)??t,$o=({currentPage:t,totalPages:e,onPageChange:n,maxVisiblePages:r=5,showFirstLast:s=!0,showFirst:o,showLast:i,hasMorePages:a,className:l="",style:c,prevText:d,nextText:u,id:f,editorAttrs:g})=>{const m=e!=null,p=m?e:0,y=m?t<p:a??!1,b=(o??s)&&m,_=(i??s)&&m,x=v.useMemo(()=>{const N=[];if(!m)return N;if(p<=r+2)for(let C=1;C<=p;C++)N.push(C);else{const C=Math.floor(r/2);let k=Math.max(2,t-C),M=Math.min(p-1,t+C);t<=C+1?M=r:t>=p-C&&(k=p-r+1),N.push(1),k>2&&N.push("...");for(let T=k;T<=M;T++)N.push(T);M<p-1&&N.push("..."),p>1&&N.push(p)}return N},[t,p,m,r]),E=N=>{N<1||N===t||m&&N>p||n(N)},S=()=>{t>1&&n(t-1)},w=()=>{y&&n(t+1)};return h.jsxs(I,{className:`pagination ${l}`,style:c,role:"navigation","aria-label":Hr("common.pagination"),id:f,...g,children:[b&&h.jsx(oe,{onClick:()=>E(1),disabled:t===1,className:"pagination-btn","aria-label":Hr("common.first_page"),children:"«"}),h.jsx(oe,{onClick:S,disabled:t===1,className:"pagination-btn","aria-label":Hr("common.prev_page"),children:d||h.jsx(h.Fragment,{children:"‹"})}),h.jsxs(I,{className:"pagination",children:[!m&&h.jsx(Q,{className:"px-3 py-1 text-sm text-gray-700 dark:text-gray-300",children:t}),x.map((N,C)=>{if(N==="...")return h.jsx(Q,{className:"pagination-ellipsis",children:"..."},`ellipsis-${C}`);const k=N,M=k===t;return h.jsx(oe,{onClick:()=>E(k),className:M?"pagination-btn-active":"pagination-btn","aria-label":Hr("common.page_n",{n:k}),"aria-current":M?"page":void 0,children:k},k)})]}),h.jsx(oe,{onClick:w,disabled:!y,className:"pagination-btn","aria-label":Hr("common.next_page"),children:u||h.jsx(h.Fragment,{children:"›"})}),_&&h.jsx(oe,{onClick:()=>E(p),disabled:t===p,className:"pagination-btn","aria-label":Hr("common.last_page"),children:"»"})]})},Dd=(t,e)=>window.G7Core?.t?.(t,e)??t,gb=()=>window.G7Core?.locale?.supported?.()??["ko","en"],pb=()=>window.G7Core?.locale?.current?.()??"ko",Id=t=>{const e=Dd(`common.language_${t}`);return e===`common.language_${t}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[t]||t.toUpperCase():e},mb=()=>gb().map(e=>({code:e,name:Id(e),nativeName:Id(e)})),ja=({value:t={},onChange:e,inputType:n="text",layout:r="inline",availableLocales:s,defaultLocale:o,placeholder:i="",required:a=!1,disabled:l=!1,maxLength:c,rows:d=4,className:u="",name:f="multilingual_input",showCodeOnMobile:g=!1,error:m,id:p,editorAttrs:y})=>{const b=!!m,_=v.useMemo(()=>s??mb(),[s]),x=v.useMemo(()=>o??pb(),[o]),E=v.useRef(t),[S,w]=v.useState(t),N=v.useRef(JSON.stringify(t));v.useEffect(()=>{const Y=JSON.stringify(t);Y!==N.current&&(N.current=Y,E.current=t,w(t))},[t]);const C=v.useCallback((Y,Z)=>{const ee={target:{name:f,value:Y}};Z&&(ee._changedKeys=Z),e?.(ee)},[e,f]),[k,M]=v.useState(()=>{if(r==="tabs"||r==="compact"){const ee=_.map(ce=>ce.code);return[x,...ee.filter(ce=>ce!==x)]}const Y=Object.keys(t).filter(ee=>t[ee]!==void 0);if(Y.length===0)return[x];const Z=[];return Y.includes(x)&&Z.push(x),Y.forEach(ee=>{ee!==x&&Z.push(ee)}),Z}),[T,L]=v.useState(x),P=v.useMemo(()=>_.filter(Y=>!k.includes(Y.code)),[_,k]),[F,D]=v.useState(!1);v.useEffect(()=>{if(r==="tabs"||r==="compact"){const ce=_.map(ae=>ae.code),J=[x,...ce.filter(ae=>ae!==x)],he=k.join(","),le=J.join(",");he!==le&&M(J);return}const Y=Object.keys(t).filter(ce=>t[ce]!==void 0);if(Y.length===0){M([x]);return}const Z=[];Y.includes(x)&&Z.push(x),Y.forEach(ce=>{ce!==x&&Z.push(ce)});const ee=k.join(","),te=Z.join(",");ee!==te&&M(Z)},[t,x,r,_]);const A=v.useCallback((Y,Z)=>{const ee={...E.current,[Y]:Z};E.current=ee,w(ee),C(ee,[Y])},[C]),O=v.useCallback(Y=>{M(ee=>[...ee,Y]),L(Y),D(!1);const Z={...E.current,[Y]:""};E.current=Z,w(Z),C(Z)},[C]),V=v.useCallback(Y=>{if(Y===x)return;M(ee=>ee.filter(te=>te!==Y)),T===Y&&L(x);const Z={...E.current};delete Z[Y],E.current=Z,w(Z),C(Z)},[T,x,C]),H=v.useCallback(Y=>{const Z=_.find(ee=>ee.code===Y);return Z?.nativeName||Z?.name||Y.toUpperCase()},[_]),W=v.useCallback(Y=>!!S[Y]?.trim(),[S]),j=v.useCallback(()=>P.length===0?null:h.jsxs(I,{className:"relative",children:[h.jsxs(oe,{type:"button",className:"inline-flex items-center gap-1 px-3 py-1 text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/50 rounded-full border border-dashed border-blue-300 dark:border-blue-600 transition-colors",onClick:()=>D(!F),disabled:l,children:[h.jsx(re,{name:"plus",className:"w-3 h-3"}),h.jsx(Q,{children:Dd("common.add_language")})]}),F&&h.jsx(I,{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-10 min-w-[120px]",children:P.map(Y=>h.jsxs(oe,{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 first:rounded-t-lg last:rounded-b-lg transition-colors",onClick:()=>O(Y.code),children:[h.jsx(re,{name:"globe",className:"w-3.5 h-3.5 text-gray-400 dark:text-gray-500"}),h.jsx(Q,{children:Y.nativeName||Y.name})]},Y.code))})]}),[P,F,l,O]),U=v.useCallback((Y,Z=!1)=>{const ee=b?"input input-error":"input",te=b?"textarea input-error":"textarea",ce=Y===x,J=`${i}${i?" (":""}${H(Y)}${i?")":""}`;return h.jsxs(I,{className:"space-y-2",children:[h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsxs(Q,{className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium
|
||
${ce?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}
|
||
`,children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),H(Y),ce&&h.jsx(Q,{className:"text-red-500 dark:text-red-400",children:"*"}),!ce&&h.jsx(oe,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",onClick:()=>V(Y),disabled:l,children:h.jsx(re,{name:"xmark",className:"w-3 h-3"})})]}),ce&&Z&&j()]}),n==="textarea"?h.jsx(Rn,{name:`${f}[${Y}]`,value:S[Y]||"",onChange:he=>A(Y,he.target.value),placeholder:J,required:a&&ce,disabled:l,maxLength:c,rows:d,className:`${te} resize-vertical`}):h.jsx(wt,{type:"text",name:`${f}[${Y}]`,value:S[Y]||"",onChange:he=>A(Y,he.target.value),placeholder:J,required:a&&ce,disabled:l,maxLength:c,className:ee})]},Y)},[f,S,A,i,a,l,c,d,n,H,x,V,j,b]),B=v.useCallback(Y=>{const Z=b?"input input-error":"input",ee=b?"textarea input-error":"textarea",te=`${i}${i?" (":""}${H(Y)}${i?")":""}`;return h.jsx(I,{children:n==="textarea"?h.jsx(Rn,{name:`${f}[${Y}]`,value:S[Y]||"",onChange:ce=>A(Y,ce.target.value),placeholder:te,required:a&&Y===x,disabled:l,maxLength:c,rows:d,className:`${ee} resize-vertical`}):h.jsx(wt,{type:"text",name:`${f}[${Y}]`,value:S[Y]||"",onChange:ce=>A(Y,ce.target.value),placeholder:te,required:a&&Y===x,disabled:l,maxLength:c,className:Z})},Y)},[f,S,A,i,a,l,c,d,n,x,H,b]),G=()=>h.jsx(I,{className:u,children:h.jsx(I,{className:"space-y-4",children:k.map((Y,Z)=>U(Y,Z===0))})}),z=()=>h.jsxs(I,{className:u,children:[h.jsxs(I,{className:"flex flex-wrap items-center gap-2 mb-3",children:[k.map(Y=>h.jsxs(oe,{type:"button",className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all
|
||
${T===Y?Y===x?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":Y===x?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
`,onClick:()=>L(Y),children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),g?h.jsxs(h.Fragment,{children:[h.jsx(Q,{className:"hidden md:inline",children:H(Y)}),h.jsx(Q,{className:"inline md:hidden",children:Y.toUpperCase()})]}):H(Y),Y===x&&h.jsx(Q,{className:"text-red-500 dark:text-red-400",children:"*"}),W(Y)&&T!==Y&&h.jsx(re,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"}),Y!==x&&h.jsx(oe,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors",onClick:Z=>{Z.stopPropagation(),V(Y)},disabled:l,children:h.jsx(re,{name:"xmark",className:"w-3 h-3"})})]},Y)),j()]}),k.map(Y=>h.jsx(I,{className:T===Y?"block":"hidden",children:B(Y)},Y))]}),X=()=>{const Y=b?"input input-error":"input",Z=b?"textarea input-error":"textarea";return h.jsx(I,{className:u,children:h.jsxs(I,{className:"flex items-center gap-1",children:[h.jsx(I,{className:"flex items-center shrink-0",children:k.map(ee=>h.jsxs(oe,{type:"button",className:`
|
||
px-2 py-1.5 text-xs font-medium border-y border-l first:rounded-l last:rounded-r last:border-r transition-colors
|
||
${T===ee?"bg-blue-500 text-white border-blue-500 dark:bg-blue-600 dark:border-blue-600":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700"}
|
||
`,onClick:()=>L(ee),title:H(ee),children:[ee.toUpperCase(),ee===x&&h.jsx(Q,{className:"text-red-400 ml-0.5",children:"*"})]},ee))}),h.jsx(I,{className:"flex-1 min-w-0",children:n==="textarea"?h.jsx(Rn,{name:`${f}[${T}]`,value:S[T]||"",onChange:ee=>A(T,ee.target.value),placeholder:i,required:a&&T===x,disabled:l,maxLength:c,rows:d,className:Z}):h.jsx(wt,{type:"text",name:`${f}[${T}]`,value:S[T]||"",onChange:ee=>A(T,ee.target.value),placeholder:i,required:a&&T===x,disabled:l,maxLength:c,className:Y})})]})})};return h.jsxs(I,{className:l?"opacity-50 cursor-not-allowed":void 0,id:p,...y,children:[r==="compact"?X():r==="tabs"?z():G(),b&&m&&h.jsx(Q,{className:"text-xs text-red-500 dark:text-red-400 mt-1 block",children:m})]})};ja.displayName="MultilingualInput";const bb=()=>window.G7Core,Wa=({checked:t,value:e,onChange:n,disabled:r=!1,label:s,description:o,size:i="md",className:a="",name:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(()=>t??e??!1);v.useEffect(()=>{f(t??e??!1)},[t,e]);const g=_=>{const x=_.target.checked;f(x),n&&!r&&n(_)},p={sm:{track:"w-9 h-5",thumb:"after:h-4 after:w-4"},md:{track:"w-11 h-6",thumb:"after:h-5 after:w-5"},lg:{track:"w-14 h-7",thumb:"after:h-6 after:w-6"}}[i],y=()=>{if(!r){const _=!u;if(f(_),n){const x=bb();x?.createChangeEvent&&n(x.createChangeEvent({checked:_,name:l}))}}},b=_=>{r||_.key!==" "&&_.key!=="Enter"&&_.key!=="Spacebar"||(_.preventDefault(),y())};return h.jsxs("div",{className:`toggle-container ${a}`,id:c,...d,children:[h.jsxs("div",{className:`toggle-switch-wrapper ${r?"cursor-not-allowed opacity-50":"cursor-pointer"}`,role:"switch","aria-checked":u,"aria-disabled":r||void 0,"aria-label":s??l,tabIndex:r?-1:0,onKeyDown:b,onClick:_=>{_.preventDefault(),_.stopPropagation(),y()},children:[h.jsx("input",{type:"checkbox",id:l,name:l,checked:u,onChange:g,disabled:r,className:"sr-only peer",tabIndex:-1}),h.jsx("div",{className:`toggle-switch-track ${p.track} ${p.thumb}`})]}),s&&h.jsx("span",{className:`toggle-label ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:y,children:s}),o&&h.jsx("p",{className:"toggle-description",children:o})]})},Fo=({status:t,label:e,showIcon:n=!0,iconName:r,className:s="",style:o,id:i,editorAttrs:a})=>{const l={success:"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 border-green-200 dark:border-green-800",warning:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800",error:"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400 border-red-200 dark:border-red-800",info:"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-400 border-blue-200 dark:border-blue-800",pending:"bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-200 dark:border-gray-600",default:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-600"},c={success:de.CheckCircle,warning:de.ExclamationTriangle,error:de.XCircle,info:de.InfoCircle,pending:de.Clock,default:de.QuestionCircle},d={success:"성공",warning:"경고",error:"오류",info:"정보",pending:"대기 중",default:"기본"},u=r||c[t],f=e||d[t],g=l[t];return h.jsxs(Q,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border ${g} ${s}`,style:o,id:i,...a,children:[n&&h.jsx(re,{name:u,className:"w-4 h-4"}),h.jsx(Q,{children:f})]})},Ld={blue:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",green:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",red:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",gray:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",yellow:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",orange:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",teal:"bg-teal-100 text-teal-800 dark:bg-teal-900/30 dark:text-teal-300",cyan:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-300"},yb={success:"green",warning:"yellow",danger:"red",error:"red",info:"blue",primary:"blue",secondary:"gray",text:"gray",default:"gray"},Pd={sm:"px-1.5 py-0.5 text-[10px]",md:"px-2 py-0.5 text-xs",lg:"px-2.5 py-1 text-sm"},$d=({color:t,variant:e,text:n,size:r="md",className:s="",style:o,children:i,id:a,editorAttrs:l})=>{const c=t||(e?yb[e]:void 0)||"gray",d=Ld[c]||Ld.gray,u=Pd[r]||Pd.md;return h.jsxs(Q,{className:`inline-flex items-center rounded-full font-medium ${u} ${d} ${s}`,style:o,id:a,...l,children:[n,i]})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:Fd,setPrototypeOf:Vd,isFrozen:vb,getPrototypeOf:xb,getOwnPropertyDescriptor:wb}=Object;let{freeze:Xt,seal:un,create:zd}=Object,{apply:Ga,construct:Ya}=typeof Reflect<"u"&&Reflect;Xt||(Xt=function(e){return e}),un||(un=function(e){return e}),Ga||(Ga=function(e,n,r){return e.apply(n,r)}),Ya||(Ya=function(e,n){return new e(...n)});const Vo=an(Array.prototype.forEach),Hd=an(Array.prototype.pop),Ss=an(Array.prototype.push),zo=an(String.prototype.toLowerCase),Xa=an(String.prototype.toString),Ud=an(String.prototype.match),_s=an(String.prototype.replace),kb=an(String.prototype.indexOf),Cb=an(String.prototype.trim),Sn=an(Object.prototype.hasOwnProperty),Kt=an(RegExp.prototype.test),Es=Sb(TypeError);function an(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return Ga(t,e,r)}}function Sb(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ya(t,n)}}function je(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zo;Vd&&Vd(t,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const o=n(s);o!==s&&(vb(e)||(e[r]=o),s=o)}t[s]=!0}return t}function _b(t){for(let e=0;e<t.length;e++)Sn(t,e)||(t[e]=null);return t}function gr(t){const e=zd(null);for(const[n,r]of Fd(t))Sn(t,n)&&(Array.isArray(r)?e[n]=_b(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=gr(r):e[n]=r);return e}function Ms(t,e){for(;t!==null;){const r=wb(t,e);if(r){if(r.get)return an(r.get);if(typeof r.value=="function")return an(r.value)}t=xb(t)}function n(){return null}return n}const Bd=Xt(["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","section","select","shadow","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"]),Ka=Xt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qa=Xt(["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"]),Eb=Xt(["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"]),Za=Xt(["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"]),Mb=Xt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),jd=Xt(["#text"]),Wd=Xt(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Qa=Xt(["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","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"]),Gd=Xt(["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"]),Ho=Xt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Nb=un(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ob=un(/<%[\w\W]*|[\w\W]*%>/gm),Tb=un(/\${[\w\W]*}/gm),Ab=un(/^data-[\-\w.\u00B7-\uFFFF]/),Db=un(/^aria-[\-\w]+$/),Yd=un(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ib=un(/^(?:\w+script|data):/i),Lb=un(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xd=un(/^html$/i),Pb=un(/^[a-z][.\w]*(-[.\w]+)+$/i);var Kd=Object.freeze({__proto__:null,MUSTACHE_EXPR:Nb,ERB_EXPR:Ob,TMPLIT_EXPR:Tb,DATA_ATTR:Ab,ARIA_ATTR:Db,IS_ALLOWED_URI:Yd,IS_SCRIPT_OR_DATA:Ib,ATTR_WHITESPACE:Lb,DOCTYPE_NAME:Xd,CUSTOM_ELEMENT:Pb});const Ns={element:1,text:3,progressingInstruction:7,comment:8,document:9},$b=function(){return typeof window>"u"?null:window},Fb=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function qd(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$b();const e=ke=>qd(ke);if(e.version="3.1.7",e.removed=[],!t||!t.document||t.document.nodeType!==Ns.document)return e.isSupported=!1,e;let{document:n}=t;const r=n,s=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:i,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:g}=t,m=l.prototype,p=Ms(m,"cloneNode"),y=Ms(m,"remove"),b=Ms(m,"nextSibling"),_=Ms(m,"childNodes"),x=Ms(m,"parentNode");if(typeof i=="function"){const ke=n.createElement("template");ke.content&&ke.content.ownerDocument&&(n=ke.content.ownerDocument)}let E,S="";const{implementation:w,createNodeIterator:N,createDocumentFragment:C,getElementsByTagName:k}=n,{importNode:M}=r;let T={};e.isSupported=typeof Fd=="function"&&typeof x=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:L,ERB_EXPR:P,TMPLIT_EXPR:F,DATA_ATTR:D,ARIA_ATTR:A,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:H}=Kd;let{IS_ALLOWED_URI:W}=Kd,j=null;const U=je({},[...Bd,...Ka,...qa,...Za,...jd]);let B=null;const G=je({},[...Wd,...Qa,...Gd,...Ho]);let z=Object.seal(zd(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}})),X=null,Y=null,Z=!0,ee=!0,te=!1,ce=!0,J=!1,he=!0,le=!1,ae=!1,Se=!1,ue=!1,pe=!1,we=!1,He=!0,se=!1;const Oe="user-content-";let Le=!0,Ie=!1,Ue={},et=null;const bt=je({},["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 Ge=null;const ft=je({},["audio","video","img","source","image","track"]);let Be=null;const ne=je({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",xe="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let be=ge,Ve=!1,De=null;const $e=je({},[fe,xe,ge],Xa);let Me=null;const qe=["application/xhtml+xml","text/html"],ot="text/html";let ye=null,Ce=null;const Fe=n.createElement("form"),nt=function(K){return K instanceof RegExp||K instanceof Function},pt=function(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ce&&Ce===K)){if((!K||typeof K!="object")&&(K={}),K=gr(K),Me=qe.indexOf(K.PARSER_MEDIA_TYPE)===-1?ot:K.PARSER_MEDIA_TYPE,ye=Me==="application/xhtml+xml"?Xa:zo,j=Sn(K,"ALLOWED_TAGS")?je({},K.ALLOWED_TAGS,ye):U,B=Sn(K,"ALLOWED_ATTR")?je({},K.ALLOWED_ATTR,ye):G,De=Sn(K,"ALLOWED_NAMESPACES")?je({},K.ALLOWED_NAMESPACES,Xa):$e,Be=Sn(K,"ADD_URI_SAFE_ATTR")?je(gr(ne),K.ADD_URI_SAFE_ATTR,ye):ne,Ge=Sn(K,"ADD_DATA_URI_TAGS")?je(gr(ft),K.ADD_DATA_URI_TAGS,ye):ft,et=Sn(K,"FORBID_CONTENTS")?je({},K.FORBID_CONTENTS,ye):bt,X=Sn(K,"FORBID_TAGS")?je({},K.FORBID_TAGS,ye):{},Y=Sn(K,"FORBID_ATTR")?je({},K.FORBID_ATTR,ye):{},Ue=Sn(K,"USE_PROFILES")?K.USE_PROFILES:!1,Z=K.ALLOW_ARIA_ATTR!==!1,ee=K.ALLOW_DATA_ATTR!==!1,te=K.ALLOW_UNKNOWN_PROTOCOLS||!1,ce=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,J=K.SAFE_FOR_TEMPLATES||!1,he=K.SAFE_FOR_XML!==!1,le=K.WHOLE_DOCUMENT||!1,ue=K.RETURN_DOM||!1,pe=K.RETURN_DOM_FRAGMENT||!1,we=K.RETURN_TRUSTED_TYPE||!1,Se=K.FORCE_BODY||!1,He=K.SANITIZE_DOM!==!1,se=K.SANITIZE_NAMED_PROPS||!1,Le=K.KEEP_CONTENT!==!1,Ie=K.IN_PLACE||!1,W=K.ALLOWED_URI_REGEXP||Yd,be=K.NAMESPACE||ge,z=K.CUSTOM_ELEMENT_HANDLING||{},K.CUSTOM_ELEMENT_HANDLING&&nt(K.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=K.CUSTOM_ELEMENT_HANDLING.tagNameCheck),K.CUSTOM_ELEMENT_HANDLING&&nt(K.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=K.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),K.CUSTOM_ELEMENT_HANDLING&&typeof K.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=K.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),J&&(ee=!1),pe&&(ue=!0),Ue&&(j=je({},jd),B=[],Ue.html===!0&&(je(j,Bd),je(B,Wd)),Ue.svg===!0&&(je(j,Ka),je(B,Qa),je(B,Ho)),Ue.svgFilters===!0&&(je(j,qa),je(B,Qa),je(B,Ho)),Ue.mathMl===!0&&(je(j,Za),je(B,Gd),je(B,Ho))),K.ADD_TAGS&&(j===U&&(j=gr(j)),je(j,K.ADD_TAGS,ye)),K.ADD_ATTR&&(B===G&&(B=gr(B)),je(B,K.ADD_ATTR,ye)),K.ADD_URI_SAFE_ATTR&&je(Be,K.ADD_URI_SAFE_ATTR,ye),K.FORBID_CONTENTS&&(et===bt&&(et=gr(et)),je(et,K.FORBID_CONTENTS,ye)),Le&&(j["#text"]=!0),le&&je(j,["html","head","body"]),j.table&&(je(j,["tbody"]),delete X.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw Es('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Es('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=K.TRUSTED_TYPES_POLICY,S=E.createHTML("")}else E===void 0&&(E=Fb(g,s)),E!==null&&typeof S=="string"&&(S=E.createHTML(""));Xt&&Xt(K),Ce=K}},it=je({},["mi","mo","mn","ms","mtext"]),rt=je({},["annotation-xml"]),Ot=je({},["title","style","font","a","script"]),ht=je({},[...Ka,...qa,...Eb]),Qt=je({},[...Za,...Mb]),Gt=function(K){let ie=x(K);(!ie||!ie.tagName)&&(ie={namespaceURI:be,tagName:"template"});const ve=zo(K.tagName),st=zo(ie.tagName);return De[K.namespaceURI]?K.namespaceURI===xe?ie.namespaceURI===ge?ve==="svg":ie.namespaceURI===fe?ve==="svg"&&(st==="annotation-xml"||it[st]):!!ht[ve]:K.namespaceURI===fe?ie.namespaceURI===ge?ve==="math":ie.namespaceURI===xe?ve==="math"&&rt[st]:!!Qt[ve]:K.namespaceURI===ge?ie.namespaceURI===xe&&!rt[st]||ie.namespaceURI===fe&&!it[st]?!1:!Qt[ve]&&(Ot[ve]||!ht[ve]):!!(Me==="application/xhtml+xml"&&De[K.namespaceURI]):!1},mt=function(K){Ss(e.removed,{element:K});try{x(K).removeChild(K)}catch{y(K)}},St=function(K,ie){try{Ss(e.removed,{attribute:ie.getAttributeNode(K),from:ie})}catch{Ss(e.removed,{attribute:null,from:ie})}if(ie.removeAttribute(K),K==="is"&&!B[K])if(ue||pe)try{mt(ie)}catch{}else try{ie.setAttribute(K,"")}catch{}},xn=function(K){let ie=null,ve=null;if(Se)K="<remove></remove>"+K;else{const _t=Ud(K,/^[\r\n\t ]+/);ve=_t&&_t[0]}Me==="application/xhtml+xml"&&be===ge&&(K='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+K+"</body></html>");const st=E?E.createHTML(K):K;if(be===ge)try{ie=new f().parseFromString(st,Me)}catch{}if(!ie||!ie.documentElement){ie=w.createDocument(be,"template",null);try{ie.documentElement.innerHTML=Ve?S:st}catch{}}const Tt=ie.body||ie.documentElement;return K&&ve&&Tt.insertBefore(n.createTextNode(ve),Tt.childNodes[0]||null),be===ge?k.call(ie,le?"html":"body")[0]:le?ie.documentElement:Tt},Vt=function(K){return N.call(K.ownerDocument||K,K,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ze=function(K){return K instanceof u&&(typeof K.nodeName!="string"||typeof K.textContent!="string"||typeof K.removeChild!="function"||!(K.attributes instanceof d)||typeof K.removeAttribute!="function"||typeof K.setAttribute!="function"||typeof K.namespaceURI!="string"||typeof K.insertBefore!="function"||typeof K.hasChildNodes!="function")},jn=function(K){return typeof a=="function"&&K instanceof a},dn=function(K,ie,ve){T[K]&&Vo(T[K],st=>{st.call(e,ie,ve,Ce)})},Io=function(K){let ie=null;if(dn("beforeSanitizeElements",K,null),Ze(K))return mt(K),!0;const ve=ye(K.nodeName);if(dn("uponSanitizeElement",K,{tagName:ve,allowedTags:j}),K.hasChildNodes()&&!jn(K.firstElementChild)&&Kt(/<[/\w]/g,K.innerHTML)&&Kt(/<[/\w]/g,K.textContent)||K.nodeType===Ns.progressingInstruction||he&&K.nodeType===Ns.comment&&Kt(/<[/\w]/g,K.data))return mt(K),!0;if(!j[ve]||X[ve]){if(!X[ve]&&Da(ve)&&(z.tagNameCheck instanceof RegExp&&Kt(z.tagNameCheck,ve)||z.tagNameCheck instanceof Function&&z.tagNameCheck(ve)))return!1;if(Le&&!et[ve]){const st=x(K)||K.parentNode,Tt=_(K)||K.childNodes;if(Tt&&st){const _t=Tt.length;for(let Yt=_t-1;Yt>=0;--Yt){const wn=p(Tt[Yt],!0);wn.__removalCount=(K.__removalCount||0)+1,st.insertBefore(wn,b(K))}}}return mt(K),!0}return K instanceof l&&!Gt(K)||(ve==="noscript"||ve==="noembed"||ve==="noframes")&&Kt(/<\/no(script|embed|frames)/i,K.innerHTML)?(mt(K),!0):(J&&K.nodeType===Ns.text&&(ie=K.textContent,Vo([L,P,F],st=>{ie=_s(ie,st," ")}),K.textContent!==ie&&(Ss(e.removed,{element:K.cloneNode()}),K.textContent=ie)),dn("afterSanitizeElements",K,null),!1)},Lo=function(K,ie,ve){if(He&&(ie==="id"||ie==="name")&&(ve in n||ve in Fe))return!1;if(!(ee&&!Y[ie]&&Kt(D,ie))){if(!(Z&&Kt(A,ie))){if(!B[ie]||Y[ie]){if(!(Da(K)&&(z.tagNameCheck instanceof RegExp&&Kt(z.tagNameCheck,K)||z.tagNameCheck instanceof Function&&z.tagNameCheck(K))&&(z.attributeNameCheck instanceof RegExp&&Kt(z.attributeNameCheck,ie)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(ie))||ie==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Kt(z.tagNameCheck,ve)||z.tagNameCheck instanceof Function&&z.tagNameCheck(ve))))return!1}else if(!Be[ie]){if(!Kt(W,_s(ve,V,""))){if(!((ie==="src"||ie==="xlink:href"||ie==="href")&&K!=="script"&&kb(ve,"data:")===0&&Ge[K])){if(!(te&&!Kt(O,_s(ve,V,"")))){if(ve)return!1}}}}}}return!0},Da=function(K){return K!=="annotation-xml"&&Ud(K,H)},Ia=function(K){dn("beforeSanitizeAttributes",K,null);const{attributes:ie}=K;if(!ie)return;const ve={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B};let st=ie.length;for(;st--;){const Tt=ie[st],{name:_t,namespaceURI:Yt,value:wn}=Tt,Pr=ye(_t);let q=_t==="value"?wn:Cb(wn);if(ve.attrName=Pr,ve.attrValue=q,ve.keepAttr=!0,ve.forceKeepAttr=void 0,dn("uponSanitizeAttribute",K,ve),q=ve.attrValue,ve.forceKeepAttr||(St(_t,K),!ve.keepAttr))continue;if(!ce&&Kt(/\/>/i,q)){St(_t,K);continue}J&&Vo([L,P,F],Te=>{q=_s(q,Te," ")});const me=ye(K.nodeName);if(Lo(me,Pr,q)){if(se&&(Pr==="id"||Pr==="name")&&(St(_t,K),q=Oe+q),he&&Kt(/((--!?|])>)|<\/(style|title)/i,q)){St(_t,K);continue}if(E&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Yt)switch(g.getAttributeType(me,Pr)){case"TrustedHTML":{q=E.createHTML(q);break}case"TrustedScriptURL":{q=E.createScriptURL(q);break}}try{Yt?K.setAttributeNS(Yt,_t,q):K.setAttribute(_t,q),Ze(K)?mt(K):Hd(e.removed)}catch{}}}dn("afterSanitizeAttributes",K,null)},La=function ke(K){let ie=null;const ve=Vt(K);for(dn("beforeSanitizeShadowDOM",K,null);ie=ve.nextNode();)dn("uponSanitizeShadowNode",ie,null),!Io(ie)&&(ie.content instanceof o&&ke(ie.content),Ia(ie));dn("afterSanitizeShadowDOM",K,null)};return e.sanitize=function(ke){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=null,ve=null,st=null,Tt=null;if(Ve=!ke,Ve&&(ke="<!-->"),typeof ke!="string"&&!jn(ke))if(typeof ke.toString=="function"){if(ke=ke.toString(),typeof ke!="string")throw Es("dirty is not a string, aborting")}else throw Es("toString is not a function");if(!e.isSupported)return ke;if(ae||pt(K),e.removed=[],typeof ke=="string"&&(Ie=!1),Ie){if(ke.nodeName){const wn=ye(ke.nodeName);if(!j[wn]||X[wn])throw Es("root node is forbidden and cannot be sanitized in-place")}}else if(ke instanceof a)ie=xn("<!---->"),ve=ie.ownerDocument.importNode(ke,!0),ve.nodeType===Ns.element&&ve.nodeName==="BODY"||ve.nodeName==="HTML"?ie=ve:ie.appendChild(ve);else{if(!ue&&!J&&!le&&ke.indexOf("<")===-1)return E&&we?E.createHTML(ke):ke;if(ie=xn(ke),!ie)return ue?null:we?S:""}ie&&Se&&mt(ie.firstChild);const _t=Vt(Ie?ke:ie);for(;st=_t.nextNode();)Io(st)||(st.content instanceof o&&La(st.content),Ia(st));if(Ie)return ke;if(ue){if(pe)for(Tt=C.call(ie.ownerDocument);ie.firstChild;)Tt.appendChild(ie.firstChild);else Tt=ie;return(B.shadowroot||B.shadowrootmode)&&(Tt=M.call(r,Tt,!0)),Tt}let Yt=le?ie.outerHTML:ie.innerHTML;return le&&j["!doctype"]&&ie.ownerDocument&&ie.ownerDocument.doctype&&ie.ownerDocument.doctype.name&&Kt(Xd,ie.ownerDocument.doctype.name)&&(Yt="<!DOCTYPE "+ie.ownerDocument.doctype.name+`>
|
||
`+Yt),J&&Vo([L,P,F],wn=>{Yt=_s(Yt,wn," ")}),E&&we?E.createHTML(Yt):Yt},e.setConfig=function(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pt(ke),ae=!0},e.clearConfig=function(){Ce=null,ae=!1},e.isValidAttribute=function(ke,K,ie){Ce||pt({});const ve=ye(ke),st=ye(K);return Lo(ve,st,ie)},e.addHook=function(ke,K){typeof K=="function"&&(T[ke]=T[ke]||[],Ss(T[ke],K))},e.removeHook=function(ke){if(T[ke])return Hd(T[ke])},e.removeHooks=function(ke){T[ke]&&(T[ke]=[])},e.removeAllHooks=function(){T={}},e}var Vb=qd();const Ja=({content:t,text:e,isHtml:n=!0,className:r="",purifyConfig:s,id:o,editorAttrs:i})=>{const a=e??t??"";if(!a||a.trim()==="")return null;if(!n){const u=`
|
||
whitespace-pre-wrap
|
||
text-gray-900 dark:text-gray-100
|
||
font-sans
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:u,id:o,...i,children:a})}const l={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"]},c=v.useMemo(()=>{const u=s?{...l,...s,FORBID_TAGS:[...l.FORBID_TAGS,...s.FORBID_TAGS||[]],FORBID_ATTR:[...l.FORBID_ATTR,...s.FORBID_ATTR||[]]}:l;return Vb.sanitize(a,u).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,m,p,y)=>(p.startsWith("http://")||p.startsWith("https://"))&&!g.includes("rel=")?`<a ${m}href="${p}"${y} rel="noopener noreferrer">`:g)},[a,s]),d=`
|
||
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
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:d,dangerouslySetInnerHTML:{__html:c},id:o,...i})},Uo=window.G7Core?.createLogger?.("Comp:DataGrid")??{log:(...t)=>console.log("[Comp:DataGrid]",...t),warn:(...t)=>console.warn("[Comp:DataGrid]",...t),error:(...t)=>console.error("[Comp:DataGrid]",...t)},Ur=(t,e)=>window.G7Core?.t?.(t,e)??t,zb={Div:I,Span:Q,Button:oe,Icon:re,Checkbox:Cn,P:yt,A:Fr,Label:on,Input:wt,H1:Pa,H2:er,H3:$r,H4:Od,Img:kn,Select:Vr,Textarea:Rn,Table:za,Thead:Ha,Tbody:Ua,Tfoot:Ba,Tr:tr,Th:zr,Td:Jt,MultilingualInput:ja,Toggle:Wa,StatusBadge:Fo,Badge:$d,HtmlContent:Ja,ActionMenu:Cs},Ra=()=>{const t=window.G7Core?.getComponentMap?.();return t&&Object.keys(t).length>0?t:zb},el=t=>{if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.map(e=>el(e)).join(", ");if(typeof t=="object"){if(v.isValidElement(t))return t;if(Object.keys(t).length===0)return"";try{return JSON.stringify(t)}catch{return Uo.warn("객체를 문자열로 변환할 수 없습니다:",t),"[Object]"}}return String(t)},Zd=(t,e)=>{if(!t)return!0;const n=window.G7Core;return typeof n?.evaluateCondition=="function"?n.evaluateCondition(t,{row:e,item:e,$item:e}):(Uo.warn("G7Core.evaluateCondition 미노출 — subRow 조건을 평가할 수 없습니다:",t),!0)},Br=(t,e,n,r="",s)=>{const o=window.G7Core;if(o?.renderItemChildren){const i={row:e,value:n,$value:n};return o.renderItemChildren(t,i,Ra(),r,s?{componentContext:s}:void 0)}return Uo.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},Qd=(t,e,n)=>t?!t.includes("{{")&&!t.includes("$t:")?t:Br([{type:"basic",name:"Span",text:t}],{},null,e,n):"",tl=(t,e,n="",r)=>{const s=window.G7Core;if(s?.renderItemChildren){const o={row:e,$value:e};return s.renderItemChildren(t,o,Ra(),n,r?{componentContext:r}:void 0)}return Uo.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},Hb=({id:t,columns:e,data:n,sortable:r=!0,pagination:s=!1,pageSize:o=10,onRowClick:i,className:a="",style:l,sortField:c,sortDirection:d,onSortChange:u,selectable:f=!1,selectedIds:g=[],onSelectionChange:m,idField:p="id",selectionScope:y="free",showColumnSelector:b=!1,visibleColumns:_,onColumnVisibilityChange:x,responsiveBreakpoint:E=768,cardRenderer:S,rowActions:w,onRowAction:N,alwaysShowPagination:C=!1,serverSidePagination:k=!1,serverCurrentPage:M,serverTotalPages:T,serverHasMorePages:L,onPageChange:P,prevText:F,nextText:D,columnSelectorText:A,emptyMessage:O,actionsColumnHeader:V,requiredText:H,selectedCountText:W,showFirstLast:j=!0,expandable:U=!1,expandedRowIds:B,onExpandChange:G,expandChildren:z,expandedRowRender:X,expandColumnWidth:Y="48px",expandIconExpanded:Z=de.ChevronDown,expandIconCollapsed:ee=de.ChevronRight,expandConditionField:te,dynamicColumns:ce,dynamicColumnsInsertAfter:J,expandContext:he,__componentContext:le,subRowChildren:ae,subRowCondition:Se,subRowClassName:ue="px-6 py-2 bg-gray-50 dark:bg-gray-900",subRowRender:pe,footerCells:we,footerClassName:He="bg-gray-50 dark:bg-gray-800/50 font-medium",footerCardChildren:se,editorAttrs:Oe})=>{const Le=F||void 0,Ie=D||void 0,Ue=A??Ur("common.column_selector"),et=O??Ur("common.no_data"),bt=V??Ur("common.actions"),Ge=H??Ur("common.required"),ft=W??Ur("common.selected_count"),Be=q=>W===void 0?Ur("common.selected_count",{count:q}):W.replace(/\{\{count\}\}/g,String(q)).replace(/\{count\}/g,String(q)),ne=window.G7Core,fe=ne?.useControllableState,xe=ne?.shallowArrayEqual,[ge,be]=fe?fe(c,null):[c??null,()=>{}],[Ve,De]=fe?fe(d,"asc"):[d??"asc",()=>{}],[$e,Me]=v.useState(1),[qe,ot]=fe?fe(B,[],G,{isEqual:xe}):[B??[],()=>{}],[ye,Ce]=v.useState(!1),Fe=v.useRef(null),nt=ne?.useResponsive,pt=nt?.(),it=pt?pt.width<E:typeof window<"u"&&window.innerWidth<E,rt=v.useMemo(()=>{if(!ce||!Array.isArray(ce)||ce.length===0)return e;if(J){const q=e.findIndex(me=>me.field===J);if(q!==-1)return[...e.slice(0,q+1),...ce,...e.slice(q+1)]}return[...e,...ce]},[e,ce,J]),[Ot,ht]=v.useState(()=>_&&_.length>0?_:e.filter(q=>!q.hidden).map(q=>q.field));v.useEffect(()=>{_&&_.length>0&&ht(_)},[_]);const Qt=v.useRef("");v.useEffect(()=>{const q=e.map(me=>me.field).join(",");Qt.current&&q!==Qt.current&&(!_||_.length===0)&&ht(e.filter(me=>!me.hidden).map(me=>me.field)),Qt.current=q},[e,_]);const Gt=v.useRef([]),mt=v.useRef(null);v.useEffect(()=>{if(ce&&ce.length>0){const q=ce.map(ct=>ct.field);if(mt.current===null&&(mt.current=_!==void 0&&_.length>0,mt.current)){Gt.current=q;return}const me=Gt.current,Te=q.filter(ct=>!me.includes(ct));if(Te.length>0){const ct=Te.filter(ze=>!Ot.includes(ze));if(ct.length>0){const ze=[...Ot,...ct];ht(ze),x?.(ze)}}Gt.current=q}},[ce]),v.useEffect(()=>{k||Me(1)},[n,k]),v.useEffect(()=>{const q=me=>{Fe.current&&!Fe.current.contains(me.target)&&Ce(!1)};return ye&&document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[ye]);const St=v.useMemo(()=>!b&&(!_||_.length===0)?rt.filter(q=>!q.hidden):rt.filter(q=>Ot.includes(q.field)),[rt,Ot,b,_]),xn=r&&!(k&&!u),Vt=v.useMemo(()=>!ge||!r||!n?n||[]:u||k?n:[...n].sort((q,me)=>{const Te=q[ge],ct=me[ge];if(Te===ct)return 0;const ze=Te>ct?1:-1;return Ve==="asc"?ze:-ze}),[n,ge,Ve,r,u,k]),Ze=v.useMemo(()=>{if(k||!s)return Vt;const q=($e-1)*o,me=q+o;return Vt.slice(q,me)},[Vt,$e,o,s,k]),jn=k?M||1:$e,dn=k?T??null:Math.ceil((Vt?.length||0)/o),Io=C||(dn??0)>1||L===!0||jn>1,Lo=v.useCallback(q=>{k&&P?P(q):Me(q)},[k,P]),Da=q=>{if(!xn||e.find(ct=>ct.field===q)?.sortable===!1)return;const Te=ge===q&&Ve==="asc"?"desc":"asc";be(q),De(Te),u?.(q,Te)},Ia=v.useCallback(()=>{if(!m||!Ze)return;const q=Ze.map(Te=>Te[p]);if(q.every(Te=>g.includes(Te)))m(g.filter(Te=>!q.includes(Te)));else{const Te=[...new Set([...g,...q])];m(Te)}},[Ze,g,m,p]),La=v.useCallback(q=>{m&&(g.includes(q)?m(g.filter(me=>me!==q)):m([...g,q]))},[g,m]);v.useEffect(()=>{if(y!=="page"||!m||g.length===0)return;const q=new Set((Ze??[]).map(Te=>Te[p])),me=g.filter(Te=>q.has(Te));me.length!==g.length&&m(me)},[y,f,Ze,g,m,p]);const ke=v.useCallback(q=>{if(rt.find(ct=>ct.field===q)?.required)return;const Te=Ot.includes(q)?Ot.filter(ct=>ct!==q):[...Ot,q];ht(Te),x?.(Te)},[rt,Ot,x]),K=v.useCallback((q,me)=>{N?.(q,me)},[N]),ie=v.useCallback(q=>w?w.map(me=>{let Te=me.disabled??!1;if(me.disabledField&&!Te){const ct=me.disabledField.split(".");let ze=q;for(const FT of ct)ze=ze?.[FT];ze||(Te=!0)}return{...me,disabled:Te,onClick:()=>K(me.id,q)}}):[],[w,K]),ve=v.useCallback(q=>{if(!te)return!0;const me=q[te];return Array.isArray(me)?me.length>0:!!me},[te]),st=v.useCallback(q=>{const me=qe.includes(q)?qe.filter(Te=>Te!==q):[...qe,q];fe?ot(me):G&&G(me)},[qe,G,fe,ot]),Tt=v.useCallback(q=>qe.includes(q),[qe]),_t=v.useCallback(q=>X?X(q):z&&z.length>0&&ne?.renderExpandContent?ne.renderExpandContent({children:z,row:q,expandContext:he,componentContext:le,componentMap:Ra(),keyPrefix:`expand-${q[p]}`}):null,[X,z,p,he,le,le?.state]),Yt=v.useMemo(()=>!Ze||Ze.length===0?!1:Ze.every(q=>g.includes(q[p])),[Ze,g,p]),wn=v.useMemo(()=>{if(!Ze||Ze.length===0)return!1;const q=Ze.filter(me=>g.includes(me[p])).length;return q>0&&q<Ze.length},[Ze,g,p]),Pr=(q,me)=>{const Te=q[p],ct=Tt(Te);return h.jsxs(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 mb-4",children:[h.jsxs(I,{className:"flex items-start justify-between",children:[U&&ve(q)&&h.jsx(oe,{onClick:()=>st(Te),className:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors mr-2","aria-label":ct?"Collapse card":"Expand card",children:h.jsx(re,{name:ct?Z:ee,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}),f&&h.jsx(Cn,{checked:g.includes(q[p]),onChange:()=>La(q[p]),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded mr-3 mt-1"}),h.jsx(I,{className:"flex-1",children:h.jsx(I,{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:me.map(ze=>h.jsxs(I,{className:"min-w-0",children:[h.jsx(Q,{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase",children:ze.header}),h.jsx(I,{className:"text-sm text-gray-900 dark:text-gray-200 mt-0.5 break-words",children:ze.cellChildren&&ze.cellChildren.length>0?Br(ze.cellChildren,q,q[ze.field],`card-${q[p]}-${ze.field}`,le):ze.render?ze.render(q[ze.field],q):el(q[ze.field])})]},ze.field))})}),w&&w.length>0&&h.jsx(I,{className:"ml-2",children:h.jsx(Cs,{items:ie(q),triggerLabel:"",triggerIconName:de.EllipsisHorizontal})})]}),U&&ct&&ve(q)&&h.jsx(I,{className:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:_t(q)}),(ae&&ae.length>0||pe)&&Zd(Se,q)&&h.jsx(I,{className:ue?`mt-3 ${ue}`:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-700",children:pe?pe(q):tl(ae,q,`card-subrow-${Te}`,le)})]})};return it?h.jsxs(I,{id:t,className:`w-full ${a}`,style:l,...Oe,children:[b&&h.jsx(I,{className:"mb-4 flex justify-end",children:h.jsxs(I,{ref:Fe,className:"relative",children:[h.jsxs(oe,{onClick:()=>Ce(!ye),className:"flex items-center gap-2 px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700",children:[h.jsx(re,{name:de.Cog,className:"w-4 h-4 text-gray-500 dark:text-gray-400"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:Ue})]}),ye&&h.jsx(I,{className:"absolute right-0 z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",children:h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:rt.map(q=>h.jsxs(I,{className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${q.required?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:()=>!q.required&&ke(q.field),children:[h.jsx(Cn,{checked:Ot.includes(q.field),disabled:q.required,onChange:()=>{},className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"}),h.jsxs(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:[q.header,q.required&&h.jsxs(Q,{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:["(",Ge,")"]})]})]},q.field))})})]})}),f&&g.length>0&&ft&&h.jsx(I,{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:Be(g.length)}),h.jsx(I,{id:t?`${t}__body`:void 0,children:Ze&&Ze.length>0?Ze.map((q,me)=>h.jsx(I,{children:S?S(q,St):Pr(q,St)},q[p]||me)):h.jsx(I,{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:et})}),we&&we.length>0&&Ze&&Ze.length>0&&h.jsx(I,{className:`rounded-lg p-4 mt-2 ${He}`,children:se&&se.length>0?Br(se,{},null,"footer-card",le):h.jsx(I,{className:"space-y-1",children:we.filter(q=>q.text||q.children&&q.children.length>0).map((q,me)=>{const Te=St.find(ct=>ct.field===q.field);return h.jsxs(I,{className:"flex justify-between text-sm",children:[h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:Te?.header||""}),h.jsx(Q,{className:q.className||"text-gray-900 dark:text-gray-100",children:q.children&&q.children.length>0?Br(q.children,{},null,`footer-mobile-${me}`,le):Qd(q.text,`footer-mobile-text-${me}`,le)})]},`footer-mobile-${me}`)})})}),s&&Io&&h.jsx(I,{className:"flex justify-center mt-4",children:h.jsx($o,{currentPage:jn,totalPages:dn,hasMorePages:k?L:void 0,onPageChange:Lo,showFirstLast:j,maxVisiblePages:5,prevText:Le,nextText:Ie})})]}):h.jsxs(I,{id:t,className:`w-full ${a}`,style:l,...Oe,children:[b&&h.jsx(I,{className:"mb-4 flex justify-end",children:h.jsxs(I,{ref:Fe,className:"relative",children:[h.jsxs(oe,{onClick:()=>Ce(!ye),className:"flex items-center gap-2 px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700",children:[h.jsx(re,{name:de.Cog,className:"w-4 h-4 text-gray-500 dark:text-gray-400"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:Ue})]}),ye&&h.jsx(I,{className:"absolute right-0 z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",children:h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:rt.map(q=>h.jsxs(I,{className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${q.required?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:()=>!q.required&&ke(q.field),children:[h.jsx(Cn,{checked:Ot.includes(q.field),disabled:q.required,onChange:()=>{},className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"}),h.jsxs(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:[q.header,q.required&&h.jsxs(Q,{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:["(",Ge,")"]})]})]},q.field))})})]})}),f&&g.length>0&&ft&&h.jsx(I,{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:Be(g.length)}),h.jsx(I,{id:t?`${t}__body`:void 0,className:"overflow-x-auto border border-gray-200 dark:border-gray-700 rounded-lg",children:h.jsxs(za,{className:"w-full",children:[h.jsx(Ha,{className:"bg-gray-50 dark:bg-gray-700",children:h.jsxs(tr,{children:[U&&h.jsx(zr,{className:"px-2 py-3",style:{width:Y}}),f&&h.jsx(zr,{className:"px-4 py-3 w-10",children:h.jsx(Cn,{checked:Yt,ref:q=>{q&&(q.indeterminate=wn)},onChange:Ia,className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"})}),St.map(q=>h.jsxs(zr,{className:`px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider ${xn&&q.sortable!==!1?"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-600":""}`,style:{width:q.width,minWidth:q.width},onClick:xn?()=>Da(q.field):void 0,children:[q.header,ge===q.field&&h.jsx(Q,{className:"ml-1",children:Ve==="asc"?"↑":"↓"})]},q.field)),w&&w.length>0&&h.jsx(zr,{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-24",children:bt})]})}),h.jsx(Ua,{className:`bg-white dark:bg-gray-800 ${ue?"":"divide-y divide-gray-200 dark:divide-gray-700"}`,children:Ze&&Ze.length>0?Ze.map((q,me)=>{const Te=q[p]||me,ct=Tt(Te);return h.jsxs(v.Fragment,{children:[h.jsxs(tr,{className:`${i?"cursor-pointer":""} hover:bg-gray-50 dark:hover:bg-gray-700 ${g.includes(q[p])?"bg-blue-50 dark:bg-blue-900/20":""} ${ue&&me>0?"border-t border-gray-200 dark:border-gray-700":""}`,onClick:()=>i?.(q),children:[U&&h.jsx(Jt,{className:"px-2 py-4 text-center",onClick:ze=>ze.stopPropagation(),children:ve(q)?h.jsx(oe,{onClick:()=>st(Te),className:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors","aria-label":ct?"Collapse row":"Expand row",children:h.jsx(re,{name:ct?Z:ee,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}):null}),f&&h.jsx(Jt,{className:"px-4 py-4",onClick:ze=>ze.stopPropagation(),children:h.jsx(Cn,{checked:g.includes(q[p]),onChange:()=>La(q[p]),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"})}),St.map(ze=>h.jsx(Jt,{className:"px-6 py-4 align-top whitespace-nowrap text-sm text-gray-900 dark:text-gray-200",style:{width:ze.width,minWidth:ze.width},children:ze.cellChildren&&ze.cellChildren.length>0?Br(ze.cellChildren,q,q[ze.field],`${q[p]}-${ze.field}`,le):ze.render?ze.render(q[ze.field],q):el(q[ze.field])},ze.field)),w&&w.length>0&&h.jsx(Jt,{className:"px-6 py-4 text-right",onClick:ze=>ze.stopPropagation(),children:h.jsx(Cs,{items:ie(q),triggerLabel:"",triggerIconName:de.EllipsisHorizontal,position:"right"})})]}),U&&ct&&ve(q)&&h.jsx(tr,{className:"bg-gray-50 dark:bg-gray-900",children:h.jsx(Jt,{colSpan:St.length+1+(f?1:0)+(w&&w.length>0?1:0),className:"px-6 py-4",children:_t(q)})}),(ae&&ae.length>0||pe)&&Zd(Se,q)&&h.jsx(tr,{className:ue?"!border-t-0":"",children:h.jsx(Jt,{colSpan:St.length+(U?1:0)+(f?1:0)+(w&&w.length>0?1:0),className:ue?"p-2":ue||"px-6 py-2 bg-gray-50 dark:bg-gray-900",children:ue?h.jsx(I,{className:ue,children:pe?pe(q):tl(ae,q,`subrow-${Te}`,le)}):pe?pe(q):tl(ae,q,`subrow-${Te}`,le)})})]},Te)}):h.jsx(tr,{children:h.jsx(Jt,{colSpan:St.length+(U?1:0)+(f?1:0)+(w&&w.length>0?1:0),className:"px-6 py-8 text-center text-gray-500 dark:text-gray-400",children:et})})}),we&&we.length>0&&Ze&&Ze.length>0&&h.jsx(Ba,{children:h.jsxs(tr,{className:He,children:[U&&h.jsx(Jt,{className:"px-2 py-4"}),f&&h.jsx(Jt,{className:"px-4 py-4"}),(()=>{const q=new Map(we.filter(me=>me.field).map(me=>[me.field,me]));return St.map(me=>{const Te=q.get(me.field);return Te?h.jsx(Jt,{className:`px-6 py-4 text-sm text-gray-900 dark:text-gray-200 ${Te.className||""}`,colSpan:Te.colSpan,style:{width:me.width,minWidth:me.width},children:Te.children&&Te.children.length>0?Br(Te.children,{},null,`footer-${me.field}`,le):Qd(Te.text,`footer-text-${me.field}`,le)},`footer-${me.field}`):h.jsx(Jt,{className:"px-6 py-4",style:{width:me.width,minWidth:me.width}},`footer-${me.field}`)})})(),w&&w.length>0&&h.jsx(Jt,{className:"px-6 py-4"})]})})]})}),s&&Io&&h.jsx(I,{className:"flex justify-center mt-4",children:h.jsx($o,{currentPage:jn,totalPages:dn,hasMorePages:k?L:void 0,onPageChange:Lo,showFirstLast:j,maxVisiblePages:5,prevText:Le,nextText:Ie})})]})},Ub=window.G7Core?.createLogger?.("Comp:CardGrid")??{log:(...t)=>console.log("[Comp:CardGrid]",...t),warn:(...t)=>console.warn("[Comp:CardGrid]",...t),error:(...t)=>console.error("[Comp:CardGrid]",...t)},Bb=(t,e)=>window.G7Core?.t?.(t,e)??t,jb=()=>window.G7Core?.getComponentMap?.()||{},Wb=(t,e)=>{if(!t)return!0;const n=window.G7Core;return typeof n?.evaluateCondition=="function"?n.evaluateCondition(t,{row:e,item:e,$item:e}):(Ub.warn("G7Core.evaluateCondition 미노출 — 조건을 평가할 수 없습니다:",t),!0)},Jd=(t,e,n,r,s)=>{const o=window.G7Core;if(t.name==="ActionMenu"){if(r&&r.length>0&&s)return{...t,props:{...t.props,items:r.map(i=>({...i,onClick:()=>s(i.id,e)}))}};if(t.actions&&Array.isArray(t.actions)){const i=t.props?.items||[],a=new Map(t.actions.map(c=>[c.id,c])),l=i.map(c=>{if(typeof c.onClick=="string"){const d=c.onClick,u=a.get(d);if(u&&o?.ActionDispatcher)return{...c,onClick:()=>{const f={...n};o.ActionDispatcher.dispatch(u,f)}}}return c});return{...t,props:{...t.props,items:l}}}}return t.children&&Array.isArray(t.children)?{...t,children:t.children.map(i=>Jd(i,e,n,r,s))}:t},Gb=(t,e,n,r="",s,o)=>{const i=window.G7Core;if(i?.renderItemChildren){const a=t.filter(d=>{const u=d.condition||d.if;return u?Wb(u,e):!0}),l={row:e,$value:e,index:n},c=a.map(d=>Jd(d,e,l,s,o));try{const d=jb();return i.renderItemChildren(c,l,d,r)}catch{return h.jsxs(I,{className:"text-red-600 dark:text-red-400 p-4",children:[h.jsx(yt,{children:"컴포넌트 로드 실패"}),h.jsx(yt,{className:"text-sm",children:"[CardGrid] 데이터를 표시할 수 없습니다."})]})}}return null},nl=(t,e)=>{if(t.name==="Div"&&t.children&&t.children.length>0){const n=t.children.map((r,s)=>nl(r,`${e}-child-${s}`)).filter(Boolean);return h.jsx(I,{className:t.props?.className||"",children:n},e)}return h.jsx(I,{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-full animate-pulse"},e)},Rd=(t,e="skeleton")=>!t||t.length===0?null:t.map((n,r)=>{const s=`${e}-${n.id||n.name}-${r}`;return n.condition||n.if?null:(n.iteration,nl(n,s))}).filter(Boolean),Yb=({data:t,cardColumns:e=[],gridColumns:n=3,gap:r=4,responsiveColumns:s,cardClassName:o="",idField:i="id",pagination:a=!0,pageSize:l=12,serverSidePagination:c=!1,serverCurrentPage:d,serverTotalPages:u,alwaysShowPagination:f=!1,onPageChange:g,paginationInfoText:m,rowActions:p,onRowAction:y,className:b="",style:_,emptyMessage:x,prevText:E,nextText:S,showSkeleton:w=!0,skeletonCount:N,skeletonCellChildren:C,id:k,editorAttrs:M})=>{const T=x??Bb("common.no_data"),L=e[0]?.cellChildren||[],[P,F]=v.useState(1);window.G7Core?.useResponsive?.();const A=c?d??1:P,O=c?u??1:Math.ceil((t?.length??0)/l),V=G=>{c?g?.(G):F(G)},H=v.useCallback((G,z)=>{y?.(G,z)},[y]),W=v.useMemo(()=>{if(!t)return[];if(!a||c)return t;const G=(P-1)*l,z=G+l;return t.slice(G,z)},[t,a,c,P,l]),j=v.useMemo(()=>{const G=[],z=s?.sm??1;G.push(`grid-cols-${z}`),s?.sm&&G.push(`sm:grid-cols-${s.sm}`);const X=s?.md??Math.min(n,2);G.push(`md:grid-cols-${X}`);const Y=s?.lg??n;return G.push(`lg:grid-cols-${Y}`),s?.xl&&G.push(`xl:grid-cols-${s.xl}`),G.join(" ")},[n,s]),U=v.useMemo(()=>w?C&&C.length>0?Rd(C,"custom-skeleton"):L&&L.length>0?Rd(L,"auto-skeleton"):null:null,[w,C,L]);if(!t){if(!w)return null;const G=N??n;return h.jsx(I,{className:`grid ${j} gap-${r} ${b}`,style:_,id:k,...M,children:Array.from({length:G}).map((z,X)=>h.jsx(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6 space-y-4",children:U},`skeleton-${X}`))})}if(W.length===0)return h.jsx(I,{className:b,style:_,id:k,...M,children:h.jsx(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-12",children:h.jsx(yt,{className:"text-center text-gray-600 dark:text-gray-400",children:T})})});const B=a&&(f||O>1);return h.jsxs(I,{className:b,style:_,id:k,...M,children:[h.jsx(I,{className:`grid ${j} gap-${r}`,children:W.map((G,z)=>h.jsx(I,{className:o,children:Gb(L,G,z,`card-${z}`,p,H)},G[i]||z))}),B&&h.jsxs(I,{className:"mt-6 space-y-4 flex flex-col items-center",children:[h.jsx($o,{currentPage:A,totalPages:O,onPageChange:V,showFirstLast:!1,maxVisiblePages:5,prevText:E,nextText:S}),m&&h.jsx(I,{className:"text-sm text-gray-600 dark:text-gray-400 text-center",children:m})]})]})},Xb=(t,e)=>window.G7Core?.t?.(t,e)??t,Bo=({isOpen:t,onClose:e,title:n,titlePrefix:r,titleSuffix:s,closeOnBackdropClick:o=!0,closeOnOverlayClick:i,showCloseButton:a=!0,closeOnEscape:l=!0,children:c,width:d="500px",className:u="",style:f,__dataContext:g,__translationContext:m})=>{const p=i!==void 0?i:o,y=v.useRef(null),b=v.useRef(null);if(v.useEffect(()=>{const E=S=>{S.key==="Escape"&&t&&l&&e()};if(t&&l)return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[t,e,l]),v.useEffect(()=>{if(t&&y.current){b.current=document.activeElement;const E=y.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),S=E[0],w=E[E.length-1];S?.focus();const N=C=>{C.key==="Tab"&&(C.shiftKey?document.activeElement===S&&(C.preventDefault(),w?.focus()):document.activeElement===w&&(C.preventDefault(),S?.focus()))};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N),b.current?.focus()}}},[t]),v.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),!t)return null;const _=f?.zIndex??50,x=(E,S)=>{if(!E||E.length===0)return null;const w=window.G7Core;if(!w)return null;const N=w.getDynamicRenderer?.();return N?E.map((C,k)=>h.jsx(N,{componentDef:C,dataContext:g||{},translationContext:m,registry:w.getComponentRegistry(),bindingEngine:w.getDataBindingEngine(),translationEngine:w.getTranslationEngine(),actionDispatcher:w.getActionDispatcher(),isRootRenderer:!1},`${S}-${k}`)):null};return h.jsxs(I,{className:"modal-wrapper",style:{zIndex:_},onClick:p?e:void 0,children:[h.jsx(I,{className:"modal-backdrop","aria-hidden":"true"}),h.jsxs(I,{ref:y,className:`modal-container ${u}`,style:{width:d,...f?{...f,zIndex:void 0}:{}},onClick:E=>E.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":n?"modal-title":void 0,children:[(n||r||s||a)&&h.jsxs(I,{className:"modal-header-row",children:[h.jsxs(I,{className:"flex-center gap-sm",children:[x(r,"title-prefix"),n&&h.jsx(I,{id:"modal-title",className:"modal-title",children:n}),x(s,"title-suffix")]}),a&&h.jsx(oe,{onClick:e,className:"modal-close-btn","aria-label":Xb("common.close_modal"),children:h.jsx("svg",{className:"icon-lg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsx(I,{className:"modal-body-content",children:c})]})]})},Kb=({label:t,items:e,onItemClick:n,position:r="bottom-left",variant:s="default",className:o="",style:i,id:a,editorAttrs:l})=>{const[c,d]=v.useState(!1),[u,f]=v.useState(-1),g=v.useRef(null),m=v.useRef(null),[p,y]=v.useState(r);v.useEffect(()=>{const x=E=>{g.current&&!g.current.contains(E.target)&&(d(!1),f(-1))};if(c)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[c]),v.useEffect(()=>{const x=E=>{if(!c)return;const S=e.map((w,N)=>w.disabled?-1:N).filter(w=>w!==-1);switch(E.key){case"ArrowDown":E.preventDefault(),f(w=>{const C=(S.indexOf(w)+1)%S.length;return S[C]});break;case"ArrowUp":E.preventDefault(),f(w=>{const N=S.indexOf(w),C=N<=0?S.length-1:N-1;return S[C]});break;case"Enter":E.preventDefault(),u>=0&&!e[u].disabled&&b(e[u]);break;case"Escape":E.preventDefault(),d(!1),f(-1);break}};if(c)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[c,u,e]),v.useEffect(()=>{if(c&&m.current&&g.current){const x=m.current.getBoundingClientRect(),E=g.current.getBoundingClientRect(),S=window.innerWidth,w=window.innerHeight,N=x.width||224,C=x.height||200;let k=r;r.includes("left")?E.left+N>S&&(k=k.replace("left","right")):E.right-N<0&&(k=k.replace("right","left")),r.includes("top")?E.top-C<0&&(k=k.replace("top","bottom")):E.bottom+C>w&&(k=k.replace("bottom","top")),y(k)}},[c,r]);const b=x=>{x.disabled||(x.onClick?.(),n?.(x.value,x),d(!1),f(-1))},_={"bottom-left":"dropdown-menu-bottom-left","bottom-right":"dropdown-menu-bottom-right","top-left":"dropdown-menu-top-left","top-right":"dropdown-menu-top-right"};return h.jsxs(I,{ref:g,className:`dropdown ${o}`,style:i,id:a,...l,children:[h.jsxs(oe,{onClick:()=>d(!c),className:s==="text"?"dropdown-trigger-text":"dropdown-trigger","aria-haspopup":"true","aria-expanded":c,children:[t,s!=="text"&&h.jsx("svg",{className:`inline-block ml-2 w-4 h-4 transition-transform ${c?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),c&&h.jsx(I,{ref:m,className:`dropdown-menu ${_[p]}`,role:"menu","aria-orientation":"vertical",children:h.jsx(I,{className:"py-1",children:e.map((x,E)=>h.jsx(I,{className:`${x.disabled?"dropdown-item-disabled":"dropdown-item"} ${u===E?"dropdown-item-focused":""}`,onClick:()=>b(x),onMouseEnter:()=>!x.disabled&&f(E),role:"menuitem","aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,children:x.label},x.value))})})]})},qb=({imageUrl:t,imageAlt:e="",title:n,subtitle:r,description:s,price:o,originalPrice:i,discountRate:a,currency:l="₩",buttonText:c="자세히 보기",onButtonClick:d,className:u="",style:f,id:g,editorAttrs:m})=>{const p=a&&a>0,y=(o??0).toLocaleString(),b=i?.toLocaleString();return h.jsxs(I,{className:`rounded-lg bg-white dark:bg-gray-800 shadow-md hover:shadow-xl transition-shadow border border-gray-200 dark:border-gray-700 overflow-hidden ${u}`,style:f,id:g,...m,children:[t&&h.jsxs(I,{className:"relative w-full",children:[h.jsx(kn,{src:t,alt:e||n,className:"w-full h-64 object-cover"}),p&&h.jsx(I,{className:"absolute top-2 right-2 bg-red-500 text-white px-2 py-1 rounded-md",children:h.jsxs(Q,{className:"text-sm font-bold",children:["-",a,"%"]})})]}),h.jsxs(I,{className:"p-4",children:[r&&h.jsx($r,{className:"text-xs font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wider mb-2",children:r}),h.jsx(er,{className:"text-xl font-bold text-gray-900 dark:text-white mb-2 line-clamp-2",children:n}),s&&h.jsx(yt,{className:"text-sm text-gray-600 dark:text-gray-400 mb-4 line-clamp-3",children:s}),h.jsxs(I,{className:"flex items-center gap-2 mb-4",children:[h.jsxs(Q,{className:"text-2xl font-bold text-gray-900 dark:text-white",children:[l,y]}),i&&h.jsxs(Q,{className:"text-sm text-gray-400 dark:text-gray-500 line-through",children:[l,b]})]}),c&&h.jsx(oe,{onClick:d,className:"w-full bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg transition-colors",children:c})]})]})},Zb=({value:t,label:e,change:n,changeLabel:r="전월 대비",iconName:s,trend:o="neutral",className:i="",style:a,id:l,editorAttrs:c})=>{const d=o==="up",u=o==="down",f=n!==void 0?Math.abs(n):0,g=d?"stats-trend-up":u?"stats-trend-down":"stats-trend-neutral",m=d?de.ArrowUp:u?de.ArrowDown:void 0;return h.jsxs(I,{className:`stat-card ${i}`,style:a,id:l,...c,children:[h.jsxs(I,{className:"flex-between mb-md",children:[s&&h.jsx(I,{className:"stats-icon stats-icon-blue",children:h.jsx(re,{name:s,className:"icon-lg"})}),n!==void 0&&h.jsxs(I,{className:`stats-change ${g}`,children:[m&&h.jsx(re,{name:m,className:"icon-sm"}),h.jsxs(Q,{className:"text-sm font-semibold",children:[f,"%"]})]})]}),h.jsx($r,{className:"stats-value-lg",children:typeof t=="number"?t.toLocaleString():t}),h.jsx(yt,{className:"stats-label",children:e}),n!==void 0&&r&&h.jsx(I,{className:"stats-sublabel",children:h.jsx(Q,{children:r})})]})},eu=()=>window.G7Core,tu=(t,e)=>eu()?.t?.(t,e)??t,Qb=({name:t="search",placeholder:e,value:n,onChange:r,onSubmit:s,showButton:o=!1,suggestions:i=[],onSuggestionClick:a,showSuggestions:l=!1,className:c="",style:d,id:u,editorAttrs:f})=>{const g=e??tu("common.search_placeholder"),[m,p]=v.useState(""),[y,b]=v.useState(!1),_=v.useRef(null),x=v.useRef(""),E=n!==void 0?n:m,S=l&&y&&i.length>0&&E.length>0,w="w-64 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",N=eu()?.style?.mergeClasses?.(w,c)??`${w} ${c}`;v.useEffect(()=>{n!==void 0&&(x.current=n)},[n]);const C=T=>{const L=T.target.value;p(L),r?.(T),x.current!==""&&L===""&&!T.nativeEvent.inputType&&setTimeout(()=>{const P=_.current?.querySelector("form");P&&P.requestSubmit()},0),x.current=L},k=T=>{p(T.text);const L={target:{value:T.text,name:t}};r?.(L),a?.(T),b(!1)},M=T=>{T.preventDefault(),s?.(T)};return h.jsxs(I,{ref:_,className:"relative",style:d,id:u,...f,children:[h.jsx(Va,{onSubmit:M,className:"relative",children:h.jsxs(I,{className:`relative flex items-center ${o?"gap-2":""}`,children:[h.jsxs(I,{className:"relative flex-1",children:[h.jsx(I,{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",children:h.jsx(re,{name:de.Search,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),h.jsx(wt,{type:"search",name:t,value:E,onChange:C,onFocus:()=>b(!0),onBlur:()=>setTimeout(()=>b(!1),200),placeholder:g,className:N})]}),o&&h.jsx(oe,{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:tu("common.search")})]})}),S&&h.jsx(I,{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:i.map(T=>h.jsx(I,{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:()=>k(T),children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(re,{name:de.Search,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:T.text})]})},T.id))})]})},rl=(t,e)=>window.G7Core?.t?.(t,e)??t,Jb=({title:t,filters:e,onChange:n,onReset:r,showResetButton:s=!0,className:o="",style:i,id:a,editorAttrs:l})=>{const c=t??rl("common.filter"),d=(f,g)=>{n?.(f,g)},u=(f,g,m)=>{const p=e.find(b=>b.id===f);if(!p)return;const y=Array.isArray(p.value)?p.value:[];if(typeof g=="string"){const b=y.filter(x=>typeof x=="string"),_=m?[...b,g]:b.filter(x=>x!==g);n?.(f,_)}else{const b=y.filter(x=>typeof x=="number"),_=m?[...b,g]:b.filter(x=>x!==g);n?.(f,_)}};return h.jsxs(I,{className:`rounded-lg bg-white dark:bg-gray-800 shadow-md border border-gray-200 dark:border-gray-700 p-4 ${o}`,style:i,id:a,...l,children:[h.jsxs(I,{className:"flex items-center justify-between mb-4 pb-3 border-b border-gray-200 dark:border-gray-700",children:[h.jsx(Q,{className:"text-lg font-semibold text-gray-900 dark:text-white",children:c}),s&&r&&h.jsx(oe,{onClick:r,className:"text-sm text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:rl("common.reset")})]}),h.jsx(I,{className:"space-y-4",children:e.map(f=>h.jsxs(I,{className:"space-y-2",children:[h.jsx(on,{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:f.label}),f.type==="select"&&h.jsxs(Vr,{value:f.value,onChange:g=>d(f.id,g.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 focus:border-blue-500 dark:focus:border-blue-400 bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:[h.jsx("option",{value:"",children:rl("common.select_placeholder")}),f.options.map(g=>h.jsx("option",{value:g.value,children:g.label},g.id))]}),f.type==="checkbox"&&h.jsx(I,{className:"space-y-2",children:f.options.map(g=>{const m=Array.isArray(f.value)?f.value.some(p=>p===g.value):!1;return h.jsxs(on,{className:"flex items-center gap-2 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-md transition-colors",children:[h.jsx(Cn,{checked:m,onChange:p=>u(f.id,g.value,p.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded focus:ring-blue-500"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:g.label})]},g.id)})})]},f.id))})]})},Rb=({tabs:t,activeTabId:e,onTabChange:n,variant:r="default",className:s="",style:o,mobileBreakpoint:i=768,id:a,editorAttrs:l})=>{const d=window.G7Core?.useResponsive,u=d?.(),f=u?u.width<i:typeof window<"u"&&window.innerWidth<i,g=v.useRef([]),m=w=>{!w.disabled&&w.id!==e&&n?.(w.id)},p=(w,N)=>{const C=w.key==="ArrowRight"?1:w.key==="ArrowLeft"?-1:0;let k=null;if(C!==0)for(let M=1;M<=t.length;M+=1){const T=(N+C*M+t.length*M)%t.length;if(!t[T]?.disabled){k=T;break}}else if(w.key==="Home")k=t.findIndex(M=>!M.disabled);else if(w.key==="End"){for(let M=t.length-1;M>=0;M-=1)if(!t[M]?.disabled){k=M;break}}k===null||k<0||(w.preventDefault(),g.current[k]?.focus(),m(t[k]))},y=w=>{const N=w.target.value,C=Number(N),k=typeof N=="string"&&N!==""&&!Number.isNaN(C)?C:N,M=t.find(T=>String(T.id)===String(k));M&&m(M)};if(f)return h.jsx(I,{className:s,style:o,id:a,...l,children:h.jsx(Vr,{value:e!==void 0?String(e):"",onChange:y,options:t.map(w=>({value:String(w.id),label:w.badge!==void 0?`${w.label} (${w.badge})`:w.label,disabled:w.disabled})),className:"w-full"})});const b=w=>{const N=w.id===e;if(w.disabled)return"tab-btn-base tab-btn-disabled";switch(r){case"pills":return N?"tab-btn-base tab-btn-pills-active":"tab-btn-base tab-btn-pills";case"underline":return N?"tab-btn-base tab-btn-underline-active":"tab-btn-base tab-btn-underline";case"default":default:return N?"tab-btn-base tab-btn-default-active":"tab-btn-base tab-btn-default"}},_=r==="underline"?"tab-nav-underline":"tab-nav-default",x=l?.["data-editor-path"],E=t.findIndex(w=>w.id===e),S=E>=0?E:t.findIndex(w=>!w.disabled);return h.jsx(Po,{className:`${_} ${s}`,style:o,role:"tablist","aria-orientation":"horizontal",id:a,...l,children:t.map((w,N)=>h.jsxs(oe,{ref:C=>{g.current[N]=C},type:"button",role:"tab","aria-selected":w.id===e,tabIndex:N===S?0:-1,onClick:()=>m(w),onKeyDown:C=>p(C,N),disabled:w.disabled,className:b(w),...x?{"data-editor-item-path":`${x}.props.tabs.${N}`}:{},children:[w.iconName&&h.jsx(re,{name:w.iconName,className:"w-4 h-4"}),h.jsx(Q,{children:w.label}),w.badge!==void 0&&h.jsx(I,{className:"flex items-center justify-center min-w-[20px] h-5 px-1.5 bg-red-500 dark:bg-red-600 text-white dark:text-white text-xs font-bold rounded-full",children:h.jsx(Q,{children:w.badge})})]},w.id))})},sl=window.G7Core?.createLogger?.("Handler:ScrollToSection")??{log:(...t)=>console.log("[Handler:ScrollToSection]",...t),warn:(...t)=>console.warn("[Handler:ScrollToSection]",...t),error:(...t)=>console.error("[Handler:ScrollToSection]",...t)};async function nu(t,e){const n=t.params||{},{targetId:r,offset:s=120,delay:o=100,scrollContainerId:i}=n;if(!r){sl.warn("targetId is required");return}const a=await ey(r,o);if(!a){sl.warn(`Element not found: ${r}`);return}const l=ty(a,i),c=ny(a,l,s);ry(l,c)}async function ey(t,e){await new Promise(s=>setTimeout(s,e));const n=10,r=50;for(let s=0;s<n;s++){const o=document.getElementById(t);if(o)return await new Promise(i=>setTimeout(i,50)),o;await new Promise(i=>setTimeout(i,r))}return null}function ty(t,e){if(e){const o=document.getElementById(e);if(o&&ru(o))return o;sl.warn(`Container '${e}' ${o?"has no scroll":"not found"}, trying auto-detect`)}let n=t.parentElement,r=0;const s=10;for(;n&&n!==document.body&&r<s;){if(ru(n))return n;n=n.parentElement,r++}return window}function ru(t){const e=window.getComputedStyle(t);return(e.overflowY==="auto"||e.overflowY==="scroll")&&t.scrollHeight>t.clientHeight}function ny(t,e,n){if(e===window||!("getBoundingClientRect"in e))return t.getBoundingClientRect().top+window.pageYOffset-n;{const r=e.getBoundingClientRect(),s=t.getBoundingClientRect();return e.scrollTop+(s.top-r.top)-n}}function ry(t,e){t===window||!("scrollTo"in t)?window.scrollTo({top:e,behavior:"smooth"}):t.scrollTo({top:e,behavior:"smooth"})}window.G7Core?.createLogger?.("Comp:TabNavigation");const sy=({tabs:t,activeTabId:e,className:n="bg-white dark:bg-gray-800 flex gap-2 border-b border-gray-200 dark:border-gray-700 px-6",style:r,activeClassName:s="tab-btn-base tab-btn-default-active",inactiveClassName:o="tab-btn-base tab-btn-default",sectionIdPrefix:i="tab_content_",scrollOffset:a=120,scrollDelay:l=100,onTabChange:c,enableScrollSpy:d=!1,scrollSpyOffset:u=80,scrollContainerId:f,id:g,editorAttrs:m})=>{const[p,y]=v.useState(e??(t.length>0?t[0].id:"")),_=window.G7Core?.useResponsive,x=_?.(),E=x?x.width<768:typeof window<"u"&&window.innerWidth<768,S=v.useRef(!1),w=v.useRef(null),N=v.useRef([]),C=P=>{if(d&&(S.current=!0,w.current&&clearTimeout(w.current)),P.onClick){if(P.onClick(P.id),!d)return}else if(c){if(c(P.id),!d)return}else y(P.id);const F=P.scrollOffset??a,D=P.scrollDelay??l;nu({params:{targetId:`${i}${P.id}`,offset:F,delay:D,scrollContainerId:f}}),d&&(w.current=setTimeout(()=>{S.current=!1},D+500))},k=(P,F)=>{const D=P.key==="ArrowRight"?1:P.key==="ArrowLeft"?-1:0;let A=null;if(D!==0)for(let O=1;O<=t.length;O+=1){const V=(F+D*O+t.length*O)%t.length;if(!t[V]?.disabled){A=V;break}}else if(P.key==="Home")A=t.findIndex(O=>!O.disabled);else if(P.key==="End"){for(let O=t.length-1;O>=0;O-=1)if(!t[O]?.disabled){A=O;break}}A===null||A<0||(P.preventDefault(),N.current[A]?.focus(),C(t[A]))};v.useEffect(()=>{if(!d)return;const P=f?document.getElementById(f):null,F={root:P??null,rootMargin:`-${u}px 0px -30% 0px`,threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]},D=new Map,A=()=>{const W=P,j=W?W.scrollTop:window.pageYOffset||document.documentElement.scrollTop,U=W?W.scrollHeight:document.documentElement.scrollHeight,B=W?W.clientHeight:document.documentElement.clientHeight;return j+B>=U-10},O=W=>{if(S.current)return;W.forEach(X=>{const Y=X.target.id;X.isIntersecting?D.set(Y,X.intersectionRatio):D.delete(Y)});let j=0,U="";D.forEach((X,Y)=>{X>j&&(j=X,U=Y)});const B=t[t.length-1],G=`${i}${B?.id}`,z=D.has(G);if(A()&&z&&B){y(B.id);return}if(U){const X=U.replace(i,""),Y=Number(X),Z=isNaN(Y)?X:Y;t.some(te=>te.id===Z)&&y(Z)}},V=()=>{},H=new IntersectionObserver(O,F);return t.forEach(W=>{const j=document.getElementById(`${i}${W.id}`);j&&H.observe(j)}),window.addEventListener("scroll",V,{passive:!0}),()=>{H.disconnect(),window.removeEventListener("scroll",V),w.current&&clearTimeout(w.current)}},[d,t,i,u,f]);const M=P=>{const F=P.target.value,D=Number(F),A=isNaN(D)?F:D,O=t.find(V=>V.id===A);O&&C(O)};if(E)return h.jsx(I,{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-4 py-3",id:g,...m,children:h.jsx(Vr,{value:String(p),onChange:M,options:t.map(P=>({value:String(P.id),label:P.label,disabled:P.disabled})),className:"w-full"})});const T=t.findIndex(P=>P.id===p),L=T>=0?T:t.findIndex(P=>!P.disabled);return h.jsx(I,{className:n,style:r,role:"tablist","aria-orientation":"horizontal",id:g,...m,children:t.map((P,F)=>h.jsxs(oe,{ref:D=>{N.current[F]=D},type:"button",role:"tab","aria-selected":p===P.id,tabIndex:F===L?0:-1,className:p===P.id?s:o,disabled:P.disabled,onClick:()=>C(P),onKeyDown:D=>k(D,F),children:[P.iconName&&h.jsx(re,{name:P.iconName,size:"sm"}),h.jsx(Q,{children:P.label})]},P.id))})},oy=()=>window.G7Core,iy=({iconName:t,label:e,onClick:n,variant:r="primary",size:s="md",disabled:o=!1,className:i="",style:a,id:l,editorAttrs:c})=>{const d={sm:e?"px-3 py-1.5 text-sm":"w-8 h-8",md:e?"px-4 py-2 text-base":"w-10 h-10",lg:e?"px-5 py-2.5 text-lg":"w-12 h-12"},u={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},f={primary:"bg-blue-600 hover:bg-blue-700 text-white border-transparent",secondary:"bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600",danger:"bg-red-600 hover:bg-red-700 text-white border-transparent",ghost:"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 border-transparent",outline:"bg-transparent hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600"},g="inline-flex items-center justify-center gap-2 font-medium rounded-lg border transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-blue-400",m=o?"opacity-50 cursor-not-allowed":"",p=`${g} ${d[s]} ${f[r]} ${m}`,y=oy()?.style?.mergeClasses?.(p,i)??`${p} ${i}`;return h.jsxs(oe,{onClick:n,disabled:o,className:y,style:a,id:l,...c,children:[h.jsx(re,{name:t,className:u[s]}),e]})},ay=(t,e)=>window.G7Core?.t?.(t,e)??t,su=({isOpen:t,onClose:e,title:n,content:r,actions:s=[],width:o="500px",closeOnOverlay:i=!0,showCloseButton:a=!0,className:l="",style:c})=>{const d=()=>{i&&e()},u={primary:"dialog-btn-primary",secondary:"dialog-btn-secondary",danger:"dialog-btn-danger",ghost:"dialog-btn-ghost"};return h.jsxs(Bo,{isOpen:t,onClose:d,width:o,className:l,style:c,children:[h.jsxs(I,{className:"dialog-header",children:[h.jsx(er,{className:"dialog-title",children:n}),a&&h.jsx(oe,{onClick:e,className:"dialog-close","aria-label":ay("common.close_dialog"),children:h.jsx(re,{name:de.Times,className:"icon-md"})})]}),h.jsx(I,{className:"dialog-body",children:r}),s.length>0&&h.jsx(I,{className:"dialog-footer",children:s.map((f,g)=>h.jsxs(oe,{onClick:f.onClick,disabled:f.disabled,className:u[f.variant||"primary"],children:[f.iconName&&h.jsx(re,{name:f.iconName,className:"icon-sm mr-2 inline-block"}),f.label]},g))})]})},ol=(t,e)=>window.G7Core?.t?.(t,e)??t,ou=({isOpen:t,onClose:e,title:n,message:r,confirmText:s,cancelText:o,onConfirm:i,onCancel:a,confirmButtonVariant:l="primary",cancelButtonVariant:c="secondary",width:d="500px",closeOnOverlay:u=!0,isLoading:f=!1,loadingText:g})=>{const m=s??ol("common.confirm"),p=o??ol("common.cancel"),y=g??ol("common.loading"),b=()=>{i()},_=()=>{f||(a?.(),e())},x=()=>{f||e()},E={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 h.jsxs(Bo,{isOpen:t,onClose:x,title:n,width:d,children:[h.jsx(I,{className:"py-2",children:typeof r=="string"?h.jsx(yt,{className:"text-gray-700 dark:text-gray-300",children:r}):r}),h.jsxs(I,{className:"flex justify-end gap-3 mt-6",children:[h.jsx(oe,{onClick:_,disabled:f,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:h.jsx(Q,{children:p})}),h.jsxs(oe,{onClick:b,disabled:f,className:`flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed ${E[l]}`,children:[f&&h.jsx(re,{name:de.Spinner,className:"w-4 h-4 animate-spin"}),h.jsx(Q,{children:f?y:m})]})]})]})},ly=(t,e)=>window.G7Core?.t?.(t,e)??t,cy=({isOpen:t,onClose:e,title:n,message:r,confirmText:s,onConfirm:o,confirmButtonVariant:i="primary",width:a="500px",closeOnOverlay:l=!0})=>{const u=[{label:s??ly("common.confirm"),onClick:()=>{o?.(),e()},variant:i}],f=typeof r=="string"?h.jsx(yt,{className:"text-gray-700 dark:text-gray-300",children:r}):r;return h.jsx(su,{isOpen:t,onClose:e,title:n,content:f,actions:u,width:a,closeOnOverlay:l})},dy=(t,e)=>window.G7Core?.t?.(t,e)??t,uy={success:de.CheckCircle,error:de.XCircle,warning:de.ExclamationTriangle,info:de.InfoCircle},iu={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"}},fy={"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"},hy=({toasts:t,position:e="bottom-center",duration:n=3e3,onRemove:r})=>{const[s,o]=v.useState(new Map),i=v.useCallback(a=>{o(l=>{const c=new Map(l);return c.set(a,!1),c}),setTimeout(()=>{if(r)r(a);else{const l=window.G7Core;l?.state?.update&&l.state.update(c=>({toasts:(Array.isArray(c.toasts)?c.toasts:[]).filter(u=>u.id!==a)}))}},300)},[r]);return v.useEffect(()=>{!t||t.length===0||t.forEach(a=>{if(s.has(a.id))return;o(c=>{const d=new Map(c);return d.set(a.id,!0),d});const l=a.duration||n;l>0&&setTimeout(()=>{i(a.id)},l)})},[t,n,i,s]),!t||t.length===0?null:h.jsx(I,{className:`fixed z-[9999] flex flex-col gap-2 ${fy[e]}`,"aria-live":"polite","aria-atomic":"true",children:t.map(a=>h.jsx(gy,{toast:a,position:e,isVisible:s.get(a.id)??!0,onClose:()=>i(a.id)},a.id))})},gy=({toast:t,position:e,isVisible:n,onClose:r})=>{const s=iu[t.type]||iu.info,o=t.icon?t.icon:uy[t.type],i=e.startsWith("bottom")?"translate-y-2":"-translate-y-2";return h.jsxs(I,{className:`
|
||
flex items-center gap-3 p-4 rounded-lg border shadow-lg
|
||
min-w-[300px] max-w-md
|
||
transition-all duration-300
|
||
${s.bg}
|
||
${n?"opacity-100 translate-y-0":`opacity-0 ${i}`}
|
||
`,role:"alert",children:[h.jsx(re,{name:o,className:`w-5 h-5 flex-shrink-0 ${s.text}`}),h.jsx(Q,{className:`flex-1 text-sm font-medium ${s.text}`,children:t.message}),h.jsx(oe,{onClick:r,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${s.text} focus:outline-none`,"aria-label":dy("common.close_notification"),children:h.jsx(re,{name:de.Times,className:"w-4 h-4"})})]})},au=({items:t,separator:e=h.jsx(re,{name:de.ChevronRight,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),showHome:n=!1,homeHref:r="/",maxItems:s,className:o="",id:i,editorAttrs:a})=>{let c=n?[{label:"Home",href:r},...t]:t,d=c,u=!1;if(s&&c.length>s){u=!0;const f=c.slice(0,1),g=c.slice(-(s-2));d=[...f,...g]}return h.jsx(Po,{className:`flex items-center space-x-2 text-sm ${o}`,"aria-label":"Breadcrumb",id:i,...a,children:h.jsx(I,{className:"flex items-center space-x-2",children:d.map((f,g)=>{const m=g===d.length-1,p=g===0;return h.jsxs(v.Fragment,{children:[u&&p&&h.jsxs(h.Fragment,{children:[h.jsx(lu,{item:f,isLast:!1}),h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e}),h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:"..."}),d.length>1&&h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e})]}),(!u||!p)&&h.jsxs(h.Fragment,{children:[h.jsx(lu,{item:f,isLast:m}),!m&&h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e})]})]},g)})})})},lu=({item:t,isLast:e})=>e||!t.href&&!t.onClick?h.jsx(Q,{className:"font-medium text-gray-900 dark:text-white","aria-current":e?"page":void 0,children:t.label}):t.onClick?h.jsx(Fr,{href:"#",onClick:n=>{n.preventDefault(),t.onClick?.()},className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:t.label}):h.jsx(Fr,{href:t.href,className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:t.label}),py=({title:t,description:e,iconName:n,illustrationSrc:r,illustrationAlt:s="Empty state illustration",actions:o=[],className:i="",id:a,editorAttrs:l})=>{const c={primary:"bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600 focus:ring-gray-500",danger:"bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500"};return h.jsxs(I,{className:`flex flex-col items-center justify-center p-8 text-center ${i}`,role:"status","aria-live":"polite",id:a,...l,children:[r?h.jsx(kn,{src:r,alt:s,className:"w-48 h-48 mb-6 object-contain"}):n?h.jsx(I,{className:"mb-6 p-4 rounded-full bg-gray-100 dark:bg-gray-700",children:h.jsx(re,{name:n,className:"w-12 h-12 text-gray-400 dark:text-gray-500"})}):null,h.jsx(er,{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:t}),e&&h.jsx(yt,{className:"text-gray-600 dark:text-gray-400 mb-6 max-w-md",children:e}),o.length>0&&h.jsx(I,{className:"flex flex-wrap gap-3 justify-center",children:o.map((d,u)=>h.jsxs(oe,{onClick:d.onClick,className:`
|
||
px-4 py-2 rounded-md font-medium transition-colors
|
||
focus:outline-none focus:ring-2 focus:ring-offset-2
|
||
${c[d.variant||"primary"]}
|
||
`,children:[d.iconName&&h.jsx(re,{name:d.iconName,className:"w-4 h-4 mr-2 inline-block"}),d.label]},u))})]})},my=(t,e)=>window.G7Core?.t?.(t,e)??t,by=({id:t,size:e="md",color:n="text-blue-600",fullscreen:r=!1,text:s,className:o="",editorAttrs:i})=>{const a={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-2",lg:"w-12 h-12 border-3",xl:"w-16 h-16 border-4"},l={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},c=h.jsxs(I,{className:`flex flex-col items-center justify-center gap-3 ${o}`,children:[h.jsx(I,{className:`
|
||
${a[e]}
|
||
border-gray-200 dark:border-gray-700 border-t-current
|
||
rounded-full animate-spin
|
||
${n}
|
||
`,role:"status","aria-label":my("common.loading")}),s&&h.jsx(Q,{className:`${l[e]} ${n} font-medium`,children:s})]});return r?h.jsx(I,{id:t,className:"fixed inset-0 z-50 flex items-center justify-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90","aria-live":"polite","aria-busy":"true",...i,children:c}):h.jsx(I,{id:t,className:"flex items-center justify-center p-4","aria-live":"polite","aria-busy":"true",...i,children:c})},jr=()=>window.G7Core,il=(t,e)=>window.G7Core?.t?.(t,e)??t,yy=({logo:t,logoAlt:e="Logo",menu:n=[],collapsed:r=!1,onToggleCollapse:s,className:o="",currentLocale:i,id:a,editorAttrs:l})=>{const[c,d]=v.useState(new Set),[u,f]=v.useState(i||jr()?.locale?.current?.()||"ko"),[g,m]=v.useState(window.location.pathname),p=v.useMemo(()=>{const k=[],M=T=>{for(const L of T)L.url&&k.push(L.url),L.children&&M(L.children)};return M(n),k},[n]),y=v.useCallback(k=>{let M=null;for(const T of p)(k===T||k.startsWith(T+"/"))&&(!M||T.length>M.length)&&(M=T);return M},[p]);v.useEffect(()=>{const k=jr();return k?.state?.subscribe?k.state.subscribe(T=>{const L=T?._global?.locale||k?.locale?.current?.()||"ko";f(L);const P=T?._global?.currentPath||window.location.pathname;m(P)}):void 0},[]),v.useEffect(()=>{const k=()=>{m(window.location.pathname)};return window.addEventListener("popstate",k),()=>window.removeEventListener("popstate",k)},[]),v.useEffect(()=>{i&&f(i)},[i]);const b=(k,M)=>!k||typeof M!="string"?!1:M===k?!0:M.startsWith(k+"/")?y(M)===k:!1,_=(k,M)=>{const T=new Set,L=P=>{for(const F of P)if(F.children&&F.children.length>0){if(L(F.children)||b(F.url,M))return T.add(F.id),!0}else if(b(F.url,M))return!0;return!1};return L(k),T};v.useEffect(()=>{if(n.length>0&&g){const k=_(n,g);k.size>0&&d(M=>new Set([...M,...k]))}},[g,n]);const x=k=>b(k,g),E=k=>k.children?k.children.some(M=>x(M.url)||E(M)):!1,S=k=>{d(M=>{const T=new Set(M);return T.has(k)?T.delete(k):T.add(k),T})},w=k=>typeof k=="string"?k:k[u]||k.en||Object.values(k)[0]||"",N=(k,M)=>{jr()?.dispatch?(k.preventDefault(),jr().navigation?.onComplete(()=>{jr().dispatch({handler:"setState",params:{target:"global",sidebarOpen:!1}})}),jr().dispatch({handler:"navigate",params:{path:M}})):window.location.href=M},C=(k,M=0,T=!1)=>{const L=k.children&&k.children.length>0,P=c.has(k.id),F=w(k.name),D=M>0,A=x(k.url),O=E(k),V=D?"admin-sidebar-subitem":"admin-sidebar-item",H="admin-sidebar-item-active",W="admin-sidebar-item-active-parent",j="admin-sidebar-item-default";return h.jsxs(I,{className:D?"relative group":"",children:[D&&h.jsxs(h.Fragment,{children:[!T&&h.jsx(I,{className:"admin-sidebar-tree-line-vertical"}),h.jsx(I,{className:"admin-sidebar-tree-line-curve"})]}),L&&k.url?h.jsxs(I,{className:`
|
||
${V}
|
||
${A?H:O?W:j}
|
||
${r?"justify-center":""}
|
||
`,children:[h.jsxs(oe,{onClick:B=>N(B,k.url),className:"flex items-center justify-start flex-1 min-w-0",children:[k.icon&&h.jsx(gt,{className:`${k.icon} ${r?"":"mr-3"} w-5 h-5 flex items-center justify-center`}),!r&&h.jsx(Q,{className:"truncate",children:F})]}),!r&&h.jsxs(I,{className:"admin-sidebar-chevron-trail",children:[k.module_id&&h.jsx(gt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"}),h.jsx(oe,{onClick:()=>S(k.id),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600","aria-label":il(P?"common.collapse":"common.expand"),children:h.jsx(gt,{className:`fas fa-chevron-down w-4 h-4 transition-transform ${P?"rotate-180":""}`})})]})]}):L?h.jsxs(oe,{onClick:()=>S(k.id),className:`
|
||
${V}
|
||
${O?W:j}
|
||
${r?"justify-center":""}
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[k.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(gt,{className:k.icon})}),!r&&h.jsx(Q,{children:F})]}),!r&&h.jsxs(I,{className:"admin-sidebar-chevron-trail",children:[k.module_id&&h.jsx(gt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"}),h.jsx(gt,{className:`fas fa-chevron-right w-4 h-4 text-slate-400 transition-transform duration-200 ${P?"rotate-90":""}`})]})]}):k.url?h.jsxs(oe,{onClick:B=>N(B,k.url),className:`
|
||
${V}
|
||
${A?H:j}
|
||
${r?"justify-center":""}
|
||
text-left
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[k.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(gt,{className:k.icon})}),!r&&h.jsx(Q,{children:F})]}),!r&&k.module_id&&h.jsx(gt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"})]}):h.jsxs(oe,{className:`
|
||
${V}
|
||
admin-sidebar-item-disabled
|
||
${r?"justify-center":""}
|
||
text-left
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[k.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(gt,{className:k.icon})}),!r&&h.jsx(Q,{children:F})]}),!r&&k.module_id&&h.jsx(gt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"})]}),L&&!r&&P&&h.jsx(I,{className:"relative ml-2",children:k.children.map((B,G)=>C(B,M+1,G===k.children.length-1))})]},k.id)};return h.jsxs(I,{className:o,id:a,...l,children:[(t||s)&&h.jsxs(I,{className:"admin-sidebar-header",children:[t&&!r&&h.jsx(kn,{src:t,alt:e,className:"h-8"}),s&&h.jsx(oe,{onClick:s,className:"admin-sidebar-collapse-btn","aria-label":il(r?"common.expand_sidebar":"common.collapse_sidebar"),children:h.jsx(gt,{className:`${r?"fas fa-chevron-right":"fas fa-chevron-left"} w-5 h-5 text-slate-600 dark:text-slate-400`})})]}),h.jsx(I,{className:"admin-sidebar-menu-list",children:n.map((k,M)=>C(k,0,M===n.length-1))})]})},Os=(t,e)=>window.G7Core?.t?.(t,e)??t,vy=({user:t={name:"",email:""},notifications:e=[],onNotificationClick:n,onProfileClick:r,onLogoutClick:s,className:o=""})=>{const[i,a]=v.useState(!1),[l,c]=v.useState(!1),d=v.useRef(null),u=v.useRef(null),f=e.filter(g=>!g.read).length;return v.useEffect(()=>{const g=m=>{d.current&&!d.current.contains(m.target)&&a(!1),u.current&&!u.current.contains(m.target)&&c(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),h.jsxs(I,{className:`
|
||
bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-6 py-4 flex items-center justify-end gap-4
|
||
${o}
|
||
`,children:[h.jsxs(I,{ref:d,className:"relative",children:[h.jsxs(oe,{onClick:()=>a(!i),className:"relative p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full transition-colors","aria-label":Os("common.notifications"),children:[h.jsx(re,{name:de.Bell,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),f>0&&h.jsx(Q,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h-5 text-xs font-bold text-white bg-red-500 rounded-full",children:f>9?"9+":f})]}),i&&h.jsxs(I,{className:"absolute right-0 mt-2 w-80 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[h.jsx(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:h.jsx(Q,{className:"font-semibold text-gray-900 dark:text-white",children:Os("common.notifications")})}),h.jsx(I,{className:"max-h-96 overflow-y-auto",children:e.length===0?h.jsx(I,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:h.jsx(Q,{children:Os("common.no_notifications")})}):e.map(g=>h.jsx(oe,{onClick:()=>{g.onClick?.(),n?.(g.id),a(!1)},className:`
|
||
w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 border-b border-gray-100 dark:border-gray-700 transition-colors
|
||
${g.read?"":"bg-blue-50 dark:bg-blue-900/20"}
|
||
`,children:h.jsxs(I,{className:"flex items-start gap-3",children:[g.iconName&&h.jsx(re,{name:g.iconName,className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5"}),h.jsxs(I,{className:"flex-1",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:g.title}),h.jsx(I,{className:"text-gray-600 dark:text-gray-400 text-sm mt-1",children:g.message}),h.jsx(I,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1",children:g.time})]}),!g.read&&h.jsx(Q,{className:"w-2 h-2 bg-blue-500 rounded-full mt-1.5"})]})},g.id))})]})]}),h.jsxs(I,{ref:u,className:"relative",children:[h.jsxs(oe,{onClick:()=>c(!l),className:"flex items-center gap-3 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[t.avatar?h.jsx(kn,{src:t.avatar,alt:t.name,className:"w-8 h-8 rounded-full object-cover"}):h.jsx(I,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:"hidden md:block text-left",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:t.name}),t.role&&h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-xs",children:t.role})]}),h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]}),l&&h.jsxs(I,{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 z-50",children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white",children:t.name}),h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-sm",children:t.email})]}),h.jsxs(I,{className:"py-2",children:[h.jsxs(oe,{onClick:()=>{r?.(),c(!1)},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 text-gray-900 dark:text-white",children:[h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{children:Os("common.profile_settings")})]}),h.jsxs(oe,{onClick:()=>{s?.(),c(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 text-red-600 dark:text-red-400 transition-colors",children:[h.jsx(re,{name:de.ArrowRight,className:"w-5 h-5"}),h.jsx(Q,{children:Os("common.logout")})]})]})]})]})]})},xy=({notifications:t=[],unreadCount:e=0,hasMore:n=!1,loading:r=!1,titleText:s="Notifications",emptyText:o="No notifications",markAllReadText:i="Mark all as read",deleteAllText:a="Delete all",unreadOnlyText:l="Unread only",unreadOnly:c=!1,onNotificationClick:d,onClose:u,onLoadMore:f,onMarkAllRead:g,onDeleteAll:m,onDelete:p,onUnreadOnlyToggle:y,dropdownAlign:b="right",className:_="",id:x,editorAttrs:E})=>{const[S,w]=v.useState(!1),N=v.useRef(null),C=v.useRef(null),k=v.useRef(null),M=v.useRef(null),T=v.useRef(new Set),L=v.useRef(f),P=v.useRef(n),F=v.useRef(r),D=v.useRef(t.length),A=v.useRef(-1);v.useEffect(()=>{L.current=f,P.current=n,F.current=r,D.current=t.length}),v.useEffect(()=>{if(!M.current||!k.current||!S)return;A.current=-1;const W=new IntersectionObserver(([j])=>{j.isIntersecting&&(F.current||!P.current||A.current!==D.current&&(A.current=D.current,L.current?.()))},{root:k.current,threshold:.1});return W.observe(M.current),()=>W.disconnect()},[S]),v.useEffect(()=>{if(!k.current||!S)return;const W=new IntersectionObserver(U=>{U.forEach(B=>{const G=B.target.getAttribute("data-notification-id"),z=B.target.getAttribute("data-unread")==="true";G&&z&&B.isIntersecting&&T.current.add(G)})},{root:k.current,threshold:.5});return k.current.querySelectorAll("[data-notification-id]").forEach(U=>W.observe(U)),()=>W.disconnect()},[S,t]);const O=e>0?e:t.filter(W=>!W.read).length,V=v.useCallback(()=>{if(S){if(O>0){const W=Array.from(T.current).filter(j=>{const U=t.find(B=>String(B.id)===String(j));return U&&!U.read});W.length>0&&u?.(W)}T.current.clear(),w(!1)}},[S,u,O,t]);v.useEffect(()=>{if(!S)return;const W=j=>{N.current&&!N.current.contains(j.target)&&V()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[S,V]);const H=v.useCallback(()=>{S?V():w(!0)},[S,V]);return v.useLayoutEffect(()=>{const W=C.current;if(!S||!W)return;W.style.transform="";const j=W.getBoundingClientRect(),U=typeof window<"u"?window.innerWidth:0;if(j.width===0&&j.height===0)return;const B=8;let G=0;j.right>U-B?G=-(j.right-(U-B)):j.left<B&&(G=B-j.left),G!==0&&(W.style.transform=`translateX(${G}px)`)},[S,b,t.length]),h.jsxs(I,{ref:N,className:`relative ${_}`,id:x,...E,children:[h.jsxs(oe,{onClick:H,className:"relative w-9 h-9 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors cursor-pointer","aria-label":s,children:[h.jsx(re,{name:de.Bell,className:"text-sm text-slate-500 dark:text-slate-400"}),O>0&&h.jsx(Q,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h-5 text-xs font-bold text-white bg-red-500 dark:bg-red-600 rounded-full",children:O>99?"99+":O})]}),S&&h.jsxs(I,{ref:C,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:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between gap-2",children:[h.jsxs(I,{className:"flex items-center gap-3 min-w-0",children:[h.jsx(Q,{className:"font-semibold text-gray-900 dark:text-white",children:s}),y&&h.jsxs(I,{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>y(!c),children:[h.jsx(wt,{type:"checkbox",checked:c,onChange:W=>{W.stopPropagation(),y(W.target.checked)},onClick:W=>W.stopPropagation(),className:"w-3.5 h-3.5 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-400 focus:ring-blue-500 dark:focus:ring-blue-400 cursor-pointer"}),h.jsx(Q,{className:"text-xs text-gray-600 dark:text-gray-400",children:l})]})]}),h.jsxs(I,{className:"flex items-center gap-3 flex-shrink-0",children:[g&&O>0&&h.jsx(oe,{onClick:()=>{g(),T.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:i}),m&&t.length>0&&h.jsx(oe,{onClick:()=>{m()},className:"text-xs text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300 hover:underline cursor-pointer",children:a})]})]}),h.jsx(I,{ref:k,className:"max-h-96 overflow-y-auto",children:t.length===0&&!r?h.jsx(I,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:h.jsx(Q,{children:o})}):h.jsxs(h.Fragment,{children:[t.map(W=>{const j=!W.read;return h.jsxs(I,{"data-notification-id":W.id,"data-unread":j?"true":"false",onClick:()=>{W.onClick?.(),d?.(W),w(!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 ${j?"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:[W.iconName&&h.jsx(re,{name:W.iconName,className:`w-5 h-5 mt-0.5 flex-shrink-0 ${j?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"}`}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsx(I,{className:`text-sm truncate ${j?"font-semibold text-gray-900 dark:text-white":"font-normal text-gray-600 dark:text-gray-400"}`,children:W.title}),h.jsx(I,{className:`text-sm mt-1 line-clamp-2 ${j?"text-gray-700 dark:text-gray-300":"text-gray-500 dark:text-gray-500"}`,children:W.message}),h.jsx(I,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1 font-mono",children:W.time})]}),h.jsxs(I,{className:"flex flex-col items-center gap-2 flex-shrink-0",children:[j&&h.jsx(Q,{className:"w-2 h-2 bg-blue-500 dark:bg-blue-400 rounded-full mt-1.5"}),p&&h.jsx(oe,{onClick:U=>{U.stopPropagation(),p(W)},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:h.jsx(re,{name:de.Trash,className:"w-4 h-4"})})]})]},W.id)}),n&&h.jsx(I,{ref:M,className:"px-4 py-3 text-center",children:r?h.jsx(Q,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."}):h.jsx(Q,{className:"text-sm text-gray-400 dark:text-gray-500"})}),r&&!n&&t.length>0&&h.jsx(I,{className:"px-4 py-2 text-center",children:h.jsx(Q,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."})})]})})]})]})},cu=window.G7Core?.createLogger?.("Comp:UserProfile")??{log:(...t)=>console.log("[Comp:UserProfile]",...t),warn:(...t)=>console.warn("[Comp:UserProfile]",...t),error:(...t)=>console.error("[Comp:UserProfile]",...t)},wy=({user:t={name:"",email:""},profileText:e="Profile Settings",logoutText:n="Logout",onProfileClick:r,onLogoutClick:s,className:o="",logoutEndpoint:i="/api/admin/auth/logout",redirectPath:a="/admin/login",showChevron:l=!0,dropdownDirection:c="up",dropdownOnly:d=!1,id:u,editorAttrs:f})=>{const[g,m]=v.useState(!1),[p,y]=v.useState(!1),b=v.useRef(null);v.useEffect(()=>{const S=w=>{b.current&&!b.current.contains(w.target)&&m(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]);const _=()=>{const w=`; ${document.cookie}`.split("; XSRF-TOKEN=");return w.length===2?decodeURIComponent(w.pop()?.split(";").shift()||""):null},x=()=>localStorage.getItem("auth_token"),E=async()=>{if(!p)try{if(y(!0),m(!1),s){s();return}const S=_(),w=x(),N=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...S&&{"X-XSRF-TOKEN":S},...w&&{Authorization:`Bearer ${w}`}},credentials:"include"});N.ok?(localStorage.removeItem("auth_token"),window.location.href=a):(cu.error("로그아웃 실패:",N.statusText),localStorage.removeItem("auth_token"),window.location.href=a)}catch(S){cu.error("로그아웃 오류:",S),localStorage.removeItem("auth_token"),window.location.href=a}finally{y(!1)}};return h.jsxs(I,{ref:b,className:d?`absolute inset-0 ${o}`:`relative ${o}`,id:u,...f,children:[h.jsx(oe,{onClick:()=>m(!g),className:d?"w-full h-full opacity-0 cursor-pointer":"flex items-center gap-2 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors w-full",children:!d&&h.jsxs(h.Fragment,{children:[t.avatar?h.jsx(kn,{src:t.avatar,alt:t.name,className:"w-8 h-8 rounded-full object-cover"}):h.jsx(I,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:"flex-1 text-left",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:t.name}),t.role&&h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-xs",children:t.role})]}),l&&h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]})}),g&&h.jsxs(I,{className:`absolute ${c==="down"?"top-full mt-2":"bottom-full mb-2"} ${d?"right-0 w-72":"left-0 w-full"} bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50`,children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",onClick:()=>{m(!1),window.G7Core?.dispatch({handler:"navigate",params:{path:`/admin/users/${t.uuid}`}})},children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white",children:t.name}),h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-sm",children:t.email})]}),h.jsxs(I,{className:"py-2",children:[h.jsxs(oe,{onClick:()=>{m(!1),r?r():window.G7Core?.dispatch({handler:"navigate",params:{path:`/admin/users/${t.uuid}/edit`}})},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-start gap-3 transition-colors",children:[h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"text-gray-900 dark:text-white",children:e})]}),h.jsxs(oe,{onClick:E,disabled:p,className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-start gap-3 text-red-600 dark:text-red-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[h.jsx(re,{name:de.ArrowRight,className:"w-5 h-5"}),h.jsx(Q,{children:p?"Logging out...":n})]})]})]})]})},jo=window.G7Core?.createLogger?.("Comp:LanguageSelector")??{log:(...t)=>console.log("[Comp:LanguageSelector]",...t),warn:(...t)=>console.warn("[Comp:LanguageSelector]",...t),error:(...t)=>console.error("[Comp:LanguageSelector]",...t)},du=t=>{const e=window.G7Core?.state?.get?.("_global.appConfig.localeNames")?.[t];return e||{ko:"한국어",en:"English",ja:"日本語",zh:"中文",es:"Español",fr:"Français",de:"Deutsch"}[t]||t},ky=({availableLocales:t=["ko","en"],languageText:e="Language",apiEndpoint:n="/api/admin/users/me/language",onLanguageChange:r,className:s="",inline:o=!1,showCode:i=!1,id:a,editorAttrs:l})=>{const[c,d]=v.useState(!1),[u,f]=v.useState(!1),[g,m]=v.useState(()=>localStorage.getItem("g7_locale")||"ko"),p=v.useRef(null);v.useEffect(()=>{if(o)return;const x=E=>{p.current&&!p.current.contains(E.target)&&d(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const y=()=>{const E=`; ${document.cookie}`.split("; XSRF-TOKEN=");return E.length===2?decodeURIComponent(E.pop()?.split(";").shift()||""):null},b=()=>localStorage.getItem("auth_token"),_=async x=>{if(!(u||x===g))try{f(!0);const E=y(),S=b();try{const w=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json",Accept:"application/json",...E&&{"X-XSRF-TOKEN":E},...S&&{Authorization:`Bearer ${S}`}},credentials:"include",body:JSON.stringify({language:x})});w.ok||jo.warn("언어 설정 저장 실패 (UI는 변경됨):",w.statusText)}catch(w){jo.warn("언어 설정 API 호출 실패 (UI는 변경됨):",w)}m(x),d(!1),r?.(x),window.__templateApp?await window.__templateApp.changeLocale(x):(jo.warn("TemplateApp not found, reloading page"),window.location.reload())}catch(E){jo.error("언어 변경 오류:",E)}finally{f(!1)}};return o?h.jsxs(I,{className:`${s}`,id:a,...l,children:[h.jsxs(oe,{onClick:()=>d(!c),disabled:u,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",children:[h.jsx(re,{name:de.Globe,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"text-gray-900 dark:text-white flex-1",children:e}),h.jsx(Q,{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300 rounded",children:g.toUpperCase()}),h.jsx(re,{name:de.ChevronDown,className:`w-4 h-4 text-gray-400 dark:text-gray-500 transition-transform ${c?"rotate-180":""}`})]}),c&&h.jsx(I,{className:"px-4 py-2 flex flex-wrap gap-2",children:t.map(x=>h.jsx(oe,{onClick:()=>_(x),disabled:u,className:`
|
||
px-3 py-1.5 text-sm font-medium rounded-md transition-colors
|
||
${g===x?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
${u?"opacity-50 cursor-not-allowed":""}
|
||
`,children:du(x)},x))})]}):h.jsxs(I,{ref:p,className:`relative ${s}`,id:a,...l,children:[h.jsxs(oe,{onClick:()=>d(!c),className:i?"flex items-center gap-1.5 px-2.5 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors cursor-pointer":"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors","aria-haspopup":"listbox","aria-expanded":c,"aria-label":e,children:[h.jsx(re,{name:de.Globe,className:i?"w-4 h-4":"w-5 h-5 text-gray-600 dark:text-gray-400"}),i&&h.jsx(Q,{className:"font-medium uppercase",children:g}),i&&h.jsx(re,{name:de.ChevronDown,className:"w-3 h-3"})]}),c&&h.jsx(I,{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:h.jsx(I,{className:"py-2",children:t.map(x=>h.jsxs(oe,{onClick:()=>_(x),disabled:u,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
|
||
${g===x?"bg-gray-50 dark:bg-gray-700":""}
|
||
${u?"opacity-50 cursor-not-allowed":""}
|
||
`,children:[h.jsx(Q,{className:"text-gray-900 dark:text-white flex-1",children:du(x)}),g===x&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400"})]},x))})})]})},Cy=({copyright:t="© 2026 G7",version:e,quickLinks:n=[],className:r="",changelogModalId:s,copyrightModalId:o,id:i,editorAttrs:a})=>{const l=v.useCallback(()=>{s&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/changelog",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreChangelogContent:"{{response.data.content}}"}},{handler:"openModal",target:s}],onError:[{handler:"openModal",target:s}]}]})},[s]),c=v.useCallback(()=>{o&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/license",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreLicenseContent:"{{response.data.content}}"}},{handler:"openModal",target:o}],onError:[{handler:"openModal",target:o}]}]})},[o]);return h.jsx(I,{className:`admin-footer ${r}`,id:i,...a,children:h.jsxs(I,{className:"admin-footer-row",children:[h.jsxs(I,{className:"admin-footer-group",children:[h.jsx(Q,{className:o?"admin-footer-link-hover":"",onClick:o?c:void 0,children:t}),e&&h.jsxs(h.Fragment,{children:[h.jsx(Q,{className:"hidden md:inline",children:"•"}),h.jsxs(Q,{className:`flex-center gap-2 ${s?"admin-footer-link-hover":""}`,onClick:s?l:void 0,children:[h.jsx(re,{name:de.Tag,className:"w-4 h-4"}),h.jsxs(Q,{children:["v",e]})]})]})]}),n.length>0&&h.jsx(I,{className:"flex-center gap-4",children:n.map(d=>h.jsxs(Fr,{href:d.url,className:"admin-footer-link",children:[d.iconName&&h.jsx(re,{name:d.iconName,className:"w-4 h-4"}),h.jsx(Q,{children:d.label})]},d.id))})]})})},Sy=({title:t,description:e,breadcrumbItems:n,tabs:r,onTabChange:s,actions:o,className:i="",children:a,id:l,editorAttrs:c})=>{const d=(u="secondary")=>({primary:"page-action-primary",secondary:"page-action-secondary",danger:"page-action-danger",ghost:"page-action-ghost"})[u];return h.jsxs(I,{className:i,id:l,...c,children:[n&&n.length>0&&h.jsx(I,{className:"mb-md",children:h.jsx(au,{items:n})}),h.jsxs(I,{className:"flex-between mb-lg",children:[h.jsxs(I,{children:[h.jsx(Pa,{className:"page-title",children:t}),e&&h.jsx(yt,{className:"page-description",children:e})]}),a?h.jsx(I,{className:"flex-center page-actions",children:a}):o&&o.length>0?h.jsx(I,{className:"page-actions",children:o.map(u=>h.jsxs(oe,{onClick:u.onClick,disabled:u.disabled,className:d(u.variant),children:[u.iconName&&h.jsx(re,{name:u.iconName,className:"icon-md"}),u.variant!=="ghost"&&u.label&&h.jsx(I,{children:u.label})]},u.id))}):null]}),r&&r.length>0&&h.jsx(I,{className:"tab-container",children:r.map(u=>h.jsxs(oe,{onClick:()=>s?.(u.value),className:u.active?"tab-btn-active":"tab-btn",children:[h.jsx(I,{children:u.label}),u.badge!==void 0&&h.jsx(I,{className:u.active?"tab-badge-active":"tab-badge",children:u.badge})]},u.id))})]})},_y=()=>window.G7Core,Ey=({title:t,description:e,className:n="",style:r,children:s,id:o,editorAttrs:i})=>{const a="flex items-center justify-between",l=_y()?.style?.mergeClasses?.(a,n)??`${a} ${n}`;return h.jsxs(I,{className:l,style:r,id:o,...i,children:[h.jsxs(I,{children:[t&&h.jsx(er,{className:"text-base font-semibold text-gray-900 dark:text-white",children:t}),e&&h.jsx(yt,{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:e})]}),s&&h.jsx(I,{className:"flex items-center gap-2",children:s})]})},nr=(t,e)=>window.G7Core?.t?.(t,e)??t,My=({image:t,imageAlt:e,vendor:n,name:r,version:s,status:o,updateAvailable:i=!1,latestVersion:a,dependencies:l=[],showLayoutEditButton:c=!1,actions:d=[],onLayoutEditClick:u,className:f="",id:g,editorAttrs:m})=>{const p=b=>({active:"success",inactive:"default",pending:"pending",error:"error"})[b],y=b=>({active:nr("common.status_active"),inactive:nr("common.status_inactive"),pending:nr("common.status_pending"),error:nr("common.status_error")})[b];return h.jsxs(I,{className:`
|
||
bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden hover:shadow-lg transition-shadow
|
||
${f}
|
||
`,id:g,...m,children:[t&&h.jsxs(I,{className:"relative",children:[h.jsx(kn,{src:t,alt:e||nr("common.template_preview",{vendor:n,name:r}),className:"w-full h-48 object-cover"}),h.jsx(I,{className:"absolute top-3 right-3",children:h.jsx(Fo,{status:p(o),label:y(o),showIcon:!0})}),i&&h.jsx(I,{className:"absolute top-3 left-3",children:h.jsxs(Q,{className:"flex items-center gap-1 px-2 py-1 bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border border-yellow-200 dark:border-yellow-800 rounded-md text-xs font-semibold",children:[h.jsx(re,{name:de.ExclamationTriangle,className:"w-3 h-3"}),h.jsx(Q,{children:nr("common.update_available")})]})})]}),h.jsxs(I,{className:"p-4",children:[h.jsxs(I,{className:"flex items-start justify-between mb-3",children:[h.jsxs(I,{className:"flex-1",children:[h.jsxs($r,{className:"text-lg font-bold text-gray-900 dark:text-white",children:[n,"/",r]}),h.jsxs(I,{className:"flex items-center gap-2 mt-1 text-sm text-gray-600 dark:text-gray-400",children:[h.jsxs(Q,{children:["v",s]}),i&&a&&h.jsxs(h.Fragment,{children:[h.jsx(Q,{children:"→"}),h.jsxs(Q,{className:"text-yellow-600 dark:text-yellow-400 font-semibold",children:["v",a]})]})]}),!t&&h.jsx(I,{className:"mt-2",children:h.jsx(Fo,{status:p(o),label:y(o),showIcon:!0})})]}),d.length>0&&h.jsx(Cs,{items:d,triggerIconName:de.EllipsisVertical,position:"left"})]}),l.length>0&&h.jsxs(I,{className:"mb-3",children:[h.jsxs(yt,{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:[nr("common.dependencies"),":"]}),h.jsx(I,{className:"flex flex-wrap gap-1",children:l.map((b,_)=>h.jsx(Q,{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:b},_))})]}),c&&u&&h.jsxs(oe,{onClick:u,className:"w-full px-4 py-2 bg-blue-600 dark:bg-blue-500 text-white rounded-md hover:bg-blue-700 dark:hover:bg-blue-600 transition-colors flex items-center justify-center gap-2 font-medium",children:[h.jsx(re,{name:de.Edit,className:"w-4 h-4"}),h.jsx(Q,{children:nr("common.edit_layout")})]})]})]})},uu=({type:t,message:e,dismissible:n=!1,onDismiss:r,className:s="",id:o,editorAttrs:i})=>{const a={info:{containerClass:"alert-info",iconClass:"alert-icon-info",textClass:"alert-text-info",icon:de.InfoCircle},success:{containerClass:"alert-success",iconClass:"alert-icon-success",textClass:"alert-text-success",icon:de.CheckCircle},warning:{containerClass:"alert-warning",iconClass:"alert-icon-warning",textClass:"alert-text-warning",icon:de.ExclamationTriangle},error:{containerClass:"alert-error",iconClass:"alert-icon-error",textClass:"alert-text-error",icon:de.TimesCircle}},l=a[t]??a.info;return h.jsxs(I,{className:`${l.containerClass} ${s}`,role:"alert","aria-live":"polite",id:o,...i,children:[h.jsx(re,{name:l.icon,className:l.iconClass,ariaLabel:`${t} icon`}),h.jsx(yt,{className:l.textClass,children:e}),n&&h.jsx(oe,{onClick:r,className:`alert-dismiss ${l.textClass}`,"aria-label":"Close alert",children:h.jsx(re,{name:de.Times,className:l.iconClass,ariaLabel:"Close"})})]})},Ny=({layoutName:t,onBack:e,onPreview:n,onSave:r,isSaving:s=!1,className:o=""})=>{const i=`
|
||
flex items-center justify-between gap-4 p-4 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700
|
||
${o}
|
||
`.trim().replace(/\s+/g," ");return h.jsxs(I,{className:i,children:[h.jsxs(I,{className:"flex items-center gap-3",children:[h.jsx(oe,{onClick:e,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors bg-transparent border-0 cursor-pointer","aria-label":"뒤로가기",children:h.jsx(re,{name:de.ArrowLeft,className:"text-gray-700 dark:text-gray-300",ariaLabel:"뒤로가기"})}),h.jsx(er,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:t})]}),h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(oe,{onClick:n,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors border-0 cursor-pointer","aria-label":"미리보기",children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(re,{name:de.Eye,className:"text-gray-700 dark:text-gray-300",ariaLabel:"미리보기 아이콘"}),h.jsx("span",{children:"미리보기"})]})}),h.jsx(oe,{onClick:r,disabled:s,className:`
|
||
px-4 py-2 rounded-lg transition-colors border-0 cursor-pointer
|
||
${s?"bg-blue-400 dark:bg-blue-600 cursor-not-allowed":"bg-blue-600 dark:bg-blue-500 hover:bg-blue-700 dark:hover:bg-blue-600"}
|
||
text-white
|
||
`.trim().replace(/\s+/g," "),"aria-label":s?"저장 중...":"저장",children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(re,{name:s?de.Spinner:de.Save,className:`text-white ${s?"animate-spin":""}`,ariaLabel:s?"저장 중 아이콘":"저장 아이콘"}),h.jsx("span",{children:s?"저장 중...":"저장"})]})})]})]})},Oy=({files:t,selectedId:e,onSelect:n,className:r=""})=>{const s=a=>{try{const l=new Date(a);if(isNaN(l.getTime()))return a;const c=l.getFullYear(),d=String(l.getMonth()+1).padStart(2,"0"),u=String(l.getDate()).padStart(2,"0"),f=String(l.getHours()).padStart(2,"0"),g=String(l.getMinutes()).padStart(2,"0");return`${c}-${d}-${u} ${f}:${g}`}catch{return a}},o=a=>{n(a)},i=`
|
||
w-full
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:i,children:t.length===0?h.jsx(I,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"파일이 없습니다."}):h.jsx($a,{className:"divide-y divide-gray-200 dark:divide-gray-700",role:"listbox","aria-label":"레이아웃 파일 목록",children:t.map(a=>{const l=a.id===e,c=`
|
||
flex items-center justify-between p-4 cursor-pointer
|
||
transition-colors duration-150
|
||
${l?"bg-blue-100 dark:bg-blue-900 border-l-4 border-blue-500":"hover:bg-gray-100 dark:hover:bg-gray-800"}
|
||
`.trim().replace(/\s+/g," "),d=`
|
||
font-medium
|
||
${l?"text-blue-900 dark:text-blue-100":"text-gray-900 dark:text-gray-100"}
|
||
`.trim().replace(/\s+/g," "),u=`
|
||
text-sm
|
||
${l?"text-blue-700 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(Fa,{className:c,onClick:()=>o(a.id),role:"option","aria-selected":l,tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),o(a.id))},children:h.jsxs(I,{className:"flex flex-col gap-1",children:[h.jsx(Q,{className:d,children:a.name}),h.jsx(Q,{className:u,children:s(a.updated_at)})]})},a.id)})})})};function fu(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ty(t){if(Array.isArray(t))return t}function Ay(t,e,n){return(e=Vy(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dy(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function Iy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function gu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hu(Object(n),!0).forEach(function(r){Ay(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ly(t,e){if(t==null)return{};var n,r,s=Py(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}function Py(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function $y(t,e){return Ty(t)||Dy(t,e)||zy(t,e)||Iy()}function Fy(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vy(t){var e=Fy(t,"string");return typeof e=="symbol"?e:e+""}function zy(t,e){if(t){if(typeof t=="string")return fu(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fu(t,e):void 0}}function Hy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function mu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?pu(Object(n),!0).forEach(function(r){Hy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Uy(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return e.reduceRight(function(s,o){return o(s)},r)}}function Ts(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=t.length?t.apply(this,s):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return e.apply(n,[].concat(s,a))}}}function Wo(t){return{}.toString.call(t).includes("Object")}function By(t){return!Object.keys(t).length}function As(t){return typeof t=="function"}function jy(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Wy(t,e){return Wo(e)||rr("changeType"),Object.keys(e).some(function(n){return!jy(t,n)})&&rr("changeField"),e}function Gy(t){As(t)||rr("selectorType")}function Yy(t){As(t)||Wo(t)||rr("handlerType"),Wo(t)&&Object.values(t).some(function(e){return!As(e)})&&rr("handlersType")}function Xy(t){t||rr("initialIsRequired"),Wo(t)||rr("initialType"),By(t)&&rr("initialContent")}function Ky(t,e){throw new Error(t[e]||t.default)}var qy={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},rr=Ts(Ky)(qy),Go={changes:Wy,selector:Gy,handler:Yy,initial:Xy};function Zy(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Go.initial(t),Go.handler(e);var n={current:t},r=Ts(Ry)(n,e),s=Ts(Jy)(n),o=Ts(Go.changes)(t),i=Ts(Qy)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Go.selector(c),c(n.current)}function l(c){Uy(r,s,o,i)(c)}return[a,l]}function Qy(t,e){return As(e)?e(t.current):e}function Jy(t,e){return t.current=mu(mu({},t.current),e),e}function Ry(t,e,n){return As(e)?e(t.current):Object.keys(n).forEach(function(r){var s;return(s=e[r])===null||s===void 0?void 0:s.call(e,t.current[r])}),n}var ev={create:Zy},tv={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function nv(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=t.length?t.apply(this,s):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return e.apply(n,[].concat(s,a))}}}function rv(t){return{}.toString.call(t).includes("Object")}function sv(t){return t||yu("configIsRequired"),rv(t)||yu("configType"),t.urls?(ov(),{paths:{vs:t.urls.monacoBase}}):t}function ov(){console.warn(bu.deprecation)}function iv(t,e){throw new Error(t[e]||t.default)}var bu={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
||
You are using deprecated way of configuration.
|
||
|
||
Instead of using
|
||
monaco.config({ urls: { monacoBase: '...' } })
|
||
use
|
||
monaco.config({ paths: { vs: '...' } })
|
||
|
||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||
`},yu=nv(iv)(bu),av={config:sv},lv=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,i){return i(o)},s)}};function vu(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],vu(t[n],e[n]))}),gu(gu({},t),e)}var cv={type:"cancelation",msg:"operation is manually canceled"};function al(t){var e=!1,n=new Promise(function(r,s){t.then(function(o){return e?s(cv):r(o)}),t.catch(s)});return n.cancel=function(){return e=!0},n}var dv=["monaco"],uv=ev.create({config:tv,isInitialized:!1,resolve:null,reject:null,monaco:null}),xu=$y(uv,2),Ds=xu[0],Yo=xu[1];function fv(t){var e=av.config(t),n=e.monaco,r=Ly(e,dv);Yo(function(s){return{config:vu(s.config,r),monaco:n}})}function hv(){var t=Ds(function(e){var n=e.monaco,r=e.isInitialized,s=e.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!t.isInitialized){if(Yo({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),al(ll);if(window.monaco&&window.monaco.editor)return wu(window.monaco),t.resolve(window.monaco),al(ll);lv(gv,mv)(bv)}return al(ll)}function gv(t){return document.body.appendChild(t)}function pv(t){var e=document.createElement("script");return t&&(e.src=t),e}function mv(t){var e=Ds(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=pv("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function bv(){var t=Ds(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){var r=n.m;wu(r),t.resolve(r)},function(n){t.reject(n)})}function wu(t){Ds().monaco||Yo({monaco:t})}function yv(){return Ds(function(t){var e=t.monaco;return e})}var ll=new Promise(function(t,e){return Yo({resolve:t,reject:e})}),ku={config:fv,init:hv,__getMonacoInstance:yv},vv={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},cl=vv,xv={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},wv=xv;function kv({children:t}){return v.createElement("div",{style:wv.container},t)}var Cv=kv,Sv=Cv;function _v({width:t,height:e,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:i}){return v.createElement("section",{style:{...cl.wrapper,width:t,height:e},...i},!n&&v.createElement(Sv,null,r),v.createElement("div",{ref:s,style:{...cl.fullWidth,...!n&&cl.hide},className:o}))}var Ev=_v,Cu=v.memo(Ev);function Mv(t){v.useEffect(t,[])}var Su=Mv;function Nv(t,e,n=!0){let r=v.useRef(!0);v.useEffect(r.current||!n?()=>{r.current=!1}:t,e)}var ln=Nv;function Is(){}function Wr(t,e,n,r){return Ov(t,r)||Tv(t,e,n,r)}function Ov(t,e){return t.editor.getModel(_u(t,e))}function Tv(t,e,n,r){return t.editor.createModel(e,n,r?_u(t,r):void 0)}function _u(t,e){return t.Uri.parse(e)}function Av({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:i,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:u={},height:f="100%",width:g="100%",className:m,wrapperProps:p={},beforeMount:y=Is,onMount:b=Is}){let[_,x]=v.useState(!1),[E,S]=v.useState(!0),w=v.useRef(null),N=v.useRef(null),C=v.useRef(null),k=v.useRef(b),M=v.useRef(y),T=v.useRef(!1);Su(()=>{let D=ku.init();return D.then(A=>(N.current=A)&&S(!1)).catch(A=>A?.type!=="cancelation"&&console.error("Monaco initialization: error:",A)),()=>w.current?F():D.cancel()}),ln(()=>{if(w.current&&N.current){let D=w.current.getOriginalEditor(),A=Wr(N.current,t||"",r||n||"text",o||"");A!==D.getModel()&&D.setModel(A)}},[o],_),ln(()=>{if(w.current&&N.current){let D=w.current.getModifiedEditor(),A=Wr(N.current,e||"",s||n||"text",i||"");A!==D.getModel()&&D.setModel(A)}},[i],_),ln(()=>{let D=w.current.getModifiedEditor();D.getOption(N.current.editor.EditorOption.readOnly)?D.setValue(e||""):e!==D.getValue()&&(D.executeEdits("",[{range:D.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),D.pushUndoStop())},[e],_),ln(()=>{w.current?.getModel()?.original.setValue(t||"")},[t],_),ln(()=>{let{original:D,modified:A}=w.current.getModel();N.current.editor.setModelLanguage(D,r||n||"text"),N.current.editor.setModelLanguage(A,s||n||"text")},[n,r,s],_),ln(()=>{N.current?.editor.setTheme(c)},[c],_),ln(()=>{w.current?.updateOptions(u)},[u],_);let L=v.useCallback(()=>{if(!N.current)return;M.current(N.current);let D=Wr(N.current,t||"",r||n||"text",o||""),A=Wr(N.current,e||"",s||n||"text",i||"");w.current?.setModel({original:D,modified:A})},[n,e,s,t,r,o,i]),P=v.useCallback(()=>{!T.current&&C.current&&(w.current=N.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...u}),L(),N.current?.editor.setTheme(c),x(!0),T.current=!0)},[u,c,L]);v.useEffect(()=>{_&&k.current(w.current,N.current)},[_]),v.useEffect(()=>{!E&&!_&&P()},[E,_,P]);function F(){let D=w.current?.getModel();a||D?.original?.dispose(),l||D?.modified?.dispose(),w.current?.dispose()}return v.createElement(Cu,{width:g,height:f,isEditorReady:_,loading:d,_ref:C,className:m,wrapperProps:p})}var Dv=Av;v.memo(Dv);function Iv(t){let e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}var Lv=Iv,Xo=new Map;function Pv({defaultValue:t,defaultLanguage:e,defaultPath:n,value:r,language:s,path:o,theme:i="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:u=!0,keepCurrentModel:f=!1,width:g="100%",height:m="100%",className:p,wrapperProps:y={},beforeMount:b=Is,onMount:_=Is,onChange:x,onValidate:E=Is}){let[S,w]=v.useState(!1),[N,C]=v.useState(!0),k=v.useRef(null),M=v.useRef(null),T=v.useRef(null),L=v.useRef(_),P=v.useRef(b),F=v.useRef(),D=v.useRef(r),A=Lv(o),O=v.useRef(!1),V=v.useRef(!1);Su(()=>{let j=ku.init();return j.then(U=>(k.current=U)&&C(!1)).catch(U=>U?.type!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>M.current?W():j.cancel()}),ln(()=>{let j=Wr(k.current,t||r||"",e||s||"",o||n||"");j!==M.current?.getModel()&&(u&&Xo.set(A,M.current?.saveViewState()),M.current?.setModel(j),u&&M.current?.restoreViewState(Xo.get(o)))},[o],S),ln(()=>{M.current?.updateOptions(c)},[c],S),ln(()=>{!M.current||r===void 0||(M.current.getOption(k.current.editor.EditorOption.readOnly)?M.current.setValue(r):r!==M.current.getValue()&&(V.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),M.current.pushUndoStop(),V.current=!1))},[r],S),ln(()=>{let j=M.current?.getModel();j&&s&&k.current?.editor.setModelLanguage(j,s)},[s],S),ln(()=>{a!==void 0&&M.current?.revealLine(a)},[a],S),ln(()=>{k.current?.editor.setTheme(i)},[i],S);let H=v.useCallback(()=>{if(!(!T.current||!k.current)&&!O.current){P.current(k.current);let j=o||n,U=Wr(k.current,r||t||"",e||s||"",j||"");M.current=k.current?.editor.create(T.current,{model:U,automaticLayout:!0,...c},d),u&&M.current.restoreViewState(Xo.get(j)),k.current.editor.setTheme(i),a!==void 0&&M.current.revealLine(a),w(!0),O.current=!0}},[t,e,n,r,s,o,c,d,u,i,a]);v.useEffect(()=>{S&&L.current(M.current,k.current)},[S]),v.useEffect(()=>{!N&&!S&&H()},[N,S,H]),D.current=r,v.useEffect(()=>{S&&x&&(F.current?.dispose(),F.current=M.current?.onDidChangeModelContent(j=>{V.current||x(M.current.getValue(),j)}))},[S,x]),v.useEffect(()=>{if(S){let j=k.current.editor.onDidChangeMarkers(U=>{let B=M.current.getModel()?.uri;if(B&&U.find(G=>G.path===B.path)){let G=k.current.editor.getModelMarkers({resource:B});E?.(G)}});return()=>{j?.dispose()}}return()=>{}},[S,E]);function W(){F.current?.dispose(),f?u&&Xo.set(o,M.current.saveViewState()):M.current.getModel()?.dispose(),M.current.dispose()}return v.createElement(Cu,{width:g,height:m,isEditorReady:S,loading:l,_ref:T,className:p,wrapperProps:y})}var $v=Pv,Fv=v.memo($v),Vv=Fv;const zv=({value:t,onChange:e,language:n="json",height:r="100%",readOnly:s=!1,theme:o="vs-dark"})=>{const i=v.useRef(null),a=(c,d)=>{i.current=c,n==="json"&&d.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemaValidation:"error",allowComments:!1}),c.updateOptions({readOnly:s,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,lineNumbers:"on",renderWhitespace:"selection",automaticLayout:!0})},l=c=>{e&&c!==void 0&&e({target:{value:c}})};return v.useEffect(()=>{i.current&&i.current.updateOptions({readOnly:s})},[s]),h.jsx("div",{className:"border border-gray-300 dark:border-gray-700 rounded-lg overflow-hidden",children:h.jsx(Vv,{height:r,language:n,value:t,theme:o,onChange:l,onMount:a,options:{readOnly:s,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,lineNumbers:"on",renderWhitespace:"selection",automaticLayout:!0}})})},Hv=t=>{const e=new Date(t);return new Intl.DateTimeFormat("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)},Eu=v.memo(({version:t,isSelected:e,onSelect:n})=>{const r=v.useCallback(()=>{n?.(t.id)},[n,t.id]);return h.jsx(Fa,{role:"listitem","aria-selected":e,className:`
|
||
p-3 rounded-lg border cursor-pointer transition-colors
|
||
${e?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 hover:border-gray-400 dark:border-gray-600 dark:hover:border-gray-500"}
|
||
`,onClick:r,children:h.jsxs(I,{className:"flex justify-between items-start",children:[h.jsxs(I,{className:"flex-1",children:[h.jsxs(Q,{className:"font-semibold text-gray-900 dark:text-gray-100",children:["버전 ",t.version]}),h.jsx(Q,{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:Hv(t.created_at)})]}),h.jsxs(I,{className:"flex gap-3 text-sm",children:[h.jsxs(Q,{className:"text-green-600 dark:text-green-400",children:["+",t.changes_summary.added]}),h.jsxs(Q,{className:"text-red-600 dark:text-red-400",children:["-",t.changes_summary.removed]})]})]})})});Eu.displayName="VersionListItem";const Mu=({versions:t,selectedId:e,onSelect:n})=>t.length===0?h.jsx(I,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"버전이 없습니다."}):h.jsx($a,{role:"list",className:"space-y-2",children:t.map(r=>h.jsx(Eu,{version:r,isSelected:e===r.id,onSelect:n},r.id))}),Uv=({layoutId:t,versions:e,onRestore:n})=>{const[r,s]=v.useState(),o=l=>{s(l)},i=()=>{r!==void 0&&n(r)},a=r===void 0;return h.jsxs(I,{className:"space-y-4",role:"region","aria-label":"레이아웃 히스토리 패널",children:[h.jsx(I,{className:"border border-gray-300 dark:border-gray-600 rounded-lg p-4",children:h.jsx(Mu,{versions:e,selectedId:r,onSelect:o})}),h.jsx(I,{className:"flex justify-end",children:h.jsx(oe,{variant:"primary",disabled:a,onClick:i,"aria-label":"선택한 버전으로 복원",children:"복원"})})]})},Bv=({emailLabel:t="Email",passwordLabel:e="Password",submitButtonText:n="Sign In",processingText:r="Processing...",emailPlaceholder:s="Email",passwordPlaceholder:o="Password",forgotPasswordText:i="Forgot your password?",forgotPasswordUrl:a="/admin/password/reset",emailRequiredError:l="Please enter your email.",emailInvalidError:c="Please enter a valid email address.",passwordRequiredError:d="Please enter your password.",onSubmit:u,loadingActions:f={},isLoading:g=!1,disabled:m=!1,apiError:p="",className:y="",style:b})=>{const[_,x]=v.useState(""),[E,S]=v.useState(""),[w,N]=v.useState({}),C=p,k=Object.values(f).some(F=>F===!0),M=g||k,T=m||M,L=()=>{const F={},D=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return!_||_.trim()===""?F.email=l:D.test(_)||(F.email=c),(!E||E.trim()==="")&&(F.password=d),N(F),Object.keys(F).length===0},P=async F=>{if(!L()){F.preventDefault();return}N({}),u?await u(F):F.preventDefault()};return h.jsx(I,{className:`w-full ${y}`,style:b,children:h.jsxs(Va,{onSubmit:P,className:"space-y-6",noValidate:!0,children:[C&&h.jsx(I,{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:h.jsx(yt,{className:"text-sm text-red-600 dark:text-red-400",children:C})}),h.jsxs(I,{children:[h.jsx(on,{htmlFor:"email",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:t}),h.jsx(wt,{id:"email",name:"email",type:"email",value:_,onChange:F=>x(F.target.value),placeholder:s,disabled:T,className:`
|
||
w-full px-4 py-3 rounded-lg border
|
||
${w.email?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
||
bg-white dark:bg-gray-800
|
||
text-gray-900 dark:text-white
|
||
placeholder-gray-400 dark:placeholder-gray-500
|
||
focus:outline-none focus:ring-2
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
`}),w.email&&h.jsx(yt,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:w.email})]}),h.jsxs(I,{children:[h.jsx(on,{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:e}),h.jsx(wt,{id:"password",name:"password",type:"password",value:E,onChange:F=>S(F.target.value),placeholder:o,disabled:T,className:`
|
||
w-full px-4 py-3 rounded-lg border
|
||
${w.password?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
||
bg-white dark:bg-gray-800
|
||
text-gray-900 dark:text-white
|
||
placeholder-gray-400 dark:placeholder-gray-500
|
||
focus:outline-none focus:ring-2
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
`}),w.password&&h.jsx(yt,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:w.password})]}),a&&h.jsx(I,{className:"flex items-center justify-end",children:h.jsx(Fr,{href:a,className:"text-sm text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300 transition-colors duration-200",children:i})}),h.jsx(oe,{type:"submit",disabled:T,className:`
|
||
w-full px-4 py-3 rounded-lg font-medium
|
||
bg-blue-600 hover:bg-blue-700
|
||
dark:bg-blue-500 dark:hover:bg-blue-600
|
||
text-white
|
||
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
|
||
dark:focus:ring-offset-gray-900
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
flex items-center justify-center
|
||
`,children:M?h.jsxs(h.Fragment,{children:[h.jsxs(Wn,{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r]}):n})]})})},Nu=t=>t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,dl=t=>{const e=Nu(t);document.documentElement.setAttribute("data-theme",e),e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},jv=()=>{const t=localStorage.getItem("g7_color_scheme");return t&&["auto","light","dark"].includes(t)?t:"auto"},Wv=({onThemeChange:t,className:e="",autoText:n="System",lightText:r="Light",darkText:s="Dark",id:o,editorAttrs:i})=>{const a=jv(),[l,c]=v.useState(a),[d,u]=v.useState(!1),f=v.useRef(null);v.useEffect(()=>{dl(l)},[]),v.useEffect(()=>{if(l!=="auto")return;const p=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{dl("auto")};return p.addEventListener("change",y),()=>p.removeEventListener("change",y)},[l]),v.useEffect(()=>{const p=y=>{f.current&&!f.current.contains(y.target)&&u(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const g=p=>{c(p),localStorage.setItem("g7_color_scheme",p),dl(p),u(!1),t?.(p)},m=()=>Nu(l)==="dark"?de.Moon:de.Sun;return h.jsxs(I,{ref:f,className:`relative ${e}`,id:o,...i,children:[h.jsx(oe,{onClick:()=>u(!d),className:"w-9 h-9 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors","aria-label":"Toggle theme",children:h.jsx(re,{name:m(),className:"text-sm text-slate-500 dark:text-slate-400"})}),d&&h.jsx(I,{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:h.jsxs(I,{className:"py-2",children:[h.jsxs(oe,{onClick:()=>g("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
|
||
${l==="auto"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(re,{name:de.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),l==="auto"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),h.jsxs(oe,{onClick:()=>g("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
|
||
${l==="light"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(re,{name:de.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),l==="light"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),h.jsxs(oe,{onClick:()=>g("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
|
||
${l==="dark"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(re,{name:de.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:s}),l==="dark"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Ou=window.G7Core?.createLogger?.("Comp:ColumnSelector")??{log:(...t)=>console.log("[Comp:ColumnSelector]",...t),warn:(...t)=>console.warn("[Comp:ColumnSelector]",...t),error:(...t)=>console.error("[Comp:ColumnSelector]",...t)},Tu=(t,e)=>window.G7Core?.t?.(t,e)??t,Gv=()=>window.G7Core,Yv=({id:t,columns:e,visibleColumns:n,onColumnVisibilityChange:r,triggerLabel:s,triggerIconName:o=de.Sliders,position:i="right",className:a="",style:l,requiredText:c,menuTitle:d,menuDescription:u,defaultColumns:f,triggerClassName:g,labelClassName:m,dynamicColumns:p,dynamicColumnsInsertAfter:y,editorAttrs:b})=>{const _=s??Tu("common.column_selector"),x=c??Tu("common.required"),E=v.useMemo(()=>{if(!p||!Array.isArray(p)||p.length===0)return e;if(y){const z=e.findIndex(X=>X.field===y);if(z!==-1)return[...e.slice(0,z+1),...p,...e.slice(z+1)]}return[...e,...p]},[e,p,y]),[S,w]=v.useState(!1),N=v.useRef(null),C=v.useRef(null),[k,M]=v.useState(!1),[T,L]=v.useState(i),P=v.useMemo(()=>{try{const z=window.G7Core?.AuthManager?.getInstance();return z?z.getUser()?.uuid:void 0}catch{return}},[]),F=t?`g7_columns_${t}${P!==void 0?`_${P}`:""}`:null,D=()=>{if(!F)return null;try{const z=localStorage.getItem(F);if(z){const X=JSON.parse(z);if(Array.isArray(X)&&X.length>0)return X}}catch(z){Ou.warn("Failed to load from localStorage:",z)}return null},A=z=>{if(F)try{localStorage.setItem(F,JSON.stringify(z))}catch(X){Ou.warn("Failed to save to localStorage:",X)}},O=()=>{const z=D();return z||(n&&n.length>0?n:f&&f.length>0?f:E.filter(X=>X.visible!==!1).map(X=>X.field))},[V,H]=v.useState(O);v.useEffect(()=>{k||(r&&V.length>0&&r(V),M(!0))},[k,r,V]),v.useEffect(()=>{k&&n&&n.length>0&&(D()||H(n))},[n,k]);const W=v.useRef([]),j=v.useRef(null);v.useEffect(()=>{if(k&&p&&p.length>0){const z=p.map(Z=>Z.field);if(j.current===null){const Z=D();if(j.current=Z!==null,Z!==null){W.current=z;return}}const X=W.current,Y=z.filter(Z=>!X.includes(Z));if(Y.length>0){const Z=n&&n.length>0?n:V,ee=Y.filter(te=>!Z.includes(te));if(ee.length>0){const te=[...Z,...ee];H(te),A(te),r?.(te)}}W.current=z}},[p,k]);const U=n&&n.length>0?n:V;v.useEffect(()=>{const z=X=>{N.current&&!N.current.contains(X.target)&&w(!1)};return S&&document.addEventListener("mousedown",z),()=>{document.removeEventListener("mousedown",z)}},[S]),v.useEffect(()=>{if(S&&C.current&&N.current){const z=C.current.getBoundingClientRect(),X=N.current.getBoundingClientRect(),Y=window.innerWidth,Z=z.width||256;i==="right"?X.right-Z<0?L("left"):L("right"):X.left+Z>Y?L("right"):L("left")}},[S,i]);const B=z=>{if(E.find(Z=>Z.field===z)?.required)return;const Y=U.includes(z)?U.filter(Z=>Z!==z):[...U,z];H(Y),A(Y),r?.(Y)},G=T==="left"?"left-0":"right-0";return h.jsxs(I,{ref:N,className:`relative inline-block ${a}`,style:l,id:t,...b,children:[h.jsxs(oe,{onClick:()=>w(!S),className:Gv()?.style?.mergeClasses?.("flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",g)??`flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors ${g??""}`,children:[h.jsx(re,{name:o,className:"w-5 h-5"}),_&&h.jsx(Q,{className:`${m||"hidden sm:inline"} text-sm`,children:_})]}),S&&h.jsxs(I,{ref:C,className:`absolute ${G} z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg`,children:[(d||u)&&h.jsxs(I,{className:"px-4 pt-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:[d&&h.jsx(Q,{className:"block text-sm font-medium text-gray-900 dark:text-white",children:d}),u&&h.jsx(Q,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-1",children:u})]}),h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:E.map(z=>{const X=U.includes(z.field),Y=z.required===!0;return h.jsxs(I,{onClick:()=>!Y&&B(z.field),className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${Y?"cursor-default":"cursor-pointer"}`,children:[h.jsx(Cn,{checked:X,disabled:Y,readOnly:!0,className:"h-4 w-4 text-blue-600 rounded border-gray-300 dark:border-gray-600 pointer-events-none"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:z.header}),Y&&x&&h.jsx(Q,{className:"ml-auto text-xs text-gray-400 dark:text-gray-500",children:x})]},z.field)})})]})]})},Xv=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...t)=>console.log("[Comp:PageTransition]",...t),warn:(...t)=>console.warn("[Comp:PageTransition]",...t),error:(...t)=>console.error("[Comp:PageTransition]",...t)},Kv=({className:t="",style:e})=>{const[n,r]=v.useState(!1);return v.useEffect(()=>{const s=window.G7Core?.TransitionManager;if(!s){Xv.warn("TransitionManager를 찾을 수 없습니다.");return}return r(s.getIsPending()),s.subscribe(i=>{r(i)})},[]),n?h.jsxs(I,{className:`fixed top-0 left-0 right-0 z-[999] ${t}`,style:e,role:"progressbar","aria-label":"페이지 로딩 중",children:[h.jsx(I,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:h.jsx(I,{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"}})}),h.jsx("style",{children:`
|
||
@keyframes loading {
|
||
0% {
|
||
transform: translateX(-100%);
|
||
}
|
||
50% {
|
||
transform: translateX(300%);
|
||
}
|
||
100% {
|
||
transform: translateX(-100%);
|
||
}
|
||
}
|
||
`})]}):null},qv=(t,e)=>window.G7Core?.t?.(t,e)??t,Zv=({options:t})=>{const e=document.documentElement.classList.contains("dark"),n=e?"rgb(17,24,39)":"rgb(249,250,251)",r=e?"#6b7280":"#9ca3af",s=e?"#9ca3af":"#6b7280";return h.jsxs("div",{style:{position:"absolute",inset:0,zIndex:2147483647,overflow:"hidden",background:n,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",paddingTop:"15%",gap:"12px"},children:[h.jsx("div",{style:{width:"32px",height:"32px",border:`3px solid ${r}`,borderTopColor:"transparent",borderRadius:"50%",animation:"g7-spin 0.8s linear infinite"}}),h.jsx("span",{style:{color:s,fontSize:"14px"},children:t?.text||qv("nav.loading")})]})};function pr(t){"@babel/helpers - typeof";return pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pr(t)}function Qv(t,e){if(pr(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(pr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Au(t){var e=Qv(t,"string");return pr(e)=="symbol"?e:e+""}function Ls(t,e,n){return(e=Au(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Du(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Ee(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Du(Object(n),!0).forEach(function(r){Ls(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Du(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Jv(t){if(Array.isArray(t))return t}function Rv(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function ul(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Iu(t,e){if(t){if(typeof t=="string")return ul(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ul(t,e):void 0}}function ex(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gn(t,e){return Jv(t)||Rv(t,e)||Iu(t,e)||ex()}function tx(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function In(t,e){if(t==null)return{};var n,r,s=tx(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}var nx=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Lu(t){var e=t.defaultInputValue,n=e===void 0?"":e,r=t.defaultMenuIsOpen,s=r===void 0?!1:r,o=t.defaultValue,i=o===void 0?null:o,a=t.inputValue,l=t.menuIsOpen,c=t.onChange,d=t.onInputChange,u=t.onMenuClose,f=t.onMenuOpen,g=t.value,m=In(t,nx),p=v.useState(a!==void 0?a:n),y=Gn(p,2),b=y[0],_=y[1],x=v.useState(l!==void 0?l:s),E=Gn(x,2),S=E[0],w=E[1],N=v.useState(g!==void 0?g:i),C=Gn(N,2),k=C[0],M=C[1],T=v.useCallback(function(V,H){typeof c=="function"&&c(V,H),M(V)},[c]),L=v.useCallback(function(V,H){var W;typeof d=="function"&&(W=d(V,H)),_(W!==void 0?W:V)},[d]),P=v.useCallback(function(){typeof f=="function"&&f(),w(!0)},[f]),F=v.useCallback(function(){typeof u=="function"&&u(),w(!1)},[u]),D=a!==void 0?a:b,A=l!==void 0?l:S,O=g!==void 0?g:k;return Ee(Ee({},m),{},{inputValue:D,menuIsOpen:A,onChange:T,onInputChange:L,onMenuClose:F,onMenuOpen:P,value:O})}function Ae(){return Ae=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ae.apply(null,arguments)}function rx(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Au(r.key),r)}}function sx(t,e,n){return e&&Pu(t.prototype,e),n&&Pu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function fl(t,e){return fl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},fl(t,e)}function ox(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fl(t,e)}function Ko(t){return Ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ko(t)}function $u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($u=function(){return!!t})()}function ix(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ax(t,e){if(e&&(pr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ix(t)}function lx(t){var e=$u();return function(){var n,r=Ko(t);if(e){var s=Ko(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return ax(this,n)}}function cx(t){if(Array.isArray(t))return ul(t)}function dx(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ux(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gr(t){return cx(t)||dx(t)||Iu(t)||ux()}function fx(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function hx(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var gx=(function(){function t(n){var r=this;this._insertTag=function(s){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,o),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(hx(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var o=fx(s);try{o.insertRule(r,o.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},t})(),zt="-ms-",qo="-moz-",Qe="-webkit-",Fu="comm",hl="rule",gl="decl",px="@import",Vu="@keyframes",mx="@layer",bx=Math.abs,Zo=String.fromCharCode,yx=Object.assign;function vx(t,e){return $t(t,0)^45?(((e<<2^$t(t,0))<<2^$t(t,1))<<2^$t(t,2))<<2^$t(t,3):0}function zu(t){return t.trim()}function xx(t,e){return(t=e.exec(t))?t[0]:t}function Je(t,e,n){return t.replace(e,n)}function pl(t,e){return t.indexOf(e)}function $t(t,e){return t.charCodeAt(e)|0}function Ps(t,e,n){return t.slice(e,n)}function Ln(t){return t.length}function ml(t){return t.length}function Qo(t,e){return e.push(t),t}function wx(t,e){return t.map(e).join("")}var Jo=1,Yr=1,Hu=0,Rt=0,kt=0,Xr="";function Ro(t,e,n,r,s,o,i){return{value:t,root:e,parent:n,type:r,props:s,children:o,line:Jo,column:Yr,length:i,return:""}}function $s(t,e){return yx(Ro("",null,null,"",null,null,0),t,{length:-t.length},e)}function kx(){return kt}function Cx(){return kt=Rt>0?$t(Xr,--Rt):0,Yr--,kt===10&&(Yr=1,Jo--),kt}function cn(){return kt=Rt<Hu?$t(Xr,Rt++):0,Yr++,kt===10&&(Yr=1,Jo++),kt}function Pn(){return $t(Xr,Rt)}function ei(){return Rt}function Fs(t,e){return Ps(Xr,t,e)}function Vs(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Uu(t){return Jo=Yr=1,Hu=Ln(Xr=t),Rt=0,[]}function Bu(t){return Xr="",t}function ti(t){return zu(Fs(Rt-1,bl(t===91?t+2:t===40?t+1:t)))}function Sx(t){for(;(kt=Pn())&&kt<33;)cn();return Vs(t)>2||Vs(kt)>3?"":" "}function _x(t,e){for(;--e&&cn()&&!(kt<48||kt>102||kt>57&&kt<65||kt>70&&kt<97););return Fs(t,ei()+(e<6&&Pn()==32&&cn()==32))}function bl(t){for(;cn();)switch(kt){case t:return Rt;case 34:case 39:t!==34&&t!==39&&bl(kt);break;case 40:t===41&&bl(t);break;case 92:cn();break}return Rt}function Ex(t,e){for(;cn()&&t+kt!==57;)if(t+kt===84&&Pn()===47)break;return"/*"+Fs(e,Rt-1)+"*"+Zo(t===47?t:cn())}function Mx(t){for(;!Vs(Pn());)cn();return Fs(t,Rt)}function Nx(t){return Bu(ni("",null,null,null,[""],t=Uu(t),0,[0],t))}function ni(t,e,n,r,s,o,i,a,l){for(var c=0,d=0,u=i,f=0,g=0,m=0,p=1,y=1,b=1,_=0,x="",E=s,S=o,w=r,N=x;y;)switch(m=_,_=cn()){case 40:if(m!=108&&$t(N,u-1)==58){pl(N+=Je(ti(_),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:N+=ti(_);break;case 9:case 10:case 13:case 32:N+=Sx(m);break;case 92:N+=_x(ei()-1,7);continue;case 47:switch(Pn()){case 42:case 47:Qo(Ox(Ex(cn(),ei()),e,n),l);break;default:N+="/"}break;case 123*p:a[c++]=Ln(N)*b;case 125*p:case 59:case 0:switch(_){case 0:case 125:y=0;case 59+d:b==-1&&(N=Je(N,/\f/g,"")),g>0&&Ln(N)-u&&Qo(g>32?Wu(N+";",r,n,u-1):Wu(Je(N," ","")+";",r,n,u-2),l);break;case 59:N+=";";default:if(Qo(w=ju(N,e,n,c,d,s,a,x,E=[],S=[],u),o),_===123)if(d===0)ni(N,e,w,w,E,o,u,a,S);else switch(f===99&&$t(N,3)===110?100:f){case 100:case 108:case 109:case 115:ni(t,w,w,r&&Qo(ju(t,w,w,0,0,s,a,x,s,E=[],u),S),s,S,u,a,r?E:S);break;default:ni(N,w,w,w,[""],S,0,a,S)}}c=d=g=0,p=b=1,x=N="",u=i;break;case 58:u=1+Ln(N),g=m;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&Cx()==125)continue}switch(N+=Zo(_),_*p){case 38:b=d>0?1:(N+="\f",-1);break;case 44:a[c++]=(Ln(N)-1)*b,b=1;break;case 64:Pn()===45&&(N+=ti(cn())),f=Pn(),d=u=Ln(x=N+=Mx(ei())),_++;break;case 45:m===45&&Ln(N)==2&&(p=0)}}return o}function ju(t,e,n,r,s,o,i,a,l,c,d){for(var u=s-1,f=s===0?o:[""],g=ml(f),m=0,p=0,y=0;m<r;++m)for(var b=0,_=Ps(t,u+1,u=bx(p=i[m])),x=t;b<g;++b)(x=zu(p>0?f[b]+" "+_:Je(_,/&\f/g,f[b])))&&(l[y++]=x);return Ro(t,e,n,s===0?hl:a,l,c,d)}function Ox(t,e,n){return Ro(t,e,n,Fu,Zo(kx()),Ps(t,2,-2),0)}function Wu(t,e,n,r){return Ro(t,e,n,gl,Ps(t,0,r),Ps(t,r+1,-1),r)}function Kr(t,e){for(var n="",r=ml(t),s=0;s<r;s++)n+=e(t[s],s,t,e)||"";return n}function Tx(t,e,n,r){switch(t.type){case mx:if(t.children.length)break;case px:case gl:return t.return=t.return||t.value;case Fu:return"";case Vu:return t.return=t.value+"{"+Kr(t.children,r)+"}";case hl:t.value=t.props.join(",")}return Ln(n=Kr(t.children,r))?t.return=t.value+"{"+n+"}":""}function Ax(t){var e=ml(t);return function(n,r,s,o){for(var i="",a=0;a<e;a++)i+=t[a](n,r,s,o)||"";return i}}function Dx(t){return function(e){e.root||(e=e.return)&&t(e)}}function Ix(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var Lx=function(e,n,r){for(var s=0,o=0;s=o,o=Pn(),s===38&&o===12&&(n[r]=1),!Vs(o);)cn();return Fs(e,Rt)},Px=function(e,n){var r=-1,s=44;do switch(Vs(s)){case 0:s===38&&Pn()===12&&(n[r]=1),e[r]+=Lx(Rt-1,n,r);break;case 2:e[r]+=ti(s);break;case 4:if(s===44){e[++r]=Pn()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=Zo(s)}while(s=cn());return e},$x=function(e,n){return Bu(Px(Uu(e),n))},Gu=new WeakMap,Fx=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,s=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!Gu.get(r))&&!s){Gu.set(e,!0);for(var o=[],i=$x(n,o),a=r.props,l=0,c=0;l<i.length;l++)for(var d=0;d<a.length;d++,c++)e.props[c]=o[l]?i[l].replace(/&\f/g,a[d]):a[d]+" "+i[l]}}},Vx=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function Yu(t,e){switch(vx(t,e)){case 5103:return Qe+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Qe+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Qe+t+qo+t+zt+t+t;case 6828:case 4268:return Qe+t+zt+t+t;case 6165:return Qe+t+zt+"flex-"+t+t;case 5187:return Qe+t+Je(t,/(\w+).+(:[^]+)/,Qe+"box-$1$2"+zt+"flex-$1$2")+t;case 5443:return Qe+t+zt+"flex-item-"+Je(t,/flex-|-self/,"")+t;case 4675:return Qe+t+zt+"flex-line-pack"+Je(t,/align-content|flex-|-self/,"")+t;case 5548:return Qe+t+zt+Je(t,"shrink","negative")+t;case 5292:return Qe+t+zt+Je(t,"basis","preferred-size")+t;case 6060:return Qe+"box-"+Je(t,"-grow","")+Qe+t+zt+Je(t,"grow","positive")+t;case 4554:return Qe+Je(t,/([^-])(transform)/g,"$1"+Qe+"$2")+t;case 6187:return Je(Je(Je(t,/(zoom-|grab)/,Qe+"$1"),/(image-set)/,Qe+"$1"),t,"")+t;case 5495:case 3959:return Je(t,/(image-set\([^]*)/,Qe+"$1$`$1");case 4968:return Je(Je(t,/(.+:)(flex-)?(.*)/,Qe+"box-pack:$3"+zt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Qe+t+t;case 4095:case 3583:case 4068:case 2532:return Je(t,/(.+)-inline(.+)/,Qe+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ln(t)-1-e>6)switch($t(t,e+1)){case 109:if($t(t,e+4)!==45)break;case 102:return Je(t,/(.+:)(.+)-([^]+)/,"$1"+Qe+"$2-$3$1"+qo+($t(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~pl(t,"stretch")?Yu(Je(t,"stretch","fill-available"),e)+t:t}break;case 4949:if($t(t,e+1)!==115)break;case 6444:switch($t(t,Ln(t)-3-(~pl(t,"!important")&&10))){case 107:return Je(t,":",":"+Qe)+t;case 101:return Je(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Qe+($t(t,14)===45?"inline-":"")+"box$3$1"+Qe+"$2$3$1"+zt+"$2box$3")+t}break;case 5936:switch($t(t,e+11)){case 114:return Qe+t+zt+Je(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Qe+t+zt+Je(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Qe+t+zt+Je(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Qe+t+zt+t+t}return t}var zx=function(e,n,r,s){if(e.length>-1&&!e.return)switch(e.type){case gl:e.return=Yu(e.value,e.length);break;case Vu:return Kr([$s(e,{value:Je(e.value,"@","@"+Qe)})],s);case hl:if(e.length)return wx(e.props,function(o){switch(xx(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Kr([$s(e,{props:[Je(o,/:(read-\w+)/,":"+qo+"$1")]})],s);case"::placeholder":return Kr([$s(e,{props:[Je(o,/:(plac\w+)/,":"+Qe+"input-$1")]}),$s(e,{props:[Je(o,/:(plac\w+)/,":"+qo+"$1")]}),$s(e,{props:[Je(o,/:(plac\w+)/,zt+"input-$1")]})],s)}return""})}},Hx=[zx],Ux=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var s=e.stylisPlugins||Hx,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),b=1;b<y.length;b++)o[y[b]]=!0;a.push(p)});var l,c=[Fx,Vx];{var d,u=[Tx,Dx(function(p){d.insert(p)})],f=Ax(c.concat(s,u)),g=function(y){return Kr(Nx(y),f)};l=function(y,b,_,x){d=_,g(y?y+"{"+b.styles+"}":b.styles),x&&(m.inserted[b.name]=!0)}}var m={key:n,sheet:new gx({key:n,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return m.sheet.hydrate(a),m},yl={exports:{}},Re={};/** @license React v16.13.1
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Xu;function Bx(){if(Xu)return Re;Xu=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,s=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,i=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,u=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,p=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,_=t?Symbol.for("react.scope"):60119;function x(S){if(typeof S=="object"&&S!==null){var w=S.$$typeof;switch(w){case e:switch(S=S.type,S){case l:case c:case r:case o:case s:case u:return S;default:switch(S=S&&S.$$typeof,S){case a:case d:case m:case g:case i:return S;default:return w}}case n:return w}}}function E(S){return x(S)===c}return Re.AsyncMode=l,Re.ConcurrentMode=c,Re.ContextConsumer=a,Re.ContextProvider=i,Re.Element=e,Re.ForwardRef=d,Re.Fragment=r,Re.Lazy=m,Re.Memo=g,Re.Portal=n,Re.Profiler=o,Re.StrictMode=s,Re.Suspense=u,Re.isAsyncMode=function(S){return E(S)||x(S)===l},Re.isConcurrentMode=E,Re.isContextConsumer=function(S){return x(S)===a},Re.isContextProvider=function(S){return x(S)===i},Re.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},Re.isForwardRef=function(S){return x(S)===d},Re.isFragment=function(S){return x(S)===r},Re.isLazy=function(S){return x(S)===m},Re.isMemo=function(S){return x(S)===g},Re.isPortal=function(S){return x(S)===n},Re.isProfiler=function(S){return x(S)===o},Re.isStrictMode=function(S){return x(S)===s},Re.isSuspense=function(S){return x(S)===u},Re.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===o||S===s||S===u||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===m||S.$$typeof===g||S.$$typeof===i||S.$$typeof===a||S.$$typeof===d||S.$$typeof===y||S.$$typeof===b||S.$$typeof===_||S.$$typeof===p)},Re.typeOf=x,Re}var Ku;function jx(){return Ku||(Ku=1,yl.exports=Bx()),yl.exports}var vl,qu;function Wx(){if(qu)return vl;qu=1;var t=jx(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[t.ForwardRef]=r,o[t.Memo]=s;function i(m){return t.isMemo(m)?s:o[m.$$typeof]||e}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function g(m,p,y){if(typeof p!="string"){if(f){var b=u(p);b&&b!==f&&g(m,b,y)}var _=l(p);c&&(_=_.concat(c(p)));for(var x=i(m),E=i(p),S=0;S<_.length;++S){var w=_[S];if(!n[w]&&!(y&&y[w])&&!(E&&E[w])&&!(x&&x[w])){var N=d(p,w);try{a(m,w,N)}catch{}}}}return m}return vl=g,vl}Wx();var Gx=!0;function Yx(t,e,n){var r="";return n.split(" ").forEach(function(s){t[s]!==void 0?e.push(t[s]+";"):s&&(r+=s+" ")}),r}var Zu=function(e,n,r){var s=e.key+"-"+n.name;(r===!1||Gx===!1)&&e.registered[s]===void 0&&(e.registered[s]=n.styles)},Xx=function(e,n,r){Zu(e,n,r);var s=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+s:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function Kx(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var qx={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Zx=/[A-Z]|^ms/g,Qx=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Qu=function(e){return e.charCodeAt(1)===45},Ju=function(e){return e!=null&&typeof e!="boolean"},xl=Ix(function(t){return Qu(t)?t:t.replace(Zx,"-$&").toLowerCase()}),Ru=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(Qx,function(r,s,o){return $n={name:s,styles:o,next:$n},s})}return qx[e]!==1&&!Qu(e)&&typeof n=="number"&&n!==0?n+"px":n};function zs(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return $n={name:s.name,styles:s.styles,next:$n},s.name;var o=n;if(o.styles!==void 0){var i=o.next;if(i!==void 0)for(;i!==void 0;)$n={name:i.name,styles:i.styles,next:$n},i=i.next;var a=o.styles+";";return a}return Jx(t,e,n)}case"function":{if(t!==void 0){var l=$n,c=n(t);return $n=l,zs(t,e,c)}break}}var d=n;return d}function Jx(t,e,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=zs(t,e,n[s])+";";else for(var o in n){var i=n[o];if(typeof i!="object"){var a=i;Ju(a)&&(r+=xl(o)+":"+Ru(o,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&e==null)for(var l=0;l<i.length;l++)Ju(i[l])&&(r+=xl(o)+":"+Ru(o,i[l])+";");else{var c=zs(t,e,i);switch(o){case"animation":case"animationName":{r+=xl(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}return r}var ef=/label:\s*([^\s;{]+)\s*(;|$)/g,$n;function tf(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,s="";$n=void 0;var o=t[0];if(o==null||o.raw===void 0)r=!1,s+=zs(n,e,o);else{var i=o;s+=i[0]}for(var a=1;a<t.length;a++)if(s+=zs(n,e,t[a]),r){var l=o;s+=l[a]}ef.lastIndex=0;for(var c="",d;(d=ef.exec(s))!==null;)c+="-"+d[1];var u=Kx(s)+c;return{name:u,styles:s,next:$n}}var Rx=function(e){return e()},ew=$.useInsertionEffect?$.useInsertionEffect:!1,tw=ew||Rx,nf=$.createContext(typeof HTMLElement<"u"?Ux({key:"css"}):null);nf.Provider;var nw=function(e){return v.forwardRef(function(n,r){var s=v.useContext(nf);return e(n,s,r)})},rw=$.createContext({}),wl={}.hasOwnProperty,kl="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",sw=function(e,n){var r={};for(var s in n)wl.call(n,s)&&(r[s]=n[s]);return r[kl]=e,r},ow=function(e){var n=e.cache,r=e.serialized,s=e.isStringTag;return Zu(n,r,s),tw(function(){return Xx(n,r,s)}),null},iw=nw(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var s=t[kl],o=[r],i="";typeof t.className=="string"?i=Yx(e.registered,o,t.className):t.className!=null&&(i=t.className+" ");var a=tf(o,void 0,$.useContext(rw));i+=e.key+"-"+a.name;var l={};for(var c in t)wl.call(t,c)&&c!=="css"&&c!==kl&&(l[c]=t[c]);return l.className=i,n&&(l.ref=n),$.createElement($.Fragment,null,$.createElement(ow,{cache:e,serialized:a,isStringTag:typeof s=="string"}),$.createElement(s,l))}),aw=iw,_e=function(e,n){var r=arguments;if(n==null||!wl.call(n,"css"))return $.createElement.apply(void 0,r);var s=r.length,o=new Array(s);o[0]=aw,o[1]=sw(e,n);for(var i=2;i<s;i++)o[i]=r[i];return $.createElement.apply(null,o)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(_e||(_e={}));function Cl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return tf(e)}function lw(){var t=Cl.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function cw(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const dw=Math.min,uw=Math.max,ri=Math.round,si=Math.floor,oi=t=>({x:t,y:t});function fw(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function ii(){return typeof window<"u"}function rf(t){return of(t)?(t.nodeName||"").toLowerCase():"#document"}function Yn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function sf(t){var e;return(e=(of(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function of(t){return ii()?t instanceof Node||t instanceof Yn(t).Node:!1}function hw(t){return ii()?t instanceof Element||t instanceof Yn(t).Element:!1}function Sl(t){return ii()?t instanceof HTMLElement||t instanceof Yn(t).HTMLElement:!1}function af(t){return!ii()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Yn(t).ShadowRoot}const gw=new Set(["inline","contents"]);function lf(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=_l(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!gw.has(s)}function pw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const mw=new Set(["html","body","#document"]);function bw(t){return mw.has(rf(t))}function _l(t){return Yn(t).getComputedStyle(t)}function yw(t){if(rf(t)==="html")return t;const e=t.assignedSlot||t.parentNode||af(t)&&t.host||sf(t);return af(e)?e.host:e}function cf(t){const e=yw(t);return bw(e)?t.ownerDocument?t.ownerDocument.body:t.body:Sl(e)&&lf(e)?e:cf(e)}function ai(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=cf(t),o=s===((r=t.ownerDocument)==null?void 0:r.body),i=Yn(s);if(o){const a=El(i);return e.concat(i,i.visualViewport||[],lf(s)?s:[],a&&n?ai(a):[])}return e.concat(s,ai(s,[],n))}function El(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function vw(t){const e=_l(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Sl(t),o=s?t.offsetWidth:n,i=s?t.offsetHeight:r,a=ri(n)!==o||ri(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function Ml(t){return hw(t)?t:t.contextElement}function df(t){const e=Ml(t);if(!Sl(e))return oi(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:o}=vw(e);let i=(o?ri(n.width):n.width)/r,a=(o?ri(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const xw=oi(0);function ww(t){const e=Yn(t);return!pw()||!e.visualViewport?xw:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function kw(t,e,n){return!1}function uf(t,e,n,r){e===void 0&&(e=!1);const s=t.getBoundingClientRect(),o=Ml(t);let i=oi(1);e&&(i=df(t));const a=kw()?ww(o):oi(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,d=s.width/i.x,u=s.height/i.y;if(o){const f=Yn(o),g=r;let m=f,p=El(m);for(;p&&r&&g!==m;){const y=df(p),b=p.getBoundingClientRect(),_=_l(p),x=b.left+(p.clientLeft+parseFloat(_.paddingLeft))*y.x,E=b.top+(p.clientTop+parseFloat(_.paddingTop))*y.y;l*=y.x,c*=y.y,d*=y.x,u*=y.y,l+=x,c+=E,m=Yn(p),p=El(m)}}return fw({width:d,height:u,x:l,y:c})}function ff(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Cw(t,e){let n=null,r;const s=sf(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:d,top:u,width:f,height:g}=c;if(a||e(),!f||!g)return;const m=si(u),p=si(s.clientWidth-(d+f)),y=si(s.clientHeight-(u+g)),b=si(d),x={rootMargin:-m+"px "+-p+"px "+-y+"px "+-b+"px",threshold:uw(0,dw(1,l))||1};let E=!0;function S(w){const N=w[0].intersectionRatio;if(N!==l){if(!E)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!ff(c,t.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(S,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(t)}return i(!0),o}function Sw(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ml(t),d=s||o?[...c?ai(c):[],...ai(e)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const u=c&&a?Cw(c,n):null;let f=-1,g=null;i&&(g=new ResizeObserver(b=>{let[_]=b;_&&_.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let m,p=l?uf(t):null;l&&y();function y(){const b=uf(t);p&&!ff(p,b)&&n(),p=b,m=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(_=>{s&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),u?.(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Nl=v.useLayoutEffect,_w=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],li=function(){};function Ew(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function Mw(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];var o=[].concat(r);if(e&&t)for(var i in e)e.hasOwnProperty(i)&&e[i]&&o.push("".concat(Ew(t,i)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var ci=function(e){return $w(e)?e.filter(Boolean):pr(e)==="object"&&e!==null?[e]:[]},hf=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=In(e,_w);return Ee({},n)},vt=function(e,n,r){var s=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(n,e),className:s(r??{},i(n,e),a)}};function di(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function Nw(t){return di(t)?window.innerHeight:t.clientHeight}function gf(t){return di(t)?window.pageYOffset:t.scrollTop}function ui(t,e){if(di(t)){window.scrollTo(0,e);return}t.scrollTop=e}function Ow(t){var e=getComputedStyle(t),n=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var s=t;s=s.parentElement;)if(e=getComputedStyle(s),!(n&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return s;return document.documentElement}function Tw(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e}function fi(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:li,s=gf(t),o=e-s,i=10,a=0;function l(){a+=i;var c=Tw(a,s,o,n);ui(t,c),a<n?window.requestAnimationFrame(l):r(t)}l()}function pf(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=e.offsetHeight/3;r.bottom+s>n.bottom?ui(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+s,t.scrollHeight)):r.top-s<n.top&&ui(t,Math.max(e.offsetTop-s,0))}function Aw(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function mf(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Dw(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var bf=!1,Iw={get passive(){return bf=!0}},hi=typeof window<"u"?window:{};hi.addEventListener&&hi.removeEventListener&&(hi.addEventListener("p",li,Iw),hi.removeEventListener("p",li,!1));var Lw=bf;function Pw(t){return t!=null}function $w(t){return Array.isArray(t)}function Hs(t,e,n){return t?e:n}function HT(t){return t}function UT(t){return t}var Fw=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];var o=Object.entries(e).filter(function(i){var a=Gn(i,1),l=a[0];return!r.includes(l)});return o.reduce(function(i,a){var l=Gn(a,2),c=l[0],d=l[1];return i[c]=d,i},{})},Vw=["children","innerProps"],zw=["children","innerProps"];function Hw(t){var e=t.maxHeight,n=t.menuEl,r=t.minHeight,s=t.placement,o=t.shouldScroll,i=t.isFixedPosition,a=t.controlHeight,l=Ow(n),c={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return c;var d=l.getBoundingClientRect(),u=d.height,f=n.getBoundingClientRect(),g=f.bottom,m=f.height,p=f.top,y=n.offsetParent.getBoundingClientRect(),b=y.top,_=i?window.innerHeight:Nw(l),x=gf(l),E=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),w=b-S,N=_-p,C=w+x,k=u-x-p,M=g-_+x+E,T=x+p-S,L=160;switch(s){case"auto":case"bottom":if(N>=m)return{placement:"bottom",maxHeight:e};if(k>=m&&!i)return o&&fi(l,M,L),{placement:"bottom",maxHeight:e};if(!i&&k>=r||i&&N>=r){o&&fi(l,M,L);var P=i?N-E:k-E;return{placement:"bottom",maxHeight:P}}if(s==="auto"||i){var F=e,D=i?w:C;return D>=r&&(F=Math.min(D-E-a,e)),{placement:"top",maxHeight:F}}if(s==="bottom")return o&&ui(l,M),{placement:"bottom",maxHeight:e};break;case"top":if(w>=m)return{placement:"top",maxHeight:e};if(C>=m&&!i)return o&&fi(l,T,L),{placement:"top",maxHeight:e};if(!i&&C>=r||i&&w>=r){var A=e;return(!i&&C>=r||i&&w>=r)&&(A=i?w-S:C-S),o&&fi(l,T,L),{placement:"top",maxHeight:A}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(s,'".'))}return c}function Uw(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var yf=function(e){return e==="auto"?"bottom":e},Bw=function(e,n){var r,s=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return Ee((r={label:"menu"},Ls(r,Uw(s),"100%"),Ls(r,"position","absolute"),Ls(r,"width","100%"),Ls(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},vf=v.createContext(null),jw=function(e){var n=e.children,r=e.minMenuHeight,s=e.maxMenuHeight,o=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,c=v.useContext(vf)||{},d=c.setPortalPlacement,u=v.useRef(null),f=v.useState(s),g=Gn(f,2),m=g[0],p=g[1],y=v.useState(null),b=Gn(y,2),_=b[0],x=b[1],E=l.spacing.controlHeight;return Nl(function(){var S=u.current;if(S){var w=i==="fixed",N=a&&!w,C=Hw({maxHeight:s,menuEl:S,minHeight:r,placement:o,shouldScroll:N,isFixedPosition:w,controlHeight:E});p(C.maxHeight),x(C.placement),d?.(C.placement)}},[s,o,i,a,r,d,E]),n({ref:u,placerProps:Ee(Ee({},e),{},{placement:_||yf(o),maxHeight:m})})},Ww=function(e){var n=e.children,r=e.innerRef,s=e.innerProps;return _e("div",Ae({},vt(e,"menu",{menu:!0}),{ref:r},s),n)},Gw=Ww,Yw=function(e,n){var r=e.maxHeight,s=e.theme.spacing.baseUnit;return Ee({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:s,paddingTop:s})},Xw=function(e){var n=e.children,r=e.innerProps,s=e.innerRef,o=e.isMulti;return _e("div",Ae({},vt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:s},r),n)},xf=function(e,n){var r=e.theme,s=r.spacing.baseUnit,o=r.colors;return Ee({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(s*2,"px ").concat(s*3,"px")})},Kw=xf,qw=xf,Zw=function(e){var n=e.children,r=n===void 0?"No options":n,s=e.innerProps,o=In(e,Vw);return _e("div",Ae({},vt(Ee(Ee({},o),{},{children:r,innerProps:s}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),s),r)},Qw=function(e){var n=e.children,r=n===void 0?"Loading...":n,s=e.innerProps,o=In(e,zw);return _e("div",Ae({},vt(Ee(Ee({},o),{},{children:r,innerProps:s}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),s),r)},Jw=function(e){var n=e.rect,r=e.offset,s=e.position;return{left:n.left,position:s,top:r,width:n.width,zIndex:1}},Rw=function(e){var n=e.appendTo,r=e.children,s=e.controlElement,o=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=v.useRef(null),c=v.useRef(null),d=v.useState(yf(i)),u=Gn(d,2),f=u[0],g=u[1],m=v.useMemo(function(){return{setPortalPlacement:g}},[]),p=v.useState(null),y=Gn(p,2),b=y[0],_=y[1],x=v.useCallback(function(){if(s){var N=Aw(s),C=a==="fixed"?0:window.pageYOffset,k=N[f]+C;(k!==b?.offset||N.left!==b?.rect.left||N.width!==b?.rect.width)&&_({offset:k,rect:N})}},[s,a,f,b?.offset,b?.rect.left,b?.rect.width]);Nl(function(){x()},[x]);var E=v.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),s&&l.current&&(c.current=Sw(s,l.current,x,{elementResize:"ResizeObserver"in window}))},[s,x]);Nl(function(){E()},[E]);var S=v.useCallback(function(N){l.current=N,E()},[E]);if(!n&&a!=="fixed"||!b)return null;var w=_e("div",Ae({ref:S},vt(Ee(Ee({},e),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),o),r);return _e(vf.Provider,{value:m},n?Dn.createPortal(w,n):w)},e1=function(e){var n=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},t1=function(e){var n=e.children,r=e.innerProps,s=e.isDisabled,o=e.isRtl;return _e("div",Ae({},vt(e,"container",{"--is-disabled":s,"--is-rtl":o}),r),n)},n1=function(e,n){var r=e.theme.spacing,s=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Ee({alignItems:"center",display:s&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},r1=function(e){var n=e.children,r=e.innerProps,s=e.isMulti,o=e.hasValue;return _e("div",Ae({},vt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":s,"value-container--has-value":o}),r),n)},s1=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},o1=function(e){var n=e.children,r=e.innerProps;return _e("div",Ae({},vt(e,"indicatorsContainer",{indicators:!0}),r),n)},wf,i1=["size"],a1=["innerProps","isRtl","size"],l1={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},kf=function(e){var n=e.size,r=In(e,i1);return _e("svg",Ae({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:l1},r))},Ol=function(e){return _e(kf,Ae({size:20},e),_e("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Cf=function(e){return _e(kf,Ae({size:20},e),_e("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Sf=function(e,n){var r=e.isFocused,s=e.theme,o=s.spacing.baseUnit,i=s.colors;return Ee({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?i.neutral60:i.neutral20,padding:o*2,":hover":{color:r?i.neutral80:i.neutral40}})},c1=Sf,d1=function(e){var n=e.children,r=e.innerProps;return _e("div",Ae({},vt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||_e(Cf,null))},u1=Sf,f1=function(e){var n=e.children,r=e.innerProps;return _e("div",Ae({},vt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||_e(Ol,null))},h1=function(e,n){var r=e.isDisabled,s=e.theme,o=s.spacing.baseUnit,i=s.colors;return Ee({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?i.neutral10:i.neutral20,marginBottom:o*2,marginTop:o*2})},g1=function(e){var n=e.innerProps;return _e("span",Ae({},n,vt(e,"indicatorSeparator",{"indicator-separator":!0})))},p1=lw(wf||(wf=cw([`
|
||
0%, 80%, 100% { opacity: 0; }
|
||
40% { opacity: 1; }
|
||
`]))),m1=function(e,n){var r=e.isFocused,s=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return Ee({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:s,lineHeight:1,marginRight:s,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?i.neutral60:i.neutral20,padding:a*2})},Tl=function(e){var n=e.delay,r=e.offset;return _e("span",{css:Cl({animation:"".concat(p1," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},b1=function(e){var n=e.innerProps,r=e.isRtl,s=e.size,o=s===void 0?4:s,i=In(e,a1);return _e("div",Ae({},vt(Ee(Ee({},i),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),_e(Tl,{delay:0,offset:r}),_e(Tl,{delay:160,offset:!0}),_e(Tl,{delay:320,offset:!r}))},y1=function(e,n){var r=e.isDisabled,s=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return Ee({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?i.neutral5:i.neutral0,borderColor:r?i.neutral10:s?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:s?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:s?i.primary:i.neutral30}})},v1=function(e){var n=e.children,r=e.isDisabled,s=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return _e("div",Ae({ref:o},vt(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":a}),i,{"aria-disabled":r||void 0}),n)},x1=v1,w1=["data"],k1=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},C1=function(e){var n=e.children,r=e.cx,s=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,d=e.theme,u=e.selectProps;return _e("div",Ae({},vt(e,"group",{group:!0}),l),_e(i,Ae({},a,{selectProps:u,theme:d,getStyles:s,getClassNames:o,cx:r}),c),_e("div",null,n))},S1=function(e,n){var r=e.theme,s=r.colors,o=r.spacing;return Ee({label:"group",cursor:"default",display:"block"},n?{}:{color:s.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},_1=function(e){var n=hf(e);n.data;var r=In(n,w1);return _e("div",Ae({},vt(e,"groupHeading",{"group-heading":!0}),r))},E1=C1,M1=["innerRef","isDisabled","isHidden","inputClassName"],N1=function(e,n){var r=e.isDisabled,s=e.value,o=e.theme,i=o.spacing,a=o.colors;return Ee(Ee({visibility:r?"hidden":"visible",transform:s?"translateZ(0)":""},O1),n?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},_f={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},O1={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ee({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},_f)},T1=function(e){return Ee({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},_f)},A1=function(e){var n=e.cx,r=e.value,s=hf(e),o=s.innerRef,i=s.isDisabled,a=s.isHidden,l=s.inputClassName,c=In(s,M1);return _e("div",Ae({},vt(e,"input",{"input-container":!0}),{"data-value":r||""}),_e("input",Ae({className:n({input:!0},l),ref:o,style:T1(a),disabled:i},c)))},D1=A1,I1=function(e,n){var r=e.theme,s=r.spacing,o=r.borderRadius,i=r.colors;return Ee({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:s.baseUnit/2})},L1=function(e,n){var r=e.theme,s=r.borderRadius,o=r.colors,i=e.cropWithEllipsis;return Ee({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:s/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},P1=function(e,n){var r=e.theme,s=r.spacing,o=r.borderRadius,i=r.colors,a=e.isFocused;return Ee({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:s.baseUnit,paddingRight:s.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},Ef=function(e){var n=e.children,r=e.innerProps;return _e("div",r,n)},$1=Ef,F1=Ef;function V1(t){var e=t.children,n=t.innerProps;return _e("div",Ae({role:"button"},n),e||_e(Ol,{size:14}))}var z1=function(e){var n=e.children,r=e.components,s=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,c=r.Container,d=r.Label,u=r.Remove;return _e(c,{data:s,innerProps:Ee(Ee({},vt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},_e(d,{data:s,innerProps:Ee({},vt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),_e(u,{data:s,innerProps:Ee(Ee({},vt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},H1=z1,U1=function(e,n){var r=e.isDisabled,s=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Ee({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:s?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},B1=function(e){var n=e.children,r=e.isDisabled,s=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return _e("div",Ae({},vt(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":s,"option--is-selected":o}),{ref:i,"aria-disabled":r},a),n)},j1=B1,W1=function(e,n){var r=e.theme,s=r.spacing,o=r.colors;return Ee({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},G1=function(e){var n=e.children,r=e.innerProps;return _e("div",Ae({},vt(e,"placeholder",{placeholder:!0}),r),n)},Y1=G1,X1=function(e,n){var r=e.isDisabled,s=e.theme,o=s.spacing,i=s.colors;return Ee({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},K1=function(e){var n=e.children,r=e.isDisabled,s=e.innerProps;return _e("div",Ae({},vt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),s),n)},q1=K1,gi={ClearIndicator:f1,Control:x1,DropdownIndicator:d1,DownChevron:Cf,CrossIcon:Ol,Group:E1,GroupHeading:_1,IndicatorsContainer:o1,IndicatorSeparator:g1,Input:D1,LoadingIndicator:b1,Menu:Gw,MenuList:Xw,MenuPortal:Rw,LoadingMessage:Qw,NoOptionsMessage:Zw,MultiValue:H1,MultiValueContainer:$1,MultiValueLabel:F1,MultiValueRemove:V1,Option:j1,Placeholder:Y1,SelectContainer:t1,SingleValue:q1,ValueContainer:r1},Z1=function(e){return Ee(Ee({},gi),e.components)},Mf=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Q1(t,e){return!!(t===e||Mf(t)&&Mf(e))}function J1(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!Q1(t[n],e[n]))return!1;return!0}function R1(t,e){e===void 0&&(e=J1);var n=null;function r(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];if(n&&n.lastThis===this&&e(s,n.lastArgs))return n.lastResult;var i=t.apply(this,s);return n={lastResult:i,lastArgs:s,lastThis:this},i}return r.clear=function(){n=null},r}for(var ek={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},tk=function(e){return _e("span",Ae({css:ek},e))},Nf=tk,nk={guidance:function(e){var n=e.isSearchable,r=e.isMulti,s=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(s?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,s=r===void 0?"":r,o=e.labels,i=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(s,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return i?"option ".concat(s," is disabled. Select another option."):"option ".concat(s,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,s=e.options,o=e.label,i=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,c=e.isSelected,d=e.isAppleDevice,u=function(p,y){return p&&p.length?"".concat(p.indexOf(y)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(i," focused, ").concat(u(a,r),".");if(n==="menu"&&d){var f=l?" disabled":"",g="".concat(c?" selected":"").concat(f);return"".concat(i).concat(g,", ").concat(u(s,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},rk=function(e){var n=e.ariaSelection,r=e.focusedOption,s=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,c=e.id,d=e.isAppleDevice,u=l.ariaLiveMessages,f=l.getOptionLabel,g=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,y=l.isSearchable,b=l.menuIsOpen,_=l.options,x=l.screenReaderStatus,E=l.tabSelectsValue,S=l.isLoading,w=l["aria-label"],N=l["aria-live"],C=v.useMemo(function(){return Ee(Ee({},nk),u||{})},[u]),k=v.useMemo(function(){var D="";if(n&&C.onChange){var A=n.option,O=n.options,V=n.removedValue,H=n.removedValues,W=n.value,j=function(Z){return Array.isArray(Z)?null:Z},U=V||A||j(W),B=U?f(U):"",G=O||H||void 0,z=G?G.map(f):[],X=Ee({isDisabled:U&&p(U,a),label:B,labels:z},n);D=C.onChange(X)}return D},[n,C,p,a,f]),M=v.useMemo(function(){var D="",A=r||s,O=!!(r&&a&&a.includes(r));if(A&&C.onFocus){var V={focused:A,label:f(A),isDisabled:p(A,a),isSelected:O,options:o,context:A===r?"menu":"value",selectValue:a,isAppleDevice:d};D=C.onFocus(V)}return D},[r,s,f,p,C,o,a,d]),T=v.useMemo(function(){var D="";if(b&&_.length&&!S&&C.onFilter){var A=x({count:o.length});D=C.onFilter({inputValue:g,resultsMessage:A})}return D},[o,g,b,C,_,x,S]),L=n?.action==="initial-input-focus",P=v.useMemo(function(){var D="";if(C.guidance){var A=s?"value":b?"menu":"input";D=C.guidance({"aria-label":w,context:A,isDisabled:r&&p(r,a),isMulti:m,isSearchable:y,tabSelectsValue:E,isInitialFocus:L})}return D},[w,r,s,m,p,y,b,C,a,E,L]),F=_e(v.Fragment,null,_e("span",{id:"aria-selection"},k),_e("span",{id:"aria-focused"},M),_e("span",{id:"aria-results"},T),_e("span",{id:"aria-guidance"},P));return _e(v.Fragment,null,_e(Nf,{id:c},L&&F),_e(Nf,{"aria-live":N,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!L&&F))},sk=rk,Al=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],ok=new RegExp("["+Al.map(function(t){return t.letters}).join("")+"]","g"),Of={},Dl=0;Dl<Al.length;Dl++)for(var Il=Al[Dl],Ll=0;Ll<Il.letters.length;Ll++)Of[Il.letters[Ll]]=Il.base;var Tf=function(e){return e.replace(ok,function(n){return Of[n]})},ik=R1(Tf),Af=function(e){return e.replace(/^\s+|\s+$/g,"")},ak=function(e){return"".concat(e.label," ").concat(e.value)},lk=function(e){return function(n,r){if(n.data.__isNew__)return!0;var s=Ee({ignoreCase:!0,ignoreAccents:!0,stringify:ak,trim:!0,matchFrom:"any"},e),o=s.ignoreCase,i=s.ignoreAccents,a=s.stringify,l=s.trim,c=s.matchFrom,d=l?Af(r):r,u=l?Af(a(n)):a(n);return o&&(d=d.toLowerCase(),u=u.toLowerCase()),i&&(d=ik(d),u=Tf(u)),c==="start"?u.substr(0,d.length)===d:u.indexOf(d)>-1}},ck=["innerRef"];function dk(t){var e=t.innerRef,n=In(t,ck),r=Fw(n,"onExited","in","enter","exit","appear");return _e("input",Ae({ref:e},r,{css:Cl({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var uk=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function fk(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,s=t.onTopArrive,o=t.onTopLeave,i=v.useRef(!1),a=v.useRef(!1),l=v.useRef(0),c=v.useRef(null),d=v.useCallback(function(y,b){if(c.current!==null){var _=c.current,x=_.scrollTop,E=_.scrollHeight,S=_.clientHeight,w=c.current,N=b>0,C=E-S-x,k=!1;C>b&&i.current&&(r&&r(y),i.current=!1),N&&a.current&&(o&&o(y),a.current=!1),N&&b>C?(n&&!i.current&&n(y),w.scrollTop=E,k=!0,i.current=!0):!N&&-b>x&&(s&&!a.current&&s(y),w.scrollTop=0,k=!0,a.current=!0),k&&uk(y)}},[n,r,s,o]),u=v.useCallback(function(y){d(y,y.deltaY)},[d]),f=v.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),g=v.useCallback(function(y){var b=l.current-y.changedTouches[0].clientY;d(y,b)},[d]),m=v.useCallback(function(y){if(y){var b=Lw?{passive:!1}:!1;y.addEventListener("wheel",u,b),y.addEventListener("touchstart",f,b),y.addEventListener("touchmove",g,b)}},[g,f,u]),p=v.useCallback(function(y){y&&(y.removeEventListener("wheel",u,!1),y.removeEventListener("touchstart",f,!1),y.removeEventListener("touchmove",g,!1))},[g,f,u]);return v.useEffect(function(){if(e){var y=c.current;return m(y),function(){p(y)}}},[e,m,p]),function(y){c.current=y}}var Df=["boxSizing","height","overflow","paddingRight","position"],If={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Lf(t){t.cancelable&&t.preventDefault()}function Pf(t){t.stopPropagation()}function $f(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function Ff(){return"ontouchstart"in window||navigator.maxTouchPoints}var Vf=!!(typeof window<"u"&&window.document&&window.document.createElement),Us=0,qr={capture:!1,passive:!1};function hk(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,s=v.useRef({}),o=v.useRef(null),i=v.useCallback(function(l){if(Vf){var c=document.body,d=c&&c.style;if(r&&Df.forEach(function(m){var p=d&&d[m];s.current[m]=p}),r&&Us<1){var u=parseInt(s.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,g=window.innerWidth-f+u||0;Object.keys(If).forEach(function(m){var p=If[m];d&&(d[m]=p)}),d&&(d.paddingRight="".concat(g,"px"))}c&&Ff()&&(c.addEventListener("touchmove",Lf,qr),l&&(l.addEventListener("touchstart",$f,qr),l.addEventListener("touchmove",Pf,qr))),Us+=1}},[r]),a=v.useCallback(function(l){if(Vf){var c=document.body,d=c&&c.style;Us=Math.max(Us-1,0),r&&Us<1&&Df.forEach(function(u){var f=s.current[u];d&&(d[u]=f)}),c&&Ff()&&(c.removeEventListener("touchmove",Lf,qr),l&&(l.removeEventListener("touchstart",$f,qr),l.removeEventListener("touchmove",Pf,qr)))}},[r]);return v.useEffect(function(){if(e){var l=o.current;return i(l),function(){a(l)}}},[e,i,a]),function(l){o.current=l}}var gk=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},pk={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function mk(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,s=r===void 0?!0:r,o=t.onBottomArrive,i=t.onBottomLeave,a=t.onTopArrive,l=t.onTopLeave,c=fk({isEnabled:s,onBottomArrive:o,onBottomLeave:i,onTopArrive:a,onTopLeave:l}),d=hk({isEnabled:n}),u=function(g){c(g),d(g)};return _e(v.Fragment,null,n&&_e("div",{onClick:gk,css:pk}),e(u))}var bk={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},yk=function(e){var n=e.name,r=e.onFocus;return _e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:bk,value:"",onChange:function(){}})},vk=yk;function Pl(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function xk(){return Pl(/^iPhone/i)}function zf(){return Pl(/^Mac/i)}function wk(){return Pl(/^iPad/i)||zf()&&navigator.maxTouchPoints>1}function kk(){return xk()||wk()}function Ck(){return zf()||kk()}var Sk=function(e){return e.label},Hf=function(e){return e.label},Uf=function(e){return e.value},_k=function(e){return!!e.isDisabled},Ek={clearIndicator:u1,container:e1,control:y1,dropdownIndicator:c1,group:k1,groupHeading:S1,indicatorsContainer:s1,indicatorSeparator:h1,input:N1,loadingIndicator:m1,loadingMessage:qw,menu:Bw,menuList:Yw,menuPortal:Jw,multiValue:I1,multiValueLabel:L1,multiValueRemove:P1,noOptionsMessage:Kw,option:U1,placeholder:W1,singleValue:X1,valueContainer:n1},Mk={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Nk=4,Bf=4,Ok=38,Tk=Bf*2,Ak={baseUnit:Bf,controlHeight:Ok,menuGutter:Tk},$l={borderRadius:Nk,colors:Mk,spacing:Ak},Dk={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:mf(),captureMenuScroll:!mf(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:lk(),formatGroupLabel:Sk,getOptionLabel:Hf,getOptionValue:Uf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:_k,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Dw(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function jf(t,e,n,r){var s=Kf(t,e,n),o=qf(t,e,n),i=Xf(t,e),a=mi(t,e);return{type:"option",data:e,isDisabled:s,isSelected:o,label:i,value:a,index:r}}function pi(t,e){return t.options.map(function(n,r){if("options"in n){var s=n.options.map(function(i,a){return jf(t,i,e,a)}).filter(function(i){return Yf(t,i)});return s.length>0?{type:"group",data:n,options:s,index:r}:void 0}var o=jf(t,n,e,r);return Yf(t,o)?o:void 0}).filter(Pw)}function Wf(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,Gr(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function Gf(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Gr(r.options.map(function(s){return{data:s.data,id:"".concat(e,"-").concat(r.index,"-").concat(s.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function Ik(t,e){return Wf(pi(t,e))}function Yf(t,e){var n=t.inputValue,r=n===void 0?"":n,s=e.data,o=e.isSelected,i=e.label,a=e.value;return(!Qf(t)||!o)&&Zf(t,{label:i,value:a,data:s},r)}function Lk(t,e){var n=t.focusedValue,r=t.selectValue,s=r.indexOf(n);if(s>-1){var o=e.indexOf(n);if(o>-1)return n;if(s<e.length)return e[s]}return null}function Pk(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var Fl=function(e,n){var r,s=(r=e.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return s||null},Xf=function(e,n){return e.getOptionLabel(n)},mi=function(e,n){return e.getOptionValue(n)};function Kf(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function qf(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=mi(t,e);return n.some(function(s){return mi(t,s)===r})}function Zf(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var Qf=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},$k=1,Vl=(function(t){ox(n,t);var e=lx(n);function n(r){var s;if(rx(this,n),s=e.call(this,r),s.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},s.blockOptionHover=!1,s.isComposing=!1,s.commonProps=void 0,s.initialTouchX=0,s.initialTouchY=0,s.openAfterFocus=!1,s.scrollToFocusedOptionOnUpdate=!1,s.userIsDragging=void 0,s.controlRef=null,s.getControlRef=function(l){s.controlRef=l},s.focusedOptionRef=null,s.getFocusedOptionRef=function(l){s.focusedOptionRef=l},s.menuListRef=null,s.getMenuListRef=function(l){s.menuListRef=l},s.inputRef=null,s.getInputRef=function(l){s.inputRef=l},s.focus=s.focusInput,s.blur=s.blurInput,s.onChange=function(l,c){var d=s.props,u=d.onChange,f=d.name;c.name=f,s.ariaOnChange(l,c),u(l,c)},s.setValue=function(l,c,d){var u=s.props,f=u.closeMenuOnSelect,g=u.isMulti,m=u.inputValue;s.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(s.setState({inputIsHiddenAfterUpdate:!g}),s.onMenuClose()),s.setState({clearFocusValueOnUpdate:!0}),s.onChange(l,{action:c,option:d})},s.selectOption=function(l){var c=s.props,d=c.blurInputOnSelect,u=c.isMulti,f=c.name,g=s.state.selectValue,m=u&&s.isOptionSelected(l,g),p=s.isOptionDisabled(l,g);if(m){var y=s.getOptionValue(l);s.setValue(g.filter(function(b){return s.getOptionValue(b)!==y}),"deselect-option",l)}else if(!p)u?s.setValue([].concat(Gr(g),[l]),"select-option",l):s.setValue(l,"select-option");else{s.ariaOnChange(l,{action:"select-option",option:l,name:f});return}d&&s.blurInput()},s.removeValue=function(l){var c=s.props.isMulti,d=s.state.selectValue,u=s.getOptionValue(l),f=d.filter(function(m){return s.getOptionValue(m)!==u}),g=Hs(c,f,f[0]||null);s.onChange(g,{action:"remove-value",removedValue:l}),s.focusInput()},s.clearValue=function(){var l=s.state.selectValue;s.onChange(Hs(s.props.isMulti,[],null),{action:"clear",removedValues:l})},s.popValue=function(){var l=s.props.isMulti,c=s.state.selectValue,d=c[c.length-1],u=c.slice(0,c.length-1),f=Hs(l,u,u[0]||null);d&&s.onChange(f,{action:"pop-value",removedValue:d})},s.getFocusedOptionId=function(l){return Fl(s.state.focusableOptionsWithIds,l)},s.getFocusableOptionsWithIds=function(){return Gf(pi(s.props,s.state.selectValue),s.getElementId("option"))},s.getValue=function(){return s.state.selectValue},s.cx=function(){for(var l=arguments.length,c=new Array(l),d=0;d<l;d++)c[d]=arguments[d];return Mw.apply(void 0,[s.props.classNamePrefix].concat(c))},s.getOptionLabel=function(l){return Xf(s.props,l)},s.getOptionValue=function(l){return mi(s.props,l)},s.getStyles=function(l,c){var d=s.props.unstyled,u=Ek[l](c,d);u.boxSizing="border-box";var f=s.props.styles[l];return f?f(u,c):u},s.getClassNames=function(l,c){var d,u;return(d=(u=s.props.classNames)[l])===null||d===void 0?void 0:d.call(u,c)},s.getElementId=function(l){return"".concat(s.state.instancePrefix,"-").concat(l)},s.getComponents=function(){return Z1(s.props)},s.buildCategorizedOptions=function(){return pi(s.props,s.state.selectValue)},s.getCategorizedOptions=function(){return s.props.menuIsOpen?s.buildCategorizedOptions():[]},s.buildFocusableOptions=function(){return Wf(s.buildCategorizedOptions())},s.getFocusableOptions=function(){return s.props.menuIsOpen?s.buildFocusableOptions():[]},s.ariaOnChange=function(l,c){s.setState({ariaSelection:Ee({value:l},c)})},s.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),s.focusInput())},s.onMenuMouseMove=function(l){s.blockOptionHover=!1},s.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=s.props.openMenuOnClick;s.state.isFocused?s.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&s.onMenuClose():c&&s.openMenu("first"):(c&&(s.openAfterFocus=!0),s.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},s.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!s.props.isDisabled){var c=s.props,d=c.isMulti,u=c.menuIsOpen;s.focusInput(),u?(s.setState({inputIsHiddenAfterUpdate:!d}),s.onMenuClose()):s.openMenu("first"),l.preventDefault()}},s.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(s.clearValue(),l.preventDefault(),s.openAfterFocus=!1,l.type==="touchend"?s.focusInput():setTimeout(function(){return s.focusInput()}))},s.onScroll=function(l){typeof s.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&di(l.target)&&s.props.onMenuClose():typeof s.props.closeMenuOnScroll=="function"&&s.props.closeMenuOnScroll(l)&&s.props.onMenuClose()},s.onCompositionStart=function(){s.isComposing=!0},s.onCompositionEnd=function(){s.isComposing=!1},s.onTouchStart=function(l){var c=l.touches,d=c&&c.item(0);d&&(s.initialTouchX=d.clientX,s.initialTouchY=d.clientY,s.userIsDragging=!1)},s.onTouchMove=function(l){var c=l.touches,d=c&&c.item(0);if(d){var u=Math.abs(d.clientX-s.initialTouchX),f=Math.abs(d.clientY-s.initialTouchY),g=5;s.userIsDragging=u>g||f>g}},s.onTouchEnd=function(l){s.userIsDragging||(s.controlRef&&!s.controlRef.contains(l.target)&&s.menuListRef&&!s.menuListRef.contains(l.target)&&s.blurInput(),s.initialTouchX=0,s.initialTouchY=0)},s.onControlTouchEnd=function(l){s.userIsDragging||s.onControlMouseDown(l)},s.onClearIndicatorTouchEnd=function(l){s.userIsDragging||s.onClearIndicatorMouseDown(l)},s.onDropdownIndicatorTouchEnd=function(l){s.userIsDragging||s.onDropdownIndicatorMouseDown(l)},s.handleInputChange=function(l){var c=s.props.inputValue,d=l.currentTarget.value;s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange(d,{action:"input-change",prevInputValue:c}),s.props.menuIsOpen||s.onMenuOpen()},s.onInputFocus=function(l){s.props.onFocus&&s.props.onFocus(l),s.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(s.openAfterFocus||s.props.openMenuOnFocus)&&s.openMenu("first"),s.openAfterFocus=!1},s.onInputBlur=function(l){var c=s.props.inputValue;if(s.menuListRef&&s.menuListRef.contains(document.activeElement)){s.inputRef.focus();return}s.props.onBlur&&s.props.onBlur(l),s.onInputChange("",{action:"input-blur",prevInputValue:c}),s.onMenuClose(),s.setState({focusedValue:null,isFocused:!1})},s.onOptionHover=function(l){if(!(s.blockOptionHover||s.state.focusedOption===l)){var c=s.getFocusableOptions(),d=c.indexOf(l);s.setState({focusedOption:l,focusedOptionId:d>-1?s.getFocusedOptionId(l):null})}},s.shouldHideSelectedOptions=function(){return Qf(s.props)},s.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),s.focus()},s.onKeyDown=function(l){var c=s.props,d=c.isMulti,u=c.backspaceRemovesValue,f=c.escapeClearsValue,g=c.inputValue,m=c.isClearable,p=c.isDisabled,y=c.menuIsOpen,b=c.onKeyDown,_=c.tabSelectsValue,x=c.openMenuOnFocus,E=s.state,S=E.focusedOption,w=E.focusedValue,N=E.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(s.blockOptionHover=!0,l.key){case"ArrowLeft":if(!d||g)return;s.focusValue("previous");break;case"ArrowRight":if(!d||g)return;s.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(w)s.removeValue(w);else{if(!u)return;d?s.popValue():m&&s.clearValue()}break;case"Tab":if(s.isComposing||l.shiftKey||!y||!_||!S||x&&s.isOptionSelected(S,N))return;s.selectOption(S);break;case"Enter":if(l.keyCode===229)break;if(y){if(!S||s.isComposing)return;s.selectOption(S);break}return;case"Escape":y?(s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange("",{action:"menu-close",prevInputValue:g}),s.onMenuClose()):m&&f&&s.clearValue();break;case" ":if(g)return;if(!y){s.openMenu("first");break}if(!S)return;s.selectOption(S);break;case"ArrowUp":y?s.focusOption("up"):s.openMenu("last");break;case"ArrowDown":y?s.focusOption("down"):s.openMenu("first");break;case"PageUp":if(!y)return;s.focusOption("pageup");break;case"PageDown":if(!y)return;s.focusOption("pagedown");break;case"Home":if(!y)return;s.focusOption("first");break;case"End":if(!y)return;s.focusOption("last");break;default:return}l.preventDefault()}},s.state.instancePrefix="react-select-"+(s.props.instanceId||++$k),s.state.selectValue=ci(r.value),r.menuIsOpen&&s.state.selectValue.length){var o=s.getFocusableOptionsWithIds(),i=s.buildFocusableOptions(),a=i.indexOf(s.state.selectValue[0]);s.state.focusableOptionsWithIds=o,s.state.focusedOption=i[a],s.state.focusedOptionId=Fl(o,i[a])}return s}return sx(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&pf(this.menuListRef,this.focusedOptionRef),Ck()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(s){var o=this.props,i=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!i&&s.isDisabled||l&&a&&!s.menuIsOpen)&&this.focusInput(),l&&i&&!s.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&s.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(pf(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(s,o){this.props.onInputChange(s,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(s){var o=this,i=this.state,a=i.selectValue,l=i.isFocused,c=this.buildFocusableOptions(),d=s==="first"?0:c.length-1;if(!this.props.isMulti){var u=c.indexOf(a[0]);u>-1&&(d=u)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[d],focusedOptionId:this.getFocusedOptionId(c[d])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(s){var o=this.state,i=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var c=i.length-1,d=-1;if(i.length){switch(s){case"previous":l===0?d=0:l===-1?d=c:d=l-1;break;case"next":l>-1&&l<c&&(d=l+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:i[d]})}}}},{key:"focusOption",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(i);i||(c=-1),s==="up"?l=c>0?c-1:a.length-1:s==="down"?l=(c+1)%a.length:s==="pageup"?(l=c-o,l<0&&(l=0)):s==="pagedown"?(l=c+o,l>a.length-1&&(l=a.length-1)):s==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme($l):Ee(Ee({},$l),this.props.theme):$l})},{key:"getCommonProps",value:function(){var s=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,d=this.setValue,u=this.props,f=u.isMulti,g=u.isRtl,m=u.options,p=this.hasValue();return{clearValue:s,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:f,isRtl:g,options:m,selectOption:c,selectProps:u,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var s=this.state.selectValue;return s.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var s=this.props,o=s.isClearable,i=s.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(s,o){return Kf(this.props,s,o)}},{key:"isOptionSelected",value:function(s,o){return qf(this.props,s,o)}},{key:"filterOption",value:function(s,o){return Zf(this.props,s,o)}},{key:"formatOptionLabel",value:function(s,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(s,{context:o,inputValue:i,selectValue:a})}else return this.getOptionLabel(s)}},{key:"formatGroupLabel",value:function(s){return this.props.formatGroupLabel(s)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var s=this.props,o=s.isDisabled,i=s.isSearchable,a=s.inputId,l=s.inputValue,c=s.tabIndex,d=s.form,u=s.menuIsOpen,f=s.required,g=this.getComponents(),m=g.Input,p=this.state,y=p.inputIsHidden,b=p.ariaSelection,_=this.commonProps,x=a||this.getElementId("input"),E=Ee(Ee(Ee({"aria-autocomplete":"list","aria-expanded":u,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?$.createElement(m,Ae({},_,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:d,type:"text",value:l},E)):$.createElement(dk,Ae({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:li,onFocus:this.onInputFocus,disabled:o,tabIndex:c,inputMode:"none",form:d,value:""},E))})},{key:"renderPlaceholderOrValue",value:function(){var s=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,c=o.MultiValueRemove,d=o.SingleValue,u=o.Placeholder,f=this.commonProps,g=this.props,m=g.controlShouldRenderValue,p=g.isDisabled,y=g.isMulti,b=g.inputValue,_=g.placeholder,x=this.state,E=x.selectValue,S=x.focusedValue,w=x.isFocused;if(!this.hasValue()||!m)return b?null:$.createElement(u,Ae({},f,{key:"placeholder",isDisabled:p,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),_);if(y)return E.map(function(C,k){var M=C===S,T="".concat(s.getOptionLabel(C),"-").concat(s.getOptionValue(C));return $.createElement(i,Ae({},f,{components:{Container:a,Label:l,Remove:c},isFocused:M,isDisabled:p,key:T,index:k,removeProps:{onClick:function(){return s.removeValue(C)},onTouchEnd:function(){return s.removeValue(C)},onMouseDown:function(P){P.preventDefault()}},data:C}),s.formatOptionLabel(C,"value"))});if(b)return null;var N=E[0];return $.createElement(d,Ae({},f,{data:N,isDisabled:p}),this.formatOptionLabel(N,"value"))}},{key:"renderClearIndicator",value:function(){var s=this.getComponents(),o=s.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,d=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||c)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return $.createElement(o,Ae({},i,{innerProps:u,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var s=this.getComponents(),o=s.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,d=this.state.isFocused;if(!o||!c)return null;var u={"aria-hidden":"true"};return $.createElement(o,Ae({},i,{innerProps:u,isDisabled:l,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var s=this.getComponents(),o=s.DropdownIndicator,i=s.IndicatorSeparator;if(!o||!i)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return $.createElement(i,Ae({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var s=this.getComponents(),o=s.DropdownIndicator;if(!o)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return $.createElement(o,Ae({},i,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var s=this,o=this.getComponents(),i=o.Group,a=o.GroupHeading,l=o.Menu,c=o.MenuList,d=o.MenuPortal,u=o.LoadingMessage,f=o.NoOptionsMessage,g=o.Option,m=this.commonProps,p=this.state.focusedOption,y=this.props,b=y.captureMenuScroll,_=y.inputValue,x=y.isLoading,E=y.loadingMessage,S=y.minMenuHeight,w=y.maxMenuHeight,N=y.menuIsOpen,C=y.menuPlacement,k=y.menuPosition,M=y.menuPortalTarget,T=y.menuShouldBlockScroll,L=y.menuShouldScrollIntoView,P=y.noOptionsMessage,F=y.onMenuScrollToTop,D=y.onMenuScrollToBottom;if(!N)return null;var A=function(B,G){var z=B.type,X=B.data,Y=B.isDisabled,Z=B.isSelected,ee=B.label,te=B.value,ce=p===X,J=Y?void 0:function(){return s.onOptionHover(X)},he=Y?void 0:function(){return s.selectOption(X)},le="".concat(s.getElementId("option"),"-").concat(G),ae={id:le,onClick:he,onMouseMove:J,onMouseOver:J,tabIndex:-1,role:"option","aria-selected":s.state.isAppleDevice?void 0:Z};return $.createElement(g,Ae({},m,{innerProps:ae,data:X,isDisabled:Y,isSelected:Z,key:le,label:ee,type:z,value:te,isFocused:ce,innerRef:ce?s.getFocusedOptionRef:void 0}),s.formatOptionLabel(B.data,"menu"))},O;if(this.hasOptions())O=this.getCategorizedOptions().map(function(U){if(U.type==="group"){var B=U.data,G=U.options,z=U.index,X="".concat(s.getElementId("group"),"-").concat(z),Y="".concat(X,"-heading");return $.createElement(i,Ae({},m,{key:X,data:B,options:G,Heading:a,headingProps:{id:Y,data:U.data},label:s.formatGroupLabel(U.data)}),U.options.map(function(Z){return A(Z,"".concat(z,"-").concat(Z.index))}))}else if(U.type==="option")return A(U,"".concat(U.index))});else if(x){var V=E({inputValue:_});if(V===null)return null;O=$.createElement(u,m,V)}else{var H=P({inputValue:_});if(H===null)return null;O=$.createElement(f,m,H)}var W={minMenuHeight:S,maxMenuHeight:w,menuPlacement:C,menuPosition:k,menuShouldScrollIntoView:L},j=$.createElement(jw,Ae({},m,W),function(U){var B=U.ref,G=U.placerProps,z=G.placement,X=G.maxHeight;return $.createElement(l,Ae({},m,W,{innerRef:B,innerProps:{onMouseDown:s.onMenuMouseDown,onMouseMove:s.onMenuMouseMove},isLoading:x,placement:z}),$.createElement(mk,{captureEnabled:b,onTopArrive:F,onBottomArrive:D,lockEnabled:T},function(Y){return $.createElement(c,Ae({},m,{innerRef:function(ee){s.getMenuListRef(ee),Y(ee)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:s.getElementId("listbox")},isLoading:x,maxHeight:X,focusedOption:p}),O)}))});return M||k==="fixed"?$.createElement(d,Ae({},m,{appendTo:M,controlElement:this.controlRef,menuPlacement:C,menuPosition:k}),j):j}},{key:"renderFormField",value:function(){var s=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,c=o.name,d=o.required,u=this.state.selectValue;if(d&&!this.hasValue()&&!a)return $.createElement(vk,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(i){var f=u.map(function(p){return s.getOptionValue(p)}).join(i);return $.createElement("input",{name:c,type:"hidden",value:f})}else{var g=u.length>0?u.map(function(p,y){return $.createElement("input",{key:"i-".concat(y),name:c,type:"hidden",value:s.getOptionValue(p)})}):$.createElement("input",{name:c,type:"hidden",value:""});return $.createElement("div",null,g)}else{var m=u[0]?this.getOptionValue(u[0]):"";return $.createElement("input",{name:c,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var s=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,c=o.isFocused,d=o.selectValue,u=this.getFocusableOptions();return $.createElement(sk,Ae({},s,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:c,selectValue:d,focusableOptions:u,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var s=this.getComponents(),o=s.Control,i=s.IndicatorsContainer,a=s.SelectContainer,l=s.ValueContainer,c=this.props,d=c.className,u=c.id,f=c.isDisabled,g=c.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return $.createElement(a,Ae({},p,{className:d,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),$.createElement(o,Ae({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:g}),$.createElement(l,Ae({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),$.createElement(i,Ae({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(s,o){var i=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,c=o.ariaSelection,d=o.isFocused,u=o.prevWasFocused,f=o.instancePrefix,g=s.options,m=s.value,p=s.menuIsOpen,y=s.inputValue,b=s.isMulti,_=ci(m),x={};if(i&&(m!==i.value||g!==i.options||p!==i.menuIsOpen||y!==i.inputValue)){var E=p?Ik(s,_):[],S=p?Gf(pi(s,_),"".concat(f,"-option")):[],w=a?Lk(o,_):null,N=Pk(o,E),C=Fl(S,N);x={selectValue:_,focusedOption:N,focusedOptionId:C,focusableOptionsWithIds:S,focusedValue:w,clearFocusValueOnUpdate:!1}}var k=l!=null&&s!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},M=c,T=d&&u;return d&&!T&&(M={value:Hs(b,_,_[0]||null),options:_,action:"initial-input-focus"},T=!u),c?.action==="initial-input-focus"&&(M=null),Ee(Ee(Ee({},x),k),{},{prevProps:s,ariaSelection:M,prevWasFocused:T})}}]),n})(v.Component);Vl.defaultProps=Dk;var Fk=v.forwardRef(function(t,e){var n=Lu(t);return $.createElement(Vl,Ae({ref:e},n))}),Jf=Fk,Vk=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Rf=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,s=String(e).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),i=String(r.getOptionLabel(n)).toLowerCase();return o===s||i===s},zl={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,n,r,s){return!(!e||n.some(function(o){return Rf(e,o,s)})||r.some(function(o){return Rf(e,o,s)}))},getNewOptionData:function(e,n){return{label:n,value:e,__isNew__:!0}}};function zk(t){var e=t.allowCreateWhileLoading,n=e===void 0?!1:e,r=t.createOptionPosition,s=r===void 0?"last":r,o=t.formatCreateLabel,i=o===void 0?zl.formatCreateLabel:o,a=t.isValidNewOption,l=a===void 0?zl.isValidNewOption:a,c=t.getNewOptionData,d=c===void 0?zl.getNewOptionData:c,u=t.onCreateOption,f=t.options,g=f===void 0?[]:f,m=t.onChange,p=In(t,Vk),y=p.getOptionValue,b=y===void 0?Uf:y,_=p.getOptionLabel,x=_===void 0?Hf:_,E=p.inputValue,S=p.isLoading,w=p.isMulti,N=p.value,C=p.name,k=v.useMemo(function(){return l(E,ci(N),g,{getOptionValue:b,getOptionLabel:x})?d(E,i(E)):void 0},[i,d,x,b,E,l,g,N]),M=v.useMemo(function(){return(n||!S)&&k?s==="first"?[k].concat(Gr(g)):[].concat(Gr(g),[k]):g},[n,s,S,k,g]),T=v.useCallback(function(L,P){if(P.action!=="select-option")return m(L,P);var F=Array.isArray(L)?L:[L];if(F[F.length-1]===k){if(u)u(E);else{var D=d(E,E),A={action:"create-option",name:C,option:D};m(Hs(w,[].concat(Gr(ci(N)),[D]),D),A)}return}m(L,P)},[d,E,w,C,k,u,m,N]);return Ee(Ee({},p),{},{options:M,onChange:T})}var Hk=v.forwardRef(function(t,e){var n=Lu(t),r=zk(n);return $.createElement(Vl,Ae({ref:e},r))}),eh=Hk;const Ft={control:"input-tag",valueContainer:"gap-1 flex flex-wrap",multiValue:{blue:"bg-blue-100 dark:bg-blue-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",green:"bg-green-100 dark:bg-green-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",amber:"bg-amber-100 dark:bg-amber-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",red:"bg-red-100 dark:bg-red-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",purple:"bg-purple-100 dark:bg-purple-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",gray:"bg-gray-100 dark:bg-gray-700/50 rounded px-1.5 py-0.5 flex items-center gap-1"},multiValueLabel:{blue:"text-blue-700 dark:text-blue-300 text-xs",green:"text-green-700 dark:text-green-300 text-xs font-semibold",amber:"text-amber-700 dark:text-amber-300 text-xs font-semibold",red:"text-red-700 dark:text-red-300 text-xs font-semibold",purple:"text-purple-700 dark:text-purple-300 text-xs font-semibold",gray:"text-gray-700 dark:text-gray-300 text-xs"},multiValueRemove:{blue:"text-blue-700 dark:text-blue-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",green:"text-green-700 dark:text-green-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",amber:"text-amber-700 dark:text-amber-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",red:"text-red-700 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",purple:"text-purple-700 dark:text-purple-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",gray:"text-gray-700 dark:text-gray-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1"},input:"text-gray-900 dark:text-white text-sm",placeholder:"text-gray-400 dark:text-gray-500 text-sm",menu:"mt-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",menuList:"py-1",option:{base:"px-3 py-2 cursor-pointer text-gray-900 dark:text-white text-[13px]",selected:"bg-blue-100 dark:bg-blue-900/20",focused:"bg-gray-100 dark:bg-gray-700",default:"bg-white dark:bg-gray-800"},noOptionsMessage:"px-3 py-2 text-gray-500 dark:text-gray-400 text-[13px]",checkbox:{base:"w-4 h-4 rounded border flex items-center justify-center text-white text-[10px] shrink-0",selected:"bg-blue-500 border-blue-500",unselected:"border-gray-400 dark:border-gray-500"}},th=t=>{const{data:e,isSelected:n}=t;return h.jsx(gi.Option,{...t,children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`${Ft.checkbox.base} ${n?Ft.checkbox.selected:Ft.checkbox.unselected}`,children:n?"✓":""}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"text-[13px]",children:e.label}),e.count!==void 0&&e.count>0&&h.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-[10px]",children:["(",e.count,")"]})]}),e.description&&h.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.description})]})]})})},nh=t=>h.jsx(gi.GroupHeading,{...t,children:h.jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800/50 border-b border-gray-200 dark:border-gray-700",children:t.data.label})}),Uk=t=>{const{data:e}=t;return h.jsxs(gi.MultiValueLabel,{...t,children:[h.jsx("span",{children:e.label}),e.count!==void 0&&e.count>0&&h.jsxs("span",{className:"text-xs opacity-60 ml-1",children:["(",e.count,")"]})]})},Bk=({value:t,options:e=[],onChange:n,creatable:r=!1,placeholder:s="검색 또는 입력...",noOptionsMessage:o="검색 결과가 없습니다",formatCreateLabel:i,createLabelSuffix:a="추가",maxItems:l,disabled:c=!1,onBeforeRemove:d,onCreateOption:u,className:f="",tagVariants:g,defaultVariant:m="blue",name:p,isMulti:y=!0,isClearable:b=!0,isSearchable:_=!0,delimiters:x=[","],splitOnPaste:E=!0,onInputChange:S,id:w,editorAttrs:N})=>{const C=c===!0||c==="true",k=v.useCallback(J=>J==null?[]:Array.isArray(J)?J:[J],[]),[M,T]=v.useState(()=>k(t)),[L,P]=v.useState(""),F=v.useRef(void 0);v.useEffect(()=>{const J=(le,ae)=>!le&&!ae?!0:!le||!ae||le.length!==ae.length?!1:le.every((Se,ue)=>Se===ae[ue]),he=k(t);J(he,F.current)||(T(he),F.current=he)},[t,k]);const D=v.useMemo(()=>i?typeof i=="string"?J=>`${i} "${J}"`:i:J=>h.jsxs("span",{className:"text-[13px]",children:[h.jsx("strong",{children:J})," ",a]}),[i,a]),A=v.useMemo(()=>!M||!Array.isArray(M)?[]:M.map(J=>e.find(le=>le.value===J)||{value:J,label:String(J)}).filter(J=>J!==void 0),[M,e]),O=v.useMemo(()=>{const J=new Set(e.map(we=>we.value)),he=M?M.filter(we=>!J.has(we)).map(we=>({value:we,label:String(we)})):[],le=[...e,...he];if(!le.some(we=>we.group))return le;const Se=new Map,ue=[];le.forEach(we=>{if(we.group){const He=Se.get(we.group)||[];He.push(we),Se.set(we.group,He)}else ue.push(we)});const pe=[];return Se.forEach((we,He)=>{pe.push({label:He,options:we})}),ue.length>0&&pe.push({label:"",options:ue}),pe},[e,M]),V=v.useCallback(J=>({target:{value:J},currentTarget:{value:J},preventDefault:()=>{},stopPropagation:()=>{}}),[]),H=v.useCallback(J=>{if(!x?.length)return[J.trim()].filter(Boolean);const he=x.map(ae=>ae.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),le=new RegExp(`[${he.join("")}]`);return J.split(le).map(ae=>ae.trim()).filter(Boolean)},[x]),W=v.useCallback((J,he)=>{if(he.action!=="input-change"){P(J);return}if(S&&S(V(J)),!x?.some(ue=>J.includes(ue))||!r||!y){P(J);return}const Se=H(J).filter(ue=>ue&&!M.includes(ue));if(Se.length>0){const ue=l?l-M.length:1/0,pe=Se.slice(0,ue);if(pe.length>0){const we=[...M,...pe];T(we),n(V(we))}}P("")},[x,r,y,H,M,l,n,V,S]),j=v.useCallback(J=>{if(!E||!r||!y)return;const he=J.clipboardData.getData("text"),le=H(he);if(le.length<=1)return;J.preventDefault();const ae=le.filter(Se=>Se&&!M.includes(Se));if(ae.length>0){const Se=l?l-M.length:1/0,ue=ae.slice(0,Se);if(ue.length>0){const pe=[...M,...ue];T(pe),n(V(pe))}}},[E,r,y,H,M,l,n,V]),U=v.useCallback((J,he)=>{if((he.action==="remove-value"||he.action==="pop-value")&&he.removedValue&&d){const ae=d(he.removedValue);if(ae!==!0){const Se=typeof ae=="string"?ae:`"${he.removedValue.label}"은(는) 제거할 수 없습니다.`;alert(Se);return}}if(l&&J.length>l)return;const le=J.map(ae=>ae.value);T(le),n(V(le))},[n,d,l,V]),B=v.useCallback((J,he)=>{if(he.action==="clear"&&M.length>0&&d){const Se=e.find(pe=>pe.value===M[0])||{value:M[0],label:String(M[0])},ue=d(Se);if(ue!==!0){const pe=typeof ue=="string"?ue:`"${Se.label}"은(는) 제거할 수 없습니다.`;alert(pe);return}}const le=J?J.value:null,ae=J?[J.value]:[];T(ae),n(V(le))},[n,d,M,e,V]),G=v.useCallback(J=>{u&&u(J);const he=[...M||[],J];T(he),n(V(he))},[n,u,M,V]),z=v.useCallback(J=>!J||!J.trim()?!1:!M?.includes(J.trim()),[M]),X=v.useCallback(J=>{const he=L.trim();if(J.key==="Tab"&&r&&y&&he){if(M.includes(he))J.preventDefault(),P("");else if(!l||M.length<l){J.preventDefault();const le=[...M,he];T(le),n(V(le)),P("")}return}J.key==="Enter"&&(!he||M&&M.includes(he))&&(J.preventDefault(),J.stopPropagation())},[M,L,r,y,l,n,V]),Y=v.useCallback(J=>g&&g[J]?g[J]:m,[g,m]),Z={control:()=>`${Ft.control} ${f} ${C?"opacity-60 cursor-not-allowed":""}`,valueContainer:()=>Ft.valueContainer,multiValue:J=>{const he=Y(J.data.value);return Ft.multiValue[he]},multiValueLabel:J=>{const he=Y(J.data.value);return Ft.multiValueLabel[he]},multiValueRemove:J=>{const he=Y(J.data.value);return`${Ft.multiValueRemove[he]} ${C?"pointer-events-none":""}`},singleValue:()=>"text-gray-900 dark:text-white text-sm",input:()=>Ft.input,placeholder:()=>Ft.placeholder,menu:()=>Ft.menu,menuList:()=>Ft.menuList,menuPortal:()=>"z-[9999]",option:J=>`${Ft.option.base} ${J.isSelected?Ft.option.selected:J.isFocused?Ft.option.focused:Ft.option.default}`,noOptionsMessage:()=>Ft.noOptionsMessage,clearIndicator:()=>"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-pointer px-1",dropdownIndicator:()=>"text-gray-400 dark:text-gray-500 px-1"},ee={options:O,onKeyDown:X,placeholder:s,noOptionsMessage:()=>o,isDisabled:C,isSearchable:_,menuIsOpen:void 0,openMenuOnClick:!0,openMenuOnFocus:!0,menuPortalTarget:typeof document<"u"?document.body:null,menuPosition:"fixed",classNamePrefix:"tag-input",unstyled:!0,classNames:Z,styles:{menuPortal:J=>({...J,zIndex:9999})},...r&&y||S?{inputValue:L,onInputChange:W}:{}},te=y?M.join(","):M[0]??"";if(!y){const J={...ee,isMulti:!1,value:A[0]||null,onChange:B,isClearable:b,closeMenuOnSelect:!0,components:{Option:th,GroupHeading:nh,IndicatorSeparator:()=>null,...b?{}:{ClearIndicator:()=>null}}};return r?h.jsxs(I,{id:w,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:te}),h.jsx(eh,{...J,onCreateOption:G,formatCreateLabel:D,isValidNewOption:z,createOptionPosition:"first"})]}):h.jsxs(I,{id:w,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:te}),h.jsx(Jf,{...J})]})}const ce={...ee,isMulti:!0,value:A,onChange:U,closeMenuOnSelect:!1,hideSelectedOptions:!1,backspaceRemovesValue:!1,isClearable:!1,components:{Option:th,GroupHeading:nh,MultiValueLabel:Uk,ClearIndicator:()=>null,DropdownIndicator:()=>null,IndicatorSeparator:()=>null}};return r?h.jsxs(I,{id:w,...N,onPaste:j,children:[p&&h.jsx("input",{type:"hidden",name:p,value:te}),h.jsx(eh,{...ce,onCreateOption:G,formatCreateLabel:D,isValidNewOption:z,createOptionPosition:"first"})]}):h.jsxs(I,{id:w,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:te}),h.jsx(Jf,{...ce})]})},Zr=(t,e)=>window.G7Core?.t?.(t,e)??t,jk=()=>window.G7Core?.locale?.supported?.()??["ko","en"],Wk=()=>window.G7Core?.locale?.current?.()??"ko",Hl=t=>{const e=Zr(`common.language_${t}`);return e===`common.language_${t}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[t]||t.toUpperCase():e},Gk=({value:t=[],onChange:e,placeholder:n="입력 후 Enter",disabled:r=!1,creatable:s=!0,delimiters:o=[","],className:i="",name:a,error:l,maxItems:c,modalId:d,statePath:u,__componentContext:f,id:g,editorAttrs:m})=>{const p=v.useMemo(()=>jk(),[]),y=v.useMemo(()=>Wk(),[]),[b,_]=v.useState(()=>t||[]),[x,E]=v.useState(""),[S,w]=v.useState(!1),[N,C]=v.useState(null),[k,M]=v.useState({}),T=v.useRef(null),L=v.useRef(void 0);v.useEffect(()=>{const z=(Y,Z)=>!Y&&!Z?!0:!Y||!Z||Y.length!==Z.length?!1:JSON.stringify(Y)===JSON.stringify(Z),X=t||[];z(X,L.current)||(_(X),L.current=X)},[t]);const P=v.useCallback(z=>({target:{name:a,value:z},currentTarget:{name:a,value:z},preventDefault:()=>{},stopPropagation:()=>{}}),[a]),F=v.useCallback(z=>{const X=[];for(const Y of p){const Z=z[Y];Z?.trim()&&X.push(`${Y.toUpperCase()}: ${Z}`)}return X.length>0?X.join(" / "):""},[p]),D=v.useCallback(z=>{const X=b.filter((Y,Z)=>Z!==z);_(X),e?.(P(X))},[b,e,P]),A=v.useCallback((z,X,Y)=>{const Z=window.G7Core;if(!Z?.dispatch)return;const ee=p.map(te=>({code:te,label:Hl(te)}));Z.dispatch({handler:"setState",params:{target:"global",multilingualTagEdit:{fieldName:a,editingIndex:z,values:X,supportedLocales:ee,defaultLocale:y,statePath:u,currentTags:Y}}}),Z.dispatch({handler:"openModal",target:d},{componentContext:f})},[a,p,y,d,u,f]),O=v.useCallback(z=>{r||(d?A(z,{...b[z]},b):(C(z),M({...b[z]}),w(!0)))},[r,b,d,A]),V=v.useCallback((z="")=>{const X={};p.forEach(Y=>{X[Y]=Y===y?z:""}),d?(A(null,X,b),E("")):(C(null),M(X),w(!0),E(""))},[p,y,d,A,b]),H=v.useCallback(()=>{if(!Object.values(k).some(Y=>Y.trim()!=="")){w(!1);return}let X;N!==null?X=b.map((Y,Z)=>Z===N?k:Y):X=[...b,k],_(X),e?.(P(X)),w(!1),M({}),C(null)},[k,N,b,e,P]),W=v.useCallback(()=>{w(!1),M({}),C(null)},[]),j=v.useCallback(z=>{const X=z.target.value;if(o.some(Z=>X.includes(Z))&&s){const Z=o.map(ce=>ce.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),ee=new RegExp(`[${Z.join("")}]`),te=X.split(ee).map(ce=>ce.trim()).filter(Boolean);if(te.length>0){V(te[0]);return}}E(X)},[o,s,V]),U=v.useCallback(z=>{if(z.key==="Enter"&&x.trim()&&s){if(z.preventDefault(),c&&b.length>=c)return;V(x.trim())}},[x,s,c,b.length,V]),B=v.useCallback((z,X)=>{M(Y=>({...Y,[z]:X}))},[]),G=!!l;return h.jsxs(I,{className:i,id:g,...m,children:[h.jsxs(I,{className:`flex flex-wrap gap-1.5 p-2 border rounded-lg bg-white dark:bg-gray-700 min-h-[42px] ${G?"border-red-500 dark:border-red-400":"border-gray-300 dark:border-gray-600 focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500"} ${r?"opacity-60 bg-gray-100 dark:bg-gray-800 cursor-not-allowed":""}`,children:[b.map((z,X)=>h.jsxs(I,{className:"flex items-center gap-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded px-2 py-0.5 text-sm",children:[h.jsx(Q,{className:`cursor-pointer hover:underline ${r?"cursor-not-allowed":""}`,onClick:()=>O(X),children:F(z)}),!r&&h.jsx(oe,{type:"button",className:"p-0 h-4 w-4 min-w-0 border-0 bg-transparent text-blue-600 dark:text-blue-400 hover:text-red-600 dark:hover:text-red-400 hover:bg-transparent",onClick:Y=>{Y.stopPropagation(),D(X)},children:h.jsx(re,{name:"times",className:"text-xs"})})]},X)),s&&!r&&(!c||b.length<c)&&h.jsx("input",{ref:T,type:"text",value:x,onChange:j,onKeyDown:U,placeholder:b.length===0?n:"",disabled:r,className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500"})]}),l&&h.jsx(Q,{className:"text-xs text-red-500 dark:text-red-400 mt-1",children:l}),!d&&h.jsx(Bo,{isOpen:S,onClose:W,title:Zr(N!==null?"common.edit":"common.add"),width:"400px",children:h.jsxs(I,{className:"space-y-4 p-4",children:[p.map(z=>h.jsxs(I,{className:"space-y-1",children:[h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(Q,{className:"text-sm font-medium text-gray-700 dark:text-gray-300 w-16",children:Hl(z)}),h.jsxs(Q,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",z.toUpperCase(),")"]})]}),h.jsx(wt,{type:"text",value:k[z]??"",onChange:X=>B(z,X.target.value),placeholder:`${Hl(z)} 값 입력`,className:"w-full",autoFocus:z===y})]},z)),h.jsxs(I,{className:"flex justify-end gap-2 pt-4 border-t border-gray-200 dark:border-gray-700",children:[h.jsx(oe,{type:"button",variant:"secondary",onClick:W,children:Zr("common.cancel")}),h.jsx(oe,{type:"button",variant:"primary",onClick:H,children:Zr(N!==null?"common.save":"common.add")})]})]})}),a&&h.jsx("input",{type:"hidden",name:a,value:JSON.stringify(b)})]})},rh=(t,e)=>window.G7Core?.t?.(t,e)??t,sh=({type:t,identifier:e,name:n,installedModules:r=[],installedPlugins:s=[],className:o="",style:i,id:a,editorAttrs:l})=>{const c={module:de.Cubes,plugin:de.PuzzlePiece},d={module:rh("common.module"),plugin:rh("common.plugin")},u=v.useMemo(()=>{if(n)return n;if(e){const p=(t==="module"?r:s)?.find(y=>y.identifier===e);if(p)return p.name}},[n,e,t,r,s]),f=c[t],g=u?`${u} ${d[t]}`:d[t];return h.jsxs(Q,{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium text-gray-400 dark:text-gray-500 ${o}`,style:i,id:a,...l,children:[h.jsx(re,{name:f,className:"w-3.5 h-3.5"}),h.jsx(Q,{children:g})]})},Yk=({options:t=[],value:e,onChange:n,multiple:r=!1,searchPlaceholder:s="Search...",onSearch:o,noResultsText:i="No results found",initialText:a="Type to search",triggerLabel:l="Select",triggerIcon:c,disabled:d=!1,className:u="",id:f,editorAttrs:g})=>{const[m,p]=v.useState(!1),[y,b]=v.useState(""),_=v.useRef(null),x=v.useRef(null),E=v.useRef(`searchable-dropdown-input-${Math.random().toString(36).slice(2,9)}`).current,S=v.useMemo(()=>e==null?[]:Array.isArray(e)?e:[e],[e]),w=v.useMemo(()=>{if(!y.trim())return t;const D=y.toLowerCase();return t.filter(A=>A.label.toLowerCase().includes(D)||A.description?.toLowerCase().includes(D))},[t,y]),N=v.useMemo(()=>{if(S.length===0)return l;if(r){const A=S.length;return A===1?t.find(V=>String(V.value)===String(S[0]))?.label||l:`${A} selected`}return t.find(A=>String(A.value)===String(S[0]))?.label||l},[S,t,r,l]);v.useEffect(()=>{const D=A=>{_.current&&!_.current.contains(A.target)&&p(!1)};return m&&document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[m]),v.useEffect(()=>{const D=A=>{A.key==="Escape"&&m&&(p(!1),x.current?.focus())};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[m]),v.useEffect(()=>{if(!m){b("");return}const D=setTimeout(()=>{document.getElementById(E)?.focus()},50);return()=>{clearTimeout(D)}},[m,E]);const C=v.useCallback(()=>{d||p(D=>!D)},[d]),k=v.useCallback(D=>{const A=D.target.value;b(A),o?.(A)},[o]),M=v.useCallback(D=>{if(r){const O=S.some(V=>String(V)===String(D))?S.filter(V=>String(V)!==String(D)):[...S,D];n?.(O)}else n?.(D),p(!1),x.current?.focus()},[r,S,n]),T=D=>S.some(A=>String(A)===String(D)),L=y.length===0&&t.length===0,P=y.length>0&&w.length===0,F=w.length>0;return h.jsxs(I,{ref:_,className:`relative inline-block ${u}`,id:f,...g,children:[h.jsxs(oe,{ref:x,type:"button",onClick:C,disabled:d,className:`
|
||
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
|
||
flex items-center justify-between gap-2
|
||
text-left cursor-pointer
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
min-w-[200px]
|
||
`,"aria-haspopup":"listbox","aria-expanded":m,children:[h.jsxs(I,{className:"flex items-center gap-2",children:[c,h.jsx(Q,{className:"truncate",children:N})]}),h.jsx(Wn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${m?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),m&&h.jsxs(I,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden min-w-[280px]",role:"listbox",children:[h.jsx(I,{className:"p-3 border-b border-gray-200 dark:border-gray-700",children:h.jsx("input",{id:E,type:"text",value:y,onChange:k,placeholder:s,className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent focus:outline-none"})}),h.jsxs(I,{className:"max-h-80 overflow-auto",children:[L&&h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:a}),P&&h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:i}),F&&h.jsx(I,{className:"py-2",children:w.map(D=>{const A=T(D.value);return h.jsxs(oe,{type:"button",onClick:()=>!D.disabled&&M(D.value),disabled:D.disabled,className:`
|
||
w-full px-4 py-3 text-left
|
||
flex items-start gap-3
|
||
hover:bg-gray-100 dark:hover:bg-gray-700
|
||
transition-colors
|
||
${D.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
||
`,role:"option","aria-selected":A,children:[h.jsx(I,{className:"w-5 h-5 flex-shrink-0 mt-0.5",children:A&&h.jsx(Wn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsx(I,{className:`font-medium ${A?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-white"}`,children:D.label}),D.description&&h.jsx(I,{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5",children:D.description})]})]},D.value)})})]})]})]})},Bs={container:{base:"tag-select",disabled:"opacity-50 cursor-not-allowed"},tag:"tag",tagRemove:"tag-remove",placeholder:"tag-select-placeholder"},Xk=({options:t=[],value:e=[],onChange:n,placeholder:r="No items selected",disabled:s=!1,className:o="",id:i,editorAttrs:a})=>{const l=v.useCallback(f=>t.find(m=>String(m.value)===String(f))?.label||String(f),[t]),c=v.useCallback(f=>{if(s)return;const g=e.filter(m=>String(m)!==String(f));n?.(g)},[e,n,s]),d=v.useMemo(()=>e.map(f=>({value:f,label:l(f)})),[e,l]),u=`${Bs.container.base} ${s?Bs.container.disabled:""} ${o}`.trim();return h.jsx(I,{className:u,id:i,...a,children:d.length===0?h.jsx(Q,{className:Bs.placeholder,children:r}):d.map(f=>h.jsxs(Q,{className:Bs.tag,children:[f.label,!s&&h.jsx(Q,{className:Bs.tagRemove,onClick:()=>c(f.value),role:"button","aria-label":`Remove ${f.label}`,children:h.jsx(Wn,{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},f.value))})};function Kk(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const bi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qr(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Ul(t){return"nodeType"in t}function qt(t){var e,n;return t?Qr(t)?t:Ul(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Bl(t){const{Document:e}=qt(t);return t instanceof e}function js(t){return Qr(t)?!1:t instanceof qt(t).HTMLElement}function oh(t){return t instanceof qt(t).SVGElement}function Jr(t){return t?Qr(t)?t.document:Ul(t)?Bl(t)?t:js(t)||oh(t)?t.ownerDocument:document:document:document}const _n=bi?v.useLayoutEffect:v.useEffect;function yi(t){const e=v.useRef(t);return _n(()=>{e.current=t}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function qk(){const t=v.useRef(null),e=v.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Ws(t,e){e===void 0&&(e=[t]);const n=v.useRef(t);return _n(()=>{n.current!==t&&(n.current=t)},e),n}function Gs(t,e){const n=v.useRef();return v.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function vi(t){const e=yi(t),n=v.useRef(null),r=v.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function xi(t){const e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}let jl={};function Ys(t,e){return v.useMemo(()=>{if(e)return e;const n=jl[t]==null?0:jl[t]+1;return jl[t]=n,t+"-"+n},[t,e])}function ih(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((o,i)=>{const a=Object.entries(i);for(const[l,c]of a){const d=o[l];d!=null&&(o[l]=d+t*c)}return o},{...e})}}const Rr=ih(1),Xs=ih(-1);function Zk(t){return"clientX"in t&&"clientY"in t}function wi(t){if(!t)return!1;const{KeyboardEvent:e}=qt(t.target);return e&&t instanceof e}function Qk(t){if(!t)return!1;const{TouchEvent:e}=qt(t.target);return e&&t instanceof e}function ki(t){if(Qk(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Zk(t)?{x:t.clientX,y:t.clientY}:null}const Fn=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Fn.Translate.toString(t),Fn.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),ah="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Jk(t){return t.matches(ah)?t:t.querySelector(ah)}const Rk={display:"none"};function eC(t){let{id:e,value:n}=t;return v.createElement("div",{id:e,style:Rk},n)}function tC(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={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 v.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function nC(){const[t,e]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const lh=v.createContext(null);function rC(t){const e=v.useContext(lh);v.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function sC(){const[t]=v.useState(()=>new Set),e=v.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[v.useCallback(r=>{let{type:s,event:o}=r;t.forEach(i=>{var a;return(a=i[s])==null?void 0:a.call(i,o)})},[t]),e]}const oC={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.
|
||
`},iC={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function aC(t){let{announcements:e=iC,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=oC}=t;const{announce:o,announcement:i}=nC(),a=Ys("DndLiveRegion"),[l,c]=v.useState(!1);if(v.useEffect(()=>{c(!0)},[]),rC(v.useMemo(()=>({onDragStart(u){let{active:f}=u;o(e.onDragStart({active:f}))},onDragMove(u){let{active:f,over:g}=u;e.onDragMove&&o(e.onDragMove({active:f,over:g}))},onDragOver(u){let{active:f,over:g}=u;o(e.onDragOver({active:f,over:g}))},onDragEnd(u){let{active:f,over:g}=u;o(e.onDragEnd({active:f,over:g}))},onDragCancel(u){let{active:f,over:g}=u;o(e.onDragCancel({active:f,over:g}))}}),[o,e])),!l)return null;const d=v.createElement(v.Fragment,null,v.createElement(eC,{id:r,value:s.draggable}),v.createElement(tC,{id:a,announcement:i}));return n?Dn.createPortal(d,n):d}var Et;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Et||(Et={}));function Ci(){}function es(t,e){return v.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Wl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const En=Object.freeze({x:0,y:0});function ch(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function lC(t,e){const n=ki(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function dh(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function cC(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function uh(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function fh(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function hh(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Gl=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=hh(e,e.left,e.top),o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=ch(hh(l),s);o.push({id:a,data:{droppableContainer:i,value:c}})}}return o.sort(dh)},dC=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=uh(e),o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=uh(l),d=s.reduce((f,g,m)=>f+ch(c[m],g),0),u=Number((d/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:u}})}}return o.sort(dh)};function uC(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height),i=s-r,a=o-n;if(r<s&&n<o){const l=e.width*e.height,c=t.width*t.height,d=i*a,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const fC=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const o of r){const{id:i}=o,a=n.get(i);if(a){const l=uC(a,e);l>0&&s.push({id:i,data:{droppableContainer:o,value:l}})}}return s.sort(cC)};function hC(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function gh(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:En}function gC(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.reduce((i,a)=>({...i,top:i.top+t*a.y,bottom:i.bottom+t*a.y,left:i.left+t*a.x,right:i.right+t*a.x}),{...n})}}const pC=gC(1);function ph(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function mC(t,e,n){const r=ph(e);if(!r)return t;const{scaleX:s,scaleY:o,x:i,y:a}=r,l=t.left-i-(1-s)*parseFloat(n),c=t.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?t.width/s:t.width,u=o?t.height/o:t.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const bC={ignoreTransform:!1};function ts(t,e){e===void 0&&(e=bC);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:c,transformOrigin:d}=qt(t).getComputedStyle(t);c&&(n=mC(n,c,d))}const{top:r,left:s,width:o,height:i,bottom:a,right:l}=n;return{top:r,left:s,width:o,height:i,bottom:a,right:l}}function mh(t){return ts(t,{ignoreTransform:!0})}function yC(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function vC(t,e){return e===void 0&&(e=qt(t).getComputedStyle(t)),e.position==="fixed"}function xC(t,e){e===void 0&&(e=qt(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=e[s];return typeof o=="string"?n.test(o):!1})}function Si(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(Bl(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!js(s)||oh(s)||n.includes(s))return n;const o=qt(t).getComputedStyle(s);return s!==t&&xC(s,o)&&n.push(s),vC(s,o)?n:r(s.parentNode)}return t?r(t):n}function bh(t){const[e]=Si(t,1);return e??null}function Yl(t){return!bi||!t?null:Qr(t)?t:Ul(t)?Bl(t)||t===Jr(t).scrollingElement?window:js(t)?t:null:null}function yh(t){return Qr(t)?t.scrollX:t.scrollLeft}function vh(t){return Qr(t)?t.scrollY:t.scrollTop}function Xl(t){return{x:yh(t),y:vh(t)}}var At;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(At||(At={}));function xh(t){return!bi||!t?!1:t===document.scrollingElement}function wh(t){const e={x:0,y:0},n=xh(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,o=t.scrollLeft<=e.x,i=t.scrollTop>=r.y,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:i,isRight:a,maxScroll:r,minScroll:e}}const wC={x:.2,y:.2};function kC(t,e,n,r,s){let{top:o,left:i,right:a,bottom:l}=n;r===void 0&&(r=10),s===void 0&&(s=wC);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=wh(t),g={x:0,y:0},m={x:0,y:0},p={height:e.height*s.y,width:e.width*s.x};return!c&&o<=e.top+p.height?(g.y=At.Backward,m.y=r*Math.abs((e.top+p.height-o)/p.height)):!d&&l>=e.bottom-p.height&&(g.y=At.Forward,m.y=r*Math.abs((e.bottom-p.height-l)/p.height)),!f&&a>=e.right-p.width?(g.x=At.Forward,m.x=r*Math.abs((e.right-p.width-a)/p.width)):!u&&i<=e.left+p.width&&(g.x=At.Backward,m.x=r*Math.abs((e.left+p.width-i)/p.width)),{direction:g,speed:m}}function CC(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function kh(t){return t.reduce((e,n)=>Rr(e,Xl(n)),En)}function SC(t){return t.reduce((e,n)=>e+yh(n),0)}function _C(t){return t.reduce((e,n)=>e+vh(n),0)}function Ch(t,e){if(e===void 0&&(e=ts),!t)return;const{top:n,left:r,bottom:s,right:o}=e(t);bh(t)&&(s<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const EC=[["x",["left","right"],SC],["y",["top","bottom"],_C]];class Kl{constructor(e,n){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 r=Si(n),s=kh(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,i,a]of EC)for(const l of i)Object.defineProperty(this,l,{get:()=>{const c=a(r),d=s[o]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ks{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function MC(t){const{EventTarget:e}=qt(t);return t instanceof e?t:Jr(t)}function ql(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var fn;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(fn||(fn={}));function Sh(t){t.preventDefault()}function NC(t){t.stopPropagation()}var Ye;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Ye||(Ye={}));const _h={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},OC=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class qs{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Ks(Jr(n)),this.windowListeners=new Ks(qt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fn.Resize,this.handleCancel),this.windowListeners.add(fn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&Ch(r),n(En)}handleKeyDown(e){if(wi(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:o=_h,coordinateGetter:i=OC,scrollBehavior:a="smooth"}=s,{code:l}=e;if(o.end.includes(l)){this.handleEnd(e);return}if(o.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:En;this.referenceCoordinates||(this.referenceCoordinates=d);const u=i(e,{active:n,context:r.current,currentCoordinates:d});if(u){const f=Xs(u,d),g={x:0,y:0},{scrollableAncestors:m}=r.current;for(const p of m){const y=e.code,{isTop:b,isRight:_,isLeft:x,isBottom:E,maxScroll:S,minScroll:w}=wh(p),N=CC(p),C={x:Math.min(y===Ye.Right?N.right-N.width/2:N.right,Math.max(y===Ye.Right?N.left:N.left+N.width/2,u.x)),y:Math.min(y===Ye.Down?N.bottom-N.height/2:N.bottom,Math.max(y===Ye.Down?N.top:N.top+N.height/2,u.y))},k=y===Ye.Right&&!_||y===Ye.Left&&!x,M=y===Ye.Down&&!E||y===Ye.Up&&!b;if(k&&C.x!==u.x){const T=p.scrollLeft+f.x,L=y===Ye.Right&&T<=S.x||y===Ye.Left&&T>=w.x;if(L&&!f.y){p.scrollTo({left:T,behavior:a});return}L?g.x=p.scrollLeft-T:g.x=y===Ye.Right?p.scrollLeft-S.x:p.scrollLeft-w.x,g.x&&p.scrollBy({left:-g.x,behavior:a});break}else if(M&&C.y!==u.y){const T=p.scrollTop+f.y,L=y===Ye.Down&&T<=S.y||y===Ye.Up&&T>=w.y;if(L&&!f.x){p.scrollTo({top:T,behavior:a});return}L?g.y=p.scrollTop-T:g.y=y===Ye.Down?p.scrollTop-S.y:p.scrollTop-w.y,g.y&&p.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(e,Rr(Xs(u,this.referenceCoordinates),g))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}qs.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=_h,onActivation:s}=e,{active:o}=n;const{code:i}=t.nativeEvent;if(r.start.includes(i)){const a=o.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function Eh(t){return!!(t&&"distance"in t)}function Mh(t){return!!(t&&"delay"in t)}class Zl{constructor(e,n,r){var s;r===void 0&&(r=MC(e.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=e,this.events=n;const{event:o}=e,{target:i}=o;this.props=e,this.events=n,this.document=Jr(i),this.documentListeners=new Ks(this.document),this.listeners=new Ks(r),this.windowListeners=new Ks(qt(i)),this.initialCoordinates=(s=ki(o))!=null?s:En,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:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(fn.Resize,this.handleCancel),this.windowListeners.add(fn.DragStart,Sh),this.windowListeners.add(fn.VisibilityChange,this.handleCancel),this.windowListeners.add(fn.ContextMenu,Sh),this.documentListeners.add(fn.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mh(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Eh(n)){this.handlePending(n);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(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(fn.Click,NC,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fn.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!s)return;const l=(n=ki(e))!=null?n:En,c=Xs(s,l);if(!r&&a){if(Eh(a)){if(a.tolerance!=null&&ql(c,a.tolerance))return this.handleCancel();if(ql(c,a.distance))return this.handleStart()}if(Mh(a)&&ql(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const TC={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Zs extends Zl{constructor(e){const{event:n}=e,r=Jr(n.target);super(e,TC,r)}}Zs.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const AC={move:{name:"mousemove"},end:{name:"mouseup"}};var Ql;(function(t){t[t.RightClick=2]="RightClick"})(Ql||(Ql={}));class DC extends Zl{constructor(e){super(e,AC,Jr(e.event.target))}}DC.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Ql.RightClick?!1:(r?.({event:n}),!0)}}];const Jl={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class IC extends Zl{constructor(e){super(e,Jl)}static setup(){return window.addEventListener(Jl.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Jl.move.name,e)};function e(){}}}IC.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var Qs;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Qs||(Qs={}));var _i;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(_i||(_i={}));function LC(t){let{acceleration:e,activator:n=Qs.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:i=5,order:a=_i.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:f}=t;const g=$C({delta:u,disabled:!o}),[m,p]=qk(),y=v.useRef({x:0,y:0}),b=v.useRef({x:0,y:0}),_=v.useMemo(()=>{switch(n){case Qs.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Qs.DraggableRect:return s}},[n,s,l]),x=v.useRef(null),E=v.useCallback(()=>{const w=x.current;if(!w)return;const N=y.current.x*b.current.x,C=y.current.y*b.current.y;w.scrollBy(N,C)},[]),S=v.useMemo(()=>a===_i.TreeOrder?[...c].reverse():c,[a,c]);v.useEffect(()=>{if(!o||!c.length||!_){p();return}for(const w of S){if(r?.(w)===!1)continue;const N=c.indexOf(w),C=d[N];if(!C)continue;const{direction:k,speed:M}=kC(w,C,_,e,f);for(const T of["x","y"])g[T][k[T]]||(M[T]=0,k[T]=0);if(M.x>0||M.y>0){p(),x.current=w,m(E,i),y.current=M,b.current=k;return}}y.current={x:0,y:0},b.current={x:0,y:0},p()},[e,E,r,p,o,i,JSON.stringify(_),JSON.stringify(g),m,c,S,d,JSON.stringify(f)])}const PC={x:{[At.Backward]:!1,[At.Forward]:!1},y:{[At.Backward]:!1,[At.Forward]:!1}};function $C(t){let{delta:e,disabled:n}=t;const r=xi(e);return Gs(s=>{if(n||!r||!s)return PC;const o={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[At.Backward]:s.x[At.Backward]||o.x===-1,[At.Forward]:s.x[At.Forward]||o.x===1},y:{[At.Backward]:s.y[At.Backward]||o.y===-1,[At.Forward]:s.y[At.Forward]||o.y===1}}},[n,e,r])}function FC(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Gs(s=>{var o;return e==null?null:(o=r??s)!=null?o:null},[r,e])}function VC(t,e){return v.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,o=s.activators.map(i=>({eventName:i.eventName,handler:e(i.handler,r)}));return[...n,...o]},[]),[t,e])}var Js;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Js||(Js={}));var Rl;(function(t){t.Optimized="optimized"})(Rl||(Rl={}));const Nh=new Map;function zC(t,e){let{dragging:n,dependencies:r,config:s}=e;const[o,i]=v.useState(null),{frequency:a,measure:l,strategy:c}=s,d=v.useRef(t),u=y(),f=Ws(u),g=v.useCallback(function(b){b===void 0&&(b=[]),!f.current&&i(_=>_===null?b:_.concat(b.filter(x=>!_.includes(x))))},[f]),m=v.useRef(null),p=Gs(b=>{if(u&&!n)return Nh;if(!b||b===Nh||d.current!==t||o!=null){const _=new Map;for(let x of t){if(!x)continue;if(o&&o.length>0&&!o.includes(x.id)&&x.rect.current){_.set(x.id,x.rect.current);continue}const E=x.node.current,S=E?new Kl(l(E),E):null;x.rect.current=S,S&&_.set(x.id,S)}return _}return b},[t,o,n,u,l]);return v.useEffect(()=>{d.current=t},[t]),v.useEffect(()=>{u||g()},[n,u]),v.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),v.useEffect(()=>{u||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{g(),m.current=null},a))},[a,u,g,...r]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:o!=null};function y(){switch(c){case Js.Always:return!1;case Js.BeforeDragging:return n;default:return!n}}}function ec(t,e){return Gs(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function HC(t,e){return ec(t,e)}function UC(t){let{callback:e,disabled:n}=t;const r=yi(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function Ei(t){let{callback:e,disabled:n}=t;const r=yi(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function BC(t){return new Kl(ts(t),t)}function Oh(t,e,n){e===void 0&&(e=BC);const[r,s]=v.useState(null);function o(){s(l=>{if(!t)return null;if(t.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=e(t);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const i=UC({callback(l){if(t)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(t)){o();break}}}}),a=Ei({callback:o});return _n(()=>{o(),t?(a?.observe(t),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[t]),r}function jC(t){const e=ec(t);return gh(t,e)}const Th=[];function WC(t){const e=v.useRef(t),n=Gs(r=>t?r&&r!==Th&&t&&e.current&&t.parentNode===e.current.parentNode?r:Si(t):Th,[t]);return v.useEffect(()=>{e.current=t},[t]),n}function GC(t){const[e,n]=v.useState(null),r=v.useRef(t),s=v.useCallback(o=>{const i=Yl(o.target);i&&n(a=>a?(a.set(i,Xl(i)),new Map(a)):null)},[]);return v.useEffect(()=>{const o=r.current;if(t!==o){i(o);const a=t.map(l=>{const c=Yl(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,Xl(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=t}return()=>{i(t),i(o)};function i(a){a.forEach(l=>{const c=Yl(l);c?.removeEventListener("scroll",s)})}},[s,t]),v.useMemo(()=>t.length?e?Array.from(e.values()).reduce((o,i)=>Rr(o,i),En):kh(t):En,[t,e])}function Ah(t,e){e===void 0&&(e=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},e),v.useEffect(()=>{const r=t!==En;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Xs(t,n.current):En}function YC(t){v.useEffect(()=>{if(!bi)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function XC(t,e){return v.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:o}=r;return n[s]=i=>{o(i,e)},n},{}),[t,e])}function Dh(t){return v.useMemo(()=>t?yC(t):null,[t])}const Ih=[];function KC(t,e){e===void 0&&(e=ts);const[n]=t,r=Dh(n?qt(n):null),[s,o]=v.useState(Ih);function i(){o(()=>t.length?t.map(l=>xh(l)?r:new Kl(e(l),l)):Ih)}const a=Ei({callback:i});return _n(()=>{a?.disconnect(),i(),t.forEach(l=>a?.observe(l))},[t]),s}function Lh(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return js(e)?e:t}function qC(t){let{measure:e}=t;const[n,r]=v.useState(null),s=v.useCallback(c=>{for(const{target:d}of c)if(js(d)){r(u=>{const f=e(d);return u?{...u,width:f.width,height:f.height}:f});break}},[e]),o=Ei({callback:s}),i=v.useCallback(c=>{const d=Lh(c);o?.disconnect(),d&&o?.observe(d),r(d?e(d):null)},[e,o]),[a,l]=vi(i);return v.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const ZC=[{sensor:Zs,options:{}},{sensor:qs,options:{}}],QC={current:{}},Mi={draggable:{measure:mh},droppable:{measure:mh,strategy:Js.WhileDragging,frequency:Rl.Optimized},dragOverlay:{measure:ts}};class Rs extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const JC={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Rs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ci},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Mi,measureDroppableContainers:Ci,windowRect:null,measuringScheduled:!1},Ph={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ci,draggableNodes:new Map,over:null,measureDroppableContainers:Ci},eo=v.createContext(Ph),$h=v.createContext(JC);function RC(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Rs}}}function eS(t,e){switch(e.type){case Et.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Et.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Et.DragEnd:case Et.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Et.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new Rs(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Et.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const i=new Rs(t.droppable.containers);return i.set(n,{...o,disabled:s}),{...t,droppable:{...t.droppable,containers:i}}}case Et.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const o=new Rs(t.droppable.containers);return o.delete(n),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function tS(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=v.useContext(eo),o=xi(r),i=xi(n?.id);return v.useEffect(()=>{if(!e&&!r&&o&&i!=null){if(!wi(o)||document.activeElement===o.target)return;const a=s.get(i);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=Jk(d);if(u){u.focus();break}}})}},[r,e,s,i,o]),null}function Fh(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,o)=>o({transform:s,...r}),n):n}function nS(t){return v.useMemo(()=>({draggable:{...Mi.draggable,...t?.draggable},droppable:{...Mi.droppable,...t?.droppable},dragOverlay:{...Mi.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function rS(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const o=v.useRef(!1),{x:i,y:a}=typeof s=="boolean"?{x:s,y:s}:s;_n(()=>{if(!i&&!a||!e){o.current=!1;return}if(o.current||!r)return;const c=e?.node.current;if(!c||c.isConnected===!1)return;const d=n(c),u=gh(d,r);if(i||(u.x=0),a||(u.y=0),o.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const f=bh(c);f&&f.scrollBy({top:u.y,left:u.x})}},[e,i,a,r,n])}const Ni=v.createContext({...En,scaleX:1,scaleY:1});var sr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(sr||(sr={}));const tc=v.memo(function(e){var n,r,s,o;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:d=ZC,collisionDetection:u=fC,measuring:f,modifiers:g,...m}=e;const p=v.useReducer(eS,void 0,RC),[y,b]=p,[_,x]=sC(),[E,S]=v.useState(sr.Uninitialized),w=E===sr.Initialized,{draggable:{active:N,nodes:C,translate:k},droppable:{containers:M}}=y,T=N!=null?C.get(N):null,L=v.useRef({initial:null,translated:null}),P=v.useMemo(()=>{var ye;return N!=null?{id:N,data:(ye=T?.data)!=null?ye:QC,rect:L}:null},[N,T]),F=v.useRef(null),[D,A]=v.useState(null),[O,V]=v.useState(null),H=Ws(m,Object.values(m)),W=Ys("DndDescribedBy",i),j=v.useMemo(()=>M.getEnabled(),[M]),U=nS(f),{droppableRects:B,measureDroppableContainers:G,measuringScheduled:z}=zC(j,{dragging:w,dependencies:[k.x,k.y],config:U.droppable}),X=FC(C,N),Y=v.useMemo(()=>O?ki(O):null,[O]),Z=ot(),ee=HC(X,U.draggable.measure);rS({activeNode:N!=null?C.get(N):null,config:Z.layoutShiftCompensation,initialRect:ee,measure:U.draggable.measure});const te=Oh(X,U.draggable.measure,ee),ce=Oh(X?X.parentElement:null),J=v.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=M.getNodeFor((n=J.current.over)==null?void 0:n.id),le=qC({measure:U.dragOverlay.measure}),ae=(r=le.nodeRef.current)!=null?r:X,Se=w?(s=le.rect)!=null?s:te:null,ue=!!(le.nodeRef.current&&le.rect),pe=jC(ue?null:te),we=Dh(ae?qt(ae):null),He=WC(w?he??X:null),se=KC(He),Oe=Fh(g,{transform:{x:k.x-pe.x,y:k.y-pe.y,scaleX:1,scaleY:1},activatorEvent:O,active:P,activeNodeRect:te,containerNodeRect:ce,draggingNodeRect:Se,over:J.current.over,overlayNodeRect:le.rect,scrollableAncestors:He,scrollableAncestorRects:se,windowRect:we}),Le=Y?Rr(Y,k):null,Ie=GC(He),Ue=Ah(Ie),et=Ah(Ie,[te]),bt=Rr(Oe,Ue),Ge=Se?pC(Se,Oe):null,ft=P&&Ge?u({active:P,collisionRect:Ge,droppableRects:B,droppableContainers:j,pointerCoordinates:Le}):null,Be=fh(ft,"id"),[ne,fe]=v.useState(null),xe=ue?Oe:Rr(Oe,et),ge=hC(xe,(o=ne?.rect)!=null?o:null,te),be=v.useRef(null),Ve=v.useCallback((ye,Ce)=>{let{sensor:Fe,options:nt}=Ce;if(F.current==null)return;const pt=C.get(F.current);if(!pt)return;const it=ye.nativeEvent,rt=new Fe({active:F.current,activeNode:pt,event:it,options:nt,context:J,onAbort(ht){if(!C.get(ht))return;const{onDragAbort:Gt}=H.current,mt={id:ht};Gt?.(mt),_({type:"onDragAbort",event:mt})},onPending(ht,Qt,Gt,mt){if(!C.get(ht))return;const{onDragPending:xn}=H.current,Vt={id:ht,constraint:Qt,initialCoordinates:Gt,offset:mt};xn?.(Vt),_({type:"onDragPending",event:Vt})},onStart(ht){const Qt=F.current;if(Qt==null)return;const Gt=C.get(Qt);if(!Gt)return;const{onDragStart:mt}=H.current,St={activatorEvent:it,active:{id:Qt,data:Gt.data,rect:L}};Dn.unstable_batchedUpdates(()=>{mt?.(St),S(sr.Initializing),b({type:Et.DragStart,initialCoordinates:ht,active:Qt}),_({type:"onDragStart",event:St}),A(be.current),V(it)})},onMove(ht){b({type:Et.DragMove,coordinates:ht})},onEnd:Ot(Et.DragEnd),onCancel:Ot(Et.DragCancel)});be.current=rt;function Ot(ht){return async function(){const{active:Gt,collisions:mt,over:St,scrollAdjustedTranslate:xn}=J.current;let Vt=null;if(Gt&&xn){const{cancelDrop:Ze}=H.current;Vt={activatorEvent:it,active:Gt,collisions:mt,delta:xn,over:St},ht===Et.DragEnd&&typeof Ze=="function"&&await Promise.resolve(Ze(Vt))&&(ht=Et.DragCancel)}F.current=null,Dn.unstable_batchedUpdates(()=>{b({type:ht}),S(sr.Uninitialized),fe(null),A(null),V(null),be.current=null;const Ze=ht===Et.DragEnd?"onDragEnd":"onDragCancel";if(Vt){const jn=H.current[Ze];jn?.(Vt),_({type:Ze,event:Vt})}})}}},[C]),De=v.useCallback((ye,Ce)=>(Fe,nt)=>{const pt=Fe.nativeEvent,it=C.get(nt);if(F.current!==null||!it||pt.dndKit||pt.defaultPrevented)return;const rt={active:it};ye(Fe,Ce.options,rt)===!0&&(pt.dndKit={capturedBy:Ce.sensor},F.current=nt,Ve(Fe,Ce))},[C,Ve]),$e=VC(d,De);YC(d),_n(()=>{te&&E===sr.Initializing&&S(sr.Initialized)},[te,E]),v.useEffect(()=>{const{onDragMove:ye}=H.current,{active:Ce,activatorEvent:Fe,collisions:nt,over:pt}=J.current;if(!Ce||!Fe)return;const it={active:Ce,activatorEvent:Fe,collisions:nt,delta:{x:bt.x,y:bt.y},over:pt};Dn.unstable_batchedUpdates(()=>{ye?.(it),_({type:"onDragMove",event:it})})},[bt.x,bt.y]),v.useEffect(()=>{const{active:ye,activatorEvent:Ce,collisions:Fe,droppableContainers:nt,scrollAdjustedTranslate:pt}=J.current;if(!ye||F.current==null||!Ce||!pt)return;const{onDragOver:it}=H.current,rt=nt.get(Be),Ot=rt&&rt.rect.current?{id:rt.id,rect:rt.rect.current,data:rt.data,disabled:rt.disabled}:null,ht={active:ye,activatorEvent:Ce,collisions:Fe,delta:{x:pt.x,y:pt.y},over:Ot};Dn.unstable_batchedUpdates(()=>{fe(Ot),it?.(ht),_({type:"onDragOver",event:ht})})},[Be]),_n(()=>{J.current={activatorEvent:O,active:P,activeNode:X,collisionRect:Ge,collisions:ft,droppableRects:B,draggableNodes:C,draggingNode:ae,draggingNodeRect:Se,droppableContainers:M,over:ne,scrollableAncestors:He,scrollAdjustedTranslate:bt},L.current={initial:Se,translated:Ge}},[P,X,ft,Ge,C,ae,Se,B,M,ne,He,bt]),LC({...Z,delta:k,draggingRect:Ge,pointerCoordinates:Le,scrollableAncestors:He,scrollableAncestorRects:se});const Me=v.useMemo(()=>({active:P,activeNode:X,activeNodeRect:te,activatorEvent:O,collisions:ft,containerNodeRect:ce,dragOverlay:le,draggableNodes:C,droppableContainers:M,droppableRects:B,over:ne,measureDroppableContainers:G,scrollableAncestors:He,scrollableAncestorRects:se,measuringConfiguration:U,measuringScheduled:z,windowRect:we}),[P,X,te,O,ft,ce,le,C,M,B,ne,G,He,se,U,z,we]),qe=v.useMemo(()=>({activatorEvent:O,activators:$e,active:P,activeNodeRect:te,ariaDescribedById:{draggable:W},dispatch:b,draggableNodes:C,over:ne,measureDroppableContainers:G}),[O,$e,P,te,b,W,C,ne,G]);return v.createElement(lh.Provider,{value:x},v.createElement(eo.Provider,{value:qe},v.createElement($h.Provider,{value:Me},v.createElement(Ni.Provider,{value:ge},c)),v.createElement(tS,{disabled:a?.restoreFocus===!1})),v.createElement(aC,{...a,hiddenTextDescribedById:W}));function ot(){const ye=D?.autoScrollEnabled===!1,Ce=typeof l=="object"?l.enabled===!1:l===!1,Fe=w&&!ye&&!Ce;return typeof l=="object"?{...l,enabled:Fe}:{enabled:Fe}}}),sS=v.createContext(null),Vh="button",oS="Draggable";function iS(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const o=Ys(oS),{activators:i,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:f}=v.useContext(eo),{role:g=Vh,roleDescription:m="draggable",tabIndex:p=0}=s??{},y=l?.id===e,b=v.useContext(y?Ni:sS),[_,x]=vi(),[E,S]=vi(),w=XC(i,e),N=Ws(n);_n(()=>(u.set(e,{id:e,key:o,node:_,activatorNode:E,data:N}),()=>{const k=u.get(e);k&&k.key===o&&u.delete(e)}),[u,e]);const C=v.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":r,"aria-pressed":y&&g===Vh?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,g,p,y,m,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:C,isDragging:y,listeners:r?void 0:w,node:_,over:f,setNodeRef:x,setActivatorNodeRef:S,transform:b}}function zh(){return v.useContext($h)}const aS="Droppable",lS={timeout:25};function cS(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const o=Ys(aS),{active:i,dispatch:a,over:l,measureDroppableContainers:c}=v.useContext(eo),d=v.useRef({disabled:n}),u=v.useRef(!1),f=v.useRef(null),g=v.useRef(null),{disabled:m,updateMeasurementsFor:p,timeout:y}={...lS,...s},b=Ws(p??r),_=v.useCallback(()=>{if(!u.current){u.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),g.current=null},y)},[y]),x=Ei({callback:_,disabled:m||!i}),E=v.useCallback((C,k)=>{x&&(k&&(x.unobserve(k),u.current=!1),C&&x.observe(C))},[x]),[S,w]=vi(E),N=Ws(e);return v.useEffect(()=>{!x||!S.current||(x.disconnect(),u.current=!1,x.observe(S.current))},[S,x]),v.useEffect(()=>(a({type:Et.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:f,data:N}}),()=>a({type:Et.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==d.current.disabled&&(a({type:Et.SetDroppableDisabled,id:r,key:o,disabled:n}),d.current.disabled=n)},[r,o,n,a]),{active:i,rect:f,isOver:l?.id===r,node:S,over:l,setNodeRef:w}}function dS(t){let{animation:e,children:n}=t;const[r,s]=v.useState(null),[o,i]=v.useState(null),a=xi(n);return!n&&!r&&a&&s(a),_n(()=>{if(!o)return;const l=r?.key,c=r?.props.id;if(l==null||c==null){s(null);return}Promise.resolve(e(c,o)).then(()=>{s(null)})},[e,r,o]),v.createElement(v.Fragment,null,n,r?v.cloneElement(r,{ref:i}):null)}const uS={x:0,y:0,scaleX:1,scaleY:1};function fS(t){let{children:e}=t;return v.createElement(eo.Provider,{value:Ph},v.createElement(Ni.Provider,{value:uS},e))}const hS={position:"fixed",touchAction:"none"},gS=t=>wi(t)?"transform 250ms ease":void 0,pS=v.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:o,className:i,rect:a,style:l,transform:c,transition:d=gS}=t;if(!a)return null;const u=s?c:{...c,scaleX:1,scaleY:1},f={...hS,width:a.width,height:a.height,top:a.top,left:a.left,transform:Fn.Transform.toString(u),transformOrigin:s&&r?lC(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return v.createElement(n,{className:i,style:f,ref:e},o)}),mS={duration:250,easing:"ease",keyframes:t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Fn.Transform.toString(e)},{transform:Fn.Transform.toString(n)}]},sideEffects:(t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:o,className:i}=t;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[l,c]of Object.entries(s))n.node.style.setProperty(l,c);i!=null&&i.active&&n.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function bS(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return yi((o,i)=>{if(e===null)return;const a=n.get(o);if(!a)return;const l=a.node.current;if(!l)return;const c=Lh(i);if(!c)return;const{transform:d}=qt(i).getComputedStyle(i),u=ph(d);if(!u)return;const f=typeof e=="function"?e:yS(e);return Ch(l,s.draggable.measure),f({active:{id:o,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:u})})}function yS(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...mS,...t};return o=>{let{active:i,dragOverlay:a,transform:l,...c}=o;if(!e)return;const d={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},u={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-d.x,y:l.y-d.y,...u},g=s({...c,active:i,dragOverlay:a,transform:{initial:l,final:f}}),[m]=g,p=g[g.length-1];if(JSON.stringify(m)===JSON.stringify(p))return;const y=r?.({active:i,dragOverlay:a,...c}),b=a.node.animate(g,{duration:e,easing:n,fill:"forwards"});return new Promise(_=>{b.onfinish=()=>{y?.(),_()}})}}let Hh=0;function vS(t){return v.useMemo(()=>{if(t!=null)return Hh++,Hh},[t])}const xS=v.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:o,modifiers:i,wrapperElement:a="div",className:l,zIndex:c=999}=t;const{activatorEvent:d,active:u,activeNodeRect:f,containerNodeRect:g,draggableNodes:m,droppableContainers:p,dragOverlay:y,over:b,measuringConfiguration:_,scrollableAncestors:x,scrollableAncestorRects:E,windowRect:S}=zh(),w=v.useContext(Ni),N=vS(u?.id),C=Fh(i,{activatorEvent:d,active:u,activeNodeRect:f,containerNodeRect:g,draggingNodeRect:y.rect,over:b,overlayNodeRect:y.rect,scrollableAncestors:x,scrollableAncestorRects:E,transform:w,windowRect:S}),k=ec(f),M=bS({config:r,draggableNodes:m,droppableContainers:p,measuringConfiguration:_}),T=k?y.setRef:void 0;return v.createElement(fS,null,v.createElement(dS,{animation:M},u&&N?v.createElement(pS,{key:N,id:u.id,ref:T,as:a,activatorEvent:d,adjustScale:e,className:l,transition:o,rect:k,style:{zIndex:c,...s},transform:C},n):null))});function ns(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function wS(t,e){return t.reduce((n,r,s)=>{const o=e.get(r);return o&&(n[s]=o),n},Array(t.length))}function Oi(t){return t!==null&&t>=0}function kS(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function CS(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Ti=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const o=ns(e,r,n),i=e[s],a=o[s];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},Ai={scaleX:1,scaleY:1},nc=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:o,overIndex:i}=t;const a=(e=o[n])!=null?e:r;if(!a)return null;if(s===n){const c=o[i];return c?{x:0,y:n<i?c.top+c.height-(a.top+a.height):c.top-a.top,...Ai}:null}const l=SS(o,s,n);return s>n&&s<=i?{x:0,y:-a.height-l,...Ai}:s<n&&s>=i?{x:0,y:a.height+l,...Ai}:{x:0,y:0,...Ai}};function SS(t,e,n){const r=t[e],s=t[e-1],o=t[e+1];return r?n<e?s?r.top-(s.top+s.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const Uh="Sortable",Bh=v.createContext({activeIndex:-1,containerId:Uh,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ti,disabled:{draggable:!1,droppable:!1}});function Di(t){let{children:e,id:n,items:r,strategy:s=Ti,disabled:o=!1}=t;const{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=zh(),u=Ys(Uh,n),f=a.rect!==null,g=v.useMemo(()=>r.map(w=>typeof w=="object"&&"id"in w?w.id:w),[r]),m=i!=null,p=i?g.indexOf(i.id):-1,y=c?g.indexOf(c.id):-1,b=v.useRef(g),_=!kS(g,b.current),x=y!==-1&&p===-1||_,E=CS(o);_n(()=>{_&&m&&d(g)},[_,g,m,d]),v.useEffect(()=>{b.current=g},[g]);const S=v.useMemo(()=>({activeIndex:p,containerId:u,disabled:E,disableTransforms:x,items:g,overIndex:y,useDragOverlay:f,sortedRects:wS(g,l),strategy:s}),[p,u,E.draggable,E.droppable,x,g,y,l,f,s]);return v.createElement(Bh.Provider,{value:S},e)}const jh=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return ns(n,r,s).indexOf(e)},Wh=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:o,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=t;return!c||!r||a!==o&&s===i?!1:n?!0:i!==s&&e===l},_S={duration:200,easing:"ease"},Gh="transform",ES=Fn.Transition.toString({property:Gh,duration:0,easing:"linear"}),MS={roleDescription:"sortable"};function NS(t){let{disabled:e,index:n,node:r,rect:s}=t;const[o,i]=v.useState(null),a=v.useRef(n);return _n(()=>{if(!e&&n!==a.current&&r.current){const l=s.current;if(l){const c=ts(r.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&i(d)}}n!==a.current&&(a.current=n)},[e,n,r,s]),v.useEffect(()=>{o&&i(null)},[o]),o}function Ii(t){let{animateLayoutChanges:e=Wh,attributes:n,disabled:r,data:s,getNewIndex:o=jh,id:i,strategy:a,resizeObserverConfig:l,transition:c=_S}=t;const{items:d,containerId:u,activeIndex:f,disabled:g,disableTransforms:m,sortedRects:p,overIndex:y,useDragOverlay:b,strategy:_}=v.useContext(Bh),x=OS(r,g),E=d.indexOf(i),S=v.useMemo(()=>({sortable:{containerId:u,index:E,items:d},...s}),[u,s,E,d]),w=v.useMemo(()=>d.slice(d.indexOf(i)),[d,i]),{rect:N,node:C,isOver:k,setNodeRef:M}=cS({id:i,data:S,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...l}}),{active:T,activatorEvent:L,activeNodeRect:P,attributes:F,setNodeRef:D,listeners:A,isDragging:O,over:V,setActivatorNodeRef:H,transform:W}=iS({id:i,data:S,attributes:{...MS,...n},disabled:x.draggable}),j=Kk(M,D),U=!!T,B=U&&!m&&Oi(f)&&Oi(y),G=!b&&O,z=G&&B?W:null,Y=B?z??(a??_)({rects:p,activeNodeRect:P,activeIndex:f,overIndex:y,index:E}):null,Z=Oi(f)&&Oi(y)?o({id:i,items:d,activeIndex:f,overIndex:y}):E,ee=T?.id,te=v.useRef({activeId:ee,items:d,newIndex:Z,containerId:u}),ce=d!==te.current.items,J=e({active:T,containerId:u,isDragging:O,isSorting:U,id:i,index:E,items:d,newIndex:te.current.newIndex,previousItems:te.current.items,previousContainerId:te.current.containerId,transition:c,wasDragging:te.current.activeId!=null}),he=NS({disabled:!J,index:E,node:C,rect:N});return v.useEffect(()=>{U&&te.current.newIndex!==Z&&(te.current.newIndex=Z),u!==te.current.containerId&&(te.current.containerId=u),d!==te.current.items&&(te.current.items=d)},[U,Z,u,d]),v.useEffect(()=>{if(ee===te.current.activeId)return;if(ee!=null&&te.current.activeId==null){te.current.activeId=ee;return}const ae=setTimeout(()=>{te.current.activeId=ee},50);return()=>clearTimeout(ae)},[ee]),{active:T,activeIndex:f,attributes:F,data:S,rect:N,index:E,newIndex:Z,items:d,isOver:k,isSorting:U,isDragging:O,listeners:A,node:C,overIndex:y,over:V,setNodeRef:j,setActivatorNodeRef:H,setDroppableNodeRef:M,setDraggableNodeRef:D,transform:he??Y,transition:le()};function le(){if(he||ce&&te.current.newIndex===E)return ES;if(!(G&&!wi(L)||!c)&&(U||J))return Fn.Transition.toString({...c,property:Gh})}}function OS(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function to(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const TS=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],Li=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:o,over:i,scrollableAncestors:a}}=e;if(TS.includes(t.code)){if(t.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const f=s.get(u.id);if(f)switch(t.code){case Ye.Down:r.top<f.top&&l.push(u);break;case Ye.Up:r.top>f.top&&l.push(u);break;case Ye.Left:r.left>f.left&&l.push(u);break;case Ye.Right:r.left<f.left&&l.push(u);break}});const c=dC({collisionRect:r,droppableRects:s,droppableContainers:l});let d=fh(c,"id");if(d===i?.id&&c.length>1&&(d=c[1].id),d!=null){const u=o.get(n.id),f=o.get(d),g=f?s.get(f.id):null,m=f?.node.current;if(m&&g&&u&&f){const y=Si(m).some((w,N)=>a[N]!==w),b=Yh(u,f),_=AS(u,f),x=y||!b?{x:0,y:0}:{x:_?r.width-g.width:0,y:_?r.height-g.height:0},E={x:g.left,y:g.top};return x.x&&x.y?E:Xs(E,x)}}}};function Yh(t,e){return!to(t)||!to(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function AS(t,e){return!to(t)||!to(e)||!Yh(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const DS=Object.freeze(Object.defineProperty({__proto__:null,SortableContext:Di,arrayMove:ns,defaultAnimateLayoutChanges:Wh,defaultNewIndexGetter:jh,hasSortableData:to,rectSortingStrategy:Ti,sortableKeyboardCoordinates:Li,useSortable:Ii,verticalListSortingStrategy:nc},Symbol.toStringTag,{value:"Module"})),IS=()=>window.G7Core,Xh=({item:t,isSelected:e=!1,isExpanded:n=!1,level:r=0,onClick:s,onToggle:o,onExpandToggle:i,className:a="",selectedClassName:l="bg-blue-50 dark:bg-blue-900/30 border-blue-500",defaultClassName:c="bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600",dragHandleClassName:d="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",iconContainerClassName:u="bg-gray-100 dark:bg-gray-700",contentClassName:f="",enableDrag:g=!0,toggleDisabled:m=!1})=>{const{attributes:p,listeners:y,setNodeRef:b,transform:_,transition:x,isDragging:E}=Ii({id:t.id}),S={transform:Fn.Transform.toString(_),transition:x,opacity:E?.5:1},w=r*24+12,C=`flex items-center gap-2 cursor-pointer transition-colors ${e?l:c}`,k=IS()?.style?.mergeClasses?.(C,a)??`${C} ${a}`.trim();return h.jsxs(I,{ref:b,style:S,className:k,onClick:s,children:[g&&h.jsx(I,{...p,...y,className:`flex-shrink-0 cursor-grab active:cursor-grabbing p-1 ${d}`,style:{paddingLeft:`${w}px`},children:h.jsx(re,{name:"grip-vertical",className:"w-4 h-4"})}),!g&&r>0&&h.jsx(I,{style:{paddingLeft:`${w}px`}}),g&&h.jsx(h.Fragment,{children:t.hasChildren?h.jsx(oe,{type:"button",onClick:M=>{M.stopPropagation(),i?.()},className:`flex-shrink-0 p-1 ${d}`,children:h.jsx(re,{name:n?"chevron-down":"chevron-right",className:"w-4 h-4"})}):h.jsx(I,{className:"flex-shrink-0 w-6"})}),h.jsx(I,{className:`flex-shrink-0 w-8 h-8 flex items-center justify-center rounded ${u}`,children:h.jsx(re,{name:t.icon||"file",className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:`flex-1 min-w-0 ${f}`,children:[h.jsxs(I,{className:"flex items-center gap-1",children:[h.jsx(Q,{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:t.name}),t.isModuleMenu&&h.jsx(re,{name:"cube",className:"w-2 h-2 text-gray-300 dark:text-gray-500 ml-2",title:t.moduleName})]}),h.jsx(Q,{className:"text-xs text-gray-500 dark:text-gray-400 truncate block",children:t.url})]}),h.jsx(I,{className:"flex-shrink-0",onClick:M=>M.stopPropagation(),children:h.jsx(Wa,{checked:t.isActive,onChange:()=>o?.(new MouseEvent("click")),size:"sm",disabled:m})})]})},LS=()=>window.G7Core;function Kh(t,e,n=0,r=null){const s=[];for(const o of t)s.push({item:o,depth:n,parentId:r}),o.children?.length>0&&e.has(o.id)&&s.push(...Kh(o.children,e,n+1,o.id));return s}function rc(t,e){for(const n of t){if(n.id===e)return n;if(n.children){const r=rc(n.children,e);if(r)return r}}return null}function qh(t){const e=[];if(t.children)for(const n of t.children)e.push(n.id),e.push(...qh(n));return e}function Zh(t,e){return t.filter(n=>n.id!==e).map(n=>n.children?.length>0?{...n,children:Zh(n.children,e)}:n)}function Qh(t,e,n,r){if(n===null){const s=[...t];return s.splice(r,0,e),s}return t.map(s=>{if(s.id===n){const o=[...s.children||[]];return o.splice(r,0,e),{...s,children:o}}return s.children?.length>0?{...s,children:Qh(s.children,e,n,r)}:s})}function Jh(t,e,n,r){if(e===null){const s=t.findIndex(i=>i.id===n),o=t.findIndex(i=>i.id===r);return s===-1||o===-1?t:ns(t,s,o)}return t.map(s=>{if(s.id===e&&s.children){const o=s.children.findIndex(a=>a.id===n),i=s.children.findIndex(a=>a.id===r);return o===-1||i===-1?s:{...s,children:ns(s.children,o,i)}}return s.children?.length>0?{...s,children:Jh(s.children,e,n,r)}:s})}function Rh(t){const e=t.map((s,o)=>({id:s.id,order:o+1})),n={},r=s=>{s.forEach(o=>{o.children?.length>0&&(n[o.id]=o.children.map((i,a)=>({id:i.id,order:a+1})),r(o.children))})};return r(t),{parent_menus:e,child_menus:n}}const PS=({items:t=[],selectedId:e,onSelect:n,onOrderChange:r,onToggleStatus:s,title:o,className:i="",listClassName:a="",childrenContainerClassName:l="bg-gray-50 dark:bg-gray-900/50",itemClassName:c="py-2.5 px-3 mx-4 my-2 rounded-lg border",itemSelectedClassName:d,itemDefaultClassName:u,titleClassName:f="px-4 py-3 border-b border-gray-200 dark:border-gray-700",enableDrag:g=!0,toggleDisabled:m=!1,id:p,editorAttrs:y})=>{const[b,_]=v.useState(new Set),[x,E]=v.useState(null),[S,w]=v.useState(t),N=v.useRef(!1),C=v.useRef(""),k=v.useRef(""),M=v.useCallback(B=>JSON.stringify(B),[]),T=v.useCallback(B=>B.map(G=>{const z=G.children?.map(X=>X.id).join(",")||"";return`${G.id}:${z}`}).join("|"),[]);v.useEffect(()=>{const B=T(t),G=M(t);if(N.current){const z=T(S);(B===z||B!==C.current)&&(N.current=!1,C.current=B,k.current=G,(B!==z||G!==M(S))&&w(t));return}G!==k.current&&(C.current=B,k.current=G,w(t))},[t,T,M,S]);const L=Wl(es(Zs,{activationConstraint:{distance:8}}),es(qs,{coordinateGetter:Li})),P=v.useCallback(B=>{if(typeof B=="string")return B;const z=LS()?.locale?.current?.()||"ko";return B[z]||B.en||Object.values(B)[0]||""},[]),F=v.useCallback(B=>{_(G=>{const z=new Set(G);return z.has(B)?z.delete(B):z.add(B),z})},[]),D=v.useCallback(B=>{n?.(B)},[n]),A=v.useCallback((B,G,z)=>{z.stopPropagation(),s?.(B,G)},[s]),O=B=>{E(B.active.id)},V=B=>{const{active:G,over:z}=B;if(E(null),!z||G.id===z.id)return;const X=W.find(Z=>Z.item.id===Number(G.id)),Y=W.find(Z=>Z.item.id===Number(z.id));if(!(!X||!Y))if(X.parentId===Y.parentId){const Z=Jh(S,X.parentId,Number(G.id),Number(z.id));w(Z),N.current=!0,r?.(Rh(Z))}else{const Z=X.item;if(qh(Z).includes(Number(z.id)))return;let te=Zh(S,Z.id);const ce=W.findIndex(pe=>pe.item.id===Number(G.id)),J=W.findIndex(pe=>pe.item.id===Number(z.id)),he=ce>J,le=Y.parentId;let ae;if(le===null)ae=te.findIndex(pe=>pe.id===Number(z.id)),ae===-1?ae=te.length:he||(ae+=1);else{const we=rc(te,le)?.children||[];ae=we.findIndex(He=>He.id===Number(z.id)),ae===-1?ae=we.length:he||(ae+=1)}const Se={...Z,parent_id:le,children:Z.children||[]};te=Qh(te,Se,le,ae),w(te),N.current=!0;const ue=Rh(te);ue.moved_items=[{id:Z.id,new_parent_id:le}],r?.(ue)}},H=B=>({id:B.id,name:P(B.name),slug:B.slug,url:B.url,icon:B.icon,isActive:B.is_active,isModuleMenu:!!B.module_id,moduleName:B.module?P(B.module.name):void 0,hasChildren:B.children&&B.children.length>0}),W=v.useMemo(()=>Kh(S,b),[S,b]),j=v.useMemo(()=>W.map(B=>B.item.id),[W]),U=x?rc(S,Number(x)):null;return h.jsxs(I,{className:i,id:p,...y,children:[o&&h.jsx(I,{className:f,children:h.jsx($r,{className:"text-sm font-medium text-gray-900 dark:text-white",children:o})}),h.jsxs(tc,{sensors:L,collisionDetection:Gl,onDragStart:O,onDragEnd:V,children:[h.jsx(Di,{items:j,strategy:nc,children:h.jsx(I,{className:a,children:W.map(B=>h.jsx(I,{className:B.depth>0?l:"",children:h.jsx(Xh,{item:H(B.item),isSelected:e===B.item.id,isExpanded:b.has(B.item.id),level:B.depth,onClick:()=>D(B.item),onToggle:G=>A(B.item.id,B.item.is_active,G),onExpandToggle:()=>F(B.item.id),className:c,selectedClassName:d,defaultClassName:u,enableDrag:g,toggleDisabled:m})},B.item.id))})}),h.jsx(xS,{children:U?h.jsx(I,{className:"bg-white dark:bg-gray-800 shadow-lg rounded-lg border border-blue-500 p-3",children:h.jsx(I,{className:"flex items-center gap-2",children:h.jsx(I,{className:"text-sm font-medium text-gray-900 dark:text-white",children:P(U.name)})})}):null})]})]})},$S=[{value:"LayoutDashboard",label:"LayoutDashboard",faIcon:"tachometer-alt"},{value:"Settings",label:"Settings",faIcon:"cog"},{value:"Menu",label:"Menu",faIcon:"bars"},{value:"Users",label:"Users",faIcon:"users"},{value:"Package",label:"Package",faIcon:"cube"},{value:"Puzzle",label:"Puzzle",faIcon:"puzzle-piece"},{value:"FileText",label:"FileText",faIcon:"file-alt"},{value:"ShoppingCart",label:"ShoppingCart",faIcon:"shopping-cart"},{value:"MessageSquare",label:"MessageSquare",faIcon:"comment"},{value:"Home",label:"Home",faIcon:"home"},{value:"User",label:"User",faIcon:"user"},{value:"Search",label:"Search",faIcon:"search"},{value:"Bell",label:"Bell",faIcon:"bell"},{value:"Mail",label:"Mail",faIcon:"envelope"},{value:"Calendar",label:"Calendar",faIcon:"calendar"},{value:"Chart",label:"Chart",faIcon:"chart-bar"},{value:"Database",label:"Database",faIcon:"database"},{value:"Lock",label:"Lock",faIcon:"lock"},{value:"Globe",label:"Globe",faIcon:"globe"},{value:"Image",label:"Image",faIcon:"image"}],FS=({value:t,onChange:e,options:n=$S,placeholder:r,searchPlaceholder:s,noResultsText:o,className:i="",disabled:a=!1,name:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(!1),[g,m]=v.useState(""),p=v.useRef(null),y=n.find(x=>{if(!t)return!1;if(t.includes("fa-")){const E=t.replace(/^(fas|far|fab|fal|fad)\s+fa-/,"");return x.faIcon===E||x.faIcon===t}return x.value===t||x.faIcon===t}),b=n.filter(x=>x.label.toLowerCase().includes(g.toLowerCase()));v.useEffect(()=>{const x=E=>{p.current&&!p.current.contains(E.target)&&(f(!1),m(""))};if(u)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[u]);const _=x=>{const E=`fas fa-${x.faIcon}`;e?.(E),f(!1),m("")};return h.jsxs(I,{ref:p,className:`relative ${i}`,id:c,...d,children:[h.jsxs(oe,{type:"button",onClick:()=>!a&&f(!u),disabled:a,className:`
|
||
w-full flex items-center justify-between px-3 py-2
|
||
bg-white dark:bg-gray-800
|
||
border border-gray-300 dark:border-gray-600 rounded-lg
|
||
text-left text-sm
|
||
${a?"opacity-50 cursor-not-allowed":"hover:border-gray-400 dark:hover:border-gray-500"}
|
||
focus:outline-none focus:ring-2 focus:ring-blue-500
|
||
`,children:[h.jsx(I,{className:"flex items-center gap-2",children:y?h.jsxs(h.Fragment,{children:[h.jsx(re,{name:y.faIcon,className:"w-4 h-4 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"text-gray-900 dark:text-white",children:y.label})]}):h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:r})}),h.jsx(re,{name:"chevron-down",className:`w-4 h-4 text-gray-400 dark:text-gray-500 transition-transform ${u?"rotate-180":""}`})]}),l&&h.jsx("input",{type:"hidden",name:l,value:t||""}),u&&h.jsxs(I,{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-72 overflow-hidden",children:[h.jsx(I,{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:h.jsx(wt,{type:"text",value:g,onChange:x=>m(x.target.value),placeholder:s,className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white",autoFocus:!0})}),h.jsx(I,{className:"max-h-56 overflow-y-auto",children:b.length>0?b.map(x=>h.jsxs(oe,{type:"button",onClick:()=>_(x),className:`
|
||
w-full flex items-center gap-3 px-3 py-2 text-left text-sm
|
||
${y?.faIcon===x.faIcon?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}
|
||
`,children:[h.jsx(re,{name:x.faIcon,className:"w-4 h-4"}),h.jsx(Q,{children:x.label}),y?.faIcon===x.faIcon&&h.jsx(re,{name:"check",className:"w-4 h-4 ml-auto text-blue-600"})]},x.value)):h.jsx(I,{className:"px-3 py-4 text-sm text-gray-500 dark:text-gray-400 text-center",children:o})})]})]})},sc=({defaultOpen:t=!1,isOpen:e,onToggle:n,className:r="",style:s,children:o,disabled:i=!1,id:a,editorAttrs:l})=>{const[c,d]=v.useState(t),u=e!==void 0,f=u?e:c,g=v.useRef(null),[m,p]=v.useState(t?void 0:0),y=()=>{if(i)return;const _=!f;u||d(_),n?.(_)};v.useEffect(()=>{if(g.current)if(f){p(g.current.scrollHeight);const _=setTimeout(()=>{p(void 0)},300);return()=>clearTimeout(_)}else p(g.current.scrollHeight),requestAnimationFrame(()=>{p(0)})},[f]);const b={};if(v.Children.forEach(o,_=>{if(v.isValidElement(_)){const x=_.props?.slot;x==="trigger"?b.trigger=_:x==="content"&&(b.content=_)}}),!b.trigger&&!b.content){const _=v.Children.toArray(o);_.length>=2?(b.trigger=_[0],b.content=_.slice(1)):_.length===1&&(b.content=_[0])}return h.jsxs(I,{className:`border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden ${r}`,style:s,id:a,...l,children:[h.jsxs(oe,{type:"button",onClick:y,disabled:i,className:`w-full flex items-center justify-between p-3 text-left bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${i?"opacity-50 cursor-not-allowed":""} ${f?"border-b border-gray-200 dark:border-gray-700":""}`,"aria-expanded":f,children:[h.jsx(I,{className:"flex-1",children:b.trigger}),!b.trigger&&h.jsx("svg",{className:`w-5 h-5 text-gray-500 dark:text-gray-400 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h.jsx(I,{ref:g,className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:m!==void 0?`${m}px`:"auto"},children:h.jsx(I,{className:"bg-white dark:bg-gray-800",children:b.content})})]})},no=window.G7Core,eg=no?.useControllableState,tg=(t,e)=>window.G7Core?.t?.(t,e)??t,VS={"":"common.scope_type_all_desc",self:"common.scope_type_self_desc",role:"common.scope_type_role_desc"},zS=({options:t,value:e,onChange:n,disabled:r=!1})=>{const[s,o]=v.useState(!1),[i,a]=v.useState({}),l=v.useRef(null),c=t.find(u=>u.value===e)??t[0];v.useEffect(()=>{if(!s)return;const u=g=>{l.current&&!l.current.contains(g.target)&&o(!1)},f=()=>{if(!l.current)return;const g=l.current.getBoundingClientRect();a({position:"fixed",top:g.bottom+4,right:window.innerWidth-g.right,zIndex:9999})};return document.addEventListener("mousedown",u),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[s]);const d=v.useCallback(()=>{if(r||!l.current)return;const u=l.current.getBoundingClientRect();a({position:"fixed",top:u.bottom+4,right:window.innerWidth-u.right,zIndex:9999}),o(f=>!f)},[r]);return h.jsxs(I,{ref:l,className:"relative flex-shrink-0",children:[h.jsxs(I,{role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),u.preventDefault(),d()},onMouseDown:u=>u.stopPropagation(),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.stopPropagation(),u.preventDefault(),d()),u.key==="Escape"&&o(!1)},className:`flex items-center gap-1 text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 cursor-pointer select-none ${r?"opacity-50 cursor-not-allowed":"hover:border-blue-400 dark:hover:border-blue-500"}`,children:[h.jsx(Q,{children:c?.label??""}),h.jsx(re,{name:de.ChevronDown,className:"w-3 h-3 text-gray-400 dark:text-gray-500"})]}),s&&h.jsx(I,{style:i,className:"w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1",children:t.map(u=>{const f=u.value??"",g=VS[f],m=g?tg(g):"",p=u.value===e;return h.jsxs(I,{role:"option","aria-selected":p,onClick:y=>{y.stopPropagation(),y.preventDefault(),n(u.value),o(!1)},onMouseDown:y=>y.stopPropagation(),className:`px-3 py-2 cursor-pointer transition-colors ${p?"bg-blue-50 dark:bg-blue-900/30":"hover:bg-gray-50 dark:hover:bg-gray-700/50"}`,children:[h.jsxs(I,{className:"flex items-center justify-between",children:[h.jsx(Q,{className:`text-xs font-medium ${p?"text-blue-700 dark:text-blue-300":"text-gray-900 dark:text-white"}`,children:u.label}),p&&h.jsx(re,{name:de.Check,className:"w-3.5 h-3.5 text-blue-600 dark:text-blue-400"})]}),m&&h.jsx(Q,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:m})]},f||"__null__")})})]})},HS=(t,e)=>{if(t.length!==e.length)return!1;const n=[...t].sort((s,o)=>s.id-o.id),r=[...e].sort((s,o)=>s.id-o.id);return n.every((s,o)=>s.id===r[o].id&&s.scope_type===r[o].scope_type)},US=({data:t=[],value:e=[],onChange:n,scopeOptions:r=[],className:s="",disabled:o=!1,desktopColumns:i=2,installedModules:a=[],installedPlugins:l=[],id:c,editorAttrs:d})=>{const u=v.useCallback(M=>{if(n){const T=no?.createChangeEvent?no.createChangeEvent({value:M}):{target:{value:M}};n(T)}},[n]),[f,g]=eg?eg(e,[],u,{isEqual:HS}):(()=>{const[M,T]=v.useState(e),L=v.useRef(n);L.current=n;const P=v.useRef(!1);v.useEffect(()=>{if(P.current){P.current=!1;return}T(e)},[e]);const F=v.useCallback(D=>{P.current=!0,T(A=>{const O=typeof D=="function"?D(A):D;if(L.current){const V=no?.createChangeEvent?no.createChangeEvent({value:O}):{target:{value:O}};L.current(V)}return O})},[]);return[M,F]})(),m=v.useMemo(()=>new Set(f.map(M=>M.id)),[f]),p=v.useCallback(M=>M.is_assignable?[M.id]:M.children.flatMap(T=>p(T)),[]),y=v.useCallback(M=>{const T=p(M);return T.length>0&&T.every(L=>m.has(L))},[m,p]),b=v.useCallback(M=>{const T=p(M),L=T.filter(P=>m.has(P)).length;return L>0&&L<T.length},[m,p]),_=v.useCallback(M=>p(M).filter(L=>m.has(L)).length,[m,p]),x=v.useCallback((M,T)=>{o||g(L=>T?[...L,{id:M,scope_type:null}]:L.filter(P=>P.id!==M))},[o,g]),E=v.useCallback((M,T)=>{if(o)return;const L=p(M),P=new Set(L);g(F=>{if(T){const D=new Set(F.map(O=>O.id)),A=L.filter(O=>!D.has(O)).map(O=>({id:O,scope_type:null}));return[...F,...A]}else return F.filter(D=>!P.has(D.id))})},[o,p,g]),S=v.useCallback((M,T)=>{o||g(L=>L.map(P=>P.id===M?{...P,scope_type:T}:P))},[o,g]),w=M=>{const T=m.has(M.id),L=!!M.resource_route_key,P=T&&L&&r.length>0,F=f.find(D=>D.id===M.id)?.scope_type??null;return h.jsxs(on,{className:`flex items-start gap-3 p-3 rounded-lg border cursor-pointer transition-colors ${T?"border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700/50"} ${o?"opacity-50 cursor-not-allowed":""}`,children:[h.jsx(wt,{type:"checkbox",checked:T,onChange:D=>{D.stopPropagation(),x(M.id,D.target.checked)},disabled:o,className:"w-4 h-4 mt-0.5 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsxs(I,{className:"flex items-center justify-between gap-2",children:[h.jsx(Q,{className:"text-sm font-medium text-gray-900 dark:text-white",children:M.name}),P&&h.jsx(zS,{options:r,value:F,onChange:D=>S(M.id,D),disabled:o})]}),M.description&&h.jsx(Q,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:M.description})]})]},M.id)},N=(M,T)=>{const L=y(M),P=b(M),F=_(M),D=M.children.filter(V=>V.is_assignable);if(D.length===0&&M.children.length===0)return null;const A=M.children.some(V=>!V.is_assignable),O=i===1?"grid-cols-1":i===3?"grid-cols-1 md:grid-cols-3":"grid-cols-1 md:grid-cols-2";return h.jsxs(sc,{defaultOpen:!1,className:"border-0 rounded-none",children:[h.jsxs(I,{slot:"trigger",className:"flex items-center gap-3 w-full py-2",children:[h.jsx("input",{type:"checkbox",checked:L,ref:V=>{V&&(V.indeterminate=P)},onChange:V=>{V.stopPropagation(),E(M,V.target.checked)},onClick:V=>V.stopPropagation(),onMouseDown:V=>V.stopPropagation(),disabled:o,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(re,{name:de.Folder,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),h.jsx(Q,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:M.name}),h.jsxs(Q,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ml-1",children:[F,"/",M.leaf_count]}),h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-400 dark:text-gray-500 ml-auto"})]}),h.jsx(I,{slot:"content",className:`pl-8 grid ${O} gap-2 py-2`,children:A?M.children.map(V=>V.is_assignable?w(V):N(V)):D.map(V=>w(V))})]},M.id)},C=M=>{if(M.extension_type==="core")return"core";if(M.extension_type==="module")return"module";if(M.extension_type==="plugin")return"plugin";const T=M.extension_identifier??M.module??"";return T==="core"||!T?"core":l?.some(P=>P.identifier===T)?"plugin":"module"},k=M=>{const T=y(M),L=b(M),P=_(M),F=C(M);return h.jsxs(sc,{defaultOpen:!1,className:"mb-2",children:[h.jsxs(I,{slot:"trigger",className:"flex items-center gap-3 w-full py-2",children:[h.jsx("input",{type:"checkbox",checked:T,ref:D=>{D&&(D.indeterminate=L)},onChange:D=>{D.stopPropagation(),E(M,D.target.checked)},onClick:D=>D.stopPropagation(),onMouseDown:D=>D.stopPropagation(),disabled:o,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(re,{name:F==="core"?de.Cog:de.Cube,className:"w-5 h-5 text-gray-400 dark:text-gray-500"}),h.jsx(Q,{className:"font-medium text-gray-900 dark:text-white",children:M.name}),F!=="core"&&h.jsx(sh,{type:F,identifier:M.extension_identifier??M.module,installedModules:a,installedPlugins:l}),h.jsxs(Q,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ml-2",children:[P,"/",M.leaf_count]}),h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-400 dark:text-gray-500 ml-auto"})]}),h.jsx(I,{slot:"content",className:"pl-8 space-y-2 pb-2",children:M.children.map(D=>D.is_assignable?w(D):N(D))})]},M.id)};return t.length===0?h.jsx(I,{className:`text-sm text-gray-400 dark:text-gray-500 py-4 text-center ${s}`,id:c,...d,children:tg("common.no_data")??"데이터가 없습니다."}):h.jsx(I,{className:`space-y-2 ${s}`,id:c,...d,children:t.map(M=>k(M))})};function BS({text:t,keyword:e}){if(!e||!t)return h.jsx(h.Fragment,{children:t});const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=t.split(new RegExp(`(${n})`,"gi"));return h.jsx(h.Fragment,{children:r.map((s,o)=>s.toLowerCase()===e.toLowerCase()?h.jsx(Q,{className:"bg-yellow-200 dark:bg-yellow-700 rounded px-0.5",children:s},o):s)})}const jS=({data:t=[],expandedIds:e=[],selectedIds:n=[],searchKeyword:r="",showProductCount:s=!1,selectable:o=!1,className:i="",onToggle:a,onSelectionChange:l,id:c,editorAttrs:d})=>{const u=v.useCallback(y=>{if(!a)return;const b=e.includes(y)?e.filter(_=>_!==y):[...e,y];a(b)},[e,a]),f=v.useCallback((y,b)=>{if(!l)return;const _=b?[...n,y]:n.filter(x=>x!==y);l(_)},[n,l]),g=v.useMemo(()=>{if(!r)return null;const y=new Set,b=_=>{for(const x of _)(x.localized_name||x.name).toLowerCase().includes(r.toLowerCase())&&y.add(x.id),x.children&&b(x.children)};return b(t),y},[t,r]),m=v.useCallback(y=>!g||g.has(y.id)?!0:(y.children??[]).some(b=>m(b)),[g]),p=(y,b=0)=>{const _=(y.children??[]).length>0,x=e.includes(y.id),E=n.includes(y.id),S=y.localized_name||y.name;return r&&!m(y)?null:h.jsxs(I,{"data-testid":`category-node-${y.id}`,children:[h.jsxs(I,{className:`flex items-center gap-2 py-1.5 px-2 rounded cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors ${b>0?"ml-"+Math.min(b*5,20):""}`,style:b>0?{marginLeft:`${b*20}px`}:void 0,children:[_?h.jsx(I,{className:"flex-shrink-0 w-5 h-5 flex items-center justify-center text-gray-400 dark:text-gray-500",onClick:()=>u(y.id),"data-testid":`toggle-${y.id}`,children:h.jsx(re,{name:x?de.CaretDown:de.CaretRight,className:"text-xs"})}):h.jsx(I,{className:"flex-shrink-0 w-5 h-5"}),o&&h.jsx(Cn,{checked:E,onChange:w=>{w.stopPropagation(),f(y.id,w.target.checked)},className:"flex-shrink-0","data-testid":`checkbox-${y.id}`}),h.jsx(re,{name:de.Folder,className:`flex-shrink-0 text-sm ${_?"text-yellow-500 dark:text-yellow-400":"text-gray-400 dark:text-gray-500"}`}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300 select-none",onClick:()=>_&&u(y.id),children:h.jsx(BS,{text:S,keyword:r})}),s&&y.products_count!==void 0&&h.jsx(Q,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400 ml-1",children:y.products_count})]}),_&&x&&h.jsx(I,{"data-testid":`children-${y.id}`,children:(y.children??[]).map(w=>p(w,b+1))})]},y.id)};return t.length===0?h.jsx(I,{className:`text-sm text-gray-400 dark:text-gray-500 py-4 text-center ${i}`,id:c,...d,children:"데이터가 없습니다."}):h.jsx(I,{className:`border border-gray-200 dark:border-gray-700 rounded-lg p-2 max-h-80 overflow-y-auto ${i}`,id:c,...d,children:t.map(y=>p(y,0))})},ng="carousel",ro="controller",WS="navigation",GS="no-scroll",oc="portal",YS="root",rg="toolbar",XS="counter",so="fullscreen",sg="slideshow",oo="thumbnails",og="zoom",rs="loading",ic="playing",io="error",ao="complete",KS="placeholder",lo=t=>`active-slide-${t}`,qS=lo(rs),ZS=lo(ic),QS=lo(io),JS=lo(ao),ig="fullsize",ss="flex_center",RS="no_scroll",ag="no_scroll_padding",ac="slide",lg="slide_wrapper",e_="slide_wrapper_interactive",or="prev",ir="next",lc="swipe",os="close",cg="onPointerDown",dg="onPointerMove",ug="onPointerUp",fg="onPointerLeave",hg="onPointerCancel",cc="onKeyDown",t_="onKeyUp",dc="onWheel",n_="Escape",r_="ArrowLeft",s_="ArrowRight",o_="button",Pi="icon",gg="contain",pg="cover",mg="Unknown action type",bg="yarl__";function Ht(...t){return[...t].filter(Boolean).join(" ")}function Ne(t){return`${bg}${t}`}function dt(t){return`--${bg}${t}`}function mr(t,e){return`${t}${e?`_${e}`:""}`}function br(t){return e=>mr(t,e)}function yr(t,e){var n;return(n=t?.[e])!==null&&n!==void 0?n:e}function yg(t,e,n){return yr(t,"{index} of {total}").replace(/\{index}/g,`${gc(n,e.length)+1}`).replace(/\{total}/g,`${e.length}`)}function is(...t){return()=>{t.forEach(e=>{e()})}}function hn(t,e,n){return()=>{const r=$.useContext(n);if(!r)throw new Error(`${t} must be used within a ${e}.Provider`);return r}}function uc(){return typeof window<"u"}function fc(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function vr(t){return t.type===void 0||t.type==="image"}function hc(t,e){return t.imageFit===pg||t.imageFit!==gg&&e===pg}function $i(t){return typeof t=="string"?Number.parseInt(t,10):t}function Fi(t){if(typeof t=="number")return{pixel:t};if(typeof t=="string"){const e=$i(t);return t.endsWith("%")?{percent:e}:{pixel:e}}return{pixel:0}}function i_(t,e){const n=Fi(e),r=n.percent!==void 0?t.width/100*n.percent:n.pixel;return{width:Math.max(t.width-2*r,0),height:Math.max(t.height-2*r,0)}}function a_(){return(uc()?window?.devicePixelRatio:void 0)||1}function gc(t,e){return e>0?(t%e+e)%e:0}function pc(t){return t.length>0}function mc(t,e){return t[gc(e,t.length)]}function bc(t,e){return pc(t)?mc(t,e):void 0}function vg(t){return vr(t)?t.src:void 0}function Vi(t,e,n){if(!n)return t;const{buttons:r,...s}=t,o=r.findIndex(a=>a===e),i=$.isValidElement(n)?$.cloneElement(n,{key:e},null):n;if(o>=0){const a=[...r];return a.splice(o,1,i),{buttons:a,...s}}return{buttons:[i,...r],...s}}function xg(t,e,n=0){return Math.min(t.preload,Math.max(t.finite?e.length-1:Math.floor(e.length/2),n))}const l_=Number($.version.split(".")[0])>=19;function c_(t){return{inert:l_?t:t?"":void 0}}function d_(t){t.scrollTop}const yc={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[os]},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:gg,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 gn(t,e){return{name:t,component:e}}function Dt(t,e){return{module:t,children:e}}function wg(t,e,n){return t.module.name===e?n(t):t.children?[Dt(t.module,t.children.flatMap(r=>{var s;return(s=wg(r,e,n))!==null&&s!==void 0?s:[]}))]:[t]}function as(t,e,n){return t.flatMap(r=>{var s;return(s=wg(r,e,n))!==null&&s!==void 0?s:[]})}function u_(t,e=[],n=[]){let r=t;const s=g=>{const m=[...r];for(;m.length>0;){const p=m.pop();if(p?.module.name===g)return!0;p?.children&&m.push(...p.children)}return!1},o=(g,m)=>{if(g===""){r=[Dt(m,r)];return}r=as(r,g,p=>[Dt(m,[p])])},i=(g,m)=>{r=as(r,g,p=>[Dt(p.module,[Dt(m,p.children)])])},a=(g,m,p)=>{r=as(r,g,y=>{var b;return[Dt(y.module,[...p?[Dt(m)]:[],...(b=y.children)!==null&&b!==void 0?b:[],...p?[]:[Dt(m)]])]})},l=(g,m,p)=>{r=as(r,g,y=>[...p?[Dt(m)]:[],y,...p?[]:[Dt(m)]])},c=g=>{i(ro,g)},d=(g,m)=>{r=as(r,g,p=>[Dt(m,p.children)])},u=g=>{r=as(r,g,m=>m.children)},f=g=>{n.push(g)};return e.forEach(g=>{g({contains:s,addParent:o,append:i,addChild:a,addSibling:l,addModule:c,replace:d,remove:u,augment:f})}),{config:r,augmentation:g=>n.reduce((m,p)=>p(m),g)}}const kg=$.createContext(null),vc=hn("useA11yContext","A11yContext",kg);function f_({children:t}){const[e,n]=$.useState(!1),[r,s]=$.useState(!1),o=$.useMemo(()=>({focusWithin:e,trackFocusWithin:(a,l)=>{const c=d=>u=>{var f;u.currentTarget.contains(u.relatedTarget)||n(d),(f=d?a:l)===null||f===void 0||f(u)};return{onFocus:c(!0),onBlur:c(!1)}},autoPlaying:r,setAutoPlaying:s}),[e,r]);return $.createElement(kg.Provider,{value:o},t)}const Cg=$.createContext(null),ls=hn("useDocument","DocumentContext",Cg);function h_({nodeRef:t,children:e}){const n=$.useMemo(()=>{const r=o=>{var i;return((i=o||t.current)===null||i===void 0?void 0:i.ownerDocument)||document};return{getOwnerDocument:r,getOwnerWindow:o=>{var i;return((i=r(o))===null||i===void 0?void 0:i.defaultView)||window}}},[t]);return $.createElement(Cg.Provider,{value:n},e)}const Sg=$.createContext(null),cs=hn("useEvents","EventsContext",Sg);function g_({children:t}){const[e]=$.useState({});$.useEffect(()=>()=>{Object.keys(e).forEach(r=>delete e[r])},[e]);const n=$.useMemo(()=>{const r=(i,a)=>{var l;(l=e[i])===null||l===void 0||l.splice(0,e[i].length,...e[i].filter(c=>c!==a))};return{publish:(...[i,a])=>{var l;(l=e[i])===null||l===void 0||l.forEach(c=>c(a))},subscribe:(i,a)=>(e[i]||(e[i]=[]),e[i].push(a),()=>r(i,a)),unsubscribe:r}},[e]);return $.createElement(Sg.Provider,{value:n},t)}const _g=$.createContext(null),It=hn("useLightboxProps","LightboxPropsContext",_g);function Eg({children:t,...e}){return $.createElement(_g.Provider,{value:e},t)}const Mg=$.createContext(null),pn=hn("useLightboxState","LightboxStateContext",Mg),Ng=$.createContext(null),p_=hn("useLightboxDispatch","LightboxDispatchContext",Ng);function m_(t,e){switch(e.type){case"swipe":{const{slides:n}=t,r=e?.increment||0,s=t.globalIndex+r,o=gc(s,n.length),i=bc(n,o),a=r||e.duration!==void 0?{increment:r,duration:e.duration,easing:e.easing}:void 0;return{slides:n,currentIndex:o,globalIndex:s,currentSlide:i,animation:a}}case"update":return e.slides!==t.slides||e.index!==t.currentIndex?{slides:e.slides,currentIndex:e.index,globalIndex:e.index,currentSlide:bc(e.slides,e.index)}:t;default:throw new Error(mg)}}function b_({slides:t,index:e,children:n}){const[r,s]=$.useReducer(m_,{slides:t,currentIndex:e,globalIndex:e,currentSlide:bc(t,e)});$.useEffect(()=>{s({type:"update",slides:t,index:e})},[t,e]);const o=$.useMemo(()=>({...r,state:r,dispatch:s}),[r,s]);return $.createElement(Ng.Provider,{value:s},$.createElement(Mg.Provider,{value:o},n))}const Og=$.createContext(null),co=hn("useTimeouts","TimeoutsContext",Og);function y_({children:t}){const[e]=$.useState([]);$.useEffect(()=>()=>{e.forEach(r=>window.clearTimeout(r)),e.splice(0,e.length)},[e]);const n=$.useMemo(()=>{const r=i=>{e.splice(0,e.length,...e.filter(a=>a!==i))};return{setTimeout:(i,a)=>{const l=window.setTimeout(()=>{r(l),i()},a);return e.push(l),l},clearTimeout:i=>{i!==void 0&&(r(i),window.clearTimeout(i))}}},[e]);return $.createElement(Og.Provider,{value:n},t)}const ds=$.forwardRef(function({label:e,className:n,icon:r,renderIcon:s,onClick:o,style:i,...a},l){const{styles:c,labels:d}=It(),u=yr(d,e);return $.createElement("button",{ref:l,type:"button",title:u,"aria-label":u,className:Ht(Ne(o_),n),onClick:o,style:{...i,...c.button},...a},s?s():$.createElement(r,{className:Ne(Pi),style:c.icon}))});function Tg(t,e){const n=r=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...r},e);return n.displayName=t,n}function en(t,e){return Tg(t,$.createElement("g",{fill:"currentColor"},$.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),e))}function v_(t,e){return Tg(t,$.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"}),e)))}const x_=en("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"})),w_=en("Previous",$.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),k_=en("Next",$.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),C_=en("Loading",$.createElement($.Fragment,null,Array.from({length:8}).map((t,e,n)=>$.createElement("line",{key:e,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/n.length*(e+1),transform:`rotate(${360/n.length*e}, 12, 12)`})))),S_=en("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"})),Mn=uc()?$.useLayoutEffect:$.useEffect;function xc(){const[t,e]=$.useState(!1);return $.useEffect(()=>{var n,r;const s=(n=window.matchMedia)===null||n===void 0?void 0:n.call(window,"(prefers-reduced-motion: reduce)");e(s?.matches);const o=i=>e(i.matches);return(r=s?.addEventListener)===null||r===void 0||r.call(s,"change",o),()=>{var i;return(i=s?.removeEventListener)===null||i===void 0?void 0:i.call(s,"change",o)}},[]),t}function __(t){let e=0,n=0,r=0;const o=window.getComputedStyle(t).transform.match(/matrix.*\((.+)\)/);if(o){const i=o[1].split(",").map($i);i.length===6?(e=i[4],n=i[5]):i.length===16&&(e=i[12],n=i[13],r=i[14])}return{x:e,y:n,z:r}}function wc(t,e){const n=$.useRef(void 0),r=$.useRef(void 0),s=xc();return Mn(()=>{var o,i,a;if(t.current&&n.current!==void 0&&!s){const{keyframes:l,duration:c,easing:d,onfinish:u}=e(n.current,t.current.getBoundingClientRect(),__(t.current))||{};if(l&&c){(o=r.current)===null||o===void 0||o.cancel(),r.current=void 0;try{r.current=(a=(i=t.current).animate)===null||a===void 0?void 0:a.call(i,l,{duration:c,easing:d})}catch(f){console.error(f)}r.current&&(r.current.onfinish=()=>{r.current=void 0,u?.()})}}n.current=void 0}),{prepareAnimation:o=>{n.current=o},isAnimationPlaying:()=>{var o;return((o=r.current)===null||o===void 0?void 0:o.playState)==="running"}}}function Ag(){const t=$.useRef(null),e=$.useRef(void 0),[n,r]=$.useState();return{setContainerRef:$.useCallback(o=>{t.current=o,e.current&&(e.current.disconnect(),e.current=void 0);const i=()=>{if(o){const a=window.getComputedStyle(o),l=c=>parseFloat(c)||0;r({width:Math.round(o.clientWidth-l(a.paddingLeft)-l(a.paddingRight)),height:Math.round(o.clientHeight-l(a.paddingTop)-l(a.paddingBottom))})}else r(void 0)};i(),o&&typeof ResizeObserver<"u"&&(e.current=new ResizeObserver(i),e.current.observe(o))},[]),containerRef:t,containerRect:n}}function zi(){const t=$.useRef(void 0),{setTimeout:e,clearTimeout:n}=co();return $.useCallback((r,s)=>{n(t.current),t.current=e(r,s>0?s:0)},[e,n])}function We(t){const e=$.useRef(t);return Mn(()=>{e.current=t}),$.useCallback((...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function Dg(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function kc(t,e){return $.useMemo(()=>t==null&&e==null?null:n=>{Dg(t,n),Dg(e,n)},[t,e])}function Ig(t,e=!1){const n=$.useRef(!1);Mn(()=>{e&&n.current&&(n.current=!1,t())},[e,t]);const r=$.useCallback(()=>{n.current=!0},[]),s=$.useCallback(()=>{n.current=!1},[]);return{onFocus:r,onBlur:s}}function Hi(){const[t,e]=$.useState(!1);return Mn(()=>{e(window.getComputedStyle(window.document.documentElement).direction==="rtl")},[]),t}function Lg(){const[t]=$.useState({}),e=$.useCallback((s,o)=>{var i;(i=t[s])===null||i===void 0||i.forEach(a=>{o.isPropagationStopped()||a(o)})},[t]),n=$.useMemo(()=>({onPointerDown:s=>e(cg,s),onPointerMove:s=>e(dg,s),onPointerUp:s=>e(ug,s),onPointerLeave:s=>e(fg,s),onPointerCancel:s=>e(hg,s),onKeyDown:s=>e(cc,s),onKeyUp:s=>e(t_,s),onWheel:s=>e(dc,s)}),[e]),r=$.useCallback((s,o)=>(t[s]||(t[s]=[]),t[s].unshift(o),()=>{const i=t[s];i&&i.splice(0,i.length,...i.filter(a=>a!==o))}),[t]);return{registerSensors:n,subscribeSensors:r}}function Pg(t,e){const n=$.useRef(0),r=zi(),s=We((...o)=>{n.current=Date.now(),t(o)});return $.useCallback((...o)=>{r(()=>{s(o)},e-(Date.now()-n.current))},[e,s,r])}const Cc=br("slide"),Sc=br("slide_image");function xr({slide:t,offset:e,render:n,rect:r,imageFit:s,imageProps:o,onClick:i,onLoad:a,onError:l,style:c}){var d,u,f,g,m,p,y,b;const[_,x]=$.useState(rs),{publish:E}=cs(),{setTimeout:S}=co(),w=$.useRef(null);$.useEffect(()=>{e===0&&E(lo(_))},[e,_,E]);const N=We(U=>{("decode"in U?U.decode():Promise.resolve()).catch(()=>{}).then(()=>{U.parentNode&&(x(ao),S(()=>{a?.(U)},0))})}),C=$.useCallback(U=>{w.current=U,U?.complete&&N(U)},[N]),k=$.useCallback(U=>{N(U.currentTarget)},[N]),M=We(()=>{x(io),l?.()}),T=hc(t,s),L=(U,B)=>Number.isFinite(U)?U:B,P=L(Math.max(...((u=(d=t.srcSet)===null||d===void 0?void 0:d.map(U=>U.width))!==null&&u!==void 0?u:[]).concat(t.width?[t.width]:[]).filter(Boolean)),((f=w.current)===null||f===void 0?void 0:f.naturalWidth)||0),F=L(Math.max(...((m=(g=t.srcSet)===null||g===void 0?void 0:g.map(U=>U.height))!==null&&m!==void 0?m:[]).concat(t.height?[t.height]:[]).filter(Boolean)),((p=w.current)===null||p===void 0?void 0:p.naturalHeight)||0),D=P&&F?{maxWidth:`min(${P}px, 100%)`,maxHeight:`min(${F}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},A=(y=t.srcSet)===null||y===void 0?void 0:y.sort((U,B)=>U.width-B.width).map(U=>`${U.src} ${U.width}w`).join(", "),O=()=>r&&!T&&t.width&&t.height?r.height/t.height*t.width:Number.MAX_VALUE,V=A&&r&&uc()?`${Math.round(Math.min(O(),r.width))}px`:void 0,{style:H,className:W,...j}=o||{};return $.createElement($.Fragment,null,$.createElement("img",{ref:C,onLoad:k,onError:M,onClick:i,draggable:!1,className:Ht(Ne(Sc()),T&&Ne(Sc("cover")),_!==ao&&Ne(Sc("loading")),W),style:{...D,...c,...H},...j,alt:(b=t.alt)!==null&&b!==void 0?b:"",sizes:V,srcSet:A,src:t.src}),_!==ao&&$.createElement("div",{className:Ne(Cc(KS))},_===rs&&(n?.iconLoading?n.iconLoading():$.createElement(C_,{className:Ht(Ne(Pi),Ne(Cc(rs)))})),_===io&&(n?.iconError?n.iconError():$.createElement(S_,{className:Ht(Ne(Pi),Ne(Cc(io)))}))))}const E_=$.forwardRef(function({className:e,children:n,onFocus:r,onBlur:s,...o},i){const a=$.useRef(null),{trackFocusWithin:l}=vc();return $.createElement(h_,{nodeRef:a},$.createElement("div",{ref:kc(i,a),className:Ht(Ne("root"),e),...l(r,s),...o},n))});var Ut;(function(t){t[t.NONE=0]="NONE",t[t.SWIPE=1]="SWIPE",t[t.PULL=2]="PULL",t[t.ANIMATION=3]="ANIMATION"})(Ut||(Ut={}));function $g(t,e,n,r,s){$.useEffect(()=>s?()=>{}:is(t(cg,e),t(dg,n),t(ug,r),t(fg,r),t(hg,r)),[t,e,n,r,s])}var Nn;(function(t){t[t.NONE=0]="NONE",t[t.SWIPE=1]="SWIPE",t[t.PULL=2]="PULL"})(Nn||(Nn={}));const _c=30;function M_({disableSwipeNavigation:t,closeOnBackdropClick:e},n,r,s,o,i,a,l,c,d,u,f,g,m,p,y){const b=$.useRef(0),_=$.useRef([]),x=$.useRef(void 0),E=$.useRef(0),S=$.useRef(Nn.NONE),w=$.useCallback(P=>{x.current===P.pointerId&&(x.current=void 0,S.current=Nn.NONE);const F=_.current;F.splice(0,F.length,...F.filter(D=>D.pointerId!==P.pointerId))},[]),N=$.useCallback(P=>{w(P),P.persist(),_.current.push(P)},[w]),C=$.useCallback(P=>_.current.find(({pointerId:F})=>P.pointerId===F),[]),k=We(P=>{N(P)}),M=(P,F)=>u&&P>F||d&&P<-F,T=We(P=>{const F=C(P);if(F)if(x.current===P.pointerId){const D=Date.now()-E.current,A=b.current;S.current===Nn.SWIPE?Math.abs(A)>.3*s||Math.abs(A)>5&&D<o?l(A,D):c(A):S.current===Nn.PULL&&(M(A,2*_c)?m(A,D):p(A)),b.current=0,S.current=Nn.NONE}else{const{target:D}=P;e&&D instanceof HTMLElement&&D===F.target&&(D.classList.contains(Ne(ac))||D.classList.contains(Ne(lg)))&&y()}w(P)}),L=We(P=>{const F=C(P);if(F){const D=x.current===P.pointerId;if(P.buttons===0){D&&b.current!==0?T(P):w(F);return}const A=P.clientX-F.clientX,O=P.clientY-F.clientY;if(x.current===void 0){const V=H=>{N(P),x.current=P.pointerId,E.current=Date.now(),S.current=H};Math.abs(A)>Math.abs(O)&&Math.abs(A)>_c&&r(A)?t||(V(Nn.SWIPE),i()):Math.abs(O)>Math.abs(A)&&M(O,_c)&&(V(Nn.PULL),f())}else D&&(S.current===Nn.SWIPE?(b.current=A,a(A)):S.current===Nn.PULL&&(b.current=O,g(O)))}});$g(n,k,L,T)}function N_({preventDefaultWheelX:t,preventDefaultWheelY:e}){const n=$.useRef(null),r=We(s=>{const o=Math.abs(s.deltaX)>Math.abs(s.deltaY);(o&&t||!o&&e||s.ctrlKey)&&s.preventDefault()});return $.useCallback(s=>{var o;s?s.addEventListener("wheel",r,{passive:!1}):(o=n.current)===null||o===void 0||o.removeEventListener("wheel",r),n.current=s},[r])}function O_(t,e,n,r,s,o,i,a,l){const c=$.useRef(0),d=$.useRef(0),u=$.useRef(void 0),f=$.useRef(void 0),g=$.useRef(0),m=$.useRef(void 0),p=$.useRef(0),{setTimeout:y,clearTimeout:b}=co(),_=$.useCallback(()=>{u.current&&(b(u.current),u.current=void 0)},[b]),x=$.useCallback(()=>{f.current&&(b(f.current),f.current=void 0)},[b]),E=We(()=>{t!==Ut.SWIPE&&(c.current=0,p.current=0,_(),x())});$.useEffect(E,[t,E]);const S=We(N=>{f.current=void 0,c.current===N&&l(c.current)}),w=We(N=>{if(N.ctrlKey||Math.abs(N.deltaY)>Math.abs(N.deltaX))return;const C=k=>{g.current=k,b(m.current),m.current=k>0?y(()=>{g.current=0,m.current=void 0},300):void 0};if(t===Ut.NONE){if(Math.abs(N.deltaX)<=1.2*Math.abs(g.current)){C(N.deltaX);return}if(!n(-N.deltaX))return;if(d.current+=N.deltaX,_(),Math.abs(d.current)>30)d.current=0,C(0),p.current=Date.now(),o();else{const k=d.current;u.current=y(()=>{u.current=void 0,k===d.current&&(d.current=0)},s)}}else if(t===Ut.SWIPE){let k=c.current-N.deltaX;if(k=Math.min(Math.abs(k),r)*Math.sign(k),c.current=k,i(k),x(),Math.abs(k)>.2*r){C(N.deltaX),a(k,Date.now()-p.current);return}f.current=y(()=>S(k),2*s)}else C(N.deltaX)});$.useEffect(()=>e(dc,w),[e,w])}const Fg=br("container"),Vg=$.createContext(null),On=hn("useController","ControllerContext",Vg);function T_({children:t,...e}){var n;const{carousel:r,animation:s,controller:o,on:i,styles:a,render:l}=e,{closeOnPullUp:c,closeOnPullDown:d,preventDefaultWheelX:u,preventDefaultWheelY:f}=o,[g,m]=$.useState(),p=pn(),y=p_(),[b,_]=$.useState(Ut.NONE),x=$.useRef(0),E=$.useRef(0),S=$.useRef(1),{registerSensors:w,subscribeSensors:N}=Lg(),{subscribe:C,publish:k}=cs(),M=zi(),T=zi(),L=zi(),{containerRef:P,setContainerRef:F,containerRect:D}=Ag(),A=kc(N_({preventDefaultWheelX:u,preventDefaultWheelY:f}),F),O=$.useRef(null),V=kc(O,void 0),{getOwnerDocument:H}=ls(),W=Hi(),j=se=>(W?-1:1)*(typeof se=="number"?se:1),U=We(()=>{var se;return(se=P.current)===null||se===void 0?void 0:se.focus()}),B=We(()=>e),G=We(()=>p),z=$.useCallback(se=>k(or,se),[k]),X=$.useCallback(se=>k(ir,se),[k]),Y=$.useCallback(()=>k(os),[k]),Z=se=>!(r.finite&&(j(se)>0&&p.currentIndex===0||j(se)<0&&p.currentIndex===p.slides.length-1)),ee=se=>{var Oe;x.current=se,(Oe=P.current)===null||Oe===void 0||Oe.style.setProperty(dt("swipe_offset"),`${Math.round(se)}px`)},te=se=>{var Oe,Le;E.current=se,S.current=(()=>{const et=d&&se>0?se:c&&se<0?-se:0;return Math.min(Math.max(fc(1-et/60*(1-.5),2),.5),1)})(),(Oe=P.current)===null||Oe===void 0||Oe.style.setProperty(dt("pull_offset"),`${Math.round(se)}px`),(Le=P.current)===null||Le===void 0||Le.style.setProperty(dt("pull_opacity"),`${S.current}`)},{prepareAnimation:ce}=wc(O,(se,Oe,Le)=>{if(O.current&&D)return{keyframes:[{transform:`translate(0, ${se.rect.y-Oe.y+Le.y}px)`,opacity:se.opacity},{transform:"translate(0, 0)",opacity:1}],duration:se.duration,easing:s.easing.fade}}),J=(se,Oe)=>{if(c||d){te(se);let Le=0;O.current&&(Le=s.fade*(Oe?2:1),ce({rect:O.current.getBoundingClientRect(),opacity:S.current,duration:Le})),L(()=>{te(0),_(Ut.NONE)},Le),_(Ut.ANIMATION),Oe||Y()}},{prepareAnimation:he,isAnimationPlaying:le}=wc(O,(se,Oe,Le)=>{var Ie;if(O.current&&D&&(!((Ie=p.animation)===null||Ie===void 0)&&Ie.duration)){const Ue=Fi(r.spacing),et=(Ue.percent?Ue.percent*D.width/100:Ue.pixel)||0;return{keyframes:[{transform:`translate(${j(p.globalIndex-se.index)*(D.width+et)+se.rect.x-Oe.x+Le.x}px, 0)`},{transform:"translate(0, 0)"}],duration:p.animation.duration,easing:p.animation.easing}}}),ae=We(se=>{var Oe,Le;const Ie=se.offset||0,Ue=Ie?s.swipe:(Oe=s.navigation)!==null&&Oe!==void 0?Oe:s.swipe,et=!Ie&&!le()?s.easing.navigation:s.easing.swipe;let{direction:bt}=se;const Ge=(Le=se.count)!==null&&Le!==void 0?Le:1;let ft=Ut.ANIMATION,Be=Ue*Ge;if(!bt){const fe=D?.width,xe=se.duration||0,ge=fe?Ue/fe*Math.abs(Ie):Ue;Ge!==0?(xe<ge?Be=Be/ge*Math.max(xe,ge/5):fe&&(Be=Ue/fe*(fe-Math.abs(Ie))),bt=j(Ie)>0?or:ir):Be=Ue/2}let ne=0;bt===or?Z(j(1))?ne=-Ge:(ft=Ut.NONE,Be=Ue):bt===ir&&(Z(j(-1))?ne=Ge:(ft=Ut.NONE,Be=Ue)),Be=Math.round(Be),T(()=>{ee(0),_(Ut.NONE)},Be),O.current&&he({rect:O.current.getBoundingClientRect(),index:p.globalIndex}),_(ft),k(lc,{type:"swipe",increment:ne,duration:Be,easing:et})});$.useEffect(()=>{var se,Oe;!((se=p.animation)===null||se===void 0)&&se.increment&&(!((Oe=p.animation)===null||Oe===void 0)&&Oe.duration)&&M(()=>y({type:"swipe",increment:0}),p.animation.duration)},[p.animation,y,M]);const Se=[N,Z,D?.width||0,s.swipe,()=>_(Ut.SWIPE),se=>ee(se),(se,Oe)=>ae({offset:se,duration:Oe,count:1}),se=>ae({offset:se,count:0})],ue=[()=>{d&&_(Ut.PULL)},se=>te(se),se=>J(se),se=>J(se,!0)];M_(o,...Se,c,d,...ue,Y),O_(b,...Se);const pe=We(()=>{o.focus&&H().querySelector(`.${Ne(oc)} .${Ne(Fg())}`)&&U()});$.useEffect(pe,[pe]);const we=We(()=>{var se;(se=i.view)===null||se===void 0||se.call(i,{index:p.currentIndex})});$.useEffect(we,[p.globalIndex,we]),$.useEffect(()=>is(C(or,se=>ae({direction:or,...se})),C(ir,se=>ae({direction:ir,...se})),C(lc,se=>y(se))),[C,ae,y]);const He=$.useMemo(()=>({prev:z,next:X,close:Y,focus:U,slideRect:D?i_(D,r.padding):{width:0,height:0},containerRect:D||{width:0,height:0},subscribeSensors:N,containerRef:P,setCarouselRef:V,toolbarWidth:g,setToolbarWidth:m}),[z,X,Y,U,N,D,P,V,g,m,r.padding]);return $.useImperativeHandle(o.ref,()=>({prev:z,next:X,close:Y,focus:U,getLightboxProps:B,getLightboxState:G}),[z,X,Y,U,B,G]),$.createElement("div",{ref:A,className:Ht(Ne(Fg()),Ne(ss)),style:{...b===Ut.SWIPE?{[dt("swipe_offset")]:`${Math.round(x.current)}px`}:null,...b===Ut.PULL?{[dt("pull_offset")]:`${Math.round(E.current)}px`,[dt("pull_opacity")]:`${S.current}`}:null,...o.touchAction!=="none"?{[dt("controller_touch_action")]:o.touchAction}:null,...a.container},tabIndex:-1,...w},D&&$.createElement(Vg.Provider,{value:He},t,(n=l.controls)===null||n===void 0?void 0:n.call(l)))}const A_=gn(ro,T_);function wr(t){return mr(ng,t)}function zg(t){return mr(ac,t)}function D_({slide:t,offset:e}){const n=$.useRef(null),{currentIndex:r,slides:s}=pn(),{slideRect:o,focus:i}=On(),{render:a,carousel:{imageFit:l,imageProps:c},on:{click:d},styles:{slide:u},labels:f}=It(),{getOwnerDocument:g}=ls(),m=e!==0;$.useEffect(()=>{var y;m&&(!((y=n.current)===null||y===void 0)&&y.contains(g().activeElement))&&i()},[m,i,g]);const p=()=>{var y,b,_,x;let E=(y=a.slide)===null||y===void 0?void 0:y.call(a,{slide:t,offset:e,rect:o});return!E&&vr(t)&&(E=$.createElement(xr,{slide:t,offset:e,render:a,rect:o,imageFit:l,imageProps:c,onClick:m?void 0:()=>d?.({index:r})})),E?$.createElement($.Fragment,null,(b=a.slideHeader)===null||b===void 0?void 0:b.call(a,{slide:t}),((_=a.slideContainer)!==null&&_!==void 0?_:(({children:S})=>S))({slide:t,children:E}),(x=a.slideFooter)===null||x===void 0?void 0:x.call(a,{slide:t})):null};return $.createElement("div",{ref:n,className:Ht(Ne(zg()),!m&&Ne(zg("current")),Ne(ss)),...c_(m),style:u,role:"group","aria-roledescription":yr(f,"Slide"),"aria-label":yg(f,s,r+e)},p())}function I_(){const t=It().styles.slide;return $.createElement("div",{className:Ne(ac),style:t})}function L_({carousel:t,labels:e}){const{slides:n,currentIndex:r,globalIndex:s}=pn(),{setCarouselRef:o}=On(),{autoPlaying:i,focusWithin:a}=vc(),l=Fi(t.spacing),c=Fi(t.padding),d=xg(t,n,1),u=[];if(pc(n))for(let f=r-d;f<=r+d;f+=1){const g=mc(n,f),m=s-r+f,p=t.finite&&(f<0||f>n.length-1);u.push(p?{key:m}:{key:[`${m}`,vg(g)].filter(Boolean).join("|"),offset:f-r,slide:g})}return $.createElement("div",{ref:o,className:Ht(Ne(wr()),u.length>0&&Ne(wr("with_slides"))),style:{[`${dt(wr("slides_count"))}`]:u.length,[`${dt(wr("spacing_px"))}`]:l.pixel||0,[`${dt(wr("spacing_percent"))}`]:l.percent||0,[`${dt(wr("padding_px"))}`]:c.pixel||0,[`${dt(wr("padding_percent"))}`]:c.percent||0},role:"region","aria-live":i&&!a?"off":"polite","aria-roledescription":yr(e,"Carousel"),"aria-label":yr(e,"Photo gallery")},u.map(({key:f,slide:g,offset:m})=>g?$.createElement(D_,{key:f,slide:g,offset:m}):$.createElement(I_,{key:f})))}const P_=gn(ng,L_);function Hg(){const{carousel:t}=It(),{slides:e,currentIndex:n}=pn(),r=e.length===0||t.finite&&n===0,s=e.length===0||t.finite&&n===e.length-1;return{prevDisabled:r,nextDisabled:s}}function Ug(t){var e;const n=Hi(),{publish:r}=cs(),{animation:s}=It(),{prevDisabled:o,nextDisabled:i}=Hg(),a=((e=s.navigation)!==null&&e!==void 0?e:s.swipe)/2,l=Pg(()=>r(or),a),c=Pg(()=>r(ir),a),d=We(u=>{switch(u.key){case n_:r(os);break;case r_:(n?i:o)||(n?c:l)();break;case s_:(n?o:i)||(n?l:c)();break}});$.useEffect(()=>t(cc,d),[t,d])}function Bg({label:t,icon:e,renderIcon:n,action:r,onClick:s,disabled:o,style:i}){return $.createElement(ds,{label:t,icon:e,renderIcon:n,className:Ne(`navigation_${r}`),disabled:o,onClick:s,style:i,...Ig(On().focus,o)})}function $_({render:{buttonPrev:t,buttonNext:e,iconPrev:n,iconNext:r},styles:s}){const{prev:o,next:i,subscribeSensors:a}=On(),{prevDisabled:l,nextDisabled:c}=Hg();return Ug(a),$.createElement($.Fragment,null,t?t():$.createElement(Bg,{label:"Previous",action:or,icon:w_,renderIcon:n,style:s.navigationPrev,disabled:l,onClick:o}),e?e():$.createElement(Bg,{label:"Next",action:ir,icon:k_,renderIcon:r,style:s.navigationNext,disabled:c,onClick:i}))}const F_=gn(WS,$_),jg=Ne(RS),V_=Ne(ag);function z_(t){return"style"in t}function Wg(t,e,n){const r=window.getComputedStyle(t),s=n?"padding-left":"padding-right",o=n?r.paddingLeft:r.paddingRight,i=t.style.getPropertyValue(s);return t.style.setProperty(s,`${($i(o)||0)+e}px`),()=>{i?t.style.setProperty(s,i):t.style.removeProperty(s)}}function H_({noScroll:{disabled:t},children:e}){const n=Hi(),{getOwnerDocument:r,getOwnerWindow:s}=ls();return $.useEffect(()=>{if(t)return()=>{};const o=[],i=s(),{body:a,documentElement:l}=r(),c=Math.round(i.innerWidth-l.clientWidth);if(c>0){o.push(Wg(a,c,n));const d=a.getElementsByTagName("*");for(let u=0;u<d.length;u+=1){const f=d[u];z_(f)&&i.getComputedStyle(f).getPropertyValue("position")==="fixed"&&!f.classList.contains(V_)&&o.push(Wg(f,c,n))}}return a.classList.add(jg),()=>{a.classList.remove(jg),o.forEach(d=>d())}},[n,t,r,s]),$.createElement($.Fragment,null,e)}const U_=gn(GS,H_);function Gg(t){return mr(oc,t)}function Yg(t,e,n){const r=t.getAttribute(e);return t.setAttribute(e,n),()=>{r?t.setAttribute(e,r):t.removeAttribute(e)}}function B_({children:t,animation:e,styles:n,className:r,on:s,portal:o,close:i,labels:a}){const[l,c]=$.useState(!1),[d,u]=$.useState(!1),f=$.useRef([]),g=$.useRef(null),{setTimeout:m}=co(),{subscribe:p}=cs(),b=xc()?0:e.fade;$.useEffect(()=>(c(!0),()=>{c(!1),u(!1)}),[]);const _=We(()=>{f.current.forEach(w=>w()),f.current=[]}),x=We(()=>{var w;u(!1),_(),(w=s.exiting)===null||w===void 0||w.call(s),m(()=>{var N;(N=s.exited)===null||N===void 0||N.call(s),i()},b)});$.useEffect(()=>p(os,x),[p,x]);const E=We(w=>{var N,C,k;d_(w),u(!0),(N=s.entering)===null||N===void 0||N.call(s);const M=(k=(C=w.parentNode)===null||C===void 0?void 0:C.children)!==null&&k!==void 0?k:[];for(let T=0;T<M.length;T+=1){const L=M[T];["TEMPLATE","SCRIPT","STYLE"].indexOf(L.tagName)===-1&&L!==w&&(f.current.push(Yg(L,"inert","")),f.current.push(Yg(L,"aria-hidden","true")))}f.current.push(()=>{var T,L;(L=(T=g.current)===null||T===void 0?void 0:T.focus)===null||L===void 0||L.call(T)}),m(()=>{var T;(T=s.entered)===null||T===void 0||T.call(s)},b)}),S=$.useCallback(w=>{w?E(w):_()},[E,_]);return l?Dn.createPortal($.createElement(E_,{ref:S,className:Ht(r,Ne(Gg()),Ne(ag),d&&Ne(Gg("open"))),"aria-modal":!0,role:"dialog","aria-label":yr(a,"Lightbox"),style:{...e.fade!==yc.animation.fade?{[dt("fade_animation_duration")]:`${b}ms`}:null,...e.easing.fade!==yc.animation.easing.fade?{[dt("fade_animation_timing_function")]:e.easing.fade}:null,...n.root},onFocus:w=>{g.current||(g.current=w.relatedTarget)}},t),o.root||document.body):null}const j_=gn(oc,B_);function W_({children:t}){return $.createElement($.Fragment,null,t)}const G_=gn(YS,W_);function Y_(t){return mr(rg,t)}function X_({toolbar:{buttons:t},render:{buttonClose:e,iconClose:n},styles:r}){const{close:s,setToolbarWidth:o}=On(),{setContainerRef:i,containerRect:a}=Ag();Mn(()=>{o(a?.width)},[o,a?.width]);const l=()=>e?e():$.createElement(ds,{key:os,label:"Close",icon:x_,renderIcon:n,onClick:s});return $.createElement("div",{ref:i,style:r.toolbar,className:Ne(Y_())},t?.map(c=>c===os?l():c))}const K_=gn(rg,X_);function Xg(t,e){var n;return $.createElement(t.module.component,{key:t.module.name,...e},(n=t.children)===null||n===void 0?void 0:n.map(r=>Xg(r,e)))}function q_(t,e={}){const{easing:n,...r}=t,{easing:s,...o}=e;return{easing:{...n,...s},...r,...o}}function Z_({carousel:t,animation:e,render:n,toolbar:r,controller:s,noScroll:o,on:i,plugins:a,slides:l,index:c,...d}){const{animation:u,carousel:f,render:g,toolbar:m,controller:p,noScroll:y,on:b,slides:_,index:x,plugins:E,...S}=yc,{config:w,augmentation:N}=u_([Dt(j_,[Dt(U_,[Dt(A_,[Dt(P_),Dt(K_),Dt(F_)])])])],a||E),C=N({animation:q_(u,e),carousel:{...f,...t},render:{...g,...n},toolbar:{...m,...r},controller:{...p,...s},noScroll:{...y,...o},on:{...b,...i},...S,...d});return C.open?$.createElement(Eg,{...C},$.createElement(b_,{slides:l||_,index:$i(c||x)},$.createElement(y_,null,$.createElement(g_,null,$.createElement(f_,null,Xg(Dt(G_,w),C)))))):null}const Q_={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1};function J_(t){return Math.min(Math.max(t,Number.EPSILON),1)}function Kg(t){const{minZoom:e,...n}={...Q_,...t};return{minZoom:J_(e),...n}}function R_(t,e,n,r){const s=$.useRef(void 0),o=$.useRef(void 0),{zoom:i}=It().animation,a=xc(),l=We(()=>{var c,d,u;if((c=s.current)===null||c===void 0||c.cancel(),s.current=void 0,o.current&&r?.current){try{s.current=(u=(d=r.current).animate)===null||u===void 0?void 0:u.call(d,[{transform:o.current},{transform:`scale(${t}) translateX(${e}px) translateY(${n}px)`}],{duration:a?0:i??500,easing:s.current?"ease-out":"ease-in-out"})}catch(f){console.error(f)}o.current=void 0,s.current&&(s.current.onfinish=()=>{s.current=void 0})}});return Mn(l,[t,e,n,l]),$.useCallback(()=>{o.current=r?.current?window.getComputedStyle(r.current).transform:void 0},[r])}function e2(t,e){const{on:n}=It(),r=We(()=>{var s;e||(s=n.zoom)===null||s===void 0||s.call(n,{zoom:t})});$.useEffect(r,[t,r])}function Ui(){const{zoom:t}=It();return Kg(t)}function t2(t,e){var n,r;let s={width:0,height:0},o={width:0,height:0};const{currentSlide:i}=pn(),{imageFit:a}=It().carousel,{maxZoomPixelRatio:l}=Ui();if(t&&i){const d={...i,...e};if(vr(d)){const u=hc(d,a),f=Math.max(...(((n=d.srcSet)===null||n===void 0?void 0:n.map(m=>m.width))||[]).concat(d.width?[d.width]:[])),g=Math.max(...(((r=d.srcSet)===null||r===void 0?void 0:r.map(m=>m.height))||[]).concat(d.height?[d.height]:[]));f>0&&g>0&&t.width>0&&t.height>0&&(o=u?{width:Math.round(Math.min(f,t.width/t.height*g)),height:Math.round(Math.min(g,t.height/t.width*f))}:{width:f,height:g},o={width:o.width*l,height:o.height*l},s=u?{width:Math.min(t.width,o.width,f),height:Math.min(t.height,o.height,g)}:{width:Math.round(Math.min(t.width,t.height/g*f,f)),height:Math.round(Math.min(t.height,t.width/f*g,g))})}}const c=s.width?Math.max(fc(o.width/s.width,5),1):1;return{imageRect:s,maxZoom:c}}function qg(t,e){return Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)}function Zg(t,e,n=100,r=2){return t*Math.min(1+Math.abs(e/n),r)**Math.sign(e)}function n2(t,e,n,r,s,o,i,a,l){const c=$.useRef([]),d=$.useRef(0),u=$.useRef(void 0),{globalIndex:f}=pn(),{getOwnerWindow:g}=ls(),{containerRef:m,subscribeSensors:p}=On(),{keyboardMoveDistance:y,zoomInMultiplier:b,wheelZoomDistanceFactor:_,scrollToZoom:x,doubleTapDelay:E,doubleClickDelay:S,doubleClickMaxStops:w,pinchZoomDistanceFactor:N,pinchZoomV4:C}=Ui(),k=$.useCallback(V=>{if(m.current){const{pageX:H,pageY:W}=V,{scrollX:j,scrollY:U}=g(),{left:B,top:G,width:z,height:X}=m.current.getBoundingClientRect();return[H-B-j-z/2,W-G-U-X/2]}return[]},[m,g]),M=We(V=>{const{key:H,metaKey:W,ctrlKey:j}=V,U=W||j,B=()=>{V.preventDefault(),V.stopPropagation()};if(t>1){const G=(z,X)=>{B(),a(z,X)};H==="ArrowDown"?G(0,y):H==="ArrowUp"?G(0,-y):H==="ArrowLeft"?G(-y,0):H==="ArrowRight"&&G(y,0)}H==="+"||U&&H==="="?(B(),s()):H==="-"||U&&H==="_"?(B(),o()):U&&H==="0"&&(B(),i(1))}),T=We(V=>{if((V.ctrlKey||x)&&Math.abs(V.deltaY)>Math.abs(V.deltaX)){V.stopPropagation(),i(Zg(t,-V.deltaY,_),!0,...k(V));return}t>1&&(V.stopPropagation(),x||a(V.deltaX,V.deltaY))}),L=$.useCallback(V=>{const H=c.current;H.splice(0,H.length,...H.filter(W=>W.pointerId!==V.pointerId))},[]),P=$.useCallback(V=>{L(V),V.persist(),c.current.push(V)},[L]),F=We(V=>{var H;const W=c.current;if(V.pointerType==="mouse"&&V.buttons>1||!(!((H=l?.current)===null||H===void 0)&&H.contains(V.target)))return;t>1&&V.stopPropagation();const{timeStamp:j}=V;if(W.length===0&&j-d.current<(V.pointerType==="touch"?E:S)){d.current=0;const U=t>=1?t!==n?t*Math.max(n**(1/w),b):1:t!==e?t/Math.max(e**(-1/w),b):1;i(U,!1,...k(V))}else d.current=j;if(P(V),W.length===2){const U=qg(W[0],W[1]);u.current={previousDistance:U,initialDistance:Math.max(U,1),initialZoom:t}}}),D=We(V=>{const H=c.current,W=H.find(j=>j.pointerId===V.pointerId);if(H.length===2&&u.current){V.stopPropagation(),P(V);const j=qg(H[0],H[1]),U=C?u.current.initialZoom/u.current.initialDistance*j:Zg(t,j-u.current.previousDistance,N);i(U,!0,...H.map(B=>k(B)).reduce((B,G)=>G.map((z,X)=>B[X]+z/2))),u.current.previousDistance=j;return}t>1&&(V.stopPropagation(),W&&(H.length===1&&a((W.clientX-V.clientX)/t,(W.clientY-V.clientY)/t),P(V)))}),A=$.useCallback(V=>{const H=c.current;H.length===2&&H.find(W=>W.pointerId===V.pointerId)&&(u.current=void 0),L(V)},[L]),O=$.useCallback(()=>{const V=c.current;V.splice(0,V.length),d.current=0,u.current=void 0},[]);$g(p,F,D,A,r),$.useEffect(O,[f,O]),$.useEffect(()=>r?()=>{}:is(O,p(cc,M),p(dc,T)),[r,p,O,M,T])}function r2(t,e,n){const[r,s]=$.useState(1),[o,i]=$.useState(0),[a,l]=$.useState(0),c=R_(r,o,a,n),{currentSlide:d,globalIndex:u}=pn(),{containerRect:f,slideRect:g}=On(),{minZoom:m,zoomInMultiplier:p}=Ui(),y=d&&vr(d)?d.src:void 0,b=!y||!n?.current;Mn(()=>{s(1),i(0),l(0)},[u,y]);const _=$.useCallback((N,C,k)=>{const M=k||r,T=o-(N||0),L=a-(C||0),P=(t.width*M-g.width)/2/M,F=(t.height*M-g.height)/2/M;i(Math.min(Math.abs(T),Math.max(P,0))*Math.sign(T)),l(Math.min(Math.abs(L),Math.max(F,0))*Math.sign(L))},[r,o,a,g,t.width,t.height]),x=$.useCallback((N,C,k,M)=>{const T=fc(N+.01<e?N-.01>m?N:m:e,5);C||c(),_(k?k*(1/r-1/T):0,M?M*(1/r-1/T):0,T),s(T)},[r,m,e,_,c]),E=We(()=>{r>1&&(r>e&&x(e,!0),_())});Mn(E,[f.width,f.height,E]);const S=$.useCallback(()=>{const N=r*p;x(r<1&&N>1?1:N)},[r,p,x]),w=$.useCallback(()=>{const N=r/p;x(r>1&&N<1?1:N)},[r,p,x]);return{zoom:r,offsetX:o,offsetY:a,disabled:b,changeOffsets:_,changeZoom:x,zoomIn:S,zoomOut:w}}const Qg=$.createContext(null),Ec=hn("useZoom","ZoomControllerContext",Qg);function s2({children:t}){const[e,n]=$.useState(),{slideRect:r}=On(),{ref:s,minZoom:o}=Ui(),{imageRect:i,maxZoom:a}=t2(r,e?.imageDimensions),{zoom:l,offsetX:c,offsetY:d,disabled:u,changeZoom:f,changeOffsets:g,zoomIn:m,zoomOut:p}=r2(i,a,e?.zoomWrapperRef);e2(l,u),n2(l,o,a,u,m,p,f,g,e?.zoomWrapperRef);const y=$.useMemo(()=>({zoom:l,minZoom:o,maxZoom:a,offsetX:c,offsetY:d,disabled:u,zoomIn:m,zoomOut:p,changeZoom:f}),[l,o,a,c,d,u,m,p,f]);$.useImperativeHandle(s,()=>y,[y]);const b=$.useMemo(()=>({...y,setZoomWrapper:n}),[y,n]);return $.createElement(Qg.Provider,{value:b},t)}const o2=en("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"}))),i2=en("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"})),Jg=$.forwardRef(function({zoomIn:e,onLoseFocus:n},r){const s=$.useRef(!1),o=$.useRef(!1),{zoom:i,minZoom:a,maxZoom:l,zoomIn:c,zoomOut:d,disabled:u}=Ec(),{render:f}=It(),g=u||(e?i>=l:i<=a);return $.useEffect(()=>{g&&s.current&&o.current&&n(),g||(s.current=!0)},[g,n]),$.createElement(ds,{ref:r,disabled:g,label:e?"Zoom in":"Zoom out",icon:e?o2:i2,renderIcon:e?f.iconZoomIn:f.iconZoomOut,onClick:e?c:d,onFocus:()=>{o.current=!0},onBlur:()=>{o.current=!1}})});function a2(){const t=$.useRef(null),e=$.useRef(null),{focus:n}=On(),r=$.useCallback(i=>{var a,l;!((a=i.current)===null||a===void 0)&&a.disabled?n():(l=i.current)===null||l===void 0||l.focus()},[n]),s=$.useCallback(()=>r(t),[r]),o=$.useCallback(()=>r(e),[r]);return $.createElement($.Fragment,null,$.createElement(Jg,{zoomIn:!0,ref:t,onLoseFocus:o}),$.createElement(Jg,{ref:e,onLoseFocus:s}))}function l2(){const{render:t}=It(),e=Ec();return t.buttonZoom?$.createElement($.Fragment,null,t.buttonZoom(e)):$.createElement(a2,null)}function c2(t){var e;return(((e=t.srcSet)===null||e===void 0?void 0:e.length)||0)>0}function d2({current:t,preload:e},{type:n,source:r}){switch(n){case"fetch":return t?{current:t,preload:r}:{current:r};case"done":return r===e?{current:r}:{current:t,preload:e};default:throw new Error(mg)}}function u2(t){var e,n;const[{current:r,preload:s},o]=$.useReducer(d2,{}),{slide:i,rect:a,imageFit:l,render:c,interactive:d}=t,u=i.srcSet.sort((S,w)=>S.width-w.width),f=(e=i.width)!==null&&e!==void 0?e:u[u.length-1].width,g=(n=i.height)!==null&&n!==void 0?n:u[u.length-1].height,m=hc(i,l),p=Math.max(...u.map(S=>S.width)),y=Math.min((m?Math.max:Math.min)(a.width,f*(a.height/g)),p),b=a_(),_=We(()=>{var S;const w=(S=u.find(N=>N.width>=y*b))!==null&&S!==void 0?S:u[u.length-1];(!r||u.findIndex(N=>N.src===r)<u.findIndex(N=>N===w))&&o({type:"fetch",source:w.src})});Mn(_,[a.width,a.height,b,_]);const x=We(S=>o({type:"done",source:S})),E={WebkitTransform:d?"initial":"translateZ(0)"};return m||Object.assign(E,a.width/a.height<f/g?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),$.createElement($.Fragment,null,s&&s!==r&&$.createElement(xr,{key:"preload",...t,offset:void 0,slide:{...i,src:s,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...E},onLoad:()=>x(s),render:{...c,iconLoading:()=>null,iconError:()=>null}}),r&&$.createElement(xr,{key:"current",...t,slide:{...i,src:r,srcSet:void 0},style:E}))}function f2({render:t,slide:e,offset:n,rect:r}){var s;const[o,i]=$.useState(),a=$.useRef(null),{zoom:l,maxZoom:c,offsetX:d,offsetY:u,setZoomWrapper:f}=Ec(),g=l>1,{carousel:m,on:p}=It(),{currentIndex:y}=pn();Mn(()=>n===0?(f({zoomWrapperRef:a,imageDimensions:o}),()=>f(void 0)):()=>{},[n,o,f]);let b=(s=t.slide)===null||s===void 0?void 0:s.call(t,{slide:e,offset:n,rect:r,zoom:l,maxZoom:c});if(!b&&vr(e)){const _={slide:e,offset:n,rect:r,render:t,imageFit:m.imageFit,imageProps:m.imageProps,onClick:n===0?()=>{var x;return(x=p.click)===null||x===void 0?void 0:x.call(p,{index:y})}:void 0};b=c2(e)?$.createElement(u2,{..._,slide:e,interactive:g,rect:n===0?{width:r.width*l,height:r.height*l}:r}):$.createElement(xr,{onLoad:x=>i({width:x.naturalWidth,height:x.naturalHeight}),..._})}return b?$.createElement("div",{ref:a,className:Ht(Ne(ig),Ne(ss),Ne(lg),g&&Ne(e_)),style:n===0?{transform:`scale(${l}) translateX(${d}px) translateY(${u}px)`}:void 0},b):null}const h2=({augment:t,addModule:e})=>{t(({zoom:n,toolbar:r,render:s,controller:o,...i})=>{const a=Kg(n);return{zoom:a,toolbar:Vi(r,og,$.createElement(l2,null)),render:{...s,slide:l=>{var c;return vr(l.slide)?$.createElement(f2,{render:s,...l}):(c=s.slide)===null||c===void 0?void 0:c.call(s,l)}},controller:{...o,preventDefaultWheelY:a.scrollToZoom},...i}}),e(gn(og,s2))},g2={separator:"/",container:{}},Rg=t=>({...g2,...t});function p2({counter:t}){const{slides:e,currentIndex:n}=pn(),{separator:r,container:{className:s,...o},className:i,...a}=Rg(t);return e.length===0?null:$.createElement("div",{className:Ht(Ne("counter"),s||i),...a,...o,"aria-hidden":!0},n+1," ",r," ",e.length)}function m2({augment:t,addChild:e}){t(({counter:n,...r})=>({counter:Rg(n),...r})),e(ro,gn(XS,p2))}const b2={autoplay:!1,delay:3e3,ref:null},ep=t=>({...b2,...t}),tp=$.createContext(null),y2=hn("useSlideshow","SlideshowContext",tp);function v2({slideshow:t,carousel:{finite:e},on:n,children:r}){const{autoplay:s,delay:o,ref:i}=ep(t),a=$.useRef(s),[l,c]=$.useState(s),d=$.useRef(void 0),u=$.useRef(void 0),{slides:f,currentIndex:g}=pn(),{setTimeout:m,clearTimeout:p}=co(),{subscribe:y}=cs(),{next:b}=On(),{setAutoPlaying:_}=vc();$.useEffect(()=>_(l),[l,_]);const x=f.length===0||e&&g===f.length-1,E=$.useCallback(()=>{!l&&!x&&c(!0)},[l,x]),S=$.useCallback(()=>{l&&c(!1)},[l]),w=$.useCallback(()=>{p(d.current),d.current=void 0},[p]),N=We(()=>{w(),!(!l||x||u.current===rs||u.current===ic)&&(d.current=m(()=>{l&&(u.current=void 0,b())},o))});$.useEffect(N,[g,l,N]),$.useEffect(()=>{l&&x&&c(!1)},[g,l,x]);const C=We(()=>{var T;return(T=n.slideshowStart)===null||T===void 0?void 0:T.call(n)}),k=We(()=>{var T;return(T=n.slideshowStop)===null||T===void 0?void 0:T.call(n)});$.useEffect(()=>{l?C():a.current&&k(),a.current=l},[l,C,k]),$.useEffect(()=>is(w,y(qS,()=>{u.current=rs,w()}),y(ZS,()=>{u.current=ic,w()}),y(QS,()=>{u.current=io,N()}),y(JS,()=>{u.current=ao,N()})),[y,w,N]);const M=$.useMemo(()=>({playing:l,disabled:x,play:E,pause:S}),[l,x,E,S]);return $.useImperativeHandle(i,()=>M,[M]),$.createElement(tp.Provider,{value:M},r)}const x2=en("Play",$.createElement("path",{d:"M8 5v14l11-7z"})),w2=en("Pause",$.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}));function k2(){const{playing:t,disabled:e,play:n,pause:r}=y2(),{render:s}=It(),o=Ig(On().focus,e);return s.buttonSlideshow?$.createElement($.Fragment,null,s.buttonSlideshow({playing:t,disabled:e,play:n,pause:r})):$.createElement(ds,{label:t?"Pause":"Play",icon:t?w2:x2,renderIcon:t?s.iconSlideshowPause:s.iconSlideshowPlay,onClick:t?r:n,disabled:e,...o})}function C2({augment:t,addModule:e}){t(({slideshow:n,toolbar:r,...s})=>({toolbar:Vi(r,sg,$.createElement(k2,null)),slideshow:ep(n),...s})),e(gn(sg,v2))}const S2={auto:!1,ref:null},np=t=>({...S2,...t}),rp=$.createContext(null),_2=hn("useFullscreen","FullscreenContext",rp);function E2({fullscreen:t,on:e,children:n}){const{auto:r,ref:s}=np(t),o=$.useRef(null),[i,a]=$.useState(),[l,c]=$.useState(!1),d=$.useRef(!1),{getOwnerDocument:u}=ls();Mn(()=>{var x,E,S,w;const N=u();a(!((w=(S=(E=(x=N.fullscreenEnabled)!==null&&x!==void 0?x:N.webkitFullscreenEnabled)!==null&&E!==void 0?E:N.mozFullScreenEnabled)!==null&&S!==void 0?S:N.msFullscreenEnabled)!==null&&w!==void 0&&w))},[u]);const f=$.useCallback(()=>{var x;const E=u(),S=E.fullscreenElement||E.webkitFullscreenElement||E.mozFullScreenElement||E.msFullscreenElement;return((x=S?.shadowRoot)===null||x===void 0?void 0:x.fullscreenElement)||S},[u]),g=$.useCallback(()=>{const x=o.current;try{x.requestFullscreen?x.requestFullscreen().catch(()=>{}):x.webkitRequestFullscreen?x.webkitRequestFullscreen():x.mozRequestFullScreen?x.mozRequestFullScreen():x.msRequestFullscreen&&x.msRequestFullscreen()}catch{}},[]),m=$.useCallback(()=>{if(!f())return;const x=u();try{x.exitFullscreen?x.exitFullscreen().catch(()=>{}):x.webkitExitFullscreen?x.webkitExitFullscreen():x.mozCancelFullScreen?x.mozCancelFullScreen():x.msExitFullscreen&&x.msExitFullscreen()}catch{}},[f,u]);$.useEffect(()=>{const x=u(),E=()=>{c(f()===o.current)};return is(...["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].map(S=>(x.addEventListener(S,E),()=>x.removeEventListener(S,E))))},[f,u]);const p=We(()=>{var x;return(x=e.enterFullscreen)===null||x===void 0?void 0:x.call(e)}),y=We(()=>{var x;return(x=e.exitFullscreen)===null||x===void 0?void 0:x.call(e)});$.useEffect(()=>{l&&(d.current=!0),d.current&&(l?p:y)()},[l,p,y]);const b=We(()=>{var x;return(x=r?g:null)===null||x===void 0||x(),m});$.useEffect(b,[b]);const _=$.useMemo(()=>({fullscreen:l,disabled:i,enter:g,exit:m}),[l,i,g,m]);return $.useImperativeHandle(s,()=>_,[_]),$.createElement("div",{ref:o,className:Ht(Ne(so),Ne(ig))},$.createElement(rp.Provider,{value:_},n))}const M2=en("EnterFullscreen",$.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})),N2=en("ExitFullscreen",$.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));function O2(){var t;const{fullscreen:e,disabled:n,enter:r,exit:s}=_2(),{render:o}=It();return n?null:o.buttonFullscreen?$.createElement($.Fragment,null,(t=o.buttonFullscreen)===null||t===void 0?void 0:t.call(o,{fullscreen:e,disabled:n,enter:r,exit:s})):$.createElement(ds,{disabled:n,label:e?"Exit Fullscreen":"Enter Fullscreen",icon:e?N2:M2,renderIcon:e?o.iconExitFullscreen:o.iconEnterFullscreen,onClick:e?s:r})}function T2({augment:t,contains:e,addParent:n}){t(({fullscreen:r,toolbar:s,...o})=>({toolbar:Vi(s,so,$.createElement(O2,null)),fullscreen:np(r),...o})),n(e(oo)?oo:ro,gn(so,E2))}const kr={ref:null,position:"bottom",width:120,height:80,border:1,borderRadius:4,padding:4,gap:16,imageFit:"contain",vignette:!0,hidden:!1,showToggle:!1},Mc=t=>({...kr,...t});function sp(){const{thumbnails:t}=It();return Mc(t)}const Cr=t=>mr(oo,t),Lt=t=>Cr(mr("thumbnail",t)),A2=en("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"})),D2=en("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 I2({slide:t,render:e,rect:n,imageFit:r}){var s;const o=(s=e.thumbnail)===null||s===void 0?void 0:s.call(e,{slide:t,render:e,rect:n,imageFit:r});if(o)return o;const i={render:e,rect:n,imageFit:r};if(t.thumbnail)return $.createElement(xr,{slide:{src:t.thumbnail},...i});if(vr(t))return $.createElement(xr,{slide:t,...i});const a=Ne(Lt(Pi));return t.type==="video"?$.createElement($.Fragment,null,t.poster&&$.createElement(xr,{slide:{src:t.poster},...i}),$.createElement(A2,{className:a})):$.createElement(D2,{className:a})}const L2=br("active"),Nc=br("fadein"),Oc=br("fadeout"),P2=br("placeholder"),op="delay",ip="duration";function $2({slide:t,index:e,onClick:n,fadeIn:r,fadeOut:s,placeholder:o,onLoseFocus:i}){const a=$.useRef(null),{render:l,styles:c,labels:d}=It(),{slides:u,globalIndex:f}=pn(),{getOwnerDocument:g}=ls(),{width:m,height:p,imageFit:y}=sp(),b={width:m,height:p},_=e===f,x=We(i);return $.useEffect(()=>{s&&g().activeElement===a.current&&x()},[s,x,g]),$.createElement("button",{ref:a,type:"button",className:Ht(Ne(ss),Ne(Lt()),_&&Ne(Lt(L2())),r&&Ne(Lt(Nc())),s&&Ne(Lt(Oc())),o&&Ne(Lt(P2()))),style:{...r?{[dt(Lt(Nc(ip)))]:`${r.duration}ms`,[dt(Lt(Nc(op)))]:`${r.delay}ms`}:null,...s?{[dt(Lt(Oc(ip)))]:`${s.duration}ms`,[dt(Lt(Oc(op)))]:`${s.delay}ms`}:null,...c.thumbnail},onClick:n,"aria-current":_?!0:void 0,"aria-label":yg(d,u,e)},t&&I2({slide:t,render:l,rect:b,imageFit:y}))}function ap(t){return["top","bottom"].includes(t)}function lp(t,e){return e+2*(t.border+t.padding)+t.gap}function F2(t){const{thumbnail:e,poster:n}=t||{thumbnail:"placeholder"};return typeof e=="string"&&e||typeof n=="string"&&n||t&&vg(t)||void 0}function cp({visible:t,containerRef:e}){const n=$.useRef(null),r=Hi(),{publish:s,subscribe:o}=cs(),{carousel:i,styles:a,labels:l}=It(),{slides:c,globalIndex:d,animation:u}=pn(),{registerSensors:f,subscribeSensors:g}=Lg();Ug(g);const m=sp(),{position:p,width:y,height:b,border:_,borderStyle:x,borderColor:E,borderRadius:S,padding:w,gap:N,vignette:C}=m,k=u?.duration!==void 0&&u?.increment||0,M=u?.duration||0,{prepareAnimation:T}=wc(n,A=>({keyframes:ap(p)?[{transform:`translateX(${(r?-1:1)*lp(m,y)*k+A}px)`},{transform:"translateX(0)"}]:[{transform:`translateY(${lp(m,b)*k+A}px)`},{transform:"translateY(0)"}],duration:M,easing:u?.easing})),L=We(()=>{let A=0;if(e.current&&n.current){const O=e.current.getBoundingClientRect(),V=n.current.getBoundingClientRect();A=ap(p)?V.left-O.left-(O.width-V.width)/2:V.top-O.top-(O.height-V.height)/2}T(A)});$.useEffect(()=>is(o(lc,L)),[o,L]);const P=xg(i,c),F=[];if(pc(c))for(let A=d-P-Math.abs(k);A<=d+P+Math.abs(k);A+=1){const V=i.finite&&(A<0||A>c.length-1)||k<0&&A<d-P||k>0&&A>d+P?null:mc(c,A),H=[`${A}`,F2(V)].filter(Boolean).join("|");F.push({key:H,index:A,slide:V})}const D=A=>()=>{A>d?s(ir,{count:A-d}):A<d&&s(or,{count:d-A})};return $.createElement("div",{className:Ht(Ne(Cr("container")),Ne(ss)),style:{...t?null:{display:"none"},...y!==kr.width?{[dt(Lt("width"))]:`${y}px`}:null,...b!==kr.height?{[dt(Lt("height"))]:`${b}px`}:null,..._!==kr.border?{[dt(Lt("border"))]:`${_}px`}:null,...x?{[dt(Lt("border_style"))]:x}:null,...E?{[dt(Lt("border_color"))]:E}:null,...S!==kr.borderRadius?{[dt(Lt("border_radius"))]:`${S}px`}:null,...w!==kr.padding?{[dt(Lt("padding"))]:`${w}px`}:null,...N!==kr.gap?{[dt(Lt("gap"))]:`${N}px`}:null,...a.thumbnailsContainer}},$.createElement("nav",{ref:n,style:a.thumbnailsTrack,className:Ht(Ne(Cr("track")),Ne(ss)),"aria-label":yr(l,"Thumbnails"),tabIndex:-1,...f},F.map(({key:A,index:O,slide:V})=>{const H=M/Math.abs(k||1),W=k>0&&O>d+P-k&&O<=d+P||k<0&&O<d-P-k&&O>=d-P?{duration:H,delay:((k>0?O-(d+P-k):d-P-k-O)-1)*H}:void 0,j=k>0&&O<d-P||k<0&&O>d+P?{duration:H,delay:(k>0?k-(d-P-O):-k-(O-(d+P)))*H}:void 0;return $.createElement($2,{key:A,index:O,slide:V,fadeIn:W,fadeOut:j,placeholder:!V,onClick:D(O),onLoseFocus:()=>{var U;return(U=n.current)===null||U===void 0?void 0:U.focus()}})})),C&&$.createElement("div",{className:Ne(Cr("vignette"))}))}const dp=$.createContext(null),V2=hn("useThumbnails","ThumbnailsContext",dp);function z2({children:t,...e}){const{ref:n,position:r,hidden:s}=Mc(e.thumbnails),[o,i]=$.useState(!s),a=$.useRef(null),l=$.useMemo(()=>({visible:o,show:()=>i(!0),hide:()=>i(!1)}),[o]);return $.useImperativeHandle(n,()=>l,[l]),$.createElement(Eg,{...e},$.createElement(dp.Provider,{value:l},$.createElement("div",{ref:a,className:Ht(Ne(Cr()),Ne(Cr(`${r}`)))},["start","top"].includes(r)&&$.createElement(cp,{containerRef:a,visible:o}),$.createElement("div",{className:Ne(Cr("wrapper"))},t),["end","bottom"].includes(r)&&$.createElement(cp,{containerRef:a,visible:o}))))}const up=()=>$.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"})),H2=en("ThumbnailsVisible",up()),U2=v_("ThumbnailsHidden",up());function B2(){const{visible:t,show:e,hide:n}=V2(),{render:r}=It();return r.buttonThumbnails?$.createElement($.Fragment,null,r.buttonThumbnails({visible:t,show:e,hide:n})):$.createElement(ds,{label:t?"Hide thumbnails":"Show thumbnails",icon:t?H2:U2,renderIcon:t?r.iconThumbnailsVisible:r.iconThumbnailsHidden,onClick:t?n:e})}function j2({augment:t,contains:e,append:n,addParent:r}){t(({thumbnails:o,toolbar:i,...a})=>{const l=Mc(o);return{toolbar:Vi(i,oo,l.showToggle?$.createElement(B2,null):null),thumbnails:l,...a}});const s=gn(oo,z2);e(so)?n(so,s):r(ro,s)}const Tc=t=>{if(!t||typeof window>"u"||!window.location||!/^(https?:)?\/\//i.test(t))return!1;try{return new URL(t,window.location.href).origin!==window.location.origin}catch{return!1}},W2=window.G7Core?.createLogger?.("Comp:ImageGallery")??{log:(...t)=>console.log("[Comp:ImageGallery]",...t),warn:(...t)=>console.warn("[Comp:ImageGallery]",...t),error:(...t)=>console.error("[Comp:ImageGallery]",...t)},Ac=window.G7Core,Bi=(t,e)=>Ac?.t?.(t,e)??t,G2=async(t,e)=>{try{const n=await Ac.api.get(t,{responseType:"blob"});if(n){const r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r)}}catch(n){W2.error("Failed to download file:",n),Ac?.toast?.error?.(Bi("common.download_failed"))}},Y2=(t,e)=>{const n=document.createElement("a");n.href=t,n.download=e,n.target="_blank",document.body.appendChild(n),n.click(),document.body.removeChild(n)},Dc=async t=>{const e=t.downloadUrl||t.src,n=t.filename||t.title||"image";t.downloadRequiresAuth&&!Tc(e)?await G2(e,n):Y2(e,n)},X2=({image:t,index:e,onDownload:n})=>{const[r,s]=v.useState(!1),o=async i=>{if(i.stopPropagation(),n){n(t,e);return}s(!0);try{await Dc(t)}finally{s(!1)}};return h.jsx(oe,{type:"button",onClick:o,disabled:r,className:"yarl__button flex items-center justify-center","aria-label":Bi("common.download"),title:Bi("common.download"),children:r?h.jsx(gt,{className:"fa-solid fa-spinner fa-spin text-white"}):h.jsx(gt,{className:"fa-solid fa-download text-white"})})},ji=({images:t,isOpen:e,onClose:n,startIndex:r=0,enableZoom:s=!0,enableSlideshow:o=!1,enableFullscreen:i=!0,showCounter:a=!0,showDownload:l=!0,showThumbnails:c=!0,onDownload:d,editorAttrs:u,id:f})=>{const[g,m]=v.useState(r),p=v.useRef(r),y=t.map(x=>({src:x.src,title:x.title,description:x.description})),b=[];s&&b.push(h2),o&&b.push(C2),i&&b.push(T2),a&&b.push(m2),c&&b.push(j2);const _=t[g];if(v.useEffect(()=>{p.current=g},[g]),u){const x=(t??[]).slice(0,4);return h.jsx(I,{id:f,className:"grid grid-cols-2 gap-2 p-3 rounded-lg border border-dashed border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800",...u,children:x.length>0?x.map((E,S)=>h.jsx(kn,{src:E.thumbnail||E.src,alt:E.title||"",className:"w-full aspect-square object-cover rounded bg-gray-200 dark:bg-gray-700"},S)):h.jsxs(I,{className:"col-span-2 flex items-center justify-center py-6 text-sm text-gray-400 dark:text-gray-500",children:[h.jsx(gt,{className:"fa-regular fa-images mr-2"}),Bi("editor.component.image_gallery")]})})}return h.jsx(Z_,{open:e,close:n,slides:y,index:g,plugins:b,on:{view:({index:x})=>{x!==p.current&&m(x)}},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:[l&&_&&h.jsx(X2,{image:_,index:g,onDownload:d},"download"),"close"].filter(Boolean)},styles:{container:{backgroundColor:"rgba(0, 0, 0, 0.9)"}}})},fp=()=>{const[t,e]=v.useState(!1),[n,r]=v.useState([]),[s,o]=v.useState(0),i=v.useCallback((l,c=0)=>{r(l),o(c),e(!0)},[]),a=v.useCallback(()=>{e(!1)},[]);return{isOpen:t,openGallery:i,closeGallery:a,galleryProps:{images:n,isOpen:t,onClose:a,startIndex:s}}};ji.displayName="ImageGallery";const K2=Object.freeze(Object.defineProperty({__proto__:null,ImageGallery:ji,executeImageDownload:Dc,useImageGallery:fp},Symbol.toStringTag,{value:"Module"})),q2=v.createContext(null),Z2=({value:t,children:e})=>h.jsx(q2.Provider,{value:t,children:e});function Q2(t,e){return e.forEach((function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach((function(r){if(r!=="default"&&!(r in t)){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}}))})),Object.freeze(t)}function hp(t,e){return new Promise((function(n,r){let s;return J2(t).then((function(o){try{return s=o,n(new Blob([e.slice(0,2),s,e.slice(2)],{type:"image/jpeg"}))}catch(i){return r(i)}}),r)}))}const J2=t=>new Promise(((e,n)=>{const r=new FileReader;r.addEventListener("load",(({target:{result:s}})=>{const o=new DataView(s);let i=0;if(o.getUint16(i)!==65496)return n("not a valid JPEG");for(i+=2;;){const a=o.getUint16(i);if(a===65498)break;const l=o.getUint16(i+2);if(a===65505&&o.getUint32(i+4)===1165519206){const c=i+10;let d;switch(o.getUint16(c)){case 18761:d=!0;break;case 19789:d=!1;break;default:return n("TIFF header contains invalid endian")}if(o.getUint16(c+2,d)!==42)return n("TIFF header contains invalid version");const u=o.getUint32(c+4,d),f=c+u+2+12*o.getUint16(c+u,d);for(let g=c+u+2;g<f;g+=12)if(o.getUint16(g,d)==274){if(o.getUint16(g+2,d)!==3)return n("Orientation data type is invalid");if(o.getUint32(g+4,d)!==1)return n("Orientation data count is invalid");o.setUint16(g+8,1,d);break}return e(s.slice(i,i+2+l))}i+=2+l}return e(new Blob)})),r.readAsArrayBuffer(t)}));var Wi={},R2={get exports(){return Wi},set exports(t){Wi=t}};(function(t){var e,n,r={};R2.exports=r,r.parse=function(s,o){for(var i=r.bin.readUshort,a=r.bin.readUint,l=0,c={},d=new Uint8Array(s),u=d.length-4;a(d,u)!=101010256;)u--;l=u,l+=4;var f=i(d,l+=4);i(d,l+=2);var g=a(d,l+=2),m=a(d,l+=4);l+=4,l=m;for(var p=0;p<f;p++){a(d,l),l+=4,l+=4,l+=4,a(d,l+=4),g=a(d,l+=4);var y=a(d,l+=4),b=i(d,l+=4),_=i(d,l+2),x=i(d,l+4);l+=6;var E=a(d,l+=8);l+=4,l+=b+_+x,r._readLocal(d,E,c,g,y,o)}return c},r._readLocal=function(s,o,i,a,l,c){var d=r.bin.readUshort,u=r.bin.readUint;u(s,o),d(s,o+=4),d(s,o+=2);var f=d(s,o+=2);u(s,o+=2),u(s,o+=4),o+=4;var g=d(s,o+=8),m=d(s,o+=2);o+=2;var p=r.bin.readUTF8(s,o,g);if(o+=g,o+=m,c)i[p]={size:l,csize:a};else{var y=new Uint8Array(s.buffer,o);if(f==0)i[p]=new Uint8Array(y.buffer.slice(o,o+a));else{if(f!=8)throw"unknown compression method: "+f;var b=new Uint8Array(l);r.inflateRaw(y,b),i[p]=b}}},r.inflateRaw=function(s,o){return r.F.inflate(s,o)},r.inflate=function(s,o){return s[0],s[1],r.inflateRaw(new Uint8Array(s.buffer,s.byteOffset+2,s.length-6),o)},r.deflate=function(s,o){o==null&&(o={level:6});var i=0,a=new Uint8Array(50+Math.floor(1.1*s.length));a[i]=120,a[i+1]=156,i+=2,i=r.F.deflateRaw(s,a,i,o.level);var l=r.adler(s,0,s.length);return a[i+0]=l>>>24&255,a[i+1]=l>>>16&255,a[i+2]=l>>>8&255,a[i+3]=l>>>0&255,new Uint8Array(a.buffer,0,i+4)},r.deflateRaw=function(s,o){o==null&&(o={level:6});var i=new Uint8Array(50+Math.floor(1.1*s.length)),a=r.F.deflateRaw(s,i,a,o.level);return new Uint8Array(i.buffer,0,a)},r.encode=function(s,o){o==null&&(o=!1);var i=0,a=r.bin.writeUint,l=r.bin.writeUshort,c={};for(var d in s){var u=!r._noNeed(d)&&!o,f=s[d],g=r.crc.crc(f,0,f.length);c[d]={cpr:u,usize:f.length,crc:g,file:u?r.deflateRaw(f):f}}for(var d in c)i+=c[d].file.length+30+46+2*r.bin.sizeUTF8(d);i+=22;var m=new Uint8Array(i),p=0,y=[];for(var d in c){var b=c[d];y.push(p),p=r._writeHeader(m,p,d,b,0)}var _=0,x=p;for(var d in c)b=c[d],y.push(p),p=r._writeHeader(m,p,d,b,1,y[_++]);var E=p-x;return a(m,p,101010256),p+=4,l(m,p+=4,_),l(m,p+=2,_),a(m,p+=2,E),a(m,p+=4,x),p+=4,p+=2,m.buffer},r._noNeed=function(s){var o=s.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(o)!=-1},r._writeHeader=function(s,o,i,a,l,c){var d=r.bin.writeUint,u=r.bin.writeUshort,f=a.file;return d(s,o,l==0?67324752:33639248),o+=4,l==1&&(o+=2),u(s,o,20),u(s,o+=2,0),u(s,o+=2,a.cpr?8:0),d(s,o+=2,0),d(s,o+=4,a.crc),d(s,o+=4,f.length),d(s,o+=4,a.usize),u(s,o+=4,r.bin.sizeUTF8(i)),u(s,o+=2,0),o+=2,l==1&&(o+=2,o+=2,d(s,o+=6,c),o+=4),o+=r.bin.writeUTF8(s,o,i),l==0&&(s.set(f,o),o+=f.length),o},r.crc={table:(function(){for(var s=new Uint32Array(256),o=0;o<256;o++){for(var i=o,a=0;a<8;a++)1&i?i=3988292384^i>>>1:i>>>=1;s[o]=i}return s})(),update:function(s,o,i,a){for(var l=0;l<a;l++)s=r.crc.table[255&(s^o[i+l])]^s>>>8;return s},crc:function(s,o,i){return 4294967295^r.crc.update(4294967295,s,o,i)}},r.adler=function(s,o,i){for(var a=1,l=0,c=o,d=o+i;c<d;){for(var u=Math.min(c+5552,d);c<u;)l+=a+=s[c++];a%=65521,l%=65521}return l<<16|a},r.bin={readUshort:function(s,o){return s[o]|s[o+1]<<8},writeUshort:function(s,o,i){s[o]=255&i,s[o+1]=i>>8&255},readUint:function(s,o){return 16777216*s[o+3]+(s[o+2]<<16|s[o+1]<<8|s[o])},writeUint:function(s,o,i){s[o]=255&i,s[o+1]=i>>8&255,s[o+2]=i>>16&255,s[o+3]=i>>24&255},readASCII:function(s,o,i){for(var a="",l=0;l<i;l++)a+=String.fromCharCode(s[o+l]);return a},writeASCII:function(s,o,i){for(var a=0;a<i.length;a++)s[o+a]=i.charCodeAt(a)},pad:function(s){return s.length<2?"0"+s:s},readUTF8:function(s,o,i){for(var a,l="",c=0;c<i;c++)l+="%"+r.bin.pad(s[o+c].toString(16));try{a=decodeURIComponent(l)}catch{return r.bin.readASCII(s,o,i)}return a},writeUTF8:function(s,o,i){for(var a=i.length,l=0,c=0;c<a;c++){var d=i.charCodeAt(c);if((4294967168&d)==0)s[o+l]=d,l++;else if((4294965248&d)==0)s[o+l]=192|d>>6,s[o+l+1]=128|d>>0&63,l+=2;else if((4294901760&d)==0)s[o+l]=224|d>>12,s[o+l+1]=128|d>>6&63,s[o+l+2]=128|d>>0&63,l+=3;else{if((4292870144&d)!=0)throw"e";s[o+l]=240|d>>18,s[o+l+1]=128|d>>12&63,s[o+l+2]=128|d>>6&63,s[o+l+3]=128|d>>0&63,l+=4}}return l},sizeUTF8:function(s){for(var o=s.length,i=0,a=0;a<o;a++){var l=s.charCodeAt(a);if((4294967168&l)==0)i++;else if((4294965248&l)==0)i+=2;else if((4294901760&l)==0)i+=3;else{if((4292870144&l)!=0)throw"e";i+=4}}return i}},r.F={},r.F.deflateRaw=function(s,o,i,a){var l=[[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]][a],c=r.F.U,d=r.F._goodIndex;r.F._hash;var u=r.F._putsE,f=0,g=i<<3,m=0,p=s.length;if(a==0){for(;f<p;)u(o,g,f+(T=Math.min(65535,p-f))==p?1:0),g=r.F._copyExact(s,f,T,o,g+8),f+=T;return g>>>3}var y=c.lits,b=c.strt,_=c.prev,x=0,E=0,S=0,w=0,N=0,C=0;for(p>2&&(b[C=r.F._hash(s,0)]=0),f=0;f<p;f++){if(N=C,f+1<p-2){C=r.F._hash(s,f+1);var k=f+1&32767;_[k]=b[C],b[C]=k}if(m<=f){(x>14e3||E>26697)&&p-f>100&&(m<f&&(y[x]=f-m,x+=2,m=f),g=r.F._writeBlock(f==p-1||m==p?1:0,y,x,w,s,S,f-S,o,g),x=E=w=0,S=f);var M=0;f<p-2&&(M=r.F._bestMatch(s,f,_,N,Math.min(l[2],p-f),l[3]));var T=M>>>16,L=65535&M;if(M!=0){L=65535&M;var P=d(T=M>>>16,c.of0);c.lhst[257+P]++;var F=d(L,c.df0);c.dhst[F]++,w+=c.exb[P]+c.dxb[F],y[x]=T<<23|f-m,y[x+1]=L<<16|P<<8|F,x+=2,m=f+T}else c.lhst[s[f]]++;E++}}for(S==f&&s.length!=0||(m<f&&(y[x]=f-m,x+=2,m=f),g=r.F._writeBlock(1,y,x,w,s,S,f-S,o,g),x=0,E=0,x=E=w=0,S=f);(7&g)!=0;)g++;return g>>>3},r.F._bestMatch=function(s,o,i,a,l,c){var d=32767&o,u=i[d],f=d-u+32768&32767;if(u==d||a!=r.F._hash(s,o-f))return 0;for(var g=0,m=0,p=Math.min(32767,o);f<=p&&--c!=0&&u!=d;){if(g==0||s[o+g]==s[o+g-f]){var y=r.F._howLong(s,o,f);if(y>g){if(m=f,(g=y)>=l)break;f+2<y&&(y=f+2);for(var b=0,_=0;_<y-2;_++){var x=o-f+_+32768&32767,E=x-i[x]+32768&32767;E>b&&(b=E,u=x)}}}f+=(d=u)-(u=i[d])+32768&32767}return g<<16|m},r.F._howLong=function(s,o,i){if(s[o]!=s[o-i]||s[o+1]!=s[o+1-i]||s[o+2]!=s[o+2-i])return 0;var a=o,l=Math.min(s.length,o+258);for(o+=3;o<l&&s[o]==s[o-i];)o++;return o-a},r.F._hash=function(s,o){return(s[o]<<8|s[o+1])+(s[o+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(s,o,i,a,l,c,d,u,f){var g,m,p,y,b,_,x,E,S,w=r.F.U,N=r.F._putsF,C=r.F._putsE;w.lhst[256]++,m=(g=r.F.getTrees())[0],p=g[1],y=g[2],b=g[3],_=g[4],x=g[5],E=g[6],S=g[7];var k=32+((f+3&7)==0?0:8-(f+3&7))+(d<<3),M=a+r.F.contSize(w.fltree,w.lhst)+r.F.contSize(w.fdtree,w.dhst),T=a+r.F.contSize(w.ltree,w.lhst)+r.F.contSize(w.dtree,w.dhst);T+=14+3*x+r.F.contSize(w.itree,w.ihst)+(2*w.ihst[16]+3*w.ihst[17]+7*w.ihst[18]);for(var L=0;L<286;L++)w.lhst[L]=0;for(L=0;L<30;L++)w.dhst[L]=0;for(L=0;L<19;L++)w.ihst[L]=0;var P=k<M&&k<T?0:M<T?1:2;if(N(u,f,s),N(u,f+1,P),f+=3,P==0){for(;(7&f)!=0;)f++;f=r.F._copyExact(l,c,d,u,f)}else{var F,D;if(P==1&&(F=w.fltree,D=w.fdtree),P==2){r.F.makeCodes(w.ltree,m),r.F.revCodes(w.ltree,m),r.F.makeCodes(w.dtree,p),r.F.revCodes(w.dtree,p),r.F.makeCodes(w.itree,y),r.F.revCodes(w.itree,y),F=w.ltree,D=w.dtree,C(u,f,b-257),C(u,f+=5,_-1),C(u,f+=5,x-4),f+=4;for(var A=0;A<x;A++)C(u,f+3*A,w.itree[1+(w.ordr[A]<<1)]);f+=3*x,f=r.F._codeTiny(E,w.itree,u,f),f=r.F._codeTiny(S,w.itree,u,f)}for(var O=c,V=0;V<i;V+=2){for(var H=o[V],W=H>>>23,j=O+(8388607&H);O<j;)f=r.F._writeLit(l[O++],F,u,f);if(W!=0){var U=o[V+1],B=U>>16,G=U>>8&255,z=255&U;C(u,f=r.F._writeLit(257+G,F,u,f),W-w.of0[G]),f+=w.exb[G],N(u,f=r.F._writeLit(z,D,u,f),B-w.df0[z]),f+=w.dxb[z],O+=W}}f=r.F._writeLit(256,F,u,f)}return f},r.F._copyExact=function(s,o,i,a,l){var c=l>>>3;return a[c]=i,a[c+1]=i>>>8,a[c+2]=255-a[c],a[c+3]=255-a[c+1],c+=4,a.set(new Uint8Array(s.buffer,o,i),c),l+(i+4<<3)},r.F.getTrees=function(){for(var s=r.F.U,o=r.F._hufTree(s.lhst,s.ltree,15),i=r.F._hufTree(s.dhst,s.dtree,15),a=[],l=r.F._lenCodes(s.ltree,a),c=[],d=r.F._lenCodes(s.dtree,c),u=0;u<a.length;u+=2)s.ihst[a[u]]++;for(u=0;u<c.length;u+=2)s.ihst[c[u]]++;for(var f=r.F._hufTree(s.ihst,s.itree,7),g=19;g>4&&s.itree[1+(s.ordr[g-1]<<1)]==0;)g--;return[o,i,f,l,d,g,a,c]},r.F.getSecond=function(s){for(var o=[],i=0;i<s.length;i+=2)o.push(s[i+1]);return o},r.F.nonZero=function(s){for(var o="",i=0;i<s.length;i+=2)s[i+1]!=0&&(o+=(i>>1)+",");return o},r.F.contSize=function(s,o){for(var i=0,a=0;a<o.length;a++)i+=o[a]*s[1+(a<<1)];return i},r.F._codeTiny=function(s,o,i,a){for(var l=0;l<s.length;l+=2){var c=s[l],d=s[l+1];a=r.F._writeLit(c,o,i,a);var u=c==16?2:c==17?3:7;c>15&&(r.F._putsE(i,a,d,u),a+=u)}return a},r.F._lenCodes=function(s,o){for(var i=s.length;i!=2&&s[i-1]==0;)i-=2;for(var a=0;a<i;a+=2){var l=s[a+1],c=a+3<i?s[a+3]:-1,d=a+5<i?s[a+5]:-1,u=a==0?-1:s[a-1];if(l==0&&c==l&&d==l){for(var f=a+5;f+2<i&&s[f+2]==l;)f+=2;(g=Math.min(f+1-a>>>1,138))<11?o.push(17,g-3):o.push(18,g-11),a+=2*g-2}else if(l==u&&c==l&&d==l){for(f=a+5;f+2<i&&s[f+2]==l;)f+=2;var g=Math.min(f+1-a>>>1,6);o.push(16,g-3),a+=2*g-2}else o.push(l,0)}return i>>>1},r.F._hufTree=function(s,o,i){var a=[],l=s.length,c=o.length,d=0;for(d=0;d<c;d+=2)o[d]=0,o[d+1]=0;for(d=0;d<l;d++)s[d]!=0&&a.push({lit:d,f:s[d]});var u=a.length,f=a.slice(0);if(u==0)return 0;if(u==1){var g=a[0].lit;return f=g==0?1:0,o[1+(g<<1)]=1,o[1+(f<<1)]=1,1}a.sort((function(E,S){return E.f-S.f}));var m=a[0],p=a[1],y=0,b=1,_=2;for(a[0]={lit:-1,f:m.f+p.f,l:m,r:p,d:0};b!=u-1;)m=y!=b&&(_==u||a[y].f<a[_].f)?a[y++]:a[_++],p=y!=b&&(_==u||a[y].f<a[_].f)?a[y++]:a[_++],a[b++]={lit:-1,f:m.f+p.f,l:m,r:p};var x=r.F.setDepth(a[b-1],0);for(x>i&&(r.F.restrictDepth(f,i,x),x=i),d=0;d<u;d++)o[1+(f[d].lit<<1)]=f[d].d;return x},r.F.setDepth=function(s,o){return s.lit!=-1?(s.d=o,o):Math.max(r.F.setDepth(s.l,o+1),r.F.setDepth(s.r,o+1))},r.F.restrictDepth=function(s,o,i){var a=0,l=1<<i-o,c=0;for(s.sort((function(u,f){return f.d==u.d?u.f-f.f:f.d-u.d})),a=0;a<s.length&&s[a].d>o;a++){var d=s[a].d;s[a].d=o,c+=l-(1<<i-d)}for(c>>>=i-o;c>0;)(d=s[a].d)<o?(s[a].d++,c-=1<<o-d-1):a++;for(;a>=0;a--)s[a].d==o&&c<0&&(s[a].d--,c++);c!=0&&console.log("debt left")},r.F._goodIndex=function(s,o){var i=0;return o[16|i]<=s&&(i|=16),o[8|i]<=s&&(i|=8),o[4|i]<=s&&(i|=4),o[2|i]<=s&&(i|=2),o[1|i]<=s&&(i|=1),i},r.F._writeLit=function(s,o,i,a){return r.F._putsF(i,a,o[s<<1]),a+o[1+(s<<1)]},r.F.inflate=function(s,o){var i=Uint8Array;if(s[0]==3&&s[1]==0)return o||new i(0);var a=r.F,l=a._bitsF,c=a._bitsE,d=a._decodeTiny,u=a.makeCodes,f=a.codes2map,g=a._get17,m=a.U,p=o==null;p&&(o=new i(s.length>>>2<<3));for(var y,b,_=0,x=0,E=0,S=0,w=0,N=0,C=0,k=0,M=0;_==0;)if(_=l(s,M,1),x=l(s,M+1,2),M+=3,x!=0){if(p&&(o=r.F._check(o,k+131072)),x==1&&(y=m.flmap,b=m.fdmap,N=511,C=31),x==2){E=c(s,M,5)+257,S=c(s,M+5,5)+1,w=c(s,M+10,4)+4,M+=14;for(var T=0;T<38;T+=2)m.itree[T]=0,m.itree[T+1]=0;var L=1;for(T=0;T<w;T++){var P=c(s,M+3*T,3);m.itree[1+(m.ordr[T]<<1)]=P,P>L&&(L=P)}M+=3*w,u(m.itree,L),f(m.itree,L,m.imap),y=m.lmap,b=m.dmap,M=d(m.imap,(1<<L)-1,E+S,s,M,m.ttree);var F=a._copyOut(m.ttree,0,E,m.ltree);N=(1<<F)-1;var D=a._copyOut(m.ttree,E,S,m.dtree);C=(1<<D)-1,u(m.ltree,F),f(m.ltree,F,y),u(m.dtree,D),f(m.dtree,D,b)}for(;;){var A=y[g(s,M)&N];M+=15&A;var O=A>>>4;if(!(O>>>8))o[k++]=O;else{if(O==256)break;var V=k+O-254;if(O>264){var H=m.ldef[O-257];V=k+(H>>>3)+c(s,M,7&H),M+=7&H}var W=b[g(s,M)&C];M+=15&W;var j=W>>>4,U=m.ddef[j],B=(U>>>4)+l(s,M,15&U);for(M+=15&U,p&&(o=r.F._check(o,k+131072));k<V;)o[k]=o[k++-B],o[k]=o[k++-B],o[k]=o[k++-B],o[k]=o[k++-B];k=V}}}else{(7&M)!=0&&(M+=8-(7&M));var G=4+(M>>>3),z=s[G-4]|s[G-3]<<8;p&&(o=r.F._check(o,k+z)),o.set(new i(s.buffer,s.byteOffset+G,z),k),M=G+z<<3,k+=z}return o.length==k?o:o.slice(0,k)},r.F._check=function(s,o){var i=s.length;if(o<=i)return s;var a=new Uint8Array(Math.max(i<<1,o));return a.set(s,0),a},r.F._decodeTiny=function(s,o,i,a,l,c){for(var d=r.F._bitsE,u=r.F._get17,f=0;f<i;){var g=s[u(a,l)&o];l+=15&g;var m=g>>>4;if(m<=15)c[f]=m,f++;else{var p=0,y=0;m==16?(y=3+d(a,l,2),l+=2,p=c[f-1]):m==17?(y=3+d(a,l,3),l+=3):m==18&&(y=11+d(a,l,7),l+=7);for(var b=f+y;f<b;)c[f]=p,f++}}return l},r.F._copyOut=function(s,o,i,a){for(var l=0,c=0,d=a.length>>>1;c<i;){var u=s[c+o];a[c<<1]=0,a[1+(c<<1)]=u,u>l&&(l=u),c++}for(;c<d;)a[c<<1]=0,a[1+(c<<1)]=0,c++;return l},r.F.makeCodes=function(s,o){for(var i,a,l,c,d=r.F.U,u=s.length,f=d.bl_count,g=0;g<=o;g++)f[g]=0;for(g=1;g<u;g+=2)f[s[g]]++;var m=d.next_code;for(i=0,f[0]=0,a=1;a<=o;a++)i=i+f[a-1]<<1,m[a]=i;for(l=0;l<u;l+=2)(c=s[l+1])!=0&&(s[l]=m[c],m[c]++)},r.F.codes2map=function(s,o,i){for(var a=s.length,l=r.F.U.rev15,c=0;c<a;c+=2)if(s[c+1]!=0)for(var d=c>>1,u=s[c+1],f=d<<4|u,g=o-u,m=s[c]<<g,p=m+(1<<g);m!=p;)i[l[m]>>>15-o]=f,m++},r.F.revCodes=function(s,o){for(var i=r.F.U.rev15,a=15-o,l=0;l<s.length;l+=2){var c=s[l]<<o-s[l+1];s[l]=i[c]>>>a}},r.F._putsE=function(s,o,i){i<<=7&o;var a=o>>>3;s[a]|=i,s[a+1]|=i>>>8},r.F._putsF=function(s,o,i){i<<=7&o;var a=o>>>3;s[a]|=i,s[a+1]|=i>>>8,s[a+2]|=i>>>16},r.F._bitsE=function(s,o,i){return(s[o>>>3]|s[1+(o>>>3)]<<8)>>>(7&o)&(1<<i)-1},r.F._bitsF=function(s,o,i){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16)>>>(7&o)&(1<<i)-1},r.F._get17=function(s,o){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16)>>>(7&o)},r.F._get25=function(s,o){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16|s[3+(o>>>3)]<<24)>>>(7&o)},r.F.U=(e=Uint16Array,n=Uint32Array,{next_code:new e(16),bl_count:new e(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 e(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 n(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new n(286),dhst:new n(30),ihst:new n(19),lits:new n(15e3),strt:new e(65536),prev:new e(32768)}),(function(){for(var s=r.F.U,o=0;o<32768;o++){var i=o;i=(4278255360&(i=(4042322160&(i=(3435973836&(i=(2863311530&i)>>>1|(1431655765&i)<<1))>>>2|(858993459&i)<<2))>>>4|(252645135&i)<<4))>>>8|(16711935&i)<<8,s.rev15[o]=(i>>>16|i<<16)>>>17}function a(l,c,d){for(;c--!=0;)l.push(0,d)}for(o=0;o<32;o++)s.ldef[o]=s.of0[o]<<3|s.exb[o],s.ddef[o]=s.df0[o]<<4|s.dxb[o];a(s.fltree,144,8),a(s.fltree,112,9),a(s.fltree,24,7),a(s.fltree,8,8),r.F.makeCodes(s.fltree,9),r.F.codes2map(s.fltree,9,s.flmap),r.F.revCodes(s.fltree,9),a(s.fdtree,32,5),r.F.makeCodes(s.fdtree,5),r.F.codes2map(s.fdtree,5,s.fdmap),r.F.revCodes(s.fdtree,5),a(s.itree,19,0),a(s.ltree,286,0),a(s.dtree,30,0),a(s.ttree,320,0)})()})();var eE=Q2({__proto__:null,default:Wi},[Wi]);const Tn=(function(){var t={nextZero(d,u){for(;d[u]!=0;)u++;return u},readUshort:(d,u)=>d[u]<<8|d[u+1],writeUshort(d,u,f){d[u]=f>>8&255,d[u+1]=255&f},readUint:(d,u)=>16777216*d[u]+(d[u+1]<<16|d[u+2]<<8|d[u+3]),writeUint(d,u,f){d[u]=f>>24&255,d[u+1]=f>>16&255,d[u+2]=f>>8&255,d[u+3]=255&f},readASCII(d,u,f){let g="";for(let m=0;m<f;m++)g+=String.fromCharCode(d[u+m]);return g},writeASCII(d,u,f){for(let g=0;g<f.length;g++)d[u+g]=f.charCodeAt(g)},readBytes(d,u,f){const g=[];for(let m=0;m<f;m++)g.push(d[u+m]);return g},pad:d=>d.length<2?`0${d}`:d,readUTF8(d,u,f){let g,m="";for(let p=0;p<f;p++)m+=`%${t.pad(d[u+p].toString(16))}`;try{g=decodeURIComponent(m)}catch{return t.readASCII(d,u,f)}return g}};function e(d,u,f,g){const m=u*f,p=o(g),y=Math.ceil(u*p/8),b=new Uint8Array(4*m),_=new Uint32Array(b.buffer),{ctype:x}=g,{depth:E}=g,S=t.readUshort;if(x==6){const H=m<<2;if(E==8)for(var w=0;w<H;w+=4)b[w]=d[w],b[w+1]=d[w+1],b[w+2]=d[w+2],b[w+3]=d[w+3];if(E==16)for(w=0;w<H;w++)b[w]=d[w<<1]}else if(x==2){const H=g.tabs.tRNS;if(H==null){if(E==8)for(w=0;w<m;w++){var N=3*w;_[w]=255<<24|d[N+2]<<16|d[N+1]<<8|d[N]}if(E==16)for(w=0;w<m;w++)N=6*w,_[w]=255<<24|d[N+4]<<16|d[N+2]<<8|d[N]}else{var C=H[0];const W=H[1],j=H[2];if(E==8)for(w=0;w<m;w++){var k=w<<2;N=3*w,_[w]=255<<24|d[N+2]<<16|d[N+1]<<8|d[N],d[N]==C&&d[N+1]==W&&d[N+2]==j&&(b[k+3]=0)}if(E==16)for(w=0;w<m;w++)k=w<<2,N=6*w,_[w]=255<<24|d[N+4]<<16|d[N+2]<<8|d[N],S(d,N)==C&&S(d,N+2)==W&&S(d,N+4)==j&&(b[k+3]=0)}}else if(x==3){const H=g.tabs.PLTE,W=g.tabs.tRNS,j=W?W.length:0;if(E==1)for(var M=0;M<f;M++){var T=M*y,L=M*u;for(w=0;w<u;w++){k=L+w<<2;var P=3*(F=d[T+(w>>3)]>>7-((7&w)<<0)&1);b[k]=H[P],b[k+1]=H[P+1],b[k+2]=H[P+2],b[k+3]=F<j?W[F]:255}}if(E==2)for(M=0;M<f;M++)for(T=M*y,L=M*u,w=0;w<u;w++)k=L+w<<2,P=3*(F=d[T+(w>>2)]>>6-((3&w)<<1)&3),b[k]=H[P],b[k+1]=H[P+1],b[k+2]=H[P+2],b[k+3]=F<j?W[F]:255;if(E==4)for(M=0;M<f;M++)for(T=M*y,L=M*u,w=0;w<u;w++)k=L+w<<2,P=3*(F=d[T+(w>>1)]>>4-((1&w)<<2)&15),b[k]=H[P],b[k+1]=H[P+1],b[k+2]=H[P+2],b[k+3]=F<j?W[F]:255;if(E==8)for(w=0;w<m;w++){var F;k=w<<2,P=3*(F=d[w]),b[k]=H[P],b[k+1]=H[P+1],b[k+2]=H[P+2],b[k+3]=F<j?W[F]:255}}else if(x==4){if(E==8)for(w=0;w<m;w++){k=w<<2;var D=d[A=w<<1];b[k]=D,b[k+1]=D,b[k+2]=D,b[k+3]=d[A+1]}if(E==16)for(w=0;w<m;w++){var A;k=w<<2,D=d[A=w<<2],b[k]=D,b[k+1]=D,b[k+2]=D,b[k+3]=d[A+2]}}else if(x==0)for(C=g.tabs.tRNS?g.tabs.tRNS:-1,M=0;M<f;M++){const H=M*y,W=M*u;if(E==1)for(var O=0;O<u;O++){var V=(D=255*(d[H+(O>>>3)]>>>7-(7&O)&1))==255*C?0:255;_[W+O]=V<<24|D<<16|D<<8|D}else if(E==2)for(O=0;O<u;O++)V=(D=85*(d[H+(O>>>2)]>>>6-((3&O)<<1)&3))==85*C?0:255,_[W+O]=V<<24|D<<16|D<<8|D;else if(E==4)for(O=0;O<u;O++)V=(D=17*(d[H+(O>>>1)]>>>4-((1&O)<<2)&15))==17*C?0:255,_[W+O]=V<<24|D<<16|D<<8|D;else if(E==8)for(O=0;O<u;O++)V=(D=d[H+O])==C?0:255,_[W+O]=V<<24|D<<16|D<<8|D;else if(E==16)for(O=0;O<u;O++)D=d[H+(O<<1)],V=S(d,H+(O<<1))==C?0:255,_[W+O]=V<<24|D<<16|D<<8|D}return b}function n(d,u,f,g){const m=o(d),p=Math.ceil(f*m/8),y=new Uint8Array((p+1+d.interlace)*g);return u=d.tabs.CgBI?s(u,y):r(u,y),d.interlace==0?u=i(u,d,0,f,g):d.interlace==1&&(u=(function(_,x){const E=x.width,S=x.height,w=o(x),N=w>>3,C=Math.ceil(E*w/8),k=new Uint8Array(S*C);let M=0;const T=[0,0,4,0,2,0,1],L=[0,4,0,2,0,1,0],P=[8,8,8,4,4,2,2],F=[8,8,4,4,2,2,1];let D=0;for(;D<7;){const O=P[D],V=F[D];let H=0,W=0,j=T[D];for(;j<S;)j+=O,W++;let U=L[D];for(;U<E;)U+=V,H++;const B=Math.ceil(H*w/8);i(_,x,M,H,W);let G=0,z=T[D];for(;z<S;){let X=L[D],Y=M+G*B<<3;for(;X<E;){var A;if(w==1&&(A=(A=_[Y>>3])>>7-(7&Y)&1,k[z*C+(X>>3)]|=A<<7-((7&X)<<0)),w==2&&(A=(A=_[Y>>3])>>6-(7&Y)&3,k[z*C+(X>>2)]|=A<<6-((3&X)<<1)),w==4&&(A=(A=_[Y>>3])>>4-(7&Y)&15,k[z*C+(X>>1)]|=A<<4-((1&X)<<2)),w>=8){const Z=z*C+X*N;for(let ee=0;ee<N;ee++)k[Z+ee]=_[(Y>>3)+ee]}Y+=w,X+=V}G++,z+=O}H*W!=0&&(M+=W*(1+B)),D+=1}return k})(u,d)),u}function r(d,u){return s(new Uint8Array(d.buffer,2,d.length-6),u)}var s=(function(){const d={H:{}};return d.H.N=function(u,f){const g=Uint8Array;let m,p,y=0,b=0,_=0,x=0,E=0,S=0,w=0,N=0,C=0;if(u[0]==3&&u[1]==0)return f||new g(0);const k=d.H,M=k.b,T=k.e,L=k.R,P=k.n,F=k.A,D=k.Z,A=k.m,O=f==null;for(O&&(f=new g(u.length>>>2<<5));y==0;)if(y=M(u,C,1),b=M(u,C+1,2),C+=3,b!=0){if(O&&(f=d.H.W(f,N+(1<<17))),b==1&&(m=A.J,p=A.h,S=511,w=31),b==2){_=T(u,C,5)+257,x=T(u,C+5,5)+1,E=T(u,C+10,4)+4,C+=14;let H=1;for(var V=0;V<38;V+=2)A.Q[V]=0,A.Q[V+1]=0;for(V=0;V<E;V++){const U=T(u,C+3*V,3);A.Q[1+(A.X[V]<<1)]=U,U>H&&(H=U)}C+=3*E,P(A.Q,H),F(A.Q,H,A.u),m=A.w,p=A.d,C=L(A.u,(1<<H)-1,_+x,u,C,A.v);const W=k.V(A.v,0,_,A.C);S=(1<<W)-1;const j=k.V(A.v,_,x,A.D);w=(1<<j)-1,P(A.C,W),F(A.C,W,m),P(A.D,j),F(A.D,j,p)}for(;;){const H=m[D(u,C)&S];C+=15&H;const W=H>>>4;if(!(W>>>8))f[N++]=W;else{if(W==256)break;{let j=N+W-254;if(W>264){const X=A.q[W-257];j=N+(X>>>3)+T(u,C,7&X),C+=7&X}const U=p[D(u,C)&w];C+=15&U;const B=U>>>4,G=A.c[B],z=(G>>>4)+M(u,C,15&G);for(C+=15&G;N<j;)f[N]=f[N++-z],f[N]=f[N++-z],f[N]=f[N++-z],f[N]=f[N++-z];N=j}}}}else{(7&C)!=0&&(C+=8-(7&C));const H=4+(C>>>3),W=u[H-4]|u[H-3]<<8;O&&(f=d.H.W(f,N+W)),f.set(new g(u.buffer,u.byteOffset+H,W),N),C=H+W<<3,N+=W}return f.length==N?f:f.slice(0,N)},d.H.W=function(u,f){const g=u.length;if(f<=g)return u;const m=new Uint8Array(g<<1);return m.set(u,0),m},d.H.R=function(u,f,g,m,p,y){const b=d.H.e,_=d.H.Z;let x=0;for(;x<g;){const E=u[_(m,p)&f];p+=15&E;const S=E>>>4;if(S<=15)y[x]=S,x++;else{let w=0,N=0;S==16?(N=3+b(m,p,2),p+=2,w=y[x-1]):S==17?(N=3+b(m,p,3),p+=3):S==18&&(N=11+b(m,p,7),p+=7);const C=x+N;for(;x<C;)y[x]=w,x++}}return p},d.H.V=function(u,f,g,m){let p=0,y=0;const b=m.length>>>1;for(;y<g;){const _=u[y+f];m[y<<1]=0,m[1+(y<<1)]=_,_>p&&(p=_),y++}for(;y<b;)m[y<<1]=0,m[1+(y<<1)]=0,y++;return p},d.H.n=function(u,f){const g=d.H.m,m=u.length;let p,y,b,_;const x=g.j;for(var E=0;E<=f;E++)x[E]=0;for(E=1;E<m;E+=2)x[u[E]]++;const S=g.K;for(p=0,x[0]=0,y=1;y<=f;y++)p=p+x[y-1]<<1,S[y]=p;for(b=0;b<m;b+=2)_=u[b+1],_!=0&&(u[b]=S[_],S[_]++)},d.H.A=function(u,f,g){const m=u.length,p=d.H.m.r;for(let y=0;y<m;y+=2)if(u[y+1]!=0){const b=y>>1,_=u[y+1],x=b<<4|_,E=f-_;let S=u[y]<<E;const w=S+(1<<E);for(;S!=w;)g[p[S]>>>15-f]=x,S++}},d.H.l=function(u,f){const g=d.H.m.r,m=15-f;for(let p=0;p<u.length;p+=2){const y=u[p]<<f-u[p+1];u[p]=g[y]>>>m}},d.H.M=function(u,f,g){g<<=7&f;const m=f>>>3;u[m]|=g,u[m+1]|=g>>>8},d.H.I=function(u,f,g){g<<=7&f;const m=f>>>3;u[m]|=g,u[m+1]|=g>>>8,u[m+2]|=g>>>16},d.H.e=function(u,f,g){return(u[f>>>3]|u[1+(f>>>3)]<<8)>>>(7&f)&(1<<g)-1},d.H.b=function(u,f,g){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16)>>>(7&f)&(1<<g)-1},d.H.Z=function(u,f){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16)>>>(7&f)},d.H.i=function(u,f){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16|u[3+(f>>>3)]<<24)>>>(7&f)},d.H.m=(function(){const u=Uint16Array,f=Uint32Array;return{K:new u(16),j:new u(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 u(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 f(32),J:new u(512),_:[],h:new u(32),$:[],w:new u(32768),C:[],v:[],d:new u(32768),D:[],u:new u(512),Q:[],r:new u(32768),s:new f(286),Y:new f(30),a:new f(19),t:new f(15e3),k:new u(65536),g:new u(32768)}})(),(function(){const u=d.H.m;for(var f=0;f<32768;f++){let m=f;m=(2863311530&m)>>>1|(1431655765&m)<<1,m=(3435973836&m)>>>2|(858993459&m)<<2,m=(4042322160&m)>>>4|(252645135&m)<<4,m=(4278255360&m)>>>8|(16711935&m)<<8,u.r[f]=(m>>>16|m<<16)>>>17}function g(m,p,y){for(;p--!=0;)m.push(0,y)}for(f=0;f<32;f++)u.q[f]=u.S[f]<<3|u.T[f],u.c[f]=u.p[f]<<4|u.z[f];g(u._,144,8),g(u._,112,9),g(u._,24,7),g(u._,8,8),d.H.n(u._,9),d.H.A(u._,9,u.J),d.H.l(u._,9),g(u.$,32,5),d.H.n(u.$,5),d.H.A(u.$,5,u.h),d.H.l(u.$,5),g(u.Q,19,0),g(u.C,286,0),g(u.D,30,0),g(u.v,320,0)})(),d.H.N})();function o(d){return[1,null,3,1,2,null,4][d.ctype]*d.depth}function i(d,u,f,g,m){let p=o(u);const y=Math.ceil(g*p/8);let b,_;p=Math.ceil(p/8);let x=d[f],E=0;if(x>1&&(d[f]=[0,0,1][x-2]),x==3)for(E=p;E<y;E++)d[E+1]=d[E+1]+(d[E+1-p]>>>1)&255;for(let S=0;S<m;S++)if(b=f+S*y,_=b+S+1,x=d[_-1],E=0,x==0)for(;E<y;E++)d[b+E]=d[_+E];else if(x==1){for(;E<p;E++)d[b+E]=d[_+E];for(;E<y;E++)d[b+E]=d[_+E]+d[b+E-p]}else if(x==2)for(;E<y;E++)d[b+E]=d[_+E]+d[b+E-y];else if(x==3){for(;E<p;E++)d[b+E]=d[_+E]+(d[b+E-y]>>>1);for(;E<y;E++)d[b+E]=d[_+E]+(d[b+E-y]+d[b+E-p]>>>1)}else{for(;E<p;E++)d[b+E]=d[_+E]+a(0,d[b+E-y],0);for(;E<y;E++)d[b+E]=d[_+E]+a(d[b+E-p],d[b+E-y],d[b+E-p-y])}return d}function a(d,u,f){const g=d+u-f,m=g-d,p=g-u,y=g-f;return m*m<=p*p&&m*m<=y*y?d:p*p<=y*y?u:f}function l(d,u,f){f.width=t.readUint(d,u),u+=4,f.height=t.readUint(d,u),u+=4,f.depth=d[u],u++,f.ctype=d[u],u++,f.compress=d[u],u++,f.filter=d[u],u++,f.interlace=d[u],u++}function c(d,u,f,g,m,p,y,b,_){const x=Math.min(u,m),E=Math.min(f,p);let S=0,w=0;for(let D=0;D<E;D++)for(let A=0;A<x;A++)if(y>=0&&b>=0?(S=D*u+A<<2,w=(b+D)*m+y+A<<2):(S=(-b+D)*u-y+A<<2,w=D*m+A<<2),_==0)g[w]=d[S],g[w+1]=d[S+1],g[w+2]=d[S+2],g[w+3]=d[S+3];else if(_==1){var N=d[S+3]*.00392156862745098,C=d[S]*N,k=d[S+1]*N,M=d[S+2]*N,T=g[w+3]*(1/255),L=g[w]*T,P=g[w+1]*T,F=g[w+2]*T;const O=1-N,V=N+T*O,H=V==0?0:1/V;g[w+3]=255*V,g[w+0]=(C+L*O)*H,g[w+1]=(k+P*O)*H,g[w+2]=(M+F*O)*H}else if(_==2)N=d[S+3],C=d[S],k=d[S+1],M=d[S+2],T=g[w+3],L=g[w],P=g[w+1],F=g[w+2],N==T&&C==L&&k==P&&M==F?(g[w]=0,g[w+1]=0,g[w+2]=0,g[w+3]=0):(g[w]=C,g[w+1]=k,g[w+2]=M,g[w+3]=N);else if(_==3){if(N=d[S+3],C=d[S],k=d[S+1],M=d[S+2],T=g[w+3],L=g[w],P=g[w+1],F=g[w+2],N==T&&C==L&&k==P&&M==F)continue;if(N<220&&T>20)return!1}return!0}return{decode:function(u){const f=new Uint8Array(u);let g=8;const m=t,p=m.readUshort,y=m.readUint,b={tabs:{},frames:[]},_=new Uint8Array(f.length);let x,E=0,S=0;const w=[137,80,78,71,13,10,26,10];for(var N=0;N<8;N++)if(f[N]!=w[N])throw"The input is not a PNG file!";for(;g<f.length;){const D=m.readUint(f,g);g+=4;const A=m.readASCII(f,g,4);if(g+=4,A=="IHDR")l(f,g,b);else if(A=="iCCP"){for(var C=g;f[C]!=0;)C++;m.readASCII(f,g,C-g),f[C+1];const O=f.slice(C+2,g+D);let V=null;try{V=r(O)}catch{V=s(O)}b.tabs[A]=V}else if(A=="CgBI")b.tabs[A]=f.slice(g,g+4);else if(A=="IDAT"){for(N=0;N<D;N++)_[E+N]=f[g+N];E+=D}else if(A=="acTL")b.tabs[A]={num_frames:y(f,g),num_plays:y(f,g+4)},x=new Uint8Array(f.length);else if(A=="fcTL"){S!=0&&((F=b.frames[b.frames.length-1]).data=n(b,x.slice(0,S),F.rect.width,F.rect.height),S=0);const O={x:y(f,g+12),y:y(f,g+16),width:y(f,g+4),height:y(f,g+8)};let V=p(f,g+22);V=p(f,g+20)/(V==0?100:V);const H={rect:O,delay:Math.round(1e3*V),dispose:f[g+24],blend:f[g+25]};b.frames.push(H)}else if(A=="fdAT"){for(N=0;N<D-4;N++)x[S+N]=f[g+N+4];S+=D-4}else if(A=="pHYs")b.tabs[A]=[m.readUint(f,g),m.readUint(f,g+4),f[g+8]];else if(A=="cHRM")for(b.tabs[A]=[],N=0;N<8;N++)b.tabs[A].push(m.readUint(f,g+4*N));else if(A=="tEXt"||A=="zTXt"){b.tabs[A]==null&&(b.tabs[A]={});var k=m.nextZero(f,g),M=m.readASCII(f,g,k-g),T=g+D-k-1;if(A=="tEXt")P=m.readASCII(f,k+1,T);else{var L=r(f.slice(k+2,k+2+T));P=m.readUTF8(L,0,L.length)}b.tabs[A][M]=P}else if(A=="iTXt"){b.tabs[A]==null&&(b.tabs[A]={}),k=0,C=g,k=m.nextZero(f,C),M=m.readASCII(f,C,k-C);const O=f[C=k+1];var P;f[C+1],C+=2,k=m.nextZero(f,C),m.readASCII(f,C,k-C),C=k+1,k=m.nextZero(f,C),m.readUTF8(f,C,k-C),T=D-((C=k+1)-g),O==0?P=m.readUTF8(f,C,T):(L=r(f.slice(C,C+T)),P=m.readUTF8(L,0,L.length)),b.tabs[A][M]=P}else if(A=="PLTE")b.tabs[A]=m.readBytes(f,g,D);else if(A=="hIST"){const O=b.tabs.PLTE.length/3;for(b.tabs[A]=[],N=0;N<O;N++)b.tabs[A].push(p(f,g+2*N))}else if(A=="tRNS")b.ctype==3?b.tabs[A]=m.readBytes(f,g,D):b.ctype==0?b.tabs[A]=p(f,g):b.ctype==2&&(b.tabs[A]=[p(f,g),p(f,g+2),p(f,g+4)]);else if(A=="gAMA")b.tabs[A]=m.readUint(f,g)/1e5;else if(A=="sRGB")b.tabs[A]=f[g];else if(A=="bKGD")b.ctype==0||b.ctype==4?b.tabs[A]=[p(f,g)]:b.ctype==2||b.ctype==6?b.tabs[A]=[p(f,g),p(f,g+2),p(f,g+4)]:b.ctype==3&&(b.tabs[A]=f[g]);else if(A=="IEND")break;g+=D,m.readUint(f,g),g+=4}var F;return S!=0&&((F=b.frames[b.frames.length-1]).data=n(b,x.slice(0,S),F.rect.width,F.rect.height)),b.data=n(b,_,b.width,b.height),delete b.compress,delete b.interlace,delete b.filter,b},toRGBA8:function(u){const f=u.width,g=u.height;if(u.tabs.acTL==null)return[e(u.data,f,g,u).buffer];const m=[];u.frames[0].data==null&&(u.frames[0].data=u.data);const p=f*g*4,y=new Uint8Array(p),b=new Uint8Array(p),_=new Uint8Array(p);for(let E=0;E<u.frames.length;E++){const S=u.frames[E],w=S.rect.x,N=S.rect.y,C=S.rect.width,k=S.rect.height,M=e(S.data,C,k,u);if(E!=0)for(var x=0;x<p;x++)_[x]=y[x];if(S.blend==0?c(M,C,k,y,f,g,w,N,0):S.blend==1&&c(M,C,k,y,f,g,w,N,1),m.push(y.buffer.slice(0)),S.dispose!=0){if(S.dispose==1)c(b,C,k,y,f,g,w,N,0);else if(S.dispose==2)for(x=0;x<p;x++)y[x]=_[x]}}return m},_paeth:a,_copyTile:c,_bin:t}})();(function(){const{_copyTile:t}=Tn,{_bin:e}=Tn,n=Tn._paeth;var r={table:(function(){const C=new Uint32Array(256);for(let k=0;k<256;k++){let M=k;for(let T=0;T<8;T++)1&M?M=3988292384^M>>>1:M>>>=1;C[k]=M}return C})(),update(C,k,M,T){for(let L=0;L<T;L++)C=r.table[255&(C^k[M+L])]^C>>>8;return C},crc:(C,k,M)=>4294967295^r.update(4294967295,C,k,M)};function s(C,k,M,T){k[M]+=C[0]*T>>4,k[M+1]+=C[1]*T>>4,k[M+2]+=C[2]*T>>4,k[M+3]+=C[3]*T>>4}function o(C){return Math.max(0,Math.min(255,C))}function i(C,k){const M=C[0]-k[0],T=C[1]-k[1],L=C[2]-k[2],P=C[3]-k[3];return M*M+T*T+L*L+P*P}function a(C,k,M,T,L,P,F){F==null&&(F=1);const D=T.length,A=[];for(var O=0;O<D;O++){const z=T[O];A.push([z>>>0&255,z>>>8&255,z>>>16&255,z>>>24&255])}for(O=0;O<D;O++){let z=4294967295;for(var V=0,H=0;H<D;H++){var W=i(A[O],A[H]);H!=O&&W<z&&(z=W,V=H)}}const j=new Uint32Array(L.buffer),U=new Int16Array(k*M*4),B=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(O=0;O<B.length;O++)B[O]=255*((B[O]+.5)/16-.5);for(let z=0;z<M;z++)for(let X=0;X<k;X++){var G;O=4*(z*k+X),F!=2?G=[o(C[O]+U[O]),o(C[O+1]+U[O+1]),o(C[O+2]+U[O+2]),o(C[O+3]+U[O+3])]:(W=B[4*(3&z)+(3&X)],G=[o(C[O]+W),o(C[O+1]+W),o(C[O+2]+W),o(C[O+3]+W)]),V=0;let Y=16777215;for(H=0;H<D;H++){const te=i(G,A[H]);te<Y&&(Y=te,V=H)}const Z=A[V],ee=[G[0]-Z[0],G[1]-Z[1],G[2]-Z[2],G[3]-Z[3]];F==1&&(X!=k-1&&s(ee,U,O+4,7),z!=M-1&&(X!=0&&s(ee,U,O+4*k-4,3),s(ee,U,O+4*k,5),X!=k-1&&s(ee,U,O+4*k+4,1))),P[O>>2]=V,j[O>>2]=T[V]}}function l(C,k,M,T,L){L==null&&(L={});const{crc:P}=r,F=e.writeUint,D=e.writeUshort,A=e.writeASCII;let O=8;const V=C.frames.length>1;let H,W=!1,j=33+(V?20:0);if(L.sRGB!=null&&(j+=13),L.pHYs!=null&&(j+=21),L.iCCP!=null&&(H=pako.deflate(L.iCCP),j+=21+H.length+4),C.ctype==3){for(var U=C.plte.length,B=0;B<U;B++)C.plte[B]>>>24!=255&&(W=!0);j+=8+3*U+4+(W?8+1*U+4:0)}for(var G=0;G<C.frames.length;G++)V&&(j+=38),j+=(Z=C.frames[G]).cimg.length+12,G!=0&&(j+=4);j+=12;const z=new Uint8Array(j),X=[137,80,78,71,13,10,26,10];for(B=0;B<8;B++)z[B]=X[B];if(F(z,O,13),O+=4,A(z,O,"IHDR"),O+=4,F(z,O,k),O+=4,F(z,O,M),O+=4,z[O]=C.depth,O++,z[O]=C.ctype,O++,z[O]=0,O++,z[O]=0,O++,z[O]=0,O++,F(z,O,P(z,O-17,17)),O+=4,L.sRGB!=null&&(F(z,O,1),O+=4,A(z,O,"sRGB"),O+=4,z[O]=L.sRGB,O++,F(z,O,P(z,O-5,5)),O+=4),L.iCCP!=null){const ee=13+H.length;F(z,O,ee),O+=4,A(z,O,"iCCP"),O+=4,A(z,O,"ICC profile"),O+=11,O+=2,z.set(H,O),O+=H.length,F(z,O,P(z,O-(ee+4),ee+4)),O+=4}if(L.pHYs!=null&&(F(z,O,9),O+=4,A(z,O,"pHYs"),O+=4,F(z,O,L.pHYs[0]),O+=4,F(z,O,L.pHYs[1]),O+=4,z[O]=L.pHYs[2],O++,F(z,O,P(z,O-13,13)),O+=4),V&&(F(z,O,8),O+=4,A(z,O,"acTL"),O+=4,F(z,O,C.frames.length),O+=4,F(z,O,L.loop!=null?L.loop:0),O+=4,F(z,O,P(z,O-12,12)),O+=4),C.ctype==3){for(F(z,O,3*(U=C.plte.length)),O+=4,A(z,O,"PLTE"),O+=4,B=0;B<U;B++){const ee=3*B,te=C.plte[B],ce=255&te,J=te>>>8&255,he=te>>>16&255;z[O+ee+0]=ce,z[O+ee+1]=J,z[O+ee+2]=he}if(O+=3*U,F(z,O,P(z,O-3*U-4,3*U+4)),O+=4,W){for(F(z,O,U),O+=4,A(z,O,"tRNS"),O+=4,B=0;B<U;B++)z[O+B]=C.plte[B]>>>24&255;O+=U,F(z,O,P(z,O-U-4,U+4)),O+=4}}let Y=0;for(G=0;G<C.frames.length;G++){var Z=C.frames[G];V&&(F(z,O,26),O+=4,A(z,O,"fcTL"),O+=4,F(z,O,Y++),O+=4,F(z,O,Z.rect.width),O+=4,F(z,O,Z.rect.height),O+=4,F(z,O,Z.rect.x),O+=4,F(z,O,Z.rect.y),O+=4,D(z,O,T[G]),O+=2,D(z,O,1e3),O+=2,z[O]=Z.dispose,O++,z[O]=Z.blend,O++,F(z,O,P(z,O-30,30)),O+=4);const ee=Z.cimg;F(z,O,(U=ee.length)+(G==0?0:4)),O+=4;const te=O;A(z,O,G==0?"IDAT":"fdAT"),O+=4,G!=0&&(F(z,O,Y++),O+=4),z.set(ee,O),O+=U,F(z,O,P(z,te,O-te)),O+=4}return F(z,O,0),O+=4,A(z,O,"IEND"),O+=4,F(z,O,P(z,O-4,4)),O+=4,z.buffer}function c(C,k,M){for(let T=0;T<C.frames.length;T++){const L=C.frames[T];L.rect.width;const P=L.rect.height,F=new Uint8Array(P*L.bpl+P);L.cimg=g(L.img,P,L.bpp,L.bpl,F,k,M)}}function d(C,k,M,T,L){const P=L[0],F=L[1],D=L[2],A=L[3],O=L[4],V=L[5];let H=6,W=8,j=255;for(var U=0;U<C.length;U++){const Se=new Uint8Array(C[U]);for(var B=Se.length,G=0;G<B;G+=4)j&=Se[G+3]}const z=j!=255,X=(function(ue,pe,we,He,se,Oe){const Le=[];for(var Ie=0;Ie<ue.length;Ie++){const Be=new Uint8Array(ue[Ie]),ne=new Uint32Array(Be.buffer);var Ue;let fe=0,xe=0,ge=pe,be=we,Ve=He?1:0;if(Ie!=0){const De=Oe||He||Ie==1||Le[Ie-2].dispose!=0?1:2;let $e=0,Me=1e9;for(let qe=0;qe<De;qe++){var et=new Uint8Array(ue[Ie-1-qe]);const ot=new Uint32Array(ue[Ie-1-qe]);let ye=pe,Ce=we,Fe=-1,nt=-1;for(let it=0;it<we;it++)for(let rt=0;rt<pe;rt++)ne[Ge=it*pe+rt]!=ot[Ge]&&(rt<ye&&(ye=rt),rt>Fe&&(Fe=rt),it<Ce&&(Ce=it),it>nt&&(nt=it));Fe==-1&&(ye=Ce=Fe=nt=0),se&&((1&ye)==1&&ye--,(1&Ce)==1&&Ce--);const pt=(Fe-ye+1)*(nt-Ce+1);pt<Me&&(Me=pt,$e=qe,fe=ye,xe=Ce,ge=Fe-ye+1,be=nt-Ce+1)}et=new Uint8Array(ue[Ie-1-$e]),$e==1&&(Le[Ie-1].dispose=2),Ue=new Uint8Array(ge*be*4),t(et,pe,we,Ue,ge,be,-fe,-xe,0),Ve=t(Be,pe,we,Ue,ge,be,-fe,-xe,3)?1:0,Ve==1?f(Be,pe,we,Ue,{x:fe,y:xe,width:ge,height:be}):t(Be,pe,we,Ue,ge,be,-fe,-xe,0)}else Ue=Be.slice(0);Le.push({rect:{x:fe,y:xe,width:ge,height:be},img:Ue,blend:Ve,dispose:0})}if(He)for(Ie=0;Ie<Le.length;Ie++){if((ft=Le[Ie]).blend==1)continue;const Be=ft.rect,ne=Le[Ie-1].rect,fe=Math.min(Be.x,ne.x),xe=Math.min(Be.y,ne.y),ge={x:fe,y:xe,width:Math.max(Be.x+Be.width,ne.x+ne.width)-fe,height:Math.max(Be.y+Be.height,ne.y+ne.height)-xe};Le[Ie-1].dispose=1,Ie-1!=0&&u(ue,pe,we,Le,Ie-1,ge,se),u(ue,pe,we,Le,Ie,ge,se)}let bt=0;if(ue.length!=1)for(var Ge=0;Ge<Le.length;Ge++){var ft;bt+=(ft=Le[Ge]).rect.width*ft.rect.height}return Le})(C,k,M,P,F,D),Y={},Z=[],ee=[];if(T!=0){const Se=[];for(G=0;G<X.length;G++)Se.push(X[G].img.buffer);const ue=(function(se){let Oe=0;for(var Le=0;Le<se.length;Le++)Oe+=se[Le].byteLength;const Ie=new Uint8Array(Oe);let Ue=0;for(Le=0;Le<se.length;Le++){const et=new Uint8Array(se[Le]),bt=et.length;for(let Ge=0;Ge<bt;Ge+=4){let ft=et[Ge],Be=et[Ge+1],ne=et[Ge+2];const fe=et[Ge+3];fe==0&&(ft=Be=ne=0),Ie[Ue+Ge]=ft,Ie[Ue+Ge+1]=Be,Ie[Ue+Ge+2]=ne,Ie[Ue+Ge+3]=fe}Ue+=bt}return Ie.buffer})(Se),pe=p(ue,T);for(G=0;G<pe.plte.length;G++)Z.push(pe.plte[G].est.rgba);let we=0;for(G=0;G<X.length;G++){const He=(ce=X[G]).img.length;var te=new Uint8Array(pe.inds.buffer,we>>2,He>>2);ee.push(te);const se=new Uint8Array(pe.abuf,we,He);V&&a(ce.img,ce.rect.width,ce.rect.height,Z,se,te),ce.img.set(se),we+=He}}else for(U=0;U<X.length;U++){var ce=X[U];const Se=new Uint32Array(ce.img.buffer);var J=ce.rect.width;for(B=Se.length,te=new Uint8Array(B),ee.push(te),G=0;G<B;G++){const ue=Se[G];if(G!=0&&ue==Se[G-1])te[G]=te[G-1];else if(G>J&&ue==Se[G-J])te[G]=te[G-J];else{let pe=Y[ue];if(pe==null&&(Y[ue]=pe=Z.length,Z.push(ue),Z.length>=300))break;te[G]=pe}}}const he=Z.length;for(he<=256&&O==0&&(W=he<=2?1:he<=4?2:he<=16?4:8,W=Math.max(W,A)),U=0;U<X.length;U++){(ce=X[U]).rect.x,ce.rect.y,J=ce.rect.width;const Se=ce.rect.height;let ue=ce.img;new Uint32Array(ue.buffer);let pe=4*J,we=4;if(he<=256&&O==0){pe=Math.ceil(W*J/8);var le=new Uint8Array(pe*Se);const He=ee[U];for(let se=0;se<Se;se++){G=se*pe;const Oe=se*J;if(W==8)for(var ae=0;ae<J;ae++)le[G+ae]=He[Oe+ae];else if(W==4)for(ae=0;ae<J;ae++)le[G+(ae>>1)]|=He[Oe+ae]<<4-4*(1&ae);else if(W==2)for(ae=0;ae<J;ae++)le[G+(ae>>2)]|=He[Oe+ae]<<6-2*(3&ae);else if(W==1)for(ae=0;ae<J;ae++)le[G+(ae>>3)]|=He[Oe+ae]<<7-1*(7&ae)}ue=le,H=3,we=1}else if(z==0&&X.length==1){le=new Uint8Array(J*Se*3);const He=J*Se;for(G=0;G<He;G++){const se=3*G,Oe=4*G;le[se]=ue[Oe],le[se+1]=ue[Oe+1],le[se+2]=ue[Oe+2]}ue=le,H=2,we=3,pe=3*J}ce.img=ue,ce.bpl=pe,ce.bpp=we}return{ctype:H,depth:W,plte:Z,frames:X}}function u(C,k,M,T,L,P,F){const D=Uint8Array,A=Uint32Array,O=new D(C[L-1]),V=new A(C[L-1]),H=L+1<C.length?new D(C[L+1]):null,W=new D(C[L]),j=new A(W.buffer);let U=k,B=M,G=-1,z=-1;for(let Y=0;Y<P.height;Y++)for(let Z=0;Z<P.width;Z++){const ee=P.x+Z,te=P.y+Y,ce=te*k+ee,J=j[ce];J==0||T[L-1].dispose==0&&V[ce]==J&&(H==null||H[4*ce+3]!=0)||(ee<U&&(U=ee),ee>G&&(G=ee),te<B&&(B=te),te>z&&(z=te))}G==-1&&(U=B=G=z=0),F&&((1&U)==1&&U--,(1&B)==1&&B--),P={x:U,y:B,width:G-U+1,height:z-B+1};const X=T[L];X.rect=P,X.blend=1,X.img=new Uint8Array(P.width*P.height*4),T[L-1].dispose==0?(t(O,k,M,X.img,P.width,P.height,-P.x,-P.y,0),f(W,k,M,X.img,P)):t(W,k,M,X.img,P.width,P.height,-P.x,-P.y,0)}function f(C,k,M,T,L){t(C,k,M,T,L.width,L.height,-L.x,-L.y,2)}function g(C,k,M,T,L,P,F){const D=[];let A,O=[0,1,2,3,4];P!=-1?O=[P]:(k*T>5e5||M==1)&&(O=[0]),F&&(A={level:0});const V=eE;for(var H=0;H<O.length;H++){for(let U=0;U<k;U++)m(L,C,U,T,M,O[H]);D.push(V.deflate(L,A))}let W,j=1e9;for(H=0;H<D.length;H++)D[H].length<j&&(W=H,j=D[H].length);return D[W]}function m(C,k,M,T,L,P){const F=M*T;let D=F+M;if(C[D]=P,D++,P==0)if(T<500)for(var A=0;A<T;A++)C[D+A]=k[F+A];else C.set(new Uint8Array(k.buffer,F,T),D);else if(P==1){for(A=0;A<L;A++)C[D+A]=k[F+A];for(A=L;A<T;A++)C[D+A]=k[F+A]-k[F+A-L]+256&255}else if(M==0){for(A=0;A<L;A++)C[D+A]=k[F+A];if(P==2)for(A=L;A<T;A++)C[D+A]=k[F+A];if(P==3)for(A=L;A<T;A++)C[D+A]=k[F+A]-(k[F+A-L]>>1)+256&255;if(P==4)for(A=L;A<T;A++)C[D+A]=k[F+A]-n(k[F+A-L],0,0)+256&255}else{if(P==2)for(A=0;A<T;A++)C[D+A]=k[F+A]+256-k[F+A-T]&255;if(P==3){for(A=0;A<L;A++)C[D+A]=k[F+A]+256-(k[F+A-T]>>1)&255;for(A=L;A<T;A++)C[D+A]=k[F+A]+256-(k[F+A-T]+k[F+A-L]>>1)&255}if(P==4){for(A=0;A<L;A++)C[D+A]=k[F+A]+256-n(0,k[F+A-T],0)&255;for(A=L;A<T;A++)C[D+A]=k[F+A]+256-n(k[F+A-L],k[F+A-T],k[F+A-L-T])&255}}}function p(C,k){const M=new Uint8Array(C),T=M.slice(0),L=new Uint32Array(T.buffer),P=y(T,k),F=P[0],D=P[1],A=M.length,O=new Uint8Array(A>>2);let V;if(M.length<2e7)for(var H=0;H<A;H+=4)V=b(F,W=M[H]*.00392156862745098,j=M[H+1]*.00392156862745098,U=M[H+2]*.00392156862745098,B=M[H+3]*.00392156862745098),O[H>>2]=V.ind,L[H>>2]=V.est.rgba;else for(H=0;H<A;H+=4){var W=M[H]*.00392156862745098,j=M[H+1]*(1/255),U=M[H+2]*(1/255),B=M[H+3]*(1/255);for(V=F;V.left;)V=_(V.est,W,j,U,B)<=0?V.left:V.right;O[H>>2]=V.ind,L[H>>2]=V.est.rgba}return{abuf:T.buffer,inds:O,plte:D}}function y(C,k,M){M==null&&(M=1e-4);const T=new Uint32Array(C.buffer),L={i0:0,i1:C.length,bst:null,est:null,tdst:0,left:null,right:null};L.bst=S(C,L.i0,L.i1),L.est=w(L.bst);const P=[L];for(;P.length<k;){let D=0,A=0;for(var F=0;F<P.length;F++)P[F].est.L>D&&(D=P[F].est.L,A=F);if(D<M)break;const O=P[A],V=x(C,T,O.i0,O.i1,O.est.e,O.est.eMq255);if(O.i0>=V||O.i1<=V){O.est.L=0;continue}const H={i0:O.i0,i1:V,bst:null,est:null,tdst:0,left:null,right:null};H.bst=S(C,H.i0,H.i1),H.est=w(H.bst);const W={i0:V,i1:O.i1,bst:null,est:null,tdst:0,left:null,right:null};for(W.bst={R:[],m:[],N:O.bst.N-H.bst.N},F=0;F<16;F++)W.bst.R[F]=O.bst.R[F]-H.bst.R[F];for(F=0;F<4;F++)W.bst.m[F]=O.bst.m[F]-H.bst.m[F];W.est=w(W.bst),O.left=H,O.right=W,P[A]=H,P.push(W)}for(P.sort(((D,A)=>A.bst.N-D.bst.N)),F=0;F<P.length;F++)P[F].ind=F;return[L,P]}function b(C,k,M,T,L){if(C.left==null)return C.tdst=(function(H,W,j,U,B){const G=W-H[0],z=j-H[1],X=U-H[2],Y=B-H[3];return G*G+z*z+X*X+Y*Y})(C.est.q,k,M,T,L),C;const P=_(C.est,k,M,T,L);let F=C.left,D=C.right;P>0&&(F=C.right,D=C.left);const A=b(F,k,M,T,L);if(A.tdst<=P*P)return A;const O=b(D,k,M,T,L);return O.tdst<A.tdst?O:A}function _(C,k,M,T,L){const{e:P}=C;return P[0]*k+P[1]*M+P[2]*T+P[3]*L-C.eMq}function x(C,k,M,T,L,P){for(T-=4;M<T;){for(;E(C,M,L)<=P;)M+=4;for(;E(C,T,L)>P;)T-=4;if(M>=T)break;const F=k[M>>2];k[M>>2]=k[T>>2],k[T>>2]=F,M+=4,T-=4}for(;E(C,M,L)>P;)M-=4;return M+4}function E(C,k,M){return C[k]*M[0]+C[k+1]*M[1]+C[k+2]*M[2]+C[k+3]*M[3]}function S(C,k,M){const T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],L=[0,0,0,0],P=M-k>>2;for(let F=k;F<M;F+=4){const D=C[F]*.00392156862745098,A=C[F+1]*(1/255),O=C[F+2]*(1/255),V=C[F+3]*(1/255);L[0]+=D,L[1]+=A,L[2]+=O,L[3]+=V,T[0]+=D*D,T[1]+=D*A,T[2]+=D*O,T[3]+=D*V,T[5]+=A*A,T[6]+=A*O,T[7]+=A*V,T[10]+=O*O,T[11]+=O*V,T[15]+=V*V}return T[4]=T[1],T[8]=T[2],T[9]=T[6],T[12]=T[3],T[13]=T[7],T[14]=T[11],{R:T,m:L,N:P}}function w(C){const{R:k}=C,{m:M}=C,{N:T}=C,L=M[0],P=M[1],F=M[2],D=M[3],A=T==0?0:1/T,O=[k[0]-L*L*A,k[1]-L*P*A,k[2]-L*F*A,k[3]-L*D*A,k[4]-P*L*A,k[5]-P*P*A,k[6]-P*F*A,k[7]-P*D*A,k[8]-F*L*A,k[9]-F*P*A,k[10]-F*F*A,k[11]-F*D*A,k[12]-D*L*A,k[13]-D*P*A,k[14]-D*F*A,k[15]-D*D*A],V=O,H=N;let W=[Math.random(),Math.random(),Math.random(),Math.random()],j=0,U=0;if(T!=0)for(let G=0;G<16&&(W=H.multVec(V,W),U=Math.sqrt(H.dot(W,W)),W=H.sml(1/U,W),!(G!=0&&Math.abs(U-j)<1e-9));G++)j=U;const B=[L*A,P*A,F*A,D*A];return{Cov:O,q:B,e:W,L:j,eMq255:H.dot(H.sml(255,B),W),eMq:H.dot(W,B),rgba:(Math.round(255*B[3])<<24|Math.round(255*B[2])<<16|Math.round(255*B[1])<<8|Math.round(255*B[0])<<0)>>>0}}var N={multVec:(C,k)=>[C[0]*k[0]+C[1]*k[1]+C[2]*k[2]+C[3]*k[3],C[4]*k[0]+C[5]*k[1]+C[6]*k[2]+C[7]*k[3],C[8]*k[0]+C[9]*k[1]+C[10]*k[2]+C[11]*k[3],C[12]*k[0]+C[13]*k[1]+C[14]*k[2]+C[15]*k[3]],dot:(C,k)=>C[0]*k[0]+C[1]*k[1]+C[2]*k[2]+C[3]*k[3],sml:(C,k)=>[C*k[0],C*k[1],C*k[2],C*k[3]]};Tn.encode=function(k,M,T,L,P,F,D){L==null&&(L=0),D==null&&(D=!1);const A=d(k,M,T,L,[!1,!1,!1,0,D,!1]);return c(A,-1),l(A,M,T,P,F)},Tn.encodeLL=function(k,M,T,L,P,F,D,A){const O={ctype:0+(L==1?0:2)+(P==0?0:4),depth:F,frames:[]},V=(L+P)*F,H=V*M;for(let W=0;W<k.length;W++)O.frames.push({rect:{x:0,y:0,width:M,height:T},img:new Uint8Array(k[W]),blend:0,dispose:1,bpp:Math.ceil(V/8),bpl:Math.ceil(H/8)});return c(O,0,!0),l(O,M,T,D,A)},Tn.encode.compress=d,Tn.encode.dither=a,Tn.quantize=p,Tn.quantize.getKDtree=y,Tn.quantize.getNearest=b})();const gp={toArrayBuffer(t,e){const n=t.width,r=t.height,s=n<<2,o=t.getContext("2d").getImageData(0,0,n,r),i=new Uint32Array(o.data.buffer),a=(32*n+31)/32<<2,l=a*r,c=122+l,d=new ArrayBuffer(c),u=new DataView(d),f=1<<20;let g,m,p,y,b=f,_=0,x=0,E=0;function S(C){u.setUint16(x,C,!0),x+=2}function w(C){u.setUint32(x,C,!0),x+=4}function N(C){x+=C}S(19778),w(c),N(4),w(122),w(108),w(n),w(-r>>>0),S(1),S(32),w(3),w(l),w(2835),w(2835),N(8),w(16711680),w(65280),w(255),w(4278190080),w(1466527264),(function C(){for(;_<r&&b>0;){for(y=122+_*a,g=0;g<s;)b--,m=i[E++],p=m>>>24,u.setUint32(y+g,m<<8|p),g+=4;_++}E<i.length?(b=f,setTimeout(C,gp._dly)):e(d)})()},toBlob(t,e){this.toArrayBuffer(t,(n=>{e(new Blob([n],{type:"image/bmp"}))}))},_dly:9};var tn={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},tE={[tn.CHROME]:16384,[tn.FIREFOX]:11180,[tn.DESKTOP_SAFARI]:16384,[tn.IE]:8192,[tn.IOS]:4096,[tn.ETC]:8192};const Ic=typeof window<"u",pp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Gi=Ic&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),nE=(Ic||pp)&&(Gi&&Gi.getOriginalSymbol(window,"File")||typeof File<"u"&&File),mp=(Ic||pp)&&(Gi&&Gi.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function Lc(t,e,n=Date.now()){return new Promise((r=>{const s=t.split(","),o=s[0].match(/:(.*?);/)[1],i=globalThis.atob(s[1]);let a=i.length;const l=new Uint8Array(a);for(;a--;)l[a]=i.charCodeAt(a);const c=new Blob([l],{type:o});c.name=e,c.lastModified=n,r(c)}))}function bp(t){return new Promise(((e,n)=>{const r=new mp;r.onload=()=>e(r.result),r.onerror=s=>n(s),r.readAsDataURL(t)}))}function yp(t){return new Promise(((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=s=>n(s),r.src=t}))}function Sr(){if(Sr.cachedResult!==void 0)return Sr.cachedResult;let t=tn.ETC;const{userAgent:e}=navigator;return/Chrom(e|ium)/i.test(e)?t=tn.CHROME:/iP(ad|od|hone)/i.test(e)&&/WebKit/i.test(e)?t=tn.IOS:/Safari/i.test(e)?t=tn.DESKTOP_SAFARI:/Firefox/i.test(e)?t=tn.FIREFOX:(/MSIE/i.test(e)||document.documentMode)&&(t=tn.IE),Sr.cachedResult=t,Sr.cachedResult}function vp(t,e){const n=Sr(),r=tE[n];let s=t,o=e,i=s*o;const a=s>o?o/s:s/o;for(;i>r*r;){const l=(r+s)/2,c=(r+o)/2;l<c?(o=c,s=c*a):(o=l*a,s=l),i=s*o}return{width:s,height:o}}function Yi(t,e){let n,r;try{if(n=new OffscreenCanvas(t,e),r=n.getContext("2d"),r===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{n=document.createElement("canvas"),r=n.getContext("2d")}return n.width=t,n.height=e,[n,r]}function xp(t,e){const{width:n,height:r}=vp(t.width,t.height),[s,o]=Yi(n,r);return e&&/jpe?g/.test(e)&&(o.fillStyle="white",o.fillRect(0,0,s.width,s.height)),o.drawImage(t,0,0,s.width,s.height),s}function Xi(){return Xi.cachedResult!==void 0||(Xi.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),Xi.cachedResult}function Ki(t,e={}){return new Promise((function(n,r){let s,o;var i=function(){try{return o=xp(s,e.fileType||t.type),n([s,o])}catch(l){return r(l)}},a=function(l){try{var c=function(d){try{throw d}catch(u){return r(u)}};try{let d;return bp(t).then((function(u){try{return d=u,yp(d).then((function(f){try{return s=f,(function(){try{return i()}catch(g){return r(g)}})()}catch(g){return c(g)}}),c)}catch(f){return c(f)}}),c)}catch(d){c(d)}}catch(d){return r(d)}};try{if(Xi()||[tn.DESKTOP_SAFARI,tn.MOBILE_SAFARI].includes(Sr()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(t).then((function(l){try{return s=l,i()}catch{return a()}}),a)}catch{a()}}))}function qi(t,e,n,r,s=1){return new Promise((function(o,i){let a;if(e==="image/png"){let c,d,u;return c=t.getContext("2d"),{data:d}=c.getImageData(0,0,t.width,t.height),u=Tn.encode([d.buffer],t.width,t.height,4096*s),a=new Blob([u],{type:e}),a.name=n,a.lastModified=r,l.call(this)}{let c=function(){return l.call(this)};if(e==="image/bmp")return new Promise((d=>gp.toBlob(t,d))).then(function(d){try{return a=d,a.name=n,a.lastModified=r,c.call(this)}catch(u){return i(u)}}.bind(this),i);{let d=function(){return c.call(this)};if(typeof OffscreenCanvas=="function"&&t instanceof OffscreenCanvas)return t.convertToBlob({type:e,quality:s}).then(function(u){try{return a=u,a.name=n,a.lastModified=r,d.call(this)}catch(f){return i(f)}}.bind(this),i);{let u;return u=t.toDataURL(e,s),Lc(u,n,r).then(function(f){try{return a=f,d.call(this)}catch(g){return i(g)}}.bind(this),i)}}}function l(){return o(a)}}))}function Vn(t){t.width=0,t.height=0}function us(){return new Promise((function(t,e){let n,r,s,o;return us.cachedResult!==void 0?t(us.cachedResult):Lc("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(i){try{return n=i,Ki(n).then((function(a){try{return r=a[1],qi(r,n.type,n.name,n.lastModified).then((function(l){try{return s=l,Vn(r),Ki(s).then((function(c){try{return o=c[0],us.cachedResult=o.width===1&&o.height===2,t(us.cachedResult)}catch(d){return e(d)}}),e)}catch(c){return e(c)}}),e)}catch(l){return e(l)}}),e)}catch(a){return e(a)}}),e)}))}function wp(t){return new Promise(((e,n)=>{const r=new mp;r.onload=s=>{const o=new DataView(s.target.result);if(o.getUint16(0,!1)!=65496)return e(-2);const i=o.byteLength;let a=2;for(;a<i;){if(o.getUint16(a+2,!1)<=8)return e(-1);const l=o.getUint16(a,!1);if(a+=2,l==65505){if(o.getUint32(a+=2,!1)!=1165519206)return e(-1);const c=o.getUint16(a+=6,!1)==18761;a+=o.getUint32(a+4,c);const d=o.getUint16(a,c);a+=2;for(let u=0;u<d;u++)if(o.getUint16(a+12*u,c)==274)return e(o.getUint16(a+12*u+8,c))}else{if((65280&l)!=65280)break;a+=o.getUint16(a,!1)}}return e(-1)},r.onerror=s=>n(s),r.readAsArrayBuffer(t)}))}function kp(t,e){const{width:n}=t,{height:r}=t,{maxWidthOrHeight:s}=e;let o,i=t;return isFinite(s)&&(n>s||r>s)&&([i,o]=Yi(n,r),n>r?(i.width=s,i.height=r/n*s):(i.width=n/r*s,i.height=s),o.drawImage(t,0,0,i.width,i.height),Vn(t)),i}function Cp(t,e){const{width:n}=t,{height:r}=t,[s,o]=Yi(n,r);switch(e>4&&e<9?(s.width=r,s.height=n):(s.width=n,s.height=r),e){case 2:o.transform(-1,0,0,1,n,0);break;case 3:o.transform(-1,0,0,-1,n,r);break;case 4:o.transform(1,0,0,-1,0,r);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,r,0);break;case 7:o.transform(0,-1,-1,0,r,n);break;case 8:o.transform(0,-1,1,0,0,n)}return o.drawImage(t,0,0,n,r),Vn(t),s}function Sp(t,e,n=0){return new Promise((function(r,s){let o,i,a,l,c,d,u,f,g,m,p,y,b,_,x,E,S,w,N,C;function k(T=5){if(e.signal&&e.signal.aborted)throw e.signal.reason;o+=T,e.onProgress(Math.min(o,100))}function M(T){if(e.signal&&e.signal.aborted)throw e.signal.reason;o=Math.min(Math.max(T,o),100),e.onProgress(o)}return o=n,i=e.maxIteration||10,a=1024*e.maxSizeMB*1024,k(),Ki(t,e).then(function(T){try{return[,l]=T,k(),c=kp(l,e),k(),new Promise((function(L,P){var F;if(!(F=e.exifOrientation))return wp(t).then(function(A){try{return F=A,D.call(this)}catch(O){return P(O)}}.bind(this),P);function D(){return L(F)}return D.call(this)})).then(function(L){try{return d=L,k(),us().then(function(P){try{return u=P?c:Cp(c,d),k(),f=e.initialQuality||1,g=e.fileType||t.type,qi(u,g,t.name,t.lastModified,f).then(function(F){try{{let A=function(){if(i--&&(x>a||x>b)){let V,H;return V=C?.95*N.width:N.width,H=C?.95*N.height:N.height,[S,w]=Yi(V,H),w.drawImage(N,0,0,V,H),f*=g==="image/png"?.85:.95,qi(S,g,t.name,t.lastModified,f).then((function(W){try{return E=W,Vn(N),N=S,x=E.size,M(Math.min(99,Math.floor((_-x)/(_-a)*100))),A}catch(j){return s(j)}}),s)}return[1]},O=function(){return Vn(N),Vn(S),Vn(c),Vn(u),Vn(l),M(100),r(E)};if(m=F,k(),p=m.size>a,y=m.size>t.size,!p&&!y)return M(100),r(m);var D;return b=t.size,_=m.size,x=_,N=u,C=!e.alwaysKeepResolution&&p,(D=function(V){for(;V;){if(V.then)return void V.then(D,s);try{if(V.pop){if(V.length)return V.pop()?O.call(this):V;V=A}else V=V.call(this)}catch(H){return s(H)}}}.bind(this))(A)}}catch(A){return s(A)}}.bind(this),s)}catch(F){return s(F)}}.bind(this),s)}catch(P){return s(P)}}.bind(this),s)}catch(L){return s(L)}}.bind(this),s)}))}const rE=`
|
||
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 Pc;function sE(t,e){return new Promise(((n,r)=>{Pc||(Pc=(function(i){const a=[];return a.push(i),URL.createObjectURL(new Blob(a))})(rE));const s=new Worker(Pc);s.addEventListener("message",(function(i){if(e.signal&&e.signal.aborted)s.terminate();else if(i.data.progress===void 0){if(i.data.error)return r(new Error(i.data.error)),void s.terminate();n(i.data.file),s.terminate()}else e.onProgress(i.data.progress)})),s.addEventListener("error",r),e.signal&&e.signal.addEventListener("abort",(()=>{r(e.signal.reason),s.terminate()})),s.postMessage({file:t,imageCompressionLibUrl:e.libURL,options:{...e,onProgress:void 0,signal:void 0}})}))}function Bt(t,e){return new Promise((function(n,r){let s,o,i,a,l,c;if(s={...e},i=0,{onProgress:a}=s,s.maxSizeMB=s.maxSizeMB||Number.POSITIVE_INFINITY,l=typeof s.useWebWorker!="boolean"||s.useWebWorker,delete s.useWebWorker,s.onProgress=g=>{i=g,typeof a=="function"&&a(i)},!(t instanceof Blob||t instanceof nE))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(t.type))return r(new Error("The file given is not an image"));if(c=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!l||typeof Worker!="function"||c)return Sp(t,s).then(function(g){try{return o=g,f.call(this)}catch(m){return r(m)}}.bind(this),r);var d=function(){try{return f.call(this)}catch(g){return r(g)}}.bind(this),u=function(g){try{return Sp(t,s).then((function(m){try{return o=m,d()}catch(p){return r(p)}}),r)}catch(m){return r(m)}};try{return s.libURL=s.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",sE(t,s).then((function(g){try{return o=g,d()}catch{return u()}}),u)}catch{u()}function f(){try{o.name=t.name,o.lastModified=t.lastModified}catch{}try{s.preserveExif&&t.type==="image/jpeg"&&(!s.fileType||s.fileType&&s.fileType===t.type)&&(o=hp(t,o))}catch{}return n(o)}}))}Bt.getDataUrlFromFile=bp,Bt.getFilefromDataUrl=Lc,Bt.loadImage=yp,Bt.drawImageInCanvas=xp,Bt.drawFileInCanvas=Ki,Bt.canvasToFile=qi,Bt.getExifOrientation=wp,Bt.handleMaxWidthOrHeight=kp,Bt.followExifOrientation=Cp,Bt.cleanupCanvasMemory=Vn,Bt.isAutoOrientationInBrowser=us,Bt.approximateBelowMaximumCanvasSizeOfBrowser=vp,Bt.copyExifWithoutOrientation=hp,Bt.getBrowserName=Sr,Bt.version="2.0.2";const oE=window.G7Core,$c=t=>{const e=["B","KB","MB","GB"];let n=0,r=t;for(;r>=1024&&n<e.length-1;)r/=1024,n++;return`${r.toFixed(2)} ${e[n]}`},iE=t=>{if(t&&typeof t=="object"){const e=t;if(e.response?.data?.message)return e.response.data.message;if(e.response?.data?.errors){const n=Object.values(e.response.data.errors)[0];if(Array.isArray(n)&&n[0])return n[0]}if(e.message)return e.message}return t instanceof Error?t.message:"업로드 실패"},aE=t=>t?t.startsWith("image/")?"fa-file-image":t.startsWith("video/")?"fa-file-video":t.startsWith("audio/")?"fa-file-audio":t==="application/pdf"?"fa-file-pdf":t.includes("word")||t.includes("document")?"fa-file-word":t.includes("excel")||t.includes("spreadsheet")?"fa-file-excel":t.includes("zip")||t.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",Pt=(t,e)=>oE?.t?.(t,e)??t,_p=window.G7Core?.createLogger?.("Comp:FileUploader")??{log:(...t)=>console.log("[Comp:FileUploader]",...t),warn:(...t)=>console.warn("[Comp:FileUploader]",...t),error:(...t)=>console.error("[Comp:FileUploader]",...t)},_r=window.G7Core;function lE(t){const{attachmentableType:e,attachmentableId:n,collection:r,maxFiles:s,maxSize:o,maxConcurrentUploads:i,accept:a,imageCompression:l,roleIds:c,autoUpload:d,initialFiles:u,endpoints:f,onFilesChange:g,onUploadComplete:m,onUploadError:p,onRemove:y,onReorder:b,uploadTriggerEvent:_,confirmBeforeRemove:x,uploadParams:E}=t,[S,w]=v.useState(u),[N,C]=v.useState([]),[k,M]=v.useState(!1),T=v.useRef(null),L=v.useRef(0),P=v.useRef(new Set),F=v.useRef(new Map),D=v.useRef(null),[A,O]=v.useState(!1),[V,H]=v.useState(null),[W,j]=v.useState(!1),U=v.useRef(!1),[B,G]=v.useState([]),[z,X]=v.useState(!1),[Y,Z]=v.useState(0),ee=v.useRef(0),[te,ce]=v.useState(new Map),J=v.useRef(new Map),he=v.useRef(g);he.current=g,v.useEffect(()=>{he.current?.(N)},[N]),v.useEffect(()=>{if(U.current)return;const ne=u.filter(ge=>!P.current.has(ge.id)&&(!ge.hash||!P.current.has(ge.hash))),fe=new Set(ne.map(ge=>ge.id)),xe=Array.from(F.current.values()).filter(ge=>!fe.has(ge.id)&&!P.current.has(ge.id));w([...ne,...xe])},[u]);const le=v.useCallback(async ne=>{const fe={maxSizeMB:l?.maxSizeMB??1,maxWidthOrHeight:l?.maxWidthOrHeight??1920,useWebWorker:!0};return await Bt(ne,fe)},[l]),ae=v.useCallback(async ne=>{const fe=S.length+N.length,xe=Math.max(0,s-fe),ge=Array.from(ne).slice(0,xe);if(ne.length>xe){const be=Array.from(ne).slice(xe),Ve=Pt("attachment.upload_limit_exceeded",{max:s});p?.(Ve,be[0]??ne[0])}for(const be of ge){if(be.size>o*1024*1024){p?.(`[${be.name}] 파일 크기(${$c(be.size)})가 최대 허용 크기(${o}MB)를 초과합니다.`,be);continue}if(a){const De="."+be.name.split(".").pop()?.toLowerCase();if(!a.split(",").map(Me=>Me.trim().toLowerCase()).includes(De)){p?.(`[${be.name}] 허용되지 않는 파일 형식입니다. (허용: ${a})`,be);continue}}const Ve={id:`pending-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,file:be,original_filename:be.name,mime_type:be.type,size:be.size,size_formatted:$c(be.size),status:"pending",progress:0};if(be.type.startsWith("image/")&&(Ve.preview=URL.createObjectURL(be)),C(De=>[...De,Ve]),be.type.startsWith("image/")&&l){C(De=>De.map($e=>$e.id===Ve.id?{...$e,status:"compressing"}:$e));try{const De=await le(be);C($e=>$e.map(Me=>Me.id===Ve.id?{...Me,compressedBlob:De,size:De.size,size_formatted:$c(De.size),status:"pending",progress:0}:Me))}catch{C(De=>De.map($e=>$e.id===Ve.id?{...$e,status:"error",error:"이미지 압축 실패"}:$e))}}}},[S.length,N.length,s,o,a,l,le,p]),Se=v.useCallback(async ne=>{const fe=new FormData,xe=ne.compressedBlob?new File([ne.compressedBlob],ne.original_filename,{type:ne.mime_type}):ne.file;fe.append("file",xe),e&&fe.append("attachmentable_type",e),n&&fe.append("attachmentable_id",String(n)),fe.append("collection",r),c.forEach(ge=>{fe.append("role_ids[]",String(ge))}),E&&Object.entries(E).forEach(([ge,be])=>{fe.append(ge,be)});try{const ge=await _r.api.post(f.upload,fe,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:Ve=>{const De=Math.round(Ve.loaded*100/(Ve.total??1));C($e=>$e.map(Me=>Me.id===ne.id?{...Me,progress:De}:Me))}});return ge?.data?.data??ge?.data}catch(ge){const be=iE(ge);throw new Error(be)}},[e,n,r,c,f.upload]),ue=v.useCallback(async()=>{const ne=N.filter(De=>De.status==="pending"||De.status==="error");if(ne.length===0)return D.current=S,[];const fe=[],xe=new Map,ge=[...ne],be=async()=>{for(;ge.length>0&&L.current<i;){const De=ge.shift();L.current++,C($e=>$e.map(Me=>Me.id===De.id?{...Me,status:"uploading",progress:0}:Me));try{const $e=await Se(De);if($e)fe.push($e),xe.set(String(De.id),String($e.hash)),F.current.set($e.id,$e),C(Me=>Me.filter(qe=>qe.id!==De.id)),w(Me=>[...Me,$e]),G(Me=>{if(Me.length===0)return Me;const qe=String(De.id);return Me.some(ye=>String(ye)===qe)?Me.map(ye=>String(ye)===qe?String($e.hash):ye):Me}),De.preview&&URL.revokeObjectURL(De.preview);else{const Me=Pt("attachment.upload_response_invalid");C(qe=>qe.map(ot=>ot.id===De.id?{...ot,status:"error",error:Me}:ot)),p?.(`[${De.original_filename}] ${Me}`,De.file)}}catch($e){const Me=$e instanceof Error?$e.message:"업로드 실패";C(qe=>qe.map(ot=>ot.id===De.id?{...ot,status:"error",error:Me}:ot)),p?.(`[${De.original_filename}] ${Me}`,De.file)}finally{L.current--}}},Ve=Array(Math.min(i,ne.length)).fill(null).map(()=>be());if(await Promise.all(Ve),fe.length>0){m?.(fe);const De=[...S,...fe];if(B.length>0){const $e=B.map(ot=>xe.get(String(ot))??ot),Me=new Map($e.map((ot,ye)=>[String(ot),ye])),qe=[...De].sort((ot,ye)=>{const Ce=Me.get(String(ot.hash))??De.length,Fe=Me.get(String(ye.hash))??De.length;return Ce-Fe}).map((ot,ye)=>({...ot,sort_order:ye,order:ye+1}));D.current=qe,f.reorder&&b&&b(qe)}else D.current=De.map(($e,Me)=>({...$e,sort_order:Me,order:Me+1}))}else D.current=S;return fe},[N,i,Se,m,p,B,S,b,f.reorder]);v.useEffect(()=>{if(!_)return;const ne=_r.componentEvent.on(_,async()=>{const fe=await ue(),xe=D.current??[...S,...fe];return{uploadedAttachments:fe,existingFiles:S,allFiles:xe}});return()=>{ne()}},[_,ue,S]),v.useEffect(()=>{d&&N.some(ne=>ne.status==="pending")&&ue()},[d,N,ue]);const pe=v.useCallback(async ne=>{j(!0);try{if(ne.id&&f.delete){const xe=f.delete.replace(":id",String(ne.id));await _r.api.delete(xe)}const fe=ne.hash||ne.id;ne.id&&(P.current.add(ne.id),F.current.delete(ne.id)),ne.hash&&P.current.add(ne.hash),w(xe=>xe.filter(ge=>(ge.hash||ge.id)!==fe)),y?.(ne.hash||ne.id),O(!1),H(null)}catch{_p.error("첨부파일 삭제 실패")}finally{j(!1)}},[y,f.delete]),we=v.useCallback(async ne=>{"hash"in ne?x?(H(ne),O(!0)):await pe(ne):(ne.preview&&URL.revokeObjectURL(ne.preview),C(fe=>fe.filter(xe=>xe.id!==ne.id)))},[x,pe]),He=v.useCallback(ne=>{C(fe=>fe.map(xe=>xe.id===ne.id?{...xe,status:"pending",error:void 0}:xe))},[]),se=v.useCallback(async ne=>{const{arrayMove:fe}=await Promise.resolve().then(()=>DS),{active:xe,over:ge}=ne;if(!ge||xe.id===ge.id)return;const be=[...S,...N];let Ve;if(B.length===0)Ve=be;else{const Ce=new Map(B.map((Fe,nt)=>[String(Fe),nt]));Ve=[...be].sort((Fe,nt)=>{const pt="hash"in Fe?String(Fe.hash):String(Fe.id),it="hash"in nt?String(nt.hash):String(nt.id);return(Ce.get(pt)??be.length)-(Ce.get(it)??be.length)})}const De=Ve.findIndex(Ce=>"hash"in Ce?Ce.hash===xe.id:Ce.id===xe.id),$e=Ve.findIndex(Ce=>"hash"in Ce?Ce.hash===ge.id:Ce.id===ge.id),Me=fe(Ve,De,$e);G(Me.map(Ce=>"hash"in Ce?Ce.hash:Ce.id));const qe=Me.filter(Ce=>"hash"in Ce),ot=Me.filter(Ce=>!("hash"in Ce));U.current=!0,w(qe),C(ot);const ye=qe.map((Ce,Fe)=>({...Ce,sort_order:Fe,order:Fe+1}));if(qe.length>0&&f.reorder){const Ce=qe.map((Fe,nt)=>({id:Fe.id,order:nt+1}));try{const Fe=await _r.api.patch(f.reorder,{order:Ce});_r.toast.success(Fe.message)}catch(Fe){const nt=Fe instanceof Error?Fe.message:Pt("attachment.reorder_failed");_r.toast.error(nt)}}b?.(ye)},[S,N,B,f.reorder,b]),Oe=v.useMemo(()=>[...S,...N].filter(ne=>"is_image"in ne?ne.is_image:ne.mime_type?.startsWith("image/")??!1),[S,N]),Le=v.useCallback(ne=>{const fe=Oe.findIndex(xe=>"hash"in ne&&"hash"in xe?xe.hash===ne.hash:"id"in ne&&"id"in xe&&!("hash"in ne)&&!("hash"in xe)?xe.id===ne.id:!1);fe!==-1&&(ee.current+=1,Z(fe),X(!0))},[Oe]);v.useEffect(()=>{let ne=!1;return(async()=>{const xe=S.filter(be=>be.is_image),ge=new Set(xe.map(be=>be.id));for(const[be,Ve]of J.current)ge.has(be)||(URL.revokeObjectURL(Ve),J.current.delete(be));for(const be of xe){if(ne)break;if(!J.current.has(be.id)){if(Tc(be.download_url)){J.current.set(be.id,be.download_url),ce(new Map(J.current));continue}try{const Ve=await _r.api.get(be.download_url,{responseType:"blob"});if(!ne&&Ve){const De=URL.createObjectURL(Ve);J.current.set(be.id,De),ce(new Map(J.current))}}catch(Ve){_p.error("Failed to load authenticated image:",Ve)}}}})(),()=>{ne=!0}},[S]),v.useEffect(()=>()=>{J.current.forEach(ne=>URL.revokeObjectURL(ne)),J.current.clear()},[]);const Ie=v.useCallback(async ne=>{const{executeImageDownload:fe}=await Promise.resolve().then(()=>K2);await fe({src:ne.download_url,downloadUrl:ne.download_url,filename:ne.original_filename,downloadRequiresAuth:!0})},[]),Ue=v.useMemo(()=>{const ne=[...S,...N];if(B.length===0)return ne;const fe=new Map(B.map((xe,ge)=>[String(xe),ge]));return[...ne].sort((xe,ge)=>{const be="hash"in xe?String(xe.hash):String(xe.id),Ve="hash"in ge?String(ge.hash):String(ge.id),De=fe.get(be)??ne.length,$e=fe.get(Ve)??ne.length;return De-$e})},[S,N,B]),et=Ue.length,bt=et>0,Ge=et<s,ft=v.useCallback(()=>C([]),[]),Be=v.useCallback(()=>N,[N]);return{existingFiles:S,pendingFiles:N,isDragOver:k,setIsDragOver:M,isDeleting:W,totalCount:et,hasFiles:bt,canAddMore:Ge,allItems:Ue,imageFiles:Oe,handleFiles:ae,handleRemove:we,handleRetry:He,handleUploadAll:ue,handleOpenGallery:Le,handleDownload:Ie,handleDragEnd:se,inputRef:T,galleryOpen:z,setGalleryOpen:X,galleryStartIndex:Y,galleryKeyRef:ee,confirmDialogOpen:A,setConfirmDialogOpen:O,itemToDelete:V,executeRemoveAttachment:pe,authenticatedImageUrls:te,clear:ft,getPendingFiles:Be}}const cE=({isDragOver:t,canAddMore:e,onFiles:n,setIsDragOver:r,inputRef:s,accept:o,maxFiles:i,maxSize:a,disabled:l,children:c})=>{const d=e&&!l;return h.jsxs(I,{className:`
|
||
relative border-2 border-dashed rounded-lg transition-colors
|
||
${l?"opacity-60 cursor-not-allowed":""}
|
||
${t&&!l?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
|
||
`,onDragOver:u=>{u.preventDefault(),d&&r(!0)},onDragLeave:()=>r(!1),onDrop:u=>{u.preventDefault(),r(!1),d&&n(u.dataTransfer.files)},children:[h.jsx("input",{ref:s,type:"file",multiple:!0,accept:o,onChange:u=>u.target.files&&!l&&n(u.target.files),className:"hidden",disabled:l}),!c&&h.jsxs(I,{className:`p-8 text-center transition-colors ${l?"cursor-not-allowed":"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,onClick:()=>!l&&s.current?.click(),children:[h.jsx(gt,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),h.jsx(yt,{className:"text-sm text-gray-600 dark:text-gray-400",children:Pt("attachment.drop_or_click")}),h.jsxs(yt,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[Pt("attachment.upload_limit",{maxFiles:i,maxSize:a}),o&&` (${o})`]})]}),c]})},dE=window.G7Core,uE=window.G7Core?.createLogger?.("Comp:SortableThumbnail")??{log:(...t)=>console.log("[Comp:SortableThumbnail]",...t),warn:(...t)=>console.warn("[Comp:SortableThumbnail]",...t),error:(...t)=>console.error("[Comp:SortableThumbnail]",...t)},fE=({file:t,onRemove:e,onRetry:n,onImageClick:r,onDownload:s,isPrimary:o,onPrimaryClick:i,disabled:a})=>{const{attributes:l,listeners:c,setNodeRef:d,transform:u,transition:f,isDragging:g}=Ii({id:"hash"in t?t.hash:t.id}),m={transform:Fn.Transform.toString(u),transition:f,opacity:g?.5:1},p="status"in t&&t.status!==void 0,y=p?t.status:"done",b=y==="uploading",_=y==="compressing",x=y==="error",E=p?t.progress:100,S=p?t.preview:void 0,w=p?t.mime_type?.startsWith("image/")??!1:t.is_image,[N,C]=v.useState(void 0),k=!p&&w?t.download_url:void 0;v.useEffect(()=>{if(!k){C(void 0);return}if(Tc(k)){C(k);return}let T=!0,L;return(async()=>{try{const F=await dE.api.get(k,{responseType:"blob"});T&&F&&(L=URL.createObjectURL(F),C(L))}catch(F){uE.error("Failed to load authenticated image:",F)}})(),()=>{T=!1,L&&URL.revokeObjectURL(L)}},[k]);const M=N;return h.jsxs(I,{ref:d,style:m,className:"relative group bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[h.jsxs(I,{className:`aspect-square w-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 relative ${w||!p?"cursor-pointer":""}`,onClick:()=>{b||_||(w&&r?r():!p&&s&&s())},children:[S||M?h.jsx(kn,{src:S||M,alt:t.original_filename,className:"w-full h-full object-cover"}):h.jsx(gt,{className:`fa-solid ${aE(t.mime_type)} text-4xl text-gray-400 dark:text-gray-500`}),(b||_)&&h.jsxs(I,{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center",children:[h.jsx(I,{className:"w-3/4 h-2 bg-gray-700 dark:bg-gray-600 rounded-full overflow-hidden",children:h.jsx(I,{className:"h-full bg-blue-500 dark:bg-blue-400 transition-all",style:{width:`${E}%`}})}),h.jsxs(Q,{className:"text-white text-xs mt-1",children:[E,"%"]})]}),x&&h.jsx(I,{className:"absolute inset-0 bg-red-500/50 dark:bg-red-600/50 flex items-center justify-center",children:h.jsx(gt,{className:"fa-solid fa-exclamation-triangle text-2xl text-white"})}),i&&h.jsx(oe,{type:"button",onClick:T=>{T.stopPropagation(),i()},className:`absolute top-1.5 left-1.5 z-10 p-1 rounded-full transition-colors ${o?"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:Pt(o?"attachment.primary_image":"attachment.set_as_primary"),children:h.jsx(gt,{className:"fa-solid fa-star text-xs"})}),h.jsxs(I,{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 ${a?"hidden":""}`,children:[h.jsx(oe,{type:"button",...l,...c,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:Pt("attachment.drag_to_reorder"),onClick:T=>T.stopPropagation(),children:h.jsx(gt,{className:"fa-solid fa-grip-vertical text-sm"})}),!p&&s&&h.jsx(oe,{type:"button",onClick:T=>{T.stopPropagation(),s()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-blue-500 hover:bg-white",title:Pt("common.download"),children:h.jsx(gt,{className:"fa-solid fa-download text-sm"})}),x&&n&&h.jsx(oe,{type:"button",onClick:T=>{T.stopPropagation(),n()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-orange-500 hover:bg-white",title:Pt("common.retry"),children:h.jsx(gt,{className:"fa-solid fa-arrow-rotate-right text-sm"})}),h.jsx(oe,{type:"button",onClick:T=>{T.stopPropagation(),e()},disabled:b||_,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-red-500 hover:bg-white disabled:opacity-50",title:Pt("common.delete"),children:h.jsx(gt,{className:"fa-solid fa-times text-sm"})})]})]}),h.jsxs(I,{className:`p-2 ${!p&&s?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,onClick:()=>{!p&&s&&s()},children:[h.jsx(yt,{className:"text-xs font-medium text-gray-900 dark:text-white truncate",title:t.original_filename,children:t.original_filename}),h.jsx(yt,{className:"text-xs text-gray-500 dark:text-gray-400",children:t.size_formatted})]})]})},hE=({allItems:t,canAddMore:e,totalCount:n,maxFiles:r,maxSize:s,accept:o,onRemove:i,onRetry:a,onImageClick:l,onDownload:c,onDragEnd:d,onAddClick:u,enablePrimarySelection:f,primaryFileId:g,onPrimaryChange:m,disabled:p})=>{const y=Wl(es(Zs,{activationConstraint:{distance:8}}),es(qs,{coordinateGetter:Li}));return h.jsxs(I,{className:"p-3",children:[h.jsx(tc,{sensors:y,collisionDetection:Gl,onDragEnd:d,children:h.jsx(Di,{items:t.map(b=>"hash"in b?b.hash:b.id),strategy:Ti,children:h.jsxs(I,{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:[t.map(b=>{const _="hash"in b,x=_?b.is_image:b.mime_type?.startsWith("image/")??!1;return h.jsx(fE,{file:b,onRemove:()=>i(b),onRetry:"status"in b&&b.status==="error"?()=>a(b):void 0,onImageClick:x?()=>l(b):void 0,onDownload:_?()=>c(b):void 0,isPrimary:f&&_&&(b.hash||b.id)===g,onPrimaryClick:f&&_?()=>m?.(b.hash||b.id):void 0,disabled:p},_?b.hash:b.id)}),e&&!p&&h.jsxs(I,{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:u,children:[h.jsx(gt,{className:"fa-solid fa-plus text-2xl text-gray-400 dark:text-gray-500 mb-1"}),h.jsx(Q,{className:"text-xs text-gray-500 dark:text-gray-400",children:Pt("common.add")})]})]})})}),h.jsxs(I,{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:[h.jsx(Q,{children:Pt("attachment.attached_count",{count:n,max:r})}),h.jsxs(Q,{children:[Pt("attachment.max_size",{size:s}),o&&` (${o})`]})]})]})},Ep=v.forwardRef(({uploadTriggerEvent:t,attachmentableType:e,attachmentableId:n,collection:r="default",maxFiles:s=10,maxSize:o=10,maxConcurrentUploads:i=3,accept:a,imageCompression:l,roleIds:c=[],autoUpload:d=!0,onFilesChange:u,onUploadComplete:f,onUploadError:g,onRemove:m,onReorder:p,initialFiles:y=[],disabled:b=!1,className:_="",confirmBeforeRemove:x=!1,confirmRemoveTitle:E,confirmRemoveMessage:S,apiEndpoints:w,uploadParams:N,enablePrimarySelection:C=!1,primaryFileId:k,onPrimaryChange:M,id:T,editorAttrs:L},P)=>{const F={upload:w?.upload??"/api/admin/attachments",delete:w?.delete??"/api/admin/attachments/:id",reorder:w?.reorder??"/api/admin/attachments/reorder"},D=lE({attachmentableType:e,attachmentableId:n,collection:r,maxFiles:s,maxSize:o,maxConcurrentUploads:i,accept:a,imageCompression:l,roleIds:c,autoUpload:d,initialFiles:y,endpoints:F,onFilesChange:u,onUploadComplete:f,onUploadError:g,onRemove:m,onReorder:p,uploadTriggerEvent:t,confirmBeforeRemove:x,uploadParams:N});v.useImperativeHandle(P,()=>({uploadAll:D.handleUploadAll,clear:D.clear,getPendingFiles:D.getPendingFiles}));const A=v.useMemo(()=>D.imageFiles.map(V=>{const H=!("hash"in V),W=V,j=V;return H?{src:W.preview||"",filename:W.original_filename,title:W.original_filename,downloadRequiresAuth:!1}:{src:D.authenticatedImageUrls.get(j.id)||j.download_url,downloadUrl:j.download_url,filename:j.original_filename,title:j.original_filename,downloadRequiresAuth:!0}}),[D.imageFiles,D.authenticatedImageUrls]),O=v.useMemo(()=>({existingFiles:D.existingFiles,pendingFiles:D.pendingFiles,isDragOver:D.isDragOver,isDeleting:D.isDeleting,maxFiles:s,maxSize:o,accept:a,endpoints:F,confirmBeforeRemove:x,totalCount:D.totalCount,hasFiles:D.hasFiles,canAddMore:D.canAddMore,allItems:D.allItems,imageFiles:D.imageFiles,handleFiles:D.handleFiles,handleRemove:D.handleRemove,handleRetry:D.handleRetry,handleUploadAll:D.handleUploadAll,handleOpenGallery:D.handleOpenGallery,handleDownload:D.handleDownload,handleDragEnd:D.handleDragEnd,setIsDragOver:D.setIsDragOver,inputRef:D.inputRef,galleryOpen:D.galleryOpen,setGalleryOpen:D.setGalleryOpen,galleryStartIndex:D.galleryStartIndex,galleryKeyRef:D.galleryKeyRef,confirmDialogOpen:D.confirmDialogOpen,setConfirmDialogOpen:D.setConfirmDialogOpen,itemToDelete:D.itemToDelete,executeRemoveAttachment:D.executeRemoveAttachment,authenticatedImageUrls:D.authenticatedImageUrls}),[D,s,o,a,F,x]);return h.jsx(Z2,{value:O,children:h.jsxs(I,{id:T,className:_,...L,children:[h.jsx(cE,{isDragOver:D.isDragOver,canAddMore:D.canAddMore,onFiles:D.handleFiles,setIsDragOver:D.setIsDragOver,inputRef:D.inputRef,accept:a,maxFiles:s,maxSize:o,disabled:b,children:D.hasFiles&&h.jsx(hE,{allItems:D.allItems,canAddMore:D.canAddMore,totalCount:D.totalCount,maxFiles:s,maxSize:o,accept:a,onRemove:D.handleRemove,onRetry:D.handleRetry,onImageClick:D.handleOpenGallery,onDownload:D.handleDownload,onDragEnd:D.handleDragEnd,onAddClick:()=>D.inputRef.current?.click(),enablePrimarySelection:C,primaryFileId:k,onPrimaryChange:M,disabled:b})}),x&&h.jsx(ou,{isOpen:D.confirmDialogOpen,onClose:()=>{D.isDeleting||D.setConfirmDialogOpen(!1)},title:E??Pt("attachment.delete_confirm_title"),message:S??Pt("attachment.delete_confirm_message"),confirmText:Pt("common.delete"),confirmButtonVariant:"danger",onConfirm:()=>{D.itemToDelete&&D.executeRemoveAttachment(D.itemToDelete)},isLoading:D.isDeleting,loadingText:Pt("attachment.deleting")}),A.length>0&&D.galleryOpen&&h.jsx(ji,{images:A,isOpen:!0,onClose:()=>D.setGalleryOpen(!1),startIndex:D.galleryStartIndex,showDownload:!0},`gallery-${D.galleryKeyRef.current}`)]})})});Ep.displayName="FileUploader";const gE=({name:t,value:e,options:n,onChange:r,disabled:s=!1,inline:o=!1,className:i="",size:a="md",label:l,error:c,id:d,editorAttrs:u})=>{const[f,g]=v.useState(()=>e??"");v.useEffect(()=>{g(e??"")},[e]);const m=_=>{const x=_.target.value;g(x),r&&!s&&r(_)},y={sm:{radio:"w-3.5 h-3.5",label:"text-xs",gap:"gap-1.5"},md:{radio:"w-4 h-4",label:"text-sm",gap:"gap-2"},lg:{radio:"w-5 h-5",label:"text-base",gap:"gap-2.5"}}[a],b=o?"flex flex-wrap items-center gap-4":"flex flex-col gap-2";return h.jsxs(I,{className:i,id:d,...u,children:[l&&h.jsx(Q,{className:`block mb-2 font-medium text-gray-700 dark:text-gray-300 ${y.label}`,children:l}),h.jsx(I,{className:b,children:n.map(_=>{const x=String(_.value)===String(f),E=s||_.disabled;return h.jsxs(on,{className:`inline-flex items-center ${y.gap} ${E?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[h.jsx("input",{type:"radio",name:t,value:_.value,checked:x,onChange:m,disabled:E,className:`
|
||
${y.radio}
|
||
text-blue-600
|
||
bg-gray-100 dark:bg-gray-700
|
||
border-gray-300 dark:border-gray-600
|
||
focus:ring-blue-500 dark:focus:ring-blue-600
|
||
focus:ring-2
|
||
dark:ring-offset-gray-800
|
||
${E?"cursor-not-allowed":"cursor-pointer"}
|
||
`}),h.jsx(Q,{className:`
|
||
${y.label}
|
||
font-medium
|
||
text-gray-900 dark:text-gray-300
|
||
`,children:_.label})]},_.value)})}),c&&h.jsx(Q,{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:c})]})},fs=()=>window.G7Core,Zi=(t,e)=>fs()?.t?.(t,e)??t,pE=()=>fs()?.locale?.supported?.()??["ko","en"],mE=()=>fs()?.locale?.current?.()??"ko",Mp=t=>{const e=Zi(`common.language_${t}`);return e===`common.language_${t}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[t]||t.toUpperCase():e},bE=({content:t="",value:e,onChange:n,multilingual:r=!1,isHtml:s=!1,onIsHtmlChange:o,rows:i=15,placeholder:a="",label:l,showHtmlModeToggle:c=!0,contentClassName:d="",purifyConfig:u,className:f="",name:g="content",htmlFieldName:m="content_mode",readOnly:p=!1,id:y,editorAttrs:b})=>{const _=v.useMemo(()=>pE(),[]),x=v.useMemo(()=>mE(),[]),[E,S]=v.useState(x),[w,N]=v.useState(s),[C,k]=v.useState(t),[M,T]=v.useState(e??{}),[L,P]=v.useState(!1);v.useEffect(()=>{N(s)},[s]),v.useEffect(()=>{r||k(t)},[t,r]),v.useEffect(()=>{r&&e&&T(e)},[e,r]);const F=v.useCallback(j=>{const U=j.target.value;if(k(U),n){const B=fs()?.createChangeEvent?.({value:U,name:g,type:"textarea"})??{target:{name:g,value:U}};n(B)}},[n,g]),D=v.useCallback((j,U)=>{const B={...M,[j]:U};if(T(B),n){const G=fs()?.createChangeEvent?.({value:B,name:g,type:"multilingual"})??{target:{name:g,value:B}};n(G)}},[n,g,M]),A=v.useCallback(j=>{const U=j.target.checked;if(N(U),U||P(!1),o){const B=fs()?.createChangeEvent?.({checked:U,name:m,type:"checkbox"})??{target:{name:m,checked:U}};o(B)}},[o,m]),O=v.useCallback(()=>{P(j=>!j)},[]),V=r?M[E]??"":C,H=v.useCallback(j=>!!M[j]?.trim(),[M]),W=()=>h.jsx(I,{className:"flex flex-wrap items-center gap-2 mb-3",children:_.map(j=>{const U=j===x,B=E===j;return h.jsxs(oe,{type:"button",className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all
|
||
${B?U?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":U?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
`,onClick:()=>S(j),children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),h.jsx(Q,{children:Mp(j)}),U&&h.jsx(Q,{className:"text-red-500",children:"*"}),H(j)&&!B&&h.jsx(re,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"})]},j)})});return h.jsxs(I,{className:`space-y-2 ${f}`,id:y,...b,children:[h.jsxs(I,{className:"flex items-center justify-between",children:[l&&h.jsx(on,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:l}),h.jsxs(I,{className:"flex items-center gap-3",children:[w&&!p&&h.jsx(oe,{type:"button",onClick:O,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${L?"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:Zi(L?"common.preview_off":"common.preview")}),c&&h.jsxs(on,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[h.jsx(wt,{type:"checkbox",name:m,checked:w,onChange:A,disabled:p,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"}),h.jsx(I,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:Zi("common.html_mode")})]})]})]}),r&&W(),!L&&(r?_.map(j=>h.jsx(I,{className:E===j?"block":"hidden",children:h.jsx(Rn,{name:`${g}[${j}]`,value:M[j]??"",onChange:U=>D(j,U.target.value),placeholder:`${a} (${Mp(j)})`,rows:i,readOnly:p,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 ${w?"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"}`})},j)):h.jsx(Rn,{name:g,value:C,onChange:F,placeholder:a,rows:i,readOnly:p,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 ${w?"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"}`})),L&&h.jsx(I,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:h.jsx(Ja,{content:V,isHtml:!0,className:d||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:u})})]})},Np="g7_dismissed_warnings";function Op(){try{const t=sessionStorage.getItem(Np);return t?JSON.parse(t):[]}catch{return[]}}function yE(t){try{const e=Op();e.includes(t)||(e.push(t),sessionStorage.setItem(Np,JSON.stringify(e)))}catch{}}function vE(t){switch(t){case"error":return"error";case"warning":return"warning";case"info":default:return"info"}}const xE=({warnings:t,className:e=""})=>{const[n,r]=v.useState([]);v.useEffect(()=>{r(Op())},[]);const s=v.useCallback(i=>{yE(i),r(a=>[...a,i])},[]);if(!t||t.length===0)return null;const o=t.filter(i=>!n.includes(i.id));return o.length===0?null:h.jsx(I,{className:`space-y-2 ${e}`.trim(),children:o.map(i=>h.jsx(uu,{type:vE(i.level),message:i.message,dismissible:!0,onDismiss:()=>s(i.id)},i.id))})},Tp=window.G7Core?.createLogger?.("Comp:FilterVisibility")??{log:(...t)=>console.log("[Comp:FilterVisibility]",...t),warn:(...t)=>console.warn("[Comp:FilterVisibility]",...t),error:(...t)=>console.error("[Comp:FilterVisibility]",...t)},wE=({id:t,visibleFilters:e,defaultFilters:n=[],onFilterVisibilityChange:r})=>{const[s,o]=v.useState(!1),i=v.useRef(!0),a=v.useMemo(()=>{try{const f=window.G7Core?.AuthManager?.getInstance();return f?f.getUser()?.uuid:void 0}catch{return}},[]),l=v.useMemo(()=>`g7_filters_${t}${a!==void 0?`_${a}`:""}`,[t,a]),c=v.useCallback(()=>{try{const f=localStorage.getItem(l);if(f){const g=JSON.parse(f);if(Array.isArray(g))return g}}catch(f){Tp.warn("Failed to load from localStorage:",f)}return null},[l]),d=v.useCallback(f=>{try{localStorage.setItem(l,JSON.stringify(f))}catch(g){Tp.warn("Failed to save to localStorage:",g)}},[l]),u=v.useCallback(()=>{const f=c();return f||(e&&e.length>0?e:n)},[c,e,n]);return v.useEffect(()=>{if(!s){const f=u();r&&f.length>0&&r(f),o(!0)}},[s,r,u]),v.useEffect(()=>{if(s&&e&&e.length>0){if(i.current){i.current=!1;return}d(e)}},[s,e,d]),null},kE=window.G7Core?.createLogger?.("Comp:SlotContainer")??{log:(...t)=>console.log("[Comp:SlotContainer]",...t),warn:(...t)=>console.warn("[Comp:SlotContainer]",...t),error:(...t)=>console.error("[Comp:SlotContainer]",...t)};function CE(t,e){return e&&t&&typeof t.id=="string"&&t.id.length>0?{...t,id:`${t.id}__${e}`}:t}const SE=({slotId:t,className:e="",emptyContent:n,style:r,id:s,children:o})=>{const[i,a]=v.useState([]),[,l]=v.useState({}),c=v.useCallback(()=>{const m=window.__slotContextValue;if(m)return m;const p=window.G7Core;return p&&p.getSlotContext?.()||null},[]),d=v.useCallback(()=>{const m=c();m&&m.isEnabled&&a(m.getSlotComponents(t))},[t,c]);v.useEffect(()=>{const m=c();return!m||!m.isEnabled?void 0:(d(),m.subscribeToSlot(t,()=>{d(),l({})}))},[t,c,d]);const u=v.useCallback(()=>{const m=window.G7Core;return m?m.getDynamicRenderer?.():null},[]);if(i.length===0)return n?h.jsx(I,{className:e,style:r,id:s,children:n}):o?h.jsx(I,{className:e,style:r,id:s,children:o}):null;const f=u(),g=window.G7Core;return!f||!g?(kE.error("G7Core or DynamicRenderer not available"),null):h.jsxs(I,{className:e,style:r,id:s,children:[i.map(m=>{const{componentDef:p,dataContext:y,parentFormContext:b,getParentComponentContext:_,translationContext:x}=m,E=CE(p,s);return h.jsx(f,{componentDef:E,dataContext:y,translationContext:x,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:_?.(),parentFormContextProp:b,isRootRenderer:!1},E.id||`slot-${t}-${m.order}`)}),o]})},Ap=(t,e)=>window.G7Core?.t?.(t,e)??t,Dp=(t,e,n)=>window.G7Core?.renderComponentLayout?.(t,e,n)??null,_E=({options:t=[],value:e,onChange:n,placeholder:r,disabled:s=!1,className:o="",maxHeight:i="320px",children:a,selectedChildren:l,__componentLayoutDefs:c,id:d,editorAttrs:u})=>{const[f,g]=v.useState(!1),m=v.useRef(null),p=v.useRef(null),y=v.useMemo(()=>e==null?null:t.find(w=>String(w.value)===String(e))||null,[t,e]);v.useEffect(()=>{const w=N=>{m.current&&!m.current.contains(N.target)&&g(!1)};return f&&document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[f]),v.useEffect(()=>{const w=N=>{N.key==="Escape"&&f&&(g(!1),p.current?.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[f]);const b=v.useCallback(()=>{s||g(w=>!w)},[s]),_=v.useCallback(w=>{n&&n({target:{value:w},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),g(!1),p.current?.focus()},[n]),x=r??Ap("common.select"),E=()=>{if(!y)return h.jsx(Q,{className:"text-gray-400 dark:text-gray-500",children:x});if(c?.selected){const w=Dp(c.selected,{item:y,isSelected:!0},"selected");if(w)return w}return l||h.jsx(Q,{className:"truncate",children:y.label})},S=(w,N)=>h.jsxs(I,{className:"flex items-center justify-between w-full",children:[h.jsx(Q,{className:N?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-900 dark:text-white",children:w.label}),N&&h.jsx(Wn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]});return h.jsxs(I,{ref:m,className:`relative ${o}`,id:d,...u,children:[h.jsxs(oe,{ref:p,type:"button",onClick:b,disabled:s,className:`
|
||
w-full px-4 py-2.5
|
||
bg-gray-100 dark:bg-gray-700
|
||
border-0 rounded-xl
|
||
text-sm text-gray-700 dark:text-gray-200 font-medium
|
||
focus:ring-2 focus:ring-blue-500 focus:outline-none
|
||
flex items-center justify-between gap-2
|
||
text-left cursor-pointer
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
`,"aria-haspopup":"listbox","aria-expanded":f,children:[h.jsx(I,{className:"flex-1 min-w-0",children:E()}),h.jsx(Wn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&h.jsx(I,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",role:"listbox",children:h.jsx(I,{className:"overflow-auto",style:{maxHeight:i},children:t.length===0?h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:Ap("common.no_options")}):t.map((w,N)=>{const C=String(w.value)===String(e);return h.jsx(oe,{type:"button",onClick:()=>!w.disabled&&_(w.value),disabled:w.disabled,className:`
|
||
w-full px-4 py-3 text-left text-sm
|
||
hover:bg-gray-100 dark:hover:bg-gray-700
|
||
transition-colors
|
||
${C?"bg-blue-50 dark:bg-blue-900/20":""}
|
||
${w.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
||
`,role:"option","aria-selected":C,"data-item-value":w.value,"data-item-index":N,"data-item-selected":C,children:c?.item?Dp(c.item,{item:w,index:N,isSelected:C},`item-${N}`):a||S(w,C)},w.value)})})})]})};function EE(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}const ME=({value:t,checked:e=!1,icon:n,label:r,variant:s="blue",customColor:o,className:i="",style:a,onChange:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(!1),g="inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium border cursor-pointer transition-all";if(o){const b=EE(o),_=document.documentElement.classList.contains("dark");let x;return e?x={backgroundColor:o,color:"#ffffff",borderColor:o,opacity:u?.85:1}:x=b?{backgroundColor:`rgba(${b.r}, ${b.g}, ${b.b}, ${u?_?.25:.12:_?.15:.06})`,color:o,borderColor:`rgba(${b.r}, ${b.g}, ${b.b}, ${_?.3:.2})`}:{},h.jsxs(on,{className:`${g} ${i}`,style:{...x,...a},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),id:c,...d,children:[h.jsx(wt,{type:"checkbox",value:t,checked:e,onChange:E=>{l?.(E)},className:"hidden"}),n&&h.jsx(re,{name:n,className:"w-4 h-4"}),h.jsx(I,{children:r})]})}const y=e?{green:"bg-green-600 dark:bg-green-600 text-white dark:text-white border-green-700 dark:border-green-500 hover:bg-green-700 dark:hover:bg-green-500",orange:"bg-orange-600 dark:bg-orange-600 text-white dark:text-white border-orange-700 dark:border-orange-500 hover:bg-orange-700 dark:hover:bg-orange-500",yellow:"bg-yellow-600 dark:bg-yellow-600 text-white dark:text-white border-yellow-700 dark:border-yellow-500 hover:bg-yellow-700 dark:hover:bg-yellow-500",gray:"bg-gray-600 dark:bg-gray-500 text-white dark:text-white border-gray-700 dark:border-gray-400 hover:bg-gray-700 dark:hover:bg-gray-400",blue:"bg-blue-600 dark:bg-blue-600 text-white dark:text-white border-blue-700 dark:border-blue-500 hover:bg-blue-700 dark:hover:bg-blue-500"}[s]:{green:"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 hover:bg-green-100 dark:hover:bg-green-900/30",orange:"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800 hover:bg-orange-100 dark:hover:bg-orange-900/30",yellow:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-600 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800 hover:bg-yellow-100 dark:hover:bg-yellow-900/30",gray:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-300 border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-600",blue:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900/30"}[s];return h.jsxs(on,{className:`${g} ${y} ${i}`,style:a,id:c,...d,children:[h.jsx(wt,{type:"checkbox",value:t,checked:e,onChange:b=>{l?.(b)},className:"hidden"}),n&&h.jsx(re,{name:n,className:"w-4 h-4"}),h.jsx(I,{children:r})]})},NE=({label:t,icon:e,iconPosition:n="left",position:r="right",className:s="",style:o,children:i})=>{const[a,l]=v.useState(!1),[c,d]=v.useState({top:0,left:0}),u=v.useRef(null),f=v.useRef(null),g=v.useCallback(()=>{if(!u.current)return;const p=u.current.getBoundingClientRect(),y=224;let b=r==="right"?p.right-y:p.left;const _=p.bottom+8;b<8&&(b=8),b+y>window.innerWidth-8&&(b=window.innerWidth-y-8),d({top:_,left:b})},[r]);v.useEffect(()=>{a&&g()},[a,g]),v.useEffect(()=>{if(!a)return;const p=()=>{l(!1)};return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[a]),v.useEffect(()=>{const p=y=>{const b=y.target,_=u.current?.contains(b),x=f.current?.contains(b);!_&&!x&&l(!1)};return a&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[a]);const m=a?Dn.createPortal(h.jsx("div",{ref:f,className:"fixed z-[9999] w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",style:{top:c.top,left:c.left},onClick:()=>l(!1),children:i}),document.body):null;return h.jsxs(I,{className:`relative inline-block ${s}`,style:o,children:[h.jsxs(oe,{ref:u,onClick:()=>l(!a),className:"flex items-center gap-2",children:[n==="left"&&e&&h.jsx(re,{name:e,className:"w-4 h-4"}),t&&h.jsx(Q,{className:"text-sm font-medium",children:t}),n==="right"&&e&&h.jsx(re,{name:e,className:"w-4 h-4"})]}),m]})},OE=({label:t,icon:e,variant:n="default",disabled:r=!1,divider:s=!1,className:o="",style:i,onClick:a})=>{if(s)return h.jsx(I,{className:"h-px bg-gray-200 dark:bg-gray-700 my-1",style:i});const l=n==="danger"?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",c=r?"opacity-50 cursor-not-allowed":"cursor-pointer",d=()=>{!r&&a&&a()};return h.jsxs(I,{onClick:d,className:`flex items-center gap-3 px-4 py-3 transition-colors ${l} ${c} ${o}`,style:i,children:[e&&h.jsx(re,{name:e,className:"w-4 h-4"}),t&&h.jsx(Q,{className:"text-sm font-medium",children:t})]})},TE=()=>window.G7Core,Fc=v.createContext(null),Ip=()=>{const t=v.useContext(Fc);if(!t){const e=TE(),n=e?.locale?.current?.()||"ko",r=e?.locale?.supported?.()||["ko","en"];return{activeLocale:n,getActiveLocale:()=>e?.locale?.current?.()||"ko",supportedLocales:r,isInsideMultilingualTabPanel:!1}}return{...t,isInsideMultilingualTabPanel:!0}},AE=()=>window.G7Core,DE=({value:t,onChange:e,placeholder:n,readOnly:r,disabled:s,hasError:o})=>{const{activeLocale:i,getActiveLocale:a}=Ip(),l=typeof t=="string"?{[i]:t}:t||{},c=v.useCallback(u=>{const f=a();e({...l,[f]:u.target.value})},[l,a,e]),d=o?"border-red-500 dark:border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500 focus:border-blue-500";return h.jsx(wt,{type:"text",value:l[i]||"",onChange:c,placeholder:n,readOnly:r,disabled:s,className:`w-full px-3 py-2 text-sm border ${d} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2`})},IE=(t,e)=>{if(!e)return!1;const n=e.startsWith("!"),r=n?e.slice(1):e,s=!!t[r];return n?!s:s},LE=({column:t,item:e,index:n,onValueChange:r,readOnly:s,error:o})=>{const i=e[t.key],a=s||t.readOnly||IE(e,t.readOnlyCondition)||t.disabled,l=!!o,c=l?"border-red-500 dark:border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500 focus:border-blue-500",d=v.useCallback(f=>{r(t.key,f)},[t.key,r]),u=f=>h.jsxs(I,{className:"w-full",children:[f,l&&h.jsx(Q,{className:"text-xs text-red-500 dark:text-red-400 mt-1 block",children:o})]});switch(t.type){case"input":return u(h.jsx(wt,{type:"text",value:i||"",onChange:f=>d(f.target.value),placeholder:t.placeholder,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${t.className||""}`}));case"number":return u(h.jsx(wt,{type:"number",value:i??"",onChange:f=>d(f.target.value?Number(f.target.value):null),placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${t.className||""}`}));case"select":return u(h.jsxs(Vr,{value:i??"",onChange:f=>d(f.target.value),disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${t.className||""}`,children:[h.jsx("option",{value:"",children:"선택하세요"}),t.options?.map(f=>h.jsx("option",{value:f.value,disabled:f.disabled,children:f.label},f.value))]}));case"textarea":return u(h.jsx(Rn,{value:i||"",onChange:f=>d(f.target.value),placeholder:t.placeholder,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 resize-none ${t.className||""}`,rows:2}));case"multilingual":return u(h.jsx(DE,{value:i,onChange:f=>d(f),placeholder:t.placeholder,readOnly:a,disabled:a,hasError:l}));case"custom":return t.render?h.jsx(h.Fragment,{children:t.render(e,n,d)}):h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:"-"});default:return h.jsx(Q,{className:"text-gray-900 dark:text-white text-sm",children:String(i??"")})}},PE=(t,e,n)=>{if(!t)return;if(n==="multilingual"){const o=AE()?.locale?.current?.()||"ko",i=`${e}.${o}`;return t[i]?.[0]}return t[e]?.[0]},$E=({item:t,index:e,id:n,columns:r,enableDrag:s=!0,showIndex:o=!0,canRemove:i=!0,rowActions:a,readOnly:l=!1,onValueChange:c,onRemove:d,className:u="",level:f=0,errors:g})=>{const{attributes:m,listeners:p,setNodeRef:y,transform:b,transition:_,isDragging:x}=Ii({id:n,disabled:!s||l}),E={transform:Fn.Transform.toString(b),transition:_,opacity:x?.5:1},S=v.useCallback((C,k)=>{c?.(C,k)},[c]),w=v.useCallback(C=>{C.onClick?.(t,e)},[t,e]),N=f>0?{paddingLeft:`${f*24}px`}:{};return h.jsxs(I,{ref:y,style:E,className:`flex items-center gap-2 py-2 px-2 border-b border-gray-100 dark:border-gray-700 last:border-b-0 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors ${x?"bg-blue-50 dark:bg-blue-900/20 shadow-lg rounded-lg z-10":""} ${u}`,children:[s&&!l&&h.jsx(I,{...m,...p,className:"flex-shrink-0 w-6 h-6 flex items-center justify-center cursor-grab active:cursor-grabbing text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400",style:N,children:h.jsx(re,{name:"grip-vertical",className:"w-4 h-4"})}),o&&h.jsx(I,{className:"flex-shrink-0 w-8 text-center text-sm text-gray-500 dark:text-gray-400 font-medium",children:e+1}),r.map(C=>{const k=PE(g,C.key,C.type);return h.jsx(I,{className:`flex-1 min-w-0 ${C.width||""}`,style:C.width?{flex:"none",width:C.width}:{},children:h.jsx(LE,{column:C,item:t,index:e,onValueChange:S,readOnly:l,error:k})},C.key)}),a&&a.length>0&&!l&&h.jsx(I,{className:"flex-shrink-0 flex items-center gap-1",children:a.map(C=>{const k=typeof C.disabled=="function"?C.disabled(t,e):C.disabled;return h.jsx(oe,{type:"button",onClick:()=>w(C),disabled:k,className:`p-1.5 rounded transition-colors ${C.danger?"text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-600":"text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-300"} disabled:opacity-50 disabled:cursor-not-allowed`,title:C.label,children:C.icon?h.jsx(re,{name:C.icon,className:"w-4 h-4"}):h.jsx(Q,{className:"text-xs",children:C.label})},C.key)})}),i&&!a&&!l&&h.jsx(I,{className:"flex-shrink-0",children:h.jsx(oe,{type:"button",onClick:d,className:"p-1.5 text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-300 rounded transition-colors",title:"삭제",children:h.jsx(re,{name:"minus",className:"w-4 h-4"})})})]})},Lp=()=>window.G7Core,Vc=()=>`item_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,FE=t=>{const e={_id:Vc()};return t.forEach(n=>{if(n.type==="multilingual"){const s=Lp()?.locale?.all?.()||["ko","en"],o={};s.forEach(i=>{o[i]=""}),e[n.key]=o}else n.type==="number"?e[n.key]=null:(n.type,e[n.key]="")}),e},VE=(t,e)=>{if(!t)return{};const n=`fields.${e}.`,r={};return Object.keys(t).forEach(s=>{if(s.startsWith(n)){const o=s.substring(n.length);r[o]=t[s]}}),r},zE=({items:t=[],columns:e,onChange:n,onAddItem:r,onRemoveItem:s,onReorder:o,addLabel:i="항목 추가",enableDrag:a=!0,showIndex:l=!0,minItems:c=0,maxItems:d,rowActions:u,emptyMessage:f="항목이 없습니다.",className:g="",headerClassName:m="",rowClassName:p="",name:y,readOnly:b=!1,createDefaultItem:_,childrenKey:x,itemIdKey:E="_id",errors:S,id:w,editorAttrs:N})=>{const C=v.useRef(null),k=v.useRef([]),M=v.useRef(null),T=v.useMemo(()=>{let j=!1;for(const U of t)if(U[E]==null){j=!0;break}return j?t.map(U=>U[E]!=null?U:{...U,[E]:Vc()}):t},[t,E]);k.current=T,v.useEffect(()=>{M.current=null},[T]);const L=v.useCallback(j=>String(j[E]??""),[E]);v.useEffect(()=>{if(y){const j=Lp();j?.form&&(C.current=j.form)}},[y]);const P=Wl(es(Zs,{activationConstraint:{distance:8}}),es(qs,{coordinateGetter:Li})),F=v.useMemo(()=>T.map(j=>L(j)),[T,L]),D=v.useCallback(j=>{const{active:U,over:B}=j;if(B&&U.id!==B.id){const G=M.current??k.current,z=G.map(Z=>String(Z[E]??"")),X=z.indexOf(String(U.id)),Y=z.indexOf(String(B.id));if(X!==-1&&Y!==-1){const Z=ns([...G],X,Y);M.current=Z,n?.(Z),o?.(Z)}}},[n,o,E]),A=v.useCallback((j,U,B)=>{const z=[...M.current??k.current];z[j]={...z[j],[U]:B},M.current=z,n?.(z)},[n]),O=v.useCallback(()=>{const j=M.current??k.current;if(d&&j.length>=d)return;if(r){r();return}const U=_?_():FE(e);U[E]||(U[E]=Vc());const B=[...j,U];M.current=B,n?.(B)},[d,r,_,e,E,n]),V=v.useCallback(j=>{const U=M.current??k.current;if(U.length<=c)return;const B=U[j];if(s){s(j,B);return}const G=U.filter((z,X)=>X!==j);M.current=G,n?.(G)},[c,s,n]),H=T.length>c,W=!d||T.length<d;return h.jsxs(I,{className:`dynamic-field-list ${g}`,id:w,...N,children:[h.jsxs(I,{className:`flex items-center gap-2 py-2 px-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50 rounded-t-lg ${m}`,children:[a&&!b&&h.jsx(I,{className:"flex-shrink-0 w-6"}),l&&h.jsx(I,{className:"flex-shrink-0 w-8 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase",children:"#"}),e.map(j=>h.jsxs(I,{className:`flex-1 min-w-0 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase ${j.width||""}`,style:j.width?{flex:"none",width:j.width}:{},children:[j.label,j.required&&h.jsx(Q,{className:"text-red-500 dark:text-red-400 ml-0.5",children:"*"})]},j.key)),(u||!b&&H)&&h.jsx(I,{className:"flex-shrink-0 w-8"})]}),T.length>0?h.jsx(tc,{sensors:P,collisionDetection:Gl,onDragEnd:D,children:h.jsx(Di,{items:F,strategy:nc,children:h.jsx(I,{className:"border-x border-gray-200 dark:border-gray-700",children:T.map((j,U)=>{const B=L(j),G=VE(S,U);return h.jsx($E,{id:B,item:j,index:U,columns:e,enableDrag:a,showIndex:l,canRemove:H,rowActions:u,readOnly:b,onValueChange:(z,X)=>A(U,z,X),onRemove:()=>V(U),className:p,errors:G},B)})})})}):h.jsx(I,{className:"border-x border-gray-200 dark:border-gray-700 py-8 text-center text-gray-500 dark:text-gray-400 text-sm",children:f}),!b&&W&&h.jsx(I,{className:"relative border border-gray-200 dark:border-gray-700 border-t-0 rounded-b-lg",children:h.jsx(I,{className:"flex items-center justify-center py-2",children:h.jsxs(oe,{type:"button",onClick:O,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[h.jsx(re,{name:"plus",className:"w-4 h-4"}),h.jsx(Q,{children:i})]})})}),(b||!W)&&T.length>0&&h.jsx(I,{className:"border-x border-b border-gray-200 dark:border-gray-700 rounded-b-lg h-1"})]})},Pp=()=>window.G7Core,HE=()=>Pp()?.locale?.supported?.()??["ko","en"],UE=()=>Pp()?.locale?.current?.()??"ko",BE={ko:"한국어",en:"English",ja:"日本語",zh:"中文"},jE=({children:t,className:e="",style:n,variant:r="default",defaultLocale:s,onLocaleChange:o,locales:i})=>{const a=v.useMemo(()=>i&&i.length>0?i:HE(),[i]),[l,c]=v.useState(s||UE());v.useEffect(()=>{if(a.length>0&&!a.includes(l)){const p=a[0];c(p),o?.(p)}},[a,l,o]);const d=v.useRef(l);d.current=l;const u=v.useCallback(()=>d.current,[]),f=v.useCallback(p=>{c(p),o?.(p)},[o]),g=v.useMemo(()=>({activeLocale:l,getActiveLocale:u,supportedLocales:a}),[l,u,a]),m=p=>{const y=p===l,b="px-4 py-2 text-sm font-medium transition-all";return r==="pills"?y?`${b} bg-blue-600 text-white rounded-lg`:`${b} text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg`:r==="underline"?y?`${b} text-blue-600 dark:text-blue-400 border-b-2 border-blue-600 dark:border-blue-400`:`${b} text-gray-600 dark:text-gray-400 border-b-2 border-transparent hover:border-gray-300 dark:hover:border-gray-500`:y?`${b} text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-b-2 border-blue-600`:`${b} text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700 border-b-2 border-transparent`};return h.jsxs(I,{className:e,style:n,children:[h.jsx(Po,{className:"flex gap-1 border-b border-gray-200 dark:border-gray-700 mb-4",children:a.map(p=>h.jsx(oe,{type:"button",onClick:()=>f(p),className:m(p),children:h.jsx(Q,{children:BE[p]||p})},p))}),h.jsx(Fc.Provider,{value:g,children:t})]})},WE=({label:t,required:e=!1,error:n,helperText:r,className:s="",labelClassName:o="",children:i,horizontal:a=!1,labelWidth:l="w-1/3",id:c,editorAttrs:d})=>{const u=a?`flex items-start gap-4 ${s}`:`space-y-1 ${s}`,f=a?`${l} flex-shrink-0 pt-2`:"",g=a?"flex-1":"";return h.jsxs(I,{className:u,id:c,...d,children:[t&&h.jsx(I,{className:f,children:h.jsxs(on,{className:`block text-sm font-medium text-gray-700 dark:text-gray-300 ${o}`,children:[t,e&&h.jsx("span",{className:"ml-1 text-red-500 dark:text-red-400",children:"*"})]})}),h.jsxs(I,{className:`${g} ${n?"form-field-error":""}`.trim(),children:[i,r&&!n&&h.jsx(I,{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:r}),n&&h.jsx(I,{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:n})]})]})};/*!
|
||
* @kurkle/color v0.3.4
|
||
* https://github.com/kurkle/color#readme
|
||
* (c) 2024 Jukka Kurkela
|
||
* Released under the MIT License
|
||
*/function uo(t){return t+.5|0}const ar=(t,e,n)=>Math.max(Math.min(t,n),e);function fo(t){return ar(uo(t*2.55),0,255)}function lr(t){return ar(uo(t*255),0,255)}function Xn(t){return ar(uo(t/2.55)/100,0,1)}function $p(t){return ar(uo(t*100),0,100)}const mn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zc=[..."0123456789ABCDEF"],GE=t=>zc[t&15],YE=t=>zc[(t&240)>>4]+zc[t&15],Qi=t=>(t&240)>>4===(t&15),XE=t=>Qi(t.r)&&Qi(t.g)&&Qi(t.b)&&Qi(t.a);function KE(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&mn[t[1]]*17,g:255&mn[t[2]]*17,b:255&mn[t[3]]*17,a:e===5?mn[t[4]]*17:255}:(e===7||e===9)&&(n={r:mn[t[1]]<<4|mn[t[2]],g:mn[t[3]]<<4|mn[t[4]],b:mn[t[5]]<<4|mn[t[6]],a:e===9?mn[t[7]]<<4|mn[t[8]]:255})),n}const qE=(t,e)=>t<255?e(t):"";function ZE(t){var e=XE(t)?GE:YE;return t?"#"+e(t.r)+e(t.g)+e(t.b)+qE(t.a,e):void 0}const QE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Fp(t,e,n){const r=e*Math.min(n,1-n),s=(o,i=(o+t/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[s(0),s(8),s(4)]}function JE(t,e,n){const r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function RE(t,e,n){const r=Fp(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)r[s]*=1-e-n,r[s]+=e;return r}function eM(t,e,n,r,s){return t===s?(e-n)/r+(e<n?6:0):e===s?(n-t)/r+2:(t-e)/r+4}function Hc(t){const n=t.r/255,r=t.g/255,s=t.b/255,o=Math.max(n,r,s),i=Math.min(n,r,s),a=(o+i)/2;let l,c,d;return o!==i&&(d=o-i,c=a>.5?d/(2-o-i):d/(o+i),l=eM(n,r,s,d,o),l=l*60+.5),[l|0,c||0,a]}function Uc(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(lr)}function Bc(t,e,n){return Uc(Fp,t,e,n)}function tM(t,e,n){return Uc(RE,t,e,n)}function nM(t,e,n){return Uc(JE,t,e,n)}function Vp(t){return(t%360+360)%360}function rM(t){const e=QE.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?fo(+e[5]):lr(+e[5]));const s=Vp(+e[2]),o=+e[3]/100,i=+e[4]/100;return e[1]==="hwb"?r=tM(s,o,i):e[1]==="hsv"?r=nM(s,o,i):r=Bc(s,o,i),{r:r[0],g:r[1],b:r[2],a:n}}function sM(t,e){var n=Hc(t);n[0]=Vp(n[0]+e),n=Bc(n),t.r=n[0],t.g=n[1],t.b=n[2]}function oM(t){if(!t)return;const e=Hc(t),n=e[0],r=$p(e[1]),s=$p(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${s}%, ${Xn(t.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const zp={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Hp={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function iM(){const t={},e=Object.keys(Hp),n=Object.keys(zp);let r,s,o,i,a;for(r=0;r<e.length;r++){for(i=a=e[r],s=0;s<n.length;s++)o=n[s],a=a.replace(o,zp[o]);o=parseInt(Hp[i],16),t[a]=[o>>16&255,o>>8&255,o&255]}return t}let Ji;function aM(t){Ji||(Ji=iM(),Ji.transparent=[0,0,0,0]);const e=Ji[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const lM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function cM(t){const e=lM.exec(t);let n=255,r,s,o;if(e){if(e[7]!==r){const i=+e[7];n=e[8]?fo(i):ar(i*255,0,255)}return r=+e[1],s=+e[3],o=+e[5],r=255&(e[2]?fo(r):ar(r,0,255)),s=255&(e[4]?fo(s):ar(s,0,255)),o=255&(e[6]?fo(o):ar(o,0,255)),{r,g:s,b:o,a:n}}}function dM(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Xn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const jc=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,hs=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function uM(t,e,n){const r=hs(Xn(t.r)),s=hs(Xn(t.g)),o=hs(Xn(t.b));return{r:lr(jc(r+n*(hs(Xn(e.r))-r))),g:lr(jc(s+n*(hs(Xn(e.g))-s))),b:lr(jc(o+n*(hs(Xn(e.b))-o))),a:t.a+n*(e.a-t.a)}}function Ri(t,e,n){if(t){let r=Hc(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=Bc(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Up(t,e){return t&&Object.assign(e||{},t)}function Bp(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=lr(t[3]))):(e=Up(t,{r:0,g:0,b:0,a:1}),e.a=lr(e.a)),e}function fM(t){return t.charAt(0)==="r"?cM(t):rM(t)}class ho{constructor(e){if(e instanceof ho)return e;const n=typeof e;let r;n==="object"?r=Bp(e):n==="string"&&(r=KE(e)||aM(e)||fM(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=Up(this._rgb);return e&&(e.a=Xn(e.a)),e}set rgb(e){this._rgb=Bp(e)}rgbString(){return this._valid?dM(this._rgb):void 0}hexString(){return this._valid?ZE(this._rgb):void 0}hslString(){return this._valid?oM(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,s=e.rgb;let o;const i=n===o?.5:n,a=2*i-1,l=r.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,r.r=255&c*r.r+o*s.r+.5,r.g=255&c*r.g+o*s.g+.5,r.b=255&c*r.b+o*s.b+.5,r.a=i*r.a+(1-i)*s.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=uM(this._rgb,e._rgb,n)),this}clone(){return new ho(this.rgb)}alpha(e){return this._rgb.a=lr(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=uo(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ri(this._rgb,2,e),this}darken(e){return Ri(this._rgb,2,-e),this}saturate(e){return Ri(this._rgb,1,e),this}desaturate(e){return Ri(this._rgb,1,-e),this}rotate(e){return sM(this._rgb,e),this}}/*!
|
||
* Chart.js v4.5.1
|
||
* https://www.chartjs.org
|
||
* (c) 2025 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/function Kn(){}const hM=(()=>{let t=0;return()=>t++})();function at(t){return t==null}function Mt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Xe(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function bn(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function zn(t,e){return bn(t)?t:e}function Ke(t,e){return typeof t>"u"?e:t}const gM=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,jp=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ut(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function tt(t,e,n,r){let s,o,i;if(Mt(t))for(o=t.length,s=0;s<o;s++)e.call(n,t[s],s);else if(Xe(t))for(i=Object.keys(t),o=i.length,s=0;s<o;s++)e.call(n,t[i[s]],i[s])}function ea(t,e){let n,r,s,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(s=t[n],o=e[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ta(t){if(Mt(t))return t.map(ta);if(Xe(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let s=0;for(;s<r;++s)e[n[s]]=ta(t[n[s]]);return e}return t}function Wp(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function pM(t,e,n,r){if(!Wp(t))return;const s=e[t],o=n[t];Xe(s)&&Xe(o)?go(s,o,r):e[t]=ta(o)}function go(t,e,n){const r=Mt(e)?e:[e],s=r.length;if(!Xe(t))return t;n=n||{};const o=n.merger||pM;let i;for(let a=0;a<s;++a){if(i=r[a],!Xe(i))continue;const l=Object.keys(i);for(let c=0,d=l.length;c<d;++c)o(l[c],t,i,n)}return t}function po(t,e){return go(t,e,{merger:mM})}function mM(t,e,n){if(!Wp(t))return;const r=e[t],s=n[t];Xe(r)&&Xe(s)?po(r,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ta(s))}const Gp={"":t=>t,x:t=>t.x,y:t=>t.y};function bM(t){const e=t.split("."),n=[];let r="";for(const s of e)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function yM(t){const e=bM(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function Er(t,e){return(Gp[e]||(Gp[e]=yM(e)))(t)}function Wc(t){return t.charAt(0).toUpperCase()+t.slice(1)}const mo=t=>typeof t<"u",cr=t=>typeof t=="function",Yp=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function vM(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const lt=Math.PI,Ct=2*lt,na=Number.POSITIVE_INFINITY,xM=lt/180,Nt=lt/2,Mr=lt/4,Xp=lt*2/3,Kp=Math.log10,dr=Math.sign;function ra(t,e,n){return Math.abs(t-e)<n}function qp(t){const e=Math.round(t);t=ra(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Kp(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function wM(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((s,o)=>s-o).pop(),e}function kM(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function sa(t){return!kM(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function CM(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function SM(t,e,n){let r,s,o;for(r=0,s=t.length;r<s;r++)o=t[r][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function qn(t){return t*(lt/180)}function _M(t){return t*(180/lt)}function Zp(t){if(!bn(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Qp(t,e){const n=e.x-t.x,r=e.y-t.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*lt&&(o+=Ct),{angle:o,distance:s}}function EM(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Hn(t){return(t%Ct+Ct)%Ct}function oa(t,e,n,r){const s=Hn(t),o=Hn(e),i=Hn(n),a=Hn(o-s),l=Hn(i-s),c=Hn(s-o),d=Hn(s-i);return s===o||s===i||r&&o===i||a>l&&c<d}function nn(t,e,n){return Math.max(e,Math.min(n,t))}function MM(t){return nn(t,-32768,32767)}function Nr(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function Gc(t,e,n){n=n||(i=>t[i]<e);let r=t.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const Yc=(t,e,n,r)=>Gc(t,n,r?s=>{const o=t[s][e];return o<n||o===n&&t[s+1][e]===n}:s=>t[s][e]<n),NM=(t,e,n)=>Gc(t,n,r=>t[r][e]>=n);function OM(t,e,n){let r=0,s=t.length;for(;r<s&&t[r]<e;)r++;for(;s>r&&t[s-1]>n;)s--;return r>0||s<t.length?t.slice(r,s):t}const Jp=["push","pop","shift","splice","unshift"];function TM(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Jp.forEach(n=>{const r="_onData"+Wc(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...o){const i=s.apply(this,o);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),i}})})}function Rp(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(e);s!==-1&&r.splice(s,1),!(r.length>0)&&(Jp.forEach(o=>{delete t[o]}),delete t._chartjs)}function e0(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const t0=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function n0(t,e){let n=[],r=!1;return function(...s){n=s,r||(r=!0,t0.call(window,()=>{r=!1,t.apply(e,n)}))}}function AM(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const Xc=t=>t==="start"?"left":t==="end"?"right":"center",jt=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,DM=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e,ia=t=>t===0||t===1,r0=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Ct/n)),s0=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Ct/n)+1,bo={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Nt)+1,easeOutSine:t=>Math.sin(t*Nt),easeInOutSine:t=>-.5*(Math.cos(lt*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>ia(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ia(t)?t:r0(t,.075,.3),easeOutElastic:t=>ia(t)?t:s0(t,.075,.3),easeInOutElastic(t){return ia(t)?t:t<.5?.5*r0(t*2,.1125,.45):.5+.5*s0(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-bo.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?bo.easeInBounce(t*2)*.5:bo.easeOutBounce(t*2-1)*.5+.5};function o0(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function i0(t){return o0(t)?t:new ho(t)}function Kc(t){return o0(t)?t:new ho(t).saturate(.5).darken(.1).hexString()}const IM=["x","y","borderWidth","radius","tension"],LM=["color","borderColor","backgroundColor"];function PM(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:LM},numbers:{type:"number",properties:IM}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function $M(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const a0=new Map;function FM(t,e){e=e||{};const n=t+JSON.stringify(e);let r=a0.get(n);return r||(r=new Intl.NumberFormat(t,e),a0.set(n,r)),r}function qc(t,e,n){return FM(e,n).format(t)}const VM={values(t){return Mt(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const r=this.chart.options.locale;let s,o=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=zM(t,n)}const i=Kp(Math.abs(o)),a=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),qc(t,r,l)}};function zM(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var l0={formatters:VM};function HM(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:l0.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Or=Object.create(null),Zc=Object.create(null);function yo(t,e){if(!e)return t;const n=e.split(".");for(let r=0,s=n.length;r<s;++r){const o=n[r];t=t[o]||(t[o]=Object.create(null))}return t}function Qc(t,e,n){return typeof e=="string"?go(yo(t,e),n):go(yo(t,""),e)}class UM{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>Kc(s.backgroundColor),this.hoverBorderColor=(r,s)=>Kc(s.borderColor),this.hoverColor=(r,s)=>Kc(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return Qc(this,e,n)}get(e){return yo(this,e)}describe(e,n){return Qc(Zc,e,n)}override(e,n){return Qc(Or,e,n)}route(e,n,r,s){const o=yo(this,e),i=yo(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=i[s];return Xe(l)?Object.assign({},c,l):Ke(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var xt=new UM({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[PM,$M,HM]);function BM(t){return!t||at(t.size)||at(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function c0(t,e,n,r,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,n.push(s)),o>r&&(r=o),r}function Tr(t,e,n){const r=t.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((e-s)*r)/r+s}function d0(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function u0(t,e,n,r){f0(t,e,n,r,null)}function f0(t,e,n,r,s){let o,i,a,l,c,d,u,f;const g=e.pointStyle,m=e.rotation,p=e.radius;let y=(m||0)*xM;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(y),t.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),t.restore();return}if(!(isNaN(p)||p<=0)){switch(t.beginPath(),g){default:s?t.ellipse(n,r,s/2,p,0,0,Ct):t.arc(n,r,p,0,Ct),t.closePath();break;case"triangle":d=s?s/2:p,t.moveTo(n+Math.sin(y)*d,r-Math.cos(y)*p),y+=Xp,t.lineTo(n+Math.sin(y)*d,r-Math.cos(y)*p),y+=Xp,t.lineTo(n+Math.sin(y)*d,r-Math.cos(y)*p),t.closePath();break;case"rectRounded":c=p*.516,l=p-c,i=Math.cos(y+Mr)*l,u=Math.cos(y+Mr)*(s?s/2-c:l),a=Math.sin(y+Mr)*l,f=Math.sin(y+Mr)*(s?s/2-c:l),t.arc(n-u,r-a,c,y-lt,y-Nt),t.arc(n+f,r-i,c,y-Nt,y),t.arc(n+u,r+a,c,y,y+Nt),t.arc(n-f,r+i,c,y+Nt,y+lt),t.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*p,d=s?s/2:l,t.rect(n-d,r-l,2*d,2*l);break}y+=Mr;case"rectRot":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),t.moveTo(n-u,r-a),t.lineTo(n+f,r-i),t.lineTo(n+u,r+a),t.lineTo(n-f,r+i),t.closePath();break;case"crossRot":y+=Mr;case"cross":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),t.moveTo(n-u,r-a),t.lineTo(n+u,r+a),t.moveTo(n+f,r-i),t.lineTo(n-f,r+i);break;case"star":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),t.moveTo(n-u,r-a),t.lineTo(n+u,r+a),t.moveTo(n+f,r-i),t.lineTo(n-f,r+i),y+=Mr,u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),t.moveTo(n-u,r-a),t.lineTo(n+u,r+a),t.moveTo(n+f,r-i),t.lineTo(n-f,r+i);break;case"line":i=s?s/2:Math.cos(y)*p,a=Math.sin(y)*p,t.moveTo(n-i,r-a),t.lineTo(n+i,r+a);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(y)*(s?s/2:p),r+Math.sin(y)*p);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function h0(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Jc(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Rc(t){t.restore()}function jM(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),at(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function WM(t,e,n,r,s){if(s.strikethrough||s.underline){const o=t.measureText(r),i=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(i,d),t.lineTo(a,d),t.stroke()}}function GM(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function vo(t,e,n,r,s,o={}){const i=Mt(e)?e:[e],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(t.save(),t.font=s.string,jM(t,o),l=0;l<i.length;++l)c=i[l],o.backdrop&&GM(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),at(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,n,r,o.maxWidth)),t.fillText(c,n,r,o.maxWidth),WM(t,n,r,c,o),r+=Number(s.lineHeight);t.restore()}function aa(t,e){const{x:n,y:r,w:s,h:o,radius:i}=e;t.arc(n+i.topLeft,r+i.topLeft,i.topLeft,1.5*lt,lt,!0),t.lineTo(n,r+o-i.bottomLeft),t.arc(n+i.bottomLeft,r+o-i.bottomLeft,i.bottomLeft,lt,Nt,!0),t.lineTo(n+s-i.bottomRight,r+o),t.arc(n+s-i.bottomRight,r+o-i.bottomRight,i.bottomRight,Nt,0,!0),t.lineTo(n+s,r+i.topRight),t.arc(n+s-i.topRight,r+i.topRight,i.topRight,0,-Nt,!0),t.lineTo(n+i.topLeft,r)}const YM=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,XM=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function KM(t,e){const n=(""+t).match(YM);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const qM=t=>+t||0;function ed(t,e){const n={},r=Xe(e),s=r?Object.keys(e):e,o=Xe(t)?r?i=>Ke(t[i],t[e[i]]):i=>t[i]:()=>t;for(const i of s)n[i]=qM(o(i));return n}function g0(t){return ed(t,{top:"y",right:"x",bottom:"y",left:"x"})}function gs(t){return ed(t,["topLeft","topRight","bottomLeft","bottomRight"])}function yn(t){const e=g0(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Wt(t,e){t=t||{},e=e||xt.font;let n=Ke(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ke(t.style,e.style);r&&!(""+r).match(XM)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:Ke(t.family,e.family),lineHeight:KM(Ke(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:Ke(t.weight,e.weight),string:""};return s.string=BM(s),s}function la(t,e,n,r){let s,o,i;for(s=0,o=t.length;s<o;++s)if(i=t[s],i!==void 0&&i!==void 0)return i}function ZM(t,e,n){const{min:r,max:s}=t,o=jp(e,(s-r)/2),i=(a,l)=>n&&a===0?0:a+l;return{min:i(r,-Math.abs(o)),max:i(s,o)}}function ps(t,e){return Object.assign(Object.create(t),e)}function td(t,e=[""],n,r,s=()=>t[0]){const o=n||t;typeof r>"u"&&(r=v0("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:r,_getTarget:s,override:a=>td([a,...t],e,o,r)};return new Proxy(i,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return m0(a,l,()=>sN(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return x0(a).includes(l)},ownKeys(a){return x0(a)},set(a,l,c){const d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function ms(t,e,n,r){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:p0(t,r),setContext:o=>ms(t,o,n,r),override:o=>ms(t.override(o),e,n,r)};return new Proxy(s,{deleteProperty(o,i){return delete o[i],delete t[i],!0},get(o,i,a){return m0(o,i,()=>JM(o,i,a))},getOwnPropertyDescriptor(o,i){return o._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(o,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(o,i,a){return t[i]=a,delete o[i],!0}})}function p0(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:n,indexable:r,isScriptable:cr(n)?n:()=>n,isIndexable:cr(r)?r:()=>r}}const QM=(t,e)=>t?t+Wc(e):e,nd=(t,e)=>Xe(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function m0(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function JM(t,e,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:i}=t;let a=r[e];return cr(a)&&i.isScriptable(e)&&(a=RM(e,a,t,n)),Mt(a)&&a.length&&(a=eN(e,a,t,i.isIndexable)),nd(e,a)&&(a=ms(a,s,o&&o[e],i)),a}function RM(t,e,n,r){const{_proxy:s,_context:o,_subProxy:i,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,i||r);return a.delete(t),nd(t,l)&&(l=rd(s._scopes,s,t,l)),l}function eN(t,e,n,r){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;if(typeof o.index<"u"&&r(t))return e[o.index%e.length];if(Xe(e[0])){const l=e,c=s._scopes.filter(d=>d!==l);e=[];for(const d of l){const u=rd(c,s,t,d);e.push(ms(u,o,i&&i[t],a))}}return e}function b0(t,e,n){return cr(t)?t(e,n):t}const tN=(t,e)=>t===!0?e:typeof t=="string"?Er(e,t):void 0;function nN(t,e,n,r,s){for(const o of e){const i=tN(n,o);if(i){t.add(i);const a=b0(i._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(i===!1&&typeof r<"u"&&n!==r)return null}return!1}function rd(t,e,n,r){const s=e._rootScopes,o=b0(e._fallback,n,r),i=[...t,...s],a=new Set;a.add(r);let l=y0(a,i,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=y0(a,i,o,l,r),l===null)?!1:td(Array.from(a),[""],s,o,()=>rN(e,n,r))}function y0(t,e,n,r,s){for(;n;)n=nN(t,e,n,r,s);return n}function rN(t,e,n){const r=t._getTarget();e in r||(r[e]={});const s=r[e];return Mt(s)&&Xe(n)?n:s||{}}function sN(t,e,n,r){let s;for(const o of e)if(s=v0(QM(o,t),n),typeof s<"u")return nd(t,s)?rd(n,r,t,s):s}function v0(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function x0(t){let e=t._keys;return e||(e=t._keys=oN(t._scopes)),e}function oN(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(r);return Array.from(e)}function sd(){return typeof window<"u"&&typeof document<"u"}function od(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function ca(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const da=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function iN(t,e){return da(t).getPropertyValue(e)}const aN=["top","right","bottom","left"];function Ar(t,e,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=aN[s];r[o]=parseFloat(t[e+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const lN=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function cN(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:s,offsetY:o}=r;let i=!1,a,l;if(lN(s,o,t.target))a=s,l=o;else{const c=e.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,i=!0}return{x:a,y:l,box:i}}function Dr(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,s=da(n),o=s.boxSizing==="border-box",i=Ar(s,"padding"),a=Ar(s,"border","width"),{x:l,y:c,box:d}=cN(t,n),u=i.left+(d&&a.left),f=i.top+(d&&a.top);let{width:g,height:m}=e;return o&&(g-=i.width+a.width,m-=i.height+a.height),{x:Math.round((l-u)/g*n.width/r),y:Math.round((c-f)/m*n.height/r)}}function dN(t,e,n){let r,s;if(e===void 0||n===void 0){const o=t&&od(t);if(!o)e=t.clientWidth,n=t.clientHeight;else{const i=o.getBoundingClientRect(),a=da(o),l=Ar(a,"border","width"),c=Ar(a,"padding");e=i.width-c.width-l.width,n=i.height-c.height-l.height,r=ca(a.maxWidth,o,"clientWidth"),s=ca(a.maxHeight,o,"clientHeight")}}return{width:e,height:n,maxWidth:r||na,maxHeight:s||na}}const ur=t=>Math.round(t*10)/10;function uN(t,e,n,r){const s=da(t),o=Ar(s,"margin"),i=ca(s.maxWidth,t,"clientWidth")||na,a=ca(s.maxHeight,t,"clientHeight")||na,l=dN(t,e,n);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const f=Ar(s,"border","width"),g=Ar(s,"padding");c-=g.width+f.width,d-=g.height+f.height}return c=Math.max(0,c-o.width),d=Math.max(0,r?c/r:d-o.height),c=ur(Math.min(c,i,l.maxWidth)),d=ur(Math.min(d,a,l.maxHeight)),c&&!d&&(d=ur(c/2)),(e!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=ur(Math.floor(d*r))),{width:c,height:d}}function w0(t,e,n){const r=e||1,s=ur(t.height*r),o=ur(t.width*r);t.height=ur(t.height),t.width=ur(t.width);const i=t.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==s||i.width!==o?(t.currentDevicePixelRatio=r,i.height=s,i.width=o,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const fN=(function(){let t=!1;try{const e={get passive(){return t=!0,!1}};sd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t})();function k0(t,e){const n=iN(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const hN=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},gN=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function bs(t,e,n){return t?hN(e,n):gN()}function C0(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function S0(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function ua(t,e,n){return t.options.clip?t[n]:e[n]}function pN(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:ua(n,e,"left"),right:ua(n,e,"right"),top:ua(r,e,"top"),bottom:ua(r,e,"bottom")}:e}function mN(t,e){const n=e._clip;if(n.disabled)return!1;const r=pN(e,t.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
|
||
* Chart.js v4.5.1
|
||
* https://www.chartjs.org
|
||
* (c) 2025 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/class bN{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:e,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=t0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,l;for(;i>=0;--i)l=o[i],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,e,"progress")),o.length||(r.running=!1,this._notify(s,r,e,"complete"),r.initial=!1),n+=o.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Zn=new bN;const _0="transparent",yN={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=i0(t||_0),s=r.valid&&i0(e||_0);return s&&s.valid?s.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class vN{constructor(e,n,r,s){const o=n[r];s=la([e.to,s,o,e.from]);const i=la([e.from,o,s]);this._active=!0,this._fn=e.fn||yN[e.type||typeof i],this._easing=bo[e.easing]||bo.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=i,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=la([e.to,n,s,e.from]),this._from=la([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let l;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/r%2,l=i&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class E0{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!Xe(e))return;const n=Object.keys(xt.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!Xe(o))return;const i={};for(const a of n)i[a]=o[a];(Mt(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(e,n){const r=n.options,s=wN(e,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&xN(e.options.$animations,r).then(()=>{e.options=r},()=>{}),o}_createAnimations(e,n){const r=this._properties,s=[],o=e.$animations||(e.$animations={}),i=Object.keys(n),a=Date.now();let l;for(l=i.length-1;l>=0;--l){const c=i[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(e,n));continue}const d=n[c];let u=o[c];const f=r.get(c);if(u)if(f&&u.active()){u.update(f,d,a);continue}else u.cancel();if(!f||!f.duration){e[c]=d;continue}o[c]=u=new vN(f,e,c,d),s.push(u)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return Zn.add(this._chart,r),!0}}function xN(t,e){const n=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=t[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function wN(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function M0(t,e){const n=t&&t.options||{},r=n.reverse,s=n.min===void 0?e:0,o=n.max===void 0?e:0;return{start:r?o:s,end:r?s:o}}function kN(t,e,n){if(n===!1)return!1;const r=M0(t,n),s=M0(e,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function CN(t){let e,n,r,s;return Xe(t)?(e=t.top,n=t.right,r=t.bottom,s=t.left):e=n=r=s=t,{top:e,right:n,bottom:r,left:s,disabled:t===!1}}function N0(t,e){const n=[],r=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].index);return n}function O0(t,e,n,r={}){const s=t.keys,o=r.mode==="single";let i,a,l,c;if(e===null)return;let d=!1;for(i=0,a=s.length;i<a;++i){if(l=+s[i],l===n){if(d=!0,r.all)continue;break}c=t.values[l],bn(c)&&(o||e===0||dr(e)===dr(c))&&(e+=c)}return!d&&!r.all?0:e}function SN(t,e){const{iScale:n,vScale:r}=e,s=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",i=Object.keys(t),a=new Array(i.length);let l,c,d;for(l=0,c=i.length;l<c;++l)d=i[l],a[l]={[s]:d,[o]:t[d]};return a}function id(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function _N(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function EN(t){const{min:e,max:n,minDefined:r,maxDefined:s}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function MN(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function T0(t,e,n,r){for(const s of e.getMatchingVisibleMetas(r).reverse()){const o=t[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function A0(t,e){const{chart:n,_cachedMeta:r}=t,s=n._stacks||(n._stacks={}),{iScale:o,vScale:i,index:a}=r,l=o.axis,c=i.axis,d=_N(o,i,r),u=e.length;let f;for(let g=0;g<u;++g){const m=e[g],{[l]:p,[c]:y}=m,b=m._stacks||(m._stacks={});f=b[c]=MN(s,d,p),f[a]=y,f._top=T0(f,i,!0,r.type),f._bottom=T0(f,i,!1,r.type);const _=f._visualValues||(f._visualValues={});_[a]=y}}function ad(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function NN(t,e){return ps(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ON(t,e,n){return ps(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function xo(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const s of e){const o=s._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const ld=t=>t==="reset"||t==="none",D0=(t,e)=>e?t:Object.assign({},t),TN=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:N0(n,!0),values:null};class ys{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=id(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&xo(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(u,f,g,m)=>u==="x"?f:u==="r"?m:g,o=n.xAxisID=Ke(r.xAxisID,ad(e,"x")),i=n.yAxisID=Ke(r.yAxisID,ad(e,"y")),a=n.rAxisID=Ke(r.rAxisID,ad(e,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,i,a),d=n.vAxisID=s(l,i,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Rp(this._data,this),e._stacked&&xo(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(Xe(n)){const s=this._cachedMeta;this._data=SN(n,s)}else if(r!==n){if(r){Rp(r,this);const s=this._cachedMeta;xo(s),s._parsed=[]}n&&Object.isExtensible(n)&&TM(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=id(n.vScale,n),n.stack!==r.stack&&(s=!0,xo(n),n.stack=r.stack),this._resyncElements(e),(s||o!==n._stacked)&&(A0(this,n._parsed),n._stacked=id(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:s}=this,{iScale:o,_stacked:i}=r,a=o.axis;let l=e===0&&n===s.length?!0:r._sorted,c=e>0&&r._parsed[e-1],d,u,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{Mt(s[e])?f=this.parseArrayData(r,s,e,n):Xe(s[e])?f=this.parseObjectData(r,s,e,n):f=this.parsePrimitiveData(r,s,e,n);const g=()=>u[a]===null||c&&u[a]<c[a];for(d=0;d<n;++d)r._parsed[d+e]=u=f[d],l&&(g()&&(l=!1),c=u);r._sorted=l}i&&A0(this,f)}parsePrimitiveData(e,n,r,s){const{iScale:o,vScale:i}=e,a=o.axis,l=i.axis,c=o.getLabels(),d=o===i,u=new Array(s);let f,g,m;for(f=0,g=s;f<g;++f)m=f+r,u[f]={[a]:d||o.parse(c[m],m),[l]:i.parse(n[m],m)};return u}parseArrayData(e,n,r,s){const{xScale:o,yScale:i}=e,a=new Array(s);let l,c,d,u;for(l=0,c=s;l<c;++l)d=l+r,u=n[d],a[l]={x:o.parse(u[0],d),y:i.parse(u[1],d)};return a}parseObjectData(e,n,r,s){const{xScale:o,yScale:i}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,u,f,g;for(d=0,u=s;d<u;++d)f=d+r,g=n[f],c[d]={x:o.parse(Er(g,a),f),y:i.parse(Er(g,l),f)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const s=this.chart,o=this._cachedMeta,i=n[e.axis],a={keys:N0(s,!0),values:n._stacks[e.axis]._visualValues};return O0(a,i,o.index,{mode:r})}updateRangeFromParsed(e,n,r,s){const o=r[n.axis];let i=o===null?NaN:o;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,i=O0(s,o,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}getMinMax(e,n){const r=this._cachedMeta,s=r._parsed,o=r._sorted&&e===r.iScale,i=s.length,a=this._getOtherScale(e),l=TN(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=EN(a);let f,g;function m(){g=s[f];const p=g[a.axis];return!bn(g[e.axis])||d>p||u<p}for(f=0;f<i&&!(!m()&&(this.updateRangeFromParsed(c,e,g,l),o));++f);if(o){for(f=i-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,e,g,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let s,o,i;for(s=0,o=n.length;s<o;++s)i=n[s][e.axis],bn(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(e);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=CN(Ke(this.options.clip,kN(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,i=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(e,o,a,l),d=a;d<a+l;++d){const u=s[d];u.hidden||(u.active&&c?i.push(u):u.draw(e,o))}for(d=0;d<i.length;++d)i[d].draw(e,o)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const s=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const i=this._cachedMeta.data[e];o=i.$context||(i.$context=ON(this.getContext(),e,i)),o.parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=NN(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const s=n==="active",o=this._cachedDataOpts,i=e+"-"+n,a=o[i],l=this.enableOptionSharing&&mo(r);if(a)return D0(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,e),u=s?[`${e}Hover`,"hover",e,""]:[e,""],f=c.getOptionScopes(this.getDataset(),d),g=Object.keys(xt.elements[e]),m=()=>this.getContext(r,s,n),p=c.resolveNamedOptions(f,g,m,u);return p.$shared&&(p.$shared=l,o[i]=Object.freeze(D0(p,l))),p}_resolveAnimations(e,n,r){const s=this.chart,o=this._cachedDataOpts,i=`animation-${n}`,a=o[i];if(a)return a;let l;if(s.options.animation!==!1){const d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(f,this.getContext(e,r,n))}const c=new E0(s,l&&l.animations);return l&&l._cacheable&&(o[i]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||ld(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),s=this._sharedOptions,o=this.getSharedOptions(r),i=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:i}}updateElement(e,n,r,s){ld(s)?Object.assign(e,r):this._resolveAnimations(n,s).update(e,r)}updateSharedOptions(e,n,r){e&&!ld(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,s){e.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(e,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=r.length,o=n.length,i=Math.min(o,s);i&&this.parse(0,i),o>s?this._insertElements(s,o-s,e):o<s&&this._removeElements(o,s-o)}_insertElements(e,n,r=!0){const s=this._cachedMeta,o=s.data,i=e+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=i;a--)c[a]=c[a-n]};for(l(o),a=e;a<i;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(e,n),r&&this.updateElements(o,e,n,"reset")}updateElements(e,n,r,s){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(e,n);r._stacked&&xo(r,s)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,s]=e;this[n](r,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Pe(ys,"defaults",{}),Pe(ys,"datasetElementType",null),Pe(ys,"dataElementType",null);function AN(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let s=0,o=n.length;s<o;s++)r=r.concat(n[s].controller.getAllParsedValues(t));t._cache.$bar=e0(r.sort((s,o)=>s-o))}return t._cache.$bar}function DN(t){const e=t.iScale,n=AN(e,t.type);let r=e._length,s,o,i,a;const l=()=>{i===32767||i===-32768||(mo(a)&&(r=Math.min(r,Math.abs(i-a)||r)),a=i)};for(s=0,o=n.length;s<o;++s)i=e.getPixelForValue(n[s]),l();for(a=void 0,s=0,o=e.ticks.length;s<o;++s)i=e.getPixelForTick(s),l();return r}function IN(t,e,n,r){const s=n.barThickness;let o,i;return at(s)?(o=e.min*n.categoryPercentage,i=n.barPercentage):(o=s*r,i=1),{chunk:o/r,ratio:i,start:e.pixels[t]-o/2}}function LN(t,e,n,r){const s=e.pixels,o=s[t];let i=t>0?s[t-1]:null,a=t<s.length-1?s[t+1]:null;const l=n.categoryPercentage;i===null&&(i=o-(a===null?e.end-e.start:a-o)),a===null&&(a=o+o-i);const c=o-(o-Math.min(i,a))/2*l;return{chunk:Math.abs(a-i)/2*l/r,ratio:n.barPercentage,start:c}}function PN(t,e,n,r){const s=n.parse(t[0],r),o=n.parse(t[1],r),i=Math.min(s,o),a=Math.max(s,o);let l=i,c=a;Math.abs(i)>Math.abs(a)&&(l=a,c=i),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:i,max:a}}function I0(t,e,n,r){return Mt(t)?PN(t,e,n,r):e[n.axis]=n.parse(t,r),e}function L0(t,e,n,r){const s=t.iScale,o=t.vScale,i=s.getLabels(),a=s===o,l=[];let c,d,u,f;for(c=n,d=n+r;c<d;++c)f=e[c],u={},u[s.axis]=a||s.parse(i[c],c),l.push(I0(f,u,o,c));return l}function cd(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function $N(t,e,n){return t!==0?dr(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function FN(t){let e,n,r,s,o;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(s="end",o="start"):(s="start",o="end"),{start:n,end:r,reverse:e,top:s,bottom:o}}function VN(t,e,n,r){let s=e.borderSkipped;const o={};if(!s){t.borderSkipped=o;return}if(s===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:a,reverse:l,top:c,bottom:d}=FN(t);s==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?s=c:(n._bottom||0)===r?s=d:(o[P0(d,i,a,l)]=!0,s=c)),o[P0(s,i,a,l)]=!0,t.borderSkipped=o}function P0(t,e,n,r){return r?(t=zN(t,e,n),t=$0(t,n,e)):t=$0(t,e,n),t}function zN(t,e,n){return t===e?n:t===n?e:t}function $0(t,e,n){return t==="start"?e:t==="end"?n:t}function HN(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class fa extends ys{parsePrimitiveData(e,n,r,s){return L0(e,n,r,s)}parseArrayData(e,n,r,s){return L0(e,n,r,s)}parseObjectData(e,n,r,s){const{iScale:o,vScale:i}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=i.axis==="x"?a:l,u=[];let f,g,m,p;for(f=r,g=r+s;f<g;++f)p=n[f],m={},m[o.axis]=o.parse(Er(p,c),f),u.push(I0(Er(p,d),m,i,f));return u}updateRangeFromParsed(e,n,r,s){super.updateRangeFromParsed(e,n,r,s);const o=r._custom;o&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:r,vScale:s}=n,o=this.getParsed(e),i=o._custom,a=cd(i)?"["+i.start+", "+i.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,r,s){const o=s==="reset",{index:i,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s);for(let g=n;g<n+r;g++){const m=this.getParsed(g),p=o||at(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),y=this._calculateBarIndexPixels(g,d),b=(m._stacks||{})[a.axis],_={horizontal:c,base:p.base,enableBorderRadius:!b||cd(m._custom)||i===b._top||i===b._bottom,x:c?p.head:y.center,y:c?y.center:p.head,height:c?y.size:Math.abs(p.size),width:c?Math.abs(p.size):y.size};f&&(_.options=u||this.resolveDataElementOptions(g,e[g].active?"active":s));const x=_.options||e[g].options;VN(_,x,b,i),HN(_,x,d.ratio),this.updateElement(e[g],g,_,s)}}_getStacks(e,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=r.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=d=>{const u=d._parsed.find(g=>g[r.axis]===l),f=u&&u[d.vScale.axis];if(at(f)||isNaN(f))return!0};for(const d of s)if(!(n!==void 0&&c(d))&&((o===!1||i.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&i.push(d.stack),d.index===e))break;return i.length||i.push(void 0),i}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(r=>e[r].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[Ke(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,r){const s=this._getStacks(e,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const e=this.options,n=this._cachedMeta,r=n.iScale,s=[];let o,i;for(o=0,i=n.data.length;o<i;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=e.barThickness;return{min:a||DN(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:i}}=this,a=o||0,l=this.getParsed(e),c=l._custom,d=cd(c);let u=l[n.axis],f=0,g=r?this.applyStack(n,l,r):u,m,p;g!==u&&(f=g-u,g=u),d&&(u=c.barStart,g=c.barEnd-c.barStart,u!==0&&dr(u)!==dr(c.barEnd)&&(f=0),f+=u);const y=!at(o)&&!d?o:f;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(e)?m=n.getPixelForValue(f+g):m=b,p=m-b,Math.abs(p)<i){p=$N(p,n,a)*i,u===a&&(b-=p/2);const _=n.getPixelForDecimal(0),x=n.getPixelForDecimal(1),E=Math.min(_,x),S=Math.max(_,x);b=Math.max(Math.min(b,S),E),m=b+p,r&&!d&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(m)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const _=dr(p)*n.getLineWidthForValue(a)/2;b+=_,p-=_}return{size:p,base:b,head:m,center:m+p/2}}_calculateBarIndexPixels(e,n){const r=n.scale,s=this.options,o=s.skipNull,i=Ke(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const d=o?this._getStackCount(e):n.stackCount,u=s.barThickness==="flex"?LN(e,n,s,d*c):IN(e,n,s,d*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(Ke(f,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0)+g;a=u.start+u.chunk*m+u.chunk/2,l=Math.min(i,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(e)[r.axis],e),l=Math.min(i,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,n=e.vScale,r=e.data,s=r.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}Pe(fa,"id","bar"),Pe(fa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Pe(fa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function UN(t,e,n){let r=1,s=1,o=0,i=0;if(e<Ct){const a=t,l=a+e,c=Math.cos(a),d=Math.sin(a),u=Math.cos(l),f=Math.sin(l),g=(x,E,S)=>oa(x,a,l,!0)?1:Math.max(E,E*n,S,S*n),m=(x,E,S)=>oa(x,a,l,!0)?-1:Math.min(E,E*n,S,S*n),p=g(0,c,u),y=g(Nt,d,f),b=m(lt,c,u),_=m(lt+Nt,d,f);r=(p-b)/2,s=(y-_)/2,o=-(p+b)/2,i=-(y+_)/2}return{ratioX:r,ratioY:s,offsetX:o,offsetY:i}}class wo extends ys{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=l=>+r[l];if(Xe(r[e])){const{key:l="value"}=this._parsing;o=c=>+Er(r[c],l)}let i,a;for(i=e,a=e+n;i<a;++i)s._parsed[i]=o(i)}}_getRotation(){return qn(this.options.rotation-90)}_getCircumference(){return qn(this.options.circumference)}_getRotationExtents(){let e=Ct,n=-Ct;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),i=s._getCircumference();e=Math.min(e,o),n=Math.max(n,o+i)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-i)/2,0),l=Math.min(gM(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:m,offsetY:p}=UN(u,d,l),y=(r.width-i)/f,b=(r.height-i)/g,_=Math.max(Math.min(y,b)/2,0),x=jp(this.options.radius,_),E=Math.max(x*l,0),S=(x-E)/this._getVisibleDatasetWeightTotal();this.offsetX=m*x,this.offsetY=p*x,s.total=this.calculateTotal(),this.outerRadius=x-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(o,0,o.length,e)}_circumference(e,n){const r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*o/Ct)}updateElements(e,n,r,s){const o=s==="reset",i=this.chart,a=i.chartArea,c=i.options.animation,d=(a.left+a.right)/2,u=(a.top+a.bottom)/2,f=o&&c.animateScale,g=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:p,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),_;for(_=0;_<n;++_)b+=this._circumference(_,o);for(_=n;_<n+r;++_){const x=this._circumference(_,o),E=e[_],S={x:d+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:m,innerRadius:g};y&&(S.options=p||this.resolveDataElementOptions(_,E.active?"active":s)),b+=x,this.updateElement(E,_,S,s)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let r=0,s;for(s=0;s<n.length;s++){const o=e._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?Ct*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=qc(n._parsed[e],r.options.locale);return{label:s[e]||"",value:o}}getMaxBorderWidth(e){let n=0;const r=this.chart;let s,o,i,a,l;if(!e){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){i=r.getDatasetMeta(s),e=i.data,a=i.controller;break}}if(!e)return 0;for(s=0,o=e.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let r=0,s=e.length;r<s;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(e){return Math.max(Ke(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Pe(wo,"id","doughnut"),Pe(wo,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Pe(wo,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),Pe(wo,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data,{labels:{pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=e.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const u=e.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:u.backgroundColor,fontColor:o,hidden:!e.getDataVisibility(c),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:s,pointStyle:r,borderRadius:i&&(a||u.borderRadius),index:c}}):[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});function Ir(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class dd{constructor(e){Pe(this,"options");this.options=e||{}}static override(e){Object.assign(dd.prototype,e)}init(){}formats(){return Ir()}parse(){return Ir()}format(){return Ir()}add(){return Ir()}diff(){return Ir()}startOf(){return Ir()}endOf(){return Ir()}}var BN={_date:dd};function jN(t,e,n,r){const{controller:s,data:o,_sorted:i}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&i&&o.length){const c=a._reversePixels?NM:Yc;if(r){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(o,e,n-u),g=c(o,e,n+u);return{lo:f.lo,hi:g.hi}}}}else{const d=c(o,e,n);if(l){const{vScale:u}=s._cachedMeta,{_parsed:f}=t,g=f.slice(0,d.lo+1).reverse().findIndex(p=>!at(p[u.axis]));d.lo-=Math.max(0,g);const m=f.slice(d.hi).findIndex(p=>!at(p[u.axis]));d.hi+=Math.max(0,m)}return d}}return{lo:0,hi:o.length-1}}function ha(t,e,n,r,s){const o=t.getSortedVisibleDatasetMetas(),i=n[e];for(let a=0,l=o.length;a<l;++a){const{index:c,data:d}=o[a],{lo:u,hi:f}=jN(o[a],e,i,s);for(let g=u;g<=f;++g){const m=d[g];m.skip||r(m,c,g)}}}function WN(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,s){const o=e?Math.abs(r.x-s.x):0,i=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function ud(t,e,n,r,s){const o=[];return!s&&!t.isPointInArea(e)||ha(t,n,e,function(a,l,c){!s&&!h0(a,t.chartArea,0)||a.inRange(e.x,e.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function GN(t,e,n,r){let s=[];function o(i,a,l){const{startAngle:c,endAngle:d}=i.getProps(["startAngle","endAngle"],r),{angle:u}=Qp(i,{x:e.x,y:e.y});oa(u,c,d)&&s.push({element:i,datasetIndex:a,index:l})}return ha(t,n,e,o),s}function YN(t,e,n,r,s,o){let i=[];const a=WN(n);let l=Number.POSITIVE_INFINITY;function c(d,u,f){const g=d.inRange(e.x,e.y,s);if(r&&!g)return;const m=d.getCenterPoint(s);if(!(!!o||t.isPointInArea(m))&&!g)return;const y=a(e,m);y<l?(i=[{element:d,datasetIndex:u,index:f}],l=y):y===l&&i.push({element:d,datasetIndex:u,index:f})}return ha(t,n,e,c),i}function fd(t,e,n,r,s,o){return!o&&!t.isPointInArea(e)?[]:n==="r"&&!r?GN(t,e,n,s):YN(t,e,n,r,s,o)}function F0(t,e,n,r,s){const o=[],i=n==="x"?"inXRange":"inYRange";let a=!1;return ha(t,n,e,(l,c,d)=>{l[i]&&l[i](e[n],s)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(e.x,e.y,s))}),r&&!a?[]:o}var XN={modes:{index(t,e,n,r){const s=Dr(e,t),o=n.axis||"x",i=n.includeInvisible||!1,a=n.intersect?ud(t,s,o,r,i):fd(t,s,o,!1,r,i),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(t,e,n,r){const s=Dr(e,t),o=n.axis||"xy",i=n.includeInvisible||!1;let a=n.intersect?ud(t,s,o,r,i):fd(t,s,o,!1,r,i);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(t,e,n,r){const s=Dr(e,t),o=n.axis||"xy",i=n.includeInvisible||!1;return ud(t,s,o,r,i)},nearest(t,e,n,r){const s=Dr(e,t),o=n.axis||"xy",i=n.includeInvisible||!1;return fd(t,s,o,n.intersect,r,i)},x(t,e,n,r){const s=Dr(e,t);return F0(t,s,"x",n.intersect,r)},y(t,e,n,r){const s=Dr(e,t);return F0(t,s,"y",n.intersect,r)}}};const V0=["left","top","right","bottom"];function ko(t,e){return t.filter(n=>n.pos===e)}function z0(t,e){return t.filter(n=>V0.indexOf(n.pos)===-1&&n.box.axis===e)}function Co(t,e){return t.sort((n,r)=>{const s=e?r:n,o=e?n:r;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function KN(t){const e=[];let n,r,s,o,i,a;for(n=0,r=(t||[]).length;n<r;++n)s=t[n],{position:o,options:{stack:i,stackWeight:a=1}}=s,e.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:i&&o+i,stackWeight:a});return e}function qN(t){const e={};for(const n of t){const{stack:r,pos:s,stackWeight:o}=n;if(!r||!V0.includes(s))continue;const i=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return e}function ZN(t,e){const n=qN(t),{vBoxMaxWidth:r,hBoxMaxHeight:s}=e;let o,i,a;for(o=0,i=t.length;o<i;++o){a=t[o];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&e.availableWidth,a.height=s):(a.width=r,a.height=d?d*s:l&&e.availableHeight)}return n}function QN(t){const e=KN(t),n=Co(e.filter(c=>c.box.fullSize),!0),r=Co(ko(e,"left"),!0),s=Co(ko(e,"right")),o=Co(ko(e,"top"),!0),i=Co(ko(e,"bottom")),a=z0(e,"x"),l=z0(e,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:s.concat(l).concat(i).concat(a),chartArea:ko(e,"chartArea"),vertical:r.concat(s).concat(l),horizontal:o.concat(i).concat(a)}}function H0(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function U0(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function JN(t,e,n,r){const{pos:s,box:o}=n,i=t.maxPadding;if(!Xe(s)){n.size&&(t[s]-=n.size);const u=r[n.stack]||{size:0,count:1};u.size=Math.max(u.size,n.horizontal?o.height:o.width),n.size=u.size/u.count,t[s]+=n.size}o.getPadding&&U0(i,o.getPadding());const a=Math.max(0,e.outerWidth-H0(i,t,"left","right")),l=Math.max(0,e.outerHeight-H0(i,t,"top","bottom")),c=a!==t.w,d=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function RN(t){const e=t.maxPadding;function n(r){const s=Math.max(e[r]-t[r],0);return t[r]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function eO(t,e){const n=e.maxPadding;function r(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(i=>{o[i]=Math.max(e[i],n[i])}),o}return r(t?["left","right"]:["top","bottom"])}function So(t,e,n,r){const s=[];let o,i,a,l,c,d;for(o=0,i=t.length,c=0;o<i;++o){a=t[o],l=a.box,l.update(a.width||e.w,a.height||e.h,eO(a.horizontal,e));const{same:u,other:f}=JN(e,n,a,r);c|=u&&s.length,d=d||f,l.fullSize||s.push(a)}return c&&So(s,e,n,r)||d}function ga(t,e,n,r,s){t.top=n,t.left=e,t.right=e+r,t.bottom=n+s,t.width=r,t.height=s}function B0(t,e,n,r){const s=n.padding;let{x:o,y:i}=e;for(const a of t){const l=a.box,c=r[a.stack]||{placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const u=e.w*d,f=c.size||l.height;mo(c.start)&&(i=c.start),l.fullSize?ga(l,s.left,i,n.outerWidth-s.right-s.left,f):ga(l,e.left+c.placed,i,u,f),c.start=i,c.placed+=u,i=l.bottom}else{const u=e.h*d,f=c.size||l.width;mo(c.start)&&(o=c.start),l.fullSize?ga(l,o,s.top,f,n.outerHeight-s.bottom-s.top):ga(l,o,e.top+c.placed,f,u),c.start=o,c.placed+=u,o=l.right}}e.x=o,e.y=i}var vn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const s=yn(t.options.layout.padding),o=Math.max(e-s.width,0),i=Math.max(n-s.height,0),a=QN(t.boxes),l=a.vertical,c=a.horizontal;tt(t.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const d=l.reduce((p,y)=>y.box.options&&y.box.options.display===!1?p:p+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:o,availableHeight:i,vBoxMaxWidth:o/2/d,hBoxMaxHeight:i/2}),f=Object.assign({},s);U0(f,yn(r));const g=Object.assign({maxPadding:f,w:o,h:i,x:s.left,y:s.top},s),m=ZN(l.concat(c),u);So(a.fullSize,g,u,m),So(l,g,u,m),So(c,g,u,m)&&So(l,g,u,m),RN(g),B0(a.leftAndTop,g,u,m),g.x+=g.w,g.y+=g.h,B0(a.rightAndBottom,g,u,m),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},tt(a.chartArea,p=>{const y=p.box;Object.assign(y,t.chartArea),y.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class j0{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,s){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(e){return!0}updateConfig(e){}}class tO extends j0{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const pa="$chartjs",nO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},W0=t=>t===null||t==="";function rO(t,e){const n=t.style,r=t.getAttribute("height"),s=t.getAttribute("width");if(t[pa]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",W0(s)){const o=k0(t,"width");o!==void 0&&(t.width=o)}if(W0(r))if(t.style.height==="")t.height=t.width/(e||2);else{const o=k0(t,"height");o!==void 0&&(t.height=o)}return t}const G0=fN?{passive:!0}:!1;function sO(t,e,n){t&&t.addEventListener(e,n,G0)}function oO(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,G0)}function iO(t,e){const n=nO[t.type]||t.type,{x:r,y:s}=Dr(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:s!==void 0?s:null}}function ma(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function aO(t,e,n){const r=t.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||ma(a.addedNodes,r),i=i&&!ma(a.removedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function lO(t,e,n){const r=t.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||ma(a.removedNodes,r),i=i&&!ma(a.addedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const _o=new Map;let Y0=0;function X0(){const t=window.devicePixelRatio;t!==Y0&&(Y0=t,_o.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function cO(t,e){_o.size||window.addEventListener("resize",X0),_o.set(t,e)}function dO(t){_o.delete(t),_o.size||window.removeEventListener("resize",X0)}function uO(t,e,n){const r=t.canvas,s=r&&od(r);if(!s)return;const o=n0((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),i=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return i.observe(s),cO(t,o),i}function hd(t,e,n){n&&n.disconnect(),e==="resize"&&dO(t)}function fO(t,e,n){const r=t.canvas,s=n0(o=>{t.ctx!==null&&n(iO(o,t))},t);return sO(r,e,s),s}class hO extends j0{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(rO(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[pa])return!1;const r=n[pa].initial;["height","width"].forEach(o=>{const i=r[o];at(i)?n.removeAttribute(o):n.setAttribute(o,i)});const s=r.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[pa],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),i={attach:aO,detach:lO,resize:uO}[n]||fO;s[n]=i(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),s=r[n];if(!s)return;({attach:hd,detach:hd,resize:hd}[n]||oO)(e,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,s){return uN(e,n,r,s)}isAttached(e){const n=e&&od(e);return!!(n&&n.isConnected)}}function gO(t){return!sd()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?tO:hO}let Lr=(Aa=class{constructor(){Pe(this,"x");Pe(this,"y");Pe(this,"active",!1);Pe(this,"options");Pe(this,"$animations")}tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return sa(this.x)&&sa(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const s={};return e.forEach(o=>{s[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),s}},Pe(Aa,"defaults",{}),Pe(Aa,"defaultRoutes"),Aa);function pO(t,e){const n=t.options.ticks,r=mO(t),s=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?yO(e):[],i=o.length,a=o[0],l=o[i-1],c=[];if(i>s)return vO(e,c,o,i/s),c;const d=bO(o,e,s);if(i>0){let u,f;const g=i>1?Math.round((l-a)/(i-1)):null;for(ba(e,c,d,at(g)?0:a-g,a),u=0,f=i-1;u<f;u++)ba(e,c,d,o[u],o[u+1]);return ba(e,c,d,l,at(g)?e.length:l+g),c}return ba(e,c,d),c}function mO(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),s=t._maxLength/n;return Math.floor(Math.min(r,s))}function bO(t,e,n){const r=xO(t),s=e.length/n;if(!r)return Math.max(s,1);const o=wM(r);for(let i=0,a=o.length-1;i<a;i++){const l=o[i];if(l>s)return l}return Math.max(s,1)}function yO(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function vO(t,e,n,r){let s=0,o=n[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===o&&(e.push(t[i]),s++,o=n[s*r])}function ba(t,e,n,r,s){const o=Ke(r,0),i=Math.min(Ke(s,t.length),t.length);let a=0,l,c,d;for(n=Math.ceil(n),s&&(l=s-r,n=l/Math.floor(l/n)),d=o;d<0;)a++,d=Math.round(o+a*n);for(c=Math.max(o,0);c<i;c++)c===d&&(e.push(t[c]),a++,d=Math.round(o+a*n))}function xO(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const wO=t=>t==="left"?"right":t==="right"?"left":t,K0=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,q0=(t,e)=>Math.min(e||t,t);function Z0(t,e){const n=[],r=t.length/e,s=t.length;let o=0;for(;o<s;o+=r)n.push(t[Math.floor(o)]);return n}function kO(t,e,n){const r=t.ticks.length,s=Math.min(e,r-1),o=t._startPixel,i=t._endPixel,a=1e-6;let l=t.getPixelForTick(s),c;if(!(n&&(r===1?c=Math.max(l-o,i-l):e===0?c=(t.getPixelForTick(1)-l)/2:c=(l-t.getPixelForTick(s-1))/2,l+=s<e?c:-c,l<o-a||l>i+a)))return l}function CO(t,e){tt(t,n=>{const r=n.gc,s=r.length/2;let o;if(s>e){for(o=0;o<s;++o)delete n.data[r[o]];r.splice(0,s)}})}function Eo(t){return t.drawTicks?t.tickLength:0}function Q0(t,e){if(!t.display)return 0;const n=Wt(t.font,e),r=yn(t.padding);return(Mt(t.text)?t.text.length:1)*n.lineHeight+r.height}function SO(t,e){return ps(t,{scale:e,type:"scale"})}function _O(t,e,n){return ps(t,{tick:n,index:e,type:"tick"})}function EO(t,e,n){let r=Xc(t);return(n&&e!=="right"||!n&&e==="right")&&(r=wO(r)),r}function MO(t,e,n,r){const{top:s,left:o,bottom:i,right:a,chart:l}=t,{chartArea:c,scales:d}=l;let u=0,f,g,m;const p=i-s,y=a-o;if(t.isHorizontal()){if(g=jt(r,o,a),Xe(n)){const b=Object.keys(n)[0],_=n[b];m=d[b].getPixelForValue(_)+p-e}else n==="center"?m=(c.bottom+c.top)/2+p-e:m=K0(t,n,e);f=a-o}else{if(Xe(n)){const b=Object.keys(n)[0],_=n[b];g=d[b].getPixelForValue(_)-y+e}else n==="center"?g=(c.left+c.right)/2-y+e:g=K0(t,n,e);m=jt(r,i,s),u=n==="left"?-Nt:Nt}return{titleX:g,titleY:m,maxWidth:f,rotation:u}}class vs extends Lr{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return e=zn(e,Number.POSITIVE_INFINITY),n=zn(n,Number.NEGATIVE_INFINITY),r=zn(r,Number.POSITIVE_INFINITY),s=zn(s,Number.NEGATIVE_INFINITY),{min:zn(e,r),max:zn(n,s),minDefined:bn(e),maxDefined:bn(n)}}getMinMax(e){let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds(),i;if(s&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)i=a[l].controller.getMinMax(this,e),s||(n=Math.min(n,i.min)),o||(r=Math.max(r,i.max));return n=o&&n>r?r:n,r=s&&n>r?n:r,{min:zn(n,zn(r,n)),max:zn(r,zn(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ut(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:s,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ZM(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Z0(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=pO(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ut(this.options.afterUpdate,[this])}beforeSetDimensions(){ut(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ut(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ut(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ut(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,s,o;for(r=0,s=e.length;r<s;r++)o=e[r],o.label=ut(n.callback,[o.value,r,e],this)}afterTickToLabelConversion(){ut(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ut(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=q0(this.ticks.length,e.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let i=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),u=d.widest.width,f=d.highest.height,g=nn(this.chart.width-u,0,this.maxWidth);a=e.offset?this.maxWidth/r:g/(r-1),u+6>a&&(a=g/(r-(e.offset?.5:1)),l=this.maxHeight-Eo(e.grid)-n.padding-Q0(e.title,this.chart.options.font),c=Math.sqrt(u*u+f*f),i=_M(Math.min(Math.asin(nn((d.highest.height+6)/a,-1,1)),Math.asin(nn(l/c,-1,1))-Math.asin(nn(f/c,-1,1)))),i=Math.max(s,Math.min(o,i))),this.labelRotation=i}afterCalculateLabelRotation(){ut(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ut(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const l=Q0(s,n.options.font);if(a?(e.width=this.maxWidth,e.height=Eo(o)+l):(e.height=this.maxHeight,e.width=Eo(o)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:u,highest:f}=this._getLabelSizes(),g=r.padding*2,m=qn(this.labelRotation),p=Math.cos(m),y=Math.sin(m);if(a){const b=r.mirror?0:y*u.width+p*f.height;e.height=Math.min(this.maxHeight,e.height+b+g)}else{const b=r.mirror?0:p*u.width+y*f.height;e.width=Math.min(this.maxWidth,e.width+b+g)}this._calculatePadding(c,d,y,p)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,s){const{ticks:{align:o,padding:i},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*e.width,g=r*n.height):(f=r*e.height,g=s*n.width):o==="start"?g=n.width:o==="end"?f=e.width:o!=="inner"&&(f=e.width/2,g=n.width/2),this.paddingLeft=Math.max((f-d+i)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-u+i)*this.width/(this.width-u),0)}else{let d=n.height/2,u=e.height/2;o==="start"?(d=0,u=e.height):o==="end"&&(d=n.height,u=0),this.paddingTop=d+i,this.paddingBottom=u+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ut(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)at(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Z0(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:s,_longestTextCache:o}=this,i=[],a=[],l=Math.floor(n/q0(n,r));let c=0,d=0,u,f,g,m,p,y,b,_,x,E,S;for(u=0;u<n;u+=l){if(m=e[u].label,p=this._resolveTickFontOptions(u),s.font=y=p.string,b=o[y]=o[y]||{data:{},gc:[]},_=p.lineHeight,x=E=0,!at(m)&&!Mt(m))x=c0(s,b.data,b.gc,x,m),E=_;else if(Mt(m))for(f=0,g=m.length;f<g;++f)S=m[f],!at(S)&&!Mt(S)&&(x=c0(s,b.data,b.gc,x,S),E+=_);i.push(x),a.push(E),c=Math.max(x,c),d=Math.max(E,d)}CO(o,n);const w=i.indexOf(c),N=a.indexOf(d),C=k=>({width:i[k]||0,height:a[k]||0});return{first:C(0),last:C(n-1),widest:C(w),highest:C(N),widths:i,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return MM(this._alignToPixels?Tr(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=_O(this.getContext(),e,r))}return this.$context||(this.$context=SO(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=qn(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),i=e.autoSkipPadding||0,a=o?o.widest.width+i:0,l=o?o.highest.height+i:0;return this.isHorizontal()?l*r>a*s?a/r:l/s:l*s<a*r?l/r:a/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,s=this.options,{grid:o,position:i,border:a}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),f=Eo(o),g=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,y=p/2,b=function(A){return Tr(r,A,p)};let _,x,E,S,w,N,C,k,M,T,L,P;if(i==="top")_=b(this.bottom),N=this.bottom-f,k=_-y,T=b(e.top)+y,P=e.bottom;else if(i==="bottom")_=b(this.top),T=e.top,P=b(e.bottom)-y,N=_+y,k=this.top+f;else if(i==="left")_=b(this.right),w=this.right-f,C=_-y,M=b(e.left)+y,L=e.right;else if(i==="right")_=b(this.left),M=e.left,L=b(e.right)-y,w=_+y,C=this.left+f;else if(n==="x"){if(i==="center")_=b((e.top+e.bottom)/2+.5);else if(Xe(i)){const A=Object.keys(i)[0],O=i[A];_=b(this.chart.scales[A].getPixelForValue(O))}T=e.top,P=e.bottom,N=_+y,k=N+f}else if(n==="y"){if(i==="center")_=b((e.left+e.right)/2);else if(Xe(i)){const A=Object.keys(i)[0],O=i[A];_=b(this.chart.scales[A].getPixelForValue(O))}w=_-y,C=w-f,M=e.left,L=e.right}const F=Ke(s.ticks.maxTicksLimit,u),D=Math.max(1,Math.ceil(u/F));for(x=0;x<u;x+=D){const A=this.getContext(x),O=o.setContext(A),V=a.setContext(A),H=O.lineWidth,W=O.color,j=V.dash||[],U=V.dashOffset,B=O.tickWidth,G=O.tickColor,z=O.tickBorderDash||[],X=O.tickBorderDashOffset;E=kO(this,x,l),E!==void 0&&(S=Tr(r,E,H),c?w=C=M=L=S:N=k=T=P=S,g.push({tx1:w,ty1:N,tx2:C,ty2:k,x1:M,y1:T,x2:L,y2:P,width:H,color:W,borderDash:j,borderDashOffset:U,tickWidth:B,tickColor:G,tickBorderDash:z,tickBorderDashOffset:X}))}return this._ticksLength=u,this._borderValue=_,g}_computeLabelItems(e){const n=this.axis,r=this.options,{position:s,ticks:o}=r,i=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=o,f=Eo(r.grid),g=f+d,m=u?-d:g,p=-qn(this.labelRotation),y=[];let b,_,x,E,S,w,N,C,k,M,T,L,P="middle";if(s==="top")w=this.bottom-m,N=this._getXAxisLabelAlignment();else if(s==="bottom")w=this.top+m,N=this._getXAxisLabelAlignment();else if(s==="left"){const D=this._getYAxisLabelAlignment(f);N=D.textAlign,S=D.x}else if(s==="right"){const D=this._getYAxisLabelAlignment(f);N=D.textAlign,S=D.x}else if(n==="x"){if(s==="center")w=(e.top+e.bottom)/2+g;else if(Xe(s)){const D=Object.keys(s)[0],A=s[D];w=this.chart.scales[D].getPixelForValue(A)+g}N=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")S=(e.left+e.right)/2-g;else if(Xe(s)){const D=Object.keys(s)[0],A=s[D];S=this.chart.scales[D].getPixelForValue(A)}N=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?P="top":l==="end"&&(P="bottom"));const F=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){x=a[b],E=x.label;const D=o.setContext(this.getContext(b));C=this.getPixelForTick(b)+o.labelOffset,k=this._resolveTickFontOptions(b),M=k.lineHeight,T=Mt(E)?E.length:1;const A=T/2,O=D.color,V=D.textStrokeColor,H=D.textStrokeWidth;let W=N;i?(S=C,N==="inner"&&(b===_-1?W=this.options.reverse?"left":"right":b===0?W=this.options.reverse?"right":"left":W="center"),s==="top"?c==="near"||p!==0?L=-T*M+M/2:c==="center"?L=-F.highest.height/2-A*M+M:L=-F.highest.height+M/2:c==="near"||p!==0?L=M/2:c==="center"?L=F.highest.height/2-A*M:L=F.highest.height-T*M,u&&(L*=-1),p!==0&&!D.showLabelBackdrop&&(S+=M/2*Math.sin(p))):(w=C,L=(1-T)*M/2);let j;if(D.showLabelBackdrop){const U=yn(D.backdropPadding),B=F.heights[b],G=F.widths[b];let z=L-U.top,X=0-U.left;switch(P){case"middle":z-=B/2;break;case"bottom":z-=B;break}switch(N){case"center":X-=G/2;break;case"right":X-=G;break;case"inner":b===_-1?X-=G:b>0&&(X-=G/2);break}j={left:X,top:z,width:G+U.width,height:B+U.height,color:D.backdropColor}}y.push({label:E,font:k,textOffset:L,options:{rotation:p,color:O,strokeColor:V,strokeWidth:H,textAlign:W,textBaseline:P,translation:[S,w],backdrop:j}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-qn(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:s,padding:o}}=this.options,i=this._getLabelSizes(),a=e+o,l=i.widest.width;let c,d;return n==="left"?s?(d=this.right+o,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?s?(d=this.left+o,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:s,width:o,height:i}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,s,o,i),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,i;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,i=s.length;o<i;++o){const l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:r,grid:s}}=this,o=r.setContext(this.getContext()),i=r.display?o.width:0;if(!i)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,u,f;this.isHorizontal()?(c=Tr(e,this.left,i)-i/2,d=Tr(e,this.right,a)+a/2,u=f=l):(u=Tr(e,this.top,i)-i/2,f=Tr(e,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,u),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&Jc(r,s);const o=this.getLabelItems(e);for(const i of o){const a=i.options,l=i.font,c=i.label,d=i.textOffset;vo(r,c,0,d,l,a)}s&&Rc(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const o=Wt(r.font),i=yn(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Xe(n)?(l+=i.bottom,Mt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=i.top;const{titleX:c,titleY:d,maxWidth:u,rotation:f}=MO(this,l,n,a);vo(e,r.text,0,0,o,{color:r.color,maxWidth:u,rotation:f,textAlign:EO(a,n,s),textBaseline:"middle",translation:[c,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=Ke(e.grid&&e.grid.z,-1),s=Ke(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==vs.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];a[r]===this.id&&(!e||a.type===e)&&s.push(a)}return s}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Wt(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ya{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;TO(n)&&(r=this.register(n));const s=this.items,o=e.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in s||(s[o]=e,NO(e,i,r),this.override&&xt.override(e.id,e.overrides)),i}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,s=this.scope;r in n&&delete n[r],s&&r in xt[s]&&(delete xt[s][r],this.override&&delete Or[r])}}function NO(t,e,n){const r=go(Object.create(null),[n?xt.get(n):{},xt.get(e),t.defaults]);xt.set(e,r),t.defaultRoutes&&OO(e,t.defaultRoutes),t.descriptors&&xt.describe(e,t.descriptors)}function OO(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),s=r.pop(),o=[t].concat(r).join("."),i=e[n].split("."),a=i.pop(),l=i.join(".");xt.route(o,s,l,a)})}function TO(t){return"id"in t&&"defaults"in t}class AO{constructor(){this.controllers=new ya(ys,"datasets",!0),this.elements=new ya(Lr,"elements"),this.plugins=new ya(Object,"plugins"),this.scales=new ya(vs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,r){[...n].forEach(s=>{const o=r||this._getRegistryForType(s);r||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):tt(s,i=>{const a=r||this._getRegistryForType(i);this._exec(e,a,i)})})}_exec(e,n,r){const s=Wc(e);ut(r["before"+s],[],r),n[e](r),ut(r["after"+s],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const s=n.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return s}}var Un=new AO;class DO{constructor(){this._init=void 0}notify(e,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const o=s?this._descriptors(e).filter(s):this._descriptors(e),i=this._notify(o,e,n,r);return n==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),i}_notify(e,n,r,s){s=s||{};for(const o of e){const i=o.plugin,a=i[r],l=[n,s,o.options];if(ut(a,l,i)===!1&&s.cancelable)return!1}return!0}invalidate(){at(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,s=Ke(r.options&&r.options.plugins,{}),o=IO(r);return s===!1&&!n?[]:PO(e,o,s,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,s=(o,i)=>o.filter(a=>!i.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,r),e,"stop"),this._notify(s(r,n),e,"start")}}function IO(t){const e={},n=[],r=Object.keys(Un.plugins.items);for(let o=0;o<r.length;o++)n.push(Un.getPlugin(r[o]));const s=t.plugins||[];for(let o=0;o<s.length;o++){const i=s[o];n.indexOf(i)===-1&&(n.push(i),e[i.id]=!0)}return{plugins:n,localIds:e}}function LO(t,e){return!e&&t===!1?null:t===!0?{}:t}function PO(t,{plugins:e,localIds:n},r,s){const o=[],i=t.getContext();for(const a of e){const l=a.id,c=LO(r[l],s);c!==null&&o.push({plugin:a,options:$O(t.config,{plugin:a,local:n[l]},c,i)})}return o}function $O(t,{plugin:e,local:n},r,s){const o=t.pluginScopeKeys(e),i=t.getOptionScopes(r,o);return n&&e.defaults&&i.push(e.defaults),t.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function gd(t,e){const n=xt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function FO(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function VO(t,e){return t===e?"_index_":"_value_"}function J0(t){if(t==="x"||t==="y"||t==="r")return t}function zO(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function pd(t,...e){if(J0(t))return t;for(const n of e){const r=n.axis||zO(n.position)||t.length>1&&J0(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function R0(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function HO(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return R0(t,"x",n[0])||R0(t,"y",n[0])}return{}}function UO(t,e){const n=Or[t.type]||{scales:{}},r=e.scales||{},s=gd(t.type,e),o=Object.create(null);return Object.keys(r).forEach(i=>{const a=r[i];if(!Xe(a))return console.error(`Invalid scale configuration for scale: ${i}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const l=pd(i,a,HO(i,t),xt.scales[a.type]),c=VO(l,s),d=n.scales||{};o[i]=po(Object.create(null),[{axis:l},a,d[l],d[c]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,l=i.indexAxis||gd(a,e),d=(Or[a]||{}).scales||{};Object.keys(d).forEach(u=>{const f=FO(u,l),g=i[f+"AxisID"]||f;o[g]=o[g]||Object.create(null),po(o[g],[{axis:f},r[g],d[u]])})}),Object.keys(o).forEach(i=>{const a=o[i];po(a,[xt.scales[a.type],xt.scale])}),o}function em(t){const e=t.options||(t.options={});e.plugins=Ke(e.plugins,{}),e.scales=UO(t,e)}function tm(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function BO(t){return t=t||{},t.data=tm(t.data),em(t),t}const nm=new Map,rm=new Set;function va(t,e){let n=nm.get(t);return n||(n=e(),nm.set(t,n),rm.add(n)),n}const Mo=(t,e,n)=>{const r=Er(e,n);r!==void 0&&t.add(r)};class jO{constructor(e){this._config=BO(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=tm(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),em(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return va(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return va(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return va(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return va(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let s=r.get(e);return(!s||n)&&(s=new Map,r.set(e,s)),s}getOptionScopes(e,n,r){const{options:s,type:o}=this,i=this._cachedScopes(e,r),a=i.get(n);if(a)return a;const l=new Set;n.forEach(d=>{e&&(l.add(e),d.forEach(u=>Mo(l,e,u))),d.forEach(u=>Mo(l,s,u)),d.forEach(u=>Mo(l,Or[o]||{},u)),d.forEach(u=>Mo(l,xt,u)),d.forEach(u=>Mo(l,Zc,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),rm.has(n)&&i.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,Or[n]||{},xt.datasets[n]||{},{type:n},xt,Zc]}resolveNamedOptions(e,n,r,s=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=sm(this._resolverCache,e,s);let l=i;if(GO(i,n)){o.$shared=!1,r=cr(r)?r():r;const c=this.createResolver(e,r,a);l=ms(i,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(e,n,r=[""],s){const{resolver:o}=sm(this._resolverCache,e,r);return Xe(n)?ms(o,n,void 0,s):o}}function sm(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const s=n.join();let o=r.get(s);return o||(o={resolver:td(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,o)),o}const WO=t=>Xe(t)&&Object.getOwnPropertyNames(t).some(e=>cr(t[e]));function GO(t,e){const{isScriptable:n,isIndexable:r}=p0(t);for(const s of e){const o=n(s),i=r(s),a=(i||o)&&t[s];if(o&&(cr(a)||WO(a))||i&&Mt(a))return!0}return!1}var YO="4.5.1";const XO=["top","bottom","left","right","chartArea"];function om(t,e){return t==="top"||t==="bottom"||XO.indexOf(t)===-1&&e==="x"}function im(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function am(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ut(n&&n.onComplete,[t],e)}function KO(t){const e=t.chart,n=e.options.animation;ut(n&&n.onProgress,[t],e)}function lm(t){return sd()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const xa={},cm=t=>{const e=lm(t);return Object.values(xa).filter(n=>n.canvas===e).pop()};function qO(t,e,n){const r=Object.keys(t);for(const s of r){const o=+s;if(o>=e){const i=t[s];delete t[s],(n>0||o>e)&&(t[o+n]=i)}}}function ZO(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}let No=(hr=class{static register(...e){Un.add(...e),dm()}static unregister(...e){Un.remove(...e),dm()}constructor(e,n){const r=this.config=new jO(n),s=lm(e),o=cm(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||gO(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,i.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=hM(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new DO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=AM(u=>this.update(u),i.resizeDelay||0),this._dataChanges=[],xa[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Zn.listen(this,"complete",am),Zn.listen(this,"progress",KO),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return at(e)?n&&o?o:s?r/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Un}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():w0(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return d0(this.canvas,this.ctx),this}stop(){return Zn.stop(this),this}resize(e,n){Zn.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(s,e,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,w0(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),ut(r.onResize,[this,i],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};tt(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,s=Object.keys(r).reduce((i,a)=>(i[a]=!1,i),{});let o=[];n&&(o=o.concat(Object.keys(n).map(i=>{const a=n[i],l=pd(i,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),tt(o,i=>{const a=i.options,l=a.id,c=pd(l,a),d=Ke(a.type,i.dtype);(a.position===void 0||om(a.position,c)!==om(i.dposition))&&(a.position=i.dposition),s[l]=!0;let u=null;if(l in r&&r[l].type===d)u=r[l];else{const f=Un.getScale(d);u=new f({id:l,type:d,ctx:this.ctx,chart:this}),r[u.id]=u}u.init(a,e)}),tt(s,(i,a)=>{i||delete r[a]}),tt(r,i=>{vn.configure(this,i,i.options),vn.addBox(this,i)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(im("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const o=n[r];let i=this.getDatasetMeta(r);const a=o.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=a,i.indexAxis=o.indexAxis||gd(a,this.options),i.order=o.order||0,i.index=r,i.label=""+o.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const l=Un.getController(a),{datasetElementType:c,dataElementType:d}=xt.datasets[a];Object.assign(l,{dataElementType:Un.getElement(d),datasetElementType:c&&Un.getElement(c)}),i.controller=new l(this,r),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){tt(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:u}=this.getDatasetMeta(c),f=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(f),i=Math.max(+u.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),s||tt(o,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(im("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){tt(this.scales,e=>{vn.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!Yp(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:o}of n){const i=r==="_removeElements"?-o:o;qO(e,s,i)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(e.filter(i=>i[0]===o).map((i,a)=>a+","+i.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!Yp(s,r(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vn.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],tt(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,cr(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),s={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Zn.has(this)?this.attached&&!Zn.running(this)&&Zn.start(this):(this.draw(),am({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let s,o;for(s=0,o=n.length;s<o;++s){const i=n[s];(!e||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r={meta:e,index:e.index,cancelable:!0},s=mN(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Jc(n,s),e.controller.draw(),s&&Rc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return h0(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,s){const o=XN.modes[n];return typeof o=="function"?o(this,e,r,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=ps(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const s=r?"show":"hide",o=this.getDatasetMeta(e),i=o.controller._resolveAnimations(void 0,s);mo(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),i.update(o,{visible:r}),this.update(a=>a.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Zn.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),d0(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,r=(o,i)=>{n.addEventListener(this,o,i),e[o]=i},s=(o,i,a)=>{o.offsetX=i,o.offsetY=a,this._eventHandler(o)};tt(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},s=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let i;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",i)};i=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():i()}unbindEvents(){tt(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},tt(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const s=r?"set":"remove";let o,i,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){i=e[a];const c=i&&this.getDatasetMeta(i.datasetIndex).controller;c&&c[s+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:o,index:i})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[i],index:i}});!ea(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),i=o(n,e),a=r?e:o(e,n);i.length&&this.updateHoverStyle(i,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=i=>(i.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const o=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:s=[],options:o}=this,i=n,a=this._getActiveElements(e,s,r,i),l=vM(e),c=ZO(e,this._lastEvent,r,l);r&&(this._lastEvent=null,ut(o.onHover,[e,a,this],this),l&&ut(o.onClick,[e,a,this],this));const d=!ea(a,s);return(d||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,d}_getActiveElements(e,n,r,s){if(e.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}},Pe(hr,"defaults",xt),Pe(hr,"instances",xa),Pe(hr,"overrides",Or),Pe(hr,"registry",Un),Pe(hr,"version",YO),Pe(hr,"getChart",cm),hr);function dm(){return tt(No.instances,t=>t._plugins.invalidate())}function QO(t,e,n){const{startAngle:r,x:s,y:o,outerRadius:i,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:d}=l,u=Math.min(c/i,Hn(r-n));if(t.beginPath(),t.arc(s,o,i-c/2,r+u/2,n-u/2),a>0){const f=Math.min(c/a,Hn(r-n));t.arc(s,o,a+c/2,n-f/2,r+f/2,!0)}else{const f=Math.min(c/2,i*Hn(r-n));if(d==="round")t.arc(s,o,f,n-lt/2,r+lt/2,!0);else if(d==="bevel"){const g=2*f*f,m=-g*Math.cos(n+lt/2)+s,p=-g*Math.sin(n+lt/2)+o,y=g*Math.cos(r+lt/2)+s,b=g*Math.sin(r+lt/2)+o;t.lineTo(m,p),t.lineTo(y,b)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function JO(t,e,n){const{startAngle:r,pixelMargin:s,x:o,y:i,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(o,i,a,r-c,n+c),l>s?(c=s/l,t.arc(o,i,l,n+c,r-c,!0)):t.arc(o,i,s,n+Nt,r-Nt),t.closePath(),t.clip()}function RO(t){return ed(t,["outerStart","outerEnd","innerStart","innerEnd"])}function e5(t,e,n,r){const s=RO(t.options.borderRadius),o=(n-e)/2,i=Math.min(o,r*e/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return nn(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:nn(s.innerStart,0,i),innerEnd:nn(s.innerEnd,0,i)}}function xs(t,e,n,r){return{x:n+t*Math.cos(e),y:r+t*Math.sin(e)}}function wa(t,e,n,r,s,o){const{x:i,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=e,u=Math.max(e.outerRadius+r+n-c,0),f=d>0?d+r+n+c:0;let g=0;const m=s-l;if(r){const D=d>0?d-r:0,A=u>0?u-r:0,O=(D+A)/2,V=O!==0?m*O/(O+r):m;g=(m-V)/2}const p=Math.max(.001,m*u-n/lt)/u,y=(m-p)/2,b=l+y+g,_=s-y-g,{outerStart:x,outerEnd:E,innerStart:S,innerEnd:w}=e5(e,f,u,_-b),N=u-x,C=u-E,k=b+x/N,M=_-E/C,T=f+S,L=f+w,P=b+S/T,F=_-w/L;if(t.beginPath(),o){const D=(k+M)/2;if(t.arc(i,a,u,k,D),t.arc(i,a,u,D,M),E>0){const H=xs(C,M,i,a);t.arc(H.x,H.y,E,M,_+Nt)}const A=xs(L,_,i,a);if(t.lineTo(A.x,A.y),w>0){const H=xs(L,F,i,a);t.arc(H.x,H.y,w,_+Nt,F+Math.PI)}const O=(_-w/f+(b+S/f))/2;if(t.arc(i,a,f,_-w/f,O,!0),t.arc(i,a,f,O,b+S/f,!0),S>0){const H=xs(T,P,i,a);t.arc(H.x,H.y,S,P+Math.PI,b-Nt)}const V=xs(N,b,i,a);if(t.lineTo(V.x,V.y),x>0){const H=xs(N,k,i,a);t.arc(H.x,H.y,x,b-Nt,k)}}else{t.moveTo(i,a);const D=Math.cos(k)*u+i,A=Math.sin(k)*u+a;t.lineTo(D,A);const O=Math.cos(M)*u+i,V=Math.sin(M)*u+a;t.lineTo(O,V)}t.closePath()}function t5(t,e,n,r,s){const{fullCircles:o,startAngle:i,circumference:a}=e;let l=e.endAngle;if(o){wa(t,e,n,r,l,s);for(let c=0;c<o;++c)t.fill();isNaN(a)||(l=i+(a%Ct||Ct))}return wa(t,e,n,r,l,s),t.fill(),l}function n5(t,e,n,r,s){const{fullCircles:o,startAngle:i,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:d,borderDash:u,borderDashOffset:f,borderRadius:g}=l,m=l.borderAlign==="inner";if(!c)return;t.setLineDash(u||[]),t.lineDashOffset=f,m?(t.lineWidth=c*2,t.lineJoin=d||"round"):(t.lineWidth=c,t.lineJoin=d||"bevel");let p=e.endAngle;if(o){wa(t,e,n,r,p,s);for(let y=0;y<o;++y)t.stroke();isNaN(a)||(p=i+(a%Ct||Ct))}m&&JO(t,e,p),l.selfJoin&&p-i>=lt&&g===0&&d!=="miter"&&QO(t,e,p),o||(wa(t,e,n,r,p,s),t.stroke())}class Oo extends Lr{constructor(n){super();Pe(this,"circumference");Pe(this,"endAngle");Pe(this,"fullCircles");Pe(this,"innerRadius");Pe(this,"outerRadius");Pe(this,"pixelMargin");Pe(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,s){const o=this.getProps(["x","y"],s),{angle:i,distance:a}=Qp(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,m=Ke(f,c-l),p=oa(i,l,c)&&l!==c,y=m>=Ct||p,b=Nr(a,d+g,u+g);return y&&b}getCenterPoint(n){const{x:r,y:s,startAngle:o,endAngle:i,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,u=(o+i)/2,f=(a+l+d+c)/2;return{x:r+Math.cos(u)*f,y:s+Math.sin(u)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:s}=this,o=(r.offset||0)/4,i=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=s>Ct?Math.floor(s/Ct):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(lt,s||0)),d=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,t5(n,this,d,i,a),n5(n,this,d,i,a),n.restore()}}Pe(Oo,"id","arc"),Pe(Oo,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),Pe(Oo,"defaultRoutes",{backgroundColor:"backgroundColor"}),Pe(Oo,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function um(t,e){const{x:n,y:r,base:s,width:o,height:i}=t.getProps(["x","y","base","width","height"],e);let a,l,c,d,u;return t.horizontal?(u=i/2,a=Math.min(n,s),l=Math.max(n,s),c=r-u,d=r+u):(u=o/2,a=n-u,l=n+u,c=Math.min(r,s),d=Math.max(r,s)),{left:a,top:c,right:l,bottom:d}}function fr(t,e,n,r){return t?0:nn(e,n,r)}function r5(t,e,n){const r=t.options.borderWidth,s=t.borderSkipped,o=g0(r);return{t:fr(s.top,o.top,0,n),r:fr(s.right,o.right,0,e),b:fr(s.bottom,o.bottom,0,n),l:fr(s.left,o.left,0,e)}}function s5(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,o=gs(s),i=Math.min(e,n),a=t.borderSkipped,l=r||Xe(s);return{topLeft:fr(!l||a.top||a.left,o.topLeft,0,i),topRight:fr(!l||a.top||a.right,o.topRight,0,i),bottomLeft:fr(!l||a.bottom||a.left,o.bottomLeft,0,i),bottomRight:fr(!l||a.bottom||a.right,o.bottomRight,0,i)}}function o5(t){const e=um(t),n=e.right-e.left,r=e.bottom-e.top,s=r5(t,n/2,r/2),o=s5(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function md(t,e,n,r){const s=e===null,o=n===null,a=t&&!(s&&o)&&um(t,r);return a&&(s||Nr(e,a.left,a.right))&&(o||Nr(n,a.top,a.bottom))}function i5(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function a5(t,e){t.rect(e.x,e.y,e.w,e.h)}function bd(t,e,n={}){const r=t.x!==n.x?-e:0,s=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-r,i=(t.y+t.h!==n.y+n.h?e:0)-s;return{x:t.x+r,y:t.y+s,w:t.w+o,h:t.h+i,radius:t.radius}}class ka extends Lr{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:o,outer:i}=o5(this),a=i5(i.radius)?aa:a5;e.save(),(i.w!==o.w||i.h!==o.h)&&(e.beginPath(),a(e,bd(i,n,o)),e.clip(),a(e,bd(o,-n,i)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,bd(o,n)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,n,r){return md(this,e,n,r)}inXRange(e,n){return md(this,e,null,n)}inYRange(e,n){return md(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(n+s)/2:n,y:o?r:(r+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Pe(ka,"id","bar"),Pe(ka,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Pe(ka,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const fm=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},l5=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class hm extends Lr{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=ut(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,s)=>e.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,s=Wt(r.font),o=s.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=fm(r,o);let c,d;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(i,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(i,s,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(d,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,s){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a;let u=e;o.textAlign="left",o.textBaseline="middle";let f=-1,g=-d;return this.legendItems.forEach((m,p)=>{const y=r+n/2+o.measureText(m.text).width;(p===0||c[c.length-1]+y+2*a>i)&&(u+=d,c[c.length-(p>0?0:1)]=0,g+=d,f++),l[p]={left:0,top:g,row:f,width:y,height:s},c[c.length-1]+=y+a}),u}_fitCols(e,n,r,s){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=i-e;let u=a,f=0,g=0,m=0,p=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:_,itemHeight:x}=c5(r,n,o,y,s);b>0&&g+x+2*a>d&&(u+=f+a,c.push({width:f,height:g}),m+=f+a,p++,f=g=0),l[b]={left:m,top:g,col:p,width:_,height:x},f=Math.max(f,_),g+=x+a}),u+=f,c.push({width:f,height:g}),u}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:o}}=this,i=bs(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=jt(r,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=jt(r,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+e+s,c.left=i.leftForLtr(i.x(l),c.width),l+=c.width+s}else{let a=0,l=jt(r,this.top+e+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=jt(r,this.top+e+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=i.leftForLtr(i.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Jc(e,this),this._draw(),Rc(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:s}=this,{align:o,labels:i}=e,a=xt.color,l=bs(e.rtl,this.left,this.width),c=Wt(i.font),{padding:d}=i,u=c.size,f=u/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:p,itemHeight:y}=fm(i,u),b=function(w,N,C){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;s.save();const k=Ke(C.lineWidth,1);if(s.fillStyle=Ke(C.fillStyle,a),s.lineCap=Ke(C.lineCap,"butt"),s.lineDashOffset=Ke(C.lineDashOffset,0),s.lineJoin=Ke(C.lineJoin,"miter"),s.lineWidth=k,s.strokeStyle=Ke(C.strokeStyle,a),s.setLineDash(Ke(C.lineDash,[])),i.usePointStyle){const M={radius:p*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:k},T=l.xPlus(w,m/2),L=N+f;f0(s,M,T,L,i.pointStyleWidth&&m)}else{const M=N+Math.max((u-p)/2,0),T=l.leftForLtr(w,m),L=gs(C.borderRadius);s.beginPath(),Object.values(L).some(P=>P!==0)?aa(s,{x:T,y:M,w:m,h:p,radius:L}):s.rect(T,M,m,p),s.fill(),k!==0&&s.stroke()}s.restore()},_=function(w,N,C){vo(s,C.text,w,N+y/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},x=this.isHorizontal(),E=this._computeTitleHeight();x?g={x:jt(o,this.left+d,this.right-r[0]),y:this.top+d+E,line:0}:g={x:this.left+d,y:jt(o,this.top+E+d,this.bottom-n[0].height),line:0},C0(this.ctx,e.textDirection);const S=y+d;this.legendItems.forEach((w,N)=>{s.strokeStyle=w.fontColor,s.fillStyle=w.fontColor;const C=s.measureText(w.text).width,k=l.textAlign(w.textAlign||(w.textAlign=i.textAlign)),M=m+f+C;let T=g.x,L=g.y;l.setWidth(this.width),x?N>0&&T+M+d>this.right&&(L=g.y+=S,g.line++,T=g.x=jt(o,this.left+d,this.right-r[g.line])):N>0&&L+S>this.bottom&&(T=g.x=T+n[g.line].width+d,g.line++,L=g.y=jt(o,this.top+E+d,this.bottom-n[g.line].height));const P=l.x(T);if(b(P,L,w),T=DM(k,T+m+f,x?T+M:this.right,e.rtl),_(l.x(T),L,w),x)g.x+=M+d;else if(typeof w.text!="string"){const F=c.lineHeight;g.y+=gm(w,F)+d}else g.y+=S}),S0(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=Wt(n.font),s=yn(n.padding);if(!n.display)return;const o=bs(e.rtl,this.left,this.width),i=this.ctx,a=n.position,l=r.size/2,c=s.top+l;let d,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,u=jt(e.align,u,this.right-f);else{const m=this.columnSizes.reduce((p,y)=>Math.max(p,y.height),0);d=c+jt(e.align,this.top,this.bottom-m-e.labels.padding-this._computeTitleHeight())}const g=jt(a,u,u+f);i.textAlign=o.textAlign(Xc(a)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=r.string,vo(i,n.text,g,d,r)}_computeTitleHeight(){const e=this.options.title,n=Wt(e.font),r=yn(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,s,o;if(Nr(e,this.left,this.right)&&Nr(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(s=o[r],Nr(e,s.left,s.left+s.width)&&Nr(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!f5(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=l5(s,r);s&&!o&&ut(n.onLeave,[e,s,this],this),this._hoveredItem=r,r&&!o&&ut(n.onHover,[e,r,this],this)}else r&&ut(n.onClick,[e,r,this],this)}}function c5(t,e,n,r,s){const o=d5(r,t,e,n),i=u5(s,r,e.lineHeight);return{itemWidth:o,itemHeight:i}}function d5(t,e,n,r){let s=t.text;return s&&typeof s!="string"&&(s=s.reduce((o,i)=>o.length>i.length?o:i)),e+n.size/2+r.measureText(s).width}function u5(t,e,n){let r=t;return typeof e.text!="string"&&(r=gm(e,n)),r}function gm(t,e){const n=t.text?t.text.length:0;return e*n}function f5(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var pm={id:"legend",_element:hm,start(t,e,n){const r=t.legend=new hm({ctx:t.ctx,options:n,chart:t});vn.configure(t,r,n),vn.addBox(t,r)},stop(t){vn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;vn.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),e.hidden=!0):(s.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=yn(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:i&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class mm extends Lr{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const s=Mt(r.text)?r.text.length:1;this._padding=yn(r.padding);const o=s*Wt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:s,right:o,options:i}=this,a=i.align;let l=0,c,d,u;return this.isHorizontal()?(d=jt(a,r,o),u=n+e,c=o-r):(i.position==="left"?(d=r+e,u=jt(a,s,n),l=lt*-.5):(d=o-e,u=jt(a,n,s),l=lt*.5),c=s-n),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=Wt(n.font),o=r.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);vo(e,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Xc(n.align),textBaseline:"middle",translation:[i,a]})}}function h5(t,e){const n=new mm({ctx:t.ctx,options:e,chart:t});vn.configure(t,n,e),vn.addBox(t,n),t.titleBlock=n}var g5={id:"title",_element:mm,start(t,e,n){h5(t,n)},stop(t){const e=t.titleBlock;vn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;vn.configure(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const To={average(t){if(!t.length)return!1;let e,n,r=new Set,s=0,o=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),s+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,s=Number.POSITIVE_INFINITY,o,i,a;for(o=0,i=t.length;o<i;++o){const l=t[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=EM(e,c);d<s&&(s=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Bn(t,e){return e&&(Mt(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Qn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
||
`)>-1?t.split(`
|
||
`):t}function p5(t,e){const{element:n,datasetIndex:r,index:s}=e,o=t.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:t,label:i,parsed:o.getParsed(s),raw:t.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function bm(t,e){const n=t.chart.ctx,{body:r,footer:s,title:o}=t,{boxWidth:i,boxHeight:a}=e,l=Wt(e.bodyFont),c=Wt(e.titleFont),d=Wt(e.footerFont),u=o.length,f=s.length,g=r.length,m=yn(e.padding);let p=m.height,y=0,b=r.reduce((E,S)=>E+S.before.length+S.lines.length+S.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){const E=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=g*E+(b-g)*l.lineHeight+(b-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let _=0;const x=function(E){y=Math.max(y,n.measureText(E).width+_)};return n.save(),n.font=c.string,tt(t.title,x),n.font=l.string,tt(t.beforeBody.concat(t.afterBody),x),_=e.displayColors?i+2+e.boxPadding:0,tt(r,E=>{tt(E.before,x),tt(E.lines,x),tt(E.after,x)}),_=0,n.font=d.string,tt(t.footer,x),n.restore(),y+=m.width,{width:y,height:p}}function m5(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function b5(t,e,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(t==="left"&&s+o+i>e.width||t==="right"&&s-o-i<0)return!0}function y5(t,e,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:l}}=t;let c="center";return r==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=i-o/2&&(c="right"),b5(c,t,e,n)&&(c="center"),c}function ym(t,e,n){const r=n.yAlign||e.yAlign||m5(t,n);return{xAlign:n.xAlign||e.xAlign||y5(t,e,n,r),yAlign:r}}function v5(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function x5(t,e,n){let{y:r,height:s}=t;return e==="top"?r+=n:e==="bottom"?r-=s+n:r-=s/2,r}function vm(t,e,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=t,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=gs(i);let m=v5(e,a);const p=x5(e,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(d,f)+s:a==="right"&&(m+=Math.max(u,g)+s),{x:nn(m,0,r.width-e.width),y:nn(p,0,r.height-e.height)}}function Ca(t,e,n){const r=yn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function xm(t){return Bn([],Qn(t))}function w5(t,e,n){return ps(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function wm(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const km={beforeTitle:Kn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:Kn,beforeBody:Kn,beforeLabel:Kn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return at(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Kn,afterBody:Kn,beforeFooter:Kn,footer:Kn,afterFooter:Kn};function rn(t,e,n,r){const s=t[e].call(n,r);return typeof s>"u"?km[e].call(n,r):s}class yd extends Lr{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new E0(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=w5(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,s=rn(r,"beforeTitle",this,e),o=rn(r,"title",this,e),i=rn(r,"afterTitle",this,e);let a=[];return a=Bn(a,Qn(s)),a=Bn(a,Qn(o)),a=Bn(a,Qn(i)),a}getBeforeBody(e,n){return xm(rn(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,s=[];return tt(e,o=>{const i={before:[],lines:[],after:[]},a=wm(r,o);Bn(i.before,Qn(rn(a,"beforeLabel",this,o))),Bn(i.lines,rn(a,"label",this,o)),Bn(i.after,Qn(rn(a,"afterLabel",this,o))),s.push(i)}),s}getAfterBody(e,n){return xm(rn(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,s=rn(r,"beforeFooter",this,e),o=rn(r,"footer",this,e),i=rn(r,"afterFooter",this,e);let a=[];return a=Bn(a,Qn(s)),a=Bn(a,Qn(o)),a=Bn(a,Qn(i)),a}_createItems(e){const n=this._active,r=this.chart.data,s=[],o=[],i=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(p5(this.chart,n[l]));return e.filter&&(a=a.filter((d,u,f)=>e.filter(d,u,f,r))),e.itemSort&&(a=a.sort((d,u)=>e.itemSort(d,u,r))),tt(a,d=>{const u=wm(e.callbacks,d);s.push(rn(u,"labelColor",this,d)),o.push(rn(u,"labelPointStyle",this,d)),i.push(rn(u,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=a,a}update(e,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,i=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=To[r.position].call(this,s,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const l=this._size=bm(this,r),c=Object.assign({},a,l),d=ym(this.chart,r,c),u=vm(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,s){const o=this.getCaretPosition(e,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(e,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:i,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=gs(a),{x:f,y:g}=e,{width:m,height:p}=n;let y,b,_,x,E,S;return o==="center"?(E=g+p/2,s==="left"?(y=f,b=y-i,x=E+i,S=E-i):(y=f+m,b=y+i,x=E-i,S=E+i),_=y):(s==="left"?b=f+Math.max(l,d)+i:s==="right"?b=f+m-Math.max(c,u)-i:b=this.caretX,o==="top"?(x=g,E=x-i,y=b-i,_=b+i):(x=g+p,E=x+i,y=b+i,_=b-i),S=x),{x1:y,x2:b,x3:_,y1:x,y2:E,y3:S}}drawTitle(e,n,r){const s=this.title,o=s.length;let i,a,l;if(o){const c=bs(r.rtl,this.x,this.width);for(e.x=Ca(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",i=Wt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,l=0;l<o;++l)n.fillText(s[l],c.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+a,l+1===o&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,n,r,s,o){const i=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,d=Wt(o.bodyFont),u=Ca(this,"left",o),f=s.x(u),g=l<d.lineHeight?(d.lineHeight-l)/2:0,m=n.y+g;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,b=m+l/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,u0(e,p,y,b),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,u0(e,p,y,b)}else{e.lineWidth=Xe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;const p=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),b=gs(i.borderRadius);Object.values(b).some(_=>_!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,aa(e,{x:p,y:m,w:c,h:l,radius:b}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),aa(e,{x:y,y:m+1,w:c-2,h:l-2,radius:b}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(p,m,c,l),e.strokeRect(p,m,c,l),e.fillStyle=i.backgroundColor,e.fillRect(y,m+1,c-2,l-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,u=Wt(r.bodyFont);let f=u.lineHeight,g=0;const m=bs(r.rtl,this.x,this.width),p=function(C){n.fillText(C,m.x(e.x+g),e.y+f/2),e.y+=f+o},y=m.textAlign(i);let b,_,x,E,S,w,N;for(n.textAlign=i,n.textBaseline="middle",n.font=u.string,e.x=Ca(this,y,r),n.fillStyle=r.bodyColor,tt(this.beforeBody,p),g=a&&y!=="right"?i==="center"?c/2+d:c+2+d:0,E=0,w=s.length;E<w;++E){for(b=s[E],_=this.labelTextColors[E],n.fillStyle=_,tt(b.before,p),x=b.lines,a&&x.length&&(this._drawColorBox(n,e,E,m,r),f=Math.max(u.lineHeight,l)),S=0,N=x.length;S<N;++S)p(x[S]),f=u.lineHeight;tt(b.after,p)}g=0,f=u.lineHeight,tt(this.afterBody,p),e.y-=o}drawFooter(e,n,r){const s=this.footer,o=s.length;let i,a;if(o){const l=bs(r.rtl,this.x,this.width);for(e.x=Ca(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",i=Wt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,a=0;a<o;++a)n.fillText(s[a],l.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+r.footerSpacing}}drawBackground(e,n,r,s){const{xAlign:o,yAlign:i}=this,{x:a,y:l}=e,{width:c,height:d}=r,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:m}=gs(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+u,l),i==="top"&&this.drawCaret(e,n,r,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),i==="center"&&o==="right"&&this.drawCaret(e,n,r,s),n.lineTo(a+c,l+d-m),n.quadraticCurveTo(a+c,l+d,a+c-m,l+d),i==="bottom"&&this.drawCaret(e,n,r,s),n.lineTo(a+g,l+d),n.quadraticCurveTo(a,l+d,a,l+d-g),i==="center"&&o==="left"&&this.drawCaret(e,n,r,s),n.lineTo(a,l+u),n.quadraticCurveTo(a,l,a+u,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const i=To[e.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=bm(this,e),l=Object.assign({},i,this._size),c=ym(n,e,l),d=vm(e,l,c,n);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=yn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=r,this.drawBackground(o,e,s,n),C0(e,n.textDirection),o.y+=i.top,this.drawTitle(o,e,n),this.drawBody(o,e,n),this.drawFooter(o,e,n),S0(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,s=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!ea(r,s),i=this._positionChanged(s,n);(o||i)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],i=this._getActiveElements(e,o,n,r),a=this._positionChanged(i,e),l=n||!ea(i,o)||a;return l&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,r,s){const o=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const i=this.chart.getElementsAtEventForMode(e,o.mode,o,r);return o.reverse&&i.reverse(),i}_positionChanged(e,n){const{caretX:r,caretY:s,options:o}=this,i=To[o.position].call(this,e,n);return i!==!1&&(r!==i.x||s!==i.y)}}Pe(yd,"positioners",To);var Cm={id:"tooltip",_element:yd,positioners:To,afterInit(t,e,n){n&&(t.tooltip=new yd({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:km},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const k5=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function C5(t,e,n,r){const s=t.indexOf(e);if(s===-1)return k5(t,e,n,r);const o=t.lastIndexOf(e);return s!==o?n:s}const S5=(t,e)=>t===null?null:nn(Math.round(t),0,e);function Sm(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class vd extends vs{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(at(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:C5(r,e,Ke(n,e),this._addedLabels),S5(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,s=[];let o=this.getLabels();o=e===0&&n===o.length-1?o:o.slice(e,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=e;i<=n;i++)s.push({value:i});return s}getLabelForValue(e){return Sm.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Pe(vd,"id","category"),Pe(vd,"defaults",{ticks:{callback:Sm}});function _5(t,e){const n=[],{bounds:s,step:o,min:i,max:a,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:f}=t,g=o||1,m=d-1,{min:p,max:y}=e,b=!at(i),_=!at(a),x=!at(c),E=(y-p)/(u+1);let S=qp((y-p)/m/g)*g,w,N,C,k;if(S<1e-14&&!b&&!_)return[{value:p},{value:y}];k=Math.ceil(y/S)-Math.floor(p/S),k>m&&(S=qp(k*S/m/g)*g),at(l)||(w=Math.pow(10,l),S=Math.ceil(S*w)/w),s==="ticks"?(N=Math.floor(p/S)*S,C=Math.ceil(y/S)*S):(N=p,C=y),b&&_&&o&&CM((a-i)/o,S/1e3)?(k=Math.round(Math.min((a-i)/S,d)),S=(a-i)/k,N=i,C=a):x?(N=b?i:N,C=_?a:C,k=c-1,S=(C-N)/k):(k=(C-N)/S,ra(k,Math.round(k),S/1e3)?k=Math.round(k):k=Math.ceil(k));const M=Math.max(Zp(S),Zp(N));w=Math.pow(10,at(l)?M:l),N=Math.round(N*w)/w,C=Math.round(C*w)/w;let T=0;for(b&&(f&&N!==i?(n.push({value:i}),N<i&&T++,ra(Math.round((N+T*S)*w)/w,i,_m(i,E,t))&&T++):N<i&&T++);T<k;++T){const L=Math.round((N+T*S)*w)/w;if(_&&L>a)break;n.push({value:L})}return _&&f&&C!==a?n.length&&ra(n[n.length-1].value,a,_m(a,E,t))?n[n.length-1].value=a:n.push({value:a}):(!_||C===a)&&n.push({value:C}),n}function _m(t,e,{horizontal:n,minRotation:r}){const s=qn(r),o=(n?Math.sin(s):Math.cos(s))||.001,i=.75*e*(""+t).length;return Math.min(e/o,i)}class E5 extends vs{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return at(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:o}=this;const i=l=>s=n?s:l,a=l=>o=r?o:l;if(e){const l=dr(s),c=dr(o);l<0&&c<0?a(0):l>0&&c>0&&i(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),e||i(s-l)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,i=_5(s,o);return e.bounds==="ticks"&&SM(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const s=(r-n)/Math.max(e.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return qc(e,this.chart.options.locale,this.options.ticks.format)}}class xd extends E5{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=bn(e)?e:0,this.max=bn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=qn(this.options.ticks.minRotation),s=(e?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Pe(xd,"id","linear"),Pe(xd,"defaults",{ticks:{callback:l0.formatters.numeric}});const Sa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},sn=Object.keys(Sa);function Em(t,e){return t-e}function Mm(t,e){if(at(e))return null;const n=t._adapter,{parser:r,round:s,isoWeekday:o}=t._parseOpts;let i=e;return typeof r=="function"&&(i=r(i)),bn(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(s&&(i=s==="week"&&(sa(o)||o===!0)?n.startOf(i,"isoWeek",o):n.startOf(i,s)),+i)}function Nm(t,e,n,r){const s=sn.length;for(let o=sn.indexOf(t);o<s-1;++o){const i=Sa[sn[o]],a=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-e)/(a*i.size))<=r)return sn[o]}return sn[s-1]}function M5(t,e,n,r,s){for(let o=sn.length-1;o>=sn.indexOf(n);o--){const i=sn[o];if(Sa[i].common&&t._adapter.diff(s,r,i)>=e-1)return i}return sn[n?sn.indexOf(n):0]}function N5(t){for(let e=sn.indexOf(t)+1,n=sn.length;e<n;++e)if(Sa[sn[e]].common)return sn[e]}function Om(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:s}=Gc(n,e),o=n[r]>=e?n[r]:n[s];t[o]=!0}}function O5(t,e,n,r){const s=t._adapter,o=+s.startOf(e[0].value,r),i=e[e.length-1].value;let a,l;for(a=o;a<=i;a=+s.add(a,1,r))l=n[a],l>=0&&(e[l].major=!0);return e}function Tm(t,e,n){const r=[],s={},o=e.length;let i,a;for(i=0;i<o;++i)a=e[i],s[a]=i,r.push({value:a,major:!1});return o===0||!n?r:O5(t,r,s,n)}class _a extends vs{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const r=e.time||(e.time={}),s=this._adapter=new BN._date(e.adapters.date);s.init(n),po(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Mm(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:s,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function l(c){!i&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!i||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=bn(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=bn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,i=this.max,a=OM(s,o,i);return this._unit=n.unit||(r.autoSkip?Nm(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):M5(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:N5(this._unit),this.initOffsets(s),e.reverse&&a.reverse(),Tm(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,s,o;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?r=o:r=(o-this.getDecimalForValue(e[e.length-2]))/2);const i=e.length<3?.5:.25;n=nn(n,0,i),r=nn(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,i=o.unit||Nm(o.minUnit,n,r,this._getLabelCapacity(n)),a=Ke(s.ticks.stepSize,1),l=i==="week"?o.isoWeekday:!1,c=sa(l)||l===!0,d={};let u=n,f,g;if(c&&(u=+e.startOf(u,"isoWeek",l)),u=+e.startOf(u,c?"day":i),e.diff(r,n,i)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+i);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(f=u,g=0;f<r;f=+e.add(f,a,i),g++)Om(d,f,m);return(f===r||s.bounds==="ticks"||g===1)&&Om(d,f,m),Object.keys(d).sort(Em).map(p=>+p)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,o=this._unit,i=n||s[o];return this._adapter.format(e,i)}_tickFormatFunction(e,n,r,s){const o=this.options,i=o.ticks.callback;if(i)return ut(i,[e,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],u=c&&a[c],f=r[n],g=c&&u&&f&&f.major;return this._adapter.format(e,s||(g?u:d))}generateTickLabels(e){let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,s=qn(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),i=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*i,h:r*i+a*o}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(e,0,Tm(this,[e],this._majorUnit),s),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)e.push(Mm(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return e0(e.sort(Em))}}Pe(_a,"id","time"),Pe(_a,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ea(t,e,n){let r=0,s=t.length-1,o,i,a,l;n?(e>=t[r].pos&&e<=t[s].pos&&({lo:r,hi:s}=Yc(t,"pos",e)),{pos:o,time:a}=t[r],{pos:i,time:l}=t[s]):(e>=t[r].time&&e<=t[s].time&&({lo:r,hi:s}=Yc(t,"time",e)),{time:o,pos:a}=t[r],{time:i,pos:l}=t[s]);const c=i-o;return c?a+(l-a)*(e-o)/c:a}class Am extends _a{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Ea(n,this.min),this._tableRange=Ea(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,s=[],o=[];let i,a,l,c,d;for(i=0,a=e.length;i<a;++i)c=e[i],c>=n&&c<=r&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,a=s.length;i<a;++i)d=s[i+1],l=s[i-1],c=s[i],Math.round((d+l)/2)!==c&&o.push({time:c,pos:i/(a-1)});return o}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,o)=>s-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(Ea(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return Ea(this._table,r*this._tableRange+this._minPos,!0)}}Pe(Am,"id","timeseries"),Pe(Am,"defaults",_a.defaults);const Dm="label";function Im(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function T5(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function Lm(t,e){t.labels=e}function Pm(t,e,n=Dm){const r=[];t.datasets=e.map(s=>{const o=t.datasets.find(i=>i[n]===s[n]);return!o||!s.data||r.includes(o)?{...s}:(r.push(o),Object.assign(o,s),o)})}function A5(t,e=Dm){const n={labels:[],datasets:[]};return Lm(n,t.labels),Pm(n,t.datasets,e),n}function D5(t,e){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:o,type:i,data:a,options:l,plugins:c=[],fallbackContent:d,updateMode:u,...f}=t,g=v.useRef(null),m=v.useRef(null),p=()=>{g.current&&(m.current=new No(g.current,{type:i,data:A5(a,o),options:l&&{...l},plugins:c}),Im(e,m.current))},y=()=>{Im(e,null),m.current&&(m.current.destroy(),m.current=null)};return v.useEffect(()=>{!s&&m.current&&l&&T5(m.current,l)},[s,l]),v.useEffect(()=>{!s&&m.current&&Lm(m.current.config.data,a.labels)},[s,a.labels]),v.useEffect(()=>{!s&&m.current&&a.datasets&&Pm(m.current.config.data,a.datasets,o)},[s,a.datasets]),v.useEffect(()=>{m.current&&(s?(y(),setTimeout(p)):m.current.update(u))},[s,l,a.labels,a.datasets,u]),v.useEffect(()=>{m.current&&(y(),setTimeout(p))},[i]),v.useEffect(()=>(p(),()=>y()),[]),h.jsx("canvas",{ref:g,role:"img",height:n,width:r,...f,children:d})}const I5=v.forwardRef(D5);function $m(t,e){return No.register(e),v.forwardRef((n,r)=>h.jsx(I5,{...n,ref:r,type:t}))}const L5=$m("bar",fa),P5=$m("doughnut",wo);No.register(vd,xd,ka,g5,Cm,pm);const $5=({labels:t,datasets:e,height:n=200,showLegend:r=!1,showGrid:s=!1,showYGrid:o=!1,showYAxis:i=!1,className:a="",id:l,editorAttrs:c})=>{const d=v.useMemo(()=>({labels:t??[],datasets:(e??[]).map((m,p)=>({label:m.label,data:m.data,backgroundColor:m.backgroundColor||(p===0?"#7C3AED":"#DDD6FE"),borderRadius:m.borderRadius??4,barThickness:16,maxBarThickness:20,yAxisID:m.yAxisID??"y"}))}),[t,e]),u=v.useMemo(()=>(e??[]).some(m=>m.yAxisID==="y1"),[e]),f=v.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:750,easing:"easeOutQuart"},animations:{x:{duration:0},y:{from:m=>{if(m.type==="data")return m.chart.scales.y.getPixelForValue(0)}}},transitions:{active:{animation:{duration:200}},resize:{animation:{duration:0}}},plugins:{legend:{display:r,position:"top"},tooltip:{backgroundColor:"#1e293b",titleColor:"#fff",bodyColor:"#fff",padding:12,cornerRadius:8}},scales:{x:{grid:{display:s},border:{display:!1},ticks:{color:"#94a3b8",font:{size:11}}},y:{type:"linear",position:"left",grid:{display:o,color:"#e2e8f0"},border:{display:!1},ticks:{display:i,color:"#94a3b8",font:{size:11},padding:8},beginAtZero:!0,grace:"5%"},...u?{y1:{type:"linear",position:"right",grid:{display:!1},border:{display:!1},ticks:{display:i,color:"#94a3b8",font:{size:11},padding:8},beginAtZero:!0,grace:"5%"}}:{}}}),[r,s,o,i,u]),g=typeof n=="number"?n:/^\d+$/.test(String(n))?`${n}px`:n;return h.jsx("div",{className:`bar-chart-container ${a}`,style:{height:g},id:l,...c,children:h.jsx(L5,{data:d,options:f})})},F5=v.memo($5,(t,e)=>JSON.stringify(t.labels)===JSON.stringify(e.labels)&&JSON.stringify(t.datasets)===JSON.stringify(e.datasets)&&t.height===e.height&&t.showLegend===e.showLegend&&t.showGrid===e.showGrid&&t.showYGrid===e.showYGrid&&t.showYAxis===e.showYAxis&&t.className===e.className&&t.id===e.id&&t.editorAttrs===e.editorAttrs);No.register(Oo,Cm,pm);const V5=({data:t,centerLabel:e,centerValue:n,size:r=200,cutout:s="70%",showLegend:o=!1,className:i="",id:a,editorAttrs:l})=>{const c=v.useMemo(()=>({labels:(t??[]).map(f=>f.name),datasets:[{data:(t??[]).map(f=>f.value),backgroundColor:(t??[]).map(f=>f.color),borderWidth:0,hoverOffset:4}]}),[t]),d=v.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,cutout:s,plugins:{legend:{display:o},tooltip:{backgroundColor:"#1e293b",titleColor:"#fff",bodyColor:"#fff",padding:12,cornerRadius:8,callbacks:{label:f=>` $${f.parsed.toLocaleString()}`}}}}),[s,o]),u=typeof r=="number"?r:/^\d+$/.test(String(r))?`${r}px`:r;return h.jsx("div",{className:`donut-chart-wrapper ${i}`,id:a,...l,children:h.jsxs("div",{className:"relative",style:{width:u,height:u},children:[h.jsx(P5,{data:c,options:d}),(e||n)&&h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e&&h.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:e}),n&&h.jsx("span",{className:"text-lg font-bold text-slate-900 dark:text-white",children:n})]})]})})},z5=({id:t,className:e,style:n,children:r,editorAttrs:s})=>h.jsx("div",{id:t,className:e,style:n,...s,children:r}),H5=({children:t,cols:e=1,responsive:n,gap:r,rowGap:s,colGap:o,autoRows:i,autoCols:a,flow:l="row",className:c="",style:d,onClick:u,id:f,editorAttrs:g})=>{const m=["grid"];if(e&&m.push(`grid-cols-${e}`),n&&(n.sm&&m.push(`sm:grid-cols-${n.sm}`),n.md&&m.push(`md:grid-cols-${n.md}`),n.lg&&m.push(`lg:grid-cols-${n.lg}`),n.xl&&m.push(`xl:grid-cols-${n.xl}`),n["2xl"]&&m.push(`2xl:grid-cols-${n["2xl"]}`)),r!==void 0&&r>0&&m.push(`gap-${r}`),s!==void 0&&s>0&&m.push(`gap-y-${s}`),o!==void 0&&o>0&&m.push(`gap-x-${o}`),i){const y={auto:"auto-rows-auto",min:"auto-rows-min",max:"auto-rows-max",fr:"auto-rows-fr"};m.push(y[i])}if(a){const y={auto:"auto-cols-auto",min:"auto-cols-min",max:"auto-cols-max",fr:"auto-cols-fr"};m.push(y[a])}const p={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 m.push(p[l]),c&&m.push(c),h.jsx(I,{className:m.join(" "),style:d,onClick:u,id:f,...g,children:t})},U5=({children:t,direction:e="row",justify:n="start",align:r="stretch",wrap:s="nowrap",gap:o=0,grow:i=!1,shrink:a=!0,className:l="",style:c,onClick:d,id:u,editorAttrs:f})=>{const g=["flex"],m={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"};g.push(m[e]);const p={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};g.push(p[s]);const y={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};g.push(y[n]);const b={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};return g.push(b[r]),o>0&&g.push(`gap-${o}`),i===!0?g.push("flex-grow"):typeof i=="number"&&i>0&&g.push(`flex-grow-${i}`),a===!1?g.push("shrink-0"):a===!0?g.push("flex-shrink"):typeof a=="number"&&a>0&&g.push(`flex-shrink-${a}`),l&&g.push(l),h.jsx(I,{className:g.join(" "),style:c,onClick:d,id:u,...f,children:t})},B5=({title:t,subtitle:e,children:n,padding:r="none",background:s="none",maxWidth:o,centered:i=!1,border:a=!1,shadow:l="none",rounded:c=!1,className:d="",style:u,onClick:f,id:g,editorAttrs:m})=>{const p=[],y={none:"",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"};y[r]&&p.push(y[r]);const b={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(s!=="none"&&p.push(b[s]),o){const x={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"};p.push(x[o])}i&&p.push("mx-auto"),a&&p.push("border","border-gray-200","dark:border-gray-700");const _={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"};return l!=="none"&&p.push(_[l]),c&&p.push("rounded-lg"),d&&p.push(d),h.jsxs(Td,{className:p.join(" "),style:u,onClick:f,id:g,...m,children:[(t||e)&&h.jsxs("div",{className:"mb-4",children:[t&&h.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:t}),e&&h.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:e})]}),n]})},j5=({leftWidth:t="250px",rightWidth:e="300px",leftSlot:n,centerSlot:r,rightSlot:s,className:o="",style:i,id:a,editorAttrs:l})=>{const c=`flex flex-row w-full h-full ${o}`.trim(),d={width:t,flexShrink:0},u={flex:1,minWidth:0},f={width:e,flexShrink:0};return h.jsxs(I,{className:c,style:i,id:a,...l,children:[h.jsx(I,{className:"flex flex-col",style:d,children:n}),h.jsx(I,{className:"flex flex-col",style:u,children:r}),h.jsx(I,{className:"flex flex-col",style:f,children:s})]})},W5={language:"json",theme:"vs-dark",options:{automaticLayout:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,fontSize:14,tabSize:2,formatOnPaste:!0,formatOnType:!0,wordWrap:"on",folding:!0,lineNumbers:"on",renderWhitespace:"selection"}},Fm=[{uri:`${window.location.origin}/schemas/layout.json`,fileMatch:["*layout*.json"],schema:{type:"object",properties:{version:{type:"string"},endpoint:{type:"string"},components:{type:"array"}},required:["version","endpoint","components"]}}],G5={"vs/nls":{availableLanguages:{"*":"ko"}}};function Y5(t){t.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:Fm,enableSchemaRequest:!0,schemaValidation:"error",schemaRequest:"error"})}const X5={identifier:"sirsoft-admin_basic",vendor:"sirsoft",name:{ko:"Admin Basic",en:"Admin Basic"},version:"1.0.5",license:"MIT",description:{ko:"그누보드7 기본 관리자 템플릿",en:"Gnuboard7 default admin template"},type:"admin",locales:["ko","en"],author:{name:"sirsoft",email:"contact@sirsoft.com",url:"https://sirsoft.com"},release_date:"2026-05-15",g7_version:">=7.0.7",dependencies:{modules:{},plugins:{}},assets:{css:["assets/css/main.css","assets/css/ui-system.css"],js:["dist/components.js"],fonts:["assets/fonts/"],images:["assets/images/"]},components:{basic:["a","button","checkbox","div","form","h1","h2","h3","hr","icon","img","input","label","li","nav","p","section","select","span","svg","table","tbody","td","textarea","th","thead","tr","ul"],composite:["action-menu","admin-footer","admin-header","admin-sidebar","alert-dialog","breadcrumb","card","confirm-dialog","data-grid","dialog","dropdown","empty-state","filter-group","icon-button","loading-spinner","modal","page-header","pagination","product-card","search-bar","stat-card","status-badge","tab-navigation","template-card","toast"],layout:["container","flex","grid","section"]},preview:{thumbnail:"preview/thumbnail.png",screenshots:["preview/screenshot1.png","preview/screenshot2.png"]},error_config:{layouts:{401:"errors/401",403:"errors/403",404:"errors/404",500:"errors/500",503:"errors/503",maintenance:"errors/maintenance"}},github_url:"https://github.com/gnuboard/g7-template-sirsoft-admin_basic",github_changelog_url:"https://github.com/gnuboard/g7-template-sirsoft-admin_basic/blob/main/CHANGELOG.md",externals:[{id:"fontawesome",type:"style",url:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css",preconnect:"https://cdnjs.cloudflare.com"},{id:"pretendard",type:"webfont",url:"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css",preconnect:"https://cdn.jsdelivr.net",crossorigin:"anonymous"},{id:"flag-icons",type:"style",url:"https://cdn.jsdelivr.net/npm/flag-icons@7.2.3/css/flag-icons.min.css"}]},Jn=window.G7Core?.createLogger?.("Handler:SetTheme")??{log:(...t)=>console.log("[Handler:SetTheme]",...t),warn:(...t)=>console.warn("[Handler:SetTheme]",...t),error:(...t)=>console.error("[Handler:SetTheme]",...t)},wd=["auto","light","dark"],Vm="g7_color_scheme",K5=t=>t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,Ma=t=>{const e=K5(t);document.documentElement.setAttribute("data-theme",e),e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};function q5(){try{const t=localStorage.getItem(Vm),e=t&&wd.includes(t)?t:"auto";Ma(e);try{window.G7Core?.state?.setGlobal?.({theme:e})}catch(n){Jn.warn("Failed to set global theme state:",n)}Jn.log("Initial theme applied:",e)}catch(t){Jn.warn("Failed to load initial theme:",t),Ma("auto")}}async function Z5(t,e){const n=t?.target;if(n&&typeof n=="string"&&wd.includes(n)){Ma(n);try{window.G7Core?.state?.setGlobal?.({theme:n})}catch(r){Jn.warn("Failed to set global theme state:",r)}return}q5()}async function Q5(t,e){let n;if(t?.target&&typeof t.target=="string"&&!t.target.includes("{{")&&(n=t.target),!n||typeof n!="string"){Jn.warn("Invalid theme:",n);return}if(!wd.includes(n)){Jn.warn("Unsupported theme:",n);return}const r=n;try{localStorage.setItem(Vm,r)}catch(s){Jn.error("Failed to save theme to localStorage:",s);return}Ma(r);try{window.G7Core?.state?.setGlobal?.({theme:r})}catch(s){Jn.warn("Failed to set global theme state:",s)}Jn.log("Theme changed to:",r)}const ws=window.G7Core?.createLogger?.("Handler:InitMenu")??{log:(...t)=>console.log("[Handler:InitMenu]",...t),warn:(...t)=>console.warn("[Handler:InitMenu]",...t),error:(...t)=>console.error("[Handler:InitMenu]",...t)};function zm(t,e){for(const n of t){if(n.slug===e)return n;if(n.children&&n.children.length>0){const r=zm(n.children,e);if(r)return r}}return null}function Hm(t){return new URLSearchParams(window.location.search).get(t)}function J5(t){return window.G7Core?.state?.getDataSource?.(t)}function R5(t){const e=[t,t?.data,t?.data?.data];for(const n of e)if(Array.isArray(n)&&n.length>0)return n;return null}async function eT(t,e=30,n=100){for(let r=0;r<e;r++){const s=R5(J5(t));if(s)return s;await new Promise(o=>setTimeout(o,n))}return null}async function tT(t){const e=window.G7Core;try{const r=(await e?.api?.get?.(`/api/admin/menus/${t.id}`))?.data;if(r&&typeof r=="object"&&r.id===t.id)return r}catch(n){ws.warn("[initMenuFromUrl] Failed to hydrate menu detail:",n)}return t}async function nT(t,e){const n=window.G7Core,r=Hm("menu"),s=Hm("mode");if(!r){ws.log("[initMenuFromUrl] No menu parameter in URL");return}if(!n?.state?.set){ws.warn("[initMenuFromUrl] G7Core.state.set not available");return}const o=await eT("menus");if(!o){ws.warn("[initMenuFromUrl] menus data not available after waiting");return}const i=zm(o,r);if(!i){ws.warn("[initMenuFromUrl] Menu not found with slug:",r);return}const a=await tT(i),l=s==="edit"?"edit":"view";n.state.set({selectedMenuId:a.id,selectedMenu:a,panelMode:l}),l==="edit"&&n.state.set({formData:{name:a.name,slug:a.slug,url:a.url,icon:a.icon,parent_id:a.parent_id,extension_type:a.extension_type,extension_identifier:a.extension_identifier,is_active:a.is_active,roles:(a.roles??[]).map(c=>c.id)}}),ws.log("[initMenuFromUrl] Menu initialized from URL:",{slug:r,mode:l,menuId:i.id})}const Zt=window.G7Core?.createLogger?.("Handler:FilterVisibility")??{log:(...t)=>console.log("[Handler:FilterVisibility]",...t),warn:(...t)=>console.warn("[Handler:FilterVisibility]",...t),error:(...t)=>console.error("[Handler:FilterVisibility]",...t)},Na="g7_filter_visibility_";async function rT(t,e){const{storageKey:n,defaultFilters:r=[],stateKey:s="visibleFilters"}=t?.params||{};if(!n){Zt.warn("[initFilterVisibility] storageKey is required");return}const o=`${Na}${n}`;try{const i=localStorage.getItem(o);let a;if(i){const l=JSON.parse(i);Array.isArray(l)?(a=l,Zt.log(`[initFilterVisibility] Loaded from localStorage: ${a.join(", ")}`)):(a=r,Zt.warn("[initFilterVisibility] Invalid saved data format, using defaults"))}else a=r,Zt.log(`[initFilterVisibility] No saved data, using defaults: ${r.join(", ")}`);e?.setState&&e.setState({[s]:a})}catch(i){Zt.error("[initFilterVisibility] Failed to load filter visibility:",i),e?.setState&&e.setState({[s]:r})}}async function sT(t,e){const{storageKey:n,filters:r}=t?.params||{};if(!n){Zt.warn("[saveFilterVisibility] storageKey is required");return}if(!Array.isArray(r)){Zt.warn("[saveFilterVisibility] filters must be an array");return}const s=`${Na}${n}`;try{localStorage.setItem(s,JSON.stringify(r)),Zt.log(`[saveFilterVisibility] Saved to localStorage: ${r.join(", ")}`)}catch(o){Zt.error("[saveFilterVisibility] Failed to save filter visibility:",o)}}async function oT(t,e){const{storageKey:n,filterId:r,stateKey:s="visibleFilters"}=t?.params||{};if(!n||!r){Zt.warn("[toggleFilterVisibility] storageKey and filterId are required");return}const o=e?.state?.[s]||[];let i;o.includes(r)?i=o.filter(l=>l!==r):i=[...o,r],e?.setState&&e.setState({[s]:i});const a=`${Na}${n}`;try{localStorage.setItem(a,JSON.stringify(i)),Zt.log(`[toggleFilterVisibility] Toggled ${r}: ${i.join(", ")}`)}catch(l){Zt.error("[toggleFilterVisibility] Failed to save:",l)}}async function iT(t,e){const{storageKey:n,defaultFilters:r=[],stateKey:s="visibleFilters"}=t?.params||{};if(!n){Zt.warn("[resetFilterVisibility] storageKey is required");return}const o=`${Na}${n}`;try{localStorage.setItem(o,JSON.stringify(r)),e?.setState&&e.setState({[s]:r}),Zt.log(`[resetFilterVisibility] Reset to defaults: ${r.join(", ")}`)}catch(i){Zt.error("[resetFilterVisibility] Failed to reset:",i)}}const ks=window.G7Core?.createLogger?.("Handler:MultilingualTag")??{log:(...t)=>console.log("[Handler:MultilingualTag]",...t),warn:(...t)=>console.warn("[Handler:MultilingualTag]",...t),error:(...t)=>console.error("[Handler:MultilingualTag]",...t)};async function aT(t,e){const n=window.G7Core;if(!n){ks.error("G7Core not available");return}const r=n.state?.getGlobal?.()?.multilingualTagEdit;if(!r){ks.warn("No multilingualTagEdit state found"),n.modal?.close?.();return}const{fieldName:s,editingIndex:o,values:i,statePath:a,currentTags:l}=r;if(!Object.values(i||{}).some(g=>typeof g=="string"&&g.trim()!=="")){ks.warn("No values to save"),n.modal?.close?.(),kd(n);return}const d=Array.isArray(l)?l:[];let u;o==null?u=[...d,i]:u=d.map((g,m)=>m===o?i:g);const f=a||(s?.startsWith("form.")?s:`form.${s}`);n.state?.setParentLocal?.({[f]:u}),n.modal?.close?.(),kd(n)}async function lT(t,e){const n=window.G7Core;if(!n){ks.error("G7Core not available");return}n.modal?.close?.(),kd(n)}async function cT(t,e){const n=window.G7Core;if(!n){ks.error("G7Core not available");return}const r=t?.params?.locale;if(!r){ks.warn("No locale specified");return}const s=e?.event;let o="";s?.target?.value!==void 0?o=s.target.value:s?.value!==void 0&&(o=s.value);const a=(n.state?.getGlobal?.()||{}).multilingualTagEdit||{},l={...a.values||{},[r]:o};n.dispatch?.({handler:"setState",params:{target:"global",multilingualTagEdit:{...a,values:l}}})}function kd(t){t.dispatch?.({handler:"setState",params:{target:"global",multilingualTagEdit:null}})}function Um(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),s=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),i=String(t.getSeconds()).padStart(2,"0");return`${e}-${n}-${r}T${s}:${o}:${i}`}function dT(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59),r=Um(n),s=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);switch(t){case"today":break;case"week":s.setDate(s.getDate()-6);break;case"month":s.setMonth(s.getMonth()-1);break;case"3months":s.setMonth(s.getMonth()-3);break;case"6months":s.setMonth(s.getMonth()-6);break;case"1year":s.setFullYear(s.getFullYear()-1);break}return{startDate:Um(s),endDate:r}}function uT(t){const{preset:e}=t.params||{preset:"today"},{startDate:n,endDate:r}=dT(e);return{startDate:n,endDate:r,preset:e}}const Ao=window.G7Core?.createLogger?.("Handler:Sidebar")??{log:(...t)=>console.log("[Handler:Sidebar]",...t),warn:(...t)=>console.warn("[Handler:Sidebar]",...t),error:(...t)=>console.error("[Handler:Sidebar]",...t)},Bm="g7_admin_sidebar_collapsed";function jm(){try{return localStorage.getItem(Bm)==="1"}catch{return!1}}function fT(t){try{localStorage.setItem(Bm,t?"1":"0")}catch(e){Ao.error("Failed to save sidebar state to localStorage:",e)}try{window.G7Core?.state?.setGlobal?.({sidebarCollapsed:t})}catch(e){Ao.warn("Failed to set global sidebar state:",e)}}function Wm(){const t=jm();try{window.G7Core?.state?.setGlobal?.({sidebarCollapsed:t})}catch(e){Ao.warn("Failed to restore sidebar state:",e)}Ao.log("Initial sidebar collapsed state restored:",t)}async function hT(t,e){Wm()}async function gT(t,e){const r=!(()=>{try{return!!window.G7Core?.state?.getGlobal?.()?.sidebarCollapsed}catch{return jm()}})();fT(r),Ao.log("Sidebar collapsed toggled to:",r)}const Cd=window.G7Core?.createLogger?.("Handler:DownloadAttachment")??{log:(...t)=>console.log("[Handler:DownloadAttachment]",...t),warn:(...t)=>console.warn("[Handler:DownloadAttachment]",...t),error:(...t)=>console.error("[Handler:DownloadAttachment]",...t)};async function pT(t,e){const n=window.G7Core,{url:r,filename:s}=t?.params||{};if(!r){Cd.warn("다운로드 URL 이 없어 요청을 건너뜁니다.");return}if(!n?.api?.get){Cd.error("G7Core.api.get 이 초기화되지 않아 다운로드를 실행할 수 없습니다.");return}try{const o=await n.api.get(r,{responseType:"blob"});if(o){const i=URL.createObjectURL(o),a=document.createElement("a");a.href=i,a.download=s||"",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}}catch(o){Cd.error("첨부파일 다운로드 실패",o),n?.toast?.error?.(n?.t?.("common.download_failed")??"Download failed")}}const Oa=window.G7Core?.createLogger?.("Handler:DetectAssetUrlMode")??{log:(...t)=>console.log("[Handler:DetectAssetUrlMode]",...t),warn:(...t)=>console.warn("[Handler:DetectAssetUrlMode]",...t),error:(...t)=>console.error("[Handler:DetectAssetUrlMode]",...t)},mT="G7_ASSET_PROBE_OK";async function Gm(t){try{const e=await fetch(t,{cache:"no-store",credentials:"omit"});if(!e.ok)return!1;const n=e.headers.get("content-type")??"";return/javascript|ecmascript/i.test(n)?(await e.text()).includes(mT):!1}catch{return!1}}async function Ym(){const[t,e]=await Promise.all([Gm("/api/system/asset-probe.js"),Gm("/api/system/asset-probe")]);return t&&e?"extension":!t&&e?"extensionless":"unavailable"}function bT(){return window.G7Config?.settings?.general?.asset_url_mode??"extension"}async function yT(t){try{const e=await Ym();if(e==="unavailable")return;const n=bT();if(e===n)return;window.G7Core?.state?.setGlobal?.({assetUrlModeDrift:{detected:e,stored:n}})}catch(e){Oa.warn("자산 URL 방식 대조 실패 (대시보드 동작에는 영향 없음):",e)}}async function vT(t,e){const n=window.G7Core,r=e?.setState??n?.state?.setLocal,s=o=>{typeof r=="function"?r({asset_url_mode_detect_status:o}):Oa.warn("setState 를 찾지 못해 감지 상태를 폼에 반영하지 못했습니다")};try{s("detecting");const o=await Ym();if(o==="unavailable"){s("unavailable");return}typeof r=="function"?r({"general.asset_url_mode":o,asset_url_mode_detect_status:o}):Oa.warn("setState 를 찾지 못해 감지 결과를 폼에 반영하지 못했습니다")}catch(o){Oa.error("자산 URL 방식 감지 실패:",o),s("unavailable")}}const Ta={detectAssetUrlMode:vT,checkAssetUrlModeDrift:yT,setTheme:Q5,initTheme:Z5,scrollToSection:nu,initMenuFromUrl:nT,initFilterVisibility:rT,saveFilterVisibility:sT,toggleFilterVisibility:oT,resetFilterVisibility:iT,saveMultilingualTag:aT,cancelMultilingualTag:lT,updateMultilingualTagValue:cT,setDateRange:uT,toggleSidebar:gT,initSidebar:hT,downloadAttachment:pT},Do=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic:IdentityLauncher")??{log:(...t)=>console.log("[Template:sirsoft-admin_basic:IdentityLauncher]",...t),warn:(...t)=>console.warn("[Template:sirsoft-admin_basic:IdentityLauncher]",...t),error:(...t)=>console.error("[Template:sirsoft-admin_basic:IdentityLauncher]",...t)};function xT(){const e=window.G7Core?.api?.getToken?.()??null;return e?{Authorization:`Bearer ${e}`}:{}}function wT(){try{const t=typeof window<"u"?window.localStorage?.getItem("g7_locale"):null;return t?{"Accept-Language":t}:{}}catch{return{}}}async function kT(t,e=null){const n={purpose:t.purpose};t.provider_id&&(n.provider_id=t.provider_id),e&&(n.target=e);const r=t.challenge_start_url||"/api/identity/challenges",s=await fetch(r,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...wT(),...xT()},body:JSON.stringify(n)}),o=await s.json().catch(()=>null);if(!s.ok||!o?.success){const a=o?.message??`Challenge 시작 실패 (HTTP ${s.status})`;throw new Error(a)}const i=o.data??o;return{id:i.id,expires_at:i.expires_at,render_hint:i.render_hint??t.render_hint??"text_code",public_payload:i.public_payload,redirect_url:i.redirect_url,max_attempts:typeof i.max_attempts=="number"?i.max_attempts:void 0}}async function CT(t){const e=window.G7Core,n=e?.identity;if(!e?.dispatch||!e?.state||!n)return Do.error("G7Core 또는 G7Core.identity 가 초기화되지 않아 launcher 를 실행할 수 없습니다."),{status:"failed",failureCode:"G7_NOT_READY"};if(t.render_hint==="external_redirect"||t.redirect_url)return n.redirectExternally(t);const r=t.target&&(t.target.email||t.target.phone)?t.target:null;let s;try{s=await kT(t,r)}catch(m){Do.error("Challenge 시작 실패:",m);try{await e.dispatch({handler:"toast",params:{type:"error",message:m instanceof Error?m.message:"본인인증 시작에 실패했습니다."}})}catch{}return{status:"failed",failureCode:"CHALLENGE_START_FAILED",reason:m instanceof Error?m.message:String(m)}}if(s.redirect_url)return n.redirectExternally({...t,render_hint:"external_redirect",redirect_url:s.redirect_url});const o=s.expires_at?new Date(s.expires_at).getTime():0,i=o>0?Math.max(0,Math.floor((o-Date.now())/1e3)):0,a=typeof s.max_attempts=="number"?s.max_attempts:0;e.state.set({identityChallenge:{policy_key:t.policy_key,purpose:t.purpose,provider_id:t.provider_id??null,render_hint:s.render_hint,challenge_id:s.id,expires_at:s.expires_at,public_payload:s.public_payload??{},target:r,code:"",error:null,attempts:0,maxAttempts:a,remainingSeconds:i,resendCooldown:0}});let l=o,c=0;const d=window.setInterval(()=>{const m=l>0?Math.max(0,Math.floor((l-Date.now())/1e3)):0;c=Math.max(0,c-1),e.state.set({identityChallenge:{remainingSeconds:m,resendCooldown:c}})},1e3);let u=null;try{u=e.state.subscribe?.(m=>{const p=m?.identityChallenge?.expires_at;if(typeof p=="string"){const b=new Date(p).getTime();Number.isFinite(b)&&b!==l&&(l=b)}const y=m?.identityChallenge?.resendCooldown;typeof y=="number"&&y>c&&(c=y)})??null}catch{}const f=n.createDeferred();try{await e.dispatch({handler:"openModal",target:"identity-challenge-modal"})}catch(m){return Do.error("openModal 실패 — 풀페이지로 폴백:",m),window.clearInterval(d),u?.(),n.redirectExternally({...t,render_hint:"external_redirect",redirect_url:`/admin/identity/challenge?challenge_id=${encodeURIComponent(s.id)}&return=${encodeURIComponent(window.location.href)}`})}const g=await f;return window.clearInterval(d),u?.(),g}function ST(){const t=window.G7Core?.identity;if(!t?.setLauncher){Do.warn("G7Core.identity 가 아직 초기화되지 않아 launcher 등록을 건너뜁니다. 코어 부트스트랩 순서를 확인하세요.");return}t.setLauncher(CT),Do.log("IDV launcher registered (sirsoft-admin_basic)")}function _T(t){const e=t.icons;return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object"&&typeof n.value=="string"):[]}function ET(t,e){const n=t.label;return typeof n=="string"?n.startsWith("$t:")?e(n.slice(3)):n:t.value}function MT(t,e,n){if(n==="")return!0;const r=n.toLowerCase();return t.value.toLowerCase().includes(r)||e.toLowerCase().includes(r)?!0:(t.keywords??[]).some(s=>s.toLowerCase().includes(r))}function NT({entry:t}){const e=t.preview;return e?.html?h.jsx("span",{className:"g7le-icon-preview",dangerouslySetInnerHTML:{__html:e.html},style:_d}):e?.className?h.jsx("span",{className:`g7le-icon-preview ${e.className}`,style:_d}):h.jsx("i",{className:`fas fa-${t.value}`,style:_d,"aria-hidden":"true"})}function OT({control:t,value:e,onChange:n,t:r}){const s=_T(t),o=e==null?"":String(e),i=typeof t.iconColumns=="number"?t.iconColumns:6,a=t.iconSearchPlaceholder,l=typeof a=="string"&&a.startsWith("$t:")?r(a.slice(3)):r("layout_editor.icon_picker.search_placeholder"),[c,d]=v.useState("");if(s.length===0)return h.jsx("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Xm,children:h.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-free","data-testid":"g7le-widget-icon-picker-free",value:o,placeholder:r("layout_editor.icon_picker.free_input_hint"),onChange:g=>n(g.target.value===""?void 0:g.target.value),style:Km})});const u=g=>ET(g,r),f=s.filter(g=>MT(g,u(g),c));return h.jsxs("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Xm,children:[h.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-search","data-testid":"g7le-widget-icon-picker-search",value:c,placeholder:l,onChange:g=>d(g.target.value),style:Km}),h.jsxs("div",{className:"g7le-icon-grid","data-testid":"g7le-widget-icon-picker-grid",style:{...TT,gridTemplateColumns:`repeat(${i}, minmax(0, 1fr))`},children:[h.jsx("button",{type:"button","data-testid":"g7le-icon-cell-none",title:r("layout_editor.icon_picker.none"),onClick:()=>n(void 0),"aria-pressed":o==="",style:o===""?qm:Sd,children:h.jsx("span",{style:AT,children:"—"})}),f.map(g=>{const m=g.value===o;return h.jsx("button",{type:"button","data-testid":`g7le-icon-cell-${g.value}`,title:u(g),"aria-pressed":m,onClick:()=>n(g.value),style:m?qm:Sd,children:h.jsx(NT,{entry:g})},g.value)})]}),f.length===0&&h.jsx("div",{"data-testid":"g7le-widget-icon-picker-empty",style:DT,children:r("layout_editor.icon_picker.no_results")})]})}const Xm={display:"flex",flexDirection:"column",gap:6,width:"100%"},Km={padding:"5px 8px",fontSize:12,border:"1px solid #cbd5e1",borderRadius:6,width:"100%"},TT={display:"grid",gap:4,maxHeight:220,overflowY:"auto",padding:2},Sd={display:"flex",alignItems:"center",justifyContent:"center",minHeight:34,padding:4,border:"1px solid #e2e8f0",borderRadius:6,background:"#fff",cursor:"pointer"},qm={...Sd,border:"2px solid #2563eb",background:"#eff6ff"},_d={display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:16,lineHeight:1},AT={fontSize:10,color:"#475569",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},DT={fontSize:11,color:"#94a3b8",fontStyle:"italic",padding:"4px 2px"},Zm=130,An=20;function IT(t){const e=t?.arrayProp;return typeof e=="string"&&e?e:"tabs"}function LT(t){let e=0;for(const n of t){const r=typeof n.id=="number"?n.id:Number(n.id);Number.isFinite(r)&&r>e&&(e=r)}return e+1}function PT({node:t,params:e,cellBoxes:n,t:r,onPatchNode:s}){const o=IT(e),i=v.useMemo(()=>{const g=(t.props??{})[o];return typeof g=="string"||!Array.isArray(g)?null:g},[t,o]),a=v.useMemo(()=>{const g=new Map,m=`props.${o}.`;for(const p of n??[]){if(!p.path.startsWith(m))continue;const y=Number(p.path.slice(m.length));Number.isInteger(y)&&g.set(y,{top:p.top,left:p.left,width:p.width,height:p.height})}return g},[n,o]),l=v.useCallback(g=>{const m=t.props??{};s({...t,props:{...m,[o]:g}})},[t,o,s]),c=v.useCallback(g=>{if(!i)return;const p={id:LT(i),label:r("editor.tabnav_inplace.new_tab")},y=i.slice();y.splice(g,0,p),l(y)},[i,l,r]),d=v.useCallback(g=>{if(!i)return;const m=i.slice();m.splice(g,1),l(m)},[i,l]),u=v.useCallback((g,m)=>{if(!i)return;const p=g+m;if(p<0||p>=i.length)return;const y=i.slice(),[b]=y.splice(g,1);y.splice(p,0,b),l(y)},[i,l]);if(!i||a.size===0)return null;const f={position:"absolute",width:An,height:An,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,lineHeight:1,border:"1px solid rgba(0,0,0,0.15)",borderRadius:4,background:"#ffffff",color:"#1f2937",cursor:"pointer",boxShadow:"0 1px 2px rgba(0,0,0,0.18)",pointerEvents:"auto",padding:0,zIndex:Zm};return h.jsx("div",{className:"g7le-tabnav-inplace","data-testid":"g7le-tabnav-inplace",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:Zm},children:i.map((g,m)=>{const p=a.get(m);if(!p)return null;const y=p.left+p.width;return h.jsxs("div",{"data-testid":`g7le-tabnav-aff-${m}`,children:[h.jsx("button",{type:"button","data-testid":`g7le-tabnav-remove-${m}`,title:r("editor.tabnav_inplace.remove"),"aria-label":r("editor.tabnav_inplace.remove"),style:{...f,left:y-An/2,top:p.top-An/2,color:"#b91c1c"},onClick:b=>{b.preventDefault(),b.stopPropagation(),d(m)},children:"✕"}),m>0&&h.jsx("button",{type:"button","data-testid":`g7le-tabnav-move-left-${m}`,title:r("editor.tabnav_inplace.move_left"),"aria-label":r("editor.tabnav_inplace.move_left"),style:{...f,left:p.left,top:p.top+p.height-An/2},onClick:b=>{b.preventDefault(),b.stopPropagation(),u(m,-1)},children:"◀"}),m<i.length-1&&h.jsx("button",{type:"button","data-testid":`g7le-tabnav-move-right-${m}`,title:r("editor.tabnav_inplace.move_right"),"aria-label":r("editor.tabnav_inplace.move_right"),style:{...f,left:y-An,top:p.top+p.height-An/2},onClick:b=>{b.preventDefault(),b.stopPropagation(),u(m,1)},children:"▶"}),m===0&&h.jsx("button",{type:"button","data-testid":"g7le-tabnav-add-0",title:r("editor.tabnav_inplace.add"),"aria-label":r("editor.tabnav_inplace.add"),style:{...f,left:p.left-An,top:p.top+p.height/2-An/2,color:"#15803d"},onClick:b=>{b.preventDefault(),b.stopPropagation(),c(0)},children:"+"}),h.jsx("button",{type:"button","data-testid":`g7le-tabnav-add-${m+1}`,title:r("editor.tabnav_inplace.add"),"aria-label":r("editor.tabnav_inplace.add"),style:{...f,left:y-An/2,top:p.top+p.height/2-An/2,color:"#15803d"},onClick:b=>{b.preventDefault(),b.stopPropagation(),c(m+1)},children:"+"})]},`tab-aff-${g.id}-${m}`)})})}const Ed=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic:EditorWidgets")??{log:(...t)=>console.log("[Template:sirsoft-admin_basic:EditorWidgets]",...t),warn:(...t)=>console.warn("[Template:sirsoft-admin_basic:EditorWidgets]",...t)};function $T(){if(typeof window>"u")return;const t=window.G7Core?.layoutEditor;if(!t?.registerWidget){Ed.warn("G7Core.layoutEditor 미노출 — icon-picker 위젯 등록 보류");return}t.registerWidget("icon-picker",OT),Ed.log("편집기 위젯 'icon-picker' 등록됨(Font Awesome 검색 그리드)"),t.registerCanvasOverlay&&(t.registerCanvasOverlay("tabnav",PT),Ed.log("편집기 캔버스 오버레이 'tabnav' 등록됨(TabNavigation 탭 인플레이스)"))}const Md=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic")??{log:(...t)=>console.log("[Template:sirsoft-admin_basic]",...t),warn:(...t)=>console.warn("[Template:sirsoft-admin_basic]",...t),error:(...t)=>console.error("[Template:sirsoft-admin_basic]",...t)};typeof window<"u"&&(window.G7TemplateHandlers=Ta);function Qm(){if(typeof window<"u"){let t=0;const e=50,n=()=>{const r=window.G7Core?.getActionDispatcher?.();r?(Object.entries(Ta).forEach(([s,o])=>{r.registerHandler(s,o)}),Md.log(`${Object.keys(Ta).length} custom handler(s) registered:`,Object.keys(Ta)),ST(),Wm()):(t++,t<=e?(Md.warn(`ActionDispatcher not found, retrying... (${t}/${e})`),setTimeout(n,100)):Md.error("Failed to register handlers: ActionDispatcher not available after maximum retries"))};document.readyState==="complete"?n():window.addEventListener("load",n)}}return $T(),Qm(),R.A=Fr,R.Accordion=sc,R.ActionMenu=Cs,R.AdminFooter=Cy,R.AdminHeader=vy,R.AdminSidebar=yy,R.Alert=uu,R.AlertDialog=cy,R.Badge=$d,R.BarChart=F5,R.Breadcrumb=au,R.Button=oe,R.Card=hb,R.CardGrid=Yb,R.CategoryTree=jS,R.Checkbox=Cn,R.ChipCheckbox=ME,R.Code=cb,R.CodeEditor=zv,R.ColumnSelector=Yv,R.ConfirmDialog=ou,R.Container=z5,R.DataGrid=Hb,R.Dialog=su,R.Div=I,R.DonutChart=V5,R.Dropdown=Kb,R.DropdownButton=NE,R.DropdownMenuItem=OE,R.DynamicFieldList=zE,R.EmptyState=py,R.ExtensionBadge=sh,R.FileInput=Nd,R.FileUploader=Ep,R.FilterGroup=Jb,R.FilterVisibilitySelector=wE,R.Flex=U5,R.Form=Va,R.FormField=WE,R.Fragment=ub,R.Grid=H5,R.H1=Pa,R.H2=er,R.H3=$r,R.H4=Od,R.Hr=fb,R.HtmlContent=Ja,R.HtmlEditor=bE,R.I=gt,R.Icon=re,R.IconButton=iy,R.IconName=de,R.IconSelect=FS,R.ImageGallery=ji,R.Img=kn,R.Input=wt,R.Label=on,R.LanguageSelector=ky,R.LayoutEditorHeader=Ny,R.LayoutFileList=Oy,R.LayoutHistoryPanel=Uv,R.LayoutWarnings=xE,R.Li=Fa,R.LoadingSpinner=by,R.LoginForm=Bv,R.Modal=Bo,R.MultilingualInput=ja,R.MultilingualLocaleContext=Fc,R.MultilingualTabPanel=jE,R.MultilingualTagInput=Gk,R.Nav=Po,R.NotificationCenter=xy,R.Ol=nb,R.Optgroup=ib,R.Option=ob,R.P=yt,R.PageHeader=Sy,R.PageLoading=Zv,R.PageTransitionIndicator=Kv,R.Pagination=$o,R.PermissionTree=US,R.Pre=db,R.ProductCard=qb,R.RadioGroup=gE,R.RichSelect=_E,R.SearchBar=Qb,R.SearchableDropdown=Yk,R.Section=Td,R.SectionHeader=Ey,R.SectionLayout=B5,R.Select=Vr,R.SlotContainer=SE,R.SortableMenuItem=Xh,R.SortableMenuList=PS,R.Span=Q,R.StatCard=Zb,R.StatusBadge=Fo,R.Svg=Wn,R.TabNavigation=Rb,R.TabNavigationScroll=sy,R.Table=za,R.TagInput=Bk,R.TagSelect=Xk,R.Tbody=Ua,R.Td=Jt,R.TemplateCard=My,R.Textarea=Rn,R.Tfoot=Ba,R.Th=zr,R.Thead=Ha,R.ThemeToggle=Wv,R.ThreeColumnLayout=j5,R.Toast=hy,R.Toggle=Wa,R.Tr=tr,R.Ul=$a,R.UnifiedIcon=lb,R.UserProfile=wy,R.VersionList=Mu,R.configureJSONLanguageService=Y5,R.defaultJSONSchemas=Fm,R.executeImageDownload=Dc,R.initTemplate=Qm,R.jsonEditorDefaults=W5,R.monacoInitOptions=G5,R.templateMetadata=X5,R.useCurrentMultilingualLocale=Ip,R.useImageGallery=fp,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),R})({},ReactJSXRuntime,React,ReactDOM);
|