선거문자 임시 대량발송 프로세스 화면 개발 - 임시화면 1차 개발 완료 커밋
- 임시화면 1차 개발 완료 커밋
@859649f13cbcc32e571fa07e7e427bcc053d1af2
--- src/main/java/itn/let/mjo/msgcampain/web/MjonMsgCampainDataController.java
+++ src/main/java/itn/let/mjo/msgcampain/web/MjonMsgCampainDataController.java
... | ... | @@ -1733,11 +1733,13 @@ |
| 1733 | 1733 |
* @return |
| 1734 | 1734 |
* @throws Exception |
| 1735 | 1735 |
*/ |
| 1736 |
- @RequestMapping(value= {"/web/mjon/msgcampain/selectAddrGroupListAjax.do"})
|
|
| 1736 |
+ @RequestMapping(value= {"/web/mjon/msgcampain/selectAddrGroupListAjax.do" , "/web/mjon/msgcampain/huge/selectAddrGroupListAjax.do"
|
|
| 1737 |
+ }) |
|
| 1737 | 1738 |
public String selectAddrGroupListAjax( |
| 1738 | 1739 |
@ModelAttribute("searchVO") AddrGroupVO addrGroupVO,
|
| 1739 | 1740 |
AddrVO addrVO, |
| 1740 | 1741 |
ModelMap model, |
| 1742 |
+ HttpServletRequest request, |
|
| 1741 | 1743 |
RedirectAttributes redirectAttributes) throws Exception {
|
| 1742 | 1744 |
|
| 1743 | 1745 |
//로그인 권한정보 불러오기 |
... | ... | @@ -1783,7 +1785,14 @@ |
| 1783 | 1785 |
|
| 1784 | 1786 |
model.addAttribute("addrGroupList", addrGroupList);
|
| 1785 | 1787 |
|
| 1786 |
- return "web/msgcampain/addr/MsgAddrGroupListAjax"; |
|
| 1788 |
+ String jspUrl = "web/msgcampain/addr/MsgAddrGroupListAjax"; |
|
| 1789 |
+ |
|
| 1790 |
+ if("/web/mjon/msgcampain/huge/selectAddrGroupListAjax.do".equals(request.getRequestURI())) {
|
|
| 1791 |
+ |
|
| 1792 |
+ jspUrl = "web/msgcampain/addr/huge/MsgHGAddrGroupListAjax"; |
|
| 1793 |
+ } |
|
| 1794 |
+ |
|
| 1795 |
+ return jspUrl; |
|
| 1787 | 1796 |
} |
| 1788 | 1797 |
|
| 1789 | 1798 |
|
+++ src/main/java/itn/let/mjo/msgcampain/web/MjonMsgCampainHGDataController.java
... | ... | @@ -0,0 +1,540 @@ |
| 1 | +package itn.let.mjo.msgcampain.web; | |
| 2 | + | |
| 3 | +import java.math.BigDecimal; | |
| 4 | +import java.math.RoundingMode; | |
| 5 | +import java.text.SimpleDateFormat; | |
| 6 | +import java.util.ArrayList; | |
| 7 | +import java.util.Calendar; | |
| 8 | +import java.util.Date; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +import javax.annotation.Resource; | |
| 12 | +import javax.servlet.http.HttpServletRequest; | |
| 13 | + | |
| 14 | +import org.springframework.beans.factory.annotation.Value; | |
| 15 | +import org.springframework.stereotype.Controller; | |
| 16 | +import org.springframework.ui.ModelMap; | |
| 17 | +import org.springframework.web.bind.annotation.ModelAttribute; | |
| 18 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 19 | + | |
| 20 | +import egovframework.rte.fdl.idgnr.EgovIdGnrService; | |
| 21 | +import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; | |
| 22 | +import egovframework.rte.psl.dataaccess.util.EgovMap; | |
| 23 | +import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; | |
| 24 | +import itn.com.cmm.ComDefaultCodeVO; | |
| 25 | +import itn.com.cmm.EgovMessageSource; | |
| 26 | +import itn.com.cmm.LoginVO; | |
| 27 | +import itn.com.cmm.service.EgovCmmUseService; | |
| 28 | +import itn.com.cmm.service.EgovFileMngService; | |
| 29 | +import itn.com.cmm.service.EgovFileMngUtil; | |
| 30 | +import itn.com.cmm.util.MJUtil; | |
| 31 | +import itn.com.utl.fcc.service.EgovStringUtil; | |
| 32 | +import itn.let.lett.service.HashConfVO; | |
| 33 | +import itn.let.lett.service.LetterService; | |
| 34 | +import itn.let.lett.service.LetterVO; | |
| 35 | +import itn.let.mjo.addr.service.AddrGroupService; | |
| 36 | +import itn.let.mjo.addr.service.AddrService; | |
| 37 | +import itn.let.mjo.addr.service.AddrVO; | |
| 38 | +import itn.let.mjo.event.service.MjonEventService; | |
| 39 | +import itn.let.mjo.event.service.MjonEventVO; | |
| 40 | +import itn.let.mjo.msg.service.MjonMsgService; | |
| 41 | +import itn.let.mjo.msgcampain.service.MjonCandidateService; | |
| 42 | +import itn.let.mjo.msgcampain.service.MjonCandidateVO; | |
| 43 | +import itn.let.mjo.msgdata.service.MjonMsgDataService; | |
| 44 | +import itn.let.mjo.msgdata.service.MjonMsgDataVO; | |
| 45 | +import itn.let.mjo.pay.service.MjonPayService; | |
| 46 | +import itn.let.mjo.spammsg.service.MjonSpamMsgService; | |
| 47 | +import itn.let.mjo.symbol.service.MjonSymbolService; | |
| 48 | +import itn.let.mjo.symbol.service.MjonSymbolVO; | |
| 49 | +import itn.let.sym.ccm.cde.service.CateCode; | |
| 50 | +import itn.let.sym.ccm.cde.service.EgovCcmCmmnDetailCodeManageService; | |
| 51 | +import itn.let.sym.grd.service.MberGrdService; | |
| 52 | +import itn.let.sym.site.service.EgovSiteManagerService; | |
| 53 | +import itn.let.sym.site.service.JoinSettingVO; | |
| 54 | +import itn.let.uss.umt.service.EgovMberManageService; | |
| 55 | +import itn.let.uss.umt.service.EgovUserManageService; | |
| 56 | +import itn.let.uss.umt.service.MberManageVO; | |
| 57 | +import itn.let.utl.fcc.service.EgovCryptoUtil; | |
| 58 | + | |
| 59 | +@Controller | |
| 60 | +public class MjonMsgCampainHGDataController { | |
| 61 | + | |
| 62 | + | |
| 63 | + @Resource(name = "mjonMsgService") | |
| 64 | + private MjonMsgService mjonMsgService; | |
| 65 | + | |
| 66 | + @Resource(name = "mjonPayService") | |
| 67 | + private MjonPayService mjonPayService; | |
| 68 | + | |
| 69 | + @Resource(name = "MjonMsgDataService") | |
| 70 | + private MjonMsgDataService mjonMsgDataService; | |
| 71 | + | |
| 72 | + @Resource(name = "LetterService") | |
| 73 | + private LetterService letterService; | |
| 74 | + | |
| 75 | + @Resource(name = "mjonSymbolService") | |
| 76 | + private MjonSymbolService mjonSymbolService; | |
| 77 | + | |
| 78 | + /** mberManageService */ | |
| 79 | + @Resource(name = "mberManageService") | |
| 80 | + private EgovMberManageService mberManageService; | |
| 81 | + | |
| 82 | + @Resource (name = "AddrService") | |
| 83 | + private AddrService addrService; | |
| 84 | + | |
| 85 | + @Resource (name = "AddrGroupService") | |
| 86 | + private AddrGroupService addrGroupService; | |
| 87 | + | |
| 88 | + @Resource(name = "mjonCandidateService") | |
| 89 | + private MjonCandidateService mjonCandidateService; | |
| 90 | + | |
| 91 | + @Resource(name = "EgovCmmUseService") | |
| 92 | + private EgovCmmUseService cmmUseService; | |
| 93 | + | |
| 94 | + /** EgovMessageSource */ | |
| 95 | + @Resource(name="egovMessageSource") | |
| 96 | + EgovMessageSource egovMessageSource; | |
| 97 | + | |
| 98 | + @Resource(name="EgovFileMngUtil") | |
| 99 | + private EgovFileMngUtil fileUtil; | |
| 100 | + | |
| 101 | + @Resource(name="EgovFileMngService") | |
| 102 | + private EgovFileMngService fileMngService; | |
| 103 | + | |
| 104 | + /* 암복호화 */ | |
| 105 | + @Resource(name = "egovCryptoUtil") | |
| 106 | + EgovCryptoUtil egovCryptoUtil; | |
| 107 | + | |
| 108 | + @Resource(name = "egovMjonMsgGroupIdGnrService") | |
| 109 | + private EgovIdGnrService idgenMjonMsgGroupId; | |
| 110 | + | |
| 111 | + @Resource(name = "egovMjonCashIdGnrService") | |
| 112 | + private EgovIdGnrService idgenMjonCashId; | |
| 113 | + | |
| 114 | + @Resource(name = "CmmnDetailCodeManageService") | |
| 115 | + private EgovCcmCmmnDetailCodeManageService cmmnDetailCodeManageService; | |
| 116 | + | |
| 117 | + /** 첨부파일 저장경로 */ | |
| 118 | + @Value("#{globalSettings['Globals.file.saveDir']}") | |
| 119 | + private String fileSaveDir; | |
| 120 | + | |
| 121 | + /** userManageService */ | |
| 122 | + @Resource(name = "userManageService") | |
| 123 | + private EgovUserManageService userManageService; | |
| 124 | + | |
| 125 | + @Resource(name = "MjonEventService") | |
| 126 | + private MjonEventService mjonEventService; | |
| 127 | + | |
| 128 | + @Resource(name = "mjonSpamMsgService") | |
| 129 | + private MjonSpamMsgService mjonSpamMsgService; | |
| 130 | + | |
| 131 | + /** 사이트 설정 */ | |
| 132 | + @Resource(name = "egovSiteManagerService") | |
| 133 | + EgovSiteManagerService egovSiteManagerService; | |
| 134 | + | |
| 135 | + /** 등급제 관리 서비스 */ | |
| 136 | + @Resource(name = "mberGrdService") | |
| 137 | + MberGrdService mberGrdService; | |
| 138 | + | |
| 139 | + | |
| 140 | + /** | |
| 141 | + * 선거 문자 대량 발송 화면 | |
| 142 | + * @param searchVO | |
| 143 | + * @param model | |
| 144 | + * @return "/web/mjon/msgcampain/huge/selectMsgHGDataView.do" | |
| 145 | + * @throws Exception | |
| 146 | + */ | |
| 147 | + @RequestMapping(value= {"/web/mjon/msgcampain/huge/selectMsgHGDataView.do"}) | |
| 148 | + public String selectMsgHGDataView(@ModelAttribute("searchVO") MjonMsgDataVO searchVO | |
| 149 | + , CateCode cateCode | |
| 150 | + , HttpServletRequest request | |
| 151 | + , ModelMap model) throws Exception{ | |
| 152 | + | |
| 153 | +String categoryType = cateCode.getCateType(); | |
| 154 | + | |
| 155 | + if(categoryType == null) { | |
| 156 | + | |
| 157 | + categoryType = "N"; | |
| 158 | + | |
| 159 | + } | |
| 160 | + | |
| 161 | + // 문자 카테고리 리스트 불러오기 | |
| 162 | + List<CateCode> cateConfList = letterService.selectCateConfWithList(categoryType); | |
| 163 | + model.addAttribute("cateCodeList", cateConfList); | |
| 164 | + | |
| 165 | + // 문자 해쉬태그 리스트 불러오기 | |
| 166 | + String msgType = "M"; | |
| 167 | + List<HashConfVO> hashTagList = letterService.selectHashTagWithList(msgType); | |
| 168 | + model.addAttribute("hashTagList", hashTagList); | |
| 169 | + | |
| 170 | + // 문자 리스트 불러오기 | |
| 171 | + LetterVO letterVO = new LetterVO(); | |
| 172 | + if(letterVO.getPageUnit() != 10) { | |
| 173 | + letterVO.setPageUnit(letterVO.getPageUnit()); | |
| 174 | + } | |
| 175 | + | |
| 176 | + //로그인 권한정보 불러오기 | |
| 177 | + LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; | |
| 178 | + model.addAttribute("loginVO", loginVO); | |
| 179 | + | |
| 180 | + for(int i=0 ; i < cateConfList.size(); i++) { | |
| 181 | + if("선거".equals(cateConfList.get(i).getCateNm())) { | |
| 182 | + letterVO.setCategoryCode(cateConfList.get(i).getCateCode()); | |
| 183 | + } | |
| 184 | + } | |
| 185 | + | |
| 186 | + //주소록에서 선택시 넘어오는 파라미터 | |
| 187 | + if("Y".equals(searchVO.getMoveAddrFlag())) { | |
| 188 | + model.addAttribute("addrVO", searchVO); | |
| 189 | + } | |
| 190 | + | |
| 191 | + //주소록에서 선택시 넘어오는 파라미터 | |
| 192 | + if("Y".equals(searchVO.getMoveAddrAllFlag())) { | |
| 193 | + AddrVO addrVO = new AddrVO(); | |
| 194 | + | |
| 195 | + String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); | |
| 196 | + if(userId != "") { | |
| 197 | + addrVO.setMberId(userId); | |
| 198 | + } | |
| 199 | + addrVO.setRecordCountPerPage(100000); | |
| 200 | + addrVO.setFirstIndex(0); | |
| 201 | + addrVO.setSearchAddrGrpId(request.getParameter("searchAddrGrpId")); | |
| 202 | + addrVO.setSearchCondition(request.getParameter("searchCondition")); | |
| 203 | + addrVO.setSearchKeyword(request.getParameter("searchKeyword")); | |
| 204 | + addrVO.setStartKeyword(request.getParameter("startKeyword")); | |
| 205 | + List<AddrVO> addrList = addrService.selectAddrList(addrVO); | |
| 206 | + | |
| 207 | + List<String> addrIdList = new ArrayList<String>(); | |
| 208 | + for(AddrVO item : addrList) { | |
| 209 | + addrIdList.add(item.getAddrId()); | |
| 210 | + } | |
| 211 | + | |
| 212 | + searchVO.setAddrIdList(addrIdList); | |
| 213 | + searchVO.setMoveAddrFlag("Y"); | |
| 214 | + | |
| 215 | + model.addAttribute("addrVO", searchVO); | |
| 216 | + } | |
| 217 | + | |
| 218 | + /** pageing */ | |
| 219 | + PaginationInfo paginationInfo = new PaginationInfo(); | |
| 220 | + paginationInfo.setCurrentPageNo(letterVO.getPageIndex()); | |
| 221 | + paginationInfo.setRecordCountPerPage(letterVO.getPageUnit()); | |
| 222 | + paginationInfo.setPageSize(letterVO.getPageSize()); | |
| 223 | + | |
| 224 | + letterVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); | |
| 225 | + letterVO.setLastIndex(paginationInfo.getLastRecordIndex()); | |
| 226 | + letterVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); | |
| 227 | + | |
| 228 | + | |
| 229 | + List<?> resultPhoList = mjonMsgDataService.selectPhotoLetterList(letterVO); | |
| 230 | + | |
| 231 | + model.addAttribute("resultPhoList", resultPhoList); | |
| 232 | + paginationInfo.setTotalRecordCount( resultPhoList.size()> 0 ? ((Long)((EgovMap)resultPhoList.get(0)).get("totCnt")).intValue() : 0); | |
| 233 | + model.addAttribute("paginationInfo", paginationInfo); | |
| 234 | + | |
| 235 | + //발송결과 문자 재전송에서 넘어오는 경우 파마리터 전달 | |
| 236 | + List<String> temp = searchVO.getMsgSeqList(); | |
| 237 | + | |
| 238 | + if(temp != null) { | |
| 239 | + | |
| 240 | + model.addAttribute("reSendMsgVO", searchVO); | |
| 241 | + | |
| 242 | + } | |
| 243 | + model.addAttribute("letterVO", letterVO); | |
| 244 | + | |
| 245 | + // 문자 재전송 New | |
| 246 | + model.addAttribute("msgResendAllFlag", searchVO.getMsgResendAllFlag()); | |
| 247 | + model.addAttribute("msgResendAllGroupId", searchVO.getMsgResendAllGroupId()); | |
| 248 | + model.addAttribute("msgResendAllAdvertiseYn", searchVO.getMsgResendAllAdvertiseYn()); | |
| 249 | + model.addAttribute("msgResendAllReplaceYn", searchVO.getMsgResendAllReplaceYn()); | |
| 250 | + | |
| 251 | + return "web/msgcampain/huge/MsgHGDataView"; | |
| 252 | + } | |
| 253 | + | |
| 254 | + /** | |
| 255 | + * 선거 문자 대량 발송 단문/장문/그림문자 전송 화면 | |
| 256 | + * @param searchVO | |
| 257 | + * @param model | |
| 258 | + * @return "/web/mjon/msgcampain/huge/selectMsgHGDataSMLViewAjax.do" | |
| 259 | + * @throws Exception | |
| 260 | + */ | |
| 261 | + @RequestMapping(value= {"/web/mjon/msgcampain/huge/selectMsgHGDataSMLViewAjax.do"}) | |
| 262 | + public String selectMsgHGDataSMLView(@ModelAttribute("searchVO") MjonMsgDataVO searchVO, CateCode cateCode, ModelMap model) throws Exception{ | |
| 263 | + | |
| 264 | + //로그인 권한정보 불러오기 | |
| 265 | + LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; | |
| 266 | + String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); | |
| 267 | + String author = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getAuthority()); | |
| 268 | + | |
| 269 | + String categoryType = cateCode.getCateType(); | |
| 270 | + | |
| 271 | + if(categoryType == null) { | |
| 272 | + | |
| 273 | + categoryType = "N"; | |
| 274 | + | |
| 275 | + } | |
| 276 | + | |
| 277 | + //문자 전송 개인 단가 불러오기 | |
| 278 | + | |
| 279 | + //0.이벤트 진행중이 회원 정보 불러오기. | |
| 280 | + //이벤트 회원 정보 테이블에서 대상자의 정보를 불러온다. | |
| 281 | + MjonEventVO mjonEventVO = new MjonEventVO(); | |
| 282 | + mjonEventVO.setMberId(userId); | |
| 283 | + MjonEventVO eventMberInfo = mjonEventService.selectEventMsgMberDefaultInfo(mjonEventVO); | |
| 284 | + | |
| 285 | + | |
| 286 | + long eventDiffDate = 0; | |
| 287 | + float eventRemainCash = 0; | |
| 288 | + boolean compareEndDate = false; | |
| 289 | + | |
| 290 | + if(eventMberInfo != null) { | |
| 291 | + | |
| 292 | + String eventEndDate = eventMberInfo.getEventEndDate(); | |
| 293 | + | |
| 294 | + /** | |
| 295 | + * MJUtil.getCompareDate() | |
| 296 | + * 현재 날짜와 파라미터 전달 날짜를 비교 | |
| 297 | + * 전달날짜를 지난경우 False를 리턴함. | |
| 298 | + * 현재날짜 이전 혹은 같은 날짜면 True를 리턴함. | |
| 299 | + * | |
| 300 | + * */ | |
| 301 | + | |
| 302 | + if(eventEndDate != null) { | |
| 303 | + compareEndDate = MJUtil.getCompareDate(eventEndDate); | |
| 304 | + eventRemainCash = (float) eventMberInfo.getEventRemainCash(); | |
| 305 | + | |
| 306 | + //이벤트 종료 일자가 지난 경우, 이벤트 상태가 종료아 아니면 종료 처리 시킴 | |
| 307 | + //이벤트 남은 캐시가 단문 발송금액 7.5원 보다 낮으면 이벤트 종료 시킴 | |
| 308 | + if(!compareEndDate || eventRemainCash < 7.5) { | |
| 309 | + | |
| 310 | + if(!eventMberInfo.getEventStatus().equals("E")) { | |
| 311 | + | |
| 312 | + //이벤트 상태값을 종료로 변경한다. | |
| 313 | + mjonEventVO.setEventInfoId(eventMberInfo.getEventInfoId()); | |
| 314 | + mjonEventVO.setEventStatus("E"); | |
| 315 | + mjonEventVO.setEventMemo("이벤트 발송 최소 금액(7.5) 부족 혹은 이벤트 종료일 초과되어 이벤트 종료 시킴"); | |
| 316 | + mjonEventVO.setEventRemainCash(eventRemainCash); | |
| 317 | + mjonEventService.updateEventEndStatus(mjonEventVO); | |
| 318 | + eventMberInfo.setEventStatus("E"); | |
| 319 | + | |
| 320 | + } | |
| 321 | + | |
| 322 | + }else {//이벤트 진행중이면 남은 날짜 계산해서 전달. | |
| 323 | + | |
| 324 | + /** | |
| 325 | + * MJUtil.getDiffDateDay() | |
| 326 | + * 현재 날짜와 파라미터 날짜 사이의 날짜 수를 계산해줌. | |
| 327 | + * | |
| 328 | + * */ | |
| 329 | + eventDiffDate = MJUtil.getDiffDateDay(eventEndDate); | |
| 330 | + | |
| 331 | + } | |
| 332 | + } | |
| 333 | + | |
| 334 | + } | |
| 335 | + | |
| 336 | + //남은 날짜값을 절대값으로 변경(음수로 나오기 때문) | |
| 337 | + model.addAttribute("eventDiffDate", Math.abs(eventDiffDate)); | |
| 338 | + model.addAttribute("compareEndDate", compareEndDate); | |
| 339 | + model.addAttribute("eventRemainCash", eventRemainCash); | |
| 340 | + model.addAttribute("eventMberInfo", eventMberInfo); | |
| 341 | + | |
| 342 | + //1.시스템 기본 단가 정보 불러오기 | |
| 343 | + JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo(); | |
| 344 | + | |
| 345 | + // 등급제 단가 추출 => 시스템 단가에 적용 | |
| 346 | + sysJoinSetVO = mberGrdService.selectMberGrdDefaultInfo(sysJoinSetVO, userId); | |
| 347 | + | |
| 348 | + //2.사용자 개인 단가 정보 불러오기 | |
| 349 | + MberManageVO mberManageVO = new MberManageVO(); | |
| 350 | + | |
| 351 | + if(!userId.equals("") && !author.equals("ROLE_ADMIN")) { | |
| 352 | + | |
| 353 | + mberManageVO = mjonMsgDataService.selectMberManageInfo(userId); | |
| 354 | + searchVO.setUserId(userId); | |
| 355 | + | |
| 356 | + } | |
| 357 | + | |
| 358 | + model.addAttribute("exceptSpamYn", mberManageVO.getExceptSpamYn()); | |
| 359 | + | |
| 360 | + //3.사용자 개인단가 정보가 0이 아니면 개인단가 사용, 없으면 시스템 기본 단가 사용 | |
| 361 | + Float shortPrice = mberManageVO.getShortPrice(); | |
| 362 | + Float longPrice = mberManageVO.getLongPrice(); | |
| 363 | + Float picturePrice = mberManageVO.getPicturePrice(); | |
| 364 | + Float picture2Price = mberManageVO.getPicture2Price(); | |
| 365 | + Float picture3Price = mberManageVO.getPicture3Price(); | |
| 366 | + BigDecimal userMoney = new BigDecimal(mberManageVO.getUserMoney()).setScale(2, RoundingMode.HALF_EVEN); | |
| 367 | + | |
| 368 | + //일반 단가정보 저장 변수 셋팅 - 이벤트 캐시 부족시 일반단가로 계산하기 위해서임.20230328, 우영두추가 | |
| 369 | + Float norShortPrice = mberManageVO.getShortPrice(); | |
| 370 | + Float norLongPrice = mberManageVO.getLongPrice(); | |
| 371 | + Float norPicturePrice = mberManageVO.getPicturePrice(); | |
| 372 | + Float norPicture2Price = mberManageVO.getPicture2Price(); | |
| 373 | + Float norPicture3Price = mberManageVO.getPicture3Price(); | |
| 374 | + | |
| 375 | + //기존 소수점 2째자리에서 반올림하였으나, 정책 변경으로 소수점 버림 처리함 20220623 | |
| 376 | + /*int shortPrice = (int) mberManageVO.getShortPrice(); | |
| 377 | + int longPrice = (int) mberManageVO.getLongPrice(); | |
| 378 | + int picturePrice = (int) mberManageVO.getPicturePrice(); | |
| 379 | + int picture2Price = (int) mberManageVO.getPicture2Price(); | |
| 380 | + int picture3Price = (int) mberManageVO.getPicture3Price(); | |
| 381 | + int userMoney = (int) mberManageVO.getUserMoney();*/ | |
| 382 | + | |
| 383 | + String userPoint = mberManageVO.getUserPoint(); | |
| 384 | + | |
| 385 | + //이벤트 진행 회원의 발송 단가 처리해주기 | |
| 386 | + if(eventMberInfo != null && eventMberInfo.getEventStatus().equals("Y") && compareEndDate) { | |
| 387 | + | |
| 388 | + shortPrice = Float.parseFloat(eventMberInfo.getEventShortPrice()); | |
| 389 | + longPrice = Float.parseFloat(eventMberInfo.getEventLongPrice()); | |
| 390 | + picturePrice = Float.parseFloat(eventMberInfo.getEventPicturePrice()); | |
| 391 | + picture2Price = Float.parseFloat(eventMberInfo.getEventPicture2Price()); | |
| 392 | + picture3Price = Float.parseFloat(eventMberInfo.getEventPicture3Price()); | |
| 393 | + | |
| 394 | + //이벤트 캐시 부족시 일반단가로 계산하기 위해서임.20230328, 우영두추가 | |
| 395 | + if(shortPrice < 1 || longPrice < 1 || picturePrice < 1) {//이벤트 단가 적용시 일반단가도 필요하여 셋팅 해줌. | |
| 396 | + | |
| 397 | + norShortPrice = (float) sysJoinSetVO.getShortPrice(); | |
| 398 | + norLongPrice = (float) sysJoinSetVO.getLongPrice(); | |
| 399 | + norPicturePrice = (float) sysJoinSetVO.getPicturePrice(); | |
| 400 | + norPicture2Price = (float) sysJoinSetVO.getPicture2Price(); | |
| 401 | + norPicture3Price = (float) sysJoinSetVO.getPicture3Price(); | |
| 402 | + | |
| 403 | + } | |
| 404 | + | |
| 405 | + }else if(shortPrice < 1 || longPrice < 1 || picturePrice < 1) { | |
| 406 | + | |
| 407 | + shortPrice = (float) sysJoinSetVO.getShortPrice(); | |
| 408 | + longPrice = (float) sysJoinSetVO.getLongPrice(); | |
| 409 | + picturePrice = (float) sysJoinSetVO.getPicturePrice(); | |
| 410 | + picture2Price = (float) sysJoinSetVO.getPicture2Price(); | |
| 411 | + picture3Price = (float) sysJoinSetVO.getPicture3Price(); | |
| 412 | + | |
| 413 | + } | |
| 414 | + | |
| 415 | + model.addAttribute("shortPrice", shortPrice); | |
| 416 | + model.addAttribute("longPrice", longPrice); | |
| 417 | + model.addAttribute("picturePrice", picturePrice); | |
| 418 | + model.addAttribute("picture2Price", picture2Price); | |
| 419 | + model.addAttribute("picture3Price", picture3Price); | |
| 420 | + model.addAttribute("userMoney", userMoney); | |
| 421 | + model.addAttribute("userPoint", userPoint); | |
| 422 | + | |
| 423 | + //이벤트 캐시 부족시 일반단가로 계산하기 위해서임.20230328, 우영두추가 | |
| 424 | + if(norShortPrice < 1 || norLongPrice < 1 || norPicturePrice < 1) {//협의 단가가 없는 경우 일반단가에 시스템 단가로 셋팅해줌 | |
| 425 | + | |
| 426 | + norShortPrice = (float) sysJoinSetVO.getShortPrice(); | |
| 427 | + norLongPrice = (float) sysJoinSetVO.getLongPrice(); | |
| 428 | + norPicturePrice = (float) sysJoinSetVO.getPicturePrice(); | |
| 429 | + norPicture2Price = (float) sysJoinSetVO.getPicture2Price(); | |
| 430 | + norPicture3Price = (float) sysJoinSetVO.getPicture3Price(); | |
| 431 | + | |
| 432 | + } | |
| 433 | + | |
| 434 | + model.addAttribute("norShortPrice", norShortPrice); | |
| 435 | + model.addAttribute("norLongPrice", norLongPrice); | |
| 436 | + model.addAttribute("norPicturePrice", norPicturePrice); | |
| 437 | + model.addAttribute("norPicture2Price", norPicture2Price); | |
| 438 | + model.addAttribute("norPicture3Price", norPicture3Price); | |
| 439 | + | |
| 440 | + //선거 후보자 정보 불러오기 | |
| 441 | + MjonCandidateVO mjonCandidateVO = new MjonCandidateVO(); | |
| 442 | + | |
| 443 | + if(userId != ""){ | |
| 444 | + | |
| 445 | + mjonCandidateVO = mjonCandidateService.selectCandidateDataInfo(userId); | |
| 446 | + | |
| 447 | + //String cryptText = egovCryptoUtil.encrypt(plainText); | |
| 448 | + | |
| 449 | + if(mjonCandidateVO != null) { | |
| 450 | + | |
| 451 | + // 주민번호 복호화 하기 | |
| 452 | + String regidentNo1 = egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo1()); | |
| 453 | + String regidentNo2 = egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo2()); | |
| 454 | + | |
| 455 | + mjonCandidateVO.setRegidentNo1(regidentNo1); | |
| 456 | + mjonCandidateVO.setRegidentNo2(regidentNo2); | |
| 457 | + | |
| 458 | + } | |
| 459 | + | |
| 460 | + } | |
| 461 | + | |
| 462 | + model.addAttribute("mjonCandidateVO", mjonCandidateVO); | |
| 463 | + | |
| 464 | + // 이메일 코드조회 | |
| 465 | + ComDefaultCodeVO voComCode = new ComDefaultCodeVO(); | |
| 466 | + voComCode.setCodeId("ITN031"); | |
| 467 | + model.addAttribute("emailCode", cmmUseService.selectCmmCodeDetail(voComCode)); | |
| 468 | + | |
| 469 | + if(!userId.equals("")) {//로그인 했을때만 발신번호 리스트 불러오기 | |
| 470 | + | |
| 471 | + //아이디 발신번호 리스트 불러오기. | |
| 472 | + List<String> resultSendPhonList = mjonMsgDataService.selectSendPhonNumList(userId); | |
| 473 | + List<String> resultPhonList = new ArrayList<String>(); | |
| 474 | + MJUtil mjUtil = new MJUtil(); | |
| 475 | + | |
| 476 | + for(String phone : resultSendPhonList) { | |
| 477 | + | |
| 478 | + resultPhonList.add(mjUtil.addDash(phone)); | |
| 479 | + | |
| 480 | + } | |
| 481 | + model.addAttribute("resultPhonList", resultPhonList); | |
| 482 | + | |
| 483 | + } | |
| 484 | + | |
| 485 | + // 문자 카테고리 리스트 불러오기 | |
| 486 | + List<CateCode> cateConfList = letterService.selectCateConfWithList(categoryType); | |
| 487 | + model.addAttribute("cateCodeList", cateConfList); | |
| 488 | + | |
| 489 | + //그림 문자 리스트 불러오기 | |
| 490 | + LetterVO letterVO = new LetterVO(); | |
| 491 | + if(letterVO.getPageUnit() != 10) { | |
| 492 | + letterVO.setPageUnit(letterVO.getPageUnit()); | |
| 493 | + } | |
| 494 | + | |
| 495 | + MjonSymbolVO symbolVO = new MjonSymbolVO(); | |
| 496 | + // 특수문자 리스트 불러오기 | |
| 497 | + List<MjonSymbolVO> symbolList = mjonSymbolService.selectMjonSymbolList(symbolVO); | |
| 498 | + model.addAttribute("symbolList", symbolList); | |
| 499 | + | |
| 500 | + //최근 전송 내역 | |
| 501 | + Calendar cal = Calendar.getInstance(); | |
| 502 | + Date now = new Date(); | |
| 503 | + | |
| 504 | + SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd"); | |
| 505 | + | |
| 506 | + cal.setTime(now); | |
| 507 | + cal.add(Calendar.DATE, -3); | |
| 508 | + | |
| 509 | + String chkDate = format.format(cal.getTime()); | |
| 510 | + | |
| 511 | + searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작 | |
| 512 | + List<?> resultLatestMsgList = mjonMsgDataService.selectLatestMsgList(searchVO); | |
| 513 | + model.addAttribute("resultLatestMsgList", resultLatestMsgList); | |
| 514 | + | |
| 515 | + //자주보내는 번호 | |
| 516 | + List<?> resultBookMarkMsgList = mjonMsgDataService.selectBookMarkMsgList(searchVO); | |
| 517 | + model.addAttribute("resultBookMarkMsgList", resultBookMarkMsgList); | |
| 518 | + | |
| 519 | + | |
| 520 | + /** pageing */ | |
| 521 | + PaginationInfo paginationInfo = new PaginationInfo(); | |
| 522 | + paginationInfo.setCurrentPageNo(letterVO.getPageIndex()); | |
| 523 | + paginationInfo.setRecordCountPerPage(letterVO.getPageUnit()); | |
| 524 | + paginationInfo.setPageSize(letterVO.getPageSize()); | |
| 525 | + | |
| 526 | + letterVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); | |
| 527 | + letterVO.setLastIndex(paginationInfo.getLastRecordIndex()); | |
| 528 | + letterVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); | |
| 529 | + | |
| 530 | + List<?> resultPhoList = mjonMsgDataService.selectPhotoLetterList(letterVO); | |
| 531 | + | |
| 532 | + model.addAttribute("resultPhoList", resultPhoList); | |
| 533 | + paginationInfo.setTotalRecordCount( resultPhoList.size()> 0 ? ((Long)((EgovMap)resultPhoList.get(0)).get("totCnt")).intValue() : 0); | |
| 534 | + model.addAttribute("paginationInfo", paginationInfo); | |
| 535 | + model.addAttribute("mberManageVO", mberManageVO); | |
| 536 | + | |
| 537 | + return "web/msgcampain/huge/MsgHGDataSMLView"; | |
| 538 | + } | |
| 539 | + | |
| 540 | +} |
--- src/main/webapp/WEB-INF/jsp/web/addr/AddrList.jsp
+++ src/main/webapp/WEB-INF/jsp/web/addr/AddrList.jsp
... | ... | @@ -1040,11 +1040,10 @@ |
| 1040 | 1040 |
gMemoList[i] = memo.replace(/,/g,"§"); |
| 1041 | 1041 |
} |
| 1042 | 1042 |
|
| 1043 |
+ //브라우저 대기 메세지 안나오게 하기위한 처리 |
|
| 1043 | 1044 |
var reStartArray = [10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 100000, 110000, 120000, 130000, 140000, 150000, 160000, 170000, 180000, 190000, 200000]; |
| 1044 | 1045 |
|
| 1045 | 1046 |
if (reStartArray.includes(i, 0)) {
|
| 1046 |
- console.log("########## i : " + i);
|
|
| 1047 |
- |
|
| 1048 | 1047 |
gArrRestartIndex = i+1; |
| 1049 | 1048 |
|
| 1050 | 1049 |
if (selectedData.length > gArrRestartIndex) {
|
... | ... | @@ -1052,13 +1051,12 @@ |
| 1052 | 1051 |
break; |
| 1053 | 1052 |
} |
| 1054 | 1053 |
} |
| 1055 |
- console.log(i); |
|
| 1056 | 1054 |
} |
| 1057 | 1055 |
|
| 1058 | 1056 |
if (gPhoneList.length == selectedData.length) {
|
| 1059 |
- console.log(new Date()); |
|
| 1060 |
- console.log("gPhoneList.length : " + gPhoneList.length);
|
|
| 1061 |
- console.log("selectedData.length : " + selectedData.length);
|
|
| 1057 |
+ //console.log(new Date()); |
|
| 1058 |
+ //console.log("gPhoneList.length : " + gPhoneList.length);
|
|
| 1059 |
+ //console.log("selectedData.length : " + selectedData.length);
|
|
| 1062 | 1060 |
|
| 1063 | 1061 |
SetAddrMassSave_Step2(); |
| 1064 | 1062 |
} |
... | ... | @@ -1114,6 +1112,8 @@ |
| 1114 | 1112 |
// 데이터 비우기 |
| 1115 | 1113 |
SetClear(); |
| 1116 | 1114 |
|
| 1115 |
+ var selectMassVal = $("#addrGrpIdInfo option:selected").val();
|
|
| 1116 |
+ |
|
| 1117 | 1117 |
// 주소록그룹 콤보박스 유지 |
| 1118 | 1118 |
setTimeout(setSelectMassSetting, 500, selectMassVal); |
| 1119 | 1119 |
} |
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/MsgDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/MsgDataSMLView.jsp
... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 |
function updateTotCnt(data){
|
| 24 | 24 |
|
| 25 | 25 |
var rowTotCnt = data; |
| 26 |
- $("#rowTotCnt").text(rowTotCnt);
|
|
| 26 |
+ $("#rowTotCnt").text(numberWithCommas(rowTotCnt));
|
|
| 27 | 27 |
|
| 28 | 28 |
} |
| 29 | 29 |
|
... | ... | @@ -1737,7 +1737,6 @@ |
| 1737 | 1737 |
}else{
|
| 1738 | 1738 |
|
| 1739 | 1739 |
conLeng = adTxtLeng + conLeng + denyTxtLeng +2; // 상단 광고 텍스트 , 하단 080 문자내용 길이 더해주기 , +2는 엔터 적용 |
| 1740 |
- console.log("++++++++++ conleng ::: "+conLeng);
|
|
| 1741 | 1740 |
$('#msgLeng').text(conLeng);
|
| 1742 | 1741 |
|
| 1743 | 1742 |
//문자 길이 변수에 저장해주기 |
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/addr/huge/MsgHGAddrGroupListAjax.jsp
... | ... | @@ -0,0 +1,142 @@ |
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| 3 | +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> | |
| 4 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | |
| 5 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | |
| 6 | +<script type="text/javascript"> | |
| 7 | +$(document).ready(function(){ | |
| 8 | + | |
| 9 | + // 주소록 그룹 카운트(전체) | |
| 10 | + getAddrGroupTotCnt(); | |
| 11 | + | |
| 12 | + //주소록 그룹 카운트(그룹미지정) | |
| 13 | + getAddrGroupNogrpCnt(); | |
| 14 | + | |
| 15 | + //주소록 그룹 카운트(자주보내는 번호) | |
| 16 | + getAddrGroupBookmarkCnt(); | |
| 17 | + | |
| 18 | +}); | |
| 19 | + | |
| 20 | +// 주소록 그룹 카운트(전체) | |
| 21 | +function getAddrGroupTotCnt() { | |
| 22 | + $.ajax({ | |
| 23 | + type: "POST", | |
| 24 | + url: "/web/addr/selectAddrGroupTotCntAjax.do", | |
| 25 | + data: {}, | |
| 26 | + dataType:'json', | |
| 27 | + async: true, | |
| 28 | + success: function (data) { | |
| 29 | + if (data.isSuccess) { | |
| 30 | + $("#addrTotCnt").html(numberWithCommas(data.addrTotCnt)); | |
| 31 | + } | |
| 32 | + else { | |
| 33 | + //alert("Msg : " + data.msg); | |
| 34 | + } | |
| 35 | + }, | |
| 36 | + error: function (e) { | |
| 37 | + //alert("ERROR : " + JSON.stringify(e)); | |
| 38 | + } | |
| 39 | + }); | |
| 40 | +} | |
| 41 | + | |
| 42 | +//주소록 그룹 카운트(그룹미지정) | |
| 43 | +function getAddrGroupNogrpCnt() { | |
| 44 | + $.ajax({ | |
| 45 | + type: "POST", | |
| 46 | + url: "/web/addr/selectAddrGroupNogrpCntAjax.do", | |
| 47 | + data: {}, | |
| 48 | + dataType:'json', | |
| 49 | + async: true, | |
| 50 | + success: function (data) { | |
| 51 | + if (data.isSuccess) { | |
| 52 | + $("#nogrpCnt").html(data.nogrpCnt); | |
| 53 | + } | |
| 54 | + else { | |
| 55 | + //alert("Msg : " + data.msg); | |
| 56 | + } | |
| 57 | + }, | |
| 58 | + error: function (e) { | |
| 59 | + //alert("ERROR : " + JSON.stringify(e)); | |
| 60 | + } | |
| 61 | + }); | |
| 62 | +} | |
| 63 | + | |
| 64 | +//주소록 그룹 카운트(자주보내는 번호) | |
| 65 | +function getAddrGroupBookmarkCnt() { | |
| 66 | + $.ajax({ | |
| 67 | + type: "POST", | |
| 68 | + url: "/web/addr/selectAddrGroupBookmarkCntAjax.do", | |
| 69 | + data: {}, | |
| 70 | + dataType:'json', | |
| 71 | + async: true, | |
| 72 | + success: function (data) { | |
| 73 | + if (data.isSuccess) { | |
| 74 | + $("#bookmarkCnt").html(data.bookmarkCnt); | |
| 75 | + } | |
| 76 | + else { | |
| 77 | + //alert("Msg : " + data.msg); | |
| 78 | + } | |
| 79 | + }, | |
| 80 | + error: function (e) { | |
| 81 | + //alert("ERROR : " + JSON.stringify(e)); | |
| 82 | + } | |
| 83 | + }); | |
| 84 | +} | |
| 85 | + | |
| 86 | + | |
| 87 | +//그룹 클릭했을 때 활성화 디자인 추가 | |
| 88 | +$(".adr_cb_wrap2").click(function(){ | |
| 89 | + $(this).addClass("active"); | |
| 90 | + $(this).siblings(".adr_cb_wrap2").removeClass("active"); | |
| 91 | +}); | |
| 92 | +</script> | |
| 93 | + | |
| 94 | +<div class="adr_pop_list"> | |
| 95 | + <div class="adr_cb_wrap2"> | |
| 96 | + <!-- <p onClick="javascript:fnSelectAddrList('all','',this); return false;"> --> | |
| 97 | + <p> | |
| 98 | + <img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">전체[<span id="addrTotCnt"></span>명] | |
| 99 | + </p> | |
| 100 | + </div> | |
| 101 | + | |
| 102 | + <div class="adr_cb_wrap2"> | |
| 103 | + <label for="group1" class="label"></label> | |
| 104 | + <input type="checkbox" id="group1"> | |
| 105 | + <!-- <p onClick="javascript:fnSelectAddrList('none','',this); return false;"> --> | |
| 106 | + <p> | |
| 107 | + <img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">그룹미지정[<span id="nogrpCnt"></span>명] | |
| 108 | + </p> | |
| 109 | + </div> | |
| 110 | + | |
| 111 | + <div class="adr_cb_wrap2"> | |
| 112 | + <label for="group2" class="label"></label> | |
| 113 | + <input type="checkbox" id="group2"> | |
| 114 | + <!-- <p onClick="javascript:fnSelectAddrList('book','',this); return false;"> --> | |
| 115 | + <p> | |
| 116 | + <img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘">자주보내는 번호[<span id="bookmarkCnt"></span>명] | |
| 117 | + </p> | |
| 118 | + </div> | |
| 119 | + | |
| 120 | + <c:choose> | |
| 121 | + <c:when test="${not empty addrGroupList}"> | |
| 122 | + <c:forEach var="addrGroupList" items="${addrGroupList}" varStatus="status"> | |
| 123 | + <div class="adr_cb_wrap2"> | |
| 124 | + <label for="group${status.index+3}" class="label"></label> | |
| 125 | + <input type="checkbox" name="grpCheck" id="group${status.index+3}" value="${addrGroupList.addrGrpId}§${addrGroupList.addrGrpNm}§${addrGroupList.grpCount}"> | |
| 126 | + <%-- <p onClick="javascript:fnSelectAddrList('grp','${addrGroupList.addrGrpId}',this); return false;"> --%> | |
| 127 | + <p> | |
| 128 | + <img src="/publish/images/content/close_folder2.png" alt="폴더 닫힘"> | |
| 129 | + <c:out value="${addrGroupList.addrGrpNm}" />[<span><c:out value="${addrGroupList.grpCount}" /></span>명] | |
| 130 | + </p> | |
| 131 | + </div> | |
| 132 | + </c:forEach> | |
| 133 | + </c:when> | |
| 134 | + <c:otherwise> | |
| 135 | + <div class="adr_cb_wrap2"> | |
| 136 | + <p> | |
| 137 | + 검색 결과가 없습니다. | |
| 138 | + </p> | |
| 139 | + </div> | |
| 140 | + </c:otherwise> | |
| 141 | + </c:choose> | |
| 142 | +</div>(No newline at end of file) |
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/huge/MsgHGDataSMLView.jsp
... | ... | @@ -0,0 +1,4410 @@ |
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| 3 | +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> | |
| 4 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | |
| 5 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> | |
| 6 | + | |
| 7 | + | |
| 8 | +<script type="text/javascript" src="<c:url value='/publish/js/content.js'/>"></script> | |
| 9 | +<script type="text/javascript" src="<c:url value='/js/txtSpecialReplace.js?date=202304250001'/>"></script> | |
| 10 | +<%-- <script type="text/javascript" src="<c:url value='/dist/js/tabulator_5.4.js'/>"></script> --%> | |
| 11 | + | |
| 12 | +<% pageContext.setAttribute("newLineChar", "\r\n"); %> | |
| 13 | +<script type="text/javascript"> | |
| 14 | +var tableErrorData = []; | |
| 15 | +var totRows = 0; // 좌측 받는사람 총 갯수 | |
| 16 | + | |
| 17 | +/* 파일등록 */ | |
| 18 | +var _fileIdx = 0; | |
| 19 | +var _fileForm2 = new Array(); | |
| 20 | +var fileExt = ""; // 첨부파일 확장자 | |
| 21 | +var excelAddr = []; //엑셀 불러오기에서 내용 저장하는 배열 변수 | |
| 22 | + | |
| 23 | +//전체 데이터 갯수 구하는 함수 | |
| 24 | +function updateTotCnt(data){ | |
| 25 | + | |
| 26 | + var rowTotCnt = data; | |
| 27 | + $("#rowTotCnt").text(numberWithCommas(rowTotCnt)); | |
| 28 | + | |
| 29 | +} | |
| 30 | + | |
| 31 | +//주소록 불러오기에서 수신자 리스트 tabulator에 데이터 추가해주기 | |
| 32 | +function addPhoneInfo(data){ | |
| 33 | + | |
| 34 | + if(data == null){ | |
| 35 | + | |
| 36 | + alert("연락처 정보가 없습니다."); | |
| 37 | + return; | |
| 38 | + | |
| 39 | + }else{ | |
| 40 | + | |
| 41 | + var idx = 0; | |
| 42 | + var newData = data;//중복 연락처는 하나만 남기고 모두 제거 | |
| 43 | + | |
| 44 | + var recTableData = tableL.getRows(); // 받는사람 리스트의 전체 목록을 저장 | |
| 45 | + var tableData = []; | |
| 46 | + | |
| 47 | + //기존 받는사람 리스트를 배열에 미리 담아둔다. | |
| 48 | + if(recTableData.length > 0){ | |
| 49 | + | |
| 50 | + for(var j=0; j < recTableData.length; j++){ | |
| 51 | + | |
| 52 | + tableData.push({phone: removeDash(recTableData[j].getData().phone) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4}); | |
| 53 | + | |
| 54 | + } | |
| 55 | + | |
| 56 | + } | |
| 57 | + | |
| 58 | + //받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. | |
| 59 | + for(var i=0; i < newData.length; i++){ | |
| 60 | + | |
| 61 | + tableData.push({phone: removeDash(newData[i].phone) , name: newData[i].name, rep1: newData[i].rep1, rep2: newData[i].rep2, rep3: newData[i].rep3, rep4: newData[i].rep4}); | |
| 62 | + | |
| 63 | + } | |
| 64 | + | |
| 65 | + var temp = tableData.length; | |
| 66 | + | |
| 67 | + //기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다. | |
| 68 | + tableL.clearData(); //기존 받는사람 목록을 삭제. | |
| 69 | + //tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기 | |
| 70 | + tableL.addData(getSpupDupliPhoneDataChk(tableData)); // 속도 개선된 중복 검사 호출 | |
| 71 | + | |
| 72 | + _fileForm2 = []; //form file data 초기화 | |
| 73 | + _fileIdx = 0; //form file idx 초기화 | |
| 74 | + | |
| 75 | + totRows = tableL.getRows().length; | |
| 76 | + updateTotCnt(totRows); //전체 데이터 갯수 구하기 | |
| 77 | + | |
| 78 | + var smsTxtArea = $('#smsTxtArea').val(); | |
| 79 | + //일괄변환 문구 결제금액 처리 | |
| 80 | + if(smsTxtArea.indexOf("[*이름*]") > -1 | |
| 81 | + || smsTxtArea.indexOf("[*1*]") > -1 | |
| 82 | + || smsTxtArea.indexOf("[*2*]") > -1 | |
| 83 | + || smsTxtArea.indexOf("[*3*]") > -1 | |
| 84 | + || smsTxtArea.indexOf("[*4*]") > -1){ | |
| 85 | + | |
| 86 | + fnReplCell(); | |
| 87 | + | |
| 88 | + }else{ | |
| 89 | + | |
| 90 | + //결제 금액 구하기 | |
| 91 | + totalPriceSum(totRows); | |
| 92 | + | |
| 93 | + } | |
| 94 | + | |
| 95 | + } | |
| 96 | + | |
| 97 | +} | |
| 98 | + | |
| 99 | +/* 파일사이즈 가져오기 */ | |
| 100 | +function getStrFileSize(filesize){ | |
| 101 | + var sizeStr=""; | |
| 102 | + var sizeKB = filesize/1024; | |
| 103 | + if(parseInt(sizeKB) > 1024){ | |
| 104 | + var sizeMB = sizeKB/1024; | |
| 105 | + sizeStr = sizeMB.toFixed(2)+" MB"; | |
| 106 | + }else{ | |
| 107 | + sizeStr = sizeKB.toFixed(2)+" KB"; | |
| 108 | + } | |
| 109 | + return sizeStr; | |
| 110 | +} | |
| 111 | + | |
| 112 | +// 엑셀 파일 불러오기 | |
| 113 | +function excelExport(event){ | |
| 114 | + | |
| 115 | + var data = new FormData(document.excelForm); | |
| 116 | + data.append("file0", $('#excelFile').prop('files')[0]); | |
| 117 | + | |
| 118 | + var fileValue = $("#excelFile").val().split("\\"); | |
| 119 | + var fileName = fileValue[fileValue.length-1]; | |
| 120 | + | |
| 121 | + var fileExt = fileName.split('.').pop().toLowerCase(); | |
| 122 | + | |
| 123 | + if(fileExt.length > 0){ | |
| 124 | + if($.inArray(fileExt, ['txt','xls','xlsx']) == -1) { | |
| 125 | + | |
| 126 | + alert('txt, xls, xlsx 파일만 업로드 할수 있습니다.'); | |
| 127 | + return false; | |
| 128 | + | |
| 129 | + } | |
| 130 | + | |
| 131 | + | |
| 132 | + var url = ""; | |
| 133 | + | |
| 134 | + if(fileExt == "xls" || fileExt == "xlsx"){ | |
| 135 | + | |
| 136 | + url = "/web/mjon/msgdata/sendExelFilePhoneNumAjax.do"; | |
| 137 | + | |
| 138 | + }else if(fileExt = "txt"){ | |
| 139 | + | |
| 140 | + url = "/web/mjon/msgdata/sendTxtFilePhoneNumAjax.do"; | |
| 141 | + | |
| 142 | + }else{ | |
| 143 | + | |
| 144 | + alert('txt, xls, xlsx 파일만 업로드 할수 있습니다.'); | |
| 145 | + return; | |
| 146 | + | |
| 147 | + } | |
| 148 | + | |
| 149 | + //엑셀 데이터 변수에 자료가 있으면 지워준다. | |
| 150 | + if(excelAddr.length > 0){ | |
| 151 | + | |
| 152 | + excelAddr = []; | |
| 153 | + | |
| 154 | + } | |
| 155 | + | |
| 156 | + $.ajax({ | |
| 157 | + type: "POST", | |
| 158 | + enctype: 'multipart/form-data', | |
| 159 | + url: url, | |
| 160 | + data: data, | |
| 161 | + dataType:'json', | |
| 162 | + async: true, | |
| 163 | + processData: false, | |
| 164 | + contentType: false, | |
| 165 | + cache: false, | |
| 166 | + //timeout: 600000, | |
| 167 | + success: function (returnData, status) { | |
| 168 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 169 | + | |
| 170 | + if(returnData.success){ | |
| 171 | + | |
| 172 | + var data = returnData.data; | |
| 173 | + var message = returnData.message; | |
| 174 | + | |
| 175 | + if(message != '' ){ | |
| 176 | + alert(returnData.message); | |
| 177 | + } | |
| 178 | + | |
| 179 | + if(data != null){ | |
| 180 | + | |
| 181 | + $.each(data, function(i, item){ | |
| 182 | + | |
| 183 | + if(checkHpNum(item.phone)){ | |
| 184 | + | |
| 185 | + excelAddr.push({phone: item.phone, name: item.name, rep1: item.replace1, rep2: item.replace2, rep3: item.replace3, rep4: item.replace4}); | |
| 186 | + | |
| 187 | + }/* else{ | |
| 188 | + | |
| 189 | + alert("엑셀 파일 데이터의 형식이 맞지 않는 부분이 있습니다."); | |
| 190 | + excelAddr = []; //엑셀 데이터 저장 변수 초기화 | |
| 191 | + $("#excelFile").val(""); //첨부파일 input 초기화 | |
| 192 | + $("#excelNm").val(""); // 첨부파일 명 초기화 | |
| 193 | + fileName = ""; | |
| 194 | + return false; | |
| 195 | + | |
| 196 | + } */ | |
| 197 | + | |
| 198 | + }); | |
| 199 | + | |
| 200 | + } | |
| 201 | + | |
| 202 | + }else{ | |
| 203 | + alert(returnData.message); | |
| 204 | +// alert("첨부파일 불러오는 중 오류가 발생하였습니다."); | |
| 205 | + excelAddr = []; //엑셀 데이터 저장 변수 초기화 | |
| 206 | + $("#excelFile").val(""); //첨부파일 input 초기화 | |
| 207 | + $("#excelNm").val(""); // 첨부파일 명 초기화 | |
| 208 | + fileName = ""; | |
| 209 | + return; | |
| 210 | + | |
| 211 | + } | |
| 212 | + } else if(status== 'fail'){ | |
| 213 | + alert("첨부파일 불러오는 중 오류가 발생하였습니다."); | |
| 214 | + console.log("status : fail ~"); | |
| 215 | + } | |
| 216 | + }, | |
| 217 | + error: function (e) { | |
| 218 | + alert("첨부파일 불러오는 중 오류가 발생하였습니다."); | |
| 219 | + console.log("ERROR : ", e); | |
| 220 | + }, | |
| 221 | + beforeSend : function(xmlHttpRequest) { | |
| 222 | + //로딩창 show | |
| 223 | + $('.loading_layer').addClass('active'); | |
| 224 | + }, | |
| 225 | + complete : function(xhr, textStatus) { | |
| 226 | + //로딩창 hide | |
| 227 | + $('.loading_layer').removeClass('active'); | |
| 228 | + } | |
| 229 | + }); | |
| 230 | + | |
| 231 | + $("#excelFile").val(""); | |
| 232 | + $("#excelNm").val(fileName); | |
| 233 | + | |
| 234 | + } | |
| 235 | + | |
| 236 | +} | |
| 237 | + | |
| 238 | +//엑셀 불러오기 팝업의 추가 버튼 처리 | |
| 239 | +$("#excelAdd").click(function(){ | |
| 240 | + | |
| 241 | + if(excelAddr.length > 0){ | |
| 242 | + | |
| 243 | + //첨부파일로 불러온 데이터를 받는사람 목록에 추가해 준다. | |
| 244 | + addPhoneInfo(excelAddr); | |
| 245 | + | |
| 246 | + //첨부파일 초기화 시켜주기 | |
| 247 | + $("#excelFile").val(""); | |
| 248 | + $("#excelNm").val(""); | |
| 249 | + | |
| 250 | + }else{ | |
| 251 | + | |
| 252 | + alert("추가 엑셀 데이터가 없습니다."); | |
| 253 | + return false; | |
| 254 | + | |
| 255 | + } | |
| 256 | + | |
| 257 | + | |
| 258 | +}); | |
| 259 | + | |
| 260 | +function txtExport(event){ | |
| 261 | + var input = event.target; | |
| 262 | + var reader = new FileReader(); | |
| 263 | + var file = input.files[0]; | |
| 264 | + var txtAddr = []; | |
| 265 | + var fileNm = input.files[0].name; | |
| 266 | + var fileExt = fileNm.split('.').pop().toLowerCase(); | |
| 267 | + | |
| 268 | + if(fileExt != "txt"){ | |
| 269 | + | |
| 270 | + alert("TXT 파일만 등록 할 수 있습니다."); | |
| 271 | + return false; | |
| 272 | + | |
| 273 | + } | |
| 274 | + | |
| 275 | + if (!file) { | |
| 276 | + | |
| 277 | + alert("첨부파일이 없습니다."); | |
| 278 | + return; | |
| 279 | + } | |
| 280 | + | |
| 281 | + //txt 파일 읽어 오기 | |
| 282 | + var arrSplitData = []; | |
| 283 | + reader.onload = function(e) { | |
| 284 | + fileData = e.target.result; | |
| 285 | + arrSplitData = fileData.split("\n"); | |
| 286 | + | |
| 287 | + for(var i=0; i < arrSplitData.length; i++){ | |
| 288 | + | |
| 289 | + var arrTemp = arrSplitData[i].split("\t"); | |
| 290 | + txtAddr.push({phone: arrTemp[1].trim(), name: arrTemp[0].trim()}); | |
| 291 | + | |
| 292 | + } | |
| 293 | + | |
| 294 | + //Tabulator에 데이터 입력해주기 | |
| 295 | + addPhoneInfo(txtAddr); | |
| 296 | + }; | |
| 297 | + reader.readAsText(file, 'UTF-8'); | |
| 298 | + | |
| 299 | + //첨부파일 초기화 시켜주기 | |
| 300 | + $("#txtFile").val(""); | |
| 301 | +} | |
| 302 | + | |
| 303 | +//발송금액 단가표시 | |
| 304 | +function SetPriceWrapOpen() { | |
| 305 | + var loginVO = '${LoginVO}'; | |
| 306 | + //로그인 체크 | |
| 307 | + if(loginVO == "" || loginVO == null){ | |
| 308 | + } | |
| 309 | + else { | |
| 310 | + // 발송금액 가격안내 | |
| 311 | + $("#myPriceWrap").show(); | |
| 312 | + } | |
| 313 | +} | |
| 314 | + | |
| 315 | +//등급제 시행 ON/OFF 체크 | |
| 316 | +function getMberSettingDetail() { | |
| 317 | + $.ajax({ | |
| 318 | + type: "POST", | |
| 319 | + url: "/web/grd/mberSettDetailAjax.do", | |
| 320 | + data: {}, | |
| 321 | + dataType:'json', | |
| 322 | + async: false, | |
| 323 | + success: function (data) { | |
| 324 | + if (data.isSuccess) { | |
| 325 | + // 발송금액 가격안내 | |
| 326 | + $("#myPriceWrap").show(); | |
| 327 | + } | |
| 328 | + else { | |
| 329 | + //alert("Msg : " + data.msg); | |
| 330 | + } | |
| 331 | + }, | |
| 332 | + error: function (e) { | |
| 333 | + //alert("ERROR : " + JSON.stringify(e)); | |
| 334 | + } | |
| 335 | + }); | |
| 336 | +} | |
| 337 | + | |
| 338 | +$(document).ready(function (){ | |
| 339 | + // 발송금액 단가표시 | |
| 340 | + SetPriceWrapOpen(); | |
| 341 | + | |
| 342 | + //미리보기 이미지 영역 숨김 처리 | |
| 343 | + $('.preiew_img').hide(); | |
| 344 | + $('.prePhoto').hide(); | |
| 345 | + | |
| 346 | + //최초 화면 문자열 길이 체크해주기 | |
| 347 | + var strCon = $('#smsTxtArea').val(); | |
| 348 | + fnByteString(strCon); | |
| 349 | + | |
| 350 | + //선거문자 텍스트 내용 추가해주기 | |
| 351 | + advMsgInsert(); | |
| 352 | + | |
| 353 | + | |
| 354 | + //문자 내용 입력시 바이트수 계산하기 | |
| 355 | + $('#smsTxtArea').keyup(function(e){ | |
| 356 | + | |
| 357 | + var contents = $(this).val(); | |
| 358 | + | |
| 359 | + fnByteString(contents); | |
| 360 | + | |
| 361 | + });//문자 바이트수 계산하기 끝 | |
| 362 | + | |
| 363 | + | |
| 364 | + //스프레드 시트 Tabulator 초기 셋팅 | |
| 365 | + /* var tabledata = [ | |
| 366 | + ]; */ | |
| 367 | + | |
| 368 | + //var selectRow; | |
| 369 | + | |
| 370 | + //받는사람 연락처 내용 처리 | |
| 371 | + //Tabulator AJAX Data Loading | |
| 372 | + | |
| 373 | + | |
| 374 | + tableL = new Tabulator(".callList_box", { | |
| 375 | + height:"255px", | |
| 376 | + layout:"fitDataFill", | |
| 377 | + //data:tabledata, | |
| 378 | + autoColumns:true, | |
| 379 | + headerHozAlign:"center", | |
| 380 | + //validationMode:"highlight", | |
| 381 | + //clipboard:false, | |
| 382 | + //clipboardCopySelector:"table", | |
| 383 | + //clipboardPasteAction:"insert", // insert, update, replace | |
| 384 | + placeholder:"주소록을 선택해 해주세요.", //fit columns to width of table (optional) | |
| 385 | + //resizableColumns:true, | |
| 386 | + columns:[ //Define Table Columns | |
| 387 | + {formatter:"rowSelection", titleFormatter:"rowSelection", clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){ | |
| 388 | + cell.getRow().toggleSelect(); | |
| 389 | + } | |
| 390 | + }, | |
| 391 | + {title:"주소록명", hozAlign:"center", field:"addrGrpNm", headerSort:false, width:300}, | |
| 392 | + {title:"건수", hozAlign:"center", field:"addrGrpCnt", headerSort:false, width:100}, | |
| 393 | + {title:"그룹아이디", hozAlign:"center", field:"addrGrpId", visible:false}, | |
| 394 | + | |
| 395 | + ], | |
| 396 | + | |
| 397 | + }); | |
| 398 | + | |
| 399 | + | |
| 400 | + //주소록 불러오기 팝업 내용 | |
| 401 | + //Tabulator AJAX Data Loading | |
| 402 | + tableAddr = new Tabulator(".callAddr_box", { | |
| 403 | + height:"255px", | |
| 404 | + layout:"fitColumns", | |
| 405 | + headerHozAlign:"center", | |
| 406 | + validationMode:"highlight", | |
| 407 | + placeholder:"주소록 그룹을 선택해 주세요.", //fit columns to width of table (optional) | |
| 408 | + resizableColumns:false, | |
| 409 | + columns:[ //Define Table Columns | |
| 410 | + {formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){ | |
| 411 | + cell.getRow().toggleSelect(); | |
| 412 | + } | |
| 413 | + }, | |
| 414 | + {title:"그룹명", hozAlign:"center", field:"addrGroupNm", editor:"input", width:100, validator:["required","minLength:2", "maxLength:40"]}, | |
| 415 | + {title:"이름", hozAlign:"center", field:"addrName", editor:"input", width:100, validator:["maxLength:12"]}, | |
| 416 | + {title:"휴대폰번호", hozAlign:"center", field:"addrPhone", editor:"input", width:100, validator:["required","minLength:10", "maxLength:11"]}, | |
| 417 | + {title:"[*1*]", hozAlign:"center", field:"addrRep1", editor:"input", width:84, validator:["maxLength:40"]}, | |
| 418 | + {title:"[*2*]", hozAlign:"center", field:"addrRep2", editor:"input", width:84, validator:["maxLength:40"]}, | |
| 419 | + {title:"[*3*]", hozAlign:"center", field:"addrRep3", editor:"input", width:84, validator:["maxLength:40"]}, | |
| 420 | + {title:"[*4*]", hozAlign:"center", field:"addrRep4", editor:"input", width:84, validator:["maxLength:40"]}, | |
| 421 | + | |
| 422 | + ], | |
| 423 | + validationFailed:function(cell, value, parameters){ // 유효성 체크 함수 - 아직 잘 모르겠음 | |
| 424 | + var valid = cell.isValid(); | |
| 425 | + var fieldNm = cell.getField(); | |
| 426 | + if(!valid){ | |
| 427 | + if(fieldNm == "addrName"){ | |
| 428 | + alert("받는사람 이름은 최대 12글자까지만 입력 가능합니다."); | |
| 429 | + }else if(fieldNm == "addrPhone"){ | |
| 430 | + alert("휴대폰번호는 하이픈(-)을 제외한 숫자만 정확히 입력해 주세요."); | |
| 431 | + }else if(fieldNm == "addrGroupNm"){ | |
| 432 | + alert("그룹명을 정확히 입력해 주세요. 2 ~ 40글자 이내로 입력 가능합니다."); | |
| 433 | + }else{ | |
| 434 | + alert("치환문자를 정확히 입력해 주세요. 40글자 이내로 입력 가능합니다."); | |
| 435 | + } | |
| 436 | + | |
| 437 | + //해당 셀 데이터 삭제 | |
| 438 | + cell.setValue(""); | |
| 439 | + } | |
| 440 | + return value % parameters.addrPhone; | |
| 441 | + }, | |
| 442 | + | |
| 443 | + }); | |
| 444 | + | |
| 445 | + //핸드폰 번호 Tabulator에서 수정시 중복 체크 | |
| 446 | + function fnDuplPhone(){ | |
| 447 | + | |
| 448 | + var recTableData = tableL.getRows(); // 받는사람 리스트의 전체 목록을 저장 | |
| 449 | + var tableData = []; | |
| 450 | + | |
| 451 | + //기존 받는사람 리스트를 배열에 미리 담아둔다. | |
| 452 | + if(recTableData.length > 0){ | |
| 453 | + | |
| 454 | + for(var j=0; j < recTableData.length; j++){ | |
| 455 | + | |
| 456 | + tableData.push({phone: removeDash(recTableData[j].getData().phone.trim()) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4}); | |
| 457 | + | |
| 458 | + } | |
| 459 | + | |
| 460 | + } | |
| 461 | + | |
| 462 | + //수신목록에서 중복 휴대폰문자가 있는지 체크해주기 | |
| 463 | + var dupCnt = dupliPhoneDataChk(tableData); | |
| 464 | + | |
| 465 | + if(dupCnt > 0){ | |
| 466 | + | |
| 467 | + if(confirm("동일한 휴대폰 번호가 받는사람 목록에 등록되어 있습니다. 중복 번호를 삭제하시겠습니까?")){ | |
| 468 | + | |
| 469 | + //수신목록에서 중복 휴대폰 번호 삭제해주기 | |
| 470 | + tableL.clearData(); //기존 받는사람 목록을 삭제. | |
| 471 | + tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기 | |
| 472 | + _fileForm2 = []; //form file data 초기화 | |
| 473 | + _fileIdx = 0; //form file idx 초기화 | |
| 474 | + | |
| 475 | + totRows = tableL.getRows().length; | |
| 476 | + updateTotCnt(totRows); //전체 데이터 갯수 구하기 | |
| 477 | + | |
| 478 | + } | |
| 479 | + | |
| 480 | + } | |
| 481 | + | |
| 482 | + } | |
| 483 | + | |
| 484 | + //받는사람 목록에 복사/붙여넣기 기능 처리 | |
| 485 | + /* $('.callList_box').on('paste', function (e) { | |
| 486 | + | |
| 487 | + var element = e.originalEvent.clipboardData.getData('text'); // 클립보드에 복사한 데이터 가져오기 | |
| 488 | + | |
| 489 | + var elmSplit= []; | |
| 490 | + | |
| 491 | + elmSplit = element.split("\n"); | |
| 492 | + | |
| 493 | + var elmLen = elmSplit.length; | |
| 494 | + | |
| 495 | + | |
| 496 | + if(elmLen < 0){ | |
| 497 | + | |
| 498 | + alert("붙여넣을 연락처를 복사해주세요."); | |
| 499 | + return false; | |
| 500 | + | |
| 501 | + }else{ | |
| 502 | + tableErrorData.length = 0; // 오류 번호 배열 초기화 | |
| 503 | + | |
| 504 | + var splitData = []; | |
| 505 | + var realPhone = []; | |
| 506 | + for(var i=0; i < elmLen; i++){ | |
| 507 | + | |
| 508 | + var splitStr = elmSplit[i]; | |
| 509 | + var tabData = []; | |
| 510 | + var comData = []; | |
| 511 | + | |
| 512 | + if(splitStr.indexOf('\t') != -1){ | |
| 513 | + splitData = splitStr.split('\t'); //탭 구분으로 데이터 분할 | |
| 514 | + }else if(splitStr.indexOf(',') != -1){ | |
| 515 | + splitData = splitStr.split(','); //콤마 구분으로 데이터 분할 | |
| 516 | + }else{ | |
| 517 | + splitData = splitStr.split(' '); | |
| 518 | + } | |
| 519 | + | |
| 520 | + | |
| 521 | + if(splitData.length == 0){// 데이터가 없는경우 | |
| 522 | + | |
| 523 | + alert("탭으로 구분하여 데이터를 복사해 주세요."); | |
| 524 | + return false; | |
| 525 | + | |
| 526 | + }else if(splitData.length == 1){// 데이터가 탭으로 구분이 없는 경우 | |
| 527 | + | |
| 528 | + for(var j=0; j < splitData.length; j++){ | |
| 529 | + if(checkHpNum(splitData[j].trim())){//핸드폰 양식이 맞는지 확인 | |
| 530 | + //배열 끝에 데이터 추가해 주기 | |
| 531 | + realPhone.push({phone: removeDash(splitData[j].trim()), name: ""}); | |
| 532 | + } | |
| 533 | + else { | |
| 534 | + if (splitData[j].trim() != '' && splitData[j].trim() != null && splitData[j].trim() != undefined) { | |
| 535 | + tableErrorData.push(splitData[j].trim()); | |
| 536 | + } | |
| 537 | + } | |
| 538 | + } | |
| 539 | + | |
| 540 | + }else{//데이터가 탭으로 구분되어 이름, 연락처로 구분된 경우 | |
| 541 | + | |
| 542 | + var phone = ""; //핸드폰번호 | |
| 543 | + var name = ""; //이름 | |
| 544 | + var rep1 = ""; //치환문자1 | |
| 545 | + var rep2 = ""; //치환문자2 | |
| 546 | + var rep3 = ""; //치환문자3 | |
| 547 | + var rep4 = ""; //치환문자4 | |
| 548 | + var isPhoneValid = false; | |
| 549 | + for(var j=0; j < splitData.length; j++){ | |
| 550 | + | |
| 551 | + if(j == 0){ | |
| 552 | + | |
| 553 | + name = splitData[j].trim(); | |
| 554 | + | |
| 555 | + } | |
| 556 | + | |
| 557 | + if(j == 1){ | |
| 558 | + | |
| 559 | + if(checkHpNum(splitData[j].trim())){//핸드폰 양식이 맞는지 확인 | |
| 560 | + phone = removeDash(splitData[j].trim()); | |
| 561 | + isPhoneValid = true; | |
| 562 | + }else{ | |
| 563 | + if (splitData[j].trim() != '' && splitData[j].trim() != null && splitData[j].trim() != undefined) { | |
| 564 | + tableErrorData.push(splitData[j].trim()); | |
| 565 | + } | |
| 566 | + } | |
| 567 | + | |
| 568 | + } | |
| 569 | + | |
| 570 | + if(j == 2){ //치환문자1 | |
| 571 | + | |
| 572 | + rep1 = splitData[j].trim(); | |
| 573 | + | |
| 574 | + } | |
| 575 | + | |
| 576 | + if(j == 3){ //치환문자2 | |
| 577 | + | |
| 578 | + rep2 = splitData[j].trim(); | |
| 579 | + | |
| 580 | + } | |
| 581 | + | |
| 582 | + if(j == 4){ //치환문자3 | |
| 583 | + | |
| 584 | + rep3 = splitData[j].trim(); | |
| 585 | + | |
| 586 | + } | |
| 587 | + | |
| 588 | + if(j == 5){ //치환문자4 | |
| 589 | + | |
| 590 | + rep4 = splitData[j].trim(); | |
| 591 | + | |
| 592 | + } | |
| 593 | + | |
| 594 | + } | |
| 595 | + | |
| 596 | + if (isPhoneValid == true) { | |
| 597 | + //배열 끝에 데이터 추가해 주기 | |
| 598 | + realPhone.push({phone: phone, name: name, rep1 : rep1, rep2 : rep2, rep3 : rep3, rep4 : rep4 }); | |
| 599 | + } | |
| 600 | + | |
| 601 | + }//else end | |
| 602 | + | |
| 603 | + } | |
| 604 | + | |
| 605 | + var recTableData = tableL.getRows(); // 받는사람 리스트의 전체 목록을 저장 | |
| 606 | + var tableData = []; | |
| 607 | + | |
| 608 | + //기존 받는사람 리스트를 배열에 미리 담아둔다. | |
| 609 | + if(recTableData.length > 0){ | |
| 610 | + | |
| 611 | + for(var j=0; j < recTableData.length; j++){ | |
| 612 | + | |
| 613 | + tableData.push({phone: removeDash(recTableData[j].getData().phone.trim()) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4, }); | |
| 614 | + | |
| 615 | + } | |
| 616 | + | |
| 617 | + } | |
| 618 | + | |
| 619 | + if(realPhone.length > 0){ | |
| 620 | + | |
| 621 | + for(var j=0; j < realPhone.length; j++){ | |
| 622 | + | |
| 623 | + tableData.push({phone: removeDash(realPhone[j].phone.trim()) , name: realPhone[j].name, rep1: realPhone[j].rep1, rep2: realPhone[j].rep2, rep3: realPhone[j].rep3, rep4: realPhone[j].rep4}); | |
| 624 | + | |
| 625 | + } | |
| 626 | + | |
| 627 | + } | |
| 628 | + | |
| 629 | + //tableData.push(realPhone); | |
| 630 | + | |
| 631 | + //중복 연락처 1개만 남기고 삭제하기 | |
| 632 | + var removeDuplPhone = dupliPhoneData(tableData); | |
| 633 | + | |
| 634 | + //수신자 리스트에 전화번호 추가해주기 | |
| 635 | + //tableL.addData(removeDuplPhone); | |
| 636 | + tableL.setData(removeDuplPhone); | |
| 637 | + | |
| 638 | + totRows = tableL.getRows().length; | |
| 639 | + updateTotCnt(totRows); //전체 데이터 갯수 구하기 | |
| 640 | + | |
| 641 | + var smsTxtArea = $('#smsTxtArea').val(); | |
| 642 | + | |
| 643 | + //일괄변환 문구 결제금액 처리 | |
| 644 | + if(smsTxtArea.indexOf("[*이름*]") > -1 | |
| 645 | + || smsTxtArea.indexOf("[*1*]") > -1 | |
| 646 | + || smsTxtArea.indexOf("[*2*]") > -1 | |
| 647 | + || smsTxtArea.indexOf("[*3*]") > -1 | |
| 648 | + || smsTxtArea.indexOf("[*4*]") > -1){ | |
| 649 | + | |
| 650 | + fnReplCell(); | |
| 651 | + }else{ | |
| 652 | + //결제 금액 구하기 | |
| 653 | + totalPriceSum(totRows); | |
| 654 | + } | |
| 655 | + | |
| 656 | + if (tableErrorData.length > 0) { | |
| 657 | + alert("올바르지 않은 휴대폰 번호가 "+ tableErrorData.length +" 건 있습니다."); | |
| 658 | + } | |
| 659 | + | |
| 660 | + } | |
| 661 | + | |
| 662 | + }); */ | |
| 663 | + | |
| 664 | + //받는사람 번호 버튼 클릭시 Tabulator에 데이터 넣어주기 | |
| 665 | + $('.addCallToF').click(function(){ | |
| 666 | + | |
| 667 | + var callToNum = $('#callTo').val(); | |
| 668 | + if(callToNum == null || callToNum == ""){ | |
| 669 | + | |
| 670 | + alert("받는사람 번호를 입력해 주세요."); | |
| 671 | + return false; | |
| 672 | + | |
| 673 | + }else if(!checkHpNum(callToNum)){ | |
| 674 | + | |
| 675 | + alert("올바른 전화번호를 입력해 주세요."); | |
| 676 | + $('#callTo').val(""); | |
| 677 | + return false; | |
| 678 | + } | |
| 679 | + | |
| 680 | + //핸드폰 번호에 '-' 문자 제거하기 | |
| 681 | + callToNum = removeDash(callToNum); | |
| 682 | + | |
| 683 | + //기존 받는사람 연락처 모두 불러오기 | |
| 684 | + var data = tableL.getRows(); | |
| 685 | + var tableData = []; | |
| 686 | + var dpCnt = 0; | |
| 687 | + for(var i=0; i < tableL.getRows().length; i++){ | |
| 688 | + | |
| 689 | + if(callToNum == data[i].getData().phone){ | |
| 690 | + | |
| 691 | + dpCnt++; | |
| 692 | + | |
| 693 | + } | |
| 694 | + | |
| 695 | + } | |
| 696 | + | |
| 697 | + if(dpCnt > 0){ | |
| 698 | + | |
| 699 | + alert("받는사람 리스트에 동일한 연락처가 있습니다."); | |
| 700 | + $('#callTo').val(""); | |
| 701 | + return false; | |
| 702 | + | |
| 703 | + }else{ | |
| 704 | + | |
| 705 | + tabledata = [{phone: callToNum},]; | |
| 706 | + | |
| 707 | + //빈 row 데이터 삭제하기 | |
| 708 | + var befData = tableL.getRows(); | |
| 709 | + var totLen = tableL.getRows().length; | |
| 710 | + | |
| 711 | + for(var i=0; i < totLen; i++){ | |
| 712 | + | |
| 713 | + tableData.push({phone: data[i].getData().phone.trim(), name: data[i].getData().name}); | |
| 714 | + | |
| 715 | + } | |
| 716 | + | |
| 717 | + //연락처 추가해 주기 | |
| 718 | + addPhoneInfo(tabledata); | |
| 719 | + | |
| 720 | + //tableL.addData(tabledata); | |
| 721 | + | |
| 722 | + //전체 데이터 갯수 구하기 | |
| 723 | + //totRows = tableL.getRows().length; | |
| 724 | + //updateTotCnt(totRows); | |
| 725 | + | |
| 726 | + //결제 금액 구하기 | |
| 727 | + //totalPriceSum(totRows); | |
| 728 | + | |
| 729 | + $('#callTo').val(""); | |
| 730 | + | |
| 731 | + } | |
| 732 | + | |
| 733 | + }); | |
| 734 | + | |
| 735 | + | |
| 736 | + //받는사람 전체삭제 버튼 처리 | |
| 737 | + $('.all_del').click(function(){ | |
| 738 | + | |
| 739 | + var data = tableL.getRows(); | |
| 740 | + | |
| 741 | + if(data == null || data == ""){ | |
| 742 | + | |
| 743 | + alert("받는사람을 추가해 주세요."); | |
| 744 | + return false; | |
| 745 | + | |
| 746 | + }else{ | |
| 747 | + | |
| 748 | + if(confirm("받는사람 목록을 모두 삭제하시겠습니까?")){ | |
| 749 | + tableL.clearData(); | |
| 750 | + $("#rowTotCnt").text(0); //총건수 수정 | |
| 751 | + $("#rowDupCnt").text(0); //중복건수 수정 | |
| 752 | + totalPriceSum(0); //결제 금액 수정 | |
| 753 | + } | |
| 754 | + | |
| 755 | + } | |
| 756 | + | |
| 757 | + }); | |
| 758 | + | |
| 759 | + | |
| 760 | + // 받는사람 선택삭제 버튼 처리해주기 | |
| 761 | + $('.select_del').click(function(){ | |
| 762 | + | |
| 763 | + if(tableL == null || tableL == ""){ | |
| 764 | + | |
| 765 | + alert("받는사람을 추가해 주세요."); | |
| 766 | + return false; | |
| 767 | + | |
| 768 | + } | |
| 769 | + | |
| 770 | + var selectedData = tableL.getSelectedRows(); | |
| 771 | + | |
| 772 | + if(selectedData == "" || selectedData == null){ | |
| 773 | + | |
| 774 | + alert("삭제할 연락처를 선택해주세요."); | |
| 775 | + return false; | |
| 776 | + | |
| 777 | + }else{ // 선택한 Row 데이터 삭제하기 | |
| 778 | + | |
| 779 | + if(confirm("선택하신 받는 사람을 삭제하시겠습니까?")){ | |
| 780 | + | |
| 781 | + for(var i=0; i < selectedData.length; i++){ | |
| 782 | + | |
| 783 | + selectedData[i].delete(); | |
| 784 | + | |
| 785 | + } | |
| 786 | + | |
| 787 | + totRows = tableL.getRows().length; | |
| 788 | + | |
| 789 | + updateTotCnt(totRows); | |
| 790 | + | |
| 791 | + var smsTxtArea = $('#smsTxtArea').val(); | |
| 792 | + | |
| 793 | + //일괄변환 문구 결제금액 처리 | |
| 794 | + if(smsTxtArea.indexOf("[*이름*]") > -1 | |
| 795 | + || smsTxtArea.indexOf("[*1*]") > -1 | |
| 796 | + || smsTxtArea.indexOf("[*2*]") > -1 | |
| 797 | + || smsTxtArea.indexOf("[*3*]") > -1 | |
| 798 | + || smsTxtArea.indexOf("[*4*]") > -1){ | |
| 799 | + | |
| 800 | + fnReplCell(); | |
| 801 | + }else{ | |
| 802 | + //결제 금액 구하기 | |
| 803 | + totalPriceSum(totRows); | |
| 804 | + } | |
| 805 | + | |
| 806 | + } | |
| 807 | + | |
| 808 | + } | |
| 809 | + | |
| 810 | + }); | |
| 811 | + | |
| 812 | +/* //받는사람 중복 삭제 | |
| 813 | + $('.duple_del').click(function(){ | |
| 814 | + | |
| 815 | + //기존 연락처 모두 불러오기 | |
| 816 | + var data = tableL.getRows(); | |
| 817 | + var tableData = []; | |
| 818 | + var dpCnt = 0; | |
| 819 | + var totLen = tableL.getRows().length; | |
| 820 | + | |
| 821 | + for(var i=0; i < totLen; i++){ | |
| 822 | + | |
| 823 | + tableData.push({phone: data[i].getData().phone.trim(), name: data[i].getData().name}); | |
| 824 | + | |
| 825 | + } | |
| 826 | + | |
| 827 | + var removeDuplData = dupliPhoneData(tableData); | |
| 828 | + | |
| 829 | + tableL.setData(removeDuplData); | |
| 830 | + | |
| 831 | + //총 받는사람 수 계산 | |
| 832 | + totRows = tableL.getRows().length; | |
| 833 | + updateTotCnt(totRows); | |
| 834 | + | |
| 835 | + //결제 금액 구하기 | |
| 836 | + totalPriceSum(totRows); | |
| 837 | + | |
| 838 | + }); */ | |
| 839 | + | |
| 840 | + //주소록 불러오기 버튼 클릭시 | |
| 841 | + $('.popupAddr').click(function(){ | |
| 842 | + | |
| 843 | + var login = '${LoginVO.id}'; | |
| 844 | + | |
| 845 | + if(login == null || login == ''){ | |
| 846 | + | |
| 847 | + alert("로그인 후 이용이 가능합니다."); | |
| 848 | + return false; | |
| 849 | + | |
| 850 | + } | |
| 851 | + | |
| 852 | + $("#addrGroupLoad").load("/web/mjon/msgcampain/huge/selectAddrGroupListAjax.do", "" ,function(response, status, xhr){ | |
| 853 | + //리스트 스크롤 처리해주기 | |
| 854 | + $(".adr_pop_list").mCustomScrollbar({ | |
| 855 | + axis: 'y', | |
| 856 | + scrollbarPosition: "outside", | |
| 857 | + theme: "dark", | |
| 858 | + autoHideScrollbar: false | |
| 859 | + }); | |
| 860 | + }); | |
| 861 | + | |
| 862 | + }); | |
| 863 | + | |
| 864 | + //엑섹불러오기 버튼 클릭시 파일 첨부 실행 | |
| 865 | + $('.c3').click(function(){ // 엑셀파일 불러오기 선택 시 | |
| 866 | + | |
| 867 | + $("#excelFile").click(); | |
| 868 | + | |
| 869 | + }); | |
| 870 | + | |
| 871 | + //최근전송내역 팝업 선택추가 버튼 처리(체크내역 받는사람 리스트로 추가해주기) | |
| 872 | + $(document).on('click', '#latestAddPhone', function (){ | |
| 873 | + var addPhoneList = []; //신규로 추가할 전화번호 저장변수 | |
| 874 | + $("input:checkbox[name='latAddrChk']:checked").each(function(index){ | |
| 875 | + var chkPhone = $(this).val(); | |
| 876 | + if(!checkHpNum(chkPhone)){ | |
| 877 | + alert("올바른 전화번호가 아닙니다."); | |
| 878 | + return false; | |
| 879 | + }else{ | |
| 880 | + addPhoneList.push({phone: removeDash(chkPhone.trim())}); | |
| 881 | + } | |
| 882 | + }); | |
| 883 | + | |
| 884 | + if(addPhoneList.length > 0){ | |
| 885 | + //연락처 추가해 주기 | |
| 886 | + addPhoneInfo(addPhoneList); | |
| 887 | + $("#btnLatestAddPhoneClose").trigger("click"); | |
| 888 | + } | |
| 889 | + else { | |
| 890 | + alert("연락처를 선택해주세요."); | |
| 891 | + return false; | |
| 892 | + } | |
| 893 | + }); | |
| 894 | + | |
| 895 | + //최근전송내역 팝업 전체추가 버튼 처리 | |
| 896 | + $(document).on('click', '#latestAddPhoneAll', function (){ | |
| 897 | + var addPhoneList = []; //신규로 추가할 전화번호 저장변수 | |
| 898 | + $("input:checkbox[name='latAddrChk']").each(function(index){ | |
| 899 | + var chkPhone = $(this).val(); | |
| 900 | + if(!checkHpNum(chkPhone)){ | |
| 901 | + alert("올바른 전화번호가 아닙니다."); | |
| 902 | + return false; | |
| 903 | + }else{ | |
| 904 | + addPhoneList.push({phone: removeDash(chkPhone.trim())}); | |
| 905 | + } | |
| 906 | + }); | |
| 907 | + | |
| 908 | + if(addPhoneList.length > 0){ | |
| 909 | + //연락처 추가해 주기 | |
| 910 | + addPhoneInfo(addPhoneList); | |
| 911 | + $("#btnLatestAddPhoneClose").trigger("click"); | |
| 912 | + } | |
| 913 | + else { | |
| 914 | + alert("연락처가 없습니다."); | |
| 915 | + return false; | |
| 916 | + } | |
| 917 | + }); | |
| 918 | + | |
| 919 | + //최근전송내역 팝업 선택 취소 버튼 처리 | |
| 920 | + $(document).on('click', '#latestCancelPhone', function (){ | |
| 921 | + | |
| 922 | + $("input[name=latAddrChk]").prop("checked", false); | |
| 923 | + | |
| 924 | + }); | |
| 925 | + | |
| 926 | + //최근전송내역 팝업 삭제 버튼 처리 | |
| 927 | + $(document).on('click', '#latestAddrDel', function (){ | |
| 928 | + | |
| 929 | + $(this).parent("#latestLi").remove(); | |
| 930 | + | |
| 931 | + }); | |
| 932 | + | |
| 933 | + //자주보내는 번호 팝업 선택추가 버튼 처리(체크내역 받는사람 리스트로 추가해주기) | |
| 934 | + $(document).on('click', '#bookMarkAddPhone', function (){ | |
| 935 | + var addPhoneList = []; //신규로 추가할 전화번호 저장변수 | |
| 936 | + $("input:checkbox[name='bookAddrChk']:checked").each(function(index){ | |
| 937 | + var chkPhone = $(this).val(); | |
| 938 | + if(!checkHpNum(chkPhone)){ | |
| 939 | + alert("올바른 전화번호가 아닙니다."); | |
| 940 | + return false; | |
| 941 | + }else{ | |
| 942 | + addPhoneList.push({phone: removeDash(chkPhone.trim())}); | |
| 943 | + } | |
| 944 | + }); | |
| 945 | + | |
| 946 | + if(addPhoneList.length > 0){ | |
| 947 | + //연락처 추가해 주기 | |
| 948 | + addPhoneInfo(addPhoneList); | |
| 949 | + $("#btnLatestAddPhoneClose").trigger("click"); | |
| 950 | + } | |
| 951 | + else { | |
| 952 | + alert("연락처를 선택해주세요."); | |
| 953 | + return false; | |
| 954 | + } | |
| 955 | + }); | |
| 956 | + | |
| 957 | + //자주보내는 번호 팝업 선택추가 버튼 처리(체크내역 받는사람 리스트로 추가해주기) | |
| 958 | + $(document).on('click', '#bookMarkAddPhoneAll', function (){ | |
| 959 | + var addPhoneList = []; //신규로 추가할 전화번호 저장변수 | |
| 960 | + $("input:checkbox[name='bookAddrChk']").each(function(index){ | |
| 961 | + var chkPhone = $(this).val(); | |
| 962 | + if(!checkHpNum(chkPhone)){ | |
| 963 | + alert("올바른 전화번호가 아닙니다."); | |
| 964 | + return false; | |
| 965 | + }else{ | |
| 966 | + addPhoneList.push({phone: removeDash(chkPhone.trim())}); | |
| 967 | + } | |
| 968 | + }); | |
| 969 | + | |
| 970 | + if(addPhoneList.length > 0){ | |
| 971 | + //연락처 추가해 주기 | |
| 972 | + addPhoneInfo(addPhoneList); | |
| 973 | + $("#btnLatestAddPhoneClose").trigger("click"); | |
| 974 | + } | |
| 975 | + else { | |
| 976 | + alert("연락처가 없습니다."); | |
| 977 | + return false; | |
| 978 | + } | |
| 979 | + }); | |
| 980 | + | |
| 981 | + //자주보내는 번호 팝업 선택 취소 버튼 처리 | |
| 982 | + $(document).on('click', '#bookMarkCancelPhone', function (){ | |
| 983 | + | |
| 984 | + $("input[name=bookAddrChk]").prop("checked", false); | |
| 985 | + | |
| 986 | + }); | |
| 987 | + | |
| 988 | + //자주보내는 번호 팝업 삭제 버튼 처리 | |
| 989 | + $(document).on('click', '#bookMarkAddrDel', function (){ | |
| 990 | + | |
| 991 | + $(this).parent("#bookMarkLi").remove(); | |
| 992 | + | |
| 993 | + }); | |
| 994 | + | |
| 995 | + | |
| 996 | + //오류 검사 버튼 처리 | |
| 997 | + $('.check_validity').click(function(){ | |
| 998 | + | |
| 999 | + var invalid = tableL.getInvalidCells(); //오류 데이터 체크 | |
| 1000 | + var dataLen = tableL.getRows().length; //연락처 데이터 갯수 | |
| 1001 | + var totLen = invalid.length; //오류 데이터 갯수 | |
| 1002 | + var errMsg = ""; //최종 alert에 표시할 메시지 저장 변수 | |
| 1003 | + | |
| 1004 | + if(dataLen > 0){ //연락처 정보가 있으면 수행 | |
| 1005 | + | |
| 1006 | + if(totLen > 0){ //내용에 오류가 있으면 수행 | |
| 1007 | + | |
| 1008 | + //오류 데이터 값 저장 | |
| 1009 | + for(var i=0; i < totLen; i++){ | |
| 1010 | + | |
| 1011 | + var cellValue = invalid[i].getValue(); | |
| 1012 | + | |
| 1013 | + if(i == 0){ | |
| 1014 | + | |
| 1015 | + errMsg = cellValue; | |
| 1016 | + | |
| 1017 | + }else{ | |
| 1018 | + | |
| 1019 | + errMsg = errMsg +", "+ cellValue; | |
| 1020 | + | |
| 1021 | + } | |
| 1022 | + | |
| 1023 | + } | |
| 1024 | + | |
| 1025 | + if(errMsg == "" || errMsg == null){ | |
| 1026 | + | |
| 1027 | + alert("내용에 오류가 있습니다."); | |
| 1028 | + return false; | |
| 1029 | + | |
| 1030 | + }else{ | |
| 1031 | + | |
| 1032 | + alert(errMsg + "의 내용에 오류가 있습니다."); | |
| 1033 | + return false; | |
| 1034 | + | |
| 1035 | + } | |
| 1036 | + | |
| 1037 | + }else{ | |
| 1038 | + | |
| 1039 | + alert("오류 데이터가 없습니다."); | |
| 1040 | + return false; | |
| 1041 | + | |
| 1042 | + } | |
| 1043 | + | |
| 1044 | + }else{ | |
| 1045 | + | |
| 1046 | + alert("연락처를 입력해 주세요."); | |
| 1047 | + return false; | |
| 1048 | + | |
| 1049 | + } | |
| 1050 | + | |
| 1051 | + }); | |
| 1052 | + | |
| 1053 | + //문자입력창의 첨부된 이미지 순서를 바꿀 때 | |
| 1054 | + $(document).on('mouseup', '.thumb_wrap img', function (){ | |
| 1055 | + //미리보기 창의 이미지 순서를 변경한다 | |
| 1056 | + setTimeout(function() { | |
| 1057 | + var previewHtml = ""; | |
| 1058 | + var imgCnt = $("#imgCnt").val(); | |
| 1059 | + //이미지 갯수만큼 for문 돌림 | |
| 1060 | + | |
| 1061 | + for(var i=0; i<imgCnt; i++) { | |
| 1062 | + var imgTag = $(".thumb_wrap li:eq("+i+") div").html(); // 썸네일에 있는 이미지 태그 가져오기 | |
| 1063 | + previewHtml += '<div class="img_box preBoxF on_scroll_img" id="preBoxF'+(i+1)+'">' | |
| 1064 | + previewHtml += imgTag; | |
| 1065 | + previewHtml += '</div>' | |
| 1066 | + } | |
| 1067 | + $('.preViewShort div').remove(); //미리보기 영역에 있던 이미지 다 지우고 | |
| 1068 | + $('.preViewShort').append(previewHtml); //새로 sorting된 이미지 그려주기 | |
| 1069 | + }, 100); | |
| 1070 | + | |
| 1071 | + }); | |
| 1072 | + | |
| 1073 | + //문자 샘플 탭, 그림문자 샘플 탭 선택시 옵션 초기화 | |
| 1074 | + $('.tab').click(function(){ | |
| 1075 | + | |
| 1076 | + var index = $(this).index(); | |
| 1077 | + var form = document.letterForm; | |
| 1078 | + | |
| 1079 | + if($(this).hasClass("active") === true){ | |
| 1080 | + | |
| 1081 | + if(index == 0){ | |
| 1082 | + | |
| 1083 | + form.pageIndex.value = 1; | |
| 1084 | + form.letterType.value = "S"; | |
| 1085 | + form.categoryCode.value = ""; | |
| 1086 | + form.hashTag.value = ""; | |
| 1087 | + | |
| 1088 | + }else if(index == 1){ | |
| 1089 | + | |
| 1090 | + form.pageIndex.value = 1; | |
| 1091 | + form.letterType.value = "P"; | |
| 1092 | + form.categoryCode.value = ""; | |
| 1093 | + form.hashTag.value = ""; | |
| 1094 | + | |
| 1095 | + }else if(index == 2){ | |
| 1096 | + | |
| 1097 | + setTimeout(function(){ | |
| 1098 | + map.relayout(); | |
| 1099 | + map.setCenter(testcoords); | |
| 1100 | + }, 0); | |
| 1101 | + | |
| 1102 | + } | |
| 1103 | + | |
| 1104 | + } | |
| 1105 | + | |
| 1106 | + }); | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + //이미지 선택시 그림문자 처리 | |
| 1110 | + $(document).on('click', '.photoOnImg', function(){ | |
| 1111 | + | |
| 1112 | + // 클릭 시 조회수 증가 로직 | |
| 1113 | + var letterId = $(this).attr('id'); | |
| 1114 | + | |
| 1115 | + var url = "/web/mjon/msgdata/updateSmsTemplateCntAjax.do"; | |
| 1116 | + | |
| 1117 | + $.ajax({ | |
| 1118 | + type: "POST", | |
| 1119 | + url: url, | |
| 1120 | + data: {'letterId':letterId}, | |
| 1121 | + dataType:'json', | |
| 1122 | + async: false, | |
| 1123 | + cache: false, | |
| 1124 | + success: function (returnData, status) { | |
| 1125 | + console.log("status : ", status); | |
| 1126 | + }, | |
| 1127 | + error: function (e) {console.log("ERROR : ", e); } | |
| 1128 | + }); | |
| 1129 | + // 클릭 시 조회수 증가 로직 끝 | |
| 1130 | + | |
| 1131 | + var imgId = $(this).parent().find("input").val(); | |
| 1132 | + imageControl($(this), "edit_n", "Template", imgId); | |
| 1133 | + | |
| 1134 | + var contents = $('#smsTxtArea').val(); | |
| 1135 | + //(contents); | |
| 1136 | + | |
| 1137 | + //받는 사람 주소록 리스트에서 각 주소 갯수 합산 계산 | |
| 1138 | + //totRows = tableL.getRows().length; | |
| 1139 | + totRows = getTabulatorLAddrGrpCnt(); | |
| 1140 | + updateTotCnt(totRows); //전체 데이터 갯수 구하기 | |
| 1141 | + | |
| 1142 | + //일괄변환 문구 결제금액 처리 | |
| 1143 | + if(contents.indexOf("[*이름*]") > -1 | |
| 1144 | + || contents.indexOf("[*1*]") > -1 | |
| 1145 | + || contents.indexOf("[*2*]") > -1 | |
| 1146 | + || contents.indexOf("[*3*]") > -1 | |
| 1147 | + || contents.indexOf("[*4*]") > -1){ | |
| 1148 | + | |
| 1149 | + fnReplCell(); | |
| 1150 | + | |
| 1151 | + }else{ | |
| 1152 | + | |
| 1153 | + //결제금액 표시해주기 | |
| 1154 | + var totalPrice = totalPriceSum(totRows); | |
| 1155 | + $('#totalPrice').text(totalPrice); | |
| 1156 | + $('#txtReplYn').val("N"); | |
| 1157 | + | |
| 1158 | + } | |
| 1159 | + | |
| 1160 | + var sendOfT=$('.send_top').offset().top; | |
| 1161 | + $('html,body').stop().animate({'scrollTop':sendOfT-60},250); | |
| 1162 | + | |
| 1163 | + }); | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + //그림문자 이미지 삭제 처리 - 동적으로 추가한 객체는 on 함수로 불러올 수 있다. | |
| 1167 | + $(document).on('click', '.file_close', function(){ | |
| 1168 | + var delImgPath = ""; //삭제하려는 이미지 경로 받아오기 | |
| 1169 | + var index = $(this).parent().index(); // 현재 선택 된 객체 인덱스 번호 받아오기 | |
| 1170 | + var imgCnt = $("#imgCnt").val(); // 현재 첨부된 이미지의 갯수 | |
| 1171 | + var contents = $('#smsTxtArea').val(); | |
| 1172 | + | |
| 1173 | + //선택한 태그의 부모 이미지 li 객체 삭제 | |
| 1174 | + $(this).parent(".delLi").remove(); | |
| 1175 | + | |
| 1176 | + //미리보기 화면에서의 이미지 객체 삭제 | |
| 1177 | + //삭제하려는 이미지 경로 받아오기 | |
| 1178 | + delImgPath = $('.preBoxF').eq(index).find("img").attr("src"); | |
| 1179 | + | |
| 1180 | + $('.preBoxF').eq(index).remove(); | |
| 1181 | + | |
| 1182 | + // 삭제한 이미지 경로 배열에서 삭제해 주기 | |
| 1183 | + for(var i=0; i < imgFilePath.length; i++){ | |
| 1184 | + | |
| 1185 | + if(imgFilePath[i] == delImgPath){ | |
| 1186 | + | |
| 1187 | + imgFilePath.splice(i, 1); //이미지 경로 삭제 | |
| 1188 | + imgFileId.splice(i, 1); //이미지 아이디 삭제 - 내 문자 보관함 저장용으로 사용 | |
| 1189 | + i--; | |
| 1190 | + } | |
| 1191 | + | |
| 1192 | + } | |
| 1193 | + | |
| 1194 | + //imgCnt--; | |
| 1195 | + $("#imgCnt").val(Number(imgCnt) - 1); | |
| 1196 | + | |
| 1197 | + //미리보기 포토 1,2,3 번 번호 표시 변경 | |
| 1198 | + $('.photo_num_02').hide(); | |
| 1199 | + $('.photo_num_03').hide(); | |
| 1200 | + if(imgCnt > 2){ | |
| 1201 | + | |
| 1202 | + $('.photo_num_01').show(); | |
| 1203 | + $('.photo_num_02').show(); | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + }else if(imgCnt > 1){ | |
| 1207 | + $('.photo_num_01').show(); | |
| 1208 | + | |
| 1209 | + }else{ | |
| 1210 | + | |
| 1211 | + //그림을 모두 삭제 했을때 단문으로 변경 | |
| 1212 | + $('.preShort').show(); | |
| 1213 | + $('.prePhoto').hide(); | |
| 1214 | + | |
| 1215 | + $('.msg_com').removeClass("msg_photo"); | |
| 1216 | + $('.msg_com').addClass("msg_short"); | |
| 1217 | + $('.put_left').removeClass("photo"); | |
| 1218 | + $('#msgType').val("4"); // 메세지 타입 설정 | |
| 1219 | + | |
| 1220 | + fnByteString(contents); | |
| 1221 | + | |
| 1222 | + } | |
| 1223 | + | |
| 1224 | + //수신목록 전체 데이터 갯수 구하기 | |
| 1225 | + updateTotCnt(totRows); | |
| 1226 | + | |
| 1227 | + //일괄변환 문구 결제금액 처리 | |
| 1228 | + if(contents.indexOf("[*이름*]") > -1 | |
| 1229 | + || contents.indexOf("[*1*]") > -1 | |
| 1230 | + || contents.indexOf("[*2*]") > -1 | |
| 1231 | + || contents.indexOf("[*3*]") > -1 | |
| 1232 | + || contents.indexOf("[*4*]") > -1){ | |
| 1233 | + | |
| 1234 | + fnReplCell(); | |
| 1235 | + | |
| 1236 | + }else{ | |
| 1237 | + | |
| 1238 | + //결제금액 표시해주기 | |
| 1239 | + var totalPrice = totalPriceSum(totRows); | |
| 1240 | + $('#totalPrice').text(totalPrice); | |
| 1241 | + $('#txtReplYn').val("N"); | |
| 1242 | + | |
| 1243 | + } | |
| 1244 | + | |
| 1245 | + var scrollHei = $(".mCustomScrollBox").height(); | |
| 1246 | + if(scrollHei > 488) { | |
| 1247 | + $(".img_box").removeClass("on_scroll_img"); | |
| 1248 | + } | |
| 1249 | + | |
| 1250 | + }); | |
| 1251 | + | |
| 1252 | + // 초기화 버튼 처리 | |
| 1253 | + $('.btnReset').click(function(){ | |
| 1254 | + | |
| 1255 | + //일반문자 라이오 선택해 주기 | |
| 1256 | + $("#send_adYnN").prop("checked", true); | |
| 1257 | + | |
| 1258 | + $('.delLi').each(function(){ | |
| 1259 | + | |
| 1260 | + $(this).remove(); | |
| 1261 | + | |
| 1262 | + }); | |
| 1263 | + | |
| 1264 | + $('.preBoxF').each(function(){ | |
| 1265 | + | |
| 1266 | + $(this).remove(); | |
| 1267 | + | |
| 1268 | + }); | |
| 1269 | + | |
| 1270 | + //그림 카운트 초기화 | |
| 1271 | + $('#imgCnt').val(0); | |
| 1272 | + | |
| 1273 | + //그림을 모두 삭제 했을때 단문으로 변경 | |
| 1274 | + $('.preShort').show(); | |
| 1275 | + $('.prePhoto').hide(); | |
| 1276 | + | |
| 1277 | + $('.msg_com').removeClass("msg_photo"); | |
| 1278 | + $('.msg_com').addClass("msg_short"); | |
| 1279 | + $('#msgType').val("4"); // 메세지 타입 설정 | |
| 1280 | + | |
| 1281 | + //메세지 내용 초기화 | |
| 1282 | + $('#smsTxtArea').val(""); | |
| 1283 | + fnByteString(""); | |
| 1284 | + | |
| 1285 | + }); | |
| 1286 | + | |
| 1287 | + // 동적으로 추가해주기 때문에 on 사용 | |
| 1288 | + $(document).on('click', '.letterMsg', function(){ //문자 템플릿 선택시 상단 문자 내용에 입력해주기 | |
| 1289 | + | |
| 1290 | + // 클릭 시 조회수 증가 로직 | |
| 1291 | + var letterId = $(this).attr('id'); | |
| 1292 | + | |
| 1293 | + var url = "/web/mjon/msgdata/updateSmsTemplateCntAjax.do"; | |
| 1294 | + | |
| 1295 | + $.ajax({ | |
| 1296 | + type: "POST", | |
| 1297 | + url: url, | |
| 1298 | + data: {'letterId':letterId}, | |
| 1299 | + dataType:'json', | |
| 1300 | + async: false, | |
| 1301 | + cache: false, | |
| 1302 | + success: function (returnData, status) { | |
| 1303 | + console.log("status : ", status); | |
| 1304 | + }, | |
| 1305 | + error: function (e) {console.log("ERROR : ", e); } | |
| 1306 | + }); | |
| 1307 | + // 클릭 시 조회수 증가 로직 끝 | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + /* var smsTxtArea = $(this).find('.msg_text').text(); */ | |
| 1311 | + var smsTxtArea = $(this).find('.msg_text').html(); | |
| 1312 | + | |
| 1313 | + smsTxtArea = smsTxtArea.replace(/(<br>|<br\/>|<br \/>)/g, '\n'); | |
| 1314 | + $('#smsTxtArea').val(""); | |
| 1315 | + $('#smsTxtArea').val(smsTxtArea); | |
| 1316 | + fnByteString(smsTxtArea); | |
| 1317 | + | |
| 1318 | + var sendOfT=$('.send_top').offset().top; | |
| 1319 | + $('html,body').stop().animate({'scrollTop':sendOfT-60},250); | |
| 1320 | + | |
| 1321 | + }); | |
| 1322 | + | |
| 1323 | + // 동적으로 추가해주기 때문에 on 사용 | |
| 1324 | + $(document).on('click', '.btnSearchF', function(){ // 검색 기능 실행 | |
| 1325 | + | |
| 1326 | + var formL = document.letterForm; | |
| 1327 | + var formM = document.myMsgForm; | |
| 1328 | + formL.categoryCode.value = ""; //해시태그 검색 시 카테고리 제거 | |
| 1329 | + formL.upperCateNo.value = ""; //해시태그 검색 시 카테고리 제거 | |
| 1330 | + /* if(form.searchKeyword.value == ""){ | |
| 1331 | + | |
| 1332 | + alert("검색어를 입력해 주세요."); | |
| 1333 | + return false; | |
| 1334 | + | |
| 1335 | + } */ | |
| 1336 | + | |
| 1337 | + var tabIndex = $(".selectedTab").children(".active").index(); | |
| 1338 | + | |
| 1339 | + //문자 리스트 불러오기 | |
| 1340 | + if(tabIndex == 0) { | |
| 1341 | + formL.letterType.value="S"; | |
| 1342 | + fnLetterListAjax(); | |
| 1343 | + } | |
| 1344 | + //그림 문자 리스트 불러오기 | |
| 1345 | + if(tabIndex == 1) { | |
| 1346 | + formL.letterType.value="P"; | |
| 1347 | + fnPhotoListAjax(); | |
| 1348 | + } | |
| 1349 | + //내문자함 리스트 불러오기 | |
| 1350 | + if(tabIndex == 3) { | |
| 1351 | + formM.searchKeyword.value = formL.searchKeyword.value; //letterForm의 검색어를 문자함 검색어 부분에 입력해줌 | |
| 1352 | + fnMyMsgListAjax(); | |
| 1353 | + } | |
| 1354 | + $('.bottom_content.current .area_total_count').show(); | |
| 1355 | + return false; | |
| 1356 | + }); | |
| 1357 | + | |
| 1358 | + //탭 선택시에 검색자 초기화하여 검색하기 | |
| 1359 | + $(document).on('click', '.selectedTab', function(){ | |
| 1360 | + var formL = document.letterForm; | |
| 1361 | + var formM = document.myMsgForm; | |
| 1362 | + formL.categoryCode.value = ""; //탭 선택시 카테고리 제거 | |
| 1363 | + formL.upperCateNo.value = ""; //탭 선택시 카테고리 제거 | |
| 1364 | + | |
| 1365 | + var tabIndex = $(".selectedTab").children(".active").index(); | |
| 1366 | + | |
| 1367 | + //2줄보기, 4줄보기 초기화 | |
| 1368 | + $("#LPageUnit option:eq(0)").prop("selected", true); | |
| 1369 | + $("#PhPageUnit option:eq(0)").prop("selected", true); | |
| 1370 | + $("#msgPageUnit option:eq(0)").prop("selected", true); | |
| 1371 | + | |
| 1372 | + $('.bottom_content .area_total_count').hide(); | |
| 1373 | + | |
| 1374 | + //문자 리스트 불러오기 | |
| 1375 | + if(tabIndex == 0) { | |
| 1376 | + formL.letterType.value="S"; | |
| 1377 | + formL.pageUnit.value = "10"; | |
| 1378 | + formL.searchKeyword.value=""; | |
| 1379 | + fnLetterListAjax(1); | |
| 1380 | + } | |
| 1381 | + //그림 문자 리스트 불러오기 | |
| 1382 | + if(tabIndex == 1) { | |
| 1383 | + formL.letterType.value="P"; | |
| 1384 | + formL.pageUnit.value = "10"; | |
| 1385 | + formL.searchKeyword.value=""; | |
| 1386 | + fnPhotoListAjax(1); | |
| 1387 | + } | |
| 1388 | + //내문자함 리스트 불러오기 | |
| 1389 | + if(tabIndex == 3) { | |
| 1390 | + formL.pageUnit.value = "10"; | |
| 1391 | + formM.searchKeyword.value = ""; | |
| 1392 | + fnMyMsgListAjax(1); | |
| 1393 | + } | |
| 1394 | + | |
| 1395 | + }); | |
| 1396 | + | |
| 1397 | + /* | |
| 1398 | + | |
| 1399 | + 단문 / 장문 탭 옵션 선택시 실행 | |
| 1400 | + | |
| 1401 | + **/ | |
| 1402 | + | |
| 1403 | + $('.tDep1_mType').click(function(){ // 전체,기업, 개인 선택 옵션 처리 | |
| 1404 | + | |
| 1405 | + var mType = $(this).find('.on').text(); | |
| 1406 | + var form = document.letterForm; | |
| 1407 | + | |
| 1408 | + if(mType == "전체"){ | |
| 1409 | + | |
| 1410 | + form.memberType.value = ""; | |
| 1411 | + | |
| 1412 | + }else if(mType == "기업"){ | |
| 1413 | + | |
| 1414 | + form.memberType.value = "B"; | |
| 1415 | + | |
| 1416 | + }else{ | |
| 1417 | + | |
| 1418 | + form.memberType.value = "P"; | |
| 1419 | + | |
| 1420 | + } | |
| 1421 | + | |
| 1422 | + //문자 리스트 불러오기 | |
| 1423 | + //form.letterType.value = "S"; | |
| 1424 | + form.categoryCode.value = ""; | |
| 1425 | + form.hashTag.value = ""; | |
| 1426 | + form.pageIndex.value = 1; | |
| 1427 | + | |
| 1428 | + //문자 리스트 불러오기 | |
| 1429 | + fnLetterListAjax(1); | |
| 1430 | + | |
| 1431 | + }); | |
| 1432 | + | |
| 1433 | + $('.tDep1_letType').click(function(){ // 단문, 장문 선택 시 옵션처리 | |
| 1434 | + | |
| 1435 | + var letterType = $(this).find('.on').attr("value"); | |
| 1436 | + var form = document.letterForm; | |
| 1437 | + | |
| 1438 | + form.letterType.value = letterType; | |
| 1439 | + | |
| 1440 | + //문자 리스트 불러오기 | |
| 1441 | + fnLetterListAjax(1); | |
| 1442 | + | |
| 1443 | + }); | |
| 1444 | + | |
| 1445 | + $('.tDep1_cateCode').click(function(){ // 카테고리 선택 시 옵션 처리 | |
| 1446 | + | |
| 1447 | + var cateCode = $(this).find('.on').attr("value"); | |
| 1448 | + var form = document.letterForm; | |
| 1449 | + | |
| 1450 | + if(cateCode == "all"){ //전체 선택시 | |
| 1451 | + | |
| 1452 | + cateCode = ""; | |
| 1453 | + | |
| 1454 | + } else { | |
| 1455 | + //카테고리 코드 클릭 시 해쉬태그 초기화 후 전체 선택 | |
| 1456 | + form.hashTag.value=""; | |
| 1457 | + $('.tDep1_hashTag').find('.on').removeClass('on'); | |
| 1458 | + $('.tDep1_hashTag').find('.hashAll').addClass('on'); | |
| 1459 | + } | |
| 1460 | + form.upperCateNo.value = ""; | |
| 1461 | + form.categoryCode.value = cateCode; | |
| 1462 | + form.pageIndex.value = 1; | |
| 1463 | + //카테고리 클릭 시 검색자 초기화 | |
| 1464 | + form.searchKeyword.value = ""; | |
| 1465 | + | |
| 1466 | + //문자 리스트 불러오기 | |
| 1467 | + fnLetterListAjax(1); | |
| 1468 | + | |
| 1469 | + }); | |
| 1470 | + | |
| 1471 | + $('.tDep1_threeCateCode').click(function(){ // 하위 카테고리 선택 시 문자샘플 조회 | |
| 1472 | + var cateCode = $(this).find('.on').attr("value"); | |
| 1473 | + var form = document.letterForm; | |
| 1474 | + var upperCateNo = $(this).siblings('div').find('.on').attr('value'); | |
| 1475 | + form.upperCateNo.value = upperCateNo; | |
| 1476 | + form.categoryCode.value=cateCode; | |
| 1477 | + //해쉬태그 검색자 초기화 | |
| 1478 | + form.searchKeyword.value = ""; | |
| 1479 | + form.pageIndex.value = 1; | |
| 1480 | + | |
| 1481 | + //문자 리스트 불러오기 | |
| 1482 | + fnLetterListAjax(1); | |
| 1483 | + | |
| 1484 | + }); | |
| 1485 | + | |
| 1486 | + $('.tDep1_hashTag').click(function(){ // 해시 태그 선택 시 옵션 처리 | |
| 1487 | + var hashTag = $(this).find('.on').attr("value"); | |
| 1488 | + var form = document.letterForm; | |
| 1489 | + | |
| 1490 | + //해쉬태그 클릭 시 카테고리코드 초기화 후 전체 선택 | |
| 1491 | + form.categoryCode.value=""; | |
| 1492 | + $('.tDep1_cateCode').find('.on').removeClass('on'); | |
| 1493 | + $('.tDep1_cateCode').find('.cateAll').addClass('on'); | |
| 1494 | + //해쉬태그 클릭 시 검색자 초기화 | |
| 1495 | + form.searchKeyword.value = ""; | |
| 1496 | + | |
| 1497 | + form.hashTag.value = hashTag; | |
| 1498 | + form.pageIndex.value = 1; | |
| 1499 | + | |
| 1500 | + //문자 리스트 불러오기 | |
| 1501 | + fnLetterListAjax(1); | |
| 1502 | + | |
| 1503 | + }); | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + /* | |
| 1507 | + | |
| 1508 | + 그림문자 탭 옵션 선택시 사용 | |
| 1509 | + | |
| 1510 | + */ | |
| 1511 | + | |
| 1512 | + $('.tDep2_mType').click(function(){ // 전체,기업, 개인 선택 옵션 처리 | |
| 1513 | + | |
| 1514 | + var mType = $(this).find('.on').text(); | |
| 1515 | + var form = document.letterForm; | |
| 1516 | + | |
| 1517 | + if(mType == "전체"){ | |
| 1518 | + | |
| 1519 | + form.memberType.value = ""; | |
| 1520 | + | |
| 1521 | + }else if(mType == "기업"){ | |
| 1522 | + | |
| 1523 | + form.memberType.value = "B"; | |
| 1524 | + | |
| 1525 | + }else{ | |
| 1526 | + | |
| 1527 | + form.memberType.value = "P"; | |
| 1528 | + | |
| 1529 | + } | |
| 1530 | + | |
| 1531 | + //문자 리스트 불러오기 | |
| 1532 | + form.letterType.value = "P"; | |
| 1533 | + form.categoryCode.value = ""; | |
| 1534 | + form.hashTag.value = ""; | |
| 1535 | + form.pageIndex.value = 1; | |
| 1536 | + | |
| 1537 | + fnPhotoListAjax(); | |
| 1538 | + | |
| 1539 | + }); | |
| 1540 | + | |
| 1541 | + $('.tDep2_letType').click(function(){ // 그림문자 선택 | |
| 1542 | + | |
| 1543 | + var letterType = $(this).find('.on').attr("value"); | |
| 1544 | + var form = document.letterForm; | |
| 1545 | + form.letterType.value = 'P'; | |
| 1546 | + | |
| 1547 | + //문자 리스트 불러오기 | |
| 1548 | + fnPhotoListAjax(1); | |
| 1549 | + | |
| 1550 | + }); | |
| 1551 | + | |
| 1552 | + $('.tDep2_cateCode').click(function(){ // 그림 문자 카테고리 선택 시 옵션 처리 | |
| 1553 | + | |
| 1554 | + var cateCode = $(this).find('.on').attr("value"); | |
| 1555 | + var form = document.letterForm; | |
| 1556 | + | |
| 1557 | + if(cateCode == "all"){ //전체 선택시 | |
| 1558 | + | |
| 1559 | + cateCode = ""; | |
| 1560 | + | |
| 1561 | + } else { | |
| 1562 | + //카테고리 코드 클릭 시 해쉬태그 초기화 후 전체 선택 | |
| 1563 | + form.hashTag.value=""; | |
| 1564 | + $('.tDep2_hashTag').find('.on').removeClass('on'); | |
| 1565 | + $('.tDep2_hashTag').find('.hashAll').addClass('on'); | |
| 1566 | + } | |
| 1567 | + form.upperCateNo.value = ""; | |
| 1568 | + form.categoryCode.value = cateCode; | |
| 1569 | + form.pageIndex.value = 1; | |
| 1570 | + //카테고리 클릭 시 검색자 초기화 | |
| 1571 | + form.searchKeyword.value = ""; | |
| 1572 | + //문자 리스트 불러오기 | |
| 1573 | + fnPhotoListAjax(1); | |
| 1574 | + | |
| 1575 | + }); | |
| 1576 | + | |
| 1577 | + $('.tDep2_threeCateCode').click(function(){ // 하위 카테고리 선택 시 문자샘플 조회 | |
| 1578 | + var cateCode = $(this).find('.on').attr("value"); | |
| 1579 | + var form = document.letterForm; | |
| 1580 | + var upperCateNo = $(this).siblings('div').find('.on').attr('value'); | |
| 1581 | + form.upperCateNo.value = upperCateNo; | |
| 1582 | + form.categoryCode.value=cateCode; | |
| 1583 | + //해쉬태그 검색자 초기화 | |
| 1584 | + form.searchKeyword.value = ""; | |
| 1585 | + form.pageIndex.value = 1; | |
| 1586 | + | |
| 1587 | + //그림문자 리스트 불러오기 | |
| 1588 | + fnPhotoListAjax(1); | |
| 1589 | + }); | |
| 1590 | + | |
| 1591 | + $('.tDep2_hashTag').click(function(){ // 그림문자 해시 태그 선택 시 옵션 처리 | |
| 1592 | + var hashTag = $(this).find('.on').attr("value"); | |
| 1593 | + var form = document.letterForm; | |
| 1594 | + | |
| 1595 | + //해쉬태그 클릭 시 카테고리코드 초기화 후 전체 선택 | |
| 1596 | + form.categoryCode.value=""; | |
| 1597 | + $('.tDep2_cateCode').find('.on').removeClass('on'); | |
| 1598 | + $('.tDep2_cateCode').find('.cateAll').addClass('on'); | |
| 1599 | + //해쉬태그 클릭 시 검색자 초기화 | |
| 1600 | + form.searchKeyword.value = ""; | |
| 1601 | + | |
| 1602 | + form.hashTag.value = hashTag; | |
| 1603 | + form.pageIndex.value = 1; | |
| 1604 | + | |
| 1605 | + //문자 리스트 불러오기 | |
| 1606 | + fnPhotoListAjax(1); | |
| 1607 | + }); | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + $(".fontPlus").click(function () { | |
| 1611 | + var currentSize = $(".preview_auto").css("fontSize"); | |
| 1612 | + var size = parseInt(currentSize, 10) * 1.2; | |
| 1613 | + var unit = currentSize.slice(-2); | |
| 1614 | + if(size > 65){ | |
| 1615 | + return false; | |
| 1616 | + } | |
| 1617 | + $(".preview_auto").css("fontSize", size+unit); | |
| 1618 | + }); | |
| 1619 | + | |
| 1620 | + $(".fontMinus").click(function () { | |
| 1621 | + var currentSize = $(".preview_auto").css("fontSize"); | |
| 1622 | + var size = parseInt(currentSize, 10) / 1.2; | |
| 1623 | + var unit = currentSize.slice(-2); | |
| 1624 | + if(size < 10){ | |
| 1625 | + return false; | |
| 1626 | + } | |
| 1627 | + $(".preview_auto").css("fontSize", size+unit); | |
| 1628 | + }); | |
| 1629 | + | |
| 1630 | + //즉시, 예약 선택시 날짜 영역 초기 표시 | |
| 1631 | + var reYn = $("input[name=reserYn]:checked").val(); | |
| 1632 | + | |
| 1633 | + if(reYn == "N"){ | |
| 1634 | + $('.rev_selected').hide(); | |
| 1635 | + }else{ | |
| 1636 | + $('.rev_selected').show(); | |
| 1637 | + } | |
| 1638 | + | |
| 1639 | + //즉시 발송 라디오 버튼 선택시 숨김처리 | |
| 1640 | + $("#reserYnN").on('click', function(){ | |
| 1641 | + $('.rev_selected').hide(); | |
| 1642 | + $('.send_rev .send_content').css('padding-bottom','108px'); | |
| 1643 | + $('.send_btn .btnType:first-child').html('발송하기'); | |
| 1644 | + }); | |
| 1645 | + | |
| 1646 | + //예약 발송 라디오 버튼 선택시 숨김 해제처리 | |
| 1647 | + $("#reserYnY").on('click', function(){ | |
| 1648 | + $('.rev_selected').show(); | |
| 1649 | + $('.send_rev .send_content').css('padding-bottom','0'); | |
| 1650 | + $('.send_btn .btnType:first-child').html('예약하기'); | |
| 1651 | + }); | |
| 1652 | +}); | |
| 1653 | + | |
| 1654 | +//선거 후보자 등록 알림 메세지 처리 | |
| 1655 | +function fn_candidateChk(){ | |
| 1656 | + alert("선거 후보자를 등록이 되어야 문자 발송이 가능합니다. 후보자 등록을 해주세요."); | |
| 1657 | + return false; | |
| 1658 | + | |
| 1659 | +} | |
| 1660 | + | |
| 1661 | +//문자 바이트수 계산하기 함수 | |
| 1662 | +function fnByteString(contents){ | |
| 1663 | + | |
| 1664 | + var totalByte = 0; | |
| 1665 | + //var content = contents; | |
| 1666 | + var adverYn = $("input[name='send_adYn']:checked").val(); | |
| 1667 | + var adTxtLeng = conByteLeng($('.ad_txt').text()); | |
| 1668 | + var denyTxtLeng = 0; | |
| 1669 | + var denyTxt = $('.deny_txt').html(); | |
| 1670 | + | |
| 1671 | + //선거문자 하단 문구 줄바꿈 처리하기 | |
| 1672 | + if(typeof denyTxt !='undefined' && denyTxt != null){ | |
| 1673 | + | |
| 1674 | + denyTxt = denyTxt.replaceAll("<br>","\n"); | |
| 1675 | + denyTxt = denyTxt.replaceAll("<br/>","\n"); | |
| 1676 | + denyTxtLeng = conByteLeng(denyTxt); | |
| 1677 | + | |
| 1678 | + } | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + $('#msgLeng').html(""); | |
| 1682 | + $('#limitLeng').html(""); | |
| 1683 | + var conLeng = conByteLeng(contents); // 내용 문자 입력 바이트 수 계산하기 | |
| 1684 | + | |
| 1685 | + console.log(contents); | |
| 1686 | + | |
| 1687 | + //일반문자, 광고문자에 따른 문자 길이 변경해주기 | |
| 1688 | + if(adverYn == "N"){ | |
| 1689 | + | |
| 1690 | + $('#msgLeng').text(conLeng); | |
| 1691 | + | |
| 1692 | + //문자 길이 변수에 저장해주기 | |
| 1693 | + $('#smsLen').val(conLeng); | |
| 1694 | + | |
| 1695 | + }else{ | |
| 1696 | + | |
| 1697 | + conLeng = adTxtLeng + conLeng + denyTxtLeng +2; // 상단 광고 텍스트 , 하단 080 문자내용 길이 더해주기 , +2는 엔터 적용 | |
| 1698 | + $('#msgLeng').text(conLeng); | |
| 1699 | + | |
| 1700 | + //문자 길이 변수에 저장해주기 | |
| 1701 | + $('#smsLen').val(conLeng); | |
| 1702 | + | |
| 1703 | + } | |
| 1704 | + | |
| 1705 | + var photoSts = $('.delLi').length; | |
| 1706 | + if(photoSts > 0){ | |
| 1707 | + | |
| 1708 | + $('#msgLeng').html(conLeng + " / "); | |
| 1709 | + $('#limitLeng').html("2000"); | |
| 1710 | + $('.msg_com').html("그림"); | |
| 1711 | + $('#msgType').val("6"); // 메세지 타입 설정 | |
| 1712 | + | |
| 1713 | + $('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고 | |
| 1714 | + $('.put_left').removeClass("short"); //내용 입력 박스 클래스 삭제 | |
| 1715 | + $('.msg_com').removeClass("msg_long"); //장문 클래스 삭제하고 | |
| 1716 | + $('.put_left').removeClass("long"); //내용 입력 박스 클래스 삭제 | |
| 1717 | + $('.msg_com').addClass("msg_photo"); // 그림 클래스 삽입 | |
| 1718 | + $('.put_left').addClass("photo"); // 내용 입력 박스에 클래스 삽입 | |
| 1719 | + $('.put_left').css("display","block"); // 내용 입력 박스에 클래스 삽입 | |
| 1720 | + $('.msg_title').addClass('active'); | |
| 1721 | + | |
| 1722 | + //document.getElementById("mmsSubject").disabled = false; | |
| 1723 | + | |
| 1724 | + }else{ | |
| 1725 | + | |
| 1726 | + if(conLeng > 90){ | |
| 1727 | + | |
| 1728 | + $('#msgLeng').html(conLeng + " / "); | |
| 1729 | + $('#limitLeng').html("2000"); | |
| 1730 | + $('.msg_com').html("장문"); | |
| 1731 | + $('#msgType').val("6"); // 메세지 타입 설정 | |
| 1732 | + | |
| 1733 | + $('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고 | |
| 1734 | + $('.put_left').removeClass("short"); //내용 입력 박스 클래스 삭제 | |
| 1735 | + $('.msg_com').addClass("msg_long"); // 장문 클래스 삽입 | |
| 1736 | + $('.put_left').addClass("long"); // 내용 입력 박스에 클래스 삽입 | |
| 1737 | + $('.msg_title').addClass('active'); | |
| 1738 | + | |
| 1739 | + //document.getElementById("mmsSubject").disabled = false; | |
| 1740 | + | |
| 1741 | + }else{ | |
| 1742 | + | |
| 1743 | + $('#msgLeng').html(conLeng + " / "); | |
| 1744 | + $('#limitLeng').html("90"); | |
| 1745 | + $('.msg_com').html("단문"); | |
| 1746 | + $('#msgType').val("4"); // 메세지 타입 설정 | |
| 1747 | + $('.msg_com').removeClass("msg_long"); //단문 클래스 삭제하고 | |
| 1748 | + $('.put_left').removeClass("long"); //내용 입력 박스 클래스 삭제 | |
| 1749 | + $('.msg_com').addClass("msg_short"); // 장문 클래스 삽입 | |
| 1750 | + $('.put_left').addClass("short"); // 내용 입력 박스에 클래스 삽입 | |
| 1751 | + $('.msg_title, .title_wrap .textbox').removeClass('active'); | |
| 1752 | + $('#mmsSubject').val(""); | |
| 1753 | + $('#title_y').prop('checked',false); | |
| 1754 | + $('#title_n').prop('checked',true); | |
| 1755 | + | |
| 1756 | + //제목 비활성화로 내용 지워주기 | |
| 1757 | + /* $('#mmsSubject').val(""); | |
| 1758 | + document.getElementById("mmsSubject").disabled = true; */ | |
| 1759 | + | |
| 1760 | + } | |
| 1761 | + | |
| 1762 | + } | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + // 미리보기 데이터 입력해 주기 , 줄바꿈 문자 변환해주기 | |
| 1766 | + //var repContent = ""; | |
| 1767 | + //repContent = content.replace(/(?:\r\n|\r|\n)/g, '<br/>'); | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + if(conLeng > 0){ | |
| 1771 | + | |
| 1772 | + $('.none_txt').text(""); | |
| 1773 | + | |
| 1774 | + }else{ | |
| 1775 | + | |
| 1776 | + $('.none_txt').text("내용을 입력해주세요."); | |
| 1777 | + | |
| 1778 | + } | |
| 1779 | + | |
| 1780 | + //미리보기에 내용 입력해 주기 | |
| 1781 | + $('.realtime').text(contents); | |
| 1782 | + | |
| 1783 | + // 2000byte 초과시 메세지 알림 | |
| 1784 | + if(conLeng > 2000){ | |
| 1785 | + | |
| 1786 | + //2000바이트 초과시 문자열 잘라서 보여주기 | |
| 1787 | + var subUnderStr = strUnderLineSubstring(contents, 2000); | |
| 1788 | + $('#smsTxtArea').val(subUnderStr); | |
| 1789 | + | |
| 1790 | + //문자 바이트수 수정해주기 | |
| 1791 | + $('#msgLeng').text(conByteLeng(subUnderStr)); | |
| 1792 | + | |
| 1793 | + //문자 길이 변수에 저장해주기 | |
| 1794 | + $('#smsLen').val(conByteLeng(subUnderStr)); | |
| 1795 | + | |
| 1796 | + alert("문자 내용은 2000byte를 넘을 수 없습니다."); | |
| 1797 | + return false; | |
| 1798 | + } | |
| 1799 | + | |
| 1800 | + //수신목록에 추가되어있는 주소록 그룹의 주소갯수 합산해주기 | |
| 1801 | + if(tableL != null){ | |
| 1802 | + | |
| 1803 | + var totAddrCnt = getTabulatorLAddrGrpCnt(); | |
| 1804 | + | |
| 1805 | + totRows = totAddrCnt; | |
| 1806 | + | |
| 1807 | + } | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + //수신목록 주소록 그룹의 주소록 전체 갯수 표시해주기 | |
| 1811 | + updateTotCnt(totRows); | |
| 1812 | + | |
| 1813 | + //일괄변환 문구 결제금액 처리 | |
| 1814 | + if(contents.indexOf("[*이름*]") > -1 | |
| 1815 | + || contents.indexOf("[*1*]") > -1 | |
| 1816 | + || contents.indexOf("[*2*]") > -1 | |
| 1817 | + || contents.indexOf("[*3*]") > -1 | |
| 1818 | + || contents.indexOf("[*4*]") > -1){ | |
| 1819 | + | |
| 1820 | + fnReplCell(); | |
| 1821 | + | |
| 1822 | + }else{ | |
| 1823 | + | |
| 1824 | + var totalPrice = totalPriceSum(totRows); | |
| 1825 | + $('#totalPrice').text(totalPrice); | |
| 1826 | + $('#txtReplYn').val("N"); | |
| 1827 | + | |
| 1828 | + } | |
| 1829 | + | |
| 1830 | +} | |
| 1831 | + | |
| 1832 | +function openPhotoEditor() { | |
| 1833 | + var imgCnt = $("#imgCnt").val(); | |
| 1834 | + | |
| 1835 | + if(imgCnt >= 3) { | |
| 1836 | + alert("메시지에 첨부할 수 있는 이미지는 최대 3장입니다."); | |
| 1837 | + return; | |
| 1838 | + } | |
| 1839 | + | |
| 1840 | + //만들려는 팝업의 크기 | |
| 1841 | + var popup_wid = '1100'; | |
| 1842 | + var popup_ht = '851'; | |
| 1843 | + | |
| 1844 | + //중앙 정렬을 위해 윈도우 스크린의 width,height 구하는 변수 만듦 | |
| 1845 | + var popup_left = (window.screen.width / 2) - (popup_wid / 2); | |
| 1846 | + var popup_top =(window.screen.height / 2) - (popup_ht / 2); | |
| 1847 | + | |
| 1848 | + window.open('<c:url value='/web/mjon/msgcampain/openImageEditorPopup.do'/>', 'a', 'width=' + popup_wid +', height='+ popup_ht +', left=' + popup_left + ', top='+ popup_top + ', scrollbar=no' ); | |
| 1849 | + | |
| 1850 | +} | |
| 1851 | + | |
| 1852 | +//그림샘플 이미지 선택시 문자 내용에 입력 처리 | |
| 1853 | +function imageControl(obj, editYn, imageName, imgId) { | |
| 1854 | + | |
| 1855 | + var imgCnt = $("#imgCnt").val(); // 현재 페이지에 첨부된 이미지 갯수 | |
| 1856 | + var imgSrc = obj.attr("src"); | |
| 1857 | + | |
| 1858 | + if(imgCnt >= 3){ | |
| 1859 | + alert("이미지는 3장만 선택할 수 있습니다."); | |
| 1860 | + return false; | |
| 1861 | + } | |
| 1862 | + | |
| 1863 | + $('.preShort').hide(); | |
| 1864 | + $('.prePhoto').show(); | |
| 1865 | + | |
| 1866 | + if($('.msg_com').hasClass("msg_short") === true){ | |
| 1867 | + | |
| 1868 | + $('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고 | |
| 1869 | + $('.msg_com').addClass("msg_photo"); // 그림문자용 클래스 삽입 | |
| 1870 | + $('.put_left').removeClass("short"); | |
| 1871 | + $('.put_left').addClass("photo"); | |
| 1872 | + $('.msg_com').html("그림"); | |
| 1873 | + $('#msgType').val("6"); // 메세지 타입 설정 | |
| 1874 | + | |
| 1875 | + //제목 입력 항목 활성화 | |
| 1876 | + //document.getElementById("mmsSubject").disabled = false; | |
| 1877 | + | |
| 1878 | + }else{ | |
| 1879 | + | |
| 1880 | + $('.msg_com').removeClass("msg_long"); //장문 클래스 삭제하고 | |
| 1881 | + $('.msg_com').addClass("msg_photo"); // 그림문자용 클래스 삽입 | |
| 1882 | + $('.put_left').removeClass("long"); | |
| 1883 | + $('.put_left').addClass("photo"); | |
| 1884 | + $('.msg_com').html("그림"); | |
| 1885 | + $('#msgType').val("6"); // 메세지 타입 설정 | |
| 1886 | + | |
| 1887 | + //제목 입력 항목 활성화 | |
| 1888 | + //document.getElementById("mmsSubject").disabled = false; | |
| 1889 | + | |
| 1890 | + } | |
| 1891 | + | |
| 1892 | + //이미지 카운트 증가시키기 | |
| 1893 | + //imgCnt ++; | |
| 1894 | + $("#imgCnt").val(Number(imgCnt)+1); | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + //문자 내용 상단에 이미지 이름 영역 객체 추가해주기 | |
| 1898 | + var imgPath = '<img src="' + imgSrc + '" class="thumb_img '+ editYn +'" alt="thumb1"/>'; | |
| 1899 | + var liPath = '<li class="delLi '+imageName+'" id="delLi'+ imgCnt +'">' | |
| 1900 | + + '<div>'+ imgPath+ '</div>' | |
| 1901 | + + '<button type="button" class="file_close"><img src="/publish/images/content/thumb_del.png" alt="첨부파일 삭제"></button>' | |
| 1902 | + + '<button type="button" class="file_close_on"><img src="/publish/images/content/thumb_del_on.png" alt="첨부파일 삭제"></button>' | |
| 1903 | + + '</li>'; | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + /* "<li class=\"delLi\"><p>" + imgPath + "</p><button type=\"button\" class=\"file_close\"><img class=\"delImg\" src=\"/publish/images/content/file_close.png\" alt=\"첨부파일 삭제\"></button></li>" */ | |
| 1907 | + $('.liOnImg').append(liPath); | |
| 1908 | + | |
| 1909 | + //미리보기 보여주기 | |
| 1910 | + $('.preiew_img').show(); | |
| 1911 | + | |
| 1912 | + var imgHtml = ""; | |
| 1913 | + var imgPath = "<div class=\"img_box preBoxF\" id=preBoxF"+ imgCnt +"><img src=\"" + imgSrc + "\" /></div>"; | |
| 1914 | + | |
| 1915 | + if($("#imgCnt").val() == 1){ | |
| 1916 | + $('.preViewShort').append(imgPath); | |
| 1917 | + $('.photo_num_01').show(); | |
| 1918 | + $('.photo_num_02').hide(); | |
| 1919 | + $('.photo_num_03').hide(); | |
| 1920 | + //$(".thumb_wrap li:eq(0)").addClass("on"); | |
| 1921 | + | |
| 1922 | + }else if($("#imgCnt").val() == 2){ | |
| 1923 | + $('.preViewShort').append(imgPath); | |
| 1924 | + $('.photo_num_02').show(); | |
| 1925 | + $(".thumb_wrap li").removeClass("on"); | |
| 1926 | + //$(".thumb_wrap li:eq(1)").addClass("on"); | |
| 1927 | + | |
| 1928 | + }else if($("#imgCnt").val() == 3){ | |
| 1929 | + $('.preViewShort').append(imgPath); | |
| 1930 | + $('.photo_num_03').show(); | |
| 1931 | + $(".thumb_wrap li").removeClass("on"); | |
| 1932 | + //$(".thumb_wrap li:eq(2)").addClass("on"); | |
| 1933 | + | |
| 1934 | + } | |
| 1935 | + | |
| 1936 | + // 배열에 선택한 이미지 경로 저장해주기 | |
| 1937 | + imgFilePath.push(imgSrc); | |
| 1938 | + | |
| 1939 | + // 배열에 선택한 이미지 아이디 저장해주기 - 내 문자 보관함 저장용으로 사용 | |
| 1940 | + if(typeof(imgId) != 'undefined' && imgId != null && editYn != 'edit_y'){ | |
| 1941 | + imgFileId.push(imgId); | |
| 1942 | + } | |
| 1943 | + //문자 길이 및 타입 변경해주기 | |
| 1944 | + var contents = $('#smsTxtArea').val(); | |
| 1945 | + fnByteString(contents); | |
| 1946 | + | |
| 1947 | + var scrollHei = $(".mCustomScrollBox").height(); | |
| 1948 | + if(scrollHei > 488) { | |
| 1949 | + $(".img_box").addClass("on_scroll_img"); | |
| 1950 | + } | |
| 1951 | + | |
| 1952 | +} | |
| 1953 | + | |
| 1954 | +//그림샘플 이미지 선택시 문자 내용에 입력 처리 | |
| 1955 | +function myMsgImageControl(imgSrc, editYn, imageName, imgId) { | |
| 1956 | + | |
| 1957 | + var imgCnt = $("#imgCnt").val(); // 현재 페이지에 첨부된 이미지 갯수 | |
| 1958 | + var imgSrc = imgSrc; | |
| 1959 | + if(imgCnt >= 3){ | |
| 1960 | + alert("이미지는 3장만 선택할 수 있습니다."); | |
| 1961 | + return false; | |
| 1962 | + } | |
| 1963 | + | |
| 1964 | + $('.preShort').hide(); | |
| 1965 | + $('.prePhoto').show(); | |
| 1966 | + | |
| 1967 | + if($('.msg_com').hasClass("msg_short") === true){ | |
| 1968 | + | |
| 1969 | + $('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고 | |
| 1970 | + $('.msg_com').addClass("msg_photo"); // 그림문자용 클래스 삽입 | |
| 1971 | + $('.put_left').removeClass("short"); | |
| 1972 | + $('.put_left').addClass("photo"); | |
| 1973 | + $('.msg_com').html("그림"); | |
| 1974 | + $('#msgType').val("6"); // 메세지 타입 설정 | |
| 1975 | + | |
| 1976 | + //제목 입력 항목 활성화 | |
| 1977 | + //document.getElementById("mmsSubject").disabled = false; | |
| 1978 | + | |
| 1979 | + }else{ | |
| 1980 | + | |
| 1981 | + $('.msg_com').removeClass("msg_long"); //장문 클래스 삭제하고 | |
| 1982 | + $('.msg_com').addClass("msg_photo"); // 그림문자용 클래스 삽입 | |
| 1983 | + $('.put_left').removeClass("long"); | |
| 1984 | + $('.put_left').addClass("photo"); | |
| 1985 | + $('.msg_com').html("그림"); | |
| 1986 | + $('#msgType').val("6"); // 메세지 타입 설정 | |
| 1987 | + | |
| 1988 | + //제목 입력 항목 활성화 | |
| 1989 | + //document.getElementById("mmsSubject").disabled = false; | |
| 1990 | + | |
| 1991 | + } | |
| 1992 | + | |
| 1993 | + //이미지 카운트 증가시키기 | |
| 1994 | + //imgCnt ++; | |
| 1995 | + $("#imgCnt").val(Number(imgCnt)+1); | |
| 1996 | + | |
| 1997 | + //문자 내용 상단에 이미지 이름 영역 객체 추가해주기 | |
| 1998 | + var imgPath = '<img src="' + imgSrc + '" class="thumb_img '+ editYn +'" alt="thumb1"/>'; | |
| 1999 | + var liPath = '<li class="delLi '+imageName+'" id="delLi'+ imgCnt +'">' | |
| 2000 | + + '<div>'+ imgPath+ '</div>' | |
| 2001 | + + '<button type="button" class="file_close"><img src="/publish/images/content/thumb_del.png" alt="첨부파일 삭제"></button>' | |
| 2002 | + + '<button type="button" class="file_close_on"><img src="/publish/images/content/thumb_del_on.png" alt="첨부파일 삭제"></button>' | |
| 2003 | + + '</li>'; | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + /* "<li class=\"delLi\"><p>" + imgPath + "</p><button type=\"button\" class=\"file_close\"><img class=\"delImg\" src=\"/publish/images/content/file_close.png\" alt=\"첨부파일 삭제\"></button></li>" */ | |
| 2007 | + $('.liOnImg').append(liPath); | |
| 2008 | + | |
| 2009 | + //미리보기 보여주기 | |
| 2010 | + $('.preiew_img').show(); | |
| 2011 | + | |
| 2012 | + var imgHtml = ""; | |
| 2013 | + var imgPath = "<div class=\"img_box preBoxF\" id=preBoxF"+ imgCnt +"><img src=\"" + imgSrc + "\" /></div>"; | |
| 2014 | + | |
| 2015 | + if($("#imgCnt").val() == 1){ | |
| 2016 | + $('.preViewShort').append(imgPath); | |
| 2017 | + $('.photo_num_01').show(); | |
| 2018 | + $('.photo_num_02').hide(); | |
| 2019 | + $('.photo_num_03').hide(); | |
| 2020 | + //$(".thumb_wrap li:eq(0)").addClass("on"); | |
| 2021 | + | |
| 2022 | + }else if($("#imgCnt").val() == 2){ | |
| 2023 | + $('.preViewShort').append(imgPath); | |
| 2024 | + $('.photo_num_02').show(); | |
| 2025 | + $(".thumb_wrap li").removeClass("on"); | |
| 2026 | + //$(".thumb_wrap li:eq(1)").addClass("on"); | |
| 2027 | + | |
| 2028 | + }else if($("#imgCnt").val() == 3){ | |
| 2029 | + $('.preViewShort').append(imgPath); | |
| 2030 | + $('.photo_num_03').show(); | |
| 2031 | + $(".thumb_wrap li").removeClass("on"); | |
| 2032 | + //$(".thumb_wrap li:eq(2)").addClass("on"); | |
| 2033 | + | |
| 2034 | + } | |
| 2035 | + | |
| 2036 | + // 배열에 선택한 이미지 경로 저장해주기 | |
| 2037 | + imgFilePath.push(imgSrc); | |
| 2038 | + // 배열에 선택한 이미지 아이디 저장해주기 - 내 문자 보관함 저장용으로 사용 | |
| 2039 | + if(typeof(imgId) != 'undefined' && imgId != null){ | |
| 2040 | + imgFileId.push(imgId); | |
| 2041 | + } | |
| 2042 | + //문자 길이 및 타입 변경해주기 | |
| 2043 | + var contents = $('#smsTxtArea').val(); | |
| 2044 | + fnByteString(contents); | |
| 2045 | + | |
| 2046 | + var scrollHei = $(".mCustomScrollBox").height(); | |
| 2047 | + if(scrollHei > 488) { | |
| 2048 | + $(".img_box").addClass("on_scroll_img"); | |
| 2049 | + } | |
| 2050 | + | |
| 2051 | +} | |
| 2052 | + | |
| 2053 | + | |
| 2054 | +$(document).on('click', '.symbolButton, .changeWord', function (){ | |
| 2055 | + //var smsTxtArea = $('#smsTxtArea').val(); | |
| 2056 | + //$('#smsTxtArea').val(smsTxtArea + $(this).attr("value")); | |
| 2057 | + | |
| 2058 | + // 커서 위치에 삽입 | |
| 2059 | + setCursorInsertText("smsTxtArea", $(this).attr("value")); | |
| 2060 | + | |
| 2061 | + fnByteString($('#smsTxtArea').val()); | |
| 2062 | +}); | |
| 2063 | + | |
| 2064 | +$(document).on('click', '#recommBtn', function(){ | |
| 2065 | + | |
| 2066 | + var recommId = $('#recommId').val(); | |
| 2067 | + | |
| 2068 | + if(recommId == ''){ | |
| 2069 | + | |
| 2070 | + alert("추천인 ID를 입력해 주세요."); | |
| 2071 | + return false; | |
| 2072 | + | |
| 2073 | + } | |
| 2074 | + | |
| 2075 | + var data = new FormData(document.msgForm); | |
| 2076 | + var url = "/web/mjon/msgcampain/selectRecommIdCheckAjax.do"; | |
| 2077 | + | |
| 2078 | + $.ajax({ | |
| 2079 | + type: "POST", | |
| 2080 | + enctype: 'multipart/form-data', | |
| 2081 | + url: url, | |
| 2082 | + data: data, | |
| 2083 | + dataType:'json', | |
| 2084 | + async: false, | |
| 2085 | + processData: false, | |
| 2086 | + contentType: false, | |
| 2087 | + cache: false, | |
| 2088 | + //timeout: 600000, | |
| 2089 | + success: function (returnData, status) { | |
| 2090 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 2091 | + | |
| 2092 | + if(returnData.status == "success"){ | |
| 2093 | + | |
| 2094 | + alert("추천인 아이디가 확인 되었습니다."); | |
| 2095 | + return false; | |
| 2096 | + | |
| 2097 | + }else{ | |
| 2098 | + | |
| 2099 | + alert("존재하지 않는 추천인 아이디 입니다."); | |
| 2100 | + return false; | |
| 2101 | + | |
| 2102 | + } | |
| 2103 | + | |
| 2104 | + } else if(status== 'fail'){ | |
| 2105 | + alert("추천인 확인에 실패하였습니다. !!"); | |
| 2106 | + } | |
| 2107 | + }, | |
| 2108 | + error: function (e) { alert("추천인 확인에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 2109 | + }); | |
| 2110 | + | |
| 2111 | +}); | |
| 2112 | + | |
| 2113 | +//문자발송 받는사람 목록 주소록에 등록하기 기능 처리 | |
| 2114 | +$('.registAddr').click(function(){ | |
| 2115 | + | |
| 2116 | + var tableData = tableL.getRows(); | |
| 2117 | + var dataLen = tableL.getRows().length; | |
| 2118 | + | |
| 2119 | + var nameList = []; //치환문자 이름 | |
| 2120 | + var phoneNum = []; //받는사람 | |
| 2121 | + var rep1List = []; //치환문자1 | |
| 2122 | + var rep2List = []; //치환문자2 | |
| 2123 | + var rep3List = []; //치환문자3 | |
| 2124 | + var rep4List = []; //치환문자4 | |
| 2125 | + | |
| 2126 | + if(dataLen > 0){ | |
| 2127 | + | |
| 2128 | + for(var i=0; i < dataLen; i++){ | |
| 2129 | + | |
| 2130 | + var name = tableData[i].getData().name; | |
| 2131 | + var phone = removeDash(tableData[i].getData().phone); | |
| 2132 | + var rep1 = tableData[i].getData().rep1; | |
| 2133 | + var rep2 = tableData[i].getData().rep2; | |
| 2134 | + var rep3 = tableData[i].getData().rep3; | |
| 2135 | + var rep4 = tableData[i].getData().rep4; | |
| 2136 | + | |
| 2137 | + if(phone == "" || phone == null){ | |
| 2138 | + | |
| 2139 | + alert("수신 목록에 핸드폰 번호가 없는 항목이 있습니다."); | |
| 2140 | + return false; | |
| 2141 | + | |
| 2142 | + }else if(!checkHpNum(phone)){ | |
| 2143 | + | |
| 2144 | + alert("수신 목록에 잘 못된 핸드폰 번호가 있습니다. 핸드폰 번호 : " + phone + " 입니다."); | |
| 2145 | + return false; | |
| 2146 | + | |
| 2147 | + } | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + phoneNum[i] = phone; | |
| 2151 | + | |
| 2152 | + if(name == "" || name == null){ | |
| 2153 | + nameList[i] = ""; | |
| 2154 | + }else{ | |
| 2155 | + nameList[i] = name.replaceAll(",","§"); | |
| 2156 | + } | |
| 2157 | + | |
| 2158 | + if(rep1 == "" || rep1 == null){ | |
| 2159 | + rep1List[i] = "-"; | |
| 2160 | + }else{ | |
| 2161 | + rep1List[i] = rep1.replaceAll(",","§"); | |
| 2162 | + } | |
| 2163 | + | |
| 2164 | + if(rep2 == "" || rep2 == null){ | |
| 2165 | + rep2List[i] = "-"; | |
| 2166 | + }else{ | |
| 2167 | + rep2List[i] = rep2.replaceAll(",","§"); | |
| 2168 | + } | |
| 2169 | + | |
| 2170 | + if(rep3 == "" || rep3 == null){ | |
| 2171 | + rep3List[i] = "-"; | |
| 2172 | + }else{ | |
| 2173 | + rep3List[i] = rep3.replaceAll(",","§"); | |
| 2174 | + } | |
| 2175 | + | |
| 2176 | + if(rep4 == "" || rep4 == null){ | |
| 2177 | + rep4List[i] = "-"; | |
| 2178 | + }else{ | |
| 2179 | + rep4List[i] = rep4.replaceAll(",","§"); | |
| 2180 | + } | |
| 2181 | + | |
| 2182 | + /* if(name == "" || name == null){ | |
| 2183 | + | |
| 2184 | + alert("수신 목록에 이름이 없는 항목이 있습니다. 이름을 입력해 주세요"); | |
| 2185 | + return false; | |
| 2186 | + | |
| 2187 | + }else{ | |
| 2188 | + | |
| 2189 | + nameList[i] = name; | |
| 2190 | + phoneNum[i] = phone; | |
| 2191 | + | |
| 2192 | + if(rep1 == "" || rep1 == null){ | |
| 2193 | + rep1List[i] = "-"; | |
| 2194 | + }else{ | |
| 2195 | + rep1List[i] = rep1; | |
| 2196 | + } | |
| 2197 | + | |
| 2198 | + if(rep2 == "" || rep2 == null){ | |
| 2199 | + rep2List[i] = "-"; | |
| 2200 | + }else{ | |
| 2201 | + rep2List[i] = rep2; | |
| 2202 | + } | |
| 2203 | + | |
| 2204 | + if(rep3 == "" || rep3 == null){ | |
| 2205 | + rep3List[i] = "-"; | |
| 2206 | + }else{ | |
| 2207 | + rep3List[i] = rep3; | |
| 2208 | + } | |
| 2209 | + | |
| 2210 | + if(rep4 == "" || rep4 == null){ | |
| 2211 | + rep4List[i] = "-"; | |
| 2212 | + }else{ | |
| 2213 | + rep4List[i] = rep4; | |
| 2214 | + } | |
| 2215 | + | |
| 2216 | + } */ | |
| 2217 | + | |
| 2218 | + } | |
| 2219 | + | |
| 2220 | + //주소록 정보를 Form에 넣어준다. | |
| 2221 | + | |
| 2222 | + var form = document.msgForm; | |
| 2223 | + form.callToList.value = phoneNum; | |
| 2224 | + form.nameList.value = nameList; | |
| 2225 | + form.rep1List.value = rep1List; | |
| 2226 | + form.rep2List.value = rep2List; | |
| 2227 | + form.rep3List.value = rep3List; | |
| 2228 | + form.rep4List.value = rep4List; | |
| 2229 | + form.addrGrpId.value = $("#addrGrpIdInfo").val(); | |
| 2230 | + form.addrGrpNm.value = $("#addrGrpNm").val(); | |
| 2231 | + | |
| 2232 | + if ($("#addrGrpIdInfo option:selected").val() == "NEW" && ($("#addrGrpNm").val() == "" || $("#addrGrpNm").val() == null || $("#addrGrpNm").val() == undefined)) { | |
| 2233 | + alert("저장할 그룹을 선택하거나 새 그룹명을 입력해주세요."); | |
| 2234 | + return false; | |
| 2235 | + }else if ($("#addrGrpIdInfo option:selected").val() == "NEW" && $("#addrGrpNm").val() != "") { | |
| 2236 | + //주소록 중복체크 | |
| 2237 | + if (getAddrGroupDuplCheckAjax() == false) { | |
| 2238 | + alert("중복된 그룹명입니다. 새 그룹명을 입력해주세요."); | |
| 2239 | + return false; | |
| 2240 | + } | |
| 2241 | + } | |
| 2242 | + if(confirm("연락처 정보를 주소록에 등록 하시겠습니까?")){ | |
| 2243 | + | |
| 2244 | + var data = new FormData(form); | |
| 2245 | + var url = "/web/mjon/msgdata/insertMsgAddrListAjax.do"; | |
| 2246 | + | |
| 2247 | + $.ajax({ | |
| 2248 | + type: "POST", | |
| 2249 | + enctype: 'multipart/form-data', | |
| 2250 | + url: url, | |
| 2251 | + data: data, | |
| 2252 | + dataType:'json', | |
| 2253 | + async: true, | |
| 2254 | + processData: false, | |
| 2255 | + contentType: false, | |
| 2256 | + cache: false, | |
| 2257 | + //timeout: 600000, | |
| 2258 | + success: function (returnData, status) { | |
| 2259 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 2260 | + | |
| 2261 | + if(returnData.result == "success"){ | |
| 2262 | + var alertMsg = "총 " + returnData.resultCnt + "건의 " +returnData.message; | |
| 2263 | + | |
| 2264 | + if(returnData.dupliCnt > 0) { | |
| 2265 | + alertMsg += "\n"+numberWithCommas(returnData.dupliCnt) + "건은 이미 등록되어있는 번호입니다."; | |
| 2266 | + } | |
| 2267 | + | |
| 2268 | + alert(alertMsg); | |
| 2269 | + $("#addrGrpNm").val(""); | |
| 2270 | + $('.addressregi_layer').attr('style',''); | |
| 2271 | + $('.mask').removeClass('on'); | |
| 2272 | + return false; | |
| 2273 | + | |
| 2274 | + }else if(returnData.result == "allDupl") { | |
| 2275 | + alert("요청하신 "+returnData.dupliCnt+"건의 번호가 주소록에 이미 등록되어있습니다."); | |
| 2276 | + $("#addrGrpNm").val(""); | |
| 2277 | + $('.addressregi_layer').attr('style',''); | |
| 2278 | + $('.mask').removeClass('on'); | |
| 2279 | + return false; | |
| 2280 | + }else{ | |
| 2281 | + alert(returnData.message); | |
| 2282 | + $("#addrGrpNm").val(""); | |
| 2283 | + $('.addressregi_layer').attr('style',''); | |
| 2284 | + $('.mask').removeClass('on'); | |
| 2285 | + return false; | |
| 2286 | + | |
| 2287 | + } | |
| 2288 | + | |
| 2289 | + } else if(status== 'fail'){ | |
| 2290 | + alert("주소록 등록에 실패하였습니다. !!"); | |
| 2291 | + } | |
| 2292 | + }, | |
| 2293 | + error: function (e) { | |
| 2294 | + alert("주소록 등록에 실패하였습니다."); | |
| 2295 | + console.log("ERROR : ", e); | |
| 2296 | + }, | |
| 2297 | + beforeSend : function(xmlHttpRequest) { | |
| 2298 | + //로딩창 show | |
| 2299 | + $('.loading_layer').addClass('active'); | |
| 2300 | + }, | |
| 2301 | + complete : function(xhr, textStatus) { | |
| 2302 | + //로딩창 hide | |
| 2303 | + $('.loading_layer').removeClass('active'); | |
| 2304 | + } | |
| 2305 | + }); | |
| 2306 | + | |
| 2307 | + } | |
| 2308 | + | |
| 2309 | + }else{ | |
| 2310 | + | |
| 2311 | + alert("연락처 정보를 등록해 주세요."); | |
| 2312 | + return false; | |
| 2313 | + | |
| 2314 | + } | |
| 2315 | + | |
| 2316 | + | |
| 2317 | +}); | |
| 2318 | + | |
| 2319 | +//주소록 불러오기 그룹명 검색 기능처리 | |
| 2320 | +function fnAddrGrpSearch(){ | |
| 2321 | + | |
| 2322 | + var form = document.searchAddrGrpForm; | |
| 2323 | + form.searchKeyword.value = form.searchGrpKeyword.value; | |
| 2324 | + form.searchCondition.value = ""; | |
| 2325 | + | |
| 2326 | + var sendData = $(document.searchAddrGrpForm).serializeArray(); | |
| 2327 | + | |
| 2328 | + $("#addrGroupLoad").load("/web/mjon/msgcampain/huge/selectAddrGroupListAjax.do", sendData ,function(response, status, xhr){ | |
| 2329 | + //리스트 스크롤 처리해주기 | |
| 2330 | + $(".adr_pop_list").mCustomScrollbar({ | |
| 2331 | + axis: 'y', | |
| 2332 | + scrollbarPosition: "outside", | |
| 2333 | + theme: "dark", | |
| 2334 | + autoHideScrollbar: false | |
| 2335 | + }); | |
| 2336 | + }); | |
| 2337 | + | |
| 2338 | +} | |
| 2339 | + | |
| 2340 | +//주소록 불러오기 팝업의 그룹 선택시 우측에 주소록 불러오기 | |
| 2341 | +function fnSelectAddrList(type,addrGrpId,item){ | |
| 2342 | + | |
| 2343 | + // 주소록 그룹 열림, 닫힘 폴더이미지 초기화 | |
| 2344 | + $(".adr_pop_list div p").each(function (index, item) { | |
| 2345 | + $(item).find("img").attr("src", "/publish/images/content/close_folder2.png"); | |
| 2346 | + $(item).find("img").attr("alt", "폴더 닫힘"); | |
| 2347 | + }); | |
| 2348 | + | |
| 2349 | + var form = document.searchAddrGrpForm; | |
| 2350 | + form.type.value = type; | |
| 2351 | + form.searchAddrGrpId.value = addrGrpId; | |
| 2352 | + form.searchKeyword.value = ""; | |
| 2353 | + form.searchCondition.value = form.searchAddrCondition.value; | |
| 2354 | + | |
| 2355 | + //왼쪽 그룹리스트의 그룸명을 선택시 검색어를 초기화해준다. | |
| 2356 | + form.searchAddrKeyword.value=""; | |
| 2357 | + | |
| 2358 | + /* | |
| 2359 | + $(item).toggleClass("open"); | |
| 2360 | + if ($(item).hasClass("open") === true) { | |
| 2361 | + $(item).find("img").attr("src", "/publish/images/content/open_folder2.png"); | |
| 2362 | + $(item).find("img").attr("alt", "폴더 열림"); | |
| 2363 | + } | |
| 2364 | + else { | |
| 2365 | + $(item).find("img").attr("src", "/publish/images/content/close_folder2.png"); | |
| 2366 | + $(item).find("img").attr("alt", "폴더 닫힘"); | |
| 2367 | + } | |
| 2368 | + */ | |
| 2369 | + | |
| 2370 | + $(item).find("img").attr("src", "/publish/images/content/open_folder2.png"); | |
| 2371 | + $(item).find("img").attr("alt", "폴더 열림"); | |
| 2372 | + | |
| 2373 | + loadAddrList(); | |
| 2374 | + | |
| 2375 | +} | |
| 2376 | + | |
| 2377 | +function fnAddrSearch(){ | |
| 2378 | + | |
| 2379 | + var form = document.searchAddrGrpForm; | |
| 2380 | + form.searchKeyword.value = form.searchAddrKeyword.value; | |
| 2381 | + form.searchCondition.value = form.searchAddrCondition.value; | |
| 2382 | + | |
| 2383 | + loadAddrList(); | |
| 2384 | + | |
| 2385 | +} | |
| 2386 | + | |
| 2387 | +function loadAddrList(){ | |
| 2388 | + | |
| 2389 | + /* | |
| 2390 | + serialize 를 사용할때는 processData, contentType 옵션 제가할것 | |
| 2391 | + */ | |
| 2392 | + var data = $("#searchAddrGrpForm").serialize(); | |
| 2393 | + | |
| 2394 | + var url = "/web/mjon/msgcampain/selectMsgAddrListAjax.do"; | |
| 2395 | + | |
| 2396 | + $.ajax({ | |
| 2397 | + type: "POST", | |
| 2398 | + url: url, | |
| 2399 | + data: data, | |
| 2400 | + dataType:'json', | |
| 2401 | + async: true, | |
| 2402 | + cache: false, | |
| 2403 | + success: function (returnData, status) { | |
| 2404 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 2405 | + | |
| 2406 | + if(returnData.result == "success"){ | |
| 2407 | + | |
| 2408 | + var addrList = returnData.resultAddrList; | |
| 2409 | + var tableData = []; | |
| 2410 | + | |
| 2411 | + if(addrList.length == 0){ | |
| 2412 | + | |
| 2413 | + alert("주소록 정보가 없습니다."); | |
| 2414 | + tableAddr.setData(tableData); | |
| 2415 | + return false; | |
| 2416 | + } | |
| 2417 | + | |
| 2418 | + //받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. | |
| 2419 | + for(var i=0; i < addrList.length; i++){ | |
| 2420 | + | |
| 2421 | + tableData.push({addrGroupNm: addrList[i].addrGrpNm, addrPhone: removeDash(addrList[i].addrPhoneNo) , addrName: addrList[i].addrNm, addrRep1: addrList[i].addrInfo1, addrRep2: addrList[i].addrInfo2, addrRep3: addrList[i].addrInfo3, addrRep4: addrList[i].addrInfo4}); | |
| 2422 | + | |
| 2423 | + } | |
| 2424 | + | |
| 2425 | + //우측 주소록 리스트 Tabulator에 입력해주기 | |
| 2426 | + tableAddr.setData(tableData); | |
| 2427 | + | |
| 2428 | + }else{ | |
| 2429 | + | |
| 2430 | + alert(returnData.message); | |
| 2431 | + return false; | |
| 2432 | + | |
| 2433 | + } | |
| 2434 | + | |
| 2435 | + } else if(status== 'fail'){ | |
| 2436 | + alert("주소록 불러오기에 실패하였습니다. !!"); | |
| 2437 | + } | |
| 2438 | + }, | |
| 2439 | + error: function (e) { | |
| 2440 | + alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e); | |
| 2441 | + }, | |
| 2442 | + beforeSend : function(xmlHttpRequest) { | |
| 2443 | + //로딩창 show | |
| 2444 | + $('.loading_layer').addClass('active'); | |
| 2445 | + }, | |
| 2446 | + complete : function(xhr, textStatus) { | |
| 2447 | + //로딩창 hide | |
| 2448 | + $('.loading_layer').removeClass('active'); | |
| 2449 | + } | |
| 2450 | + }); | |
| 2451 | + | |
| 2452 | +} | |
| 2453 | + | |
| 2454 | +//주소록 불러오기에서 수신자 리스트 추가해 주기 | |
| 2455 | +function addrToList(){ | |
| 2456 | + | |
| 2457 | + var selectedData = tableAddr.getSelectedRows(); | |
| 2458 | + var tableData = []; | |
| 2459 | + | |
| 2460 | + if(selectedData == "" || selectedData == null){ | |
| 2461 | + | |
| 2462 | + alert("주소록을 선택해 주세요."); | |
| 2463 | + return false; | |
| 2464 | + | |
| 2465 | + }else{ // 선택한 Row 데이터 저장해주기 | |
| 2466 | + | |
| 2467 | + for(var i=0; i < selectedData.length; i++){ | |
| 2468 | + | |
| 2469 | + //좌측 받는사람 리스트를 담아둔 배열에 데이터를 추가해 준다. | |
| 2470 | + tableData.push({phone: removeDash(selectedData[i].getData().addrPhone), | |
| 2471 | + name: selectedData[i].getData().addrName, | |
| 2472 | + rep1: selectedData[i].getData().addrRep1, | |
| 2473 | + rep2: selectedData[i].getData().addrRep2, | |
| 2474 | + rep3: selectedData[i].getData().addrRep3, | |
| 2475 | + rep4: selectedData[i].getData().addrRep4} | |
| 2476 | + ); | |
| 2477 | + | |
| 2478 | + } | |
| 2479 | + | |
| 2480 | + //선택한 데이터 받는사람 리스트에 추가해 주기 | |
| 2481 | + addPhoneInfo(tableData); | |
| 2482 | + $(".closeAddr").trigger("click"); | |
| 2483 | + | |
| 2484 | + //주소록 레이어 팝업의 Tabulator 데이터 지워주기 | |
| 2485 | + tableAddr.clearData(); | |
| 2486 | + | |
| 2487 | + } | |
| 2488 | + | |
| 2489 | +} | |
| 2490 | + | |
| 2491 | +//주소록 팝업 닫기 기능 | |
| 2492 | +function addrClose(){ | |
| 2493 | + | |
| 2494 | + $(".closeAddr").trigger("click"); | |
| 2495 | + | |
| 2496 | + //주소록 레이어 팝업의 Tabulator 데이터 지워주기 | |
| 2497 | + tableAddr.clearData(); | |
| 2498 | + | |
| 2499 | +} | |
| 2500 | + | |
| 2501 | +//내문자함 선택시 저장된 내용 문자 입력영역에 처리해주기 | |
| 2502 | +function fnMyMsgAdd(msgId){ | |
| 2503 | + | |
| 2504 | + var form = document.addMyMsgForm; | |
| 2505 | + form.msgId.value = msgId; | |
| 2506 | + form.pageType.value = "myMsg"; | |
| 2507 | + | |
| 2508 | + var url = "/web/mjon/msgcampain/selectMsgAddInfoAjax.do"; | |
| 2509 | + var data = new FormData(document.addMyMsgForm); | |
| 2510 | + | |
| 2511 | + $.ajax({ | |
| 2512 | + type: "POST", | |
| 2513 | + url: url, | |
| 2514 | + data: data, | |
| 2515 | + dataType:'json', | |
| 2516 | + async: false, | |
| 2517 | + processData: false, | |
| 2518 | + contentType: false, | |
| 2519 | + cache: false, | |
| 2520 | + success: function (returnData, status) { | |
| 2521 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 2522 | + | |
| 2523 | + if(returnData.result == "success"){ | |
| 2524 | + | |
| 2525 | + var msgData = returnData.resultMsgInfo; | |
| 2526 | + var fileData = returnData.resultMsgAddPhotoInfo; | |
| 2527 | + | |
| 2528 | + var smsTxt = msgData.smsTxt; | |
| 2529 | + var subject = msgData.subject; | |
| 2530 | + var fileId = ""; | |
| 2531 | + var filePath = ""; | |
| 2532 | + var len = fileData.length; | |
| 2533 | + | |
| 2534 | + //기존 내용 지워주기 | |
| 2535 | + //$(".btnReset").trigger("click"); | |
| 2536 | + $('.delLi').each(function(){ | |
| 2537 | + $(this).remove(); | |
| 2538 | + }); | |
| 2539 | + | |
| 2540 | + $('.preBoxF').each(function(){ | |
| 2541 | + $(this).remove(); | |
| 2542 | + }); | |
| 2543 | + | |
| 2544 | + $('#imgCnt').val(0); | |
| 2545 | + | |
| 2546 | + //기존 imgFileId, imgFilePath 배열에 있는 내용 초기화 해주기 | |
| 2547 | + imgFilePath = []; | |
| 2548 | + imgFileId = []; | |
| 2549 | + | |
| 2550 | + //내문자함 텍스트 내용 입력해주기 | |
| 2551 | + $('#smsTxtArea').val(smsTxt); | |
| 2552 | + | |
| 2553 | + //첨부 이미지가 있는경우 이미지 처리해주기 | |
| 2554 | + if(len > 0){ | |
| 2555 | + | |
| 2556 | + for(var i=0; i < len; i++){ | |
| 2557 | + | |
| 2558 | + var num = i + 1; | |
| 2559 | + var imgId = fileData[i].atchFileId; | |
| 2560 | + var imgSn = fileData[i].fileSn; | |
| 2561 | + var fileStreCours = fileData[i].fileStreCours; | |
| 2562 | + var streFileNm = fileData[i].streFileNm; | |
| 2563 | + var fileExtsn = fileData[i].fileExtsn; | |
| 2564 | + | |
| 2565 | + /* var imgSrc = fileStreCours + "/" + streFileNm + "." + fileExtsn; */ | |
| 2566 | + var imgSrc = '/cmm/fms/getImage2.do?atchFileId=' + imgId + '&fileSn=' + imgSn; | |
| 2567 | + myMsgImageControl(imgSrc, "edit_n", "Template", imgId); | |
| 2568 | + | |
| 2569 | + } | |
| 2570 | + | |
| 2571 | + fnByteString(smsTxt); | |
| 2572 | + | |
| 2573 | + }else{ | |
| 2574 | + | |
| 2575 | + fnByteString(smsTxt); | |
| 2576 | + | |
| 2577 | + } | |
| 2578 | + | |
| 2579 | + //내 문자함 가져오기에서 글자길이 계산을 다시한다. | |
| 2580 | + $("#smsTxtArea").trigger("keyup"); | |
| 2581 | + | |
| 2582 | + // 문자전송 상단으로 이동 | |
| 2583 | + var sendOfT=$('.send_top').offset().top; | |
| 2584 | + $('html,body').stop().animate({'scrollTop':sendOfT-60},250); | |
| 2585 | + }else{ | |
| 2586 | + | |
| 2587 | + alert("내문자함 내용을 불러오지 못하였습니다."); | |
| 2588 | + return false; | |
| 2589 | + | |
| 2590 | + } | |
| 2591 | + | |
| 2592 | + } else if(status== 'fail'){ | |
| 2593 | + alert("내문자함 내용 입력에 실패하였습니다. !!"); | |
| 2594 | + } | |
| 2595 | + }, | |
| 2596 | + error: function (e) { alert("내문자함 내용 입력에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 2597 | + }); | |
| 2598 | + | |
| 2599 | +} | |
| 2600 | + | |
| 2601 | +function emailChange(email){ | |
| 2602 | + var emailTxt = $("input[name=emailDomain]"); | |
| 2603 | + | |
| 2604 | + if(email.value == '1'){ | |
| 2605 | + $("input[name=emailDomain]").attr('readonly', false); | |
| 2606 | + emailTxt.val(''); | |
| 2607 | + }else{ | |
| 2608 | + emailTxt.val(email.value); | |
| 2609 | + $("input[name=emailDomain]").attr('readonly', true); | |
| 2610 | + } | |
| 2611 | + | |
| 2612 | +} | |
| 2613 | + | |
| 2614 | +function fnCandidateUpt(dataType){ | |
| 2615 | + | |
| 2616 | + var form = document.candiForm; | |
| 2617 | + form.dataType.value = dataType; | |
| 2618 | + | |
| 2619 | + if(form.candidateNm.value == ""){ | |
| 2620 | + | |
| 2621 | + alert("후보자 이름을 입력해 주세요."); | |
| 2622 | + return false; | |
| 2623 | + | |
| 2624 | + } | |
| 2625 | + | |
| 2626 | + if(form.regidentNo1.value == ""){ | |
| 2627 | + | |
| 2628 | + alert("후보자 주민등록번호 앞자리를 입력해 주세요."); | |
| 2629 | + return false; | |
| 2630 | + | |
| 2631 | + }else if(!Number(form.regidentNo1.value)){ | |
| 2632 | + | |
| 2633 | + alert("후보자 주민등록번호 앞자리를 정확히 입력해 주세요."); | |
| 2634 | + return false; | |
| 2635 | + | |
| 2636 | + } | |
| 2637 | + | |
| 2638 | + if(form.regidentNo2.value == ""){ | |
| 2639 | + | |
| 2640 | + alert("후보자 주민등록번호 뒷자리를 입력해 주세요."); | |
| 2641 | + return false; | |
| 2642 | + | |
| 2643 | + }else if(!Number(form.regidentNo2.value)){ | |
| 2644 | + | |
| 2645 | + alert("후보자 주민등록번호 뒷자리를 정확히 입력해 주세요."); | |
| 2646 | + return false; | |
| 2647 | + | |
| 2648 | + } | |
| 2649 | + | |
| 2650 | + if(form.candidateAddr.value == ""){ | |
| 2651 | + | |
| 2652 | + alert("후보자 주소를 입력해 주세요."); | |
| 2653 | + return false; | |
| 2654 | + | |
| 2655 | + } | |
| 2656 | + | |
| 2657 | + if(form.managerNm.value == ""){ | |
| 2658 | + | |
| 2659 | + alert("담당자 이름을 입력해 주세요."); | |
| 2660 | + return false; | |
| 2661 | + | |
| 2662 | + } | |
| 2663 | + | |
| 2664 | + if(form.phoneNo.value == ""){ | |
| 2665 | + | |
| 2666 | + alert("담당자 휴대폰 번호를 입력해 주세요."); | |
| 2667 | + return false; | |
| 2668 | + | |
| 2669 | + }else if(!checkHpNum(removeDash(form.phoneNo.value))){ | |
| 2670 | + | |
| 2671 | + alert("정확한 휴대폰 번호를 입력해 주세요."); | |
| 2672 | + return false; | |
| 2673 | + | |
| 2674 | + } | |
| 2675 | + | |
| 2676 | + var emailChk = form.email.value + "@" + form.emailDomain.value; | |
| 2677 | + | |
| 2678 | + if(emailChk == ""){ | |
| 2679 | + | |
| 2680 | + alert("이메일을 입력해 주세요."); | |
| 2681 | + return false; | |
| 2682 | + | |
| 2683 | + }else if(!checkEmail(emailChk)){ | |
| 2684 | + | |
| 2685 | + alert("정확한 이메일을 입력해 주세요."); | |
| 2686 | + return false; | |
| 2687 | + | |
| 2688 | + } | |
| 2689 | + | |
| 2690 | + var msg = ""; | |
| 2691 | + | |
| 2692 | + if(dataType == 'Upt'){ | |
| 2693 | + | |
| 2694 | + msg="후보자 정보를 수정하시겠습니까?"; | |
| 2695 | + | |
| 2696 | + }else{ | |
| 2697 | + | |
| 2698 | + msg="후보자를 등록 하시겠습니까?"; | |
| 2699 | + | |
| 2700 | + } | |
| 2701 | + | |
| 2702 | + if(confirm(msg)){ | |
| 2703 | + | |
| 2704 | + //XSS 취약점 제거 | |
| 2705 | + form.candidateNm.value = XSSCheck(form.candidateNm.value); | |
| 2706 | + form.regidentNo1.value = XSSCheck(form.regidentNo1.value); | |
| 2707 | + form.regidentNo2.value = XSSCheck(form.regidentNo2.value); | |
| 2708 | + form.candidateAddr.value = XSSCheck(form.candidateAddr.value); | |
| 2709 | + form.managerNm.value = XSSCheck(form.managerNm.value); | |
| 2710 | + form.phoneNo.value = XSSCheck(form.phoneNo.value); | |
| 2711 | + form.email.value = XSSCheck(form.email.value); | |
| 2712 | + form.emailDomain.value = XSSCheck(form.emailDomain.value); | |
| 2713 | + | |
| 2714 | + var url = "/web/mjon/msgcampain/insertCandidateDataInfoAjax.do"; | |
| 2715 | + var data = new FormData(document.candiForm); | |
| 2716 | + | |
| 2717 | + $.ajax({ | |
| 2718 | + type: "POST", | |
| 2719 | + url: url, | |
| 2720 | + data: data, | |
| 2721 | + dataType:'json', | |
| 2722 | + async: false, | |
| 2723 | + processData: false, | |
| 2724 | + contentType: false, | |
| 2725 | + cache: false, | |
| 2726 | + success: function (returnData, status) { | |
| 2727 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 2728 | + | |
| 2729 | + if(returnData.result == "loginFail"){ | |
| 2730 | + | |
| 2731 | + alert(returnData.message); | |
| 2732 | + return false; | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + }else if(returnData.result == "success"){ | |
| 2736 | + | |
| 2737 | + alert(returnData.message); | |
| 2738 | + location.reload(); | |
| 2739 | +// return false; | |
| 2740 | + | |
| 2741 | + }else{ | |
| 2742 | + | |
| 2743 | + alert(returnData.message); | |
| 2744 | + return false; | |
| 2745 | + | |
| 2746 | + } | |
| 2747 | + | |
| 2748 | + } else if(status== 'fail'){ | |
| 2749 | + alert("후보자 등록에 실패하였습니다. !!"); | |
| 2750 | + } | |
| 2751 | + }, | |
| 2752 | + error: function (e) { alert("후보자 등록에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 2753 | + }); | |
| 2754 | + | |
| 2755 | + } | |
| 2756 | + | |
| 2757 | +} | |
| 2758 | + | |
| 2759 | +function fnCandidateDel(){ | |
| 2760 | + | |
| 2761 | + var form = document.candiForm; | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + if(confirm("후보자를 삭제 하시겠습니까?")){ | |
| 2765 | + | |
| 2766 | + //XSS 취약점 제거 | |
| 2767 | + form.candidateNm.value = XSSCheck(form.candidateNm.value); | |
| 2768 | + form.regidentNo1.value = XSSCheck(form.regidentNo1.value); | |
| 2769 | + form.regidentNo2.value = XSSCheck(form.regidentNo2.value); | |
| 2770 | + form.candidateAddr.value = XSSCheck(form.candidateAddr.value); | |
| 2771 | + form.managerNm.value = XSSCheck(form.managerNm.value); | |
| 2772 | + form.phoneNo.value = XSSCheck(form.phoneNo.value); | |
| 2773 | + form.email.value = XSSCheck(form.email.value); | |
| 2774 | + form.emailDomain.value = XSSCheck(form.emailDomain.value); | |
| 2775 | + | |
| 2776 | + var url = "/web/mjon/msgcampain/deleteCandidateDataInfoAjax.do"; | |
| 2777 | + var data = new FormData(document.candiForm); | |
| 2778 | + | |
| 2779 | + $.ajax({ | |
| 2780 | + type: "POST", | |
| 2781 | + url: url, | |
| 2782 | + data: data, | |
| 2783 | + dataType:'json', | |
| 2784 | + async: false, | |
| 2785 | + processData: false, | |
| 2786 | + contentType: false, | |
| 2787 | + cache: false, | |
| 2788 | + success: function (returnData, status) { | |
| 2789 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 2790 | + | |
| 2791 | + if(returnData.result == "loginFail"){ | |
| 2792 | + | |
| 2793 | + alert(returnData.message); | |
| 2794 | + return false; | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + }else if(returnData.result == "success"){ | |
| 2798 | + | |
| 2799 | + alert(returnData.message); | |
| 2800 | + location.reload(); | |
| 2801 | +// return false; | |
| 2802 | + | |
| 2803 | + }else{ | |
| 2804 | + | |
| 2805 | + alert(returnData.message); | |
| 2806 | + return false; | |
| 2807 | + | |
| 2808 | + } | |
| 2809 | + | |
| 2810 | + } else if(status== 'fail'){ | |
| 2811 | + alert("후보자 삭제에 실패하였습니다. !!"); | |
| 2812 | + } | |
| 2813 | + }, | |
| 2814 | + error: function (e) { alert("후보자 삭제에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 2815 | + }); | |
| 2816 | + debugger; | |
| 2817 | + } | |
| 2818 | +} | |
| 2819 | + | |
| 2820 | +function fn_candidateLoginChk(){ | |
| 2821 | + | |
| 2822 | + alert("후보자 등록은 로그인 후 이용 가능합니다."); | |
| 2823 | + return false; | |
| 2824 | + | |
| 2825 | +} | |
| 2826 | + | |
| 2827 | +function fn_mberDeptChk(){ | |
| 2828 | + | |
| 2829 | + alert("선거문자는 개인 회원만 이용 가능합니다."); | |
| 2830 | + return false; | |
| 2831 | + | |
| 2832 | +} | |
| 2833 | + | |
| 2834 | + | |
| 2835 | +function goToCustom(){ | |
| 2836 | + var form = document.goToCustomForm; | |
| 2837 | + form.submit(); | |
| 2838 | +} | |
| 2839 | +//최초 문자샘플 탭 리스트 데이터 불러오기 | |
| 2840 | +//fnLetterListAjax(); | |
| 2841 | + | |
| 2842 | +/* 윈도우팝업 열기 */ | |
| 2843 | +function infoPop(pageUrl){ | |
| 2844 | + document.popForm.pageType.value = pageUrl; | |
| 2845 | + document.popForm.action = "/web/pop/infoPop.do"; | |
| 2846 | + document.popForm.method = "post"; | |
| 2847 | + window.open("about:blank", 'infoPop', 'width=790, height=1500, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=yes'); | |
| 2848 | + document.popForm.target = "infoPop"; | |
| 2849 | + document.popForm.submit(); | |
| 2850 | +} | |
| 2851 | + | |
| 2852 | +$(document).on('click', '.addressregi_btn', function() { | |
| 2853 | + var tableData = tableL.getRows(); | |
| 2854 | + var dataLen = tableL.getRows().length; | |
| 2855 | + if(dataLen == 0){ | |
| 2856 | + alert("연락처 정보를 등록해 주세요."); | |
| 2857 | + return false; | |
| 2858 | + }else{ | |
| 2859 | + $('.addressregi_layer').css({'width':'680px','display':'block','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 2860 | + setTimeout(function(){ | |
| 2861 | + $('.addressregi_layer').css({'opacity':'1'}); | |
| 2862 | + },150); | |
| 2863 | + $('.mask').addClass('on'); | |
| 2864 | + getAddrGroupList(); | |
| 2865 | + } | |
| 2866 | +}); | |
| 2867 | + | |
| 2868 | +$(document).on('click', '.addressregi_layer .tooltip-close', function() { | |
| 2869 | + $('.addressregi_layer').attr('style',''); | |
| 2870 | + $("#addrGrpNm").val(""); | |
| 2871 | +}); | |
| 2872 | + | |
| 2873 | +$(document).on('change', '#addrGrpIdInfo', function() { | |
| 2874 | + if ($("#addrGrpIdInfo option:selected").val() != "NEW") { | |
| 2875 | + $("#addrGrpNm").val(""); // 새그룹명 Clear; | |
| 2876 | + } | |
| 2877 | +}); | |
| 2878 | + | |
| 2879 | +//주소록 그룹정보 불러오기 | |
| 2880 | +function getAddrGroupList() { | |
| 2881 | + $.ajax({ | |
| 2882 | + type : "POST", | |
| 2883 | + async : false, | |
| 2884 | + url : "/web/mjon/addr/addrGroupListAjax.do", | |
| 2885 | + data : {}, | |
| 2886 | + dataType:'json', | |
| 2887 | + success : function(data) { | |
| 2888 | + //alert(JSON.stringify(data.addrGroupList)); | |
| 2889 | + | |
| 2890 | + // Show Html | |
| 2891 | + getAddrGroupListShow(data.addrGroupList); | |
| 2892 | + }, | |
| 2893 | + error : function(xhr, status, error) { | |
| 2894 | + alert(error); | |
| 2895 | + return false; | |
| 2896 | + } | |
| 2897 | + }); | |
| 2898 | +} | |
| 2899 | + | |
| 2900 | +//Show Html | |
| 2901 | +function getAddrGroupListShow(jsonList) { | |
| 2902 | + var sHtml = ""; | |
| 2903 | + sHtml += "<option value='NEW'>그룹추가</option>"; | |
| 2904 | + sHtml += "<option value='0'>그룹미지정</option>"; | |
| 2905 | + sHtml += "<option value='bookmark'>자주보내는 번호</option>"; | |
| 2906 | + for (var j = 0; j < jsonList.length; j++) { | |
| 2907 | + sHtml += " <option value='" + $.trim(jsonList[j].addrGrpId) + "' />" + $.trim(jsonList[j].addrGrpNm) + "</option>"; | |
| 2908 | + } | |
| 2909 | + | |
| 2910 | + $("#addrGrpIdInfo").html(sHtml); | |
| 2911 | +} | |
| 2912 | + | |
| 2913 | +//주소록 그룹 중복체크 | |
| 2914 | +function getAddrGroupDuplCheckAjax() { | |
| 2915 | + var isReturn = true; | |
| 2916 | + | |
| 2917 | + $.ajax({ | |
| 2918 | + url : "<c:url value='/web/addr/getAddrGroupDuplCheckAjax.do' />", | |
| 2919 | + type : 'POST', | |
| 2920 | + data : {"addrGrpNm" : $("#addrGrpNm").val()}, | |
| 2921 | + dataType:'json', | |
| 2922 | + async: false, // 동기 | |
| 2923 | + success : function(data, status){ | |
| 2924 | + if(data.isSuccess == true) { | |
| 2925 | + if(data.isDupl == true) { | |
| 2926 | + //alert("중복된 그룹명입니다."); | |
| 2927 | + isReturn = false; | |
| 2928 | + } | |
| 2929 | + } | |
| 2930 | + else { | |
| 2931 | + //alert("Message : " + msg); | |
| 2932 | + } | |
| 2933 | + }, | |
| 2934 | + error: function (e) { | |
| 2935 | + //alert("주소록 중복체크에 실패했습니다."); | |
| 2936 | + } | |
| 2937 | + }); | |
| 2938 | + | |
| 2939 | + return isReturn; | |
| 2940 | +} | |
| 2941 | + | |
| 2942 | +/* 테스트발송 열기 */ | |
| 2943 | +function fnTestSend(){ | |
| 2944 | + | |
| 2945 | + if(!checkConf()){ //문자온 conf-check | |
| 2946 | + alert("현재 문자 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요."); | |
| 2947 | + return false; | |
| 2948 | + } | |
| 2949 | + | |
| 2950 | + var msgForm = document.msgForm; | |
| 2951 | + var form = document.testSendForm; | |
| 2952 | + var loginVO = '${LoginVO}'; | |
| 2953 | + var spamStatus = false; | |
| 2954 | + var callFrom = $("#callFromList option:selected").val(); | |
| 2955 | + | |
| 2956 | + //로그인 체크 | |
| 2957 | + if(loginVO == "" || loginVO == null){ | |
| 2958 | + alert("문자발송 서비스는 로그인 후 이용 가능합니다."); | |
| 2959 | + return false; | |
| 2960 | + } | |
| 2961 | + | |
| 2962 | + //MJ_MSG_GROUP_DATA 누락데이터 체크 | |
| 2963 | + //if (getMsgGroupDataErrorCheck() == false) { | |
| 2964 | + // alert("고객님께서 발송한 최근문자가 발송결과에 표시되지않아, 문자발송이 임시로 차단되었습니다.\n문자온 고객센터에 문의해주세요."); | |
| 2965 | + // return false; | |
| 2966 | + //} | |
| 2967 | + | |
| 2968 | + //문자내용에 이모지가 있는지 체크 | |
| 2969 | + var strCont = msgForm.smsTxtArea.value; | |
| 2970 | + if(!emojiCheck(strCont)) return false; | |
| 2971 | + | |
| 2972 | + // 발신번호 체크 | |
| 2973 | + if(callFrom == ""){ | |
| 2974 | + alert("발신번호를 입력해 주세요."); | |
| 2975 | + return false; | |
| 2976 | + } | |
| 2977 | + | |
| 2978 | + //그림문자가 아닌데 본문 비어있는지 확인 | |
| 2979 | + if(imgFilePath.length == 0) { | |
| 2980 | + if(msgForm.smsTxtArea.value == "") { | |
| 2981 | + alert("문자 내용을 입력해 주세요."); | |
| 2982 | + return false; | |
| 2983 | + } | |
| 2984 | + }else{//문자내용에 스팸 단어 포함여부 체크 | |
| 2985 | + var spmData = new FormData(msgForm); | |
| 2986 | + url = "/web/mjon/msgdata/selectSpamTxtChkAjax.do"; | |
| 2987 | + | |
| 2988 | + $.ajax({ | |
| 2989 | + type: "POST", | |
| 2990 | + url: url, | |
| 2991 | + data: spmData, | |
| 2992 | + dataType:'json', | |
| 2993 | + async: false, | |
| 2994 | + processData: false, | |
| 2995 | + contentType: false, | |
| 2996 | + cache: false, | |
| 2997 | + success: function (returnData, status) { | |
| 2998 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 2999 | + | |
| 3000 | + if("fail" == returnData.result){ | |
| 3001 | + | |
| 3002 | + alert(returnData.message); | |
| 3003 | + return false; | |
| 3004 | + | |
| 3005 | + }else if("loginFail" == returnData.result){ | |
| 3006 | + | |
| 3007 | + alert(returnData.message); | |
| 3008 | + return false; | |
| 3009 | + | |
| 3010 | + }else if("spams" == returnData.result){ | |
| 3011 | + | |
| 3012 | +// var spmFilterTxt = returnData.spmFilterTxt; | |
| 3013 | + spamStatus = true; | |
| 3014 | + //alert("문자 내용에 \"" + spmFilterTxt + "\"의 스팸문자가 포함되어 있습니다."); | |
| 3015 | + alert("전송 문자내용 중 스팸문구로 의심되는 단어가 포함되어 있어 문자발송이 불가합니다.\n자세한 사항은 문자온 고객센터를 통해 문의주시기 바랍니다."); | |
| 3016 | + return false; | |
| 3017 | + | |
| 3018 | + } | |
| 3019 | + | |
| 3020 | + } else if(status== 'fail'){ | |
| 3021 | + alert(returnData.message); | |
| 3022 | + return false; | |
| 3023 | + } | |
| 3024 | + }, | |
| 3025 | + error: function (e) { alert("시스템 오류가 발생하였습니다."); console.log("ERROR : ", e); return false;} | |
| 3026 | + }); | |
| 3027 | + | |
| 3028 | + } | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + //단문 장문 그림(몇장인지) 판별하기 - 발송금액 계산 | |
| 3032 | + | |
| 3033 | + if($('#nowMsgType').text() == "그림"){ | |
| 3034 | + | |
| 3035 | + msgType = 'P'; | |
| 3036 | + | |
| 3037 | + if(imgFilePath.length == 1) { | |
| 3038 | + | |
| 3039 | + form.eachPrice.value = '<c:out value="${picturePrice}" />'; | |
| 3040 | + | |
| 3041 | + } else if(imgFilePath.length == 2) { | |
| 3042 | + | |
| 3043 | + form.eachPrice.value = '<c:out value="${picture2Price}" />'; | |
| 3044 | + | |
| 3045 | + } else if(imgFilePath.length == 3) { | |
| 3046 | + | |
| 3047 | + form.eachPrice.value = '<c:out value="${picture3Price}" />'; | |
| 3048 | + | |
| 3049 | + } | |
| 3050 | + | |
| 3051 | + //제목 사용한 경우 | |
| 3052 | + if($("input[name=title_status]:checked").val() == 'Y') { | |
| 3053 | + form.mmsSubject.value = msgForm.mmsSubject.value; | |
| 3054 | + } else { | |
| 3055 | + form.mmsSubject.value = ""; //초기화 | |
| 3056 | + } | |
| 3057 | + | |
| 3058 | + }else if($('#nowMsgType').text() == "장문"){ | |
| 3059 | + | |
| 3060 | + msgType = 'L'; | |
| 3061 | + | |
| 3062 | + form.eachPrice.value = '<c:out value="${longPrice}" />'; | |
| 3063 | + | |
| 3064 | + //제목 사용한 경우 | |
| 3065 | + if($("input[name=title_status]:checked").val() == 'Y') { | |
| 3066 | + form.mmsSubject.value = msgForm.mmsSubject.value; | |
| 3067 | + } else { | |
| 3068 | + form.mmsSubject.value = ""; //초기화 | |
| 3069 | + } | |
| 3070 | + | |
| 3071 | + }else{ | |
| 3072 | + | |
| 3073 | + msgType = 'S'; | |
| 3074 | + | |
| 3075 | + form.eachPrice.value = '<c:out value="${shortPrice}" />'; | |
| 3076 | + | |
| 3077 | + form.mmsSubject.value = ""; // 장문/그림 제목 초기화 | |
| 3078 | + } | |
| 3079 | + | |
| 3080 | + form.msgType.value = msgType; | |
| 3081 | + | |
| 3082 | + /* | |
| 3083 | + var phoneIn = $(".send_right .phone").html(); | |
| 3084 | + //팝업으로 보내기 전에 realtime class 삭제 - 스크립트 제외 | |
| 3085 | + phoneIn = phoneIn.replace(' class="realtime"',""); | |
| 3086 | + form.msgpreview.value = phoneIn; | |
| 3087 | + */ | |
| 3088 | + //발신번호 세팅 | |
| 3089 | + form.callFrom.value = callFrom; | |
| 3090 | + | |
| 3091 | + //이미지 path 보내기 | |
| 3092 | + form.imgFilePath.value = imgFilePath; | |
| 3093 | + | |
| 3094 | + form.action = "/web/pop/testSendPop.do"; | |
| 3095 | + form.method = "post"; | |
| 3096 | + window.open("about:blank", 'testSendPop', 'width=770, height=850, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=1'); | |
| 3097 | + form.target = "testSendPop"; | |
| 3098 | + form.submit(); | |
| 3099 | +} | |
| 3100 | + | |
| 3101 | +function advMsgInsert(){ | |
| 3102 | + var callFrom = $("#callFromList option:selected").val(); | |
| 3103 | + | |
| 3104 | + var advStr = '<div class="ad_txt"><p>(선거운동정보)</p></div>'; | |
| 3105 | + var advDenyStr = '<div class="deny_txt">후보자전화번호 ' + callFrom + '<br/>불법수집정보 신고번호 118번<br/>무료거부 0808800858</div>'; | |
| 3106 | + | |
| 3107 | + var preAdvStr = '<p class="ad_tit">(선거운동정보)</p>'; | |
| 3108 | + var preAdvDenyStr = '<p class="deny_receipt">후보자전화번호 ' + callFrom + '<br>불법수집정보 신고번호 118번<br>무료거부 0808800858</p>'; | |
| 3109 | + | |
| 3110 | + //광고 및 무료수신거부 텍스트 추가 | |
| 3111 | + if ($('input[name=send_adYn]:checked').val() == 'Y'){ | |
| 3112 | + | |
| 3113 | + //문자내용 광고문자 삭제하기 | |
| 3114 | + $(".ad_txt").remove(); | |
| 3115 | + $(".deny_txt").remove(); | |
| 3116 | + //미리보기 광고 문자 삭제하기 | |
| 3117 | + $('.ad_tit').remove(); | |
| 3118 | + $('.deny_receipt').remove(); | |
| 3119 | + | |
| 3120 | + //문자 내용에 광고 문자 추가해주기 | |
| 3121 | + $(advStr).insertBefore('textarea[name=smsTxtArea]'); | |
| 3122 | + $(advDenyStr).insertBefore('div[name=afterDeny]'); | |
| 3123 | + | |
| 3124 | + //미리보기에 광고 문자 추가해주기 | |
| 3125 | + $(preAdvStr).insertBefore('.none_txt'); | |
| 3126 | + $(preAdvDenyStr).insertAfter('.realtime'); | |
| 3127 | + | |
| 3128 | + }else{ //광고 및 무료수신거부 텍스트 삭제 | |
| 3129 | + | |
| 3130 | + //문자내용 광고문자 삭제하기 | |
| 3131 | + $('.ad_txt').remove(); | |
| 3132 | + $('.deny_txt').remove(); | |
| 3133 | + | |
| 3134 | + //미리보기 광고 문자 삭제하기 | |
| 3135 | + $('.ad_tit').remove(); | |
| 3136 | + $('.deny_receipt').remove(); | |
| 3137 | + | |
| 3138 | + } | |
| 3139 | + | |
| 3140 | + //문자 바이트수 계산하기 | |
| 3141 | + fnByteString($('#smsTxtArea').val()); | |
| 3142 | + | |
| 3143 | +} | |
| 3144 | + | |
| 3145 | +function setCandidatePhone() { | |
| 3146 | + advMsgInsert(); | |
| 3147 | +} | |
| 3148 | + | |
| 3149 | +//이벤트 잔액 로그인 체크 | |
| 3150 | +$(".btn_event_cash").off().on("click", function(){ | |
| 3151 | + var loginVO = '${LoginVO}'; | |
| 3152 | + if(loginVO == "" || loginVO == null){ | |
| 3153 | + alert("로그인 후 이용이 가능합니다."); | |
| 3154 | + return false; | |
| 3155 | + } | |
| 3156 | +}); | |
| 3157 | + | |
| 3158 | +function checkNumber(event) { | |
| 3159 | + var divideCnt = $('#divideCnt').val(); | |
| 3160 | + if(!(event.key >= 0 && event.key <= 9)) { | |
| 3161 | + return false; | |
| 3162 | + } | |
| 3163 | + | |
| 3164 | + var totCnt = divideCnt + "" + event.key; | |
| 3165 | + if(Number(totCnt) > 5000){ | |
| 3166 | + | |
| 3167 | + alert("분할전송 건수는 5,000건을 초과할 수 없습니다."); | |
| 3168 | + $('#divideCnt').val("20"); | |
| 3169 | + return false; | |
| 3170 | + | |
| 3171 | + } | |
| 3172 | + | |
| 3173 | + return true; | |
| 3174 | +} | |
| 3175 | + | |
| 3176 | +//문자 발송목록 | |
| 3177 | +function getMjMsgSentListAll(pageNo) { | |
| 3178 | + document.sentListForm.pageIndex.value = pageNo; | |
| 3179 | + document.sentListForm.msgSentType.value = "02"; // 01:문자전송, 02:선거문자 | |
| 3180 | + | |
| 3181 | + var sendData= $(document.sentListForm).serializeArray(); | |
| 3182 | + $("#mjMsgSentListAllLoad").load("/web/mjon/msgdata/selectMjMsgSentListAjax.do", sendData ,function(response, status, xhr){ | |
| 3183 | + | |
| 3184 | + }); | |
| 3185 | +} | |
| 3186 | + | |
| 3187 | + | |
| 3188 | +//주소록 불러오기 팝업 그룹 선택 데이터 불러오기. | |
| 3189 | +function fnSelectAddrGrpList(){ | |
| 3190 | + | |
| 3191 | + $(".closeAddr").trigger("click"); | |
| 3192 | + | |
| 3193 | + //var myAddrGrpId = $("input[name=grpCheck]:checked").val(); | |
| 3194 | + | |
| 3195 | + //그룹 미지정 체크 확인 | |
| 3196 | + var addrGrp1 = $('.adr_cb_wrap2 #group1').is(':checked'); | |
| 3197 | + | |
| 3198 | + //자주보내는 번호 체크 확인 | |
| 3199 | + var addrGrp2 = $('.adr_cb_wrap2 #group2').is(':checked'); | |
| 3200 | + | |
| 3201 | + var arrAddrGrpId = []; | |
| 3202 | + $("input[name=grpCheck]:checked").each(function(){ | |
| 3203 | + | |
| 3204 | + arrAddrGrpId.push($(this).val()); | |
| 3205 | + | |
| 3206 | + }); | |
| 3207 | + | |
| 3208 | + if(addrGrp1 == false && addrGrp2 == false && arrAddrGrpId.length == 0){ | |
| 3209 | + | |
| 3210 | + alert("추가할 주소록 그룹을 선택해 주세요."); | |
| 3211 | + return false; | |
| 3212 | + | |
| 3213 | + } | |
| 3214 | + | |
| 3215 | + //선택 그룹 Tabulator에 정보 입력해 주기 | |
| 3216 | + var tableData = []; | |
| 3217 | + var totGrpCnt = 0; | |
| 3218 | + | |
| 3219 | + //그룹 미지정 선택시 | |
| 3220 | + if(addrGrp1){ | |
| 3221 | + | |
| 3222 | + var addrGrp1Nm = "그룹미지정"; | |
| 3223 | + var addrGrp1Cnt = $("#nogrpCnt").text(); | |
| 3224 | + | |
| 3225 | + if(Number(addrGrp1Cnt) > 0){ | |
| 3226 | + totGrpCnt = Number(totGrpCnt) + Number(addrGrp1Cnt); | |
| 3227 | + tableData.push({addrGrpNm:addrGrp1Nm, addrGrpCnt:addrGrp1Cnt, addrGrpId:'group1' }); | |
| 3228 | + } | |
| 3229 | + | |
| 3230 | + } | |
| 3231 | + | |
| 3232 | + //자주보내는번호 | |
| 3233 | + if(addrGrp2){ | |
| 3234 | + | |
| 3235 | + var addrGrp2Nm = "자주보내는 번호"; | |
| 3236 | + var addrGrp2Cnt = $("#bookmarkCnt").text(); | |
| 3237 | + | |
| 3238 | + if(Number(addrGrp2Cnt) > 0){ | |
| 3239 | + totGrpCnt = Number(totGrpCnt) + Number(addrGrp2Cnt); | |
| 3240 | + tableData.push({addrGrpNm:addrGrp2Nm, addrGrpCnt:addrGrp2Cnt, addrGrpId:'bookmark' }); | |
| 3241 | + } | |
| 3242 | + | |
| 3243 | + } | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + //그룹추가 데이터 처리 | |
| 3247 | + if(arrAddrGrpId.length > 0){ | |
| 3248 | + | |
| 3249 | + for(var i=0; i< arrAddrGrpId.length; i++){ | |
| 3250 | + | |
| 3251 | + var addrGrpId = arrAddrGrpId[i].split("§")[0]; | |
| 3252 | + var addrGrpNm = arrAddrGrpId[i].split("§")[1]; | |
| 3253 | + var addrGrpCnt = arrAddrGrpId[i].split("§")[2]; | |
| 3254 | + | |
| 3255 | + if(Number(addrGrpCnt) > 0){ | |
| 3256 | + totGrpCnt = Number(totGrpCnt) + Number(addrGrpCnt); | |
| 3257 | + tableData.push({addrGrpNm:addrGrpNm, addrGrpCnt:addrGrpCnt, addrGrpId:addrGrpId }); | |
| 3258 | + } | |
| 3259 | + } | |
| 3260 | + | |
| 3261 | + } | |
| 3262 | + | |
| 3263 | + //Tabulator 데이터 입력 | |
| 3264 | + tableL.clearData(); //기존 등록된 주소록 정보 삭제 | |
| 3265 | + tableL.addData(tableData); | |
| 3266 | + updateTotCnt(totGrpCnt); //전체 데이터 갯수 구하기 | |
| 3267 | + totalPriceSum(totGrpCnt); | |
| 3268 | + | |
| 3269 | + | |
| 3270 | +} | |
| 3271 | + | |
| 3272 | +</script> | |
| 3273 | + <div class="loading_layer"> | |
| 3274 | + <div class="loading_container"> | |
| 3275 | + <div class="bar"></div> | |
| 3276 | + <div class="text">Loading</div> | |
| 3277 | + </div> | |
| 3278 | + </div> | |
| 3279 | + | |
| 3280 | + <form id="sentListForm" name="sentListForm" method="post"> | |
| 3281 | + <input type="hidden" name="pageType" value=""/> | |
| 3282 | + <input type="hidden" name="pageIndex" value=""/> | |
| 3283 | + <input type="hidden" name="msgSentType" value=""/> | |
| 3284 | + <input type="hidden" name="searchSortCnd" value="" /> | |
| 3285 | + <input type="hidden" name="searchSortOrd" value="" /> | |
| 3286 | + </form> | |
| 3287 | + | |
| 3288 | + <!-- 2023 10 16 재전송 : 상세내용 팝업 --> | |
| 3289 | + <div class="tooltip-wrap" style="z-index:110;"> | |
| 3290 | + <div class="popup-com adr_layer rev_popup01" tabindex="0" data-tooltip-con="rev_popup01" | |
| 3291 | + data-focus="rev_popup01" data-focus-prev="rev_popup01-close" style="width: 440px;"> | |
| 3292 | + <div class="popup_heading"> | |
| 3293 | + <p>문자내용</p> | |
| 3294 | + <button type="button" class="tooltip-close" data-focus="rev_popup01-close"><img | |
| 3295 | + src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3296 | + </div> | |
| 3297 | + <div class="layer_in" id="msgSentDetailPopLoad" style="padding-bottom: 0px;"> | |
| 3298 | + </div> | |
| 3299 | + <div class="popup_btn_wrap2" style="justify-content: center; margin-bottom: 30px;"> | |
| 3300 | + <button type="button" class="tooltip-close" data-focus="rev_popup01-close" data-focus-next="rev_popup01">닫기</button> | |
| 3301 | + </div> | |
| 3302 | + </div> | |
| 3303 | + </div> | |
| 3304 | + <!--// 2023 10 16 재전송 : 상세내용 팝업 --> | |
| 3305 | + | |
| 3306 | + <!-- 2023 10 16 재전송 팝업 --> | |
| 3307 | + <div class="tooltip-wrap"> | |
| 3308 | + <div class="popup-com import_layer popup05" tabindex="0" data-tooltip-con="popup05" data-focus="popup05" data-focus-prev="popup05-close" style="width: 900px;"> | |
| 3309 | + <div class="popup_heading"> | |
| 3310 | + <p><span>전송내역</p> | |
| 3311 | + <button type="button" class="tooltip-close" data-focus="popup05-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3312 | + </div> | |
| 3313 | + <div class="layer_in" id="mjMsgSentListAllLoad" style="padding-bottom: 0px; min-height:428px;"> | |
| 3314 | + </div> | |
| 3315 | + <div class="popup_btn_wrap2" style="margin-bottom: 30px;"> | |
| 3316 | + <button type="button" class="tooltip-close" data-focus="popup05-close" data-focus-next="popup05">닫기</button> | |
| 3317 | + </div> | |
| 3318 | + </div> | |
| 3319 | + </div> | |
| 3320 | + <!--// 2023 10 16 재전송 팝업 --> | |
| 3321 | + | |
| 3322 | + <!-- 후보자등록 팝업 data-tooltip:candidate_popup01 --> | |
| 3323 | + <div class="tooltip-wrap"> | |
| 3324 | + <div class="popup-com candidate_layer candidate_popup01" tabindex="0" data-tooltip-con="candidate_popup01" data-focus="candidate_popup01" data-focus-prev="candidate_popup01-close" style="width: 620px;"> | |
| 3325 | + <div class="popup_heading"> | |
| 3326 | + <p>후보자 등록</p> | |
| 3327 | + <button type="button" class="tooltip-close" data-focus="candidate_popup01-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3328 | + </div> | |
| 3329 | + | |
| 3330 | + <form id="candiForm" name="candiForm" method="post"> | |
| 3331 | + <input type="hidden" id="dataType" name="dataType" value="Reg"/> | |
| 3332 | + | |
| 3333 | + <div class="layer_in"> | |
| 3334 | + <p class="adr_pop_title">선거문자는 반드시 <span class="c_002c9a">후보자 등록</span>을 하셔야만 이용 가능합니다. <br/>입력하신 내용은 세금계산서 발행을 위한 정보로만 사용됩니다.</p> | |
| 3335 | + <div class="candidate_table"> | |
| 3336 | + <p>후보자</p> | |
| 3337 | + <table> | |
| 3338 | + <caption>후보자 등록을 위한 성명, 주민등록번호, 주소를 입력하는 표</caption> | |
| 3339 | + <colgroup> | |
| 3340 | + <col style="width: 125px;"> | |
| 3341 | + <col style="width: auto;"> | |
| 3342 | + </colgroup> | |
| 3343 | + <tbody> | |
| 3344 | + <tr> | |
| 3345 | + <th scope="row">성명</th> | |
| 3346 | + <td> | |
| 3347 | + <label for="candidateNm" class="label"></label> | |
| 3348 | + <input type="text" id="candidateNm" name="candidateNm" value="<c:out value='${mjonCandidateVO.candidateNm}'/>" placeholder="후보자 성명 입력" onfocus="this.placeholder=''" onblur="this.placeholder='후보자 성명 입력'" class="inputLight"> | |
| 3349 | + </td> | |
| 3350 | + </tr> | |
| 3351 | + <tr class="residentNum"> | |
| 3352 | + <th scope="row">주민등록번호</th> | |
| 3353 | + <td> | |
| 3354 | + <label for="regidentNo1" class="label"></label> | |
| 3355 | + <input type="text" id="regidentNo1" name="regidentNo1" value="<c:out value='${mjonCandidateVO.regidentNo1}'/>" maxlength="6" placeholder="주민등록번호 앞 6자리" onfocus="this.placeholder=''" onblur="this.placeholder='주민등록번호 앞 6자리'" class="inputLight"> | |
| 3356 | + <span>-</span> | |
| 3357 | + <label for="regidentNo2" class="label"></label> | |
| 3358 | + <input type="password" id="regidentNo2" name="regidentNo2" value="<c:out value='${mjonCandidateVO.regidentNo2}'/>" maxlength="7" placeholder="주민등록번호 뒤 7자리" onfocus="this.placeholder=''" onblur="this.placeholder='주민등록번호 뒤 7자리'" class="inputLight"> | |
| 3359 | + </td> | |
| 3360 | + </tr> | |
| 3361 | + <tr> | |
| 3362 | + <th scope="row">주소</th> | |
| 3363 | + <td> | |
| 3364 | + <label for="candidateAddr" class="label"></label> | |
| 3365 | + <input type="text" id="candidateAddr" name="candidateAddr" value="<c:out value='${mjonCandidateVO.candidateAddr}'/>"> | |
| 3366 | + </td> | |
| 3367 | + </tr> | |
| 3368 | + </tbody> | |
| 3369 | + </table> | |
| 3370 | + </div> | |
| 3371 | + <div class="candidate_table" style="margin-top: 40px;"> | |
| 3372 | + <p>담당자</p> | |
| 3373 | + <table> | |
| 3374 | + <caption>후보자 등록을 위한 성명, 주민등록번호, 주소를 입력하는 표</caption> | |
| 3375 | + <colgroup> | |
| 3376 | + <col style="width: 125px;"> | |
| 3377 | + <col style="width: auto;"> | |
| 3378 | + </colgroup> | |
| 3379 | + <tbody> | |
| 3380 | + <tr> | |
| 3381 | + <th scope="row">성명</th> | |
| 3382 | + <td> | |
| 3383 | + <label for="managerNm" class="label"></label> | |
| 3384 | + <input type="text" id="managerNm" name="managerNm" value="<c:out value='${mjonCandidateVO.managerNm}'/>" placeholder="담당자 성명 입력" onfocus="this.placeholder=''" onblur="this.placeholder='담당자 성명 입력'" class="inputLight"> | |
| 3385 | + </td> | |
| 3386 | + </tr> | |
| 3387 | + <%-- <tr> | |
| 3388 | + <th scope="row">직위</th> | |
| 3389 | + <td> | |
| 3390 | + <label for="office" class="label"></label> | |
| 3391 | + <input type="text" id="office" name="office" value="<c:out value='${mjonCandidateVO.office}'/>" placeholder="직위 입력" onfocus="this.placeholder=''" onblur="this.placeholder='직위 입력'" class="inputLight"> | |
| 3392 | + </td> | |
| 3393 | + </tr> --%> | |
| 3394 | + <tr> | |
| 3395 | + <th scope="row">휴대폰</th> | |
| 3396 | + <td> | |
| 3397 | + <label for="phoneNo" class="label"></label> | |
| 3398 | + <input type="text" id="phoneNo" name="phoneNo" value="<c:out value='${mjonCandidateVO.phoneNo}'/>" placeholder="‘-’ 없이 숫자만 입력" onfocus="this.placeholder=''" onblur="this.placeholder='‘-’ 없이 숫자만 입력'" class="inputLight"> | |
| 3399 | + </td> | |
| 3400 | + </tr> | |
| 3401 | + <tr class="emailWrap3"> | |
| 3402 | + <th scope="row">이메일</th> | |
| 3403 | + <td> | |
| 3404 | + <label for="email" class="label"></label> | |
| 3405 | + <input type="text" id="email" name="email" value="<c:out value='${mjonCandidateVO.email}'/>"> | |
| 3406 | + <span>@</span> | |
| 3407 | + <label for="emailDomain" class="label"></label> | |
| 3408 | + <input type="text" id="emailDomain" name="emailDomain" value="<c:out value='${mjonCandidateVO.emailDomain}'/>"> | |
| 3409 | + <label for="" class="label">이메일 선택</label> | |
| 3410 | + <select class="list_selType1" id="taxEmailSelect" onchange="emailChange(this)"> | |
| 3411 | + <c:forEach var="result" items="${emailCode}" varStatus="status"> | |
| 3412 | + <c:if test="${status.index eq 0 }"> | |
| 3413 | + <option value="1">${result.codeNm}</option> | |
| 3414 | + </c:if> | |
| 3415 | + <c:if test="${status.index ne 0 }"> | |
| 3416 | + <option value="${result.codeDc}">${result.codeNm}</option> | |
| 3417 | + </c:if> | |
| 3418 | + </c:forEach> | |
| 3419 | + </select> | |
| 3420 | + </td> | |
| 3421 | + </tr> | |
| 3422 | + </tbody> | |
| 3423 | + </table> | |
| 3424 | + </div> | |
| 3425 | + <div class="popup_btn_wrap2"> | |
| 3426 | + <c:choose> | |
| 3427 | + <c:when test="${not empty mjonCandidateVO.candidateNm}"> | |
| 3428 | + <button type="button" onclick="javascript:fnCandidateUpt('Upt'); return false;">수정</button> | |
| 3429 | + <%-- <button type="button" onclick="javascript:fnCandidateDel(); return false;">삭제</button> --%> | |
| 3430 | + </c:when> | |
| 3431 | + <c:otherwise> | |
| 3432 | + <button type="button" onclick="javascript:fnCandidateUpt('Reg'); return false;">등록</button> | |
| 3433 | + </c:otherwise> | |
| 3434 | + </c:choose> | |
| 3435 | + <button type="button" class="tooltip-close" data-focus="candidate_popup01-close" data-focus-next="candidate_popup01">닫기</button> | |
| 3436 | + </div> | |
| 3437 | + </div> | |
| 3438 | + | |
| 3439 | + <!-- Workaround to avoid corrupted XHR2 request body in IE10 / IE11 --> | |
| 3440 | + <input type="hidden" name="_dontcare"> | |
| 3441 | + </form> | |
| 3442 | + </div> | |
| 3443 | + </div><!--// 후보자등록 팝업 --> | |
| 3444 | + | |
| 3445 | + <div class="tooltip-wrap"> | |
| 3446 | + <div class="popup-com history_layer popup03" tabindex="0" data-tooltip-con="popup03" data-focus="popup03" data-focus-prev="popup03-close"> | |
| 3447 | + <div class="popup_heading"> | |
| 3448 | + <p><span>전송내역</p> | |
| 3449 | + <button type="button" class="tooltip-close" data-focus="popup03-close" id="btnLatestAddPhoneClose"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3450 | + </div> | |
| 3451 | + <div class="layer_in"> | |
| 3452 | + <!-- tab button --> | |
| 3453 | + <ul class="tabType6"> | |
| 3454 | + <li class="tab active"><button type="button" onclick="TabType(this,'1');">최근 전송내역</button></li> | |
| 3455 | + <li class="tab"><button type="button" onclick="TabType(this,'2');">자주보내는 번호</button></li> | |
| 3456 | + </ul><!--// tab button --> | |
| 3457 | + <!-- 최근 전송내역 --> | |
| 3458 | + <div class="history_cont hascont current"> | |
| 3459 | + <div class="histroy_trans latestMsgArea" id="latestMsgArea"> | |
| 3460 | + <ul id="latestMsgUl"> | |
| 3461 | + <c:choose> | |
| 3462 | + <c:when test="${not empty resultLatestMsgList}"> | |
| 3463 | + <c:forEach var="latestMsgList" items="${resultLatestMsgList}" varStatus="status"> | |
| 3464 | + <li id="latestLi"> | |
| 3465 | + <input type="checkbox" id="addrChk_${status.count}" name="latAddrChk" value="<c:out value='${latestMsgList.callTo}'/>"> | |
| 3466 | + <label for="addrChk_${status.count}" class="label">최근 전송내역</label> | |
| 3467 | + <p><c:out value="${latestMsgList.callTo}"/></p> | |
| 3468 | + <button type="button" id="latestAddrDel"><img src="/publish/images/popup/close3.png" alt="전화번호 삭제"></button> | |
| 3469 | + </li> | |
| 3470 | + </c:forEach> | |
| 3471 | + </c:when> | |
| 3472 | + <c:otherwise> | |
| 3473 | + <li> | |
| 3474 | + <p>최근 발송 내역이 없습니다.</p> | |
| 3475 | + </li> | |
| 3476 | + </c:otherwise> | |
| 3477 | + </c:choose> | |
| 3478 | + </ul> | |
| 3479 | + </div> | |
| 3480 | + <div class="popup_btn_wrap2 hisroy_btn" style="width: 230px;"> | |
| 3481 | + <button type="button" id="latestAddPhoneAll">전체추가</button> | |
| 3482 | + <button type="button" id="latestAddPhone">선택추가</button> | |
| 3483 | + <button type="button" id="latestCancelPhone">선택취소</button> | |
| 3484 | + </div> | |
| 3485 | + </div><!--// 최근 전송내역 --> | |
| 3486 | + <!-- 자주보내는 번호 --> | |
| 3487 | + <div class="history_cont hascont"> | |
| 3488 | + <div class="histroy_trans" id="bookMarkMsgArea"> | |
| 3489 | + <ul id="bookMsgUl"> | |
| 3490 | + <c:choose> | |
| 3491 | + <c:when test="${not empty resultBookMarkMsgList}"> | |
| 3492 | + <c:forEach var="bookMarkMsgList" items="${resultBookMarkMsgList}" varStatus="status"> | |
| 3493 | + <li id="bookMarkLi"> | |
| 3494 | + <input type="checkbox" id="bokAddrChk_${status.count}" name="bookAddrChk" value="<c:out value='${bookMarkMsgList.addrPhoneNo}'/>"> | |
| 3495 | + <label for="addrChk_${status.count}" class="label">최근 전송내역</label> | |
| 3496 | + <p><c:out value="${bookMarkMsgList.addrPhoneNo}"/></p> | |
| 3497 | + <button type="button" id="bookMarkAddrDel"><img src="/publish/images/popup/close3.png" alt="전화번호 삭제"></button> | |
| 3498 | + </li> | |
| 3499 | + </c:forEach> | |
| 3500 | + </c:when> | |
| 3501 | + <c:otherwise> | |
| 3502 | + <li> | |
| 3503 | + <p>등록된 자주 보내는 번호 내역이 없습니다.</p> | |
| 3504 | + </li> | |
| 3505 | + </c:otherwise> | |
| 3506 | + </c:choose> | |
| 3507 | + </ul> | |
| 3508 | + </div> | |
| 3509 | + <div class="popup_btn_wrap2 hisroy_btn" style="width: 230px;"> | |
| 3510 | + <button type="button" id="bookMarkAddPhoneAll">전체추가</button> | |
| 3511 | + <button type="button" id="bookMarkAddPhone">선택추가</button> | |
| 3512 | + <button type="button" id="bookMarkCancelPhone">선택취소</button> | |
| 3513 | + </div> | |
| 3514 | + </div><!--// 자주보내는 번호 --> | |
| 3515 | + </div> | |
| 3516 | + </div> | |
| 3517 | + </div><!--// 전송내역 팝업 --> | |
| 3518 | + <!-- 엑셀 불러오기 --> | |
| 3519 | + <form id="excelForm" name="excelForm" method="post"> | |
| 3520 | + <div class="tooltip-wrap"> | |
| 3521 | + <div class="popup-com import_layer popup02" tabindex="0" data-tooltip-con="popup02" data-focus="popup02" data-focus-prev="popup02-close"> | |
| 3522 | + <div class="popup_heading"> | |
| 3523 | + <p><span>엑셀</span> 불러오기</p> | |
| 3524 | + <button type="button" class="tooltip-close" data-focus="popup02-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3525 | + </div> | |
| 3526 | + <div class="layer_in"> | |
| 3527 | + <!-- 엑셀파일 불러오기 --> | |
| 3528 | + <div class="hascont"> | |
| 3529 | + <div class="titBox"> | |
| 3530 | + <p>- 최대 2만 건까지 등록할 수 있습니다.</p> | |
| 3531 | + <p>- [엑셀 불러오기]시 문서의 A, B, C, D열을 불러옵니다.(지원하는 파일 형식 : xls, xlsx)</p> | |
| 3532 | + <p>- 이름 : 20byte, [*1*]~[*4*] : 40byte까지 입력 가능합니다.</p> | |
| 3533 | + <p>- 휴대폰 항목은 숫자, 하이픈(-)만 인식하며, 번호 앞에 0이 생략되어도 정상 등록됩니다. | |
| 3534 | + </p> | |
| 3535 | + <%-- <button type="button" class="excel_btn" onclick="location.href='/cmm/fms/FileDown.do?atchFileId=FILE_000000000011651&fileSn=1'"><i></i>샘플파일 다운로드</button> --%> | |
| 3536 | + <button type="button" class="excel_btn" onclick="location.href='/download/msg/엑셀주소록_등록양식.xlsx'"><i class="downroad"></i>샘플파일 다운로드</button> | |
| 3537 | + </div> | |
| 3538 | + <div class="attachedFile"> | |
| 3539 | + <label for="" class="attachedFile_label">첨부파일</label> | |
| 3540 | + <input type="text" id="excelNm" readonly> | |
| 3541 | + <input type="file" id="excelFile" accept=".xls, .xlsx" onchange="excelExport(event); return false;" style="display:none"/> | |
| 3542 | + <button type="button" class="btnType btnType6 c3">찾아보기</button> | |
| 3543 | + <p><span class="vMiddle">*</span> 첨부된 파일은 <span class="c_e40000">[추가]버튼을 클릭</span>하셔야 받는 사람에 등록됩니다.</p> | |
| 3544 | + </div> | |
| 3545 | + </div><!--// 엑셀파일 불러오기 --> | |
| 3546 | + <div class="popup_btn_wrap2"> | |
| 3547 | + <button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02" id="excelAdd">추가</button> | |
| 3548 | + <button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02">닫기</button> | |
| 3549 | + </div> | |
| 3550 | + </div> | |
| 3551 | + </div> | |
| 3552 | + </div><!--// 엑셀 불러오기 --> | |
| 3553 | + </form> | |
| 3554 | + <!-- 주소록 불러오기 --> | |
| 3555 | + <div class="tooltip-wrap"> | |
| 3556 | + <div class="popup-com import_layer popup06" tabindex="0" data-tooltip-con="popup06" data-focus="popup06" data-focus-prev="popup06-close" style="width: 260px"> | |
| 3557 | + <div class="popup_heading"> | |
| 3558 | + <p><span>주소록 불러오기</p> | |
| 3559 | + <button type="button" onClick="javascript:addrClose(); return false;"> | |
| 3560 | + <img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3561 | + </div> | |
| 3562 | + <div class="layer_in"> | |
| 3563 | + <!-- <div class="titBox titBox_pad"> | |
| 3564 | + <p>- 주소록 수정 및 변경은 <span>[주소록 관리]</span>에서만 가능합니다.</p> | |
| 3565 | + <button type="button" class="adr_admin" onClick="location.href='/web/mjon/addr/selectAddrList.do'">주소록 관리</button> | |
| 3566 | + </div> --> | |
| 3567 | + <div class="adr_wrap"> | |
| 3568 | + <form id="searchAddrGrpForm" name="searchAddrGrpForm" method="post" style="display: flex; justify-content: space-between;"> | |
| 3569 | + <input type="hidden" id="searchAddrGrpId" name="searchAddrGrpId" value=""/> | |
| 3570 | + <input type="hidden" id="type" name="type" value="all"/> | |
| 3571 | + <input type="hidden" id="searchKeyword" name="searchKeyword" value=""/> | |
| 3572 | + <input type="hidden" name="searchCondition" id="searchCondition" value="0" /> | |
| 3573 | + <div class="adr_pop_left"> | |
| 3574 | + <div class="adr_left_search"> | |
| 3575 | + <label for="searchGrpKeyword" class="label">그룹명 검색</label> | |
| 3576 | + <input type="text" name="searchGrpKeyword" id="searchGrpKeyword" placeholder="그룹명 검색" onfocus="this.placeholder=''" onblur="this.placeholder='그룹명 검색'" class="inputLight"> | |
| 3577 | + <button type="button" onClick="javascrit:fnAddrGrpSearch(); return false;"><img src="/publish/images/popup/search.png" alt="검색"></button> | |
| 3578 | + </div> | |
| 3579 | + <div class="adr_pop_box"> | |
| 3580 | + <div id="addrGroupLoad"> | |
| 3581 | + </div> | |
| 3582 | + </div> | |
| 3583 | + <div class="popup_btn"> | |
| 3584 | + <button type="button" class="btnType" onClick="javascript:fnSelectAddrGrpList(); return false;">선택 그룹 추가</button> | |
| 3585 | + </div> | |
| 3586 | + </div> | |
| 3587 | + <!-- <div class="adr_pop_right"> | |
| 3588 | + <div class="clearfix"> | |
| 3589 | + <div class="btnWrap_last"> | |
| 3590 | + <label for="searchAddrCondition" class="label">카테고리 선택</label> | |
| 3591 | + <select id="searchAddrCondition" name="searchAddrCondition" class="selType2"> | |
| 3592 | + <option value='0'>전체</option> | |
| 3593 | + <option value='1'>그룹명</option> | |
| 3594 | + <option value='2'>이름</option> | |
| 3595 | + <option value='3'>핸드폰번호</option> | |
| 3596 | + </select> | |
| 3597 | + <label for="searchAddrKeyword" class="label">검색어 입력</label> | |
| 3598 | + <input type="text" id="searchAddrKeyword" name="searchAddrKeyword" placeholder="검색어를 입력하세요" onfocus="this.placeholder=''" onblur="this.placeholder='검색어를 입력하세요'" > | |
| 3599 | + <button type="button" class="btnType btnType17" onClick="javascrit:fnAddrSearch(); return false;">검색</button> | |
| 3600 | + </div> | |
| 3601 | + table | |
| 3602 | + <div class="adr_excel adr_pop_list2 callAddr_box"> | |
| 3603 | + </div> | |
| 3604 | + // table | |
| 3605 | + </div> | |
| 3606 | + <div class="popup_btn_wrap2"> | |
| 3607 | + <button type="button" onClick="javascript:addrToList(); return false;">추가</button> | |
| 3608 | + <button type="button" onClick="javascript:addrClose(); return false;">닫기</button> | |
| 3609 | + </div> | |
| 3610 | + 주소록 레이어 팝업 닫기 실행 코드 | |
| 3611 | + </div> --> | |
| 3612 | + | |
| 3613 | + <input type="hidden" name="btnAddrClose" id="btnAddrClose" class="tooltip-close closeAddr" data-focus="popup06-close" /> | |
| 3614 | + </form> | |
| 3615 | + </div> | |
| 3616 | + </div> | |
| 3617 | + </div> | |
| 3618 | + </div><!--// 주소록 불러오기 --> | |
| 3619 | + <!-- 주소록에 등록 data-tooltip:duplication_layer --> | |
| 3620 | + <div class="tooltip-wrap"> | |
| 3621 | + <div class="popup-com addressregi_layer" tabindex="0" data-tooltip-con="addressregi_layer" data-focus="addressregi_layer" data-focus-prev="addressregi_layer-close" style="width: 680px;"> | |
| 3622 | + <div class="popup_heading"> | |
| 3623 | + <p>주소록에 등록</p> | |
| 3624 | + <button type="button" class="tooltip-close" data-focus="addressregi_layer-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3625 | + </div> | |
| 3626 | + <div class="layer_in" style="padding: 30px 20px;"> | |
| 3627 | + <table class="layer_tType1"> | |
| 3628 | + <caption>주소록 그룹선택 표</caption> | |
| 3629 | + <colgroup> | |
| 3630 | + <col style="width: 95px"> | |
| 3631 | + <col style="width: auto"> | |
| 3632 | + </colgroup> | |
| 3633 | + <tbody> | |
| 3634 | + <tr> | |
| 3635 | + <th>그룹 선택</th> | |
| 3636 | + <td> | |
| 3637 | + <label for="" class="label">그룹 선택</label> | |
| 3638 | + <select id="addrGrpIdInfo" name="addrGrpIdInfo"> | |
| 3639 | + </select> | |
| 3640 | + <label for="" class="label">그룹명 입력</label> | |
| 3641 | + <input type="text" id="addrGrpNm" name="addrGrpNm" placeholder="새 그룹명을 입력해주세요." onfocus="this.placeholder=''" onblur="this.placeholder='새 그룹명을 입력해주세요.'"class="inputLight" style="width: 300px;"> | |
| 3642 | + <input type="file" id="excelFile" accept=".xls, .xlsx, .txt" onchange="excelExport(event); return false;" style="display:none"/> | |
| 3643 | + </td> | |
| 3644 | + </tr> | |
| 3645 | + </tbody> | |
| 3646 | + </table> | |
| 3647 | + <div class="popup_btn_wrap2"> | |
| 3648 | + <button type="button" class="registAddr">등록</button> | |
| 3649 | + <button type="button" class="tooltip-close" data-focus="addressregi_layer-close" data-focus-next="addressregi_layer">닫기</button> | |
| 3650 | + </div> | |
| 3651 | + </div> | |
| 3652 | + </div> | |
| 3653 | + </div> | |
| 3654 | + <!--// 주소록에 등록 팝업 --> | |
| 3655 | + | |
| 3656 | + <!--선거문자 이용안내 팝업 --> | |
| 3657 | + <div class="tooltip-wrap"> | |
| 3658 | + <div class="popup-com ad_layer candidate_popup03" tabindex="0" data-tooltip-con="candidate_popup03" data-focus="candidate_popup03" data-focus-prev="candidate_popup03-close" style="width: 795px"> | |
| 3659 | + <div class="popup_heading"> | |
| 3660 | + <p>선거문자 안내</p> | |
| 3661 | + <button type="button" class="tooltip-close" data-focus="candidate_popup03-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3662 | + </div> | |
| 3663 | + <div class="layer_in"> | |
| 3664 | + <img src="/publish/images/content/candidatePop_banner.png" alt="선거문자 이용안내 배너" class="candidate_banner"> | |
| 3665 | + <ul class="info_list"> | |
| 3666 | + <li>- 90byte 초과 시, 자동으로 장문으로 전환됩니다. 장문 문자는 최대 2,000byte까지만 작성할 수 있습니다.</li> | |
| 3667 | + <li>- 그림문자 1건당 최대 3장까지 이미지 첨부 가능 [권장 사이즈 : <strong>640 x 960</strong>픽셀 / 최대용량 : <strong>10MB</strong> 이내]</li> | |
| 3668 | + <li>- 선거문자는 반드시 발송규정을 사전 확인 후 발송해 주시기 바랍니다.</li> | |
| 3669 | + </ul> | |
| 3670 | + <!-- 이용방법/혜택 --> | |
| 3671 | + <div class="cdpop_cont current" id="listTab2_1"> | |
| 3672 | + <div> | |
| 3673 | + <p class="cdpop_title"> | |
| 3674 | + <i class="cdpop_title_icon1"></i>선거문자 이용방법 | |
| 3675 | + <span class="customReq"> | |
| 3676 | + <button type="button" onclick="goToCustom();"><i></i>선거문자 맞춤제작</button> | |
| 3677 | + </span> | |
| 3678 | + </p> | |
| 3679 | + <ul class="cdpop_info"> | |
| 3680 | + <li> | |
| 3681 | + <i class="info_step1"></i> | |
| 3682 | + <div> | |
| 3683 | + <p>회원가입</p> | |
| 3684 | + </div> | |
| 3685 | + </li> | |
| 3686 | + <li> | |
| 3687 | + <i class="info_step2"></i> | |
| 3688 | + <div> | |
| 3689 | + <p>후보자등록</p> | |
| 3690 | + </div> | |
| 3691 | + </li> | |
| 3692 | + <li> | |
| 3693 | + <i class="info_step3"></i> | |
| 3694 | + <div> | |
| 3695 | + <p>전용계좌</p> | |
| 3696 | + </div> | |
| 3697 | + </li> | |
| 3698 | + <li> | |
| 3699 | + <i class="info_step4"></i> | |
| 3700 | + <div> | |
| 3701 | + <p>발신번호 인증</p> | |
| 3702 | + </div> | |
| 3703 | + </li> | |
| 3704 | + <li> | |
| 3705 | + <i class="info_step5"></i> | |
| 3706 | + <div> | |
| 3707 | + <p>문자전송</p> | |
| 3708 | + </div> | |
| 3709 | + </li> | |
| 3710 | + <li> | |
| 3711 | + <i class="info_step6"></i> | |
| 3712 | + <div> | |
| 3713 | + <p>세금계산서</p> | |
| 3714 | + </div> | |
| 3715 | + </li> | |
| 3716 | + </ul> | |
| 3717 | + </div> | |
| 3718 | + <div> | |
| 3719 | + <p class="cdpop_title"><i class="cdpop_title_icon2"></i>문자온 선거문자만의 장점 및 혜택</p> | |
| 3720 | + <ul class="cdpop_benefit"> | |
| 3721 | + <li> | |
| 3722 | + <div> | |
| 3723 | + <i class="benefit1"></i> | |
| 3724 | + <p>한 번에 대량으로 보내야 한다면?<span>10만건까지 동시 전송 가능</span></p> | |
| 3725 | + </div> | |
| 3726 | + <p>문자온의 대량전송(엑셀·TXT) 모듈을 통해 | |
| 3727 | + 10만건의 대량문자도 쉽고 빠르게 전송 가능합니다.</p> | |
| 3728 | + </li> | |
| 3729 | + <li> | |
| 3730 | + <div> | |
| 3731 | + <i class="benefit2"></i> | |
| 3732 | + <p>수신거부 번호가 필요하세요?<span>080 수신거부 번호 무료제공</span></p> | |
| 3733 | + </div> | |
| 3734 | + <p>선거문자 발송규정 준수를 위해 | |
| 3735 | + 080 수신거부 번호를 무료로 제공해 드립니다.</p> | |
| 3736 | + </li> | |
| 3737 | + <li> | |
| 3738 | + <div> | |
| 3739 | + <i class="benefit3"></i> | |
| 3740 | + <p>주소록 등록이 번거로우신가요?<span>주소록 등록 무료대행</span></p> | |
| 3741 | + </div> | |
| 3742 | + <p>주소록 등록파일(엑셀·TXT)을 문자온에 제공해 | |
| 3743 | + 주시면 무료로 빠르고 신속하게 등록해 드립니다.</p> | |
| 3744 | + </li> | |
| 3745 | + <li> | |
| 3746 | + <div> | |
| 3747 | + <i class="benefit4"></i> | |
| 3748 | + <p>홍보효과를 높이고 싶다면?<span>후보자만의 그림문자 맞춤제작</span></p> | |
| 3749 | + </div> | |
| 3750 | + <p>선거공약, 인사말, 후보자 사진 등을 넣어 그림문자를 | |
| 3751 | + 맞춤 제작하여 홍보효과를 극대화할 수 있습니다.</p> | |
| 3752 | + </li> | |
| 3753 | + <li> | |
| 3754 | + <div> | |
| 3755 | + <i class="benefit5"></i> | |
| 3756 | + <p>오류·실패건의 문자를 보상받고 싶다면?<span>오류·실패건 문자 100% 환불</span></p> | |
| 3757 | + </div> | |
| 3758 | + <p>번호오류, 수신거부, 수신실패 등으로 인해 문자전송이 | |
| 3759 | + 실패한 경우 100% 환불(자동충전)해 드립니다.</p> | |
| 3760 | + </li> | |
| 3761 | + <li> | |
| 3762 | + <div> | |
| 3763 | + <i class="benefit6 "></i> | |
| 3764 | + <p>전송결과가 궁금하다면?<span>실시간 전송결과 확인 가능</span></p> | |
| 3765 | + </div> | |
| 3766 | + <p>전송결과 및 실패사유를 실시간으로 제공해드립니다.</p> | |
| 3767 | + </li> | |
| 3768 | + <li> | |
| 3769 | + <div> | |
| 3770 | + <i class="benefit7"></i> | |
| 3771 | + <p>20건씩 나눠서 보내야한다면?<span>20건씩 분할 예약 전송 가능</span></p> | |
| 3772 | + </div> | |
| 3773 | + <p>누구나 쉽고 편리하게 20건씩 나눠서 분할 전송이 가능합니다.</p> | |
| 3774 | + </li> | |
| 3775 | + <li> | |
| 3776 | + <div> | |
| 3777 | + <i class="benefit8"></i> | |
| 3778 | + <p>필요한 서류가 있다면?<span>문자온에서 간편하게 신청 가능</span></p> | |
| 3779 | + </div> | |
| 3780 | + <p>문자온에서 발송내역서 출력이 가능하며, | |
| 3781 | + 세금계산서는 메일로 자동으로 발행됩니다.</p> | |
| 3782 | + </li> | |
| 3783 | + </ul> | |
| 3784 | + </div> | |
| 3785 | + </div><!--// 이용방법/혜택 --> | |
| 3786 | + </div> | |
| 3787 | + <div class="popup_btn_wrap2" style="margin: 0 auto 30px auto;"> | |
| 3788 | + <button type="button" class="tooltip-close" data-focus="candidate_popup03-close" data-focus-next="candidate_popup03">닫기</button> | |
| 3789 | + </div> | |
| 3790 | + </div> | |
| 3791 | + </div><!--// 선거문자 이용안내 팝업 --> | |
| 3792 | + | |
| 3793 | + <!-- 이벤트 잔여 캐시 정보 표시 팝업 --> | |
| 3794 | + <div class="tooltip-wrap"> | |
| 3795 | + <div class="popup-com event_cash_popup popup07" tabindex="0" data-tooltip-con="popup07" data-focus="popup07" data-focus-prev="popup07-close"> | |
| 3796 | + <div class="popup_heading"> | |
| 3797 | + <p>이벤트 잔액</p> | |
| 3798 | + <button type="button" class="tooltip-close" data-focus="popup07-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 3799 | + </div> | |
| 3800 | + <div class="layer_in"> | |
| 3801 | + <div class="table_wrap"> | |
| 3802 | + <div class="table_top"> | |
| 3803 | + <p class="popup_title_18">첫 결제 이벤트 잔액(캐시)</p> | |
| 3804 | + <p><span class="c_e40000 fwBold"><fmt:formatNumber value="${eventRemainCash}" pattern="#,###.#"/></span>원</p> | |
| 3805 | + </div> | |
| 3806 | + <table class="popup_table_type2"> | |
| 3807 | + <colgroup> | |
| 3808 | + <col style="width: 25%;"> | |
| 3809 | + <col style="width: auto;"> | |
| 3810 | + </colgroup> | |
| 3811 | + <tbody> | |
| 3812 | + <tr> | |
| 3813 | + <th>단문(<fmt:formatNumber value="${eventMberInfo.eventShortPrice}" pattern="#,###.#"/>)</th> | |
| 3814 | + <td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventShortPrice) - ((eventRemainCash / eventMberInfo.eventShortPrice) % 1) }" pattern="#,###"/></span>건</td> | |
| 3815 | + </tr> | |
| 3816 | + <tr> | |
| 3817 | + <th>장문(<fmt:formatNumber value="${eventMberInfo.eventLongPrice}" pattern="#,###.#"/>)</th> | |
| 3818 | + <td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventLongPrice) - ((eventRemainCash / eventMberInfo.eventLongPrice) % 1)}" pattern="#,###"/></span>건</td> | |
| 3819 | + </tr> | |
| 3820 | + <tr> | |
| 3821 | + <th>그림 1장(<fmt:formatNumber value="${eventMberInfo.eventPicturePrice}" pattern="#,###.#"/>)</th> | |
| 3822 | + <td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventPicturePrice) - ((eventRemainCash / eventMberInfo.eventPicturePrice) % 1)}" pattern="#,###"/></span>건</td> | |
| 3823 | + </tr> | |
| 3824 | + <tr> | |
| 3825 | + <th>그림 2장(<fmt:formatNumber value="${eventMberInfo.eventPicture2Price}" pattern="#,###.#"/>)</th> | |
| 3826 | + <td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventPicture2Price) - ((eventRemainCash / eventMberInfo.eventPicture2Price) % 1)}" pattern="#,###"/></span>건</td> | |
| 3827 | + </tr> | |
| 3828 | + <tr> | |
| 3829 | + <th>그림 3장(<fmt:formatNumber value="${eventMberInfo.eventPicture3Price}" pattern="#,###.#"/>)</th> | |
| 3830 | + <td><span class="c_002c9a fwBold"><fmt:formatNumber value="${(eventRemainCash / eventMberInfo.eventPicture3Price) - ((eventRemainCash / eventMberInfo.eventPicture3Price) % 1)}" pattern="#,###"/></span>건</td> | |
| 3831 | + </tr> | |
| 3832 | + </tbody> | |
| 3833 | + </table> | |
| 3834 | + </div> | |
| 3835 | + <div class="popup_btn_wrap2"> | |
| 3836 | + <button type="button" class="tooltip-close" data-focus="popup07-close" data-focus-next="popup07">닫기</button> | |
| 3837 | + </div> | |
| 3838 | + </div> | |
| 3839 | + </div> | |
| 3840 | + </div> | |
| 3841 | + | |
| 3842 | + <form id="msgForm" name="msgForm" method="post"> | |
| 3843 | + <input type="hidden" id="msgType" name="msgType" value="4" /><!-- 문자 종류 : 단문 - 4, 장문/그림 - 6 --> | |
| 3844 | + <input type="hidden" id="imgFilePath" name="imgFilePath" value="" /><!-- 선택 이미지 파일 경로 정보 , 로 구분 최대 3장까지 --> | |
| 3845 | + <input type="hidden" id="imgFileId" name="imgFileId" value="" /><!-- 선택 이미지 파일 아이디 정보 , 로 구분 최대 3장까지 --> | |
| 3846 | + <input type="hidden" id="fileCnt" name="fileCnt" value="0" /><!-- 첨부파일 추가 갯수 --> | |
| 3847 | + <input type="hidden" id="callToList" name="callToList" value=""/><!-- 수신자 전화번호 리스트 --> | |
| 3848 | + <input type="hidden" id="callFrom" name="callFrom" value=""/> <!-- 발신자 전화번호 --> | |
| 3849 | + <input type="hidden" id="eachPrice" name="eachPrice" value="0"/> <!-- 문자 개별 단가 금액 --> | |
| 3850 | + <input type="hidden" id="totPrice" name="totPrice" value="0"/> <!-- 총 결제 금액 --> | |
| 3851 | + <input type="hidden" id="smsLen" name="smsLen" value="0"/> <!-- 문자 길이 정보 --> | |
| 3852 | + <input type="hidden" id="reserveYn" name="reserveYn" value="N"/> <!-- 즉시/예약 선택여부 --> | |
| 3853 | + <input type="hidden" id="reqDate" name="reqDate" value=""/> <!-- 예약문자 날짜 --> | |
| 3854 | + <input type="hidden" id="imgCnt" value="0" /> | |
| 3855 | + <input type="hidden" id="smsTxt" name="smsTxt" value=""/><!-- 문자발송 문자 내용 --> | |
| 3856 | + <input type="hidden" id="nameList" name="nameList" value=""/><!-- 문자발송 문자 이름 리스트 --> | |
| 3857 | + <input type="hidden" id="rep1List" name="rep1List" value=""/><!-- 문자발송 문자 치환1 리스트 --> | |
| 3858 | + <input type="hidden" id="rep2List" name="rep2List" value=""/><!-- 문자발송 문자 치환2 리스트 --> | |
| 3859 | + <input type="hidden" id="rep3List" name="rep3List" value=""/><!-- 문자발송 문자 치환3 리스트 --> | |
| 3860 | + <input type="hidden" id="rep4List" name="rep4List" value=""/><!-- 문자발송 문자 치환4 리스트 --> | |
| 3861 | + <input type="hidden" name="templateYn" /> | |
| 3862 | + <input type="hidden" id="sPrice" name="sPrice" value="<c:out value="${shortPrice}"/>"/><!-- 단문문자 단가 --> | |
| 3863 | + <input type="hidden" id="mPrice" name="mPrice" value="<c:out value="${longPrice}"/>"/><!-- 장문문자 단가 --> | |
| 3864 | + <input type="hidden" id="pPrice" name="pPrice" value="<c:out value="${picturePrice}"/>"/><!-- 그림문자 단가 --> | |
| 3865 | + <input type="hidden" id="p2Price" name="p2Price" value="<c:out value="${picture2Price}"/>"/><!-- 그림2장문자 단가 --> | |
| 3866 | + <input type="hidden" id="p3Price" name="p3Price" value="<c:out value="${picture3Price}"/>"/><!-- 그림3장문자 단가 --> | |
| 3867 | + <input type="hidden" id="myPrice" name="myPrice" value="<c:out value="${userMoney}"/>"/> | |
| 3868 | + <input name="msgKind" type="hidden" value="C"/><!-- 문자종류 일반:N , 광고:A , 선거:C --> | |
| 3869 | + <input type="hidden" id="txtReplYn" name="txtReplYn" value="N"/><!-- 변환문자 유무 --> | |
| 3870 | + <input type="hidden" id="shortMsgCnt" name="shortMsgCnt" value="0"/><!-- 단문 변환문자 건수 --> | |
| 3871 | + <input type="hidden" id="longMsgCnt" name="longMsgCnt" value="0"/><!-- 장문 변환문자 건수 --> | |
| 3872 | + | |
| 3873 | + <!-- 주소록 등록 --> | |
| 3874 | + <input type="hidden" id="addrGrpId" name="addrGrpId" value=""/> | |
| 3875 | + <input type="hidden" id="addrGrpNm" name="addrGrpNm" value=""/> | |
| 3876 | + | |
| 3877 | + <!-- 이벤트 관련 변수 --> | |
| 3878 | + <input type="hidden" id="eventStatus" name="eventStatus" value="<c:out value='${eventMberInfo.eventStatus}'/>"/> | |
| 3879 | + <input type="hidden" id="eventRemainCash" name="eventRemainCash" value="<c:out value='${eventRemainCash}'/>"/> | |
| 3880 | + <input type="hidden" id="eventYn" name="eventYn" value="N"/> | |
| 3881 | + | |
| 3882 | + <!-- 스팸문자 관련 변수 --> | |
| 3883 | + <input type="hidden" id="spamKeyword" name="spamKeyword"/> | |
| 3884 | + <input type="hidden" id="spamStatus" name="spamStatus"/> | |
| 3885 | + <input type="hidden" id="exceptSpamYn" name="exceptSpamYn" value="<c:out value='${exceptSpamYn}'/>"/> | |
| 3886 | + | |
| 3887 | + <!-- 이벤트 캐시 부족시 일반캐시로 계산을 위해 저장, 우영두 2023.03.28 --> | |
| 3888 | + <input type="hidden" id="norsPrice" name="norsPrice" value="<c:out value="${norShortPrice}"/>"/><!-- 단문문자 단가(이벤트 단가 제외) --> | |
| 3889 | + <input type="hidden" id="normPrice" name="normPrice" value="<c:out value="${norLongPrice}"/>"/><!-- 장문문자 단가(이벤트 단가 제외) --> | |
| 3890 | + <input type="hidden" id="norpPrice" name="norpPrice" value="<c:out value="${norPicturePrice}"/>"/><!-- 그림문자 단가(이벤트 단가 제외) --> | |
| 3891 | + <input type="hidden" id="norp2Price" name="norp2Price" value="<c:out value="${norPicture2Price}"/>"/><!-- 그림2장문자 단가(이벤트 단가 제외) --> | |
| 3892 | + <input type="hidden" id="norp3Price" name="norp3Price" value="<c:out value="${norPicture3Price}"/>"/><!-- 그림3장문자 단가(이벤트 단가 제외) --> | |
| 3893 | + <input type="hidden" id="evnPhoneNumCnt" name="evnPhoneNumCnt" value="0"/><!-- 치환 이벤트 발송 수신자 갯수 --> | |
| 3894 | + <input type="hidden" id="evnShortMsgCnt" name="evnShortMsgCnt" value="0"/><!-- 치환 이벤트 단문 건수 --> | |
| 3895 | + <input type="hidden" id="evnLongMsgCnt" name="evnLongMsgCnt" value="0"/><!-- 치환 이벤트 장문 건수 --> | |
| 3896 | + | |
| 3897 | + <input type="hidden" id="divideChk" name="divideChk" value="N"> | |
| 3898 | + | |
| 3899 | + <!-- <div class="top_content current" id="tab1_1"> --> | |
| 3900 | + <div class="heading"> | |
| 3901 | + <h2>선거 문자전송</h2> | |
| 3902 | + <div class="election_btnWrap"> | |
| 3903 | + <button type="button" class="button2 info" onclick="infoPop('selectMsgDataView2');">발송규정</button> | |
| 3904 | + <button type="button" class="button2 info" data-tooltip="candidate_popup03">사용안내</button> | |
| 3905 | + <c:choose> | |
| 3906 | + <c:when test="${empty LoginVO}"> | |
| 3907 | + <button type="button" class="btnType" onclick="javascript:fn_candidateLoginChk(); return false;"><i class="election_btn1"></i>후보자 등록</button> | |
| 3908 | + </c:when> | |
| 3909 | + <c:when test="${not empty mberManageVO && mberManageVO.dept eq 'c'}"> | |
| 3910 | + <button type="button" class="btnType" onclick="javascript:fn_mberDeptChk(); return false;"><i class="election_btn1"></i>후보자 등록</button> | |
| 3911 | + </c:when> | |
| 3912 | + <c:otherwise> | |
| 3913 | + <button type="button" class="btnType" data-tooltip="candidate_popup01"><i class="election_btn1"></i>후보자 등록</button> | |
| 3914 | + </c:otherwise> | |
| 3915 | + </c:choose> | |
| 3916 | + <button type="button" class="btnType" onclick="location.href='/web/member/pay/BillPub.do'"><i class="election_btn2"></i>세금계산서</button> | |
| 3917 | + <button type="button" class="btnType" onclick="location.href='/web/mjon/msgsent/selectMsgSentView.do'"><i class="election_btn3"></i>발송결과 출력하기</button> | |
| 3918 | + </div> | |
| 3919 | + </div> | |
| 3920 | + <%-- <div class="titBox"> | |
| 3921 | + <p>- 90byte 초과 시, 장문으로 전환됩니다. 장문 문자는 최대 2,000byte까지 작성할 수 있습니다.</p> | |
| 3922 | + <p>- 그림문자 1건에 포토 최대 3장 첨부가능 [권장 사이즈 : <span class="c_222 fwRg">640 x 960</span>픽셀 / 최대용량 : <span class="c_222 fwRg">10MB</span>이내]</p> | |
| 3923 | + <p>- 광고성 메시지는 반드시 유의사항 확인 후 발송해 주시기 바랍니다. <span><a href="#" data-tooltip="candidate_popup02">[선거문자 관련규정 안내]</a></span></p> | |
| 3924 | + </div> --%> | |
| 3925 | + <div class="send_general"> | |
| 3926 | + <div class="send_left"> | |
| 3927 | + <%-- <dl class="myprice_view"> | |
| 3928 | + <dt>나의 요금제</dt> | |
| 3929 | + <dd> | |
| 3930 | + <ul> | |
| 3931 | + <li><span class="type">단문</span><span class="price"><c:out value="${shortPrice}"/></span>원</li> | |
| 3932 | + <li><span class="type">장문</span><span class="price"><c:out value="${longPrice}"/></span>원</li> | |
| 3933 | + <li><span class="type">그림</span><span class="price"><c:out value="${picturePrice}"/></span>원 <span class="count">(2장 : <c:out value="${picture2Price}"/>원 / 3장 : <c:out value="${picture3Price}"/>원)</span></li> | |
| 3934 | + </ul> | |
| 3935 | + </dd> | |
| 3936 | + </dl> --%> | |
| 3937 | + <table class="tType1"> | |
| 3938 | + <caption>일반 문자보내기 분류 번호 내용 등을 입력하는 표</caption> | |
| 3939 | + <colgroup> | |
| 3940 | + <col style="width: 100px;"> | |
| 3941 | + <col style="width: auto;"> | |
| 3942 | + </colgroup> | |
| 3943 | + <tbody> | |
| 3944 | + <tr> | |
| 3945 | + <th scope="row">문자분류</th> | |
| 3946 | + <td class="send_cf"> | |
| 3947 | + <input id="send_adYnY" type="radio" name="send_adYn" value="Y" checked="checked"> | |
| 3948 | + <label for="send_adYnY">선거</label> | |
| 3949 | + </td> | |
| 3950 | + </tr> | |
| 3951 | + <tr> | |
| 3952 | + <th scope="row">발신번호</th> | |
| 3953 | + <td class="put_num"> | |
| 3954 | + <label for="callFrom" class="label"></label> | |
| 3955 | + <select id="callFromList" name="callFromList" class="sel_number" onchange="setCandidatePhone();"> | |
| 3956 | + <c:choose> | |
| 3957 | + <c:when test="${not empty resultPhonList}"> | |
| 3958 | + <c:forEach var="phonList" items="${resultPhonList}" varStatus="status"> | |
| 3959 | + <option value="${phonList}">${phonList}</option> | |
| 3960 | + </c:forEach> | |
| 3961 | + </c:when> | |
| 3962 | + <c:otherwise> | |
| 3963 | + <option value="">등록된 발신 번호가 없습니다.</option> | |
| 3964 | + </c:otherwise> | |
| 3965 | + </c:choose> | |
| 3966 | + </select> | |
| 3967 | + <button type="button" class="btnType btnType6" onclick="location.href='/web/user/sendNumberManage.do'">번호등록</button> | |
| 3968 | + </td> | |
| 3969 | + </tr> | |
| 3970 | + <tr class="msg_title"> | |
| 3971 | + <th scope="row">제목</th> | |
| 3972 | + <td> | |
| 3973 | + <ul class="title_wrap"> | |
| 3974 | + <li> | |
| 3975 | + <input id="title_y" type="radio"name="title_status" value="Y" onchange="titleStatus(this);"> | |
| 3976 | + <label for="title_y">사용</label> | |
| 3977 | + <input id="title_n" type="radio" name="title_status" value="N" onchange="titleStatus(this);" checked="checked"> | |
| 3978 | + <label for="title_n">사용안함</label> | |
| 3979 | + </li> | |
| 3980 | + <li class="textbox"> | |
| 3981 | + <label for="mmsSubject" class="label"></label> | |
| 3982 | + <input type="text" size="20" id="mmsSubject" name="mmsSubject" class="w100" maxlength="20" placeholder="" onfocus="this.placeholder=''" > | |
| 3983 | + </li> | |
| 3984 | + </ul> | |
| 3985 | + </td> | |
| 3986 | + </tr> | |
| 3987 | + <!-- 문자 내용 영역 --> | |
| 3988 | + <tr> | |
| 3989 | + <th scope="row" class="vTop">내용</th> | |
| 3990 | + <td class="putText"> | |
| 3991 | + <div class="clearfix"> | |
| 3992 | + <div class="put_left short"> | |
| 3993 | + <!-- 업로드한 이미지의 썸네일 영역 --> | |
| 3994 | + <ul class="thumb_wrap liOnImg"></ul> | |
| 3995 | + <!-- //업로드한 이미지의 썸네일 영역 --> | |
| 3996 | + <label for="smsTxtArea" class="label"></label> | |
| 3997 | + <textarea id="smsTxtArea" name="smsTxtArea" class="put_text" placeholder="내용을 입력해주세요. | |
| 3998 | +-90btye 초과 시 LMS 자동전환 | |
| 3999 | +-파일첨부 시 MMS 자동전환"></textarea> | |
| 4000 | + <div class="text_length"> | |
| 4001 | + <div name="afterDeny"> | |
| 4002 | + <p> | |
| 4003 | + <span class="fwMd" id="msgLeng">0 /</span> | |
| 4004 | + <span class="c_002c9a fwMd" id="limitLeng"> 90</span>byte | |
| 4005 | + </p> | |
| 4006 | + <span class="msg_com msg_short">단문</span> | |
| 4007 | + </div> | |
| 4008 | + </div> | |
| 4009 | + </div> | |
| 4010 | + <div class="put_right"> | |
| 4011 | + <div class="btn_popup_wrap spc_wrap"> | |
| 4012 | + <button type="button" class="btnType btnType7" onclick="miniPopup(this);">특수문자</button> | |
| 4013 | + <div class="send_miniPop spc_character"> | |
| 4014 | + <div class="tab_character"> | |
| 4015 | + <a href="#none" class="on">특수문자</a> | |
| 4016 | + <a href="#none">웃음</a> | |
| 4017 | + <a href="#none">슬픔</a> | |
| 4018 | + <a href="#none">분노</a> | |
| 4019 | + <a href="#none">사랑</a> | |
| 4020 | + <a href="#none">그외</a> | |
| 4021 | + </div> | |
| 4022 | + <!-- 특수문자 부분 --> | |
| 4023 | + <div class="cnt_character on"> | |
| 4024 | + <div class="box_character"> | |
| 4025 | + <c:forEach var="symbolList" items="${symbolList}" varStatus="status"> | |
| 4026 | + <c:if test="${symbolList.symbolType == 'D'}"> | |
| 4027 | + <a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}"><c:out value="${symbolList.symbol}"/></a> | |
| 4028 | + </c:if> | |
| 4029 | + </c:forEach> | |
| 4030 | + </div> | |
| 4031 | + </div> | |
| 4032 | + <!-- 웃음 --> | |
| 4033 | + <div class="cnt_character emt_character"> | |
| 4034 | + <div class="box_character"> | |
| 4035 | + <c:forEach var="symbolList" items="${symbolList}" varStatus="status"> | |
| 4036 | + <c:if test="${symbolList.symbolType == 'S'}"> | |
| 4037 | + <a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a> | |
| 4038 | + </c:if> | |
| 4039 | + </c:forEach> | |
| 4040 | + </div> | |
| 4041 | + </div> | |
| 4042 | + <!-- //웃음 --> | |
| 4043 | + <!-- 슬픔 --> | |
| 4044 | + <div class="cnt_character emt_character"> | |
| 4045 | + <div class="box_character"> | |
| 4046 | + <c:forEach var="symbolList" items="${symbolList}" varStatus="status"> | |
| 4047 | + <c:if test="${symbolList.symbolType == 'C'}"> | |
| 4048 | + <a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a> | |
| 4049 | + </c:if> | |
| 4050 | + </c:forEach> | |
| 4051 | + </div> | |
| 4052 | + </div> | |
| 4053 | + <!-- //슬픔 --> | |
| 4054 | + <!-- 분노 --> | |
| 4055 | + <div class="cnt_character emt_character"> | |
| 4056 | + <div class="box_character"> | |
| 4057 | + <c:forEach var="symbolList" items="${symbolList}" varStatus="status"> | |
| 4058 | + <c:if test="${symbolList.symbolType == 'A'}"> | |
| 4059 | + <a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a> | |
| 4060 | + </c:if> | |
| 4061 | + </c:forEach> | |
| 4062 | + </div> | |
| 4063 | + </div> | |
| 4064 | + <!-- //분노 --> | |
| 4065 | + <!-- 사랑 --> | |
| 4066 | + <div class="cnt_character emt_character"> | |
| 4067 | + <div class="box_character"> | |
| 4068 | + <c:forEach var="symbolList" items="${symbolList}" varStatus="status"> | |
| 4069 | + <c:if test="${symbolList.symbolType == 'L'}"> | |
| 4070 | + <a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a> | |
| 4071 | + </c:if> | |
| 4072 | + </c:forEach> | |
| 4073 | + </div> | |
| 4074 | + </div> | |
| 4075 | + <!-- //사랑 --> | |
| 4076 | + <!-- 그외 --> | |
| 4077 | + <div class="cnt_character emt_character emt_etc "> | |
| 4078 | + <div class="box_character"> | |
| 4079 | + <c:forEach var="symbolList" items="${symbolList}" varStatus="status"> | |
| 4080 | + <c:if test="${symbolList.symbolType == 'E'}"> | |
| 4081 | + <a href="javascript:void(0)" class="symbolButton" value="${symbolList.symbol}">${symbolList.symbol}</a> | |
| 4082 | + </c:if> | |
| 4083 | + </c:forEach> | |
| 4084 | + </div> | |
| 4085 | + </div> | |
| 4086 | + <!-- //그외 --> | |
| 4087 | + <button type="button" class="btn_close" onclick="miniPopup(this);">닫기</button> | |
| 4088 | + </div> | |
| 4089 | + </div> | |
| 4090 | + <div class="btn_popup_wrap convers_wrap"> | |
| 4091 | + <button type="button" class="btnType btnType7" onclick="miniPopup(this)">특정문구 일괄변환<i class="qmMark"></i></button> | |
| 4092 | + <div class="send_miniPop convers"> | |
| 4093 | + <div> | |
| 4094 | + <div class="convers_top"> | |
| 4095 | + <span>특정문구 일괄변환이란?</span> | |
| 4096 | + <p>주소록, 엑셀에 입력된 내용을 이용해 수신자마다 다른 내용의<br> 메시지를 발송하는 기능</p> | |
| 4097 | + </div> | |
| 4098 | + <div class="convers_middle"><a href="javascript:void(0)" class="changeWord" value="[*이름*]">[*이름*]</a></div> | |
| 4099 | + <div class="convers_bottom"> | |
| 4100 | + <a href="javascript:void(0)" class="changeWord" value="[*1*]">[*1*]</a> | |
| 4101 | + <a href="javascript:void(0)" class="changeWord" value="[*2*]">[*2*]</a> | |
| 4102 | + <a href="javascript:void(0)" class="changeWord" value="[*3*]">[*3*]</a> | |
| 4103 | + <a href="javascript:void(0)" class="changeWord" value="[*4*]">[*4*]</a> | |
| 4104 | + </div> | |
| 4105 | + </div> | |
| 4106 | + <button type="button" class="btn_close" onclick="miniPopup(this);">닫기</button> | |
| 4107 | + </div> | |
| 4108 | + </div> | |
| 4109 | + <button type="button" class="btnType btnType7" onclick="javascript:fnGoMyMsg(); return false;">내문자함</button> | |
| 4110 | + <button type="button" class="btnType btnType8" onclick="openPhotoEditor();">이미지 불러오기</button> | |
| 4111 | + <div class="send_btnWrap"> | |
| 4112 | + <button type="button" class="btnType btnType9" onclick="javascript:fn_saveMyMsg(); return false;">문자저장</button> | |
| 4113 | + <button type="button" class="btnType btnType9 btnReset">초기화</button> | |
| 4114 | + </div> | |
| 4115 | + </div> | |
| 4116 | + </div> | |
| 4117 | + <p>* 현재 [<span id="nowMsgType">단문</span>] <span class="c_e40000 fwBold nowMsgCnt">0</span>건 발송 가능합니다.</p> | |
| 4118 | + </td> | |
| 4119 | + </tr> | |
| 4120 | + <tr> | |
| 4121 | + <th scope="row" class="vTop">받는사람</th> | |
| 4122 | + <td class="putText"> | |
| 4123 | + <div class="clearfix receipt_num"> | |
| 4124 | + <!-- <div class="receipt_num_top"> | |
| 4125 | + <label for="callTo" class="label">받는 번호입력</label> | |
| 4126 | + <input type="text" id="callTo" name="callTo" placeholder="번호를 입력하세요" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'" style="width:340px;"> | |
| 4127 | + <button type="button" class="btnType btnType6 addCallToF">번호추가</button> | |
| 4128 | + <span><span class="vMiddle">*</span> 중복번호는 한번만 발송됩니다.</span> | |
| 4129 | + </div> --> | |
| 4130 | + <div class="receipt_num_midde"> | |
| 4131 | + <div class="listType list01 callList_box" id="callList_box"> | |
| 4132 | + <div class="list_table list_head"> | |
| 4133 | + <div class="cb_wrap"> | |
| 4134 | + <label for="" class="label"></label> | |
| 4135 | + <input type="checkbox"> | |
| 4136 | + </div> | |
| 4137 | + <div class="list_table_num"> | |
| 4138 | + <p>번호</p> | |
| 4139 | + <img src="/publish/images/sortUp.png"> | |
| 4140 | + <img src="/publish/images/sortDown.png"> | |
| 4141 | + </div> | |
| 4142 | + <div class="list_table_name"> | |
| 4143 | + <p>이름</p> | |
| 4144 | + <img src="/publish/images/sortUp.png"> | |
| 4145 | + <img src="/publish/images/sortDown.png"> | |
| 4146 | + </div> | |
| 4147 | + </div> | |
| 4148 | + </div> | |
| 4149 | + <div class="put_right"> | |
| 4150 | + <div class="btn_popup_wrap spc_wrap"> | |
| 4151 | + <button type="button" data-tooltip="popup06" class="btnType btnType7 popupAddr">주소록 불러오기</button> | |
| 4152 | + </div> | |
| 4153 | + <!-- <div class="btn_popup_wrap"> | |
| 4154 | + <button type="button" data-tooltip="popup02" class="btnType btnType7">엑셀 불러오기</button> | |
| 4155 | + </div> | |
| 4156 | + <div class="btn_popup_wrap"> | |
| 4157 | + <button type="button" data-tooltip="popup03" class="btnType btnType7 tab1">최근 전송내역</button> | |
| 4158 | + </div> | |
| 4159 | + <div class="btn_popup_wrap"> | |
| 4160 | + <button type="button" data-tooltip="popup03" class="btnType btnType7 tab2">자주 보내는 번호</button> | |
| 4161 | + </div> | |
| 4162 | + <div class="btn_popup_wrap"> | |
| 4163 | + <button type="button" data-tooltip="popup05" class="btnType btnType7 tab2" onclick="getMjMsgSentListAll('1');">재전송</button> | |
| 4164 | + </div> | |
| 4165 | + <div class="btn_popup_wrap check_validity_wrap"> | |
| 4166 | + <button type="button" class="btnType btnType7 check_validity">오류 검사 <i class="qmMark"></i></button> | |
| 4167 | + <div class="error_hover_cont send_hover_cont"> | |
| 4168 | + <p>휴대폰 번호 입력 시 해당 휴대폰 번호에 대한 형식이 어긋나거나 휴대폰 번호에 오류가 있는지 등을 검사하는 기능</p> | |
| 4169 | + <span>(예시) 010-1234-0001(O) / 010-12345-0001(X)</span> | |
| 4170 | + </div> | |
| 4171 | + </div> --> | |
| 4172 | + </div> | |
| 4173 | + </div> | |
| 4174 | + <div class="list_bottom clearfix"> | |
| 4175 | + <div class="remove_btnWrap"> | |
| 4176 | + <button type="button" class="btnType15 all_del"><i class="remove_img"></i>전체삭제</button> | |
| 4177 | + <button type="button" class="btnType15 select_del"><i class="remove_img"></i>선택삭제</button> | |
| 4178 | + </div> | |
| 4179 | + <div class="list_bottom_right"> | |
| 4180 | + <p>총 <span class="c_e40000" id="rowTotCnt">0</span> 건 <!-- / 중복 <span class="c_002c9a" id="rowDupCnt">0</span>건 --></p> | |
| 4181 | + <%--<button type="button" class="address_reg2 registAddr">주소록에 등록</button>--%> | |
| 4182 | + <!-- <button type="button" class="address_reg2 addressregi_btn">주소록에 등록</button> --> | |
| 4183 | + </div> | |
| 4184 | + </div> | |
| 4185 | + </div> | |
| 4186 | + </td> | |
| 4187 | + </tr> | |
| 4188 | + <tr> | |
| 4189 | + <th colspan="2" class="billingAmount"> | |
| 4190 | + <div> | |
| 4191 | + <div class="final_pay"> | |
| 4192 | + <div class="pay_info_list"> | |
| 4193 | + <p>발송금액 :</p> | |
| 4194 | + <div class="info" id="repPriceTxt"> | |
| 4195 | + 단문 : <strong>20</strong>건<span>/</span>장문 : <strong>150</strong>건<span>/</span>그림문자 : <strong>30</strong>건 | |
| 4196 | + </div> | |
| 4197 | + </div> | |
| 4198 | + <p class="price" ><span id="totalPriceTxt">0</span>원<span>(부가세 포함)</span></p> | |
| 4199 | + </div> | |
| 4200 | + <c:if test="${eventRemainCash > 0 && eventMberInfo.eventStatus eq 'Y'}"> | |
| 4201 | + <p style="text-align: right; font-size: 14px; color: #666; margin: -10px 0 15px 0; font-weight: 300;">* 이벤트회원의 발송금액은 이벤트단가를 적용하여 계산된 금액이므로 실제 발송금액과 다를 수 있습니다.</p> | |
| 4202 | + </c:if> | |
| 4203 | + <div class="pay_type clearfix"> | |
| 4204 | + <fmt:formatNumber type="number" maxFractionDigits="3" value="${userMoney}" var="commaPrice" /> | |
| 4205 | + <div> | |
| 4206 | + <input type="radio" id="radio_bill_1" name="radio_bill" checked="checked"> | |
| 4207 | + <label for="radio_bill_1">보유잔액</label> | |
| 4208 | + <%-- <label for="radio_bill_1">내 충전금 (<span id="spUserMoney"> | |
| 4209 | + <c:choose> | |
| 4210 | + <c:when test="${not empty userMoney}"> | |
| 4211 | + <c:out value="${commaPrice}"/> | |
| 4212 | + </c:when> | |
| 4213 | + <c:otherwise> | |
| 4214 | + 0 | |
| 4215 | + </c:otherwise> | |
| 4216 | + </c:choose> | |
| 4217 | + </span>원)</label> --%> | |
| 4218 | + <label for="userMoney" class="label">보유잔액</label> | |
| 4219 | + <input type="text" id="userMoney" name="userMoney" value="<c:out value='${commaPrice}'/>" readonly> | |
| 4220 | + <span class="won">원</span> | |
| 4221 | + <button type="button" class="btnType btnType21" onclick="location.href='/web/member/pay/PayView.do'">충전</button> | |
| 4222 | + </div> | |
| 4223 | + <c:if test="${eventRemainCash > 0 && eventMberInfo.eventStatus eq 'Y'}"> | |
| 4224 | + <div><button type="button" data-tooltip="popup07" class="btnType btnType3 btn_event_cash">이벤트 잔액</button></div> | |
| 4225 | + </c:if> | |
| 4226 | + </div> | |
| 4227 | + | |
| 4228 | + <!--발송금액 아래 등급별 가격안내 추가--> | |
| 4229 | + <div class="my_price_wrap" id="myPriceWrap" style="display: none;"> | |
| 4230 | + <div class="center-line"></div> | |
| 4231 | + <ul> | |
| 4232 | + <li class="title"> | |
| 4233 | + <img src="/publish/images/content/icon_mypage_message.png" alt="">나의 단가 <span>:</span> | |
| 4234 | + </li> | |
| 4235 | + <li class="price_line"> | |
| 4236 | + <span class="type">단문</span> | |
| 4237 | + <span class="price"><fmt:formatNumber value="${shortPrice}" pattern="###.#" /></span>원 | |
| 4238 | + <span class="line">/ </span> | |
| 4239 | + </li> | |
| 4240 | + <li class="price_line"> | |
| 4241 | + <span class="type">장문</span> | |
| 4242 | + <span class="price"><fmt:formatNumber value="${longPrice}" pattern="###.#" /></span>원 | |
| 4243 | + <span class="line">/ </span> | |
| 4244 | + </li> | |
| 4245 | + <li class="price_line"> | |
| 4246 | + <span class="type">그림</span> | |
| 4247 | + <span class="price"><fmt:formatNumber value="${picturePrice}" pattern="###.#" /></span>원 | |
| 4248 | + (2장 : <fmt:formatNumber value="${picture2Price}" pattern="###.#" />원 / 3장 : <fmt:formatNumber value="${picture3Price}" pattern="###.#" />원) | |
| 4249 | + </li> | |
| 4250 | + </ul> | |
| 4251 | + </div> | |
| 4252 | + <!-- End --> | |
| 4253 | + | |
| 4254 | + </div> | |
| 4255 | + </th> | |
| 4256 | + </tr> | |
| 4257 | + <%-- <tr> | |
| 4258 | + <th scope="row">추천인 ID</th> | |
| 4259 | + <td class="check_num"> | |
| 4260 | + <input id="radio5" type="radio"name="recom" checked="checked"> | |
| 4261 | + <label for="radio5">없음</label> | |
| 4262 | + <input id="radio6" type="radio" name="recom"> | |
| 4263 | + <label for="radio6">있음</label> | |
| 4264 | + <div> | |
| 4265 | + <label for="recommId" class="label"></label> | |
| 4266 | + <input type="text" size="20" id="recommId" name="recommId" value="" placeholder="추천인 아이디 입력" onfocus="this.placeholder=''" onblur="this.placeholder='추천인 아이디 입력'"> | |
| 4267 | + <button type="button" class="btnType btnType9" id="recommBtn">추천인 확인</button> | |
| 4268 | + </div> | |
| 4269 | + </td> | |
| 4270 | + </tr> --%> | |
| 4271 | + </tbody> | |
| 4272 | + </table> | |
| 4273 | + </div> | |
| 4274 | + <div class="send_right"> | |
| 4275 | + <div class="phone"> | |
| 4276 | + <div class="phoneIn"> | |
| 4277 | + <div> | |
| 4278 | + <p><img src="/publish/images/search.png">미리보기</p> | |
| 4279 | + <div class="text_length2 clearfix preShort"> | |
| 4280 | + <span class="msg_com msg_short">단문</span> | |
| 4281 | + <div> | |
| 4282 | + <span>글자크기</span> | |
| 4283 | + <button type="button" class="fontPlus"><img src="/publish/images/content/font_plus.png"></button> | |
| 4284 | + <button type="button" class="fontMinus"><img src="/publish/images/content/font_minus.png"></button> | |
| 4285 | + </div> | |
| 4286 | + </div> | |
| 4287 | + <div class="text_length2 clearfix prePhoto"> | |
| 4288 | + <span class="msg_com msg_photo">포토</span> | |
| 4289 | + <ul class="photo_msg_num"> | |
| 4290 | + <li class="photo_num_01" onclick="imgClick(0);"><a href="#none">1</a></li> | |
| 4291 | + <li class="photo_num_02" onclick="imgClick(1);"><a href="#none">2</a></li> | |
| 4292 | + <li class="photo_num_03" onclick="imgClick(2);"><a href="#none">3</a></li> | |
| 4293 | + </ul> | |
| 4294 | + <div> | |
| 4295 | + <span>글자크기</span> | |
| 4296 | + <button type="button" class="fontPlus"><img src="/publish/images/content/font_plus.png"></button> | |
| 4297 | + <button type="button" class="fontMinus"><img src="/publish/images/content/font_minus.png"></button> | |
| 4298 | + </div> | |
| 4299 | + </div> | |
| 4300 | + <!-- 텍스트 미리보기 --> | |
| 4301 | + <div class="text_preview"> | |
| 4302 | + <div class="preiew_img preViewShort"></div> | |
| 4303 | + <div class="preview_auto"> | |
| 4304 | + <p class="none_txt">내용을 입력해주세요.222222</p> | |
| 4305 | + <pre class="realtime">adfasfdasdf</pre> | |
| 4306 | + </div> | |
| 4307 | + </div> | |
| 4308 | + <!-- //텍스트 미리보기 --> | |
| 4309 | + </div> | |
| 4310 | + </div> | |
| 4311 | + <p class="addText">※ 단말기 설정에 따라 다르게 보일 수 있습니다</p> | |
| 4312 | + </div> | |
| 4313 | + <div class="phone_bottom"> | |
| 4314 | + <div class="send_rev"> | |
| 4315 | + <div class="send_content"> | |
| 4316 | + <div class="rev_radio"> | |
| 4317 | + <ul> | |
| 4318 | + <li><input type="radio" id="reserYnN" name="reserYn" value="N" checked="checked"><label for="reserYnN">즉시</label></li> | |
| 4319 | + <li><input type="radio" id="reserYnY" name="reserYn" value="Y"><label for="reserYnY">예약</label></li> | |
| 4320 | + </ul> | |
| 4321 | + </div> | |
| 4322 | + <div class="send_btn"> | |
| 4323 | + <button type="button" class="btnType btnType11" onclick="javascript:fn_sendMsgData(); return false;">발송하기</button> | |
| 4324 | + <button type="button" class="btnType btnType10" onclick="javascript:fnTestSend(); return false;">테스트발송</button> | |
| 4325 | + </div> | |
| 4326 | + </div> | |
| 4327 | + <div class="rev_selected"> | |
| 4328 | + <div class="rev_top"> | |
| 4329 | + <span>날짜 :</span> | |
| 4330 | + <div class="calendar_wrap"> | |
| 4331 | + <input type="text" class="startDate2 inp resDate calendar02" title="검색 시작일" id="startDate2" name="startDate2" value="" data-datecontrol="true"> | |
| 4332 | + </div> | |
| 4333 | + <label for="msgResHour" class="label">시 선택</label> | |
| 4334 | + <div class="selBox"> | |
| 4335 | + <select class="selType1" id="msgResHour" name="msgResHour"> | |
| 4336 | + <c:forEach var="hour" begin="0" end="23" step="1" varStatus="status"> | |
| 4337 | + <c:choose> | |
| 4338 | + <c:when test="${hour < 10}"> | |
| 4339 | + <option value="0${hour}">0${hour}시</option> | |
| 4340 | + </c:when> | |
| 4341 | + <c:otherwise> | |
| 4342 | + <option value="${hour}">${hour}시</option> | |
| 4343 | + </c:otherwise> | |
| 4344 | + </c:choose> | |
| 4345 | + </c:forEach> | |
| 4346 | + </select> | |
| 4347 | + <label for="msgResMin" class="label">분 선택</label> | |
| 4348 | + <select class="selType1" id="msgResMin" name="msgResMin"> | |
| 4349 | + <c:forEach var="min" begin="0" end="55" step="5"> | |
| 4350 | + <c:choose> | |
| 4351 | + <c:when test="${min < 10}"> | |
| 4352 | + <option value="0${min}">0${min}분</option> | |
| 4353 | + </c:when> | |
| 4354 | + <c:otherwise> | |
| 4355 | + <option value="${min}">${min}분</option> | |
| 4356 | + </c:otherwise> | |
| 4357 | + </c:choose> | |
| 4358 | + </c:forEach> | |
| 4359 | + </select> | |
| 4360 | + </div> | |
| 4361 | + </div> | |
| 4362 | + | |
| 4363 | + <!-- <div class="rev_bottom"> | |
| 4364 | + <input type="checkbox" id="divideChk" name="divideChk"> | |
| 4365 | + <label for="divideChk">분할전송</label> | |
| 4366 | + <input type="text" class="dividType1" id="divideCnt" name="divideCnt" value="20" onkeypress='return checkNumber(event)' maxlength="4"/> | |
| 4367 | + <label for="divideCnt">건씩</label> | |
| 4368 | + <select class="selType1" id="divideTime" name="divideTime"> | |
| 4369 | + <option value="1">01분</option> | |
| 4370 | + <option value="2">02분</option> | |
| 4371 | + <option value="3">03분</option> | |
| 4372 | + <option value="4">04분</option> | |
| 4373 | + <option value="5">05분</option> | |
| 4374 | + <option value="10">10분</option> | |
| 4375 | + <option value="15">15분</option> | |
| 4376 | + <option value="20">20분</option> | |
| 4377 | + <option value="30">30분</option> | |
| 4378 | + </select> | |
| 4379 | + <label for="divideTime">간격</label> | |
| 4380 | + </div> --> | |
| 4381 | + </div> | |
| 4382 | + </div> | |
| 4383 | + </div> | |
| 4384 | + </div> | |
| 4385 | + </div> | |
| 4386 | + <!-- </div> --><!--// tab content1 --> | |
| 4387 | +</form> | |
| 4388 | +<form id="latestMsgForm" name="latestMsgForm" method="post"> | |
| 4389 | + <input type="hidden" id="userId" name="userId" value="${LoginVO.id}"/> | |
| 4390 | +</form> | |
| 4391 | +<form id="addMyMsgForm" name="addMyMsgForm" method="post"> | |
| 4392 | + <input type="hidden" id="msgId" name="msgId" value=""/> | |
| 4393 | + <input type="hidden" id="pageType1" name="pageType" value=""/> | |
| 4394 | +</form> | |
| 4395 | +<form name="popForm" id="popForm" method="post"> | |
| 4396 | + <input type="hidden"id="pageType2" name="pageType" value=""/> | |
| 4397 | +</form> | |
| 4398 | +<form name="goToCustomForm" id="goToCustomForm" method="post" action="/web/mjon/custom/selectMsgCustomView.do"> | |
| 4399 | + <input type="hidden" id="pageType3" name="pageType" value="msgcampain"/> | |
| 4400 | +</form> | |
| 4401 | +<form name="testSendForm" id="testSendForm" method="post"> | |
| 4402 | + <input type="hidden" name="msgKind" value="C"/> | |
| 4403 | + <input type="hidden" name="msgpreview" value=""/> | |
| 4404 | + <input type="hidden" name="mmsSubject" value=""/> | |
| 4405 | + <input type="hidden" name="callFrom" value=""/> | |
| 4406 | + <input type="hidden" name="imgFilePath" value=""/> | |
| 4407 | + <input type="hidden" name="eachPrice" value=""/> | |
| 4408 | + <input type="hidden" name="msgType" value=""/> | |
| 4409 | + <input type="hidden" name="smsTxt" value=""/> | |
| 4410 | +</form> |
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/huge/MsgHGDataView.jsp
... | ... | @@ -0,0 +1,2289 @@ |
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| 3 | +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> | |
| 4 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | |
| 5 | +<%@ page import="itn.com.cmm.LoginVO" %> | |
| 6 | + | |
| 7 | +<!-- <script src="/publish/js/content.js"></script> --> | |
| 8 | + | |
| 9 | +<script type="text/javascript"> | |
| 10 | + | |
| 11 | +var _regExp1 = /(^02.{0}|^01.{1}|^[0-9]{3})-?([0-9]{3,4})-?([0-9]{4})$/; | |
| 12 | + | |
| 13 | +var imgFilePath = []; // 최종 선택한 이미지 경로 저장 변수 | |
| 14 | +var imgFileId = []; // 최종 선택한 파일 아이디 저장 변수 | |
| 15 | +var templateYn = []; // 템플릿 사용 여부 저장 변수 | |
| 16 | +var tableL = null; //좌측 받는 사람 주소록 Tabulator 변수 | |
| 17 | +var tableR = null; //우측 주소록 불러오기 Tabulator 변수 | |
| 18 | +var tableAddr = null; //주소록 불러오기 팝업 Tabulator 변수 | |
| 19 | + | |
| 20 | +var loginVO = '${loginVO}'; | |
| 21 | + | |
| 22 | +var popCustomScrT=0; // 맞춤제작 요청 JSPark => 2023.02.21 추가 | |
| 23 | +var msgResendAllFlag = "${msgResendAllFlag}"; | |
| 24 | +var msgResendAllGroupId = "${msgResendAllGroupId}"; | |
| 25 | +var msgResendAllAdvertiseYn = "${msgResendAllAdvertiseYn}"; | |
| 26 | +var msgResendAllReplaceYn = "${msgResendAllReplaceYn}"; | |
| 27 | + | |
| 28 | +$(document).ready(function(){ | |
| 29 | + //문자 발송 화면 폼 불러오기 | |
| 30 | + listMsgDataView(); | |
| 31 | + | |
| 32 | + //최 하단 문자 샘플 탭 리스트 내용 불러오기 | |
| 33 | + fnLetterListAjax(1); | |
| 34 | + | |
| 35 | + //최 하단 그림문자 탭 리스트 내용 불러오기 | |
| 36 | + fnPhotoListAjax(1); | |
| 37 | + | |
| 38 | + // 내보관함 리스트 로그인이 완료된 경우에만 로드되도록 | |
| 39 | + if(loginVO != "" && loginVO != null){ | |
| 40 | + //최 하단 내문자함 탭 리스트 내용 불러오기 | |
| 41 | + fnMyMsgListAjax(1); | |
| 42 | + } | |
| 43 | + | |
| 44 | + //그림문자 샘플 탭 활성화 시키기 | |
| 45 | + TabType2($('.tabType2 li').eq(1), '2'); | |
| 46 | + | |
| 47 | + $(".tDep2_cateCode a").each(function(index, item){ | |
| 48 | + | |
| 49 | + if($(this).text() == "선거"){ | |
| 50 | + $('.tDep2_cateCode').find('.on').removeClass('on'); | |
| 51 | + $(this).addClass('on'); | |
| 52 | + } | |
| 53 | + }) | |
| 54 | + | |
| 55 | + // 맞춤제작 요청 JSPark => 2023.02.21 추가 | |
| 56 | + //맞춤제작 등록 Popup | |
| 57 | + //customPopup(); | |
| 58 | + | |
| 59 | +}); | |
| 60 | + | |
| 61 | +//문자 그룹정보 => 재전송용 | |
| 62 | +function getMjMsgGroupInfoByResend() { | |
| 63 | + $.ajax({ | |
| 64 | + type: "POST", | |
| 65 | + url: "/web/mjon/msgdata/selectMjMsgGroupInfoByResendAjax.do", | |
| 66 | + data: {"msgResendAllGroupId" : msgResendAllGroupId}, | |
| 67 | + dataType:'json', | |
| 68 | + async: false, | |
| 69 | + success: function (data) { | |
| 70 | + //alert(JSON.stringify(data)); | |
| 71 | + if(data.isSuccess == true){ | |
| 72 | + var msgData = data.resultMsgInfo; | |
| 73 | + var fileData = data.resultMsgAddPhotoInfo; | |
| 74 | + | |
| 75 | + // 발신번호 | |
| 76 | + var reCallFrom = $.trim(removeDash($("#callFromList option:selected").val())); | |
| 77 | + if ($.trim(removeDash(msgData.callFrom)) != reCallFrom) { | |
| 78 | + alert("발신번호가 이전에 발송한 번호가 아닙니다.\n발신번호를 확인해주세요.") | |
| 79 | + } | |
| 80 | + | |
| 81 | + var smsTxt = msgData.smsTxt; | |
| 82 | + var subject = msgData.subject; | |
| 83 | + var fileId = ""; | |
| 84 | + var filePath = ""; | |
| 85 | + var len = fileData.length; | |
| 86 | + | |
| 87 | + // 기존 내용 지워주기 | |
| 88 | + //$(".btnReset").trigger("click"); | |
| 89 | + $('.delLi').each(function(){ | |
| 90 | + $(this).remove(); | |
| 91 | + }); | |
| 92 | + | |
| 93 | + $('.preBoxF').each(function(){ | |
| 94 | + $(this).remove(); | |
| 95 | + }); | |
| 96 | + | |
| 97 | + $('#imgCnt').val(0); | |
| 98 | + | |
| 99 | + // 기존 imgFileId, imgFilePath 배열에 있는 내용 초기화 해주기 | |
| 100 | + imgFilePath = []; | |
| 101 | + imgFileId = []; | |
| 102 | + | |
| 103 | + // 문자제목 | |
| 104 | + if (msgData.subject != null && msgData.subject != "") { | |
| 105 | + $('.msg_title').addClass('active'); | |
| 106 | + $("input:radio[name='title_status']:radio[value='Y']").prop('checked', true); // 선택하기 | |
| 107 | + $('.textbox').show(); | |
| 108 | + $("#mmsSubject").val(subject); | |
| 109 | + } | |
| 110 | + | |
| 111 | + // 문자내용 | |
| 112 | + // 선거 기본정보 제거 | |
| 113 | + if (smsTxt.indexOf("(선거운동정보)") == 0) { | |
| 114 | + smsTxt = $.trim(smsTxt.replace("(선거운동정보)", "")); | |
| 115 | + var smsTxtLastIdxCnt = smsTxt.lastIndexOf("후보자전화번호"); | |
| 116 | + if (smsTxtLastIdxCnt != -1) { | |
| 117 | + smsTxt = $.trim(smsTxt.substring(0, smsTxtLastIdxCnt)); | |
| 118 | + } | |
| 119 | + } | |
| 120 | + $('#smsTxtArea').val(smsTxt); | |
| 121 | + | |
| 122 | + // 첨부 이미지가 있는경우 이미지 처리해주기 | |
| 123 | + if(len > 0) { | |
| 124 | + for(var i=0; i < len; i++) { | |
| 125 | + var num = i + 1; | |
| 126 | + var imgId = fileData[i].atchFileId; | |
| 127 | + var imgSn = fileData[i].fileSn; | |
| 128 | + var fileStreCours = fileData[i].fileStreCours; | |
| 129 | + var streFileNm = fileData[i].streFileNm; | |
| 130 | + var fileExtsn = fileData[i].fileExtsn; | |
| 131 | + | |
| 132 | + /* var imgSrc = fileStreCours + "/" + streFileNm + "." + fileExtsn; */ | |
| 133 | + var imgSrc = '/cmm/fms/getImage2.do?atchFileId=' + imgId + '&fileSn=' + imgSn; | |
| 134 | + myMsgImageControl(imgSrc, "edit_n", "Template", imgId); | |
| 135 | + } | |
| 136 | + | |
| 137 | + fnByteString($('#smsTxtArea').val()); | |
| 138 | + } | |
| 139 | + else { | |
| 140 | + fnByteString($('#smsTxtArea').val()); | |
| 141 | + } | |
| 142 | + | |
| 143 | + // 문자전송 상단으로 이동 | |
| 144 | + var sendOfT=$('.send_top').offset().top; | |
| 145 | + $('html,body').stop().animate({'scrollTop':sendOfT-60},250); | |
| 146 | + | |
| 147 | + } else { | |
| 148 | + //alert("Message : " + msg); | |
| 149 | + } | |
| 150 | + }, | |
| 151 | + error: function (e) { | |
| 152 | + //alert("저장에 실패하였습니다."); | |
| 153 | + //console.log("ERROR : ", e); | |
| 154 | + } | |
| 155 | + }); | |
| 156 | +} | |
| 157 | + | |
| 158 | +// 문자 상세정보 => 재전송용 | |
| 159 | +function getMjMsgListByResend() { | |
| 160 | + $.ajax({ | |
| 161 | + type: "POST", | |
| 162 | + url: "/web/mjon/msgdata/selectMjMsgListByResendAjax.do", | |
| 163 | + data: {"msgResendAllGroupId" : msgResendAllGroupId}, | |
| 164 | + dataType:'json', | |
| 165 | + async: true, | |
| 166 | + success: function (data) { | |
| 167 | + if(data.isSuccess == true){ | |
| 168 | + var listCnt = data.resultList.length; | |
| 169 | + | |
| 170 | + //수신자 처리 변수 | |
| 171 | + var callToList = []; //수신자 처리 리스트 | |
| 172 | + var tableData = []; //수신자 tabulator 처리 변수 | |
| 173 | + | |
| 174 | + for(var i = 0; i < listCnt; i++){ // 수신자 리스트 Tabulator에 입력해 주기 | |
| 175 | + callToList[i] = data.resultList[i].callTo; | |
| 176 | + tableData.push({phone: removeDash(callToList[i])}); | |
| 177 | + } | |
| 178 | + | |
| 179 | + if(tableData.length > 0){ | |
| 180 | + tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기 | |
| 181 | + | |
| 182 | + totRows = tableL.getRows().length; | |
| 183 | + updateTotCnt(totRows); //전체 데이터 갯수 구하기 | |
| 184 | + | |
| 185 | + //결제 금액 구하기 | |
| 186 | + totalPriceSum(totRows); | |
| 187 | + } | |
| 188 | + | |
| 189 | + } else { | |
| 190 | + //alert("Message : " + msg); | |
| 191 | + } | |
| 192 | + }, | |
| 193 | + error: function (e) { | |
| 194 | + //alert("저장에 실패하였습니다."); | |
| 195 | + //console.log("ERROR : ", e); | |
| 196 | + } | |
| 197 | + }); | |
| 198 | +} | |
| 199 | + | |
| 200 | +//문자발송 URL Move | |
| 201 | +function goMsgUrlMove() { | |
| 202 | + document.location.href = "/web/mjon/msgcampain/huge/selectMsgHGDataView.do"; | |
| 203 | +} | |
| 204 | + | |
| 205 | +function listMsgDataView(){ | |
| 206 | + | |
| 207 | + var sendData = $(document.searchForm).serializeArray() ; | |
| 208 | + $(".contentArea").load("/web/mjon/msgcampain/huge/selectMsgHGDataSMLViewAjax.do", sendData ,function(response, status, xhr){ | |
| 209 | + | |
| 210 | + //문자 재전송 처리를 위해 사용 | |
| 211 | + $("#msgForm").ready(function(){ //문자 내용 폼이 로드된 후 실행 | |
| 212 | + | |
| 213 | + var msgResendFlag = '${reSendMsgVO.msgResendFlag}'; | |
| 214 | + var msgSeqList = []; | |
| 215 | + msgSeqList = '${reSendMsgVO.msgSeqList}'; | |
| 216 | + if(msgSeqList.length > 0){ | |
| 217 | + | |
| 218 | + fnMsgResend(msgResendFlag, msgSeqList); | |
| 219 | + | |
| 220 | + } | |
| 221 | + | |
| 222 | + //주소록에서 주소를 전송한 경우 처리 | |
| 223 | + var moveAddrFlag = '${addrVO.moveAddrFlag}'; | |
| 224 | + var addrIdList = []; | |
| 225 | + addrIdList = '${addrVO.addrIdList}'; | |
| 226 | + if(addrIdList.length > 0) { | |
| 227 | + fnAddrSet(moveAddrFlag, addrIdList); | |
| 228 | + } | |
| 229 | + | |
| 230 | + // 문자 재전송 New | |
| 231 | + if (msgResendAllFlag == "Y") { | |
| 232 | + if (msgResendAllReplaceYn != "Y") { | |
| 233 | + // 문자 그룹정보 => 재전송용 | |
| 234 | + getMjMsgGroupInfoByResend(); | |
| 235 | + } | |
| 236 | + | |
| 237 | + // 문자 상세정보 => 재전송용 | |
| 238 | + getMjMsgListByResend(); | |
| 239 | + } | |
| 240 | + | |
| 241 | + }); | |
| 242 | + | |
| 243 | + | |
| 244 | + }).slideDown(); | |
| 245 | +} | |
| 246 | + | |
| 247 | +function fnAddrSet(moveAddrFlag, addrIdList){ | |
| 248 | + | |
| 249 | + if(moveAddrFlag == 'Y'){ // 주소록에서 넘어오는 경우 | |
| 250 | + | |
| 251 | + var form = document.moveAddrForm; | |
| 252 | + form.addrIdList.value = addrIdList; | |
| 253 | + | |
| 254 | + var data = new FormData(form); | |
| 255 | + url = "/web/mjon/addr/selectAddrDataListAjax.do"; | |
| 256 | + | |
| 257 | + $.ajax({ | |
| 258 | + type: "POST", | |
| 259 | + url: url, | |
| 260 | + data: data, | |
| 261 | + dataType:'json', | |
| 262 | + async: true, | |
| 263 | + processData: false, | |
| 264 | + contentType: false, | |
| 265 | + cache: false, | |
| 266 | + success: function (returnData, status) { | |
| 267 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 268 | + if("fail"==returnData.result){ | |
| 269 | + | |
| 270 | + alert(returnData.message); | |
| 271 | + return false; | |
| 272 | + | |
| 273 | + }else if("loginFail"==returnData.result){ | |
| 274 | + | |
| 275 | + alert(returnData.message); | |
| 276 | + return false; | |
| 277 | + | |
| 278 | + }else if(returnData.resultListCnt == '0'){ | |
| 279 | + | |
| 280 | + alert("전달된 주소록이 없습니다."); | |
| 281 | + return false; | |
| 282 | + | |
| 283 | + }else{ | |
| 284 | + | |
| 285 | + var listCnt = returnData.resultListCnt; | |
| 286 | + | |
| 287 | + //수신자 처리 변수 | |
| 288 | + var tableData = []; //수신자 tabulator 처리 변수 | |
| 289 | + | |
| 290 | + for(var i = 0; i < listCnt; i++){ // 수신자 리스트 Tabulator에 입력해 주기 | |
| 291 | + | |
| 292 | + tableData.push({ | |
| 293 | + name: returnData.resultList[i].addrNm | |
| 294 | + ,phone: removeDash(returnData.resultList[i].addrPhoneNo) | |
| 295 | + ,rep1: returnData.resultList[i].addrInfo1 | |
| 296 | + ,rep2: returnData.resultList[i].addrInfo2 | |
| 297 | + ,rep3: returnData.resultList[i].addrInfo3 | |
| 298 | + ,rep4: returnData.resultList[i].addrInfo4 | |
| 299 | + }); | |
| 300 | + | |
| 301 | + } | |
| 302 | + | |
| 303 | + tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기 | |
| 304 | + | |
| 305 | + totRows = tableL.getRows().length; | |
| 306 | + | |
| 307 | + updateTotCnt(totRows); //전체 데이터 갯수 구하기 | |
| 308 | + | |
| 309 | + //결제 금액 구하기 | |
| 310 | + totalPriceSum(totRows); | |
| 311 | + | |
| 312 | + return false; | |
| 313 | + | |
| 314 | + } | |
| 315 | + | |
| 316 | + } else if(status== 'fail'){ | |
| 317 | + alert(returnData.message); | |
| 318 | + } | |
| 319 | + }, | |
| 320 | + error: function (e) { | |
| 321 | + alert("주소록 가져오기에 실패하였습니다."); | |
| 322 | + console.log("ERROR : ", e); | |
| 323 | + }, | |
| 324 | + beforeSend : function(xmlHttpRequest) { | |
| 325 | + //로딩창 show | |
| 326 | + $('.loading_layer').addClass('active'); | |
| 327 | + }, | |
| 328 | + complete : function(xhr, textStatus) { | |
| 329 | + //로딩창 hide | |
| 330 | + $('.loading_layer').removeClass('active'); | |
| 331 | + } | |
| 332 | + }); | |
| 333 | + | |
| 334 | + } | |
| 335 | + | |
| 336 | +} | |
| 337 | + | |
| 338 | +function fnMsgResend(msgResendFlag, msgSeqList){ | |
| 339 | + | |
| 340 | + if(msgResendFlag == 'Y'){ // 문자재전송에서 넘어오는 경우 | |
| 341 | + | |
| 342 | + var form = document.msgResendForm; | |
| 343 | + form.msgSeqList.value = msgSeqList; | |
| 344 | + | |
| 345 | + var data = new FormData(form); | |
| 346 | + url = "/web/mjon/msgcampain/selectReSendMsgDataListAjax.do"; | |
| 347 | + | |
| 348 | + $.ajax({ | |
| 349 | + type: "POST", | |
| 350 | + url: url, | |
| 351 | + data: data, | |
| 352 | + dataType:'json', | |
| 353 | + async: false, | |
| 354 | + processData: false, | |
| 355 | + contentType: false, | |
| 356 | + cache: false, | |
| 357 | + success: function (returnData, status) { | |
| 358 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 359 | + if("fail"==returnData.result){ | |
| 360 | + | |
| 361 | + alert(returnData.message); | |
| 362 | + return false; | |
| 363 | + | |
| 364 | + }else if("loginFail"==returnData.result){ | |
| 365 | + | |
| 366 | + alert(returnData.message); | |
| 367 | + return false; | |
| 368 | + | |
| 369 | + }else if(returnData.resultListCnt == '0'){ | |
| 370 | + | |
| 371 | + alert("재전송 문자내용이 없습니다."); | |
| 372 | + return false; | |
| 373 | + | |
| 374 | + }else{ | |
| 375 | + | |
| 376 | + var data = returnData; | |
| 377 | + var listCnt = returnData.resultListCnt; | |
| 378 | + var photoInfo = returnData.resultMsgPhotoInfo; | |
| 379 | + //수신자 처리 변수 | |
| 380 | + var callToList = []; //수신자 처리 리스트 | |
| 381 | + var tableData = []; //수신자 tabulator 처리 변수 | |
| 382 | + | |
| 383 | + //var subject = data.resultList[0].subject; //제목 | |
| 384 | + //var smsTxt = data.resultList[0].smsTxt; //문자내용 | |
| 385 | + //var fileCnt = data.resultList[0].fileCnt; //그림문자 이미지 갯수 | |
| 386 | + //var filePath1 = data.resultList[0].fileType1; //이미지1 파일 경로 | |
| 387 | + //var filePath2 = data.resultList[0].fileType2; //이미지2 파일 경로 | |
| 388 | + //var filePath3 = data.resultList[0].fileType3; //이미지3 파일 경로 | |
| 389 | + var atchFileId1 = photoInfo.atchFileId1; //이미지1 파일 번호 | |
| 390 | + var atchFileId2 = photoInfo.atchFileId2; //이미지2 파일 번호 | |
| 391 | + var atchFileId3 = photoInfo.atchFileId3; //이미지3 파일 번호 | |
| 392 | + | |
| 393 | + /* if(smsTxt != null){ | |
| 394 | + | |
| 395 | + $("#smsTxtArea").val(smsTxt); | |
| 396 | + fnByteString(smsTxt); | |
| 397 | + | |
| 398 | + } | |
| 399 | + | |
| 400 | + if(subject != null){ | |
| 401 | + | |
| 402 | + $("#mmsSubject").val(subject); | |
| 403 | + | |
| 404 | + } | |
| 405 | + | |
| 406 | + if(fileCnt > 0){ //문자 내용 이미지 처리해주기 | |
| 407 | + | |
| 408 | + for(var i=0; i < fileCnt; i++){ | |
| 409 | + | |
| 410 | + var imgId = ""; | |
| 411 | + var imgSrc = ""; | |
| 412 | + | |
| 413 | + if(i == 0){ | |
| 414 | + | |
| 415 | + imgSrc = filePath1.replace("/usr/local/tomcat_mjon/webapps/mjon",""); | |
| 416 | + imgId = atchFileId1; | |
| 417 | + | |
| 418 | + }else if(i == 1){ | |
| 419 | + | |
| 420 | + imgSrc = filePath2.replace("/usr/local/tomcat_mjon/webapps/mjon",""); | |
| 421 | + imgId = atchFileId2; | |
| 422 | + | |
| 423 | + }else{ | |
| 424 | + | |
| 425 | + imgSrc = filePath3.replace("/usr/local/tomcat_mjon/webapps/mjon",""); | |
| 426 | + imgId = atchFileId3; | |
| 427 | + | |
| 428 | + } | |
| 429 | + | |
| 430 | + myMsgImageControl(imgSrc, "edit_n", "Template", imgId); | |
| 431 | + | |
| 432 | + } | |
| 433 | + | |
| 434 | + } */ | |
| 435 | + | |
| 436 | + for(var i = 0; i < listCnt; i++){ // 수신자 리스트 Tabulator에 입력해 주기 | |
| 437 | + | |
| 438 | + callToList[i] = data.resultList[i].callTo; | |
| 439 | + tableData.push({phone: removeDash(callToList[i])}); | |
| 440 | + | |
| 441 | + } | |
| 442 | + | |
| 443 | + if(tableData.length > 0){ | |
| 444 | + | |
| 445 | + tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기 | |
| 446 | + | |
| 447 | + //totRows = tableL.getRows().length; | |
| 448 | + //updateTotCnt(totRows); //전체 데이터 갯수 구하기 | |
| 449 | + | |
| 450 | + //결제 금액 구하기 | |
| 451 | + //totalPriceSum(totRows); | |
| 452 | + | |
| 453 | + } | |
| 454 | + | |
| 455 | + return false; | |
| 456 | + | |
| 457 | + } | |
| 458 | + | |
| 459 | + } else if(status== 'fail'){ | |
| 460 | + alert(returnData.message); | |
| 461 | + } | |
| 462 | + }, | |
| 463 | + error: function (e) { alert("문자 재전송 번호 등록에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 464 | + }); | |
| 465 | + | |
| 466 | + } | |
| 467 | + | |
| 468 | +} | |
| 469 | + | |
| 470 | +function fnLetterListAjax(index){ | |
| 471 | + var form = document.letterForm; | |
| 472 | + | |
| 473 | + if($('.tDep1_letType a').eq(0).hasClass('on')) { | |
| 474 | + form.letterType.value='S'; | |
| 475 | + } else if ($('.tDep1_letType a').eq(1).hasClass('on')) { | |
| 476 | + form.letterType.value='L'; | |
| 477 | + } | |
| 478 | + | |
| 479 | + //검색자 입력 검색 시 카테고리, 해쉬태그 전체 초기화 | |
| 480 | + if(form.searchKeyword.value != '') { | |
| 481 | + form.categoryCode.value = ""; | |
| 482 | + form.hashTag.value = ""; | |
| 483 | + | |
| 484 | + $('.tDep1_cateCode').find('.on').removeClass('on'); | |
| 485 | + $('.tDep1_cateCode').find('.cateAll').addClass('on'); | |
| 486 | + $('.tDep1_hashTag').find('.on').removeClass('on'); | |
| 487 | + $('.tDep1_hashTag').find('.hashAll').addClass('on'); | |
| 488 | + }else{ | |
| 489 | + //해시태그가 선택되어 있을 경우 해당 태그 검색어를 전달해줌 | |
| 490 | + var strTagTxt = $('.tDep1_hashTag').find('.on').text().replace("#",""); | |
| 491 | + if(strTagTxt == "전체"){ | |
| 492 | + form.hashTag.value = ""; | |
| 493 | + }else{ | |
| 494 | + form.hashTag.value = strTagTxt; | |
| 495 | + } | |
| 496 | + } | |
| 497 | + | |
| 498 | + form.pageIndex.value = index; | |
| 499 | + var sendData = $(document.letterForm).serializeArray(); | |
| 500 | + //하위 카테고리 | |
| 501 | + $("#tDep1_depThrCateCode").load("/web/mjon/msgcampain/selectCateConfThrDptListAjax.do", sendData ,function(response, status, xhr){ | |
| 502 | + if(document.letterForm.searchKeyword.value == ''){ | |
| 503 | + $('.bottom_content .area_total_count').hide(); | |
| 504 | + } | |
| 505 | + if(form.hashTag.value != ''){ | |
| 506 | + if($('#letterLoad .nodata_box').length > 0){ | |
| 507 | + $('#letterLoad .nodata_box').hide().next('.nodata_box.hashTag').show(); | |
| 508 | + } | |
| 509 | + } | |
| 510 | + | |
| 511 | + }); | |
| 512 | + $("#letterLoad").load("/web/mjon/msgcampain/selectLetterDataListAjax.do", sendData ,function(response, status, xhr){ | |
| 513 | + if(document.letterForm.searchKeyword.value == ''){ | |
| 514 | + $('.bottom_content .area_total_count').hide(); | |
| 515 | + } | |
| 516 | + }); | |
| 517 | + | |
| 518 | +} | |
| 519 | + | |
| 520 | +function fnPhotoListAjax(index){ | |
| 521 | + var form = document.letterForm; | |
| 522 | + //검색자 입력 검색 시 카테고리, 해쉬태그 전체 초기화 | |
| 523 | + if(form.searchKeyword.value != '') { | |
| 524 | + form.categoryCode.value = ""; | |
| 525 | + form.hashTag.value = ""; | |
| 526 | + | |
| 527 | + $('.tDep2_cateCode').find('.on').removeClass('on'); | |
| 528 | + $('.tDep2_cateCode').find('.cateAll').addClass('on'); | |
| 529 | + $('.tDep2_hashTag').find('.on').removeClass('on'); | |
| 530 | + $('.tDep2_hashTag').find('.hashAll').addClass('on'); | |
| 531 | + }else{ | |
| 532 | + //해시태그가 선택되어 있을 경우 해당 태그 검색어를 전달해줌 | |
| 533 | + var strTagTxt = $('.tDep2_hashTag').find('.on').text().replace("#",""); | |
| 534 | + if(strTagTxt == "전체"){ | |
| 535 | + form.hashTag.value = ""; | |
| 536 | + }else{ | |
| 537 | + form.hashTag.value = strTagTxt; | |
| 538 | + } | |
| 539 | + } | |
| 540 | + | |
| 541 | + form.letterType.value = 'P'; | |
| 542 | + form.pageIndex.value = index; | |
| 543 | + var sendData = $(document.letterForm).serializeArray(); | |
| 544 | + //하위 카테고리 | |
| 545 | + $("#tDep2_depThrCateCode").load("/web/mjon/msgcampain/selectCateConfThrDptListAjax.do", sendData ,function(response, status, xhr){ | |
| 546 | + if(document.letterForm.searchKeyword.value == ''){ | |
| 547 | + $('.bottom_content .area_total_count').hide(); | |
| 548 | + } | |
| 549 | + if(form.hashTag.value != ''){ | |
| 550 | + if($('#letterLoad .nodata_box').length > 0){ | |
| 551 | + $('#letterLoad .nodata_box').hide().next('.nodata_box.hashTag').show(); | |
| 552 | + } | |
| 553 | + } | |
| 554 | + | |
| 555 | + }); | |
| 556 | + $("#photoLoad").load("/web/mjon/msgcampain/selectPhotoDataListAjax.do", sendData ,function(response, status, xhr){ | |
| 557 | + photoLayerView(); | |
| 558 | + if(document.letterForm.searchKeyword.value == ''){ | |
| 559 | + $('.bottom_content .area_total_count').hide(); | |
| 560 | + } | |
| 561 | + if(form.hashTag.value != ''){ | |
| 562 | + if($('#photoLoad .nodata_box').length > 0){ | |
| 563 | + $('#photoLoad .nodata_box').hide().next('.nodata_box.hashTag').show(); | |
| 564 | + } | |
| 565 | + } | |
| 566 | + }); | |
| 567 | + | |
| 568 | +} | |
| 569 | + | |
| 570 | +function fnMyMsgListAjax(index){ | |
| 571 | + | |
| 572 | + if(loginVO == "" || loginVO == null){ | |
| 573 | + //alert("로그인 후 사용이 가능합니다."); | |
| 574 | + location.href="/web/user/login/login.do"; | |
| 575 | + return false; | |
| 576 | + }else{ | |
| 577 | + document.myMsgForm.pageIndex.value = index; | |
| 578 | + var sendData = $(document.myMsgForm).serializeArray(); | |
| 579 | + $("#myMsgLoad").load("/web/mjon/msgcampain/selectMyMsgDataListAjax.do", sendData ,function(response, status, xhr){ | |
| 580 | + /* $(".msg_cont").mCustomScrollbar({ | |
| 581 | + axis: 'y', | |
| 582 | + scrollbarPosition: "inside", | |
| 583 | + theme: "dark", | |
| 584 | + autoHideScrollbar: false | |
| 585 | + }); */ | |
| 586 | + | |
| 587 | + }); | |
| 588 | + } | |
| 589 | +} | |
| 590 | + | |
| 591 | +function fnMyMsgSearchListAjax(index){ | |
| 592 | + | |
| 593 | + document.myMsgForm.pageIndex.value = index; | |
| 594 | + var sendData = $(document.myMsgForm).serializeArray(); | |
| 595 | + $("#myMsgLoad").load("/web/mjon/msgcampain/selectMyMsgDataListAjax.do", sendData ,function(response, status, xhr){ | |
| 596 | + | |
| 597 | + /* $(".msg_cont").mCustomScrollbar({ | |
| 598 | + axis: 'y', | |
| 599 | + scrollbarPosition: "inside", | |
| 600 | + theme: "dark", | |
| 601 | + autoHideScrollbar: false | |
| 602 | + }); */ | |
| 603 | + | |
| 604 | + }); | |
| 605 | + | |
| 606 | +} | |
| 607 | + | |
| 608 | +function fnMsgExcelDataView(){ | |
| 609 | + | |
| 610 | + /* var sendData = $(document.searchForm).serializeArray() ; | |
| 611 | + | |
| 612 | + //엑셀 문자 탭 활성화 시키기 | |
| 613 | + TabType1($('.tabType1 li').eq(1), '2'); | |
| 614 | + | |
| 615 | + $(".contentExcelArea").load("/web/mjon/msgcampain/selectMsgExcelDataViewAjax.do", sendData ,function(response, status, xhr){ | |
| 616 | + }); */ | |
| 617 | + | |
| 618 | + location.href="/web/mjon/msgcampain/excel/selectMsgExcelDataView.do"; | |
| 619 | + | |
| 620 | +} | |
| 621 | + | |
| 622 | +function fnMsgTWDataView(){ | |
| 623 | + | |
| 624 | + location.href="/web/mjon/msgcampain/selectMsgTWDataView.do"; | |
| 625 | + | |
| 626 | +} | |
| 627 | + | |
| 628 | +function fn_saveMyMsg(){ // 내 문자 보관함 저장 | |
| 629 | + | |
| 630 | + var form = document.msgForm; | |
| 631 | + var myImgFileId = []; //신규 이미지 추가 파일 Id 저장 변수 | |
| 632 | + var adverYn = $("input[name='send_adYn']:checked").val(); //광고 체크여부 | |
| 633 | + | |
| 634 | + /* | |
| 635 | + 이미지 에디터를 사용하여 추가한 경우 이미지 업로드 처리 - 단 에디터에서 템플릿을 선택한 경우는 업로드안함 | |
| 636 | + 신규 이미지 추가를 한 경우만 이미지 파일 업로드 처리함 | |
| 637 | + */ | |
| 638 | + $('.thumb_wrap').find('.thumb_img').each(function(idx, el) { | |
| 639 | + | |
| 640 | + if($("#delLi"+idx).hasClass("Template")){ //이미지 에디터 템플릿 이미지 선택 여부 확인 | |
| 641 | + templateYn.push("Y"); | |
| 642 | + } else { | |
| 643 | + templateYn.push("N"); | |
| 644 | + } | |
| 645 | + | |
| 646 | + if($(el).hasClass("edit_y")) { //에디터를 사용했고 | |
| 647 | + //이미지 변환 | |
| 648 | + const imgBase64 = $(el).attr("src"); | |
| 649 | + const decodImg = atob(imgBase64.split(',')[1]); // base64~ 부분을 제외하고 데이터 디코딩 | |
| 650 | + | |
| 651 | + | |
| 652 | + let array = []; | |
| 653 | + for (let i = 0; i < decodImg.length; i++) { | |
| 654 | + array.push(decodImg.charCodeAt(i)); | |
| 655 | + } | |
| 656 | + | |
| 657 | + const file = new Blob([new Uint8Array(array)], {type: 'image/jpeg'}); | |
| 658 | + const fileName = 'canvas_img_' + new Date().getMilliseconds() + '.jpg'; | |
| 659 | + let formData = new FormData(); | |
| 660 | + formData.append('file', file, fileName); | |
| 661 | + | |
| 662 | + $.ajax({ | |
| 663 | + type: 'post', | |
| 664 | + url: '/web/mjon/msgcampain/insertEditImageAjax.do', | |
| 665 | + cache: false, | |
| 666 | + data: formData, | |
| 667 | + dataType:'json', | |
| 668 | + processData: false, | |
| 669 | + contentType: false, | |
| 670 | + async: false, | |
| 671 | + success: function (returnData, status) { | |
| 672 | + if(status == 'success'){ | |
| 673 | + // imgFilePath 에 배열로 담아주기(이미지 순서대로) | |
| 674 | + //console.log(imgFilePath); | |
| 675 | + //imgFilePath.push(returnData.filefullPath); | |
| 676 | + myImgFileId.push(returnData.atchFileId); | |
| 677 | + | |
| 678 | + } else if(status== 'fail'){ | |
| 679 | + alert(returnData.message); | |
| 680 | + } | |
| 681 | + }, | |
| 682 | + error: function (e) { alert("이미지 업로드에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 683 | + }); | |
| 684 | + | |
| 685 | + } else { | |
| 686 | + //에디터 안거친 템플릿 이미지면 바로 src 때림 | |
| 687 | + imgFilePath.push($(el).attr("src")); | |
| 688 | + } | |
| 689 | + }); | |
| 690 | + | |
| 691 | + if(myImgFileId.length > 0 && imgFileId.length > 0){ //기존 샘플 이미지와 이미지 에디터 둘다 사용한 경우 | |
| 692 | + | |
| 693 | + var tempImgId = []; | |
| 694 | + | |
| 695 | + tempImgId.push(myImgFileId); | |
| 696 | + tempImgId.push(imgFileId); | |
| 697 | + form.imgFileId.value = tempImgId; | |
| 698 | + | |
| 699 | + }else if(myImgFileId.length > 0){ //이미지 에디터에서 신규 등록한 이미지 | |
| 700 | + | |
| 701 | + form.imgFileId.value = myImgFileId; | |
| 702 | + | |
| 703 | + }else{ //샘플 이미지 선택만 했을경우(이미지 에디터 사용 안했을때) | |
| 704 | + | |
| 705 | + form.imgFileId.value = imgFileId; | |
| 706 | + } | |
| 707 | + | |
| 708 | + //광고 문자 내용 합쳐주기 | |
| 709 | + if(adverYn == 'Y'){ | |
| 710 | + | |
| 711 | + var adTxt = $('.ad_txt').text(); | |
| 712 | + var denyTxt = $('.deny_txt').text(); | |
| 713 | + var smsTxt = form.smsTxtArea.value; | |
| 714 | + | |
| 715 | + //var adverTxt = adTxt + '\n\n' + smsTxt + '\n\n' + denyTxt; | |
| 716 | + var adverTxt = smsTxt; | |
| 717 | + form.smsTxt.value = adverTxt; | |
| 718 | + | |
| 719 | + }else{ | |
| 720 | + | |
| 721 | + var smsTxt = form.smsTxtArea.value; | |
| 722 | + form.smsTxt.value = smsTxt; | |
| 723 | + | |
| 724 | + } | |
| 725 | + | |
| 726 | + //문자 종류 설정(S:단문 , L:장문 , P:그림) | |
| 727 | + var photoSts = $('.delLi').length; | |
| 728 | + var conLeng = conByteLeng(form.smsTxt.value); // 내용 문자 입력 바이트 수 계산하기 | |
| 729 | + | |
| 730 | + if(photoSts > 0){ | |
| 731 | + | |
| 732 | + form.msgType.value = 'P'; | |
| 733 | + | |
| 734 | + }else if(conLeng > 90){ | |
| 735 | + | |
| 736 | + form.msgType.value = 'L'; | |
| 737 | + | |
| 738 | + }else{ | |
| 739 | + | |
| 740 | + form.msgType.value = 'S'; | |
| 741 | + | |
| 742 | + } | |
| 743 | + | |
| 744 | + if(photoSts == '0' && conLeng == '0'){ | |
| 745 | + | |
| 746 | + alert("문자내용을 입력해 주세요."); | |
| 747 | + return false; | |
| 748 | + | |
| 749 | + } | |
| 750 | + | |
| 751 | + var data = new FormData(form); | |
| 752 | + url = "/web/mjon/msgcampain/insertMyMsgDataAjax.do"; | |
| 753 | + | |
| 754 | + $.ajax({ | |
| 755 | + type: "POST", | |
| 756 | + url: url, | |
| 757 | + data: data, | |
| 758 | + dataType:'json', | |
| 759 | + async: false, | |
| 760 | + processData: false, | |
| 761 | + contentType: false, | |
| 762 | + cache: false, | |
| 763 | + success: function (returnData, status) { | |
| 764 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 765 | + if("fail"==returnData.result){ | |
| 766 | + | |
| 767 | + alert(returnData.message); | |
| 768 | + return false; | |
| 769 | + | |
| 770 | + }else{ | |
| 771 | + | |
| 772 | + alert("내 문자함에 저장되었습니다."); | |
| 773 | + | |
| 774 | + //내 문자함 탭 활성화 시키기 | |
| 775 | + TabType2($('.tabType2 li').eq(3), '4'); | |
| 776 | + var offset = $('.tabType2').offset(); | |
| 777 | + $('html, body').animate({scrollTop : offset.top-140}, 400); | |
| 778 | + | |
| 779 | + //최 하단 내문자함 탭 리스트 내용 불러오기 | |
| 780 | + var sendData = $(document.myMsgForm).serializeArray(); | |
| 781 | + $("#myMsgLoad").load("/web/mjon/msgcampain/selectMyMsgDataListAjax.do", sendData ,function(response, status, xhr){ | |
| 782 | + }); | |
| 783 | + | |
| 784 | + } | |
| 785 | + | |
| 786 | + } else if(status== 'fail'){ | |
| 787 | + alert(returnData.message); | |
| 788 | + } | |
| 789 | + }, | |
| 790 | + error: function (e) { alert("문자 저장에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 791 | + }); | |
| 792 | + | |
| 793 | +} | |
| 794 | + | |
| 795 | +//내 문자함으로 탭이동 | |
| 796 | +function fnGoMyMsg(){ | |
| 797 | + | |
| 798 | + //내 문자함 탭 활성화 시키기 | |
| 799 | + TabType2($('.tabType2 li').eq(3), '4'); | |
| 800 | + | |
| 801 | + var offset = $('.tabType2').offset(); | |
| 802 | + $('html, body').animate({scrollTop : offset.top-140}, 400); | |
| 803 | + | |
| 804 | +} | |
| 805 | + | |
| 806 | +//MJ_MSG_GROUP_DATA 누락데이터 체크 | |
| 807 | +function getMsgGroupDataErrorCheck() { | |
| 808 | + var isError = false; | |
| 809 | + | |
| 810 | + $.ajax({ | |
| 811 | + type: "POST", | |
| 812 | + url: "/web/mjon/msgdata/selectMsgGroupNotExistInfoAjax.do", | |
| 813 | + data: {}, | |
| 814 | + dataType:'json', | |
| 815 | + async: false, | |
| 816 | + success: function (data) { | |
| 817 | + if (data.isSuccess) { | |
| 818 | + if (data.isError == true) { | |
| 819 | + isError = true; | |
| 820 | + } | |
| 821 | + } | |
| 822 | + }, | |
| 823 | + error: function (e) { | |
| 824 | + | |
| 825 | + } | |
| 826 | + }); | |
| 827 | + | |
| 828 | + return isError; | |
| 829 | +} | |
| 830 | + | |
| 831 | +function checkConf() { | |
| 832 | + var confCheck = false; | |
| 833 | + | |
| 834 | + $.ajax({ | |
| 835 | + type: "POST", | |
| 836 | + url: "/web/mjon/conf/selectMjonMsgUseConfAjax.do", | |
| 837 | + data: {}, | |
| 838 | + dataType:'json', | |
| 839 | + async: false, | |
| 840 | + success: function (returnData, status) { | |
| 841 | + if(returnData.result == "fail") { | |
| 842 | + console.log(returnData.message); | |
| 843 | + }else if(returnData.result == "success"){ | |
| 844 | + confCheck = true; | |
| 845 | + } | |
| 846 | + } | |
| 847 | + ,error: function (e) {console.log("ERROR : ", e); } | |
| 848 | + }); | |
| 849 | + | |
| 850 | + return confCheck; | |
| 851 | +} | |
| 852 | + | |
| 853 | +//문자발송 처리 함수 | |
| 854 | +function fn_sendMsgData(){ | |
| 855 | + | |
| 856 | + if(!checkConf()){ //문자온 conf-check | |
| 857 | + alert("현재 문자 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요."); | |
| 858 | + return false; | |
| 859 | + } | |
| 860 | + | |
| 861 | + var form = document.msgForm; | |
| 862 | + | |
| 863 | + //회원 보유 잔액 비교 | |
| 864 | + var totPriceOnly = stringReplaceAll(form.totPrice.value, ",", ""); | |
| 865 | + var userMoneyOnly = stringReplaceAll(form.myPrice.value, ",", ""); | |
| 866 | + if(parseFloat(userMoneyOnly) < parseFloat(totPriceOnly)){ | |
| 867 | + alert("문자 발송에 필요한 회원님의 보유 잔액이 부족 합니다."); | |
| 868 | + return false; | |
| 869 | + } | |
| 870 | + | |
| 871 | + var loginVO = '${LoginVO}'; | |
| 872 | + var adverYn = $("input[name='send_adYn']:checked").val(); | |
| 873 | + var spamStatus = false; | |
| 874 | + var exceptSpamYn = $("#exceptSpamYn").val(); //금지어 필터링 예외 여부 - N 일 경우만 스팸 검사를 진행 | |
| 875 | + | |
| 876 | +/* //이벤트 진행중 회원의 경우 이벤트 잔여금액 비교 처리 필요. | |
| 877 | + var eventStatus = form.eventStatus.value; | |
| 878 | + var eventRemainCash = parseFloat(form.eventRemainCash.value); | |
| 879 | + | |
| 880 | + if(eventStatus == 'Y'){ | |
| 881 | + | |
| 882 | + if(parseFloat(eventRemainCash) < parseFloat(totPriceOnly)){ | |
| 883 | + | |
| 884 | + alert("고객님의 이벤트 캐시 잔액은 " + eventRemainCash + "원으로 입력하신 수량의 문자를 전부 발송할 수 없습니다. 잔액 이하로 발송건수를 재설정하시기 바랍니다."); | |
| 885 | + return false; | |
| 886 | + } | |
| 887 | + | |
| 888 | + } */ | |
| 889 | + | |
| 890 | + if(loginVO == "" || loginVO == null){ | |
| 891 | + | |
| 892 | + alert("문자발송 서비스는 로그인 후 이용 가능합니다."); | |
| 893 | + return false; | |
| 894 | + | |
| 895 | + } | |
| 896 | + | |
| 897 | + //MJ_MSG_GROUP_DATA 누락데이터 체크 | |
| 898 | + //if (getMsgGroupDataErrorCheck() == false) { | |
| 899 | + // alert("고객님께서 발송한 최근문자가 발송결과에 표시되지않아, 문자발송이 임시로 차단되었습니다.\n문자온 고객센터에 문의해주세요."); | |
| 900 | + // return false; | |
| 901 | + //} | |
| 902 | + | |
| 903 | + if(form.callFromList.value == ""){ | |
| 904 | + | |
| 905 | + alert("발신번호를 입력해 주세요."); | |
| 906 | + return false; | |
| 907 | + | |
| 908 | + } | |
| 909 | + | |
| 910 | + var titleStatus = form.title_status.value; | |
| 911 | + if(titleStatus == 'N'){//장문 제목 사용안함으로 선택시 제목에 있는 데이터 지워주기 | |
| 912 | + | |
| 913 | + form.mmsSubject.value = ""; | |
| 914 | + | |
| 915 | + }else{//장문 제목에 치환문자 포함된 경우 입력 못하도록 처리. | |
| 916 | + | |
| 917 | + var mmsSubject = form.mmsSubject.value; | |
| 918 | + if(getSpacialStringChk(mmsSubject)){ | |
| 919 | + alert("문자 제목에는 치환문자(엑셀 내 *이름*, *1*, *2*, *3*, *4* 등)를 사용하실 수 없습니다."); | |
| 920 | + return false; | |
| 921 | + } | |
| 922 | + | |
| 923 | + } | |
| 924 | + | |
| 925 | + //문자내용 첫글자에 특수기호 포함 여부 체크 | |
| 926 | + var strCont = form.smsTxtArea.value; | |
| 927 | + var rtnStr = strChinJpnCheck(strCont); | |
| 928 | + | |
| 929 | + //문자제목에 이모지가 있는지 체크 | |
| 930 | + var titleStatusYn = $("input[name='title_status']:checked").val(); | |
| 931 | + if(titleStatusYn == 'Y') { | |
| 932 | + if(!emojiCheck(form.mmsSubject.value)) return false; | |
| 933 | + } | |
| 934 | + | |
| 935 | + //문자내용에 이모지가 있는지 체크 | |
| 936 | + if(!emojiCheck(strCont)) return false; | |
| 937 | + | |
| 938 | + if(rtnStr.length > 0){ | |
| 939 | + | |
| 940 | + alert("입력하신 문구 중 \" " + rtnStr + " \" 는 일부 휴대폰에서 표기되지 않을 수 있습니다."); | |
| 941 | + | |
| 942 | + } | |
| 943 | + | |
| 944 | + //문자내용 첫글자에 특수기호 포함 여부 체크 | |
| 945 | + /* var strCont = form.smsTxtArea.value; | |
| 946 | + var repStr = strFirstCharCheck(strCont); | |
| 947 | + | |
| 948 | + if(repStr.length > 0){ | |
| 949 | + | |
| 950 | + alert("문자 내용 첫 글자는 특수기호가 들어갈 수 없습니다."); | |
| 951 | + $('#smsTxtArea').val(strCont.replace(repStr, "")); | |
| 952 | + fnByteString(strCont.replace(repStr, "")); | |
| 953 | + return false; | |
| 954 | + | |
| 955 | + } */ | |
| 956 | + | |
| 957 | + if(imgFilePath.length == 0){ // 그림문자일 경우 내용이 없어도 됨 , 장문 문자일 경우만 문자내용 체크함 | |
| 958 | + | |
| 959 | + if(form.smsTxtArea.value == ""){ | |
| 960 | + | |
| 961 | + alert("문자 내용을 입력해 주세요."); | |
| 962 | + return false; | |
| 963 | + | |
| 964 | + } | |
| 965 | + | |
| 966 | + } | |
| 967 | + | |
| 968 | + //선거 문자 내용 합쳐주기 | |
| 969 | + if(adverYn == 'Y'){ | |
| 970 | + | |
| 971 | + var adTxt = $('.ad_txt').text(); | |
| 972 | + var denyTxt = $('.deny_txt').html(); | |
| 973 | + var smsTxt = form.smsTxtArea.value; | |
| 974 | + | |
| 975 | + //선거운동정보 하단 테스트내용 줄바꿈 처리해주기 | |
| 976 | + denyTxt = denyTxt.replaceAll("<br>","\n"); | |
| 977 | + denyTxt = denyTxt.replaceAll("<br/>","\n"); | |
| 978 | + | |
| 979 | + var adverTxt = adTxt + "\n" + smsTxt + "\n" + denyTxt; | |
| 980 | + form.smsTxt.value = adverTxt; | |
| 981 | + | |
| 982 | + }else{ | |
| 983 | + | |
| 984 | + var smsTxt = form.smsTxtArea.value; | |
| 985 | + form.smsTxt.value = smsTxt; | |
| 986 | + | |
| 987 | + } | |
| 988 | + | |
| 989 | + //수신번호 리스트 체크하기 | |
| 990 | + var numCnt = 0; | |
| 991 | + /* var nameList = []; //치환문자 이름 | |
| 992 | + var phoneNum = []; //받는사람 | |
| 993 | + var rep1List = []; //치환문자1 | |
| 994 | + var rep2List = []; //치환문자2 | |
| 995 | + var rep3List = []; //치환문자3 | |
| 996 | + var rep4List = []; //치환문자4 */ | |
| 997 | + var addrGrpList = []; //주소록 그룹 리스트 | |
| 998 | + | |
| 999 | + var selectedData = tableL.getRows(); | |
| 1000 | + | |
| 1001 | + if(selectedData == "" || selectedData == null){ | |
| 1002 | + | |
| 1003 | + alert("주소록을 한 건 이상 추가해주세요."); | |
| 1004 | + return false; | |
| 1005 | + | |
| 1006 | + }else{ // 선택한 Row '-' 문자 삭제하기 | |
| 1007 | + | |
| 1008 | + for(var i=0; i < selectedData.length; i++){ | |
| 1009 | + | |
| 1010 | + //일괄변환 문자에 콤마(,)가 들어가있으면 배열로 넘길때 문제가 발생하여 특수문자(§)로 치환하여 넘겨주도록 한다. | |
| 1011 | + var addrGrpId = tableL.getRows()[i].getData().addrGrpId; | |
| 1012 | + | |
| 1013 | + if(addrGrpId == ""){ | |
| 1014 | + | |
| 1015 | + alert("수신 목록에 주소록 정보가 없습니다."); | |
| 1016 | + return false; | |
| 1017 | + | |
| 1018 | + } | |
| 1019 | + | |
| 1020 | + addrGrpList[i] = addrGrpId; | |
| 1021 | + | |
| 1022 | + } | |
| 1023 | + | |
| 1024 | + } | |
| 1025 | + | |
| 1026 | + for(var i=0; i< addrGrpList.length; i++){ | |
| 1027 | + | |
| 1028 | + console.log("++++++++++++ addr group id ::: "+addrGrpList[i]); | |
| 1029 | + | |
| 1030 | + } | |
| 1031 | + | |
| 1032 | + var reserYn = $("input[name=reserYn]:checked").val(); // 예약 발송 여부 확인 | |
| 1033 | + | |
| 1034 | + if(reserYn == 'Y'){ | |
| 1035 | + | |
| 1036 | + var date = $(".resDate").val();//form.msgResDate.value; | |
| 1037 | + var hour = form.msgResHour.value; | |
| 1038 | + var min = form.msgResMin.value; | |
| 1039 | + | |
| 1040 | + if(date == ""){ | |
| 1041 | + | |
| 1042 | + alert("예약전송 날짜를 선택해 주세요."); | |
| 1043 | + return false; | |
| 1044 | + | |
| 1045 | + }else{ | |
| 1046 | + | |
| 1047 | + var now = new Date(); | |
| 1048 | + var reqDate = date + " " + hour + ":" + min + ":00"; | |
| 1049 | + var gapDate = getGapDayTime(date, hour, min); | |
| 1050 | + | |
| 1051 | + if(gapDate < 0){ // 음수이면 이전날짜, 크면 이후 날짜. | |
| 1052 | + alert("예약 날짜는 현재 시간 이후의 날짜 및 시간을 선택해 주세요."); | |
| 1053 | + return false; | |
| 1054 | + }else{ | |
| 1055 | + form.reqDate.value = reqDate; //예약일자 파라미터 저장 | |
| 1056 | + } | |
| 1057 | + } | |
| 1058 | + | |
| 1059 | + }else{ | |
| 1060 | + | |
| 1061 | + form.reqDate.value = ""; | |
| 1062 | + | |
| 1063 | + } | |
| 1064 | + | |
| 1065 | + var fileLinks = document.getElementsByName("fileLinks"); | |
| 1066 | + | |
| 1067 | + var conLeng = conByteLeng($('#smsTxt').val()); // 내용 문자 입력 바이트 수 계산하기 | |
| 1068 | + | |
| 1069 | + if(conLeng > 2000){ | |
| 1070 | + | |
| 1071 | + alert("문자 내용은 2000byte를 넘을 수 없습니다."); | |
| 1072 | + return false; | |
| 1073 | + | |
| 1074 | + } | |
| 1075 | + | |
| 1076 | + if(confirm("문자를 전송하시겠습니까?")){ | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + imgFilePath = []; | |
| 1080 | + $('.thumb_wrap').find('.thumb_img').each(function(idx, el) { | |
| 1081 | + if($("#delLi"+idx).hasClass("Template")){ | |
| 1082 | + templateYn.push("Y"); | |
| 1083 | + } else { | |
| 1084 | + templateYn.push("N"); | |
| 1085 | + } | |
| 1086 | + | |
| 1087 | + if($(el).hasClass("edit_y")) { | |
| 1088 | + //이미지 변환 | |
| 1089 | + const imgBase64 = $(el).attr("src"); | |
| 1090 | + const decodImg = atob(imgBase64.split(',')[1]); // base64~ 부분을 제외하고 데이터 디코딩 | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + let array = []; | |
| 1094 | + for (let i = 0; i < decodImg.length; i++) { | |
| 1095 | + array.push(decodImg.charCodeAt(i)); | |
| 1096 | + } | |
| 1097 | + | |
| 1098 | + const file = new Blob([new Uint8Array(array)], {type: 'image/jpeg'}); | |
| 1099 | + const fileName = 'canvas_img_' + new Date().getMilliseconds() + '.jpg'; | |
| 1100 | + let formData = new FormData(); | |
| 1101 | + formData.append('file', file, fileName); | |
| 1102 | + | |
| 1103 | + $.ajax({ | |
| 1104 | + type: 'post', | |
| 1105 | + url: '/web/mjon/msgcampain/insertEditImageAjax.do', | |
| 1106 | + cache: false, | |
| 1107 | + data: formData, | |
| 1108 | + dataType:'json', | |
| 1109 | + processData: false, | |
| 1110 | + contentType: false, | |
| 1111 | + async: false, | |
| 1112 | + success: function (returnData, status) { | |
| 1113 | + if(status == 'success'){ | |
| 1114 | + // imgFilePath 에 배열로 담아주기(이미지 순서대로) | |
| 1115 | + //console.log(imgFilePath); | |
| 1116 | + imgFilePath.push(returnData.filefullPath); | |
| 1117 | + imgFileId.push(returnData.atchFileId); | |
| 1118 | + | |
| 1119 | + } else if(status== 'fail'){ | |
| 1120 | + alert(returnData.message); | |
| 1121 | + } | |
| 1122 | + }, | |
| 1123 | + error: function (e) { alert("이미지 업로드에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 1124 | + }); | |
| 1125 | + | |
| 1126 | + } else { | |
| 1127 | + | |
| 1128 | + if(imgFilePath.length != imgFileId.length){ | |
| 1129 | + //에디터 안거친 템플릿 이미지면 바로 src 때림 | |
| 1130 | + imgFilePath.push($(el).attr("src")); | |
| 1131 | + } | |
| 1132 | + | |
| 1133 | + } | |
| 1134 | + }); | |
| 1135 | + | |
| 1136 | + form.imgFilePath.value = imgFilePath; // 저장한 이미지 경로 담아주기 | |
| 1137 | + form.callToList.value = phoneNum; //수신자번호 리스트 저장해주기 | |
| 1138 | + form.callFrom.value = removeDash(form.callFromList.value); // 발신번호 대쉬(-) 문자 없애주기 | |
| 1139 | + form.reserveYn.value = reserYn; // 즉시 / 예약 문자 선택 여부 | |
| 1140 | + form.templateYn.value = templateYn; | |
| 1141 | + form.imgFileId.value = imgFileId; | |
| 1142 | + //form.nameList.value = nameList; | |
| 1143 | + //form.rep1List.value = rep1List; | |
| 1144 | + //form.rep2List.value = rep2List; | |
| 1145 | + //form.rep3List.value = rep3List; | |
| 1146 | + //form.rep4List.value = rep4List; | |
| 1147 | + | |
| 1148 | + //총 결제금액 천단위 콤마 삭제 후 전송 | |
| 1149 | + var totPrice = form.totPrice.value; | |
| 1150 | + totPrice = totPrice.replace(",",""); | |
| 1151 | + form.totPrice.value = totPrice; | |
| 1152 | + | |
| 1153 | + //문자내용이 입력된 경우 스팸 필터링 실행 | |
| 1154 | + if(!form.smsTxtArea.value == "" && exceptSpamYn == "N"){ | |
| 1155 | + | |
| 1156 | + console.log(smsTxtArea); | |
| 1157 | + var spmData = new FormData(form); | |
| 1158 | + url = "/web/mjon/msgdata/selectSpamTxtChkAjax.do"; | |
| 1159 | + | |
| 1160 | + $.ajax({ | |
| 1161 | + type: "POST", | |
| 1162 | + url: url, | |
| 1163 | + data: spmData, | |
| 1164 | + dataType:'json', | |
| 1165 | + async: false, | |
| 1166 | + processData: false, | |
| 1167 | + contentType: false, | |
| 1168 | + cache: false, | |
| 1169 | + success: function (returnData, status) { | |
| 1170 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 1171 | + | |
| 1172 | + if("fail" == returnData.result){ | |
| 1173 | + | |
| 1174 | + alert(returnData.message); | |
| 1175 | + return false; | |
| 1176 | + | |
| 1177 | + }else if("loginFail" == returnData.result){ | |
| 1178 | + | |
| 1179 | + alert(returnData.message); | |
| 1180 | + return false; | |
| 1181 | + | |
| 1182 | + }else if("spams" == returnData.result){ | |
| 1183 | + | |
| 1184 | +// var spmFilterTxt = returnData.spmFilterTxt; | |
| 1185 | + spamStatus = true; | |
| 1186 | + | |
| 1187 | +// form.spamKeyword.value = spmFilterTxt; | |
| 1188 | + form.spamStatus.value='Y'; | |
| 1189 | + }else{ | |
| 1190 | + form.spamKeyword.value = ''; | |
| 1191 | + form.spamStatus.value='N'; | |
| 1192 | + | |
| 1193 | + } | |
| 1194 | + | |
| 1195 | + } else if(status== 'fail'){ | |
| 1196 | + alert(returnData.message); | |
| 1197 | + return false; | |
| 1198 | + } | |
| 1199 | + }, | |
| 1200 | + error: function (e) { alert("문자 발송에 실패하였습니다."); console.log("ERROR : ", e); return false;} | |
| 1201 | + }); | |
| 1202 | + | |
| 1203 | + } | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + //이벤트 진행중 회원의 경우 이벤트 잔여금액 비교 처리 필요. | |
| 1207 | + //이벤트 캐시가 부족한 경우 이벤트 캐시로 발송 가능한 만큼만 이벤트 금액으로 발송 처리해줌. | |
| 1208 | + //이 후 나머지 발송 건수는 이벤트 캐시가 아닌 일반 단가로 발송 처리를 진행 함. | |
| 1209 | + var eventStatus = form.eventStatus.value; | |
| 1210 | + | |
| 1211 | + if(eventStatus == 'Y'){ //이벤트 진행 대상자이면 문자종류에 이벤트로 구분 | |
| 1212 | + | |
| 1213 | + form.eventYn.value = "Y"; //이벤트문자 종류 설정 | |
| 1214 | + | |
| 1215 | + } | |
| 1216 | + | |
| 1217 | + var eventRemainCash = parseFloat(form.eventRemainCash.value); | |
| 1218 | + | |
| 1219 | + if(eventStatus == 'Y'){ | |
| 1220 | + | |
| 1221 | + if(parseFloat(eventRemainCash) < parseFloat(totPriceOnly)){ | |
| 1222 | + | |
| 1223 | + if(confirm("고객님의 이벤트 캐시 잔액(" + eventRemainCash + "원) 부족으로 요청하신 문자("+numberWithCommas(phoneNum.length)+"건)를 모두 발송할 수 없습니다. 이벤트 캐시 초과 건에 대해서는 일반 단가를 적용하여 발송하시겠습니까?")){ | |
| 1224 | + | |
| 1225 | + var smsTxtArea = $('#smsTxtArea').val(); | |
| 1226 | + var evnMsgType = $("#msgType").val(); | |
| 1227 | + var evnEachPrice = $("#eachPrice").val(); //form 에 저장된 이벤트 개별 단가 불러오기 | |
| 1228 | + var evnSendCnt = Math.floor(eventRemainCash / evnEachPrice); | |
| 1229 | + var norEachPrice = 0; | |
| 1230 | + var imgCnt = $("#imgCnt").val(); //그림 이미지 갯수 | |
| 1231 | + var txtReplYn = $("#txtReplYn").val(); //치환문자 포함 여부 | |
| 1232 | + var evnPhoneNumCnt = Number($("#evnPhoneNumCnt").val()); //치환문자 체크하면서 단/장문 건수 카운팅하면서 이벤트 금액으로 발송가능한 수신자 갯수 정보 | |
| 1233 | + var myPrice = parseFloat($("#myPrice").val()); //회원보유 잔여 캐시 금액 | |
| 1234 | + | |
| 1235 | + //수신목록 저장 배열 변수 | |
| 1236 | + var evnPhoneNum = []; //이벤트 단가 받는사람 | |
| 1237 | + var norPhoneNum = []; //일반 단가 받는 사람 | |
| 1238 | + | |
| 1239 | + //치환문자 포함 문자 저장 배열 변수(이벤트 문자 저장) | |
| 1240 | + var evnName = []; | |
| 1241 | + var evnRep1 = []; | |
| 1242 | + var evnRep2 = []; | |
| 1243 | + var evnRep3 = []; | |
| 1244 | + var evnRep4 = []; | |
| 1245 | + | |
| 1246 | + //치환문자 포함 문자 저장 배열 변수(일반 문자 저장) | |
| 1247 | + var norName = []; | |
| 1248 | + var norRep1 = []; | |
| 1249 | + var norRep2 = []; | |
| 1250 | + var norRep3 = []; | |
| 1251 | + var norRep4 = []; | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + /** | |
| 1255 | + Desc: 1. 그림, 치환, 일반 문자에 대해서 각각 이벤트 단가로 전송할 리스트 와 일반단가로 전송할 리스트를 분리 하는 로직 | |
| 1256 | + 2. 그림 및 일반 문자는 단순 이벤트 금액으로 보낼수 있는 건수를 계산하여 리스트[0] 부터 발송 건수만큼 추출하여 evnPhoneNum 배열에 입력 후 이벤트 금액으로 발송 진행 | |
| 1257 | + 3. 이벤트 발송이 완료되면, 이벤트 건수를 제외한 나머지 건수를 norPhoneNum 배열에 입력 후 일반 금액으로 발송 진행 | |
| 1258 | + 4. 일반 발송시에 전송 단가(eachPrice), 전체금액(totPrice) 등 변수 정보 변경 | |
| 1259 | + ===== | |
| 1260 | + 5. 그림문자가 아닌 치환문자인 경우 치환 처리를 진행하면서 단문, 장문을 구분하고 이때 이벤트 금액에서 단문, 장문 가격을 차감하여 보낼 수량을 카운팅 함. | |
| 1261 | + 6. 치환 체크가 완료되면 치환시 나온 카운트 갯수만큼 이벤트 배열과 일반 배열에 분리처리 후 전송함. | |
| 1262 | + Param Array : evnPhoneNum, norPhoneNum | |
| 1263 | + function : getNorEachPrice - 메세지 타입(msgType)에 따른 단문, 장문, 그림문자 개별 단가 금액 확인 | |
| 1264 | + sendMsgAjax - 문자 발송 요청 Ajax 처리 | |
| 1265 | + */ | |
| 1266 | + | |
| 1267 | + //그림문자인 경우 | |
| 1268 | + if(imgCnt > 0){ | |
| 1269 | + | |
| 1270 | + //이벤트 가격으로 전송 할 받는 사람 리스트 저장처리 | |
| 1271 | + for(var i=0; i< evnSendCnt; i++){ | |
| 1272 | + evnPhoneNum[i]= phoneNum[i]; | |
| 1273 | + | |
| 1274 | + //그림문자에 치환문자가 포함된 경우 | |
| 1275 | + if(txtReplYn == 'Y'){ | |
| 1276 | + | |
| 1277 | + evnPhoneNum[i] = phoneNum[i]; | |
| 1278 | + evnName[i] = nameList[i]; | |
| 1279 | + evnRep1[i] = rep1List[i]; | |
| 1280 | + evnRep2[i] = rep2List[i]; | |
| 1281 | + evnRep3[i] = rep3List[i]; | |
| 1282 | + evnRep4[i] = rep4List[i]; | |
| 1283 | + | |
| 1284 | + } | |
| 1285 | + } | |
| 1286 | + | |
| 1287 | + //일반 가격으로 전송 할 받는 사람 리스트 저장처리 | |
| 1288 | + for(var j=0; j < phoneNum.length - evnSendCnt; j++){ | |
| 1289 | + norPhoneNum[j]= phoneNum[j + evnSendCnt]; | |
| 1290 | + | |
| 1291 | + //그림문자에 치환문자가 포함된 경우 | |
| 1292 | + if(txtReplYn == 'Y'){ | |
| 1293 | + | |
| 1294 | + norPhoneNum[j]= phoneNum[j + evnSendCnt]; | |
| 1295 | + norName[j] = nameList[j + evnSendCnt]; | |
| 1296 | + norRep1[j] = rep1List[j + evnSendCnt]; | |
| 1297 | + norRep2[j] = rep2List[j + evnSendCnt]; | |
| 1298 | + norRep3[j] = rep3List[j + evnSendCnt]; | |
| 1299 | + norRep4[j] = rep4List[j + evnSendCnt]; | |
| 1300 | + | |
| 1301 | + } | |
| 1302 | + | |
| 1303 | + }; | |
| 1304 | + | |
| 1305 | + }else if(txtReplYn == 'Y'){//치환 문자가 있는 경우 , 그림문자에 치환이 있는 경우 그림문자 가격으로 발송 | |
| 1306 | + | |
| 1307 | + //이벤트 가격으로 전송 할 받는 사람 리스트 저장처리 | |
| 1308 | + for(var i=0; i< evnPhoneNumCnt; i++){ | |
| 1309 | + evnPhoneNum[i] = phoneNum[i]; | |
| 1310 | + evnName[i] = nameList[i]; | |
| 1311 | + evnRep1[i] = rep1List[i]; | |
| 1312 | + evnRep2[i] = rep2List[i]; | |
| 1313 | + evnRep3[i] = rep3List[i]; | |
| 1314 | + evnRep4[i] = rep4List[i]; | |
| 1315 | + | |
| 1316 | + } | |
| 1317 | + | |
| 1318 | + //일반 가격으로 전송 할 받는 사람 리스트 저장처리 | |
| 1319 | + for(var j=0; j < phoneNum.length - evnPhoneNumCnt; j++){ | |
| 1320 | + norPhoneNum[j]= phoneNum[j + evnPhoneNumCnt]; | |
| 1321 | + norName[j] = nameList[j + evnPhoneNumCnt]; | |
| 1322 | + norRep1[j] = rep1List[j + evnPhoneNumCnt]; | |
| 1323 | + norRep2[j] = rep2List[j + evnPhoneNumCnt]; | |
| 1324 | + norRep3[j] = rep3List[j + evnPhoneNumCnt]; | |
| 1325 | + norRep4[j] = rep4List[j + evnPhoneNumCnt]; | |
| 1326 | + | |
| 1327 | + }; | |
| 1328 | + | |
| 1329 | + }else{//치환문자 없는 경우 처리 | |
| 1330 | + | |
| 1331 | + //이벤트 가격으로 전송 할 받는 사람 리스트 저장처리 | |
| 1332 | + for(var i=0; i< evnSendCnt; i++){ | |
| 1333 | + evnPhoneNum[i]= phoneNum[i]; | |
| 1334 | + } | |
| 1335 | + | |
| 1336 | + //일반 가격으로 전송 할 받는 사람 리스트 저장처리 | |
| 1337 | + for(var j=0; j < phoneNum.length - evnSendCnt; j++){ | |
| 1338 | + norPhoneNum[j]= phoneNum[j + evnSendCnt]; | |
| 1339 | + }; | |
| 1340 | + } | |
| 1341 | + | |
| 1342 | + var orgShortMsgCnt = $("#shortMsgCnt").val(); //단문 총 건수 백업 | |
| 1343 | + var orgLongMsgCnt = $("#longMsgCnt").val(); //장문 총 건수 백업 | |
| 1344 | + //이벤트 단가 문자 전송 처리 시작 | |
| 1345 | + if(evnPhoneNum.length > 0){ | |
| 1346 | + | |
| 1347 | + form.callToList.value = evnPhoneNum; //수신자번호 리스트 저장해주기 | |
| 1348 | + form.totPrice.value = evnEachPrice * evnSendCnt; //이벤트 단가 총 결제금액 셋팅해주기 | |
| 1349 | + form.eventStatus.value = 'Y'; | |
| 1350 | + form.eventYn.value = 'Y'; | |
| 1351 | + | |
| 1352 | + var evnTotPrice = parseFloat(form.totPrice.value); | |
| 1353 | + | |
| 1354 | + if(myPrice < evnTotPrice){ | |
| 1355 | + | |
| 1356 | + alert("문자 발송에 필요한 회원님의 보유 잔액이 부족 합니다."); | |
| 1357 | + return false; | |
| 1358 | + | |
| 1359 | + }else{ | |
| 1360 | + | |
| 1361 | + myPrice = myPrice - evnTotPrice; | |
| 1362 | + | |
| 1363 | + } | |
| 1364 | + | |
| 1365 | + //치환문자가 있는 경우 변수 정보 담아주기(그림문자 아닌경우) | |
| 1366 | + if(txtReplYn == 'Y' && imgCnt < 1){ | |
| 1367 | + | |
| 1368 | + var evnShortMsgCnt = $("#evnShortMsgCnt").val(); | |
| 1369 | + var evnLongMsgCnt = $("#evnLongMsgCnt").val(); | |
| 1370 | + | |
| 1371 | + form.shortMsgCnt.value = evnShortMsgCnt; | |
| 1372 | + form.longMsgCnt.value = evnLongMsgCnt; | |
| 1373 | + form.nameList.value = evnName; | |
| 1374 | + form.rep1List.value = evnRep1; | |
| 1375 | + form.rep2List.value = evnRep2; | |
| 1376 | + form.rep3List.value = evnRep3; | |
| 1377 | + form.rep4List.value = evnRep4; | |
| 1378 | + | |
| 1379 | + }else if(txtReplYn == 'Y' && imgCnt > 0){//치환문자가 있는 경우 변수 정보 담아주기(그림문자인 경우) | |
| 1380 | + | |
| 1381 | + form.nameList.value = evnName; | |
| 1382 | + form.rep1List.value = evnRep1; | |
| 1383 | + form.rep2List.value = evnRep2; | |
| 1384 | + form.rep3List.value = evnRep3; | |
| 1385 | + form.rep4List.value = evnRep4; | |
| 1386 | + | |
| 1387 | + } | |
| 1388 | + | |
| 1389 | + //이벤트 발송 실행 해주기 | |
| 1390 | + var form = document.msgForm; | |
| 1391 | + | |
| 1392 | + var data = new FormData(form); | |
| 1393 | + url = "/web/mjon/msgcampain/sendMsgDataAjax.do"; | |
| 1394 | + | |
| 1395 | + $.ajax({ | |
| 1396 | + type: "POST", | |
| 1397 | + url: url, | |
| 1398 | + data: data, | |
| 1399 | + dataType:'json', | |
| 1400 | + async: true, | |
| 1401 | + processData: false, | |
| 1402 | + contentType: false, | |
| 1403 | + cache: false, | |
| 1404 | + success: function (returnData, status) { | |
| 1405 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 1406 | + if("fail" == returnData.result){ | |
| 1407 | + | |
| 1408 | + alert(returnData.message); | |
| 1409 | + return false; | |
| 1410 | + | |
| 1411 | + }else if("loginFail" == returnData.result){ | |
| 1412 | + | |
| 1413 | + alert(returnData.message); | |
| 1414 | + return false; | |
| 1415 | + | |
| 1416 | + }else if("smsLengFail" == returnData.result){ | |
| 1417 | + | |
| 1418 | + alert(returnData.message); | |
| 1419 | + return false; | |
| 1420 | + | |
| 1421 | + }else if("imgSourceFail" == returnData.result){ | |
| 1422 | + | |
| 1423 | + $('.pop_msg_fails').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 1424 | + $('.pop_msg_fails .msg_text').html(returnData.message); | |
| 1425 | + $('.mask').addClass('on'); | |
| 1426 | + | |
| 1427 | + }else if("spamKeyWordFail" == returnData.result){//스팸 및 스미싱 단어가 들어간 문자 발송시 회원 이용정지 처리 | |
| 1428 | + | |
| 1429 | + $('.pop_msg_spam').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 1430 | + $('.pop_msg_spam .msg_text').html(returnData.message); | |
| 1431 | + $('.mask').addClass('on'); | |
| 1432 | + | |
| 1433 | + }else if("statusFail" == returnData.result){ | |
| 1434 | + | |
| 1435 | + alert(returnData.message); | |
| 1436 | + //문자발송 URL Move | |
| 1437 | + goMsgUrlMove(); | |
| 1438 | + return false; | |
| 1439 | + | |
| 1440 | + }else{ | |
| 1441 | + | |
| 1442 | + var smsCnt = returnData.resultSts; | |
| 1443 | + var blockCnt = returnData.resultBlockSts; | |
| 1444 | + | |
| 1445 | + //이벤트 발송 처리가 완료 되면 나머지 일반 캐시로 발송할 문자 처리를 진행해 준다. | |
| 1446 | + var norPhoneNumCnt = norPhoneNum.length; | |
| 1447 | + if(norPhoneNumCnt > 0){ | |
| 1448 | + | |
| 1449 | + var norEachPrice = getNorEachPrice(evnMsgType); //일반 개별 단가 금액 셋팅해주기 | |
| 1450 | + | |
| 1451 | + form.callToList.value = norPhoneNum; //수신자번호 리스트 저장해주기 | |
| 1452 | + form.eachPrice.value = norEachPrice; //일반 개별 단가 금액 셋팅해주기 | |
| 1453 | + form.totPrice.value = norEachPrice * norPhoneNumCnt; //일반 단가 총 결제 금액 셋팅해주기 | |
| 1454 | + form.sPrice.value = $("#norsPrice").val(); | |
| 1455 | + form.mPrice.value = $("#normPrice").val(); | |
| 1456 | + form.pPrice.value = $("#norpPrice").val(); | |
| 1457 | + form.p2Price.value = $("#norp2Price").val(); | |
| 1458 | + form.p3Price.value = $("#norp3Price").val(); | |
| 1459 | + form.eventStatus.value = 'N'; | |
| 1460 | + form.eventYn.value = 'N'; | |
| 1461 | + | |
| 1462 | + var norTotPrice = parseFloat(form.totPrice.value); | |
| 1463 | + | |
| 1464 | + if(myPrice < norTotPrice){ | |
| 1465 | + | |
| 1466 | + var failMsg = "이벤트 캐시 잔액으로 발송한 문자("+smsCnt+"건)의 발송이 완료되었으나 일반 문자 발송("+norPhoneNumCnt+"건)에 필요한 회원님의 보유 잔액이 부족 합니다."; | |
| 1467 | + | |
| 1468 | + $('.loading_layer').removeClass('active'); | |
| 1469 | + | |
| 1470 | + $('.pop_msg_fails').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 1471 | + $('.pop_msg_fails .msg_text').html(failMsg); | |
| 1472 | + $('.mask').addClass('on'); | |
| 1473 | + | |
| 1474 | + return false; | |
| 1475 | + | |
| 1476 | + } | |
| 1477 | + | |
| 1478 | + //치환문자가 있는 경우 변수 정보 담아주기(그림문자가 아닌경우) | |
| 1479 | + if(txtReplYn == 'Y' && imgCnt < 1){ | |
| 1480 | + | |
| 1481 | + //치환문자 단/장문 혼용된 경우 각 타입별 건수를 재 계산해준다. | |
| 1482 | + //총 단/장문 각각 건수에서 이벤트로 발송한 건수를 빼준다. | |
| 1483 | + var evnShortMsgCnt = $("#evnShortMsgCnt").val(); | |
| 1484 | + var evnLongMsgCnt = $("#evnLongMsgCnt").val(); | |
| 1485 | + | |
| 1486 | + var shortMsgCnt = Number(orgShortMsgCnt) - Number(evnShortMsgCnt); | |
| 1487 | + var longMsgCnt = Number(orgLongMsgCnt) - Number(evnLongMsgCnt); | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + //계산 값이 음수로 나오는 경우 0건으로 간주한다. | |
| 1491 | + if(shortMsgCnt <= 0){ | |
| 1492 | + | |
| 1493 | + shortMsgCnt = 0; | |
| 1494 | + | |
| 1495 | + } | |
| 1496 | + | |
| 1497 | + if(longMsgCnt <= 0){ | |
| 1498 | + | |
| 1499 | + longMsgCnt = 0; | |
| 1500 | + | |
| 1501 | + } | |
| 1502 | + | |
| 1503 | + form.shortMsgCnt.value = shortMsgCnt; | |
| 1504 | + form.longMsgCnt.value = longMsgCnt; | |
| 1505 | + | |
| 1506 | + form.nameList.value = norName; | |
| 1507 | + form.rep1List.value = norRep1; | |
| 1508 | + form.rep2List.value = norRep2; | |
| 1509 | + form.rep3List.value = norRep3; | |
| 1510 | + form.rep4List.value = norRep4; | |
| 1511 | + | |
| 1512 | + }else if(txtReplYn == 'Y' && imgCnt > 0){//치환문자가 있는 경우 변수 정보 담아주기(그림문자인 경우) | |
| 1513 | + | |
| 1514 | + form.nameList.value = norName; | |
| 1515 | + form.rep1List.value = norRep1; | |
| 1516 | + form.rep2List.value = norRep2; | |
| 1517 | + form.rep3List.value = norRep3; | |
| 1518 | + form.rep4List.value = norRep4; | |
| 1519 | + | |
| 1520 | + } | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + sendMsgAjax(smsCnt, blockCnt); | |
| 1524 | + } | |
| 1525 | + | |
| 1526 | + } | |
| 1527 | + | |
| 1528 | + } else if(status== 'fail'){ | |
| 1529 | + alert(returnData.message); | |
| 1530 | + } | |
| 1531 | + }, | |
| 1532 | + beforeSend : function(xmlHttpRequest) { | |
| 1533 | + //로딩창 show | |
| 1534 | + $('.loading_layer').addClass('active'); | |
| 1535 | + }, | |
| 1536 | + complete : function(xhr, textStatus) { | |
| 1537 | + //로딩창 hide | |
| 1538 | + //$('.loading_layer').removeClass('active'); | |
| 1539 | + }, | |
| 1540 | + error: function (e) { alert("문자 발송에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 1541 | + }); | |
| 1542 | + | |
| 1543 | + }else{ | |
| 1544 | + | |
| 1545 | + //이벤트 건수로 발송 할 수 없는 경우 일반 캐시 단가로 발송처리하기 | |
| 1546 | + if(norPhoneNum.length > 0){ | |
| 1547 | + | |
| 1548 | + form.callToList.value = norPhoneNum; //수신자번호 리스트 저장해주기 | |
| 1549 | + form.eachPrice.value = getNorEachPrice(evnMsgType); //일반 개별 단가 금액 셋팅해주기 | |
| 1550 | + form.sPrice.value = $("#norsPrice").val(); | |
| 1551 | + form.mPrice.value = $("#normPrice").val(); | |
| 1552 | + form.pPrice.value = $("#norpPrice").val(); | |
| 1553 | + form.p2Price.value = $("#norp2Price").val(); | |
| 1554 | + form.p3Price.value = $("#norp3Price").val(); | |
| 1555 | + form.eventStatus.value = 'N'; | |
| 1556 | + form.eventYn.value = 'N'; | |
| 1557 | + | |
| 1558 | + sendMsgAjax(0,0); | |
| 1559 | + | |
| 1560 | + }else{ | |
| 1561 | + | |
| 1562 | + alert("문자 전송 중 오류가 발생하였습니다.!!"); | |
| 1563 | + return false; | |
| 1564 | + | |
| 1565 | + } | |
| 1566 | + | |
| 1567 | + } | |
| 1568 | + | |
| 1569 | + return false; | |
| 1570 | + }else{ | |
| 1571 | + | |
| 1572 | + return false; | |
| 1573 | + | |
| 1574 | + } | |
| 1575 | + | |
| 1576 | + }else{ | |
| 1577 | + | |
| 1578 | + //발송 Ajax 호출해주기 | |
| 1579 | + sendMsgAjax(0,0); | |
| 1580 | + | |
| 1581 | + } | |
| 1582 | + | |
| 1583 | + }else{ | |
| 1584 | + | |
| 1585 | + //발송 Ajax 호출해주기 | |
| 1586 | + sendMsgAjax(0,0); | |
| 1587 | + | |
| 1588 | + } | |
| 1589 | + | |
| 1590 | + } | |
| 1591 | + | |
| 1592 | +} | |
| 1593 | + | |
| 1594 | + | |
| 1595 | +//이벤트가 아닌 일반 개별 단가 셋팅해주기 | |
| 1596 | +function getNorEachPrice(evnMsgType){ | |
| 1597 | + | |
| 1598 | + var norEachPrice = 0; | |
| 1599 | + var evnImgCnt = $("#imgCnt").val(); | |
| 1600 | + | |
| 1601 | + //일반 단가로 변경해주기 | |
| 1602 | + if(evnMsgType == '4'){ | |
| 1603 | + | |
| 1604 | + norEachPrice = $("#norsPrice").val(); | |
| 1605 | + console.log("norEachPrice Short::: "+norEachPrice); | |
| 1606 | + | |
| 1607 | + }else if(evnMsgType == '6'){ | |
| 1608 | + | |
| 1609 | + if(evnImgCnt == 0){//장문 가격 | |
| 1610 | + | |
| 1611 | + norEachPrice = $("#normPrice").val(); | |
| 1612 | + console.log("norEachPrice Long ::: "+norEachPrice); | |
| 1613 | + | |
| 1614 | + }else if(evnImgCnt == 1){ | |
| 1615 | + | |
| 1616 | + norEachPrice = $("#norpPrice").val(); | |
| 1617 | + console.log("norEachPrice p1 ::: "+norEachPrice); | |
| 1618 | + | |
| 1619 | + }else if(evnImgCnt == 2){ | |
| 1620 | + | |
| 1621 | + norEachPrice = $("#norp2Price").val(); | |
| 1622 | + console.log("norEachPrice p2 ::: "+norEachPrice); | |
| 1623 | + | |
| 1624 | + }else if(evnImgCnt == 3){ | |
| 1625 | + | |
| 1626 | + norEachPrice = $("#norp3Price").val(); | |
| 1627 | + console.log("norEachPrice p3 ::: "+norEachPrice); | |
| 1628 | + | |
| 1629 | + } | |
| 1630 | + | |
| 1631 | + } | |
| 1632 | + | |
| 1633 | + return norEachPrice; | |
| 1634 | +} | |
| 1635 | + | |
| 1636 | + | |
| 1637 | +function sendMsgAjax(paramSmsCnt, paramBlockCnt){ | |
| 1638 | + | |
| 1639 | + var form = document.msgForm; | |
| 1640 | + var reserYn = $("#reserveYn").val(); | |
| 1641 | + | |
| 1642 | + var data = new FormData(form); | |
| 1643 | + url = "/web/mjon/msgcampain/sendMsgDataAjax.do"; | |
| 1644 | + | |
| 1645 | + $.ajax({ | |
| 1646 | + type: "POST", | |
| 1647 | + url: url, | |
| 1648 | + data: data, | |
| 1649 | + dataType:'json', | |
| 1650 | + async: true, | |
| 1651 | + processData: false, | |
| 1652 | + contentType: false, | |
| 1653 | + cache: false, | |
| 1654 | + success: function (returnData, status) { | |
| 1655 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 1656 | + if("fail" == returnData.result){ | |
| 1657 | + | |
| 1658 | + alert(returnData.message); | |
| 1659 | + return false; | |
| 1660 | + | |
| 1661 | + }else if("loginFail" == returnData.result){ | |
| 1662 | + | |
| 1663 | + alert(returnData.message); | |
| 1664 | + return false; | |
| 1665 | + | |
| 1666 | + }else if("smsLengFail" == returnData.result){ | |
| 1667 | + | |
| 1668 | + alert(returnData.message); | |
| 1669 | + return false; | |
| 1670 | + | |
| 1671 | + }else if("imgSourceFail" == returnData.result){ | |
| 1672 | + | |
| 1673 | + $('.pop_msg_fails').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 1674 | + $('.pop_msg_fails .msg_text').html(returnData.message); | |
| 1675 | + $('.mask').addClass('on'); | |
| 1676 | + | |
| 1677 | + }else if("spamKeyWordFail" == returnData.result){//스팸 및 스미싱 단어가 들어간 문자 발송시 회원 이용정지 처리 | |
| 1678 | + | |
| 1679 | + $('.pop_msg_spam').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 1680 | + $('.pop_msg_spam .msg_text').html(returnData.message); | |
| 1681 | + $('.mask').addClass('on'); | |
| 1682 | + | |
| 1683 | + }else if("statusFail" == returnData.result){ | |
| 1684 | + | |
| 1685 | + alert(returnData.message); | |
| 1686 | + //문자발송 URL Move | |
| 1687 | + goMsgUrlMove(); | |
| 1688 | + return false; | |
| 1689 | + | |
| 1690 | + }else{ | |
| 1691 | + | |
| 1692 | + var smsCnt = Number(returnData.resultSts); | |
| 1693 | + var blockCnt = Number(returnData.resultBlockSts); | |
| 1694 | + | |
| 1695 | + smsCnt = Number(smsCnt) + Number(paramSmsCnt); | |
| 1696 | + blockCnt = Number(blockCnt) + Number(paramBlockCnt); | |
| 1697 | + | |
| 1698 | + if((smsCnt + blockCnt) == 0){ | |
| 1699 | + | |
| 1700 | + $('.pop_msg_spam').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 1701 | + $('.pop_msg_spam .msg_text').html("문자 발송(예약)에 실패하였습니다.<br/> 다시 시도해주세요. <br/>* 정상적으로 발송 시도하였으나 실패하신 경우 혹시 문자내용에 사용불가 이모지 <br/>또는 복사-붙여넣기로 인한 보이지 않는 특수문자가 포함되었는지 확인 후 다시 시도해주세요."); | |
| 1702 | + $('.mask').addClass('on'); | |
| 1703 | + | |
| 1704 | + }else{ | |
| 1705 | + | |
| 1706 | + $('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 1707 | + | |
| 1708 | + //예약발송 건의 경우 결과 팝업 문구 변경 | |
| 1709 | + if(reserYn == 'Y'){ | |
| 1710 | + $('.pop_msg_success .msg_text').html("예약 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 예약 되었습니다."); | |
| 1711 | + }else{ | |
| 1712 | + $('.pop_msg_success .msg_text').html("발송 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 발송 되었습니다."); | |
| 1713 | + } | |
| 1714 | + | |
| 1715 | + $('.mask').addClass('on'); | |
| 1716 | + | |
| 1717 | + } | |
| 1718 | + | |
| 1719 | + } | |
| 1720 | + | |
| 1721 | + } else if(status== 'fail'){ | |
| 1722 | + alert(returnData.message); | |
| 1723 | + } | |
| 1724 | + }, | |
| 1725 | + beforeSend : function(xmlHttpRequest) { | |
| 1726 | + //로딩창 show | |
| 1727 | + $('.loading_layer').addClass('active'); | |
| 1728 | + }, | |
| 1729 | + complete : function(xhr, textStatus) { | |
| 1730 | + //로딩창 hide | |
| 1731 | + $('.loading_layer').removeClass('active'); | |
| 1732 | + }, | |
| 1733 | + error: function (e) { alert("문자 발송에 실패하였습니다."); console.log("ERROR : ", e); } | |
| 1734 | + }); | |
| 1735 | + | |
| 1736 | +} | |
| 1737 | + | |
| 1738 | + | |
| 1739 | +function linkPage(pageNo){ | |
| 1740 | + fnLetterListAjax(pageNo); | |
| 1741 | +} | |
| 1742 | + | |
| 1743 | + | |
| 1744 | +function linkPhoPage(pageNo){ | |
| 1745 | + fnPhotoListAjax(pageNo); | |
| 1746 | +} | |
| 1747 | + | |
| 1748 | +function myMsgPage(pageNo){ | |
| 1749 | + fnMyMsgListAjax(pageNo); | |
| 1750 | +} | |
| 1751 | + | |
| 1752 | +function fnMyMsgCheckDelete(){ | |
| 1753 | + | |
| 1754 | + var msgId = []; | |
| 1755 | + if($("input:checkbox[name='myMsgDel']").is(":checked")==false){ | |
| 1756 | + alert("선택된 항목이 없습니다."); | |
| 1757 | + return; | |
| 1758 | + } | |
| 1759 | + | |
| 1760 | + $("input:checkbox[name='myMsgDel']:checked").each(function(index){ | |
| 1761 | + | |
| 1762 | + msgId[index] = $(this).val(); | |
| 1763 | + | |
| 1764 | + }); | |
| 1765 | + | |
| 1766 | + if(msgId.length > 0){ | |
| 1767 | + | |
| 1768 | + document.myMsgForm.msgIdList.value = msgId; | |
| 1769 | + var sendData = $(document.myMsgForm).serializeArray(); | |
| 1770 | + | |
| 1771 | + $("#myMsgLoad").load("/web/mjon/msgcampain/deleteMyMsgDataListAjax.do", sendData ,function(response, status, xhr){ | |
| 1772 | + | |
| 1773 | + //문자 내용 스크롤 적용 | |
| 1774 | + /* $(".msg_cont").mCustomScrollbar({ | |
| 1775 | + axis: 'y', | |
| 1776 | + scrollbarPosition: "inside", | |
| 1777 | + theme: "dark", | |
| 1778 | + autoHideScrollbar: false | |
| 1779 | + }); */ | |
| 1780 | + | |
| 1781 | + }); | |
| 1782 | + | |
| 1783 | + }else{ | |
| 1784 | + | |
| 1785 | + alert("삭제할 문자를 선택해 주세요."); | |
| 1786 | + return false; | |
| 1787 | + | |
| 1788 | + } | |
| 1789 | + | |
| 1790 | +} | |
| 1791 | + | |
| 1792 | +//문자 샘플 2줄, 4줄 보기 기능 | |
| 1793 | +function fnLPageUnit(){ | |
| 1794 | + | |
| 1795 | + var form = document.letterForm; | |
| 1796 | + var pageUnit = form.LPageUnit.value; | |
| 1797 | + | |
| 1798 | + form.pageUnit.value = pageUnit; | |
| 1799 | + fnLetterListAjax(); | |
| 1800 | + | |
| 1801 | +} | |
| 1802 | + | |
| 1803 | +//그림문자 샘플 2줄, 4줄 보기 기능 | |
| 1804 | +function fnPhPageUnit(){ | |
| 1805 | + | |
| 1806 | + var form = document.letterForm; | |
| 1807 | + var pageUnit = form.PhPageUnit.value; | |
| 1808 | + | |
| 1809 | + form.pageUnit.value = pageUnit; | |
| 1810 | + fnPhotoListAjax(); | |
| 1811 | + | |
| 1812 | +} | |
| 1813 | + | |
| 1814 | +//그림문자 샘플 2줄, 4줄 보기 기능 | |
| 1815 | +function fnPhPageUnit(){ | |
| 1816 | + | |
| 1817 | + var form = document.letterForm; | |
| 1818 | + var pageUnit = form.PhPageUnit.value; | |
| 1819 | + | |
| 1820 | + form.pageUnit.value = pageUnit; | |
| 1821 | + fnPhotoListAjax(); | |
| 1822 | + | |
| 1823 | +} | |
| 1824 | + | |
| 1825 | +function fnMsgPageUnit(){ | |
| 1826 | + | |
| 1827 | + var form = document.myMsgForm; | |
| 1828 | + var pageUnit = form.msgPageUnit.value; | |
| 1829 | + | |
| 1830 | + form.pageUnit.value = pageUnit; | |
| 1831 | + fnMyMsgListAjax(); | |
| 1832 | + | |
| 1833 | +} | |
| 1834 | + | |
| 1835 | +function fnMyMsgSearchListOrd(){ | |
| 1836 | + | |
| 1837 | + var form = document.myMsgForm; | |
| 1838 | + var sortOrd = form.searchSortOrd.value; | |
| 1839 | + | |
| 1840 | + if(sortOrd == 'desc'){ | |
| 1841 | + | |
| 1842 | + form.searchSortOrd.value = 'asc'; | |
| 1843 | + $('#sortCnd').text('등록순'); | |
| 1844 | + | |
| 1845 | + }else{ | |
| 1846 | + | |
| 1847 | + form.searchSortOrd.value = 'desc'; | |
| 1848 | + $('#sortCnd').text('최근순'); | |
| 1849 | + | |
| 1850 | + } | |
| 1851 | + | |
| 1852 | + //내문자함 내용 검색하기 | |
| 1853 | + fnMyMsgSearchListAjax(1); | |
| 1854 | + | |
| 1855 | +} | |
| 1856 | + | |
| 1857 | +function msgSuccessClose(obj){ | |
| 1858 | + $(obj).closest('.pop_msg_success').attr('style',''); | |
| 1859 | + //문자발송 URL Move | |
| 1860 | + goMsgUrlMove(); | |
| 1861 | + $('html').scrollTop(0); | |
| 1862 | +} | |
| 1863 | + | |
| 1864 | +function msgFailsClose(obj){ | |
| 1865 | + $(obj).closest('.pop_msg_fails').attr('style',''); | |
| 1866 | +} | |
| 1867 | + | |
| 1868 | +function msgSpamClose(obj){ | |
| 1869 | + $(obj).closest('.pop_msg_spam').attr('style',''); | |
| 1870 | + //location.href="/web/uat/uia/actionLogout.do"; | |
| 1871 | +} | |
| 1872 | + | |
| 1873 | +function msgResultLink(){ | |
| 1874 | + var reserYn = $("input[name=reserYn]:checked").val(); // 예약 발송 여부 확인 | |
| 1875 | + if(reserYn == 'Y'){ | |
| 1876 | + | |
| 1877 | + location.href="/web/mjon/reservmsg/selectReservMsgView.do"; | |
| 1878 | + | |
| 1879 | + }else{ | |
| 1880 | + | |
| 1881 | + location.href="/web/mjon/msgsent/selectMsgSentView.do"; | |
| 1882 | + | |
| 1883 | + } | |
| 1884 | + | |
| 1885 | +} | |
| 1886 | + | |
| 1887 | +//START | |
| 1888 | +//맞춤제작 요청 JSPark => 2023.02.21 추가 | |
| 1889 | +//맞춤제작 등록 Popup | |
| 1890 | +function customPopup(){ | |
| 1891 | + $("#customPopup").load("/web/mjon/custom/selectMsgCustomPopupAjax.do", "" ,function(response, status, xhr){ | |
| 1892 | + popupImgList(1); | |
| 1893 | + }); | |
| 1894 | +} | |
| 1895 | + | |
| 1896 | +function openMsgCustomPopup() { | |
| 1897 | + if(loginVO == "" || loginVO == null){ | |
| 1898 | + alert("로그인 후 이용이 가능합니다."); | |
| 1899 | + return false; | |
| 1900 | + } else { | |
| 1901 | + $("#customPopupOpen").trigger("click"); | |
| 1902 | + } | |
| 1903 | + $("#customType04").hide(); | |
| 1904 | + popCustomScrT=$(window).scrollTop(); | |
| 1905 | + popScrTarget(); | |
| 1906 | +} | |
| 1907 | + | |
| 1908 | +$(window).on('load',function(){ | |
| 1909 | + setTimeout(function(){ | |
| 1910 | + popScrTarget(); | |
| 1911 | + },500); | |
| 1912 | +}); | |
| 1913 | + | |
| 1914 | +function popScrTarget(){ | |
| 1915 | + var closeTarget=$('.custom_layer .tooltip-close'); | |
| 1916 | + closeTarget.attr('onclick','popScrCloseSetting();'); | |
| 1917 | +} | |
| 1918 | + | |
| 1919 | +function popScrCloseSetting(){ | |
| 1920 | + setTimeout(function(){ | |
| 1921 | + $(window).scrollTop(popCustomScrT); | |
| 1922 | + },1); | |
| 1923 | +} | |
| 1924 | +//END | |
| 1925 | +</script> | |
| 1926 | + <div class="tooltip-wrap"> | |
| 1927 | + <!-- 문자발송 성공 레이어팝업 --> | |
| 1928 | + <div class="popup-com pop_msg_success"> | |
| 1929 | + <div class="popup_heading"> | |
| 1930 | + <p>문자 전송 결과</p> | |
| 1931 | + <button type="button" class="tooltip-close" onclick="msgSuccessClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1932 | + </div> | |
| 1933 | + <div class="layer_in"> | |
| 1934 | + <div class="msg_text">발송성공 : <strong>1</strong> 건, 수신거부 : <span>0</span>건의<br>문자가 발송 되었습니다.</div> | |
| 1935 | + </div> | |
| 1936 | + <div class="popup_btn"> | |
| 1937 | + <button type="button" onclick="msgResultLink(); return false;">문자 발송결과 바로가기</button> | |
| 1938 | + <button type="button" class="tooltip-close" onclick="msgSuccessClose(this);">확인</button> | |
| 1939 | + </div> | |
| 1940 | + </div> | |
| 1941 | + </div> | |
| 1942 | + <div class="tooltip-wrap"> | |
| 1943 | + <!-- 문자발송 실패 레이어팝업 --> | |
| 1944 | + <div class="popup-com pop_msg_fails"> | |
| 1945 | + <div class="popup_heading"> | |
| 1946 | + <p>문자 전송 결과</p> | |
| 1947 | + <button type="button" class="tooltip-close" onclick="msgFailsClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1948 | + </div> | |
| 1949 | + <div class="layer_in"> | |
| 1950 | + <div class="msg_text">발송성공 : <strong>1</strong> 건, 수신거부 : <span>0</span>건의<br>문자가 발송 되었습니다.</div> | |
| 1951 | + </div> | |
| 1952 | + <div class="popup_btn"> | |
| 1953 | + <button type="button" class="tooltip-close" onclick="msgFailsClose(this);">확인</button> | |
| 1954 | + </div> | |
| 1955 | + </div> | |
| 1956 | + </div> | |
| 1957 | + <div class="tooltip-wrap"> | |
| 1958 | + <!-- 문자발송 스팸 이용정지 레이어팝업 --> | |
| 1959 | + <div class="popup-com pop_msg_spam"> | |
| 1960 | + <div class="popup_heading"> | |
| 1961 | + <p>문자 전송 결과</p> | |
| 1962 | + <button type="button" class="tooltip-close" onclick="msgSpamClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1963 | + </div> | |
| 1964 | + <div class="layer_in"> | |
| 1965 | + <div class="msg_text"></div> | |
| 1966 | + </div> | |
| 1967 | + <div class="popup_btn"> | |
| 1968 | + <button type="button" class="tooltip-close" onclick="msgSpamClose(this);">확인</button> | |
| 1969 | + </div> | |
| 1970 | + </div> | |
| 1971 | + </div> | |
| 1972 | + <div class="inner"> | |
| 1973 | + <!-- send top --> | |
| 1974 | + <div class="send_top"> | |
| 1975 | + <!-- tab button --> | |
| 1976 | + <ul class="tabType1"> | |
| 1977 | + <li class="tab active"> | |
| 1978 | + <%-- <button type="button" onclick="TabType1(this,'1');">단문 · 장문 · 그림 문자</button> --%> | |
| 1979 | + <button type="button" onclick="TabType1(this,'1');">단체문자(자동동보문자)</button> | |
| 1980 | + </li> | |
| 1981 | + <li class="tab"> | |
| 1982 | + <%-- <button type="button" onclick="TabType1(this,'2');">대량 문자(엑셀·TXT)</button> --%> | |
| 1983 | + <%-- <button type="button" onclick="javascript:fnMsgExcelDataView(); return false;">단체문자(엑셀·TXT)</button> --%> | |
| 1984 | + <button type="button" onclick="javascript:fnMsgTWDataView(); return false;">20건 문자(수동문자)</button> | |
| 1985 | + </li> | |
| 1986 | + </ul><!--// tab button --> | |
| 1987 | + <!-- tab content1 --> | |
| 1988 | + <!-- <span id="contentArea"></span> --> | |
| 1989 | + <div class="top_content current election contentArea" id="tab1_1" style="min-height: 555px;"></div> | |
| 1990 | + | |
| 1991 | + <!-- tab content2 --> | |
| 1992 | + <!-- <span id="contentExcelArea"></span> --> | |
| 1993 | + <!-- <div class="top_content current get_excel contentExcelArea" id="tab1_2"></div> --> | |
| 1994 | + </div><!--// send top --> | |
| 1995 | + <!-- send bottom --> | |
| 1996 | + <div class="send_bottom"> | |
| 1997 | + <!-- tab button --> | |
| 1998 | + <ul class="tabType2 selectedTab"> | |
| 1999 | + <li class="tab active"><button type="button" onclick="TabType2(this,'1');">문자 샘플</button></li> | |
| 2000 | + <li class="tab"><button type="button" onclick="TabType2(this,'2');">그림문자 샘플</button></li> | |
| 2001 | + <li class="tab"><button type="button" onclick="TabType2(this,'3');">지도/약도 추가</button></li> | |
| 2002 | + <li class="tab"><button type="button" onclick="TabType2(this,'4');">내 문자함</button></li> | |
| 2003 | + </ul> | |
| 2004 | + <!--// tab button --> | |
| 2005 | + <!-- tab content1 --> | |
| 2006 | + <form id="letterForm" name="letterForm" method="post"> | |
| 2007 | + <input type="hidden" id="letterType" name="letterType" value="<c:out value='${letterVO.letterType}'/>"/> | |
| 2008 | + <input type="hidden" id="memberType" name="memberType" value="<c:out value='${letterVO.memberType}'/>"/> | |
| 2009 | + <input type="hidden" id="categoryCode" name="categoryCode" value="<c:out value='${letterVO.categoryCode}'/>"/> | |
| 2010 | + <input type="hidden" id="hashTag" name="hashTag" value="<c:out value='${letterVO.hashTag}'/>"/> | |
| 2011 | + <input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value='${letterVO.pageIndex}' default='1' /> "/> | |
| 2012 | + <input type="hidden" id="pageUnit" name="pageUnit" value="<c:out value='${letterVO.pageUnit}'/>"/> | |
| 2013 | + <input type="hidden" id="upperCateNo" name="upperCateNo" value=""/> | |
| 2014 | + <input type="hidden" id="bestCategory" name="bestCategory" value="<c:out value='${letterVO.bestCategory}'/>"/> | |
| 2015 | + | |
| 2016 | + <div class="search_sample"> | |
| 2017 | + <input type="text" id="searchKeyword" name="searchKeyword" value="<c:out value='${letterVO.searchKeyword}'/>" placeholder="문자샘플 검색하기" onfocus="this.placeholder=''" onblur="this.placeholder='문자샘플 검색하기'" maxlength="10"> | |
| 2018 | + <button class="btnSearchF"><img src="/publish/images/search02.png" alt=""></button> | |
| 2019 | + </div> | |
| 2020 | + <!-- tab content1 --> | |
| 2021 | + <div class="bottom_content current" id="tab2_1"> | |
| 2022 | + <div class="area_tabs"> | |
| 2023 | + <div class="top_tab"> | |
| 2024 | + <!-- <div class="tab_depth1 tDep1_mType"> | |
| 2025 | + <a href="#none" class="on" value="">전체</a> | |
| 2026 | + <a href="#none" value="B">기업</a> | |
| 2027 | + <a href="#none" value="P">개인</a> | |
| 2028 | + <div class="on_active">전체</div> | |
| 2029 | + </div> --> | |
| 2030 | + <div class="tab_depth2 tDep1_letType"> | |
| 2031 | + <a href="#none" class="on" value="S">단문문자</a> | |
| 2032 | + <a href="#none" value="L">장문문자</a> | |
| 2033 | + </div> | |
| 2034 | + <select name="LPageUnit" id="LPageUnit" class="selType2" onChange="fnLPageUnit(); return false;"> | |
| 2035 | + <option value="10">2줄보기</option> | |
| 2036 | + <option value="20">4줄보기</option> | |
| 2037 | + <option value="30">6줄보기</option> | |
| 2038 | + </select> | |
| 2039 | + <div class="customReq"> | |
| 2040 | + <%-- 맞춤제작 요청 JSPark => 2023.02.21 추가 --%> | |
| 2041 | + <%-- | |
| 2042 | + <input type="hidden" id="customPopupOpen" data-tooltip="popup01"> | |
| 2043 | + <button type="button" onclick="openMsgCustomPopup(); return false;"><i></i>맞춤제작 요청</button> | |
| 2044 | + --%> | |
| 2045 | + <button type="button" onClick="location.href='/web/mjon/custom/selectMsgCustomView.do'"><i></i>맞춤제작 요청</button> | |
| 2046 | + </div> | |
| 2047 | + </div> | |
| 2048 | + <div class="bottom_tab"> | |
| 2049 | + <div class="tab_depth3 tDep1_cateCode"> | |
| 2050 | + <a href="#none" class="on cateAll" value="">All</a> | |
| 2051 | + <a href="#none" value="best">BEST</a> | |
| 2052 | + <c:forEach var="cateList" items="${cateCodeList}" varStatus="status"> | |
| 2053 | + <a href="#none" value="<c:out value='${cateList.cateCode}'/>"><c:out value="${cateList.cateNm}"/></a> | |
| 2054 | + </c:forEach> | |
| 2055 | + </div> | |
| 2056 | + <div class="tab_depth4 tDep1_threeCateCode" id="tDep1_depThrCateCode"> <!-- 해쉬태그 삭제 및 하위 카테고리 추가로 인해 class="tDep1_hashTag" 삭제 --> | |
| 2057 | + <%-- <a href="#none" class="on hashAll" value="">전체</a> | |
| 2058 | + <c:forEach var="hashList" items="${hashTagList}" varStatus="status"> | |
| 2059 | + <a href="#none" value="${hashList.hashNm}">#<c:out value="${hashList.hashNm}"/></a> | |
| 2060 | + </c:forEach> --%> | |
| 2061 | + </div> | |
| 2062 | + </div> | |
| 2063 | + </div> | |
| 2064 | + <div id="letterLoad"> | |
| 2065 | + </div> | |
| 2066 | + </div><!--// tab content1 --> | |
| 2067 | + <!--// tab content2 --> | |
| 2068 | + <div class="bottom_content" id="tab2_2"> | |
| 2069 | + <div class="area_tabs"> | |
| 2070 | + <div class="top_tab"> | |
| 2071 | + <!-- <div class="tab_depth1 tDep2_mType"> | |
| 2072 | + <a href="#none" class="on" value="">전체</a> | |
| 2073 | + <a href="#none" value="B">기업</a> | |
| 2074 | + <a href="#none" class="on" value="P">개인</a> | |
| 2075 | + <div class="on_active">전체</div> | |
| 2076 | + </div> --> | |
| 2077 | + <div class="tab_depth2 tDep2_letType"> | |
| 2078 | + <a href="#none" class="on" value="P">그림문자</a> | |
| 2079 | + </div> | |
| 2080 | + <select name="PhPageUnit" id="PhPageUnit" class="selType2" onChange="fnPhPageUnit(); return false;"> | |
| 2081 | + <option value="10">2줄보기</option> | |
| 2082 | + <option value="20">4줄보기</option> | |
| 2083 | + <option value="30">6줄보기</option> | |
| 2084 | + </select> | |
| 2085 | + <div class="customReq"> | |
| 2086 | + <%-- 맞춤제작 요청 JSPark => 2023.02.21 추가 --%> | |
| 2087 | + <%-- | |
| 2088 | + <input type="hidden" id="customPopupOpen" data-tooltip="popup01"> | |
| 2089 | + <button type="button" onclick="openMsgCustomPopup(); return false;"><i></i>맞춤제작 요청</button> | |
| 2090 | + --%> | |
| 2091 | + <button type="button" onClick="location.href='/web/mjon/custom/selectMsgCustomView.do'"><i></i>맞춤제작 요청</button> | |
| 2092 | + </div> | |
| 2093 | + </div> | |
| 2094 | + <div class="bottom_tab"> | |
| 2095 | + <div class="tab_depth3 tDep2_cateCode"> | |
| 2096 | + <a href="#none" class="on cateAll" value="">All</a> | |
| 2097 | + <a href="#none" value="best">BEST</a> | |
| 2098 | + <c:forEach var="cateList" items="${cateCodeList}" varStatus="status"> | |
| 2099 | + <a href="#none" value="<c:out value='${cateList.cateCode}'/>"><c:out value="${cateList.cateNm}"/></a> | |
| 2100 | + </c:forEach> | |
| 2101 | + </div> | |
| 2102 | + <div class="tab_depth4 tDep2_threeCateCode" id="tDep2_depThrCateCode"><!-- 해쉬태그 삭제 및 하위 카테고리 추가로 인해 class="tDep2_hashTag" 삭제 --> | |
| 2103 | + <!-- 하위 카테고리(3뎁스)로 대체 --> | |
| 2104 | + <%-- <a href="#none" class="on hashAll" value="">전체</a> | |
| 2105 | + <c:forEach var="hashList" items="${hashTagList}" varStatus="status"> | |
| 2106 | + <a href="#none" value="${hashList.hashNm}">#<c:out value="${hashList.hashNm}"/></a> | |
| 2107 | + </c:forEach> --%> | |
| 2108 | + </div> | |
| 2109 | + </div> | |
| 2110 | + </div> | |
| 2111 | + <div id="photoLoad"> | |
| 2112 | + </div> | |
| 2113 | + <!-- pagination --> | |
| 2114 | + </div><!--// tab content2 --> | |
| 2115 | + </form> | |
| 2116 | + | |
| 2117 | + <!--tab content3 --> | |
| 2118 | + <div class="bottom_content" id="tab2_3"> | |
| 2119 | + <div class="map_search"> | |
| 2120 | + <label for="" class="label"></label> | |
| 2121 | + <div class="mapWrap"> | |
| 2122 | + <script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script> | |
| 2123 | + <script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=7fc7b80a3e32ac964da92f6aa3d6000d&libraries=services"></script> | |
| 2124 | + <input type="text" id="sample5_address" placeholder="도로명 또는 지번을 입력해주세요." onfocus="this.placeholder=''" onblur="this.placeholder='도로명 또는 지번을 입력해주세요.'"> | |
| 2125 | + <button type="button" class="btnType map_check" onclick="sample5_execDaumPostcode()">확인</button> | |
| 2126 | + <button type="button" class="btnType map_add" onclick="insertajax();">약도링크 추가</button> | |
| 2127 | + <p><span class="vMiddle">*</span> 지도링크는 입력메시지 끝부분에 추가됩니다.</p> | |
| 2128 | + <div id="map" style="width:100%;height:450px; margin-top: 10px;"> </div> | |
| 2129 | + | |
| 2130 | + <div class="mapInfo"> | |
| 2131 | + </div> | |
| 2132 | + </div> | |
| 2133 | + </div> | |
| 2134 | + <script> | |
| 2135 | + var mapContainer = document.getElementById('map'), // 지도를 표시할 div | |
| 2136 | + mapOption = { | |
| 2137 | + center: new daum.maps.LatLng(37.613898152040385, 127.15319231152851), // 지도의 중심좌표 | |
| 2138 | + level: 5 // 지도의 확대 레벨 | |
| 2139 | + }; | |
| 2140 | + | |
| 2141 | + //지도를 미리 생성 | |
| 2142 | + var map = new daum.maps.Map(mapContainer, mapOption); | |
| 2143 | + //주소-좌표 변환 객체를 생성 | |
| 2144 | + var geocoder = new daum.maps.services.Geocoder(); | |
| 2145 | + //마커를 미리 생성 | |
| 2146 | + var marker = new daum.maps.Marker({ | |
| 2147 | + position: new daum.maps.LatLng(37.613898152040385, 127.15319231152851), | |
| 2148 | + map: map | |
| 2149 | + }); | |
| 2150 | + var testcoords = new daum.maps.LatLng(37.613898152040385, 127.15319231152851); | |
| 2151 | + setTimeout(function(){ | |
| 2152 | + map.relayout(); | |
| 2153 | + map.setCenter(testcoords); | |
| 2154 | + }, 5000); | |
| 2155 | + | |
| 2156 | + //lat 위도 lng 경도 | |
| 2157 | + var paramLat; | |
| 2158 | + var paramLng; | |
| 2159 | + | |
| 2160 | + function sample5_execDaumPostcode() { | |
| 2161 | + new daum.Postcode({ | |
| 2162 | + oncomplete: function(data) { | |
| 2163 | + var addr = data.address; // 최종 주소 변수 | |
| 2164 | + | |
| 2165 | + // 주소 정보를 해당 필드에 넣는다. | |
| 2166 | + document.getElementById("sample5_address").value = addr; | |
| 2167 | + // 주소로 상세 정보를 검색 | |
| 2168 | + geocoder.addressSearch(data.address, function(results, status) { | |
| 2169 | + // 정상적으로 검색이 완료됐으면 | |
| 2170 | + if (status === daum.maps.services.Status.OK) { | |
| 2171 | + | |
| 2172 | + var result = results[0]; //첫번째 결과의 값을 활용 | |
| 2173 | + | |
| 2174 | + // 해당 주소에 대한 좌표를 받아서 | |
| 2175 | + var coords = new daum.maps.LatLng(result.y, result.x); | |
| 2176 | + // 지도를 보여준다. | |
| 2177 | + mapContainer.style.display = "block"; | |
| 2178 | + map.relayout(); | |
| 2179 | + // 지도 중심을 변경한다. | |
| 2180 | + map.setCenter(coords); | |
| 2181 | + // 마커를 결과값으로 받은 위치로 옮긴다. | |
| 2182 | + marker.setPosition(coords) | |
| 2183 | + paramLat = result.y; | |
| 2184 | + paramLng = result.x; | |
| 2185 | + | |
| 2186 | + } | |
| 2187 | + }); | |
| 2188 | + } | |
| 2189 | + }).open({ | |
| 2190 | + q: document.getElementById("sample5_address").value | |
| 2191 | + }); | |
| 2192 | + } | |
| 2193 | + | |
| 2194 | + function insertajax(){ | |
| 2195 | + var mapInsertConfirm = confirm('약도를 추가하시겠습니까?'); | |
| 2196 | + | |
| 2197 | + if(mapInsertConfirm){ | |
| 2198 | + $.ajax({ | |
| 2199 | + cache : false, | |
| 2200 | + url : "<c:url value='/MapUrlInsertAjax.do'/>", | |
| 2201 | + type : 'POST', | |
| 2202 | + data : { | |
| 2203 | + "mapLat" : paramLat, | |
| 2204 | + "mapLng" : paramLng | |
| 2205 | + }, | |
| 2206 | + dataType:'json', | |
| 2207 | + success : function(returnData, status){ | |
| 2208 | + if(status == "success") { | |
| 2209 | + if (returnData.url != 0) { | |
| 2210 | + var smsTxttmp = $('#smsTxtArea').val(); | |
| 2211 | + | |
| 2212 | + /* document.getElementById("testarea").value = returnData.url + "/MapUrl.do?seq=" + returnData.seq; */ | |
| 2213 | + $('#smsTxtArea').val(smsTxttmp+returnData.url + "/MapUrl.do?seq=" + returnData.seq); | |
| 2214 | + | |
| 2215 | + smsTxttmp = $('#smsTxtArea').val(); | |
| 2216 | + | |
| 2217 | + fnByteString(smsTxttmp); | |
| 2218 | + } | |
| 2219 | + }else{ alert("ERROR!");return;} | |
| 2220 | + }, | |
| 2221 | + | |
| 2222 | + error : function(request , status, error){ | |
| 2223 | + alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); | |
| 2224 | + | |
| 2225 | + } | |
| 2226 | + }); | |
| 2227 | + } | |
| 2228 | + else{ | |
| 2229 | + alert("취소되었습니다."); | |
| 2230 | + } | |
| 2231 | + } | |
| 2232 | + </script> | |
| 2233 | + </div><!--// tab content3 --> | |
| 2234 | + <!-- tab content4 --> | |
| 2235 | + <form id="myMsgForm" name="myMsgForm" method="post"> | |
| 2236 | + <input name="pageIndex" type="hidden" value="1"/> | |
| 2237 | + <input name="msgIdList" type="hidden" value=""/> | |
| 2238 | + <input name="pageUnit" type="hidden" value=""/> | |
| 2239 | + <input name="searchSortOrd" type="hidden" value="desc"/> | |
| 2240 | + <input name="msgKind" type="hidden" value="C"/> | |
| 2241 | + <div class="bottom_content" id="tab2_4"> | |
| 2242 | + <div class="search_wrap clearfix"> | |
| 2243 | + <div class="btn_left"> | |
| 2244 | + <span>· 기간</span> | |
| 2245 | + <div class="calendar_wrap"> | |
| 2246 | + <input type="text" class="startDate inp calendar" title="검색 시작일" id="startDate" name="myMsgStDt" value="" data-datecontrol="true"> | |
| 2247 | + <span class="dateEtc">~</span> | |
| 2248 | + <input type="text" class="endDate inp calendar" title="검색 종료일" id="endDate" name="myMsgEndDt" value="" data-datecontrol="true"> | |
| 2249 | + </div> | |
| 2250 | + <div class="search"> | |
| 2251 | + <label for="searchWord" class="label"></label> | |
| 2252 | + <input type="text" id="searchWord" name="searchKeyword" placeholder="내 문자함 검색" onfocus="this.placeholder=''" onblur="this.placeholder='내보관함 검색'" maxlength="10"> | |
| 2253 | + <button type="button" class="btnType btnType2" onclick="javascript:fnMyMsgSearchListAjax(1); return false;">검색</button> | |
| 2254 | + </div> | |
| 2255 | + </div> | |
| 2256 | + <div class="btn_right"> | |
| 2257 | + <button type="button" id="sortOrd" name="sortOrd" onClick="javascript:fnMyMsgSearchListOrd(); return false;"><span id="sortCnd">최근순</span><i></i></button> | |
| 2258 | + <select name="msgType" id="msgType1" class="selType2" onChange="fnMyMsgSearchListAjax(1); return false;"> | |
| 2259 | + <option value="">전체보기</option> | |
| 2260 | + <option value="S">단문문자</option> | |
| 2261 | + <option value="L">장문문자</option> | |
| 2262 | + <option value="P">그림문자</option> | |
| 2263 | + </select> | |
| 2264 | + <select name="msgPageUnit" id="msgPageUnit" class="selType2" onChange="fnMsgPageUnit(); return false;"> | |
| 2265 | + <option value="10">2줄보기</option> | |
| 2266 | + <option value="20">4줄보기</option> | |
| 2267 | + <option value="30">6줄보기</option> | |
| 2268 | + </select> | |
| 2269 | + </div> | |
| 2270 | + </div> | |
| 2271 | + <div id="myMsgLoad"> | |
| 2272 | + </div> | |
| 2273 | + </div><!--// tab content4 --> | |
| 2274 | + </form> | |
| 2275 | + </div><!-- inner close --> | |
| 2276 | + | |
| 2277 | + <!-- 맞춤제작 요청 레이어 팝업 --> | |
| 2278 | + <div class="tooltip-wrap" id="customPopup"> | |
| 2279 | + </div> | |
| 2280 | + <!--// 맞춤제작 요청 레이어 팝업 --> | |
| 2281 | +</div> | |
| 2282 | +<form id="msgResendForm" name="msgResendForm" method="post"> | |
| 2283 | + <input name="msgResendFlag" type="hidden" value="N"/> | |
| 2284 | + <input name="msgSeqList" type="hidden" value=""/> | |
| 2285 | +</form> | |
| 2286 | +<form id="moveAddrForm" name="moveAddrForm" method="post"> | |
| 2287 | + <input name="moveAddrFlag" type="hidden" value="N"/> | |
| 2288 | + <input name="addrIdList" type="hidden" value=""/> | |
| 2289 | +</form> |
--- src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgcampain/tw/MsgTWDataSMLView.jsp
... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 |
function updateTotCnt(data){
|
| 34 | 34 |
|
| 35 | 35 |
var rowTotCnt = data; |
| 36 |
- $("#rowTotCnt").text(rowTotCnt);
|
|
| 36 |
+ $("#rowTotCnt").text(numberWithCommas(rowTotCnt));
|
|
| 37 | 37 |
|
| 38 | 38 |
} |
| 39 | 39 |
|
--- src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp
... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 |
function updateTotCnt(data){
|
| 24 | 24 |
|
| 25 | 25 |
var rowTotCnt = data; |
| 26 |
- $("#rowTotCnt").text(rowTotCnt);
|
|
| 26 |
+ $("#rowTotCnt").text(numberWithCommas(rowTotCnt));
|
|
| 27 | 27 |
|
| 28 | 28 |
} |
| 29 | 29 |
|
--- src/main/webapp/WEB-INF/jsp/web/msgdata/excel/MsgExcelDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/excel/MsgExcelDataSMLView.jsp
... | ... | @@ -166,7 +166,7 @@ |
| 166 | 166 |
function updateTotCnt(data){
|
| 167 | 167 |
|
| 168 | 168 |
var rowTotCnt = data; |
| 169 |
- $("#rowTotCnt").text(rowTotCnt);
|
|
| 169 |
+ $("#rowTotCnt").text(numberWithCommas(rowTotCnt));
|
|
| 170 | 170 |
|
| 171 | 171 |
} |
| 172 | 172 |
|
+++ src/main/webapp/dist/js/tabulator_5.4.js
... | ... | @@ -0,0 +1,3 @@ |
| 1 | +/* Tabulator v5.4.4 (c) Oliver Folkerd 2023 */ | |
| 2 | +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Tabulator=t()}(this,(function(){"use strict";class e{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t){return this.table.deprecationAdvisor.check(e,t)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class t{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}getParentColumn(){return this._column.parent instanceof n&&this._column.parent.getComponent()}_getSelf(){return this._column}scrollTo(){return this._column.table.columnManager.scrollToColumn(this._column)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return!!e&&e.getComponent()}getPrevColumn(){var e=this._column.prevColumn();return!!e&&e.getComponent()}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var i={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};class s{constructor(e){return this._cell=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(){return this._cell.row.getData()}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class o extends e{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell")}_configureCell(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((t=>{e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(typeof(e=this.chain("cell-format",this,null,(()=>this.element.innerHTML=this.value)))){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",null!=e&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new s(this)),this.component}}class n extends e{constructor(e,t){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach(((e,t)=>{var i=new n(e,this);this.attachColumn(i)})),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end"}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(n.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((e=>{-1===n.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)}))}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;(this.dispatch("column-layout",this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass)&&e.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",(e=>{e.stopPropagation(),i.focus()})),i.addEventListener("change",(()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())})),t.appendChild(i),e.field?this.langBind("columns|"+e.field,(t=>{i.value=t||e.title||" "})):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,(i=>{this._formatColumnHeaderTitle(t,i||e.title||" ")})):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,(()=>t));switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass)&&this.definition.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t,i=e,s=this.fieldStructure,o=s.length;for(let e=0;e<o&&(t=i=i[s[e]],i);e++);return t}_setFlatData(e,t){this.field&&(e[this.field]=t)}_setNestedData(e,t){var i=e,s=this.fieldStructure,o=s.length;for(let e=0;e<o;e++)if(e==o-1)i[s[e]]=t;else{if(!i[s[e]]){if(void 0===t)break;i[s[e]]={}}i=i[s[e]]}}attachColumn(e){this.groupElement?(this.columns.push(e),this.groupElement.appendChild(e.getElement()),e.columnRendered()):console.warn("Column Warning - Column being attached to another column instead of column group")}verticalAlign(e,t){var i=this.parent.isGroup?this.parent.getGroupElement().clientHeight:t||this.parent.getHeadersElement().clientHeight;this.element.style.height=i+"px",this.dispatch("column-height",this,this.element.style.height),this.isGroup&&(this.groupElement.style.minHeight=i-this.contentElement.offsetHeight+"px"),this.columns.forEach((function(t){t.verticalAlign(e)}))}clearVerticalAlign(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach((function(e){e.clearVerticalAlign()})),this.dispatch("column-height",this,"")}getElement(){return this.element}getGroupElement(){return this.groupElement}getField(){return this.field}getTitleDownload(){return this.titleDownload}getFirstColumn(){return this.isGroup?!!this.columns.length&&this.columns[0].getFirstColumn():this}getLastColumn(){return this.isGroup?!!this.columns.length&&this.columns[this.columns.length-1].getLastColumn():this}getColumns(e){var t=[];return e?this.columns.forEach((e=>{t.push(e),t=t.concat(e.getColumns(!0))})):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach((function(e){t.push(e.getDefinition(!0))})),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach((function(t){t.visible&&(e=!0)})),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(e){e.show()})),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(e){e.hide()})),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})),this.contentElement.style.maxWidth=e-1+"px",this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}checkCellHeights(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}getWidth(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}setMaxWidth(e){this.minWidth&&e<this.minWidth&&(e=this.minWidth,console.warn("the maxWidth ("+e+"px) for column '"+this.field+"' cannot be smaller that its minWidth ("+this.minWidthStyled+")")),this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach((function(e){e.setMaxWidth()}))}delete(){return new Promise(((e,t)=>{this.isGroup&&this.columns.forEach((function(e){e.delete()})),this.dispatch("column-delete",this);var i=this.cells.length;for(let e=0;e<i;e++)this.cells[0].delete();this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.contentElement=!1,this.titleElement=!1,this.groupElement=!1,this.parent.isGroup&&this.parent.removeChild(this),this.table.columnManager.deregisterColumn(this),this.table.columnManager.rerenderColumns(!0),e()}))}columnRendered(){this.titleFormatterRendered&&this.titleFormatterRendered(),this.dispatch("column-rendered",this)}generateCell(e){var t=new o(this,e);return this.cells.push(t),t}nextColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._nextVisibleColumn(e+1)}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((e=>{e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((e=>{var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((e=>(t.field==this.field&&(this.field=!1),this.delete().then((()=>e.getComponent()))))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new t(this)),this.component}}n.defaultOptionList=i;class r{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static deepClone(e,t,i=[]){var s={}.__proto__,o=[].__proto__;for(var n in t||(t=Object.assign(Array.isArray(e)?[]:{},e)),e){let r,a,l=e[n];null==l||"object"!=typeof l||l.__proto__!==s&&l.__proto__!==o||(r=i.findIndex((e=>e.subject===l)),r>-1?t[n]=i[r].copy:(a=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:a}),t[n]=this.deepClone(l,a,i)))}return t}}class a{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults),s=this.table.options.debugInvalidOptions||!0===t.debugInvalidOptions;Object.assign(i,e);for(let e in t)i.hasOwnProperty(e)||(s&&console.warn("Invalid "+this.msgType+" option:",e),i[e]=t.key);for(let e in i)e in t?i[e]=t[e]:Array.isArray(i[e])?i[e]=Object.assign([],i[e]):"object"==typeof i[e]&&null!==i[e]?i[e]=Object.assign({},i[e]):void 0===i[e]&&delete i[e];return i}}class l extends e{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,t,i){var s=this.rows().indexOf(e),o=e.getElement(),n=0;return new Promise(((a,l)=>{if(s>-1){if(void 0===i&&(i=this.table.options.scrollToRowIfVisible),!i&&r.elVisible(o)&&(n=r.elOffset(o).top-r.elOffset(this.elementVertical).top)>0&&n<this.elementVertical.clientHeight-o.offsetHeight)return a(),!1;switch(void 0===t&&(t=this.table.options.scrollToRowPosition),"nearest"===t&&(t=this.scrollToRowNearestTop(e)?"top":"bottom"),this.scrollToRow(e),t){case"middle":case"center":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop+(o.offsetTop-this.elementVertical.scrollTop)-(this.elementVertical.scrollHeight-o.offsetTop)/2:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight/2;break;case"bottom":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop-(this.elementVertical.scrollHeight-o.offsetTop)+o.offsetHeight:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight+o.offsetHeight;break;case"top":this.elementVertical.scrollTop=o.offsetTop}a()}else console.warn("Scroll Error - Row not visible"),l("Scroll Error - Row not visible")}))}}class h extends l{constructor(e){super(e)}renderRowCells(e){e.cells.forEach((t=>{e.element.appendChild(t.getElement()),t.cellRendered()}))}reinitializeColumnWidths(e){e.forEach((function(e){e.reinitializeWidth()}))}}class d extends l{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){"fitDataTable"==this.options("layout")&&console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),this.options("responsiveLayout")&&console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),this.options("rtl")&&console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction")}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach((t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}})),this.windowBuffer=2*e}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((e=>{var t,i={};e.visible&&(e.modules.frozen||(t=e.getWidth(),i.leftPos=s,i.rightPos=s+t,i.width=t,this.isFitData&&(i.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),s+t>this.vDomScrollPosLeft&&s<this.vDomScrollPosRight?(-1==this.leftCol&&(this.leftCol=this.columns.length,this.vDomPadLeft=s),this.rightCol=this.columns.length):-1!==this.leftCol&&(this.vDomPadRight+=t),this.columns.push(e),e.modules.vdomHoz=i,s+=t))})),this.tableElement.style.paddingLeft=this.vDomPadLeft+"px",this.tableElement.style.paddingRight=this.vDomPadRight+"px",this.initialized=!0,t||e&&!this.reinitChanged(i)||this.reinitializeRows(),this.elementVertical.scrollLeft=this.scrollLeft)}renderRowCells(e){this.initialized?this.initializeRow(e):e.cells.forEach((t=>{e.element.appendChild(t.getElement()),t.cellRendered()}))}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let e=this.leftCol;e<=this.rightCol;e++)this.columns[e].reinitializeWidth()}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e,t,i=!1;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach((e=>{!e.definition.width&&e.visible&&(i=!0)})),i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,e=this.chain("rows-sample",[1],[],(()=>this.table.rowManager.getDisplayRows()))[0])){t=e.getElement(),e.generateCells(),this.tableElement.appendChild(t);for(let i=0;i<e.cells.length;i++){let s=e.cells[i];t.appendChild(s.getElement()),s.column.reinitializeWidth()}t.parentNode.removeChild(t),this.rerenderColumns(!1,!0)}}else"fitColumns"===this.options("layout")&&(this.layoutRefresh(),this.rerenderColumns(!1,!0))}reinitChanged(e){var t=!0;return e.cols.length!==this.columns.length||e.leftCol!==this.leftCol||e.rightCol!==this.rightCol||(e.cols.forEach(((e,i)=>{e!==this.columns[i]&&(t=!1)})),!t)}reinitializeRows(){var e=this.getVisibleRows(),t=this.table.rowManager.getRows().filter((t=>!e.includes(t)));e.forEach((e=>{this.reinitializeRow(e,!0)})),t.forEach((e=>{e.deinitialize()}))}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s<t;s++){let e=this.columns[s];e.modules.vdomHoz.leftPos+=i,e.modules.vdomHoz.rightPos+=i}}addColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol+1];i&&i.modules.vdomHoz.leftPos<=this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);e.getElement().insertBefore(t.getElement(),e.getCell(this.columns[this.rightCol]).getElement().nextSibling),t.cellRendered()}})),this.fitDataColActualWidthCheck(i),this.rightCol++,this.getVisibleRows().forEach((e=>{"group"!==e.type&&(e.modules.vdomHoz.rightCol=this.rightCol)})),this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol-1];if(i)if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);e.getElement().insertBefore(t.getElement(),e.getCell(this.columns[this.leftCol]).getElement()),t.cellRendered()}})),this.leftCol--,this.getVisibleRows().forEach((e=>{"group"!==e.type&&(e.modules.vdomHoz.leftCol=this.leftCol)})),this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let t=this.fitDataColActualWidthCheck(i);t&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+t,this.vDomPadRight-=t)}else t=!1;else t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),this.vDomPadRight+=i.getWidth(),this.rightCol--,this.getVisibleRows().forEach((e=>{"group"!==e.type&&(e.modules.vdomHoz.rightCol=this.rightCol)}))):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos<this.vDomScrollPosLeft?(e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColLeft",e.message)}}})),this.vDomPadLeft+=i.getWidth(),this.leftCol++,this.getVisibleRows().forEach((e=>{"group"!==e.type&&(e.modules.vdomHoz.leftCol=this.leftCol)}))):t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),(i=(t=e.getWidth())-e.modules.vdomHoz.width)&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if("group"!==e.type){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol},this.table.modules.frozenColumns&&this.table.modules.frozenColumns.leftColumns.forEach((t=>{this.appendCell(e,t)}));for(let t=this.leftCol;t<=this.rightCol;t++)this.appendCell(e,this.columns[t]);this.table.modules.frozenColumns&&this.table.modules.frozenColumns.rightColumns.forEach((t=>{this.appendCell(e,t)}))}}appendCell(e,t){if(t&&t.visible){let i=e.getCell(t);e.getElement().appendChild(i.getElement()),i.cellRendered()}}reinitializeRow(e,t){if("group"!==e.type&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class c extends e{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.contentsElement=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new a(this.table,"column definition",i),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.contentsElement=this.createHeaderContentsElement(),this.element=this.createHeaderElement(),this.contentsElement.insertBefore(this.headersElement,this.contentsElement.firstChild),this.element.insertBefore(this.contentsElement,this.element.firstChild),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scrollbar-vertical",this.padVerticalScrollbar.bind(this))}padVerticalScrollbar(e){this.table.rtl?this.headersElement.style.marginLeft=e+"px":this.headersElement.style.marginRight=e+"px"}initializeRenderer(){var e,t={virtual:d,basic:h};(e="string"==typeof this.table.options.renderHorizontal?t[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderContentsElement(){var e=document.createElement("div");return e.classList.add("tabulator-header-contents"),e.setAttribute("role","rowgroup"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getContentsElement(){return this.contentsElement}getHeadersElement(){return this.headersElement}scrollHorizontal(e){this.contentsElement.scrollLeft=e,this.scrollLeft=e,this.renderer.scrollColumns(e)}generateColumnsFromRowData(e){var t,i,s=[],o=this.table.options.autoColumnsDefinitions;if(e&&e.length){for(var n in t=e[0]){let e={field:n,title:n},o=t[n];switch(typeof o){case"undefined":i="string";break;case"boolean":i="boolean";break;case"object":i=Array.isArray(o)?"array":"string";break;default:i=isNaN(o)||""===o?o.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}e.sorter=i,s.push(e)}if(o)switch(typeof o){case"function":this.table.options.columns=o.call(this.table,s);break;case"object":Array.isArray(o)?s.forEach((e=>{var t=o.find((t=>t.field===e.field));t&&Object.assign(e,t)})):s.forEach((e=>{o[e.field]&&Object.assign(e,o[e.field])})),this.table.options.columns=s}else this.table.options.columns=s;this.setColumns(this.table.options.columns)}}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach(((e,t)=>{this._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new n(e,this),o=s.getElement(),r=i?this.findColumnIndex(i):i;if(i&&r>-1){var a=i.getTopColumn(),l=this.columns.indexOf(a),h=a.getElement();t?(this.columns.splice(l,0,s),h.parentNode.insertBefore(o,h)):(this.columns.splice(l+1,0,s),h.parentNode.insertBefore(o,h.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}verticalAlignHeaders(){var e=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach((e=>{e.clearVerticalAlign()})),this.columns.forEach((t=>{var i=t.getHeight();i>e&&(e=i)})),this.headersElement.style.height=e+"px",this.columns.forEach((t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)})),this.table.rowManager.adjustTableSize())}findColumn(e){var i;if("object"!=typeof e)return this.columnsByField[e]||!1;if(e instanceof n)return e;if(e instanceof t)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return i=[],this.columns.forEach((e=>{i.push(e),i=i.concat(e.getColumns(!0))})),i.find((t=>t.element===e))||!1}return!1}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach((i=>{i.split(".")[0]===e&&t.push(this.columnsByField[i])})),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(){var e=this.columnsByIndex.findIndex((e=>e.visible));return e>-1&&this.columnsByIndex[e]}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex((t=>e===t))}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach(((t,i)=>{e(t,i)}))}getDefinitions(e){var t=[];return this.columnsByIndex.forEach((i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}getDefinitionTree(){var e=[];return this.columns.forEach((t=>{e.push(t.getDefinition(!0))})),e}getComponents(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((e=>{t.push(e.getComponent())})),t}getWidth(){var e=0;return this.columnsByIndex.forEach((t=>{t.visible&&(e+=t.getWidth())})),e}moveColumn(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,o){var n,r=e.indexOf(t);r>-1&&(e.splice(r,1),(n=e.indexOf(i))>-1?s&&(n+=1):n=r,e.splice(n,0,t),o&&(this.chain("column-moving-rows",[t,i,s],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(n,0,t)}})))}scrollToColumn(e,t,i){var s=0,o=e.getLeftOffset(),n=0,r=e.getElement();return new Promise(((a,l)=>{if(void 0===t&&(t=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":n=-this.element.clientWidth/2;break;case"right":n=r.clientWidth-this.headersElement.clientWidth}if(!i&&o>0&&o+r.offsetWidth<this.element.clientWidth)return!1;s=o+n,s=Math.max(Math.min(s,this.table.rowManager.element.scrollWidth-this.table.rowManager.element.clientWidth),0),this.table.rowManager.scrollHorizontal(s),this.scrollHorizontal(s),a()}else console.warn("Scroll Error - Column not visible"),l("Scroll Error - Column not visible")}))}generateCells(e){var t=[];return this.columnsByIndex.forEach((i=>{t.push(i.generateCell(e))})),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var s,o,n;i.visible&&(s=i.definition.width||0,o=parseInt(i.minWidth),n="string"==typeof s?s.indexOf("%")>-1?e/100*parseInt(s):parseInt(s):s,t+=n>o?n:o)})),t}addColumn(e,t,i){return new Promise(((s,o)=>{var n=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),"fitColumns"!=this.layoutMode()&&n.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),s(n)}))}deregisterColumn(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(e,t){this.redrawBlock?(!1===e||!0===e&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(e){r.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class u{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(){return this._row.table.rowManager.scrollToRow(this._row)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e?e.getComponent():e}getPrevRow(){var e=this._row.prevRow();return e?e.getComponent():e}}class p extends e{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}setCellHeight(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach((function(e){e.clearHeight()}))}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t,i=this.element&&r.elVisible(this.element),s={};return new Promise(((o,n)=>{"string"==typeof e&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(s=Object.assign(s,this.data),s=Object.assign(s,e)),t=this.chain("row-data-changing",[this,s,e],null,e);for(let e in t)this.data[e]=t[e];this.dispatch("row-data-save-after",this);for(let s in e){this.table.columnManager.getColumnsByFieldRoot(s).forEach((e=>{let s=this.getCell(e.getField());if(s){let o=e.getFieldValue(t);s.getValue()!==o&&(s.setValueProcessData(o),i&&s.cellRendered())}}))}i?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,i,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),o()}))}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){return e=this.table.columnManager.findColumn(e),this.initialized||0!==this.cells.length||this.generateCells(),this.cells.find((function(t){return t.column===e}))}getCellIndex(e){return this.cells.findIndex((function(t){return t===e}))}findCell(e){return this.cells.find((t=>t.element===e))}getCells(){return this.initialized||0!==this.cells.length||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t<e;t++)this.cells[0].delete()}wipe(){if(this.detachModules(),this.deleteCells(),this.element){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.parentNode&&this.element.parentNode.removeChild(this.element)}this.element=!1,this.modules={}}isDisplayed(){return this.table.rowManager.getDisplayRows().includes(this)}getPosition(){return!!this.isDisplayed()&&this.position}setPosition(e){e!=this.position&&(this.position=e,this.positionWatchers.forEach((e=>{e(this.position)})))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new u(this)),this.component}}class m extends l{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0;this.rows().forEach(((i,s)=>{this.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}rerenderRows(e){this.clearRows(),e&&e(),this.renderRows()}scrollToRowNearestTop(e){var t=r.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-t)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-t))}scrollToRow(e){var t=e.getElement();this.elementVertical.scrollTop=r.elOffset(t).top-r.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class g extends l{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,o=this.table.rowManager.scrollLeft,n=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(n[r]){var a=t-n[r].getElement().offsetTop;if(!(!1===s||Math.abs(a)<s))break;s=a,i=r}n.forEach((e=>{e.deinitializeHeight()})),e&&e(),this.rows().length?this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,s||0):(this.clear(),this.table.rowManager.tableEmpty()),this.scrollColumns(o)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,o=2*this.vDomWindowBuffer,n=this.rows();if(this.scrollTop=e,-i>o||s>o){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*n.length)),this.scrollColumns(r)}else t?(i<0&&this._addTopRow(n,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(n,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(n,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(n,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,o=0,n=0,r=this.rows();if(e)o=this.vDomTop,n=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a])if(s){if(!(i-r[a].getElement().offsetTop>=0))break;n=a}else if(t-r[a].getElement().offsetTop>=0)o=a;else{if(s=!0,!(i-r[a].getElement().offsetTop>=0))break;n=a}return r.slice(o,n+1)}_virtualRenderFill(e,t,i){var s=this.tableElement,o=this.elementVertical,n=0,a=0,l=0,h=0,d=0,c=this.rows(),u=c.length,p=this.elementVertical.clientHeight;if(i=i||0,e=e||0){for(;s.firstChild;)s.removeChild(s.firstChild);(l=(u-e+1)*this.vDomRowHeight)<p&&(e-=Math.ceil((p-l)/this.vDomRowHeight))<0&&(e=0),e-=n=Math.min(Math.max(Math.floor(this.vDomWindowBuffer/this.vDomRowHeight),this.vDomWindowMinMarginRows),e)}else this.clear();if(u&&r.elVisible(this.elementVertical)){for(this.vDomTop=e,this.vDomBottom=e-1;(a<=p+this.vDomWindowBuffer||d<this.vDomWindowMinTotalRows)&&this.vDomBottom<u-1;){var m,g=this.vDomBottom+1,b=c[g];this.styleRow(b,g),s.appendChild(b.getElement()),b.initialize(),b.heightInitialized||b.normalizeHeight(!0),m=b.getHeight(),d<n?h+=m:a+=m,m>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*m),this.vDomBottom++,d++}e?(this.vDomTopPad=t?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-h,this.vDomBottomPad=this.vDomBottom==u-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-a-h,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((a+h)/d),this.vDomBottomPad=this.vDomRowHeight*(u-this.vDomBottom-1),this.vDomScrollHeight=h+a+this.vDomBottomPad-p),s.style.paddingTop=this.vDomTopPad+"px",s.style.paddingBottom=this.vDomBottomPad+"px",t&&(this.scrollTop=this.vDomTopPad+h+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-p:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-p),this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&t&&(this.scrollTop+=this.elementVertical.offsetHeight-p),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,o.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomTop-1,r=0,a=!0;a;)if(this.vDomTop){let l,h,d=e[n];d&&r<this.vDomMaxRenderChain?(l=d.getHeight()||this.vDomRowHeight,h=d.initialized,t>=l?(this.styleRow(d,n),i.insertBefore(d.getElement(),i.firstChild),d.initialized&&d.heightInitialized||s.push(d),d.initialize(),h||(l=d.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,o+=l,this.vDomTop--,n--,r++):a=!1):a=!1}else a=!1;for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomTopPad-=o,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=o)}_removeTopRow(e,t){for(var i=[],s=0,o=0,n=!0;n;){let r,a=e[this.vDomTop];a&&o<this.vDomMaxRenderChain?(r=a.getHeight()||this.vDomRowHeight,t>=r?(this.vDomTop++,t-=r,s+=r,i.push(a),o++):n=!1):n=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomBottom+1,r=0,a=!0;a;){let l,h,d=e[n];d&&r<this.vDomMaxRenderChain?(l=d.getHeight()||this.vDomRowHeight,h=d.initialized,t>=l?(this.styleRow(d,n),i.appendChild(d.getElement()),d.initialized&&d.heightInitialized||s.push(d),d.initialize(),h||(l=d.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,o+=l,this.vDomBottom++,n++,r++):a=!1):a=!1}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomBottomPad-=o,(this.vDomBottomPad<0||n==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=o)}_removeBottomRow(e,t){for(var i=[],s=0,o=0,n=!0;n;){let r,a=e[this.vDomBottom];a&&o<this.vDomMaxRenderChain?(r=a.getHeight()||this.vDomRowHeight,t>=r?(this.vDomBottom--,t-=r,s+=r,i.push(a),o++):n=!1):n=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class b extends e{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.scrollbarWidth=0,this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e}initializePlaceholder(){var e=this.table.options.placeholder;if(e){let t=document.createElement("div");if(t.classList.add("tabulator-placeholder"),"string"==typeof e){let i=document.createElement("div");i.classList.add("tabulator-placeholder-contents"),i.innerHTML=e,t.appendChild(i),this.placeholderContents=i}else"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(t.appendChild(e),this.placeholderContents=e):(console.warn("Invalid placeholder provided, must be string or HTML Element",e),this.el=null);this.placeholder=t}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",(()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))}))}findRow(e){if("object"!=typeof e){if(void 0===e)return!1;return this.rows.find((t=>t.data[this.table.options.index]==e))||!1}if(e instanceof p)return e;if(e instanceof u)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return this.rows.find((t=>t.getElement()===e))||!1}return!1}getRowFromDataObject(e){return this.rows.find((t=>t.data===e))||!1}getRowFromPosition(e){return this.getDisplayRows().find((t=>t.getPosition()===e&&t.isDisplayed()))}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise(((s,o)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition((()=>{this._setDataActual(e)})):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()}))}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach(((e,t)=>{if(e&&"object"==typeof e){var i=new p(e,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",e)})),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData: ",e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach((e=>{e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((t=>{var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){return this.addRowActual(e,t,i,s)}addRows(e,t,i,s){var o=[];return new Promise(((n,r)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach(((e,s)=>{var n=this.addRow(e,t,i,!0);o.push(n),this.dispatch("row-added",n,e,t,i)})),this.refreshActiveData(!!s&&"displayPipeline",!1,!0),this.regenerateRowPositions(),o.length&&this._clearPlaceholder(),n(o)}))}findAddRowPos(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}addRowActual(e,t,i,s){var o,n,r=e instanceof p?e:new p(e||{},this),a=this.findAddRowPos(t),l=-1;return i||(n=this.chain("row-adding-position",[r,a],null,{index:i,top:a}),i=n.index,a=n.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,a],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(a?t:t+1,0,r)})),o>-1&&this.activeRows.splice(a?o:o+1,0,r),this.rows.splice(a?l:l+1,0,r)):a?(this.displayRowIterator((function(e){e.unshift(r)})),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator((function(e){e.push(r)})),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),r}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((s=>{this.moveRowInArray(s,e,t,i)})),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var o,n,r;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(n=e.indexOf(i))>-1?s?e.splice(n+1,0,t):e.splice(n,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){r=n>o?n:o+1;for(let t=o<n?o:n;t<=r;t++)e[t]&&this.styleRow(e[t],t)}}clearData(){this.setData([])}getRowIndex(e){return this.findRowIndex(e,this.rows)}getDisplayRowIndex(e){var t=this.getDisplayRows().indexOf(e);return t>-1&&t}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return!1!==i&&i<this.displayRowsCount-1&&(s=this.getDisplayRows()[i+1]),!s||s instanceof p&&"row"==s.type?s:this.nextDisplayRow(s,t)}prevDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return i&&(s=this.getDisplayRows()[i-1]),!t||!s||s instanceof p&&"row"==s.type?s:this.prevDisplayRow(s,t)}findRowIndex(e,t){var i;return!!((e=this.findRow(e))&&(i=t.indexOf(e))>-1)&&i}getData(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}getComponents(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}getDataCount(e){return this.getRows(e).length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,t,i){var s=this.table,o="",n=0,a=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof e)if((n=this.dataPipeline.findIndex((t=>t.handler===e)))>-1)o="dataPipeline",t&&(n==this.dataPipeline.length-1?o="display":n++);else{if(!((n=this.displayPipeline.findIndex((t=>t.handler===e)))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);o="displayPipeline",t&&(n==this.displayPipeline.length-1?o="end":n++)}else o=e||"all",n=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===o&&n<this.redrawBlockRestoreConfig.index||a.indexOf(o)<a.indexOf(this.redrawBlockRestoreConfig.stage)))&&(this.redrawBlockRestoreConfig={handler:e,skipStage:t,renderInPosition:i,stage:o,index:n}));r.elVisible(this.element)?i?this.reRenderInPosition(this.refreshPipelines.bind(this,e,o,n,i)):(this.refreshPipelines(e,o,n,i),e||this.table.columnManager.renderer.renderColumns(),this.renderTable(),s.options.layoutColumnsOnNewData&&this.table.columnManager.redraw(!0)):this.refreshPipelines(e,o,n,i),this.dispatch("data-refreshed")}}refreshPipelines(e,t,i,s){switch(this.dispatch("data-refreshing"),e||(this.activeRowsPipeline[0]=this.rows.slice(0)),t){case"all":case"dataPipeline":for(let e=i;e<this.dataPipeline.length;e++){let t=this.dataPipeline[e].handler(this.activeRowsPipeline[e].slice(0));this.activeRowsPipeline[e+1]=t||this.activeRowsPipeline[e].slice(0)}this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);case"display":i=0,this.resetDisplayRows();case"displayPipeline":for(let e=i;e<this.displayPipeline.length;e++){let t=this.displayPipeline[e].handler((e?this.getDisplayRows(e-1):this.activeRows).slice(0),s);this.setDisplayRows(t||this.getDisplayRows(e-1).slice(0),e)}case"end":this.regenerateRowPositions()}this.getDisplayRows().length&&this._clearPlaceholder()}regenerateRowPositions(){var e=this.getDisplayRows(),t=1;e.forEach((e=>{"row"===e.type&&(e.setPosition(t),t++)}))}setActiveRows(e){this.activeRows=this.activeRows=Object.assign([],e),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return void 0===e?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var e=0;this.element.scrollHeight>this.element.clientHeight&&(e=this.element.offsetWidth-this.element.clientWidth),e!==this.scrollbarWidth&&(this.scrollbarWidth=e,this.dispatch("scrollbar-vertical",e))}initializeRenderer(){var e,t={virtual:g,basic:m};(e="string"==typeof this.table.options.renderVertical?t[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),!this.table.element.clientHeight&&!this.table.options.height||this.table.options.minHeight&&this.table.options.maxHeight?this.fixedHeight=!1:this.fixedHeight=!0):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}_showPlaceholder(){this.placeholder&&(this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach((function(e){e.normalizeHeight()}))}adjustTableSize(){var e,t=this.element.clientHeight;if("fill"===this.renderer.verticalFillMode){let i=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));this.fixedHeight?(e=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px",this.element.style.minHeight=e||"calc(100% - "+i+"px)",this.element.style.height="calc(100% - "+i+"px)",this.element.style.maxHeight="calc(100% - "+i+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-i+"px",this.element.scrollTop=this.scrollTop),this.renderer.resize(),this.fixedHeight||t==this.element.clientHeight||(this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw()),this.scrollBarCheck()}this._positionPlaceholder()}reinitialize(){this.rows.forEach((function(e){e.reinitialize(!0)}))}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(t))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class f extends e{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)if("string"==typeof this.table.options.footerElement)"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));else this.element=this.table.options.footerElement}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){this.element.firstChild&&!e||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class v extends e{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach((t=>{e[t]={handler:null,components:[]}})),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach((e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)})),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};(i=i.filter((t=>{var i=s[e];return t!==e&&(!i||i&&!i.includes(t))}))).forEach((e=>{var i=this.pseudoTrackers[e].target;this.pseudoTrackers[e].target&&(this.dispatch(e+"-mouseleave",t,i),this.pseudoTrackers[e].target=null)}))}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let t of e){let e=i+"-"+t;this.subscriptionChange(e,this.subscriptionChanged.bind(this,i,t))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,o=s.indexOf(e),n=!1;i?-1===o&&(s.push(e),n=!0):this.subscribed(e+"-"+t)||o>-1&&(s.splice(o,1),n=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),n&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(s).length||this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let e=s.classList?[...s.classList]:[];if(e.filter((e=>this.abortClasses.includes(e))).length)break;let o=e.filter((e=>i.includes(e)));for(let e of o)t[this.componentMap[e]]||(t[this.componentMap[e]]=s)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],o={},n={};for(let e of i){let i,r=t[e],a=this.previousTargets[e];if(a&&a.target===r)i=a.component;else switch(e){case"row":case"group":if(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group")){i=this.table.rowManager.getVisibleRows(!0).find((e=>e.getElement()===r)),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1)}break;case"column":s.components.includes("column")&&(i=this.table.columnManager.findColumn(r));break;case"cell":s.components.includes("cell")&&(o.row instanceof p?i=o.row.findCell(r):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(o[e]=i,n[e]={target:r,component:i})}return this.previousTargets=n,o}triggerEvents(e,t,i){var s=this.listeners[e];for(let o in i)i[o]&&s.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class w{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class C extends e{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,o,n){var r=++this.requestOrder;return this.dispatchExternal("dataLoading",e),!e||0!=e.indexOf("{")&&0!=e.indexOf("[")||(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,o])?(this.loading=!0,o||this.alertLoader(),t=this.chain("data-params",[e,i,o],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams),this.chain("data-load",[e,t,i,o],!1,Promise.resolve([])).then((e=>{Array.isArray(e)||"object"!=typeof e||(e=this.mapParams(e,this.objectInvert(this.table.options.dataReceiveParams)));var t=this.chain("data-loaded",e,null,e);r==this.requestOrder?(this.clearAlert(),!1!==t&&(this.dispatchExternal("dataLoaded",t),this.table.rowManager.setData(t,s,void 0===n?!s:n))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((e=>{console.error("Data Load Error: ",e),this.dispatchExternal("dataLoadError",e),o||this.alertError(),setTimeout((()=>{this.clearAlert()}),this.table.options.dataLoaderErrorTimeout)})).finally((()=>{this.loading=!1}))):(this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,void 0===n?!s:n),Promise.resolve())}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class E{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e,t=Array.from(arguments),i=t.shift();return this.events[i]&&this.events[i].forEach(((i,s)=>{let o=i.apply(this.table,t);s||(e=o)})),e}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class y{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort(((e,t)=>e.priority-t.priority)),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e.callback===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var o=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach(((e,i)=>{o=e.callback.apply(this,t.concat([o]))})),o):"function"==typeof s?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach(((e,s)=>{e.callback.apply(this,t)&&(i=!0)})),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach((t=>{t.callback.apply(this,e)}))}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class R extends e{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t){var i="";return void 0===this.options(e)||(i="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(i=i+", Please use the %c"+t+"%c option instead",this._warnUser(i,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;")):this._warnUser(i,"font-weight: bold;","font-weight: normal;"),!1)}checkMsg(e,t){return void 0===this.options(e)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}msg(e){this._warnUser(e)}}class x{static register(e){x.tables.push(e)}static deregister(e){var t=x.tables.indexOf(e);t>-1&&x.tables.splice(t,1)}static lookupTable(e,t){var i,s,o=[];if("string"==typeof e){if((i=document.querySelectorAll(e)).length)for(var n=0;n<i.length;n++)(s=x.matchElement(i[n]))&&o.push(s)}else"undefined"!=typeof HTMLElement&&e instanceof HTMLElement||e instanceof O?(s=x.matchElement(e))&&o.push(s):Array.isArray(e)?e.forEach((function(e){o=o.concat(x.lookupTable(e))})):t||console.warn("Table Connection Error - Invalid Selector",e);return o}static matchElement(e){return x.tables.find((function(t){return e instanceof O?t===e:t.element===e}))}}x.tables=[];class T extends e{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return"string"==typeof e?(e=document.querySelector(e))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===e&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,s=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let e=r.elOffset(this.container);i-=e.left,s-=e.top}return{x:i,y:s}}elementPositionCoords(e,t="right"){var i,s,o,n=r.elOffset(e);switch(this.container!==document.body&&(i=r.elOffset(this.container),n.left-=i.left,n.top-=i.top),t){case"right":s=n.left+e.offsetWidth,o=n.top-1;break;case"bottom":s=n.left,o=n.top+e.offsetHeight;break;case"left":s=n.left,o=n.top-1;break;case"top":s=n.left,o=n.top;break;case"center":s=n.left+e.offsetWidth/2,o=n.top+e.offsetHeight/2}return{x:s,y:o,offset:n}}show(e,t){var i,s,o,n,r;return this.destroyed||this.table.destroyed||(e instanceof HTMLElement?(o=e,n=(r=this.elementPositionCoords(e,t)).offset,i=r.x,s=r.y):"number"==typeof e?(n={top:0,left:0},i=e,s=t):(i=(r=this.containerEventCoords(e)).x,s=r.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,o,n,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(e=>{e.stopPropagation()}))),this}_fitToScreen(e,t,i,s,o){var n=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-s.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,n?this.container.scrollHeight:0))if(i)if("bottom"===o)this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px";else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout((()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)}),100),this.blurCallback=e),this}_escapeCheck(e){27==e.keyCode&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new T(this.table,e,this),this.childPopup}}class k extends e{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){void 0===this.table[e]?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t,i=this.table.rowManager.displayRows.length-1;if(this._handler&&(t=this.table.rowManager.displayPipeline.findIndex((e=>e.handler===this._handler)))>-1&&(i=t),e&&(i+=e),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new T(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}function M(e,t){e.forEach((function(e){e.reinitializeWidth()})),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var L={fitData:function(e,t){t&&this.table.columnManager.renderer.reinitializeColumnWidths(e),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:M,fitDataTable:M,fitDataStretch:function(e,t){var i=0,s=this.table.rowManager.element.clientWidth,o=0,n=!1;e.forEach(((e,t)=>{e.widthFixed||e.reinitializeWidth(),(this.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(n=e),e.visible&&(i+=e.getWidth())})),n?(o=s-i+n.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(n.setWidth(0),this.table.modules.responsiveLayout.update()),o>0?n.setWidth(o):n.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e,t){var i,s,o=this.table.rowManager.element.getBoundingClientRect().width,n=0,r=0,a=0,l=[],h=[],d=0,c=0;function u(e){return"string"==typeof e?e.indexOf("%")>-1?o/100*parseInt(e):parseInt(e):e}function p(e,t,i,s){var o=[],n=0,r=0,l=0,h=a,d=0,c=0,m=[];function g(e){return i*(e.column.definition.widthGrow||1)}function b(e){return u(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,n){var r=s?b(e):g(e);e.column.minWidth>=r?o.push(e):e.column.maxWidth&&e.column.maxWidth<r?(e.width=e.column.maxWidth,t-=e.column.maxWidth,(h-=s?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)&&(i=Math.floor(t/h))):(m.push(e),c+=s?e.column.definition.widthShrink||1:e.column.definition.widthGrow||1)})),o.length?(o.forEach((function(e){n+=s?e.width-e.column.minWidth:e.column.minWidth,e.width=e.column.minWidth})),r=t-n,l=c?Math.floor(r/c):r,d=p(m,r,l,s)):(d=c?t-Math.floor(t/c)*c:t,m.forEach((function(e){e.width=s?b(e):g(e)}))),d}this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(o-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,s;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(s=u(t),n+=s>i?s:i,e.definition.widthShrink&&(h.push({column:e,width:s>i?s:i}),d+=e.definition.widthShrink)):(l.push({column:e,width:0}),a+=e.definition.widthGrow||1))})),r=o-n,i=Math.floor(r/a),c=p(l,r,i,!1),l.length&&c>0&&(l[l.length-1].width+=c),l.forEach((function(e){r-=e.width})),(s=Math.abs(c)+r)>0&&d&&(c=p(h,s,Math.floor(s/d),!0)),c&&h.length&&(h[h.length-1].width-=c),l.forEach((function(e){e.column.setWidth(e.width)})),h.forEach((function(e){e.column.setWidth(e.width)}))}};class S extends k{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;S.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}getMode(){return this.mode}layout(e){this.dispatch("layout-refreshing"),S.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),this.dispatch("layout-refreshed")}}S.moduleName="layout",S.modes=L;class D extends k{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=r.deepClone(D.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&"object"==typeof e[i]?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){if(!0===(e=e||"default")&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let t=e.split("-")[0];this.langList[t]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,t),e=t):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=r.deepClone(this.langList.default||{}),"default"!=e&&function e(t,i){for(var s in t)"object"==typeof t[s]?(i[s]||(i[s]={}),e(t[s],i[s])):i[s]=t[s]}(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=(t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach((t=>{t(this.getText(e),this.lang)}))}}D.moduleName="localize",D.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class P extends k{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[];return x.lookupTable(e).forEach((e=>{this.table!==e&&t.push(e)})),t}send(e,t,i,s){var o=this.getConnections(e);o.forEach((e=>{e.tableComms(this.table.element,t,i,s)})),!o.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}}P.moduleName="comms";var z=Object.freeze({__proto__:null,LayoutModule:S,LocalizeModule:D,CommsModule:P});class F{constructor(e,t){this.bindStaticFunctionality(e),this.bindModules(e,z,!0),t&&this.bindModules(e,t)}bindStaticFunctionality(e){e.moduleBindings={},e.extendModule=function(t,i,s){if(e.moduleBindings[t]){var o=e.moduleBindings[t][i];if(o)if("object"==typeof s)for(let e in s)o[e]=s[e];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",i)}else console.warn("Module Error - module does not exist:",t)},e.registerModule=function(t){Array.isArray(t)||(t=[t]),t.forEach((t=>{e.registerModuleBinding(t)}))},e.registerModuleBinding=function(t){e.moduleBindings[t.moduleName]=t},e.findTable=function(e){var t=x.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},e.prototype.bindModules=function(){var t=[],i=[],s=[];for(var o in this.modules={},e.moduleBindings){let n=e.moduleBindings[o],r=new n(this);this.modules[o]=r,n.prototype.moduleCore?this.modulesCore.push(r):n.moduleInitOrder?n.moduleInitOrder<0?t.push(r):i.push(r):s.push(r)}t.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),i.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),this.modulesRegular=t.concat(s.concat(i))}}bindModules(e,t,i){var s=Object.values(t);i&&s.forEach((e=>{e.prototype.moduleCore=!0})),e.registerModule(s)}}class H extends e{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class O{constructor(e,t){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new w(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new R(this),this.optionsList=new a(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout((()=>{this._create()}))),x.register(this)}initializeElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new c(this),this.rowManager=new b(this),this.footerManager=new f(this),this.dataLoader=new C(this),this.alertManager=new H(this),this.bindModules(),this.options=this.optionsList.generate(O.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new E(this,this.options,this.options.debugEventsExternal),this.eventBus=new y(this.options.debugEventsInternal),this.interactionMonitor=new v(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e,t=this.element,i=this.options;if("TABLE"===t.tagName){this.originalElement=this.element,e=document.createElement("div");var s=t.attributes;for(var o in s)"object"==typeof s[o]&&e.setAttribute(s[o].name,s[o].value);t.parentNode.replaceChild(e,t),this.element=t=e}for(t.classList.add("tabulator"),t.setAttribute("role","grid");t.firstChild;)t.removeChild(t.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",t.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",t.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",t.style.maxHeight=i.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((e=>{e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((e=>{e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){this.dataLoader.load(this.options.data)}destroy(){var e=this.element;for(this.destroyed=!0,x.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):e.indexOf("Mac OS")>-1?(this.browser="safari",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(s="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?s.trim().split(" ")[1].split(".")[1]:s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise(((i,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((e=>{var o=this.rowManager.findRow(e[this.options.index]);o?(t++,o.updateData(e).then((()=>{--t||i()})).catch((t=>{s("Update Error - Unable to update row",e,t)}))):s("Update Error - Unable to find row",e)})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))}addData(e,t,i){return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then((e=>{var t=[];e.forEach((function(e){t.push(e.getComponent())})),s(t)})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((e=>{var o=this.rowManager.findRow(e[this.options.index]);i++,o?o.updateData(e).then((()=>{i--,t.push(o.getComponent()),i||s(t)})):this.rowManager.addRows(e).then((e=>{i--,t.push(e[0].getComponent()),i||s(t)}))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let e=this.rowManager.findRow(i,!0);if(!e)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");t.push(e)}return t.sort(((e,t)=>this.rowManager.rows.indexOf(e)>this.rowManager.rows.indexOf(t)?1:-1)),t.forEach((e=>{e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then((e=>e[0].getComponent()))}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>i.getComponent())):this.rowManager.addRows(t).then((e=>e[0].getComponent()))}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>Promise.resolve(i.getComponent()))):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then((e=>e.getComponent()))}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),s?o?this.columnManager.moveColumn(s,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise(((s,o)=>{var n=this.columnManager.findColumn(e);return n?this.columnManager.scrollToColumn(n,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){Array.from(arguments).shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}O.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new F(O);class _ extends k{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupAccessor(e.definition[n]))&&(t=!0,i[n]={accessor:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":_.accessors[e]?t=_.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),s=e.getComponent(),o=r.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var n,r,a,l;e.modules.accessor&&(r=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(n=e.getFieldValue(o))&&(l=e.getComponent(),a="function"==typeof r.params?r.params(n,o,t,l,s):r.params,e.setFieldValue(o,r.accessor(n,o,t,a,l,s)))})),o}}_.moduleName="accessor",_.accessors={};function A(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(A(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(A(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function B(e){var t=A(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function I(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+B(i))),e}function V(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(V(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(V(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}var N={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var s=V(i),o=new FormData;return s.forEach((function(e){o.append(e.key,e.value)})),o}}};class W extends k{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",(function(){})),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=W.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||W.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||W.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),s=Object.assign(s,o)),s}requestDataCheck(e,t,i,s){return!((e||!this.url)&&"string"!=typeof e)}requestData(e,t,i,s,o){var n;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),n=this.generateConfig(i),this.sendRequest(this.url,t,n)):o}setDefaultConfig(e={}){this.config=Object.assign({},W.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,e,t,i)),i))):Promise.reject()}}W.moduleName="ajax",W.defaultConfig={method:"GET"},W.defaultURLGenerator=I,W.defaultLoaderPromise=function(e,t,i){var s;return new Promise(((o,n)=>{if(e=this.urlGenerator.call(this.table,e,t,i),"GET"!=t.method.toUpperCase())if(s="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var r in s.headers)t.headers||(t.headers={}),void 0===t.headers[r]&&(t.headers[r]=s.headers[r]);t.body=s.body.call(this,e,t,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);e?(void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),void 0===t.mode&&(t.mode="cors"),"cors"==t.mode?(void 0===t.headers.Origin&&(t.headers.Origin=window.location.origin),void 0===t.credentials&&(t.credentials="same-origin")):void 0===t.credentials&&(t.credentials="include"),fetch(e,t).then((e=>{e.ok?e.json().then((e=>{o(e)})).catch((e=>{n(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),n(e))})).catch((e=>{console.error("Ajax Load Error - Connection Error: ",e),n(e)}))):(console.warn("Ajax Load Error - No URL Set"),o([]))}))},W.contentTypeFormatters=N;class j extends k{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),t=(i=this.table.modules.export.generateHTMLTable(s))?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(e=>{this.paste(e)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach((e=>{var i=[];e.columns.forEach((t=>{var s="";if(t)if("group"===e.type&&(t.value=t.component.getKey()),null===t.value)s="";else switch(typeof t.value){case"object":s=JSON.stringify(t.value);break;case"undefined":s="";break;default:s=t.value}i.push(s)})),t.push(i.join("\t"))})),t.join("\n")}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((s=document.body.createTextRange()).moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=j.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=j.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e}}paste(e){var t,i,s;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach((e=>{t.push(this.table.modules.mutator.transformRow(e,"clipboard"))})):t=e,t}checkPaseOrigin(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}j.moduleName="clipboard",j.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},j.pasteParsers={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,o=[],n=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=s.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=s.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),n.push(t)})),n)}};class G{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}_getSelf(){return this._row}}var U={avg:function(e,t,i){var s=0,o=void 0!==i.precision?i.precision:2;return e.length&&(s=e.reduce((function(e,t){return Number(e)+Number(t)})),s/=e.length,s=!1!==o?s.toFixed(o):s),parseFloat(s).toString()},max:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))>s||null===s)&&(s=e)})),null!==s?!1!==o?s.toFixed(o):s:""},min:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))<s||null===s)&&(s=e)})),null!==s?!1!==o?s.toFixed(o):s:""},sum:function(e,t,i){var s=0,o=void 0!==i.precision&&i.precision;return e.length&&e.forEach((function(e){e=Number(e),s+=isNaN(e)?0:Number(e)})),!1!==o?s.toFixed(o):s},concat:function(e,t,i){var s=0;return e.length&&(s=e.reduce((function(e,t){return String(e)+String(t)}))),s},count:function(e,t,i){var s=0;return e.length&&e.forEach((function(e){e&&s++})),s}};class X extends k{constructor(e){super(e),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new n({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?("table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs||this.recalcActiveRows(),"table"!=this.table.options.columnCalcs&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":X.calculations[t.topCalc]?i.topCalc=X.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":X.calculations[t.bottomCalc]?i.botCalc=X.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){this.topInitialized||(this.table.columnManager.getContentsElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){(this.topCalcs.length||this.botCalcs.length)&&("group"!==this.table.options.columnCalcs&&this.recalcActiveRows(),this.table.options.groupBy&&"table"!==this.table.options.columnCalcs&&this.table.modules.groupRows.getChildGroups().forEach((e=>{this.recalcGroup(e)})))}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[];return e.forEach((e=>{if(t.push(e.getData()),this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs&&e.modules.dataTree&&e.modules.dataTree.open){var i=this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(e));t=t.concat(i)}})),t}generateRow(e,t){var i,s=this.generateRowData(e,t);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new p(s,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),i.component=!1,i.getComponent=()=>(i.component||(i.component=new G(i)),i.component),i.generateCells=()=>{var t=[];this.table.columnManager.columnsByIndex.forEach((s=>{this.genColumn.setField(s.getField()),this.genColumn.hozAlign=s.hozAlign,s.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(s.definition[e+"CalcFormatter"]),params:s.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=s.definition.cssClass;var n=new o(this.genColumn,i);n.getElement(),n.column=s,n.setWidth(),s.cells.push(n),t.push(n),s.visible||n.hide()})),i.cells=t},i}generateRowData(e,t){var i,s,o={},n="top"==e?this.topCalcs:this.botCalcs,r="top"==e?"topCalc":"botCalc";return n.forEach((function(e){var n=[];e.modules.columnCalcs&&e.modules.columnCalcs[r]&&(t.forEach((function(t){n.push(e.getFieldValue(t))})),s=r+"Params",i="function"==typeof e.modules.columnCalcs[s]?e.modules.columnCalcs[s](n,t):e.modules.columnCalcs[s],e.setFieldValue(o,e.modules.columnCalcs[r](n,t,i)))})),o}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach((t=>{e[t.getKey()]=this.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={};return i.forEach((e=>{s[e.getKey()]=this.getGroupResults(e)})),{top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s}}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}}X.moduleName="columnCalcs",X.calculations=U;class q extends k{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement&&(!0===t.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof t.dataTreeBranchElement?((e=document.createElement("div")).innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement),t.dataTreeCollapseElement?"string"==typeof t.dataTreeCollapseElement?((e=document.createElement("div")).innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),t.dataTreeExpandElement?"string"==typeof t.dataTreeExpandElement?((e=document.createElement("div")).innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(e,i){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(e,i){return t.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){e&&this.table.rowManager.getRows().forEach((e=>{this.reinitializeRowChildren(e)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach((t=>{e=e.concat(this.getTreeChildren(t,!1,!0))})),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&"object"==typeof t&&null!==t;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!s&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:s}}reinitializeRowChildren(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}layoutRow(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.collapseRow(e)}))):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.expandRow(e)}))),i.controlEl.addEventListener("mousedown",(e=>{e.stopPropagation()})),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach(((e,i)=>{var s;t.push(e),e instanceof p&&(e.create(),(s=e.modules.dataTree.children).index||!1===s.children||this.getChildren(e).forEach((e=>{e.create(),t.push(e)})))})),t}getChildren(e,t){var i=e.modules.dataTree,s=[],o=[];return!1!==i.children&&(i.open||t)&&(Array.isArray(i.children)||(i.children=this.generateChildren(e)),s=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(i.children):i.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(s),s.forEach((e=>{o.push(e),this.getChildren(e).forEach((e=>{o.push(e)}))}))),o}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach((i=>{var s=new p(i||{},this.table.rowManager);s.create(),s.modules.dataTree.index=e.modules.dataTree.index+1,s.modules.dataTree.parent=e,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),t.push(s)})),t}expandRow(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((e=>{e instanceof p&&i.push(e)}))),i}rowDelete(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==s&&!1!==(o=this.findChildIndex(s,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return"object"==typeof e?e instanceof p?i=e.data:e instanceof u?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find((t=>t instanceof p&&t.element===e)))&&(i=i.data):null===e&&(i=!1):i=void 0!==e&&t.data[this.field].find((t=>t.data[this.table.options.index]==e)),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,o=[];return s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach((e=>{e instanceof p&&(o.push(t?e.getComponent():e),i&&(o=o.concat(this.getTreeChildren(e,t,i))))}))),o}getChildField(){return this.field}redrawNeeded(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}q.moduleName="dataTree";var K={csv:function(e,t={},i){var s=t.delimiter?t.delimiter:",",o=[],n=[];e.forEach((e=>{var t=[];switch(e.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":e.columns.forEach(((e,t)=>{e&&1===e.depth&&(n[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":e.columns.forEach((e=>{if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}})),o.push(t.join(s))}})),n.length&&o.unshift(n.join(s)),o=o.join("\n"),t.bom&&(o="\ufeff"+o),i(o,"text/csv")},json:function(e,t,i){var s=[];e.forEach((e=>{var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(t)}})),i(s=JSON.stringify(s,null,"\t"),"application/json")},jsonLines:function(e,t,i){const s=[];e.forEach((e=>{const t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(JSON.stringify(t))}})),i(s.join("\n"),"application/x-ndjson")},pdf:function(e,t={},i){var s=[],o=[],n={},r=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},a=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},l=t.jsPDF||{},h=t.title?t.title:"";function d(e,t){var i=[];return e.columns.forEach((e=>{var s;if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}s={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(s.styles=t),i.push(s)}})),i}l.orientation||(l.orientation=t.orientation||"landscape"),l.unit||(l.unit="pt"),e.forEach((e=>{switch(e.type){case"header":s.push(d(e));break;case"group":o.push(d(e,r));break;case"calc":o.push(d(e,a));break;case"row":o.push(d(e))}}));var c=new jspdf.jsPDF(l);t.autoTable&&(n="function"==typeof t.autoTable?t.autoTable(c)||{}:t.autoTable),h&&(n.didDrawPage=function(e){c.text(h,40,30)}),n.head=s,n.body=o,c.autoTable(n),t.documentProcessing&&t.documentProcessing(c),i(c.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,s){var o=i.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new e(this),a=!("compress"in i)||i.compress;function l(){var e=[],i=[],s={},o={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce(((e,t)=>e+(t&&t.width?t.width:1)),0):0,r:t.length}};return t.forEach(((t,s)=>{var o=[];t.columns.forEach((function(e,t){e?(o.push(e.value instanceof Date||"object"!=typeof e.value?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&(e.height>1||e.width>1)&&i.push({s:{r:s,c:t},e:{r:s+e.height-1,c:t+e.width-1}})):o.push("")})),e.push(o)})),XLSX.utils.sheet_add_aoa(s,e),s["!ref"]=XLSX.utils.encode_range(o),i.length&&(s["!merges"]=i),s}if(n.SheetNames=[],n.Sheets={},i.sheetOnly)s(l());else{if(i.sheets)for(var h in i.sheets)!0===i.sheets[h]?(n.SheetNames.push(h),n.Sheets[h]=l()):(n.SheetNames.push(h),r.commsSend(i.sheets[h],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){n.Sheets[h]=e}}));else n.SheetNames.push(o),n.Sheets[o]=l();i.documentProcessing&&(n=i.documentProcessing(n)),s(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s!=e.length;++s)i[s]=255&e.charCodeAt(s);return t}(XLSX.write(n,{bookType:"xlsx",bookSST:!0,type:"binary",compression:a})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(e),"text/html")}};class J extends k{constructor(e){super(e),this.registerTableOption("downloadEncoder",(function(e,t){return new Blob([e],{type:t})})),this.registerTableOption("downloadReady",void 0),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){this.deprecationCheck("downloadReady","downloadEncoder")}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,o){var n=!1;if("function"==typeof e?n=e:J.downloaders[e]?n=J.downloaders[e]:console.warn("Download Error - No such download type found: ",e),n){var r=this.generateExportList(s);n.call(this.table,r,i||{},function(i,s){o?!0===o?this.triggerDownload(i,s,e,t,!0):o(i):this.triggerDownload(i,s,e,t)}.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((e=>{var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}triggerDownload(e,t,i,s,o){var n=document.createElement("a"),r=this.table.options.downloadEncoder(e,t);r&&(o?window.open(window.URL.createObjectURL(r)):(s=s||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,s):(n.setAttribute("href",window.URL.createObjectURL(r)),n.setAttribute("download",s),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n))),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){if("intercept"===t)this.download(i.type,"",i.options,i.active,i.intercept)}}function Y(e,t){var i=t.mask,s=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",n=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function r(t){var a=i[t];void 0!==a&&a!==n&&a!==s&&a!==o&&(e.value=e.value+""+a,r(t+1))}e.addEventListener("keydown",(t=>{var r=e.value.length,a=t.key;if(t.keyCode>46&&!t.ctrlKey&&!t.metaKey){if(r>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[r]){case s:if(a.toUpperCase()==a.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(a))return t.preventDefault(),t.stopPropagation(),!1;break;case n:break;default:if(a!==i[r])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(i=>{i.keyCode>46&&t.maskAutoFill&&r(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&r(e.value.length)}J.moduleName="download",J.downloaders=K;class ${constructor(e,t,i,s,o,n){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(n),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!t._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.filterTerm="",this.blurable=!0,this.actions={success:s,cancel:o},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){this.params.listItemFormatter&&this.cell.getTable().deprecationAdvisor.msg("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&this.cell.getTable().deprecationAdvisor.msg("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&this.cell.getTable().deprecationAdvisor.msg("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&this.cell.getTable().deprecationAdvisor.msg("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}_initializeValue(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.isFilter||(this.input.style.height="100%",this.input.focus({preventScroll:!0})),e.addEventListener("click",t),setTimeout((()=>{e.removeEventListener("click",t)}),1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&"object"==typeof e)for(let i in e)"+"==i.charAt(0)?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&Y(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter((e=>i.includes(e))).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&!e.valuesURL&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((()=>{this.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout((()=>{this.popup&&this.popup.restoreHide()}),10)}_preventBlur(){this.blurable=!1,setTimeout((()=>{this.blurable=!0}),10)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t<this.displayItems.length-1)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t<this.displayItems.length-1&&(-1==t?this._focusItem(this.displayItems[0]):this._focusItem(this.displayItems[t+1])))}_keySide(e){this.params.autocomplete||(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())}_keyEnter(e){this.params.autocomplete&&"typing"===this.lastAction?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem)}_keyEsc(e){this._cancel()}_keyHomeEnd(e){this.params.autocomplete&&e.stopImmediatePropagation()}_keySelectLetter(e){this.params.autocomplete||(e.preventDefault(),e.keyCode>=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}_keyAutoCompLetter(e){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find((e=>void 0!==e.label&&e.label.toLowerCase().startsWith(this.filterTerm)));i&&this._focusItem(i),this.filterTimeout=setTimeout((()=>{this.filterTerm=""}),800)}_focusItem(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((e=>{Number.isInteger(e)||console.error("List generation error",e)}))}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then((e=>this.listIteration===i?this._parseList(e):Promise.reject(i)))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");"function"==typeof e&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){return e=I(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((e=>e.ok?e.json().catch((e=>(console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)))):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e)))).catch((e=>(console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e))))}_uniqueColumnValues(e){var t,i={},s=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?s.forEach((e=>{var s=t.getFieldValue(e);null!=s&&""!==s&&(i[s]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map((([e,t])=>({label:t,value:e})))),e.forEach((e=>{"object"!=typeof e&&(e={label:e,value:e}),this._parseListItem(e,t,0)})),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((e=>{this._parseListItem(e,i.options,t)})),i}_sortOptions(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort(((t,i)=>e(t.label,i.label,t.value,i.value,t.original,i.original))),t.forEach((t=>{t.group&&this._sortGroup(e,t.options)}))}_defaultSortFunction(e,t){var i,s,o,n,r,a=0,l=/(\d+)|(\D+)/g,h=/\d/,d=0;if("desc"===this.params.sort&&([e,t]=[t,e]),e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(s=String(t).toLowerCase()))return 0;if(!h.test(i)||!h.test(s))return i>s?1:-1;for(i=i.match(l),s=s.match(l),r=i.length>s.length?s.length:i.length;a<r;)if((o=i[a])!==(n=s[a++]))return isFinite(o)&&isFinite(n)?("0"===o.charAt(0)&&(o="."+o),"0"===n.charAt(0)&&(n="."+n),o-n):o>n?1:-1;return i.length>s.length}d=1}else d=t||0===t?-1:0;return d}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach((i=>{this._filterItem(e,t,i)}))):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach((i=>{this._filterItem(e,t,i)&&(s=!0)})),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){return e=String(e).toLowerCase(),null!=t&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach((e=>{this._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t,i=e.element;if(!this.filtered||e.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(t=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,i):e.label)instanceof HTMLElement?i.appendChild(t):i.innerHTML=t,e.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&"object"==typeof e.elementAttributes)for(let t in e.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),i.setAttribute(t,this.input.getAttribute(t)+e.elementAttributes["+"+t])):i.setAttribute(t,e.elementAttributes[t]);e.group?i.addEventListener("click",this._groupClick.bind(this,e)):i.addEventListener("click",this._itemClick.bind(this,e)),i.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=i}this._styleItem(e),this.listEl.appendChild(i),e.group?e.options.forEach((e=>{this._buildItem(e)})):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty)return void(this.popup&&this.popup.hide(!0));this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||setTimeout((()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))}),10)}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach((e=>{e.selected=!1,this._styleItem(e)})),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((e=>e.label)).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((e=>e.value));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues)||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}}var Z={input:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type",o.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(e){null==n&&""!==r.value||r.value!==n?i(r.value)&&(n=r.value):s()}return r.value=void 0!==n?n:"",t((function(){e._getSelf&&(r.focus({preventScroll:!0}),r.style.height="100%",o.selectContents&&r.select())})),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),o.mask&&Y(r,o),r},textarea:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"hybrid",a=String(null!=n?n:""),l=document.createElement("textarea"),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+o.elementAttributes["+"+e])):l.setAttribute(e,o.elementAttributes[e]);function d(t){null==n&&""!==l.value||l.value!==n?(i(l.value)&&(n=l.value),setTimeout((function(){e.getRow().normalizeHeight()}),300)):s()}return l.value=a,t((function(){e._getSelf&&(l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",e.getRow().normalizeHeight(),o.selectContents&&l.select())})),l.addEventListener("change",d),l.addEventListener("blur",d),l.addEventListener("keyup",(function(){l.style.height="";var t=l.scrollHeight;l.style.height=t+"px",t!=h&&(h=t,e.getRow().normalizeHeight())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:e.shiftKey&&o.shiftEnterSubmit&&d();break;case 27:s();break;case 38:("editor"==r||"hybrid"==r&&l.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&l.selectionStart!==l.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&Y(l,o),l},number:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"editor",a=document.createElement("input");if(a.setAttribute("type","number"),void 0!==o.max&&a.setAttribute("max",o.max),void 0!==o.min&&a.setAttribute("min",o.min),void 0!==o.step&&a.setAttribute("step",o.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+o.elementAttributes["+"+e])):a.setAttribute(e,o.elementAttributes[e]);a.value=n;var l=function(e){h()};function h(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!==n?i(e)&&(n=e):s()}return t((function(){e._getSelf&&(a.removeEventListener("blur",l),a.focus({preventScroll:!0}),a.style.height="100%",a.addEventListener("blur",l),o.selectContents&&a.select())})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:s();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&Y(a,o),a},range:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=n?i(e)&&(n=e):s()}return r.value=n,t((function(){e._getSelf&&(r.focus({preventScroll:!0}),r.style.height="100%")})),r.addEventListener("blur",(function(e){a()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s()}})),r},date:function(e,t,i,s,o){var n=o.format,r=o.verticalNavigation||"editor",a=n?window.DateTime||luxon.DateTime:null,l=e.getValue(),h=document.createElement("input");function d(e){return(a.isDateTime(e)?e:"iso"===n?a.fromISO(String(e)):a.fromFormat(String(e),n)).toFormat("yyyy-MM-dd")}if(h.type="date",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",o.max&&h.setAttribute("max",n?d(o.max):o.max),o.min&&h.setAttribute("min",n?d(o.min):o.min),o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),h.setAttribute(e,h.getAttribute(e)+o.elementAttributes["+"+e])):h.setAttribute(e,o.elementAttributes[e]);function c(){var e,t=h.value;if(null==l&&""!==t||t!==l){if(t&&n)switch(e=a.fromFormat(String(t),"yyyy-MM-dd"),n){case!0:t=e;break;case"iso":t=e.toISO();break;default:t=e.toFormat(n)}i(t)&&(l=h.value)}else s()}return l=void 0!==l?l:"",n&&(a?l=d(l):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),h.value=l,t((function(){e._getSelf&&(h.focus({preventScroll:!0}),h.style.height="100%",o.selectContents&&h.select())})),h.addEventListener("blur",(function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==h)&&c()})),h.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:c();break;case 27:s();break;case 35:case 36:e.stopPropagation();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation())}})),h},time:function(e,t,i,s,o){var n,r=o.format,a=o.verticalNavigation||"editor",l=r?window.DateTime||luxon.DateTime:null,h=e.getValue(),d=document.createElement("input");if(d.type="time",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),d.setAttribute(e,d.getAttribute(e)+o.elementAttributes["+"+e])):d.setAttribute(e,o.elementAttributes[e]);function c(){var e,t=d.value;if(null==h&&""!==t||t!==h){if(t&&r)switch(e=l.fromFormat(String(t),"hh:mm"),r){case!0:t=e;break;case"iso":t=e.toISO();break;default:t=e.toFormat(r)}i(t)&&(h=d.value)}else s()}return h=void 0!==h?h:"",r&&(l?(n=l.isDateTime(h)?h:"iso"===r?l.fromISO(String(h)):l.fromFormat(String(h),r),h=n.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),d.value=h,t((function(){e._getSelf&&(d.focus({preventScroll:!0}),d.style.height="100%",o.selectContents&&d.select())})),d.addEventListener("blur",(function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==d)&&c()})),d.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:c();break;case 27:s();break;case 35:case 36:e.stopPropagation();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation())}})),d},datetime:function(e,t,i,s,o){var n,r=o.format,a=o.verticalNavigation||"editor",l=r?window.DateTime||luxon.DateTime:null,h=e.getValue(),d=document.createElement("input");if(d.type="datetime-local",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),d.setAttribute(e,d.getAttribute(e)+o.elementAttributes["+"+e])):d.setAttribute(e,o.elementAttributes[e]);function c(){var e,t=d.value;if(null==h&&""!==t||t!==h){if(t&&r)switch(e=l.fromISO(String(t)),r){case!0:t=e;break;case"iso":t=e.toISO();break;default:t=e.toFormat(r)}i(t)&&(h=d.value)}else s()}return h=void 0!==h?h:"",r&&(l?(n=l.isDateTime(h)?h:"iso"===r?l.fromISO(String(h)):l.fromFormat(String(h),r),h=n.toFormat("yyyy-MM-dd")+"T"+n.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),d.value=h,t((function(){e._getSelf&&(d.focus({preventScroll:!0}),d.style.height="100%",o.selectContents&&d.select())})),d.addEventListener("blur",(function(e){(e.relatedTarget||e.rangeParent||e.explicitOriginalTarget!==d)&&c()})),d.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:c();break;case 27:s();break;case 35:case 36:e.stopPropagation();break;case 38:case 40:"editor"==a&&(e.stopImmediatePropagation(),e.stopPropagation())}})),d},select:function(e,t,i,s,o){return this.deprecationMsg("The select editor has been deprecated, please use the new list editor"),new $(this,e,t,i,s,o).input},list:function(e,t,i,s,o){return new $(this,e,t,i,s,o).input},autocomplete:function(e,t,i,s,o){return this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new $(this,e,t,i,s,o).input},star:function(e,t,i,s,o){var n=this,r=e.getElement(),a=e.getValue(),l=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,d=[],c=document.createElement("div"),u=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(e){d.forEach((function(t,i){i<e?("ie"==n.table.browser?t.setAttribute("class","tabulator-star-active"):t.classList.replace("tabulator-star-inactive","tabulator-star-active"),t.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'):("ie"==n.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>')}))}function m(e){var t=document.createElement("span"),s=u.cloneNode(!0);d.push(s),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),p(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e),r.blur()})),t.appendChild(s),c.appendChild(t)}function g(e){a=e,p(e)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",c.style.verticalAlign="middle",c.style.display="inline-block",c.style.padding="4px",u.setAttribute("width",h),u.setAttribute("height",h),u.setAttribute("viewBox","0 0 512 512"),u.setAttribute("xml:space","preserve"),u.style.padding="0 1px",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),c.setAttribute(e,c.getAttribute(e)+o.elementAttributes["+"+e])):c.setAttribute(e,o.elementAttributes[e]);for(var b=1;b<=l;b++)m(b);return p(a=Math.min(parseInt(a),l)),c.addEventListener("mousemove",(function(e){p(0)})),c.addEventListener("click",(function(e){i(0)})),r.addEventListener("blur",(function(e){s()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(a+1);break;case 37:g(a-1);break;case 13:i(a);break;case 27:s()}})),c},progress:function(e,t,i,s,o){var n,r,a=e.getElement(),l=void 0===o.max?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,h=void 0===o.min?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,d=(l-h)/100,c=e.getValue()||0,u=document.createElement("div"),p=document.createElement("div");function m(){var e=window.getComputedStyle(a,null),t=d*Math.round(p.offsetWidth/((a.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+h;i(t),a.setAttribute("aria-valuenow",t),a.setAttribute("aria-label",c)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),p.setAttribute(e,p.getAttribute(e)+o.elementAttributes["+"+e])):p.setAttribute(e,o.elementAttributes[e]);return a.style.padding="4px 4px",c=Math.min(parseFloat(c),l),c=Math.max(parseFloat(c),h),c=Math.round((c-h)/d),p.style.width=c+"%",a.setAttribute("aria-valuemin",h),a.setAttribute("aria-valuemax",l),p.appendChild(u),u.addEventListener("mousedown",(function(e){n=e.screenX,r=p.offsetWidth})),u.addEventListener("mouseover",(function(){u.style.cursor="ew-resize"})),a.addEventListener("mousemove",(function(e){n&&(p.style.width=r+e.screenX-n+"px")})),a.addEventListener("mouseup",(function(e){n&&(e.stopPropagation(),e.stopImmediatePropagation(),n=!1,r=!1,m())})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+a.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-a.clientWidth/100+"px";break;case 9:case 13:m();break;case 27:s()}})),a.addEventListener("blur",(function(){s()})),p},tickCross:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input"),a=o.tristate,l=void 0===o.indeterminateValue?null:o.indeterminateValue,h=!1,d=Object.keys(o).includes("trueValue"),c=Object.keys(o).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function u(e){var t=r.checked;return d&&t?t=o.trueValue:c&&!t&&(t=o.falseValue),a?e?h?l:t:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,l):(h=!1,t):t}return r.value=n,!a||void 0!==n&&n!==l&&""!==n||(h=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&"safari"!=this.table.browser&&t((function(){e._getSelf&&r.focus({preventScroll:!0})})),r.checked=d?n===o.trueValue:!0===n||"true"===n||"True"===n||1===n,r.addEventListener("change",(function(e){i(u())})),r.addEventListener("blur",(function(e){i(u(!0))})),r.addEventListener("keydown",(function(e){13==e.keyCode&&i(u()),27==e.keyCode&&s()})),r}};class Q extends k{constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.editors=Q.editors,this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("row-layout",this.rowEditableCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((()=>{setTimeout((()=>{t.getComponent().navigateNext()}))}))))}cellIsEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.table.modules.edit.clearEdited(e._getSelf())}))}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft())return!0;if((s=this.table.rowManager.prevDisplayRow(e.row,!0))&&(i=this.findPrevEditableCell(s,s.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight())return!0;if((s=this.table.rowManager.nextDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateRight(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateUp(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}navigateDown(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}findNextEditableCell(e,t){var i=!1;if(t<e.cells.length-1)for(var s=t+1;s<e.cells.length;s++){let t=e.cells[s];if(t.column.modules.edit&&r.elVisible(t.getElement())){if(this.allowEdit(t)){i=t;break}}}return i}findPrevEditableCell(e,t){var i=!1;if(t>0)for(var s=t-1;s>=0;s--){let t=e.cells[s];if(t.column.modules.edit&&r.elVisible(t.getElement())){if(this.allowEdit(t)){i=t;break}}}return i}initializeColumnCheck(e){void 0!==e.definition.editor&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}rowEditableCheck(e){e.getCells().forEach((e=>{e.column.modules.edit&&"function"==typeof e.column.modules.edit.check&&this.updateCellClass(e)}))}initializeColumn(e){var t={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(typeof e.definition.editor){case"string":this.editors[e.definition.editor]?t.editor=this.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":t.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?this.editors[e.definition.formatter]?t.editor=this.editors[e.definition.formatter]:t.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}t.editor&&(e.modules.edit=t)}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}clearEditor(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=e.row.getElement();s.offsetTop<t?this.table.rowManager.element.scrollTop-=t-s.offsetTop:s.offsetTop+s.offsetHeight>i&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,n=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=e.getElement();this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),n-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),n-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLeft<o?this.table.rowManager.element.scrollLeft-=o-r.offsetLeft:r.offsetLeft+r.offsetWidth>n&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-n)}}allowEdit(e){var t=!!e.column.modules.edit;if(e.column.modules.edit)switch(typeof e.column.modules.edit.check){case"function":e.row.initialized&&(t=e.column.modules.edit.check(e.getComponent()));break;case"string":t=!!e.row.data[e.column.modules.edit.check];break;case"boolean":t=e.column.modules.edit.check}return t}edit(e,t,i){var s,o,n,r=this,a=function(){},l=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,l.blur(),!1;if(t&&t.stopPropagation(),this.allowEdit(e)||i){if(r.cancelEdit(),r.currentCell=e,this.focusScrollAdjust(e),o=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,o)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,o),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",o),n="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(o):e.column.modules.edit.params,s=e.column.modules.edit.editor.call(r,o,(function(e){a=e}),(function(t){if(r.currentCell===e){var i=r.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===r.table.options.validationMode?(r.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==r.editedCells.indexOf(e)&&r.editedCells.push(e),e.setValue(t,!0),!0===i):(r.invalidEdit=!0,r.focusCellNoEvent(e,!0),a(),!1)}}),(function(){r.currentCell===e&&r.cancelEdit()}),n),!this.currentCell||!1===s)return l.blur(),!1;if(!(s instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",s),l.blur(),!1;for(l.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(s),a();for(var h=l.children,d=0;d<h.length;d++)h[d].addEventListener("click",(function(e){e.stopPropagation()}));return!0}return this.mouseClick=!1,l.blur(),!1}this.invalidEdit||this.currentCell===e||this.cancelEdit()}getEditedCells(){var e=[];return this.editedCells.forEach((t=>{e.push(t.getComponent())})),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1)}}Q.moduleName="edit",Q.editors=Z;class ee{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class te{constructor(e,t,i,s,o){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=o}}class ie extends k{constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],n=this.bodyToExportRows(this.rowLookup(i));return o.concat(n)}generateTable(e,t,i,s){var o=this.generateExportList(e,t,i,s);return this.generateTableElement(o)}rowLookup(e){var t=[];if("function"==typeof e)e.call(this.table).forEach((e=>{(e=this.table.rowManager.findRow(e))&&t.push(e)}));else switch(e){case!0:case"visible":t=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":t=this.table.rowManager.rows;break;case"selected":t=this.table.modules.selectRow.selectedRows;break;default:t=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],t)}generateColumnGroupHeaders(){var e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((t=>{var i=this.processColumnGroup(t);i&&e.push(i)})),e}processColumnGroup(e){var t=e.columns,i=0,s={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(t.length){if(s.subGroups=[],s.width=0,t.forEach((e=>{var t=this.processColumnGroup(e);t&&(s.width+=t.width,s.subGroups.push(t),t.depth>i&&(i=t.depth))})),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s}columnVisCheck(e){var t=e.definition[this.colVisProp];return"function"==typeof t&&(t=t.call(this.table,e.getComponent())),!1!==t&&(e.visible||!e.visible&&t)}headersToExportRows(e){var t=[],i=0,s=[];function o(e,s){var n=i-s;if(void 0===t[s]&&(t[s]=[]),e.height=e.subGroups?1:n-e.depth+1,t[s].push(e),e.height>1)for(let i=1;i<e.height;i++)void 0===t[s+i]&&(t[s+i]=[]),t[s+i].push(!1);if(e.width>1)for(let i=1;i<e.width;i++)t[s].push(!1);e.subGroups&&e.subGroups.forEach((function(e){o(e,s+1)}))}return e.forEach((function(e){e.depth>i&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((e=>{var t=[];e.forEach((e=>{if(e){let i=void 0===e.title?"":e.title;t.push(new te(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),s.push(new ee("header",t))})),s}bodyToExportRows(e){var t=[],i=[];return this.table.columnManager.columnsByIndex.forEach((e=>{this.columnVisCheck(e)&&t.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((e=>{switch(e.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach(((e,s)=>{var o=e.getData(this.colVisProp),n=[],r=0;switch(e.type){case"group":r=e.level,n.push(new te(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach((e=>{n.push(new te(e._column.getFieldValue(o),e,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new ee(e.type,n,e.getComponent(),r))})),i}generateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),o=this.lookupTableStyles(),n=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==n?n:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),t.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(((e,t)=>{let n;switch(e.type){case"header":i.appendChild(this.generateHeaderElement(e,r,o));break;case"group":s.appendChild(this.generateGroupElement(e,r,o));break;case"calc":s.appendChild(this.generateCalcElement(e,r,o));break;case"row":n=this.generateRowElement(e,r,o),this.mapElementStyles(t%2&&o.evenRow?o.evenRow:o.oddRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(n)}})),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}generateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach((e=>{if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,this.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),this.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?this.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&this.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),s.appendChild(t)}})),s}generateGroupElement(e,t,i){var s=document.createElement("tr"),o=document.createElement("td"),n=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?n.value=t.groupHeader[e.indent](n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1!==t.groupHeader&&(n.value=e.component._group.generator(n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),o.colSpan=n.width,o.innerHTML=n.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),n.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(o),s}generateCalcElement(e,t,i){var s=this.generateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}generateRowElement(e,t,i){var s=document.createElement("tr");if(s.classList.add("tabulator-print-table-row"),e.columns.forEach(((o,n)=>{if(o){var r,a=document.createElement("td"),l=o.component._column,h=this.table.columnManager.findColumnIndex(l),d=o.value,c={modules:{},getValue:function(){return d},getField:function(){return l.definition.field},getElement:function(){return a},getColumn:function(){return l.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getComponent:function(){return c},column:l};if((l.definition.cssClass?l.definition.cssClass.split(" "):[]).forEach((function(e){a.classList.add(e)})),this.table.modExists("format")&&!1!==this.config.formatCells)d=this.table.modules.format.formatExportValue(c,this.colVisProp);else switch(typeof d){case"object":d=null!==d?JSON.stringify(d):"";break;case"undefined":d=""}d instanceof Node?a.appendChild(d):a.innerHTML=d,(r=i.styleCells&&i.styleCells[h]?i.styleCells[h]:i.firstCell)&&(this.mapElementStyles(r,a,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),l.definition.align&&(a.style.textAlign=l.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(t.treeElementField&&t.treeElementField==l.field||!t.treeElementField&&0==n)&&(e.component._row.modules.dataTree.controlEl&&a.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),a.firstChild),e.component._row.modules.dataTree.branchEl&&a.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),a.firstChild)),s.appendChild(a),c.modules.format&&c.modules.format.renderedCallback&&c.modules.format.renderedCallback()}})),t.rowFormatter&&"row"===e.type&&!1!==this.config.formatCells){Object.assign(e.component).getElement=function(){return s},t.rowFormatter(e.component)}return s}generateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.generateHTMLTable(o)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[s[e]]||(t.style[s[e]]=o.getPropertyValue(e))}))}}}}ie.moduleName="export";var se={"=":function(e,t,i,s){return t==e},"<":function(e,t,i,s){return t<e},"<=":function(e,t,i,s){return t<=e},">":function(e,t,i,s){return t>e},">=":function(e,t,i,s){return t>=e},"!=":function(e,t,i,s){return t!=e},regex:function(e,t,i,s){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,s){var o=e.toLowerCase().split(void 0===s.separator?" ":s.separator),n=String(null==t?"":t).toLowerCase(),r=[];return o.forEach((e=>{n.includes(e)&&r.push(!0)})),s.matchAll?r.length===o.length:!!r.length},starts:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,s){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}};class oe extends k{constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((e=>{var t=this.table.columnManager.findColumn(e.field);if(!t)return console.warn("Column Filter Error - No matching column found:",e.field),!1;this.setHeaderFilterValue(t,e.value)})),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){e.definition.headerFilter&&this.initializeColumn(e)}initializeColumn(e,t){var i=this,s=e.getField();e.modules.filter={success:function(t){var o,n="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",a="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[s];else{switch(e.modules.filter.value=t,typeof e.definition.headerFilterFunc){case"string":oe.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,oe.filters[e.definition.headerFilterFunc](t,o,i,s)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,e.definition.headerFilterFunc(t,o,i,s)}}if(!o)if("partial"===n)o=function(i){var s=e.getFieldValue(i);return null!=s&&String(s).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";else o=function(i){return e.getFieldValue(i)==t},r="=";i.headerFilters[s]={value:t,func:o,type:r}}e.modules.filter.value=t,a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s,o,n,r,a,l,h,d,c=this,u=e.modules.filter.success,p=e.getField();if(e.modules.filter.value=t,e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),p){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&0!==e},(s=document.createElement("div")).classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":c.table.modules.edit.editors[e.definition.headerFilter]?(o=c.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":o=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?o=e.modules.edit.editor:e.definition.formatter&&c.table.modules.edit.editors[e.definition.formatter]?(o=c.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):o=c.table.modules.edit.editors.input}if(o){if(r={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return s},getColumn:function(){return e.getComponent()},getTable:()=>this.table,getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=e.definition.headerFilterParams||{})?h.call(c.table,r):h,!(n=o.call(this.table.modules.edit,r,(function(e){d=e}),u,(function(){}),h)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(n instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",n);c.langBind("headerFilters|columns|"+e.definition.field,(function(t){n.setAttribute("placeholder",void 0!==t&&t?t:e.definition.headerFilterPlaceholder||c.langText("headerFilters|default"))})),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("focus",(e=>{var t=this.table.columnManager.contentsElement.scrollLeft;t!==this.table.rowManager.element.scrollLeft&&(this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})),a=!1,l=function(e){a&&clearTimeout(a),a=setTimeout((function(){u(n.value)}),c.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=n,e.modules.filter.attrType=n.hasAttribute("type")?n.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=n.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(n.addEventListener("keyup",l),n.addEventListener("search",l),"number"==e.modules.filter.attrType&&n.addEventListener("change",(function(e){u(n.value)})),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&n.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||n.addEventListener("mousedown",(function(e){e.stopPropagation()}))),s.appendChild(n),e.contentElement.appendChild(s),i||c.headerFilterColumns.push(e),d&&d()}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}showHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}setHeaderFilterFocus(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}reloadHeaderFilter(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var o=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach((e=>{(e=this.findFilter(e))&&(this.filterList.push(e),o=!0)})),o&&this.trackChanges()}findFilter(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:oe.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return oe.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return oe.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}findSubFilters(e){var t=[];return e.forEach((e=>{(e=this.findFilter(e))&&t.push(e)})),!!t.length&&t}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}filtersToArray(e,t){var i=[];return e.forEach((e=>{var s;Array.isArray(e)?i.push(this.filtersToArray(e,t)):(s={field:e.field,type:e.type,value:e.value},t&&"function"==typeof s.type&&(s.type="function"),i.push(s))})),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach((e=>{var t=-1;(t="object"==typeof e.field?this.filterList.findIndex((t=>e===t)):this.filterList.findIndex((t=>e.field===t.field&&e.type===t.type&&e.value===t.value)))>-1?this.filterList.splice(t,1):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)})),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((e=>{void 0!==e.modules.filter.value&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)})),this.trackChanges()}search(e,t,i,s){var o=[],n=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach((e=>{(e=this.findFilter(e))&&n.push(e)})),this.table.rowManager.rows.forEach((t=>{var i=!0;n.forEach((e=>{this.filterRecurse(e,t.getData())||(i=!1)})),i&&o.push("data"===e?t.getData("data"):t.getComponent())})),o}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((e=>{this.filterRow(e)&&i.push(e)})):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach((e=>{s.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();for(var o in this.filterList.forEach((e=>{this.filterRecurse(e,s)||(i=!1)})),this.headerFilters)this.headerFilters[o].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach((e=>{this.filterRecurse(e,t)&&(i=!0)})):i=e.func(t),i}}oe.moduleName="filter",oe.filters=se;var ne={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var s,o,n,r,a=parseFloat(e.getValue()),l="",h=t.decimal||".",d=t.thousand||",",c=t.negativeSign||"-",u=t.symbol||"",p=!!t.symbolAfter,m=void 0!==t.precision?t.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(a<0&&(a=Math.abs(a),l=c),s=!1!==m?a.toFixed(m):a,o=(s=String(s).split("."))[0],n=s.length>1?h+s[1]:"",!1!==t.thousand)for(r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+d+"$2");return p?l+o+n+u:l+u+o+n},link:function(e,t,i){var s,o=e.getValue(),n=t.urlPrefix||"",r=t.download,a=o,l=document.createElement("a");if(t.labelField&&(s=e.getData(),a=function e(t,i){var s=i[t.shift()];return t.length&&"object"==typeof s?e(t,s):s}(t.labelField.split(this.table.options.nestedFieldSeparator),s)),t.label)switch(typeof t.label){case"string":a=t.label;break;case"function":a=t.label(e)}if(a){if(t.urlField&&(o=(s=e.getData())[t.urlField]),t.url)switch(typeof t.url){case"string":o=t.url;break;case"function":o=t.url(e)}return l.setAttribute("href",n+o),t.target&&l.setAttribute("target",t.target),t.download&&(r="function"==typeof r?r(e):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return" "},image:function(e,t,i){var s=document.createElement("img"),o=e.getValue();switch(t.urlPrefix&&(o=t.urlPrefix+e.getValue()),t.urlSuffix&&(o+=t.urlSuffix),s.setAttribute("src",o),typeof t.height){case"number":s.style.height=t.height+"px";break;case"string":s.style.height=t.height}switch(typeof t.width){case"number":s.style.width=t.width+"px";break;case"string":s.style.width=t.width}return s.addEventListener("load",(function(){e.getRow().normalizeHeight()})),s},tickCross:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t.allowEmpty,r=t.allowTruthy,a=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',h=void 0!==t.crossElement?t.crossElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';return a&&s===t.trueValue||!a&&(r&&s||!0===s||"true"===s||"True"===s||1===s||"1"===s)?(o.setAttribute("aria-checked",!0),l||""):!n||"null"!==s&&""!==s&&null!=s?(o.setAttribute("aria-checked",!1),h||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=t.outputFormat||"dd/MM/yyyy HH:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(s=o.isDateTime(l)?l:"iso"===n?o.fromISO(String(l)):o.fromFormat(String(l),n)).isValid?(t.timezone&&(s=s.setZone(t.timezone)),s.toFormat(r)):!0!==a&&l?"function"==typeof a?a(l):a:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",a=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",h=void 0!==t.humanize&&t.humanize,d=void 0!==t.date?t.date:o.now(),c=e.getValue();if(void 0!==o)return(s=o.isDateTime(c)?c:"iso"===n?o.fromISO(String(c)):o.fromFormat(String(c),n)).isValid?h?s.diff(d,l).toHuman()+(a?" "+a:""):parseInt(s.diff(d,l)[l])+(a?" "+a:""):!0===r?c:"function"==typeof r?r(c):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var s=e.getValue();return void 0===t[s]?(console.warn("Missing display value for "+s),s):t[s]},star:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t&&t.stars?t.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",s=s&&!isNaN(s)?parseInt(s):0,s=Math.max(0,Math.min(s,n));for(var l=1;l<=n;l++){var h=a.cloneNode(!0);h.innerHTML=l<=s?'<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>':'<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',r.appendChild(h)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",s),r},traffic:function(e,t,i){var s,o,n=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,h=t&&void 0!==t.color?t.color:["red","orange","green"],d="#666666";if(!isNaN(n)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),o=parseFloat(n)<=a?parseFloat(n):a,o=parseFloat(o)>=l?parseFloat(o):l,s=(a-l)/100,o=Math.round((o-l)/s),typeof h){case"string":d=h;break;case"function":d=h(n);break;case"object":if(Array.isArray(h)){var c=100/h.length,u=Math.floor(o/c);u=Math.min(u,h.length-1),d=h[u=Math.max(u,0)];break}}return r.style.backgroundColor=d,r}},progress:function(e,t={},i){var o,n,r,a,l,h=this.sanitizeHTML(e.getValue())||0,d=e.getElement(),c=t.max?t.max:100,u=t.min?t.min:0,p=t.legendAlign?t.legendAlign:"center";switch(n=parseFloat(h)<=c?parseFloat(h):c,n=parseFloat(n)>=u?parseFloat(n):u,o=(c-u)/100,n=Math.round((n-u)/o),typeof t.color){case"string":r=t.color;break;case"function":r=t.color(h);break;case"object":if(Array.isArray(t.color)){let e=100/t.color.length,i=Math.floor(n/e);i=Math.min(i,t.color.length-1),i=Math.max(i,0),r=t.color[i];break}default:r="#2DC214"}switch(typeof t.legend){case"string":a=t.legend;break;case"function":a=t.legend(h);break;case"boolean":a=h;break;default:a=!1}switch(typeof t.legendColor){case"string":l=t.legendColor;break;case"function":l=t.legendColor(h);break;case"object":if(Array.isArray(t.legendColor)){let e=100/t.legendColor.length,i=Math.floor(n/e);i=Math.min(i,t.legendColor.length-1),i=Math.max(i,0),l=t.legendColor[i]}break;default:l="#000"}d.style.minWidth="30px",d.style.position="relative",d.setAttribute("aria-label",n);var m=document.createElement("div");m.style.display="inline-block",m.style.width=n+"%",m.style.backgroundColor=r,m.style.height="100%",m.setAttribute("data-max",c),m.setAttribute("data-min",u);var g=document.createElement("div");if(g.style.position="relative",g.style.width="100%",g.style.height="100%",a){var b=document.createElement("div");b.style.position="absolute",b.style.top=0,b.style.left=0,b.style.textAlign=p,b.style.width="100%",b.style.color=l,b.innerHTML=a}return i((function(){if(!(e instanceof s)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",d.appendChild(t),d=t}d.appendChild(g),g.appendChild(m),a&&g.appendChild(b)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>'},buttonCross:function(e,t,i){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>'},rownum:function(e,t,i){var s=document.createElement("span");return e.getRow().watchPosition((e=>{s.innerText=e})),s},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>"},responsiveCollapse:function(e,t,i){var s=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function n(e){var t=o.element;o.open=e,t&&(o.open?(s.classList.add("open"),t.style.display=""):(s.classList.remove("open"),t.style.display="none"))}return s.classList.add("tabulator-responsive-collapse-toggle"),s.innerHTML='<svg class=\'tabulator-responsive-collapse-toggle-open\' viewbox="0 0 24 24">\n <line x1="7" y1="12" x2="17" y2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n <line y1="7" x1="12" y2="17" x2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n</svg>\n\n<svg class=\'tabulator-responsive-collapse-toggle-close\' viewbox="0 0 24 24">\n <line x1="7" y1="12" x2="17" y2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n</svg>',e.getElement().classList.add("tabulator-row-handle"),s.addEventListener("click",(function(t){t.stopImmediatePropagation(),n(!o.open),e.getTable().rowManager.adjustTableSize()})),n(o.open),s},rowSelection:function(e,t,i){var s=document.createElement("input"),o=!1;if(s.type="checkbox",s.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(s.addEventListener("click",(e=>{e.stopPropagation()})),"function"==typeof e.getRow){var n=e.getRow();n instanceof u?(s.addEventListener("change",(e=>{"click"===this.table.options.selectableRangeMode&&o?o=!1:n.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&s.addEventListener("click",(e=>{o=!0,this.table.modules.selectRow.handleComplexRowClick(n._row,e)})),s.checked=n.isSelected&&n.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(n,s)):s=""}else s.addEventListener("change",(e=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(s);return s}};class re extends k{constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}lookupFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];switch(typeof s){case"string":re.formatters[s]?i.formatter=re.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),i.formatter=re.formatters.plaintext);break;case"function":i.formatter=s;break;default:i.formatter=re.formatters.plaintext}return i}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,o,n,r;return e.definition.titleFormatter?(s=this.getFormatter(e.definition.titleFormatter),n=t=>{e.titleFormatterRendered=t},r={getValue:function(){return t},getElement:function(){return i},getColumn:function(){return e.getComponent()},getTable:()=>this.table},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,s.call(this,r,o,n)):t}formatValue(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}formatExportValue(e,t){var i,s=e.column.modules.format[t];if(s){function o(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}return i="function"==typeof s.params?s.params(e.getComponent()):s.params,s.formatter.call(this,e.getComponent(),i,o)}return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=/]/g,(function(e){return t[e]}))}return e}emptyToSpace(e){return null==e||""===e?" ":e}getFormatter(e){switch(typeof e){case"string":re.formatters[e]?e=re.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=re.formatters.plaintext);break;case"function":break;default:e=re.formatters.plaintext}return e}}re.moduleName="format",re.formatters=ne;class ae extends k{constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach((e=>{this.initializeColumn(e)}))}initializeColumn(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}frozenCheck(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach((e=>{e.calcs.top&&this.layoutRow(e.calcs.top),e.calcs.bottom&&this.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&this.layoutGroupCalcs(e.groupList)}))}layoutColumnPosition(e){var t=[],i=0,s=0;this.leftColumns.forEach(((s,o)=>{if(s.modules.frozen.marginValue=i,s.modules.frozen.margin=s.modules.frozen.marginValue+"px",s.visible&&(i+=s.getWidth()),o==this.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var n=this.getColGroupParentElement(s);t.includes(n)||(this.layoutElement(n,s),t.push(n)),s.modules.frozen.edge&&n.classList.add("tabulator-frozen-"+s.modules.frozen.position)}else this.layoutElement(s.getElement(),s);e&&s.cells.forEach((e=>{this.layoutElement(e.getElement(!0),s)}))})),this.rightColumns.forEach(((t,i)=>{t.modules.frozen.marginValue=s,t.modules.frozen.margin=t.modules.frozen.marginValue+"px",t.visible&&(s+=t.getWidth()),i==this.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,t.parent.isGroup?this.layoutElement(this.getColGroupParentElement(t),t):this.layoutElement(t.getElement(),t),e&&t.cells.forEach((e=>{this.layoutElement(e.getElement(!0),t)}))}))}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter((t=>!e.includes(t))).forEach((e=>{e.deinitialize()})),e.forEach((e=>{"row"===e.type&&this.layoutRow(e)}))}layoutRow(e){"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})),this.rightColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}))}layoutElement(e,t){var i;t.modules.frozen&&(e.style.position="sticky",i=this.table.rtl?"left"===t.modules.frozen.position?"right":"left":t.modules.frozen.position,e.style[i]=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}adjustForScrollbar(e){this.rightColumns.length&&(this.table.columnManager.getContentsElement().style.width="calc(100% - "+e+"px)")}_calcSpace(e,t){var i=0;for(let s=0;s<t;s++)e[s].visible&&(i+=e[s].getWidth());return i}}ae.moduleName="frozenColumns";class le extends k{constructor(e){super(e),this.topElement=document.createElement("div"),this.rows=[],this.registerComponentFunction("row","freeze",this.freezeRow.bind(this)),this.registerComponentFunction("row","unfreeze",this.unfreezeRow.bind(this)),this.registerComponentFunction("row","isFrozen",this.isRowFrozen.bind(this)),this.registerTableOption("frozenRowsField","id"),this.registerTableOption("frozenRows",!1)}initialize(){this.rows=[],this.topElement.classList.add("tabulator-frozen-rows-holder"),this.table.columnManager.getContentsElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.subscribe("row-deleting",this.detachRow.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),10),this.table.options.frozenRows&&(this.subscribe("data-processed",this.initializeRows.bind(this)),this.subscribe("row-added",this.initializeRow.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this))),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}initializeRows(){this.table.rowManager.getRows().forEach((e=>{this.initializeRow(e)}))}initializeRow(e){var t=this.table.options.frozenRows,i=typeof t;"number"===i?e.getPosition()&&e.getPosition()+this.rows.length<=t&&this.freezeRow(e):"function"===i?t.call(this.table,e.getComponent())&&this.freezeRow(e):Array.isArray(t)&&t.includes(e.data[this.options("frozenRowsField")])&&this.freezeRow(e)}isRowFrozen(e){return this.rows.indexOf(e)>-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach((e=>{t.push(e)})),t}getRows(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}freezeRow(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.rows.push(e),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}unfreezeRow(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach(((e,t)=>{this.table.rowManager.styleRow(e,t)}))}}le.moduleName="frozenRows";class he{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("group",e._group,t)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class de{constructor(e,t,i,s,o,n,r){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=o,this.hasSubGroups=i<e.groupIDLookups.length-1,this.addRow=this.hasSubGroups?this._addRowToGroup:this._addRow,this.type="group",this.old=r,this.rows=[],this.groups=[],this.groupList=[],this.generator=n,this.element=!1,this.elementContents=!1,this.height=0,this.outerHeight=0,this.initialized=!1,this.calcs={},this.initialized=!1,this.modules={},this.arrowElement=!1,this.visible=r?r.visible:void 0!==e.startOpen[i]?e.startOpen[i]:e.startOpen[0],this.component=null,this.createElements(),this.addBindings(),this.createValueGroups()}wipe(e){e||(this.groupList.length?this.groupList.forEach((function(e){e.wipe()})):this.rows.forEach((e=>{e.modules&&delete e.modules.group}))),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(e),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach((t=>{this._createGroup(t,e)}))}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",(e=>{e.stopPropagation(),e.stopImmediatePropagation(),this.toggleVisibility()}))}_createGroup(e,t){var i=t+"_"+e,s=new de(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var o=this.rows.indexOf(t);o>-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}getRowIndex(e){}conformRowData(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.groupManager.blockRedraw||(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this))):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(){var e=[];return e.push(this),this._visSet(),this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.visible?this.groupList.length?this.groupList.forEach((function(t){e=e.concat(t.getHeadersAndRows())})):("table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),e=e.concat(this.rows),"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))),e}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((e=>{i.push(e.getData(t||"data"))})),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach((t=>{e+=t.getRowCount()})):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((e=>{e.getHeadersAndRows().forEach((e=>{e.detachElement()}))})):this.rows.forEach((e=>{var t=e.getElement();t.parentNode.removeChild(t)}))),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((t=>{t.getHeadersAndRows().forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var s=i.getRowGroup(e);s&&(t=s)})):this.rows.find((function(t){return t===e}))&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getRows(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}generateGroupHeaderContents(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;e<this.element.childNodes.length;++e)this.element.childNodes[e].parentNode.removeChild(this.element.childNodes[e]);return this.generateGroupHeaderContents(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}normalizeHeight(){this.setHeight(this.element.clientHeight)}initialize(e){this.initialized&&!e||(this.normalizeHeight(),this.initialized=!0)}reinitialize(){this.initialized=!1,this.height=0,r.elVisible(this.element)&&this.initialize(!0)}setHeight(e){this.height!=e&&(this.height=e,this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getGroup(){return this}reinitializeHeight(){}calcHeight(){}setCellHeight(){}clearCellHeight(){}deinitializeHeight(){}getComponent(){return this.component||(this.component=new he(this)),this.component}}class ce extends k{constructor(e){super(e),this.groupIDLookups=!1,this.startOpen=[function(){return!1}],this.headerGenerator=[function(){return""}],this.groupList=[],this.allowedValues=!1,this.groups={},this.displayHandler=this.getRows.bind(this),this.blockRedraw=!1,this.registerTableOption("groupBy",!1),this.registerTableOption("groupStartOpen",!0),this.registerTableOption("groupValues",!1),this.registerTableOption("groupUpdateOnCellEdit",!1),this.registerTableOption("groupHeader",!1),this.registerTableOption("groupHeaderPrint",null),this.registerTableOption("groupHeaderClipboard",null),this.registerTableOption("groupHeaderHtmlOutput",null),this.registerTableOption("groupHeaderDownload",null),this.registerTableOption("groupToggleElement","arrow"),this.registerTableOption("groupClosedShowCalcs",!1),this.registerTableFunction("setGroupBy",this.setGroupBy.bind(this)),this.registerTableFunction("setGroupValues",this.setGroupValues.bind(this)),this.registerTableFunction("setGroupStartOpen",this.setGroupStartOpen.bind(this)),this.registerTableFunction("setGroupHeader",this.setGroupHeader.bind(this)),this.registerTableFunction("getGroups",this.userGetGroups.bind(this)),this.registerTableFunction("getGroupedData",this.userGetGroupedData.bind(this)),this.registerComponentFunction("row","getGroup",this.rowGetGroup.bind(this))}initialize(){this.subscribe("table-destroy",this._blockRedrawing.bind(this)),this.subscribe("rows-wipe",this._blockRedrawing.bind(this)),this.subscribe("rows-wiped",this._restore_redrawing.bind(this)),this.table.options.groupBy&&(this.table.options.groupUpdateOnCellEdit&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("row-data-changed",this.reassignRowToGroup.bind(this),0)),this.subscribe("table-built",this.configureGroupSetup.bind(this)),this.subscribe("row-deleting",this.rowDeleting.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHeaders.bind(this)),this.subscribe("rows-wipe",this.wipe.bind(this)),this.subscribe("rows-added",this.rowsUpdated.bind(this)),this.subscribe("row-moving",this.rowMoving.bind(this)),this.subscribe("row-adding-index",this.rowAddingIndex.bind(this)),this.subscribe("rows-sample",this.rowSample.bind(this)),this.subscribe("render-virtual-fill",this.virtualRenderFill.bind(this)),this.registerDisplayHandler(this.displayHandler,20),this.initialized=!0)}_blockRedrawing(){this.blockRedraw=!0}_restore_redrawing(){this.blockRedraw=!1}configureGroupSetup(){if(this.table.options.groupBy){var e=this.table.options.groupBy,t=this.table.options.groupStartOpen,i=this.table.options.groupHeader;if(this.allowedValues=this.table.options.groupValues,Array.isArray(e)&&Array.isArray(i)&&e.length>i.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",((e,t)=>{this.headerGenerator[0]=(i,s,o)=>(void 0===i?"":i)+"<span>("+s+" "+(1===s?e:t.groups.items)+")</span>"})),this.groupIDLookups=[],e)this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((e=>{e.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(e)||(e=[e]),e.forEach(((e,t)=>{var i,s;i="function"==typeof e?e:(s=this.table.columnManager.getColumnByField(e))?function(e){return s.getFieldValue(e)}:function(t){return t[e]},this.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!this.allowedValues&&this.allowedValues[t]})})),t&&(Array.isArray(t)||(t=[t]),t.forEach((e=>{})),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();if(!this.table.options.groupBy)return t;t=t.filter((e=>"group"!==e.type)),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&-1==s.indexOf(t)?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),!e&&this.table.modExists("columnCalcs")&&!0===this.table.options.columnCalcs&&this.table.modules.columnCalcs.reinitializeCalcs(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return!!e.modules.group&&e.modules.group.getComponent()}rowMoving(e,t,i){if(this.table.options.groupBy){!i&&t instanceof de&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof de?t:t.modules.group,o=e instanceof de?e:e.modules.group;s===o?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(o&&o.removeRow(e),s.insertRow(e,t,i))}}rowDeleting(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach((e=>{e.groupList.length?t=t.concat(this.getChildGroups(e)):t.push(e)})),t}wipe(){this.table.options.groupBy&&(this.groupList.forEach((function(e){e.wipe()})),this.groupList=[],this.groups={})}pullGroupListData(e){var t=[];return e.forEach((e=>{var i={level:0,rowCount:0,headerContent:""},s=[];e.hasSubGroups?(s=this.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=s.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),t.push(i),t=t.concat(s)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,t.push(i),e.getRows().forEach((e=>{t.push(e.getData("data"))})))})),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((i=>{var s=i.getRowGroup(e);s&&(t=s)})),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((e=>{this.createGroup(e,0,t)})),e.forEach((e=>{this.assignRowToExistingGroup(e,t)}))):e.forEach((e=>{this.assignRowToGroup(e,t)})),Object.values(t).forEach((e=>{e.wipe(!0)}))}createGroup(e,t,i){var s,o=t+"_"+e;i=i||[],s=new de(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=s,this.groupList.push(s)}assignRowToExistingGroup(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),s=this.getExpectedPath(e);i.length==s.length&&i.every(((e,t)=>e===s[t]))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((e=>{t.push(e.func(i))})),t}updateGroupRows(e){var t=[];return this.blockRedraw||(this.groupList.forEach((e=>{t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0)),t}scrollHeaders(e){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((t=>{t.scrollHeader(e)})))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}checkBasicModeGroupHeaderWidth(){var e=this.table.rowManager.tableElement,t=!0;this.table.rowManager.getDisplayRows().forEach(((i,s)=>{this.table.rowManager.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}}ce.moduleName="groupRows";class ue extends k{constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup()._getSelf().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return ue.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return ue.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}_rebindRow(e,t){this.history.forEach((function(i){if(i.component instanceof p)i.component===e&&(i.component=t);else if(i.component instanceof o&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}}))}}ue.moduleName="history",ue.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},ue.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};class pe extends k{constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),s=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var n=0;n<s.length;n++){var r=s[n].getElementsByTagName("td"),a={};this.hasIndex||(a[t.index]=n);for(var l=0;l<r.length;l++){var h=r[l];void 0!==this.fieldIndex[l]&&(a[this.fieldIndex[l]]=h.innerHTML)}o.push(a)}t.data=o,this.dispatchExternal("htmlImported")}_extractOptions(e,t,i){var s=e.attributes,o=i?Object.keys(i):Object.keys(t),n={};for(var r in o.forEach((e=>{n[e.toLowerCase()]=e})),s){var a,l=s[r];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(a=l.name.replace("tabulator-",""),void 0!==n[a]&&(t[n[a]]=this._attribValue(l.value)))}}_attribValue(e){return"true"===e||"false"!==e&&e}_findCol(e){return this.table.options.columns.find((t=>t.title===e))||!1}_extractHeaders(e,t){for(var i=0;i<e.length;i++){var s,o=e[i],n=!1,r=this._findCol(o.textContent);r?n=!0:r={title:o.textContent.trim()},r.field||(r.field=o.textContent.trim().toLowerCase().replace(" ","_")),(s=o.getAttribute("width"))&&!r.width&&(r.width=s),this._extractOptions(o,r,this.table.columnManager.optionsList.registeredDefaults),this.fieldIndex[i]=r.field,r.field==this.table.options.index&&(this.hasIndex=!0),n||this.table.options.columns.push(r)}}_generateBlankHeaders(e,t){for(var i=0;i<e.length;i++){var s=e[i],o={title:"",field:"col"+i};this.fieldIndex[i]=o.field;var n=s.getAttribute("width");n&&(o.width=n),this.table.options.columns.push(o)}}}pe.moduleName="htmlTableImport";var me={csv:function(e){var t=[],i=0,s=0,o=!1;for(let n=0;n<e.length;n++){let r=e[n],a=e[n+1];t[i]||(t[i]=[]),t[i][s]||(t[i][s]=""),'"'==r&&o&&'"'==a?(t[i][s]+=r,n++):'"'!=r?","!=r||o?"\r"!=r||"\n"!=a||o?"\r"!=r&&"\n"!=r||o?t[i][s]+=r:(s=0,i++):(s=0,i++,n++):s++:o=!o}return t},json:function(e){try{return JSON.parse(e)}catch(e){return console.warn("JSON Import Error - File contents is invalid JSON",e),Promise.reject()}},array:function(e){return e}};class ge extends k{constructor(e){super(e),this.registerTableOption("importFormat"),this.registerTableOption("importReader","text")}initialize(){this.registerTableFunction("import",this.importFromFile.bind(this)),this.table.options.importFormat&&(this.subscribe("data-loading",this.loadDataCheck.bind(this),10),this.subscribe("data-load",this.loadData.bind(this),10))}loadDataCheck(e){return this.table.options.importFormat&&("string"==typeof e||Array.isArray(e)&&e.length&&Array.isArray(e))}loadData(e,t,i,s,o){return this.importData(this.lookupImporter(),e).then(this.structureData.bind(this)).catch((e=>(console.error("Import Error:",e||"Unable to import data"),Promise.reject(e))))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),(t="string"==typeof e?ge.importers[e]:e)||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t){var i=this.lookupImporter(e);if(i)return this.pickFile(t).then(this.importData.bind(this,i)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch((e=>(console.error("Import Error:",e||"Unable to import file"),Promise.reject(e))))}pickFile(e){return new Promise(((t,i)=>{var s=document.createElement("input");s.type="file",s.accept=e,s.addEventListener("change",(e=>{var o=s.files[0],n=new FileReader;switch(this.table.options.importReader){case"buffer":n.readAsArrayBuffer(o);break;case"binary":n.readAsBinaryString(o);break;case"url":n.readAsDataURL(o);break;default:n.readAsText(o)}n.onload=e=>{t(n.result)},n.onerror=e=>{console.warn("File Load Error - Unable to read file"),i()}})),s.click()}))}importData(e,t){var i=e.call(this.table,t);return i instanceof Promise?i:i?Promise.resolve(i):Promise.reject()}structureData(e){return Array.isArray(e)&&e.length&&Array.isArray(e[0])?this.table.options.autoColumns?this.structureArrayToObject(e):this.structureArrayToColumns(e):e}structureArrayToObject(e){var t=e.shift();return e.map((e=>{var i={};return t.forEach(((t,s)=>{i[t]=e[s]})),i}))}structureArrayToColumns(e){var t=[],i=this.table.getColumns();return i[0]&&e[0][0]&&i[0].getDefinition().title===e[0][0]&&e.shift(),e.forEach((e=>{var s={};e.forEach(((e,t)=>{var o=i[t];o&&(s[o.getField()]=e)})),t.push(s)})),t}setData(e){return this.table.setData(e)}}ge.moduleName="import",ge.importers=me;class be extends k{constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowMouseDown:"row-mousedown",rowMouseUp:"row-mouseup",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellMouseDown:"cell-mousedown",cellMouseUp:"cell-mouseup",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerMouseDown:"column-mousedown",headerMouseUp:"column-mouseup",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupMouseDown:"group-mousedown",groupMouseUp:"group-mouseup",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerMouseDown"),this.registerColumnOption("headerMouseUp"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellMouseDown"),this.registerColumnOption("cellMouseUp"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this))}cellContentsSelectionFixer(e,t){var i;if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==t){e.preventDefault();try{document.selection?((i=document.body.createTextRange()).moveToElementText(t.getElement()),i.select()):window.getSelection&&((i=document.createRange()).selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch(e){}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?!this.subscribers[e]||this.columnSubscribers[e]||this.subscribedExternal(e)||(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let e in this.eventMap)this.eventMap[e]===i&&this.subscribers[e]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var o=this.touchWatchers[e];switch("column"===e&&(e="header"),t){case"start":o.tap=!0,clearTimeout(o.tapHold),o.tapHold=setTimeout((()=>{clearTimeout(o.tapHold),o.tapHold=null,o.tap=null,clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)}),1e3);break;case"end":o.tap&&(o.tap=null,this.dispatchEvent(e+"Tap",i,s)),o.tapDbl?(clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):o.tapDbl=setTimeout((()=>{clearTimeout(o.tapDbl),o.tapDbl=null}),300),clearTimeout(o.tapHold),o.tapHold=null}}dispatchEvent(e,t,i){var s,r=i.getComponent();this.columnSubscribers[e]&&(i instanceof o?s=i.column.definition[e]:i instanceof n&&(s=i.definition[e]),s&&s(t,r)),this.dispatchExternal(e,t,r)}}be.moduleName="interaction";class fe extends k{constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],!1!==e&&(Object.assign(t,fe.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)fe.actions[t]?e[t]&&("object"!=typeof e[t]&&(e[t]=[e[t]]),e[t].forEach((e=>{(Array.isArray(e)?e:[e]).forEach((e=>{this.mapBinding(t,e)}))}))):console.warn("Key Binding Error - no such action:",t)}mapBinding(e,t){var i={action:fe.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1};t.toString().toLowerCase().split(" ").join("").split("+").forEach((e=>{switch(e){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:e=isNaN(e)?e.toUpperCase().charCodeAt(0):parseInt(e),i.keys.push(e),this.watchKeys[e]||(this.watchKeys[e]=[]),this.watchKeys[e].push(i)}}))}bindEvents(){var e=this;this.keyupBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach((function(i){e.checkBinding(t,i)})))},this.keydownBinding=function(t){var i=t.keyCode;if(e.watchKeys[i]){var s=e.pressedKeys.indexOf(i);s>-1&&e.pressedKeys.splice(s,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((e=>{-1==this.pressedKeys.indexOf(e)&&(i=!1)})),i&&t.action.call(this,e),!0)}}fe.moduleName="keybindings",fe.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},fe.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,s=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=s?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};class ve extends k{constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("menuContainer",void 0),this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("rowDblClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerTableOption("groupDblClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerDblClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu"),this.registerColumnOption("dblClickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){this.deprecationCheck("menuContainer","popupContainer")||(this.table.options.popupContainer=this.table.options.menuContainer)}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu)),this.table.options.rowDblClickMenu&&this.subscribe("row-dblclick",this.loadMenuEvent.bind(this,this.table.options.rowDblClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu)),this.table.options.groupDblClickMenu&&this.subscribe("group-dblclick",this.loadMenuEvent.bind(this,this.table.options.groupDblClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerDblClickMenu&&!this.columnSubscribers.headerDblClickMenu&&(this.columnSubscribers.headerDblClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerDblClickMenu"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu)),t.dblClickMenu&&!this.columnSubscribers.dblClickMenu&&(this.columnSubscribers.dblClickMenu=this.loadMenuTableCellEvent.bind(this,"dblClickMenu"),this.subscribe("cell-dblclick",this.columnSubscribers.dblClickMenu))}initializeColumnHeaderMenu(e){var t,i=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,o){var n,r=!(e instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),r||e.preventDefault(),i&&i.length){if(s)n=o.child(a);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((()=>{this.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=n=this.popup(a)}i.forEach((e=>{var i=document.createElement("div"),s=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof s&&(s=s.call(this.table,t.getComponent())),s instanceof Node?i.appendChild(s):i.innerHTML=s,"function"==typeof o&&(o=o.call(this.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(e=>{e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(s=>{s.stopPropagation(),this.loadMenu(s,t,e.menu,i,n)})):e.action&&i.addEventListener("click",(i=>{e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),a.appendChild(i)})),a.addEventListener("click",(e=>{this.rootPopup&&this.rootPopup.hide()})),n.show(s||e),n===this.rootPopup&&(this.rootPopup.hideOnBlur((()=>{this.rootPopup=null,this.currentComponent&&(this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}ve.moduleName="menu";class we extends k{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){var t,i=this,s={};e.modules.frozen||e.isGroup||(t=e.getElement(),s.mousemove=function(s){e.parent===i.moving.parent&&((i.touchMove?s.touches[0].pageX:s.pageX)-r.elOffset(t).left+i.table.columnManager.contentsElement.scrollLeft>e.getWidth()/2?i.toCol===e&&i.toColAfter||(t.parentNode.insertBefore(i.placeholderElement,t.nextSibling),i.moveColumn(e,!0)):(i.toCol!==e||i.toColAfter)&&(t.parentNode.insertBefore(i.placeholderElement,t),i.moveColumn(e,!1)))}.bind(i),t.addEventListener("mousedown",(function(t){i.touchMove=!1,1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),i.bindTouchEvents(e)),e.modules.moveColumn=s}bindTouchEvents(e){var t,i,s,o,n,r,a=e.getElement(),l=!1;a.addEventListener("touchstart",(a=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,t=e.nextColumn(),s=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,n=0,r=0,l=!1,this.startMove(a,e)}),this.checkPeriod)}),{passive:!0}),a.addEventListener("touchmove",(a=>{var h,d;this.moving&&(this.moveHover(a),l||(l=a.touches[0].pageX),(h=a.touches[0].pageX-l)>0?t&&h-n>s&&(d=t)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveColumn(d,!0)):i&&-h-r>o&&(d=i)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveColumn(d,!1)),d&&(t=d.nextColumn(),n=s,s=t?t.getWidth()/2:0,i=d.prevColumn(),r=o,o=i?i.getWidth()/2:0))}),{passive:!0}),a.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(e)}))}startMove(e,t){var i=t.getElement(),s=this.table.columnManager.getContentsElement(),o=this.table.columnManager.getHeadersElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-r.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),s.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=s.clientHeight-o.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s.nextSibling)})):e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s)}))}endMove(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(e){var t,i=this.table.columnManager.getContentsElement(),s=i.scrollLeft,o=(this.touchMove?e.touches[0].pageX:e.pageX)-r.elOffset(i).left+s;this.hoverElement.style.left=o-this.startX+"px",o-s<this.autoScrollMargin&&(this.autoScrollTimeout||(this.autoScrollTimeout=setTimeout((()=>{t=Math.max(0,s-5),this.table.rowManager.getElement().scrollLeft=t,this.autoScrollTimeout=!1}),1))),s+i.clientWidth-o<this.autoScrollMargin&&(this.autoScrollTimeout||(this.autoScrollTimeout=setTimeout((()=>{t=Math.min(i.clientWidth,s+5),this.table.rowManager.getElement().scrollLeft=t,this.autoScrollTimeout=!1}),1)))}}we.moduleName="moveColumn";class Ce extends k{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var t=this,i={};i.mouseup=function(i){t.tableRowDrop(i,e)}.bind(t),i.mousemove=function(i){var s;i.pageY-r.elOffset(e.element).top+t.table.rowManager.element.scrollTop>e.getHeight()/2?t.toRow===e&&t.toRowAfter||((s=e.getElement()).parentNode.insertBefore(t.placeholderElement,s.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(s=e.getElement()).previousSibling&&(s.parentNode.insertBefore(t.placeholderElement,s),t.moveRow(e,!1))}.bind(t),e.modules.moveRow=i}initializeRow(e){var t,i=this,s={};s.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),s.mousemove=function(t){var s=e.getElement();t.pageY-r.elOffset(s).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||(s.parentNode.insertBefore(i.placeholderElement,s.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(s.parentNode.insertBefore(i.placeholderElement,s),i.moveRow(e,!1))}.bind(i),this.hasHandle||((t=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=s}initializeColumn(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i,s,o,n,r,a,l=!1;t.addEventListener("touchstart",(t=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,s=e.prevRow(),n=s?s.getHeight()/2:0,r=0,a=0,l=!1,this.startMove(t,e)}),this.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(t=>{var h,d;this.moving&&(t.preventDefault(),this.moveHover(t),l||(l=t.touches[0].pageY),(h=t.touches[0].pageY-l)>0?i&&h-r>o&&(d=i)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveRow(d,!0)):s&&-h-a>n&&(d=s)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveRow(d,!1)),d&&(i=d.nextRow(),r=o,o=i?i.getHeight()/2:0,s=d.prevRow(),a=n,n=s?s.getHeight()/2:0))})),t.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(e),this.touchMove=!1)}))}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}startMove(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i,s,o=this.touchMove?e.touches[0].pageX:e.pageX,n=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(s=i.getBoundingClientRect(),this.startX=s.left-o+window.pageXOffset,this.startY=s.top-n+window.pageYOffset):this.startY=n-i.getBoundingClientRect().top}endMove(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((e=>{"string"==typeof e?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):this.connectionElements.push(e)})),this.connectionElements.forEach((e=>{var t=t=>{this.elementRowDrop(t,e,this.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((e=>{e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}connect(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=this.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender}s?s.call(this,this.moving?this.moving.getComponent():void 0,t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=this.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?s=i.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}Ce.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},Ce.prototype.senders={delete:function(e,t,i){e.delete()}},Ce.moduleName="moveRow";class Ee extends k{constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="mutator"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupMutator(e.definition[n]))&&(t=!0,i[n]={mutator:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":Ee.mutators[e]?t=Ee.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t,i){var s,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((n=>{var r,a,l;n.modules.mutate&&(r=n.modules.mutate[o]||n.modules.mutate.mutator||!1)&&(s=n.getFieldValue(void 0!==i?i:e),("data"==t&&!i||void 0!==s)&&(l=n.getComponent(),a="function"==typeof r.params?r.params(s,e,t,l):r.params,n.setFieldValue(e,r.mutator(s,e,t,a,l))))})),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((t=>{var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}enable(){this.enabled=!0}disable(){this.enabled=!1}}Ee.moduleName="mutator",Ee.mutators={};var ye={rows:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(e=>{d.innerHTML=e})),s?(a.innerHTML=" "+t+"-"+Math.min(t+e-1,s)+" ",h.innerHTML=" "+s+" ",n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d)):(a.innerHTML=" 0 ",n.appendChild(r),n.appendChild(a),n.appendChild(d)),n},pages:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),a.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),h.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(e=>{d.innerHTML=e})),n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d),n}};class Re extends k{constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i,s=this.table.rowManager,o=s.getDisplayRows();return t?o.length?i=o[0]:s.activeRows.length&&(i=s.activeRows[s.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.length<this.size)),{index:i,top:t}}calculatePageSizes(){var e,t;this.table.options.paginationSize?this.size=this.table.options.paginationSize:((e=document.createElement("div")).classList.add("tabulator-row"),e.style.visibility="hidden",(t=document.createElement("div")).classList.add("tabulator-cell"),t.innerHTML="Page Row Test",e.appendChild(t),this.table.rowManager.getTableElement().appendChild(e),this.size=Math.floor(this.table.rowManager.getElement().clientHeight/e.offsetHeight),this.table.rowManager.getTableElement().removeChild(e)),this.dispatchExternal("pageSizeChanged",this.size),this.generatePageSizeSelectList()}initialLoadComplete(){this.initialLoad=!1}remotePageParams(e,t,i,s){return this.initialLoad||(this.progressiveLoad&&!i||!this.progressiveLoad&&!this.dataChanging)&&this.reset(!0),s.page=this.page,this.size&&(s.size=this.size),s}userSetPageToRow(e){return this.table.options.pagination&&(e=this.rowManager.findRow(e))?this.setPageToRow(e):Promise.reject()}userSetPageSize(e){return!!this.table.options.pagination&&(this.setPageSize(e),this.setPage(1))}scrollVertical(e,t){var i;t||this.table.dataLoader.loading||(i=this.table.rowManager.getElement()).scrollHeight-i.clientHeight-e<(this.table.options.progressiveLoadScrollMargin||2*i.clientHeight)&&this.nextPage().catch((()=>{}))}restOnRenderBefore(e,t){return t||"local"===this.mode&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(e=document.createElement("button")).classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach((e=>{var t=document.createElement("option");t.value=e,!0===e?this.langBind("pagination|all",(function(e){t.innerHTML=e})):t.innerHTML=e,this.pageSizeSelect.appendChild(t)})),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&((t="function"==typeof e?e:Re.pageCounters[e])?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",(e=>{this.firstBut.innerHTML=e})),this.langBind("pagination|first_title",(e=>{this.firstBut.setAttribute("aria-label",e),this.firstBut.setAttribute("title",e)})),this.langBind("pagination|prev",(e=>{this.prevBut.innerHTML=e})),this.langBind("pagination|prev_title",(e=>{this.prevBut.setAttribute("aria-label",e),this.prevBut.setAttribute("title",e)})),this.langBind("pagination|next",(e=>{this.nextBut.innerHTML=e})),this.langBind("pagination|next_title",(e=>{this.nextBut.setAttribute("aria-label",e),this.nextBut.setAttribute("title",e)})),this.langBind("pagination|last",(e=>{this.lastBut.innerHTML=e})),this.langBind("pagination|last_title",(e=>{this.lastBut.setAttribute("aria-label",e),this.lastBut.setAttribute("title",e)})),this.firstBut.addEventListener("click",(()=>{this.setPage(1)})),this.prevBut.addEventListener("click",(()=>{this.previousPage()})),this.nextBut.addEventListener("click",(()=>{this.nextPage()})),this.lastBut.addEventListener("click",(()=>{this.setPage(this.max)})),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",(e=>{this.pageSizeSelect.setAttribute("aria-label",e),this.pageSizeSelect.setAttribute("title",e),t.innerHTML=e})),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",(e=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)}))),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1,this.trackChanges())}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.displayRows(-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch("remote"===this.mode&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),typeof(s=this.pageCounter.call(this,t,i,this.page,e,this.max))){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",null!=s&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+1<this.count?this.max-this.count+1:Math.max(this.page-e,1),s=this.page<=t?Math.min(this.count,this.max):Math.min(this.page+t,this.max);for(;this.pagesElement.firstChild;)this.pagesElement.removeChild(this.pagesElement.firstChild);1==this.page?(this.firstBut.disabled=!0,this.prevBut.disabled=!0):(this.firstBut.disabled=!1,this.prevBut.disabled=!1),this.page==this.max?(this.lastBut.disabled=!0,this.nextBut.disabled=!0):(this.lastBut.disabled=!1,this.nextBut.disabled=!1);for(let e=i;e<=s;e++)e>0&&e<=this.max&&this.pagesElement.appendChild(this._generatePageButton(e));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",(i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)})),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",(t=>{this.setPage(e)})),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page<this.max?(this.page++,this.trackChanges(),this.trigger()):(this.progressiveLoad||console.warn("Pagination Error - Next page would be greater than maximum page of "+this.max+":",this.max+1),Promise.reject())}getPage(){return this.page}getPageMax(){return this.max}getPageSize(e){return this.size}getMode(){return this.mode}getRows(e){var t,i,s,o,n=0,r=e.filter((e=>"row"===e.type));if("local"==this.mode){t=[],this.setMaxRows(e.length),!0===this.size?(i=0,s=e.length):s=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let r=i;r<s;r++){let i=e[r];i&&(t.push(i),"row"===i.type&&(o||(o=i),n++))}return this._setPageCounter(r.length,n,o?r.indexOf(o)+1:0),t}return this._setPageButtons(),this._setPageCounter(r.length),e.slice(0)}trigger(){var e;switch(this.mode){case"local":return e=this.table.rowManager.scrollLeft,this.refreshData(),this.table.rowManager.scrollHorizontal(e),this.dispatchExternal("pageLoaded",this.getPage()),Promise.resolve();case"remote":return this.dataChanging=!0,this.reloadData(null).finally((()=>{this.dataChanging=!1}));case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t;if(void 0===e.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data){if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=void 0!==e.last_row?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(e.data,!1,1==this.page):this.table.rowManager.addRows(e.data),this.page<this.max&&setTimeout((()=>{this.nextPage()}),this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=1===this.page?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,1!==this.page,1==this.page),t=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page<this.max&&setTimeout((()=>{this.nextPage()}))}return!1}this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}}Re.moduleName="page",Re.pageCounters=ye;var xe={local:function(e,t){var i=localStorage.getItem(e+"-"+t);return!!i&&JSON.parse(i)},cookie:function(e,t){var i,s,o=document.cookie,n=e+"-"+t,r=o.indexOf(n+"=");return r>-1&&((i=(o=o.slice(r)).indexOf(";"))>-1&&(o=o.slice(0,i)),s=o.replace(n+"=","")),!!s&&JSON.parse(s)}},Te={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}};class ke extends k{constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}initialize(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:ke.readers[this.table.options.persistenceReaderFunc]?this.readFunc=ke.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):ke.readers[this.mode]?this.readFunc=ke.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:ke.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=ke.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):ke.writers[this.mode]?this.writeFunc=ke.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retrieveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retrieveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("column-width",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}initializeColumn(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((e=>{var i=Object.getOwnPropertyDescriptor(t,e),s=t[e];i&&Object.defineProperty(t,e,{set:e=>{s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:()=>(i.get&&i.get(),s)})})),this.defWatcherBlock=!1)}load(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retrieveData(e){return!!this.readFunc&&this.readFunc(this.id,e)}mergeDefinition(e,t){var i=[];return(t=t||[]).forEach(((t,s)=>{var o,n=this._findColumn(e,t);n&&(!0===this.config.columns||null==this.config.columns?(o=Object.keys(n)).push("width"):o=this.config.columns,o.forEach((e=>{"columns"!==e&&void 0!==t[e]&&(n[e]=t[e])})),n.columns&&(n.columns=this.mergeDefinition(n.columns,t.columns)),i.push(n))})),e.forEach(((e,s)=>{this._findColumn(t,e)||(i.length>s?i.splice(s,0,e):i.push(e))})),i}_findColumn(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}save(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}validateSorters(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}getGroupConfig(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((e=>{var s,o={},n=e.getDefinition();e.isGroup?(o.title=n.title,o.columns=this.parseColumns(e.getColumns())):(o.field=e.getField(),!0===this.config.columns||null==this.config.columns?((s=Object.keys(n)).push("width"),s.push("visible")):s=this.config.columns,s.forEach((t=>{switch(t){case"width":o.width=e.getWidth();break;case"visible":o.visible=e.visible;break;default:"function"!=typeof n[t]&&-1===i.indexOf(t)&&(o[t]=n[t])}}))),t.push(o)})),t}}ke.moduleName="persistence",ke.moduleInitOrder=-10,ke.readers=xe,ke.writers=Te;class Me extends k{constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("rowDblClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerTableOption("groupDblClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerDblClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup"),this.registerColumnOption("dblClickPopup"),this.registerComponentFunction("cell","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("column","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("row","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("group","popup",this._componentPopupCall.bind(this))}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}_componentPopupCall(e,t,i){this.loadPopupEvent(t,null,e,i)}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup)),this.table.options.rowDblClickPopup&&this.subscribe("row-dblclick",this.loadPopupEvent.bind(this,this.table.options.rowDblClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup)),this.table.options.groupDblClickPopup&&this.subscribe("group-dblclick",this.loadPopupEvent.bind(this,this.table.options.groupDblClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerDblClickPopup&&!this.columnSubscribers.headerDblClickPopup&&(this.columnSubscribers.headerDblClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerDblClickPopup"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup)),t.dblClickPopup&&!this.columnSubscribers.dblClickPopup&&(this.columnSubscribers.dblClickPopup=this.loadPopupTableCellEvent.bind(this,"dblClickPopup"),this.subscribe("cell-click",this.columnSubscribers.dblClickPopup))}initializeColumnHeaderPopup(e){var t,i=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i,s){var o;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){o=e})):e,this.loadPopup(t,i,e,o,s)}loadPopup(e,t,i,s,o){var n,r,a=!(e instanceof MouseEvent);i instanceof HTMLElement?n=i:(n=document.createElement("div")).innerHTML=i,n.classList.add("tabulator-popup"),n.addEventListener("click",(e=>{e.stopPropagation()})),a||e.preventDefault(),r=this.popup(n),"function"==typeof s&&r.renderCallback(s),e?r.show(e):r.show(t.getElement(),o||"center"),r.hideOnBlur((()=>{this.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}Me.moduleName="popup";class Le extends k{constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.beforeprintEventHandler=null,this.afterprintEventHandler=null,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(this.beforeprintEventHandler=this.replaceTable.bind(this),this.afterprintEventHandler=this.cleanup.bind(this),window.addEventListener("beforeprint",this.beforeprintEventHandler),window.addEventListener("afterprint",this.afterprintEventHandler),this.subscribe("table-destroy",this.destroy.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}destroy(){this.table.options.printAsHtml&&(window.removeEventListener("beforeprint",this.beforeprintEventHandler),window.removeEventListener("afterprint",this.afterprintEventHandler))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s,o,n=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),"string"==typeof(s="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?a.innerHTML=s:a.appendChild(s),this.element.appendChild(a)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,h),window.print(),this.cleanup(),window.scrollTo(n,r),this.manualBlock=!1}}Le.moduleName="print";class Se extends k{constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-push"),o.forEach((e=>{i.table.rowManager.addRowActual(e,!1)})),s=i.origFuncs.push.apply(e,arguments),i.unblock("data-push")),s}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-unshift"),o.forEach((e=>{i.table.rowManager.addRowActual(e,!0)})),s=i.origFuncs.unshift.apply(e,arguments),i.unblock("data-unshift")),s}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s,o;return i.blocked||t!==i.currentVersion||(i.block("data-shift"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[0]))&&s.deleteActual(),o=i.origFuncs.shift.call(e),i.unblock("data-shift")),o}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s,o;return i.blocked||t!==i.currentVersion||(i.block("data-pop"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&s.deleteActual(),o=i.origFuncs.pop.call(e),i.unblock("data-pop")),o}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s,o,n=Array.from(arguments),r=n[0]<0?e.length+n[0]:n[0],a=n[1],l=!!n[2]&&n.slice(2);if(!i.blocked&&t===i.currentVersion){if(i.block("data-splice"),l&&((s=!!e[r]&&i.table.rowManager.getRowFromDataObject(e[r]))?l.forEach((e=>{i.table.rowManager.addRowActual(e,!0,s,!0)})):(l=l.slice().reverse()).forEach((e=>{i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==a){var h=e.slice(r,void 0===n[1]?n[1]:r+a);h.forEach(((e,t)=>{var s=i.table.rowManager.getRowFromDataObject(e);s&&s.deleteActual(t!==h.length-1)}))}(l||0!==a)&&i.table.rowManager.reRenderInPosition(),o=i.origFuncs.splice.apply(e,arguments),i.unblock("data-splice")}return o}})}unwatchData(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}watchRow(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}watchTreeChildren(e){var t=this,i=e.getData()[this.table.options.dataTreeChildField],s={};i&&(s.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-push");var o=s.push.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-push")}return o}}),s.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-unshift");var o=s.unshift.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-unshift")}return o}}),s.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-shift");var o=s.shift.call(i);this.rebuildTree(e),t.unblock("tree-shift")}return o}}),s.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-pop");var o=s.pop.call(i);this.rebuildTree(e),t.unblock("tree-pop")}return o}}),s.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-splice");var o=s.splice.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-splice")}return o}}))}rebuildTree(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(e,t,i){var s=this,o=Object.getOwnPropertyDescriptor(t,i),n=t[i],r=this.currentVersion;Object.defineProperty(t,i,{set:t=>{if(n=t,!s.blocked&&r===s.currentVersion){s.block("key");var a={};a[i]=t,e.updateData(a),s.unblock("key")}o.set&&o.set(t)},get:()=>(o.get&&o.get(),n)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(e){this.blocked||(this.blocked=e)}unblock(e){this.blocked===e&&(this.blocked=!1)}}Se.moduleName="reactiveData";class De extends k{constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((e=>{this.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((e=>{this.reinitializeColumn(e)})))}frozenColumnOffset(e){var t=!1;return e.modules.frozen&&(t=e.modules.frozen.marginValue,"left"===e.modules.frozen.position?t+=e.getWidth()-3:t&&(t-=3)),!1!==t&&t+"px"}reinitializeColumn(e){var t=this.frozenColumnOffset(e);e.cells.forEach((i=>{i.modules.resize&&i.modules.resize.handleEl&&(t&&(i.modules.resize.handleEl.style[e.modules.frozen.position]=t),i.element.after(i.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style[e.modules.frozen.position]=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var o=this,n=i.definition.resizable,r={},a=i.getLastColumn();if("header"===e&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===n||n==e)&&this._checkResizability(a)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var h=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=a.nextColumn(),o._mouseDown(e,a,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",(e=>{var t=a.getWidth();e.stopPropagation(),a.reinitializeWidth(!0),t!==a.getWidth()&&(o.dispatch("column-resized",a),o.table.externalEvents.dispatch("columnResized",a.getComponent()))})),i.modules.frozen&&(l.style.position="sticky",l.style[i.modules.frozen.position]=this.frozenColumnOffset(i)),r.handleEl=l,s.parentNode&&i.visible&&s.after(l)}t.modules.resize=r}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach((e=>{this.deInitializeComponent(e)}))}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s=this;function o(e){var i,o,n=void 0===e.screenX?e.touches[0].screenX:e.screenX,r=n-s.startX,a=n-s.latestX;if(s.latestX=n,s.table.rtl&&(r=-r,a=-a),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(s.startWidth+r),o=t.width==t.minWidth||t.width==t.maxWidth,a<0&&(s.nextColumn=s.initialNextColumn),s.table.options.resizableColumnFit&&s.nextColumn&&(!i||!o)){let e=s.nextColumn.getWidth();a>0&&e<=s.nextColumn.minWidth&&(s.nextColumn=s.nextColumn.nextColumn()),s.nextColumn&&s.nextColumn.setWidth(s.nextColumn.getWidth()-a)}s.table.columnManager.rerenderColumns(!0),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.startWidth!==t.getWidth()&&(s.table.columnManager.verticalAlignHeaders(),s.dispatch("column-resized",t),s.table.externalEvents.dispatch("columnResized",t.getComponent()))}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.latestX=s.startX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}De.moduleName="resizeColumns";class Pe extends k{constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",s.addEventListener("click",(function(e){e.stopPropagation()}));var n=function(i){t.startRow=e,t._mouseDown(i,e,s)};s.addEventListener("mousedown",n),s.addEventListener("touchstart",n,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var r=function(i){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(i,s,o))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r,{passive:!0}),i.appendChild(s),i.appendChild(o)}_mouseDown(e,t,i){var s=this;function o(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.dispatchExternal("rowResized",t.getComponent())}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}Pe.moduleName="resizeRows";class ze extends k{constructor(e){super(e),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e,t=this.table;this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===t.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.tableHeight==i&&this.tableWidth==s||(this.tableHeight=i,this.tableWidth=s,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),this.redrawTable())}})),this.resizeObserver.observe(t.element),e=window.getComputedStyle(t.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(e.getPropertyValue("max-height")||e.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.containerHeight==i&&this.containerWidth==s||(this.containerHeight=i,this.containerWidth=s,this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth),this.redrawTable()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell)&&(t.columnManager.rerenderColumns(!0),t.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver((e=>{this.visible=e[0].isIntersecting,this.initialized?this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1):(this.initialized=!0,this.initialRedraw=!this.visible)})),this.visibilityObserver.observe(this.table.element)}redrawTable(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}ze.moduleName="resizeTable";class Fe extends k{constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),t.visible||"collapse"!==this.mode||this.hiddenColumns.push(t))})),e=(e=e.reverse()).sort(((e,t)=>t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index)),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent();for(let e of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==e.definition.formatter){this.collapseHandleColumn=e;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}initializeRow(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=!0;e;){let t="fitColumns"==this.table.modules.layout.getMode()?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth(),i=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-t;if(i<0){let t=this.columns[this.index];t?(this.hideColumn(t),this.index++):e=!1}else{let t=this.columns[this.index-1];t&&i>0&&i>=t.getWidth()?(this.showColumn(t),this.index--):e=!1}this.table.rowManager.activeRowsCount||this.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){this.table.rowManager.getDisplayRows().forEach((e=>{this.generateCollapsedRowContent(e)}))}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}generateCollapsedRowData(e){var t,i=e.getData(),s=[];return this.hiddenColumns.forEach((o=>{var n=o.getFieldValue(i);if(o.definition.title&&o.field)if(o.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters){function r(e){e()}t={value:!1,data:{},getValue:function(){return n},getData:function(){return i},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return o.getComponent()},getTable:()=>this.table},s.push({field:o.field,title:o.definition.title,value:o.modules.format.formatter.call(this.table.modules.format,t,o.modules.format.params,r)})}else s.push({field:o.field,title:o.definition.title,value:n})})),s}formatCollapsedData(e){var t=document.createElement("table");return e.forEach((function(e){var i,s=document.createElement("tr"),o=document.createElement("td"),n=document.createElement("td"),r=document.createElement("strong");o.appendChild(r),this.langBind("columns|"+e.field,(function(t){r.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),n.appendChild(i)):n.innerHTML=e.value,s.appendChild(o),s.appendChild(n),t.appendChild(s)}),this),Object.keys(e).length?t:""}}Fe.moduleName="responsiveLayout";class He extends k{constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectable","highlight"),this.registerTableOption("selectableRangeMode","drag"),this.registerTableOption("selectableRollingSelection",!0),this.registerTableOption("selectablePersistence",!0),this.registerTableOption("selectableCheck",(function(e,t){return!0})),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}rowRetrieve(e,t){return"selected"===e?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){var t=this.selectedRows.length;this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t&&!0!==e&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=e.getElement(),s=function(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",s)};e.modules.select={selected:!1},t.checkRowSelectability(e)?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",s),document.body.addEventListener("keyup",s),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),o=i<=s?i:s,n=i>=s?i:s,r=this.table.rowManager.getDisplayRows().slice(0).splice(o,n-o+1);t.ctrlKey||t.metaKey?(r.forEach((t=>{t!==this.lastClickedRow&&(!0===this.table.options.selectable||this.isRowSelected(e)||this.selectedRows.length<this.table.options.selectable)&&this.toggleRow(t)})),this.lastClickedRow=e):(this.deselectRows(void 0,!0),!0!==this.table.options.selectable&&r.length>this.table.options.selectable&&(r=r.slice(0,this.table.options.selectable)),this.selectRows(r)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}checkRowSelectability(e){return"row"===e.type&&this.table.options.selectableCheck.call(this.table,e.getComponent())}toggleRow(e){this.checkRowSelectability(e)&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t;switch(typeof e){case"undefined":this.table.rowManager.rows.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(t=this.table.rowManager.findRow(e))?(this._selectRow(t,!0,!0),this._rowSelectionChanged()):((t=this.table.rowManager.getRows(e)).forEach((e=>{this._selectRow(e,!0,!0)})),t.length&&this._rowSelectionChanged());break;default:Array.isArray(e)?(e.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}}_selectRow(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var s=this.table.rowManager.findRow(e);s?-1==this.selectedRows.indexOf(s)&&(s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return-1!==this.selectedRows.indexOf(e)}deselectRows(e,t){var i,s=this;if(void 0===e){i=s.selectedRows.length;for(let e=0;e<i;e++)s._deselectRow(s.selectedRows[0],!0);i&&s._rowSelectionChanged(t)}else Array.isArray(e)?(e.forEach((function(e){s._deselectRow(e,!0)})),s._rowSelectionChanged(t)):s._deselectRow(e,t)}_deselectRow(e,t){var i,s=this,o=s.table.rowManager.findRow(e);o?(i=s.selectedRows.findIndex((function(e){return e==o})))>-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),s.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),s._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}getSelectedRows(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}_rowSelectionChanged(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t)for(let e of i)this._selectRow(e,!0);else for(let e of i)this._deselectRow(e,!0)}}function Oe(e,t,i,s,o,n,r){var a=window.DateTime||luxon.DateTime,l=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,d=0;if(void 0!==a){if(a.isDateTime(e)||(e="iso"===l?a.fromISO(String(e)):a.fromFormat(String(e),l)),a.isDateTime(t)||(t="iso"===l?a.fromISO(String(t)):a.fromFormat(String(t),l)),e.isValid){if(t.isValid)return e-t;d=1}else d=t.isValid?-1:0;return("top"===h&&"desc"===n||"bottom"===h&&"asc"===n)&&(d*=-1),d}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}He.moduleName="selectRow";var _e={number:function(e,t,i,s,o,n,r){var a=r.alignEmptyValues,l=r.decimalSeparator,h=r.thousandSeparator,d=0;if(e=String(e),t=String(t),h&&(e=e.split(h).join(""),t=t.split(h).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))d=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;d=1}return("top"===a&&"desc"===n||"bottom"===a&&"asc"===n)&&(d*=-1),d},string:function(e,t,i,s,o,n,r){var a,l=r.alignEmptyValues,h=0;if(e){if(t){switch(typeof r.locale){case"boolean":r.locale&&(a=this.langLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}h=1}else h=t?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},date:function(e,t,i,s,o,n,r){return r.format||(r.format="dd/MM/yyyy"),Oe.call(this,e,t,i,s,o,n,r)},time:function(e,t,i,s,o,n,r){return r.format||(r.format="HH:mm"),Oe.call(this,e,t,i,s,o,n,r)},datetime:Oe,boolean:function(e,t,i,s,o,n,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,s,o,n,r){var a=r.type||"length",l=r.alignEmptyValues,h=0;function d(e){var t;switch(a){case"length":t=e.length;break;case"sum":t=e.reduce((function(e,t){return e+t}));break;case"max":t=Math.max.apply(null,e);break;case"min":t=Math.min.apply(null,e);break;case"avg":t=e.reduce((function(e,t){return e+t}))/e.length}return t}if(Array.isArray(e)){if(Array.isArray(t))return d(t)-d(e);h=1}else h=Array.isArray(t)?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},exists:function(e,t,i,s,o,n,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,s,o,n,r){var a,l,h,d,c,u=0,p=/(\d+)|(\D+)/g,m=/\d/,g=r.alignEmptyValues,b=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((a=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!m.test(a)||!m.test(l))return a>l?1:-1;for(a=a.match(p),l=l.match(p),c=a.length>l.length?l.length:a.length;u<c;)if((h=a[u])!==(d=l[u++]))return isFinite(h)&&isFinite(d)?("0"===h.charAt(0)&&(h="."+h),"0"===d.charAt(0)&&(d="."+d),h-d):h>d?1:-1;return a.length>l.length}b=1}else b=t||0===t?-1:0;return("top"===g&&"desc"===n||"bottom"===g&&"asc"===n)&&(b*=-1),b}};class Ae extends k{constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","<div class='tabulator-arrow'></div>"),this.registerTableOption("headerSortClickElement","header"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var o=this.getSort();return o.forEach((e=>{delete e.column})),s.sort=o,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t,i,s=!1;switch(typeof e.definition.sorter){case"string":Ae.sorters[e.definition.sorter]?s=Ae.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}if(e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},!1!==e.definition.headerSort){if((t=e.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),"icon"===this.table.options.headerSortClickElement)i.classList.add("tabulator-col-sorter-element");else t.classList.add("tabulator-col-sorter-element");switch(this.table.options.headerSortElement){case"function":break;case"object":i.appendChild(this.table.options.headerSortElement);break;default:i.innerHTML=this.table.options.headerSortElement}e.titleHolderElement.appendChild(i),e.modules.sort.element=i,this.setColumnHeaderSortIcon(e,"none"),("icon"===this.table.options.headerSortClickElement?i:t).addEventListener("click",(t=>{var i="",s=[],o=!1;if(e.modules.sort){if(e.modules.sort.tristate)i="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?(o=(s=this.getSort()).findIndex((t=>t.field===e.getField())),o>-1?(s[o].dir=i,o=s.splice(o,1)[0],"none"!=i&&s.push(o)):"none"!=i&&s.push({column:e,dir:i}),this.setSort(s)):"none"==i?this.clear():this.setSort(e,i),this.refreshSort()}}))}}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,s.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t,i=this.table.rowManager.activeRows[0],s="string";if(i&&(i=i.getData(),e.getField()))switch(typeof(t=e.getFieldValue(i))){case"undefined":s="string";break;case"boolean":s="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(s="alphanum"):s="number"}return Ae.sorters[s]}sort(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,s=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o;e.column&&((o=e.column.modules.sort)&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,s.push(e)),t.setColumnHeader(e.column,e.dir))})),s.length&&t._sortItems(e,s)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((e=>{o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach((e=>{e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(e,"none"))}))}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}setColumnHeaderSortIcon(e,t){var i,s=e.modules.sort.element;if(e.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;s.firstChild;)s.removeChild(s.firstChild);"object"==typeof(i=this.table.options.headerSortElement.call(this.table,e.getComponent(),t))?s.appendChild(i):s.innerHTML=i}}_sortItems(e,t){var i=t.length-1;e.sort(((e,s)=>{for(var o,n=i;n>=0;n--){let i=t[n];if(0!==(o=this._sortRow(e,s,i.column,i.dir,i.params)))break}return o}))}_sortRow(e,t,i,s,o){var n,r,a="asc"==s?e:t,l="asc"==s?t:e;return e=void 0!==(e=i.getFieldValue(a.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",n=a.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,e,t,n,r,i.getComponent(),s,o)}}Ae.moduleName="sort",Ae.sorters=_e;class Be extends k{constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipGenerationMode",void 0),this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){this.deprecationCheckMsg("tooltipGenerationMode","This option is no longer needed as tooltips are always generated on hover now")}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,n,r;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){n=e}))),i instanceof HTMLElement?s=i:(s=document.createElement("div"),!0===i&&(t instanceof o?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(e=>{s.innerHTML=i=e||t.definition.title})):i=t.definition.title),s.innerHTML=i),(i||0===i||!1===i)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",(e=>e.preventDefault())),this.popupInstance=this.popup(s),"function"==typeof n&&this.popupInstance.renderCallback(n),r=this.popupInstance.containerEventCoords(e),this.popupInstance.show(r.x+15,r.y+15).hideOnBlur((()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}Be.moduleName="tooltip";var Ie={integer:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&t%1!=0)},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var s=!0,o=e.getData(),n=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==n.getFieldValue(i)&&(s=!1)})),s},required:function(e,t,i){return""!==t&&null!=t}};class Ve extends k{constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==s&&setTimeout((()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)})),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}rowValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.clearValidation(e._getSelf())}))}userValidate(e){var t=[];return this.table.rowManager.rows.forEach((e=>{var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}initializeColumnCheck(e){void 0!==e.definition.validator&&this.initializeColumn(e)}initializeColumn(e){var t,i=this,s=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((e=>{(t=i._extractValidator(e))&&s.push(t)})):(t=this._extractValidator(e.definition.validator))&&s.push(t),e.modules.validate=!!s.length&&s)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return(s=e.indexOf(":"))>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i="function"==typeof e?e:Ve.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,o=[],n=this.invalidCells.indexOf(t);return e&&e.forEach((e=>{e.func.call(s,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==n&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),n>-1&&this.invalidCells.splice(n,1)),!o.length||o}getInvalidCells(){var e=[];return this.invalidCells.forEach((t=>{e.push(t.getComponent())})),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}Ve.moduleName="validate",Ve.validators=Ie;var Ne=Object.freeze({__proto__:null,AccessorModule:_,AjaxModule:W,ClipboardModule:j,ColumnCalcsModule:X,DataTreeModule:q,DownloadModule:J,EditModule:Q,ExportModule:ie,FilterModule:oe,FormatModule:re,FrozenColumnsModule:ae,FrozenRowsModule:le,GroupRowsModule:ce,HistoryModule:ue,HtmlTableImportModule:pe,ImportModule:ge,InteractionModule:be,KeybindingsModule:fe,MenuModule:ve,MoveColumnsModule:we,MoveRowsModule:Ce,MutatorModule:Ee,PageModule:Re,PersistenceModule:ke,PopupModule:Me,PrintModule:Le,ReactiveDataModule:Se,ResizeColumnsModule:De,ResizeRowsModule:Pe,ResizeTableModule:ze,ResponsiveLayoutModule:Fe,SelectRowModule:He,SortModule:Ae,TooltipModule:Be,ValidateModule:Ve});class We extends O{}return new F(We,Ne),We})); | |
| 3 | +//# sourceMappingURL=tabulator.min.js.map(No newline at end of file) |
--- src/main/webapp/js/MJUtill.js
+++ src/main/webapp/js/MJUtill.js
... | ... | @@ -955,3 +955,20 @@ |
| 955 | 955 |
totalPriceSum(callToCnt); |
| 956 | 956 |
|
| 957 | 957 |
} |
| 958 |
+ |
|
| 959 |
+//Tabulator 주소록 그룹 목록일 경우 각 그룹 주소 갯수 합산해주기 |
|
| 960 |
+function getTabulatorLAddrGrpCnt(){
|
|
| 961 |
+ |
|
| 962 |
+ var selectedData = tableL.getRows(); |
|
| 963 |
+ var totAddrCnt = 0; |
|
| 964 |
+ for(var i=0; i < selectedData.length; i++){
|
|
| 965 |
+ |
|
| 966 |
+ //일괄변환 문자에 콤마(,)가 들어가있으면 배열로 넘길때 문제가 발생하여 특수문자(§)로 치환하여 넘겨주도록 한다. |
|
| 967 |
+ var addrGrpCnt = tableL.getRows()[i].getData().addrGrpCnt; |
|
| 968 |
+ |
|
| 969 |
+ totAddrCnt = Number(totAddrCnt) + Number(addrGrpCnt); |
|
| 970 |
+ |
|
| 971 |
+ } |
|
| 972 |
+ |
|
| 973 |
+ return totAddrCnt; |
|
| 974 |
+}(No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?