@bwg-ui/core 1.2.9 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{MenuReport-CuAfCZbc.cjs → MenuReport-CXsmjSvg.cjs} +1 -1
- package/dist/chunks/{MenuReport-iuRC_snf.js → MenuReport-Dgq2wH6w.js} +1 -1
- package/dist/chunks/{common-components-CFIJNFN0.js → common-components-Bp95qOup.js} +6 -6
- package/dist/chunks/{common-components-CioS_8Bi.cjs → common-components-CoRIM-Z-.cjs} +2 -2
- package/dist/chunks/{layout-components-DMR4tl9_.cjs → layout-components-hCEUMfz3.cjs} +2 -2
- package/dist/chunks/{layout-components-C-9ATcL9.js → layout-components-yyItu5pi.js} +2 -2
- package/dist/components/common/BwgView.d.ts.map +1 -1
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +5 -5
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +107 -107
- package/dist/components/guide/index.cjs +1 -1
- package/dist/components/guide/index.js +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/pages/auth/CMAuthMstrM01.d.ts +7 -0
- package/dist/components/pages/auth/CMAuthMstrM01.d.ts.map +1 -0
- package/dist/components/pages/auth/CMRoleMstrM01.d.ts +3 -0
- package/dist/components/pages/auth/CMRoleMstrM01.d.ts.map +1 -0
- package/dist/components/pages/guide/BwgComponentGuideM01.d.ts +3 -0
- package/dist/components/pages/guide/BwgComponentGuideM01.d.ts.map +1 -0
- package/dist/components/pages/guide/BwgDeveloperGuideM01.d.ts +3 -0
- package/dist/components/pages/guide/BwgDeveloperGuideM01.d.ts.map +1 -0
- package/dist/components/pages/guide/BwgReactGuideM01.d.ts +3 -0
- package/dist/components/pages/guide/BwgReactGuideM01.d.ts.map +1 -0
- package/dist/components/pages/index.d.ts +20 -0
- package/dist/components/pages/index.d.ts.map +1 -0
- package/dist/components/pages/rsrc/CMFileMstrM01.d.ts +3 -0
- package/dist/components/pages/rsrc/CMFileMstrM01.d.ts.map +1 -0
- package/dist/components/pages/rsrc/CMMenuMstrM01.d.ts +3 -0
- package/dist/components/pages/rsrc/CMMenuMstrM01.d.ts.map +1 -0
- package/dist/components/pages/rsrc/CMMenuPrgrSelectModal.d.ts +16 -0
- package/dist/components/pages/rsrc/CMMenuPrgrSelectModal.d.ts.map +1 -0
- package/dist/components/pages/rsrc/CMMenuPrntSelectModal.d.ts +16 -0
- package/dist/components/pages/rsrc/CMMenuPrntSelectModal.d.ts.map +1 -0
- package/dist/components/pages/rsrc/CMPopuMstrM01.d.ts +3 -0
- package/dist/components/pages/rsrc/CMPopuMstrM01.d.ts.map +1 -0
- package/dist/components/pages/rsrc/CMPrgrMstrM01.d.ts +3 -0
- package/dist/components/pages/rsrc/CMPrgrMstrM01.d.ts.map +1 -0
- package/dist/components/pages/syst/CMSystCfgM01.d.ts +3 -0
- package/dist/components/pages/syst/CMSystCfgM01.d.ts.map +1 -0
- package/dist/components/pages/syst/CMSystCodeM01.d.ts +3 -0
- package/dist/components/pages/syst/CMSystCodeM01.d.ts.map +1 -0
- package/dist/components/pages/user/CMUserMstrM01.d.ts +3 -0
- package/dist/components/pages/user/CMUserMstrM01.d.ts.map +1 -0
- package/dist/components/popup/SearchAddressModalM01.d.ts +7 -0
- package/dist/components/popup/SearchAddressModalM01.d.ts.map +1 -0
- package/dist/components/popup/index.cjs +1 -1
- package/dist/components/popup/index.d.ts +1 -1
- package/dist/components/popup/index.d.ts.map +1 -1
- package/dist/components/popup/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +17 -17
- package/dist/stores/index.cjs +1 -1
- package/dist/stores/index.js +1 -1
- package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
- package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
- package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
- package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
- package/dist/types/bwg-global.d.ts +2 -1
- package/dist/utils/commonUtils.d.ts +0 -6
- package/dist/utils/commonUtils.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1386 -748
- package/package.json +1 -1
- package/dist/chunks/core-CA7iRgyb.cjs +0 -1
- package/dist/chunks/core-D18HD1It.js +0 -513
- package/dist/chunks/enc-base64-CdWu8KMI.js +0 -101
- package/dist/chunks/enc-base64-DSIiAsI5.cjs +0 -1
- package/dist/chunks/sha256-D5iKSlK6.cjs +0 -1
- package/dist/chunks/sha256-DQcqzuys.js +0 -78
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const ot=require("../utils/index.cjs"),gt=require("../stores/index.cjs"),c=require("react/jsx-runtime"),ce=require("@ant-design/icons"),A=require("antd"),g=require("react"),dr=require("../provider/index.cjs"),zu=require("dompurify"),yl=require("quill"),Lu=require("react-quill"),Na=require("quill-image-resize-module-react"),lo=require("react-dom"),Ke=require("realgrid"),Aa=require("realgrid-react"),Bu=require("react-rnd"),Hu=require("./layout-components-DMR4tl9_.cjs"),Vn=require("../components/core/index.cjs"),Ma=require("react-router-dom");function xl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const nn=xl(ce),h=xl(g),$i=({checkAuth:e=!1,buttons:t,gap:r=8})=>{const{user:n}=gt.useUserStore(),o=dr.useServiceCodeValue("AUTH_BTNS"),[i,a]=g.useState({});g.useEffect(()=>{const l=e?e.menuId:void 0,u=e?e.grpId:void 0;if(!l||!u){a({});return}ot.callService(o,{crprCd:n?.crprCd,userId:n?.userId,grpId:u.toUpperCase(),menuId:l}).then(f=>{const d=Array.isArray(f?.data)?f.data:Array.isArray(f)?f:[];console.log("@@ 권한 버튼 조회결과(list)",d);const p={};(d||[]).forEach(w=>{const b=String(w?.btnId||"").trim();if(!b)return;const C=w?.enblYn==null?!0:String(w.enblYn).toUpperCase()==="Y";p[b]=C}),a(p)}).catch(f=>{console.error(f),a({})})},[o,n?.crprCd,n?.userId,e?e.menuId:void 0,e?e.grpId:void 0]);const s=g.useMemo(()=>!t||t.length===0?null:t.filter(l=>l?.visible!==!1).map(l=>{const u=!!l.disabled;if(!e)return c.jsx(A.Button,{type:l.type,disabled:u,loading:l.loading,className:l.className||"bwg-btn",style:l.style,icon:l.icon,onClick:l.onClick,children:l.label},l.id);const p=!(Object.prototype.hasOwnProperty.call(i,l.id)?!!i[l.id]:!1),w=u||p,b=c.jsx(A.Button,{type:l.type,disabled:w,loading:l.loading,className:l.className||"bwg-btn",style:l.style,icon:l.icon,onClick:l.onClick,children:l.label},l.id);if(p){const C=c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx(ce.ExclamationCircleFilled,{style:{color:"#faad14",fontSize:16}}),c.jsx("span",{style:{fontWeight:600},children:`'${l.label}' 버튼에 대한 사용 권한이 없습니다.`})]}),m=c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,paddingLeft:24},children:c.jsx("span",{style:{fontSize:12},children:"관리자에게 문의하세요."})});return c.jsx(A.Popover,{title:C,content:m,placement:"bottom",styles:{body:{backgroundColor:"#fffbe6"}},children:c.jsx("span",{children:b})},l.id)}return b}),[t,i,e]);return c.jsx(A.Flex,{gap:r,children:s})};var Fu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var o=!1;try{o=this instanceof n}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}const Wu=({grpId:e,menuId:t,btnEvent:r,layout:n="horizontal",size:o="middle",style:i,className:a,onButtonClick:s})=>{const l=dr.useServiceCodeValue("AUTH_BTNS"),{user:u}=gt.useUserStore(),[f,d]=g.useState([]),[p,w]=g.useState(!0),[b,C]=g.useState(null),[m,$]=g.useState({}),S=async()=>{try{w(!0),C(null),console.log("@@ 커스텀버튼그룹 영역 조회시작",e,t);const j=await ot.callService(l,{userId:u?.userId,crprCd:u?.crprCd,grpId:e.toUpperCase(),menuId:t});if(console.log("@@ 커스텀버튼그룹 영역 조회결과",j),j?.data&&Array.isArray(j.data)){const y=j.data.sort((E,O)=>E.btnSq-O.btnSq);d(y)}else d([])}catch(j){console.error("버튼 권한 조회 실패:",j),C("버튼 권한을 조회하는 중 오류가 발생했습니다."),d([])}finally{w(!1)}};g.useEffect(()=>{S()},[e,t]);const P=async(j,y)=>{$(E=>({...E,[j]:{loading:!0}}));try{const E=r?.[j];E?await E():console.warn(`버튼 이벤트 핸들러를 찾을 수 없습니다: ${j}`),s&&s(j,y,e)}catch(E){console.error("버튼 이벤트 실행 실패:",E),A.message.error("작업 중 오류가 발생했습니다.")}finally{$(E=>({...E,[j]:{loading:!1}}))}},_=j=>{const y=m[j.btnId]||{loading:!1};return c.jsxs(A.Button,{size:o,loading:y.loading,onClick:()=>P(j.btnId,j.btnNm),className:"bwg-btn",style:{...j.iconVal&&{display:"flex",alignItems:"center",gap:"4px"}},children:[j.iconVal&&c.jsxs(c.Fragment,{children:[j.iconType==="ANTD"&&nn[j.iconVal]&&g.createElement(nn[j.iconVal],{style:{fontSize:"14px"}}),j.iconType!=="ANTD"&&c.jsx("span",{className:j.iconVal,style:{fontSize:"14px"}})]}),j.btnNm]},j.btnId)};return p?c.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${a||""}`,style:i,children:c.jsx(A.Space,{direction:n==="vertical"?"vertical":"horizontal",size:o,children:c.jsx(A.Button,{loading:!0,size:o,children:"권한 조회 중..."})})}):b?c.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${a||""}`,style:i,children:c.jsx(A.Alert,{message:"권한 오류",description:b,type:"error",showIcon:!0,style:{minHeight:"40px"}})}):f.length===0?c.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${a||""}`,style:i,children:c.jsx(A.Alert,{message:"부여된 권한이 없습니다",type:"warning",showIcon:!0,style:{height:"20px",display:"flex",alignItems:"center",margin:0,padding:"10px 10px"}})}):c.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${a||""}`,style:i,children:c.jsx(A.Flex,{gap:3,children:f.map(_)})})},Ku=({content:e,layout:t="flex",gap:r=16,minWidth:n=120,maxWidth:o=300,style:i,className:a})=>{if(!(Array.isArray(e)&&e.length>0&&Array.isArray(e[0])))return c.jsx("div",{style:i,className:a,children:e});const l=e.filter(w=>w&&w.length>0),u=g.useMemo(()=>{const w=l[0];if(!w||w.length===0)return{totalCols:0,baseWidth:0};let b=0;const C=[];w.forEach($=>{const S=$,P=S?.props?.["data-colspan"]?parseInt(String(S.props["data-colspan"])):1;b+=P,C.push(P)});const m=b>0?100/b:0;return{totalCols:b,baseWidth:m,componentWidths:C}},[l]),f=(w,b,C)=>{const m=w,$=m?.props?.["data-colspan"]?parseInt(String(m.props["data-colspan"])):1;switch(t){case"equal":return 100/C;case"auto":return 100/C;case"grid":return 100/u.totalCols*$;case"flex":default:const S=u.baseWidth*$;return Math.max(n,Math.min(o,S))}},d=w=>{if(!w||typeof w!="object")return w;const b=w;if(!b.props)return w;const m={...b.props.style||{},width:"100%"};return g.cloneElement(b,{...b.props,style:m})},p=(w,b)=>{if(!w||w.length===0)return null;const C=w.length;return t==="grid"?c.jsx("div",{className:"erp-cmm-form",style:{display:"grid",gridTemplateColumns:`repeat(${u.totalCols}, 1fr)`,gap:`${r}px`,width:"100%"},children:w.map((m,$)=>{const S=m?.props?.["data-colspan"]?parseInt(String(m.props["data-colspan"])):1,P=d(m);return c.jsx("div",{style:{gridColumn:`span ${S}`,minWidth:`${n}px`},className:"form-component-wrapper",children:P},`row-${b}-col-${$}`)})},`row-${b}`):c.jsx(A.Flex,{gap:r,className:"erp-cmm-form",wrap:t==="auto"?"wrap":"nowrap",style:{width:"100%"},children:w.map((m,$)=>{const S=f(m,$,C),P=d(m),_=t==="flex"?{width:`${S}px`,minWidth:`${n}px`,maxWidth:`${o}px`,flexShrink:0}:{width:`${S}%`,minWidth:`${n}px`};return c.jsx("div",{style:_,className:"form-component-wrapper",children:P},`row-${b}-col-${$}`)})},`row-${b}`)};return c.jsx(A.Flex,{gap:"small",vertical:!0,style:i,className:a,children:l.map((w,b)=>p(w,b+1))})},qu=({children:e,...t})=>c.jsx(A.Col,{...t,className:"bwg-col",children:e});var qr={},Ko={exports:{}},Ia;function Co(){return Ia||(Ia=1,(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ko)),Ko.exports}var Ur={},Da;function Uu(){if(Da)return Ur;Da=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.default=void 0;var e={items_per_page:"/ 페이지",jump_to:"이동하기",jump_to_confirm:"확인하다",page:"페이지",prev_page:"이전 페이지",next_page:"다음 페이지",prev_5:"이전 5 페이지",next_5:"다음 5 페이지",prev_3:"이전 3 페이지",next_3:"다음 3 페이지",page_size:"페이지 크기"};return Ur.default=e,Ur}var Gr={},Yr={},Xr={},qo={exports:{}},Uo={exports:{}},Go={exports:{}},Yo={exports:{}},za;function Cl(){return za||(za=1,(function(e){function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Yo)),Yo.exports}var Xo={exports:{}},La;function Gu(){return La||(La=1,(function(e){var t=Cl().default;function r(n,o){if(t(n)!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var a=i.call(n,o||"default");if(t(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Xo)),Xo.exports}var Ba;function Yu(){return Ba||(Ba=1,(function(e){var t=Cl().default,r=Gu();function n(o){var i=r(o,"string");return t(i)=="symbol"?i:i+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Go)),Go.exports}var Ha;function Xu(){return Ha||(Ha=1,(function(e){var t=Yu();function r(n,o,i){return(o=t(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Uo)),Uo.exports}var Fa;function Qu(){return Fa||(Fa=1,(function(e){var t=Xu();function r(o,i){var a=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);i&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(o,l).enumerable})),a.push.apply(a,s)}return a}function n(o){for(var i=1;i<arguments.length;i++){var a=arguments[i]!=null?arguments[i]:{};i%2?r(Object(a),!0).forEach(function(s){t(o,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach(function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(a,s))})}return o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(qo)),qo.exports}var Qr={},Va;function Zu(){return Va||(Va=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.commonLocale=void 0,Qr.commonLocale={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),Qr}var Wa;function Ju(){if(Wa)return Xr;Wa=1;var e=Co().default;Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.default=void 0;var t=e(Qu()),r=Zu(),n=(0,t.default)((0,t.default)({},r.commonLocale),{},{locale:"ko_KR",today:"오늘",now:"현재 시각",backToToday:"오늘로 돌아가기",ok:"확인",clear:"지우기",week:"주",month:"월",year:"년",timeSelect:"시간 선택",dateSelect:"날짜 선택",monthSelect:"달 선택",yearSelect:"연 선택",decadeSelect:"연대 선택",yearFormat:"YYYY년",dateFormat:"YYYY-MM-DD",dateTimeFormat:"YYYY-MM-DD HH:mm:ss",monthBeforeYear:!1,previousMonth:"이전 달 (PageUp)",nextMonth:"다음 달 (PageDown)",previousYear:"이전 해 (Control + left)",nextYear:"다음 해 (Control + right)",previousDecade:"이전 연대",nextDecade:"다음 연대",previousCentury:"이전 세기",nextCentury:"다음 세기"});return Xr.default=n,Xr}var Zr={},Ka;function Sl(){if(Ka)return Zr;Ka=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.default=void 0;const e={placeholder:"시간 선택",rangePlaceholder:["시작 시간","종료 시간"]};return Zr.default=e,Zr}var qa;function wl(){if(qa)return Yr;qa=1;var e=Co().default;Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.default=void 0;var t=e(Ju()),r=e(Sl());const n={lang:Object.assign({placeholder:"날짜 선택",yearPlaceholder:"연도 선택",quarterPlaceholder:"분기 선택",monthPlaceholder:"월 선택",weekPlaceholder:"주 선택",rangePlaceholder:["시작일","종료일"],rangeYearPlaceholder:["시작 연도","종료 연도"],rangeMonthPlaceholder:["시작 월","종료 월"],rangeQuarterPlaceholder:["시작 분기","종료 분기"],rangeWeekPlaceholder:["시작 주","종료 주"],shortWeekDays:["일","월","화","수","목","금","토"],shortMonths:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},t.default),timePickerLocale:Object.assign({},r.default)};return Yr.default=n,Yr}var Ua;function ed(){if(Ua)return Gr;Ua=1;var e=Co().default;Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.default=void 0;var t=e(wl());return Gr.default=t.default,Gr}var Ga;function td(){if(Ga)return qr;Ga=1;var e=Co().default;Object.defineProperty(qr,"__esModule",{value:!0}),qr.default=void 0;var t=e(Uu()),r=e(ed()),n=e(wl()),o=e(Sl());const i="${label} 유효하지 않은 ${type}",a={locale:"ko",Pagination:t.default,DatePicker:n.default,TimePicker:o.default,Calendar:r.default,global:{placeholder:"선택하세요",close:"닫기"},Table:{filterTitle:"필터 메뉴",filterConfirm:"확인",filterReset:"초기화",filterEmptyText:"필터 없음",filterCheckAll:"전체 선택",filterSearchPlaceholder:"필터 검색",emptyText:"데이터 없음",selectAll:"전체 선택",selectInvert:"선택 반전",selectNone:"없음",selectionAll:"전체 선택",sortTitle:"정렬",expand:"펼치기",collapse:"접기",triggerDesc:"내림차순으로 정렬하기",triggerAsc:"오름차순으로 정렬하기",cancelSort:"정렬 취소하기"},Tour:{Next:"다음",Previous:"이전",Finish:"종료"},Modal:{okText:"확인",cancelText:"취소",justOkText:"확인"},Popconfirm:{okText:"확인",cancelText:"취소"},Transfer:{titles:["",""],searchPlaceholder:"여기에 검색하세요",itemUnit:"개",itemsUnit:"개",remove:"삭제",selectCurrent:"현재 페이지 선택",removeCurrent:"현재 페이지 삭제",selectAll:"전체 선택",removeAll:"전체 삭제",selectInvert:"선택 반전"},Upload:{uploading:"업로드 중...",removeFile:"파일 삭제",uploadError:"업로드 실패",previewFile:"파일 미리보기",downloadFile:"파일 다운로드"},Empty:{description:"데이터 없음"},Icon:{icon:"아이콘"},Text:{edit:"수정",copy:"복사",copied:"복사 됨",expand:"확장"},Form:{optional:"(선택사항)",defaultValidateMessages:{default:"필드 유효성 검사 오류 ${label}",required:"${label} 값을 입력해 주세요",enum:"${label} [${enum}] 중에 하나여야 합니다",whitespace:"${label} 비워둘 수 없습니다",date:{format:"${label} 유효하지 않은 날짜 형식입니다",parse:"${label} 날짜 형식으로 변환될 수 없습니다",invalid:"${label} 유효하지 않은 날짜입니다"},types:{string:i,method:i,array:i,object:i,number:i,date:i,boolean:i,integer:i,float:i,regexp:i,email:i,url:i,hex:i},string:{len:"${label} ${len}글자여야 합니다",min:"${label} 적어도 ${min}글자 이상이어야 합니다",max:"${label} ${max}글자 이하여야 합니다",range:"${label} ${min}-${max}글자 사이어야 합니다"},number:{len:"${label} 값은 ${len}이어야 합니다",min:"${label} 최솟값은 ${min}입니다",max:"${label} 최댓값은 ${max}입니다",range:"${label} 값은 ${min}-${max} 사이어야 합니다"},array:{len:"${len}이어야 합니다 ${label}",min:"최소 ${min}이어야 합니다 ${label}",max:"최대 ${max}이어야 합니다 ${label}",range:"${label} ${min}-${max} 사이어야 합니다"},pattern:{mismatch:"${label} ${pattern} 패턴과 일치하지 않습니다"}}},Image:{preview:"미리보기"},QRCode:{expired:"만료된 QR 코드",refresh:"새로고침"},ColorPicker:{presetEmpty:"미정",transparent:"투명",singleColor:"단색",gradientColor:"그라데이션"}};return qr.default=a,qr}var Qo,Ya;function rd(){return Ya||(Ya=1,Qo=td()),Qo}var nd=rd();const El=xo(nd),jl=({children:e,customTheme:t,customComponentSize:r="middle",layout:n="comfortable",getPopupContainer:o})=>{const a=(()=>{const l={token:{colorPrimary:"#1890ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1890ff",fontFamily:'"Noto Sans KR", sans-serif',fontSize:14,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",boxShadowSecondary:"0 2px 4px rgba(0, 0, 0, 0.12)"},algorithm:A.theme.defaultAlgorithm};switch(n){case"compact":return{...l,token:{...l.token,padding:8,margin:8,borderRadius:4,fontSize:12,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14}};case"spacious":return{...l,token:{...l.token,padding:24,margin:24,borderRadius:8,fontSize:16,fontSizeHeading1:44,fontSizeHeading2:36,fontSizeHeading3:28,fontSizeHeading4:24,fontSizeHeading5:20}};default:return{...l,token:{...l.token,padding:16,margin:16,borderRadius:6,fontSize:14,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14}}}})(),s={...a,...t,token:{...a.token,...t?.token},components:{Checkbox:{colorPrimary:"var(--check-primary)",colorPrimaryBorder:"var(--check-primary)",colorPrimaryHover:"var(--check-primary-active)",colorText:"var(--text-primary)"},Radio:{colorPrimary:"var(--check-primary)",colorPrimaryActive:"var(--check-primary-active)",colorPrimaryHover:"var(--check-primary-active)"},Tree:{nodeHoverBg:"var(--tree-selected-bg)",nodeHoverColor:"var(--primary-color)",nodeSelectedBg:"var(--tree-selected-bg)",nodeSelectedColor:"var(--primary-color)",colorText:"var(--text-primary)"},...t?.components??{}}};return c.jsx(A.ConfigProvider,{locale:El,theme:s,componentSize:r,space:{size:r},form:{validateMessages:{required:"${label}을(를) 입력해주세요.",types:{email:"${label}이(가) 유효한 이메일이 아닙니다.",number:"${label}이(가) 유효한 숫자가 아닙니다."},number:{range:"${label}은(는) ${min} ~ ${max} 사이의 값이어야 합니다."}}},pagination:{showSizeChanger:!0},getPopupContainer:o,children:e})},od=({children:e})=>{const{activeDetailItem:t}=gt.useMenuViewStore();return c.jsx("div",{className:"bwg-view main-view",style:{height:"100%",display:"flex",flexDirection:"column"},children:c.jsx("div",{className:"bwgview-content",children:c.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[c.jsx(A.Breadcrumb,{separator:">",items:[{title:t?.prntInfo?.menuNm},{title:t?.viewLabel}]}),e]})})})},Vt=({title:e,icons:t,tooltip:r,iconVisible:n=!0,paddingBottom:o=0,marginBottom:i=0,children:a})=>{const s=nn.AppstoreTwoTone;return g.useMemo(()=>t?.type==="antd"&&t.icon&&nn[t.icon]||s,[t?.type,t?.icon]),c.jsx(A.Flex,{vertical:!0,style:{width:"100%"},children:c.jsxs("div",{className:`bwg-title-box ${o?`pb${o}`:""} ${i?`mb${i}`:""}`,style:{display:"flex",justifyContent:"space-between"},children:[c.jsx("div",{className:"bwg-title-box-left",children:c.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[c.jsx(A.Typography.Title,{level:4,children:c.jsx("span",{children:e})}),r&&c.jsx(A.Tooltip,{title:r.title,placement:r.placement,children:c.jsx(nn.QuestionCircleTwoTone,{style:{marginLeft:5}})})]})}),c.jsx("div",{className:"bwg-title-box-right",children:c.jsx(A.Flex,{gap:6,children:a})})]})})},{Panel:Xa}=A.Collapse,la=g.forwardRef(({reqRows:e,subRows:t,border:r=!1,labelDisplay:n,header:o},i)=>{const[a]=A.Form.useForm(),[s,l]=g.useState("1"),u=()=>n?{flex:n.md||n.lg||n.sm||"100px"}:{flex:"100px"};g.useImperativeHandle(i,()=>({getFormData:()=>a.getFieldsValue(),setFormData:d=>{a.setFieldsValue(d)},resetForm:()=>{a.resetFields()},validateForm:async()=>{try{return{success:!0,data:await a.validateFields()}}catch(d){return{success:!1,error:d}}}}));const f=()=>{l(d=>d.includes("subRows")?d.filter(p=>p!=="subRows"):[...d,"subRows"])};return c.jsxs("div",{style:r?{border:"1px solid #ddd",padding:"10px 12px",borderRadius:"8px",marginBottom:"10px"}:{},children:[o&&c.jsx(Vt,{title:o.title,children:o.buttons}),c.jsx(A.Form,{form:a,layout:"inline",style:{width:"100%",paddingBottom:e||t?"10px":"0px"},labelCol:u(),labelAlign:"left",children:c.jsxs("div",{style:{position:"relative",width:"100%"},children:[t&&c.jsx("div",{style:{position:"absolute",top:"15px",left:"-9px",zIndex:10},children:s.includes("subRows")?c.jsx(A.Tooltip,{title:"접기",children:c.jsx("span",{className:"search-collapsed-arrow",onClick:f,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",children:c.jsx("path",{d:"M5.28321 0.986589C4.88285 0.482264 4.11715 0.482265 3.71679 0.986589L1.0243 4.37824C0.50404 5.0336 0.970753 6 1.80751 6L7.19249 6C8.02925 6 8.49596 5.0336 7.9757 4.37824L5.28321 0.986589Z",fill:"#AEB9C4"})})})}):c.jsx(A.Tooltip,{title:"펼치기",children:c.jsx("span",{className:"search-collapsed-arrow",onClick:f,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",children:c.jsx("path",{d:"M5.28321 5.01341C4.88285 5.51774 4.11715 5.51773 3.71679 5.01341L1.0243 1.62176C0.50404 0.966397 0.970753 1.64312e-07 1.80751 2.37464e-07L7.19249 7.08234e-07C8.02925 7.81386e-07 8.49596 0.966399 7.9757 1.62176L5.28321 5.01341Z",fill:"#AEB9C4"})})})})}),c.jsx(A.ConfigProvider,{theme:{components:{Collapse:{}}},children:c.jsxs(A.Collapse,{activeKey:["reqRows",...s.includes("subRows")?["subRows"]:[]],onChange:l,className:"searchbox-collapse",bordered:!1,ghost:!0,children:[e&&c.jsx(Xa,{style:{padding:0,margin:0},header:void 0,showArrow:!1,collapsible:"disabled",children:e},"reqRows"),t&&c.jsx(Xa,{style:{padding:0,margin:0},header:void 0,showArrow:!1,collapsible:"icon",children:t},"subRows")]})})]})})]})}),id=({children:e,showSearchBox:t,showCloseButton:r=!0,showEyesButton:n=!1,shotSettingButton:o=!0,styles:i,...a})=>{const[s,l]=g.useState(!0),[u,f]=g.useState(()=>{const $=a.placement;return $==="left"||$==="right"||$==="top"||$==="bottom"?$:"bottom"}),[d,p]=g.useState(!1),b=($=>{const S={wrapper:{...a.width&&{width:a.width},...a.height&&{height:a.height},margin:"0 auto"},content:{},header:{backgroundColor:"var(--drawer-header-bg)",color:"var(--text-primary)"}};switch($){case"bottom":return{...S,wrapper:{...S.wrapper,borderRadius:"30px 30px 0 0"},content:{borderRadius:"30px 30px 0 0"},header:{...S.header,borderRadius:"30px 30px 0 0"}};case"top":return{...S,wrapper:{...S.wrapper,borderRadius:"0 0 30px 30px"},content:{borderRadius:"0 0 30px 30px"},header:{...S.header}};case"left":return{...S,wrapper:{...S.wrapper,borderRadius:"0 30px 0px 0"},content:{borderRadius:"0 30px 0px 0"},header:{...S.header,borderRadius:"0 30px 0 0"}};case"right":return{...S,wrapper:{...S.wrapper,borderRadius:"30px 0 0 0"},content:{borderRadius:"30px 0 0 0"},header:{...S.header,borderRadius:"30px 0 0 0"}};default:return S}})(u),C={wrapper:{...b?.wrapper,...i?.wrapper},content:{...b?.content,...i?.content},header:{...b?.header,...i?.header}},m=()=>{const $=[];if(o){const S=[{key:"top",label:"상단",icon:c.jsx(ce.CaretUpOutlined,{})},{key:"right",label:"우측",icon:c.jsx(ce.CaretRightOutlined,{})},{key:"bottom",label:"하단",icon:c.jsx(ce.CaretDownOutlined,{})},{key:"left",label:"좌측",icon:c.jsx(ce.CaretLeftOutlined,{})}],P=c.jsx(A.Space.Compact,{children:S.map(_=>c.jsx(A.Button,{type:u===_.key?"primary":"default",size:"small",onClick:()=>{f(_.key),p(!1)},icon:_.icon},_.key))});$.push(c.jsx(A.Popover,{content:P,trigger:"click",placement:"left",open:d,onOpenChange:p,children:c.jsx(A.Tooltip,{placement:"bottom",title:"위치변경",zIndex:2100,children:c.jsx(A.Button,{icon:c.jsx(ce.SettingOutlined,{}),type:"text",size:"middle"})})},"shotSetting"))}return n&&$.push(c.jsx(A.Tooltip,{placement:"bottom",title:s?"배경 보기":"배경 숨기기",zIndex:2100,children:c.jsx(A.Button,{icon:c.jsx(ce.EyeOutlined,{}),type:"text",size:"middle",onClick:()=>l(!s)})},"eyes")),a.extra&&$.push(c.jsx("div",{style:{margin:"0 8px"},children:a.extra},"extra")),r&&$.push(c.jsx(A.Tooltip,{placement:"bottom",title:"닫기",zIndex:2100,children:c.jsx(A.Button,{icon:c.jsx(ce.CloseOutlined,{}),onClick:a.onClose,type:"text",size:"middle"})},"close")),$};return c.jsx(A.Drawer,{className:"main-drawer",footer:!0,...a,placement:u,styles:C,maskClosable:!1,closable:!1,mask:s,extra:c.jsx(A.Space,{size:"small",align:"center",children:m()}),afterOpenChange:$=>{$||(l(!0),f(a.placement)),a.afterOpenChange?.($)},destroyOnHidden:!0,children:t?c.jsxs(Nt,{type:"vertical",children:[c.jsxs(A.Flex,{justify:"space-between",align:"center",style:{width:"100%"},children:[c.jsx("div",{children:t.title}),c.jsx(A.Flex,{gap:2,children:t.extra})]}),c.jsx(la,{...t.searchBox}),c.jsx(A.Divider,{}),e]}):e})},fr=({width:e="100%",height:t="100%",boxAlign:r,display:n="show",overflow:o,style:i,className:a,border:s=!0,children:l,ref:u})=>c.jsx("div",{style:{width:e,height:t,display:n==="show"?"":n,overflowX:o?.x,overflowY:o?.y,...i},className:`bwgview-content-box ${r?`content-box-${r}`:""} ${a||""} ${s?"":"none-box-st"}`,ref:u,children:l}),Rl=Na?.default??Na;try{yl.register("modules/imageResize",Rl)}catch(e){console.warn("quill-image-resize-module-react 로드 실패:",e)}const co=e=>zu.sanitize(e??"",{ALLOWED_TAGS:["p","br","div","span","strong","b","em","i","u","s","blockquote","pre","code","ul","ol","li","h1","h2","h3","h4","h5","h6","a","img"],ALLOWED_ATTR:["style","class","href","target","rel","src","alt","width","height","data-*","align"],ALLOWED_URI_REGEXP:/^(?:(?:https?|data|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,KEEP_CONTENT:!0,RETURN_TRUSTED_TYPE:!1}),uo=g.forwardRef(({border:e=!0,editorProps:t,value:r,defaultValue:n,onChange:o,onBlur:i,disabled:a,placeholder:s},l)=>{const{isEditing:u=!0,title:f,containerHeight:d="100%"}=t||{},p=g.useRef(null),w=g.useMemo(()=>{const E={toolbar:u?[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{align:[]}],["link","image"],["clean"]]:!1};return Rl?{...E,imageResize:{parchment:yl.import("parchment"),modules:["Resize","DisplaySize","Toolbar"],displayStyles:{backgroundColor:"black",border:"none",color:"white"}}}:E},[u]),b=g.useMemo(()=>["header","bold","italic","underline","strike","color","background","list","bullet","indent","align","link","image","width","height"],[]),C=r!==void 0,[m,$]=g.useState(n??""),S=C?r:m,P=g.useCallback((E,O,L,I)=>{const T=co(E??"");C||$(T),o?.(T,O,L,I)},[C,o]),y=`calc(100% - ${u?"42px":"0px"} - ${f?"40px":"0px"})`;return g.useImperativeHandle(l,()=>({getHTML:()=>S??"",getText:()=>p.current?.getEditor()?.getText()??"",insertHTML:E=>{const O=p.current?.getEditor();if(!O)return;const L=O.getSelection(!0),I=co(E??"");O.clipboard.dangerouslyPasteHTML(L?L.index:O.getLength(),I)},insertImage:(E,O)=>{const L=p.current?.getEditor();if(!L)return;const I=L.getSelection(!0),T=typeof E=="string"?E:"";L.insertEmbed(I?I.index:L.getLength(),"image",T,"user")},getQuill:()=>p.current?.getEditor?.()??null})),c.jsxs(fr,{border:e,style:{opacity:a?.6:1,pointerEvents:a?"none":"auto",height:typeof d=="number"?`${d}px`:d},children:[f&&c.jsx(Vt,{...f,paddingBottom:10}),c.jsx(Lu,{ref:p,theme:u?"snow":"bubble",readOnly:!u,value:S,onChange:P,onBlur:i,modules:w,formats:b,style:{width:"100%",height:y},placeholder:s},u?"snow":"bubble")]})}),ad=(e,t,r,n)=>co(e??""),sd=({itemProps:e,...t})=>{const{rules:r,shouldUpdate:n,dependencies:o,noStyle:i,...a}=e;return c.jsx(A.Form.Item,{valuePropName:"value",trigger:"onChange",getValueFromEvent:ad,normalize:s=>s??"",rules:r,shouldUpdate:n,dependencies:o,noStyle:i,...a,children:c.jsx(uo,{...t})})},ld=e=>{const{itemProps:t,onChange:r,editorProps:n,...o}=e,i=A.Form.useFormInstance();if(t?.name!=null){const a=t.name;return c.jsxs(c.Fragment,{children:[c.jsx(A.Form.Item,{hidden:!0,name:a,rules:t.rules,normalize:s=>s??"",children:c.jsx("input",{type:"hidden"})}),c.jsx(uo,{...o,editorProps:n,value:i.getFieldValue(a)??"",onChange:(s,l,u,f)=>{const d=co(s??"");i.setFieldValue(a,d),r?.(d,l,u,f)},onBlur:()=>{i.validateFields([a]).catch(()=>{})}})]})}return c.jsx(uo,{...e})},cd=Object.assign(ld,{FormItem:sd,Core:uo});var yr={},Qa;function ud(){if(Qa)return yr;Qa=1;var e=lo;if(process.env.NODE_ENV==="production")yr.createRoot=e.createRoot,yr.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;yr.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},yr.hydrateRoot=function(r,n,o){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,o)}finally{t.usingClientEntryPoint=!1}}}return yr}var dd=ud();const ca=g.forwardRef(({currentPage:e,totalPages:t,pageSize:r=10,totalData:n,onPageChange:o,pageSizeOptions:i=[10,20,50,100],gridRef:a,mode:s="client",onServerPageChange:l},u)=>{const[f,d]=g.useState(r),[p,w]=g.useState(1),[b,C]=g.useState(r),[m,$]=g.useState(0);g.useEffect(()=>{d(r)},[r]),g.useEffect(()=>{d(r)},[]),g.useImperativeHandle(u,()=>({currentPage:p,pageSize:b,totalData:m,totalPages:Math.ceil(m/b),setPage:N=>{w(N),l?.(N,b)},setPageSize:N=>{C(N),w(1),l?.(1,N)},setTotalData:N=>{$(N)},reset:()=>{w(1),C(r),$(0)}}),[p,b,m,l,r]);const S=s==="client",P=S?(e||0)+1:p,_=S?(t||0)>0:m>0,y=S?_?Math.ceil((n||0)/f):0:Math.ceil(m/b),E=S?_&&n||0:m,O=Math.min(P,y||1),L=`${f}-${y}-${O}`,I=N=>{S?o?.(N-1):(w(N),l?.(N,b))},T=N=>{if(S){d(N);try{a?.current?.gridView?(a.current.gridView.setPaging(!0,N),a.current.gridView.setPage(0)):o?.(0)}catch(z){console.warn("페이지 사이즈 변경 중 오류:",z),o?.(0)}}else C(N),w(1),l?.(1,N)};return c.jsxs("div",{style:{padding:"10px",display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid #f0f0f0",backgroundColor:"#fafafa"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[c.jsx("span",{style:{fontSize:"12px"},children:"페이지당"}),c.jsx("select",{value:S?f:b,onChange:N=>T(Number(N.target.value)),disabled:!_,style:{padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:"4px",fontSize:"12px",opacity:_?1:.5},children:i.map(N=>c.jsxs("option",{value:N,children:[N,"개"]},N))}),c.jsxs("span",{style:{fontSize:"12px",color:"#666",opacity:_?1:.5},children:["/ 총 ",E,"개"]})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[c.jsx(A.Button,{onClick:()=>I(1),disabled:!_||O===1,style:{width:"30px",height:"24px",background:!_||O===1?"#f5f5f5":"white",cursor:!_||O===1?"not-allowed":"pointer",opacity:_?1:.5},icon:c.jsx(ce.DoubleLeftOutlined,{})}),c.jsx(A.Button,{onClick:()=>I(O-1),disabled:!_||O===1,style:{width:"30px",height:"24px",background:!_||O===1?"#f5f5f5":"white",cursor:!_||O===1?"not-allowed":"pointer",opacity:_?1:.5},icon:c.jsx(ce.LeftOutlined,{})}),c.jsx("div",{children:(()=>{if(!_||y===0)return c.jsx(A.Button,{disabled:!0,style:{width:"30px",height:"24px"},children:"1"});const N=5;let z=1,B=Math.min(N,y);O>3&&y>N&&(z=Math.max(1,O-2),B=Math.min(y,z+N-1),B===y&&(z=Math.max(1,B-N+1)));const v=[];for(let x=z;x<=B;x++)v.push(c.jsx(A.Button,{onClick:()=>I(x),style:{width:"30px",height:"24px",background:O===x?"#1890ff":"white",color:O===x?"white":"black",cursor:"pointer"},children:x},x));return v})()},L),c.jsx(A.Button,{onClick:()=>I(O+1),disabled:!_||O>=y,style:{width:"30px",height:"24px",background:!_||O>=y?"#f5f5f5":"white",cursor:!_||O>=y?"not-allowed":"pointer",opacity:_?1:.5},icon:c.jsx(ce.RightOutlined,{})}),c.jsx(A.Button,{onClick:()=>I(y),disabled:!_||O>=y,style:{width:"30px",height:"24px",background:!_||O>=y?"#f5f5f5":"white",cursor:!_||O>=y?"not-allowed":"pointer",opacity:_?1:.5},icon:c.jsx(ce.DoubleRightOutlined,{})})]})]})});ca.displayName="BwgPagination";const fd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC7SURBVHgBZZDLDcJADETHUe7QQVJC6AAqACoAKkCcESh8JI60kBKgg3TA0kE6gAISzHgj0BJ8sWw/j2cXCCI7aD446g2diDp1aWyWaz9sxmHhNlJSyUCDnlQeQpEKm5UCDwgqvHBnTji4MvcEKGw3FsVFDeCmCCbMYwIpQY4wMnX5mj5pKrXfTFSxc1sp/o03yLlZaoSpRFhme53/QF4FmNl9txbH8wuC5893tEo1PZivBs6/sgVXBlv9BpvVRX62Og6eAAAAAElFTkSuQmCC",hd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC7SURBVHgBZVDbDcIwDHSiqL90AzoCI5S/fvQBEwATIDYoE7BCRwjqAtmAsEE3gAlqzlFBKbXknJ2cL5cQRcF13SIf9Bd63mmHdcN5nsbbJm6UtY6bxlGaCunNZZmTUpniqhpQvIhZ8AlcI+9QXYHYIb3BgQ0ETAJ36BvUmQiDuBV19TNdFBkliUyK0lX1fbc0bkyL1WF6D7UzbBxnpKCi9YHG0UPeoz6BePt+h55UxMMA9NMrPa68BDLiAxmcQh0cAM62AAAAAElFTkSuQmCC",pd=[{label:"엑셀다운로드",tag:"excel"},{label:"엑셀(제목포함)",tag:"withTitleExcel"},{label:"-"},{label:"필터",type:"check",checked:!1,tag:"filter"},{label:"열고정",tag:"fixedCol"},{label:"행고정",tag:"fixedRow"},{label:"고정해제",tag:"fixedCancel"},{label:"-"},{label:"숨기기",tag:"hide"},{label:"숨기기해제",tag:"hideClear"}],gd=[{label:"엑셀다운로드",tag:"excel"},{label:"엑셀(들여쓰기 표시)",tag:"showIndentExcel"},{label:"엑셀(제목포함)",tag:"withTitleExcel"},{label:"-"},{label:"필터",type:"check",checked:!1,tag:"filter"},{label:"열고정",tag:"fixedCol"},{label:"행고정",tag:"fixedRow"},{label:"고정해제",tag:"fixedCancel"},{label:"-"},{label:"숨기기",tag:"hide"},{label:"숨기기해제",tag:"hideClear"}],md=({children:e})=>{const[t,r]=g.useState(!1),[n,o]=g.useState(null);return t?c.jsx("div",{style:{padding:"20px",border:"1px solid #ff4d4f",borderRadius:"6px",backgroundColor:"#fff2f0",margin:"10px"},children:c.jsx(A.Alert,{message:"리얼그리드 로드 실패",description:c.jsxs("div",{children:[c.jsx("p",{children:"리얼그리드 라이센스 또는 초기화 중 오류가 발생했습니다."}),c.jsxs("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:["오류: ",n?.message||"알 수 없는 오류"]}),c.jsx(A.Button,{type:"primary",size:"small",style:{marginTop:"8px"},onClick:()=>{r(!1),o(null),window.location.reload()},children:"다시 시도"})]}),type:"error",showIcon:!0})}):c.jsx(vd,{onError:i=>{console.error("BwgGrid 에러:",i),o(i),r(!0)},children:e})};class vd extends g.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,r){this.props.onError(t)}render(){return this.state.hasError?null:this.props.children}}const bd=g.forwardRef(({type:e="nrml",gridDivStyle:t,gridDivClassName:r,gridColumns:n,gridOptions:o,gridEvents:i,bindRef:a,gridContext:s,renderers:l,gridInitCallback:u},f)=>{const d=g.useRef(null),p=g.useRef(new Map),w=(R,H,K,W)=>{let q=[],Y=[];const G="treeNode";for(let J in R){let X=R[J];q[X[K]]=R[J];let ne=q[X[H]];if(ne==null||ne=="-"){Y.push(X);continue}ne[G]==null&&(ne[G]=[]),ne[G].push(X)}return Y},b=g.useCallback(R=>{const H=W=>{const q=[];return W.forEach(Y=>{Y.children&&Y.children.length>0?q.push(...H(Y.children)):q.push(Y)}),q};return H(R).map(W=>({fieldName:W.fieldName,dataType:W.dataType||"text"}))},[]),C=g.useCallback(R=>{const H=W=>{const q=[];return W.forEach(Y=>{Y.children&&Y.children.length>0?q.push(...H(Y.children)):q.push(Y)}),q};return H(R).map(W=>({...W,header:{template:W.required?`<img src='${hd}' style='margin-top:4px; margin-right: 2px;' alt='Required input' >\${headerText} `:W.editable?`<img src='${fd}' style='margin-top:4px; margin-right: 2px;' alt='Required input' >\${headerText} `:"${headerText}",values:{headerText:W.header?.text??""},text:W.header?.text||""},styleName:W.dataType==="number"?"right":W.styleName||"center"}))},[]);g.useImperativeHandle(f,()=>({addAllData(R,H){const K=d.current?.gridView.getCurrent().dataRow;if(d.current?.dataProvider instanceof Ke.LocalDataProvider){d.current.dataProvider.clearRows();try{d.current?.gridView.showLoading(),d.current.dataProvider.setRows(R)}catch(W){console.error("fillJsonData 오류:",W)}finally{d.current?.gridView.closeLoading()}}if(d.current?.dataProvider instanceof Ke.LocalTreeDataProvider){if(d.current.dataProvider.clearRows(),H?.treeOption?.dataField==null||H?.treeOption?.parentField==null)return;const W={rows:"treeNode"};try{d.current?.gridView.showLoading();let q=w(R,H.treeOption?.parentField,H.treeOption?.dataField);d.current.dataProvider.fillJsonData({treeNode:q},W),H.treeOption.isExpand&&d.current.gridView?.expandAll()}catch(q){console.error("fillJsonData 오류:",q)}finally{d.current?.gridView.closeLoading()}}H?.isCurrent?d.current?.gridView.setCurrent({dataRow:K}):d.current?.gridView.setCurrent({dataRow:0})},getGridInstance:()=>d.current,getCurrentRow:()=>d.current?.gridView.getCurrent().dataRow??-1,getCurrentIndex:()=>d.current?.gridView.getCurrent().itemIndex??-1,gridExcelDown(R){d.current?.gridView.exportGrid({type:"excel",target:"local",allItems:!1,lookupDisplay:!0,showProgress:!0,progressMessage:"엑셀 Export 중 입니다.",applyDynamicStyles:!1,separateRows:!0,indenting:!!R?.indenting,header:"default",footer:"default",sheetName:"",fileName:R?.fileName||"sample.xlsx",...R})},getGridSaveData:()=>{const R=d.current?.dataProvider?.getAllStateRows();if(R===void 0)return[{}];let H=[];if(R.created!==void 0&&R.created.length>0)for(const K in R.created){let W=d.current?.dataProvider?.getJsonRow(R.created[K]);W={...W,iudFlag:"I"},H.push(W)}if(R.updated!==void 0&&R.updated.length>0)for(const K in R.updated){let W=d.current?.dataProvider?.getJsonRow(R.updated[K]);W={...W,iudFlag:"U"},H.push(W)}if(R.deleted!==void 0&&R.deleted.length>0)for(const K in R.deleted){let W=d.current?.dataProvider?.getJsonRow(R.deleted[K]);W={...W,iudFlag:"D"},H.push(W)}return H},deleteGridData:()=>{d?.current?.gridView?.getCheckedItems()?.map(H=>{let K=d?.current?.gridView?.getDataRow(H)??-1;const W=d?.current?.dataProvider?.getRowState(K);W==Ke.RowState.DELETED?(d?.current?.dataProvider?.setRowState(K,p.current.get(H)??Ke.RowState.NONE),p.current.delete(H)):W==Ke.RowState.CREATED?d?.current?.dataProvider?.setRowState(K,Ke.RowState.CREATE_AND_DELETED):W==Ke.RowState.CREATE_AND_DELETED?d?.current?.dataProvider?.setRowState(K,Ke.RowState.CREATED):(p.current.set(H,W??Ke.RowState.NONE),d?.current?.dataProvider?.setRowState(K,Ke.RowState.DELETED)),d?.current?.gridView?.checkItem(H,!1)})},_oriRowState:[{}],dp:d.current?.dataProvider??null,vw:d.current?.gridView??null}));const m=g.useCallback((R,H,K)=>{if(a!==void 0&&K>=0){let W=R.getDataSource().getJsonRow(K);a?.current?.setFieldsValue(W)}else a!==void 0&&K<0&&a?.current?.resetFields();R.setCurrent({dataRow:0}),i?.onCurrentRowChanged&&i?.onCurrentRowChanged(R,H,K)},[a,i]),$=g.useCallback((R,H,K)=>{const W=H.fieldName??"";a?.current?.getFieldInstance(W)&&a?.current.setFieldValue(W,K),i?.onEditChange&&i?.onEditChange(R,H,K)},[a,i]),S=g.useCallback((R,H,K)=>{const W=R.getOrgFieldName(K),q=R.getValue(H,K);a?.current?.setFieldValue(W,q)},[a]),P=g.useCallback((R,H,K,W)=>{const q=R.getColumn(W).name??"",Y=R.getValue(H,W);a?.current?.getFieldInstance(q)&&a?.current.setFieldValue(q,Y),i?.onCellEdited&&i?.onCellEdited(R,H,K,W)},[a,i]),_=g.useCallback((R,H,K,W)=>{if(typeof H.dataRow=="number"&&H.dataRow!=-1){var q=R.getDataSource().getRowState(H.dataRow);if(q=="deleted"||q=="createAndDeleted")return!1}return i?.onShowEditor!=null&&i?.onShowEditor(R,H,K,W),!0},[a,i]),j=g.useCallback(R=>{if(!d.current)return;const H=d.current.gridView,K=H.getDataSource();if(o?.container?.page){const W=H.getPage(),q=H.getPageCount(),Y=K.getRowCount();U({currentPage:W,totalPages:q,totalData:Y})}},[o?.container?.page]),y=g.useCallback(()=>{if(!d.current)return;const R=d.current.gridView,H=R.getDataSource(),K=["onKeyDown"],W=["onRowInserted"];Object.keys(i??{}).map(q=>{K.includes(q)?R[q+"Add"]=i?.[q]:R[q]=i?.[q],W.includes(q)?H[q+"Add"]=i?.[q]:H[q]=i?.[q]}),H instanceof Ke.LocalDataProvider&&(H.onRowInserted=(q,Y)=>{Y<0||(setTimeout(function(){R?.setCurrent({dataRow:Y})},1),q.onRowInsertedAdd!==void 0&&q.onRowInsertedAdd(q,Y))}),R.onKeyDown=function(q,Y){if(Y.code=="Space"){let G=q.getSelectedItems(!0);for(const J in G)q.isCheckable(G[J])&&(q.isCheckedItem(G[J])?q.checkItem(G[J],!1,!1):q.checkItem(G[J],!0,!1))}return q.onKeyDownAdd!==void 0&&q.onKeyDownAdd(q,Y),!0},d.current.gridView.onCurrentRowChanged=m,d.current.gridView.onEditChange=$,d.current.gridView.getDataSource().onValueChanged=S,d.current.gridView.onCellEdited=P,d.current.gridView.onShowEditor=_,d.current.gridView.onDataLoadComplated=j},[m,$,S,P,_,j]),E=g.useCallback(R=>{if(R){try{R.gridView.setSortingOptions({enabled:!0}),R.gridView.sortMode=Ke.SortMode.EXPLICIT,R.gridView.editorOptions.viewGridInside=!0,R.gridView instanceof Ke.TreeView&&R.gridView.setTreeOptions({expandWhenSetData:Ke.ExpandWhenSetData.REMAIN_AND_EXPAND,expanderIconStyle:Ke.TreeExpanderIconStyle.SQUARE,iconVisible:!1,lineVisible:!0}),R.gridView.setDisplayOptions({showEmptyMessage:!0,emptyMessage:"조회된 데이터가 존재하지 않습니다.",useFocusClass:!0,minRowHeight:o?.display?.minRowHeight||43,maxRowHeight:o?.display?.maxRowHeight||100,rowHeight:o?.display?.rowHeight||43,rowChangeDelay:o?.display?.rowChangeDelay||0,selectionStyle:o?.display?.selectionStyle||Ke.SelectionStyle.ROWS,fitStyle:o?.display?.fitStyle||Ke.GridFitStyle.FILL,useAlternateRowStyle:o?.display?.useAlternateRowStyle||!1}),R.gridView.setEditOptions({commitWhenExitLast:!0,columnEditableFirst:!1,commitByCell:!0,commitWhenLeave:!0,crossWhenExitLast:!0,confirmWhenDelete:!1,deletable:!1,revertable:!1,showOnlyValidationMessage:!0,editable:o?.edit?.editable||!1,validateOnEdited:o?.edit?.validateOnEdited||!1}),R.gridView.setCopyOptions({singleMode:o?.copy?.singleMode||!1}),R.gridView.setPasteOptions({selectBlockPaste:!0,checkReadOnly:!0,throwValidationError:!1}),R.gridView.header.height=o?.header?.height||43,R.gridView.header.styleName=o?.header?.styleName||"bwgGridHeader",o?.container?.radio?R.gridView.setCheckBar({exclusive:o?.container?.radio||!1}):R.gridView.setCheckBar({visible:o?.container?.check||!1,showAll:o?.container?.checkAll||!1}),R.gridView.setStateBar({visible:o?.container?.state||!1}),R.gridView.rowIndicator.visible=o?.container?.indicator||!1,R.gridView instanceof Ke.GridView&&(R.gridView.groupPanel.visible=o?.container?.panel||!1),R.gridView.setFooters({visible:o?.container?.footer||!1}),R.gridView.setHeader({visible:o?.container?.header||!0}),R.gridView.formatOptions.numberFormat="#,##0"}catch(H){console.log("그리드 옵션 설정 중 오류:",H)}try{R.gridView instanceof Ke.TreeView?R.gridView.setContextMenu(gd):R.gridView.setContextMenu(pd),R.gridView.onContextMenuItemClicked=function(H,K,W){if(!(!W||!W.column)){if(K.tag=="excel")z(H,{isTitle:!1},s?.excel);else if(K.tag=="showIndentExcel")z(H,{isTitle:!1,treeBlank:!0},s?.excel);else if(K.tag=="withTitleExcel")z(H,{isTitle:!0,treeBlank:!1},s?.excel);else if(K.tag=="filter")B(H,K);else if(K.tag=="fixedCol"){const Y=H.getDataSource().getFieldIndex(W.column);H.setFixedOptions({colCount:Y})}else if(K.tag=="fixedRow")H.setFixedOptions({rowCount:(W.itemIndex||0)+1});else if(K.tag=="fixedCancel")H.setFixedOptions({colCount:0,rowCount:0});else if(K.tag=="hide")H.setColumnProperty(W.column,"visible",!1),H._hideCols[H._hideCols.length]=W.column;else if(K.tag=="hideClear")for(var q=0;q<H._hideCols.length;q++)H.setColumnProperty(H._hideCols[q],"visible",!0)}}}catch(H){console.log("컨텍스트 설정 중 오류:",H)}}},[o]),O=R=>{if(!(!l||l.length===0))try{l.forEach(H=>{const{name:K,renderer:W}=H;if(K&&W){const q=typeof W=="function"?new W:W;R.gridView.registerCustomRenderer(K,q)}})}catch(H){console.error("커스텀 렌더러 초기화 중 오류:",H)}},L=R=>{R.onPageChanged=(H,K)=>{U(W=>({...W,currentPage:K}))},R.onPageCountChanged=(H,K)=>{U(W=>({...W,totalPages:K}))}},I=R=>{d.current?.gridView&&d.current.gridView.setPage(R)},T=R=>{if(o?.layout?.colspan&&o.layout.colspan.length>0&&o?.layout?.colspan.forEach(H=>{const K=R.gridView.layoutByColumn(H.fieldName);if(K){const W=H.span;K.spanCallback=function(q,Y,G){return W}}}),n&&n.length>0&&n.some(K=>K.children&&K.children.length>0))try{(()=>{const W=JSON.parse(JSON.stringify(n)),q=[],Y=G=>{const J=[];return G.children.map(X=>{if(X.children&&X.children.length>0){const ne=Y(X),se=X.header?.text||X.fieldName,le=R.gridView.getColumnProperty(X.fieldName,"header");delete X.children,delete X.header;let Se={name:X.fieldName,header:{text:le?.text||se,template:le?.template,values:le?.values,visible:le?.visible??!0},items:ne,...X};J.push(Se)}else J.push(X.fieldName)}),J};W.map(G=>{if(G.children&&G.children.length>0){const J=Y(G),X=G.header?.text||G.fieldName,ne=G.header?.visible??!0,se=R.gridView.getColumnProperty(G.fieldName,"header");delete G.children,delete G.header;const le={name:G.fieldName,header:{text:se?.text||X,template:se?.template,values:se?.values,visible:se?.visible||ne},items:J,...G};q.push(le)}else q.push(G.fieldName)}),console.log("Final Layout!!",q),R.gridView.setColumnLayout(q)})()}catch(K){console.error("컬럼 레이아웃 설정 오류:",K)}},N=()=>{if(d.current){if(e==="nrml"){const R=d.current;if(E(R),O(R),n&&n.length>0){const H=b(n),K=C(n);R.gridView.getDataSource().setFields(H),R.gridView.setColumns(K)}if(T(R),o?.container?.page){const H=o?.pagingOption?.pageSize||10;R.gridView.setPaging(!0,H),L(R.gridView)}}else{const R=d.current;if(E(R),O(R),n&&n.length>0){const H=b(n),K=C(n);R.gridView.getDataSource().setFields(H),R.gridView.setColumns(K)}T(d.current)}setTimeout(()=>{if(u){const R=typeof f=="object"&&f!==null?f.current:null;u(R)}},0)}},z=(R,H,K)=>{const W=R.getDataSource();let q=K?.footer==null?"default":K.footer;W.getRowCount()<1&&(q="hidden");let Y={type:"excel",target:"local",allItems:!1,lookupDisplay:!0,compatibility:!0,showProgress:!0,progressMessage:"엑셀 Export 중 입니다.",applyDynamicStyles:!1,separateRows:!0,indenting:!!H?.treeBlank,footer:q,sheetName:"",documentTitle:{},documentSubtitle:{},documentTail:{},fileName:K?.fileName||"sample.xlsx"};W instanceof Ke.LocalTreeDataProvider&&(Y.indenting=!!H?.treeBlank),K?.isCellMerge==!0&&(Y.separateRows=!1),ot.isEmpty(K?.sheetName)==!1&&(Y.sheetName=K?.sheetName),H?.isTitle&&(Y.documentTitle={message:ot.isSafeEmpty(K?.mainTitle,"No Title"),visible:!0,styleName:"documentStyle",spaceTop:1,spaceBottom:0,height:43},ot.isEmpty(K?.subTitle)==!1&&(Y.documentSubtitle={message:K?.subTitle,visible:!0,styleName:"center",height:20}),ot.isEmpty(K?.tailTitle)==!1&&(Y.documentTail={message:K?.tailTitle,visible:!0,styleName:"documentStyle"})),R.exportGrid(Y)},B=(R,H)=>{const K=R.getDataSource(),W=K.getOrgFieldNames();if(H.checked)for(var q=0;q<W.length;q++){let G=[],J=K.getDistinctValues(W[q])??[];if(J.length==0)continue;let X=R.columnByName(W[q]);for(var Y=0;Y<J.length;Y++){if(J[Y]==null)continue;let ne=X.values!=null&&X.values.indexOf(J[Y])!=-1?X?.labels?.[X.values.indexOf(J[Y])]:J[Y];ot.isEmpty(ne)&&(ot.isEmpty(J[Y])?ne=" ":ne=J[Y]);let se="";J[Y]==null?se="value="+J[Y]:se="value='"+J[Y]+"'",G.push({name:ne,criteria:se})}R.setColumnFilters(W[q],G)}else for(var q=0;q<W.length;q++)R.clearColumnFilters(W[q]),R.activateAllColumnFilters(W[q],!1),R.clearColumnFilters(W[q])};g.useEffect(()=>{if(d.current&&d.current.gridView)if(e==="nrml"){const R=d.current;E(R)}else{const R=d.current;E(R)}},[e,o,E]),g.useEffect(()=>{!d.current||!n||n.length===0||N()},[n]),g.useEffect(()=>{d.current&&y()},[i,y]);const[v,x]=g.useState(!1),[k,M]=g.useState(""),D=g.useRef(null),[F,U]=g.useState({currentPage:0,totalPages:0,totalData:0});g.useEffect(()=>{U({currentPage:0,totalPages:0,totalData:0})},[]),g.useEffect(()=>{v&&setTimeout(()=>{D.current?.focus?.()},0)},[v]),g.useEffect(()=>()=>{if(d.current)try{const R=d.current;R.gridView&&(R.gridView.onDataLoadComplated=void 0,R.gridView.onCurrentRowChanged=void 0,R.gridView.onCellClicked=void 0,R.gridView.onCellDblClicked=void 0,R.gridView.onEditRowChanged=void 0,R.gridView.onItemChecked=void 0,R.gridView.onItemAllChecked=void 0,R.gridView.onColumnCheckedChanged=void 0,R.gridView.onCellButtonClicked=void 0,R.gridView.onEditChange=void 0,R.gridView.onCellEdited=void 0,R.gridView.onKeyUp=void 0,R.gridView.onKeyDown=void 0,R.gridView.onWheel=void 0,R.gridView.onValidateColumn=void 0,R.gridView.onValidateRow=void 0,R.gridView.onValidationFail=void 0,R.gridView.onRowInserting=void 0,R.gridView.onCellItemClicked=void 0,R.gridView.onShowEditor=void 0,R.gridView.getDataSource()&&(R.gridView.getDataSource().clearRows(),R.gridView.getDataSource().setFields([])),R.gridView.getDataSource().clearRows())}catch(R){console.warn("⚠️ BwgGrid cleanup error:",R)}},[]);const V=g.useCallback(R=>{Z(R)},[]),Z=g.useCallback(R=>{const H=d.current?.gridView;if(H?.isFiltered()){console.log("EE:: [그리드 Filtering 으로 인한 오류] 그리드 내 Filter를 해제 후 진행해 주십시오.");return}if(H?.commit(),ot.isEmpty(R))return;const K=H?.getCurrent().itemIndex??-1;if(K<0)return;const W={value:R,startIndex:K+1,wrap:!0,caseSensitive:!1,partialMatch:!0},q=H?.searchCell(W);H?.setCurrent(q)},[]),ae=g.useCallback(R=>{R.key==="Escape"&&(R.preventDefault(),x(!1))},[]),me=g.useCallback(R=>{R.ctrlKey&&R.code==="KeyF"&&(R.preventDefault(),M(""),x(!v))},[v]),ue={searchRow:V,searchEnter:Z,handleCloseKeyword:ae,handleSearch:me},be=g.useMemo(()=>({...t,position:"relative",width:t?.width||"100%",height:t?.height||"100%"}),[t]);return c.jsxs(md,{children:[c.jsxs("div",{style:be,className:r,onKeyDown:R=>ue.handleSearch(R),children:[v&&c.jsx("div",{className:"grid-search-box",children:c.jsxs(A.Flex,{gap:3,children:[c.jsx(A.ConfigProvider,{theme:{components:{Button:{controlHeight:32},Input:{controlHeight:32}}},children:c.jsxs(A.Space.Compact,{children:[c.jsx(A.Button,{icon:c.jsx(ce.SearchOutlined,{})}),c.jsx(A.Input,{ref:D,value:k,name:"srchField",autoComplete:"off",onKeyUp:R=>ue.handleCloseKeyword(R),onChange:R=>M(R.target.value),onPressEnter:R=>ue.searchEnter(R)})]})}),c.jsx(A.Button,{variant:"solid",icon:c.jsx(ce.CloseOutlined,{}),onClick:()=>x(!1)})]})}),e==="nrml"?c.jsx(Aa.RealGridReact,{ref:d,autoGenerateField:!0,onInitialized:N}):c.jsx(Aa.RealTreeReact,{ref:d,autoGenerateField:!1,onInitialized:N})]}),o?.container?.page&&c.jsx(ca,{currentPage:F.currentPage,totalPages:F.totalPages,pageSize:o?.pagingOption?.pageSize,totalData:F.totalData,onPageChange:I,pageSizeOptions:o?.pagingOption?.pageSizeOptions,gridRef:d})]})}),yd=e=>({initContent(t){this._root=dd.createRoot(t)},render(t,r,n,o){const i=this._root;i&&e(t,r,n,o,i)},clearContent(t){const r=this._root;r&&setTimeout(()=>{r&&(r.unmount(),this._root=null)},0)},canClick(t){return!0},click(){return{}}}),xd=g.memo(({title:e,border:t,children:r,titleChildren:n})=>{const o=g.useMemo(()=>({components:{Form:{labelColor:"#9A9A9A"},Select:{colorTextDisabled:"#000"}}}),[]);return c.jsxs(Nt,{type:"vertical",children:[c.jsx(Vt,{title:e,icons:{type:"antd",icon:"InfoCircleTwoTone"},children:n}),c.jsx(fr,{border:!1,children:c.jsx(A.ConfigProvider,{theme:o,children:r})})]})}),Nt=({type:e="horizontal",layoutAlign:t="left",verticalAlign:r,className:n,style:o,children:i})=>c.jsx("div",{style:o,className:`bwgview-content-layout ${e=="horizontal"?"hz-layout":"vt-layout"} layout-${t} ${r&&`vertical-${r}`} ${n||""}`,children:i}),Za=(e,t)=>{const r=window.innerWidth,n=window.innerHeight,o=Math.min(Math.max(e.x,0),Math.max(0,r-t.width)),i=Math.min(Math.max(e.y,0),Math.max(0,n-t.height));return{x:o,y:i}},Cd=({buttons:e,onClose:t})=>{const r=(e||[]).filter(n=>n?.visible!==!1);return r.length===0?c.jsx(A.Button,{type:"default",className:"bwg-btn popup-btn",onClick:t,children:"닫기"}):c.jsxs("div",{style:{display:"flex",gap:6},children:[r.map(n=>c.jsx(A.Button,{type:n.type,disabled:!!n.disabled,loading:n.loading,className:n.className||"bwg-btn popup-btn",style:n.style,icon:n.icon,onClick:n.onClick,children:n.label},n.id)),c.jsx(A.Button,{type:"default",className:"bwg-btn popup-btn",onClick:t,children:"닫기"})]})},Sn=({popup:e,popupEvent:t,onClose:r,children:n,buttons:o})=>{const i=g.useRef(null),a=e?.popupTitle||"팝업",s=e?.width||800,l=e?.height||600,[u,f]=g.useState(s),[d,p]=g.useState(l),w=g.useMemo(()=>{const _=Math.max(0,(window.innerWidth-s)/2),j=Math.max(0,(window.innerHeight-l)/2);return{x:_,y:j}},[s,l]),[b,C]=g.useState(w),m=(_,j)=>{const y=Za({x:j.x,y:j.y},{width:u,height:d});C(y)},$=(_,j,y,E,O)=>{const L={width:parseInt(y.style.width,10),height:parseInt(y.style.height,10)},I=Za(O,L);f(L.width),p(L.height),C(I)},S=()=>i.current??document.body,P=typeof e?.zIndex=="number"?e.zIndex:3e3;return c.jsxs("div",{style:{position:"fixed",inset:0,zIndex:P},children:[c.jsx("div",{onClick:r,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:0}}),c.jsxs(Bu.Rnd,{className:"bwg-popup",size:{width:u,height:d},position:b,bounds:"window",minWidth:400,minHeight:300,onDragStop:m,onResizeStop:$,dragHandleClassName:"drag-handle",cancel:".rnd-cancel",enableUserSelectHack:!1,style:{backgroundColor:"white",borderRadius:20,boxShadow:"0 4px 15px rgba(0,0,0,0.25)",overflow:"visible",position:"absolute",zIndex:1},children:[c.jsx("div",{className:"bwg-popup-content",style:{overflow:"hidden",borderRadius:20,height:"100%"},children:c.jsx(jl,{getPopupContainer:S,children:c.jsx(Nt,{type:"vertical",children:c.jsx(A.Card,{className:"popup-drag-container",title:c.jsx("div",{className:"drag-handle",style:{display:"flex",alignItems:"center",gap:8},children:a}),style:{width:"100%",height:"100%"},styles:{body:{height:"calc(100% - 77px)",padding:20,overflow:"auto"}},extra:c.jsx(Cd,{buttons:o,onClose:()=>e?.close?.()||r?.()}),children:c.jsx("div",{className:"rnd-cancel",style:{height:"100%"},children:c.jsx(dr.SearchBoxProvider,{children:n})})})})})}),c.jsx("div",{ref:i,className:"bwg-popup-portal-root",style:{position:"relative"}})]})]})},Sd=({children:e,...t})=>c.jsx(A.Row,{...t,className:"bwg-row",children:e}),wd=({children:e})=>c.jsx("div",{style:{height:"100%",padding:"20px 30px 26px"},children:c.jsx("div",{style:{width:"100%",height:"100%",border:"1px solid #ddd",borderRadius:"15px",background:"#fff"},children:e})}),Ed=({rowKey:e="id",columns:t,dataSource:r,loading:n=!1,rowSelection:o,size:i="middle",pagination:a=!1,...s})=>c.jsx(A.Table,{rowKey:e,columns:t,dataSource:r,loading:n,rowSelection:o,size:i,pagination:a,bordered:!0,scroll:{x:"max-content"},locale:{emptyText:"데이터가 없습니다."},...s}),jd=e=>{const{type:t="card",animated:r=!0,...n}=e;return c.jsx(A.Tabs,{type:t,animated:r,...n})};function ki(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Rd(e){if(Array.isArray(e))return ki(e)}function $l(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ua(e,t){if(e){if(typeof e=="string")return ki(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ki(e,t):void 0}}function $d(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1
|
+
"use strict";const ot=require("../utils/index.cjs"),gt=require("../stores/index.cjs"),c=require("react/jsx-runtime"),ce=require("@ant-design/icons"),A=require("antd"),g=require("react"),dr=require("../provider/index.cjs"),zu=require("dompurify"),yl=require("quill"),Lu=require("react-quill"),Na=require("quill-image-resize-module-react"),lo=require("react-dom"),Ke=require("realgrid"),Aa=require("realgrid-react"),Bu=require("react-rnd"),Hu=require("./layout-components-hCEUMfz3.cjs"),Vn=require("../components/core/index.cjs"),Ma=require("react-router-dom");function xl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const nn=xl(ce),h=xl(g),$i=({checkAuth:e=!1,buttons:t,gap:r=8})=>{const{user:n}=gt.useUserStore(),o=dr.useServiceCodeValue("AUTH_BTNS"),[i,a]=g.useState({});g.useEffect(()=>{const l=e?e.menuId:void 0,u=e?e.grpId:void 0;if(!l||!u){a({});return}ot.callService(o,{crprCd:n?.crprCd,userId:n?.userId,grpId:u.toUpperCase(),menuId:l}).then(f=>{const d=Array.isArray(f?.data)?f.data:Array.isArray(f)?f:[];console.log("@@ 권한 버튼 조회결과(list)",d);const p={};(d||[]).forEach(w=>{const b=String(w?.btnId||"").trim();if(!b)return;const C=w?.enblYn==null?!0:String(w.enblYn).toUpperCase()==="Y";p[b]=C}),a(p)}).catch(f=>{console.error(f),a({})})},[o,n?.crprCd,n?.userId,e?e.menuId:void 0,e?e.grpId:void 0]);const s=g.useMemo(()=>!t||t.length===0?null:t.filter(l=>l?.visible!==!1).map(l=>{const u=!!l.disabled;if(!e)return c.jsx(A.Button,{type:l.type,disabled:u,loading:l.loading,className:l.className||"bwg-btn",style:l.style,icon:l.icon,onClick:l.onClick,children:l.label},l.id);const p=!(Object.prototype.hasOwnProperty.call(i,l.id)?!!i[l.id]:!1),w=u||p,b=c.jsx(A.Button,{type:l.type,disabled:w,loading:l.loading,className:l.className||"bwg-btn",style:l.style,icon:l.icon,onClick:l.onClick,children:l.label},l.id);if(p){const C=c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx(ce.ExclamationCircleFilled,{style:{color:"#faad14",fontSize:16}}),c.jsx("span",{style:{fontWeight:600},children:`'${l.label}' 버튼에 대한 사용 권한이 없습니다.`})]}),m=c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,paddingLeft:24},children:c.jsx("span",{style:{fontSize:12},children:"관리자에게 문의하세요."})});return c.jsx(A.Popover,{title:C,content:m,placement:"bottom",styles:{body:{backgroundColor:"#fffbe6"}},children:c.jsx("span",{children:b})},l.id)}return b}),[t,i,e]);return c.jsx(A.Flex,{gap:r,children:s})};var Fu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var o=!1;try{o=this instanceof n}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}const Wu=({grpId:e,menuId:t,btnEvent:r,layout:n="horizontal",size:o="middle",style:i,className:a,onButtonClick:s})=>{const l=dr.useServiceCodeValue("AUTH_BTNS"),{user:u}=gt.useUserStore(),[f,d]=g.useState([]),[p,w]=g.useState(!0),[b,C]=g.useState(null),[m,$]=g.useState({}),S=async()=>{try{w(!0),C(null),console.log("@@ 커스텀버튼그룹 영역 조회시작",e,t);const j=await ot.callService(l,{userId:u?.userId,crprCd:u?.crprCd,grpId:e.toUpperCase(),menuId:t});if(console.log("@@ 커스텀버튼그룹 영역 조회결과",j),j?.data&&Array.isArray(j.data)){const y=j.data.sort((E,O)=>E.btnSq-O.btnSq);d(y)}else d([])}catch(j){console.error("버튼 권한 조회 실패:",j),C("버튼 권한을 조회하는 중 오류가 발생했습니다."),d([])}finally{w(!1)}};g.useEffect(()=>{S()},[e,t]);const P=async(j,y)=>{$(E=>({...E,[j]:{loading:!0}}));try{const E=r?.[j];E?await E():console.warn(`버튼 이벤트 핸들러를 찾을 수 없습니다: ${j}`),s&&s(j,y,e)}catch(E){console.error("버튼 이벤트 실행 실패:",E),A.message.error("작업 중 오류가 발생했습니다.")}finally{$(E=>({...E,[j]:{loading:!1}}))}},_=j=>{const y=m[j.btnId]||{loading:!1};return c.jsxs(A.Button,{size:o,loading:y.loading,onClick:()=>P(j.btnId,j.btnNm),className:"bwg-btn",style:{...j.iconVal&&{display:"flex",alignItems:"center",gap:"4px"}},children:[j.iconVal&&c.jsxs(c.Fragment,{children:[j.iconType==="ANTD"&&nn[j.iconVal]&&g.createElement(nn[j.iconVal],{style:{fontSize:"14px"}}),j.iconType!=="ANTD"&&c.jsx("span",{className:j.iconVal,style:{fontSize:"14px"}})]}),j.btnNm]},j.btnId)};return p?c.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${a||""}`,style:i,children:c.jsx(A.Space,{direction:n==="vertical"?"vertical":"horizontal",size:o,children:c.jsx(A.Button,{loading:!0,size:o,children:"권한 조회 중..."})})}):b?c.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${a||""}`,style:i,children:c.jsx(A.Alert,{message:"권한 오류",description:b,type:"error",showIcon:!0,style:{minHeight:"40px"}})}):f.length===0?c.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${a||""}`,style:i,children:c.jsx(A.Alert,{message:"부여된 권한이 없습니다",type:"warning",showIcon:!0,style:{height:"20px",display:"flex",alignItems:"center",margin:0,padding:"10px 10px"}})}):c.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${a||""}`,style:i,children:c.jsx(A.Flex,{gap:3,children:f.map(_)})})},Ku=({content:e,layout:t="flex",gap:r=16,minWidth:n=120,maxWidth:o=300,style:i,className:a})=>{if(!(Array.isArray(e)&&e.length>0&&Array.isArray(e[0])))return c.jsx("div",{style:i,className:a,children:e});const l=e.filter(w=>w&&w.length>0),u=g.useMemo(()=>{const w=l[0];if(!w||w.length===0)return{totalCols:0,baseWidth:0};let b=0;const C=[];w.forEach($=>{const S=$,P=S?.props?.["data-colspan"]?parseInt(String(S.props["data-colspan"])):1;b+=P,C.push(P)});const m=b>0?100/b:0;return{totalCols:b,baseWidth:m,componentWidths:C}},[l]),f=(w,b,C)=>{const m=w,$=m?.props?.["data-colspan"]?parseInt(String(m.props["data-colspan"])):1;switch(t){case"equal":return 100/C;case"auto":return 100/C;case"grid":return 100/u.totalCols*$;case"flex":default:const S=u.baseWidth*$;return Math.max(n,Math.min(o,S))}},d=w=>{if(!w||typeof w!="object")return w;const b=w;if(!b.props)return w;const m={...b.props.style||{},width:"100%"};return g.cloneElement(b,{...b.props,style:m})},p=(w,b)=>{if(!w||w.length===0)return null;const C=w.length;return t==="grid"?c.jsx("div",{className:"erp-cmm-form",style:{display:"grid",gridTemplateColumns:`repeat(${u.totalCols}, 1fr)`,gap:`${r}px`,width:"100%"},children:w.map((m,$)=>{const S=m?.props?.["data-colspan"]?parseInt(String(m.props["data-colspan"])):1,P=d(m);return c.jsx("div",{style:{gridColumn:`span ${S}`,minWidth:`${n}px`},className:"form-component-wrapper",children:P},`row-${b}-col-${$}`)})},`row-${b}`):c.jsx(A.Flex,{gap:r,className:"erp-cmm-form",wrap:t==="auto"?"wrap":"nowrap",style:{width:"100%"},children:w.map((m,$)=>{const S=f(m,$,C),P=d(m),_=t==="flex"?{width:`${S}px`,minWidth:`${n}px`,maxWidth:`${o}px`,flexShrink:0}:{width:`${S}%`,minWidth:`${n}px`};return c.jsx("div",{style:_,className:"form-component-wrapper",children:P},`row-${b}-col-${$}`)})},`row-${b}`)};return c.jsx(A.Flex,{gap:"small",vertical:!0,style:i,className:a,children:l.map((w,b)=>p(w,b+1))})},qu=({children:e,...t})=>c.jsx(A.Col,{...t,className:"bwg-col",children:e});var qr={},Ko={exports:{}},Ia;function Co(){return Ia||(Ia=1,(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ko)),Ko.exports}var Ur={},Da;function Uu(){if(Da)return Ur;Da=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.default=void 0;var e={items_per_page:"/ 페이지",jump_to:"이동하기",jump_to_confirm:"확인하다",page:"페이지",prev_page:"이전 페이지",next_page:"다음 페이지",prev_5:"이전 5 페이지",next_5:"다음 5 페이지",prev_3:"이전 3 페이지",next_3:"다음 3 페이지",page_size:"페이지 크기"};return Ur.default=e,Ur}var Gr={},Yr={},Xr={},qo={exports:{}},Uo={exports:{}},Go={exports:{}},Yo={exports:{}},za;function Cl(){return za||(za=1,(function(e){function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Yo)),Yo.exports}var Xo={exports:{}},La;function Gu(){return La||(La=1,(function(e){var t=Cl().default;function r(n,o){if(t(n)!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var a=i.call(n,o||"default");if(t(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Xo)),Xo.exports}var Ba;function Yu(){return Ba||(Ba=1,(function(e){var t=Cl().default,r=Gu();function n(o){var i=r(o,"string");return t(i)=="symbol"?i:i+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Go)),Go.exports}var Ha;function Xu(){return Ha||(Ha=1,(function(e){var t=Yu();function r(n,o,i){return(o=t(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Uo)),Uo.exports}var Fa;function Qu(){return Fa||(Fa=1,(function(e){var t=Xu();function r(o,i){var a=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);i&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(o,l).enumerable})),a.push.apply(a,s)}return a}function n(o){for(var i=1;i<arguments.length;i++){var a=arguments[i]!=null?arguments[i]:{};i%2?r(Object(a),!0).forEach(function(s){t(o,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):r(Object(a)).forEach(function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(a,s))})}return o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(qo)),qo.exports}var Qr={},Va;function Zu(){return Va||(Va=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.commonLocale=void 0,Qr.commonLocale={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),Qr}var Wa;function Ju(){if(Wa)return Xr;Wa=1;var e=Co().default;Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.default=void 0;var t=e(Qu()),r=Zu(),n=(0,t.default)((0,t.default)({},r.commonLocale),{},{locale:"ko_KR",today:"오늘",now:"현재 시각",backToToday:"오늘로 돌아가기",ok:"확인",clear:"지우기",week:"주",month:"월",year:"년",timeSelect:"시간 선택",dateSelect:"날짜 선택",monthSelect:"달 선택",yearSelect:"연 선택",decadeSelect:"연대 선택",yearFormat:"YYYY년",dateFormat:"YYYY-MM-DD",dateTimeFormat:"YYYY-MM-DD HH:mm:ss",monthBeforeYear:!1,previousMonth:"이전 달 (PageUp)",nextMonth:"다음 달 (PageDown)",previousYear:"이전 해 (Control + left)",nextYear:"다음 해 (Control + right)",previousDecade:"이전 연대",nextDecade:"다음 연대",previousCentury:"이전 세기",nextCentury:"다음 세기"});return Xr.default=n,Xr}var Zr={},Ka;function Sl(){if(Ka)return Zr;Ka=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.default=void 0;const e={placeholder:"시간 선택",rangePlaceholder:["시작 시간","종료 시간"]};return Zr.default=e,Zr}var qa;function wl(){if(qa)return Yr;qa=1;var e=Co().default;Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.default=void 0;var t=e(Ju()),r=e(Sl());const n={lang:Object.assign({placeholder:"날짜 선택",yearPlaceholder:"연도 선택",quarterPlaceholder:"분기 선택",monthPlaceholder:"월 선택",weekPlaceholder:"주 선택",rangePlaceholder:["시작일","종료일"],rangeYearPlaceholder:["시작 연도","종료 연도"],rangeMonthPlaceholder:["시작 월","종료 월"],rangeQuarterPlaceholder:["시작 분기","종료 분기"],rangeWeekPlaceholder:["시작 주","종료 주"],shortWeekDays:["일","월","화","수","목","금","토"],shortMonths:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},t.default),timePickerLocale:Object.assign({},r.default)};return Yr.default=n,Yr}var Ua;function ed(){if(Ua)return Gr;Ua=1;var e=Co().default;Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.default=void 0;var t=e(wl());return Gr.default=t.default,Gr}var Ga;function td(){if(Ga)return qr;Ga=1;var e=Co().default;Object.defineProperty(qr,"__esModule",{value:!0}),qr.default=void 0;var t=e(Uu()),r=e(ed()),n=e(wl()),o=e(Sl());const i="${label} 유효하지 않은 ${type}",a={locale:"ko",Pagination:t.default,DatePicker:n.default,TimePicker:o.default,Calendar:r.default,global:{placeholder:"선택하세요",close:"닫기"},Table:{filterTitle:"필터 메뉴",filterConfirm:"확인",filterReset:"초기화",filterEmptyText:"필터 없음",filterCheckAll:"전체 선택",filterSearchPlaceholder:"필터 검색",emptyText:"데이터 없음",selectAll:"전체 선택",selectInvert:"선택 반전",selectNone:"없음",selectionAll:"전체 선택",sortTitle:"정렬",expand:"펼치기",collapse:"접기",triggerDesc:"내림차순으로 정렬하기",triggerAsc:"오름차순으로 정렬하기",cancelSort:"정렬 취소하기"},Tour:{Next:"다음",Previous:"이전",Finish:"종료"},Modal:{okText:"확인",cancelText:"취소",justOkText:"확인"},Popconfirm:{okText:"확인",cancelText:"취소"},Transfer:{titles:["",""],searchPlaceholder:"여기에 검색하세요",itemUnit:"개",itemsUnit:"개",remove:"삭제",selectCurrent:"현재 페이지 선택",removeCurrent:"현재 페이지 삭제",selectAll:"전체 선택",removeAll:"전체 삭제",selectInvert:"선택 반전"},Upload:{uploading:"업로드 중...",removeFile:"파일 삭제",uploadError:"업로드 실패",previewFile:"파일 미리보기",downloadFile:"파일 다운로드"},Empty:{description:"데이터 없음"},Icon:{icon:"아이콘"},Text:{edit:"수정",copy:"복사",copied:"복사 됨",expand:"확장"},Form:{optional:"(선택사항)",defaultValidateMessages:{default:"필드 유효성 검사 오류 ${label}",required:"${label} 값을 입력해 주세요",enum:"${label} [${enum}] 중에 하나여야 합니다",whitespace:"${label} 비워둘 수 없습니다",date:{format:"${label} 유효하지 않은 날짜 형식입니다",parse:"${label} 날짜 형식으로 변환될 수 없습니다",invalid:"${label} 유효하지 않은 날짜입니다"},types:{string:i,method:i,array:i,object:i,number:i,date:i,boolean:i,integer:i,float:i,regexp:i,email:i,url:i,hex:i},string:{len:"${label} ${len}글자여야 합니다",min:"${label} 적어도 ${min}글자 이상이어야 합니다",max:"${label} ${max}글자 이하여야 합니다",range:"${label} ${min}-${max}글자 사이어야 합니다"},number:{len:"${label} 값은 ${len}이어야 합니다",min:"${label} 최솟값은 ${min}입니다",max:"${label} 최댓값은 ${max}입니다",range:"${label} 값은 ${min}-${max} 사이어야 합니다"},array:{len:"${len}이어야 합니다 ${label}",min:"최소 ${min}이어야 합니다 ${label}",max:"최대 ${max}이어야 합니다 ${label}",range:"${label} ${min}-${max} 사이어야 합니다"},pattern:{mismatch:"${label} ${pattern} 패턴과 일치하지 않습니다"}}},Image:{preview:"미리보기"},QRCode:{expired:"만료된 QR 코드",refresh:"새로고침"},ColorPicker:{presetEmpty:"미정",transparent:"투명",singleColor:"단색",gradientColor:"그라데이션"}};return qr.default=a,qr}var Qo,Ya;function rd(){return Ya||(Ya=1,Qo=td()),Qo}var nd=rd();const El=xo(nd),jl=({children:e,customTheme:t,customComponentSize:r="middle",layout:n="comfortable",getPopupContainer:o})=>{const a=(()=>{const l={token:{colorPrimary:"#1890ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1890ff",fontFamily:'"Noto Sans KR", sans-serif',fontSize:14,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",boxShadowSecondary:"0 2px 4px rgba(0, 0, 0, 0.12)"},algorithm:A.theme.defaultAlgorithm};switch(n){case"compact":return{...l,token:{...l.token,padding:8,margin:8,borderRadius:4,fontSize:12,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14}};case"spacious":return{...l,token:{...l.token,padding:24,margin:24,borderRadius:8,fontSize:16,fontSizeHeading1:44,fontSizeHeading2:36,fontSizeHeading3:28,fontSizeHeading4:24,fontSizeHeading5:20}};default:return{...l,token:{...l.token,padding:16,margin:16,borderRadius:6,fontSize:14,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14}}}})(),s={...a,...t,token:{...a.token,...t?.token},components:{Checkbox:{colorPrimary:"var(--check-primary)",colorPrimaryBorder:"var(--check-primary)",colorPrimaryHover:"var(--check-primary-active)",colorText:"var(--text-primary)"},Radio:{colorPrimary:"var(--check-primary)",colorPrimaryActive:"var(--check-primary-active)",colorPrimaryHover:"var(--check-primary-active)"},Tree:{nodeHoverBg:"var(--tree-selected-bg)",nodeHoverColor:"var(--primary-color)",nodeSelectedBg:"var(--tree-selected-bg)",nodeSelectedColor:"var(--primary-color)",colorText:"var(--text-primary)"},...t?.components??{}}};return c.jsx(A.ConfigProvider,{locale:El,theme:s,componentSize:r,space:{size:r},form:{validateMessages:{required:"${label}을(를) 입력해주세요.",types:{email:"${label}이(가) 유효한 이메일이 아닙니다.",number:"${label}이(가) 유효한 숫자가 아닙니다."},number:{range:"${label}은(는) ${min} ~ ${max} 사이의 값이어야 합니다."}}},pagination:{showSizeChanger:!0},getPopupContainer:o,children:e})},od=({children:e})=>{const{activeDetailItem:t}=gt.useMenuViewStore();return c.jsx("div",{className:"bwg-view main-view",style:{height:"100%",display:"flex",flexDirection:"column"},children:c.jsx("div",{className:"bwgview-content",children:c.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[c.jsx(A.Breadcrumb,{separator:">",items:[{title:t?.prntInfo?.menuNm},{title:t?.viewLabel}]}),e]})})})},Vt=({title:e,icons:t,tooltip:r,iconVisible:n=!0,paddingBottom:o=0,marginBottom:i=0,children:a})=>{const s=nn.AppstoreTwoTone;return g.useMemo(()=>t?.type==="antd"&&t.icon&&nn[t.icon]||s,[t?.type,t?.icon]),c.jsx(A.Flex,{vertical:!0,style:{width:"100%"},children:c.jsxs("div",{className:`bwg-title-box ${o?`pb${o}`:""} ${i?`mb${i}`:""}`,style:{display:"flex",justifyContent:"space-between"},children:[c.jsx("div",{className:"bwg-title-box-left",children:c.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[c.jsx(A.Typography.Title,{level:4,children:c.jsx("span",{children:e})}),r&&c.jsx(A.Tooltip,{title:r.title,placement:r.placement,children:c.jsx(nn.QuestionCircleTwoTone,{style:{marginLeft:5}})})]})}),c.jsx("div",{className:"bwg-title-box-right",children:c.jsx(A.Flex,{gap:6,children:a})})]})})},{Panel:Xa}=A.Collapse,la=g.forwardRef(({reqRows:e,subRows:t,border:r=!1,labelDisplay:n,header:o},i)=>{const[a]=A.Form.useForm(),[s,l]=g.useState("1"),u=()=>n?{flex:n.md||n.lg||n.sm||"100px"}:{flex:"100px"};g.useImperativeHandle(i,()=>({getFormData:()=>a.getFieldsValue(),setFormData:d=>{a.setFieldsValue(d)},resetForm:()=>{a.resetFields()},validateForm:async()=>{try{return{success:!0,data:await a.validateFields()}}catch(d){return{success:!1,error:d}}}}));const f=()=>{l(d=>d.includes("subRows")?d.filter(p=>p!=="subRows"):[...d,"subRows"])};return c.jsxs("div",{style:r?{border:"1px solid #ddd",padding:"10px 12px",borderRadius:"8px",marginBottom:"10px"}:{},children:[o&&c.jsx(Vt,{title:o.title,children:o.buttons}),c.jsx(A.Form,{form:a,layout:"inline",style:{width:"100%",paddingBottom:e||t?"10px":"0px"},labelCol:u(),labelAlign:"left",children:c.jsxs("div",{style:{position:"relative",width:"100%"},children:[t&&c.jsx("div",{style:{position:"absolute",top:"15px",left:"-9px",zIndex:10},children:s.includes("subRows")?c.jsx(A.Tooltip,{title:"접기",children:c.jsx("span",{className:"search-collapsed-arrow",onClick:f,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",children:c.jsx("path",{d:"M5.28321 0.986589C4.88285 0.482264 4.11715 0.482265 3.71679 0.986589L1.0243 4.37824C0.50404 5.0336 0.970753 6 1.80751 6L7.19249 6C8.02925 6 8.49596 5.0336 7.9757 4.37824L5.28321 0.986589Z",fill:"#AEB9C4"})})})}):c.jsx(A.Tooltip,{title:"펼치기",children:c.jsx("span",{className:"search-collapsed-arrow",onClick:f,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",children:c.jsx("path",{d:"M5.28321 5.01341C4.88285 5.51774 4.11715 5.51773 3.71679 5.01341L1.0243 1.62176C0.50404 0.966397 0.970753 1.64312e-07 1.80751 2.37464e-07L7.19249 7.08234e-07C8.02925 7.81386e-07 8.49596 0.966399 7.9757 1.62176L5.28321 5.01341Z",fill:"#AEB9C4"})})})})}),c.jsx(A.ConfigProvider,{theme:{components:{Collapse:{}}},children:c.jsxs(A.Collapse,{activeKey:["reqRows",...s.includes("subRows")?["subRows"]:[]],onChange:l,className:"searchbox-collapse",bordered:!1,ghost:!0,children:[e&&c.jsx(Xa,{style:{padding:0,margin:0},header:void 0,showArrow:!1,collapsible:"disabled",children:e},"reqRows"),t&&c.jsx(Xa,{style:{padding:0,margin:0},header:void 0,showArrow:!1,collapsible:"icon",children:t},"subRows")]})})]})})]})}),id=({children:e,showSearchBox:t,showCloseButton:r=!0,showEyesButton:n=!1,shotSettingButton:o=!0,styles:i,...a})=>{const[s,l]=g.useState(!0),[u,f]=g.useState(()=>{const $=a.placement;return $==="left"||$==="right"||$==="top"||$==="bottom"?$:"bottom"}),[d,p]=g.useState(!1),b=($=>{const S={wrapper:{...a.width&&{width:a.width},...a.height&&{height:a.height},margin:"0 auto"},content:{},header:{backgroundColor:"var(--drawer-header-bg)",color:"var(--text-primary)"}};switch($){case"bottom":return{...S,wrapper:{...S.wrapper,borderRadius:"30px 30px 0 0"},content:{borderRadius:"30px 30px 0 0"},header:{...S.header,borderRadius:"30px 30px 0 0"}};case"top":return{...S,wrapper:{...S.wrapper,borderRadius:"0 0 30px 30px"},content:{borderRadius:"0 0 30px 30px"},header:{...S.header}};case"left":return{...S,wrapper:{...S.wrapper,borderRadius:"0 30px 0px 0"},content:{borderRadius:"0 30px 0px 0"},header:{...S.header,borderRadius:"0 30px 0 0"}};case"right":return{...S,wrapper:{...S.wrapper,borderRadius:"30px 0 0 0"},content:{borderRadius:"30px 0 0 0"},header:{...S.header,borderRadius:"30px 0 0 0"}};default:return S}})(u),C={wrapper:{...b?.wrapper,...i?.wrapper},content:{...b?.content,...i?.content},header:{...b?.header,...i?.header}},m=()=>{const $=[];if(o){const S=[{key:"top",label:"상단",icon:c.jsx(ce.CaretUpOutlined,{})},{key:"right",label:"우측",icon:c.jsx(ce.CaretRightOutlined,{})},{key:"bottom",label:"하단",icon:c.jsx(ce.CaretDownOutlined,{})},{key:"left",label:"좌측",icon:c.jsx(ce.CaretLeftOutlined,{})}],P=c.jsx(A.Space.Compact,{children:S.map(_=>c.jsx(A.Button,{type:u===_.key?"primary":"default",size:"small",onClick:()=>{f(_.key),p(!1)},icon:_.icon},_.key))});$.push(c.jsx(A.Popover,{content:P,trigger:"click",placement:"left",open:d,onOpenChange:p,children:c.jsx(A.Tooltip,{placement:"bottom",title:"위치변경",zIndex:2100,children:c.jsx(A.Button,{icon:c.jsx(ce.SettingOutlined,{}),type:"text",size:"middle"})})},"shotSetting"))}return n&&$.push(c.jsx(A.Tooltip,{placement:"bottom",title:s?"배경 보기":"배경 숨기기",zIndex:2100,children:c.jsx(A.Button,{icon:c.jsx(ce.EyeOutlined,{}),type:"text",size:"middle",onClick:()=>l(!s)})},"eyes")),a.extra&&$.push(c.jsx("div",{style:{margin:"0 8px"},children:a.extra},"extra")),r&&$.push(c.jsx(A.Tooltip,{placement:"bottom",title:"닫기",zIndex:2100,children:c.jsx(A.Button,{icon:c.jsx(ce.CloseOutlined,{}),onClick:a.onClose,type:"text",size:"middle"})},"close")),$};return c.jsx(A.Drawer,{className:"main-drawer",footer:!0,...a,placement:u,styles:C,maskClosable:!1,closable:!1,mask:s,extra:c.jsx(A.Space,{size:"small",align:"center",children:m()}),afterOpenChange:$=>{$||(l(!0),f(a.placement)),a.afterOpenChange?.($)},destroyOnHidden:!0,children:t?c.jsxs(Nt,{type:"vertical",children:[c.jsxs(A.Flex,{justify:"space-between",align:"center",style:{width:"100%"},children:[c.jsx("div",{children:t.title}),c.jsx(A.Flex,{gap:2,children:t.extra})]}),c.jsx(la,{...t.searchBox}),c.jsx(A.Divider,{}),e]}):e})},fr=({width:e="100%",height:t="100%",boxAlign:r,display:n="show",overflow:o,style:i,className:a,border:s=!0,children:l,ref:u})=>c.jsx("div",{style:{width:e,height:t,display:n==="show"?"":n,overflowX:o?.x,overflowY:o?.y,...i},className:`bwgview-content-box ${r?`content-box-${r}`:""} ${a||""} ${s?"":"none-box-st"}`,ref:u,children:l}),Rl=Na?.default??Na;try{yl.register("modules/imageResize",Rl)}catch(e){console.warn("quill-image-resize-module-react 로드 실패:",e)}const co=e=>zu.sanitize(e??"",{ALLOWED_TAGS:["p","br","div","span","strong","b","em","i","u","s","blockquote","pre","code","ul","ol","li","h1","h2","h3","h4","h5","h6","a","img"],ALLOWED_ATTR:["style","class","href","target","rel","src","alt","width","height","data-*","align"],ALLOWED_URI_REGEXP:/^(?:(?:https?|data|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,KEEP_CONTENT:!0,RETURN_TRUSTED_TYPE:!1}),uo=g.forwardRef(({border:e=!0,editorProps:t,value:r,defaultValue:n,onChange:o,onBlur:i,disabled:a,placeholder:s},l)=>{const{isEditing:u=!0,title:f,containerHeight:d="100%"}=t||{},p=g.useRef(null),w=g.useMemo(()=>{const E={toolbar:u?[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{align:[]}],["link","image"],["clean"]]:!1};return Rl?{...E,imageResize:{parchment:yl.import("parchment"),modules:["Resize","DisplaySize","Toolbar"],displayStyles:{backgroundColor:"black",border:"none",color:"white"}}}:E},[u]),b=g.useMemo(()=>["header","bold","italic","underline","strike","color","background","list","bullet","indent","align","link","image","width","height"],[]),C=r!==void 0,[m,$]=g.useState(n??""),S=C?r:m,P=g.useCallback((E,O,L,I)=>{const T=co(E??"");C||$(T),o?.(T,O,L,I)},[C,o]),y=`calc(100% - ${u?"42px":"0px"} - ${f?"40px":"0px"})`;return g.useImperativeHandle(l,()=>({getHTML:()=>S??"",getText:()=>p.current?.getEditor()?.getText()??"",insertHTML:E=>{const O=p.current?.getEditor();if(!O)return;const L=O.getSelection(!0),I=co(E??"");O.clipboard.dangerouslyPasteHTML(L?L.index:O.getLength(),I)},insertImage:(E,O)=>{const L=p.current?.getEditor();if(!L)return;const I=L.getSelection(!0),T=typeof E=="string"?E:"";L.insertEmbed(I?I.index:L.getLength(),"image",T,"user")},getQuill:()=>p.current?.getEditor?.()??null})),c.jsxs(fr,{border:e,style:{opacity:a?.6:1,pointerEvents:a?"none":"auto",height:typeof d=="number"?`${d}px`:d},children:[f&&c.jsx(Vt,{...f,paddingBottom:10}),c.jsx(Lu,{ref:p,theme:u?"snow":"bubble",readOnly:!u,value:S,onChange:P,onBlur:i,modules:w,formats:b,style:{width:"100%",height:y},placeholder:s},u?"snow":"bubble")]})}),ad=(e,t,r,n)=>co(e??""),sd=({itemProps:e,...t})=>{const{rules:r,shouldUpdate:n,dependencies:o,noStyle:i,...a}=e;return c.jsx(A.Form.Item,{valuePropName:"value",trigger:"onChange",getValueFromEvent:ad,normalize:s=>s??"",rules:r,shouldUpdate:n,dependencies:o,noStyle:i,...a,children:c.jsx(uo,{...t})})},ld=e=>{const{itemProps:t,onChange:r,editorProps:n,...o}=e,i=A.Form.useFormInstance();if(t?.name!=null){const a=t.name;return c.jsxs(c.Fragment,{children:[c.jsx(A.Form.Item,{hidden:!0,name:a,rules:t.rules,normalize:s=>s??"",children:c.jsx("input",{type:"hidden"})}),c.jsx(uo,{...o,editorProps:n,value:i.getFieldValue(a)??"",onChange:(s,l,u,f)=>{const d=co(s??"");i.setFieldValue(a,d),r?.(d,l,u,f)},onBlur:()=>{i.validateFields([a]).catch(()=>{})}})]})}return c.jsx(uo,{...e})},cd=Object.assign(ld,{FormItem:sd,Core:uo});var yr={},Qa;function ud(){if(Qa)return yr;Qa=1;var e=lo;if(process.env.NODE_ENV==="production")yr.createRoot=e.createRoot,yr.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;yr.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},yr.hydrateRoot=function(r,n,o){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,o)}finally{t.usingClientEntryPoint=!1}}}return yr}var dd=ud();const ca=g.forwardRef(({currentPage:e,totalPages:t,pageSize:r=10,totalData:n,onPageChange:o,pageSizeOptions:i=[10,20,50,100],gridRef:a,mode:s="client",onServerPageChange:l},u)=>{const[f,d]=g.useState(r),[p,w]=g.useState(1),[b,C]=g.useState(r),[m,$]=g.useState(0);g.useEffect(()=>{d(r)},[r]),g.useEffect(()=>{d(r)},[]),g.useImperativeHandle(u,()=>({currentPage:p,pageSize:b,totalData:m,totalPages:Math.ceil(m/b),setPage:N=>{w(N),l?.(N,b)},setPageSize:N=>{C(N),w(1),l?.(1,N)},setTotalData:N=>{$(N)},reset:()=>{w(1),C(r),$(0)}}),[p,b,m,l,r]);const S=s==="client",P=S?(e||0)+1:p,_=S?(t||0)>0:m>0,y=S?_?Math.ceil((n||0)/f):0:Math.ceil(m/b),E=S?_&&n||0:m,O=Math.min(P,y||1),L=`${f}-${y}-${O}`,I=N=>{S?o?.(N-1):(w(N),l?.(N,b))},T=N=>{if(S){d(N);try{a?.current?.gridView?(a.current.gridView.setPaging(!0,N),a.current.gridView.setPage(0)):o?.(0)}catch(z){console.warn("페이지 사이즈 변경 중 오류:",z),o?.(0)}}else C(N),w(1),l?.(1,N)};return c.jsxs("div",{style:{padding:"10px",display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid #f0f0f0",backgroundColor:"#fafafa"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[c.jsx("span",{style:{fontSize:"12px"},children:"페이지당"}),c.jsx("select",{value:S?f:b,onChange:N=>T(Number(N.target.value)),disabled:!_,style:{padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:"4px",fontSize:"12px",opacity:_?1:.5},children:i.map(N=>c.jsxs("option",{value:N,children:[N,"개"]},N))}),c.jsxs("span",{style:{fontSize:"12px",color:"#666",opacity:_?1:.5},children:["/ 총 ",E,"개"]})]}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[c.jsx(A.Button,{onClick:()=>I(1),disabled:!_||O===1,style:{width:"30px",height:"24px",background:!_||O===1?"#f5f5f5":"white",cursor:!_||O===1?"not-allowed":"pointer",opacity:_?1:.5},icon:c.jsx(ce.DoubleLeftOutlined,{})}),c.jsx(A.Button,{onClick:()=>I(O-1),disabled:!_||O===1,style:{width:"30px",height:"24px",background:!_||O===1?"#f5f5f5":"white",cursor:!_||O===1?"not-allowed":"pointer",opacity:_?1:.5},icon:c.jsx(ce.LeftOutlined,{})}),c.jsx("div",{children:(()=>{if(!_||y===0)return c.jsx(A.Button,{disabled:!0,style:{width:"30px",height:"24px"},children:"1"});const N=5;let z=1,B=Math.min(N,y);O>3&&y>N&&(z=Math.max(1,O-2),B=Math.min(y,z+N-1),B===y&&(z=Math.max(1,B-N+1)));const v=[];for(let x=z;x<=B;x++)v.push(c.jsx(A.Button,{onClick:()=>I(x),style:{width:"30px",height:"24px",background:O===x?"#1890ff":"white",color:O===x?"white":"black",cursor:"pointer"},children:x},x));return v})()},L),c.jsx(A.Button,{onClick:()=>I(O+1),disabled:!_||O>=y,style:{width:"30px",height:"24px",background:!_||O>=y?"#f5f5f5":"white",cursor:!_||O>=y?"not-allowed":"pointer",opacity:_?1:.5},icon:c.jsx(ce.RightOutlined,{})}),c.jsx(A.Button,{onClick:()=>I(y),disabled:!_||O>=y,style:{width:"30px",height:"24px",background:!_||O>=y?"#f5f5f5":"white",cursor:!_||O>=y?"not-allowed":"pointer",opacity:_?1:.5},icon:c.jsx(ce.DoubleRightOutlined,{})})]})]})});ca.displayName="BwgPagination";const fd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC7SURBVHgBZZDLDcJADETHUe7QQVJC6AAqACoAKkCcESh8JI60kBKgg3TA0kE6gAISzHgj0BJ8sWw/j2cXCCI7aD446g2diDp1aWyWaz9sxmHhNlJSyUCDnlQeQpEKm5UCDwgqvHBnTji4MvcEKGw3FsVFDeCmCCbMYwIpQY4wMnX5mj5pKrXfTFSxc1sp/o03yLlZaoSpRFhme53/QF4FmNl9txbH8wuC5893tEo1PZivBs6/sgVXBlv9BpvVRX62Og6eAAAAAElFTkSuQmCC",hd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC7SURBVHgBZVDbDcIwDHSiqL90AzoCI5S/fvQBEwATIDYoE7BCRwjqAtmAsEE3gAlqzlFBKbXknJ2cL5cQRcF13SIf9Bd63mmHdcN5nsbbJm6UtY6bxlGaCunNZZmTUpniqhpQvIhZ8AlcI+9QXYHYIb3BgQ0ETAJ36BvUmQiDuBV19TNdFBkliUyK0lX1fbc0bkyL1WF6D7UzbBxnpKCi9YHG0UPeoz6BePt+h55UxMMA9NMrPa68BDLiAxmcQh0cAM62AAAAAElFTkSuQmCC",pd=[{label:"엑셀다운로드",tag:"excel"},{label:"엑셀(제목포함)",tag:"withTitleExcel"},{label:"-"},{label:"필터",type:"check",checked:!1,tag:"filter"},{label:"열고정",tag:"fixedCol"},{label:"행고정",tag:"fixedRow"},{label:"고정해제",tag:"fixedCancel"},{label:"-"},{label:"숨기기",tag:"hide"},{label:"숨기기해제",tag:"hideClear"}],gd=[{label:"엑셀다운로드",tag:"excel"},{label:"엑셀(들여쓰기 표시)",tag:"showIndentExcel"},{label:"엑셀(제목포함)",tag:"withTitleExcel"},{label:"-"},{label:"필터",type:"check",checked:!1,tag:"filter"},{label:"열고정",tag:"fixedCol"},{label:"행고정",tag:"fixedRow"},{label:"고정해제",tag:"fixedCancel"},{label:"-"},{label:"숨기기",tag:"hide"},{label:"숨기기해제",tag:"hideClear"}],md=({children:e})=>{const[t,r]=g.useState(!1),[n,o]=g.useState(null);return t?c.jsx("div",{style:{padding:"20px",border:"1px solid #ff4d4f",borderRadius:"6px",backgroundColor:"#fff2f0",margin:"10px"},children:c.jsx(A.Alert,{message:"리얼그리드 로드 실패",description:c.jsxs("div",{children:[c.jsx("p",{children:"리얼그리드 라이센스 또는 초기화 중 오류가 발생했습니다."}),c.jsxs("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:["오류: ",n?.message||"알 수 없는 오류"]}),c.jsx(A.Button,{type:"primary",size:"small",style:{marginTop:"8px"},onClick:()=>{r(!1),o(null),window.location.reload()},children:"다시 시도"})]}),type:"error",showIcon:!0})}):c.jsx(vd,{onError:i=>{console.error("BwgGrid 에러:",i),o(i),r(!0)},children:e})};class vd extends g.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,r){this.props.onError(t)}render(){return this.state.hasError?null:this.props.children}}const bd=g.forwardRef(({type:e="nrml",gridDivStyle:t,gridDivClassName:r,gridColumns:n,gridOptions:o,gridEvents:i,bindRef:a,gridContext:s,renderers:l,gridInitCallback:u},f)=>{const d=g.useRef(null),p=g.useRef(new Map),w=(R,H,K,W)=>{let q=[],Y=[];const G="treeNode";for(let J in R){let X=R[J];q[X[K]]=R[J];let ne=q[X[H]];if(ne==null||ne=="-"){Y.push(X);continue}ne[G]==null&&(ne[G]=[]),ne[G].push(X)}return Y},b=g.useCallback(R=>{const H=W=>{const q=[];return W.forEach(Y=>{Y.children&&Y.children.length>0?q.push(...H(Y.children)):q.push(Y)}),q};return H(R).map(W=>({fieldName:W.fieldName,dataType:W.dataType||"text"}))},[]),C=g.useCallback(R=>{const H=W=>{const q=[];return W.forEach(Y=>{Y.children&&Y.children.length>0?q.push(...H(Y.children)):q.push(Y)}),q};return H(R).map(W=>({...W,header:{template:W.required?`<img src='${hd}' style='margin-top:4px; margin-right: 2px;' alt='Required input' >\${headerText} `:W.editable?`<img src='${fd}' style='margin-top:4px; margin-right: 2px;' alt='Required input' >\${headerText} `:"${headerText}",values:{headerText:W.header?.text??""},text:W.header?.text||""},styleName:W.dataType==="number"?"right":W.styleName||"center"}))},[]);g.useImperativeHandle(f,()=>({addAllData(R,H){const K=d.current?.gridView.getCurrent().dataRow;if(d.current?.dataProvider instanceof Ke.LocalDataProvider){d.current.dataProvider.clearRows();try{d.current?.gridView.showLoading(),d.current.dataProvider.setRows(R)}catch(W){console.error("fillJsonData 오류:",W)}finally{d.current?.gridView.closeLoading()}}if(d.current?.dataProvider instanceof Ke.LocalTreeDataProvider){if(d.current.dataProvider.clearRows(),H?.treeOption?.dataField==null||H?.treeOption?.parentField==null)return;const W={rows:"treeNode"};try{d.current?.gridView.showLoading();let q=w(R,H.treeOption?.parentField,H.treeOption?.dataField);d.current.dataProvider.fillJsonData({treeNode:q},W),H.treeOption.isExpand&&d.current.gridView?.expandAll()}catch(q){console.error("fillJsonData 오류:",q)}finally{d.current?.gridView.closeLoading()}}H?.isCurrent?d.current?.gridView.setCurrent({dataRow:K}):d.current?.gridView.setCurrent({dataRow:0})},getGridInstance:()=>d.current,getCurrentRow:()=>d.current?.gridView.getCurrent().dataRow??-1,getCurrentIndex:()=>d.current?.gridView.getCurrent().itemIndex??-1,gridExcelDown(R){d.current?.gridView.exportGrid({type:"excel",target:"local",allItems:!1,lookupDisplay:!0,showProgress:!0,progressMessage:"엑셀 Export 중 입니다.",applyDynamicStyles:!1,separateRows:!0,indenting:!!R?.indenting,header:"default",footer:"default",sheetName:"",fileName:R?.fileName||"sample.xlsx",...R})},getGridSaveData:()=>{const R=d.current?.dataProvider?.getAllStateRows();if(R===void 0)return[{}];let H=[];if(R.created!==void 0&&R.created.length>0)for(const K in R.created){let W=d.current?.dataProvider?.getJsonRow(R.created[K]);W={...W,iudFlag:"I"},H.push(W)}if(R.updated!==void 0&&R.updated.length>0)for(const K in R.updated){let W=d.current?.dataProvider?.getJsonRow(R.updated[K]);W={...W,iudFlag:"U"},H.push(W)}if(R.deleted!==void 0&&R.deleted.length>0)for(const K in R.deleted){let W=d.current?.dataProvider?.getJsonRow(R.deleted[K]);W={...W,iudFlag:"D"},H.push(W)}return H},deleteGridData:()=>{d?.current?.gridView?.getCheckedItems()?.map(H=>{let K=d?.current?.gridView?.getDataRow(H)??-1;const W=d?.current?.dataProvider?.getRowState(K);W==Ke.RowState.DELETED?(d?.current?.dataProvider?.setRowState(K,p.current.get(H)??Ke.RowState.NONE),p.current.delete(H)):W==Ke.RowState.CREATED?d?.current?.dataProvider?.setRowState(K,Ke.RowState.CREATE_AND_DELETED):W==Ke.RowState.CREATE_AND_DELETED?d?.current?.dataProvider?.setRowState(K,Ke.RowState.CREATED):(p.current.set(H,W??Ke.RowState.NONE),d?.current?.dataProvider?.setRowState(K,Ke.RowState.DELETED)),d?.current?.gridView?.checkItem(H,!1)})},_oriRowState:[{}],dp:d.current?.dataProvider??null,vw:d.current?.gridView??null}));const m=g.useCallback((R,H,K)=>{if(a!==void 0&&K>=0){let W=R.getDataSource().getJsonRow(K);a?.current?.setFieldsValue(W)}else a!==void 0&&K<0&&a?.current?.resetFields();R.setCurrent({dataRow:0}),i?.onCurrentRowChanged&&i?.onCurrentRowChanged(R,H,K)},[a,i]),$=g.useCallback((R,H,K)=>{const W=H.fieldName??"";a?.current?.getFieldInstance(W)&&a?.current.setFieldValue(W,K),i?.onEditChange&&i?.onEditChange(R,H,K)},[a,i]),S=g.useCallback((R,H,K)=>{const W=R.getOrgFieldName(K),q=R.getValue(H,K);a?.current?.setFieldValue(W,q)},[a]),P=g.useCallback((R,H,K,W)=>{const q=R.getColumn(W).name??"",Y=R.getValue(H,W);a?.current?.getFieldInstance(q)&&a?.current.setFieldValue(q,Y),i?.onCellEdited&&i?.onCellEdited(R,H,K,W)},[a,i]),_=g.useCallback((R,H,K,W)=>{if(typeof H.dataRow=="number"&&H.dataRow!=-1){var q=R.getDataSource().getRowState(H.dataRow);if(q=="deleted"||q=="createAndDeleted")return!1}return i?.onShowEditor!=null&&i?.onShowEditor(R,H,K,W),!0},[a,i]),j=g.useCallback(R=>{if(!d.current)return;const H=d.current.gridView,K=H.getDataSource();if(o?.container?.page){const W=H.getPage(),q=H.getPageCount(),Y=K.getRowCount();U({currentPage:W,totalPages:q,totalData:Y})}},[o?.container?.page]),y=g.useCallback(()=>{if(!d.current)return;const R=d.current.gridView,H=R.getDataSource(),K=["onKeyDown"],W=["onRowInserted"];Object.keys(i??{}).map(q=>{K.includes(q)?R[q+"Add"]=i?.[q]:R[q]=i?.[q],W.includes(q)?H[q+"Add"]=i?.[q]:H[q]=i?.[q]}),H instanceof Ke.LocalDataProvider&&(H.onRowInserted=(q,Y)=>{Y<0||(setTimeout(function(){R?.setCurrent({dataRow:Y})},1),q.onRowInsertedAdd!==void 0&&q.onRowInsertedAdd(q,Y))}),R.onKeyDown=function(q,Y){if(Y.code=="Space"){let G=q.getSelectedItems(!0);for(const J in G)q.isCheckable(G[J])&&(q.isCheckedItem(G[J])?q.checkItem(G[J],!1,!1):q.checkItem(G[J],!0,!1))}return q.onKeyDownAdd!==void 0&&q.onKeyDownAdd(q,Y),!0},d.current.gridView.onCurrentRowChanged=m,d.current.gridView.onEditChange=$,d.current.gridView.getDataSource().onValueChanged=S,d.current.gridView.onCellEdited=P,d.current.gridView.onShowEditor=_,d.current.gridView.onDataLoadComplated=j},[m,$,S,P,_,j]),E=g.useCallback(R=>{if(R){try{R.gridView.setSortingOptions({enabled:!0}),R.gridView.sortMode=Ke.SortMode.EXPLICIT,R.gridView.editorOptions.viewGridInside=!0,R.gridView instanceof Ke.TreeView&&R.gridView.setTreeOptions({expandWhenSetData:Ke.ExpandWhenSetData.REMAIN_AND_EXPAND,expanderIconStyle:Ke.TreeExpanderIconStyle.SQUARE,iconVisible:!1,lineVisible:!0}),R.gridView.setDisplayOptions({showEmptyMessage:!0,emptyMessage:"조회된 데이터가 존재하지 않습니다.",useFocusClass:!0,minRowHeight:o?.display?.minRowHeight||43,maxRowHeight:o?.display?.maxRowHeight||100,rowHeight:o?.display?.rowHeight||43,rowChangeDelay:o?.display?.rowChangeDelay||0,selectionStyle:o?.display?.selectionStyle||Ke.SelectionStyle.ROWS,fitStyle:o?.display?.fitStyle||Ke.GridFitStyle.FILL,useAlternateRowStyle:o?.display?.useAlternateRowStyle||!1}),R.gridView.setEditOptions({commitWhenExitLast:!0,columnEditableFirst:!1,commitByCell:!0,commitWhenLeave:!0,crossWhenExitLast:!0,confirmWhenDelete:!1,deletable:!1,revertable:!1,showOnlyValidationMessage:!0,editable:o?.edit?.editable||!1,validateOnEdited:o?.edit?.validateOnEdited||!1}),R.gridView.setCopyOptions({singleMode:o?.copy?.singleMode||!1}),R.gridView.setPasteOptions({selectBlockPaste:!0,checkReadOnly:!0,throwValidationError:!1}),R.gridView.header.height=o?.header?.height||43,R.gridView.header.styleName=o?.header?.styleName||"bwgGridHeader",o?.container?.radio?R.gridView.setCheckBar({exclusive:o?.container?.radio||!1}):R.gridView.setCheckBar({visible:o?.container?.check||!1,showAll:o?.container?.checkAll||!1}),R.gridView.setStateBar({visible:o?.container?.state||!1}),R.gridView.rowIndicator.visible=o?.container?.indicator||!1,R.gridView instanceof Ke.GridView&&(R.gridView.groupPanel.visible=o?.container?.panel||!1),R.gridView.setFooters({visible:o?.container?.footer||!1}),R.gridView.setHeader({visible:o?.container?.header||!0}),R.gridView.formatOptions.numberFormat="#,##0"}catch(H){console.log("그리드 옵션 설정 중 오류:",H)}try{R.gridView instanceof Ke.TreeView?R.gridView.setContextMenu(gd):R.gridView.setContextMenu(pd),R.gridView.onContextMenuItemClicked=function(H,K,W){if(!(!W||!W.column)){if(K.tag=="excel")z(H,{isTitle:!1},s?.excel);else if(K.tag=="showIndentExcel")z(H,{isTitle:!1,treeBlank:!0},s?.excel);else if(K.tag=="withTitleExcel")z(H,{isTitle:!0,treeBlank:!1},s?.excel);else if(K.tag=="filter")B(H,K);else if(K.tag=="fixedCol"){const Y=H.getDataSource().getFieldIndex(W.column);H.setFixedOptions({colCount:Y})}else if(K.tag=="fixedRow")H.setFixedOptions({rowCount:(W.itemIndex||0)+1});else if(K.tag=="fixedCancel")H.setFixedOptions({colCount:0,rowCount:0});else if(K.tag=="hide")H.setColumnProperty(W.column,"visible",!1),H._hideCols[H._hideCols.length]=W.column;else if(K.tag=="hideClear")for(var q=0;q<H._hideCols.length;q++)H.setColumnProperty(H._hideCols[q],"visible",!0)}}}catch(H){console.log("컨텍스트 설정 중 오류:",H)}}},[o]),O=R=>{if(!(!l||l.length===0))try{l.forEach(H=>{const{name:K,renderer:W}=H;if(K&&W){const q=typeof W=="function"?new W:W;R.gridView.registerCustomRenderer(K,q)}})}catch(H){console.error("커스텀 렌더러 초기화 중 오류:",H)}},L=R=>{R.onPageChanged=(H,K)=>{U(W=>({...W,currentPage:K}))},R.onPageCountChanged=(H,K)=>{U(W=>({...W,totalPages:K}))}},I=R=>{d.current?.gridView&&d.current.gridView.setPage(R)},T=R=>{if(o?.layout?.colspan&&o.layout.colspan.length>0&&o?.layout?.colspan.forEach(H=>{const K=R.gridView.layoutByColumn(H.fieldName);if(K){const W=H.span;K.spanCallback=function(q,Y,G){return W}}}),n&&n.length>0&&n.some(K=>K.children&&K.children.length>0))try{(()=>{const W=JSON.parse(JSON.stringify(n)),q=[],Y=G=>{const J=[];return G.children.map(X=>{if(X.children&&X.children.length>0){const ne=Y(X),se=X.header?.text||X.fieldName,le=R.gridView.getColumnProperty(X.fieldName,"header");delete X.children,delete X.header;let Se={name:X.fieldName,header:{text:le?.text||se,template:le?.template,values:le?.values,visible:le?.visible??!0},items:ne,...X};J.push(Se)}else J.push(X.fieldName)}),J};W.map(G=>{if(G.children&&G.children.length>0){const J=Y(G),X=G.header?.text||G.fieldName,ne=G.header?.visible??!0,se=R.gridView.getColumnProperty(G.fieldName,"header");delete G.children,delete G.header;const le={name:G.fieldName,header:{text:se?.text||X,template:se?.template,values:se?.values,visible:se?.visible||ne},items:J,...G};q.push(le)}else q.push(G.fieldName)}),console.log("Final Layout!!",q),R.gridView.setColumnLayout(q)})()}catch(K){console.error("컬럼 레이아웃 설정 오류:",K)}},N=()=>{if(d.current){if(e==="nrml"){const R=d.current;if(E(R),O(R),n&&n.length>0){const H=b(n),K=C(n);R.gridView.getDataSource().setFields(H),R.gridView.setColumns(K)}if(T(R),o?.container?.page){const H=o?.pagingOption?.pageSize||10;R.gridView.setPaging(!0,H),L(R.gridView)}}else{const R=d.current;if(E(R),O(R),n&&n.length>0){const H=b(n),K=C(n);R.gridView.getDataSource().setFields(H),R.gridView.setColumns(K)}T(d.current)}setTimeout(()=>{if(u){const R=typeof f=="object"&&f!==null?f.current:null;u(R)}},0)}},z=(R,H,K)=>{const W=R.getDataSource();let q=K?.footer==null?"default":K.footer;W.getRowCount()<1&&(q="hidden");let Y={type:"excel",target:"local",allItems:!1,lookupDisplay:!0,compatibility:!0,showProgress:!0,progressMessage:"엑셀 Export 중 입니다.",applyDynamicStyles:!1,separateRows:!0,indenting:!!H?.treeBlank,footer:q,sheetName:"",documentTitle:{},documentSubtitle:{},documentTail:{},fileName:K?.fileName||"sample.xlsx"};W instanceof Ke.LocalTreeDataProvider&&(Y.indenting=!!H?.treeBlank),K?.isCellMerge==!0&&(Y.separateRows=!1),ot.isEmpty(K?.sheetName)==!1&&(Y.sheetName=K?.sheetName),H?.isTitle&&(Y.documentTitle={message:ot.isSafeEmpty(K?.mainTitle,"No Title"),visible:!0,styleName:"documentStyle",spaceTop:1,spaceBottom:0,height:43},ot.isEmpty(K?.subTitle)==!1&&(Y.documentSubtitle={message:K?.subTitle,visible:!0,styleName:"center",height:20}),ot.isEmpty(K?.tailTitle)==!1&&(Y.documentTail={message:K?.tailTitle,visible:!0,styleName:"documentStyle"})),R.exportGrid(Y)},B=(R,H)=>{const K=R.getDataSource(),W=K.getOrgFieldNames();if(H.checked)for(var q=0;q<W.length;q++){let G=[],J=K.getDistinctValues(W[q])??[];if(J.length==0)continue;let X=R.columnByName(W[q]);for(var Y=0;Y<J.length;Y++){if(J[Y]==null)continue;let ne=X.values!=null&&X.values.indexOf(J[Y])!=-1?X?.labels?.[X.values.indexOf(J[Y])]:J[Y];ot.isEmpty(ne)&&(ot.isEmpty(J[Y])?ne=" ":ne=J[Y]);let se="";J[Y]==null?se="value="+J[Y]:se="value='"+J[Y]+"'",G.push({name:ne,criteria:se})}R.setColumnFilters(W[q],G)}else for(var q=0;q<W.length;q++)R.clearColumnFilters(W[q]),R.activateAllColumnFilters(W[q],!1),R.clearColumnFilters(W[q])};g.useEffect(()=>{if(d.current&&d.current.gridView)if(e==="nrml"){const R=d.current;E(R)}else{const R=d.current;E(R)}},[e,o,E]),g.useEffect(()=>{!d.current||!n||n.length===0||N()},[n]),g.useEffect(()=>{d.current&&y()},[i,y]);const[v,x]=g.useState(!1),[k,M]=g.useState(""),D=g.useRef(null),[F,U]=g.useState({currentPage:0,totalPages:0,totalData:0});g.useEffect(()=>{U({currentPage:0,totalPages:0,totalData:0})},[]),g.useEffect(()=>{v&&setTimeout(()=>{D.current?.focus?.()},0)},[v]),g.useEffect(()=>()=>{if(d.current)try{const R=d.current;R.gridView&&(R.gridView.onDataLoadComplated=void 0,R.gridView.onCurrentRowChanged=void 0,R.gridView.onCellClicked=void 0,R.gridView.onCellDblClicked=void 0,R.gridView.onEditRowChanged=void 0,R.gridView.onItemChecked=void 0,R.gridView.onItemAllChecked=void 0,R.gridView.onColumnCheckedChanged=void 0,R.gridView.onCellButtonClicked=void 0,R.gridView.onEditChange=void 0,R.gridView.onCellEdited=void 0,R.gridView.onKeyUp=void 0,R.gridView.onKeyDown=void 0,R.gridView.onWheel=void 0,R.gridView.onValidateColumn=void 0,R.gridView.onValidateRow=void 0,R.gridView.onValidationFail=void 0,R.gridView.onRowInserting=void 0,R.gridView.onCellItemClicked=void 0,R.gridView.onShowEditor=void 0,R.gridView.getDataSource()&&(R.gridView.getDataSource().clearRows(),R.gridView.getDataSource().setFields([])),R.gridView.getDataSource().clearRows())}catch(R){console.warn("⚠️ BwgGrid cleanup error:",R)}},[]);const V=g.useCallback(R=>{Z(R)},[]),Z=g.useCallback(R=>{const H=d.current?.gridView;if(H?.isFiltered()){console.log("EE:: [그리드 Filtering 으로 인한 오류] 그리드 내 Filter를 해제 후 진행해 주십시오.");return}if(H?.commit(),ot.isEmpty(R))return;const K=H?.getCurrent().itemIndex??-1;if(K<0)return;const W={value:R,startIndex:K+1,wrap:!0,caseSensitive:!1,partialMatch:!0},q=H?.searchCell(W);H?.setCurrent(q)},[]),ae=g.useCallback(R=>{R.key==="Escape"&&(R.preventDefault(),x(!1))},[]),me=g.useCallback(R=>{R.ctrlKey&&R.code==="KeyF"&&(R.preventDefault(),M(""),x(!v))},[v]),ue={searchRow:V,searchEnter:Z,handleCloseKeyword:ae,handleSearch:me},be=g.useMemo(()=>({...t,position:"relative",width:t?.width||"100%",height:t?.height||"100%"}),[t]);return c.jsxs(md,{children:[c.jsxs("div",{style:be,className:r,onKeyDown:R=>ue.handleSearch(R),children:[v&&c.jsx("div",{className:"grid-search-box",children:c.jsxs(A.Flex,{gap:3,children:[c.jsx(A.ConfigProvider,{theme:{components:{Button:{controlHeight:32},Input:{controlHeight:32}}},children:c.jsxs(A.Space.Compact,{children:[c.jsx(A.Button,{icon:c.jsx(ce.SearchOutlined,{})}),c.jsx(A.Input,{ref:D,value:k,name:"srchField",autoComplete:"off",onKeyUp:R=>ue.handleCloseKeyword(R),onChange:R=>M(R.target.value),onPressEnter:R=>ue.searchEnter(R)})]})}),c.jsx(A.Button,{variant:"solid",icon:c.jsx(ce.CloseOutlined,{}),onClick:()=>x(!1)})]})}),e==="nrml"?c.jsx(Aa.RealGridReact,{ref:d,autoGenerateField:!0,onInitialized:N}):c.jsx(Aa.RealTreeReact,{ref:d,autoGenerateField:!1,onInitialized:N})]}),o?.container?.page&&c.jsx(ca,{currentPage:F.currentPage,totalPages:F.totalPages,pageSize:o?.pagingOption?.pageSize,totalData:F.totalData,onPageChange:I,pageSizeOptions:o?.pagingOption?.pageSizeOptions,gridRef:d})]})}),yd=e=>({initContent(t){this._root=dd.createRoot(t)},render(t,r,n,o){const i=this._root;i&&e(t,r,n,o,i)},clearContent(t){const r=this._root;r&&setTimeout(()=>{r&&(r.unmount(),this._root=null)},0)},canClick(t){return!0},click(){return{}}}),xd=g.memo(({title:e,border:t,children:r,titleChildren:n})=>{const o=g.useMemo(()=>({components:{Form:{labelColor:"#9A9A9A"},Select:{colorTextDisabled:"#000"}}}),[]);return c.jsxs(Nt,{type:"vertical",children:[c.jsx(Vt,{title:e,icons:{type:"antd",icon:"InfoCircleTwoTone"},children:n}),c.jsx(fr,{border:!1,children:c.jsx(A.ConfigProvider,{theme:o,children:r})})]})}),Nt=({type:e="horizontal",layoutAlign:t="left",verticalAlign:r,className:n,style:o,children:i})=>c.jsx("div",{style:o,className:`bwgview-content-layout ${e=="horizontal"?"hz-layout":"vt-layout"} layout-${t} ${r&&`vertical-${r}`} ${n||""}`,children:i}),Za=(e,t)=>{const r=window.innerWidth,n=window.innerHeight,o=Math.min(Math.max(e.x,0),Math.max(0,r-t.width)),i=Math.min(Math.max(e.y,0),Math.max(0,n-t.height));return{x:o,y:i}},Cd=({buttons:e,onClose:t})=>{const r=(e||[]).filter(n=>n?.visible!==!1);return r.length===0?c.jsx(A.Button,{type:"default",className:"bwg-btn popup-btn",onClick:t,children:"닫기"}):c.jsxs("div",{style:{display:"flex",gap:6},children:[r.map(n=>c.jsx(A.Button,{type:n.type,disabled:!!n.disabled,loading:n.loading,className:n.className||"bwg-btn popup-btn",style:n.style,icon:n.icon,onClick:n.onClick,children:n.label},n.id)),c.jsx(A.Button,{type:"default",className:"bwg-btn popup-btn",onClick:t,children:"닫기"})]})},Sn=({popup:e,popupEvent:t,onClose:r,children:n,buttons:o})=>{const i=g.useRef(null),a=e?.popupTitle||"팝업",s=e?.width||800,l=e?.height||600,[u,f]=g.useState(s),[d,p]=g.useState(l),w=g.useMemo(()=>{const _=Math.max(0,(window.innerWidth-s)/2),j=Math.max(0,(window.innerHeight-l)/2);return{x:_,y:j}},[s,l]),[b,C]=g.useState(w),m=(_,j)=>{const y=Za({x:j.x,y:j.y},{width:u,height:d});C(y)},$=(_,j,y,E,O)=>{const L={width:parseInt(y.style.width,10),height:parseInt(y.style.height,10)},I=Za(O,L);f(L.width),p(L.height),C(I)},S=()=>i.current??document.body,P=typeof e?.zIndex=="number"?e.zIndex:3e3;return c.jsxs("div",{style:{position:"fixed",inset:0,zIndex:P},children:[c.jsx("div",{onClick:r,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:0}}),c.jsxs(Bu.Rnd,{className:"bwg-popup",size:{width:u,height:d},position:b,bounds:"window",minWidth:400,minHeight:300,onDragStop:m,onResizeStop:$,dragHandleClassName:"drag-handle",cancel:".rnd-cancel",enableUserSelectHack:!1,style:{backgroundColor:"white",borderRadius:20,boxShadow:"0 4px 15px rgba(0,0,0,0.25)",overflow:"visible",position:"absolute",zIndex:1},children:[c.jsx("div",{className:"bwg-popup-content",style:{overflow:"hidden",borderRadius:20,height:"100%"},children:c.jsx(jl,{getPopupContainer:S,children:c.jsx(Nt,{type:"vertical",children:c.jsx(A.Card,{className:"popup-drag-container",title:c.jsx("div",{className:"drag-handle",style:{display:"flex",alignItems:"center",gap:8},children:a}),style:{width:"100%",height:"100%"},styles:{body:{height:"calc(100% - 77px)",padding:20,overflow:"auto"}},extra:c.jsx(Cd,{buttons:o,onClose:()=>e?.close?.()||r?.()}),children:c.jsx("div",{className:"rnd-cancel",style:{height:"100%"},children:c.jsx(dr.SearchBoxProvider,{children:n})})})})})}),c.jsx("div",{ref:i,className:"bwg-popup-portal-root",style:{position:"relative"}})]})]})},Sd=({children:e,...t})=>c.jsx(A.Row,{...t,className:"bwg-row",children:e}),wd=({children:e})=>c.jsx("div",{style:{height:"100%",padding:"20px 30px 26px"},children:c.jsx("div",{style:{width:"100%",height:"100%",border:"1px solid #ddd",borderRadius:"15px",background:"#fff"},children:e})}),Ed=({rowKey:e="id",columns:t,dataSource:r,loading:n=!1,rowSelection:o,size:i="middle",pagination:a=!1,...s})=>c.jsx(A.Table,{rowKey:e,columns:t,dataSource:r,loading:n,rowSelection:o,size:i,pagination:a,bordered:!0,scroll:{x:"max-content"},locale:{emptyText:"데이터가 없습니다."},...s}),jd=e=>{const{type:t="card",animated:r=!0,...n}=e;return c.jsx(A.Tabs,{type:t,animated:r,...n})};function ki(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Rd(e){if(Array.isArray(e))return ki(e)}function $l(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ua(e,t){if(e){if(typeof e=="string")return ki(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ki(e,t):void 0}}function $d(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function et(e){return Rd(e)||$l(e)||ua(e)||$d()}function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xe.apply(null,arguments)}var kd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};function kl(e){if(Array.isArray(e))return e}function Od(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,s=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}function Ol(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function te(e,t){return kl(e)||Od(e,t)||ua(e,t)||Ol()}function we(e){"@babel/helpers - typeof";return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(e)}function Td(e,t){if(we(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(we(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tl(e){var t=Td(e,"string");return we(t)=="symbol"?t:t+""}function ee(e,t,r){return(t=Tl(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _d(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Rt(e,t){if(e==null)return{};var r,n,o=_d(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Zo={exports:{}};/*!
|
|
4
4
|
Copyright (c) 2018 Jed Watson.
|
|
@@ -180,4 +180,4 @@ html body {
|
|
|
180
180
|
${t}-collapse,
|
|
181
181
|
${t}-edit,
|
|
182
182
|
${t}-copy
|
|
183
|
-
`]:Object.assign(Object.assign({},Nc(e)),{marginInlineStart:e.marginXXS})}),_0(e)),P0(e)),N0()),{"&-rtl":{direction:"rtl"}})}},M0=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),Ru=kn("Typography",A0,M0),I0=e=>{const{prefixCls:t,"aria-label":r,className:n,style:o,direction:i,maxLength:a,autoSize:s=!0,value:l,onSave:u,onCancel:f,onEnd:d,component:p,enterIcon:w=h.createElement(uu,null)}=e,b=h.useRef(null),C=h.useRef(!1),m=h.useRef(null),[$,S]=h.useState(l);h.useEffect(()=>{S(l)},[l]),h.useEffect(()=>{var B;if(!((B=b.current)===null||B===void 0)&&B.resizableTextArea){const{textArea:v}=b.current.resizableTextArea;v.focus();const{length:x}=v.value;v.setSelectionRange(x,x)}},[]);const P=({target:B})=>{S(B.value.replace(/[\n\r]/g,""))},_=()=>{C.current=!0},j=()=>{C.current=!1},y=({keyCode:B})=>{C.current||(m.current=B)},E=()=>{u($.trim())},O=({keyCode:B,ctrlKey:v,altKey:x,metaKey:k,shiftKey:M})=>{m.current!==B||C.current||v||x||k||M||(B===al.ENTER?(E(),d?.()):B===al.ESC&&f())},L=()=>{E()},[I,T,N]=Ru(t),z=pe(t,`${t}-edit-content`,{[`${t}-rtl`]:i==="rtl",[`${t}-${p}`]:!!p},n,T,N);return I(h.createElement("div",{className:z,style:o},h.createElement(R0,{ref:b,maxLength:a,value:$,onChange:P,onKeyDown:y,onKeyUp:O,onCompositionStart:_,onCompositionEnd:j,onBlur:L,"aria-label":r,rows:1,autoSize:s}),w!==null?su(w,{className:`${t}-edit-content-confirm`}):null))};var vi,hl;function D0(){return hl||(hl=1,vi=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),vi}var bi,pl;function z0(){if(pl)return bi;pl=1;var e=D0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,a)}function o(i,a){var s,l,u,f,d,p,w=!1;a||(a={}),s=a.debug||!1;try{u=e(),f=document.createRange(),d=document.getSelection(),p=document.createElement("span"),p.textContent=i,p.ariaHidden="true",p.style.all="unset",p.style.position="fixed",p.style.top=0,p.style.clip="rect(0, 0, 0, 0)",p.style.whiteSpace="pre",p.style.webkitUserSelect="text",p.style.MozUserSelect="text",p.style.msUserSelect="text",p.style.userSelect="text",p.addEventListener("copy",function(C){if(C.stopPropagation(),a.format)if(C.preventDefault(),typeof C.clipboardData>"u"){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var m=t[a.format]||t.default;window.clipboardData.setData(m,i)}else C.clipboardData.clearData(),C.clipboardData.setData(a.format,i);a.onCopy&&(C.preventDefault(),a.onCopy(C.clipboardData))}),document.body.appendChild(p),f.selectNodeContents(p),d.addRange(f);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");w=!0}catch(C){s&&console.error("unable to copy using execCommand: ",C),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(a.format||"text",i),a.onCopy&&a.onCopy(window.clipboardData),w=!0}catch(m){s&&console.error("unable to copy using clipboardData: ",m),s&&console.error("falling back to prompt"),l=n("message"in a?a.message:r),window.prompt(l,i)}}finally{d&&(typeof d.removeRange=="function"?d.removeRange(f):d.removeAllRanges()),p&&document.body.removeChild(p),u()}return w}return bi=o,bi}var L0=z0();const B0=xo(L0),H0=(e,t=!1)=>t&&e==null?[]:Array.isArray(e)?e:[e];var F0=exports&&exports.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(f){try{u(n.next(f))}catch(d){a(d)}}function l(f){try{u(n.throw(f))}catch(d){a(d)}}function u(f){f.done?i(f.value):o(f.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const V0=({copyConfig:e,children:t})=>{const[r,n]=h.useState(!1),[o,i]=h.useState(!1),a=h.useRef(null),s=()=>{a.current&&clearTimeout(a.current)},l={};e.format&&(l.format=e.format),h.useEffect(()=>s,[]);const u=ut(f=>F0(void 0,void 0,void 0,function*(){var d;f?.preventDefault(),f?.stopPropagation(),i(!0);try{const p=typeof e.text=="function"?yield e.text():e.text;B0(p||H0(t,!0).join("")||"",l),i(!1),n(!0),s(),a.current=setTimeout(()=>{n(!1)},3e3),(d=e.onCopy)===null||d===void 0||d.call(e,f)}catch(p){throw i(!1),p}}));return{copied:r,copyLoading:o,onClick:u}};function yi(e,t){return h.useMemo(()=>{const r=!!e;return[r,Object.assign(Object.assign({},t),r&&typeof e=="object"?e:null)]},[e])}const W0=e=>{const t=g.useRef(void 0);return g.useEffect(()=>{t.current=e}),t.current},K0=(e,t,r)=>g.useMemo(()=>e===!0?{title:t??r}:g.isValidElement(e)?{title:e}:typeof e=="object"?Object.assign({title:t??r},e):{title:e},[e,t,r]);var q0=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const $u=h.forwardRef((e,t)=>{const{prefixCls:r,component:n="article",className:o,rootClassName:i,setContentRef:a,children:s,direction:l,style:u}=e,f=q0(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:d,direction:p,className:w,style:b}=$o("typography"),C=l??p,m=a?wn(t,a):t,$=d("typography",r);process.env.NODE_ENV!=="production"&&At("Typography").deprecated(!a,"setContentRef","ref");const[S,P,_]=Ru($),j=pe($,w,{[`${$}-rtl`]:C==="rtl"},o,i,P,_),y=Object.assign(Object.assign({},b),u);return S(h.createElement(n,Object.assign({className:j,style:y,ref:m},f),s))});process.env.NODE_ENV!=="production"&&($u.displayName="Typography");var U0={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},G0=function(t,r){return h.createElement(qt,Xe({},t,{ref:r,icon:U0}))},ku=h.forwardRef(G0);process.env.NODE_ENV!=="production"&&(ku.displayName="CheckOutlined");var Y0={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},X0=function(t,r){return h.createElement(qt,Xe({},t,{ref:r,icon:Y0}))},Ou=h.forwardRef(X0);process.env.NODE_ENV!=="production"&&(Ou.displayName="CopyOutlined");var Q0={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},Z0=function(t,r){return h.createElement(qt,Xe({},t,{ref:r,icon:Q0}))},Tu=h.forwardRef(Z0);process.env.NODE_ENV!=="production"&&(Tu.displayName="LoadingOutlined");function gl(e){return e===!1?[!1,!1]:Array.isArray(e)?e:[e]}function xi(e,t,r){return e===!0||e===void 0?t:e||r&&t}function J0(e){const t=document.createElement("em");e.appendChild(t),process.env.NODE_ENV!=="production"&&(t.className="ant-typography-css-ellipsis-content-measure");const r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return e.removeChild(t),r.left>n.left||n.right>r.right||r.top>n.top||n.bottom>r.bottom}const _a=e=>["string","number"].includes(typeof e),ev=({prefixCls:e,copied:t,locale:r,iconOnly:n,tooltips:o,icon:i,tabIndex:a,onCopy:s,loading:l})=>{const u=gl(o),f=gl(i),{copied:d,copy:p}=r??{},w=t?d:p,b=xi(u[t?1:0],w),C=typeof b=="string"?b:w;return h.createElement(Tn,{title:b,getPopupContainer:m=>m.parentNode},h.createElement("button",{type:"button",className:pe(`${e}-copy`,{[`${e}-copy-success`]:t,[`${e}-copy-icon-only`]:n}),onClick:s,"aria-label":C,tabIndex:a},t?xi(f[1],h.createElement(ku,null),!0):xi(f[0],l?h.createElement(Tu,null):h.createElement(Ou,null),!0)))},eo=h.forwardRef(({style:e,children:t},r)=>{const n=h.useRef(null);return h.useImperativeHandle(r,()=>({isExceed:()=>{const o=n.current;return o.scrollHeight>o.clientHeight},getHeight:()=>n.current.clientHeight})),h.createElement("span",{"aria-hidden":!0,ref:n,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},e)},t)}),tv=e=>e.reduce((t,r)=>t+(_a(r)?String(r).length:1),0);function ml(e,t){let r=0;const n=[];for(let o=0;o<e.length;o+=1){if(r===t)return n;const i=e[o],s=_a(i)?String(i).length:1,l=r+s;if(l>t){const u=t-r;return n.push(String(i).slice(0,u)),n}n.push(i),r=l}return e}const Ci=0,Si=1,wi=2,Ei=3,vl=4,to={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function rv(e){const{enableMeasure:t,width:r,text:n,children:o,rows:i,expanded:a,miscDeps:s,onEllipsis:l}=e,u=h.useMemo(()=>fn(n),[n]),f=h.useMemo(()=>tv(u),[n]),d=h.useMemo(()=>o(u,!1),[n]),[p,w]=h.useState(null),b=h.useRef(null),C=h.useRef(null),m=h.useRef(null),$=h.useRef(null),S=h.useRef(null),[P,_]=h.useState(!1),[j,y]=h.useState(Ci),[E,O]=h.useState(0),[L,I]=h.useState(null);Le(()=>{y(t&&r&&f?Si:Ci)},[r,n,i,t,u]),Le(()=>{var B,v,x,k;if(j===Si){y(wi);const M=C.current&&getComputedStyle(C.current).whiteSpace;I(M)}else if(j===wi){const M=!!(!((B=m.current)===null||B===void 0)&&B.isExceed());y(M?Ei:vl),w(M?[0,f]:null),_(M);const D=((v=m.current)===null||v===void 0?void 0:v.getHeight())||0,F=i===1?0:((x=$.current)===null||x===void 0?void 0:x.getHeight())||0,U=((k=S.current)===null||k===void 0?void 0:k.getHeight())||0,V=Math.max(D,F+U);O(V+1),l(M)}},[j]);const T=p?Math.ceil((p[0]+p[1])/2):0;Le(()=>{var B;const[v,x]=p||[0,0];if(v!==x){const M=(((B=b.current)===null||B===void 0?void 0:B.getHeight())||0)>E;let D=T;x-v===1&&(D=M?v:x),w(M?[v,D]:[D,x])}},[p,T]);const N=h.useMemo(()=>{if(!t)return o(u,!1);if(j!==Ei||!p||p[0]!==p[1]){const B=o(u,!1);return[vl,Ci].includes(j)?B:h.createElement("span",{style:Object.assign(Object.assign({},to),{WebkitLineClamp:i})},B)}return o(a?u:ml(u,p[0]),P)},[a,j,p,u].concat(et(s))),z={width:r,margin:0,padding:0,whiteSpace:L==="nowrap"?"normal":"inherit"};return h.createElement(h.Fragment,null,N,j===wi&&h.createElement(h.Fragment,null,h.createElement(eo,{style:Object.assign(Object.assign(Object.assign({},z),to),{WebkitLineClamp:i}),ref:m},d),h.createElement(eo,{style:Object.assign(Object.assign(Object.assign({},z),to),{WebkitLineClamp:i-1}),ref:$},d),h.createElement(eo,{style:Object.assign(Object.assign(Object.assign({},z),to),{WebkitLineClamp:1}),ref:S},o([],!0))),j===Ei&&p&&p[0]!==p[1]&&h.createElement(eo,{style:Object.assign(Object.assign({},z),{top:400}),ref:b},o(ml(u,T),!0)),j===Si&&h.createElement("span",{style:{whiteSpace:"inherit"},ref:C}))}const _u=({enableEllipsis:e,isEllipsis:t,children:r,tooltipProps:n})=>!n?.title||!e?r:h.createElement(Tn,Object.assign({open:t?void 0:!1},n),r);process.env.NODE_ENV!=="production"&&(_u.displayName="EllipsisTooltip");var nv=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function ov({mark:e,code:t,underline:r,delete:n,strong:o,keyboard:i,italic:a},s){let l=s;function u(f,d){d&&(l=h.createElement(f,{},l))}return u("strong",o),u("u",r),u("del",n),u("code",t),u("mark",e),u("kbd",i),u("i",a),l}const iv="...",bl=["delete","mark","code","underline","strong","keyboard","italic"],av=h.forwardRef((e,t)=>{var r;const{prefixCls:n,className:o,style:i,type:a,disabled:s,children:l,ellipsis:u,editable:f,copyable:d,component:p,title:w}=e,b=nv(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:C,direction:m}=h.useContext(Wt),[$]=ep("Text"),S=h.useRef(null),P=h.useRef(null),_=C("typography",n),j=tc(b,bl),[y,E]=yi(f),[O,L]=kr(!1,{value:E.editing}),{triggerType:I=["icon"]}=E,T=ie=>{var fe;ie&&((fe=E.onStart)===null||fe===void 0||fe.call(E)),L(ie)},N=W0(O);Le(()=>{var ie;!O&&N&&((ie=P.current)===null||ie===void 0||ie.focus())},[O]);const z=ie=>{ie?.preventDefault(),T(!0)},B=ie=>{var fe;(fe=E.onChange)===null||fe===void 0||fe.call(E,ie),T(!1)},v=()=>{var ie;(ie=E.onCancel)===null||ie===void 0||ie.call(E),T(!1)},[x,k]=yi(d),{copied:M,copyLoading:D,onClick:F}=V0({copyConfig:k,children:l}),[U,V]=h.useState(!1),[Z,ae]=h.useState(!1),[me,ue]=h.useState(!1),[be,R]=h.useState(!1),[H,K]=h.useState(!0),[W,q]=yi(u,{expandable:!1,symbol:ie=>ie?$?.collapse:$?.expand}),[Y,G]=kr(q.defaultExpanded||!1,{value:q.expanded}),J=W&&(!Y||q.expandable==="collapsible"),{rows:X=1}=q,ne=h.useMemo(()=>J&&(q.suffix!==void 0||q.onEllipsis||q.expandable||y||x),[J,q,y,x]);Le(()=>{W&&!ne&&(V(ms("webkitLineClamp")),ae(ms("textOverflow")))},[ne,W]);const[se,le]=h.useState(J),Se=h.useMemo(()=>ne?!1:X===1?Z:U,[ne,Z,U]);Le(()=>{le(Se&&J)},[Se,J]);const ve=J&&(se?be:me),Ce=J&&X===1&&se,de=J&&X>1&&se,re=(ie,fe)=>{var Fe;G(fe.expanded),(Fe=q.onExpand)===null||Fe===void 0||Fe.call(q,ie,fe)},[ye,Ee]=h.useState(0),Ue=({offsetWidth:ie})=>{Ee(ie)},Pe=ie=>{var fe;ue(ie),me!==ie&&((fe=q.onEllipsis)===null||fe===void 0||fe.call(q,ie))};h.useEffect(()=>{const ie=S.current;if(W&&se&&ie){const fe=J0(ie);be!==fe&&R(fe)}},[W,se,l,de,H,ye]),h.useEffect(()=>{const ie=S.current;if(typeof IntersectionObserver>"u"||!ie||!se||!J)return;const fe=new IntersectionObserver(()=>{K(!!ie.offsetParent)});return fe.observe(ie),()=>{fe.disconnect()}},[se,J]);const Ne=K0(q.tooltip,E.text,l),xe=h.useMemo(()=>{if(!(!W||se))return[E.text,l,w,Ne.title].find(_a)},[W,se,w,Ne.title,ve]);if(O)return h.createElement(I0,{value:(r=E.text)!==null&&r!==void 0?r:typeof l=="string"?l:"",onSave:B,onCancel:v,onEnd:E.onEnd,prefixCls:_,className:o,style:i,direction:m,component:p,maxLength:E.maxLength,autoSize:E.autoSize,enterIcon:E.enterIcon});const Ae=()=>{const{expandable:ie,symbol:fe}=q;return ie?h.createElement("button",{type:"button",key:"expand",className:`${_}-${Y?"collapse":"expand"}`,onClick:Fe=>re(Fe,{expanded:!Y}),"aria-label":Y?$.collapse:$?.expand},typeof fe=="function"?fe(Y):fe):null},ze=()=>{if(!y)return;const{icon:ie,tooltip:fe,tabIndex:Fe}=E,Mt=fn(fe)[0]||$?.edit,nr=typeof Mt=="string"?Mt:"";return I.includes("icon")?h.createElement(Tn,{key:"edit",title:fe===!1?"":Mt},h.createElement("button",{type:"button",ref:P,className:`${_}-edit`,onClick:z,"aria-label":nr,tabIndex:Fe},ie||h.createElement(Vl,{role:"button"}))):null},Te=()=>x?h.createElement(ev,Object.assign({key:"copy"},k,{prefixCls:_,copied:M,locale:$,onCopy:F,loading:D,iconOnly:l==null})):null,ge=ie=>[ie&&Ae(),ze(),Te()],Me=ie=>[ie&&!Y&&h.createElement("span",{"aria-hidden":!0,key:"ellipsis"},iv),q.suffix,ge(ie)];return h.createElement(Mr,{onResize:Ue,disabled:!J},ie=>h.createElement(_u,{tooltipProps:Ne,enableEllipsis:J,isEllipsis:ve},h.createElement($u,Object.assign({className:pe({[`${_}-${a}`]:a,[`${_}-disabled`]:s,[`${_}-ellipsis`]:W,[`${_}-ellipsis-single-line`]:Ce,[`${_}-ellipsis-multiple-line`]:de},o),prefixCls:n,style:Object.assign(Object.assign({},i),{WebkitLineClamp:de?X:void 0}),component:p,ref:wn(ie,S,t),direction:m,onClick:I.includes("text")?z:void 0,"aria-label":xe?.toString(),title:w},j),h.createElement(rv,{enableMeasure:J&&!se,text:l,rows:X,width:ye,onEllipsis:Pe,expanded:Y,miscDeps:[M,Y,D,y,x,$].concat(et(bl.map(fe=>e[fe])))},(fe,Fe)=>ov(e,h.createElement(h.Fragment,null,fe.length>0&&Fe&&!Y&&xe?h.createElement("span",{key:"show-content","aria-hidden":!0},fe):fe,Me(Fe)))))))}),sv=h.forwardRef((e,t)=>h.createElement(av,Object.assign({ref:t},e,{component:"div"}))),Pu=(e,t,r=null)=>{for(let n=0;n<e.length;n++){const o=e[n];if(o.key===t)return{node:o,ctx:{parent:r,index:n,siblings:e}};if(o.children?.length){const i=Pu(o.children,t,o);if(i.node)return i}}return{node:null,ctx:null}},Nu=(e,t)=>{if(!e.children)return!1;for(const r of e.children)if(r.key===t||Nu(r,t))return!0;return!1};function lv({open:e,onClose:t}){const{nodes:r,rootIds:n,addFolder:o,editFolder:i,removeFolder:a,removeMenu:s,moveNode:l}=gt.useFavoriteStore(),u=g.useRef(null),[f,d]=g.useState([]),[p,w]=g.useState([]),[b,C]=g.useState(""),[m,$]=g.useState("ADD"),[S,P]=g.useState(!1),[_,j]=g.useState("");g.useEffect(()=>{e&&w(n)},[e]),g.useEffect(()=>{const O=y(r,n);d(O)},[r]),g.useEffect(()=>{S&&_&&(u.current.setFieldValue("prntBkmkId",_),u.current.setFieldValue("prntBkmkNm",r[_]?.bkmkNm??"-")),S&&m==="EDIT"&&(u.current.setFieldValue("bkmkId",_),u.current.setFieldValue("bkmkNm",r[_]?.bkmkNm)),!S&&m=="ADD"&&w(O=>[...O,_]),!S&&u.current&&(j("-"),u.current.resetFields())},[S,m,_,r]);const y=(O,L)=>{const I=(T,N="-")=>{const z=O[T];if(!z)return null;const B={key:z.bkmkId,type:z.type,title:z.type==="F"?z.bkmkNm:z.menuNm?`${z.menuNm} (${z.menuId})`:z.menuId,parentId:N,sortOrdr:z.sortOrdr??0};if(z.type==="F"){const x=(z.children??[]).map(k=>I(k,z.bkmkId)).filter(Boolean);return{...B,children:x}}return B};return L.map(T=>I(T,"-")).filter(Boolean)},E=()=>{if($("ADD"),!b){j("-"),P(!0);return}const O=r[b];if(!O){j("-"),P(!0);return}O.type==="F"?j(O.bkmkId):j(O.prntBkmkId),P(!0)};return c.jsxs(A.ConfigProvider,{theme:{components:{Modal:{wireframe:!0}}},children:[c.jsxs(A.Modal,{open:e,okButtonProps:{style:{display:"none"}},cancelText:"닫기",width:560,style:{zIndex:1001},styles:{body:{paddingTop:"12px"}},title:c.jsx("div",{style:{display:"flex",alignItems:"center",gap:12},children:c.jsxs(A.Typography.Text,{strong:!0,style:{fontSize:18},children:[c.jsx(ce.FolderOpenFilled,{style:{marginRight:10,fontSize:18,color:"#faad14"}}),"북마크 관리"]})}),onCancel:t,children:[c.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginBottom:10},children:[c.jsx(A.Button,{color:"blue",variant:"outlined",icon:c.jsx(ce.FolderAddOutlined,{}),style:{marginLeft:"8px",height:28,padding:"0 10px"},onClick:E,children:"새 폴더"}),c.jsxs("div",{children:[c.jsx(A.Tooltip,{title:"펼치기",children:c.jsx(A.Button,{icon:c.jsx(ce.PlusSquareOutlined,{}),style:{marginLeft:"8px",height:28,padding:"0 10px"},onClick:()=>{const O=Object.values(r).filter(L=>L.type==="F").map(L=>L.bkmkId);w(O)}})}),c.jsx(A.Tooltip,{title:"접기",children:c.jsx(A.Button,{icon:c.jsx(ce.MinusSquareOutlined,{}),style:{marginLeft:"8px",height:28,padding:"0 10px"},onClick:()=>w([])})})]})]}),c.jsxs("div",{style:{maxHeight:420,height:350,overflow:"auto",border:"1px solid #f0f0f0",borderRadius:8,padding:8},children:[f.length==0&&c.jsx(A.Empty,{description:c.jsxs(A.Typography.Text,{type:"secondary",style:{fontSize:13},children:["아직 저장된 북마크가 없습니다.",c.jsx("br",{}),"새로운 폴더를 생성해보세요."]})}),c.jsx(A.Tree,{blockNode:!0,draggable:!0,allowDrop:({dropNode:O,dropPosition:L})=>{const I=O.type==="F";return L===0?I:!0},onDrop:O=>{const{dragNode:L,node:I,dropPosition:T,dropToGap:N}=O;if(L.key===I.key||Nu(L,I.key))return;let z,B;if(N){const x=Pu(f,I.key).ctx,k=x.index;z=x.parent?x.parent.key:"-",B=T>0?k+1:k}else{if(I.type!=="F")return;const x=I.children||[];z=I.key,B=x.length}const v=ot.getUserId();if(L.type==="F")l({bkmkId:L.key,newPrntBkmkId:z,sortOrdr:B,userId:v}).catch(()=>{A.Modal.error({title:"이동 실패",content:"폴더 이동 중 오류가 발생했어요."})});else{if(z==="-"){A.Modal.warning({title:"이동 불가",content:"메뉴는 최상위로 이동할 수 없어요."});return}l({bkmkId:L.key,newPrntBkmkId:z,sortOrdr:B,userId:v}).catch(()=>{A.Modal.error({title:"이동 실패",content:"메뉴 이동 중 오류가 발생했어요."})})}N===!1&&w(x=>Array.from(new Set([...x,I.key])))},showLine:!0,treeData:f,selectedKeys:[b],expandedKeys:p,onExpand:w,onSelect:O=>C(O[0]),titleRender:O=>c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[c.jsxs("span",{children:[O.type==="F"?"📁":"📄"," ",O.title,O.isNew?c.jsx(A.Tag,{color:"gold",style:{marginLeft:4,fontSize:"10px",height:"16px",lineHeight:"16px",padding:"0 5px"},children:"N"}):null]}),c.jsxs("span",{style:{display:"inline-flex",gap:8},children:[O.type==="F"&&c.jsxs(c.Fragment,{children:[c.jsx(ce.PlusOutlined,{style:{opacity:.8},onClick:()=>{$("ADD"),j(O.key),P(!0)}}),c.jsx(ce.EditOutlined,{style:{opacity:.8},onClick:()=>{$("EDIT"),j(O.key),P(!0)}})]}),c.jsx(ce.DeleteOutlined,{style:{cursor:"pointer",opacity:.5},onClick:()=>{O.type==="F"?A.Modal.confirm({title:"삭제 안내",content:"폴더를 삭제하면 하위 폴더와 메뉴도 모두 삭제됩니다. 삭제하시겠습니까?",centered:!0,onOk:()=>a(O.key)}):A.Modal.confirm({title:"삭제 안내",centered:!0,content:"메뉴를 삭제하시겠습니까?",onOk:()=>s(O.key)})}})]})]})})]})]}),c.jsx(A.ConfigProvider,{theme:{components:{Modal:{titleColor:m==="ADD"?"#0958d9":"#d46b08",headerBg:m==="ADD"?"#e6f4ff":"#fff7e6"}}},children:c.jsx(A.Modal,{title:c.jsxs(c.Fragment,{children:[m==="ADD"?c.jsx(ce.FolderAddOutlined,{style:{marginRight:10,fontSize:18,color:"#1677ff"}}):c.jsx(ce.EditOutlined,{style:{marginRight:10,fontSize:18,color:"#d46b08"}}),c.jsxs(A.Typography.Text,{strong:!0,style:{fontSize:17},children:["폴더",m==="ADD"?" 추가":"명 수정"]})]}),open:S,okText:"저장",onOk:()=>{const O=u.current.getFieldValue("bkmkNm"),L=ot.getUserId();if(m==="ADD"){const I=__SYS_CD__??"KH",T=u.current.getFieldValue("prntBkmkId");o(O,T,I,L).then(()=>{P(!1)})}else{const I=u.current.getFieldValue("bkmkId");i(I,L,O).then(()=>{P(!1)})}},centered:!0,width:400,onCancel:()=>P(!1),children:c.jsxs(Vn.BwgForm,{ref:u,children:[c.jsx(Vn.BwgInput,{itemProps:{name:m==="EDIT"?"bkmkId":"prntBkmkId",hidden:!0}}),c.jsx(Vn.BwgInput,{itemProps:{label:"상위 폴더명",name:"prntBkmkNm",hidden:_==="-"||m==="EDIT"},inputProps:{disabled:!0}}),c.jsx(Vn.BwgInput,{itemProps:{label:"폴더명",name:"bkmkNm"}})]})})})]})}function cv({triggerIcon:e}){const[t,r]=g.useState(!1),[n,o]=g.useState(""),[i,a]=g.useState(null),[s,l]=g.useState([]),[u,f]=g.useState([]),[d,p]=g.useState(!1),[w,b]=g.useState(!1),[C,m]=g.useState(!1),[$,S]=g.useState(null);gt.useFavoriteStore(D=>D.treeNodes);const{nodes:P,getPrntBkmkIdByMenuId:_,getNodeByMenuId:j,isMenuBookmarked:y,removeMenuByMenuId:E,addMenuToFolder:O,convertToAntTreeData:L}=gt.useFavoriteStore(),I=gt.useFavoriteStore(D=>D.rootIds),T=g.useMemo(()=>L(P,I,n,!0),[P,I,n]),N=gt.useMenuViewStore(D=>D.activeMenuItem??{menuId:"",menuNm:""}),z=g.useMemo(()=>{if(!N?.menuId)return"";const D=j(N.menuId);if(!D)return"";if(D.fullPath)return D.fullPath;const F=U=>{const V=P[U];if(!V)return"";if(V.prntBkmkId==="-")return`${V.bkmkNm||N?.menuNm}`;const Z=F(V.prntBkmkId);return Z?`${Z} > ${V.bkmkNm||N?.menuNm}`:V.bkmkNm||N?.menuNm};return console.log("bookmarkNode ::::: ",D),console.log(F(D.bkmkId)),F(D.bkmkId)},[N?.menuId,j,P]);g.useEffect(()=>{t&&N?.menuId&&y(N.menuId)?f([_(N.menuId)]):t&&N?.menuId&&!y(N.menuId)?f(I):(f([]),l([]),S(null),m(!1))},[t,N?.menuId,y,_]),g.useEffect(()=>{if(!C||!N?.menuId)return;const D=_(N.menuId);!D||!P[D]||(o(""),l([D]),S(D))},[C,N?.menuId,P,_]);const B=(D,F)=>{O(D,F).then(U=>{console.log("AddMenuToFolder ::::: ",U),U||f(V=>V.includes(D)?V:[...V,D])})},v=D=>{E(D)},x=async D=>{N?.menuId&&(await E(N.menuId),await O(D,N),m(!1),S(null),f(F=>F.includes(D)?F:[...F,D]))},k=()=>c.jsxs("div",{style:{width:360},children:[c.jsx("div",{style:{padding:12,borderBottom:"1px solid #f0f0f0"},children:c.jsxs(A.Space,{direction:"vertical",style:{width:"100%"},children:[c.jsxs(A.Typography.Text,{strong:!0,style:{fontSize:18},children:[c.jsx(A.Button,{type:"text",icon:c.jsx(ce.ArrowLeftOutlined,{}),onClick:()=>m(!1),style:{marginRight:4}}),"폴더 변경"]}),N&&c.jsxs(A.Typography.Text,{type:"secondary",children:["현재 화면: ",c.jsx("b",{children:N.menuNm})," ",c.jsxs("span",{style:{opacity:.7},children:["(",N.menuId,")"]})]})]})}),M(),c.jsxs("div",{style:{padding:12,borderTop:"1px solid #f0f0f0",display:"flex",justifyContent:"flex-end",gap:8},children:[c.jsx(A.Button,{onClick:()=>{m(!1),S(null)},children:"취소"}),c.jsx(A.Button,{type:"primary",disabled:!$,onClick:()=>$&&x(String($)),children:"이동"})]})]}),M=()=>c.jsxs("div",{style:{maxHeight:360,overflow:"auto",padding:8},children:[c.jsxs(A.Space,{style:{width:"100%",marginBottom:8,display:"flex",justifyContent:"space-between"},children:[c.jsx(A.Input,{placeholder:"검색(폴더명)",prefix:c.jsx(ce.SearchOutlined,{}),allowClear:!0,value:n,onChange:D=>o(D.target.value),style:{width:"260px",height:28}}),c.jsxs(A.ConfigProvider,{theme:{components:{Button:{defaultHoverColor:"#6f6f6f",defaultHoverBorderColor:"#6f6f6f"}}},children:[c.jsx(A.Button,{icon:c.jsx(ce.PlusOutlined,{}),size:"small",style:{margin:"0 4px",fontSize:12},onClick:()=>{const D=Object.values(P).filter(F=>F.type==="F").map(F=>F.bkmkId);f(D)},title:"모두 확장"}),c.jsx(A.Button,{icon:c.jsx(ce.MinusOutlined,{}),size:"small",style:{margin:"0 4px",fontSize:12},onClick:()=>f([]),title:"모두 축소"})]})]}),T.length===0?c.jsx(A.Empty,{description:c.jsxs(A.Typography.Text,{type:"secondary",style:{fontSize:13},children:["아직 저장된 북마크가 없습니다.",c.jsx("br",{}),"새로운 폴더를 만들어 시작해보세요."]}),image:A.Empty.PRESENTED_IMAGE_SIMPLE}):c.jsx(A.Tree,{blockNode:!0,showLine:!0,treeData:T,selectedKeys:s,expandedKeys:u,onExpand:f,onSelect:D=>{l(D),S(D[0])},autoExpandParent:!0,titleRender:D=>{const F=String(D.key),U=i===F;return c.jsxs("div",{onMouseEnter:()=>a(F),onMouseLeave:()=>a(null),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[c.jsx("div",{children:D.title}),!y(N?.menuId)&&N&&U&&c.jsx(A.Button,{size:"small",type:"link",onClick:V=>{V.stopPropagation(),B(F,N)},children:"+ 현재화면 추가"})]})}})]});return c.jsxs(c.Fragment,{children:[c.jsx(A.Popover,{open:t&&!d,onOpenChange:r,trigger:"click",placement:"bottomLeft",styles:{body:{padding:0,borderRadius:12,border:"1px solid #e8edf5",boxShadow:"0 12px 32px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08)",background:"#fcfcff",zIndex:1e3}},content:C?k():c.jsxs("div",{style:{width:360},children:[c.jsx("div",{style:{padding:12,borderBottom:"1px solid #f0f0f0"},children:c.jsxs(A.Space,{direction:"vertical",style:{width:"100%"},children:[c.jsxs(A.Typography.Text,{strong:!0,style:{fontSize:18},children:["📌 북마크"," ",y(N?.menuId)?"저장됨":"추가"]}),N&&c.jsxs(A.Typography.Text,{type:"secondary",children:["현재 화면: ",c.jsx("b",{children:N.menuNm})," ",c.jsxs("span",{style:{opacity:.7},children:["(",N.menuId,")"]})]})]})}),y(N?.menuId)?c.jsxs("div",{style:{padding:12,margin:8,borderRadius:8,backgroundColor:"#f5f5f5"},children:[c.jsx(A.Typography.Text,{type:"secondary",style:{fontSize:12},children:"저장 위치"}),c.jsx("div",{style:{marginTop:4},children:`📁 > ${z}`||"알 수 없음"})]}):M(),c.jsxs(Nt,{style:{padding:8,borderTop:"1px solid #f0f0f0"},layoutAlign:"right",children:[N&&!y(N.menuId)?c.jsx(A.Button,{style:{height:"28px",padding:"0 10px",margin:"0 4px"},type:"primary",icon:c.jsx(ce.PlusOutlined,{}),onClick:()=>{const D=String(s[0]);let F="-";D&&P[D]&&(F=P[D].type=="M"?P[D].prntBkmkId:D),B(F,N)},children:"추가"}):c.jsxs(Nt,{layoutAlign:"between",children:[c.jsx(A.Button,{style:{height:"28px",padding:"0 10px",margin:"0 4px"},icon:c.jsx(ce.FolderOpenOutlined,{}),onClick:()=>m(!0),children:"폴더 변경"}),c.jsx(A.Button,{style:{height:"28px",padding:"0 10px",margin:"0 4px"},color:"danger",variant:"solid",icon:c.jsx(ce.MinusOutlined,{}),onClick:()=>v(N.menuId),children:"삭제"})]}),c.jsx(A.Button,{type:"text",style:{height:"28px",padding:"0 10px",margin:"0 4px"},icon:c.jsx(ce.SettingOutlined,{}),onClick:()=>{b(t),p(!0)},children:"관리"})]})]}),children:c.jsx("span",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center"},children:e})}),c.jsx(lv,{open:d,onClose:()=>{p(!1),w&&r(!0)}})]})}const uv=({reqRows:e,subRows:t})=>{const{searchBoxRef:r}=dr.useSearchBox();return c.jsx(la,{ref:r,reqRows:e,subRows:t})},dv=({children:e,searchBox:t,title:r,preRenderEvents:n=[],postRenderEvents:o=[],loading:i=!1,error:a=null,grantEvent:s={},customEvent:l={},buttons:u})=>{dr.useServiceCodeValue("AUTH_BTNS");const{user:f}=gt.useUserStore(),{activeMenuItem:d}=gt.useMenuViewStore(),{loadFavoritesIfNeeded:p,isMenuBookmarked:w}=gt.useFavoriteStore(),{loading:b}=gt.useLoadingStore(),[C,m]=g.useState({isInitialized:!1,isReady:!1,error:null,loading:!0,preRenderComplete:!1,postRenderComplete:!1}),{openCorePopup:$}=dr.usePopup(),S=async()=>{if(n.length===0){m(I=>({...I,preRenderComplete:!0}));return}try{for(const I of n)await I();m(I=>({...I,preRenderComplete:!0}))}catch(I){m(T=>({...T,error:I instanceof Error?I.message:"사전 렌더링 실패",preRenderComplete:!0}))}},P=async()=>{if(o.length===0){m(I=>({...I,postRenderComplete:!0}));return}try{for(const I of o)await I();m(I=>({...I,postRenderComplete:!0}))}catch(I){m(T=>({...T,error:I instanceof Error?I.message:"사후 렌더링 실패",postRenderComplete:!0}))}};g.useEffect(()=>{if(C.isInitialized)return;(async()=>{try{await S(),m(T=>({...T,isInitialized:!0,loading:!1}))}catch(T){console.error("BwgView 초기화 실패:",T),m(N=>({...N,isInitialized:!0,loading:!1}))}})()},[]),g.useEffect(()=>{f?.userId&&p(f.userId)},[p,f?.userId]),g.useEffect(()=>{C.isInitialized&&C.preRenderComplete&&!C.isReady&&setTimeout(async()=>{await P(),m(T=>({...T,isReady:!0}))},100)},[C.isInitialized,C.preRenderComplete,C.isReady]),g.useEffect(()=>{a&&m(I=>({...I,error:a}))},[a]);const _=()=>c.jsxs("div",{className:"bwgview-header-container",children:[c.jsxs("div",{className:"bwgview-header",children:[c.jsx("div",{className:"bwgview-header-left",children:L.LEFT}),c.jsx("div",{className:"bwgview-header-right",children:L.RIGHT})]}),t&&c.jsx(uv,{reqRows:t.reqRows,subRows:t.subRows})]});if(g.useEffect(()=>{},[f,d]),C.error||a)return c.jsx("div",{style:{padding:"24px"},children:c.jsx(A.Alert,{message:"오류 발생",description:C.error||a,type:"error",showIcon:!0})});const j=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 20",width:"1em",height:"1em",fill:"none",children:c.jsx("path",{d:"M9.9348 1.4645C10.2382 0.845167 10.7437 0.845167 11.0597 1.4645L13.0694 5.5344C13.3727 6.15374 14.1943 6.74779 14.8768 6.84891L19.3638 7.50616C20.0464 7.60727 20.2107 8.08757 19.7051 8.56787L16.4568 11.7277C15.9638 12.208 15.6478 13.1686 15.7616 13.8512L16.5326 18.3129C16.6464 18.9954 16.2419 19.2988 15.6226 18.9701L11.6159 16.8594C10.9965 16.5307 9.998 16.5307 9.37867 16.8594L5.37196 18.9701C4.75263 19.2988 4.34817 18.9954 4.46192 18.3129L5.23293 13.8512C5.34668 13.1686 5.04334 12.208 4.53776 11.7277L1.28942 8.56787C0.79648 8.08757 0.948154 7.60727 1.63068 7.50616L6.11769 6.84891C6.80022 6.74779 7.62179 6.15374 7.92513 5.5344L9.9348 1.4645Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10"})}),y=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 20",width:"1em",height:"1em",fill:"none",children:c.jsx("path",{d:"M9.9348 1.4645C10.2382 0.845167 10.7437 0.845167 11.0597 1.4645L13.0694 5.5344C13.3727 6.15374 14.1943 6.74779 14.8768 6.84891L19.3638 7.50616C20.0464 7.60727 20.2107 8.08757 19.7051 8.56787L16.4568 11.7277C15.9638 12.208 15.6478 13.1686 15.7616 13.8512L16.5326 18.3129C16.6464 18.9954 16.2419 19.2988 15.6226 18.9701L11.6159 16.8594C10.9965 16.5307 9.998 16.5307 9.37867 16.8594L5.37196 18.9701C4.75263 19.2988 4.34817 18.9954 4.46192 18.3129L5.23293 13.8512C5.34668 13.1686 5.04334 12.208 4.53776 11.7277L1.28942 8.56787C0.79648 8.08757 0.948154 7.60727 1.63068 7.50616L6.11769 6.84891C6.80022 6.74779 7.62178 6.15374 7.92513 5.5344L9.9348 1.4645Z",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",fill:"none"})}),E=I=>c.jsx(ce,{component:j,...I}),O=I=>c.jsx(ce,{component:y,...I}),L={LEFT:c.jsx("div",{className:"bwgview-header-left",children:c.jsxs(A.ConfigProvider,{theme:{components:{Tag:{controlHeight:28,controlHeightLG:28,controlHeightSM:28,controlHeightXS:28}}},children:[c.jsxs(A.Space,{children:[d&&c.jsx(cv,{triggerIcon:w(d.menuId)?c.jsx(E,{className:"bookmark-icon",style:{color:"#faad14"}}):c.jsx(O,{className:"bookmark-icon"})}),c.jsxs(A.Space.Compact,{style:{alignItems:"center"},children:[c.jsx("span",{className:"pageMenuNm",children:(()=>{let I="";return r?.useMenuTitle&&d?I=d.menuNm:r?.text?I=r.text:d&&(I=d.menuPrntId==="CM00"?d.menuNm.substring(d.menuNm.indexOf(" ")+1):d.menuNm),r?.prefix&&(I=`${r.prefix} ${I}`),r?.suffix&&(I=`${I} ${r.suffix}`),I})()}),d?.menuNo&&c.jsx(A.Tag,{className:"page-num-tag",children:d?.menuNo}),c.jsx(A.Tooltip,{title:"도움말",color:"geekblue",children:c.jsx(A.Button,{variant:"text",type:"text",className:"menu-help-btn",icon:c.jsx(ce.QuestionCircleTwoTone,{twoToneColor:"orange"})})}),c.jsx(A.Tooltip,{title:"게시판",color:"geekblue",children:c.jsx(A.Button,{variant:"text",type:"text",onClick:()=>$("CORE_REPORT"),icon:c.jsx(ce.BugFilled,{style:{color:"#1890ff"}})})})]})]}),d?.scrnId&&ot.isLocal&&c.jsx(A.Tag,{style:{marginLeft:8,fontSize:13,fontWeight:500,display:"flex"},children:c.jsx(sv,{copyable:!0,style:{display:"inherit",justifyContent:"center",alignItems:"center",marginBottom:0},children:d?.scrnId})})]})}),RIGHT:c.jsx("div",{className:"bwgview-header-right",children:c.jsx(A.ConfigProvider,{theme:{components:{Space:{padding:8}}},children:c.jsxs(A.Space,{children:[c.jsx(A.Flex,{gap:8,children:c.jsx($i,{checkAuth:d?.menuId?{menuId:d.menuId,grpId:"CUSTOM"}:!1,buttons:u?.custom||[],gap:8})}),c.jsx(A.ConfigProvider,{theme:{components:{Divider:{verticalMarginInline:0}}},children:c.jsx(A.Divider,{type:"vertical"})}),c.jsx(A.Flex,{gap:8,className:"permission-buttons",children:c.jsx($i,{checkAuth:d?.menuId?{menuId:d.menuId,grpId:"DEFAULT"}:!1,buttons:u?.grant||[],gap:8})})]})})})};return c.jsxs("div",{className:"bwg-view main-view",style:{height:"100%",display:"flex",flexDirection:"column"},children:[_(),c.jsxs("div",{className:"bwgview-content",children:[c.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:e}),(C.loading||i||b)&&c.jsx(Hu.LoadingContainer,{text:b?"처리 중...":"화면 로드 중..."})]})]})},fv=({children:e,customTheme:t,customComponentSize:r="middle"})=>{const n={token:{colorPrimary:"#1890ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1890ff",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif',fontSize:14,fontSizeHeading1:38,fontSizeHeading2:30,fontSizeHeading3:24,fontSizeHeading4:20,fontSizeHeading5:16,padding:16,margin:16,borderRadius:6,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",boxShadowSecondary:"0 2px 4px rgba(0, 0, 0, 0.12)"},algorithm:A.theme.defaultAlgorithm},o={...n,...t,token:{...n.token,...t?.token}};return c.jsx(A.ConfigProvider,{locale:El,theme:o,componentSize:r,space:{size:r},form:{validateMessages:{required:"${label}을(를) 입력해주세요.",types:{email:"${label}이(가) 유효한 이메일이 아닙니다.",number:"${label}이(가) 유효한 숫자가 아닙니다."},number:{range:"${label}은(는) ${min} ~ ${max} 사이의 값이어야 합니다."}}},pagination:{showSizeChanger:!0},children:e})},hv="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9289)'%3e%3cpath%20d='M27.3705%2010.9919C28.5405%2010.9919%2029.489%2010.0434%2029.489%208.87338C29.489%207.70337%2028.5405%206.75488%2027.3705%206.75488C26.2004%206.75488%2025.252%207.70337%2025.252%208.87338C25.252%2010.0434%2026.2004%2010.9919%2027.3705%2010.9919Z'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M30.3053%2017.2998V32.3098H24.4248V17.2998'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M27.3701%2032.31V23.3135'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.2305%2022.1925V17.642V15.6945C22.2305%2014.3075%2023.3515%2013.1865%2024.7385%2013.1865H29.9825C31.3695%2013.1865%2032.4905%2014.3075%2032.4905%2015.6945V17.642V22.1925'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.2519%2021.4229H18.6199C19.1044%2021.4229%2019.5034%2021.8219%2019.5034%2022.3064V24.4154H16.3779V22.3064C16.3779%2021.8219%2016.7769%2021.4229%2017.2614%2021.4229H17.2519Z'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M20.8339%2024.4062H15.0294C14.6254%2024.4062%2014.2979%2024.7338%2014.2979%2025.1377V31.6832C14.2979%2032.0872%2014.6254%2032.4147%2015.0294%2032.4147H20.8339C21.2378%2032.4147%2021.5654%2032.0872%2021.5654%2031.6832V25.1377C21.5654%2024.7338%2021.2378%2024.4062%2020.8339%2024.4062Z'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8252%2027.1895V29.631'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.0391%2027.1895V29.631'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.71875%2014.1642H8.53075C9.03425%2014.1642%209.49025%2013.8602%209.68025%2013.4042L10.3263%2011.8652'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.4991%205.54803L12.2266%2011.8655H17.5371L19.8836%205.51953L17.4991%205.54803Z'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.2017%2016.4639H6.57421C5.97571%2016.4639%205.49121%2015.9794%205.49121%2015.3809C5.49121%2013.4334%207.06821%2011.8564%209.01571%2011.8564H20.3492'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.56738%2032.4805H32.2909'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9289'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",pv="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9314)'%3e%3cpath%20d='M15.1807%2019.3994L18.7717%2029.7164'%20stroke='%23FF8CC3'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9033%209.25293L12.6063%2011.2574C12.6063%2011.2574%2010.7443%2014.7724%2013.2618%2022.0209'%20stroke='%23FF8CC4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9033%209.25293L12.6063%2011.2574C12.6063%2011.2574%2016.2448%2012.8534%2018.7718%2020.1019'%20stroke='%23FF8CC4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.8257%2016.71C22.2202%2012.112%2017.1947%209.67999%2012.5967%2011.276C7.99871%2012.8815%205.56671%2017.907%207.16271%2022.505L7.67571%2023.968L7.88471%2023.892C7.93221%2022.7235%208.67321%2021.6405%209.85121%2021.232C11.0292%2020.8235%2012.2737%2021.2035%2013.0432%2022.0965L13.4422%2021.954C13.4897%2020.7855%2014.2307%2019.7025%2015.4087%2019.294C16.5867%2018.8855%2017.8312%2019.2655%2018.6007%2020.1585L18.9997%2020.016C19.0472%2018.8475%2019.7882%2017.7645%2020.9662%2017.356C22.1442%2016.9475%2023.3887%2017.3275%2024.1582%2018.2205L24.3577%2018.154L23.8447%2016.691L23.8257%2016.71Z'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.37%2015.4193C23.636%2015.4858%2023.9115%2015.5238%2024.1965%2015.5238C26.068%2015.5238%2027.5785%2014.0038%2027.5785%2012.1418C27.5785%2010.2798%2026.0585%208.75977%2024.1965%208.75977C22.3345%208.75977%2020.8145%2010.2798%2020.8145%2012.1418'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M24.2061%206.12784V5.00684'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.8641%207.79018L19.1611%207.09668'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M28.5381%2016.4736L29.2411%2017.1766'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M30.21%2012.1318H31.331'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M28.5469%207.79018L29.2404%207.09668'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M29.3355%2029.8213H14.2305'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.2302%2029.8213L10.3447%2025.2803'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.8527%2028.4531L7.76074%2032.9941'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.8447%2029.8213L27.4072%2032.9943'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9314'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gv="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9273)'%3e%3cpath%20d='M25.9254%2020.8996C27.5151%2020.8996%2028.8039%2019.6108%2028.8039%2018.0211C28.8039%2016.4313%2027.5151%2015.1426%2025.9254%2015.1426C24.3356%2015.1426%2023.0469%2016.4313%2023.0469%2018.0211C23.0469%2019.6108%2024.3356%2020.8996%2025.9254%2020.8996Z'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M31.4825%2032.4711V25.9066C31.4825%2024.5671%2030.485%2023.4746%2029.2595%2023.4746H22.6C21.3745%2023.4746%2020.377%2024.5671%2020.377%2025.9066'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M25.2696%2026.7334H14.2686L16.5106%2032.6234H27.5021L25.2696%2026.7334Z'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.5617%2018.8385C6.1462%2017.4135%205.2627%2015.447%205.2627%2013.2715C5.2627%208.91095%208.7967%205.37695%2013.1572%205.37695C17.5177%205.37695%2021.0517%208.91095%2021.0517%2013.2715C21.0517%2015.124%2020.4152%2016.815%2019.3512%2018.164C18.0497%2019.8075%2016.1117%2020.919%2013.9172%2021.128'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.1572%2013.2715L16.0167%2015.5705'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.1572%208.62598V13.2715'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.35963%2016.1973L7.84663%2019.1328L4.91113%2018.6293'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M4.91113%2032.623H33.0881'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9273'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",mv=({children:e})=>{const[t,r]=g.useState({x:0,y:0}),[n,o]=g.useState(!1),[i,a]=g.useState({x:0,y:0}),[s,l]=g.useState(!1),[u,f]=g.useState(!0),d=g.useRef(null),p=[{id:"overtime",title:"시간 외 근무신청",icon:c.jsx("img",{src:gv,alt:"시간외근무신청",className:"quick-overtime"}),color:"#722ed1",onClick:()=>{console.log("시간 외 근무 신청 클릭")}},{id:"business-trip",title:"출장신청",icon:c.jsx("img",{src:hv,alt:"출장신청",className:"quick-business-trip"}),color:"#1890ff",onClick:()=>{console.log("출장 신청 클릭")}},{id:"vacation",title:"휴가신청",icon:c.jsx("img",{src:pv,alt:"휴가신청",className:"quick-holiday"}),color:"#eb2f96",onClick:()=>{console.log("휴가 신청 클릭")}},{id:"document",title:"문서신청",icon:c.jsx(ce.FileTextOutlined,{}),color:"#52c41a",onClick:()=>{console.log("문서 신청 클릭")}},{id:"profile",title:"인사정보",icon:c.jsx(ce.UserOutlined,{}),color:"#fa8c16",onClick:()=>{console.log("인사 정보 클릭")}},{id:"settings",title:"설정",icon:c.jsx(ce.SettingOutlined,{}),color:"#13c2c2",onClick:()=>{console.log("설정 클릭")}}];g.useEffect(()=>{const S=()=>{const P=window.innerHeight,j=Math.max(64,(P-300)/3);r({x:0,y:j});const y=P/2;f(j<y)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const w=S=>{if(S.preventDefault(),S.stopPropagation(),d.current){const P=d.current.getBoundingClientRect();a({x:S.clientX-P.left,y:S.clientY-P.top}),o(!0)}},b=S=>{if(n){const P=S.clientY-i.y,_=window.innerHeight-24,y=Math.max(64,Math.min(_,P));r({x:t.x,y});const E=window.innerHeight/2;f(y<E)}},C=()=>{o(!1)},m=()=>{l(!s)},$=S=>{S.onClick&&S.onClick()};return g.useEffect(()=>{if(n)return document.addEventListener("mousemove",b),document.addEventListener("mouseup",C),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C)}},[n,i]),c.jsxs("div",{className:"quick-tab-container",ref:d,style:{position:"fixed",right:0,top:t.y,zIndex:1e3,userSelect:"none",touchAction:"none"},children:[c.jsxs("div",{className:"quick-tab",style:{position:"absolute",right:"40px",top:u?0:"auto",bottom:u?"auto":0,display:"flex",flexDirection:"column",gap:"15px",border:"1px solid #E0DEEF",borderRadius:"15px",padding:"8px",boxShadow:"0 0 10px rgba(0, 0, 0, 0.3)",minWidth:"88px",maxWidth:"88px",maxHeight:u?`calc(100vh - ${t.y+12}px)`:`${t.y-12}px`,transform:s?"translateX(0)":"translateX(calc(100% + 100px))",transition:"transform 0.3s ease",marginTop:u&&t.y<100?"32px":"0",marginBottom:!u&&t.y>window.innerHeight-100?"8px":"0"},children:[c.jsx("div",{className:"quick-tab-items-wrap",style:{background:"#ffffff",borderRadius:"10px",flex:1,overflowY:"auto",maxHeight:u?`calc(100vh - ${t.y+120}px)`:`${t.y-60}px`,padding:"14px 0"},children:p.map(S=>c.jsx(A.Card,{className:"quick-tab-items",size:"small",style:{border:"none",boxShadow:"none",marginBottom:"15px",cursor:"pointer",transition:"all 0.2s ease"},styles:{body:{padding:"0"}},onClick:()=>$(S),onMouseEnter:P=>{},onMouseLeave:P=>{},children:c.jsxs("div",{className:"quick-tab-item-inner",children:[c.jsx("div",{className:"quick-tab-items-icon",style:{width:"44px",height:"44px",borderRadius:"8PX",fontSize:"24px",color:S.color,marginBottom:"5px"},children:S.icon}),c.jsx("div",{className:"quick-tab-items-title",children:S.title})]})},S.id))}),c.jsx("div",{className:"quick-tab-add-btn",style:{height:"30px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",flexShrink:0,marginBottom:"7px"},onMouseEnter:S=>{},onMouseLeave:S=>{},children:c.jsx(ce.PlusOutlined,{style:{color:"#CDC4FF",fontSize:"15px"}})})]}),c.jsx("div",{className:"quick-tab-drag-btn",style:{cursor:n?"grabbing":"grab",zIndex:1001},onMouseDown:S=>w(S)}),c.jsx(A.Button,{className:`quick-tab-toggle-btn ${s?"expanded":""}`,type:"default",style:{border:"0",backgroundColor:"transparent"},onClick:m})]})},vv=()=>{const{verifyWithToken:e}=dr.useAuth(),t=Ma.useNavigate(),r=Ma.useLocation();return g.useEffect(()=>{const o=new URLSearchParams(r.search).get("token");if(!o){t("/login",{replace:!0});return}(async()=>{const i=await e(o);t(i?"/main":"/login",{replace:!0})})()},[r.search]),c.jsx("div",{style:{display:"grid",placeItems:"center",height:"100dvh"},children:c.jsx(A.Spin,{tip:"인증중..."})})},bv=e=>{if(e==null)return"";const t=String(e).trim();return!t||t.toUpperCase()==="NULL"?"":t.toUpperCase()},ji=(e,t=0)=>{const r=Number(e);return Number.isFinite(r)?r:t};function ln(e){return{crprCd:e.crprCd||void 0,wkplCd:e.wkplCd||void 0,deptCd:bv(e.deptCd),deptNm:(e.deptNm??"").toString().trim(),hrnkDeptCd:e.hrnkDeptCd||null,hrnkDeptNm:e.hrnkDeptNm||null,deptGbCd:e.deptGbCd||null,deptLvl:ji(e.deptLvl,e.hrnkDeptCd?2:1),orgSortOrd:ji(e.orgSortOrd,0),orgOtptOrd:ji(e.orgOtptOrd,0),deptAbrv:e.deptAbrv||null,deptFullNm:e.deptFullNm||null,deptEnglNm:e.deptEnglNm||null,isLeaf:e.isLeaf||null}}function yv(e){const t=new Set,r=e.map(ln).filter(s=>s.deptCd).filter(s=>(s.deptCd===s.hrnkDeptCd&&(s.hrnkDeptCd=""),!0)).filter(s=>t.has(s.deptCd)?!1:(t.add(s.deptCd),!0));r.sort((s,l)=>(s.deptLvl||0)-(l.deptLvl||0)||(s.orgSortOrd||0)-(l.orgSortOrd||0)||s.deptCd.localeCompare(l.deptCd));const n=new Map;for(const s of r)n.set(s.deptCd,{...s,children:[]});const o=[];for(const s of r){const l=n.get(s.deptCd),u=s.hrnkDeptCd;u&&n.has(u)?n.get(u).children.push(l):o.push(l)}const i=s=>{!s||s.length===0||(s.sort((l,u)=>l.deptCd.localeCompare(u.deptCd)),s.forEach(l=>i(l.children)))};i(o);const a=s=>{if(!s.children||s.children.length===0){delete s.children;return}s.children.forEach(a)};if(o.forEach(a),o.length>1){const s=o.find(l=>l.deptCd==="D00");if(s)return[s]}return o}function xv(e){const t=e.map(ln),r=t.filter(n=>n.isLeaf!=="Y").map(n=>n.deptCd);return r.length>200?t.filter(n=>(n.deptLvl||0)<=2).map(n=>n.deptCd):r}const Au=({popup:e,onClose:t})=>{const[r,n]=g.useState(""),[o,i]=g.useState([]),[a,s]=g.useState([]),[l,u]=g.useState([]),[f,d]=g.useState(!1),p=g.useCallback(async y=>{try{d(!0);const E=await ot.callService("SCMUTIL00103",{...e?.popupParams,...y}),O=Array.isArray(E?.data)?E.data:Array.isArray(E?.deptList)?E.deptList:Array.isArray(E)?E:[],L=yv(O);u(L);const I=xv(O);i(I);const T=L[0]?.deptCd||ln(O.find(N=>ln(N).deptLvl===1)||{}).deptCd||ln(O[0]||{}).deptCd||"";s(T?[T]:[])}catch{A.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{d(!1)}},[e?.popupParams]);g.useEffect(()=>{p()},[p]);const w=g.useCallback((y,E)=>{for(const O of y){if(O.deptCd===E)return O;if(O.children){const L=w(O.children,E);if(L)return L}}return null},[]),b=g.useMemo(()=>{const y=a[0];return y?w(l,y):null},[a,l,w]),C=g.useMemo(()=>{const y=O=>O.map(L=>({title:L.deptNm,key:L.deptCd,meta:L,children:L.children?y(L.children):void 0}));return y(l)},[l]),m=g.useMemo(()=>{const y=r.trim().toLowerCase();if(!y)return C;const E=O=>O.map(L=>{const I=L.meta,T=(I?.deptNm||"").toLowerCase().includes(y)||(I?.deptCd||"").toLowerCase().includes(y),N=L.children?E(L.children):void 0;return T||N&&N.length?{...L,children:N}:null}).filter(Boolean);return E(C)},[C,r]),$=g.useCallback(y=>{s(y.slice(0,1).map(String))},[]),S=g.useCallback(y=>i(y.map(String)),[]),P=g.useCallback((y,E)=>{if(y.stopPropagation(),!E.children||E.children.length===0)return;const O=o.includes(E.key);i(L=>O?L.filter(I=>I!==E.key):[...L,E.key])},[o]),_=g.useCallback(()=>s([]),[]),j={confirm:()=>{if(!b){A.message.error("부서를 선택해주세요.");return}const y={deptCd:b.deptCd,deptNm:b.deptNm,hrnkDeptCd:b.hrnkDeptCd,hrnkDeptNm:b.hrnkDeptNm,deptLvl:b.deptLvl,orgSortOrd:b.orgSortOrd},E=e?.config;E?.onSelect?E.onSelect(y):e?.config?.callback&&e.config.callback(JSON.stringify(y)),E?.onClose&&E.onClose(),e?.close?.()},cancel:()=>{const y=e?.config;y?.onCancel&&y.onCancel(),e?.close?.()}};return c.jsx(Sn,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{j.confirm()}}],popupEvent:j,onClose:()=>{e?.close?.(),t?.()},children:c.jsx(Nt,{children:c.jsx(fr,{border:!1,style:{paddingBottom:20},children:c.jsxs(A.Splitter,{layout:"vertical",style:{height:"100%"},children:[c.jsxs(A.Splitter.Panel,{defaultSize:"70%",min:"70%",max:"75%",children:[c.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:c.jsxs(A.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[c.jsx(Vt,{title:"조직도"}),c.jsx(A.Row,{gutter:[16,16],children:c.jsx(A.Col,{span:24,children:c.jsx(A.Input,{placeholder:"부서명, 부서코드 검색",prefix:c.jsx(ce.SearchOutlined,{}),value:r,allowClear:!0,onChange:y=>n(y.target.value)})})})]})}),c.jsx("div",{style:{padding:16,overflowY:"hidden"},children:c.jsx(A.Spin,{spinning:f,children:c.jsx(A.Tree,{treeData:m,expandedKeys:o,selectedKeys:a,onSelect:$,onExpand:S,onDoubleClick:P,showLine:!0,showIcon:!1,selectable:!0,style:{overflow:"hidden"},titleRender:y=>{const E=y.meta;return c.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%",fontWeight:a.includes(y.key)?"bold":"normal"},children:[c.jsx("span",{children:E.deptNm}),c.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:E.deptCd})]})}})})})]}),c.jsx(A.Splitter.Panel,{collapsible:!0,children:c.jsxs("div",{style:{padding:16,overflowY:"hidden",height:"100%"},children:[c.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:16,fontWeight:700},children:"선택된 부서"}),b?c.jsxs("div",{style:{display:"flex",alignItems:"center",padding:14,border:"1px solid #e0e0e0",borderRadius:12,background:"#fafafa"},children:[c.jsx("div",{style:{width:42,height:42,borderRadius:"50%",border:"1px solid #e6e6e6",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:18,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:c.jsx(ce.TeamOutlined,{})}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsxs("div",{style:{fontSize:15,fontWeight:700,marginBottom:4},children:[b.deptNm," ",c.jsxs("span",{style:{color:"#8c8c8c",fontSize:12},children:["(",b.deptCd,")"]})]}),c.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:2},children:["상위부서: ",b.hrnkDeptNm||"-"]})]}),c.jsx(A.Button,{type:"text",onClick:_,icon:c.jsx(ce.RestOutlined,{style:{fontSize:24,color:"#FF6363"}})})]}):c.jsx("div",{style:{color:"#999",fontSize:14},children:"부서를 선택해주세요."})]})})]})})})})},Cv=Object.freeze(Object.defineProperty({__proto__:null,default:Au},Symbol.toStringTag,{value:"Module"})),Sv=e=>{if(e==null)return"";const t=String(e).trim();return!t||t.toUpperCase()==="NULL"?"":t.toUpperCase()},Ri=(e,t=0)=>{const r=Number(e);return Number.isFinite(r)?r:t};function cn(e){return{crprCd:e.crprCd||void 0,wkplCd:e.wkplCd||void 0,deptCd:Sv(e.deptCd),deptNm:(e.deptNm??"").toString().trim(),hrnkDeptCd:e.hrnkDeptCd||null,hrnkDeptNm:e.hrnkDeptNm||null,deptGbCd:e.deptGbCd||null,deptLvl:Ri(e.deptLvl,e.hrnkDeptCd?2:1),orgSortOrd:Ri(e.orgSortOrd,0),orgOtptOrd:Ri(e.orgOtptOrd,0),deptAbrv:e.deptAbrv||null,deptFullNm:e.deptFullNm||null,deptEnglNm:e.deptEnglNm||null,isLeaf:e.isLeaf||null}}function wv(e){const t=new Set,r=e.map(cn).filter(s=>s.deptCd).filter(s=>(s.deptCd===s.hrnkDeptCd&&(s.hrnkDeptCd=""),!0)).filter(s=>t.has(s.deptCd)?!1:(t.add(s.deptCd),!0));r.sort((s,l)=>(s.deptLvl||0)-(l.deptLvl||0)||(s.orgSortOrd||0)-(l.orgSortOrd||0)||s.deptCd.localeCompare(l.deptCd));const n=new Map;for(const s of r)n.set(s.deptCd,{...s,children:[]});const o=[];for(const s of r){const l=n.get(s.deptCd),u=s.hrnkDeptCd;u&&n.has(u)?n.get(u).children.push(l):o.push(l)}const i=s=>{!s||s.length===0||(s.sort((l,u)=>l.deptCd.localeCompare(u.deptCd)),s.forEach(l=>i(l.children)))};i(o);const a=s=>{if(!s.children||s.children.length===0){delete s.children;return}s.children.forEach(a)};if(o.forEach(a),o.length>1){const s=o.find(l=>l.deptCd==="D00");if(s)return[s]}return o}function Ev(e){const t=e.map(cn),r=t.filter(n=>n.isLeaf!=="Y").map(n=>n.deptCd);return r.length>200?t.filter(n=>(n.deptLvl||0)<=2).map(n=>n.deptCd):r}const Mu=({popup:e,onClose:t})=>{const[r,n]=g.useState(""),[o,i]=g.useState(""),[a,s]=g.useState([]),[l,u]=g.useState([]),[f,d]=g.useState([]),[p,w]=g.useState(!1),[b,C]=g.useState([]),[m,$]=g.useState(!1),S=g.useCallback(async v=>{try{$(!0);const x=await ot.callService("SCMUTIL00103",{...e?.popupParams,...v}),k=Array.isArray(x?.data)?x.data:Array.isArray(x?.deptList)?x.deptList:Array.isArray(x)?x:[],M=wv(k);C(M);const D=Ev(k);s(D);const F=M[0]?.deptCd||cn(k.find(U=>cn(U).deptLvl===1)||{}).deptCd||cn(k[0]||{}).deptCd||"";u(F?[F]:[])}catch{A.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{$(!1)}},[e?.popupParams]);g.useEffect(()=>{S()},[S]);const P=g.useCallback((v,x)=>{for(const k of v){if(k.deptCd===x)return k;if(k.children){const M=P(k.children,x);if(M)return M}}return null},[b]),_=g.useMemo(()=>f.map(v=>{const x=P(b,v);if(!x)return null;const{children:k,...M}=x;return M}).filter(Boolean),[f,b,P]),j=g.useMemo(()=>{const v=x=>x.map(k=>({title:k.deptNm,key:k.deptCd,meta:k,children:k.children?v(k.children):void 0,isLeaf:!k.children||k.children.length===0}));return v(b)},[b]),y=g.useMemo(()=>{const v=r.trim().toLowerCase();if(!v)return j;const x=k=>k.map(M=>{const D=M.meta,F=(D?.deptNm||"").toLowerCase().includes(v)||(D?.deptCd||"").toLowerCase().includes(v),U=M.children?x(M.children):void 0;return F||U&&U.length>0?{...M,children:U}:null}).filter(Boolean);return x(j)},[j,r]),E=g.useCallback(v=>{const x=[],k=M=>{for(const D of M)if(D.deptCd===v&&D.children){const F=U=>{for(const V of U)x.push(V.deptCd),V.children&&F(V.children)};F(D.children)}else D.children&&k(D.children)};return k(b),x},[b]),O=g.useCallback((v,x)=>{let k=Array.isArray(v)?v:v?.checked??[];if(p&&x?.node?.key){const M=x.node.key,D=E(M);if(x.checked){const F=new Set(k);for(const U of D)F.add(U);k=Array.from(F)}else{const F=new Set([M,...D]);k=k.filter(U=>!F.has(U))}}d(k)},[p,E]),L=g.useCallback(v=>{const x=v.map(String);if(u(x),x.length>0){const k=x[0],M=(F,U)=>{for(const V of F){if(V.deptCd===U)return V.deptNm;if(V.children){const Z=M(V.children,U);if(Z)return Z}}return null},D=M(b,k);D&&i(D)}},[b]),I=g.useCallback(v=>s(v.map(String)),[]),T=g.useCallback((v,x)=>{if(v.stopPropagation(),x.children&&x.children.length>0){const k=a.includes(x.key);s(M=>k?M.filter(D=>D!==x.key):[...M,x.key])}},[a]),N=g.useCallback(v=>{d(x=>x.filter(k=>k!==v))},[]),z=g.useCallback(()=>{d([])},[]),B={confirm:()=>{if(f.length===0){A.message.error("부서를 선택해주세요.");return}const x=Array.from(new Set(f)).map(M=>{const D=P(b,M);return D?{deptCd:D.deptCd,deptNm:D.deptNm,hrnkDeptCd:D.hrnkDeptCd,hrnkDeptNm:D.hrnkDeptNm}:null}).filter(Boolean),k=e?.config;k?.onSelect?k.onSelect(x):e?.config?.callback&&e.config.callback(JSON.stringify(x)),k?.onClose&&k.onClose(),e?.close?.()},cancel:()=>{const v=e?.config;v?.onCancel&&v.onCancel(),e?.close?.()}};return c.jsx(Sn,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{B.confirm()}}],popupEvent:B,onClose:()=>{e?.close?.(),t?.()},children:c.jsx(Nt,{children:c.jsx(fr,{border:!1,style:{paddingBottom:20},children:c.jsxs(A.Splitter,{layout:"vertical",style:{height:"100%"},children:[c.jsxs(A.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[c.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:c.jsxs(A.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[c.jsx(Vt,{title:"조직도"}),c.jsx("div",{style:{fontSize:14,color:"#666",padding:8,backgroundColor:"#f8f8f8",borderRadius:4},children:o}),c.jsxs(A.Row,{gutter:[16,16],children:[c.jsx(A.Col,{span:18,children:c.jsx(A.Input,{placeholder:"부서명, 부서장명, 부서코드 검색",prefix:c.jsx(ce.SearchOutlined,{}),value:r,allowClear:!0,onChange:v=>n(v.target.value)})}),c.jsx(A.Col,{span:6,style:{justifyContent:"center",display:"flex",alignItems:"center"},children:c.jsx(A.Checkbox,{checked:p,onChange:v=>w(v.target.checked),children:"하위까지 선택"})})]})]})}),c.jsx("div",{style:{padding:16,overflowY:"hidden"},children:c.jsx(A.Spin,{spinning:m,children:c.jsx(A.Tree,{className:"bwg-ogrn-tree",treeData:y,expandedKeys:a,selectedKeys:l,checkedKeys:f,checkable:!0,checkStrictly:!0,showLine:!0,showIcon:!1,selectable:!0,onSelect:L,onExpand:I,onCheck:O,onDoubleClick:T,style:{overflow:"hidden"},titleRender:v=>{const x=v.meta;return c.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%"},children:[c.jsx("span",{style:{fontWeight:l.includes(v.key)?"bold":"normal"},children:x.deptNm}),c.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:x.deptCd})]})}})})})]}),c.jsx(A.Splitter.Panel,{collapsible:!0,children:c.jsxs("div",{style:{padding:16,overflowY:"hidden"},children:[c.jsxs("div",{style:{marginBottom:12,display:"flex",alignItems:"center",gap:8},children:[c.jsxs("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:["선택된 부서 (",_.length,"개)"]}),_.length>0&&c.jsx("button",{onClick:z,style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",fontSize:12,padding:4},title:"전체 해제",children:"전체 해제"})]}),c.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"flex-start",minHeight:48},children:_.length===0?c.jsx("div",{style:{color:"#999",fontSize:14},children:"선택된 부서가 없습니다."}):_.map(v=>c.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:999,border:"1px solid #e6e6e6",background:"#fafafa",lineHeight:1.1,cursor:"default",maxWidth:260},title:`${v.deptNm}`,children:[c.jsx("span",{style:{width:18,height:18,borderRadius:"50%",border:"1px solid #e6e6e6",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:c.jsx(ce.TeamOutlined,{})}),c.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:2,overflow:"hidden"},children:[c.jsx("span",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:v.deptNm}),c.jsx("span",{style:{fontSize:11,color:"#8c8c8c",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:v.deptCd})]}),c.jsx("button",{onClick:()=>N(v.deptCd),style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",padding:2,lineHeight:0},"aria-label":`${v.deptNm} 선택 해제`,title:"선택 해제",children:"×"})]},v.deptCd))})]})})]})})})})},jv=Object.freeze(Object.defineProperty({__proto__:null,default:Mu},Symbol.toStringTag,{value:"Module"})),Iu=({popup:e,onClose:t})=>{const[r,n]=g.useState(""),[o,i]=g.useState(""),[a,s]=g.useState([]),[l,u]=g.useState([]),[f,d]=g.useState(null),[p,w]=g.useState([]),[b,C]=g.useState(!1),m=g.useCallback(async()=>{try{C(!0);const T=await ot.callService("SCMUTIL00105",{...e?.popupParams});console.log("📊 조직도 API 응답:",T);const N=Array.isArray(T?.data)?T.data:Array.isArray(T?.orgnList)?T.orgnList:Array.isArray(T)?T:[];if(N.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const z=$(N);console.log("🌳 구성된 조직도 트리:",z),w(z);const B=N.filter(v=>v.deptLvl<=2).map(v=>v.deptCd);if(s(B),z.length>0){const v=z[0];u([v.deptCd]),i(v.deptNm)}console.log("✅ 조직도 데이터 로딩 완료")}catch(T){console.error("❌ 조직도 데이터 로딩 실패:",T),A.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{C(!1)}},[e?.popupParams]),$=g.useCallback(T=>{const N=[...T].sort((x,k)=>x.deptLvl-k.deptLvl||x.orgSortOrd-k.orgSortOrd||x.deptCd.localeCompare(k.deptCd)),z=new Map;for(const x of N)z.set(x.deptCd,{...x,children:[]});const B=[];for(const x of N){const k=z.get(x.deptCd),M=x.hrnkDeptCd;M&&z.has(M)?z.get(M).children.push(k):B.push(k)}const v=x=>{if(!x.children||x.children.length===0){delete x.children;return}x.children.forEach(v)};return B.forEach(v),B},[]);g.useEffect(()=>{m()},[m]);const S=g.useMemo(()=>{const T=B=>{let v=[];return B.forEach(x=>{x.employees&&(v=v.concat(x.employees)),x.children&&(v=v.concat(T(x.children)))}),v},N=T(p),z=N.filter((B,v,x)=>v===x.findIndex(k=>k.empNo===B.empNo));return console.log(`👥 전체 사원 수: ${N.length}, 중복 제거 후: ${z.length}`),z},[p]),P=g.useMemo(()=>{const T=N=>N.map(z=>({title:z.deptNm,key:z.deptCd,children:z.children?T(z.children):void 0,isLeaf:!z.children||z.children.length===0}));return T(p)},[p]),_=g.useMemo(()=>{if(!r.trim())return P;const T=N=>N.map(z=>{const B=z.title.toLowerCase().includes(r.toLowerCase()),v=z.children?T(z.children):void 0;return B||v&&v.length>0?{...z,children:v}:null}).filter(Boolean);return T(P)},[P,r]),j=g.useMemo(()=>{if(!r.trim()){const T=x=>{let k=[];return x.forEach(M=>{M.employees&&(k=k.concat(M.employees)),M.children&&(k=k.concat(T(M.children)))}),k},N=(x,k)=>{for(const M of x){if(M.deptCd===k){let D=[...M.employees||[]];return M.children&&(D=D.concat(T(M.children))),D}if(M.children){const D=N(M.children,k);if(D.length>0)return D}}return[]},z=l[0];if(!z)return[];const B=N(p,z),v=B.filter((x,k,M)=>k===M.findIndex(D=>D.empNo===x.empNo));return console.log(`🔍 선택된 부서: ${z}, 반환된 사원 수: ${B.length}, 중복 제거 후: ${v.length}`),v}return S.filter(T=>T.empNm.toLowerCase().includes(r.toLowerCase())||T.empNo.toLowerCase().includes(r.toLowerCase())||T.deptNm.toLowerCase().includes(r.toLowerCase())||T.jbpsCd.includes(r)||T.jbgdCd.includes(r)||T.emplyStCd.includes(r))},[r,l,S,p]),y=g.useCallback(T=>{d(T)},[]),E=g.useCallback(T=>{const N=T.map(String);if(console.log(`🌳 트리 선택: ${N.join(", ")}`),u(N),N.length>0){const z=N[0],B=(x,k)=>{for(const M of x){if(M.deptCd===k)return M.deptNm;if(M.children){const D=B(M.children,k);if(D)return D}}return null},v=B(p,z);v&&i(v)}},[p]),O=g.useCallback(T=>{s(T.map(String))},[]),L=g.useCallback((T,N)=>{if(T.stopPropagation(),N.children&&N.children.length>0){const z=a.includes(N.key);s(z?B=>B.filter(v=>v!==N.key):B=>[...B,N.key])}},[a]),I={confirm:()=>{if(f){const T=e?.config;T?.onSelect?T.onSelect(f):e?.popupParams?.onSelect?e.popupParams.onSelect(f):e?.config?.callback&&e.config.callback(JSON.stringify(f,null,2)),T?.onClose&&T.onClose(),e?.close?.()}else A.message.error("사원을 선택해주세요.")},cancel:()=>{const T=e?.config;T?.onCancel&&T.onCancel(),e?.close?.()}};return c.jsx(Sn,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{I.confirm()}}],popupEvent:I,onClose:()=>{e?.close?.(),t?.()},children:c.jsx(Nt,{children:c.jsx(fr,{border:!1,style:{paddingBottom:20},children:c.jsxs(A.Splitter,{layout:"vertical",style:{height:"100%"},children:[c.jsxs(A.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[c.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:c.jsxs(A.Flex,{gap:8,vertical:!0,style:{marginBottom:"6px"},children:[c.jsx(Vt,{title:"조직도"}),c.jsx(A.Input,{placeholder:"이름, 소속, 전화번호 검색",prefix:c.jsx(ce.SearchOutlined,{}),value:r,allowClear:!0,onChange:T=>n(T.target.value)})]})}),c.jsx("div",{style:{padding:"16px",overflowY:"hidden"},children:c.jsx(A.Spin,{spinning:b,children:c.jsx(A.Tree,{className:"bwg-ogrn-tree",treeData:_,expandedKeys:a,selectedKeys:l,onSelect:E,onExpand:O,onDoubleClick:L,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:T=>c.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontWeight:l.includes(T.key)?"bold":"normal",display:"inline-block",width:"100%"},children:T.title})})})})]}),c.jsx(A.Splitter.Panel,{collapsible:!0,children:c.jsxs("div",{style:{padding:"16px",overflowY:"hidden"},children:[c.jsx("div",{style:{marginBottom:"16px"},children:c.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"bold"},children:r?"검색 결과":o})}),c.jsxs("div",{style:{overflow:"hidden",height:"100%"},children:[j.map(T=>c.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px",border:"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"8px",cursor:"pointer",backgroundColor:f&&f.crprCd===T.crprCd&&f.wkplCd===T.wkplCd&&f.empNo===T.empNo&&f.jbpsCd===T.jbpsCd&&f.jbgdCd===T.jbgdCd&&f.empMarkOrd===T.empMarkOrd?"#efebff":"white"},onClick:()=>y(T),children:[c.jsx("div",{style:{marginRight:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px"},onClick:N=>{N.stopPropagation(),d(T)},children:f&&f.crprCd===T.crprCd&&f.wkplCd===T.wkplCd&&f.empNo===T.empNo&&f.jbpsCd===T.jbpsCd&&f.jbgdCd===T.jbgdCd&&f.empMarkOrd===T.empMarkOrd?c.jsx(ce.CheckCircleFilled,{style:{fontSize:"20px",color:"#6449fc"}}):c.jsx(ce.CheckCircleOutlined,{style:{fontSize:"20px",color:"#d9d9d9"}})}),c.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",fontSize:"18px",color:"#666"},children:c.jsx(ce.UserOutlined,{})}),c.jsxs("div",{style:{flex:1},children:[c.jsxs("div",{style:{fontSize:"14px",fontWeight:"bold",marginBottom:"4px"},children:[T.empNm,c.jsxs("span",{style:{fontSize:"12px",fontWeight:"normal",color:"#666",marginLeft:"8px"},children:["(",T.empNo,")"]})]}),c.jsxs("div",{style:{fontSize:"12px",color:"#666",marginBottom:"2px"},children:[T.deptNm," (",T.deptCd,") | 직급:"," ",T.jbpsCd," | 등급: ",T.jbgdCd]})]})]},`emp-${T.crprCd}-${T.wkplCd}-${T.empNo}-${T.jbpsCd}-${T.jbgdCd}-${T.empMarkOrd}`)),j.length===0&&c.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#999",fontSize:"14px"},children:r?"검색 결과가 없습니다.":"해당 부서에 직원이 없습니다."})]})]})})]})})})})},Rv=Object.freeze(Object.defineProperty({__proto__:null,default:Iu},Symbol.toStringTag,{value:"Module"})),Du=({popup:e,onClose:t})=>{const[r,n]=g.useState(""),[o,i]=g.useState(""),[a,s]=g.useState([]),[l,u]=g.useState([]),[f,d]=g.useState([]),[p,w]=g.useState(!1),[b,C]=g.useState({}),m=g.useCallback(async()=>{try{w(!0);const v=await ot.callService("SCMUTIL00105",{...e?.popupParams});console.log("📊 조직도 API 응답:",v);const x=Array.isArray(v?.data)?v.data:Array.isArray(v?.orgnList)?v.orgnList:Array.isArray(v)?v:[];if(x.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const k=$(x);console.log("🌳 구성된 조직도 트리:",k),d(k);const M=x.filter(D=>D.deptLvl<=2).map(D=>D.deptCd);if(s(M),k.length>0){const D=k[0];u([D.deptCd]),i(D.deptNm)}console.log("✅ 조직도 데이터 로딩 완료")}catch(v){console.error("❌ 조직도 데이터 로딩 실패:",v),A.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{w(!1)}},[e?.popupParams]),$=g.useCallback(v=>{const x=[...v].sort((F,U)=>F.deptLvl-U.deptLvl||F.orgSortOrd-U.orgSortOrd||F.deptCd.localeCompare(U.deptCd)),k=new Map;for(const F of x)k.set(F.deptCd,{...F,children:[]});const M=[];for(const F of x){const U=k.get(F.deptCd),V=F.hrnkDeptCd;V&&k.has(V)?k.get(V).children.push(U):M.push(U)}const D=F=>{if(!F.children||F.children.length===0){delete F.children;return}F.children.forEach(D)};return M.forEach(D),M},[]);g.useEffect(()=>{m()},[m]);const S=g.useMemo(()=>{const v=M=>{let D=[];return M.forEach(F=>{F.employees&&(D=D.concat(F.employees)),F.children&&(D=D.concat(v(F.children)))}),D},x=v(f),k=x.filter((M,D,F)=>D===F.findIndex(U=>U.empNo===M.empNo));return console.log(`👥 전체 사원 수: ${x.length}, 중복 제거 후: ${k.length}`),k},[f]),P=g.useMemo(()=>{const v=x=>x.map(k=>({title:k.deptNm,key:k.deptCd,children:k.children?v(k.children):void 0,isLeaf:!k.children||k.children.length===0}));return v(f)},[f]),_=g.useMemo(()=>{if(!r.trim())return P;const v=x=>x.map(k=>{const M=k.title.toLowerCase().includes(r.toLowerCase()),D=k.children?v(k.children):void 0;return M||D&&D.length>0?{...k,children:D}:null}).filter(Boolean);return v(P)},[P,r]),j=g.useMemo(()=>{if(!r.trim()){const v=F=>{let U=[];return F.forEach(V=>{V.employees&&(U=U.concat(V.employees)),V.children&&(U=U.concat(v(V.children)))}),U},x=(F,U)=>{for(const V of F){if(V.deptCd===U){let Z=[...V.employees||[]];return V.children&&(Z=Z.concat(v(V.children))),Z}if(V.children){const Z=x(V.children,U);if(Z.length>0)return Z}}return[]},k=l[0];if(!k)return[];const M=x(f,k),D=M.filter((F,U,V)=>U===V.findIndex(Z=>Z.empNo===F.empNo));return console.log(`🔍 선택된 부서: ${k}, 반환된 사원 수: ${M.length}, 중복 제거 후: ${D.length}`),D}return S.filter(v=>v.empNm.toLowerCase().includes(r.toLowerCase())||v.empNo.toLowerCase().includes(r.toLowerCase())||v.deptNm.toLowerCase().includes(r.toLowerCase())||v.jbpsCd.includes(r)||v.jbgdCd.includes(r)||v.emplyStCd.includes(r))},[r,l,S,f]),y=g.useCallback(v=>{C(x=>{const k={...x};return k[v.empNo]?delete k[v.empNo]:k[v.empNo]=v,k})},[]),E=g.useCallback(v=>{C(x=>{const k={...x};return delete k[v],k})},[]),O=g.useCallback(()=>C({}),[]),L=g.useCallback(()=>{C(v=>{const x={...v};for(const k of j)x[k.empNo]=k;return x})},[j]),I=g.useCallback(()=>{C(v=>{const x={...v};for(const k of j)delete x[k.empNo];return x})},[j]),T=g.useCallback(v=>{const x=v.map(String);if(console.log(`🌳 트리 선택: ${x.join(", ")}`),u(x),x.length>0){const k=x[0],M=(F,U)=>{for(const V of F){if(V.deptCd===U)return V.deptNm;if(V.children){const Z=M(V.children,U);if(Z)return Z}}return null},D=M(f,k);D&&i(D)}},[f]),N=g.useCallback(v=>{s(v.map(String))},[]),z=g.useCallback((v,x)=>{if(v.stopPropagation(),!x.children||!x.children.length)return;const k=a.includes(x.key);s(M=>k?M.filter(D=>D!==x.key):[...M,x.key])},[a]),B={confirm:()=>{const v=Object.values(b).map(k=>({crprCd:k.crprCd,wkplCd:k.wkplCd,empNo:k.empNo,deptCd:k.deptCd,deptNm:k.deptNm,empNm:k.empNm,jbpsCd:k.jbpsCd,jbgdCd:k.jbgdCd,empMarkOrd:k.empMarkOrd,emplyStCd:k.emplyStCd}));if(v.length===0){A.message.error("직원을 선택해주세요.");return}const x=e?.config;x?.onSelect?x.onSelect(v):e?.config?.callback&&e.config.callback(JSON.stringify(v)),x?.onClose&&x.onClose(),e?.close?.()},cancel:()=>{const v=e?.config;v?.onCancel&&v.onCancel(),e?.close?.()}};return c.jsx(Sn,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{B.confirm()}}],popupEvent:B,onClose:()=>{e?.close?.(),t?.()},children:c.jsx(Nt,{children:c.jsx(fr,{border:!1,style:{paddingBottom:20},children:c.jsxs(A.Splitter,{style:{height:"100%"},children:[c.jsx(A.Splitter.Panel,{defaultSize:"50%",min:"50%",max:"70%",children:c.jsxs(A.Splitter,{layout:"vertical",style:{height:"100%"},children:[c.jsxs(A.Splitter.Panel,{defaultSize:"60%",min:"35%",max:"75%",children:[c.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:c.jsxs(A.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[c.jsx(Vt,{title:"조직도"}),c.jsx(A.Input,{placeholder:"이름, 소속, 직급/직위, 사번 검색",prefix:c.jsx(ce.SearchOutlined,{}),value:r,allowClear:!0,onChange:v=>n(v.target.value)})]})}),c.jsx("div",{style:{padding:16,overflowY:"hidden"},children:c.jsx(A.Spin,{spinning:p,children:c.jsx(A.Tree,{className:"bwg-ogrn-tree",treeData:_,expandedKeys:a,selectedKeys:l,onSelect:T,onExpand:N,onDoubleClick:z,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:v=>c.jsx("span",{style:{padding:"4px 8px",borderRadius:4,fontWeight:l.includes(v.key)?"bold":"normal",display:"inline-block",width:"100%"},children:v.title})})})})]}),c.jsx(A.Splitter.Panel,{children:c.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:r?"검색 결과":`${o} 사용자`}),c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsx(A.Button,{size:"small",onClick:L,children:"현재 목록 전체 선택"}),c.jsx(A.Button,{size:"small",onClick:I,children:"현재 목록 전체 해제"})]})]}),c.jsx(A.Divider,{style:{margin:"8px 0"}}),c.jsxs("div",{style:{overflowY:"auto"},children:[j.map(v=>{const x=!!b[v.empNo];return c.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,cursor:"pointer",background:x?"#efebff":"#fff"},onClick:()=>y(v),children:[c.jsx("div",{style:{marginRight:12,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center"},onClick:k=>{k.stopPropagation(),y(v)},children:x?c.jsx(ce.CheckCircleFilled,{style:{fontSize:20,color:"#6449fc"}}):c.jsx(ce.CheckCircleOutlined,{style:{fontSize:20,color:"#d9d9d9"}})}),c.jsx("div",{style:{width:36,height:36,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:16,color:"#666",flex:"0 0 auto"},children:c.jsx(ce.UserOutlined,{})}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsxs("div",{style:{fontSize:14,fontWeight:600,marginBottom:2},children:[v.empNm,c.jsxs("span",{style:{fontSize:12,fontWeight:"normal",color:"#666",marginLeft:"8px"},children:["(",v.empNo,")"]})]}),c.jsxs("div",{style:{fontSize:12,color:"#666"},children:[v.deptNm," (",v.deptCd,") | 직급: ",v.jbpsCd," ","| 등급: ",v.jbgdCd]})]})]},`emp-${v.crprCd}-${v.wkplCd}-${v.empNo}-${v.jbpsCd}-${v.jbgdCd}-${v.empMarkOrd}`)}),j.length===0&&c.jsx("div",{style:{textAlign:"center",padding:32,color:"#999",fontSize:14},children:r?"검색 결과가 없습니다.":"해당 부서에 사용자 없음"})]})]})})]})}),c.jsx(A.Splitter.Panel,{collapsible:!0,children:c.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(Vt,{title:`선택된 사용자 (${Object.keys(b).length})`}),c.jsx(A.Button,{type:"link",size:"small",onClick:O,children:"전체 해제"})]}),c.jsx(A.Divider,{style:{margin:"8px 0"}}),c.jsxs("div",{style:{overflowY:"auto",flex:1},children:[Object.values(b).map(v=>c.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,background:"#fafafa"},children:[c.jsx("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:10,color:"#666"},children:c.jsx(ce.UserOutlined,{})}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsxs("div",{style:{fontSize:13,fontWeight:600,marginBottom:2},children:[v.empNm,c.jsxs("span",{style:{fontSize:11,fontWeight:"normal",color:"#666",marginLeft:"6px"},children:["(",v.empNo,")"]})]}),c.jsxs("div",{style:{fontSize:12,color:"#666"},children:[v.deptNm," (",v.deptCd,") | 직급: ",v.jbpsCd," | 등급: ",v.jbgdCd]})]}),c.jsx(A.Button,{type:"text",shape:"circle",icon:c.jsx(ce.CloseOutlined,{}),onClick:()=>E(v.empNo)})]},`selected-${v.crprCd}-${v.wkplCd}-${v.empNo}-${v.jbpsCd}-${v.jbgdCd}-${v.empMarkOrd}`)),Object.keys(b).length===0&&c.jsx("div",{style:{color:"#999",fontSize:14,textAlign:"center",padding:24},children:"선택된 사용자가 없습니다."})]})]})})]})})})})},$v=Object.freeze(Object.defineProperty({__proto__:null,default:Du},Symbol.toStringTag,{value:"Module"}));exports.ButtonAccessController=$i;exports.BwgButtonGroup=Wu;exports.BwgCmptArea=Ku;exports.BwgCol=qu;exports.BwgConfigProvider=jl;exports.BwgDetail=od;exports.BwgDrawer=id;exports.BwgEditor=cd;exports.BwgGrid=bd;exports.BwgInfoArea=xd;exports.BwgPagination=ca;exports.BwgPopup=Sn;exports.BwgRow=Sd;exports.BwgSpace=wd;exports.BwgTable=Ed;exports.BwgTabs=jd;exports.BwgTitleBox=Vt;exports.BwgView=dv;exports.ContentBox=fr;exports.ContentLayOut=Nt;exports.GlobalConfigProvider=fv;exports.QuickServiceToggle=mv;exports.SSOHandler=vv;exports.SearchBox=la;exports.SearchDepartmentP01=Au;exports.SearchDepartmentP01$1=Cv;exports.SearchDepartmentP02=Mu;exports.SearchDepartmentP02$1=jv;exports.SearchOrganizationP01=Iu;exports.SearchOrganizationP01$1=Rv;exports.SearchOrganizationP02=Du;exports.SearchOrganizationP02$1=$v;exports.commonjsGlobal=Fu;exports.createBwgGridRenderer=yd;exports.getAugmentedNamespace=Vu;exports.getDefaultExportFromCjs=xo;
|
|
183
|
+
`]:Object.assign(Object.assign({},Nc(e)),{marginInlineStart:e.marginXXS})}),_0(e)),P0(e)),N0()),{"&-rtl":{direction:"rtl"}})}},M0=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),Ru=kn("Typography",A0,M0),I0=e=>{const{prefixCls:t,"aria-label":r,className:n,style:o,direction:i,maxLength:a,autoSize:s=!0,value:l,onSave:u,onCancel:f,onEnd:d,component:p,enterIcon:w=h.createElement(uu,null)}=e,b=h.useRef(null),C=h.useRef(!1),m=h.useRef(null),[$,S]=h.useState(l);h.useEffect(()=>{S(l)},[l]),h.useEffect(()=>{var B;if(!((B=b.current)===null||B===void 0)&&B.resizableTextArea){const{textArea:v}=b.current.resizableTextArea;v.focus();const{length:x}=v.value;v.setSelectionRange(x,x)}},[]);const P=({target:B})=>{S(B.value.replace(/[\n\r]/g,""))},_=()=>{C.current=!0},j=()=>{C.current=!1},y=({keyCode:B})=>{C.current||(m.current=B)},E=()=>{u($.trim())},O=({keyCode:B,ctrlKey:v,altKey:x,metaKey:k,shiftKey:M})=>{m.current!==B||C.current||v||x||k||M||(B===al.ENTER?(E(),d?.()):B===al.ESC&&f())},L=()=>{E()},[I,T,N]=Ru(t),z=pe(t,`${t}-edit-content`,{[`${t}-rtl`]:i==="rtl",[`${t}-${p}`]:!!p},n,T,N);return I(h.createElement("div",{className:z,style:o},h.createElement(R0,{ref:b,maxLength:a,value:$,onChange:P,onKeyDown:y,onKeyUp:O,onCompositionStart:_,onCompositionEnd:j,onBlur:L,"aria-label":r,rows:1,autoSize:s}),w!==null?su(w,{className:`${t}-edit-content-confirm`}):null))};var vi,hl;function D0(){return hl||(hl=1,vi=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),vi}var bi,pl;function z0(){if(pl)return bi;pl=1;var e=D0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,a)}function o(i,a){var s,l,u,f,d,p,w=!1;a||(a={}),s=a.debug||!1;try{u=e(),f=document.createRange(),d=document.getSelection(),p=document.createElement("span"),p.textContent=i,p.ariaHidden="true",p.style.all="unset",p.style.position="fixed",p.style.top=0,p.style.clip="rect(0, 0, 0, 0)",p.style.whiteSpace="pre",p.style.webkitUserSelect="text",p.style.MozUserSelect="text",p.style.msUserSelect="text",p.style.userSelect="text",p.addEventListener("copy",function(C){if(C.stopPropagation(),a.format)if(C.preventDefault(),typeof C.clipboardData>"u"){s&&console.warn("unable to use e.clipboardData"),s&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var m=t[a.format]||t.default;window.clipboardData.setData(m,i)}else C.clipboardData.clearData(),C.clipboardData.setData(a.format,i);a.onCopy&&(C.preventDefault(),a.onCopy(C.clipboardData))}),document.body.appendChild(p),f.selectNodeContents(p),d.addRange(f);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");w=!0}catch(C){s&&console.error("unable to copy using execCommand: ",C),s&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(a.format||"text",i),a.onCopy&&a.onCopy(window.clipboardData),w=!0}catch(m){s&&console.error("unable to copy using clipboardData: ",m),s&&console.error("falling back to prompt"),l=n("message"in a?a.message:r),window.prompt(l,i)}}finally{d&&(typeof d.removeRange=="function"?d.removeRange(f):d.removeAllRanges()),p&&document.body.removeChild(p),u()}return w}return bi=o,bi}var L0=z0();const B0=xo(L0),H0=(e,t=!1)=>t&&e==null?[]:Array.isArray(e)?e:[e];var F0=exports&&exports.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(f){try{u(n.next(f))}catch(d){a(d)}}function l(f){try{u(n.throw(f))}catch(d){a(d)}}function u(f){f.done?i(f.value):o(f.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const V0=({copyConfig:e,children:t})=>{const[r,n]=h.useState(!1),[o,i]=h.useState(!1),a=h.useRef(null),s=()=>{a.current&&clearTimeout(a.current)},l={};e.format&&(l.format=e.format),h.useEffect(()=>s,[]);const u=ut(f=>F0(void 0,void 0,void 0,function*(){var d;f?.preventDefault(),f?.stopPropagation(),i(!0);try{const p=typeof e.text=="function"?yield e.text():e.text;B0(p||H0(t,!0).join("")||"",l),i(!1),n(!0),s(),a.current=setTimeout(()=>{n(!1)},3e3),(d=e.onCopy)===null||d===void 0||d.call(e,f)}catch(p){throw i(!1),p}}));return{copied:r,copyLoading:o,onClick:u}};function yi(e,t){return h.useMemo(()=>{const r=!!e;return[r,Object.assign(Object.assign({},t),r&&typeof e=="object"?e:null)]},[e])}const W0=e=>{const t=g.useRef(void 0);return g.useEffect(()=>{t.current=e}),t.current},K0=(e,t,r)=>g.useMemo(()=>e===!0?{title:t??r}:g.isValidElement(e)?{title:e}:typeof e=="object"?Object.assign({title:t??r},e):{title:e},[e,t,r]);var q0=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};const $u=h.forwardRef((e,t)=>{const{prefixCls:r,component:n="article",className:o,rootClassName:i,setContentRef:a,children:s,direction:l,style:u}=e,f=q0(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:d,direction:p,className:w,style:b}=$o("typography"),C=l??p,m=a?wn(t,a):t,$=d("typography",r);process.env.NODE_ENV!=="production"&&At("Typography").deprecated(!a,"setContentRef","ref");const[S,P,_]=Ru($),j=pe($,w,{[`${$}-rtl`]:C==="rtl"},o,i,P,_),y=Object.assign(Object.assign({},b),u);return S(h.createElement(n,Object.assign({className:j,style:y,ref:m},f),s))});process.env.NODE_ENV!=="production"&&($u.displayName="Typography");var U0={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},G0=function(t,r){return h.createElement(qt,Xe({},t,{ref:r,icon:U0}))},ku=h.forwardRef(G0);process.env.NODE_ENV!=="production"&&(ku.displayName="CheckOutlined");var Y0={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},X0=function(t,r){return h.createElement(qt,Xe({},t,{ref:r,icon:Y0}))},Ou=h.forwardRef(X0);process.env.NODE_ENV!=="production"&&(Ou.displayName="CopyOutlined");var Q0={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},Z0=function(t,r){return h.createElement(qt,Xe({},t,{ref:r,icon:Q0}))},Tu=h.forwardRef(Z0);process.env.NODE_ENV!=="production"&&(Tu.displayName="LoadingOutlined");function gl(e){return e===!1?[!1,!1]:Array.isArray(e)?e:[e]}function xi(e,t,r){return e===!0||e===void 0?t:e||r&&t}function J0(e){const t=document.createElement("em");e.appendChild(t),process.env.NODE_ENV!=="production"&&(t.className="ant-typography-css-ellipsis-content-measure");const r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return e.removeChild(t),r.left>n.left||n.right>r.right||r.top>n.top||n.bottom>r.bottom}const _a=e=>["string","number"].includes(typeof e),ev=({prefixCls:e,copied:t,locale:r,iconOnly:n,tooltips:o,icon:i,tabIndex:a,onCopy:s,loading:l})=>{const u=gl(o),f=gl(i),{copied:d,copy:p}=r??{},w=t?d:p,b=xi(u[t?1:0],w),C=typeof b=="string"?b:w;return h.createElement(Tn,{title:b,getPopupContainer:m=>m.parentNode},h.createElement("button",{type:"button",className:pe(`${e}-copy`,{[`${e}-copy-success`]:t,[`${e}-copy-icon-only`]:n}),onClick:s,"aria-label":C,tabIndex:a},t?xi(f[1],h.createElement(ku,null),!0):xi(f[0],l?h.createElement(Tu,null):h.createElement(Ou,null),!0)))},eo=h.forwardRef(({style:e,children:t},r)=>{const n=h.useRef(null);return h.useImperativeHandle(r,()=>({isExceed:()=>{const o=n.current;return o.scrollHeight>o.clientHeight},getHeight:()=>n.current.clientHeight})),h.createElement("span",{"aria-hidden":!0,ref:n,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},e)},t)}),tv=e=>e.reduce((t,r)=>t+(_a(r)?String(r).length:1),0);function ml(e,t){let r=0;const n=[];for(let o=0;o<e.length;o+=1){if(r===t)return n;const i=e[o],s=_a(i)?String(i).length:1,l=r+s;if(l>t){const u=t-r;return n.push(String(i).slice(0,u)),n}n.push(i),r=l}return e}const Ci=0,Si=1,wi=2,Ei=3,vl=4,to={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function rv(e){const{enableMeasure:t,width:r,text:n,children:o,rows:i,expanded:a,miscDeps:s,onEllipsis:l}=e,u=h.useMemo(()=>fn(n),[n]),f=h.useMemo(()=>tv(u),[n]),d=h.useMemo(()=>o(u,!1),[n]),[p,w]=h.useState(null),b=h.useRef(null),C=h.useRef(null),m=h.useRef(null),$=h.useRef(null),S=h.useRef(null),[P,_]=h.useState(!1),[j,y]=h.useState(Ci),[E,O]=h.useState(0),[L,I]=h.useState(null);Le(()=>{y(t&&r&&f?Si:Ci)},[r,n,i,t,u]),Le(()=>{var B,v,x,k;if(j===Si){y(wi);const M=C.current&&getComputedStyle(C.current).whiteSpace;I(M)}else if(j===wi){const M=!!(!((B=m.current)===null||B===void 0)&&B.isExceed());y(M?Ei:vl),w(M?[0,f]:null),_(M);const D=((v=m.current)===null||v===void 0?void 0:v.getHeight())||0,F=i===1?0:((x=$.current)===null||x===void 0?void 0:x.getHeight())||0,U=((k=S.current)===null||k===void 0?void 0:k.getHeight())||0,V=Math.max(D,F+U);O(V+1),l(M)}},[j]);const T=p?Math.ceil((p[0]+p[1])/2):0;Le(()=>{var B;const[v,x]=p||[0,0];if(v!==x){const M=(((B=b.current)===null||B===void 0?void 0:B.getHeight())||0)>E;let D=T;x-v===1&&(D=M?v:x),w(M?[v,D]:[D,x])}},[p,T]);const N=h.useMemo(()=>{if(!t)return o(u,!1);if(j!==Ei||!p||p[0]!==p[1]){const B=o(u,!1);return[vl,Ci].includes(j)?B:h.createElement("span",{style:Object.assign(Object.assign({},to),{WebkitLineClamp:i})},B)}return o(a?u:ml(u,p[0]),P)},[a,j,p,u].concat(et(s))),z={width:r,margin:0,padding:0,whiteSpace:L==="nowrap"?"normal":"inherit"};return h.createElement(h.Fragment,null,N,j===wi&&h.createElement(h.Fragment,null,h.createElement(eo,{style:Object.assign(Object.assign(Object.assign({},z),to),{WebkitLineClamp:i}),ref:m},d),h.createElement(eo,{style:Object.assign(Object.assign(Object.assign({},z),to),{WebkitLineClamp:i-1}),ref:$},d),h.createElement(eo,{style:Object.assign(Object.assign(Object.assign({},z),to),{WebkitLineClamp:1}),ref:S},o([],!0))),j===Ei&&p&&p[0]!==p[1]&&h.createElement(eo,{style:Object.assign(Object.assign({},z),{top:400}),ref:b},o(ml(u,T),!0)),j===Si&&h.createElement("span",{style:{whiteSpace:"inherit"},ref:C}))}const _u=({enableEllipsis:e,isEllipsis:t,children:r,tooltipProps:n})=>!n?.title||!e?r:h.createElement(Tn,Object.assign({open:t?void 0:!1},n),r);process.env.NODE_ENV!=="production"&&(_u.displayName="EllipsisTooltip");var nv=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function ov({mark:e,code:t,underline:r,delete:n,strong:o,keyboard:i,italic:a},s){let l=s;function u(f,d){d&&(l=h.createElement(f,{},l))}return u("strong",o),u("u",r),u("del",n),u("code",t),u("mark",e),u("kbd",i),u("i",a),l}const iv="...",bl=["delete","mark","code","underline","strong","keyboard","italic"],av=h.forwardRef((e,t)=>{var r;const{prefixCls:n,className:o,style:i,type:a,disabled:s,children:l,ellipsis:u,editable:f,copyable:d,component:p,title:w}=e,b=nv(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:C,direction:m}=h.useContext(Wt),[$]=ep("Text"),S=h.useRef(null),P=h.useRef(null),_=C("typography",n),j=tc(b,bl),[y,E]=yi(f),[O,L]=kr(!1,{value:E.editing}),{triggerType:I=["icon"]}=E,T=ie=>{var fe;ie&&((fe=E.onStart)===null||fe===void 0||fe.call(E)),L(ie)},N=W0(O);Le(()=>{var ie;!O&&N&&((ie=P.current)===null||ie===void 0||ie.focus())},[O]);const z=ie=>{ie?.preventDefault(),T(!0)},B=ie=>{var fe;(fe=E.onChange)===null||fe===void 0||fe.call(E,ie),T(!1)},v=()=>{var ie;(ie=E.onCancel)===null||ie===void 0||ie.call(E),T(!1)},[x,k]=yi(d),{copied:M,copyLoading:D,onClick:F}=V0({copyConfig:k,children:l}),[U,V]=h.useState(!1),[Z,ae]=h.useState(!1),[me,ue]=h.useState(!1),[be,R]=h.useState(!1),[H,K]=h.useState(!0),[W,q]=yi(u,{expandable:!1,symbol:ie=>ie?$?.collapse:$?.expand}),[Y,G]=kr(q.defaultExpanded||!1,{value:q.expanded}),J=W&&(!Y||q.expandable==="collapsible"),{rows:X=1}=q,ne=h.useMemo(()=>J&&(q.suffix!==void 0||q.onEllipsis||q.expandable||y||x),[J,q,y,x]);Le(()=>{W&&!ne&&(V(ms("webkitLineClamp")),ae(ms("textOverflow")))},[ne,W]);const[se,le]=h.useState(J),Se=h.useMemo(()=>ne?!1:X===1?Z:U,[ne,Z,U]);Le(()=>{le(Se&&J)},[Se,J]);const ve=J&&(se?be:me),Ce=J&&X===1&&se,de=J&&X>1&&se,re=(ie,fe)=>{var Fe;G(fe.expanded),(Fe=q.onExpand)===null||Fe===void 0||Fe.call(q,ie,fe)},[ye,Ee]=h.useState(0),Ue=({offsetWidth:ie})=>{Ee(ie)},Pe=ie=>{var fe;ue(ie),me!==ie&&((fe=q.onEllipsis)===null||fe===void 0||fe.call(q,ie))};h.useEffect(()=>{const ie=S.current;if(W&&se&&ie){const fe=J0(ie);be!==fe&&R(fe)}},[W,se,l,de,H,ye]),h.useEffect(()=>{const ie=S.current;if(typeof IntersectionObserver>"u"||!ie||!se||!J)return;const fe=new IntersectionObserver(()=>{K(!!ie.offsetParent)});return fe.observe(ie),()=>{fe.disconnect()}},[se,J]);const Ne=K0(q.tooltip,E.text,l),xe=h.useMemo(()=>{if(!(!W||se))return[E.text,l,w,Ne.title].find(_a)},[W,se,w,Ne.title,ve]);if(O)return h.createElement(I0,{value:(r=E.text)!==null&&r!==void 0?r:typeof l=="string"?l:"",onSave:B,onCancel:v,onEnd:E.onEnd,prefixCls:_,className:o,style:i,direction:m,component:p,maxLength:E.maxLength,autoSize:E.autoSize,enterIcon:E.enterIcon});const Ae=()=>{const{expandable:ie,symbol:fe}=q;return ie?h.createElement("button",{type:"button",key:"expand",className:`${_}-${Y?"collapse":"expand"}`,onClick:Fe=>re(Fe,{expanded:!Y}),"aria-label":Y?$.collapse:$?.expand},typeof fe=="function"?fe(Y):fe):null},ze=()=>{if(!y)return;const{icon:ie,tooltip:fe,tabIndex:Fe}=E,Mt=fn(fe)[0]||$?.edit,nr=typeof Mt=="string"?Mt:"";return I.includes("icon")?h.createElement(Tn,{key:"edit",title:fe===!1?"":Mt},h.createElement("button",{type:"button",ref:P,className:`${_}-edit`,onClick:z,"aria-label":nr,tabIndex:Fe},ie||h.createElement(Vl,{role:"button"}))):null},Te=()=>x?h.createElement(ev,Object.assign({key:"copy"},k,{prefixCls:_,copied:M,locale:$,onCopy:F,loading:D,iconOnly:l==null})):null,ge=ie=>[ie&&Ae(),ze(),Te()],Me=ie=>[ie&&!Y&&h.createElement("span",{"aria-hidden":!0,key:"ellipsis"},iv),q.suffix,ge(ie)];return h.createElement(Mr,{onResize:Ue,disabled:!J},ie=>h.createElement(_u,{tooltipProps:Ne,enableEllipsis:J,isEllipsis:ve},h.createElement($u,Object.assign({className:pe({[`${_}-${a}`]:a,[`${_}-disabled`]:s,[`${_}-ellipsis`]:W,[`${_}-ellipsis-single-line`]:Ce,[`${_}-ellipsis-multiple-line`]:de},o),prefixCls:n,style:Object.assign(Object.assign({},i),{WebkitLineClamp:de?X:void 0}),component:p,ref:wn(ie,S,t),direction:m,onClick:I.includes("text")?z:void 0,"aria-label":xe?.toString(),title:w},j),h.createElement(rv,{enableMeasure:J&&!se,text:l,rows:X,width:ye,onEllipsis:Pe,expanded:Y,miscDeps:[M,Y,D,y,x,$].concat(et(bl.map(fe=>e[fe])))},(fe,Fe)=>ov(e,h.createElement(h.Fragment,null,fe.length>0&&Fe&&!Y&&xe?h.createElement("span",{key:"show-content","aria-hidden":!0},fe):fe,Me(Fe)))))))}),sv=h.forwardRef((e,t)=>h.createElement(av,Object.assign({ref:t},e,{component:"div"}))),Pu=(e,t,r=null)=>{for(let n=0;n<e.length;n++){const o=e[n];if(o.key===t)return{node:o,ctx:{parent:r,index:n,siblings:e}};if(o.children?.length){const i=Pu(o.children,t,o);if(i.node)return i}}return{node:null,ctx:null}},Nu=(e,t)=>{if(!e.children)return!1;for(const r of e.children)if(r.key===t||Nu(r,t))return!0;return!1};function lv({open:e,onClose:t}){const{nodes:r,rootIds:n,addFolder:o,editFolder:i,removeFolder:a,removeMenu:s,moveNode:l}=gt.useFavoriteStore(),u=g.useRef(null),[f,d]=g.useState([]),[p,w]=g.useState([]),[b,C]=g.useState(""),[m,$]=g.useState("ADD"),[S,P]=g.useState(!1),[_,j]=g.useState("");g.useEffect(()=>{e&&w(n)},[e]),g.useEffect(()=>{const O=y(r,n);d(O)},[r]),g.useEffect(()=>{S&&_&&(u.current.setFieldValue("prntBkmkId",_),u.current.setFieldValue("prntBkmkNm",r[_]?.bkmkNm??"-")),S&&m==="EDIT"&&(u.current.setFieldValue("bkmkId",_),u.current.setFieldValue("bkmkNm",r[_]?.bkmkNm)),!S&&m=="ADD"&&w(O=>[...O,_]),!S&&u.current&&(j("-"),u.current.resetFields())},[S,m,_,r]);const y=(O,L)=>{const I=(T,N="-")=>{const z=O[T];if(!z)return null;const B={key:z.bkmkId,type:z.type,title:z.type==="F"?z.bkmkNm:z.menuNm?`${z.menuNm} (${z.menuId})`:z.menuId,parentId:N,sortOrdr:z.sortOrdr??0};if(z.type==="F"){const x=(z.children??[]).map(k=>I(k,z.bkmkId)).filter(Boolean);return{...B,children:x}}return B};return L.map(T=>I(T,"-")).filter(Boolean)},E=()=>{if($("ADD"),!b){j("-"),P(!0);return}const O=r[b];if(!O){j("-"),P(!0);return}O.type==="F"?j(O.bkmkId):j(O.prntBkmkId),P(!0)};return c.jsxs(A.ConfigProvider,{theme:{components:{Modal:{wireframe:!0}}},children:[c.jsxs(A.Modal,{open:e,okButtonProps:{style:{display:"none"}},cancelText:"닫기",width:560,style:{zIndex:1001},styles:{body:{paddingTop:"12px"}},title:c.jsx("div",{style:{display:"flex",alignItems:"center",gap:12},children:c.jsxs(A.Typography.Text,{strong:!0,style:{fontSize:18},children:[c.jsx(ce.FolderOpenFilled,{style:{marginRight:10,fontSize:18,color:"#faad14"}}),"북마크 관리"]})}),onCancel:t,children:[c.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginBottom:10},children:[c.jsx(A.Button,{color:"blue",variant:"outlined",icon:c.jsx(ce.FolderAddOutlined,{}),style:{marginLeft:"8px",height:28,padding:"0 10px"},onClick:E,children:"새 폴더"}),c.jsxs("div",{children:[c.jsx(A.Tooltip,{title:"펼치기",children:c.jsx(A.Button,{icon:c.jsx(ce.PlusSquareOutlined,{}),style:{marginLeft:"8px",height:28,padding:"0 10px"},onClick:()=>{const O=Object.values(r).filter(L=>L.type==="F").map(L=>L.bkmkId);w(O)}})}),c.jsx(A.Tooltip,{title:"접기",children:c.jsx(A.Button,{icon:c.jsx(ce.MinusSquareOutlined,{}),style:{marginLeft:"8px",height:28,padding:"0 10px"},onClick:()=>w([])})})]})]}),c.jsxs("div",{style:{maxHeight:420,height:350,overflow:"auto",border:"1px solid #f0f0f0",borderRadius:8,padding:8},children:[f.length==0&&c.jsx(A.Empty,{description:c.jsxs(A.Typography.Text,{type:"secondary",style:{fontSize:13},children:["아직 저장된 북마크가 없습니다.",c.jsx("br",{}),"새로운 폴더를 생성해보세요."]})}),c.jsx(A.Tree,{blockNode:!0,draggable:!0,allowDrop:({dropNode:O,dropPosition:L})=>{const I=O.type==="F";return L===0?I:!0},onDrop:O=>{const{dragNode:L,node:I,dropPosition:T,dropToGap:N}=O;if(L.key===I.key||Nu(L,I.key))return;let z,B;if(N){const x=Pu(f,I.key).ctx,k=x.index;z=x.parent?x.parent.key:"-",B=T>0?k+1:k}else{if(I.type!=="F")return;const x=I.children||[];z=I.key,B=x.length}const v=ot.getUserId();if(L.type==="F")l({bkmkId:L.key,newPrntBkmkId:z,sortOrdr:B,userId:v}).catch(()=>{A.Modal.error({title:"이동 실패",content:"폴더 이동 중 오류가 발생했어요."})});else{if(z==="-"){A.Modal.warning({title:"이동 불가",content:"메뉴는 최상위로 이동할 수 없어요."});return}l({bkmkId:L.key,newPrntBkmkId:z,sortOrdr:B,userId:v}).catch(()=>{A.Modal.error({title:"이동 실패",content:"메뉴 이동 중 오류가 발생했어요."})})}N===!1&&w(x=>Array.from(new Set([...x,I.key])))},showLine:!0,treeData:f,selectedKeys:[b],expandedKeys:p,onExpand:w,onSelect:O=>C(O[0]),titleRender:O=>c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[c.jsxs("span",{children:[O.type==="F"?"📁":"📄"," ",O.title,O.isNew?c.jsx(A.Tag,{color:"gold",style:{marginLeft:4,fontSize:"10px",height:"16px",lineHeight:"16px",padding:"0 5px"},children:"N"}):null]}),c.jsxs("span",{style:{display:"inline-flex",gap:8},children:[O.type==="F"&&c.jsxs(c.Fragment,{children:[c.jsx(ce.PlusOutlined,{style:{opacity:.8},onClick:()=>{$("ADD"),j(O.key),P(!0)}}),c.jsx(ce.EditOutlined,{style:{opacity:.8},onClick:()=>{$("EDIT"),j(O.key),P(!0)}})]}),c.jsx(ce.DeleteOutlined,{style:{cursor:"pointer",opacity:.5},onClick:()=>{O.type==="F"?A.Modal.confirm({title:"삭제 안내",content:"폴더를 삭제하면 하위 폴더와 메뉴도 모두 삭제됩니다. 삭제하시겠습니까?",centered:!0,onOk:()=>a(O.key)}):A.Modal.confirm({title:"삭제 안내",centered:!0,content:"메뉴를 삭제하시겠습니까?",onOk:()=>s(O.key)})}})]})]})})]})]}),c.jsx(A.ConfigProvider,{theme:{components:{Modal:{titleColor:m==="ADD"?"#0958d9":"#d46b08",headerBg:m==="ADD"?"#e6f4ff":"#fff7e6"}}},children:c.jsx(A.Modal,{title:c.jsxs(c.Fragment,{children:[m==="ADD"?c.jsx(ce.FolderAddOutlined,{style:{marginRight:10,fontSize:18,color:"#1677ff"}}):c.jsx(ce.EditOutlined,{style:{marginRight:10,fontSize:18,color:"#d46b08"}}),c.jsxs(A.Typography.Text,{strong:!0,style:{fontSize:17},children:["폴더",m==="ADD"?" 추가":"명 수정"]})]}),open:S,okText:"저장",onOk:()=>{const O=u.current.getFieldValue("bkmkNm"),L=ot.getUserId();if(m==="ADD"){const I=__SYS_CD__??"KH",T=u.current.getFieldValue("prntBkmkId");o(O,T,I,L).then(()=>{P(!1)})}else{const I=u.current.getFieldValue("bkmkId");i(I,L,O).then(()=>{P(!1)})}},centered:!0,width:400,onCancel:()=>P(!1),children:c.jsxs(Vn.BwgForm,{ref:u,children:[c.jsx(Vn.BwgInput,{itemProps:{name:m==="EDIT"?"bkmkId":"prntBkmkId",hidden:!0}}),c.jsx(Vn.BwgInput,{itemProps:{label:"상위 폴더명",name:"prntBkmkNm",hidden:_==="-"||m==="EDIT"},inputProps:{disabled:!0}}),c.jsx(Vn.BwgInput,{itemProps:{label:"폴더명",name:"bkmkNm"}})]})})})]})}function cv({triggerIcon:e}){const[t,r]=g.useState(!1),[n,o]=g.useState(""),[i,a]=g.useState(null),[s,l]=g.useState([]),[u,f]=g.useState([]),[d,p]=g.useState(!1),[w,b]=g.useState(!1),[C,m]=g.useState(!1),[$,S]=g.useState(null);gt.useFavoriteStore(D=>D.treeNodes);const{nodes:P,getPrntBkmkIdByMenuId:_,getNodeByMenuId:j,isMenuBookmarked:y,removeMenuByMenuId:E,addMenuToFolder:O,convertToAntTreeData:L}=gt.useFavoriteStore(),I=gt.useFavoriteStore(D=>D.rootIds),T=g.useMemo(()=>L(P,I,n,!0),[P,I,n]),N=gt.useMenuViewStore(D=>D.activeMenuItem??{menuId:"",menuNm:""}),z=g.useMemo(()=>{if(!N?.menuId)return"";const D=j(N.menuId);if(!D)return"";if(D.fullPath)return D.fullPath;const F=U=>{const V=P[U];if(!V)return"";if(V.prntBkmkId==="-")return`${V.bkmkNm||N?.menuNm}`;const Z=F(V.prntBkmkId);return Z?`${Z} > ${V.bkmkNm||N?.menuNm}`:V.bkmkNm||N?.menuNm};return console.log("bookmarkNode ::::: ",D),console.log(F(D.bkmkId)),F(D.bkmkId)},[N?.menuId,j,P]);g.useEffect(()=>{t&&N?.menuId&&y(N.menuId)?f([_(N.menuId)]):t&&N?.menuId&&!y(N.menuId)?f(I):(f([]),l([]),S(null),m(!1))},[t,N?.menuId,y,_]),g.useEffect(()=>{if(!C||!N?.menuId)return;const D=_(N.menuId);!D||!P[D]||(o(""),l([D]),S(D))},[C,N?.menuId,P,_]);const B=(D,F)=>{O(D,F).then(U=>{console.log("AddMenuToFolder ::::: ",U),U||f(V=>V.includes(D)?V:[...V,D])})},v=D=>{E(D)},x=async D=>{N?.menuId&&(await E(N.menuId),await O(D,N),m(!1),S(null),f(F=>F.includes(D)?F:[...F,D]))},k=()=>c.jsxs("div",{style:{width:360},children:[c.jsx("div",{style:{padding:12,borderBottom:"1px solid #f0f0f0"},children:c.jsxs(A.Space,{direction:"vertical",style:{width:"100%"},children:[c.jsxs(A.Typography.Text,{strong:!0,style:{fontSize:18},children:[c.jsx(A.Button,{type:"text",icon:c.jsx(ce.ArrowLeftOutlined,{}),onClick:()=>m(!1),style:{marginRight:4}}),"폴더 변경"]}),N&&c.jsxs(A.Typography.Text,{type:"secondary",children:["현재 화면: ",c.jsx("b",{children:N.menuNm})," ",c.jsxs("span",{style:{opacity:.7},children:["(",N.menuId,")"]})]})]})}),M(),c.jsxs("div",{style:{padding:12,borderTop:"1px solid #f0f0f0",display:"flex",justifyContent:"flex-end",gap:8},children:[c.jsx(A.Button,{onClick:()=>{m(!1),S(null)},children:"취소"}),c.jsx(A.Button,{type:"primary",disabled:!$,onClick:()=>$&&x(String($)),children:"이동"})]})]}),M=()=>c.jsxs("div",{style:{maxHeight:360,overflow:"auto",padding:8},children:[c.jsxs(A.Space,{style:{width:"100%",marginBottom:8,display:"flex",justifyContent:"space-between"},children:[c.jsx(A.Input,{placeholder:"검색(폴더명)",prefix:c.jsx(ce.SearchOutlined,{}),allowClear:!0,value:n,onChange:D=>o(D.target.value),style:{width:"260px",height:28}}),c.jsxs(A.ConfigProvider,{theme:{components:{Button:{defaultHoverColor:"#6f6f6f",defaultHoverBorderColor:"#6f6f6f"}}},children:[c.jsx(A.Button,{icon:c.jsx(ce.PlusOutlined,{}),size:"small",style:{margin:"0 4px",fontSize:12},onClick:()=>{const D=Object.values(P).filter(F=>F.type==="F").map(F=>F.bkmkId);f(D)},title:"모두 확장"}),c.jsx(A.Button,{icon:c.jsx(ce.MinusOutlined,{}),size:"small",style:{margin:"0 4px",fontSize:12},onClick:()=>f([]),title:"모두 축소"})]})]}),T.length===0?c.jsx(A.Empty,{description:c.jsxs(A.Typography.Text,{type:"secondary",style:{fontSize:13},children:["아직 저장된 북마크가 없습니다.",c.jsx("br",{}),"새로운 폴더를 만들어 시작해보세요."]}),image:A.Empty.PRESENTED_IMAGE_SIMPLE}):c.jsx(A.Tree,{blockNode:!0,showLine:!0,treeData:T,selectedKeys:s,expandedKeys:u,onExpand:f,onSelect:D=>{l(D),S(D[0])},autoExpandParent:!0,titleRender:D=>{const F=String(D.key),U=i===F;return c.jsxs("div",{onMouseEnter:()=>a(F),onMouseLeave:()=>a(null),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[c.jsx("div",{children:D.title}),!y(N?.menuId)&&N&&U&&c.jsx(A.Button,{size:"small",type:"link",onClick:V=>{V.stopPropagation(),B(F,N)},children:"+ 현재화면 추가"})]})}})]});return c.jsxs(c.Fragment,{children:[c.jsx(A.Popover,{open:t&&!d,onOpenChange:r,trigger:"click",placement:"bottomLeft",styles:{body:{padding:0,borderRadius:12,border:"1px solid #e8edf5",boxShadow:"0 12px 32px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08)",background:"#fcfcff",zIndex:1e3}},content:C?k():c.jsxs("div",{style:{width:360},children:[c.jsx("div",{style:{padding:12,borderBottom:"1px solid #f0f0f0"},children:c.jsxs(A.Space,{direction:"vertical",style:{width:"100%"},children:[c.jsxs(A.Typography.Text,{strong:!0,style:{fontSize:18},children:["📌 북마크"," ",y(N?.menuId)?"저장됨":"추가"]}),N&&c.jsxs(A.Typography.Text,{type:"secondary",children:["현재 화면: ",c.jsx("b",{children:N.menuNm})," ",c.jsxs("span",{style:{opacity:.7},children:["(",N.menuId,")"]})]})]})}),y(N?.menuId)?c.jsxs("div",{style:{padding:12,margin:8,borderRadius:8,backgroundColor:"#f5f5f5"},children:[c.jsx(A.Typography.Text,{type:"secondary",style:{fontSize:12},children:"저장 위치"}),c.jsx("div",{style:{marginTop:4},children:`📁 > ${z}`||"알 수 없음"})]}):M(),c.jsxs(Nt,{style:{padding:8,borderTop:"1px solid #f0f0f0"},layoutAlign:"right",children:[N&&!y(N.menuId)?c.jsx(A.Button,{style:{height:"28px",padding:"0 10px",margin:"0 4px"},type:"primary",icon:c.jsx(ce.PlusOutlined,{}),onClick:()=>{const D=String(s[0]);let F="-";D&&P[D]&&(F=P[D].type=="M"?P[D].prntBkmkId:D),B(F,N)},children:"추가"}):c.jsxs(Nt,{layoutAlign:"between",children:[c.jsx(A.Button,{style:{height:"28px",padding:"0 10px",margin:"0 4px"},icon:c.jsx(ce.FolderOpenOutlined,{}),onClick:()=>m(!0),children:"폴더 변경"}),c.jsx(A.Button,{style:{height:"28px",padding:"0 10px",margin:"0 4px"},color:"danger",variant:"solid",icon:c.jsx(ce.MinusOutlined,{}),onClick:()=>v(N.menuId),children:"삭제"})]}),c.jsx(A.Button,{type:"text",style:{height:"28px",padding:"0 10px",margin:"0 4px"},icon:c.jsx(ce.SettingOutlined,{}),onClick:()=>{b(t),p(!0)},children:"관리"})]})]}),children:c.jsx("span",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center"},children:e})}),c.jsx(lv,{open:d,onClose:()=>{p(!1),w&&r(!0)}})]})}const uv=({reqRows:e,subRows:t})=>{const{searchBoxRef:r}=dr.useSearchBox();return c.jsx(la,{ref:r,reqRows:e,subRows:t})},dv=({children:e,searchBox:t,title:r,preRenderEvents:n=[],postRenderEvents:o=[],loading:i=!1,error:a=null,grantEvent:s={},customEvent:l={},buttons:u})=>{dr.useServiceCodeValue("AUTH_BTNS");const{user:f}=gt.useUserStore(),{activeMenuItem:d}=gt.useMenuViewStore(),{loadFavoritesIfNeeded:p,isMenuBookmarked:w}=gt.useFavoriteStore(),{loading:b}=gt.useLoadingStore(),[C,m]=g.useState({isInitialized:!1,isReady:!1,error:null,loading:!0,preRenderComplete:!1,postRenderComplete:!1}),{openCorePopup:$}=dr.usePopup(),S=async()=>{if(n.length===0){m(I=>({...I,preRenderComplete:!0}));return}try{for(const I of n)await I();m(I=>({...I,preRenderComplete:!0}))}catch(I){m(T=>({...T,error:I instanceof Error?I.message:"사전 렌더링 실패",preRenderComplete:!0}))}},P=async()=>{if(o.length===0){m(I=>({...I,postRenderComplete:!0}));return}try{for(const I of o)await I();m(I=>({...I,postRenderComplete:!0}))}catch(I){m(T=>({...T,error:I instanceof Error?I.message:"사후 렌더링 실패",postRenderComplete:!0}))}};g.useEffect(()=>{if(C.isInitialized)return;(async()=>{try{await S(),m(T=>({...T,isInitialized:!0,loading:!1}))}catch(T){console.error("BwgView 초기화 실패:",T),m(N=>({...N,isInitialized:!0,loading:!1}))}})()},[]),g.useEffect(()=>{f?.userId&&p(f.userId)},[p,f?.userId]),g.useEffect(()=>{C.isInitialized&&C.preRenderComplete&&!C.isReady&&setTimeout(async()=>{await P(),m(T=>({...T,isReady:!0}))},100)},[C.isInitialized,C.preRenderComplete,C.isReady]),g.useEffect(()=>{a&&m(I=>({...I,error:a}))},[a]);const _=()=>c.jsxs("div",{className:"bwgview-header-container",children:[c.jsxs("div",{className:"bwgview-header",children:[c.jsx("div",{className:"bwgview-header-left",children:L.LEFT}),c.jsx("div",{className:"bwgview-header-right",children:L.RIGHT})]}),t&&c.jsx(uv,{reqRows:t.reqRows,subRows:t.subRows})]});if(g.useEffect(()=>{},[f,d]),C.error||a)return c.jsx("div",{style:{padding:"24px"},children:c.jsx(A.Alert,{message:"오류 발생",description:C.error||a,type:"error",showIcon:!0})});const j=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 20",width:"1em",height:"1em",fill:"none",children:c.jsx("path",{d:"M9.9348 1.4645C10.2382 0.845167 10.7437 0.845167 11.0597 1.4645L13.0694 5.5344C13.3727 6.15374 14.1943 6.74779 14.8768 6.84891L19.3638 7.50616C20.0464 7.60727 20.2107 8.08757 19.7051 8.56787L16.4568 11.7277C15.9638 12.208 15.6478 13.1686 15.7616 13.8512L16.5326 18.3129C16.6464 18.9954 16.2419 19.2988 15.6226 18.9701L11.6159 16.8594C10.9965 16.5307 9.998 16.5307 9.37867 16.8594L5.37196 18.9701C4.75263 19.2988 4.34817 18.9954 4.46192 18.3129L5.23293 13.8512C5.34668 13.1686 5.04334 12.208 4.53776 11.7277L1.28942 8.56787C0.79648 8.08757 0.948154 7.60727 1.63068 7.50616L6.11769 6.84891C6.80022 6.74779 7.62179 6.15374 7.92513 5.5344L9.9348 1.4645Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10"})}),y=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 20",width:"1em",height:"1em",fill:"none",children:c.jsx("path",{d:"M9.9348 1.4645C10.2382 0.845167 10.7437 0.845167 11.0597 1.4645L13.0694 5.5344C13.3727 6.15374 14.1943 6.74779 14.8768 6.84891L19.3638 7.50616C20.0464 7.60727 20.2107 8.08757 19.7051 8.56787L16.4568 11.7277C15.9638 12.208 15.6478 13.1686 15.7616 13.8512L16.5326 18.3129C16.6464 18.9954 16.2419 19.2988 15.6226 18.9701L11.6159 16.8594C10.9965 16.5307 9.998 16.5307 9.37867 16.8594L5.37196 18.9701C4.75263 19.2988 4.34817 18.9954 4.46192 18.3129L5.23293 13.8512C5.34668 13.1686 5.04334 12.208 4.53776 11.7277L1.28942 8.56787C0.79648 8.08757 0.948154 7.60727 1.63068 7.50616L6.11769 6.84891C6.80022 6.74779 7.62178 6.15374 7.92513 5.5344L9.9348 1.4645Z",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",fill:"none"})}),E=I=>c.jsx(ce,{component:j,...I}),O=I=>c.jsx(ce,{component:y,...I}),L={LEFT:c.jsx("div",{className:"bwgview-header-left",children:c.jsxs(A.ConfigProvider,{theme:{components:{Tag:{controlHeight:28,controlHeightLG:28,controlHeightSM:28,controlHeightXS:28}}},children:[c.jsxs(A.Space,{children:[d&&c.jsx(cv,{triggerIcon:w(d.menuId)?c.jsx(E,{className:"bookmark-icon",style:{color:"#faad14"}}):c.jsx(O,{className:"bookmark-icon"})}),c.jsxs(A.Space.Compact,{style:{alignItems:"center"},children:[c.jsx("span",{className:"pageMenuNm",children:(()=>{let I="";return r?.useMenuTitle&&d?I=d.menuNm:r?.text?I=r.text:d&&(I=d.menuPrntId==="CM00"?d.menuNm.substring(d.menuNm.indexOf(" ")+1):d.menuNm),r?.prefix&&(I=`${r.prefix} ${I}`),r?.suffix&&(I=`${I} ${r.suffix}`),I})()}),d?.menuNo&&c.jsx(A.Tag,{className:"page-num-tag",children:d?.menuNo}),c.jsx(A.Tooltip,{title:"도움말",color:"geekblue",children:c.jsx(A.Button,{variant:"text",type:"text",className:"menu-help-btn",icon:c.jsx(ce.QuestionCircleTwoTone,{twoToneColor:"orange"})})}),c.jsx(A.Tooltip,{title:"게시판",color:"geekblue",children:c.jsx(A.Button,{variant:"text",type:"text",onClick:()=>$("CORE_REPORT"),icon:c.jsx(ce.BugFilled,{style:{color:"#1890ff"}})})})]})]}),d?.scrnId&&ot.isLocal&&c.jsx(A.Tag,{style:{marginLeft:8,fontSize:13,fontWeight:500,display:"flex"},children:c.jsx(sv,{copyable:!0,style:{display:"inherit",justifyContent:"center",alignItems:"center",marginBottom:0},children:d?.scrnId})})]})}),RIGHT:c.jsx("div",{className:"bwgview-header-right",children:c.jsx(A.ConfigProvider,{theme:{components:{Space:{padding:8}}},children:c.jsxs(A.Space,{children:[c.jsx(A.Flex,{gap:8,children:c.jsx($i,{checkAuth:d?.menuId?{menuId:d.menuId,grpId:"CUSTOM"}:!1,buttons:u?.custom||[],gap:8})}),c.jsx(A.ConfigProvider,{theme:{components:{Divider:{verticalMarginInline:0}}},children:c.jsx(A.Divider,{type:"vertical"})}),c.jsx(A.Flex,{gap:8,className:"permission-buttons",children:c.jsx($i,{checkAuth:d?.menuId?{menuId:d.menuId,grpId:"DEFAULT"}:!1,buttons:u?.grant||[],gap:8})})]})})})};return c.jsxs("div",{className:"bwg-view main-view",style:{height:"100%",display:"flex",flexDirection:"column"},children:[_(),c.jsx("div",{className:"bwgview-content",children:c.jsxs("div",{className:"bwgview-content",children:[c.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:e}),(C.loading||i||b)&&c.jsx(Hu.LoadingContainer,{text:b?"처리 중...":"화면 로드 중..."})]})})]})},fv=({children:e,customTheme:t,customComponentSize:r="middle"})=>{const n={token:{colorPrimary:"#1890ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1890ff",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif',fontSize:14,fontSizeHeading1:38,fontSizeHeading2:30,fontSizeHeading3:24,fontSizeHeading4:20,fontSizeHeading5:16,padding:16,margin:16,borderRadius:6,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",boxShadowSecondary:"0 2px 4px rgba(0, 0, 0, 0.12)"},algorithm:A.theme.defaultAlgorithm},o={...n,...t,token:{...n.token,...t?.token}};return c.jsx(A.ConfigProvider,{locale:El,theme:o,componentSize:r,space:{size:r},form:{validateMessages:{required:"${label}을(를) 입력해주세요.",types:{email:"${label}이(가) 유효한 이메일이 아닙니다.",number:"${label}이(가) 유효한 숫자가 아닙니다."},number:{range:"${label}은(는) ${min} ~ ${max} 사이의 값이어야 합니다."}}},pagination:{showSizeChanger:!0},children:e})},hv="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9289)'%3e%3cpath%20d='M27.3705%2010.9919C28.5405%2010.9919%2029.489%2010.0434%2029.489%208.87338C29.489%207.70337%2028.5405%206.75488%2027.3705%206.75488C26.2004%206.75488%2025.252%207.70337%2025.252%208.87338C25.252%2010.0434%2026.2004%2010.9919%2027.3705%2010.9919Z'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M30.3053%2017.2998V32.3098H24.4248V17.2998'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M27.3701%2032.31V23.3135'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.2305%2022.1925V17.642V15.6945C22.2305%2014.3075%2023.3515%2013.1865%2024.7385%2013.1865H29.9825C31.3695%2013.1865%2032.4905%2014.3075%2032.4905%2015.6945V17.642V22.1925'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.2519%2021.4229H18.6199C19.1044%2021.4229%2019.5034%2021.8219%2019.5034%2022.3064V24.4154H16.3779V22.3064C16.3779%2021.8219%2016.7769%2021.4229%2017.2614%2021.4229H17.2519Z'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M20.8339%2024.4062H15.0294C14.6254%2024.4062%2014.2979%2024.7338%2014.2979%2025.1377V31.6832C14.2979%2032.0872%2014.6254%2032.4147%2015.0294%2032.4147H20.8339C21.2378%2032.4147%2021.5654%2032.0872%2021.5654%2031.6832V25.1377C21.5654%2024.7338%2021.2378%2024.4062%2020.8339%2024.4062Z'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8252%2027.1895V29.631'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.0391%2027.1895V29.631'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.71875%2014.1642H8.53075C9.03425%2014.1642%209.49025%2013.8602%209.68025%2013.4042L10.3263%2011.8652'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.4991%205.54803L12.2266%2011.8655H17.5371L19.8836%205.51953L17.4991%205.54803Z'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.2017%2016.4639H6.57421C5.97571%2016.4639%205.49121%2015.9794%205.49121%2015.3809C5.49121%2013.4334%207.06821%2011.8564%209.01571%2011.8564H20.3492'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.56738%2032.4805H32.2909'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9289'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",pv="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9314)'%3e%3cpath%20d='M15.1807%2019.3994L18.7717%2029.7164'%20stroke='%23FF8CC3'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9033%209.25293L12.6063%2011.2574C12.6063%2011.2574%2010.7443%2014.7724%2013.2618%2022.0209'%20stroke='%23FF8CC4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9033%209.25293L12.6063%2011.2574C12.6063%2011.2574%2016.2448%2012.8534%2018.7718%2020.1019'%20stroke='%23FF8CC4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.8257%2016.71C22.2202%2012.112%2017.1947%209.67999%2012.5967%2011.276C7.99871%2012.8815%205.56671%2017.907%207.16271%2022.505L7.67571%2023.968L7.88471%2023.892C7.93221%2022.7235%208.67321%2021.6405%209.85121%2021.232C11.0292%2020.8235%2012.2737%2021.2035%2013.0432%2022.0965L13.4422%2021.954C13.4897%2020.7855%2014.2307%2019.7025%2015.4087%2019.294C16.5867%2018.8855%2017.8312%2019.2655%2018.6007%2020.1585L18.9997%2020.016C19.0472%2018.8475%2019.7882%2017.7645%2020.9662%2017.356C22.1442%2016.9475%2023.3887%2017.3275%2024.1582%2018.2205L24.3577%2018.154L23.8447%2016.691L23.8257%2016.71Z'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.37%2015.4193C23.636%2015.4858%2023.9115%2015.5238%2024.1965%2015.5238C26.068%2015.5238%2027.5785%2014.0038%2027.5785%2012.1418C27.5785%2010.2798%2026.0585%208.75977%2024.1965%208.75977C22.3345%208.75977%2020.8145%2010.2798%2020.8145%2012.1418'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M24.2061%206.12784V5.00684'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.8641%207.79018L19.1611%207.09668'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M28.5381%2016.4736L29.2411%2017.1766'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M30.21%2012.1318H31.331'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M28.5469%207.79018L29.2404%207.09668'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M29.3355%2029.8213H14.2305'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.2302%2029.8213L10.3447%2025.2803'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.8527%2028.4531L7.76074%2032.9941'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.8447%2029.8213L27.4072%2032.9943'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9314'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gv="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9273)'%3e%3cpath%20d='M25.9254%2020.8996C27.5151%2020.8996%2028.8039%2019.6108%2028.8039%2018.0211C28.8039%2016.4313%2027.5151%2015.1426%2025.9254%2015.1426C24.3356%2015.1426%2023.0469%2016.4313%2023.0469%2018.0211C23.0469%2019.6108%2024.3356%2020.8996%2025.9254%2020.8996Z'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M31.4825%2032.4711V25.9066C31.4825%2024.5671%2030.485%2023.4746%2029.2595%2023.4746H22.6C21.3745%2023.4746%2020.377%2024.5671%2020.377%2025.9066'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M25.2696%2026.7334H14.2686L16.5106%2032.6234H27.5021L25.2696%2026.7334Z'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.5617%2018.8385C6.1462%2017.4135%205.2627%2015.447%205.2627%2013.2715C5.2627%208.91095%208.7967%205.37695%2013.1572%205.37695C17.5177%205.37695%2021.0517%208.91095%2021.0517%2013.2715C21.0517%2015.124%2020.4152%2016.815%2019.3512%2018.164C18.0497%2019.8075%2016.1117%2020.919%2013.9172%2021.128'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.1572%2013.2715L16.0167%2015.5705'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.1572%208.62598V13.2715'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.35963%2016.1973L7.84663%2019.1328L4.91113%2018.6293'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M4.91113%2032.623H33.0881'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9273'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",mv=({children:e})=>{const[t,r]=g.useState({x:0,y:0}),[n,o]=g.useState(!1),[i,a]=g.useState({x:0,y:0}),[s,l]=g.useState(!1),[u,f]=g.useState(!0),d=g.useRef(null),p=[{id:"overtime",title:"시간 외 근무신청",icon:c.jsx("img",{src:gv,alt:"시간외근무신청",className:"quick-overtime"}),color:"#722ed1",onClick:()=>{console.log("시간 외 근무 신청 클릭")}},{id:"business-trip",title:"출장신청",icon:c.jsx("img",{src:hv,alt:"출장신청",className:"quick-business-trip"}),color:"#1890ff",onClick:()=>{console.log("출장 신청 클릭")}},{id:"vacation",title:"휴가신청",icon:c.jsx("img",{src:pv,alt:"휴가신청",className:"quick-holiday"}),color:"#eb2f96",onClick:()=>{console.log("휴가 신청 클릭")}},{id:"document",title:"문서신청",icon:c.jsx(ce.FileTextOutlined,{}),color:"#52c41a",onClick:()=>{console.log("문서 신청 클릭")}},{id:"profile",title:"인사정보",icon:c.jsx(ce.UserOutlined,{}),color:"#fa8c16",onClick:()=>{console.log("인사 정보 클릭")}},{id:"settings",title:"설정",icon:c.jsx(ce.SettingOutlined,{}),color:"#13c2c2",onClick:()=>{console.log("설정 클릭")}}];g.useEffect(()=>{const S=()=>{const P=window.innerHeight,j=Math.max(64,(P-300)/3);r({x:0,y:j});const y=P/2;f(j<y)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const w=S=>{if(S.preventDefault(),S.stopPropagation(),d.current){const P=d.current.getBoundingClientRect();a({x:S.clientX-P.left,y:S.clientY-P.top}),o(!0)}},b=S=>{if(n){const P=S.clientY-i.y,_=window.innerHeight-24,y=Math.max(64,Math.min(_,P));r({x:t.x,y});const E=window.innerHeight/2;f(y<E)}},C=()=>{o(!1)},m=()=>{l(!s)},$=S=>{S.onClick&&S.onClick()};return g.useEffect(()=>{if(n)return document.addEventListener("mousemove",b),document.addEventListener("mouseup",C),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",C)}},[n,i]),c.jsxs("div",{className:"quick-tab-container",ref:d,style:{position:"fixed",right:0,top:t.y,zIndex:1e3,userSelect:"none",touchAction:"none"},children:[c.jsxs("div",{className:"quick-tab",style:{position:"absolute",right:"40px",top:u?0:"auto",bottom:u?"auto":0,display:"flex",flexDirection:"column",gap:"15px",border:"1px solid #E0DEEF",borderRadius:"15px",padding:"8px",boxShadow:"0 0 10px rgba(0, 0, 0, 0.3)",minWidth:"88px",maxWidth:"88px",maxHeight:u?`calc(100vh - ${t.y+12}px)`:`${t.y-12}px`,transform:s?"translateX(0)":"translateX(calc(100% + 100px))",transition:"transform 0.3s ease",marginTop:u&&t.y<100?"32px":"0",marginBottom:!u&&t.y>window.innerHeight-100?"8px":"0"},children:[c.jsx("div",{className:"quick-tab-items-wrap",style:{background:"#ffffff",borderRadius:"10px",flex:1,overflowY:"auto",maxHeight:u?`calc(100vh - ${t.y+120}px)`:`${t.y-60}px`,padding:"14px 0"},children:p.map(S=>c.jsx(A.Card,{className:"quick-tab-items",size:"small",style:{border:"none",boxShadow:"none",marginBottom:"15px",cursor:"pointer",transition:"all 0.2s ease"},styles:{body:{padding:"0"}},onClick:()=>$(S),onMouseEnter:P=>{},onMouseLeave:P=>{},children:c.jsxs("div",{className:"quick-tab-item-inner",children:[c.jsx("div",{className:"quick-tab-items-icon",style:{width:"44px",height:"44px",borderRadius:"8PX",fontSize:"24px",color:S.color,marginBottom:"5px"},children:S.icon}),c.jsx("div",{className:"quick-tab-items-title",children:S.title})]})},S.id))}),c.jsx("div",{className:"quick-tab-add-btn",style:{height:"30px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",flexShrink:0,marginBottom:"7px"},onMouseEnter:S=>{},onMouseLeave:S=>{},children:c.jsx(ce.PlusOutlined,{style:{color:"#CDC4FF",fontSize:"15px"}})})]}),c.jsx("div",{className:"quick-tab-drag-btn",style:{cursor:n?"grabbing":"grab",zIndex:1001},onMouseDown:S=>w(S)}),c.jsx(A.Button,{className:`quick-tab-toggle-btn ${s?"expanded":""}`,type:"default",style:{border:"0",backgroundColor:"transparent"},onClick:m})]})},vv=()=>{const{verifyWithToken:e}=dr.useAuth(),t=Ma.useNavigate(),r=Ma.useLocation();return g.useEffect(()=>{const o=new URLSearchParams(r.search).get("token");if(!o){t("/login",{replace:!0});return}(async()=>{const i=await e(o);t(i?"/main":"/login",{replace:!0})})()},[r.search]),c.jsx("div",{style:{display:"grid",placeItems:"center",height:"100dvh"},children:c.jsx(A.Spin,{tip:"인증중..."})})},bv=e=>{if(e==null)return"";const t=String(e).trim();return!t||t.toUpperCase()==="NULL"?"":t.toUpperCase()},ji=(e,t=0)=>{const r=Number(e);return Number.isFinite(r)?r:t};function ln(e){return{crprCd:e.crprCd||void 0,wkplCd:e.wkplCd||void 0,deptCd:bv(e.deptCd),deptNm:(e.deptNm??"").toString().trim(),hrnkDeptCd:e.hrnkDeptCd||null,hrnkDeptNm:e.hrnkDeptNm||null,deptGbCd:e.deptGbCd||null,deptLvl:ji(e.deptLvl,e.hrnkDeptCd?2:1),orgSortOrd:ji(e.orgSortOrd,0),orgOtptOrd:ji(e.orgOtptOrd,0),deptAbrv:e.deptAbrv||null,deptFullNm:e.deptFullNm||null,deptEnglNm:e.deptEnglNm||null,isLeaf:e.isLeaf||null}}function yv(e){const t=new Set,r=e.map(ln).filter(s=>s.deptCd).filter(s=>(s.deptCd===s.hrnkDeptCd&&(s.hrnkDeptCd=""),!0)).filter(s=>t.has(s.deptCd)?!1:(t.add(s.deptCd),!0));r.sort((s,l)=>(s.deptLvl||0)-(l.deptLvl||0)||(s.orgSortOrd||0)-(l.orgSortOrd||0)||s.deptCd.localeCompare(l.deptCd));const n=new Map;for(const s of r)n.set(s.deptCd,{...s,children:[]});const o=[];for(const s of r){const l=n.get(s.deptCd),u=s.hrnkDeptCd;u&&n.has(u)?n.get(u).children.push(l):o.push(l)}const i=s=>{!s||s.length===0||(s.sort((l,u)=>l.deptCd.localeCompare(u.deptCd)),s.forEach(l=>i(l.children)))};i(o);const a=s=>{if(!s.children||s.children.length===0){delete s.children;return}s.children.forEach(a)};if(o.forEach(a),o.length>1){const s=o.find(l=>l.deptCd==="D00");if(s)return[s]}return o}function xv(e){const t=e.map(ln),r=t.filter(n=>n.isLeaf!=="Y").map(n=>n.deptCd);return r.length>200?t.filter(n=>(n.deptLvl||0)<=2).map(n=>n.deptCd):r}const Au=({popup:e,onClose:t})=>{const[r,n]=g.useState(""),[o,i]=g.useState([]),[a,s]=g.useState([]),[l,u]=g.useState([]),[f,d]=g.useState(!1),p=g.useCallback(async y=>{try{d(!0);const E=await ot.callService("SCMUTIL00103",{...e?.popupParams,...y}),O=Array.isArray(E?.data)?E.data:Array.isArray(E?.deptList)?E.deptList:Array.isArray(E)?E:[],L=yv(O);u(L);const I=xv(O);i(I);const T=L[0]?.deptCd||ln(O.find(N=>ln(N).deptLvl===1)||{}).deptCd||ln(O[0]||{}).deptCd||"";s(T?[T]:[])}catch{A.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{d(!1)}},[e?.popupParams]);g.useEffect(()=>{p()},[p]);const w=g.useCallback((y,E)=>{for(const O of y){if(O.deptCd===E)return O;if(O.children){const L=w(O.children,E);if(L)return L}}return null},[]),b=g.useMemo(()=>{const y=a[0];return y?w(l,y):null},[a,l,w]),C=g.useMemo(()=>{const y=O=>O.map(L=>({title:L.deptNm,key:L.deptCd,meta:L,children:L.children?y(L.children):void 0}));return y(l)},[l]),m=g.useMemo(()=>{const y=r.trim().toLowerCase();if(!y)return C;const E=O=>O.map(L=>{const I=L.meta,T=(I?.deptNm||"").toLowerCase().includes(y)||(I?.deptCd||"").toLowerCase().includes(y),N=L.children?E(L.children):void 0;return T||N&&N.length?{...L,children:N}:null}).filter(Boolean);return E(C)},[C,r]),$=g.useCallback(y=>{s(y.slice(0,1).map(String))},[]),S=g.useCallback(y=>i(y.map(String)),[]),P=g.useCallback((y,E)=>{if(y.stopPropagation(),!E.children||E.children.length===0)return;const O=o.includes(E.key);i(L=>O?L.filter(I=>I!==E.key):[...L,E.key])},[o]),_=g.useCallback(()=>s([]),[]),j={confirm:()=>{if(!b){A.message.error("부서를 선택해주세요.");return}const y={deptCd:b.deptCd,deptNm:b.deptNm,hrnkDeptCd:b.hrnkDeptCd,hrnkDeptNm:b.hrnkDeptNm,deptLvl:b.deptLvl,orgSortOrd:b.orgSortOrd},E=e?.config;E?.onSelect?E.onSelect(y):e?.config?.callback&&e.config.callback(JSON.stringify(y)),E?.onClose&&E.onClose(),e?.close?.()},cancel:()=>{const y=e?.config;y?.onCancel&&y.onCancel(),e?.close?.()}};return c.jsx(Sn,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{j.confirm()}}],popupEvent:j,onClose:()=>{e?.close?.(),t?.()},children:c.jsx(Nt,{children:c.jsx(fr,{border:!1,style:{paddingBottom:20},children:c.jsxs(A.Splitter,{layout:"vertical",style:{height:"100%"},children:[c.jsxs(A.Splitter.Panel,{defaultSize:"70%",min:"70%",max:"75%",children:[c.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:c.jsxs(A.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[c.jsx(Vt,{title:"조직도"}),c.jsx(A.Row,{gutter:[16,16],children:c.jsx(A.Col,{span:24,children:c.jsx(A.Input,{placeholder:"부서명, 부서코드 검색",prefix:c.jsx(ce.SearchOutlined,{}),value:r,allowClear:!0,onChange:y=>n(y.target.value)})})})]})}),c.jsx("div",{style:{padding:16,overflowY:"hidden"},children:c.jsx(A.Spin,{spinning:f,children:c.jsx(A.Tree,{treeData:m,expandedKeys:o,selectedKeys:a,onSelect:$,onExpand:S,onDoubleClick:P,showLine:!0,showIcon:!1,selectable:!0,style:{overflow:"hidden"},titleRender:y=>{const E=y.meta;return c.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%",fontWeight:a.includes(y.key)?"bold":"normal"},children:[c.jsx("span",{children:E.deptNm}),c.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:E.deptCd})]})}})})})]}),c.jsx(A.Splitter.Panel,{collapsible:!0,children:c.jsxs("div",{style:{padding:16,overflowY:"hidden",height:"100%"},children:[c.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:16,fontWeight:700},children:"선택된 부서"}),b?c.jsxs("div",{style:{display:"flex",alignItems:"center",padding:14,border:"1px solid #e0e0e0",borderRadius:12,background:"#fafafa"},children:[c.jsx("div",{style:{width:42,height:42,borderRadius:"50%",border:"1px solid #e6e6e6",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:18,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:c.jsx(ce.TeamOutlined,{})}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsxs("div",{style:{fontSize:15,fontWeight:700,marginBottom:4},children:[b.deptNm," ",c.jsxs("span",{style:{color:"#8c8c8c",fontSize:12},children:["(",b.deptCd,")"]})]}),c.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:2},children:["상위부서: ",b.hrnkDeptNm||"-"]})]}),c.jsx(A.Button,{type:"text",onClick:_,icon:c.jsx(ce.RestOutlined,{style:{fontSize:24,color:"#FF6363"}})})]}):c.jsx("div",{style:{color:"#999",fontSize:14},children:"부서를 선택해주세요."})]})})]})})})})},Cv=Object.freeze(Object.defineProperty({__proto__:null,default:Au},Symbol.toStringTag,{value:"Module"})),Sv=e=>{if(e==null)return"";const t=String(e).trim();return!t||t.toUpperCase()==="NULL"?"":t.toUpperCase()},Ri=(e,t=0)=>{const r=Number(e);return Number.isFinite(r)?r:t};function cn(e){return{crprCd:e.crprCd||void 0,wkplCd:e.wkplCd||void 0,deptCd:Sv(e.deptCd),deptNm:(e.deptNm??"").toString().trim(),hrnkDeptCd:e.hrnkDeptCd||null,hrnkDeptNm:e.hrnkDeptNm||null,deptGbCd:e.deptGbCd||null,deptLvl:Ri(e.deptLvl,e.hrnkDeptCd?2:1),orgSortOrd:Ri(e.orgSortOrd,0),orgOtptOrd:Ri(e.orgOtptOrd,0),deptAbrv:e.deptAbrv||null,deptFullNm:e.deptFullNm||null,deptEnglNm:e.deptEnglNm||null,isLeaf:e.isLeaf||null}}function wv(e){const t=new Set,r=e.map(cn).filter(s=>s.deptCd).filter(s=>(s.deptCd===s.hrnkDeptCd&&(s.hrnkDeptCd=""),!0)).filter(s=>t.has(s.deptCd)?!1:(t.add(s.deptCd),!0));r.sort((s,l)=>(s.deptLvl||0)-(l.deptLvl||0)||(s.orgSortOrd||0)-(l.orgSortOrd||0)||s.deptCd.localeCompare(l.deptCd));const n=new Map;for(const s of r)n.set(s.deptCd,{...s,children:[]});const o=[];for(const s of r){const l=n.get(s.deptCd),u=s.hrnkDeptCd;u&&n.has(u)?n.get(u).children.push(l):o.push(l)}const i=s=>{!s||s.length===0||(s.sort((l,u)=>l.deptCd.localeCompare(u.deptCd)),s.forEach(l=>i(l.children)))};i(o);const a=s=>{if(!s.children||s.children.length===0){delete s.children;return}s.children.forEach(a)};if(o.forEach(a),o.length>1){const s=o.find(l=>l.deptCd==="D00");if(s)return[s]}return o}function Ev(e){const t=e.map(cn),r=t.filter(n=>n.isLeaf!=="Y").map(n=>n.deptCd);return r.length>200?t.filter(n=>(n.deptLvl||0)<=2).map(n=>n.deptCd):r}const Mu=({popup:e,onClose:t})=>{const[r,n]=g.useState(""),[o,i]=g.useState(""),[a,s]=g.useState([]),[l,u]=g.useState([]),[f,d]=g.useState([]),[p,w]=g.useState(!1),[b,C]=g.useState([]),[m,$]=g.useState(!1),S=g.useCallback(async v=>{try{$(!0);const x=await ot.callService("SCMUTIL00103",{...e?.popupParams,...v}),k=Array.isArray(x?.data)?x.data:Array.isArray(x?.deptList)?x.deptList:Array.isArray(x)?x:[],M=wv(k);C(M);const D=Ev(k);s(D);const F=M[0]?.deptCd||cn(k.find(U=>cn(U).deptLvl===1)||{}).deptCd||cn(k[0]||{}).deptCd||"";u(F?[F]:[])}catch{A.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{$(!1)}},[e?.popupParams]);g.useEffect(()=>{S()},[S]);const P=g.useCallback((v,x)=>{for(const k of v){if(k.deptCd===x)return k;if(k.children){const M=P(k.children,x);if(M)return M}}return null},[b]),_=g.useMemo(()=>f.map(v=>{const x=P(b,v);if(!x)return null;const{children:k,...M}=x;return M}).filter(Boolean),[f,b,P]),j=g.useMemo(()=>{const v=x=>x.map(k=>({title:k.deptNm,key:k.deptCd,meta:k,children:k.children?v(k.children):void 0,isLeaf:!k.children||k.children.length===0}));return v(b)},[b]),y=g.useMemo(()=>{const v=r.trim().toLowerCase();if(!v)return j;const x=k=>k.map(M=>{const D=M.meta,F=(D?.deptNm||"").toLowerCase().includes(v)||(D?.deptCd||"").toLowerCase().includes(v),U=M.children?x(M.children):void 0;return F||U&&U.length>0?{...M,children:U}:null}).filter(Boolean);return x(j)},[j,r]),E=g.useCallback(v=>{const x=[],k=M=>{for(const D of M)if(D.deptCd===v&&D.children){const F=U=>{for(const V of U)x.push(V.deptCd),V.children&&F(V.children)};F(D.children)}else D.children&&k(D.children)};return k(b),x},[b]),O=g.useCallback((v,x)=>{let k=Array.isArray(v)?v:v?.checked??[];if(p&&x?.node?.key){const M=x.node.key,D=E(M);if(x.checked){const F=new Set(k);for(const U of D)F.add(U);k=Array.from(F)}else{const F=new Set([M,...D]);k=k.filter(U=>!F.has(U))}}d(k)},[p,E]),L=g.useCallback(v=>{const x=v.map(String);if(u(x),x.length>0){const k=x[0],M=(F,U)=>{for(const V of F){if(V.deptCd===U)return V.deptNm;if(V.children){const Z=M(V.children,U);if(Z)return Z}}return null},D=M(b,k);D&&i(D)}},[b]),I=g.useCallback(v=>s(v.map(String)),[]),T=g.useCallback((v,x)=>{if(v.stopPropagation(),x.children&&x.children.length>0){const k=a.includes(x.key);s(M=>k?M.filter(D=>D!==x.key):[...M,x.key])}},[a]),N=g.useCallback(v=>{d(x=>x.filter(k=>k!==v))},[]),z=g.useCallback(()=>{d([])},[]),B={confirm:()=>{if(f.length===0){A.message.error("부서를 선택해주세요.");return}const x=Array.from(new Set(f)).map(M=>{const D=P(b,M);return D?{deptCd:D.deptCd,deptNm:D.deptNm,hrnkDeptCd:D.hrnkDeptCd,hrnkDeptNm:D.hrnkDeptNm}:null}).filter(Boolean),k=e?.config;k?.onSelect?k.onSelect(x):e?.config?.callback&&e.config.callback(JSON.stringify(x)),k?.onClose&&k.onClose(),e?.close?.()},cancel:()=>{const v=e?.config;v?.onCancel&&v.onCancel(),e?.close?.()}};return c.jsx(Sn,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{B.confirm()}}],popupEvent:B,onClose:()=>{e?.close?.(),t?.()},children:c.jsx(Nt,{children:c.jsx(fr,{border:!1,style:{paddingBottom:20},children:c.jsxs(A.Splitter,{layout:"vertical",style:{height:"100%"},children:[c.jsxs(A.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[c.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:c.jsxs(A.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[c.jsx(Vt,{title:"조직도"}),c.jsx("div",{style:{fontSize:14,color:"#666",padding:8,backgroundColor:"#f8f8f8",borderRadius:4},children:o}),c.jsxs(A.Row,{gutter:[16,16],children:[c.jsx(A.Col,{span:18,children:c.jsx(A.Input,{placeholder:"부서명, 부서장명, 부서코드 검색",prefix:c.jsx(ce.SearchOutlined,{}),value:r,allowClear:!0,onChange:v=>n(v.target.value)})}),c.jsx(A.Col,{span:6,style:{justifyContent:"center",display:"flex",alignItems:"center"},children:c.jsx(A.Checkbox,{checked:p,onChange:v=>w(v.target.checked),children:"하위까지 선택"})})]})]})}),c.jsx("div",{style:{padding:16,overflowY:"hidden"},children:c.jsx(A.Spin,{spinning:m,children:c.jsx(A.Tree,{className:"bwg-ogrn-tree",treeData:y,expandedKeys:a,selectedKeys:l,checkedKeys:f,checkable:!0,checkStrictly:!0,showLine:!0,showIcon:!1,selectable:!0,onSelect:L,onExpand:I,onCheck:O,onDoubleClick:T,style:{overflow:"hidden"},titleRender:v=>{const x=v.meta;return c.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%"},children:[c.jsx("span",{style:{fontWeight:l.includes(v.key)?"bold":"normal"},children:x.deptNm}),c.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:x.deptCd})]})}})})})]}),c.jsx(A.Splitter.Panel,{collapsible:!0,children:c.jsxs("div",{style:{padding:16,overflowY:"hidden"},children:[c.jsxs("div",{style:{marginBottom:12,display:"flex",alignItems:"center",gap:8},children:[c.jsxs("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:["선택된 부서 (",_.length,"개)"]}),_.length>0&&c.jsx("button",{onClick:z,style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",fontSize:12,padding:4},title:"전체 해제",children:"전체 해제"})]}),c.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"flex-start",minHeight:48},children:_.length===0?c.jsx("div",{style:{color:"#999",fontSize:14},children:"선택된 부서가 없습니다."}):_.map(v=>c.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:999,border:"1px solid #e6e6e6",background:"#fafafa",lineHeight:1.1,cursor:"default",maxWidth:260},title:`${v.deptNm}`,children:[c.jsx("span",{style:{width:18,height:18,borderRadius:"50%",border:"1px solid #e6e6e6",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:c.jsx(ce.TeamOutlined,{})}),c.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:2,overflow:"hidden"},children:[c.jsx("span",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:v.deptNm}),c.jsx("span",{style:{fontSize:11,color:"#8c8c8c",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:v.deptCd})]}),c.jsx("button",{onClick:()=>N(v.deptCd),style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",padding:2,lineHeight:0},"aria-label":`${v.deptNm} 선택 해제`,title:"선택 해제",children:"×"})]},v.deptCd))})]})})]})})})})},jv=Object.freeze(Object.defineProperty({__proto__:null,default:Mu},Symbol.toStringTag,{value:"Module"})),Iu=({popup:e,onClose:t})=>{const[r,n]=g.useState(""),[o,i]=g.useState(""),[a,s]=g.useState([]),[l,u]=g.useState([]),[f,d]=g.useState(null),[p,w]=g.useState([]),[b,C]=g.useState(!1),m=g.useCallback(async()=>{try{C(!0);const T=await ot.callService("SCMUTIL00105",{...e?.popupParams});console.log("📊 조직도 API 응답:",T);const N=Array.isArray(T?.data)?T.data:Array.isArray(T?.orgnList)?T.orgnList:Array.isArray(T)?T:[];if(N.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const z=$(N);console.log("🌳 구성된 조직도 트리:",z),w(z);const B=N.filter(v=>v.deptLvl<=2).map(v=>v.deptCd);if(s(B),z.length>0){const v=z[0];u([v.deptCd]),i(v.deptNm)}console.log("✅ 조직도 데이터 로딩 완료")}catch(T){console.error("❌ 조직도 데이터 로딩 실패:",T),A.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{C(!1)}},[e?.popupParams]),$=g.useCallback(T=>{const N=[...T].sort((x,k)=>x.deptLvl-k.deptLvl||x.orgSortOrd-k.orgSortOrd||x.deptCd.localeCompare(k.deptCd)),z=new Map;for(const x of N)z.set(x.deptCd,{...x,children:[]});const B=[];for(const x of N){const k=z.get(x.deptCd),M=x.hrnkDeptCd;M&&z.has(M)?z.get(M).children.push(k):B.push(k)}const v=x=>{if(!x.children||x.children.length===0){delete x.children;return}x.children.forEach(v)};return B.forEach(v),B},[]);g.useEffect(()=>{m()},[m]);const S=g.useMemo(()=>{const T=B=>{let v=[];return B.forEach(x=>{x.employees&&(v=v.concat(x.employees)),x.children&&(v=v.concat(T(x.children)))}),v},N=T(p),z=N.filter((B,v,x)=>v===x.findIndex(k=>k.empNo===B.empNo));return console.log(`👥 전체 사원 수: ${N.length}, 중복 제거 후: ${z.length}`),z},[p]),P=g.useMemo(()=>{const T=N=>N.map(z=>({title:z.deptNm,key:z.deptCd,children:z.children?T(z.children):void 0,isLeaf:!z.children||z.children.length===0}));return T(p)},[p]),_=g.useMemo(()=>{if(!r.trim())return P;const T=N=>N.map(z=>{const B=z.title.toLowerCase().includes(r.toLowerCase()),v=z.children?T(z.children):void 0;return B||v&&v.length>0?{...z,children:v}:null}).filter(Boolean);return T(P)},[P,r]),j=g.useMemo(()=>{if(!r.trim()){const T=x=>{let k=[];return x.forEach(M=>{M.employees&&(k=k.concat(M.employees)),M.children&&(k=k.concat(T(M.children)))}),k},N=(x,k)=>{for(const M of x){if(M.deptCd===k){let D=[...M.employees||[]];return M.children&&(D=D.concat(T(M.children))),D}if(M.children){const D=N(M.children,k);if(D.length>0)return D}}return[]},z=l[0];if(!z)return[];const B=N(p,z),v=B.filter((x,k,M)=>k===M.findIndex(D=>D.empNo===x.empNo));return console.log(`🔍 선택된 부서: ${z}, 반환된 사원 수: ${B.length}, 중복 제거 후: ${v.length}`),v}return S.filter(T=>T.empNm.toLowerCase().includes(r.toLowerCase())||T.empNo.toLowerCase().includes(r.toLowerCase())||T.deptNm.toLowerCase().includes(r.toLowerCase())||T.jbpsCd.includes(r)||T.jbgdCd.includes(r)||T.emplyStCd.includes(r))},[r,l,S,p]),y=g.useCallback(T=>{d(T)},[]),E=g.useCallback(T=>{const N=T.map(String);if(console.log(`🌳 트리 선택: ${N.join(", ")}`),u(N),N.length>0){const z=N[0],B=(x,k)=>{for(const M of x){if(M.deptCd===k)return M.deptNm;if(M.children){const D=B(M.children,k);if(D)return D}}return null},v=B(p,z);v&&i(v)}},[p]),O=g.useCallback(T=>{s(T.map(String))},[]),L=g.useCallback((T,N)=>{if(T.stopPropagation(),N.children&&N.children.length>0){const z=a.includes(N.key);s(z?B=>B.filter(v=>v!==N.key):B=>[...B,N.key])}},[a]),I={confirm:()=>{if(f){const T=e?.config;T?.onSelect?T.onSelect(f):e?.popupParams?.onSelect?e.popupParams.onSelect(f):e?.config?.callback&&e.config.callback(JSON.stringify(f,null,2)),T?.onClose&&T.onClose(),e?.close?.()}else A.message.error("사원을 선택해주세요.")},cancel:()=>{const T=e?.config;T?.onCancel&&T.onCancel(),e?.close?.()}};return c.jsx(Sn,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{I.confirm()}}],popupEvent:I,onClose:()=>{e?.close?.(),t?.()},children:c.jsx(Nt,{children:c.jsx(fr,{border:!1,style:{paddingBottom:20},children:c.jsxs(A.Splitter,{layout:"vertical",style:{height:"100%"},children:[c.jsxs(A.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[c.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:c.jsxs(A.Flex,{gap:8,vertical:!0,style:{marginBottom:"6px"},children:[c.jsx(Vt,{title:"조직도"}),c.jsx(A.Input,{placeholder:"이름, 소속, 전화번호 검색",prefix:c.jsx(ce.SearchOutlined,{}),value:r,allowClear:!0,onChange:T=>n(T.target.value)})]})}),c.jsx("div",{style:{padding:"16px",overflowY:"hidden"},children:c.jsx(A.Spin,{spinning:b,children:c.jsx(A.Tree,{className:"bwg-ogrn-tree",treeData:_,expandedKeys:a,selectedKeys:l,onSelect:E,onExpand:O,onDoubleClick:L,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:T=>c.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontWeight:l.includes(T.key)?"bold":"normal",display:"inline-block",width:"100%"},children:T.title})})})})]}),c.jsx(A.Splitter.Panel,{collapsible:!0,children:c.jsxs("div",{style:{padding:"16px",overflowY:"hidden"},children:[c.jsx("div",{style:{marginBottom:"16px"},children:c.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"bold"},children:r?"검색 결과":o})}),c.jsxs("div",{style:{overflow:"hidden",height:"100%"},children:[j.map(T=>c.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px",border:"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"8px",cursor:"pointer",backgroundColor:f&&f.crprCd===T.crprCd&&f.wkplCd===T.wkplCd&&f.empNo===T.empNo&&f.jbpsCd===T.jbpsCd&&f.jbgdCd===T.jbgdCd&&f.empMarkOrd===T.empMarkOrd?"#efebff":"white"},onClick:()=>y(T),children:[c.jsx("div",{style:{marginRight:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px"},onClick:N=>{N.stopPropagation(),d(T)},children:f&&f.crprCd===T.crprCd&&f.wkplCd===T.wkplCd&&f.empNo===T.empNo&&f.jbpsCd===T.jbpsCd&&f.jbgdCd===T.jbgdCd&&f.empMarkOrd===T.empMarkOrd?c.jsx(ce.CheckCircleFilled,{style:{fontSize:"20px",color:"#6449fc"}}):c.jsx(ce.CheckCircleOutlined,{style:{fontSize:"20px",color:"#d9d9d9"}})}),c.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",fontSize:"18px",color:"#666"},children:c.jsx(ce.UserOutlined,{})}),c.jsxs("div",{style:{flex:1},children:[c.jsxs("div",{style:{fontSize:"14px",fontWeight:"bold",marginBottom:"4px"},children:[T.empNm,c.jsxs("span",{style:{fontSize:"12px",fontWeight:"normal",color:"#666",marginLeft:"8px"},children:["(",T.empNo,")"]})]}),c.jsxs("div",{style:{fontSize:"12px",color:"#666",marginBottom:"2px"},children:[T.deptNm," (",T.deptCd,") | 직급:"," ",T.jbpsCd," | 등급: ",T.jbgdCd]})]})]},`emp-${T.crprCd}-${T.wkplCd}-${T.empNo}-${T.jbpsCd}-${T.jbgdCd}-${T.empMarkOrd}`)),j.length===0&&c.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#999",fontSize:"14px"},children:r?"검색 결과가 없습니다.":"해당 부서에 직원이 없습니다."})]})]})})]})})})})},Rv=Object.freeze(Object.defineProperty({__proto__:null,default:Iu},Symbol.toStringTag,{value:"Module"})),Du=({popup:e,onClose:t})=>{const[r,n]=g.useState(""),[o,i]=g.useState(""),[a,s]=g.useState([]),[l,u]=g.useState([]),[f,d]=g.useState([]),[p,w]=g.useState(!1),[b,C]=g.useState({}),m=g.useCallback(async()=>{try{w(!0);const v=await ot.callService("SCMUTIL00105",{...e?.popupParams});console.log("📊 조직도 API 응답:",v);const x=Array.isArray(v?.data)?v.data:Array.isArray(v?.orgnList)?v.orgnList:Array.isArray(v)?v:[];if(x.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const k=$(x);console.log("🌳 구성된 조직도 트리:",k),d(k);const M=x.filter(D=>D.deptLvl<=2).map(D=>D.deptCd);if(s(M),k.length>0){const D=k[0];u([D.deptCd]),i(D.deptNm)}console.log("✅ 조직도 데이터 로딩 완료")}catch(v){console.error("❌ 조직도 데이터 로딩 실패:",v),A.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{w(!1)}},[e?.popupParams]),$=g.useCallback(v=>{const x=[...v].sort((F,U)=>F.deptLvl-U.deptLvl||F.orgSortOrd-U.orgSortOrd||F.deptCd.localeCompare(U.deptCd)),k=new Map;for(const F of x)k.set(F.deptCd,{...F,children:[]});const M=[];for(const F of x){const U=k.get(F.deptCd),V=F.hrnkDeptCd;V&&k.has(V)?k.get(V).children.push(U):M.push(U)}const D=F=>{if(!F.children||F.children.length===0){delete F.children;return}F.children.forEach(D)};return M.forEach(D),M},[]);g.useEffect(()=>{m()},[m]);const S=g.useMemo(()=>{const v=M=>{let D=[];return M.forEach(F=>{F.employees&&(D=D.concat(F.employees)),F.children&&(D=D.concat(v(F.children)))}),D},x=v(f),k=x.filter((M,D,F)=>D===F.findIndex(U=>U.empNo===M.empNo));return console.log(`👥 전체 사원 수: ${x.length}, 중복 제거 후: ${k.length}`),k},[f]),P=g.useMemo(()=>{const v=x=>x.map(k=>({title:k.deptNm,key:k.deptCd,children:k.children?v(k.children):void 0,isLeaf:!k.children||k.children.length===0}));return v(f)},[f]),_=g.useMemo(()=>{if(!r.trim())return P;const v=x=>x.map(k=>{const M=k.title.toLowerCase().includes(r.toLowerCase()),D=k.children?v(k.children):void 0;return M||D&&D.length>0?{...k,children:D}:null}).filter(Boolean);return v(P)},[P,r]),j=g.useMemo(()=>{if(!r.trim()){const v=F=>{let U=[];return F.forEach(V=>{V.employees&&(U=U.concat(V.employees)),V.children&&(U=U.concat(v(V.children)))}),U},x=(F,U)=>{for(const V of F){if(V.deptCd===U){let Z=[...V.employees||[]];return V.children&&(Z=Z.concat(v(V.children))),Z}if(V.children){const Z=x(V.children,U);if(Z.length>0)return Z}}return[]},k=l[0];if(!k)return[];const M=x(f,k),D=M.filter((F,U,V)=>U===V.findIndex(Z=>Z.empNo===F.empNo));return console.log(`🔍 선택된 부서: ${k}, 반환된 사원 수: ${M.length}, 중복 제거 후: ${D.length}`),D}return S.filter(v=>v.empNm.toLowerCase().includes(r.toLowerCase())||v.empNo.toLowerCase().includes(r.toLowerCase())||v.deptNm.toLowerCase().includes(r.toLowerCase())||v.jbpsCd.includes(r)||v.jbgdCd.includes(r)||v.emplyStCd.includes(r))},[r,l,S,f]),y=g.useCallback(v=>{C(x=>{const k={...x};return k[v.empNo]?delete k[v.empNo]:k[v.empNo]=v,k})},[]),E=g.useCallback(v=>{C(x=>{const k={...x};return delete k[v],k})},[]),O=g.useCallback(()=>C({}),[]),L=g.useCallback(()=>{C(v=>{const x={...v};for(const k of j)x[k.empNo]=k;return x})},[j]),I=g.useCallback(()=>{C(v=>{const x={...v};for(const k of j)delete x[k.empNo];return x})},[j]),T=g.useCallback(v=>{const x=v.map(String);if(console.log(`🌳 트리 선택: ${x.join(", ")}`),u(x),x.length>0){const k=x[0],M=(F,U)=>{for(const V of F){if(V.deptCd===U)return V.deptNm;if(V.children){const Z=M(V.children,U);if(Z)return Z}}return null},D=M(f,k);D&&i(D)}},[f]),N=g.useCallback(v=>{s(v.map(String))},[]),z=g.useCallback((v,x)=>{if(v.stopPropagation(),!x.children||!x.children.length)return;const k=a.includes(x.key);s(M=>k?M.filter(D=>D!==x.key):[...M,x.key])},[a]),B={confirm:()=>{const v=Object.values(b).map(k=>({crprCd:k.crprCd,wkplCd:k.wkplCd,empNo:k.empNo,deptCd:k.deptCd,deptNm:k.deptNm,empNm:k.empNm,jbpsCd:k.jbpsCd,jbgdCd:k.jbgdCd,empMarkOrd:k.empMarkOrd,emplyStCd:k.emplyStCd}));if(v.length===0){A.message.error("직원을 선택해주세요.");return}const x=e?.config;x?.onSelect?x.onSelect(v):e?.config?.callback&&e.config.callback(JSON.stringify(v)),x?.onClose&&x.onClose(),e?.close?.()},cancel:()=>{const v=e?.config;v?.onCancel&&v.onCancel(),e?.close?.()}};return c.jsx(Sn,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{B.confirm()}}],popupEvent:B,onClose:()=>{e?.close?.(),t?.()},children:c.jsx(Nt,{children:c.jsx(fr,{border:!1,style:{paddingBottom:20},children:c.jsxs(A.Splitter,{style:{height:"100%"},children:[c.jsx(A.Splitter.Panel,{defaultSize:"50%",min:"50%",max:"70%",children:c.jsxs(A.Splitter,{layout:"vertical",style:{height:"100%"},children:[c.jsxs(A.Splitter.Panel,{defaultSize:"60%",min:"35%",max:"75%",children:[c.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:c.jsxs(A.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[c.jsx(Vt,{title:"조직도"}),c.jsx(A.Input,{placeholder:"이름, 소속, 직급/직위, 사번 검색",prefix:c.jsx(ce.SearchOutlined,{}),value:r,allowClear:!0,onChange:v=>n(v.target.value)})]})}),c.jsx("div",{style:{padding:16,overflowY:"hidden"},children:c.jsx(A.Spin,{spinning:p,children:c.jsx(A.Tree,{className:"bwg-ogrn-tree",treeData:_,expandedKeys:a,selectedKeys:l,onSelect:T,onExpand:N,onDoubleClick:z,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:v=>c.jsx("span",{style:{padding:"4px 8px",borderRadius:4,fontWeight:l.includes(v.key)?"bold":"normal",display:"inline-block",width:"100%"},children:v.title})})})})]}),c.jsx(A.Splitter.Panel,{children:c.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:r?"검색 결과":`${o} 사용자`}),c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsx(A.Button,{size:"small",onClick:L,children:"현재 목록 전체 선택"}),c.jsx(A.Button,{size:"small",onClick:I,children:"현재 목록 전체 해제"})]})]}),c.jsx(A.Divider,{style:{margin:"8px 0"}}),c.jsxs("div",{style:{overflowY:"auto"},children:[j.map(v=>{const x=!!b[v.empNo];return c.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,cursor:"pointer",background:x?"#efebff":"#fff"},onClick:()=>y(v),children:[c.jsx("div",{style:{marginRight:12,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center"},onClick:k=>{k.stopPropagation(),y(v)},children:x?c.jsx(ce.CheckCircleFilled,{style:{fontSize:20,color:"#6449fc"}}):c.jsx(ce.CheckCircleOutlined,{style:{fontSize:20,color:"#d9d9d9"}})}),c.jsx("div",{style:{width:36,height:36,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:16,color:"#666",flex:"0 0 auto"},children:c.jsx(ce.UserOutlined,{})}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsxs("div",{style:{fontSize:14,fontWeight:600,marginBottom:2},children:[v.empNm,c.jsxs("span",{style:{fontSize:12,fontWeight:"normal",color:"#666",marginLeft:"8px"},children:["(",v.empNo,")"]})]}),c.jsxs("div",{style:{fontSize:12,color:"#666"},children:[v.deptNm," (",v.deptCd,") | 직급: ",v.jbpsCd," ","| 등급: ",v.jbgdCd]})]})]},`emp-${v.crprCd}-${v.wkplCd}-${v.empNo}-${v.jbpsCd}-${v.jbgdCd}-${v.empMarkOrd}`)}),j.length===0&&c.jsx("div",{style:{textAlign:"center",padding:32,color:"#999",fontSize:14},children:r?"검색 결과가 없습니다.":"해당 부서에 사용자 없음"})]})]})})]})}),c.jsx(A.Splitter.Panel,{collapsible:!0,children:c.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsx(Vt,{title:`선택된 사용자 (${Object.keys(b).length})`}),c.jsx(A.Button,{type:"link",size:"small",onClick:O,children:"전체 해제"})]}),c.jsx(A.Divider,{style:{margin:"8px 0"}}),c.jsxs("div",{style:{overflowY:"auto",flex:1},children:[Object.values(b).map(v=>c.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,background:"#fafafa"},children:[c.jsx("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:10,color:"#666"},children:c.jsx(ce.UserOutlined,{})}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsxs("div",{style:{fontSize:13,fontWeight:600,marginBottom:2},children:[v.empNm,c.jsxs("span",{style:{fontSize:11,fontWeight:"normal",color:"#666",marginLeft:"6px"},children:["(",v.empNo,")"]})]}),c.jsxs("div",{style:{fontSize:12,color:"#666"},children:[v.deptNm," (",v.deptCd,") | 직급: ",v.jbpsCd," | 등급: ",v.jbgdCd]})]}),c.jsx(A.Button,{type:"text",shape:"circle",icon:c.jsx(ce.CloseOutlined,{}),onClick:()=>E(v.empNo)})]},`selected-${v.crprCd}-${v.wkplCd}-${v.empNo}-${v.jbpsCd}-${v.jbgdCd}-${v.empMarkOrd}`)),Object.keys(b).length===0&&c.jsx("div",{style:{color:"#999",fontSize:14,textAlign:"center",padding:24},children:"선택된 사용자가 없습니다."})]})]})})]})})})})},$v=Object.freeze(Object.defineProperty({__proto__:null,default:Du},Symbol.toStringTag,{value:"Module"}));exports.ButtonAccessController=$i;exports.BwgButtonGroup=Wu;exports.BwgCmptArea=Ku;exports.BwgCol=qu;exports.BwgConfigProvider=jl;exports.BwgDetail=od;exports.BwgDrawer=id;exports.BwgEditor=cd;exports.BwgGrid=bd;exports.BwgInfoArea=xd;exports.BwgPagination=ca;exports.BwgPopup=Sn;exports.BwgRow=Sd;exports.BwgSpace=wd;exports.BwgTable=Ed;exports.BwgTabs=jd;exports.BwgTitleBox=Vt;exports.BwgView=dv;exports.ContentBox=fr;exports.ContentLayOut=Nt;exports.GlobalConfigProvider=fv;exports.QuickServiceToggle=mv;exports.SSOHandler=vv;exports.SearchBox=la;exports.SearchDepartmentP01=Au;exports.SearchDepartmentP01$1=Cv;exports.SearchDepartmentP02=Mu;exports.SearchDepartmentP02$1=jv;exports.SearchOrganizationP01=Iu;exports.SearchOrganizationP01$1=Rv;exports.SearchOrganizationP02=Du;exports.SearchOrganizationP02$1=$v;exports.commonjsGlobal=Fu;exports.createBwgGridRenderer=yd;exports.getAugmentedNamespace=Vu;exports.getDefaultExportFromCjs=xo;
|