wsemi 1.9.7 → 1.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/wsemi.umd.js +2 -2
- package/dist/wsemi.umd.js.map +1 -1
- package/docs/-_class.mjs.html +1 -1
- package/docs/-_const.mjs.html +1 -1
- package/docs/-_detector.mjs.html +1 -1
- package/docs/-_optNum.mjs.html +1 -1
- package/docs/ab2blob.mjs.html +1 -1
- package/docs/ab2u8arr.mjs.html +1 -1
- package/docs/addExcelWorksheetFromData.mjs.html +1 -1
- package/docs/addMonth.mjs.html +1 -1
- package/docs/aes2str.mjs.html +1 -1
- package/docs/alive.mjs.html +1 -1
- package/docs/arr2dt.mjs.html +1 -1
- package/docs/arrAccum.mjs.html +1 -1
- package/docs/arrAdd.mjs.html +1 -1
- package/docs/arrAt.mjs.html +1 -1
- package/docs/arrDiff.mjs.html +1 -1
- package/docs/arrFilterByKeywords.mjs.html +1 -1
- package/docs/arrFilterByNum.mjs.html +1 -1
- package/docs/arrFilterByPnum.mjs.html +1 -1
- package/docs/arrFilterByPnumAndToLog.mjs.html +1 -1
- package/docs/arrFind.mjs.html +1 -1
- package/docs/arrGroupByMaxmin.mjs.html +1 -1
- package/docs/arrHas.mjs.html +1 -1
- package/docs/arrInsert.mjs.html +1 -1
- package/docs/arrLookupByMaxmin.mjs.html +1 -1
- package/docs/arrMax.mjs.html +1 -1
- package/docs/arrMin.mjs.html +1 -1
- package/docs/arrMulti.mjs.html +1 -1
- package/docs/arrNorm.mjs.html +1 -1
- package/docs/arrProduct.mjs.html +1 -1
- package/docs/arrPull.mjs.html +1 -1
- package/docs/arrPullAt.mjs.html +1 -1
- package/docs/arrReduce.mjs.html +1 -1
- package/docs/arrReverse.mjs.html +1 -1
- package/docs/arrSep.mjs.html +1 -1
- package/docs/arrSort.mjs.html +1 -1
- package/docs/asind.mjs.html +1 -1
- package/docs/atan2d.mjs.html +1 -1
- package/docs/atand.mjs.html +1 -1
- package/docs/attstr.mjs.html +1 -1
- package/docs/b642obj.mjs.html +1 -1
- package/docs/b642str.mjs.html +1 -1
- package/docs/b642u16arr.mjs.html +1 -1
- package/docs/b642u8arr.mjs.html +1 -1
- package/docs/binstr.mjs.html +1 -1
- package/docs/blob2ab.mjs.html +1 -1
- package/docs/blob2b64.mjs.html +1 -1
- package/docs/blob2str.mjs.html +1 -1
- package/docs/blob2u8arr.mjs.html +1 -1
- package/docs/blobs2b64s.mjs.html +1 -1
- package/docs/blobs2u8arrs.mjs.html +1 -1
- package/docs/bodyLog.mjs.html +1 -1
- package/docs/browserView.mjs.html +1 -1
- package/docs/browserViewFromBlob.mjs.html +1 -1
- package/docs/browserViewFromText.mjs.html +1 -1
- package/docs/browserViewFromU8arr.mjs.html +1 -1
- package/docs/bs2u8arr.mjs.html +1 -1
- package/docs/bufRead.mjs.html +1 -1
- package/docs/bufReadDbl.mjs.html +1 -1
- package/docs/bufWrite.mjs.html +1 -1
- package/docs/bufWriteDbl.mjs.html +1 -1
- package/docs/cache.mjs.html +1 -1
- package/docs/cacheBd.mjs.html +1 -1
- package/docs/cacheSt.mjs.html +1 -1
- package/docs/cbol.mjs.html +1 -1
- package/docs/cdbl.mjs.html +1 -1
- package/docs/ceil.mjs.html +1 -1
- package/docs/cfilesize.mjs.html +1 -1
- package/docs/cfinancial.mjs.html +1 -1
- package/docs/cint.mjs.html +1 -1
- package/docs/clearXSS.mjs.html +1 -1
- package/docs/clearXSSDyn.mjs.html +1 -1
- package/docs/color.mjs.html +1 -1
- package/docs/composeToTree.mjs.html +1 -1
- package/docs/convertToTree.mjs.html +1 -1
- package/docs/copyStrToClipboard.mjs.html +1 -1
- package/docs/cosd.mjs.html +1 -1
- package/docs/cotd.mjs.html +1 -1
- package/docs/createExcelWorkbook.mjs.html +1 -1
- package/docs/cscd.mjs.html +1 -1
- package/docs/cstr.mjs.html +1 -1
- package/docs/day2cht.mjs.html +1 -1
- package/docs/debounce.mjs.html +1 -1
- package/docs/delay.mjs.html +1 -1
- package/docs/dig.mjs.html +1 -1
- package/docs/digExp.mjs.html +1 -1
- package/docs/domAlert.mjs.html +1 -1
- package/docs/domAppend.mjs.html +1 -1
- package/docs/domCancelEvent.mjs.html +1 -1
- package/docs/domCompareText.mjs.html +1 -1
- package/docs/domConvertToPic.mjs.html +1 -1
- package/docs/domConvertToPicDyn.mjs.html +1 -1
- package/docs/domDetect.mjs.html +98 -16
- package/docs/domDrag.mjs.html +1 -1
- package/docs/domDragBarAndScroll.mjs.html +1 -1
- package/docs/domDragPointer.mjs.html +1 -1
- package/docs/domDragPreview.mjs.html +1 -1
- package/docs/domDropFiles.mjs.html +1 -1
- package/docs/domElementsFromPoint.mjs.html +1 -1
- package/docs/domFadeIn.mjs.html +1 -1
- package/docs/domFadeOut.mjs.html +1 -1
- package/docs/domFind.mjs.html +1 -1
- package/docs/domFinds.mjs.html +1 -1
- package/docs/domGetAttr.mjs.html +1 -1
- package/docs/domGetBoudRect.mjs.html +1 -1
- package/docs/domGetBoudRectRefSelf.mjs.html +1 -1
- package/docs/domGetFileAccept.mjs.html +1 -1
- package/docs/domGetFiles.mjs.html +1 -1
- package/docs/domGetParents.mjs.html +1 -1
- package/docs/domGetPointFromEvent.mjs.html +1 -1
- package/docs/domGetScrollableParent.mjs.html +1 -1
- package/docs/domGetWindowSize.mjs.html +1 -1
- package/docs/domIsClientXYIn.mjs.html +1 -1
- package/docs/domIsFocused.mjs.html +1 -1
- package/docs/domIsRendered.mjs.html +1 -1
- package/docs/domIsStable.mjs.html +1 -1
- package/docs/domIsVisible.mjs.html +1 -1
- package/docs/domPrepend.mjs.html +1 -1
- package/docs/domRemove.mjs.html +1 -1
- package/docs/domRenderMarkdownMind.mjs.html +1 -1
- package/docs/domRenderMarkdownMindDyn.mjs.html +1 -1
- package/docs/domRipple.mjs.html +1 -1
- package/docs/domScrollIntoView.mjs.html +1 -1
- package/docs/domScrollTo.mjs.html +1 -1
- package/docs/domSetAttr.mjs.html +1 -1
- package/docs/domShowImages.mjs.html +1 -1
- package/docs/domShowImagesDyn.mjs.html +1 -1
- package/docs/domShowInputAndGetFiles.mjs.html +1 -1
- package/docs/domShowInputAndGetFilesU8Arrs.mjs.html +1 -1
- package/docs/domShowInputDatatime.mjs.html +1 -1
- package/docs/domTooltip.mjs.html +1 -1
- package/docs/domTriggerEvent.mjs.html +1 -1
- package/docs/domVirtualCreate.mjs.html +1 -1
- package/docs/domVirtualCreateQueue.mjs.html +1 -1
- package/docs/downloadExcelFileFromData.mjs.html +1 -1
- package/docs/downloadExcelFileFromDataDyn.mjs.html +1 -1
- package/docs/downloadFileFromB64.mjs.html +1 -1
- package/docs/downloadFileFromBlob.mjs.html +1 -1
- package/docs/downloadFileFromText.mjs.html +1 -1
- package/docs/downloadFileFromU8Arr.mjs.html +1 -1
- package/docs/dtmapping.mjs.html +1 -1
- package/docs/dtpick.mjs.html +1 -1
- package/docs/estimateTicks.mjs.html +1 -1
- package/docs/evEmit.mjs.html +1 -1
- package/docs/evEmitDelay.mjs.html +1 -1
- package/docs/evem.mjs.html +1 -1
- package/docs/examples/ex-blob2b64.html +1 -1
- package/docs/examples/ex-clearXSS.html +1 -1
- package/docs/examples/ex-clearXSSDyn.html +1 -1
- package/docs/examples/ex-colorConverter.html +1 -1
- package/docs/examples/ex-domCompareText.html +1 -1
- package/docs/examples/ex-domConvertToPic.html +1 -1
- package/docs/examples/ex-domDrag.html +1 -1
- package/docs/examples/ex-domDropFiles.html +1 -1
- package/docs/examples/ex-domIsVisible.html +1 -1
- package/docs/examples/ex-domRenderMarkdownMind.html +1 -1
- package/docs/examples/ex-domRenderMarkdownMindDyn.html +1 -1
- package/docs/examples/ex-domRipple.html +1 -1
- package/docs/examples/ex-domScrollIntoView.html +1 -1
- package/docs/examples/ex-domScrollTo.html +1 -1
- package/docs/examples/ex-domShowImages.html +1 -1
- package/docs/examples/ex-domShowImagesDyn.html +1 -1
- package/docs/examples/ex-domShowInputAndGetFiles.html +1 -1
- package/docs/examples/ex-domTooltip.html +1 -1
- package/docs/examples/ex-getFileHash.html +1 -1
- package/docs/examples/ex-getUserAgent.html +1 -1
- package/docs/examples/ex-getUserAgentDyn.html +1 -1
- package/docs/examples/ex-html2str.html +1 -1
- package/docs/examples/ex-obj2u8arr-u8arr2obj.html +1 -1
- package/docs/examples/ex-openLink.html +1 -1
- package/docs/examples/ex-str2aes-aes2str.html +1 -1
- package/docs/examples/ex-str2b64-b642str.html +1 -1
- package/docs/examples/ex-strFindFuzz.html +1 -1
- package/docs/examples/ex-timeTZ2expire-timeTZ2past.html +1 -1
- package/docs/examples/ex-xlsx.html +1 -1
- package/docs/execCli.mjs.html +1 -1
- package/docs/execCliCore.mjs.html +1 -1
- package/docs/execCliJsonRpc.mjs.html +1 -1
- package/docs/execCliSession.mjs.html +1 -1
- package/docs/execJsCode.mjs.html +1 -1
- package/docs/execProcess.mjs.html +1 -1
- package/docs/execProcessKillPid.mjs.html +1 -1
- package/docs/filepathToTree.mjs.html +1 -1
- package/docs/files2data.mjs.html +1 -1
- package/docs/flattenToConn.mjs.html +1 -1
- package/docs/flattenTree.mjs.html +1 -1
- package/docs/floor.mjs.html +1 -1
- package/docs/fsBuildReadStreamText.mjs.html +1 -1
- package/docs/fsBuildWriteStreamText.mjs.html +1 -1
- package/docs/fsCleanFolder.mjs.html +1 -1
- package/docs/fsCleanFolderCore.mjs.html +1 -1
- package/docs/fsCopyFile.mjs.html +1 -1
- package/docs/fsCopyFileCore.mjs.html +1 -1
- package/docs/fsCopyFolder.mjs.html +1 -1
- package/docs/fsCopyFolderCore.mjs.html +1 -1
- package/docs/fsCreateFile.mjs.html +1 -1
- package/docs/fsCreateFileCore.mjs.html +1 -1
- package/docs/fsCreateFolder.mjs.html +1 -1
- package/docs/fsCreateFolderCore.mjs.html +1 -1
- package/docs/fsDeleteFile.mjs.html +1 -1
- package/docs/fsDeleteFileCore.mjs.html +1 -1
- package/docs/fsDeleteFileSafe.mjs.html +1 -1
- package/docs/fsDeleteFileSafeCore.mjs.html +1 -1
- package/docs/fsDeleteFolder.mjs.html +1 -1
- package/docs/fsDeleteFolderCore.mjs.html +1 -1
- package/docs/fsDeleteFolderSafe.mjs.html +1 -1
- package/docs/fsDeleteFolderSafeCore.mjs.html +1 -1
- package/docs/fsDownloadFile.mjs.html +1 -1
- package/docs/fsDownloadFileCore.mjs.html +1 -1
- package/docs/fsEvem.mjs.html +1 -1
- package/docs/fsExists.mjs.html +1 -1
- package/docs/fsExistsCore.mjs.html +1 -1
- package/docs/fsGetFileBasicHash.mjs.html +1 -1
- package/docs/fsGetFileBasicHashCore.mjs.html +1 -1
- package/docs/fsGetFileHash.mjs.html +1 -1
- package/docs/fsGetFileHashCore.mjs.html +1 -1
- package/docs/fsGetFileXxHash.mjs.html +1 -1
- package/docs/fsGetFileXxHashCore.mjs.html +1 -1
- package/docs/fsGetFilesInFolder.mjs.html +1 -1
- package/docs/fsGetFilesInFolderCore.mjs.html +1 -1
- package/docs/fsGetFilesWithHashInFolder.mjs.html +1 -1
- package/docs/fsGetFilesWithHashInFolderCore.mjs.html +1 -1
- package/docs/fsGetFolderBasicHash.mjs.html +1 -1
- package/docs/fsGetFolderBasicHashCore.mjs.html +1 -1
- package/docs/fsGetFoldersInFolder.mjs.html +1 -1
- package/docs/fsGetFoldersInFolderCore.mjs.html +1 -1
- package/docs/fsIsFile.mjs.html +1 -1
- package/docs/fsIsFileCore.mjs.html +1 -1
- package/docs/fsIsFolder.mjs.html +1 -1
- package/docs/fsIsFolderCore.mjs.html +1 -1
- package/docs/fsMergeFiles.mjs.html +1 -1
- package/docs/fsMergeFilesCore.mjs.html +1 -1
- package/docs/fsReadJson.mjs.html +1 -1
- package/docs/fsReadText.mjs.html +1 -1
- package/docs/fsReadTextCore.mjs.html +1 -1
- package/docs/fsRenameFile.mjs.html +1 -1
- package/docs/fsRenameFileCore.mjs.html +1 -1
- package/docs/fsRenameFolder.mjs.html +1 -1
- package/docs/fsRenameFolderCore.mjs.html +1 -1
- package/docs/fsSrlog.mjs.html +1 -1
- package/docs/fsSyncFolder.mjs.html +1 -1
- package/docs/fsSyncFolderCore.mjs.html +1 -1
- package/docs/fsTask.mjs.html +1 -1
- package/docs/fsTaskCp.mjs.html +1 -1
- package/docs/fsTreeFolder.mjs.html +1 -1
- package/docs/fsTreeFolderCore.mjs.html +1 -1
- package/docs/fsTreeFolderWithHash.mjs.html +1 -1
- package/docs/fsTreeFolderWithHashCore.mjs.html +1 -1
- package/docs/fsWatchFile.mjs.html +1 -1
- package/docs/fsWatchFolder.mjs.html +1 -1
- package/docs/fsWriteJson.mjs.html +1 -1
- package/docs/fsWriteText.mjs.html +1 -1
- package/docs/fsWriteTextCore.mjs.html +1 -1
- package/docs/genGradientColor.mjs.html +1 -1
- package/docs/genID.mjs.html +1 -1
- package/docs/genIDSeq.mjs.html +1 -1
- package/docs/genPm.mjs.html +1 -1
- package/docs/getBufferSize.mjs.html +1 -1
- package/docs/getClearPathName.mjs.html +1 -1
- package/docs/getCsvStrFromData.mjs.html +1 -1
- package/docs/getDataFromExcelFileU8Arr.mjs.html +1 -1
- package/docs/getDataFromExcelFileU8ArrDyn.mjs.html +1 -1
- package/docs/getEnv.mjs.html +1 -1
- package/docs/getErrorMessage.mjs.html +1 -1
- package/docs/getExcelU8ArrFromData.mjs.html +1 -1
- package/docs/getExcelU8ArrFromWorkbook.mjs.html +1 -1
- package/docs/getExcelWorkbookFromData.mjs.html +1 -1
- package/docs/getExcelWorkbookFromWorksheet.mjs.html +1 -1
- package/docs/getExcelWorksheetFromData.mjs.html +1 -1
- package/docs/getFileAccept.mjs.html +1 -1
- package/docs/getFileBasicHash.mjs.html +1 -1
- package/docs/getFileHash.mjs.html +1 -1
- package/docs/getFileName.mjs.html +1 -1
- package/docs/getFileNameExt.mjs.html +1 -1
- package/docs/getFileTrueName.mjs.html +1 -1
- package/docs/getFileType.mjs.html +1 -1
- package/docs/getFileXxHash.mjs.html +1 -1
- package/docs/getGlobal.mjs.html +1 -1
- package/docs/getObjSize.mjs.html +1 -1
- package/docs/getPathParent.mjs.html +1 -1
- package/docs/getTimeBetween.mjs.html +1 -1
- package/docs/getTimeFromUnit.mjs.html +1 -1
- package/docs/getTimeHp.mjs.html +1 -1
- package/docs/getTimeObject.mjs.html +1 -1
- package/docs/getTimeRange.mjs.html +1 -1
- package/docs/getUserAgent.mjs.html +1 -1
- package/docs/getUserAgentDyn.mjs.html +1 -1
- package/docs/getltdtkeys.mjs.html +1 -1
- package/docs/global.html +1 -1
- package/docs/haskey.mjs.html +1 -1
- package/docs/html2str.mjs.html +1 -1
- package/docs/htmlDecode.mjs.html +1 -1
- package/docs/htmlEncode.mjs.html +1 -1
- package/docs/importResources.mjs.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interp1.mjs.html +1 -1
- package/docs/isDate.mjs.html +1 -1
- package/docs/isDev.mjs.html +1 -1
- package/docs/isEle.mjs.html +1 -1
- package/docs/isEleExistByID.mjs.html +1 -1
- package/docs/isEmail.mjs.html +1 -1
- package/docs/isErr.mjs.html +1 -1
- package/docs/isIE.mjs.html +1 -1
- package/docs/isNarrow.mjs.html +1 -1
- package/docs/isStrHasCapital.mjs.html +1 -1
- package/docs/isStrHasLetter.mjs.html +1 -1
- package/docs/isStrHasLowerCase.mjs.html +1 -1
- package/docs/isStrHasNumber.mjs.html +1 -1
- package/docs/isStrHasSpace.mjs.html +1 -1
- package/docs/isStrHasSymbol.mjs.html +1 -1
- package/docs/isUserIdentify.mjs.html +1 -1
- package/docs/isUserName.mjs.html +1 -1
- package/docs/isUserPw.mjs.html +1 -1
- package/docs/isWindow.mjs.html +1 -1
- package/docs/isab.mjs.html +1 -1
- package/docs/isarr.mjs.html +1 -1
- package/docs/isarr0.mjs.html +1 -1
- package/docs/isarr1.mjs.html +1 -1
- package/docs/isbigint.mjs.html +1 -1
- package/docs/isblob.mjs.html +1 -1
- package/docs/isbol.mjs.html +1 -1
- package/docs/isday.mjs.html +1 -1
- package/docs/isearr.mjs.html +1 -1
- package/docs/iseobj.mjs.html +1 -1
- package/docs/iser.mjs.html +1 -1
- package/docs/isernot.mjs.html +1 -1
- package/docs/isestr.mjs.html +1 -1
- package/docs/isfile.mjs.html +1 -1
- package/docs/isfun.mjs.html +1 -1
- package/docs/isint.mjs.html +1 -1
- package/docs/ismonth.mjs.html +1 -1
- package/docs/isn0int.mjs.html +1 -1
- package/docs/isn0num.mjs.html +1 -1
- package/docs/isnan.mjs.html +1 -1
- package/docs/isnbr.mjs.html +1 -1
- package/docs/isnint.mjs.html +1 -1
- package/docs/isnnum.mjs.html +1 -1
- package/docs/isnull.mjs.html +1 -1
- package/docs/isnum.mjs.html +1 -1
- package/docs/isobj.mjs.html +1 -1
- package/docs/isobj0.mjs.html +1 -1
- package/docs/isp0int.mjs.html +1 -1
- package/docs/isp0num.mjs.html +1 -1
- package/docs/ispint.mjs.html +1 -1
- package/docs/ispm.mjs.html +1 -1
- package/docs/ispnum.mjs.html +1 -1
- package/docs/isstr.mjs.html +1 -1
- package/docs/isstr0.mjs.html +1 -1
- package/docs/istime.mjs.html +1 -1
- package/docs/istimeTZ.mjs.html +1 -1
- package/docs/istimems.mjs.html +1 -1
- package/docs/istimemsTZ.mjs.html +1 -1
- package/docs/isu16arr.mjs.html +1 -1
- package/docs/isu8arr.mjs.html +1 -1
- package/docs/isundefined.mjs.html +1 -1
- package/docs/j2o.mjs.html +1 -1
- package/docs/judge.mjs.html +1 -1
- package/docs/keysmat2ltdt.mjs.html +1 -1
- package/docs/ltdt2vrtsable.mjs.html +1 -1
- package/docs/ltdtDiff.mjs.html +1 -1
- package/docs/ltdtDiffByKey.mjs.html +1 -1
- package/docs/ltdtkeys2mat.mjs.html +1 -1
- package/docs/ltdtkeysheads2mat.mjs.html +1 -1
- package/docs/ltdtmapping.mjs.html +1 -1
- package/docs/ltdtmerge.mjs.html +1 -1
- package/docs/ltdtpick.mjs.html +1 -1
- package/docs/ltdtpull.mjs.html +1 -1
- package/docs/mat2ltdt.mjs.html +1 -1
- package/docs/matConcat.mjs.html +1 -1
- package/docs/matDiff.mjs.html +1 -1
- package/docs/matat.mjs.html +1 -1
- package/docs/now2str.mjs.html +1 -1
- package/docs/now2strp.mjs.html +1 -1
- package/docs/nowDay2str.mjs.html +1 -1
- package/docs/nowms2str.mjs.html +1 -1
- package/docs/nowms2strp.mjs.html +1 -1
- package/docs/o2j.mjs.html +1 -1
- package/docs/obj2b64.mjs.html +1 -1
- package/docs/obj2pb64.mjs.html +1 -1
- package/docs/obj2str.mjs.html +1 -1
- package/docs/obj2stru8arr.mjs.html +1 -1
- package/docs/obj2u8arr.mjs.html +1 -1
- package/docs/objSortBy.mjs.html +1 -1
- package/docs/objSortByKeys.mjs.html +1 -1
- package/docs/oo.mjs.html +1 -1
- package/docs/openLink.mjs.html +1 -1
- package/docs/pb642obj.mjs.html +1 -1
- package/docs/pmChain.mjs.html +1 -1
- package/docs/pmConvertResolve.mjs.html +1 -1
- package/docs/pmDebounce.mjs.html +1 -1
- package/docs/pmHook.mjs.html +1 -1
- package/docs/pmHookReject.mjs.html +1 -1
- package/docs/pmIni.mjs.html +1 -1
- package/docs/pmInvResolve.mjs.html +1 -1
- package/docs/pmKeyMutex.mjs.html +1 -1
- package/docs/pmMap.mjs.html +1 -1
- package/docs/pmQueue.mjs.html +1 -1
- package/docs/pmSeries.mjs.html +1 -1
- package/docs/pmThrottle.mjs.html +1 -1
- package/docs/pmTimeout.mjs.html +1 -1
- package/docs/preciseNum.mjs.html +1 -1
- package/docs/pseudoRandom.mjs.html +1 -1
- package/docs/pseudoRandomIntRange.mjs.html +1 -1
- package/docs/pseudoRandomIntsNdpRange.mjs.html +1 -1
- package/docs/pseudoRandomIntsRange.mjs.html +1 -1
- package/docs/pseudoRandomRange.mjs.html +1 -1
- package/docs/pseudoRandomsRange.mjs.html +1 -1
- package/docs/queue.mjs.html +1 -1
- package/docs/random.mjs.html +1 -1
- package/docs/randomIntRange.mjs.html +1 -1
- package/docs/randomIntsNdpRange.mjs.html +1 -1
- package/docs/randomIntsRange.mjs.html +1 -1
- package/docs/randomRange.mjs.html +1 -1
- package/docs/randomsRange.mjs.html +1 -1
- package/docs/rang.mjs.html +1 -1
- package/docs/rep.mjs.html +1 -1
- package/docs/repObj.mjs.html +1 -1
- package/docs/replace.mjs.html +1 -1
- package/docs/replaceObj.mjs.html +1 -1
- package/docs/replacePlus.mjs.html +1 -1
- package/docs/round.mjs.html +1 -1
- package/docs/secd.mjs.html +1 -1
- package/docs/sep.mjs.html +1 -1
- package/docs/sepInt.mjs.html +1 -1
- package/docs/setIntervalHp.mjs.html +1 -1
- package/docs/setTimeoutHp.mjs.html +1 -1
- package/docs/sind.mjs.html +1 -1
- package/docs/split.mjs.html +1 -1
- package/docs/str2aes.mjs.html +1 -1
- package/docs/str2b64.mjs.html +1 -1
- package/docs/str2hint.mjs.html +1 -1
- package/docs/str2md5.mjs.html +1 -1
- package/docs/str2obj.mjs.html +1 -1
- package/docs/str2sha.mjs.html +1 -1
- package/docs/str2sha512.mjs.html +1 -1
- package/docs/str2u8arr.mjs.html +1 -1
- package/docs/strCompare.mjs.html +1 -1
- package/docs/strCompareForVersion.mjs.html +1 -1
- package/docs/strDiff.mjs.html +1 -1
- package/docs/strDiffToHtml.mjs.html +1 -1
- package/docs/strFindFuzz.mjs.html +1 -1
- package/docs/strFindSimilar.mjs.html +1 -1
- package/docs/strTruncate.mjs.html +1 -1
- package/docs/strdelleft.mjs.html +1 -1
- package/docs/strdelright.mjs.html +1 -1
- package/docs/strleft.mjs.html +1 -1
- package/docs/strmid.mjs.html +1 -1
- package/docs/strright.mjs.html +1 -1
- package/docs/stru8arr2obj.mjs.html +1 -1
- package/docs/tand.mjs.html +1 -1
- package/docs/time2day.mjs.html +1 -1
- package/docs/time2hour.mjs.html +1 -1
- package/docs/time2min.mjs.html +1 -1
- package/docs/timeTZ2day.mjs.html +1 -1
- package/docs/timeTZ2expire.mjs.html +1 -1
- package/docs/timeTZ2hour.mjs.html +1 -1
- package/docs/timeTZ2min.mjs.html +1 -1
- package/docs/timeTZ2past.mjs.html +1 -1
- package/docs/timems2day.mjs.html +1 -1
- package/docs/timems2hour.mjs.html +1 -1
- package/docs/timems2min.mjs.html +1 -1
- package/docs/timems2time.mjs.html +1 -1
- package/docs/timemsTZ2day.mjs.html +1 -1
- package/docs/timemsTZ2expire.mjs.html +1 -1
- package/docs/timemsTZ2hour.mjs.html +1 -1
- package/docs/timemsTZ2min.mjs.html +1 -1
- package/docs/timemsTZ2past.mjs.html +1 -1
- package/docs/timemsTZ2time.mjs.html +1 -1
- package/docs/treeObj.mjs.html +1 -1
- package/docs/treeToFilepath.mjs.html +1 -1
- package/docs/trim.mjs.html +1 -1
- package/docs/u16arr2b64.mjs.html +1 -1
- package/docs/u16arr2u8arr.mjs.html +1 -1
- package/docs/u8arr2ab.mjs.html +1 -1
- package/docs/u8arr2b64.mjs.html +1 -1
- package/docs/u8arr2blob.mjs.html +1 -1
- package/docs/u8arr2bs.mjs.html +1 -1
- package/docs/u8arr2obj.mjs.html +1 -1
- package/docs/u8arr2str.mjs.html +1 -1
- package/docs/u8arr2u16arr.mjs.html +1 -1
- package/docs/urlParse.mjs.html +1 -1
- package/docs/verifyValue.mjs.html +1 -1
- package/docs/waitFun.mjs.html +1 -1
- package/docs/wsemi.html +46 -6
- package/package.json +1 -1
- package/src/domDetect.mjs +97 -15
- package/test/domDetect.test.mjs +447 -11
- package/toolfp/dist/wsemip.umd.js +1 -1
- package/toolparfor/dist/wpf.umd.js +1 -1
- package/toolparfor/dist/wpf_pmSeries.umd.js +1 -1
package/dist/wsemi.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* wsemi v1.9.
|
|
2
|
+
* wsemi v1.9.8
|
|
3
3
|
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
13
13
|
* MIT Licence
|
|
14
14
|
*/
|
|
15
|
-
var ys,vs,As=9e15,bs=1e9,ws="0123456789abcdef",Is="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",xs="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Cs={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-As,maxE:As,crypto:!1},Es=!0,Bs="[DecimalError] ",Ss=Bs+"Invalid argument: ",ks=Bs+"Precision limit exceeded",Fs=Bs+"crypto unavailable",Ds="[object Decimal]",Ns=Math.floor,Ms=Math.pow,Ts=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Qs=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ls=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Rs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Us=1e7,Hs=Is.length-1,Os=xs.length-1,qs={toStringTag:Ds};function Ps(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(o+=Ks(n)),o+=r;(n=7-(r=(a=e[t])+"").length)&&(o+=Ks(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function $s(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ss+e)}function zs(e,t,n,r){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=Ms(10,7-t),s=e[i]%o|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(e[i+1]/o/100|0)==Ms(10,t-2)-1||(s==o/2||0==s)&&!(e[i+1]/o/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==Ms(10,t-3)-1,a}function js(e,t,n){for(var r,i,o=[0],a=0,s=e.length;a<s;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=ws.indexOf(e.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}qs.absoluteValue=qs.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Ys(e)},qs.ceil=function(){return Ys(new this.constructor(this),this.e+1,2)},qs.clampedTo=qs.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(Ss+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},qs.comparedTo=qs.cmp=function(e){var t,n,r,i,o=this,a=o.d,s=(e=new o.constructor(e)).d,l=o.s,c=e.s;if(!a||!s)return l&&c?l!==c?l:a===s?0:!a^l<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?l:s[0]?-c:0;if(l!==c)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(t=0,n=(r=a.length)<(i=s.length)?r:i;t<n;++t)if(a[t]!==s[t])return a[t]>s[t]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},qs.cosine=qs.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?i=(1/ll(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10");e.precision+=n,t=sl(e,1,t.times(i),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(r,cl(r,n)),r.precision=e,r.rounding=t,Ys(2==vs||3==vs?n.neg():n,e,t,!0)):new r(1):new r(NaN)},qs.cubeRoot=qs.cbrt=function(){var e,t,n,r,i,o,a,s,l,c,u=this,f=u.constructor;if(!u.isFinite()||u.isZero())return new f(u);for(Es=!1,(o=u.s*Ms(u.s*u,1/3))&&Math.abs(o)!=1/0?r=new f(o.toString()):(n=Ps(u.d),(o=((e=u.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=Ms(n,1/3),e=Ns((e+1)/3)-(e%3==(e<0?-1:2)),(r=new f(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=u.s),a=(e=f.precision)+3;;)if(c=(l=(s=r).times(s).times(s)).plus(u),r=Vs(c.plus(u).times(s),c.plus(l),a+2,1),Ps(s.d).slice(0,a)===(n=Ps(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Ys(r,e+1,1),t=!r.times(r).times(r).eq(u));break}if(!i&&(Ys(s,e+1,0),s.times(s).times(s).eq(u))){r=s;break}a+=4,i=1}return Es=!0,Ys(r,e,f.rounding,t)},qs.decimalPlaces=qs.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-Ns(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},qs.dividedBy=qs.div=function(e){return Vs(this,new this.constructor(e))},qs.dividedToIntegerBy=qs.divToInt=function(e){var t=this.constructor;return Ys(Vs(this,new t(e),0,1,1),t.precision,t.rounding)},qs.equals=qs.eq=function(e){return 0===this.cmp(e)},qs.floor=function(){return Ys(new this.constructor(this),this.e+1,3)},qs.greaterThan=qs.gt=function(e){return this.cmp(e)>0},qs.greaterThanOrEqualTo=qs.gte=function(e){var t=this.cmp(e);return 1==t||0===t},qs.hyperbolicCosine=qs.cosh=function(){var e,t,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/ll(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=sl(a,1,o.times(t),new a(1),!0);for(var l,c=e,u=new a(8);c--;)l=o.times(o),o=s.minus(l.times(u.minus(l.times(u))));return Ys(o,a.precision=n,a.rounding=r,!0)},qs.hyperbolicSine=qs.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=sl(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=sl(o,2,i=i.times(1/ll(5,e)),i,!0);for(var a,s=new o(5),l=new o(16),c=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(l.times(a).plus(c))))}return o.precision=t,o.rounding=n,Ys(i,t,n,!0)},qs.hyperbolicTangent=qs.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,Vs(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},qs.inverseCosine=qs.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return-1!==n?0===n?e.isNeg()?_s(t,r,i):new t(0):new t(NaN):e.isZero()?_s(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},qs.inverseHyperbolicCosine=qs.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Es=!1,n=n.times(n).minus(1).sqrt().plus(n),Es=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},qs.inverseHyperbolicSine=qs.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Es=!1,n=n.times(n).plus(1).sqrt().plus(n),Es=!0,r.precision=e,r.rounding=t,n.ln())},qs.inverseHyperbolicTangent=qs.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?Ys(new o(i),e,t,!0):(o.precision=n=r-i.e,i=Vs(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},qs.inverseSine=qs.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t?0===t?((e=_s(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},qs.inverseTangent=qs.atan=function(){var e,t,n,r,i,o,a,s,l,c=this,u=c.constructor,f=u.precision,d=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&f+4<=Os)return(a=_s(u,f+4,d).times(.25)).s=c.s,a}else{if(!c.s)return new u(NaN);if(f+4<=Os)return(a=_s(u,f+4,d).times(.5)).s=c.s,a}for(u.precision=s=f+10,u.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(Es=!1,t=Math.ceil(s/7),r=1,l=c.times(c),a=new u(c),i=c;-1!==e;)if(i=i.times(l),o=a.minus(i.div(r+=2)),i=i.times(l),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),Es=!0,Ys(a,u.precision=f,u.rounding=d,!0)},qs.isFinite=function(){return!!this.d},qs.isInteger=qs.isInt=function(){return!!this.d&&Ns(this.e/7)>this.d.length-2},qs.isNaN=function(){return!this.s},qs.isNegative=qs.isNeg=function(){return this.s<0},qs.isPositive=qs.isPos=function(){return this.s>0},qs.isZero=function(){return!!this.d&&0===this.d[0]},qs.lessThan=qs.lt=function(e){return this.cmp(e)<0},qs.lessThanOrEqualTo=qs.lte=function(e){return this.cmp(e)<1},qs.logarithm=qs.log=function(e){var t,n,r,i,o,a,s,l,c=this,u=c.constructor,f=u.precision,d=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new u(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(Es=!1,a=rl(c,s=f+5),r=t?Js(u,s+10):rl(e,s),zs((l=Vs(a,r,s,1)).d,i=f,d))do{if(a=rl(c,s+=10),r=t?Js(u,s+10):rl(e,s),l=Vs(a,r,s,1),!o){+Ps(l.d).slice(i+1,i+15)+1==1e14&&(l=Ys(l,f+1,0));break}}while(zs(l.d,i+=10,d));return Es=!0,Ys(l,f,d)},qs.minus=qs.sub=function(e){var t,n,r,i,o,a,s,l,c,u,f,d,h=this,p=h.constructor;if(e=new p(e),!h.d||!e.d)return h.s&&e.s?h.d?e.s=-e.s:e=new p(e.d||h.s!==e.s?h:NaN):e=new p(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(c=h.d,d=e.d,s=p.precision,l=p.rounding,!c[0]||!d[0]){if(d[0])e.s=-e.s;else{if(!c[0])return new p(3===l?-0:0);e=new p(h)}return Es?Ys(e,s,l):e}if(n=Ns(e.e/7),u=Ns(h.e/7),c=c.slice(),o=u-n){for((f=o<0)?(t=c,o=-o,a=d.length):(t=d,n=u,a=c.length),o>(r=Math.max(Math.ceil(s/7),a)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((f=(r=c.length)<(a=d.length))&&(a=r),r=0;r<a;r++)if(c[r]!=d[r]){f=c[r]<d[r];break}o=0}for(f&&(t=c,c=d,d=t,e.s=-e.s),a=c.length,r=d.length-a;r>0;--r)c[a++]=0;for(r=d.length;r>o;){if(c[--r]<d[r]){for(i=r;i&&0===c[--i];)c[i]=Us-1;--c[i],c[r]+=Us}c[r]-=d[r]}for(;0===c[--a];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(e.d=c,e.e=Gs(c,n),Es?Ys(e,s,l):e):new p(3===l?-0:0)},qs.modulo=qs.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?Ys(new r(n),r.precision,r.rounding):(Es=!1,9==r.modulo?(t=Vs(n,e.abs(),0,3,1)).s*=e.s:t=Vs(n,e,0,r.modulo,1),t=t.times(e),Es=!0,n.minus(t))},qs.naturalExponential=qs.exp=function(){return nl(this)},qs.naturalLogarithm=qs.ln=function(){return rl(this)},qs.negated=qs.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Ys(e)},qs.plus=qs.add=function(e){var t,n,r,i,o,a,s,l,c,u,f=this,d=f.constructor;if(e=new d(e),!f.d||!e.d)return f.s&&e.s?f.d||(e=new d(e.d||f.s===e.s?f:NaN)):e=new d(NaN),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,u=e.d,s=d.precision,l=d.rounding,!c[0]||!u[0])return u[0]||(e=new d(f)),Es?Ys(e,s,l):e;if(o=Ns(f.e/7),r=Ns(e.e/7),c=c.slice(),i=o-r){for(i<0?(n=c,i=-i,a=u.length):(n=u,r=o,a=c.length),i>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=c.length)-(i=u.length)<0&&(i=a,n=u,u=c,c=n),t=0;i;)t=(c[--i]=c[i]+u[i]+t)/Us|0,c[i]%=Us;for(t&&(c.unshift(t),++r),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=Gs(c,r),Es?Ys(e,s,l):e},qs.precision=qs.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(Ss+e);return n.d?(t=Xs(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},qs.round=function(){var e=this,t=e.constructor;return Ys(new t(e),e.e+1,t.rounding)},qs.sine=qs.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:sl(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=t.times(1/ll(5,n)),t=sl(e,2,t,t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,cl(r,n)),r.precision=e,r.rounding=t,Ys(vs>2?n.neg():n,e,t,!0)):new r(NaN)},qs.squareRoot=qs.sqrt=function(){var e,t,n,r,i,o,a=this,s=a.d,l=a.e,c=a.s,u=a.constructor;if(1!==c||!s||!s[0])return new u(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(Es=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=Ps(s)).length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=Ns((l+1)/2)-(l<0||l%2),r=new u(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):r=new u(c.toString()),n=(l=u.precision)+3;;)if(r=(o=r).plus(Vs(a,o,n+2,1)).times(.5),Ps(o.d).slice(0,n)===(t=Ps(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Ys(r,l+1,1),e=!r.times(r).eq(a));break}if(!i&&(Ys(o,l+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return Es=!0,Ys(r,l,u.rounding,e)},qs.tangent=qs.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=Vs(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,Ys(2==vs||4==vs?n.neg():n,e,t,!0)):new r(NaN)},qs.times=qs.mul=function(e){var t,n,r,i,o,a,s,l,c,u=this,f=u.constructor,d=u.d,h=(e=new f(e)).d;if(e.s*=u.s,!(d&&d[0]&&h&&h[0]))return new f(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:d&&h?0*e.s:e.s/0);for(n=Ns(u.e/7)+Ns(e.e/7),(l=d.length)<(c=h.length)&&(o=d,d=h,h=o,a=l,l=c,c=a),o=[],r=a=l+c;r--;)o.push(0);for(r=c;--r>=0;){for(t=0,i=l+r;i>r;)s=o[i]+h[r]*d[i-r-1]+t,o[i--]=s%Us|0,t=s/Us|0;o[i]=(o[i]+t)%Us|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=Gs(o,n),Es?Ys(e,f.precision,f.rounding):e},qs.toBinary=function(e,t){return ul(this,2,e,t)},qs.toDecimalPlaces=qs.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:($s(e,0,bs),void 0===t?t=r.rounding:$s(t,0,8),Ys(n,e+n.e+1,t))},qs.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=Ws(r,!0):($s(e,0,bs),void 0===t?t=i.rounding:$s(t,0,8),n=Ws(r=Ys(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},qs.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?n=Ws(i):($s(e,0,bs),void 0===t?t=o.rounding:$s(t,0,8),n=Ws(r=Ys(new o(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},qs.toFraction=function(e){var t,n,r,i,o,a,s,l,c,u,f,d,h=this,p=h.d,g=h.constructor;if(!p)return new g(h);if(c=n=new g(1),r=l=new g(0),a=(o=(t=new g(r)).e=Xs(p)-h.e-1)%7,t.d[0]=Ms(10,a<0?7+a:a),null==e)e=o>0?t:c;else{if(!(s=new g(e)).isInt()||s.lt(c))throw Error(Ss+s);e=s.gt(t)?o>0?t:c:s}for(Es=!1,s=new g(Ps(p)),u=g.precision,g.precision=o=7*p.length*2;f=Vs(s,t,0,1,1),1!=(i=n.plus(f.times(r))).cmp(e);)n=r,r=i,i=c,c=l.plus(f.times(i)),l=i,i=t,t=s.minus(f.times(i)),s=i;return i=Vs(e.minus(n),r,0,1,1),l=l.plus(i.times(c)),n=n.plus(i.times(r)),l.s=c.s=h.s,d=Vs(c,r,o,1).minus(h).abs().cmp(Vs(l,n,o,1).minus(h).abs())<1?[c,r]:[l,n],g.precision=u,Es=!0,d},qs.toHexadecimal=qs.toHex=function(e,t){return ul(this,16,e,t)},qs.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:$s(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Es=!1,n=Vs(n,e,0,t,1).times(e),Es=!0,Ys(n)):(e.s=n.s,n=e),n},qs.toNumber=function(){return+this},qs.toOctal=function(e,t){return ul(this,8,e,t)},qs.toPower=qs.pow=function(e){var t,n,r,i,o,a,s=this,l=s.constructor,c=+(e=new l(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new l(Ms(+s,c));if((s=new l(s)).eq(1))return s;if(r=l.precision,o=l.rounding,e.eq(1))return Ys(s,r,o);if((t=Ns(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=Zs(l,s,n,r),e.s<0?new l(1).div(i):Ys(i,r,o);if((a=s.s)<0){if(t<e.d.length-1)return new l(NaN);if(1&e.d[t]||(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(t=0!=(n=Ms(+s,c))&&isFinite(n)?new l(n+"").e:Ns(c*(Math.log("0."+Ps(s.d))/Math.LN10+s.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?a/0:0):(Es=!1,l.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=nl(e.times(rl(s,r+n)),r)).d&&zs((i=Ys(i,r+5,1)).d,r,o)&&(t=r+10,+Ps((i=Ys(nl(e.times(rl(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Ys(i,r+1,0))),i.s=a,Es=!0,l.rounding=o,Ys(i,r,o))},qs.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=Ws(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):($s(e,1,bs),void 0===t?t=i.rounding:$s(t,0,8),n=Ws(r=Ys(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},qs.toSignificantDigits=qs.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):($s(e,1,bs),void 0===t?t=n.rounding:$s(t,0,8)),Ys(new n(this),e,t)},qs.toString=function(){var e=this,t=e.constructor,n=Ws(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},qs.truncated=qs.trunc=function(){return Ys(new this.constructor(this),this.e+1,1)},qs.valueOf=qs.toJSON=function(){var e=this,t=e.constructor,n=Ws(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var Vs=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,a,s,l){var c,u,f,d,h,p,g,m,y,v,A,b,w,I,x,C,E,B,S,k,F=r.constructor,D=r.s==i.s?1:-1,N=r.d,M=i.d;if(!(N&&N[0]&&M&&M[0]))return new F(r.s&&i.s&&(N?!M||N[0]!=M[0]:M)?N&&0==N[0]||!M?0*D:D/0:NaN);for(l?(h=1,u=r.e-i.e):(l=Us,h=7,u=Ns(r.e/h)-Ns(i.e/h)),S=M.length,E=N.length,v=(y=new F(D)).d=[],f=0;M[f]==(N[f]||0);f++);if(M[f]>(N[f]||0)&&u--,null==o?(I=o=F.precision,a=F.rounding):I=s?o+(r.e-i.e)+1:o,I<0)v.push(1),p=!0;else{if(I=I/h+2|0,f=0,1==S){for(d=0,M=M[0],I++;(f<E||d)&&I--;f++)x=d*l+(N[f]||0),v[f]=x/M|0,d=x%M|0;p=d||f<E}else{for((d=l/(M[0]+1)|0)>1&&(M=e(M,d,l),N=e(N,d,l),S=M.length,E=N.length),C=S,b=(A=N.slice(0,S)).length;b<S;)A[b++]=0;(k=M.slice()).unshift(0),B=M[0],M[1]>=l/2&&++B;do{d=0,(c=t(M,A,S,b))<0?(w=A[0],S!=b&&(w=w*l+(A[1]||0)),(d=w/B|0)>1?(d>=l&&(d=l-1),1==(c=t(g=e(M,d,l),A,m=g.length,b=A.length))&&(d--,n(g,S<m?k:M,m,l))):(0==d&&(c=d=1),g=M.slice()),(m=g.length)<b&&g.unshift(0),n(A,g,b,l),-1==c&&(c=t(M,A,S,b=A.length))<1&&(d++,n(A,S<b?k:M,b,l)),b=A.length):0===c&&(d++,A=[0]),v[f++]=d,c&&A[0]?A[b++]=N[C]||0:(A=[N[C]],b=1)}while((C++<E||void 0!==A[0])&&I--);p=void 0!==A[0]}v[0]||v.shift()}if(1==h)y.e=u,ys=p;else{for(f=1,d=v[0];d>=10;d/=10)f++;y.e=f+u*h-1,Ys(y,s?o+y.e+1:o,a,p)}return y}}();function Ys(e,t,n,r){var i,o,a,s,l,c,u,f,d,h=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,s=f[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=7,a=t,l=(u=f[d=0])/Ms(10,i-a-1)%10|0;else if((d=Math.ceil((o+1)/7))>=(s=f.length)){if(!r)break e;for(;s++<=d;)f.push(0);u=l=0,i=1,a=(o%=7)-7+1}else{for(u=s=f[d],i=1;s>=10;s/=10)i++;l=(a=(o%=7)-7+i)<0?0:u/Ms(10,i-a-1)%10|0}if(r=r||t<0||void 0!==f[d+1]||(a<0?u:u%Ms(10,i-a-1)),c=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?u/Ms(10,i-a):0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=Ms(10,(7-t%7)%7),e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=d,s=1,d--):(f.length=d+1,s=Ms(10,7-o),f[d]=a>0?(u/Ms(10,i-a)%Ms(10,a)|0)*s:0),c)for(;;){if(0==d){for(o=1,a=f[0];a>=10;a/=10)o++;for(a=f[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,f[0]==Us&&(f[0]=1));break}if(f[d]+=s,f[d]!=Us)break;f[d--]=0,s=1}for(o=f.length;0===f[--o];)f.pop()}return Es&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function Ws(e,t,n){if(!e.isFinite())return il(e);var r,i=e.e,o=Ps(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+Ks(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Ks(-i-1)+o,n&&(r=n-a)>0&&(o+=Ks(r))):i>=a?(o+=Ks(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Ks(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=Ks(r))),o}function Gs(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function Js(e,t,n){if(t>Hs)throw Es=!0,n&&(e.precision=n),Error(ks);return Ys(new e(Is),t,1,!0)}function _s(e,t,n){if(t>Os)throw Error(ks);return Ys(new e(xs),t,n,!0)}function Xs(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Ks(e){for(var t="";e--;)t+="0";return t}function Zs(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/7+4);for(Es=!1;;){if(n%2&&fl((o=o.times(t)).d,a)&&(i=!0),0===(n=Ns(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}fl((t=t.times(t)).d,a)}return Es=!0,o}function el(e){return 1&e.d[e.d.length-1]}function tl(e,t,n){for(var r,i,o=new e(t[0]),a=0;++a<t.length;){if(!(i=new e(t[a])).s){o=i;break}((r=o.cmp(i))===n||0===r&&o.s===n)&&(o=i)}return o}function nl(e,t){var n,r,i,o,a,s,l,c=0,u=0,f=0,d=e.constructor,h=d.rounding,p=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(Es=!1,l=p):l=t,s=new d(.03125);e.e>-2;)e=e.times(s),f+=5;for(l+=r=Math.log(Ms(2,f))/Math.LN10*2+5|0,n=o=a=new d(1),d.precision=l;;){if(o=Ys(o.times(e),l,1),n=n.times(++u),Ps((s=a.plus(Vs(o,n,l,1))).d).slice(0,l)===Ps(a.d).slice(0,l)){for(i=f;i--;)a=Ys(a.times(a),l,1);if(null!=t)return d.precision=p,a;if(!(c<3&&zs(a.d,l-r,h,c)))return Ys(a,d.precision=p,h,Es=!0);d.precision=l+=10,n=o=s=new d(1),u=0,c++}a=s}}function rl(e,t){var n,r,i,o,a,s,l,c,u,f,d,h=1,p=e,g=p.d,m=p.constructor,y=m.rounding,v=m.precision;if(p.s<0||!g||!g[0]||!p.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=p.s?NaN:g?0:p);if(null==t?(Es=!1,u=v):u=t,m.precision=u+=10,r=(n=Ps(g)).charAt(0),!(Math.abs(o=p.e)<15e14))return c=Js(m,u+2,v).times(o+""),p=rl(new m(r+"."+n.slice(1)),u-10).plus(c),m.precision=v,null==t?Ys(p,v,y,Es=!0):p;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=Ps((p=p.times(e)).d)).charAt(0),h++;for(o=p.e,r>1?(p=new m("0."+n),o++):p=new m(r+"."+n.slice(1)),f=p,l=a=p=Vs(p.minus(1),p.plus(1),u,1),d=Ys(p.times(p),u,1),i=3;;){if(a=Ys(a.times(d),u,1),Ps((c=l.plus(Vs(a,new m(i),u,1))).d).slice(0,u)===Ps(l.d).slice(0,u)){if(l=l.times(2),0!==o&&(l=l.plus(Js(m,u+2,v).times(o+""))),l=Vs(l,new m(h),u,1),null!=t)return m.precision=v,l;if(!zs(l.d,u-10,y,s))return Ys(l,m.precision=v,y,Es=!0);m.precision=u+=10,c=a=p=Vs(f.minus(1),f.plus(1),u,1),d=Ys(p.times(p),u,1),i=s=1}l=c,i+=2}}function il(e){return String(e.s*e.s/0)}function ol(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";e.d.push(+t),Es&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function al(e,t){var n,r,i,o,a,s,l,c,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Rs.test(t))return ol(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Qs.test(t))n=16,t=t.toLowerCase();else if(Ts.test(t))n=2;else{if(!Ls.test(t))throw Error(Ss+t);n=8}for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,r=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=Zs(r,new r(n),o,2*o)),o=u=(c=js(t,n,Us)).length-1;0===c[o];--o)c.pop();return o<0?new r(0*e.s):(e.e=Gs(c,u),e.d=c,Es=!1,a&&(e=Vs(e,i,4*s)),l&&(e=e.times(Math.abs(l)<54?Ms(2,l):Kl.pow(2,l))),Es=!0,e)}function sl(e,t,n,r,i){var o,a,s,l,c=e.precision,u=Math.ceil(c/7);for(Es=!1,l=n.times(n),s=new e(r);;){if(a=Vs(s.times(l),new e(t++*t++),c,1),s=i?r.plus(a):r.minus(a),r=Vs(a.times(l),new e(t++*t++),c,1),void 0!==(a=s.plus(r)).d[u]){for(o=u;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return Es=!0,a.d.length=u+1,a}function ll(e,t){for(var n=e;--t;)n*=e;return n}function cl(e,t){var n,r=t.s<0,i=_s(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return vs=r?4:1,t;if((n=t.divToInt(i)).isZero())vs=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return vs=el(n)?r?2:3:r?4:1,t;vs=el(n)?r?1:4:r?3:2}return t.minus(i).abs()}function ul(e,t,n,r){var i,o,a,s,l,c,u,f,d,h=e.constructor,p=void 0!==n;if(p?($s(n,1,bs),void 0===r?r=h.rounding:$s(r,0,8)):(n=h.precision,r=h.rounding),e.isFinite()){for(p?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(a=(u=Ws(e)).indexOf("."))>=0&&(u=u.replace(".",""),(d=new h(1)).e=u.length-a,d.d=js(Ws(d),10,i),d.e=d.d.length),o=l=(f=js(u,10,i)).length;0==f[--l];)f.pop();if(f[0]){if(a<0?o--:((e=new h(e)).d=f,e.e=o,f=(e=Vs(e,d,n,r,0,i)).d,o=e.e,c=ys),a=f[n],s=i/2,c=c||void 0!==f[n+1],c=r<4?(void 0!==a||c)&&(0===r||r===(e.s<0?3:2)):a>s||a===s&&(4===r||c||6===r&&1&f[n-1]||r===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(l=f.length;!f[l-1];--l);for(a=0,u="";a<l;a++)u+=ws.charAt(f[a]);if(p){if(l>1)if(16==t||8==t){for(a=16==t?4:3,--l;l%a;l++)u+="0";for(l=(f=js(u,i,t)).length;!f[l-1];--l);for(a=1,u="1.";a<l;a++)u+=ws.charAt(f[a])}else u=u.charAt(0)+"."+u.slice(1);u=u+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)u="0"+u;u="0."+u}else if(++o>l)for(o-=l;o--;)u+="0";else o<l&&(u=u.slice(0,o)+"."+u.slice(o))}else u=p?"0p+0":"0";u=(16==t?"0x":2==t?"0b":8==t?"0o":"")+u}else u=il(e);return e.s<0?"-"+u:u}function fl(e,t){if(e.length>t)return e.length=t,!0}function dl(e){return new this(e).abs()}function hl(e){return new this(e).acos()}function pl(e){return new this(e).acosh()}function gl(e,t){return new this(e).plus(t)}function ml(e){return new this(e).asin()}function yl(e){return new this(e).asinh()}function vl(e){return new this(e).atan()}function Al(e){return new this(e).atanh()}function bl(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?_s(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=_s(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(Vs(e,t,o,1)),t=_s(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(Vs(e,t,o,1)):(n=_s(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function wl(e){return new this(e).cbrt()}function Il(e){return Ys(e=new this(e),e.e+1,2)}function xl(e,t,n){return new this(e).clamp(t,n)}function Cl(e){if(!e||"object"!=typeof e)throw Error(Bs+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,bs,"rounding",0,8,"toExpNeg",-As,0,"toExpPos",0,As,"maxE",0,As,"minE",-As,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=Cs[n]),void 0!==(r=e[n])){if(!(Ns(r)===r&&r>=o[t+1]&&r<=o[t+2]))throw Error(Ss+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=Cs[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(Ss+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(Fs);this[n]=!0}else this[n]=!1}return this}function El(e){return new this(e).cos()}function Bl(e){return new this(e).cosh()}function Sl(e,t){return new this(e).div(t)}function kl(e){return new this(e).exp()}function Fl(e){return Ys(e=new this(e),e.e+1,3)}function Dl(){var e,t,n=new this(0);for(Es=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Es=!0,new this(1/0);n=t}return Es=!0,n.sqrt()}function Nl(e){return e instanceof Kl||e&&e.toStringTag===Ds||!1}function Ml(e){return new this(e).ln()}function Tl(e,t){return new this(e).log(t)}function Ql(e){return new this(e).log(2)}function Ll(e){return new this(e).log(10)}function Rl(){return tl(this,arguments,-1)}function Ul(){return tl(this,arguments,1)}function Hl(e,t){return new this(e).mod(t)}function Ol(e,t){return new this(e).mul(t)}function ql(e,t){return new this(e).pow(t)}function Pl(e){var t,n,r,i,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:$s(e,1,bs),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(Fs);for(t=crypto.randomBytes(r*=4);o<r;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=r/4}else for(;o<r;)s[o++]=1e7*Math.random()|0;for(e%=7,(r=s[--o])&&e&&(i=Ms(10,7-e),s[o]=(r/i|0)*i);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=7)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=s,a}function $l(e){return Ys(e=new this(e),e.e+1,this.rounding)}function zl(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function jl(e){return new this(e).sin()}function Vl(e){return new this(e).sinh()}function Yl(e){return new this(e).sqrt()}function Wl(e,t){return new this(e).sub(t)}function Gl(){var e=0,t=arguments,n=new this(t[e]);for(Es=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Es=!0,Ys(n,this.precision,this.rounding)}function Jl(e){return new this(e).tan()}function _l(e){return new this(e).tanh()}function Xl(e){return Ys(e=new this(e),e.e+1,1)}qs[Symbol.for("nodejs.util.inspect.custom")]=qs.toString,qs[Symbol.toStringTag]="Decimal";var Kl=qs.constructor=function e(t){var n,r,i;function o(e){var t,n,r,i=this;if(!(i instanceof o))return new o(e);if(i.constructor=o,Nl(e))return i.s=e.s,void(Es?!e.d||e.e>o.maxE?(i.e=NaN,i.d=null):e.e<o.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"===(r=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;return void(Es?t>o.maxE?(i.e=NaN,i.d=null):t<o.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):ol(i,e.toString())}if("string"===r)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===n&&(e=e.slice(1)),i.s=1),Rs.test(e)?ol(i,e):al(i,e);if("bigint"===r)return e<0?(e=-e,i.s=-1):i.s=1,ol(i,e.toString());throw Error(Ss+e)}if(o.prototype=qs,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=Cl,o.clone=e,o.isDecimal=Nl,o.abs=dl,o.acos=hl,o.acosh=pl,o.add=gl,o.asin=ml,o.asinh=yl,o.atan=vl,o.atanh=Al,o.atan2=bl,o.cbrt=wl,o.ceil=Il,o.clamp=xl,o.cos=El,o.cosh=Bl,o.div=Sl,o.exp=kl,o.floor=Fl,o.hypot=Dl,o.ln=Ml,o.log=Tl,o.log10=Ll,o.log2=Ql,o.max=Rl,o.min=Ul,o.mod=Hl,o.mul=Ol,o.pow=ql,o.random=Pl,o.round=$l,o.sign=zl,o.sin=jl,o.sinh=Vl,o.sqrt=Yl,o.sub=Wl,o.sum=Gl,o.tan=Jl,o.tanh=_l,o.trunc=Xl,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(Cs);function Zl(e,t=0){if(go(t)||(t=0),t=Vi(t),!Ne(e))return"";return new Kl(e).toDecimalPlaces(t,Kl.ROUND_CEIL).toNumber()}function ec(e,t=0){if(!Ne(e))return"";if(!go(t))return"";return e=Ir(e),ji(e,t).toFixed(t)}function tc(){return"undefined"!=typeof self?self:Xa()?window:"undefined"!=typeof global?global:null}function nc(e){let t=function(){let e=tc();return n||e.xss}();let r=function e(n){return Ce(n)||Ee(n)?(vn(n,function(t,r){n[r]=e(t)}),n):ke(n)?t(n,{onIgnoreTagAttr:function(e,n,r,i){if("style"===n)return n+'="'+t.escapeAttrValue(r)+'"'}}):n}(Qi(e));return r}function rc(e,t){let n=Ja();if(!Ce(e)&&!Ee(e))return n.reject("rs is not an array or object"),n;let r=!1;if(Ee(e)){r=!0;let t=[];vn(e,(e,n)=>{t.push({k:n,v:e})}),e=t}Oi(t)||(t=function(e){return e});let i=-1,o=[];return e.reduce(function(e,n){return e.then(function(e){o.push(e),i+=1;let a=i,s=n;return r&&(a=n.k,s=n.v),Oi(t)?t(s,a):s})},Promise.resolve()).then(function(e){o.push(e),o=Ta(o),n.resolve(o)}).catch(function(e){n.reject(e)}),n}Is=new Kl(Is),xs=new Kl(xs);let ic={},oc={};function ac({tagName:e,path:t,attributes:n={},func:r}){let i=Ja();if("done"===ic[t])return i.resolve("loaded"),i;if("loading"===ic[t])return gs(()=>"done"===ic[t]).then(function(){i.resolve("loaded")}),i;ic[t]="loading";let o=document.createElement(e);return vn(n,(e,t)=>{o.setAttribute(t,e)}),n.rel&&"stylesheet"===n.rel?(o.setAttribute("href",t),setTimeout(()=>{i.resolve(o),ic[t]="done"},1)):(o.src=t,o.addEventListener("load",()=>{let e;Oi(r)?e=gs(r):(e=Ja(),e.resolve()),e.then(()=>hs(500)).then(function(){i.resolve(o),ic[t]="done"})}),o.addEventListener("error",()=>{i.reject(o),ic[t]="done"})),document.getElementsByTagName("head")[0].appendChild(o),i}function sc(e){let t=Ja();Ce(e)||(e=[e]),vn(e,(t,n)=>{Se(t)&&(e[n]={path:t})});let n=vo(bn(e,"path"),"|");return"done"===oc[n]?(t.resolve("loaded"),t):"loading"===oc[n]?(gs(()=>"done"===oc[n]).then(function(){t.resolve("loaded")}),t):(oc[n]="loading",vn(e,(e,t)=>{e.type||(".js"===ra(e.path,3)?e.type="js":".css"===ra(e.path,4)?e.type="css":e.type="unknow")}),rc(e,e=>{let t=Ja();if("js"===e.type)t=ac({tagName:"script",path:e.path,attributes:{type:"text/javascript"},func:e.func});else if("css"===e.type)t=ac({tagName:"link",path:e.path,attributes:{rel:"stylesheet"}});else{let n="invalid pathItem.type: "+e.type;console.log(n),t.reject(n)}return t}).finally(()=>{oc[n]="done"}))}function lc(e){return me(e).toUpperCase()}function cc(e,t,n){if(!ke(e))return"";if(!ke(t))return"";if(!Se(n))return"";return String(e).replaceAll(t,n)}function uc(e,t,n=1){return ke(e)&&go(t)?(n=Yi(n)?Vi(n):1,e.substring(t,t+n)):""}let fc={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function dc(e){return pc(e,1)}function hc(e){return pc(e,360)}function pc(e,t=1){if(e.indexOf("%")>=0){if(!Ne(e=cc(e,"%","")))throw new Error("invalid color: value is not a number");e=Ir(e)/100}else{if(!Ne(e))throw new Error("invalid color: value is not a number");e=Ir(e)/t}if(e>1)throw new Error("invalid color: value > 1");if(e<0)throw new Error("invalid color: value < 0");return e}function gc(e){if(!Ne(e))throw new Error("invalid color: value is not a number");if((e=Ir(e))>1)throw new Error("invalid color: value > 1");if(e<0)throw new Error("invalid color: value < 0");return e}function mc(e,t="rgba"){if(!Ce(e))throw new Error("invalid colors array");let n=be(e,0,0),r=be(e,1,0),i=be(e,2,0),o=be(e,3,1);if(4!==or(t=t.split("")))throw new Error("tar.length !== 4");let a=be(t,0),s=be(t,1),l=be(t,2),c=be(t,3);return{[a]:n,[s]:r,[l]:i,[c]:o}}function yc(e){let t=(e=ia(e,1)).length;if(2===t)e=`${e}${e}${e}ff`;else if(3===t){let t=uc(e,0,1),n=uc(e,1,1),r=uc(e,2,1);e=`${t}${t}${n}${n}${r}${r}ff`}else if(6===t)e=`${e}ff`;else if(8!==t)throw new Error("invalid hex color");function n(e){if(2!==e.length)throw new Error("hex.length of color is not equal to 2");if(!Ne(e=parseInt(e,16)))throw new Error("invalid hex of color");return(e=Ir(e))/255}return{r:n(uc(e,0,2)),g:n(uc(e,2,2)),b:n(uc(e,4,2)),a:n(uc(e,6,2))}}function vc(e){return e=mc(e=bn(e,(e,t)=>t<=2?pc(e,255):3===t?gc(e):null),"rgba")}function Ac(e){return e=Sc(e=mc(e=bn(e,(e,t)=>0===t?hc(e):1===t||2===t?dc(e):3===t?gc(e):null),"hsla"))}function bc(e){return e=kc(e=mc(e=bn(e,(e,t)=>0===t?hc(e):1===t||2===t?dc(e):3===t?gc(e):null),"hsva"))}function wc(e){if("transparent"===e)return{r:0,g:0,b:0,a:0};if(function(e){return Me(fc,e)}(e))return yc(e=function(e){return`#${fc[e]}`}(e));if(function(e){return"#"===na(e,1)&&(!!/[0-9A-Fa-f]{2}/g.test(e)||(!!/[0-9A-Fa-f]{3}/g.test(e)||(!!/[0-9A-Fa-f]{6}/g.test(e)||!!/[0-9A-Fa-f]{8}/g.test(e))))}(e))return yc(e);if(function(e){return"rgb"===na(e,3)||"rgba"===na(e,4)}(e))return function(e){return e=cc(e,"rgba",""),e=cc(e,"rgb",""),vc(ta(e=cc(e=e.replace(/[()]/g,""),","," ")," "))}(e);if(function(e){return"hsl"===na(e,3)||"hsla"===na(e,4)}(e))return function(e){return e=cc(e,"hsla",""),e=cc(e,"hsl",""),Ac(ta(e=cc(e=e.replace(/[()]/g,""),","," ")," "))}(e);if(function(e){return"hsv"===na(e,3)||"hsva"===na(e,4)}(e))return function(e){return e=cc(e,"hsva",""),e=cc(e,"hsv",""),bc(ta(e=cc(e=e.replace(/[()]/g,""),","," ")," "))}(e);throw new Error("format of color string is not hex-color, name-color, rgba, hsla, hsva")}function Ic(e,t){return!!Me(e,t=ms(t))||!!Me(e,t=lc(t))}function xc(e,t,n){let r;return r=be(e,t,null),null!==r?r:(r=be(e,t=lc(t),null),null!==r?r:n)}function Cc(e){if(function(e){let t=Ic(e,"r"),n=Ic(e,"g"),r=Ic(e,"b");return t&&n&&r}(e))return function(e){let t=[xc(e,"r",null),xc(e,"g",null),xc(e,"b",null),xc(e,"a",1)];return t=bn(t,Ma),vc(t)}(e);if(function(e){let t=Ic(e,"h"),n=Ic(e,"s"),r=Ic(e,"l");return t&&n&&r}(e))return function(e){let t=[xc(e,"h",null),xc(e,"s",null),xc(e,"l",null),xc(e,"a",1)];return t=bn(t,Ma),Ac(t)}(e);if(function(e){let t=Ic(e,"h"),n=Ic(e,"s"),r=Ic(e,"v");return t&&n&&r}(e))return function(e){let t=[xc(e,"h",null),xc(e,"s",null),xc(e,"v",null),xc(e,"a",1)];return t=bn(t,Ma),bc(t)}(e);throw new Error("color object is not one of rgba, hsla, hsva")}function Ec(e){let t,n,r=e.r,i=e.g,o=e.b,a=Math.max(r,i,o),s=Math.min(r,i,o),l=(a+s)/2;if(a===s)t=n=0;else{let e=a-s;switch(n=l>.5?e/(2-a-s):e/(a+s),a){case r:t=(i-o)/e+(i<o?6:0);break;case i:t=(o-r)/e+2;break;case o:t=(r-i)/e+4}t/=6}return{h:t,s:n,l:l,a:e.a}}function Bc(e){let t,n,r=e.r,i=e.g,o=e.b,a=Math.max(r,i,o),s=Math.min(r,i,o),l=a,c=a-s;if(n=0===a?0:c/a,a===s)t=0;else{switch(a){case r:t=(i-o)/c+(i<o?6:0);break;case i:t=(o-r)/c+2;break;case o:t=(r-i)/c+4}t/=6}return{h:t,s:n,v:l,a:e.a}}function Sc(e){let t,n,r,i=e.h,o=e.s,a=e.l;function s(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0===o)t=n=r=a;else{let e=a<.5?a*(1+o):a+o-a*o,l=2*a-e;t=s(l,e,i+1/3),n=s(l,e,i),r=s(l,e,i-1/3)}return{r:t,g:n,b:r,a:e.a}}function kc(e){let t,n,r,i=e.h,o=e.s,a=e.v,s=Math.floor(6*i),l=6*i-s,c=a*(1-o),u=a*(1-l*o),f=a*(1-(1-l)*o);switch(s%6){case 0:t=a,n=f,r=c;break;case 1:t=u,n=a,r=c;break;case 2:t=c,n=a,r=f;break;case 3:t=c,n=u,r=a;break;case 4:t=f,n=c,r=a;break;case 5:t=a,n=c,r=u}return{r:t,g:n,b:r,a:e.a}}function Fc(e){let t=Math.round(255*e).toString(16);if(1===t.length)return`0${t}`;if(2===t.length)return t;throw new Error("invalid value")}function Dc(e,t=!0){let n=e.r,r=e.g,i=e.b,o=e.a,a=`${Fc(n)}${Fc(r)}${Fc(i)}`;return t&&(a=`${a}${Fc(o)}`),a}function Nc(e){return Math.min(1,Math.max(0,e))}function Mc(e,t){if(!ke(t))throw new Error("fmtOutput is not a string");if(!du[t])throw console.log(`fmtOutput must be [${ht(du)}]`),new Error("invalid fmtOutput");return e=du[t](e)}function Tc(e,t,n="toRgbString"){if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=Ec(e);return r.h+=t,r.h=r.h%1,Mc(Sc(r),n)}function Qc(e,t,n,r,i="toRgbString"){if(t<0||t>1)throw new Error("w1 < 0 or > 1");if(r<0||r>1)throw new Error("w1 < 0 or > 1");return Mc({r:e.r*t+n.r*r,g:e.g*t+n.g*r,b:e.b*t+n.b*r,a:e.a*t+n.a*r},i)}function Lc(e){return`${ji(100*e,1)}%`}function Rc(e){return ji(e,0)}function Uc(e){return ji(e,3)}function Hc(e){return{r:Rc(255*e.r),g:Rc(255*e.g),b:Rc(255*e.b)}}function Oc(e){return`rgb(${Rc(255*e.r)}, ${Rc(255*e.g)}, ${Rc(255*e.b)})`}function qc(e){return{r:Rc(255*e.r),g:Rc(255*e.g),b:Rc(255*e.b),a:Uc(e.a)}}function Pc(e){return`rgba(${Rc(255*e.r)}, ${Rc(255*e.g)}, ${Rc(255*e.b)}, ${Uc(e.a)})`}function $c(e){let t=Ec(e);return{h:Rc(360*t.h),s:Uc(t.s),l:Uc(t.l)}}function zc(e){let t=Ec(e);return`hsl(${Rc(360*t.h)}, ${Uc(t.s)}, ${Uc(t.l)})`}function jc(e){let t=Ec(e);return{h:Rc(360*t.h),s:Uc(t.s),l:Uc(t.l),a:Uc(t.a)}}function Vc(e){let t=Ec(e);return`hsla(${Rc(360*t.h)}, ${Uc(t.s)}, ${Uc(t.l)}, ${Uc(t.a)})`}function Yc(e){let t=Bc(e);return{h:Rc(360*t.h),s:Uc(t.s),v:Uc(t.v)}}function Wc(e){let t=Bc(e);return`hsv(${Rc(360*t.h)}, ${Uc(t.s)}, ${Uc(t.v)})`}function Gc(e){let t=Bc(e);return{h:Rc(360*t.h),s:Uc(t.s),v:Uc(t.v),a:Uc(t.a)}}function Jc(e){let t=Bc(e);return`hsva(${Rc(360*t.h)}, ${Uc(t.s)}, ${Uc(t.v)}, ${Uc(t.a)})`}function _c(e){return{r:Lc(e.r),g:Lc(e.g),b:Lc(e.b)}}function Xc(e){return`rgb(${Lc(e.r)}, ${Lc(e.g)}, ${Lc(e.b)})`}function Kc(e){return{r:Lc(e.r),g:Lc(e.g),b:Lc(e.b),a:Uc(e.a)}}function Zc(e){return`rgba(${Lc(e.r)}, ${Lc(e.g)}, ${Lc(e.b)}, ${Uc(e.a)})`}function eu(e){let t=Ec(e);return{h:Rc(360*t.h),s:Lc(t.s),l:Lc(t.l)}}function tu(e){let t=Ec(e);return`hsl(${Rc(360*t.h)}, ${Lc(t.s)}, ${Lc(t.l)})`}function nu(e){let t=Ec(e);return{h:Rc(360*t.h),s:Lc(t.s),l:Lc(t.l),a:Uc(t.a)}}function ru(e){let t=Ec(e);return`hsla(${Rc(360*t.h)}, ${Lc(t.s)}, ${Lc(t.l)}, ${Uc(t.a)})`}function iu(e){let t=Bc(e);return{h:Rc(360*t.h),s:Lc(t.s),v:Lc(t.v)}}function ou(e){let t=Bc(e);return`hsv(${Rc(360*t.h)}, ${Lc(t.s)}, ${Lc(t.v)})`}function au(e){let t=Bc(e);return{h:Rc(360*t.h),s:Lc(t.s),v:Lc(t.v),a:Uc(t.a)}}function su(e){let t=Bc(e);return`hsva(${Rc(360*t.h)}, ${Lc(t.s)}, ${Lc(t.v)}, ${Uc(t.a)})`}function lu(e){let t=function(e){return Dc(e,!1)}(e);return`#${t}`}function cu(e){return`#${Dc(e)}`}function uu(e){let t=null,n=null,r=null;if(ke(e))t=ms(Zo(e));else{if(!Be(e))throw console.log("color=",e),new Error("color is not a string or an object");n=e}if(null!==t)try{r=wc(t)}catch(e){throw console.log(e),new Error(`can not parse color: ${t}`)}else if(null!==n)try{r=Cc(n)}catch(e){throw console.log(e),new Error(`can not parse color: ${JSON.stringify(n)}`)}return r}function fu(e){if(!Be(e))return console.log("gradient is not an effective object"),e=>`rgb(${255*(e=Math.min(Math.max(e,0),1))},${255*e},${255*e})`;let t=[];return vn(e,(e,n)=>{t.push([Ir(n),qc(uu(e)),e])}),t=Da(t,0),function(e){let n=null;for(let r=1;r<t.length;r++){let i=t[r-1][0],o=t[r-1][1],a=t[r][0],s=t[r][1];if(i<=e&&a>=e){let t=(a-e)/(a-i),r=(e-i)/(a-i);n=Qc(uu(o),t,uu(s),r,"toRgbaString");break}}return n}}let du={toRgb:Hc,toRgbString:Oc,toRgba:qc,toRgbaString:Pc,toHsl:$c,toHslString:zc,toHsla:jc,toHslaString:Vc,toHsv:Yc,toHsvString:Wc,toHsva:Gc,toHsvaString:Jc,toRgbP:_c,toRgbPString:Xc,toRgbaP:Kc,toRgbaPString:Zc,toHslP:eu,toHslPString:tu,toHslaP:nu,toHslaPString:ru,toHsvP:iu,toHsvPString:ou,toHsvaP:au,toHsvaPString:su,toHexString:lu,toHex8String:cu};var hu=function(){let e={toRgb:e=>Hc(uu(e)),toRgbString:e=>Oc(uu(e)),toRgba:e=>qc(uu(e)),toRgbaString:e=>Pc(uu(e)),toHsl:e=>$c(uu(e)),toHslString:e=>zc(uu(e)),toHsla:e=>jc(uu(e)),toHslaString:e=>Vc(uu(e)),toHsv:e=>Yc(uu(e)),toHsvString:e=>Wc(uu(e)),toHsva:e=>Gc(uu(e)),toHsvaString:e=>Jc(uu(e)),toRgbP:e=>_c(uu(e)),toRgbPString:e=>Xc(uu(e)),toRgbaP:e=>Kc(uu(e)),toRgbaPString:e=>Zc(uu(e)),toHslP:e=>eu(uu(e)),toHslPString:e=>tu(uu(e)),toHslaP:e=>nu(uu(e)),toHslaPString:e=>ru(uu(e)),toHsvP:e=>iu(uu(e)),toHsvPString:e=>ou(uu(e)),toHsvaP:e=>au(uu(e)),toHsvaPString:e=>su(uu(e)),toHexString:e=>lu(uu(e)),toHex8String:e=>cu(uu(e)),modSaturate:(e,t,n)=>function(e,t,n="toRgbString"){if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=Ec(e);return r.s+=t,r.s=Nc(r.s),Mc(Sc(r),n)}(uu(e),t,n),modGrey:(e,t)=>function(e,t="toRgbString"){let n=Ec(e);return n.s=0,Mc(Sc(n),t)}(uu(e),t),modLighten:(e,t,n)=>function(e,t,n="toRgbString"){if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=Ec(e);return r.l+=t,r.l=Nc(r.l),Mc(Sc(r),n)}(uu(e),t,n),modBrighten:(e,t,n)=>function(e,t,n="toRgbString"){if(t<0||t>1)throw new Error("amount < 0 or > 1");return e.r+=t,e.r=Nc(e.r),e.g+=t,e.g=Nc(e.g),e.b+=t,e.b=Nc(e.b),Mc(e,n)}(uu(e),t,n),modHue:(e,t,n)=>Tc(uu(e),t,n),modComplement:(e,t)=>function(e,t="toRgbString"){return Tc(e,.5,t)}(uu(e),t),spreadHue:(e,t,n)=>function(e,t,n="toRgbString"){if(!xr(t))throw new Error("num is not an integer");if((t=Vi(t))<=1)return[e];let r=Ec(e),i=1/t,o=[];for(let e=0;e<t;e++)o.push(Mc(Sc(r),n)),r.h+=i,r.h=r.h%1;return o}(uu(e),t,n),spreadMonochromatic:(e,t,n)=>function(e,t,n="toRgbString"){if(!xr(t))throw new Error("num is not an integer");if((t=Vi(t))<=1)return[e];let r=Bc(e);r.s=1,r.l=1;let i=1/t,o=[];for(let e=0;e<t;e++)o.push(Mc(kc(r),n)),r.h-=i,r.l-=i;return o}(uu(e),t,n),mix:(e,t,n,r,i)=>Qc(uu(e),t,uu(n),r,i),getBrightness:e=>function(e){if(1!==e.a)throw new Error("alpha of color can not be equal to 1");return(299*e.r+587*e.g+114*e.b)/1e3}(uu(e)),getLuminance:e=>function(e){if(1!==e.a)throw new Error("alpha of color can not be equal to 1");let t,n,r,i=e.r,o=e.g,a=e.b;return t=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),n=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),r=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r}(uu(e)),interp:fu};return e}();function pu(e,t,n){return null==e?e:function(e,t,n,r){if(!L(e))return e;for(var i=-1,o=(t=ye(t,e)).length,a=o-1,s=e;null!=s&&++i<o;){var l=ve(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=a){var u=s[l];void 0===(c=r?r(u,l,s):void 0)&&(c=L(u)?u:Ge(t[i+1])?[]:{})}ni(s,l,c),s=s[l]}return e}(e,t,n)}var gu=Function.prototype,mu=Object.prototype,yu=gu.toString,vu=mu.hasOwnProperty,Au=yu.call(Object);function bu(e){if(!D(e)||"[object Object]"!=F(e))return!1;var t=di(e);if(null===t)return!0;var n=vu.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&yu.call(n)==Au}function wu(e){return bu(e)?void 0:e}var Iu=ho(function(e,t){var n={};if(null==e)return n;var r=!1;t=de(t,function(t){return t=ye(t,e),r||(r=t.length>1),t}),ri(e,pi(e),n),r&&(n=Ti(n,7,wu));for(var i=t.length;i--;)Ia(n,t[i]);return n}),xu=Iu;function Cu(e,t={}){let n="$level",r="$parents";if(!Mn(e))return[];let i=be(t,"bindKey",null);ke(i)||(i="id");let o=be(t,"bindParent",null);ke(o)||(o="parentId");let a=be(t,"bindChildren",null);ke(a)||(a="children");let s=be(t,"saveExtProps",null);we(s)||(s=!1),e=function(e){let t=[];function a(a){let s=[];vn(e,(e,l)=>{let c=be(e,o),u=be(a,i);if(c&&u&&c===u){let o=be(a,r,[]);o=Qi(o),o.push(a[i]),t.push({[n]:a[n]+1,[r]:o,...e})}else s.push(e)}),e=s}if(e=Qi(e),function(){let i=[];vn(e,(e,a)=>{Nn(e[o])?t.push({[n]:0,[r]:[],...e}):i.push(e)}),e=i}(),0===t.length)return t;let s=-1;for(;s+=1,!(s>t.length-1);){if(a(t[s]),0===e.length)break}return t}(e);let l=function(e){let t=[];function l(e){return s?e:xu(e,[n,r])}let c={};return vn(e,(r,s)=>{if(0===r[n]){let e=l(r);t.push(e),c[r[i]]=[s]}else{let n=function(t){for(let n=0;n<e.length;n++){let r=e[n];if(t[o]===r[i])return r}return null}(r);if(null!==n){let e=c[n[i]];e=[...e,a];let o=be(t,e,[]),s=l(r);o.push(s),c[r[i]]=[...e,o.length-1],pu(t,e,o)}else console.log(`can not find parent for ${be(r,o)}`)}}),t}(e);return l}function Eu(e,t=null,n={}){Oi(t)||(t=e=>e);let r=be(n,"force",!1);return we(r)||(r=!1),function(e,t,n=!1){let r=[];if(!Ce(e)&&!Ee(e))return t(e,null,[]);function i(e){if(Ce(e))return Ki(or(e));if(Ee(e)){let t=Object.getOwnPropertyNames(e),r=null;return n&&(r=Object.getOwnPropertySymbols(e)),Ce(t)||(t=[]),Ce(r)||(r=[]),[...t,...r]}return e}return function e(n,o){if(Ce(n))return i(n).map(i=>{let o=n[i],a=Qi(r);return r.push(i),o=t(o,i,a),o=e(o),r.pop(),o});if(Ee(n)){let o=i(n),a={};return o.map(i=>{let o=n[i],s=Qi(r);r.push(i),o=t(o,i,s),o=e(o),r.pop(),a[i]=o}),a}return n}(e)}(e,t,r)}function Bu(e,t={}){if(!Be(e)&&!Mn(e))return[];let n=be(t,"bindKey",null);ke(n)||(n="id");let r=be(t,"bindParent",null);ke(r)||(r="parentId");let i=be(t,"bindBelong",null);ke(i)||(i="key");let o=be(t,"bindText",null);ke(o)||(o="text");let a=be(t,"bindType",null);ke(a)||(a="type");let s=be(t,"bindNumOfChilren",null);function l(e,t){return e=bn(e=Qi(e),e=>N(e)?Ma(e):e),N(t)&&(t=Ma(t)),(ke(t)||Ne(t))&&e.push(t),vo(e,"-")}ke(s)||(s="numOfChilren");let c=[];return Eu(e,(e,t,u)=>{let f=l(u,t),d=l(u,null),h="node";Ee(e)?h="object":Ce(e)&&(h="array");let p={[n]:f,[r]:d,[a]:h};if((ke(t)||ua(t))&&(p[i]=t),Ee(e)||Ce(e)||(p[o]=e),Ee(e)||Ce(e)){let t=null;Ee(e)?t=or(ht(e)):Ce(e)&&(t=or(e)),p[s]=t}return c.push(p),e},{force:!0}),c}function Su(e){return D(t=e)&&1===t.nodeType&&!bu(t);var t}function ku(e){if(!Su(e))return"invalid element";let t=!1;try{t=document.activeElement===e}catch(e){console.log(e)}return t}function Fu(e){return Ne(e)?(e=Ir(e),Math.cos(e*Math.PI/180)):null}function Du(e){return Ne(e)?(e=Ir(e),Math.tan(e*Math.PI/180)):null}function Nu(){return{sheets:[]}}function Mu(e){return Ne(e)?(e=Ir(e),Math.sin(e*Math.PI/180)):null}function Tu(e){if(!ke(e))return!1;let n="YYYY-MM-DD";return e===t(e,n).format(n)}function Qu(e=300){return new function(e){let t=[],n=null,r=Date.now();return Yi(e)||(e=300),e=Vi(e),function(i,...o){Oi(i)?(r=Date.now(),t.push({func:i,input:o}),null===n&&(n=setInterval(()=>{if(0===or(t))return clearInterval(n),void(n=null);if(Date.now()-r>e){let e=t.pop();t=[];try{e.func(...e.input)}catch(e){console.log("m.func catch",e)}}},10))):console.log("func is not a function")}}(e)}let Lu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Ru=Lu.length;function Uu(e=32){let t=[];e=Yi(e)?Vi(e):32;for(let n=0;n<e;n++)t[n]=Lu[0|Math.random()*Ru];return t.join("")}function Hu(e,t={}){if(!Su(e))return;let n=be(t,"duration",500);n=Ir(n),n<0&&(n=1e3);let r=be(t,"delay",0);r=Ir(r),r<0&&(r=0);let i=be(t,"opacityIni",0);i=Ir(i),i=Math.min(Math.max(i,0),1),Ne(e.style.opacity)&&(i=Ir(e.style.opacity));let o=10/n,a=`tag-${Uu()}`;e.setAttribute("dom-fade-tag",a),setTimeout(()=>{let t=setInterval(()=>{try{e.getAttribute("dom-fade-tag")!==a&&clearInterval(t),e.style.opacity=i,i>=1&&(clearInterval(t),e.removeAttribute("dom-fade-tag")),i+=o,i>1&&(i=1)}catch(e){console.log(e),clearInterval(t)}},10)},r)}function Ou(e,t={}){if(!Su(e))return;let n=be(t,"duration",500);n=Ir(n),n<0&&(n=1e3);let r=be(t,"delay",0);r=Ir(r),r<0&&(r=0);let i=be(t,"opacityIni",1);i=Ir(i),i=Math.min(Math.max(i,0),1),Ne(e.style.opacity)&&(i=Ir(e.style.opacity));let o=10/n,a=`tag-${Uu()}`;e.setAttribute("dom-fade-tag",a),setTimeout(()=>{let t=setInterval(()=>{try{e.getAttribute("dom-fade-tag")!==a&&clearInterval(t),e.style.opacity=i,i<=0&&(clearInterval(t),e.removeAttribute("dom-fade-tag")),i-=o,i<0&&(i=0)}catch(e){console.log(e),clearInterval(t)}},10)},r)}let qu='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 512.001 512.001" style="width:12px; height:12px; enable-background:new 0 0 512.001 512.001;" xml:space="preserve"><g><g><path d="M284.286,256.002L506.143,34.144c7.811-7.811,7.811-20.475,0-28.285c-7.811-7.81-20.475-7.811-28.285,0L256,227.717L34.143,5.859c-7.811-7.811-20.475-7.811-28.285,0c-7.81,7.811-7.811,20.475,0,28.285l221.857,221.857L5.858,477.859c-7.811,7.811-7.811,20.475,0,28.285c3.905,3.905,9.024,5.857,14.143,5.857c5.119,0,10.237-1.952,14.143-5.857L256,284.287l221.857,221.857c3.905,3.905,9.024,5.857,14.143,5.857s10.237-1.952,14.143-5.857c7.811-7.811,7.811-20.475,0-28.285L284.286,256.002z"/></g></g></svg>',Pu={success:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 426.667 426.667" style="width:24px; height:24px; enable-background:new 0 0 426.667 426.667" xml:space="preserve"><path style="fill:#6ac259" d="M213.333,0C95.518,0,0,95.514,0,213.333s95.518,213.333,213.333,213.333 c117.828,0,213.333-95.514,213.333-213.333S331.157,0,213.333,0z M174.199,322.918l-93.935-93.931l31.309-31.309l62.626,62.622 l140.894-140.898l31.309,31.309L174.199,322.918z"/></svg>',error:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 496.158 496.158" style="width:24px; height:24px; enable-background:new 0 0 496.158 496.158" xml:space="preserve"><path style="fill:#e04f5f" d="M496.158,248.085c0-137.021-111.07-248.082-248.076-248.082C111.07,0.003,0,111.063,0,248.085 c0,137.002,111.07,248.07,248.082,248.07C385.088,496.155,496.158,385.087,496.158,248.085z"/><path style="fill:#fff" d="M277.042,248.082l72.528-84.196c7.91-9.182,6.876-23.041-2.31-30.951 c-9.172-7.904-23.032-6.876-30.947,2.306l-68.236,79.212l-68.229-79.212c-7.91-9.188-21.771-10.216-30.954-2.306 c-9.186,7.91-10.214,21.77-2.304,30.951l72.522,84.196l-72.522,84.192c-7.91,9.182-6.882,23.041,2.304,30.951 c4.143,3.569,9.241,5.318,14.316,5.318c6.161,0,12.294-2.586,16.638-7.624l68.229-79.212l68.236,79.212 c4.338,5.041,10.47,7.624,16.637,7.624c5.069,0,10.168-1.749,14.311-5.318c9.186-7.91,10.22-21.77,2.31-30.951L277.042,248.082z"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 497.472 497.472" style="width:24px; height:24px; enable-background:new 0 0 497.472 497.472" xml:space="preserve"><g transform="matrix(1.25 0 0 -1.25 0 45)"><path style="fill:#ffcc4d" d="M24.374-357.857c-20.958,0-30.197,15.223-20.548,33.826L181.421,17.928 c9.648,18.603,25.463,18.603,35.123,0L394.14-324.031c9.671-18.603,0.421-33.826-20.548-33.826H24.374z"/><path style="fill:#231f20" d="M173.605-80.922c0,14.814,10.934,23.984,25.395,23.984c14.12,0,25.407-9.512,25.407-23.984 V-216.75c0-14.461-11.287-23.984-25.407-23.984c-14.461,0-25.395,9.182-25.395,23.984V-80.922z M171.489-289.056 c0,15.167,12.345,27.511,27.511,27.511c15.167,0,27.523-12.345,27.523-27.511c0-15.178-12.356-27.523-27.523-27.523 C183.834-316.579,171.489-304.234,171.489-289.056"/></g></svg>',infor:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 496.16 496.16" style="width:24px; height:24px; enable-background:new 0 0 496.158 496.158;" xml:space="preserve"><path d="m496.16 248.08c0-137.02-111.07-248.08-248.08-248.08-137.01 0-248.08 111.06-248.08 248.08 0 137 111.07 248.07 248.08 248.07 137.01 0 248.08-111.07 248.08-248.07z" fill="#25B7D3"/><g fill="#fff"><path d="m315.25 359.56c-1.387-2.032-4.048-2.755-6.27-1.702-24.582 11.637-52.482 23.94-57.958 25.015-0.138-0.123-0.357-0.348-0.644-0.737-0.742-1.005-1.103-2.318-1.103-4.015 0-13.905 10.495-56.205 31.192-125.72 17.451-58.406 19.469-70.499 19.469-74.514 0-6.198-2.373-11.435-6.865-15.146-4.267-3.519-10.229-5.302-17.719-5.302-12.459 0-26.899 4.73-44.146 14.461-16.713 9.433-35.352 25.41-55.396 47.487-1.569 1.729-1.733 4.314-0.395 6.228 1.34 1.915 3.825 2.644 5.986 1.764 7.037-2.872 42.402-17.359 47.557-20.597 4.221-2.646 7.875-3.989 10.861-3.989 0.107 0 0.199 4e-3 0.276 0.01 0.036 0.198 0.07 0.5 0.07 0.933 0 3.047-0.627 6.654-1.856 10.703-30.136 97.641-44.785 157.5-44.785 182.99 0 8.998 2.501 16.242 7.432 21.528 5.025 5.393 11.803 8.127 20.146 8.127 8.891 0 19.712-3.714 33.08-11.354 12.936-7.392 32.68-23.653 60.363-49.717 1.793-1.687 2.092-4.426 0.705-6.458z"/><path d="m314.28 76.672c-4.925-5.041-11.227-7.597-18.729-7.597-9.34 0-17.475 3.691-24.176 10.971-6.594 7.16-9.938 15.946-9.938 26.113 0 8.033 2.463 14.69 7.32 19.785 4.922 5.172 11.139 7.794 18.476 7.794 8.958 0 17.049-3.898 24.047-11.586 6.876-7.553 10.363-16.433 10.363-26.393 1e-3 -7.654-2.476-14.075-7.363-19.087z"/></g></svg>',cancel:qu},$u={},zu=null,ju=tc();function Vu(){vn(["top-right","top-left","bottom-right","bottom-left"],e=>{!function(e){let t=aa($u,{position:e});t=Da(t,"timeStart");let n=16;vn(t,e=>{$u[e.id].ele||($u[e.id].ele=document.querySelector(`#${e.id}`)),$u[e.id].loc.top=n,$u[e.id].loc.height=$u[e.id].ele.offsetHeight,n+=$u[e.id].loc.height+16}),vn(t,t=>{e.indexOf("bottom-")>=0?($u[t.id].ele.style.bottom=`${$u[t.id].loc.top}px`,$u[t.id].loc.bottom=$u[t.id].loc.top):$u[t.id].ele.style.top=`${$u[t.id].loc.top}px`,e.indexOf("-left")>=0?($u[t.id].ele.style.left="16px",$u[t.id].loc.left=16):($u[t.id].ele.style.right="16px",$u[t.id].loc.right=16),$u[t.id].ele.style.zIndex=2e5,$u[t.id].ele.style.opacity=1,$u[t.id].ele.style.transform="",$u[t.id].ele.style.transform=null})}(e)})}function Yu(e){$u[e].ele&&$u[e].ele.parentNode.removeChild($u[e].ele),$u[e]&&delete $u[e],Vu()}function Wu(e,t){if(!Su(e))return"invalid eleParent";if(Se(t))e.insertAdjacentHTML("beforeend",t);else{if(!Su(t))return"invalid itemChild";e.appendChild(t)}}function Gu(){return null!==navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)}function Ju(e){if(!e)return"invalid event";if(!e.cancelable)return"event is not cancelable";try{Gu()?e.cancelBubble=!0:e.stopPropagation(),e.preventDefault()}catch(e){}}var _u;ju.ttWAlertCancel=function(e){Yu(e)},ju.ttWAlertFadeIn=function(e){Hu(document.querySelector(`#${e}`))},ju.ttWAlertFadeOut=function(e){Ou(document.querySelector(`#${e}`))},function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"}(_u||(_u={}));var Xu;!function(e){e.AUTO="auto",e.DARK="dark",e.LIGHT="light"}(Xu||(Xu={}));const Ku=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function Zu(e){return e?e.replace(/\\/g,"/"):e}function ef(e){const t=e.length;let n=-1/0;for(let r=0;r<t;r++)n=Math.max(n,e[r]);return n}function tf(e,t){const n=e.split(".");return n.length>1?n[n.length-1]:t}function nf(e,t){return t.reduce((t,n)=>t||e.startsWith(n),!1)}const rf=["a/","b/","i/","w/","c/","o/"];function of(e,t,n){const r=void 0!==n?[...rf,n]:rf,i=t?new RegExp(`^${o=t,o.replace(Ku,"\\$&")} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$');var o;const[,a=""]=i.exec(e)||[],s=r.find(e=>0===a.indexOf(e));return(s?a.slice(s.length):a).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function af(e,t={}){const n=[];let r=null,i=null,o=null,a=null,s=null,l=null,c=null;const u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,p=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,m=/^new file mode (\d{6})/,y=/^copy from "?(.+)"?/,v=/^copy to "?(.+)"?/,A=/^rename from "?(.+)"?/,b=/^rename to "?(.+)"?/,w=/^similarity index (\d+)%/,I=/^dissimilarity index (\d+)%/,x=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,C=/^Binary files (.*) and (.*) differ/,E=/^GIT binary patch/,B=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,S=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,k=/^new file mode (\d{6})/,F=/^deleted file mode (\d{6}),(\d{6})/,D=e.replace(/\/g,"").replace(/\r\n?/g,"\n").split("\n");function N(){null!==i&&null!==r&&(r.blocks.push(i),i=null)}function M(){null!==r&&(r.oldName||null===l||(r.oldName=l),r.newName||null===c||(r.newName=c),r.newName&&(n.push(r),r=null)),l=null,c=null}function T(){N(),M(),r={blocks:[],deletedLines:0,addedLines:0}}function Q(e){let t;N(),null!==r&&((t=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(e))?(r.isCombined=!1,o=parseInt(t[1],10),s=parseInt(t[2],10)):(t=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(e))?(r.isCombined=!0,o=parseInt(t[1],10),a=parseInt(t[2],10),s=parseInt(t[3],10)):(e.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),o=0,s=0,r.isCombined=!1)),i={lines:[],oldStartLine:o,oldStartLine2:a,newStartLine:s,header:e}}return D.forEach((e,a)=>{if(!e||e.startsWith("*"))return;let N;const M=D[a-1],L=D[a+1],R=D[a+2];if(e.startsWith("diff --git")||e.startsWith("diff --combined")){T();if((N=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(e))&&(l=of(N[1],void 0,t.dstPrefix),c=of(N[2],void 0,t.srcPrefix)),null===r)throw new Error("Where is my file !!!");return void(r.isGitDiff=!0)}if(e.startsWith("Binary files")&&!(null==r?void 0:r.isGitDiff)){T();if((N=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(e))&&(l=of(N[1],void 0,t.dstPrefix),c=of(N[2],void 0,t.srcPrefix)),null===r)throw new Error("Where is my file !!!");return void(r.isBinary=!0)}if((!r||!r.isGitDiff&&r&&e.startsWith(u)&&L.startsWith(f)&&R.startsWith(d))&&T(),null==r?void 0:r.isTooBig)return;if(r&&("number"==typeof t.diffMaxChanges&&r.addedLines+r.deletedLines>t.diffMaxChanges||"number"==typeof t.diffMaxLineLength&&e.length>t.diffMaxLineLength)){r.isTooBig=!0,r.addedLines=0,r.deletedLines=0,r.blocks=[],i=null;return void Q("function"==typeof t.diffTooBigMessage?t.diffTooBigMessage(n.length):"Diff too big to be displayed")}if(e.startsWith(u)&&L.startsWith(f)||e.startsWith(f)&&M.startsWith(u)){if(r&&!r.oldName&&e.startsWith("--- ")&&(N=function(e,t){return of(e,"---",t)}(e,t.srcPrefix)))return r.oldName=N,void(r.language=tf(r.oldName,r.language));if(r&&!r.newName&&e.startsWith("+++ ")&&(N=function(e,t){return of(e,"+++",t)}(e,t.dstPrefix)))return r.newName=N,void(r.language=tf(r.newName,r.language))}if(r&&(e.startsWith(d)||r.isGitDiff&&r.oldName&&r.newName&&!i))return void Q(e);if(i&&(e.startsWith("+")||e.startsWith("-")||e.startsWith(" ")))return void function(e){if(null===r||null===i||null===o||null===s)return;const t={content:e},n=r.isCombined?["+ "," +","++"]:["+"],a=r.isCombined?["- "," -","--"]:["-"];nf(e,n)?(r.addedLines++,t.type=_u.INSERT,t.oldNumber=void 0,t.newNumber=s++):nf(e,a)?(r.deletedLines++,t.type=_u.DELETE,t.oldNumber=o++,t.newNumber=void 0):(t.type=_u.CONTEXT,t.oldNumber=o++,t.newNumber=s++),i.lines.push(t)}(e);const U=!function(e,t){let n=t;for(;n<D.length-3;){if(e.startsWith("diff"))return!1;if(D[n].startsWith(u)&&D[n+1].startsWith(f)&&D[n+2].startsWith(d))return!0;n++}return!1}(e,a);if(null===r)throw new Error("Where is my file !!!");(N=h.exec(e))?r.oldMode=N[1]:(N=p.exec(e))?r.newMode=N[1]:(N=g.exec(e))?(r.deletedFileMode=N[1],r.isDeleted=!0):(N=m.exec(e))?(r.newFileMode=N[1],r.isNew=!0):(N=y.exec(e))?(U&&(r.oldName=N[1]),r.isCopy=!0):(N=v.exec(e))?(U&&(r.newName=N[1]),r.isCopy=!0):(N=A.exec(e))?(U&&(r.oldName=N[1]),r.isRename=!0):(N=b.exec(e))?(U&&(r.newName=N[1]),r.isRename=!0):(N=C.exec(e))?(r.isBinary=!0,r.oldName=of(N[1],void 0,t.srcPrefix),r.newName=of(N[2],void 0,t.dstPrefix),Q("Binary file")):E.test(e)?(r.isBinary=!0,Q(e)):(N=w.exec(e))?r.unchangedPercentage=parseInt(N[1],10):(N=I.exec(e))?r.changedPercentage=parseInt(N[1],10):(N=x.exec(e))?(r.checksumBefore=N[1],r.checksumAfter=N[2],N[3]&&(r.mode=N[3])):(N=B.exec(e))?(r.checksumBefore=[N[2],N[3]],r.checksumAfter=N[1]):(N=S.exec(e))?(r.oldMode=[N[2],N[3]],r.newMode=N[1]):(N=k.exec(e))?(r.newFileMode=N[1],r.isNew=!0):(N=F.exec(e))&&(r.deletedFileMode=N[1],r.isDeleted=!0)}),N(),M(),n}class sf{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);const i=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,s,n,r)}diffWithOptionsObj(e,t,n,r){var i;const o=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),a=t.length,s=e.length;let l=1,c=a+s;null!=n.maxEditLength&&(c=Math.min(c,n.maxEditLength));const u=null!==(i=n.timeout)&&void 0!==i?i:1/0,f=Date.now()+u,d=[{oldPos:-1,lastComponent:void 0}];let h=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=s&&h+1>=a)return o(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,g=1/0;const m=()=>{for(let r=Math.max(p,-l);r<=Math.min(g,l);r+=2){let i;const l=d[r-1],c=d[r+1];l&&(d[r-1]=void 0);let u=!1;if(c){const e=c.oldPos-r;u=c&&0<=e&&e<a}const f=l&&l.oldPos+1<s;if(u||f){if(i=!f||u&&l.oldPos<c.oldPos?this.addToPath(c,!0,!1,0,n):this.addToPath(l,!1,!0,1,n),h=this.extractCommon(i,t,e,r,n),i.oldPos+1>=s&&h+1>=a)return o(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=s&&(g=Math.min(g,r-1)),h+1>=a&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>c||Date.now()>f)return r(void 0);m()||e()},0)}();else for(;l<=c&&Date.now()<=f;){const e=m();if(e)return e}}addToPath(e,t,n,r,i){const o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,r,i){const o=t.length,a=n.length;let s=e.oldPos,l=s-r,c=0;for(;l+1<o&&s+1<a&&this.equals(n[s+1],t[l+1],i);)l++,s++,c++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!i.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){const r=[];let i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();const o=r.length;let a=0,s=0,l=0;for(;a<o;a++){const e=r[a];if(e.removed)e.value=this.join(n.slice(l,l+e.count)),l+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){const r=n[l+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(l+=e.count)}}return r}}const lf=new class extends sf{};const cf="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";const uf=new class extends sf{tokenize(e){const t=new RegExp(`(\\r?\\n)|[${cf}]+|[^\\S\\n\\r]+|[^${cf}]`,"ug");return e.match(t)||[]}};function ff(e){return(t,n)=>{const r=e(t).trim(),i=e(n).trim();return function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;const n=[];let r,i;for(r=0;r<=t.length;r++)n[r]=[r];for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]}(r,i)/(r.length+i.length)}}function df(e){return function t(n,r,i=0,o=new Map){const a=function(t,n,r=new Map){let i,o=1/0;for(let a=0;a<t.length;++a)for(let s=0;s<n.length;++s){const l=JSON.stringify([t[a],n[s]]);let c;r.has(l)&&(c=r.get(l))||(c=e(t[a],n[s]),r.set(l,c)),c<o&&(o=c,i={indexA:a,indexB:s,score:o})}return i}(n,r,o);if(!a||n.length+r.length<3)return[[n,r]];const s=n.slice(0,a.indexA),l=r.slice(0,a.indexB),c=[n[a.indexA]],u=[r[a.indexB]],f=a.indexA+1,d=a.indexB+1,h=n.slice(f),p=r.slice(d),g=t(s,l,i+1,o),m=t(c,u,i+1,o),y=t(h,p,i+1,o);let v=m;return(a.indexA>0||a.indexB>0)&&(v=g.concat(v)),(n.length>f||r.length>d)&&(v=v.concat(y)),v}}const hf={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},pf={matching:"none",matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:"word",colorScheme:Xu.LIGHT},gf="/",mf=ff(e=>e.value),yf=df(mf);function vf(e){return-1!==e.indexOf("dev/null")}function Af(e){return e.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function bf(e){switch(e){case _u.CONTEXT:return hf.CONTEXT;case _u.INSERT:return hf.INSERTS;case _u.DELETE:return hf.DELETES}}function wf(e){switch(e){case Xu.DARK:return"d2h-dark-color-scheme";case Xu.AUTO:return"d2h-auto-color-scheme";case Xu.LIGHT:default:return"d2h-light-color-scheme"}}function If(e){return e.slice(0).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function xf(e,t,n=!0){const r=function(e){return e?2:1}(t);return{prefix:e.substring(0,r),content:n?If(e.substring(r)):e.substring(r)}}function Cf(e){const t=Zu(e.oldName),n=Zu(e.newName);if(t===n||vf(t)||vf(n))return vf(n)?t:n;{const e=[],r=[],i=t.split(gf),o=n.split(gf);let a=0,s=i.length-1,l=o.length-1;for(;a<s&&a<l&&i[a]===o[a];)e.push(o[a]),a+=1;for(;s>a&&l>a&&i[s]===o[l];)r.unshift(o[l]),s-=1,l-=1;const c=e.join(gf),u=r.join(gf),f=i.slice(a,s+1).join(gf),d=o.slice(a,l+1).join(gf);return c.length&&u.length?c+gf+"{"+f+" → "+d+"}"+gf+u:c.length?c+gf+"{"+f+" → "+d+"}":u.length?"{"+f+" → "+d+"}"+gf+u:t+" → "+n}}function Ef(e){return`d2h-${function(e){let t,n,r,i=0;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i|=0;return i}(Cf(e)).toString().slice(-6)}`}function Bf(e){let t="file-changed";return e.isRename||e.isCopy?t="file-renamed":e.isNew?t="file-added":e.isDeleted?t="file-deleted":e.newName!==e.oldName&&(t="file-renamed"),t}function Sf(e,t,n,r={}){const{matching:i,maxLineLengthHighlight:o,matchWordsThreshold:a,diffStyle:s}=Object.assign(Object.assign({},pf),r),l=xf(e,n,!1),c=xf(t,n,!1);if(l.content.length>o||c.content.length>o)return{oldLine:{prefix:l.prefix,content:If(l.content)},newLine:{prefix:c.prefix,content:If(c.content)}};const u="char"===s?(f=l.content,d=c.content,lf.diff(f,d,h)):function(e,t,n){return uf.diff(e,t,n)}(l.content,c.content);var f,d,h;const p=[];if("word"===s&&"words"===i){const e=u.filter(e=>e.removed),t=u.filter(e=>e.added);yf(t,e).forEach(e=>{if(1===e[0].length&&1===e[1].length){mf(e[0][0],e[1][0])<a&&(p.push(e[0][0]),p.push(e[1][0]))}})}const g=u.reduce((e,t)=>{const n=t.added?"ins":t.removed?"del":null,r=p.indexOf(t)>-1?' class="d2h-change"':"",i=If(t.value);return null!==n?`${e}<${n}${r}>${i}</${n}>`:`${e}${i}`},"");return{oldLine:{prefix:l.prefix,content:(m=g,m.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,""))},newLine:{prefix:c.prefix,content:Af(g)}};var m}const kf="file-summary",Ff={colorScheme:pf.colorScheme};class Df{constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Ff),t)}render(e){const t=e.map(e=>this.hoganUtils.render(kf,"line",{fileHtmlId:Ef(e),oldName:e.oldName,newName:e.newName,fileName:Cf(e),deletedLines:"-"+e.deletedLines,addedLines:"+"+e.addedLines},{fileIcon:this.hoganUtils.template("icon",Bf(e))})).join("\n");return this.hoganUtils.render(kf,"wrapper",{colorScheme:wf(this.config.colorScheme),filesNumber:e.length,files:t})}}const Nf=Object.assign(Object.assign({},pf),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Mf="generic",Tf="line-by-line";class Qf{constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Nf),t)}render(e){const t=e.map(e=>{let t;return t=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,t)}).join("\n");return this.hoganUtils.render(Mf,"wrapper",{colorScheme:wf(this.config.colorScheme),content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const n=this.hoganUtils.template(Tf,"file-diff"),r=this.hoganUtils.template(Mf,"file-path"),i=this.hoganUtils.template("icon","file"),o=this.hoganUtils.template("tag",Bf(e));return n.render({file:e,fileHtmlId:Ef(e),diffs:t,filePath:r.render({fileDiffName:Cf(e)},{fileIcon:i,fileTag:o})})}generateEmptyDiff(){return this.hoganUtils.render(Mf,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:hf})}generateFileHtml(e){const t=df(ff(t=>xf(t.content,e.isCombined).content));return e.blocks.map(n=>{let r=this.hoganUtils.render(Mf,"block-header",{CSSLineClass:hf,blockHeader:e.isTooBig?n.header:If(n.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(n).forEach(([n,i,o])=>{if(i.length&&o.length&&!n.length)this.applyRematchMatching(i,o,t).map(([t,n])=>{const{left:i,right:o}=this.processChangedLines(e,e.isCombined,t,n);r+=i,r+=o});else if(n.length)n.forEach(t=>{const{prefix:n,content:i}=xf(t.content,e.isCombined);r+=this.generateSingleLineHtml(e,{type:hf.CONTEXT,prefix:n,content:i,oldNumber:t.oldNumber,newNumber:t.newNumber})});else if(i.length||o.length){const{left:t,right:n}=this.processChangedLines(e,e.isCombined,i,o);r+=t,r+=n}else console.error("Unknown state reached while processing groups of lines",n,i,o)}),r}).join("\n")}applyLineGroupping(e){const t=[];let n=[],r=[];for(let i=0;i<e.lines.length;i++){const o=e.lines[i];(o.type!==_u.INSERT&&r.length||o.type===_u.CONTEXT&&n.length>0)&&(t.push([[],n,r]),n=[],r=[]),o.type===_u.CONTEXT?t.push([[o],[],[]]):o.type===_u.INSERT&&0===n.length?t.push([[],[],[o]]):o.type===_u.INSERT&&n.length>0?r.push(o):o.type===_u.DELETE&&n.push(o)}return(n.length||r.length)&&(t.push([[],n,r]),n=[],r=[]),t}applyRematchMatching(e,t,n){const r=e.length*t.length,i=ef(e.concat(t).map(e=>e.content.length));return r<this.config.matchingMaxComparisons&&i<this.config.maxLineSizeInBlockForComparison&&("lines"===this.config.matching||"words"===this.config.matching)?n(e,t):[[e,t]]}processChangedLines(e,t,n,r){const i={right:"",left:""},o=Math.max(n.length,r.length);for(let a=0;a<o;a++){const o=n[a],s=r[a],l=void 0!==o&&void 0!==s?Sf(o.content,s.content,t,this.config):void 0,c=void 0!==o&&void 0!==o.oldNumber?Object.assign(Object.assign({},void 0!==l?{prefix:l.oldLine.prefix,content:l.oldLine.content,type:hf.DELETE_CHANGES}:Object.assign(Object.assign({},xf(o.content,t)),{type:bf(o.type)})),{oldNumber:o.oldNumber,newNumber:o.newNumber}):void 0,u=void 0!==s&&void 0!==s.newNumber?Object.assign(Object.assign({},void 0!==l?{prefix:l.newLine.prefix,content:l.newLine.content,type:hf.INSERT_CHANGES}:Object.assign(Object.assign({},xf(s.content,t)),{type:bf(s.type)})),{oldNumber:s.oldNumber,newNumber:s.newNumber}):void 0,{left:f,right:d}=this.generateLineHtml(e,c,u);i.left+=f,i.right+=d}return i}generateLineHtml(e,t,n){return{left:this.generateSingleLineHtml(e,t),right:this.generateSingleLineHtml(e,n)}}generateSingleLineHtml(e,t){if(void 0===t)return"";const n=this.hoganUtils.render(Tf,"numbers",{oldNumber:t.oldNumber||"",newNumber:t.newNumber||""});return this.hoganUtils.render(Mf,"line",{type:t.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:" "===t.prefix?" ":t.prefix,content:t.content,lineNumber:n,line:t,file:e})}}const Lf=Object.assign(Object.assign({},pf),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Rf="generic";class Uf{constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Lf),t)}render(e){const t=e.map(e=>{let t;return t=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,t)}).join("\n");return this.hoganUtils.render(Rf,"wrapper",{colorScheme:wf(this.config.colorScheme),content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const n=this.hoganUtils.template("side-by-side","file-diff"),r=this.hoganUtils.template(Rf,"file-path"),i=this.hoganUtils.template("icon","file"),o=this.hoganUtils.template("tag",Bf(e));return n.render({file:e,fileHtmlId:Ef(e),diffs:t,filePath:r.render({fileDiffName:Cf(e)},{fileIcon:i,fileTag:o})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Rf,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:hf})}}generateFileHtml(e){const t=df(ff(t=>xf(t.content,e.isCombined).content));return e.blocks.map(n=>{const r={left:this.makeHeaderHtml(n.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(n).forEach(([n,i,o])=>{if(i.length&&o.length&&!n.length)this.applyRematchMatching(i,o,t).map(([t,n])=>{const{left:i,right:o}=this.processChangedLines(e.isCombined,t,n);r.left+=i,r.right+=o});else if(n.length)n.forEach(t=>{const{prefix:n,content:i}=xf(t.content,e.isCombined),{left:o,right:a}=this.generateLineHtml({type:hf.CONTEXT,prefix:n,content:i,number:t.oldNumber},{type:hf.CONTEXT,prefix:n,content:i,number:t.newNumber});r.left+=o,r.right+=a});else if(i.length||o.length){const{left:t,right:n}=this.processChangedLines(e.isCombined,i,o);r.left+=t,r.right+=n}else console.error("Unknown state reached while processing groups of lines",n,i,o)}),r}).reduce((e,t)=>({left:e.left+t.left,right:e.right+t.right}),{left:"",right:""})}applyLineGroupping(e){const t=[];let n=[],r=[];for(let i=0;i<e.lines.length;i++){const o=e.lines[i];(o.type!==_u.INSERT&&r.length||o.type===_u.CONTEXT&&n.length>0)&&(t.push([[],n,r]),n=[],r=[]),o.type===_u.CONTEXT?t.push([[o],[],[]]):o.type===_u.INSERT&&0===n.length?t.push([[],[],[o]]):o.type===_u.INSERT&&n.length>0?r.push(o):o.type===_u.DELETE&&n.push(o)}return(n.length||r.length)&&(t.push([[],n,r]),n=[],r=[]),t}applyRematchMatching(e,t,n){const r=e.length*t.length,i=ef(e.concat(t).map(e=>e.content.length));return r<this.config.matchingMaxComparisons&&i<this.config.maxLineSizeInBlockForComparison&&("lines"===this.config.matching||"words"===this.config.matching)?n(e,t):[[e,t]]}makeHeaderHtml(e,t){return this.hoganUtils.render(Rf,"block-header",{CSSLineClass:hf,blockHeader:(null==t?void 0:t.isTooBig)?e:If(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,t,n){const r={right:"",left:""},i=Math.max(t.length,n.length);for(let o=0;o<i;o++){const i=t[o],a=n[o],s=void 0!==i&&void 0!==a?Sf(i.content,a.content,e,this.config):void 0,l=void 0!==i&&void 0!==i.oldNumber?Object.assign(Object.assign({},void 0!==s?{prefix:s.oldLine.prefix,content:s.oldLine.content,type:hf.DELETE_CHANGES}:Object.assign(Object.assign({},xf(i.content,e)),{type:bf(i.type)})),{number:i.oldNumber}):void 0,c=void 0!==a&&void 0!==a.newNumber?Object.assign(Object.assign({},void 0!==s?{prefix:s.newLine.prefix,content:s.newLine.content,type:hf.INSERT_CHANGES}:Object.assign(Object.assign({},xf(a.content,e)),{type:bf(a.type)})),{number:a.newNumber}):void 0,{left:u,right:f}=this.generateLineHtml(l,c);r.left+=u,r.right+=f}return r}generateLineHtml(e,t){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(t)}}generateSingleHtml(e){const t="d2h-code-side-linenumber",n="d2h-code-side-line";return this.hoganUtils.render(Rf,"line",{type:(null==e?void 0:e.type)||`${hf.CONTEXT} d2h-emptyplaceholder`,lineClass:void 0!==e?t:`${t} d2h-code-side-emptyplaceholder`,contentClass:void 0!==e?n:`${n} d2h-code-side-emptyplaceholder`,prefix:" "===(null==e?void 0:e.prefix)?" ":null==e?void 0:e.prefix,content:null==e?void 0:e.content,lineNumber:null==e?void 0:e.number})}}var Hf={};!function(e){!function(e){var t=/\S/,n=/\"/g,r=/\n/g,i=/\r/g,o=/\\/g,a=/\u2028/,s=/\u2029/;function l(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function c(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function u(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,i=e.length;r<i;r++)if(t.charAt(n+r)!=e.charAt(r))return!1;return!0}e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(n,r){var i=n.length,o=0,a=null,s=null,f="",d=[],h=!1,p=0,g=0,m="{{",y="}}";function v(){f.length>0&&(d.push({tag:"_t",text:new String(f)}),f="")}function A(n,r){if(v(),n&&function(){for(var n=!0,r=g;r<d.length;r++)if(!(n=e.tags[d[r].tag]<e.tags._v||"_t"==d[r].tag&&null===d[r].text.match(t)))return!1;return n}())for(var i,o=g;o<d.length;o++)d[o].text&&((i=d[o+1])&&">"==i.tag&&(i.indent=d[o].text.toString()),d.splice(o,1));else r||d.push({tag:"\n"});h=!1,g=d.length}function b(e,t){var n="="+y,r=e.indexOf(n,t),i=c(e.substring(e.indexOf("=",t)+1,r)).split(" ");return m=i[0],y=i[i.length-1],r+n.length-1}for(r&&(r=r.split(" "),m=r[0],y=r[1]),p=0;p<i;p++)0==o?u(m,n,p)?(--p,v(),o=1):"\n"==n.charAt(p)?A(h):f+=n.charAt(p):1==o?(p+=m.length-1,"="==(a=(s=e.tags[n.charAt(p+1)])?n.charAt(p+1):"_v")?(p=b(n,p),o=0):(s&&p++,o=2),h=p):u(y,n,p)?(d.push({tag:a,n:c(f),otag:m,ctag:y,i:"/"==a?h-m.length:p+y.length}),f="",p+=y.length-1,o=0,"{"==a&&("}}"==y?p++:l(d[d.length-1]))):f+=n.charAt(p);return A(h,!0),d};var f={_t:!0,"\n":!0,$:!0,"/":!0};function d(t,n,r,i){var o,a=[],s=null,l=null;for(o=r[r.length-1];t.length>0;){if(l=t.shift(),o&&"<"==o.tag&&!(l.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[l.tag]<=e.tags.$||h(l,i))r.push(l),l.nodes=d(t,l.tag,r,i);else{if("/"==l.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+l.n);if(s=r.pop(),l.n!=s.n&&!p(l.n,s.n,i))throw new Error("Nesting error: "+s.n+" vs. "+l.n);return s.end=l.i,a}"\n"==l.tag&&(l.last=0==t.length||"\n"==t[0].tag)}a.push(l)}if(r.length>0)throw new Error("missing closing tag: "+r.pop().n);return a}function h(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].o==e.n)return e.tag="#",!0}function p(e,t,n){for(var r=0,i=n.length;r<i;r++)if(n[r].c==e&&n[r].o==t)return!0}function g(e){var t=[];for(var n in e.partials)t.push('"'+y(n)+'":{name:"'+y(e.partials[n].name)+'", '+g(e.partials[n])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var n in e)t.push('"'+y(n)+'": function(c,p,t,i) {'+e[n]+"}");return"{ "+t.join(",")+" }"}(e.subs)}e.stringify=function(t,n,r){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+g(t)+"}"};var m=0;function y(e){return e.replace(o,"\\\\").replace(n,'\\"').replace(r,"\\n").replace(i,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function v(e){return~e.indexOf(".")?"d":"f"}function A(e,t){var n="<"+(t.prefix||"")+e.n+m++;return t.partials[n]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+y(n)+'",c,p,"'+(e.indent||"")+'"));',n}function b(e,t){t.code+="t.b(t.t(t."+v(e.n)+'("'+y(e.n)+'",c,p,0)));'}function w(e){return"t.b("+e+");"}e.generate=function(t,n,r){m=0;var i={code:"",subs:{},partials:{}};return e.walk(t,i),r.asString?this.stringify(i,n,r):this.makeTemplate(i,n,r)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},e.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},e.codegen={"#":function(t,n){n.code+="if(t.s(t."+v(t.n)+'("'+y(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,n),n.code+="});c.pop();}"},"^":function(t,n){n.code+="if(!t.s(t."+v(t.n)+'("'+y(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,n),n.code+="};"},">":A,"<":function(t,n){var r={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,r);var i=n.partials[A(t,n)];i.subs=r.subs,i.partials=r.partials},$:function(t,n){var r={subs:{},code:"",partials:n.partials,prefix:t.n};e.walk(t.nodes,r),n.subs[t.n]=r.code,n.inPartial||(n.code+='t.sub("'+y(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=w('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+v(e.n)+'("'+y(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=w('"'+y(e.text)+'"')},"{":b,"&":b},e.walk=function(t,n){for(var r,i=0,o=t.length;i<o;i++)(r=e.codegen[t[i].tag])&&r(t[i],n);return n},e.parse=function(e,t,n){return d(e,0,[],(n=n||{}).sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,n){n=n||{};var r=e.cacheKey(t,n),i=this.cache[r];if(i){var o=i.partials;for(var a in o)delete o[a].instance;return i}return i=this.generate(this.parse(this.scan(t,n.delimiters),t,n),t,n),this.cache[r]=i}}(e)}(Hf);var Of={};!function(e){!function(e){function t(e,t,n){var r;return t&&"object"==typeof t&&(void 0!==t[e]?r=t[e]:n&&t.get&&"function"==typeof t.get&&(r=t.get(e))),r}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,n){return""},v:function(e){return e=l(e),s.test(e)?e.replace(n,"&").replace(r,"<").replace(i,">").replace(o,"'").replace(a,"""):e},t:l,render:function(e,t,n){return this.ri([e],t||{},n)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var n=this.partials[e],r=t[n.name];if(n.instance&&n.base==r)return n.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[e].base=r,n.subs){for(key in t.stackText||(t.stackText={}),n.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);r=function(e,t,n,r,i,o){function a(){}function s(){}var l;a.prototype=e,s.prototype=e.subs;var c=new a;for(l in c.subs=new s,c.subsText={},c.buf="",r=r||{},c.stackSubs=r,c.subsText=o,t)r[l]||(r[l]=t[l]);for(l in r)c.subs[l]=r[l];for(l in i=i||{},c.stackPartials=i,n)i[l]||(i[l]=n[l]);for(l in i)c.partials[l]=i[l];return c}(r,n.subs,n.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=r,r},rp:function(e,t,n,r){var i=this.ep(e,n);return i?i.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(c(r))for(var i=0;i<r.length;i++)e.push(r[i]),n(e,t,this),e.pop();else n(e,t,this)},s:function(e,t,n,r,i,o,a){var s;return(!c(e)||0!==e.length)&&("function"==typeof e&&(e=this.ms(e,t,n,r,i,o,a)),s=!!e,!r&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,n,r,i){var o,a=e.split("."),s=this.f(a[0],n,r,i),l=this.options.modelGet,u=null;if("."===e&&c(n[n.length-2]))s=n[n.length-1];else for(var f=1;f<a.length;f++)void 0!==(o=t(a[f],s,l))?(u=s,s=o):s="";return!(i&&!s)&&(i||"function"!=typeof s||(n.push(u),s=this.mv(s,n,r),n.pop()),s)},f:function(e,n,r,i){for(var o=!1,a=!1,s=this.options.modelGet,l=n.length-1;l>=0;l--)if(void 0!==(o=t(e,n[l],s))){a=!0;break}return a?(i||"function"!=typeof o||(o=this.mv(o,n,r)),o):!i&&""},ls:function(e,t,n,r,i,o){var a=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(l(e.call(t,i,n)),t,r)),this.options.delimiters=a,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,n,r,i,o,a){var s,l=t[t.length-1],c=e.call(l);return"function"==typeof c?!!r||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,l,t,n,s.substring(i,o),a)):c},mv:function(e,t,n){var r=t[t.length-1],i=e.call(r);return"function"==typeof i?this.ct(l(i.call(r)),r,n):i},sub:function(e,t,n,r){var i=this.subs[e];i&&(this.activeSub=e,i(t,n,this,r),this.activeSub=!1)}};var n=/&/g,r=/</g,i=/>/g,o=/\'/g,a=/\"/g,s=/[&<>\"\']/;function l(e){return String(null==e?"":e)}var c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(e)}(Of);var qf=Hf;qf.Template=Of.Template,qf.template=qf.Template;var Pf=qf;const $f={};$f["file-summary-line"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<li class="d2h-file-list-line">'),r.b("\n"+n),r.b(' <span class="d2h-file-name-wrapper">'),r.b("\n"+n),r.b(r.rp("<fileIcon0",e,t," ")),r.b(' <a href="#'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-name">'),r.b(r.v(r.f("fileName",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b(' <span class="d2h-file-stats">'),r.b("\n"+n),r.b(' <span class="d2h-lines-added">'),r.b(r.v(r.f("addedLines",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <span class="d2h-lines-deleted">'),r.b(r.v(r.f("deletedLines",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b("</li>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}}),$f["file-summary-wrapper"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-file-list-wrapper '),r.b(r.v(r.f("colorScheme",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-list-header">'),r.b("\n"+n),r.b(' <span class="d2h-file-list-title">Files changed ('),r.b(r.v(r.f("filesNumber",e,t,0))),r.b(")</span>"),r.b("\n"+n),r.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),r.b("\n"+n),r.b(' <a class="d2h-file-switch d2h-show">show</a>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <ol class="d2h-file-list">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("files",e,t,0))),r.b("\n"+n),r.b(" </ol>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["generic-block-header"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",e,t,0))),r.b(" "),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('"></td>'),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.s(r.f("blockHeader",e,t,1),e,t,0,156,173,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(n.t(n.f("blockHeader",e,t,0)))}),e.pop()),r.s(r.f("blockHeader",e,t,1),e,t,1,0,0,"")||r.b(" "),r.b("</div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),$f["generic-empty-diff"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" File without changes"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),$f["generic-file-path"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-file-name-wrapper">'),r.b("\n"+n),r.b(r.rp("<fileIcon0",e,t," ")),r.b(' <span class="d2h-file-name">'),r.b(r.v(r.f("fileDiffName",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(r.rp("<fileTag1",e,t," ")),r.b("</span>"),r.b("\n"+n),r.b('<label class="d2h-file-collapse">'),r.b("\n"+n),r.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),r.b("\n"+n),r.b(" Viewed"),r.b("\n"+n),r.b("</label>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}}),$f["generic-line"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",e,t,0))),r.b(" "),r.b(r.v(r.f("type",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("lineNumber",e,t,0))),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("type",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.b("\n"+n),r.s(r.f("prefix",e,t,1),e,t,0,162,238,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <span class="d2h-code-line-prefix">'),r.b(r.t(r.f("prefix",e,t,0))),r.b("</span>"),r.b("\n"+n)}),e.pop()),r.s(r.f("prefix",e,t,1),e,t,1,0,0,"")||(r.b(' <span class="d2h-code-line-prefix"> </span>'),r.b("\n"+n)),r.s(r.f("content",e,t,1),e,t,0,371,445,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <span class="d2h-code-line-ctn">'),r.b(r.t(r.f("content",e,t,0))),r.b("</span>"),r.b("\n"+n)}),e.pop()),r.s(r.f("content",e,t,1),e,t,1,0,0,"")||(r.b(' <span class="d2h-code-line-ctn"><br></span>'),r.b("\n"+n)),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),$f["generic-wrapper"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-wrapper '),r.b(r.v(r.f("colorScheme",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("content",e,t,0))),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["icon-file-added"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),r.b("\n"+n),r.b(' width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["icon-file-changed"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["icon-file-deleted"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["icon-file-renamed"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["icon-file"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),r.b("\n"+n),r.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["line-by-line-file-diff"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-header">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("filePath",e,t,0))),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-file-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("diffs",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["line-by-line-numbers"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="line-num1">'),r.b(r.v(r.f("oldNumber",e,t,0))),r.b("</div>"),r.b("\n"+n),r.b('<div class="line-num2">'),r.b(r.v(r.f("newNumber",e,t,0))),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["side-by-side-file-diff"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-header">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("filePath",e,t,0))),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-files-diff">'),r.b("\n"+n),r.b(' <div class="d2h-file-side-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.d("diffs.left",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-file-side-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.d("diffs.right",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["tag-file-added"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),r.fl()},partials:{},subs:{}}),$f["tag-file-changed"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),r.fl()},partials:{},subs:{}}),$f["tag-file-deleted"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),r.fl()},partials:{},subs:{}}),$f["tag-file-renamed"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),r.fl()},partials:{},subs:{}});class zf{constructor({compiledTemplates:e={},rawTemplates:t={}}){const n=Object.entries(t).reduce((e,[t,n])=>{const r=Pf.compile(n,{asString:!1});return Object.assign(Object.assign({},e),{[t]:r})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},$f),e),n)}static compile(e){return Pf.compile(e,{asString:!1})}render(e,t,n,r,i){const o=this.templateKey(e,t);try{return this.preCompiledTemplates[o].render(n,r,i)}catch(e){throw new Error(`Could not find template to render '${o}'`)}}template(e,t){return this.preCompiledTemplates[this.templateKey(e,t)]}templateKey(e,t){return`${e}-${t}`}}const jf=Object.assign(Object.assign(Object.assign({},Nf),Lf),{outputFormat:"line-by-line",drawFileList:!0});var Vf=Object.freeze({__proto__:null,defaultDiff2HtmlConfig:jf,html:function(e,t={}){const n=Object.assign(Object.assign({},jf),t),r="string"==typeof e?af(e,n):e,i=new zf(n),{colorScheme:o}=n,a={colorScheme:o};return(n.drawFileList?new Df(i,a).render(r):"")+("side-by-side"===n.outputFormat?new Uf(i,n).render(r):new Qf(i,n).render(r))},parse:function(e,t={}){return af(e,Object.assign(Object.assign({},jf),t))}});function Yf(e=Vf){let t="html";if(Oi(be(e,t)))return e;if(Oi(be(e,["default",t])))return e.default;let n=tc(),r=be(n,"Diff2Html.default",null),i=be(n,"Diff2Html",null);if(Oi(be(r,t)))return r;if(Oi(be(i,t)))return i;throw console.log("Diff2Html",e,"g.Diff2Html",be(n,"Diff2Html")),new Error("invalid Diff2Html, g.Diff2Html, g.Diff2Html.default, use script for import")}var Wf=Object.defineProperty,Gf=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},Jf=(e,t)=>{for(var n in t)Wf(e,n,{get:t[n],enumerable:!0})};var _f,Xf,Kf=Gf(()=>{_f=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let e=this.keys().next().value;void 0!==e&&this.delete(e)}return super.set(e,t)}},Xf={image:new _f(100),background:new _f(100),resource:new _f(150),defaultStyle:new _f(30),baseStyle:new _f(50),compress:new _f(50),computedStyle:new WeakMap,measureHints:new WeakMap,burstAdvice:new WeakMap,warnedReconcile:!1,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function Zf(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith("#")?null:n}function ed(e,t=1){let n=e.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let e of n[1].split(",")){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)continue;let n=e.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(n&&!nd.test(n[1].trim()))continue;let i=e.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),o=1;if(i){let e=parseFloat(i[1]);o=/dpi/i.test(i[2])?e/96:e}r.push({url:t[2].trim(),dppx:o})}return r.length?(r.sort((e,t)=>e.dppx-t.dppx),(r.find(e=>e.dppx>=t)||r[r.length-1]).url):null}function td(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}var nd,rd=Gf(()=>{nd=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function id(e,t){if(!t||function(e){return/^data:|^blob:|^about:blank$/i.test(e)}(e)||function(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(r||".",n),o=new URL(e,n);if(o.origin===i.origin)return!0;let a=o.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}(e,t))return!1;try{let t=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,t);return!(typeof location<"u")||n.origin!==location.origin}catch{return!!t}}function od(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(e)})}async function ad(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,i=t.useProxy||"",o=t.errorTTL??8e3,a=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if("text"===n)return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if("dataURL"===n)return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,t="",r=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(t)?atob(r):decodeURIComponent(r),o=new Uint8Array([...i].map(e=>e.charCodeAt(0))),a=new Blob([o],{type:(t||"").split(";")[0]||""});return{ok:!0,data:a,status:200,url:e,fromCache:!1,mime:a.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let t=await fetch(e);if(!t.ok)return{ok:!1,data:null,status:t.status,url:e,fromCache:!1,reason:"http_error"};let r=await t.blob(),i=r.type||t.headers.get("content-type")||"";return"dataURL"===n?{ok:!0,data:await od(r),status:t.status,url:e,fromCache:!1,mime:i}:"text"===n?{ok:!0,data:await r.text(),status:t.status,url:e,fromCache:!1,mime:i}:{ok:!0,data:r,status:t.status,url:e,fromCache:!1,mime:i}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return"dataURL"===n?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:"text"===n?"":new Blob([]),status:200,url:e,fromCache:!1};let l=function(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}(e,{as:n,timeout:r,useProxy:i,errorTTL:o}),c=cd.get(l);if(c&&c.until>Date.now())return{...c.result,fromCache:!0};c&&cd.delete(l);let u=ld.get(l);if(u)return u;let f=id(e,i)?function(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",td(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${td(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}(e,i):e,d=t.credentials;if(!d)try{let t=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,t);d=typeof location<"u"&&n.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,p=setTimeout(()=>h.abort("timeout"),r),g=(async()=>{try{let r=await fetch(f,{signal:h.signal,credentials:d,headers:a});if(!r.ok){let i={ok:!1,data:null,status:r.status,url:f,fromCache:!1,reason:"http_error"};if(o>0&&cd.set(l,{until:Date.now()+o,result:i}),!s){let t=`${r.status} ${r.statusText||""}`.trim();sd.warnOnce(`http:${r.status}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${t} while fetching ${n} ${e}`)}return t.onError&&t.onError(i),i}if("text"===n)return{ok:!0,data:await r.text(),status:r.status,url:f,fromCache:!1};let i=await r.blob(),c=i.type||r.headers.get("content-type")||"";return"dataURL"===n?{ok:!0,data:await od(i),status:r.status,url:f,fromCache:!1,mime:c}:{ok:!0,data:i,status:r.status,url:f,fromCache:!1,mime:c}}catch(i){let a=i&&"object"==typeof i&&"name"in i&&"AbortError"===i.name?String(i.message||"").includes("timeout")?"timeout":"abort":"network",c={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:a};if(!/^blob:/i.test(e)&&o>0&&cd.set(l,{until:Date.now()+o,result:c}),!s){let t=`${a}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,i="timeout"===a?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:"abort"===a?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;sd.errorOnce(t,i)}return t.onError&&t.onError(c),c}finally{clearTimeout(p),ld.delete(l)}})();return ld.set(l,g),g}var sd,ld,cd,ud=Gf(()=>{rd(),sd=function(e="[snapDOM]",{ttlMs:t=3e5,maxEntries:n=12}={}){let r=new Map,i=0;function o(o,a,s){if(i>=n)return;let l=Date.now();(r.get(a)||0)>l||(r.set(a,l+t),i++,"warn"===o&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(e,t){o("warn",e,t)},errorOnce(e,t){o("error",e,t)},reset(){r.clear(),i=0}}}("[snapDOM]",{ttlMs:18e4,maxEntries:10}),ld=new Map,cd=new Map});async function fd(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||"none"===e.trim())return e;let n=ed(e,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Zf(e);if(!n)return e;let r=function(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,n).href}catch{return e}}(n),i=td(r),o=(t.useProxy||"")+"|"+i;if(Xf.background.has(o)){let e=Xf.background.get(o);return e?`url("${e}")`:"none"}try{let e=await ad(i,{as:"dataURL",useProxy:t.useProxy});return e.ok?(Xf.background.set(o,e.data),`url("${e.data}")`):(Xf.background.set(o,null),"none")}catch{return Xf.background.set(o,null),"none"}}var dd=Gf(()=>{Kf(),rd(),ud()});function hd(e){if(e=String(e).toLowerCase(),wd.has(e)){let t={};return Xf.defaultStyle.set(e,t),t}if(Xf.defaultStyle.has(e))return Xf.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let n=document.createElement(e);n.style.all="initial",t.appendChild(n);let r=getComputedStyle(n),i={};for(let e of r){if(pd(e))continue;let t=r.getPropertyValue(e);i[e]=t}return t.removeChild(n),Xf.defaultStyle.set(e,i),i}function pd(e){let t=Ed.get(e);if(void 0===t){let n=String(e).toLowerCase();t=Cd.has(n)||xd.test(n)||Id.test(n),Ed.set(e,t)}return t}function gd(e,t){return!kd.has(e)&&("inline"===t||Bd.has(e)||Sd.has(e))}function md(e,t,n=!0,r=!1){if(t=String(t||"").toLowerCase(),wd.has(t))return"";let i=[],o=hd(t),a=(e.display||"").toLowerCase(),s="inline"===a,l=gd(t,a),c=e["text-wrap-mode"]||e["white-space"]||"",u="nowrap"===c||"pre"===c,f=l&&n&&!(l&&n&&!s&&u),d=!1;for(let t in e){if(pd(t))continue;let n=e[t];if(f){if(Fd.has(t))continue;if(Dd.has(t)){n&&n!==o[t]&&(i.push(`${t}:${n}`),"auto"!==n&&(d=!0));continue}}if(n&&n!==o[t]){if(!u&&("width"===t||"inline-size"===t)&&n.endsWith("px")&&n.includes(".")){let e=parseFloat(n);if(Number.isFinite(e)){i.push(`${t}:${(e+Nd).toFixed(3)}px`);continue}}i.push(`${t}:${n}`)}}if(f&&!s&&!r&&!d){let t=e.width;t&&"auto"!==t&&t!==o.width&&i.push(`min-width:${t}`)}return i.sort(),i.join(";")}function yd(e,t=null){let n=()=>{let e={length:0,getPropertyValue:()=>"",item:()=>""};return e[Symbol.iterator]=function*(){},e};if(1!==e?.nodeType){let r=typeof window<"u"?window:null;if(r&&"function"==typeof r.getComputedStyle)try{return r.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=Xf.computedStyle.get(e);r||(r=new Map,Xf.computedStyle.set(e,r));let i=r.get(t);if(!i){let o=function(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let n=t.defaultView;if(n&&"function"==typeof n.getComputedStyle)return n;if(typeof window<"u"&&window.frames)for(let e=0;e<window.frames.length;e++)try{if(window.frames[e]?.document===t)return window.frames[e]}catch{}}catch{}return typeof window<"u"?window:null}(e),a=null;try{a=o&&"function"==typeof o.getComputedStyle?o.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&"function"==typeof window.getComputedStyle)try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}i=a||n(),r.set(t,i)}return i}function vd(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);for(let e of Td){let n=t[`border-${e}-style`],r=t[`border-${e}-width`];("none"===n||"hidden"===n||"0px"===r)&&(delete t[`border-${e}-style`],delete t[`border-${e}-width`],delete t[`border-${e}-color`])}return t}function Ad(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o&&n++,")"===o&&n--,","===o&&0===n&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var bd,wd,Id,xd,Cd,Ed,Bd,Sd,kd,Fd,Dd,Nd,Md,Td,Qd=Gf(()=>{Kf(),bd=new Set(["meta","script","noscript","title","link","template"]),wd=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Id=/(?:^|-)(animation|transition)(?:-|$)/i,xd=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Cd=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom","stroke-color"]),Ed=new Map,Bd=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),Sd=new Set(["table","thead","tbody","tfoot","tr","td","th"]),kd=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),Fd=new Set(["width","max-width","inline-size","max-inline-size"]),Dd=new Set(["min-width","min-inline-size"]),Nd=.001,Md=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]),Td=["top","right","bottom","left"]});function Ld(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Rd(e=1e3){return"function"!=typeof requestAnimationFrame||typeof document<"u"&&"hidden"===document.visibilityState?Promise.resolve():new Promise(t=>{let n=!1,r=()=>{n||(n=!0,t())};try{requestAnimationFrame(r)}catch{return void r()}setTimeout(r,e)})}function Ud(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),n=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),r=/applewebkit/i.test(e),i=/mobile/i.test(e),o=!/safari/i.test(e),a=r&&i&&o,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),c=/ipad|iphone|ipod/.test(t)&&r;return n||a||s||l||c}var Hd=Gf(()=>{});function Od(e,t,n){let r=e&&"object"==typeof e&&(e.options||e);r&&r.debug&&(void 0!==n?console.warn("[snapdom]",t,n):console.warn("[snapdom]",t))}var qd=Gf(()=>{}),Pd=Gf(()=>{dd(),Qd(),Hd(),rd(),qd()}),$d={};function zd(e){return"string"==typeof e&&/^data:image\/svg\+xml/i.test(e)}function jd(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function Vd(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Yd(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o&&r++,")"===o&&(r=Math.max(0,r-1)),";"===o&&0===r?(t.push(n),n=""):n+=o}return n.trim()&&t.push(n),t.map(e=>e.trim()).filter(Boolean)}function Wd(e){let t=Yd(e),n=null,r=null,i=null,o=[];for(let e of t){let t=e.indexOf(":");if(t<0)continue;let a=e.slice(0,t).trim().toLowerCase(),s=e.slice(t+1).trim();"box-shadow"===a?i=s:"filter"===a?n=s:"-webkit-filter"===a?r=s:o.push([a,s])}if(i){let e=function(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o&&r++,")"===o&&(r=Math.max(0,r-1)),","===o&&0===r?(t.push(n.trim()),n=""):n+=o}n.trim()&&t.push(n.trim());let i=[];for(let e of t){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(?:\.\d+)?px/gi)||[],[n="0px",r="0px",o="0px"]=t;o=parseFloat(o)/2+"px";let a=e.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/gi,"").trim().replace(/\s{2,}/g," "),s=!!a&&","!==a;i.push(`drop-shadow(${n} ${r} ${o}${s?` ${a}`:""})`)}return i.join(" ")}(i);e&&(n=n?`${n} ${e}`:e,r=r?`${r} ${e}`:e)}let a=[...o];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([e,t])=>`${e}:${t}`).join(";")}function Gd(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,function(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,n)=>`${t}{${Wd(n)}}`)}(t))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,n)=>`style=${t}${Wd(n)}${t}`)}function Jd(e,t){let n=e=>Yd(e).map(e=>{let n=e.indexOf(":");if(n<0)return e;let r=e.slice(0,n).trim().toLowerCase();return"text-shadow"===r||t&&"box-shadow"===r?`${r}:${function(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o?n++:")"===o?n=Math.max(0,n-1):","===o&&0===n&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t.map(e=>{let t=0,n=0,r="",i=0;for(;i<e.length;){let o=e[i];if("("===o?t++:")"===o&&(t=Math.max(0,t-1)),0===t&&(0===i||" "===e[i-1])){let t=/^-?\d*\.?\d+px/.exec(e.slice(i));if(t){n++,r+=2===n?-parseFloat(t[0])+"px":t[0],i+=t[0].length;continue}}r+=o,i++}return r}).join(",")}(e.slice(n+1))}`:e}).join(";");return e=(e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,t.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,r)=>`${t}{${n(r)}}`)))).replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,r)=>`style=${t}${n(r)}${t}`)}async function _d(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:n}=await(eh||(eh=(async()=>{try{let e='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',t=new Image;t.decoding="sync",t.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,await t.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(t,0,0);let i=r.getImageData(2,18,1,1).data[3]>128,o=r.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})(),eh));try{let r=e;return t||(r=Gd(r)),n&&(r=Jd(r,t)),{svg:r,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}async function Xd(e,t){let{width:n,height:r,scale:i=1,dpr:o=1,meta:a={},backgroundColor:s,crop:l=null}=t,c=e,u=!1,f=!1;if(l&&!zd(e))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(zd(e)){let t=(function(e){let t=e.indexOf(",");if(t<0)return"";let n=e.slice(t+1,t+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(n)}catch{return""}}(e).match(/<svg\b[^>]*>/i)||[])[0]||"",n=parseFloat((t.match(/\bwidth="([\d.]+)/i)||[])[1]),r=parseFloat((t.match(/\bheight="([\d.]+)/i)||[])[1]),i=Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0&&Math.min(1,Kd/n,Kd/r,Math.sqrt(Zd/(n*r)))<1;if(l||i||Ud())try{let t=jd(e);if(l&&(t=function(e,t){let n=["x","y","width","height"].map(e=>Number(t?.[e]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let r=e.match(/<svg\b[^>]*>/i);if(!r)throw new Error("[snapdom] cannot crop a non-SVG capture");let i=r[0],o=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],a=String(o||"").trim().split(/[\s,]+/).map(Number);if(4!==a.length||!a.every(Number.isFinite)||a[2]<=0||a[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[s,l,c,u]=a,f=Math.max(s,n[0]),d=Math.max(l,n[1]),h=Math.min(s+c,n[0]+n[2]),p=Math.min(l+u,n[1]+n[3]);if(!(h>f&&p>d))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let g=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),m=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(g)&&g>0?g/c:1,v=Number.isFinite(m)&&m>0?m/u:1,A=Math.max(1,(h-f)*y),b=Math.max(1,(p-d)*v),w=i.replace(/(\bwidth=")[^"]*/i,`$1${A}`).replace(/(\bheight=")[^"]*/i,`$1${b}`).replace(/(\bviewBox=")[^"]*/i,`$1${f} ${d} ${h-f} ${p-d}`);return e.replace(i,w)}(t,l)),Ud()){let e=await _d(t);t=e.svg,u=e.naturalOnly,f=/@font-face|data:image\//i.test(t)}(i||l)&&(t=function(e){try{let t=e.match(/<svg\b[^>]*>/i);if(!t)return e;let n=t[0],r=parseFloat((n.match(/\bwidth="([\d.]+)/i)||[])[1]),i=parseFloat((n.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(r)||!Number.isFinite(i)||r<=0||i<=0)return e;let o=Math.min(1,Kd/r,Kd/i,Math.sqrt(Zd/(r*i)));if(o>=1)return e;let a=Math.max(1,Math.floor(r*o)),s=Math.max(1,Math.floor(i*o));return console.warn(`[snapDOM] Capture ${Math.round(r)}×${Math.round(i)}px exceeds the browser image-decode limit (${Kd}px/side); downscaling to ${a}×${s}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),e.replace(n,n.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${s}`))}catch{return e}}(t)),c=Vd(t)}catch(t){if(l)throw t;c=e}}let d=new Image;d.loading="eager",d.decoding="sync",d.crossOrigin="anonymous",d.src=c,await d.decode(),Ud()&&await async function(e,t){e.setAttribute("data-snapdom-internal",""),e.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(e);try{let n=document.createElement("canvas");n.width=16,n.height=16;let r=()=>new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}),i=n.getContext("2d",{willReadFrequently:!0});if(!i)return await r(),void await r();let o=performance.now()+(t?600:150);for(;;){i.clearRect(0,0,16,16);try{i.drawImage(e,0,0,16,16)}catch{return}let t=i.getImageData(0,0,16,16).data,n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0){n=!0;break}if(n||performance.now()>o)return;await r()}}finally{try{e.remove()}catch{}}}(d,f);let h,p,g=d.naturalWidth,m=d.naturalHeight,y=l?g:Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:g,v=l?m:Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:m,A=Number.isFinite(n),b=Number.isFinite(r);if(A&&b)h=Math.max(1,n),p=Math.max(1,r);else if(A){h=n,p=v*(n/Math.max(1,y))}else if(b){p=r,h=y*(r/Math.max(1,v))}else h=g,p=m;h*=i,p*=i;let w=h*o,I=p*o,x=Math.max(w/Kd,I/Kd,Math.sqrt(w*I/Zd));x>1&&(console.warn(`[snapDOM] Output ${Math.round(w)}×${Math.round(I)}px exceeds the browser canvas limit (${Kd}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),h/=x,p/=x);let C=document.createElement("canvas");C.width=h*o,C.height=p*o,C.style.width=`${h}px`,C.style.height=`${p}px`;let E=C.getContext("2d");if(1!==o&&E.scale(o,o),s&&(E.save(),E.fillStyle=s,E.fillRect(0,0,h,p),E.restore()),!u||Math.round(h*o)===g&&Math.round(p*o)===m)E.drawImage(d,0,0,h,p);else{let e=document.createElement("canvas");e.width=g,e.height=m,e.getContext("2d").drawImage(d,0,0),E.drawImage(e,0,0,h,p)}return C}Jf($d,{decodeSvgFromDataURL:()=>jd,encodeSvgToDataURL:()=>Vd,fixSafariShadows:()=>_d,toCanvas:()=>Xd});var Kd,Zd,eh,th=Gf(()=>{Hd(),Kd=16384,Zd=268435456,eh=null}),nh={};async function rh(e,t){let n=await Xd(e,t),r=await new Promise(e=>{let r=()=>e(n.toDataURL(`image/${t.format}`,t.quality));try{n.toBlob(t=>{if(!t)return r();let n=new FileReader;n.onload=()=>e(String(n.result||"")),n.onerror=r,n.readAsDataURL(t)},`image/${t.format}`,t.quality)}catch{r()}}),i=new Image;return i.src=r,await i.decode(),i.style.width=n.width/t.dpr+"px",i.style.height=n.height/t.dpr+"px",i}Jf(nh,{rasterize:()=>rh});var ih=Gf(()=>{th()}),oh={};async function ah(e,t){let{scale:n=1,width:r,height:i,meta:o={}}=t,a=Number.isFinite(r),s=Number.isFinite(i),l=Number.isFinite(n)&&1!==n||a||s;if(Ud()&&l)try{let{svg:t}=await _d(jd(e)),l=(t.match(/<svg\b[^>]*>/i)||[])[0]||"",c=parseFloat((l.match(/\bwidth="([\d.]+)/i)||[])[1]),u=parseFloat((l.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(c)||!Number.isFinite(u))throw new Error("svg without dimensions");let f,d,h=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c,p=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u;a&&s?(f=r,d=i):a?(f=r,d=Math.round(p*(r/Math.max(1,h)))):s?(d=i,f=Math.round(h*(i/Math.max(1,p)))):(f=Math.round(c*n),d=Math.round(u*n));let g=t.replace(/width="[^"]*"/,`width="${f}"`).replace(/height="[^"]*"/,`height="${d}"`),m=new Image;return m.decoding="sync",m.loading="eager",m.src=Vd(g),await m.decode(),m.style.width=`${f}px`,m.style.height=`${d}px`,m}catch(n){return Od(t,"safari vector toImg failed, falling back to PNG",n),rh(e,{...t,format:"png",quality:1,meta:o})}let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=e,await c.decode(),a&&s)c.style.width=`${r}px`,c.style.height=`${i}px`;else if(a){let e=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c.naturalWidth,t=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:c.naturalHeight,n=r/Math.max(1,e);c.style.width=`${r}px`,c.style.height=`${Math.round(t*n)}px`}else if(s){let e=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c.naturalWidth,t=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:c.naturalHeight,n=i/Math.max(1,t);c.style.height=`${i}px`,c.style.width=`${Math.round(e*n)}px`}else{let r=Math.round(c.naturalWidth*n),i=Math.round(c.naturalHeight*n);if(c.style.width=`${r}px`,c.style.height=`${i}px`,"string"==typeof e&&e.startsWith("data:image/svg+xml"))try{let t=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${r}"`).replace(/height="[^"]*"/,`height="${i}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,c.src=e}catch(e){Od(t,"SVG width/height patch in toImg failed",e)}}return c}Jf(oh,{toImg:()=>ah,toSvg:()=>ah});var sh=Gf(()=>{Pd(),ih(),th()}),lh={};async function ch(e,t){let n=t.type;if("svg"===n){let t=decodeURIComponent(e.split(",")[1]);return new Blob([t],{type:"image/svg+xml"})}let r=await Xd(e,t);return new Promise(e=>r.toBlob(t=>e(t),`image/${n}`,t.quality))}Jf(lh,{toBlob:()=>ch});var uh=Gf(()=>{th()}),fh={};async function dh(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(e){if("AbortError"!==e.name)return!1}return!0}async function hh(e,t){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(t?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(t?.format||i||"").toLowerCase(),a="jpg"===o?"jpeg":o||"png",s=t?.filename||`snapdom.${a}`,l={...t||{},format:a,type:a};l.dpr=1;let c=function(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return"iOS"===navigator.userAgentData.platform;let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}();if("svg"===a){let t=await ch(e,{...l,type:"svg"});if(c&&await dh(t,s))return;let n=URL.createObjectURL(t),r=document.createElement("a");return r.href=n,r.download=s,document.body.appendChild(r),r.click(),URL.revokeObjectURL(n),void r.remove()}let u=await Xd(e,l);if(c){let e=`image/${a}`,n=await new Promise(n=>u.toBlob(n,e,t?.quality));if(n&&await dh(n,s))return}let f=document.createElement("a");f.href=u.toDataURL(`image/${a}`,t?.quality),f.download=s,document.body.appendChild(f),f.click(),f.remove()}Jf(fh,{download:()=>hh});var ph=Gf(()=>{uh(),th(),Hd()});Pd(),Pd(),Kf();var gh=new WeakMap,mh=new Map,yh=0;function vh(){yh++,mh.size>2e3&&mh.clear()}function Ah(e){let t=e&&(1===e.nodeType?e:e.parentElement);return!!(t&&t.closest&&t.closest("[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]"))}function bh(e){for(let t of e)if(!Ah(t.target)){if("childList"===t.type){let e=!0;for(let n of t.addedNodes)if(!Ah(n)){e=!1;break}if(e)for(let n of t.removedNodes)if(!Ah(n)){e=!1;break}if(e)continue}return!0}return!1}var wh=!1;var Ih=["mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"];function xh(e){let t=gh.get(e);if(t&&t.epoch===yh){let e=t.snapshot&&t.snapshot.__needsBgInline;if(void 0!==e)return e}return!0}function Ch(e,t,n){try{if("function"==typeof e.computedStyleMap){let t=e.computedStyleMap().get("width");if(null!=t)return!Bh(String(t).trim().toLowerCase())}}catch{}let r=e.style&&(e.style.width||e.style.inlineSize);return!(!r||Bh(String(r).trim().toLowerCase()))||!!function(e,t){let n=e.getBoundingClientRect().width-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)-(parseFloat(t.borderLeftWidth)||0)-(parseFloat(t.borderRightWidth)||0);if(!(n>0))return!1;let r=1/0,i=-1/0,o=null;for(let t=e.firstChild;t;t=t.nextSibling){let e;if(3===t.nodeType){if(!/\S/.test(t.nodeValue||"")||(o=o||document.createRange(),o.selectNode(t),e=o.getBoundingClientRect(),!e.width&&!e.height))continue}else{if(1!==t.nodeType)continue;{let n=yd(t);if("none"===n.display||"absolute"===n.position||"fixed"===n.position)continue;e=t.getBoundingClientRect()}}e.left<r&&(r=e.left),e.right>i&&(i=e.right)}return i!==-1/0&&i-r<n-.5}(e,t)&&(n||function(e,t){let n=e.parentElement;if(!n)return!1;let r=yd(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(t.marginLeft)||0)-(parseFloat(t.marginRight)||0);return i>0&&Math.abs(e.getBoundingClientRect().width-i)>.5}(e,t))}var Eh=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function Bh(e){return Eh.has(e)||e.startsWith("fit-content")}var Sh=new WeakMap;function kh(e,t=null,n={}){let r=gh.get(e),i=!(!n||!n.embedFonts),o=n&&n.excludeStyleProps||null;if(r&&r.epoch===yh&&r.embedFonts===i&&r.excludeStyleProps===o)return r.snapshot;let a=t||getComputedStyle(e),s=function(e,t={}){let n={},r=t.excludeStyleProps;for(let t=0;t<e.length;t++){let i=e[t];if(pd(i)||r&&(r instanceof RegExp&&r.test(i)||"function"==typeof r&&r(i)))continue;let o=e.getPropertyValue(i);("background-image"===i||"content"===i)&&o.includes("url(")&&!o.includes("data:")&&(o="none"),n[i]=o}let i=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let t of i)if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}let o=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let t of o)if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}if(t.embedFonts){let t=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let r of t)if(!n[r])try{let t=e.getPropertyValue(r);t&&(n[r]=t)}catch{}}try{"hidden"===(n["content-visibility"]||e.getPropertyValue("content-visibility"))&&(n["content-visibility"]="hidden")}catch{}let a=!1;{let t=e.getPropertyValue("background-image");if(t&&"none"!==t&&(a=!0),!a){let t=e.getPropertyValue("background-color");t&&"rgba(0, 0, 0, 0)"!==t&&"transparent"!==t&&(a=!0)}if(!a)for(let t of Ih){let n=e.getPropertyValue(t);if(n&&"none"!==n){a=!0;break}}if(!a){let t=e.getPropertyValue("background");t&&/url\s*\(/i.test(t)&&(a=!0)}}Object.defineProperty(n,"__needsBgInline",{value:a,enumerable:!1});let s=parseFloat(e.getPropertyValue("border-top-width")||0)||0,l=parseFloat(e.getPropertyValue("border-right-width")||0)||0,c=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,u=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(0===s&&0===l&&0===c&&0===u){let t=(e.getPropertyValue("border-image-source")||"").trim(),r=t&&"none"!==t,i=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let e of i)delete n[e];r||(n.border="none")}return n}(a,n);return function(e,t,n){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r)||t.aspectRatio&&"none"!==t.aspectRatio&&"auto"!==t.aspectRatio)return;let i=t.display||"";if(i.includes("flex")||i.includes("grid"))return;let o=t.position;if("absolute"===o||"fixed"===o||"sticky"===o||"none"!==t.transform||function(e){return!!(e.backgroundImage&&"none"!==e.backgroundImage||e.backgroundColor&&"rgba(0, 0, 0, 0)"!==e.backgroundColor&&"transparent"!==e.backgroundColor||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0)||"visible"!==(e.overflowBlock||e.overflowY||"visible")}(t)||Dh(e))return;let a=t.overflowX||t.overflow||"visible",s=t.overflowY||t.overflow||"visible";if("visible"!==a||"visible"!==s)return;let l=t.clip;if(l&&"auto"!==l&&"rect(auto, auto, auto, auto)"!==l||"hidden"===t.visibility||"0"===t.opacity||!function(e){for(let t=e.firstChild;t;t=t.nextSibling)if(3===t.nodeType&&/\S/.test(t.nodeValue))return!0;let t=e.firstElementChild,n=e.lastElementChild;if(t&&"BR"===t.tagName||n&&"BR"===n.tagName)return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let e=yd(t);if("none"===e.display)continue;let n=e.position;if("absolute"!==n&&"fixed"!==n)return!0}return!1}(e))return;let c=parseFloat(t.height),u=function(e){let t=e.getBoundingClientRect().top,n=-1/0,r=null;for(let t=e.firstChild;t;t=t.nextSibling){if(3===t.nodeType){if(!/\S/.test(t.nodeValue||""))continue;r=r||document.createRange(),r.selectNode(t);let e=r.getBoundingClientRect();(e.width||e.height)&&(n=Math.max(n,e.bottom));continue}if(1!==t.nodeType)continue;let e=yd(t);if("none"===e.display)continue;let i=e.position;"absolute"===i||"fixed"===i||e.float&&"none"!==e.float||(n=Math.max(n,t.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-t}(e);Number.isFinite(c)&&Number.isFinite(u)&&Math.abs(c-u)>2||(delete n.height,delete n["block-size"])}(e,a,s),gh.set(e,{epoch:yh,snapshot:s,embedFonts:i,excludeStyleProps:o}),s}async function Fh(e,t,n,r){if("STYLE"===e.tagName)return;let i=function(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:mh,defaultStyle:Xf.defaultStyle,baseStyle:Xf.baseStyle,image:Xf.image,resource:Xf.resource,background:Xf.background,font:Xf.font},options:t||{}}:{session:Xf.session,persist:{snapshotKeyCache:mh,defaultStyle:Xf.defaultStyle,baseStyle:Xf.baseStyle,image:Xf.image,resource:Xf.resource,background:Xf.background,font:Xf.font},options:e||t||{}}}(n,r),o=i.options&&i.options.cache||"auto";"disabled"!==o&&function(e=document.documentElement){if(wh)return;wh=!0;let t=e=>{bh(e)&&vh()};try{new MutationObserver(t).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(t).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",vh),e.ready?.then(()=>vh()).catch(()=>{}))}catch{}}(document.documentElement),"disabled"===o&&!i.session.__bumpedForDisabled&&(vh(),mh.clear(),i.session.__bumpedForDisabled=!0);let{session:a,persist:s}=i;if(!a.styleCache.has(e)){let t=null;try{t=getComputedStyle(e)}catch{}a.styleCache.set(e,t||getComputedStyle(document.documentElement))}let l=a.styleCache.get(e);e.getAttribute?.("style")&&function(e,t,n){if(e.style&&0!==e.style.length)for(let r=0;r<e.style.length;r++){let i=e.style[r],o=n.getPropertyValue(i);o&&t.style.setProperty(i,o)}}(e,t,l);let c=l.getPropertyValue("animation-name");t&&t.style&&c&&"none"!==c&&t.style.setProperty("animation","none","important");let u=kh(e,l,i.options),f=Dh(e);if(f){let e=l.getPropertyValue("min-width");(!e||"auto"===e||"0px"===e)&&(u["min-width"]="0px")}let d=e.tagName?.toLowerCase()||"div",h=function(e){let t=Sh.get(e);return t||(t=Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0).map(([e,t])=>`${e}:${t}`).join(";"),Sh.set(e,t),t)}(u),p=!0;if(gd(d,(u.display||"").toLowerCase())){p=function(e){for(let t=e.firstChild;t;t=t.nextSibling){if(3===t.nodeType&&/\S/.test(t.nodeValue||""))return!0;if(1===t.nodeType){let e=yd(t).position;if("absolute"!==e&&"fixed"!==e)return!0}}return!1}(e),p&&function(e,t,n){let r=(t.display||"").toLowerCase();if("inline"===r||Sd.has(e))return!1;if(n)return!0;if("none"!==(t.float||"none").toLowerCase())return!1;let i=(t.position||"static").toLowerCase();return"absolute"!==i&&"fixed"!==i&&!Md.has(r)}(d,u,f)&&Ch(e,l,f)&&(p=!1),h=`${h}|${d}${p?"|c":""}${f?"|f":""}`;let t=u["text-wrap-mode"]||u["white-space"]||"";p&&"nowrap"!==t&&"pre"!==t&&(a.reconcileRisk=(a.reconcileRisk||0)+1)}let g=s.snapshotKeyCache.get(h);void 0===g&&(g=md(u,d,p,f),s.snapshotKeyCache.set(h,g)),a.styleMap.set(t,g)}function Dh(e){let t=e.parentElement;if(!t)return!1;let n=yd(t).display||"";return n.includes("flex")||n.includes("grid")}Qd();var Nh=["fill","stroke","color","background-color","stop-color"],Mh=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]);function Th(e){let t=e;for(;t&&1===t.nodeType;){if("http://www.w3.org/2000/svg"===t.namespaceURI){if("mask"===t.localName||"clipPath"===t.localName)return!1;if(Mh.has(t.localName))return!0}t=t.parentNode}return!1}var Qh=new Map;function Lh(e,t){if(1!==e?.nodeType||1!==t?.nodeType||Th(e))return;let n=e.getAttribute?.("style"),r=!(!n||!n.includes("var("));if(!r&&e.attributes?.length){let t=e.attributes;for(let e=0;e<t.length;e++){let n=t[e];if(n&&"string"==typeof n.value&&n.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let n=e.style;if(n&&n.length){let e=new Set;for(let r=0;r<n.length;r++){let o=n[r];if(e.has(o))continue;e.add(o);let a=n.getPropertyValue(o);if(!a||!a.includes("var("))continue;let s=i&&i.getPropertyValue(o);if(s)try{t.style.setProperty(o,s.trim(),n.getPropertyPriority(o))}catch{}}}}if(r&&e.attributes?.length){let n=e.attributes;for(let e=0;e<n.length;e++){let r=n[e];if(!r||"string"!=typeof r.value||!r.value.includes("var("))continue;let o=r.name,a=i&&i.getPropertyValue(o);if(a)try{t.style.setProperty(o,a.trim())}catch{}}}if(!r){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let n=e.namespaceURI||"html",r=function(e,t){let n=t+"::"+e.toLowerCase(),r=Qh.get(n);if(r)return r;let i=document,o="http://www.w3.org/2000/svg"===t?i.createElementNS(t,e):i.createElement(e),a=i.createElement("div");a.setAttribute("data-snapdom-internal",""),a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(o),i.documentElement.appendChild(a);let s=getComputedStyle(o),l={};for(let e of Nh)l[e]=s.getPropertyValue(e)||"";return a.remove(),Qh.set(n,l),l}(e.tagName,n);for(let e of Nh){let n=i.getPropertyValue(e)||"",o=r[e]||"";if(n&&n!==o)try{t.style.setProperty(e,n.trim())}catch{}}}}function Rh(e){return!!(!e||e.startsWith("data:")||e.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(e)&&e.length<200)}Pd(),Pd(),Kf(),ud(),ud();var Uh="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]";var Hh=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function Oh(e,t){if(!e)return null;let n=0;try{n=t?t.getBoundingClientRect().width||t.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let t of e.split(",")){let e=t.trim().split(/\s+/);if(!e[0])continue;let i=e[1]||"",o=1;/^\d*\.?\d+x$/i.test(i)?o=parseFloat(i):/^\d+w$/i.test(i)&&(o=parseInt(i,10)/n),r.push({url:e[0],d:o})}if(!r.length)return null;r.sort((e,t)=>e.d-t.d);let i=window.devicePixelRatio||1;return(r.find(e=>e.d>=i)||r[r.length-1]).url}function qh(e,t){let n=e.currentSrc||"";if(n&&!Rh(n))return n;let r=t.querySelectorAll("source[srcset]"),i=null;for(let t of r){let n=t.getAttribute("srcset");if(!n||Rh(n))continue;let r=t.getAttribute("type");if(r&&!Hh.test(r.trim()))continue;let o=t.getAttribute("media");if(o)try{if(window.matchMedia(o).matches)return Oh(n,e)}catch{}i||(i=Oh(n,e))}return i}function Ph(e){let t=[e.getAttribute("data-src"),e.getAttribute("data-lazy-src"),e.getAttribute("data-original"),e.getAttribute("data-hi-res-src")];for(let e of t)if(e&&!Rh(e))return e;let n=e.getAttribute("data-srcset")||e.getAttribute("data-lazy-srcset");if(n){let e=n.split(",")[0].trim().split(/\s+/)[0];if(e&&!Rh(e))return e}return null}async function $h(e,t={}){if(!e||1!==e?.nodeType||!1===t.resolvePicturePlaceholders)return null;let{timeout:n,concurrency:r,resolveLazySrc:i,silent:o,useProxy:a}=function(e={}){let t=e.pictureResolver&&"object"==typeof e.pictureResolver?e.pictureResolver:{};return{timeout:t.timeout??5e3,concurrency:t.concurrency??4,resolveLazySrc:!1!==t.resolveLazySrc,silent:t.silent??!1,useProxy:"string"==typeof e.useProxy?e.useProxy:""}}(t);if(!function(e,t){return!!(e&&1===e?.nodeType&&(e.matches?.("picture")||e.querySelector("picture")||t&&(e.matches?.(Uh)||e.querySelector(Uh))))}(e,i))return null;let s=[],l=[];async function c(e){let t=await ad(e,{as:"dataURL",timeout:n,useProxy:a,silent:!0});return t.ok?t.data:null}let u=Array.from(e.querySelectorAll("picture"));e.matches?.("picture")&&u.unshift(e);for(let e of u){let t=e.querySelector("img");if(!t)continue;if(!Rh(t.getAttribute("src")||""))continue;let n=qh(t,e);n&&l.push(async()=>{let r=await c(n);if(!r)return void(o||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${n.slice(0,60)}`));let i=t.getAttribute("src"),a=t.getAttribute("srcset"),l=t.getAttribute("sizes"),u=[];t.src=r,t.setAttribute("src",r),t.removeAttribute("srcset"),t.removeAttribute("sizes");let f=e.querySelectorAll("source");for(let e of f)u.push({el:e,parent:e.parentElement,next:e.nextSibling}),e.remove();s.push(()=>{null!==i?t.setAttribute("src",i):t.removeAttribute("src"),null!==a&&t.setAttribute("srcset",a),null!==l&&t.setAttribute("sizes",l);for(let{el:e,parent:t,next:n}of u)t&&t.insertBefore(e,n)})})}if(i){let t=Array.from(e.querySelectorAll("img"));"img"===e.localName&&t.unshift(e);for(let e of t){if(e.closest("picture")&&Rh(e.getAttribute("src")||""))continue;let t=e.getAttribute("src")||"",n=Ph(e);n&&Rh(t)&&l.push(async()=>{let t=await c(n);if(!t)return;let r=e.getAttribute("src");e.src=t,e.setAttribute("src",t),e.removeAttribute("srcset"),e.removeAttribute("sizes"),s.push(()=>{null!==r?e.setAttribute("src",r):e.removeAttribute("src")})})}}return 0===l.length?null:(await async function(e){for(let t=0;t<e.length;t+=r){let n=e.slice(t,t+r);await Promise.allSettled(n.map(e=>e()))}}(l),async function(){for(let e of s)try{e()}catch{}})}function zh(e,t,n){return n?Promise.all(e.map(e=>new Promise(n=>t(e,n)))):Promise.all(e.map(e=>new Promise(r=>{!function i(){Ld(n=>{!n||"function"!=typeof n.timeRemaining||n.timeRemaining()>0?t(e,r):i()},{fast:n})}()})))}function jh(e,t,n){return e?(e=(e=(e=(e=(e=e.replace(/:host\(([^)]+)\)/g,(e,n)=>`:where(${t}:is(${n.trim()}))`)).replace(/:host\b/g,`:where(${t})`)).replace(/:host-context\(([^)]+)\)/g,(e,n)=>`:where(:where(${n.trim()}) ${t})`)).replace(/::slotted\(([^)]+)\)/g,(e,n)=>`:where(${t} ${n.trim()})`)).replace(/(^|})(\s*)([^@}{]+){/g,(e,r,i,o)=>{let a=function(e,t,n=!0,r){return e.split(",").map(e=>e.trim()).filter(Boolean).map(e=>{if(e.startsWith(":where(")||e.startsWith("@"))return e;let i=n?function(e,t){if(!(e=e.trim()))return e;let n=t?`[data-sd-slotted~="${t}"]`:"[data-sd-slotted]";return e.endsWith(":not([data-sd-slotted])")||e.endsWith(`:not(${n})`)?e:`${e}:not(${n})`}(e,r):e;return`:where(${t} ${i})`}).join(", ")}(o,t,!0,n);return`${r}${i}${a}{`}),e):""}function Vh(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let e=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(e)return e}catch{}return""}function Yh(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),0===t||0===n)try{let r=getComputedStyle(e);if(0===t){let e=parseFloat(r.width);!isNaN(e)&&e>0&&(t=e)}if(0===n){let e=parseFloat(r.height);!isNaN(e)&&e>0&&(n=e)}}catch{}if(0===t||0===n)try{if(0===t){let n=parseFloat(e.getAttribute("width"));!isNaN(n)&&n>0&&(t=n)}if(0===n){let t=parseFloat(e.getAttribute("height"));!isNaN(t)&&t>0&&(n=t)}}catch{}if((0===t||0===n)&&(e.naturalWidth||e.naturalHeight))try{0===t&&e.naturalWidth>0&&(t=e.naturalWidth),0===n&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}async function Wh(e,t,n){let r=await async function(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<t&&(!r||!r.body&&!r.documentElement);)await new Promise(e=>setTimeout(e,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:a}=function(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let t=getComputedStyle(e);n=parseFloat(t.borderLeftWidth)||0,r=parseFloat(t.borderRightWidth)||0,i=parseFloat(t.borderTopWidth)||0,o=parseFloat(t.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(t.width-(n+r))),contentHeight:Math.max(0,Math.round(t.height-(i+o))),rect:t}}(e),s=n?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||"function"!=typeof s.toPng)throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let l,c={...n,scale:1,clip:null},u=function(e,t,n){let r=e.defaultView,i=r?r.scrollX:0,o=r?r.scrollY:0,a=e.body?e.body.scrollLeft:0,s=e.body?e.body.scrollTop:0,l=e.documentElement?e.documentElement.scrollLeft:0,c=e.documentElement?e.documentElement.scrollTop:0,u=0,f=0,d=0,h=0;try{let t=r&&e.body?r.getComputedStyle(e.body):null;t&&(u=(parseFloat(t.marginTop)||0)+(parseFloat(t.paddingTop)||0),f=(parseFloat(t.marginRight)||0)+(parseFloat(t.paddingRight)||0),d=(parseFloat(t.marginBottom)||0)+(parseFloat(t.paddingBottom)||0),h=(parseFloat(t.marginLeft)||0)+(parseFloat(t.paddingLeft)||0))}catch{}try{e.documentElement.setAttribute("data-sd-pinned","")}catch{}let p=e.createElement("style");return p.setAttribute("data-sd-iframe-pin",""),p.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${u}px ${f}px ${d}px ${h}px !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(p),()=>{try{p.remove()}catch{}try{e.documentElement.removeAttribute("data-sd-pinned")}catch{}try{r&&"function"==typeof r.scrollTo&&r.scrollTo(i,o),e.body&&(e.body.scrollLeft=a,e.body.scrollTop=s),e.documentElement&&(e.documentElement.scrollLeft=l,e.documentElement.scrollTop=c)}catch{}}}(r,i,o),f=Xf.session.nodeMap,d=Xf.session.styleMap,h=Xf.session.styleCache;try{l=await s.toPng(r.documentElement,c)}finally{u(),Xf.session.nodeMap=f,Xf.session.styleMap=d,Xf.session.styleCache=h}l.style.display="block",l.style.width=`${i}px`,l.style.height=`${o}px`;let p=document.createElement("div");return t.nodeMap.set(p,e),Fh(e,p,t,n),p.style.overflow="hidden",p.style.display="block",p.style.width||(p.style.width=`${Math.round(a.width)}px`),p.style.height||(p.style.height=`${Math.round(a.height)}px`),p.appendChild(l),p}var Gh=new _f(80);async function Jh(e){if(Xf.resource?.has(e))return Xf.resource.get(e);if(Gh.has(e))return Gh.get(e);let t=(async()=>{let t=await ad(e,{as:"dataURL",silent:!0});if(!t.ok||"string"!=typeof t.data)throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return Xf.resource?.set(e,t.data),t.data})();Gh.set(e,t);try{let n=await t;return Gh.set(e,n),n}catch(t){throw Gh.delete(e),t}}var _h=/\bblob:[^)"'\s]+/g;async function Xh(e){if(!e||-1===e.indexOf("blob:"))return e;let t=Array.from(new Set(e.match(_h)||[]));if(0===t.length)return e;let n=e;for(let e of t)try{let t=await Jh(e);n=n.split(e).join(t)}catch{}return n}function Kh(e){return"string"==typeof e&&e.startsWith("blob:")}function Zh(e){return(e||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.match(/^(\S+)(\s+.+)?$/);return t?{url:t[1],desc:t[2]||""}:null}).filter(Boolean)}function ep(e){return e.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function tp(e,t){let n=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&n.unshift(e),n}Hd();var np=new Map,rp=new Set(["IFRAME"]);function ip(e,t){np.set(String(e).toUpperCase(),t)}function op(e){let{width:t,height:n}=Yh(e),r=t,i=n;if(!r||!i){let t=e.getBoundingClientRect();r=r||t.width||0,i=i||t.height||0}let o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,o}var ap=200,sp=new Set(["img","canvas","video","iframe","object","embed"]);function lp(e,t){return e.right>=t.left-ap&&e.left<=t.right+ap&&e.bottom>=t.top-ap&&e.top<=t.bottom+ap}async function cp(e,t,n){if(!e)throw new Error("Invalid node");let r,i=new Set,o=null,a=null;if(e.nodeType===Node.ELEMENT_NODE){let n=(e.localName||e.tagName||"").toLowerCase();if("snapdom-sandbox"===e.id||e.hasAttribute("data-snapdom-sandbox")||bd.has(n))return null;if("foreignobject"===n&&e.parentElement?.closest?.("foreignObject"))return Od(t,"Nested <foreignObject> skipped (SVG spec limitation — not rendered by browsers)"),null;if("source"===n&&"picture"===e.parentElement?.localName)return null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if("exclude"===e.getAttribute("data-capture")){if("hide"===n.excludeMode)return op(e);if("remove"===n.excludeMode)return null}if(n.exclude&&Array.isArray(n.exclude))for(let t of n.exclude)try{if(e.matches?.(t)){if("hide"===n.excludeMode)return op(e);if("remove"===n.excludeMode)return null}}catch(e){console.warn(`Invalid selector in exclude option: ${t}`,e)}if("function"==typeof n.filter)try{if(!n.filter(e)){if("hide"===n.filterMode)return op(e);if("remove"===n.filterMode)return null}}catch(e){console.warn("Error in filter function:",e)}if(t.clip&&function(e,t){if(e===t.root)return!1;let n;try{n=e.getBoundingClientRect()}catch{return!1}if(0===n.width&&0===n.height)return!1;let r=yd(e);if("inline"===r.display&&!sp.has((e.localName||"").toLowerCase()))return!1;let i=t.rect,o=e.scrollWidth||0,a=e.scrollHeight||0,s={left:"rtl"===r.direction?Math.min(n.left,n.right-o):n.left,top:n.top,right:Math.max(n.right,n.left+o),bottom:Math.max(n.bottom,n.top+a)},l=r.writingMode||"";if((l.startsWith("vertical")||l.startsWith("sideways"))&&(s.top=Math.min(n.top,n.bottom-a),s.left=Math.min(s.left,n.right-o)),lp(s,i))return!1;let c=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;c.nextNode();){let e=c.currentNode.getBoundingClientRect();if((e.width>0||e.height>0)&&lp(e,i))return!1}return!0}(e,t.clip))return function(e,t,n){let r=e.cloneNode(!1);"IMG"===e.tagName&&(r.removeAttribute("src"),r.removeAttribute("srcset"),r.removeAttribute("sizes")),Fh(e,r,t,n);let{width:i,height:o}=Yh(e);return i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),o>0&&(r.style.height=`${o}px`,r.style.minHeight=`${o}px`,r.style.maxHeight=`${o}px`),r.style.visibility="hidden",r.style.overflow="hidden",r.style.boxSizing="border-box",r}(e,t,n);if(n.__resolveNodeHooks)for(let r of n.__resolveNodeHooks){let i;try{i=await r(e,n)}catch(e){Od(t,"resolveNode plugin hook failed",e)}if(null===i)return null;if(i instanceof Node)return i.nodeType===Node.ELEMENT_NODE&&(t.nodeMap.set(i,e),Fh(e,i,t,n)),i}{let r=rp.has(e.tagName)&&np.get(e.tagName);if(r){let i=await r(e,t,n);if(void 0!==i)return i}}if("placeholder"===e.getAttribute("data-capture")){let r=e.cloneNode(!1);t.nodeMap.set(r,e),Fh(e,r,t,n);let i=document.createElement("div");return i.textContent=e.getAttribute("data-placeholder-text")||"",i.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",r.appendChild(i),r}{let r=!rp.has(e.tagName)&&np.get(e.tagName);if(r){let i=await r(e,t,n);if(void 0!==i)return i}}try{if(r=e.cloneNode(!1),r.attributes?.length)try{for(let e of r.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(e.value)&&r.setAttribute(e.name,e.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Lh(e,r),t.nodeMap.set(r,e),"IMG"===e.tagName){!function(e,t){try{let n=null,r=yd(e).content;if(r&&r.includes("url(")){let e=r.match(/url\(["']?([^"')]+)["']?\)/);e&&(n=e[1])}let i=e.closest?.("picture"),o=n||(i?qh(e,i):e.currentSrc)||e.src||Oh(e.getAttribute("srcset"),e)||"";if(!o)return;t.setAttribute("src",o),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}(e,r);try{let{width:t,height:n}=Yh(e),i=Math.round(t||0),o=Math.round(n||0);i&&(r.dataset.snapdomWidth=String(i)),o&&(r.dataset.snapdomHeight=String(o))}catch(e){Od(t,"getUnscaledDimensions for IMG failed",e)}try{let t=e.getAttribute("style")||"",n=window.getComputedStyle(e),i=e=>{let r=t.match(new RegExp(`${e}\\s*:\\s*([^;]+)`,"i")),i=r?r[1].trim():n.getPropertyValue(e);return/%|auto/i.test(String(i||""))},o=parseInt(r.dataset.snapdomWidth||"0",10),a=parseInt(r.dataset.snapdomHeight||"0",10),s=i("width")||!o,l=i("height")||!a;s&&o&&(r.style.width=`${o}px`),l&&a&&(r.style.height=`${a}px`);let c=n.getPropertyValue("object-fit"),u=n.getPropertyValue("object-position");c&&"fill"!==c?(r.style.objectFit=c,u&&(r.style.objectPosition=u)):(o&&(r.style.minWidth=`${o}px`),a&&(r.style.minHeight=`${a}px`))}catch(e){Od(t,"IMG dimension freeze failed",e)}}}catch(t){throw console.error("[Snapdom] Failed to clone node:",e,t),t}let s=null;if(e instanceof HTMLTextAreaElement){let{width:t,height:n}=Yh(e),i=t||e.getBoundingClientRect().width||0,o=n||e.getBoundingClientRect().height||0;i&&(r.style.width=`${i}px`),o&&(r.style.height=`${o}px`)}if(e instanceof HTMLInputElement){let n=(e.type||"text").toLowerCase();if("checkbox"!==n&&"radio"!==n||!function(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}())r.value=e.value,r.setAttribute("value",e.value),void 0!==e.checked&&(r.checked=e.checked,e.checked&&r.setAttribute("checked",""),e.indeterminate&&(r.indeterminate=e.indeterminate));else{let{el:n,applyVisual:i}=function(e){let t,{width:n,height:r}=Yh(e),i=e.getBoundingClientRect();try{t=window.getComputedStyle(e)}catch{}let o=t?parseFloat(t.width):NaN,a=t?parseFloat(t.height):NaN,s=Math.round(n||i.width||0),l=Math.round(r||i.height||0),c=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,s||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,l||16),f="checkbox"===(e.type||"text").toLowerCase(),d=!!e.checked,h=!!e.indeterminate,p=Math.max(Math.min(c,u),12),g="middle";try{t&&t.verticalAlign&&(g=t.verticalAlign)}catch{}let m=document.createElement("div");m.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),m.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");function v(){let e="#0a6ed1";try{t&&(e=t.accentColor||t.color||e)}catch{}let n=p-2;if(y.innerHTML="",f){let t=document.createElementNS("http://www.w3.org/2000/svg","rect");if(t.setAttribute("x",String(1)),t.setAttribute("y",String(1)),t.setAttribute("width",String(n)),t.setAttribute("height",String(n)),t.setAttribute("rx","2"),t.setAttribute("ry","2"),t.setAttribute("fill",d?e:"none"),t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(2)),y.appendChild(t),d){let e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",`M 3 ${p/2} L ${p/2-1} ${p-1-2} L ${p-1-2} 3`),e.setAttribute("stroke","white"),e.setAttribute("stroke-width",String(Math.max(1.5,2))),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),y.appendChild(e)}else if(h){let t=document.createElementNS("http://www.w3.org/2000/svg","rect"),r=Math.max(6,n-4);t.setAttribute("x",String((p-r)/2)),t.setAttribute("y",String((p-2)/2)),t.setAttribute("width",String(r)),t.setAttribute("height",String(2)),t.setAttribute("fill",e),t.setAttribute("rx","1"),y.appendChild(t)}}else{let t=document.createElementNS("http://www.w3.org/2000/svg","circle");if(t.setAttribute("cx",String(p/2)),t.setAttribute("cy",String(p/2)),t.setAttribute("r",String((p-2)/2)),t.setAttribute("fill",d?e:"none"),t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(2)),y.appendChild(t),d){let e=document.createElementNS("http://www.w3.org/2000/svg","circle"),t=Math.max(2,.35*(p-4));e.setAttribute("cx",String(p/2)),e.setAttribute("cy",String(p/2)),e.setAttribute("r",String(t)),e.setAttribute("fill","white"),y.appendChild(e)}}m.style.setProperty("width",`${p}px`,"important"),m.style.setProperty("height",`${p}px`,"important"),m.style.setProperty("min-width",`${p}px`,"important"),m.style.setProperty("min-height",`${p}px`,"important")}return y.setAttribute("width",String(p)),y.setAttribute("height",String(p)),y.setAttribute("viewBox",`0 0 ${p} ${p}`),m.appendChild(y),v(),{el:m,applyVisual:v}}(e);t.nodeMap.set(n,e),s=i,r=n}}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let t=window.getComputedStyle(e,"::placeholder"),n=t&&t.color;if(n&&"rgba(0, 0, 0, 0)"!==n){let e="snapdom-ph-"+(1e6*Math.random()|0);r.classList.add(e);let i=document.createElement("style");i.textContent=`.${e}::placeholder{color:${n}!important;opacity:${t.opacity||"1"}!important;-webkit-text-fill-color:${n}!important;}`,r.prepend(i)}}catch{}if(e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(a=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&r.setAttribute("disabled",""),e.required&&r.setAttribute("required",""),e.readOnly&&r.setAttribute("readonly","");let t=e;void 0!==t.min&&""!==t.min&&r.setAttribute("min",t.min),void 0!==t.max&&""!==t.max&&r.setAttribute("max",t.max),void 0!==t.pattern&&""!==t.pattern&&r.setAttribute("pattern",t.pattern);let n=e.getAttribute("aria-invalid");null!==n&&r.setAttribute("aria-invalid",n)}if(Th(e)||Fh(e,r,t,n),s&&s(),e instanceof SVGElement&&!Th(e)){let t=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let n=window.getComputedStyle(e);for(let e of t){let t=n.getPropertyValue(e);t&&r.style.setProperty(e,t)}}catch{}}if(e.shadowRoot){try{let t=e.shadowRoot.querySelectorAll("slot");for(let e of t){let t=e.assignedNodes?.()||[];for(let e of t)i.add(e)}}catch{}let o=function(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}(t),a=`[data-sd="${o}"]`;t.shadowScopes||=new WeakMap,t.shadowScopes.set(e.shadowRoot,o);try{r.setAttribute("data-sd",o)}catch{}let s=function(e){let t="";try{e.querySelectorAll("style").forEach(e=>{t+=(e.textContent||"")+"\n"});let n=e.adoptedStyleSheets||[];for(let e of n)try{if(e&&e.cssRules)for(let n of e.cssRules)t+=n.cssText+"\n"}catch{}}catch{}return t}(e.shadowRoot),l=jh(s,a,o),c=function(e){let t=new Set;if(!e)return t;let n,r=/var\(\s*(--[A-Za-z0-9_-]+)\b/g;for(;n=r.exec(e);)t.add(n[1]);return t}(s),u=function(e,t,n){let r=[];for(let n of t){let t=Vh(e,n);t&&r.push(`${n}: ${t};`)}return r.length?`${n}{${r.join("")}}\n`:""}(e,c,a);!function(e,t,n){if(!t)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}(r,u+l,o);let f=document.createDocumentFragment(),d=(e,r)=>{if(e.nodeType===Node.ELEMENT_NODE&&"STYLE"===e.tagName)return r(null);cp(e,t,n).then(e=>{r(e||null)}).catch(()=>{r(null)})},h=await zh(Array.from(e.shadowRoot.childNodes),d,n.fast);f.append(...h.filter(e=>!!e)),r.appendChild(f)}if("SLOT"===e.tagName){let r=t.shadowScopes?.get(e.getRootNode()),i=e.assignedNodes?.()||[],o=i.length?e.assignedNodes?.({flatten:!0})||i:[],a=o.length?o:Array.from(e.childNodes),s=document.createDocumentFragment(),l=(e,o)=>{cp(e,t,n).then(e=>{e&&i.length&&function(e,t){if(!e)return;let n=e=>{let n=e.getAttribute("data-sd-slotted")||"";t?` ${n} `.includes(` ${t} `)||e.setAttribute("data-sd-slotted",n?`${n} ${t}`:t):e.setAttribute("data-sd-slotted",n)};e.nodeType===Node.ELEMENT_NODE&&n(e),e.querySelectorAll?.("*").forEach(n)}(e,r),o(e||null)}).catch(()=>{o(null)})},c=await zh(Array.from(a),l,n.fast);return s.append(...c.filter(e=>!!e)),s}let l=await zh(Array.from(e.childNodes),function(r,o){if(i.has(r)||e.shadowRoot&&!r.assignedSlot)return o(null);cp(r,t,n).then(e=>{o(e||null)}).catch(()=>{o(null)})},n.fast);if(r.append(...l.filter(e=>!!e)),null!==o&&r instanceof HTMLSelectElement){r.value=o;for(let e of r.options)e.value===o?e.setAttribute("selected",""):e.removeAttribute("selected")}return null!==a&&r instanceof HTMLTextAreaElement&&(r.textContent=a),r}ip("IFRAME",async function(e,t,n){let r=!1;try{r=!(!e.contentDocument&&!e.contentWindow?.document)}catch(e){Od(t,"iframe same-origin probe failed",e)}if(r)try{return await Wh(e,t,n)}catch(e){console.warn("[SnapDOM] iframe rasterization failed, fallback:",e)}if(r||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",e),n.placeholders){let{width:r,height:i}=Yh(e),o=document.createElement("div");return o.style.cssText=`width:${r}px;height:${i}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Fh(e,o,t,n),o}{let{width:r,height:i}=Yh(e),o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,Fh(e,o,t,n),o}}),ip("CANVAS",async function(e,t,n){let r="";try{let t=e.getContext("2d",{willReadFrequently:!0});try{t&&t.getImageData(0,0,1,1)}catch{}if((Ud()||!t)&&await Rd(),r=e.toDataURL("image/png"),!r||"data:,"===r){try{t&&t.getImageData(0,0,1,1)}catch{}if(await Rd(),r=e.toDataURL("image/png"),!r||"data:,"===r){let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n&&(n.drawImage(e,0,0),r=t.toDataURL("image/png"))}}}catch(e){Od(t,"Canvas toDataURL failed, using empty/fallback",e)}n&&n.debug&&r&&function(e){try{let t=Math.max(1,Math.min(32,e.width)),n=Math.max(1,Math.min(32,e.height)),r=document.createElement("canvas");r.width=t,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(e,0,0,t,n);let o=i.getImageData(0,0,t,n).data;for(let e=3;e<o.length;e+=4)if(0!==o[e])return!1;return!0}catch{return!1}}(e)&&Od(t,"canvas is empty at capture time — capture it after its first frame is drawn",e);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(e){Od(t,"img decoding/loading hints failed",e)}r&&(i.src=r),i.width=e.width,i.height=e.height;let{width:o,height:a}=Yh(e);return o>0&&(i.style.width=`${o}px`),a>0&&(i.style.height=`${a}px`),t.nodeMap.set(i,e),Fh(e,i,t,n),i}),ip("VIDEO",async function(e,t,n){let r="";try{let t=document.createElement("canvas");t.width=e.videoWidth||e.offsetWidth||320,t.height=e.videoHeight||e.offsetHeight||240;let n=t.getContext("2d");n&&(n.drawImage(e,0,0,t.width,t.height),r=t.toDataURL("image/png"),(!r||"data:,"===r)&&(r=""))}catch(e){Od(t,"Video frame capture failed, using poster fallback",e)}let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch{}r?i.src=r:e.poster&&(i.src=e.poster),i.width=e.videoWidth||e.offsetWidth||0,i.height=e.videoHeight||e.offsetHeight||0;let{width:o,height:a}=Yh(e);return o>0&&(i.style.width=`${o}px`),a>0&&(i.style.height=`${a}px`),i.style.objectFit="contain",t.nodeMap.set(i,e),Fh(e,i,t,n),i}),ip("AUDIO",async function(e,t,n){if(!e.controls)return;let{width:r,height:i}=Yh(e),o=Math.round(r||e.offsetWidth||300),a=Math.round(i||e.offsetHeight||54),s=a/2,l=Math.max(4,.16*a),c=.34*a,u=o-.34*a,f=c+l+.55*a,d=Math.max(0,u-.7*a-f),h=Math.max(9,Math.round(.24*a)),p=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${a}" viewBox="0 0 ${o} ${a}"><rect width="${o}" height="${a}" rx="${Math.min(a/2,10)}" fill="#f1f3f4"/><path d="M ${c} ${s-l} L ${c+l} ${s} L ${c} ${s+l} Z" fill="#5f6368"/><rect x="${f}" y="${s-1.5}" width="${d}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${f}" cy="${s}" r="${Math.max(3,.09*a)}" fill="#5f6368"/><text x="${u}" y="${s}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,g=document.createElement("img");try{g.decoding="sync",g.loading="eager"}catch{}return g.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,g.width=o,g.height=a,g.style.width=`${o}px`,g.style.height=`${a}px`,t.nodeMap.set(g,e),Fh(e,g,t,n),g}),Pd(),rd(),Qd(),Kf(),Kf();var up=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],fp=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),dp=[],hp=new Set;function pp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gp(e){let t="string"==typeof e?e:"",n=[...up,...dp];for(let e of n)if(e instanceof RegExp&&e.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function mp(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var yp=new Map;function vp(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&"currentcolor"!==t.toLowerCase())return t;let r=e.color?.trim();return r&&"inherit"!==r?r:"#000"}async function Ap(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,c=function(e=""){let t,n=Object.create(null),r=String(e||""),i=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g;for(;t=i.exec(r);)n[t[1].toUpperCase()]=Number(t[2]);return n}(o),{familyForMeasure:u,familyForCanvas:f}=await async function(e,t,n){let r=String(e||""),i=r.toLowerCase(),o=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),s="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?s="rounded":/\bsharp\b/.test(o)?s="sharp":/\boutlined\b/.test(o)&&(s="outlined");let l=null;if(1===a&&("outlined"===s&&fp.materialIconsFilled?l={url:fp.materialIconsFilled,alias:"snapdom-mi-filled"}:"rounded"===s&&fp.materialIconsRound?l={url:fp.materialIconsRound,alias:"snapdom-mi-round"}:"sharp"===s&&fp.materialIconsSharp&&(l={url:fp.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!yp.has(l.alias))try{let e=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(e),await e.load(),yp.set(l.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let c=`"${l.alias}"`;return{familyForMeasure:c,familyForCanvas:c}}(s,a,c);await async function(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}(f.replace(/^["']+|["']+$/g,""),r);let d=document.createElement("span");d.setAttribute("data-snapdom-internal",""),d.textContent=e,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=u,d.style.fontWeight=String(n||"normal"),d.style.fontSize=`${r}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=i,document.body.appendChild(d);let h=d.getBoundingClientRect(),p=Math.max(1,Math.ceil(h.width)),g=Math.max(1,Math.ceil(h.height));document.body.removeChild(d);let m=document.createElement("canvas");m.width=p*l,m.height=g*l;let y=m.getContext("2d");y.scale(l,l),y.font=`${n?`${n} `:""}${r}px ${f}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:m.toDataURL(),width:p,height:g}}async function bp(e,t,n,r=32,i="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.setAttribute("data-snapdom-internal",""),a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let s=a.getBoundingClientRect(),l=Math.ceil(s.width),c=Math.ceil(s.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,l*o),u.height=Math.max(1,c*o);let f=u.getContext("2d");return f.scale(o,o),f.font=n?`${n} ${r}px "${t}"`:`${r}px "${t}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=i,f.fillText(e,0,0),{dataUrl:u.toDataURL(),width:l,height:c}}ud(),Hd();var wp=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Ip=["katex","mathjax","mathml"];function xp(e){if(!e)return"";for(let t of e.split(",")){let e=t.trim().replace(/^['"]+|['"]+$/g,"");if(e&&!wp.has(e.toLowerCase()))return e}return""}function Cp(e){let t=String(e??"400").trim().toLowerCase();if("normal"===t)return 400;if("bold"===t)return 700;let n=parseInt(t,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Ep(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Bp(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function Sp(e){return e&&"string"==typeof e?e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-"):""}function kp(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let i=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(e=>i.endsWith(e))||n.some(e=>i===e.toLowerCase()||i.endsWith("."+e.toLowerCase())))return!0;let o=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(o)||/\.woff2?(\b|$)/.test(o)||Ip.some(e=>o.includes(e)))return!0;for(let e of t){let t=e.toLowerCase().replace(/\s+/g,"+"),n=e.toLowerCase().replace(/\s+/g,"-"),r=Sp(e);if(o.includes(t)||o.includes(n)||r&&o.includes(r))return!0}return!1}catch{return!1}}function Fp(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(e,n,r)=>{let i=(r||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return e;let o=i;try{o=new URL(i,t||location.href).href}catch{}return`url("${o}")`})}var Dp=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g;async function Np(e,t,n){if(!e)return e;let r=new Set;function i(e,t){try{return new URL(e,t||location.href).href}catch{return e}}let o=Fp(e,t||location.href);return o=await async function e(t,o,a=0){if(a>4)return console.warn(`[snapDOM] @import depth exceeded (4) at ${o}`),t;let s,l="",c=0;for(;s=Dp.exec(t);){l+=t.slice(c,s.index),c=Dp.lastIndex;let u=i((s[2]||s[4]||"").trim(),o);if(r.has(u)){console.warn(`[snapDOM] Skipping circular @import: ${u}`);continue}r.add(u);let f="";try{let e=await ad(u,{as:"text",useProxy:n,silent:!0});e.ok&&"string"==typeof e.data&&(f=e.data)}catch{}f?(f=Fp(f,u),f=await e(f,u,a+1),l+=`\n/* inlined: ${u} */\n${f}\n`):l+=s[0]}return l+=t.slice(c),l}(o,t||location.href,0),o}var Mp=/url\((["']?)([^"')]+)\1\)/g,Tp=/@font-face[^{}]*\{[^}]*\}/g;function Qp(e,t,n=""){return(e.match(new RegExp(`${t}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Lp(e){if(!e)return[];let t=[],n=e.split(",").map(e=>e.trim()).filter(Boolean);for(let e of n){let n=e.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!n)continue;let r=n[1],i=n[2],o=e=>{if(!e.includes("?"))return parseInt(e,16);return[parseInt(e.replace(/\?/g,"0"),16),parseInt(e.replace(/\?/g,"F"),16)]};if(i){let e=o(r),n=o(i),a=Array.isArray(e)?e[0]:e,s=Array.isArray(n)?n[1]:n;t.push([Math.min(a,s),Math.max(a,s)])}else{let e=o(r);Array.isArray(e)?t.push([e[0],e[1]]):t.push([e,e])}}return t}function Rp(e,t){if(!t.length||!e||0===e.size)return!0;for(let n of e)for(let[e,r]of t)if(n>=e&&n<=r)return!0;return!1}function Up(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Mp)){let e=(r[2]||"").trim();if(e&&!e.startsWith("data:")){if(!/^https?:/i.test(e))try{e=new URL(e,t||location.href).href}catch{}n.push(e)}}return n}async function Hp(e,t,n=""){let r=e;for(let i of e.matchAll(Mp)){let e=Zf(i[0]);if(!e)continue;let o=e;if(!o.startsWith("http")&&!o.startsWith("data:"))try{o=new URL(o,t||location.href).href}catch{}if(!gp(o)){if(Xf.resource?.has(o)){Xf.font?.add(o),r=r.replace(i[0],`url(${Xf.resource.get(o)})`);continue}try{let e=await ad(o,{as:"dataURL",useProxy:n,silent:!0});if(e.ok&&"string"==typeof e.data){let t=e.data;Xf.resource?.set(o,t),Xf.font?.add(o),r=r.replace(i[0],`url(${t})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",o)}}}return r}function Op(e={}){let t=new Set((e.families||[]).map(e=>String(e).toLowerCase())),n=new Set((e.domains||[]).map(e=>String(e).toLowerCase())),r=new Set((e.subsets||[]).map(e=>String(e).toLowerCase()));return(e,i)=>{if(t.size&&t.has(e.family.toLowerCase()))return!0;if(n.size)for(let t of e.srcUrls)try{if(n.has(new URL(t).host.toLowerCase()))return!0}catch{}if(r.size){let e=function(e){if(!e.length)return null;let t=(t,n)=>e.some(([e,r])=>!(r<t||e>n)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),i=t(880,1023),o=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}(i);if(e&&r.has(e))return!0}return!1}}var qp=new WeakMap,Pp=0;function $p(e,t,n,r,i,o){let a=Array.from(e||[]).sort().join("|"),s=t?JSON.stringify({families:(t.families||[]).map(e=>String(e).toLowerCase()).sort(),domains:(t.domains||[]).map(e=>String(e).toLowerCase()).sort(),subsets:(t.subsets||[]).map(e=>String(e).toLowerCase()).sort()}):"",l=(n||[]).map(e=>`${(e.family||"").toLowerCase()}::${e.weight||"normal"}::${e.style||"normal"}::${e.src||""}`).sort().join("|"),c=r||"",u=(i||[]).map(e=>String(e).toLowerCase()).sort().join("|"),f=function(e){let t=qp.get(e);return void 0===t&&(t=Pp++,qp.set(e,t)),t}(o||document);return`fonts-embed-css::req=${a}::ex=${s}::lf=${l}::px=${c}::fd=${u}::doc=${f}`}async function zp(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let o=(e,t)=>{try{return new URL(e,t||location.href).href}catch{return e}};for(let e of i){if(e.type===CSSRule.IMPORT_RULE&&e.styleSheet){let i=e.href?o(e.href,t):t;if(r.depth>=4){console.warn(`[snapDOM] CSSOM import depth exceeded (4) at ${i}`);continue}if(i&&r.visitedSheets.has(i)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${i}`);continue}i&&r.visitedSheets.add(i);let a={...r,depth:(r.depth||0)+1};await zp(e.styleSheet,i,n,a);continue}if(e.type===CSSRule.FONT_FACE_RULE){let i=xp((e.style.getPropertyValue("font-family")||"").trim());if(!i||gp(i))continue;let o=(e.style.getPropertyValue("font-weight")||"").trim(),a=(e.style.getPropertyValue("font-style")||"").trim(),s=(e.style.getPropertyValue("font-stretch")||"").trim(),l=(e.style.getPropertyValue("font-variation-settings")||"").trim(),c=(e.style.getPropertyValue("src")||"").trim(),u=(e.style.getPropertyValue("unicode-range")||"").trim(),f=o||"400",d=a||"normal",h=s||"100%",p=(a?`font-style:${a};`:"")+(o?`font-weight:${o};`:"")+(s?`font-stretch:${s};`:"")+(l?`font-variation-settings:${l};`:"")+(u?`unicode-range:${u};`:""),g=r.faceMatchesRequired(i,d,f,h);if(!g&&!r.requiredIndex.has(i.toLowerCase()))continue;let m=Lp(u);if(!Rp(r.usedCodepoints,m))continue;let y={family:i,weightSpec:f,styleSpec:d,stretchSpec:h,unicodeRange:u,srcRaw:c,srcUrls:Up(c,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(y,m))continue;if(!g){r.provisionalFaces.push({family:i.toLowerCase(),block:`@font-face{font-family:${i};src:${c};${p}}`,srcRaw:c,baseHref:t||location.href});continue}if(r.coveredFamilies.add(i.toLowerCase()),/url\(/i.test(c)){let e=await Hp(c,t||location.href,r.useProxy);await n(`@font-face{font-family:${i};src:${e};${p}}`)}else await n(`@font-face{font-family:${i};src:${c};${p}}`)}}}async function jp({required:e,usedCodepoints:t,exclude:n,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],doc:a=document}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let s=new Map;for(let t of e){let[e,n,r,i]=String(t).split("__");if(!e)continue;let o=e.toLowerCase(),a=s.get(o)||[];a.push({w:parseInt(n,10),s:r,st:parseInt(i,10)}),s.set(o,a)}function l(e,t,n,r){let i=String(e).toLowerCase();if(!s.has(i))return!1;let o=s.get(i),a=function(e){let t=String(e||"400").trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let e=Cp(n[1]),t=Cp(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=Cp(t);return{min:r,max:r}}(n),l=function(e){let t=String(e||"normal").trim().toLowerCase();return"italic"===t?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}(t),c=function(e){let t=String(e||"100%").trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let e=parseFloat(n[1]),t=parseFloat(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}(r),u=a.min!==a.max,f=a.min,d=e=>"normal"===l.kind&&"normal"===e||"normal"!==l.kind&&("italic"===e||"oblique"===e),h=!1;for(let e of o){let t=u?e.w>=a.min&&e.w<=a.max:e.w===f,n=d(Ep(e.s)),r=e.st>=c.min&&e.st<=c.max;if(t&&n&&r){h=!0;break}}if(h)return!0;if(!u)for(let e of o){let t=d(Ep(e.s)),n=e.st>=c.min&&e.st<=c.max;if(Math.abs(f-e.w)<=300&&t&&n)return!0}if(!u&&"normal"===l.kind&&o.some(e=>"normal"!==Ep(e.s)))for(let e of o){let t=Math.abs(f-e.w)<=300,n=e.st>=c.min&&e.st<=c.max;if(t&&n)return!0}return!1}let c=Op(n),u=$p(e,n,r,i,o,a);if(Xf.resource?.has(u))return Xf.resource.get(u);let f=function(e){let t=new Set;for(let n of e||[]){let e=String(n).split("__")[0]?.trim();e&&t.add(e)}return t}(e),d=[],h=Dp;for(let e of a.querySelectorAll("style")){let t=e.textContent||"";for(let e of t.matchAll(h)){let t=(e[2]||e[4]||"").trim();t&&!gp(t)&&(a.querySelector(`link[rel="stylesheet"][href="${t}"]`)||d.push(t))}}let p=[];d.length&&await Promise.all(d.map(e=>new Promise(t=>{if(a.querySelector(`link[rel="stylesheet"][href="${e}"]`))return t(null);let n=a.createElement("link");n.rel="stylesheet",n.href=e,n.setAttribute("data-snapdom","injected-import"),n.onload=()=>t(n),n.onerror=()=>t(null),a.head.appendChild(n),p.push(n)})));let g="",m=new Set,y=[],v=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(e=>!!e.href);for(let e of p)try{e.remove()}catch{}for(let e of v)try{if(gp(e.href))continue;let r="",u=!1;try{u=new URL(e.href,location.href).origin===location.origin}catch{}if(!u){let t=Array.isArray(o)?o:[];if(!kp(e.href,f,t))continue}if(u){let t=Array.from(a.styleSheets).find(t=>t.href===e.href);if(t)try{let e=t.cssRules||[];r=Array.from(e).map(e=>e.cssText).join("")}catch{}}if(!r){let t=await ad(e.href,{as:"text",useProxy:i});if(t?.ok&&"string"==typeof t.data&&(r=t.data),gp(e.href))continue}r=await Np(r,e.href,i);let d="";for(let o of r.match(Tp)||[]){let r=xp(Qp(o,"font-family"));if(!r||gp(r))continue;let a=Qp(o,"font-weight","400"),u=Qp(o,"font-style","normal"),f=Qp(o,"font-stretch","100%"),h=Qp(o,"unicode-range"),p=Qp(o,"src"),g=Up(p,e.href),v=l(r,u,a,f);if(!v&&!s.has(r.toLowerCase()))continue;let A=Lp(h);if(!Rp(t,A))continue;let b={family:r,weightSpec:a,styleSpec:u,stretchSpec:f,unicodeRange:h,srcRaw:p,srcUrls:g,href:e.href};n&&c(b,A)||(v?(m.add(r.toLowerCase()),d+=/url\(/i.test(p)?await Hp(o,e.href,i):o):y.push({family:r.toLowerCase(),block:o,srcRaw:p,baseHref:e.href}))}d.trim()&&(g+=d)}catch{console.warn("[snapDOM] Failed to process stylesheet:",e.href)}let A={requiredIndex:s,usedCodepoints:t,faceMatchesRequired:l,coveredFamilies:m,provisionalFaces:y,simpleExcluder:n?Op(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let e of a.styleSheets)if(!e.href||!v.some(t=>t.href===e.href))try{let t=e.href||location.origin+"/";t&&A.visitedSheets.add(t),await zp(e,t,async e=>{g+=e},A)}catch{}for(let e of y)m.has(e.family)||(g+=/url\(/i.test(e.srcRaw)?await Hp(e.block,e.baseHref,i):e.block);try{for(let e of a.fonts||[]){if(!e||!e.family||"loaded"!==e.status||!e._snapdomSrc)continue;let t=String(e.family).replace(/^['"]+|['"]+$/g,"");if(gp(t)||!s.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e._snapdomSrc;if(!String(r).startsWith("data:"))if(Xf.resource?.has(e._snapdomSrc))r=Xf.resource.get(e._snapdomSrc),Xf.font?.add(e._snapdomSrc);else if(!Xf.font?.has(e._snapdomSrc))try{let t=await ad(e._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(!t.ok||"string"!=typeof t.data)continue;r=t.data,Xf.resource?.set(e._snapdomSrc,r),Xf.font?.add(e._snapdomSrc)}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",e._snapdomSrc);continue}g+=`@font-face{font-family:'${t}';src:url(${r});font-style:${e.style||"normal"};font-weight:${e.weight||"normal"};}`}}catch{}for(let e of r){if(!e||"object"!=typeof e)continue;let t=String(e.family||"").replace(/^['"]+|['"]+$/g,"");if(!t||gp(t)||!s.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=null!=e.weight?String(e.weight):"normal",o=null!=e.style?String(e.style):"normal",a=null!=e.stretchPct?`${e.stretchPct}%`:"100%",l=String(e.src||""),c=l;if(!c.startsWith("data:"))if(Xf.resource?.has(l))c=Xf.resource.get(l),Xf.font?.add(l);else if(!Xf.font?.has(l))try{let e=await ad(l,{as:"dataURL",useProxy:i,silent:!0});if(!e.ok||"string"!=typeof e.data)continue;c=e.data,Xf.resource?.set(l,c),Xf.font?.add(l)}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",l);continue}g+=`@font-face{font-family:'${t}';src:url(${c});font-style:${o};font-weight:${r};font-stretch:${a};}`}return g&&(g=function(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let i of e.match(t)||[]){let e=xp(Qp(i,"font-family")),t=Qp(i,"font-weight","400"),o=Qp(i,"font-style","normal"),a=Qp(i,"font-stretch","100%"),s=Qp(i,"unicode-range"),l=Qp(i,"src"),c=Up(l,location.href),u=c.length?c.map(e=>String(e).toLowerCase()).sort().join("|"):l.toLowerCase(),f=[String(e||"").toLowerCase(),t,o,a,s.toLowerCase(),u].join("|");n.has(f)||(n.add(f),r.push(i))}if(0===r.length)return e;let i=0;return e.replace(t,()=>r[i++]||"")}(g),Xf.resource?.set(u,g)),g}function Vp(e,t){let n=new Set,r=new Set;if(!e)return{required:n,usedCodepoints:r};let i=e=>{if(e)for(let t of e)r.add(t.codePointAt(0))},o=e=>{let t=function(e){if(!e)return[];let t=[];for(let n of e.split(",")){let e=n.trim().replace(/^['"]+|['"]+$/g,"");e&&(wp.has(e.toLowerCase())||t.push(e))}return t}(e.fontFamily);if(t.length)for(let r of t)n.add(`${r}__${Cp(e.fontWeight)}__${Ep(e.fontStyle)}__${Bp(e.fontStretch)}`)},a=e=>{o(yd(e));for(let t of["::before","::after"]){let n=yd(e,t),a=n&&n.content;if(a&&"none"!==a&&"normal"!==a)if(o(n),/^["']/.test(a))i(a.slice(1,-1));else{let e=a.match(/\\[0-9A-Fa-f]{1,6}/g);if(e)for(let t of e)try{r.add(parseInt(t.slice(1),16))}catch{}}}};a(e);let s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let e=s.currentNode;if(e.nodeType===Node.TEXT_NODE){if(t&&e.parentElement&&!t(e.parentElement))continue;i(e.nodeValue||"")}else{if(t&&!t(e))continue;a(e)}}return{required:n,usedCodepoints:r}}async function Yp(e,t=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(e||[]).filter(Boolean);if(0===r.length)return;let i=()=>{let e=n.createElement("div");e.setAttribute("data-snapdom-internal",""),e.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let t of r){let r=n.createElement("span");r.textContent="AaBbGg1234ÁÉÍÓÚçñ—∞",r.style.fontFamily=`"${t}"`,r.style.fontWeight="700",r.style.fontStyle="italic",r.style.fontSize="32px",r.style.lineHeight="1",r.style.whiteSpace="nowrap",r.style.margin="0",r.style.padding="0",e.appendChild(r)}n.body.appendChild(e),e.offsetWidth,n.body.removeChild(e)};for(let e=0;e<Math.max(1,t);e++)i(),await Rd(),await Rd()}function Wp(e,t=!1){let n="",r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function Gp(e,t=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,e)),i="";for(let[e,t]of n)for(;r>=e;)i+=t,r-=e;return t?i:i.toLowerCase()}function Jp(e,t){switch((t||"decimal").toLowerCase()){case"decimal":default:return String(e);case"decimal-leading-zero":{let t=Math.abs(e);return(e<0?"-":"")+(t<10?"0":"")+String(t)}case"lower-alpha":return Wp(e,!1);case"upper-alpha":return Wp(e,!0);case"lower-roman":return Gp(e,!1);case"upper-roman":return Gp(e,!0)}}function _p(e){let t=new WeakMap,n=e instanceof Document?e.documentElement:e,r=e=>{let t=0,n=e?.parentElement;if(!n)return 0;for(let r of n.children){if(r===e)break;"LI"===r.tagName&&t++}return t},i=(e,t,n)=>{let i,o,a,s=(e=>{let t=new Map;for(let[n,r]of e)t.set(n,r.slice());return t})(e);try{i=n.style?.counterReset||getComputedStyle(n).counterReset}catch{}if(i&&"none"!==i)for(let e of i.split(",")){let n=e.trim().split(/\s+/),r=n[0],i=Number.isFinite(Number(n[1]))?Number(n[1]):0;if(!r)continue;let o=t.get(r);if(o&&o.length){let e=o.slice();e.push(i),s.set(r,e)}else s.set(r,[i])}try{o=n.style?.counterSet||getComputedStyle(n).counterSet}catch{}if(o&&"none"!==o)for(let e of o.split(",")){let t=e.trim().split(/\s+/),n=t[0],r=Number.isFinite(Number(t[1]))?Number(t[1]):0;if(!n)continue;let i=s.get(n)||[];0===i.length&&i.push(0),i[i.length-1]=r,s.set(n,i)}try{a=n.style?.counterIncrement||getComputedStyle(n).counterIncrement}catch{}if(a&&"none"!==a)for(let e of a.split(",")){let t=e.trim().split(/\s+/),n=t[0],r=Number.isFinite(Number(t[1]))?Number(t[1]):1;if(!n)continue;let i=s.get(n)||[];0===i.length&&i.push(0),i[i.length-1]+=r,s.set(n,i)}try{if("list-item"===getComputedStyle(n).display&&(e=>e&&"LI"===e.tagName)(n)){let e=n.parentElement,t=1;if(e&&"OL"===e.tagName){let i=e.getAttribute("start"),o=Number.isFinite(Number(i))?Number(i):1,a=r(n),s=n.getAttribute("value");t=Number.isFinite(Number(s))?Number(s):o+a}else t=1+r(n);let i=s.get("list-item")||[];0===i.length&&i.push(0),i[i.length-1]=t,s.set("list-item",i)}}catch{}return s},o=(e,n,r)=>{let a=i(r,n,e);t.set(e,a);let s=a;for(let t of e.children)s=o(t,a,s);let l=new Map;for(let[e,t]of r){let n=t.length,r=s.get(e);l.set(e,r&&r.length?r.slice(0,n):t.slice())}for(let[e,t]of s)!l.has(e)&&t.length&&!n.has(e)&&l.set(e,t.slice(0,1));return l},a=new Map;return o(n,a,a),{get(e,n){let r=t.get(e)?.get(n);return r&&r.length?r[r.length-1]:0},getStack(e,n){let r=t.get(e)?.get(n);return r?r.slice():[]}}}ud();var Xp=new WeakMap;function Kp(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Zp(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let e=0;e<t.length;e++){let i=t[e];if("STYLE"===i.tagName){n+=`S${i.textContent?i.textContent.length:0}|`;let e=i.sheet,t=e?Kp(e):null;t&&(r+=t.length)}else{n+=`L${i.getAttribute("href")||""}|m:${i.getAttribute("media")||"all"}|`;let e=i.sheet,t=e?Kp(e):null;t&&(r+=t.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function eg(e,t,n){let r=Kp(e);if(!r)return!1;for(let e=0;e<r.length;e++){if(n.budget<=0)return!1;let i=r[e],o=i&&i.cssText?i.cssText:"";n.budget--;for(let e of t)if(o.includes(e))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let e=0;e<i.cssRules.length&&n.budget>0;e++){let r=i.cssRules[e],o=r&&r.cssText?r.cssText:"";n.budget--;for(let e of t)if(o.includes(e))return!0}if(n.budget<=0)return!1}return!1}function tg(e=document,t=Zp(e)){let n=Xp.get(e);if(n&&n.fingerprint===t)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],i=e.querySelectorAll("style");for(let n=0;n<i.length;n++){let o=i[n].textContent||"";for(let n of r)if(o.includes(n))return Xp.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let n={budget:1e3};try{for(let i of o)if(eg(i,r,n))return Xp.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let n=e.querySelectorAll('style,link[rel~="stylesheet"]'),i={budget:1e3};for(let o=0;o<n.length&&i.budget>0;o++){let a=n[o],s=null;if(a.tagName,s=a.sheet||null,s&&eg(s,r,i))return Xp.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Xp.set(e,{fingerprint:t,result:!0}),!0):(Xp.set(e,{fingerprint:t,result:!1}),!1)}function ng(e){for(let t of["Top","Right","Bottom","Left"]){let n=parseFloat(e[`border${t}Width`])||0,r=e[`border${t}Style`];if(n>0&&r&&"none"!==r&&"hidden"!==r)return!0}return!1}function rg(e){if(!e)return"";let t,n=[],r=/"([^"]*)"/g,i=0;for(;t=r.exec(e);){let o=e.slice(i,t.index).trim();o&&n.push(o),n.push(t[1]),i=r.lastIndex}let o=e.slice(i).trim();return o&&n.push(o),n.join("")}function ig(e,t,n){let r=e.parentElement,i=r&&n?n.get(r):null;return i?{get(e,n){let r=t.get(e,n),o=i.get(n);return"number"==typeof o?Math.max(r,o):r},getStack(e,n){let r=t.getStack(e,n);if(!r.length)return r;let o=i.get(n);if("number"==typeof o){let e=r.slice();return e[e.length-1]=Math.max(e[e.length-1],o),e}return r}}:t}function og(e,t,n){let r=new Map;function i(e){let t=[];if(!e||"none"===e)return t;for(let n of String(e).split(",")){let e=n.trim().split(/\s+/),r=e[0],i=Number.isFinite(Number(e[1]))?Number(e[1]):void 0;r&&t.push({name:r,num:i})}return t}let o=i(t?.counterReset),a=i(t?.counterSet),s=i(t?.counterIncrement);function l(t){if(r.has(t))return r.get(t).slice();let i=n.getStack(e,t);i=i.length?i.slice():[];let l=o.find(e=>e.name===t);if(l){let e=Number.isFinite(l.num)?l.num:0;i=i.length?[...i,e]:[e]}let c=a.find(e=>e.name===t);if(c){let e=Number.isFinite(c.num)?c.num:0;0===i.length&&(i=[0]),i[i.length-1]=e}let u=s.find(e=>e.name===t);if(u){let e=Number.isFinite(u.num)?u.num:1;0===i.length&&(i=[0]),i[i.length-1]+=e}return r.set(t,i.slice()),i}return{get(e,t){let n=l(t);return n.length?n[n.length-1]:0},getStack:(e,t)=>l(t),__incs:s}}function ag(e,t,n,r){let i;try{i=yd(e,t)}catch{}let o=i?.content;if(!o||"none"===o||"normal"===o)return{text:"",incs:[]};o=function(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if('"'===r)t=!t;else if("/"===r&&!t)return e.slice(0,n).trim()}return e}(o);let a=og(e,i,ig(e,n,r)),s=function(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}(o)?function(e,t,n){if(!e||"none"===e)return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return e.replace(r,(e,r,i)=>{let o=String(i).split(",").map(e=>e.trim());if("counter"===r){let e=o[0]?.replace(/^["']|["']$/g,""),r=(o[1]||"decimal").toLowerCase();return Jp(n.get(t,e),r)}{let e=o[0]?.replace(/^["']|["']$/g,""),r=o[1]?.replace(/^["']|["']$/g,"")??"",i=(o[2]||"decimal").toLowerCase(),a=n.getStack(t,e);return a.length?a.map(e=>Jp(e,i)).join(r):""}})}catch{return"- "}}(o,e,a):o;return{text:rg(s),incs:a.__incs||[]}}async function sg(e,t,n,r){if(1!==e?.nodeType||1!==t?.nodeType||"TEXTAREA"===e.tagName)return;if(!function(e,t){let n=Zp(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=tg(e,n),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):tg(e,n)}(e.ownerDocument||document,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=function(e,t){let n=null,r=()=>{if(!n)try{n=_p(e)}catch(e){Od(t,"buildCounterContext failed",e),n={get:()=>0,getStack:()=>[]}}return n};return{get:(e,t)=>r().get(e,t),getStack:(e,t)=>r().getStack(e,t)}}(e.ownerDocument||document,n));let i=n.__counterCtx;for(let o of["::before","::after","::first-letter"])try{let a=yd(e,o);if(!a||"none"===a.content&&"none"===a.backgroundImage&&"transparent"===a.backgroundColor&&!ng(a)&&(!a.transform||"none"===a.transform)&&"inline"===a.display)continue;if("::first-letter"===o){let r=yd(e),i=(r?.display||"").toLowerCase();if(i.includes("flex")||i.includes("grid"))continue;let o=e=>a[e]!==r[e]&&0!==(parseFloat(a[e])||0);if(!(a.color!==r.color||a.fontSize!==r.fontSize||a.fontWeight!==r.fontWeight||a.fontFamily!==r.fontFamily||a.fontStyle!==r.fontStyle||a.textTransform!==r.textTransform||a.float!==r.float&&"none"!==a.float||o("paddingTop")||o("paddingRight")||o("paddingBottom")||o("paddingLeft")||o("marginTop")||o("marginRight")||o("marginBottom")||o("marginLeft")))continue;let s=Array.from(t.childNodes).find(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim().length>0);if(!s)continue;let l=s.textContent,c=l.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],u=l.slice(c?.length||0);if(!c||/[\uD800-\uDFFF]/.test(c))continue;let f=document.createElement("span");f.textContent=c,f.dataset.snapdomPseudo="::first-letter";let d=md(vd(a),"span");n.styleMap.set(f,d);let h=document.createTextNode(u);t.replaceChild(h,s),t.insertBefore(f,h);continue}let s=a.content??"",l=""===s||"none"===s||"normal"===s,{text:c,incs:u}=ag(e,o,i,n.__siblingCounters),f=a.backgroundImage,d=a.backgroundColor,h=a.fontFamily,p=parseInt(a.fontSize)||32,g=parseInt(a.fontWeight)||!1,m=a.color||"#000",y=a.transform,v=gp(h),A=!l&&""!==c,b=f&&"none"!==f,w=d&&"transparent"!==d&&"rgba(0, 0, 0, 0)"!==d,I=ng(a),x=y&&"none"!==y,C="none"!==s&&"normal"!==s,E=C&&((parseFloat(a.width)||0)>0||(parseFloat(a.height)||0)>0),B=C&&a.boxShadow&&"none"!==a.boxShadow,S=C&&a.outlineStyle&&"none"!==a.outlineStyle&&(parseFloat(a.outlineWidth)||0)>0;if(!(A||b||w||I||x||E||B||S)){if(u&&u.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||new Map;for(let{name:r}of u){if(!r)continue;let a=ig(e,i,n.__siblingCounters),s=og(e,yd(e,o),a).get(e,r);t.set(r,s)}n.__siblingCounters.set(e.parentElement,t)}continue}let k=c.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(c),F=!1;if(A&&!v&&c.length>1&&!k){let n=yd(e),r=parseFloat(n.fontSize)||16,i=parseFloat(n.lineHeight);Number.isFinite(i)||(i=1.5*r),e.getBoundingClientRect().height<1.6*i&&(t.style.whiteSpace="nowrap",F=!0)}let D=document.createElement("span");D.dataset.snapdomPseudo=o,D.style.pointerEvents="none",F&&(D.style.whiteSpace="nowrap");let N=vd(a),M=(yd(e).display||"").toLowerCase(),T=M.includes("flex")||M.includes("grid");if(T){let e=N["min-width"];(!e||"auto"===e||"0px"===e)&&(N["min-width"]="0px")}let Q=md(N,"span",A,T);if(n.styleMap.set(D,Q),v&&c&&1===c.length){let{dataUrl:e,width:n,height:r}=await bp(c,h,g,p,m),i=document.createElement("img");i.src=e,i.style=`height:${p}px;width:${n/r*p}px;object-fit:contain;`,D.appendChild(i),t.dataset.snapdomHasIcon="true"}else if(c&&k){let t=ed(c,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Zf(c);if(t?.trim())try{let e=await ad(td(t),{as:"dataURL",useProxy:r.useProxy});if(e?.ok&&"string"==typeof e.data){let t=document.createElement("img");t.src=e.data,t.style=`width:${p}px;height:auto;object-fit:contain;`,D.appendChild(t)}}catch(t){console.error(`[snapdom] Error in pseudo ${o} for`,e,t)}}else!v&&A&&(D.textContent=c);D.style.backgroundImage="none","maskImage"in D.style&&(D.style.maskImage="none"),"webkitMaskImage"in D.style&&(D.style.webkitMaskImage="none");try{D.style.backgroundRepeat=a.backgroundRepeat,D.style.backgroundSize=a.backgroundSize,a.backgroundPositionX&&a.backgroundPositionY?(D.style.backgroundPositionX=a.backgroundPositionX,D.style.backgroundPositionY=a.backgroundPositionY):D.style.backgroundPosition=a.backgroundPosition,D.style.backgroundOrigin=a.backgroundOrigin,D.style.backgroundClip=a.backgroundClip,D.style.backgroundAttachment=a.backgroundAttachment,D.style.backgroundBlendMode=a.backgroundBlendMode}catch{}if(b)try{let e=Ad(f),t=await Promise.all(e.map(fd));D.style.backgroundImage=t.join(", ")}catch(e){console.warn(`[snapdom] Failed to inline background-image for ${o}`,e)}w&&(D.style.backgroundColor=d);let L=D.childNodes.length>0||""!==D.textContent?.trim()||b||w||I||x||E||B||S;if(u&&u.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||new Map,r=ig(e,i,n.__siblingCounters),a=og(e,yd(e,o),r);for(let{name:n}of u){if(!n)continue;let r=a.get(e,n);t.set(n,r)}n.__siblingCounters.set(e.parentElement,t)}if(!L)continue;"::before"===o?(t.dataset.snapdomHasBefore="1",t.insertBefore(D,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(D))}catch(t){console.warn(`[snapdom] Failed to capture ${o} for`,e,t)}let o=Array.from(t.children).filter(e=>!e.dataset.snapdomPseudo);if(n.nodeMap)for(let e of o){let t=n.nodeMap.get(e);1===t?.nodeType&&await sg(t,e,n,r)}else{let t=Array.from(e.children);for(let e=0;e<Math.min(t.length,o.length);e++)await sg(t[e],o[e],n,r)}}function lg(e,t){if(!e||1!==e?.nodeType)return;let n=e.ownerDocument||document,r=t||n,i=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(0===i.length)return;let o=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],s=e=>{if(!e||!e.getAttribute)return null;let t=e.getAttribute("href")||e.getAttribute("xlink:href")||("function"==typeof e.getAttributeNS?e.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(t)return t;let n=e.attributes;if(!n)return null;for(let e=0;e<n.length;e++){let t=n[e];if(!t||!t.name)continue;if("href"===t.name)return t.value;let r=t.name.indexOf(":");if(-1!==r&&"href"===t.name.slice(r+1))return t.value}return null},l=new Set(Array.from(e.querySelectorAll("[id]")).map(e=>e.id)),c=new Set,u=!1,f=(e,t=null)=>{if(!e)return;let n;for(o.lastIndex=0;n=o.exec(e);){u=!0;let e=(n[1]||"").trim();e&&(l.has(e)||(c.add(e),t&&!t.has(e)&&t.add(e)))}},d=e=>{let t=e.querySelectorAll("use");for(let e of t){let t=s(e);if(!t||!t.startsWith("#"))continue;u=!0;let n=t.slice(1).trim();n&&!l.has(n)&&c.add(n)}f(e.getAttribute("style")||"");for(let t of a)f(e.getAttribute(t));let n=e.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let e of n){f(e.getAttribute("style")||"");for(let t of a)f(e.getAttribute(t))}};for(let e of i)d(e);if(!u)return;let h=e.querySelector("svg.inline-defs-container");h||(h=n.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(h,e.firstChild||null));let p=h.querySelector("defs")||null,g=t=>{if(!t||l.has(t))return null;let n=(e=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,"\\$&"))(t),i=t=>{let n=r.querySelector(t);return n&&!e.contains(n)?n:null};return i(`svg defs > *#${n}`)||i(`svg > symbol#${n}`)||i(`*#${n}`)};if(!c.size)return;let m=new Set(c),y=new Set;for(;m.size;){let e=m.values().next().value;if(m.delete(e),!e||l.has(e)||y.has(e))continue;let t=g(e);if(!t){y.add(e);continue}p||(p=n.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(p));let r=t.cloneNode(!0);r.id||r.setAttribute("id",e),p.appendChild(r),y.add(e),l.add(e);let i=[r,...r.querySelectorAll("*")];for(let e of i){let t=s(e);if(t&&t.startsWith("#")){let e=t.slice(1).trim();e&&!l.has(e)&&!y.has(e)&&m.add(e)}let n=e.getAttribute?.("style")||"";n&&f(n,m);for(let t of a){let n=e.getAttribute?.(t);n&&f(n,m)}}}}function cg(e){if(!e||"none"===e)return{top:0,right:0,bottom:0,left:0};let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o?r++:")"===o&&(r=Math.max(0,r-1)),","===o&&0===r?(t.push(n),n=""):n+=o}n.trim()&&t.push(n);let i=0,o=0,a=0,s=0;for(let e of t){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(\.\d+)?px/g)?.map(e=>parseFloat(e))||[];if(t.length<2)continue;let[n,r,l=0,c=0]=t,u=Math.abs(n)+l+c,f=Math.abs(r)+l+c;o=Math.max(o,u+Math.max(n,0)),s=Math.max(s,u+Math.max(-n,0)),a=Math.max(a,f+Math.max(r,0)),i=Math.max(i,f+Math.max(-r,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(a),left:Math.ceil(s)}}function ug(e,t,n,r,i){let o=n.a,a=n.b,s=n.c,l=n.d,c=n.e||0,u=n.f||0;function f(e,t){let n=e-r,f=t-i,d=o*n+s*f,h=a*n+l*f;return d+=r+c,h+=i+u,[d,h]}let d=[f(0,0),f(e,0),f(0,t),f(e,t)],h=1/0,p=1/0,g=-1/0,m=-1/0;for(let[e,t]of d)e<h&&(h=e),t<p&&(p=t),e>g&&(g=e),t>m&&(m=t);return{minX:h,minY:p,maxX:g,maxY:m,width:g-h,height:m-p}}function fg(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],a=(e,t)=>{let n=e.toLowerCase();return"left"===n||"top"===n?0:"center"===n?t/2:"right"===n||"bottom"===n?t:n.endsWith("px")?parseFloat(n)||0:n.endsWith("%")?(parseFloat(n)||0)*t/100:/^-?\d+(\.\d+)?$/.test(n)&&parseFloat(n)||0};return{ox:a(i,t),oy:a(o,n)}}function dg(e){let t={rotate:"0deg",scale:null,translate:null},n="function"==typeof e.computedStyleMap?e.computedStyleMap():null;if(n){let r=e=>{try{return"function"==typeof n.has&&!n.has(e)||"function"!=typeof n.get?null:n.get(e)}catch{return null}},i=r("rotate");if(i)if(i.angle){let e=i.angle;t.rotate="rad"===e.unit?180*e.value/Math.PI+"deg":e.value+e.unit}else i.unit?t.rotate="rad"===i.unit?180*i.value/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let n=getComputedStyle(e);t.rotate=n.rotate&&"none"!==n.rotate?n.rotate:"0deg"}let o=r("scale");if(o){let e="x"in o&&null!=o.x?.value?o.x.value:Array.isArray(o)?o[0]?.value:Number(o)||1,n="y"in o&&null!=o.y?.value?o.y.value:Array.isArray(o)?o[1]?.value:e;t.scale=`${e} ${n}`}else{let n=getComputedStyle(e);t.scale=n.scale&&"none"!==n.scale?n.scale:null}let a=r("translate");if(a){let e="x"in a&&"value"in a.x?a.x.value:Array.isArray(a)?a[0]?.value:0,n="y"in a&&"value"in a.y?a.y.value:Array.isArray(a)?a[1]?.value:0,r="x"in a&&a.x?.unit?a.x.unit:"px",i="y"in a&&a.y?.unit?a.y.unit:"px";t.translate=`${e}${r} ${n}${i}`}else{let n=getComputedStyle(e);t.translate=n.translate&&"none"!==n.translate?n.translate:null}return t}let r=getComputedStyle(e);return t.rotate=r.rotate&&"none"!==r.rotate?r.rotate:"0deg",t.scale=r.scale&&"none"!==r.scale?r.scale:null,t.translate=r.translate&&"none"!==r.translate?r.translate:null,t}Kf(),Pd(),Qd();var hg=null;function pg(e){let t=function(){if(hg)return hg;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),hg=e,e}(),n=document.createElement("div");n.style.transformOrigin="0 0",e.baseTransform&&(n.style.transform=e.baseTransform),e.rotate&&(n.style.rotate=e.rotate),e.scale&&(n.style.scale=e.scale),e.translate&&(n.style.translate=e.translate),t.appendChild(n);let r=function(e){let t=getComputedStyle(e).transform;if(!t||"none"===t)return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}(n);return t.removeChild(n),r}var gg="http://www.w3.org/1999/xhtml",mg=new WeakSet;function yg(e,t){if(!t)return null;let n,r,i,o,a=e.ownerDocument||document,s=a.defaultView||window;if("viewport"===t)n=0,r=0,i=a.documentElement?.clientWidth||s.innerWidth,o=a.documentElement?.clientHeight||s.innerHeight;else{if("object"!=typeof t)return null;n=(Number(t.x)||0)-(s.scrollX||0),r=(Number(t.y)||0)-(s.scrollY||0),i=Number(t.width),o=Number(t.height)}return i>0&&o>0?{left:n,top:r,width:i,height:o,right:n+i,bottom:r+o}:null}function vg(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode&&e.getRootNode();return t instanceof ShadowRoot?t.host:null}function Ag(e,t){for(let n=t;n;n=vg(n))if(n===e)return!0;return!1}function bg(e,t){for(let n=vg(e);n&&n!==t&&1===n?.nodeType;n=vg(n)){let e=yd(n);if("static"!==e.position||e.transform&&"none"!==e.transform||e.filter&&"none"!==e.filter||e.backdropFilter&&"none"!==e.backdropFilter||e.perspective&&"none"!==e.perspective||/transform|perspective|filter/.test(e.willChange||"")||/layout|paint|strict|content/.test(e.contain||""))return n}return null}function wg(e,t){try{let n=new DOMMatrix;if(t&&t.rotate&&"0deg"!==t.rotate&&(n=n.multiply(new DOMMatrix(`rotate(${t.rotate})`))),t&&t.scale){let e=String(t.scale).trim().split(/\s+/).filter(Boolean);e.length&&e.every(e=>Number.isFinite(Number(e)))&&(n=n.multiply(new DOMMatrix(`scale(${e.join(",")})`)))}return e&&(n=n.multiply(new DOMMatrix(e))),n}catch{return null}}function Ig(e){let t=e.display||"";if(t.includes("flex")||t.includes("grid")||t.startsWith("table")||"inline-block"===t||"flow-root"===t||"absolute"===e.position||"fixed"===e.position||e.float&&"none"!==e.float)return!0;let n=e.overflowX||e.overflow||"visible",r=e.overflowY||e.overflow||"visible";return!!("visible"!==n||"visible"!==r||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function xg(e,t){let n=Array.from(e.childNodes),r="top"===t?n:n.reverse();for(let e of r){if(e.nodeType===Node.TEXT_NODE){if(/\S/.test(e.textContent||""))return null;continue}if(e.nodeType!==Node.ELEMENT_NODE)continue;let t=getComputedStyle(e),n=String(t.display||"");if("none"!==n&&"contents"!==n&&"absolute"!==t.position&&"fixed"!==t.position)return t.float&&"none"!==t.float||n.startsWith("inline")?null:e}return null}var Cg=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function Eg(e,t={}){e&&(function(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let e=i.currentNode;for(let t of Array.from(e.attributes)){let i=t.name;if(i.startsWith("*"))e.removeAttribute(i);else if(i.includes("@"))e.removeAttribute(i);else{if(i.includes(":")){let t=i.split(":",1)[0];if(!r.has(t)){e.removeAttribute(i);continue}}n&&(i.startsWith("x-")||i.startsWith("v-")||i.startsWith(":")||i.startsWith("on:")||i.startsWith("bind:")||i.startsWith("let:")||i.startsWith("class:"))&&e.removeAttribute(i)}}}}(e,t),function(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let e of n)e.remove()}(e),function(e){if(!e)return;let t=e=>{if(e.nodeType===Node.ELEMENT_NODE){if(e.attributes)for(let t of Array.from(e.attributes)){let n=t.value.replace(Cg,"");if(n!==t.value)try{e.setAttribute(t.name,n)}catch{}}}else if(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.CDATA_SECTION_NODE){let t=e.data.replace(Cg,"");t!==e.data&&(e.data=t)}};t(e);let n,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;n=r.nextNode();)t(n)}(e))}function Bg(e,t){if(1!==e?.nodeType||function(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}(e)||function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}(e))return!1;let n=t.position;if("absolute"===n||"fixed"===n||"sticky"===n)return!1;let r=t.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||t.transform&&"none"!==t.transform)}function Sg(e){let t=getComputedStyle(e);return!("none"===t.display||"absolute"===t.position||"fixed"===t.position)}function kg(e,t){if(1!==e?.nodeType)return!1;if("exclude"===e.getAttribute("data-capture")&&"remove"===t?.excludeMode)return!0;if(Array.isArray(t?.exclude))for(let n of t.exclude)try{if(e.matches(n))return"remove"===t.excludeMode}catch(e){Od(t,"exclude selector match failed",e)}if("function"==typeof t?.filter&&"remove"===t.filterMode)try{if(!t.filter(e))return!0}catch(e){Od(t,"filter function failed",e)}return!1}var Fg=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,Dg=.75;var Ng=/::-webkit-scrollbar(-[a-z]+)?\b/i;function Mg(e,t=new Set){let n="";if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=Mg(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let e=Mg(i.cssRules,t);e&&(n+=`@media ${i.conditionText}{${e}}`);continue}if(i.type===CSSRule.STYLE_RULE){let e=i.selectorText||"";if(Ng.test(e)){let e=i.cssText;e&&!t.has(e)&&(t.add(e),n+=e)}}}catch{}}return n}var Tg=new WeakMap;Hd();var Qg=new Set;async function Lg(e,t={}){let n=t.__session||Xf.session,r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:t},i=null;if(t.clip){let n=yg(e,t.clip);if(n){r.clip={rect:n,root:e};let t=e.getBoundingClientRect();i={x:n.left-t.left,y:n.top-t.top,width:n.width,height:n.height}}}let o,a="",s="";if(Qg.size){let t=(e,t)=>{for(let n=t;n;n=n.assignedSlot||n.parentElement||n.getRootNode()?.host)if(n===e)return!0;return!1};for(;;){let n=[...Qg].filter(({root:n})=>t(n,e)||t(e,n)).map(({promise:e})=>e.catch(()=>{}));if(!n.length)break;await Promise.all(n)}}if(!r.clip&&e.isConnected&&"hidden"!==e.ownerDocument?.visibilityState)try{let t=e.getBoundingClientRect(),n=e.ownerDocument?.defaultView||window,r=t.right<=0||t.bottom<=0||t.left>=n.innerWidth||t.top>=n.innerHeight,i=[];if(r&&(()=>{let t=[];e.shadowRoot&&t.push(e.shadowRoot);for(let n of e.querySelectorAll("*"))n.shadowRoot&&t.push(n.shadowRoot);for(;t.length;){let e=t.pop(),n="calcite-icon"===e.host?.localName;for(let r of e.querySelectorAll("*")){if(r.shadowRoot&&t.push(r.shadowRoot),!n||"svg"!==r.localName)continue;let e=r.querySelectorAll("path");if(!e.length||[...e].some(e=>e.getAttribute("d")?.trim()))continue;let o=r.getBoundingClientRect();o.width&&o.height&&i.push(r)}}})(),i.length){let t=(async()=>{let t=e.style,r=e.hasAttribute("style"),o=new Map,a=(e,n)=>{o.has(e)||o.set(e,{value:t.getPropertyValue(e),priority:t.getPropertyPriority(e)}),t.setProperty(e,n,"important");let r=o.get(e);r.forcedValue=t.getPropertyValue(e),r.forcedPriority=t.getPropertyPriority(e)};try{a("left","0"),a("top","0"),a("right","auto"),a("bottom","auto"),a("margin-top","0"),a("margin-right","0"),a("margin-bottom","0"),a("margin-left","0"),a("transform","none"),a("translate","none"),a("opacity","0"),a("pointer-events","none");let t=e.getBoundingClientRect();if(t.right<=0||t.bottom<=0||t.left>=n.innerWidth||t.top>=n.innerHeight){let t=e.parentElement?.getBoundingClientRect(),r=t&&t.right>0&&t.left<n.innerWidth?Math.max(0,t.left):0,i=t&&t.bottom>0&&t.top<n.innerHeight?Math.max(0,t.top):0;a("position","fixed"),a("left",`${r}px`),a("top",`${i}px`)}await Rd(100);let r=Date.now()+1500,o=()=>i.some(e=>{if([...e.querySelectorAll("path")].some(e=>e.getAttribute("d")?.trim()))return!1;let t=e.getBoundingClientRect();return t.width&&t.height&&t.right>0&&t.bottom>0&&t.left<n.innerWidth&&t.top<n.innerHeight});for(;Date.now()<r&&o();)await new Promise(e=>setTimeout(e,25));await Rd(100)}finally{for(let[e,n]of o)t.getPropertyValue(e)!==n.forcedValue||t.getPropertyPriority(e)!==n.forcedPriority||(n.value?t.setProperty(e,n.value,n.priority):t.removeProperty(e));!r&&!t.length&&e.removeAttribute("style"),await Rd(100)}})(),r={root:e,promise:t};Qg.add(r);try{await t}finally{Qg.delete(r)}}}catch{}let l=function(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a="none"!==n&&parseFloat(r)>0,s="none"===i||0===parseFloat(o);if(a&&s){let t=e.style.border;return e.style.border=`${r} solid transparent`,()=>{e.style.border=t}}return()=>{}}(e),c=r.clip?()=>{}:function(e){let t=[];try{let n=e.querySelectorAll("*");for(let e of n){if(!(e instanceof HTMLElement))continue;let n=e.style.contentVisibility||"",r=getComputedStyle(e);"auto"===(r.contentVisibility||r.getPropertyValue("content-visibility")||"")&&(t.push({el:e,original:n}),e.style.contentVisibility="visible")}if(e instanceof HTMLElement){let n=getComputedStyle(e);"auto"===(n.contentVisibility||n.getPropertyValue("content-visibility")||"")&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:e,original:n}of t)try{e.style.contentVisibility=n}catch{}}}(e);try{o=await cp(e,r,t)}catch(e){throw console.warn("deepClone failed:",e),e}finally{c(),l()}try{lg(o)}catch(e){console.warn("inlineExternal defs or symbol failed:",e)}try{await sg(e,o,r,t)}catch(e){console.warn("inlinePseudoElements failed:",e)}await async function(e,t=null){if(!e)return;let n=t,r=tp(e,"img");for(let e of r)try{let t=e.getAttribute("src")||e.currentSrc||"";if(Kh(t)){let n=await Jh(t);e.setAttribute("src",n)}let r=e.getAttribute("srcset");if(r&&r.includes("blob:")){let t=Zh(r),i=!1;for(let e of t)if(Kh(e.url))try{e.url=await Jh(e.url),i=!0}catch(e){Od(n,"blobUrlToDataUrl for srcset item failed",e)}i&&e.setAttribute("srcset",ep(t))}}catch(e){Od(n,"resolveBlobUrls for img failed",e)}let i=tp(e,"image");for(let e of i)try{let t="http://www.w3.org/1999/xlink",n=e.getAttribute("href")||e.getAttributeNS?.(t,"href");if(Kh(n)){let r=await Jh(n);e.setAttribute("href",r),e.removeAttributeNS?.(t,"href")}}catch(e){Od(n,"resolveBlobUrls for SVG image href failed",e)}let o=tp(e,"[style*='blob:']");for(let e of o)try{let t=e.getAttribute("style");if(t&&t.includes("blob:")){let n=await Xh(t);e.setAttribute("style",n)}}catch(e){Od(n,"replaceBlobUrls in inline style failed",e)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let e of a)try{let t=e.textContent||"";t.includes("blob:")&&(e.textContent=await Xh(t))}catch(e){Od(n,"replaceBlobUrls in style tag failed",e)}let s=["poster"];for(let t of s){let r=tp(e,`[${t}^='blob:']`);for(let e of r)try{let n=e.getAttribute(t);Kh(n)&&e.setAttribute(t,await Jh(n))}catch(e){Od(n,`resolveBlobUrls for ${t} failed`,e)}}}(o,r);try{let e=o.querySelectorAll("style[data-sd]");for(let t of e)s+=t.textContent||"",t.remove()}catch(e){Od(r,"Failed to extract shadow CSS from style[data-sd]",e)}let u=function(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let e of t)n.set(e,"c"+r++);return n}(r.styleMap);a=Array.from(u.entries()).map(([e,t])=>`.${t}{${e}}`).join(""),a=s+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+a;for(let[e,t]of r.styleMap.entries()){if("STYLE"===e.tagName)continue;if(e.getRootNode&&e.getRootNode()instanceof ShadowRoot){e.setAttribute("style",t.replace(/;/g,"; "));continue}let n=u.get(t);n&&e.classList.add(n);let r=e.style?.backgroundImage,i=e.dataset?.snapdomHasIcon;r&&"none"!==r&&(e.style.backgroundImage=r),i&&(e.style.verticalAlign="middle",e.style.display="inline")}if((r.clip||e.scrollTop||e.scrollLeft)&&1===o?.nodeType)try{let t=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};!function(e,t,n,r,i){let o=e.getBoundingClientRect();1===t?.nodeType&&t.namespaceURI===gg&&"static"===yd(e).position&&(t.style.position="relative");let a=[];for(let[t,s]of n){if(1!==t?.nodeType||t.namespaceURI!==gg||1!==s?.nodeType||s===e||!Ag(e,s))continue;let n=r.get(s)||yd(s),l=n.position;if("fixed"!==l&&"sticky"!==l&&"-webkit-sticky"!==l||"absolute"===t.style.position)continue;let c=s.getBoundingClientRect();if(!(c.width>0&&c.height>0))continue;mg.add(t);let u=n.transform&&"none"!==n.transform?n.transform:"",f=dg(s),d=!!(u||"0deg"!==f.rotate||f.scale||f.translate),h=d?wg(u,f):null,p=!h||!h.is2D||1===h.a&&0===h.b&&0===h.c&&1===h.d,g=c.width,m=c.height;p||(g=s.offsetWidth||c.width,m=s.offsetHeight||c.height);let y=s.getRootNode&&s.getRootNode()instanceof ShadowRoot,v=o,A=e.clientLeft||0,b=e.clientTop||0;if(y){let t=bg(s,e);t&&(v=t.getBoundingClientRect(),A=t.clientLeft||0,b=t.clientTop||0)}let w=c.left-v.left-A,I=c.top-v.top-b;if(d)if(t.style.translate="none",t.style.rotate="none",t.style.scale="none",p)t.style.transform="none";else{t.style.transform=`matrix(${h.a},${h.b},${h.c},${h.d},0,0)`;let{ox:e,oy:r}=fg(n,g,m),i=ug(g,m,{a:h.a,b:h.b,c:h.c,d:h.d,e:0,f:0},e,r);w-=i.minX,I-=i.minY}if("fixed"!==l){let e=t.cloneNode(!1);e.setAttribute("data-snap-ph","1"),e.style.position="static",e.style.visibility="hidden",e.style.width=`${g}px`,e.style.height=`${m}px`,e.style.boxSizing="border-box",t.parentElement?.insertBefore(e,t)}let x=g+2,C=m;i&&(Math.abs(I-i.y)<.5&&(I-=1,C+=1),Math.abs(w-i.x)<.5&&(w-=1,x+=1)),t.style.position="absolute",t.style.left=`${w}px`,t.style.top=`${I}px`,t.style.right="auto",t.style.bottom="auto",t.style.margin="0",t.style.width=`${x}px`,t.style.height=`${C}px`,t.style.boxSizing="border-box",y||a.push(t)}for(let e of a)t.appendChild(e)}(e,o,r.nodeMap,r.styleCache,t)}catch(e){Od(r,"freezeViewportPositioned failed",e)}for(let[t,n]of r.nodeMap.entries()){if(r.clip&&n===e)continue;let i=n.scrollLeft,o=n.scrollTop;if((i||o)&&1===t?.nodeType&&"http://www.w3.org/1999/xhtml"===t.namespaceURI){t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let e=t.querySelectorAll("*");for(let t of e){if(1!==t.nodeType||"http://www.w3.org/1999/xhtml"!==t.namespaceURI)continue;let e=t.style.position;if("fixed"===e||"absolute"===e){let n=parseFloat(t.style.top)||0,r=parseFloat(t.style.left)||0;t.style.top=`${n+o}px`,t.style.left=`${r+i}px`,"fixed"===e&&(t.style.position="absolute")}}}catch{}let e=document.createElement("div");for(e.style.all="unset",e.style.transform=`translate(${-i}px, ${-o}px)`,e.style.willChange="transform",e.style.display="inline-block",e.style.width="100%";t.firstChild;)e.appendChild(t.firstChild);t.appendChild(e)}}if(e===r.nodeMap.get(o)){let t=r.styleCache.get(e)||yd(e);r.styleCache.set(e,t);let n=function(e){if(!e||"none"===e)return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(e,t)=>{let n=t.split(",").map(e=>e.trim());return 6!==n.length?`matrix(${t})`:(n[4]="0",n[5]="0",`matrix(${n.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(e,t)=>{let n=t.split(",").map(e=>e.trim());return 16!==n.length?`matrix3d(${t})`:(n[12]="0",n[13]="0",`matrix3d(${n.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}(t.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=n||""}for(let[e,t]of r.nodeMap.entries())"PRE"===t.tagName&&(e.style.marginTop="0",e.style.marginBlockStart="0");return{clone:o,classCSS:a,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}ud(),Kf();var Rg="http://www.w3.org/1999/xlink";async function Ug(e,t={}){let n=Array.from(e.querySelectorAll("img"));"IMG"===e.tagName&&n.unshift(e);let r=async e=>{if(!e.getAttribute("src")){let t=e.currentSrc||e.src||Oh(e.getAttribute("srcset"),e)||"";t&&e.setAttribute("src",t)}e.removeAttribute("srcset"),e.removeAttribute("sizes");let n=e.src||"";if(!n)return;let r=Xf.image?.get(n);if(r)return e.src=r,e.width||(e.width=e.naturalWidth||100),void(e.height||(e.height=e.naturalHeight||100));let i=await ad(n,{as:"dataURL",useProxy:t.useProxy});if(i.ok&&"string"==typeof i.data&&i.data.startsWith("data:"))return Xf.image?.set(n,i.data),e.src=i.data,e.width||(e.width=e.naturalWidth||100),void(e.height||(e.height=e.naturalHeight||100));let{width:o,height:a}=function(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,i=parseInt(e.getAttribute("height")||"",10)||0,o=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0;return{width:t||o||r||e.width||e.naturalWidth||100,height:n||a||i||e.height||e.naturalHeight||100}}(e),{fallbackURL:s}=t||{};if(s)try{let r="function"==typeof s?await s({width:o,height:a,src:n,element:e}):s;if(r){let n=await ad(r,{as:"dataURL",useProxy:t.useProxy});if(n?.ok&&"string"==typeof n.data)return e.src=n.data,e.width||(e.width=o),void(e.height||(e.height=a))}}catch{}if(!1!==t.placeholders){let t=document.createElement("div");t.style.cssText=[`width:${o}px`,`height:${a}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${a}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),t.textContent="img",e.replaceWith(t)}else{let t=document.createElement("div");t.style.cssText=`display:inline-block;width:${o}px;height:${a}px;visibility:hidden;`,e.replaceWith(t)}};for(let e=0;e<n.length;e+=6){let t=n.slice(e,e+6).map(r);await Promise.allSettled(t)}let i=Array.from(e.querySelectorAll("image"));"image"===e.localName&&i.unshift(e);let o=async e=>{let n=function(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||("function"==typeof e.getAttributeNS?e.getAttributeNS(Rg,"href"):null)}(e);if(!n||n.startsWith("data:")||n.startsWith("blob:"))return;let r=await ad(n,{as:"dataURL",useProxy:t.useProxy});r.ok&&"string"==typeof r.data&&r.data.startsWith("data:")&&(e.setAttribute("href",r.data),e.removeAttribute("xlink:href"),"function"==typeof e.removeAttributeNS&&e.removeAttributeNS(Rg,"href"))};for(let e=0;e<i.length;e+=6){let t=i.slice(e,e+6).map(o);await Promise.allSettled(t)}}Pd(),Kf();var Hg=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],Og=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],qg=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],Pg=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function $g(e,t,n,r){let i=n.get(e)||yd(e);n.has(e)||n.set(e,i);let o=i.getPropertyValue("border-image"),a=i.getPropertyValue("border-image-source"),s=o&&"none"!==o||a&&"none"!==a,l=i.getPropertyValue("background-image"),c=i.getPropertyValue("background-color");if(l&&"none"!==l||c&&"rgba(0, 0, 0, 0)"!==c&&"transparent"!==c||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""))for(let e of qg){let n=i.getPropertyValue(e);n&&t.style.setProperty(e,n)}for(let e of Hg){let n=i.getPropertyValue(e);if("background-image"===e&&(!n||"none"===n)){let e=i.getPropertyValue("background");e&&/url\s*\(/.test(e)&&(n=Ad(e).filter(e=>/url\s*\(/.test(e)).join(", ")||n)}if(!n||"none"===n)continue;let o=Ad(n),a=await Promise.all(o.map(e=>fd(e,r)));a.some(e=>e&&"none"!==e&&!/^url\(undefined/.test(e))&&t.style.setProperty(e,a.join(", "))}for(let e of Og){let n=i.getPropertyValue(e);!n||"initial"===n||t.style.setProperty(e,n)}if(s)for(let e of Pg){let n=i.getPropertyValue(e);!n||"initial"===n||t.style.setProperty(e,n)}}function zg(e,t,n=Xf.session.nodeMap){let r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let e=i.currentNode;e;e=i.nextNode()){let i=n.get(e);if(1!==i?.nodeType)continue;let o=yd(i),a=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");a&&"none"!==a&&e!==t&&r.push({cloneEl:e,orig:i,bf:a,path:Yg(t,e)})}if(!r.length)return;let o=e.getBoundingClientRect(),a=r.map((e,i)=>{let o=t.cloneNode(!0);(function(e,t,n,r){let i=[[e,t]];for(;i.length;){let[e,t]=i.pop(),o=r.get(t);if(1===o?.nodeType){let t=o.getBoundingClientRect();(t.left>n.right+Vg||t.right<n.left-Vg||t.top>n.bottom+Vg||t.bottom<n.top-Vg)&&("IMG"===e.tagName&&e.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),e.style&&(e.style.backgroundImage="none"))}let a=e.children,s=t.children;for(let e=0;e<a.length;e++)i.push([a[e],s[e]])}})(o,t,e.orig.getBoundingClientRect(),n),function(e){if(e)for(let t=e;t&&t.parentNode;){let n=t.parentNode;for(;t.nextSibling;)t.nextSibling.remove();t===e&&t.remove(),t=n}}(Wg(o,e.path));for(let e=0;e<i;e++){let t=Wg(o,r[e].path);t&&(t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...e,copy:o}});for(let{cloneEl:e,orig:t,bf:n,copy:r}of a)jg(e,t,n,r,o)}function jg(e,t,n,r,i){let o=t.getBoundingClientRect();if(!o.width||!o.height)return;let a=yd(t),s=t.offsetWidth?o.width/t.offsetWidth:1,l=Math.abs(s-1)>.001?1/s:1;r.style.position="absolute",r.style.left=(i.left-o.left)*l+"px",r.style.top=(i.top-o.top)*l+"px",r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,1!==l&&(r.style.transform=`scale(${l})`,r.style.transformOrigin="top left");let c=document.createElement("div");c.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",c.appendChild(r);let u=document.createElement("div");u.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",u.style.backgroundColor=a.backgroundColor,u.style.backgroundImage=e.style.backgroundImage||a.backgroundImage;for(let e of["background-size","background-position","background-repeat","background-origin","background-clip"])u.style.setProperty(e,a.getPropertyValue(e));e.style.setProperty("background-color","transparent","important"),e.style.setProperty("background-image","none","important"),e.style.setProperty("backdrop-filter","none","important"),e.style.setProperty("-webkit-backdrop-filter","none","important"),"static"===a.position&&(e.style.position="relative"),e.style.isolation="isolate",e.prepend(u),e.prepend(c)}Kf(),Pd();var Vg=128;function Yg(e,t){let n=[];for(let r=t;r!==e;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function Wg(e,t){if(!t)return null;let n=e;for(let e of t)if(n=n.children[e],!n)return null;return n}function Gg(e,t){if(!e)return()=>{};let n=[],r=200;return function e(i){if(t){let e=i.getBoundingClientRect();if(e.width>0||e.height>0){let n=Math.max(e.right,e.left+(i.scrollWidth||0)),o=Math.max(e.bottom,e.top+(i.scrollHeight||0));if(n<t.left-r||e.left>t.right+r||o<t.top-r||e.top>t.bottom+r)return}}let o=getComputedStyle(i),a=function(e,t){if(!e)return()=>{};t=t||getComputedStyle(e);let n=function(e){let t=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");t=(t||"").trim();let n=parseInt(t,10);return Number.isFinite(n)&&n>0?n:0}(t);if(n<=0)return()=>{};if(!_g(e))return()=>{};let r=Jg(e),i=r.text,o=function(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}(t);r.write("X");let a=e.scrollHeight-o;r.restore();let s=a>0?a:function(e){let t=(e.lineHeight||"").trim(),n=parseFloat(e.fontSize)||16;return t&&"normal"!==t?t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith("%")?Math.round(parseFloat(t)/100*n):Math.round(1.2*n):Math.round(1.2*n)}(t),l=Math.round(s*n+o);if(e.scrollHeight<=l+.5)return()=>{};let c=0,u=i.length,f=-1;for(;c<=u;){let t=c+u>>1;r.write(i.slice(0,t)+"…"),e.scrollHeight<=l+.5?(f=t,c=t+1):u=t-1}return r.write((f>=0?i.slice(0,f):"")+"…"),()=>{r.restore()}}(i,o);a&&n.push(a);let s=function(e,t){if(!e)return()=>{};if(t=t||getComputedStyle(e),"ellipsis"!==t.textOverflow)return()=>{};if("nowrap"!==t.whiteSpace&&"pre"!==t.whiteSpace)return()=>{};if("hidden"!==t.overflowX&&"clip"!==t.overflowX)return()=>{};if(!_g(e))return()=>{};if(e.scrollWidth<=e.clientWidth+.5)return()=>{};let n=Jg(e),r=n.text,i=0,o=r.length,a=-1;for(;i<=o;){let t=i+o>>1;n.write(r.slice(0,t)+"…"),e.scrollWidth<=e.clientWidth+.5?(a=t,i=t+1):o=t-1}return n.write((a>=0?r.slice(0,a):"")+"…"),()=>{n.restore()}}(i,o);s&&n.push(s);for(let t of i.children||[])e(t)}(e),()=>n.forEach(e=>e())}function Jg(e){let t=[];for(let n=e.firstChild;n;n=n.nextSibling)n.nodeType===Node.TEXT_NODE&&t.push(n);let n=t.map(e=>e.data);return{text:n.join(""),write(e){t[0].data=e;for(let e=1;e<t.length;e++)t[e].data=""},restore(){for(let e=0;e<t.length;e++)t[e].data=n[e]}}}function _g(e){return!(e.childElementCount>0)&&Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}Pd(),Kf();var Xg=[];function Kg(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return"function"==typeof t?t(n):t}if("object"==typeof e&&"plugin"in e){let{plugin:t,options:n}=e;return"function"==typeof t?t(n):t}return"function"==typeof e?e():e}function Zg(e){return e&&Array.isArray(e.plugins)?e.plugins:Xg}async function em(e,t,n){let r=n,i=Zg(t);for(let n of i){let i=n&&"function"==typeof n[e]?n[e]:null;if(!i)continue;let o=await i(t,r);typeof o<"u"&&(r=o)}return r}function tm(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=function(e){let t=[];if(Array.isArray(e))for(let n of e){let e=Kg(n);if(!e||!e.name)continue;let r=t.findIndex(t=>t&&t.name===e.name);r>=0&&t.splice(r,1),t.push(e)}for(let e of Xg)e&&e.name&&!t.some(t=>t.name===e.name)&&t.push(e);return Object.freeze(t)}(t)),e}function nm(){return Xg.slice()}Kf();async function rm(e,t,n){if("string"!=typeof e||!e.startsWith("data:image")||e.startsWith("data:image/svg"))return null;let r=e.length+":"+e.slice(0,64)+e.slice(-64)+":"+Math.round(t)+"x"+Math.round(n);if(Xf.compress.has(r))return Xf.compress.get(r);let i=await(async()=>{let r;try{r=await async function(e){let t=new Image;if(t.decoding="sync",t.src=e,"function"==typeof t.decode)try{return await t.decode(),t}catch{}return await new Promise((e,n)=>{t.onload=()=>e(),t.onerror=n}),t}(e)}catch{return null}let i=r.naturalWidth||r.width,o=r.naturalHeight||r.height;if(!i||!o)return null;let a=Math.min(1,Math.max(t/i,n/o));if(!(a>0)||a>=.95)return null;let s=.95*a,l=Math.max(1,Math.round(i*s)),c=Math.max(1,Math.round(o*s)),u=document.createElement("canvas");u.width=l,u.height=c;let f=u.getContext("2d");if(!f)return null;f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,c);let d=function(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:""}(e),h="image/jpeg"===d?"image/jpeg":"image/webp"===d?"image/webp":"image/png";try{let t=u.toDataURL(h,.92);if("string"==typeof t&&t.startsWith("data:image")&&t.length<e.length)return t}catch{}return null})();return Xf.compress.set(r,i),i}async function im(e,t,n){t.compress&&(await async function(e,t){if(!t.compress)return{count:0,before:0,after:0};let n=(t.scale||1)*(t.dpr||1),r=Array.from(e.querySelectorAll("img"));"IMG"===e.tagName&&r.unshift(e);let i=0,o=0,a=0,s=async e=>{let t=e.getAttribute("src")||"";if(!t.startsWith("data:image")||t.startsWith("data:image/svg"))return;let r=parseFloat(e.dataset.snapdomWidth)||parseFloat(e.style.width)||e.width||0,s=parseFloat(e.dataset.snapdomHeight)||parseFloat(e.style.height)||e.height||0;if(!r||!s)return;let l=await rm(t,r*n,s*n);l&&(i++,o+=t.length,a+=l.length,e.setAttribute("src",l))};for(let e=0;e<r.length;e+=6)await Promise.allSettled(r.slice(e,e+6).map(s));return{count:i,before:o,after:a}}(e,t),await async function(e,t,n=Xf.session.nodeMap){if(!t.compress)return{count:0};let r=(t.scale||1)*(t.dpr||1),i=[],o=[e,...e.querySelectorAll("*")];for(let e of o){let t=e.style&&e.style.backgroundImage;t&&t.includes("data:image")&&i.push(e)}let a=0,s=async e=>{let t,i=n.get(e);if(!i||!i.isConnected)return;try{t=getComputedStyle(i)}catch{return}if((t.backgroundRepeat||"repeat").toLowerCase().split(",").some(e=>"no-repeat"!==e.trim()))return;let{w:o,h:s}=function(e){return{w:e.offsetWidth||e.getBoundingClientRect().width||0,h:e.offsetHeight||e.getBoundingClientRect().height||0}}(i);if(!o||!s)return;let l=o*r,c=s*r,u=e.style.backgroundImage,f=[...u.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],d=u;for(let e of f){let t=e[2];if(t.startsWith("data:image/svg"))continue;let n=await rm(t,l,c);n&&(d=d.split(t).join(n),a++)}d!==u&&(e.style.backgroundImage=d)};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(s));return{count:a}}(e,t,n),await async function(e,t){if(!t.compress)return{count:0};let n=(t.scale||1)*(t.dpr||1),r=Array.from(e.querySelectorAll("image"));"image"===e.localName&&r.unshift(e);let i=0,o=async e=>{let t=e.getAttribute("href")||("function"==typeof e.getAttributeNS?e.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!t||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return;let r=parseFloat(e.getAttribute("width"))||0,o=parseFloat(e.getAttribute("height"))||0;if(!r||!o)return;let a=await rm(t,r*n,o*n);a&&(e.setAttribute("href",a),e.hasAttribute("xlink:href")&&e.setAttribute("xlink:href",a),i++)};for(let e=0;e<r.length;e+=6)await Promise.allSettled(r.slice(e,e+6).map(o));return{count:i}}(e,t))}async function om(e,t){if(!e)throw new Error("Element cannot be null or undefined");(function(e="soft"){switch(e){case"auto":return Xf.session.styleMap=new Map,void(Xf.session.nodeMap=new Map);case"soft":default:return Xf.session.styleMap=new Map,Xf.session.nodeMap=new Map,void(Xf.session.styleCache=new WeakMap);case"full":return;case"disabled":Xf.session.styleMap=new Map,Xf.session.nodeMap=new Map,Xf.session.styleCache=new WeakMap,Xf.computedStyle=new WeakMap,Xf.measureHints=new WeakMap,Xf.baseStyle=new _f(50),Xf.defaultStyle=new _f(30),Xf.image=new _f(100),Xf.background=new _f(100),Xf.resource=new _f(150),Xf.compress=new _f(50),Xf.font=new Set}})(t.cache),t.__session={styleMap:Xf.session.styleMap,styleCache:Xf.session.styleCache,nodeMap:Xf.session.nodeMap},t.burst||function(e){let t=Date.now(),n=Xf.burstAdvice.get(e);!n||t-n.firstTs>2e3?Xf.burstAdvice.set(e,{count:1,firstTs:t,warned:!1}):(n.count++,n.count>=3&&!n.warned&&(n.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed.")))}(e),t.__resolveNodeHooks=function(e){let t=Array.isArray(e.plugins)?e.plugins:nm(),n=[];for(let e of t){let t=Kg(e);t&&"function"==typeof t.resolveNode&&n.push(t.resolveNode.bind(t))}return n.length?n:null}(t);let n,r,i,o,a,s,l,c,u=t.fast,f=!1!==t.outerTransforms,d=!!t.outerShadows,h=t.clip?yg(e,t.clip):null,p={element:e,options:t,plugins:t.plugins},g="",m="",y=null;await em("beforeSnap",p);let v=null;!1!==t.resolvePicturePlaceholders&&!function(e){if(Array.isArray(e.plugins))for(let t of e.plugins)if("picture-resolver"===Kg(t)?.name)return!0;return nm().some(e=>"picture-resolver"===e?.name)}(t)&&(v=await $h(p.element,p.options)),await em("beforeClone",p);let A=Gg(p.element,h);try{({clone:n,classCSS:r,styleCache:i,nodeMap:o,reconcileRisk:a,clipWindow:s}=await Lg(p.element,p.options)),a>0&&!t.reconcile&&!Xf.warnedReconcile&&(Xf.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time).")),!f&&n&&(y=function(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||"none"===r){let n=null;try{n=dg(e).scale}catch{}try{t.style.transform="none"}catch{}if(!n)return{a:1,b:0,c:0,d:1};let r=n.trim().split(/\s+/).map(parseFloat),i=Number.isFinite(r[0])?r[0]:1;return{a:i,b:0,c:0,d:Number.isFinite(r[1])?r[1]:i}}function i(e,t,n,r){let i=Math.sqrt(e*e+t*t)||0,o=0,a=0;if(i>0){let s=e/i,l=t/i;o=s*n+l*r;let c=n-s*o,u=r-l*o;a=Math.sqrt(c*c+u*u)||0,a>0?o/=a:o=0}return{a:i,b:0,c:o*a,d:a}}let o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let e=o[1].split(",").map(e=>parseFloat(e.trim()));if(6===e.length&&e.every(Number.isFinite)){let[n,r,o,a]=e,s=i(n,r,o,a);try{t.style.transform=`matrix(${s.a}, ${s.b}, ${s.c}, ${s.d}, 0, 0)`}catch{}return s}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let e=a[1].split(",").map(e=>parseFloat(e.trim()));if(16===e.length&&e.every(Number.isFinite)){let n=i(e[0],e[1],e[4],e[5]);try{t.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, 0, 0)`}catch{}return n}}try{let e=new DOMMatrix(r),n=i(e.a,e.b,e.c,e.d);try{t.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, 0, 0)`}catch{}return n}catch{return null}}(p.element,n)),!d&&n&&function(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(e){Od(n,"stripRootShadows boxShadow",e)}try{t.style.textShadow="none"}catch(e){Od(n,"stripRootShadows textShadow",e)}try{t.style.outline="none"}catch(e){Od(n,"stripRootShadows outline",e)}let i=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=i.length?i:"none"}catch(e){Od(n,"stripRootShadows filter",e)}}(p.element,n,p.options),n&&(function(e,t,n){if(!e||!t||!t.style)return;let r=getComputedStyle(e);if(!Ig(r))for(let i of["top","bottom"]){let o="top"===i?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let a=e,s=t;for(;a&&s;){let e=xg(a,i);if(!e)break;let t=n?Array.from(s.children).find(t=>n.get(t)===e)||null:s.children[Array.from(a.children).indexOf(e)]||null,r=getComputedStyle(e),l=parseFloat(r[`margin${o}`])||0;if(t&&t.style&&l>0&&(t.style[`margin${o}`]="0px"),Ig(r)||(parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)break;a=e,s=t}}}(p.element,n,o),function(e,t){if(!e||!t||!t.style)return;let n=1;try{n=parseFloat(getComputedStyle(e).zoom)}catch{return}if(t.style.getPropertyValue("zoom")||Number.isFinite(n)&&1!==n)try{t.style.setProperty("zoom","1","important")}catch{}}(p.element,n))}finally{A()}if(p={clone:n,classCSS:r,styleCache:i,nodeMap:o,...p},await em("afterClone",p),v&&await v(),Eg(p.clone),"remove"===p.options?.excludeMode||"remove"===p.options?.filterMode)try{!function(e,t,n=new Map){!function e(t,r){if(1!==t?.nodeType||1!==r?.nodeType)return;let i=t.childElementCount>r.childElementCount,o=n.get(t)||getComputedStyle(t);if(n.has(t)||n.set(t,o),i&&Bg(t,o)){r.style.height||(r.style.height="auto"),r.style.width||(r.style.width="auto"),r.style.removeProperty("block-size"),r.style.removeProperty("inline-size"),r.style.minHeight||(r.style.minHeight="0"),r.style.minWidth||(r.style.minWidth="0"),r.style.maxHeight||(r.style.maxHeight="none"),r.style.maxWidth||(r.style.maxWidth="none");let e=o.overflowY||o.overflowBlock||"visible",t=o.overflowX||o.overflowInline||"visible";("visible"!==e||"visible"!==t)&&(r.style.overflow="visible")}let a=Array.from(t.children),s=Array.from(r.children);for(let t=0;t<Math.min(a.length,s.length);t++)e(a[t],s[t])}(e,t)}(p.element,p.clone,p.styleCache)}catch(e){console.warn("[snapdom] shrink pass failed:",e)}try{await async function(e,t,n=Xf.session.nodeMap){if(1!==e?.nodeType)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(e.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim());if(e.matches?.(r)&&e.textContent&&e.textContent.trim()&&i.unshift(e),0===i.length)return 0;let o=1===t?.nodeType?Array.from(t.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim()):[];1===t?.nodeType&&t.matches?.(r)&&t.textContent&&t.textContent.trim()&&o.unshift(t);let a=0;for(let e=0;e<i.length;e++){let t=i[e],r=n&&n.get(t)||o[e]||null;try{let e=getComputedStyle(r||t),n=e.fontFamily||"Material Icons";if(!mp(n))continue;let i=(r||t).textContent.trim();if(!i)continue;let o=parseInt(e.fontSize,10)||24,s=e.fontWeight&&"normal"!==e.fontWeight?e.fontWeight:"normal",l=vp(e),c=e.fontVariationSettings&&"normal"!==e.fontVariationSettings?e.fontVariationSettings:"",u=(r||t).className||"",{dataUrl:f,width:d,height:h}=await Ap(i,{family:n,weight:s,fontSize:o,color:l,variation:c,className:u});t.textContent="";let p=t.ownerDocument.createElement("img");p.src=f,p.alt=i,p.style.height=`${o}px`,p.style.width=`${Math.max(1,Math.round(d/h*o))}px`,p.style.objectFit="contain",p.style.verticalAlign=getComputedStyle(t).verticalAlign||"baseline",t.appendChild(p),a++}catch{}}return a}(p.clone,p.element,p.nodeMap)}catch{}let b=e=>new Promise((t,n)=>{Ld(()=>{Promise.resolve().then(e).then(t,n)},{fast:u})}),w=(async()=>{await Promise.all([b(()=>Ug(p.clone,p.options)),b(()=>async function(e,t,n,r={},i=Xf.session.nodeMap){if(!t)return;let o=[];e&&xh(e)&&o.push([e,t]);let a=[t];for(;a.length;){let e=a.pop();if(e.children)for(let t of e.children){if("STYLE"===t.tagName)continue;let e=i.get(t);e&&xh(e)&&o.push([e,t]),a.push(t)}}for(let e=0;e<o.length;e+=6)await Promise.allSettled(o.slice(e,e+6).map(([e,t])=>$g(e,t,n,r)))}(p.element,p.clone,p.styleCache,p.options,p.nodeMap))]);try{zg(p.element,p.clone,p.nodeMap)}catch(e){console.warn("[snapdom] backdrop-filter emulation failed:",e)}t.compress&&await b(()=>im(p.clone,p.options,p.nodeMap))})(),I=Promise.resolve();t.embedFonts&&(I=b(async()=>{let e=p.element.ownerDocument||document,t=h?e=>{try{let t=e.getBoundingClientRect();return t.right>=h.left-200&&t.left<=h.right+200&&t.bottom>=h.top-200&&t.top<=h.bottom+200}catch{return!0}}:null,{required:n,usedCodepoints:r}=Vp(p.element,t);if(Ud()){let t=new Set(Array.from(n).map(e=>String(e).split("__")[0]).filter(Boolean));await Yp(t,1,e)}g=await jp({required:n,usedCodepoints:r,preCached:!1,exclude:p.options.excludeFonts,localFonts:p.options.localFonts,useProxy:p.options.useProxy,fontStylesheetDomains:p.options.fontStylesheetDomains,doc:e})})),await Promise.all([w,I]);let x=function(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),"function"==typeof e.querySelectorAll&&e.querySelectorAll("*").forEach(e=>t.add(e.tagName.toLowerCase())),Array.from(t))}(p.clone).sort(),C=x.join(",");Xf.baseStyle.has(C)?m=Xf.baseStyle.get(C):await new Promise(e=>{Ld(()=>{m=function(e){let t=new Map;for(let n of e){let e=hd(n);if(!e)continue;let r=Object.entries(e).map(([e,t])=>`${e}:${t};`).sort().join("");r&&(t.has(r)||t.set(r,[]),t.get(r).push(n))}let n="";for(let[e,r]of t.entries())n+=`${r.join(",")} { ${e} }\n`;return n}(x),Xf.baseStyle.set(C,m),e()},{fast:u})});let E=function(e){if(!e||!e.styleSheets)return"";let t=function(e){let t="";for(let n of e.styleSheets){let e=-1;try{e=n.cssRules?n.cssRules.length:-1}catch{}t+=(n.href||"inline")+":"+e+"|"}return t}(e),n=Tg.get(e);if(n&&n.fp===t)return n.css;let r=new Set,i="";for(let t of Array.from(e.styleSheets))try{let e=t.cssRules;e&&(i+=Mg(e,r))}catch{}return Tg.set(e,{fp:t,css:i}),i}(p.element?.ownerDocument||document);p={fontsCSS:g,baseCSS:m,scrollbarCSS:E,...p},await em("beforeRender",p),await new Promise(e=>{Ld(()=>{let n=yd(p.element),r=p.element.getBoundingClientRect(),i=Math.max(1,Fg(p.element.offsetWidth||parseFloat(n.width)||r.width||1)),o=Math.max(1,Fg(p.element.offsetHeight||parseFloat(n.height)||r.height||1)),a=p.element.ownerDocument||document;if(!(s||p.element!==a.body&&p.element!==a.documentElement||a.documentElement.hasAttribute("data-sd-pinned"))){let e=Math.max(p.element.scrollHeight||0,a.documentElement?.scrollHeight||0,a.body?.scrollHeight||0),t=Math.max(p.element.scrollWidth||0,a.documentElement?.scrollWidth||0,a.body?.scrollWidth||0);e>0&&(o=Math.max(o,Fg(e))),t>0&&(i=Math.max(i,Fg(t)));try{let e=(p.scrollbarCSS||"").length+(p.baseCSS||"").length+(p.fontsCSS||"").length+(p.classCSS||"").length,t=Xf.measureHints.get(p.element);if(t&&t.cssLen===e&&t.w0===i)t.csh>0&&(o=Math.max(o,Fg(t.csh))),t.csw>0&&(i=Math.max(i,Fg(t.csw)));else{let t=a.createElement("div");t.setAttribute("data-snapdom-internal",""),t.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let n=t.attachShadow({mode:"open"}),r=a.createElement("style");r.textContent=(p.scrollbarCSS||"")+p.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+p.classCSS,n.appendChild(r),n.appendChild(p.clone.cloneNode(!0)),a.body.appendChild(t);let s=t.scrollHeight,l=t.scrollWidth;a.body.removeChild(t),Xf.measureHints.set(p.element,{cssLen:e,w0:i,csh:s,csw:l}),s>0&&(o=Math.max(o,Fg(s))),l>0&&(i=Math.max(i,Fg(l)))}}catch{}}if("remove"===p.options?.excludeMode||"remove"===p.options?.filterMode){let e=function(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,s=Array.from(e.children);for(let e of s){if(kg(e,t)||!Sg(e))continue;let n=e.getBoundingClientRect(),s=n.top-r.top,l=n.bottom-r.top;l<=s||(s<i&&(i=s),l>o&&(o=l),a=!0)}let l=a?Math.max(0,o-i):0;return(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0)+(parseFloat(n.paddingTop)||0)+(parseFloat(n.paddingBottom)||0)+l}(p.element,p.options);Number.isFinite(e)&&e>0&&(o=Math.max(1,Math.min(o,Fg(e+1))))}if(p.options?.reconcile)try{let e=(p.scrollbarCSS||"")+p.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+p.classCSS;!function(e,t,n,r,i,o){let a=e.ownerDocument||document,s=e.getBoundingClientRect(),l=i>0&&s.width>0?s.width/i:1,c=o>0&&s.height>0?s.height/o:1;if(Math.abs(l-c)>.02)return 0;let u=a.createElement("div");u.setAttribute("data-snapdom-internal",""),u.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let f=u.attachShadow({mode:"open"}),d=a.createElement("style");d.textContent=n,f.appendChild(d);let h=t.cloneNode(!0);f.appendChild(h),a.body.appendChild(u);let p=0,g=(e,t,n)=>{let r=yd(e),i="border-box"===r.boxSizing,o=(e,t,...n)=>{let r=parseFloat(e);if(!Number.isFinite(r))return t;let o=r+(i?0:n.reduce((e,t)=>e+(parseFloat(t)||0),0));return Math.abs(o-t)<=.51?o:t};return{width:o(r.width,t,r.paddingLeft,r.paddingRight,r.borderLeftWidth,r.borderRightWidth),height:o(r.height,n,r.paddingTop,r.paddingBottom,r.borderTopWidth,r.borderBottomWidth)}};try{let e=h.getBoundingClientRect(),n=h.offsetWidth||i,a=h.offsetHeight||o,s=n>0&&e.width>0?e.width/n:1,u=a>0&&e.height>0?e.height/a:1,f=(e,t,n=!1)=>{let i=e.children,o=t.children,a=Math.min(i.length,o.length);for(let e=0;e<a;e++){let t=i[e],a=o[e],d=r.get(t),h=n||mg.has(t);if(1===d?.nodeType&&t?.namespaceURI===gg&&t.style&&d.isConnected){let e=d.getBoundingClientRect();if(e.width>0&&e.height>0){let n=a.getBoundingClientRect(),r=e.width/l,i=e.height/c,o=n.width,f=n.height,m=d.offsetWidth||r,y=d.offsetHeight||i,v=a.offsetWidth||o,A=a.offsetHeight||f,b=Math.abs(r-m)>Dg||Math.abs(i-y)>Dg||Math.abs(o-v)>Dg||Math.abs(f-A)>Dg;if(h){let e=g(a,v,A);r=o>0?r*s*e.width/o:r,i=f>0?i*u*e.height/f:i,o=e.width,f=e.height}else if(b){let e=g(d,m,y),t=g(a,v,A);r=e.width,i=e.height,o=t.width,f=t.height}let w=o-r,I=f-i;(Math.abs(w)>Dg||Math.abs(I)>Dg)&&(t.style.boxSizing="border-box",t.style.width=`${Fg(r)}px`,t.style.height=`${Fg(i)}px`,p++)}}f(t,a,h)}};f(t,h)}finally{u.remove()}}(p.element,p.clone,e,p.nodeMap,i,o)}catch(e){console.warn("[snapdom] reconcile pass failed:",e)}let u=(e,t=NaN)=>{let n="string"==typeof e?parseFloat(e):e;return Number.isFinite(n)?n:t},h=u(p.options.width),g=u(p.options.height),m=s?Fg(s.width):i,v=s?Fg(s.height):o,A=m,b=v,w=Number.isFinite(h),I=Number.isFinite(g),x=v>0?m/v:1;w&&I?(A=Math.max(1,Fg(h)),b=Math.max(1,Fg(g))):w?(A=Math.max(1,Fg(h)),b=Math.max(1,Fg(A/(x||1)))):I&&(b=Math.max(1,Fg(g)),A=Math.max(1,Fg(b*(x||1))));let C=0,E=0,B=i,S=o;if(s){let e=0,t=0;if(am(p.element)){let r=null;if(!f&&y&&Number.isFinite(y.a))r={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0};else{let e=dg(p.element),t=wg(n.transform&&"none"!==n.transform?n.transform:"",e);t&&t.is2D&&(r={a:t.a,b:t.b,c:t.c,d:t.d,e:0,f:0})}if(r&&(1!==r.a||0!==r.b||0!==r.c||1!==r.d)){let{ox:a,oy:s}=fg(n,i,o),l=ug(i,o,r,a,s);e=l.minX,t=l.minY}}C=Fg(s.x+e),E=Fg(s.y+t),B=Fg(C+s.width),S=Fg(E+s.height)}else if(!f&&y&&Number.isFinite(y.a)){let e=ug(i,o,{a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0},0,0);C=Fg(e.minX),E=Fg(e.minY),B=Fg(e.maxX),S=Fg(e.maxY)}else if(f&&am(p.element)){let e=n.transform&&"none"!==n.transform?n.transform:"",t=dg(p.element),r=pg({baseTransform:e,rotate:t.rotate||"0deg",scale:t.scale,translate:t.translate}),{ox:a,oy:s}=fg(n,i,o),l=r.is2D?r:new DOMMatrix(r.toString()),c=ug(i,o,{a:l.a,b:l.b,c:l.c,d:l.d,e:0,f:0},a,s);C=Fg(c.minX),E=Fg(c.minY),B=Fg(c.maxX),S=Fg(c.maxY)}let k=function(e){return cg(e.boxShadow)}(n),F=function(e){return cg(e.textShadow)}(n),D=function(e){let t,n=e.filter&&"none"!==e.filter?e.filter:e.webkitFilter||"",r=/blur\(\s*([0-9.]+)px\s*\)/gi,i=0;for(;t=r.exec(n);)i+=parseFloat(t[1])||0;let o=Math.ceil(i);return{top:o,right:o,bottom:o,left:o}}(n),N=function(e){if("none"===(e.outlineStyle||"none"))return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),n=parseFloat(e.outlineOffset||"0")||0,r=t+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}(n),M=function(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||"none"===t)return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,a=0,s=!1;for(let e of n){s=!0;let t=e.match(/-?\d+(?:\.\d+)?px/gi)?.map(e=>parseFloat(e))||[],[n=0,l=0,c=0]=t,u=Math.abs(n)+c,f=Math.abs(l)+c;i=Math.max(i,u+Math.max(n,0)),a=Math.max(a,u+Math.max(-n,0)),o=Math.max(o,f+Math.max(l,0)),r=Math.max(r,f+Math.max(-l,0))}return{bleed:{top:Fg(r),right:Fg(i),bottom:Fg(o),left:Fg(a)},has:s}}(n),T=s?{top:0,right:0,bottom:0,left:0}:d?{top:Fg(Math.max(k.top,F.top)+D.top+N.top+M.bleed.top),right:Fg(Math.max(k.right,F.right)+D.right+N.right+M.bleed.right),bottom:Fg(Math.max(k.bottom,F.bottom)+D.bottom+N.bottom+M.bleed.bottom),left:Fg(Math.max(k.left,F.left)+D.left+N.left+M.bleed.left)}:{top:D.top,right:D.right,bottom:D.bottom,left:D.left};C=Fg(C-T.left),E=Fg(E-T.top),B=Fg(B+T.right),S=Fg(S+T.bottom);let Q=Math.max(1,Fg(B-C)),L=Math.max(1,Fg(S-E)),R=w||I?Fg(A/m):1,U=I||w?Fg(b/v):1,H=Math.max(1,Fg(Q*R)),O=Math.max(1,Fg(L*U)),q="http://www.w3.org/2000/svg",P=am(p.element)?2:0,$=Fg(P+(f?0:1)),z=Math.ceil(Q+2*$),j=Math.ceil(L+2*$),V=Fg(-(Fg(C)-$)),Y=Fg(-(Fg(E)-$)),W=Math.max(0,V),G=Math.max(0,Y),J=Fg(z-Math.min(0,V)),_=Fg(j-Math.min(0,Y)),X=document.createElementNS(q,"foreignObject");X.setAttribute("x",String(Math.min(0,V))),X.setAttribute("y",String(Math.min(0,Y))),X.setAttribute("width",String(J)),X.setAttribute("height",String(_)),X.style.overflow="visible";let K=document.createElement("style");K.textContent=(p.scrollbarCSS||"")+p.baseCSS+p.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}"+p.classCSS,X.appendChild(K);let Z=document.createElement("div");Z.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Z.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${J}px;height:${_}px`+(0!==W||0!==G?`;padding:${G}px 0 0 ${W}px !important`:""),Z.appendChild(p.clone),X.appendChild(Z);let ee=(new XMLSerializer).serializeToString(X),te=w||I,ne=Object.freeze({w0:m,h0:v,vbW:z,vbH:j,targetW:A,targetH:b,contentX:Fg(V+(s?C:0)),contentY:Fg(Y+(s?E:0)),clip:s?Object.freeze({x:Fg(C),y:Fg(E),width:m,height:v}):null});Object.defineProperty(t,"meta",{value:ne,enumerable:!0,writable:!1,configurable:!0});let re=!te||Ud()?z:Fg(H+2*$),ie=!te||Ud()?j:Fg(O+2*$),oe=parseFloat(yd(a.documentElement)?.fontSize)||16;c=`<svg xmlns="${q}" width="${re}" height="${ie}" viewBox="0 0 ${z} ${j}" font-size="${oe}px">`+ee+"</svg>",l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,p={svgString:c,dataURL:l,...p},e()},{fast:u})}),await em("afterRender",p);let B=document.getElementById("snapdom-sandbox");return B&&"absolute"===B.style.position&&B.remove(),p.dataURL}function am(e){return function(e){let t=yd(e),n=t.transform||"none";if("none"!==n&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=t.rotate&&"none"!==t.rotate&&"0deg"!==t.rotate,i=t.scale&&"none"!==t.scale&&"1"!==t.scale,o=t.translate&&"none"!==t.translate&&"0px 0px"!==t.translate;return!!(r||i||o)}(e)}Kf(),Hd(),qd();var sm=new WeakMap;function lm(e,t,n){let r=new Set;if(e instanceof HTMLVideoElement&&r.add(e),e.querySelectorAll)for(let t of e.querySelectorAll("video"))r.add(t);for(let e of t.trackedVideos)r.has(e)||(e.removeEventListener("timeupdate",n),e.removeEventListener("seeked",n),t.trackedVideos.delete(e));for(let e of r)t.trackedVideos.has(e)||(e.addEventListener("timeupdate",n),e.addEventListener("seeked",n),t.trackedVideos.add(e))}function cm(e){let{burst:t,invalidate:n,...r}=e||{};try{return JSON.stringify(r,Object.keys(r).sort())}catch{return null}}function um(e,t,n,r){let i=sm.get(e);i||(i=function(e){let t={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},n=e=>{t.capturing||bh(e)&&(t.dirty=!0)},r=()=>{t.capturing||(t.dirty=!0)},i=e.ownerDocument||document;try{let r=new MutationObserver(n);r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),t.observers.push(r)}catch{}try{if(i.head){let e=new MutationObserver(n);e.observe(i.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),t.observers.push(e)}}catch{}return t.markDirty=n,t.onMediaDirty=r,lm(e,t,r),t}(e),i.baselineSignature=cm(t),sm.set(e,i));let o=cm(t),a=null===o||o!==i.baselineSignature,s=async()=>{for(let e of i.observers)i.markDirty(e.takeRecords());if(n.invalidate&&(i.dirty=!0),!a&&!i.dirty&&i.last)return i.last;i.capturing=!0,a||(i.dirty=!1);try{let e=await r();return a||(i.last=e),e}finally{for(let e of i.observers)e.takeRecords();i.capturing=!1,lm(e,i,i.onMediaDirty)}},l=i.inflight.then(s,s);return i.inflight=l.catch(()=>{}),l}Pd(),ud(),Kf();var fm=Object.assign(async function(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=function(e={}){let t=e.format??"png";"jpg"===t&&(t="jpeg");let n=function(e){if(!0===e)return"soft";if(!1===e)return"disabled";if("string"==typeof e){let t=e.toLowerCase().trim();if("auto"===t)return"auto";if("full"===t)return"full";if("soft"===t||"disabled"===t)return t}return"soft"}(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:!1!==e.placeholders,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:n,useProxy:"string"==typeof e.useProxy?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,reconcile:e.reconcile??!1,burst:e.burst??!1,invalidate:e.invalidate??!1,clip:e.clip??null,compress:!1!==e.compress,excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:!1!==e.resolvePicturePlaceholders,pictureResolver:e.pictureResolver&&"object"==typeof e.pictureResolver?e.pictureResolver:{}}}(t);if(tm(n,t&&t.plugins),Ud()){if(!0===n.embedFonts)try{let t=function(e,t){return Vp(e,t).required}(e),n=new Set([...t].map(e=>String(e).split("__")[0]).filter(Boolean));await Yp(n,1)}catch{}let r=Array.from(e.querySelectorAll("canvas"));"CANVAS"===e.tagName&&r.unshift(e);for(let e of r)try{let t=e.getContext("2d",{willReadFrequently:!0});t&&t.getImageData(0,0,1,1)}catch(e){Od(t,"safari canvas poke failed",e)}}return n.iconFonts&&n.iconFonts.length>0&&function(e){let t=Array.isArray(e)?e:[e];for(let e of t){let t;if(e instanceof RegExp)t=e;else{if("string"!=typeof e){console.warn("[snapdom] Ignored invalid iconFont value:",e);continue}t=new RegExp(pp(e),"i")}let n=`${t.source}/${t.flags}`;hp.has(n)||(hp.add(n),dp.push(t))}}(n.iconFonts),n.snap||(n.snap={toPng:(e,t)=>fm.toPng(e,t),toSvg:(e,t)=>fm.toSvg(e,t)}),n.burst?um(e,t,n,()=>fm.capture(e,n,dm)):fm.capture(e,n,dm)},{plugins:function(...e){return function(...e){let t=e.flat();for(let e of t){let t=Kg(e);t&&(Xg.some(e=>e&&e.name&&t.name&&e.name===t.name)||Xg.push(t))}}(...e),fm}}),dm=Symbol("snapdom.internal"),hm=Symbol("snapdom.internal.silent");function pm(e){return document.querySelectorAll(e)}function gm(e){function t(e){e.parentNode.removeChild(e)}if(Su(e)){return void t(e)}if(!ke(e))return;vn(pm(e),function(e){t(e)})}function mm(e,t){if(!Su(e))return"invalid eleParent";if(Se(t))e.insertAdjacentHTML("afterbegin",t);else{if(!Su(t))return"invalid itemChild";e.insertBefore(t,e.firstChild)}}async function ym(e,t={}){if(!Su(e))return Promise.reject("invalid ele");let n=be(t,"scale",null);if(Ne(n)||(n=1),n=Ir(n),n<1)return Promise.reject("opt.scale can not less then 1");let r=be(t,"picType",null);"image/jpg"!==r&&"image/jpeg"!==r&&"image/png"!==r&&"svg"!==r&&(r="image/png");let i=be(t,"toBase64",null);we(i)||(i=!0);let o=e.cloneNode(!0),a=document.createElement("div");a.style.position="absolute",a.style.top=0,a.style.left=0,a.style.zIndex=-1,a.appendChild(o);let s=document.createElement("div");s.style.opacity=0,s.style.position="relative",s.appendChild(a),mm(document.querySelector("body"),s);let l,c={scale:n,quality:1,cache:"disabled"};return"image/jpg"===r||"image/jpeg"===r?l=await fm.toJpg(a,c):"image/png"===r?l=await fm.toPng(a,c):"svg"===r&&(l=await fm.toSvg(a,c)),i&&(l=be(l,"src","")),gm(s),l}fm.capture=async(e,t,n)=>{if(n!==dm)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");t.element=e;let r=await om(e,t),i={img:async(e,t)=>{let{toImg:n}=await Promise.resolve().then(()=>(sh(),oh));return n(r,{...e,...t||{}})},svg:async(e,t)=>{let{toSvg:n}=await Promise.resolve().then(()=>(sh(),oh));return n(r,{...e,...t||{}})},canvas:async(e,t)=>{let{toCanvas:n}=await Promise.resolve().then(()=>(th(),$d));return n(r,{...e,...t||{}})},blob:async(e,t)=>{let{toBlob:n}=await Promise.resolve().then(()=>(uh(),lh));return n(r,{...e,...t||{}})},png:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(ih(),nh));return n(r,{...e,...t||{},format:"png"})},jpeg:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(ih(),nh));return n(r,{...e,...t||{},format:"jpeg"})},webp:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(ih(),nh));return n(r,{...e,...t||{},format:"webp"})},download:async(e,t)=>{let{download:n}=await Promise.resolve().then(()=>(ph(),fh));return n(r,{...e,...t||{}})}},o={};for(let e of["img","svg","canvas","blob","png","jpeg","webp"])o[e]=async n=>i[e](t,{...n||{},[hm]:!0});o.jpg=o.jpeg;let a={...t,export:{url:r},exports:o},s=await async function(e,t,n){let r=[],i=Zg(t);for(let o of i){let i=o&&"function"==typeof o[e]?o[e]:null;if(!i)continue;let a=await i(t,n);typeof a<"u"&&r.push(a)}return r}("defineExports",a),l=Object.assign({},...s.filter(e=>e&&"object"==typeof e).reverse()),c={...i,...l};c.jpeg&&!c.jpg&&(c.jpg=(e,t)=>c.jpeg(e,t));let u=!1,f=Promise.resolve();async function d(e,n){let i=Object.freeze(n&&"object"==typeof n?{...n}:{}),o=f.then(async()=>{let n=c[e];if(!n)throw new Error(`[snapdom] Unknown export type: ${e}`);let o=function(e,n){let r={...t,...n||{}};return[e,r.format,r.type].map(e=>"string"==typeof e?e.toLowerCase():"").find(e=>"jpeg"===e||"jpg"===e||"webp"===e)&&(null==r.backgroundColor||"transparent"===r.backgroundColor)&&(r.backgroundColor="#ffffff"),r}(e,i),a={...t,export:{type:e,options:o,requestedOptions:i,url:r}};await em("beforeExport",a,{format:e,options:o});let s=await n(a,o);return await em("afterExport",a,{format:e,options:o,result:s}),u||(u=!0,await em("afterSnap",t)),s});return f=o.catch(()=>{}),o}let h={url:r,toRaw:()=>r,to:(e,t)=>d(e,t),toImg:e=>d("img",e),toSvg:e=>d("svg",e),toCanvas:e=>d("canvas",e),toBlob:e=>d("blob",e),toPng:e=>d("png",e),toJpg:e=>d("jpg",e),toWebp:e=>d("webp",e),download:e=>d("download",e)};Object.defineProperty(h,"meta",{value:t.meta,enumerable:!0,writable:!1,configurable:!1});for(let e of Object.keys(c)){let t="to"+e.charAt(0).toUpperCase()+e.slice(1);h[t]||(h[t]=t=>d(e,t))}return h},fm.toRaw=(e,t)=>fm(e,t).then(e=>e.toRaw()),fm.toImg=(e,t)=>fm(e,t).then(e=>e.toImg()),fm.toSvg=(e,t)=>fm(e,t).then(e=>e.toSvg()),fm.toCanvas=(e,t)=>fm(e,t).then(e=>e.toCanvas()),fm.toBlob=(e,t)=>fm(e,t).then(e=>e.toBlob()),fm.toPng=(e,t)=>fm(e,{...t,format:"png"}).then(e=>e.toPng()),fm.toJpg=(e,t)=>fm(e,{...t,format:"jpeg"}).then(e=>e.toJpg()),fm.toWebp=(e,t)=>fm(e,{...t,format:"webp"}).then(e=>e.toWebp()),fm.download=(e,t)=>fm(e,t).then(e=>e.download());var vm=function(){return w.Date.now()},Am=Math.max,bm=Math.min;function wm(e,t,n){var r,i,o,a,s,l,c=0,u=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,o=i;return r=i=void 0,c=t,a=e.apply(o,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||f&&e-c>=o}function g(){var e=vm();if(p(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return f?bm(n,o-(e-c)):n}(e))}function m(e){return s=void 0,d&&r?h(e):(r=i=void 0,a)}function y(){var e=vm(),n=p(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?h(e):a}(l);if(f)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=vr(t)||0,L(n)&&(u=!!n.leading,o=(f="maxWait"in n)?Am(vr(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:m(vm())},y}function Im(e){if(!e||1!==e.nodeType||!e.isConnected)return!1;if(Oi(e.checkVisibility))try{return e.checkVisibility()}catch(e){}let t=e;for(;t&&1===t.nodeType;){let e="";try{e=window.getComputedStyle(t).display}catch(t){e=""}if("none"===e)return!1;t=t.parentElement||t.parentNode&&t.parentNode.host||null}return!0}function xm(e,t,n,r={}){let i=be(r,"min",-1/0),o=!0===be(r,"minOpen",!1),a="clamp"===be(r,"below","def"),s=!0===be(r,"int",!1),l=!0===be(r,"timer",!1),c="keep"===be(r,"inf","def"),u=be(e,t,null);return Ne(u)?(u=Number(u),(o?u>i:u>=i)?u===1/0?l?Li:c?1/0:n:Number.isFinite(u)?s&&!Number.isInteger(u)?n:(l&&(u=Math.min(u,Li)),u):n:a&&!o&&Number.isFinite(i)?i:n):n}let Cm=new Set,Em=null;function Bm(e){Cm.delete(e),0===Cm.size&&Em&&(Em.disconnect(),Em=null)}function Sm(e){return xm(e,"timeInterval",20,{int:!0,min:0,minOpen:!0,timer:!0})}function km(e,t){let n=be(e,t,null);return Oi(n)?n:null}function Fm(e){let t=null;try{t=e()}catch(e){t=null}return t&&1===t.nodeType?t:null}function Dm(e){return Ne(e)?Ir(e):null}function Nm(e){return e.offsetWidth>0&&e.offsetHeight>0&&e.width>0&&e.height>0}function Mm(e,t,n){let r=function(e){return xm(e,"tolerancePixel",1,{int:!0,min:0,inf:"keep"})}(t),i=!0===be(t,"sync",!1),o=km(t,"getSize"),a=km(t,"getBase"),s=function(e){return xm(e,"throttle",0,{int:!0,min:0,minOpen:!0,timer:!0})}(t),l=!1,c={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},u={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},f=null,d=new Set,h=0,p=0,g=(e,t)=>{let n=(e=>{if(!a)return{width:u.width,height:u.height};let t=null;try{t=a()}catch(e){t=null}let n=Dm(be(t,"width",null)),r=Dm(be(t,"height",null));return e&&p<h?{width:null===n?null:u.width,height:null===r?null:u.height}:{width:n,height:r}})(t),i=null===n.width?0:n.width-e.width,o=null===n.height?0:n.height-e.height;return{dw:i,dh:o,bw:Math.abs(i)>r,bh:Math.abs(o)>r}},m=e=>({width:e.bw?e.dw>0?"smaller":"larger":"",height:e.bh?e.dh>0?"smaller":"larger":""}),y=(t,r,i,o,s,f)=>{if(!l&&!(s<p)&&(p=s,Nm(r))){if(f){if(!Im(o))return void(e=>{u===e&&(u={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},c={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},n&&n())})(r);if(a){let e=g(r,!1);if(!e.bw&&!e.bh)return;i=m(e)}}e.emit("resize",{sold:t,snew:r,smode:i,ele:o}),l||e.emit("resizeWithWindow",{sold:t,snew:r,smode:i,ele:o,from:"dom"})}},v=!1,A=(e,t,n,r,i)=>{if(v)return void y(e,t,n,r,i,!1);let o=setTimeout(()=>{d.delete(o),y(e,t,n,r,i,!0)},1);d.add(o)},b=null;s>0&&(b=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return L(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),wm(e,t,{leading:r,maxWait:t,trailing:i})}(A,s));let w=t=>{l||(c={...c,windowWidth:window.innerWidth,windowHeight:window.innerHeight},Nm(c)&&Im(f)&&e.emit("resizeWithWindow",{sold:u,snew:c,smode:{width:"",height:""},from:"window"}))};window.addEventListener("resize",w);return{check:(e,t)=>{if(l)return;if(!e)return c={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},void(f=null);let n=function(e,t){let n={offsetWidth:e.offsetWidth,offsetHeight:e.offsetHeight,clientWidth:e.clientWidth,clientHeight:e.clientHeight,windowWidth:window.innerWidth,windowHeight:window.innerHeight,width:e.offsetWidth,height:e.offsetHeight};if(t){let r=null;try{r=t(e)}catch(e){r=null}n.width=Dm(be(r,"width",null))||0,n.height=Dm(be(r,"height",null))||0}return n}(e,o);c=n,f=e;let r=g(n,!0);if(!r.bw&&!r.bh)return;let a=u;u=n,h++,((e,t,n,r,i,o)=>{v=o;try{b?b(e,t,n,r,i):A(e,t,n,r,i)}finally{v=!1}})(a,n,m(r),e,h,t&&i)},clear:()=>{l=!0;for(let e of d)clearTimeout(e);d.clear(),b&&b.cancel(),window.removeEventListener("resize",w),f=null},isCleared:()=>l,isVisible:()=>c.offsetWidth>0&&c.offsetHeight>0}}function Tm(e,t={}){if(!Oi(e))return console.log("invalid f",e),null;let n=!0===be(t,"watchIdentity",!1),r=Sm(t),i=Hi(),o=Mm(i,t,()=>{h(),m()}),a=null,s=null,l=!1,c=!1,u=null,f=null,d=()=>{u.observe(a,{box:"border-box"}),f.observe(a)},h=()=>{!o.isCleared()&&a&&(u.unobserve(a),f.unobserve(a),d())},p=()=>{let e="";if(a)try{e=window.getComputedStyle(a).display}catch(t){e=""}l=!(!a||!a.isConnected),"inline"===e?c=!0:"none"!==e&&""!==e&&(c=!1);let t="inline"===e||"none"===e&&c;t&&null===s?s=setInterval(v,r):t||null===s||(clearInterval(s),s=null)},g=()=>{if(o.isCleared())return;let t=Fm(e);t!==a&&(a&&(u.unobserve(a),f.unobserve(a)),a=t,c=!1,a&&d(),p())},m=()=>{if(o.isCleared())return;a&&a.isConnected&&o.isVisible()&&!n?Bm(y):function(e){Cm.add(e),Em||(Em=new window.MutationObserver(()=>{for(let e of Array.from(Cm))e()}),Em.observe(document.documentElement,{childList:!0,subtree:!0}))}(y)},y=()=>{g(),a&&a.isConnected!==l&&p(),m()},v=()=>{g();try{o.check(a,!0)}finally{p(),m()}};return u=new window.ResizeObserver(v),f=new window.ResizeObserver(v),g(),m(),i.refresh=()=>{g(),o.check(a,!1),p(),m()},i.clear=()=>{o.isCleared()||(o.clear(),Bm(y),u.disconnect(),f.disconnect(),null!==s&&(clearInterval(s),s=null),a=null)},i}function Qm(e){if(!Su(e))return null;try{return e.getBoundingClientRect()}catch(e){}return null}function Lm(e,t){if(!Be(e))return null;if(!ua(e.clientX)||!ua(e.clientY))return null;if(!Su(t))return null;let n=Qm(t);return n?{x:e.clientX-n.left,y:e.clientY-n.top,w:t.offsetWidth,h:t.offsetHeight}:null}function Rm(e){let t=be(e,"clientX",null),n=be(e,"clientY",null),r=be(e,"pageX",null),i=be(e,"pageY",null);if(null!==t&&null!==n&&null!==r&&null!==i)return{clientX:t,clientY:n,pageX:r,pageY:i};let o=be(e,"changedTouches",[]);if(1!==or(o))return null;let a=o[0];return{clientX:be(a,"clientX",null),clientY:be(a,"clientY",null),pageX:be(a,"pageX",null),pageY:be(a,"pageY",null)}}function Um(e={}){let t=null,n=!1,r=be(e,"attIdentify",null);ke(r)||(r="dragprevid");let i=xm(e,"containerOpacity",.4),o=be(e,"containerBackground",null);ke(o)||(o="white");let a=xm(e,"containerBorderWidth",1),s=be(e,"containerBorderColor",null);ke(s)||(s="#f26");let l=`c${Uu(8)}`;function c(e,t,n){let c=function(e,t,n){let i=Qm(e);if(!i)return null;let o=e.cloneNode(!0);o.tShiftX=t-i.left,o.tShiftY=n-i.top,o.tWidth=e.offsetWidth,o.tHeight=e.offsetHeight,o.tParent=e.parentNode,o.setAttribute(r,"");let a=[];try{a=Array.from(o.querySelectorAll("input[type=radio]")),o.matches("input[type=radio]")&&a.push(o)}catch(e){}for(let e of a)e.removeAttribute("name");return o}(e,t,n);if(null===c)return null;let u=document.createElement("div");u.style.position="absolute",u.style.zIndex=1,u.style.top=0,u.style.left=0,u.style.width="100%",u.style.height="100%",u.appendChild(c);let f=document.createElement("div");f.style.position="relative",f.appendChild(u);let d=document.createElement("div");return d.setAttribute("dragpreviewid",l),d.style.position="fixed",d.style.zIndex=1e5,d.style.width=`${c.tWidth+2*a}px`,d.style.height=`${c.tHeight+2*a}px`,d.style.opacity=i,d.style.background=o,d.style.border=`${a}px solid ${s}`,d.style.pointerEvents="none",d.appendChild(f),document.querySelector("body").appendChild(d),{ele:e,node:c,cover:u,shell:f,container:d,timer:null,offs:[]}}function u(e,t,n){window.addEventListener(t,n,!0),e.offs.push(()=>{window.removeEventListener(t,n,!0)})}function f(e,r,i){t&&!n&&(t.container.style.top=r-t.node.tShiftY+"px",t.container.style.left=e-t.node.tShiftX+"px")}function d(){let e=t;if(!e)return;t=null,clearInterval(e.timer);for(let t of e.offs)t();e.offs=[];let n=e.container;n.parentNode&&n.parentNode.removeChild(n)}function h(e,n){if(t)try{for(let r of Object.keys(n))t[e].style[r]=n[r]}catch(e){}}return{createPreview:function(e,n,r){d();let i=null;try{i=c(e,n,r)}catch(e){i=null}null!==i&&(t=i,u(i,"mousemove",e=>{f(e.clientX,e.clientY)}),u(i,"touchmove",e=>{let t=Rm(e);t&&f(t.clientX,t.clientY)}),f(n,r),i.timer=setInterval(()=>{t===i?i.ele.isConnected||d():clearInterval(i.timer)},500))},updateDragPreview:f,pauseDragPreview:function(e){n=e},removeDragPreview:d,setNodeStyle:function(e){h("node",e)},setCoverStyle:function(e){h("cover",e)},setSellStyle:function(e){h("shell",e)},setContainerStyle:function(e){h("container",e)},clear:function(){d()}}}let Hm=new Map,Om=null,qm=-1/0;function Pm(){return"undefined"!=typeof performance&&Oi(performance.now)?performance.now():Date.now()}function $m(e,t){try{return e.getAttribute(t)}catch(e){return null}}function zm(e,t){let n=$m(e,t);return Ne(n)&&Number.isFinite(Number(n))?Vi(n):null}function jm(e,t){let n=be(e,"length",0);if(null===t)return 1===n?e[0]:null;for(let r=0;r<n;r++)if(be(e[r],"identifier",null)===t)return e[r];return null}function Vm(e){let t=be(e,"clientX",null),n=be(e,"clientY",null);return ua(t)&&ua(n)?{clientX:t,clientY:n}:null}function Ym(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Wm(e){for(;e.length>0;){let t=e.pop();try{t()}catch(e){}}}function Gm(e,t,n,r){let i=t?e.members.get(t):null;if(!i)return;let o=r(i);i.ev.emit("change",{mode:n,...o}),e.members.get(t)===i&&i.ev.emit(n,o)}function Jm(e,t){let n=[];try{n=document.elementsFromPoint(t.clientX,t.clientY)}catch(e){n=[]}for(let t of n){let n=e.members.get(t);if(!n)continue;let r=zm(t,n.o.attIndex);if(null!==r)return{ele:t,ind:r}}return null}function _m(e,t=null,n=null){let r=e.drag;if(!r)return;e.drag=null,Om===e&&(Om=null),null!==r.timer&&(clearTimeout(r.timer),r.timer=null),Wm(r.offs),r.pv&&(r.pv.clear(),r.pv=null);let i=r.endEle,o=r.endInd;!i||n&&o===n.ind||Gm(e,i,"leave",e=>({event:t,startInd:r.startInd,startEle:r.startEle,endInd:o,endEle:i,tarInd:o,tarEid:e.eid})),n&&Gm(e,n.ele,"drop",e=>({event:t,startInd:r.startInd,startEle:r.startEle,endInd:n.ind,endEle:n.ele,tarInd:n.ind,tarEid:e.eid}))}function Xm(e,t,n){if(e.drag!==t)return;let r=null;if(t.touch)r=Vm(jm(be(n,"changedTouches",null),t.touchId));else{if(!0===n.isTrusted&&ua(n.buttons)&&!(1&n.buttons))return void _m(e,n);r=Vm(n)}if(!r)return;if(!e.members.has(t.startEle))return void _m(e,n);t.lastP=r,t.pv&&t.pv.updateDragPreview(r.clientX,r.clientY,"domDrag");let i=Jm(e,r),o=t.o,a=()=>{let r=t.endEle,i=t.endInd;t.endEle=null,t.endInd=null,Gm(e,r,"leave",e=>({event:n,startInd:t.startInd,startEle:t.startEle,endInd:i,endEle:r,tarInd:i,tarEid:e.eid})),t.pv&&t.pv.setContainerStyle({opacity:o.previewDisabledOpacity})};if(!i)return void(null!==t.endInd&&a());if(i.ind===t.startInd)return void(null!==t.endInd&&a());if(i.ind!==t.endInd){if(null!==t.endInd&&(a(),e.drag!==t))return;return t.endInd=i.ind,t.endEle=i.ele,Gm(e,i.ele,"enter",e=>({event:n,startInd:t.startInd,startEle:t.startEle,endInd:i.ind,endEle:i.ele,tarInd:i.ind,tarEid:e.eid})),void(t.pv&&t.pv.setContainerStyle({opacity:o.previewOpacity}))}t.endEle=i.ele;let s=Lm(r,i.ele);if(!s)return;let l=s.w>0?s.x/s.w:0,c=s.h>0?s.y/s.h:0;l>=0&&l<=1&&c>=0&&c<=1&&(Gm(e,i.ele,"move",e=>({event:n,startInd:t.startInd,startEle:t.startEle,endInd:t.endInd,endEle:t.endEle,tarInd:t.endInd,tarEid:e.eid,...s,rx:l,ry:c})),t.pv&&t.pv.setContainerStyle({opacity:o.previewOpacity}))}function Km(e,t,n){if(e.drag!==t)return;let r=n;if(t.touch){if(r=jm(be(n,"changedTouches",null),t.touchId),!r)return;qm=Pm()}else if("button"in n&&0!==n.button)return;if(!e.members.has(t.startEle))return void _m(e,n);t.pv&&(t.pv.clear(),t.pv=null);let i=Vm(r);_m(e,n,i?Jm(e,i):null)}function Zm(e,t,n){e.drag===t&&(null!==t.touchId&&null===jm(be(n,"changedTouches",null),t.touchId)||_m(e,n))}function ey(e,t,n){let r=e.g;if(!e.alive||!r.isActive)return;if(Om&&Om.drag&&Om.drag.pressEvent===t)return;if(!n){if("button"in t&&0!==t.button)return;let e=be(t,"sourceCapabilities.firesTouchEvents",null);if(!0===e)return;if(!1!==e&&Pm()-qm<800)return}let i=n?be(t,"changedTouches[0]",null):t,o=n?be(i,"identifier",null):null;void 0===o&&(o=null);let a=Om?Om.drag:null;if(a&&n){if(!a.touch)return;if(null!==a.touchId&&null!==jm(be(t,"touches",null),a.touchId))return}let s=e.o,l=zm(e.ele,s.attIndex);if(null===l)return;Om&&_m(Om,t);let c={touch:n,touchId:o,pressEvent:t,o:s,startInd:l,startEle:e.ele,endInd:null,endEle:null,timer:null,pv:null,offs:[],lastEv:null,lastP:null};r.drag=c,Om=r;let u=e=>t=>{t!==c.lastEv&&(c.lastEv=t,e(r,c,t))},f=u(Xm),d=u(Km),h=u(Zm);if(n){c.offs.push(Ym(window,"touchmove",f,!0)),c.offs.push(Ym(window,"touchend",d,!0)),c.offs.push(Ym(window,"touchcancel",h,!0));let e=be(t,"target",null);e&&Oi(e.addEventListener)&&(c.offs.push(Ym(e,"touchmove",e=>{e.cancelable&&e.preventDefault(),f(e)},{passive:!1})),c.offs.push(Ym(e,"touchend",d)),c.offs.push(Ym(e,"touchcancel",h)))}else c.offs.push(Ym(window,"mousemove",f,!0)),c.offs.push(Ym(window,"mouseup",d,!0));if(c.offs.push(Ym(window,"blur",e=>{r.drag===c&&_m(r,e)})),Gm(r,c.startEle,"start",e=>({event:t,startInd:c.startInd,startEle:c.startEle,tarInd:c.startInd,tarEid:e.eid})),r.drag!==c)return;let p=Vm(i);p&&(c.timer=setTimeout(()=>{c.timer=null,r.drag===c&&(c.pv=Um({attIdentify:s.attIdentify,containerOpacity:s.previewOpacity,containerBackground:s.previewBackground,containerBorderWidth:s.previewBorderWidth,containerBorderColor:s.previewBorderColor}),c.pv.createPreview(c.startEle,p.clientX,p.clientY),c.lastP&&c.pv.updateDragPreview(c.lastP.clientX,c.lastP.clientY,"domDrag"),c.pv.setContainerStyle({opacity:c.endEle?s.previewOpacity:s.previewDisabledOpacity}))},s.timeDragStartDelay))}function ty(e,t={}){function n(e){return(Array.isArray(e)?e:[e]).filter(e=>e&&Oi(e.addEventListener))}let r=n(e),i=be(t,"canPress",null);Oi(i)||(i=()=>!0);let o=be(t,"cancelTouchMove",null);we(o)?o=o?()=>!0:null:Oi(o)||(o=()=>!0);let a=n(be(t,"eleTouchMove",null));0===a.length&&(a=r);let s=Hi(),l="",c=null,u=null,f=[];function d(){return""!==l}function h(e){return"touch"===e||"pen"===e}function p(e){let t=be(e,"pointerType","");return"touch"!==t&&"pen"!==t&&(t="mouse"),t}function g(e){let t=be(e,"pointerId",null);return void 0===t&&(t=null),t}function m(e){if("pointerType"in e&&p(e)!==l)return!1;let t=g(e);return null===c||null===t||t===c}function y(){l="",c=null}function v(e){return{clientX:e.clientX,clientY:e.clientY,pointerType:p(e),event:e}}function A(e){let t=d(),n=l;var r,i;r=p(e),i=g(e),l=r,c=i,t&&(s.emit("free",{pointerType:n,reason:"takeover",event:e}),!d())||s.emit("press",v(e))}function b(e,t){let n=l;y(),s.emit("free",{pointerType:n,reason:t,event:e})}function w(e,t,n,r){e.addEventListener(t,n,r),f.push({target:e,type:t,fun:n,options:r})}let I=e=>{if(e===u)return;if(u=e,!function(e){return!("button"in e)||("pen"===p(e)?0===e.button||5===e.button:0===e.button)}(e))return;if(!i(e))return;let t=p(e);if(d())if("mouse"===t);else{if(l!==t)return;if(!function(e){let t=g(e);if(null!==t&&null!==c&&t===c)return!0;let n=be(e,"isPrimary",null);return!0===n||!1!==n}(e))return}A(e)},x=e=>{d()&&m(e)&&(!function(e){return!(!ua(e.buttons)||33&e.buttons)}(e)?s.emit("drag",v(e)):b(e,"buttonsLost"))},C=e=>{d()&&m(e)&&b(e,"pointercancel"===be(e,"type","")?"cancel":"up")},E=e=>{h(l)&&o(e)&&Ju(e)},B=e=>{h(l)&&"mouse"!==be(e,"pointerType","")&&e.preventDefault()};return function(){for(let e of r)w(e,"pointerdown",I),w(e,"contextmenu",B);if(null!==o)for(let e of a)w(e,"touchmove",E,{passive:!1});w(window,"pointermove",x,{capture:!0}),w(window,"pointerup",C,{capture:!0}),w(window,"pointercancel",C,{capture:!0})}(),s.clear=function(){y(),u=null;for(let e of f)e.target.removeEventListener(e.type,e.fun,e.options);f=[]},s}async function ny(e){let t=[],n=Ja();return await async function e(n){let r=null;if(n.isFile&&(r=await function(e){let t=Ja();try{e.file(t.resolve,t.reject)}catch(e){t.reject(e)}return t}(n)),t.push({type:n.isDirectory?"folder":n.isFile?"file":"unknow",path:n.fullPath,name:n.name,entry:n,file:r}),n.isDirectory){let t=n.createReader(),r=await function(e){let t=Ja();try{e.readEntries(t.resolve,t.reject)}catch(e){t.reject(e)}return t}(t);await rc(r,async t=>{await e(t)})}}(e),n.resolve(t),n}async function ry(e){let t=[];vn(e,e=>{let n=e.webkitGetAsEntry();n&&t.push(n)});let n=await async function(e){let t=[];return await rc(e,async e=>{vn(await ny(e),e=>{t.push(e)})}),t}(t);return n}async function iy(e){let t=[],n=[];try{t=await async function(e){let t=[];return vn(e,e=>{e.type&&t.push({type:"file",name:e.name,file:e})}),t}(be(e,"files",[])),Gu()||(n=await ry(be(e,"items",[])).catch(e=>{console.log(e)}))}catch(e){return Promise.reject(e)}return{files:t,entries:n}}function oy(e){return document.querySelector(e)}function ay(e){return!Nn(e)}var sy=Math.max;var ly,cy=(ly=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:wr(n);return i<0&&(i=sy(r+i,0)),Tn(e,hn(t),i)},function(e,t,n){var r=Object(e);if(!dt(e)){var i=hn(t);e=ht(e),t=function(e){return i(r[e],e,r)}}var o=ly(e,t,n);return o>-1?r[i?e[o]:o]:void 0});let uy=[{name:"pic",group:"image",acp:"image/*",exec:"imageviwer"},{name:"xml",group:"data",acp:"text/xml",exec:"textviwer"},{name:"htm",group:"docums",acp:"text/html",exec:"browser"},{name:"html",group:"docums",acp:"text/html",exec:"browser"},{name:"json",group:"data",acp:"application/json",exec:"textviwer"},{name:"geojson",group:"data",acp:"application/geo+json",exec:"textviwer"},{name:"txt",group:"data",acp:"text/plain",exec:"textviwer"},{name:"csv",group:"data",acp:"text/csv",exec:"excel"},{name:"dat",group:"data",acp:"application/octet-stream",exec:"binaryviwer"},{name:"7z",group:"compress",acp:"application/x-7z-compressed",exec:"compressor"},{name:"bzip",group:"compress",acp:"application/x-bzip",exec:"7z"},{name:"bzip2",group:"compress",acp:"application/x-bzip2",exec:"compressor"},{name:"bz2",group:"compress",acp:"application/x-bzip2",exec:"compressor"},{name:"ace",group:"compress",acp:"application/x-ace-compressed",exec:"compressor"},{name:"Z",group:"compress",acp:"application/x-compress",exec:"compressor"},{name:"lzh",group:"compress",acp:"application/x-lzh-compressed",exec:"compressor"},{name:"lz",group:"compress",acp:"application/x-lzip",exec:"compressor"},{name:"rar",group:"compress",acp:"application/x-rar-compressed",exec:"compressor"},{name:"tar",group:"compress",acp:"application/x-tar",exec:"compressor"},{name:"ar",group:"compress",acp:"application/x-unix-archive",exec:"compressor"},{name:"zip",group:"compress",acp:"application/zip",exec:"compressor"},{name:"gz",group:"compress",acp:"application/gzip",exec:"compressor"},{name:"avro",group:"",acp:"application/avro",exec:""},{name:"dcm",group:"",acp:"application/dicom",exec:""},{name:"eps",group:"",acp:"application/eps",exec:""},{name:"epub",group:"",acp:"application/epub+zip",exec:""},{name:"class",group:"",acp:"application/java-vm",exec:""},{name:"mxf",group:"",acp:"application/mxf",exec:""},{name:"ogx",group:"",acp:"application/ogg",exec:""},{name:"pdf",group:"docums",acp:"application/pdf",exec:"acrobat"},{name:"pgp",group:"",acp:"application/pgp-encrypted",exec:""},{name:"ps",group:"",acp:"application/postscript",exec:""},{name:"ai",group:"",acp:"application/postscript",exec:""},{name:"rtf",group:"docums",acp:"application/rtf",exec:"word"},{name:"icc",group:"",acp:"application/vnd.iccprofile",exec:""},{name:"asf",group:"",acp:"application/vnd.ms-asf",exec:"",msg:"asf的acp可能為application/vnd.ms-asf或audio/x-ms-asf或video/x-ms-asf"},{name:"cab",group:"",acp:"application/vnd.ms-cab-compressed",exec:""},{name:"eot",group:"",acp:"application/vnd.ms-fontobject",exec:""},{name:"chm",group:"",acp:"application/vnd.ms-htmlhelp",exec:""},{name:"pst",group:"",acp:"application/vnd.ms-outlook",exec:""},{name:"odp",group:"docums",acp:"application/vnd.oasis.opendocument.presentation",exec:"powerpoint"},{name:"ods",group:"docums",acp:"application/vnd.oasis.opendocument.spreadsheet",exec:"excel"},{name:"odt",group:"docums",acp:"application/vnd.oasis.opendocument.text",exec:"word"},{name:"ppt",group:"docums",acp:"application/vnd.ms-powerpoint",exec:"powerpoint"},{name:"pptx",group:"docums",acp:"application/vnd.openxmlformats-officedocument.presentationml.presentation",exec:"powerpoint"},{name:"xls",group:"docums",acp:"application/vnd.ms-excel",exec:"excel"},{name:"xlsx",group:"docums",acp:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exec:"excel"},{name:"doc",group:"docums",acp:"application/msword",exec:"word"},{name:"docx",group:"docums",acp:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",exec:"word"},{name:"skp",group:"",acp:"application/vnd.sketchup.skp",exec:""},{name:"pcap",group:"",acp:"application/vnd.tcpdump.pcap",exec:""},{name:"wasm",group:"",acp:"application/wasm",exec:""},{name:"arrow",group:"",acp:"application/x-apache-arrow",exec:""},{name:"dmg",group:"",acp:"application/x-apple-diskimage",exec:""},{name:"arj",group:"",acp:"application/x-arj",exec:""},{name:"asar",group:"",acp:"application/x-asar",exec:""},{name:"blend",group:"",acp:"application/x-blender",exec:"blender"},{name:"cfb",group:"",acp:"application/x-cfb",exec:""},{name:"cpio",group:"",acp:"application/x-cpio",exec:""},{name:"deb",group:"",acp:"application/x-deb",exec:""},{name:"elf",group:"",acp:"application/x-elf",exec:""},{name:"shp",group:"",acp:"application/x-esri-shape",exec:""},{name:"crx",group:"",acp:"application/x-google-chrome-extension",exec:""},{name:"indd",group:"",acp:"application/x-indesign",exec:""},{name:"macho",group:"",acp:"application/x-mach-binary",exec:""},{name:"mie",group:"",acp:"application/x-mie",exec:""},{name:"mobi",group:"",acp:"application/x-mobipocket-ebook",exec:""},{name:"exe",group:"",acp:"application/x-msdownload",exec:""},{name:"nes",group:"",acp:"application/x-nintendo-nes-rom",exec:""},{name:"parquet",group:"",acp:"application/x-parquet",exec:""},{name:"rpm",group:"",acp:"application/x-rpm",exec:""},{name:"swf",group:"",acp:"application/x-shockwave-flash",exec:""},{name:"sqlite",group:"",acp:"application/x-sqlite3",exec:""},{name:"xpi",group:"",acp:"application/x-xpinstall",exec:""},{name:"xz",group:"",acp:"application/x-xz",exec:""},{name:"alias",group:"",acp:"application/x.apple.alias",exec:""},{name:"fbx",group:"",acp:"application/x.autodesk.fbx",exec:""},{name:"lnk",group:"",acp:"application/x.ms.shortcut",exec:""},{name:"zst",group:"",acp:"application/zstd",exec:""},{name:"aac",group:"audio",acp:"audio/aac",exec:"audioplayer"},{name:"aif",group:"audio",acp:"audio/aiff",exec:"audioplayer"},{name:"amr",group:"audio",acp:"audio/amr",exec:"audioplayer"},{name:"ape",group:"audio",acp:"audio/ape",exec:"audioplayer"},{name:"mid",group:"audio",acp:"audio/midi",exec:"audioplayer"},{name:"m4b",group:"audio",acp:"audio/mp4",exec:"audioplayer"},{name:"f4a",group:"audio",acp:"audio/mp4",exec:"audioplayer"},{name:"f4b",group:"audio",acp:"audio/mp4",exec:"audioplayer"},{name:"mp3",group:"audio",acp:"audio/mpeg",exec:"audioplayer"},{name:"mp2",group:"audio",acp:"audio/mpeg",exec:"audioplayer"},{name:"mp1",group:"audio",acp:"audio/mpeg",exec:"audioplayer"},{name:"oga",group:"audio",acp:"audio/ogg",exec:"audioplayer"},{name:"spx",group:"audio",acp:"audio/ogg",exec:"audioplayer"},{name:"ogg",group:"audio",acp:"audio/ogg",exec:"audioplayer"},{name:"opus",group:"audio",acp:"audio/opus",exec:"audioplayer"},{name:"qcp",group:"audio",acp:"audio/qcelp",exec:"audioplayer"},{name:"ac3",group:"audio",acp:"audio/vnd.dolby.dd-raw",exec:"audioplayer"},{name:"wav",group:"audio",acp:"audio/wav",exec:"audioplayer"},{name:"wv",group:"audio",acp:"audio/wavpack",exec:"audioplayer"},{name:"dsf",group:"audio",acp:"audio/x-dsf",exec:"audioplayer"},{name:"flac",group:"audio",acp:"audio/x-flac",exec:"audioplayer"},{name:"it",group:"audio",acp:"audio/x-it",exec:"audioplayer"},{name:"m4a",group:"audio",acp:"audio/x-m4a",exec:"audioplayer"},{name:"mpc",group:"audio",acp:"audio/x-musepack",exec:"audioplayer"},{name:"s3m",group:"audio",acp:"audio/x-s3m",exec:"audioplayer"},{name:"voc",group:"audio",acp:"audio/x-voc",exec:"audioplayer"},{name:"xm",group:"audio",acp:"audio/x-xm",exec:"audioplayer"},{name:"otf",group:"",acp:"font/otf",exec:""},{name:"ttf",group:"",acp:"font/ttf",exec:""},{name:"woff",group:"",acp:"font/woff",exec:""},{name:"woff2",group:"",acp:"font/woff2",exec:""},{name:"apng",group:"image",acp:"image/apng",exec:"imageviwer"},{name:"avif",group:"image",acp:"image/avif",exec:"imageviwer"},{name:"bmp",group:"image",acp:"image/bmp",exec:"imageviwer"},{name:"bpg",group:"image",acp:"image/bpg",exec:"imageviwer"},{name:"flif",group:"image",acp:"image/flif",exec:"imageviwer"},{name:"gif",group:"image",acp:"image/gif",exec:"imageviwer"},{name:"heic",group:"image",acp:"image/heif",exec:"imageviwer"},{name:"icns",group:"image",acp:"image/icns",exec:"imageviwer"},{name:"j2c",group:"image",acp:"image/j2c",exec:"imageviwer"},{name:"jls",group:"image",acp:"image/jls",exec:"imageviwer"},{name:"jp2",group:"image",acp:"image/jp2",exec:"imageviwer"},{name:"jpg",group:"image",acp:"image/jpeg",exec:"imageviwer"},{name:"jpm",group:"image",acp:"image/jpm",exec:"imageviwer"},{name:"jpx",group:"image",acp:"image/jpx",exec:"imageviwer"},{name:"jxl",group:"image",acp:"image/jxl",exec:"imageviwer"},{name:"ktx",group:"image",acp:"image/ktx",exec:"imageviwer"},{name:"mj2",group:"image",acp:"image/mj2",exec:"imageviwer"},{name:"png",group:"image",acp:"image/png",exec:"imageviwer"},{name:"tif",group:"image",acp:"image/tiff",exec:"imageviwer"},{name:"psd",group:"image",acp:"image/vnd.adobe.photoshop",exec:"imageviwer"},{name:"dwg",group:"image",acp:"image/vnd.dwg",exec:"imageviwer"},{name:"jxr",group:"image",acp:"image/vnd.ms-photo",exec:"imageviwer"},{name:"webp",group:"image",acp:"image/webp",exec:"imageviwer"},{name:"dng",group:"image",acp:"image/x-adobe-dng",exec:"imageviwer"},{name:"cr2",group:"image",acp:"image/x-canon-cr2",exec:"imageviwer"},{name:"cr3",group:"image",acp:"image/x-canon-cr3",exec:"imageviwer"},{name:"raf",group:"image",acp:"image/x-fujifilm-raf",exec:"imageviwer"},{name:"ico",group:"image",acp:"image/x-icon",exec:"imageviwer"},{name:"cur",group:"image",acp:"image/x-icon",exec:"imageviwer"},{name:"nef",group:"image",acp:"image/x-nikon-nef",exec:"imageviwer"},{name:"orf",group:"image",acp:"image/x-olympus-orf",exec:"imageviwer"},{name:"rw2",group:"image",acp:"image/x-panasonic-rw2",exec:"imageviwer"},{name:"arw",group:"image",acp:"image/x-sony-arw",exec:"imageviwer"},{name:"xcf",group:"image",acp:"image/x-xcf",exec:"imageviwer"},{name:"3mf",group:"",acp:"model/3mf",exec:""},{name:"glb",group:"",acp:"model/gltf-binary",exec:""},{name:"stl",group:"",acp:"model/stl",exec:""},{name:"vtp",group:"",acp:"model/vtp",exec:""},{name:"vtk",group:"",acp:"model/vtk",exec:""},{name:"vtu",group:"",acp:"model/vtu",exec:""},{name:"vti",group:"",acp:"model/vti",exec:""},{name:"vts",group:"",acp:"model/vts",exec:""},{name:"vtr",group:"",acp:"model/vtr",exec:""},{name:"ics",group:"",acp:"text/calendar",exec:""},{name:"vcf",group:"",acp:"text/vcard",exec:""},{name:"3gp",group:"video",acp:"video/3gpp",exec:"videoplayer"},{name:"3g2",group:"video",acp:"video/3gpp2",exec:"videoplayer"},{name:"m2p",group:"video",acp:"video/MP2P",exec:"videoplayer"},{name:"vob",group:"video",acp:"video/MP2P",exec:"videoplayer"},{name:"sub",group:"video",acp:"video/MP2P",exec:"videoplayer",msg:"與字幕檔衝突"},{name:"mts",group:"video",acp:"video/mp2t",exec:"videoplayer"},{name:"m4p",group:"video",acp:"video/mp4",exec:"videoplayer"},{name:"f4v",group:"video",acp:"video/mp4",exec:"videoplayer"},{name:"f4p",group:"video",acp:"video/mp4",exec:"videoplayer"},{name:"mp4",group:"video",acp:"video/mp4",exec:"videoplayer"},{name:"mpg",group:"video",acp:"video/mpeg",exec:"videoplayer",msg:"mpg可能為mpeg或video/MP1S或video/MP2S"},{name:"ogv",group:"video",acp:"video/ogg",exec:"videoplayer"},{name:"ogm",group:"video",acp:"video/ogg",exec:"videoplayer"},{name:"mov",group:"video",acp:"video/quicktime",exec:"videoplayer"},{name:"avi",group:"video",acp:"video/vnd.avi",exec:"videoplayer"},{name:"webm",group:"video",acp:"video/webm",exec:"videoplayer"},{name:"flv",group:"video",acp:"video/x-flv",exec:"videoplayer"},{name:"m4v",group:"video",acp:"video/x-m4v",exec:"videoplayer"},{name:"mkv",group:"video",acp:"video/x-matroska",exec:"videoplayer"}];function fy(e=""){let t=null;return ke(e)?(t=cy(uy,{name:e}),Be(t)||(t=null)):t=uy,t}function dy(e=""){if(""!==e&&"name"!==e&&"group"!==e&&"acp"!==e&&"exec"!==e)return[];let t=fy();if(""===e)return t;let n={};return vn(t,function(t){let r=t[e];Me(n,r)||(n[r]=[]),n[r].push(t)}),n}function hy(e="*"){if("*"===e)return e;if(!Se(e)&&!Mn(e))return"*";"common"===e&&(e=["docums","compress","image","data"]);let t=dy();function n(e){return Pn(bn(e,"acp"))}Se(e)&&(e=[e]);let r="";if(Mn(e)){let i=bn(e,function(e){return function(e){return n(aa(t,{group:e}))}(e)}),o=En(i,bn(e,function(e){return n(aa(t,{name:e}))}));o=aa(o,ay),r=vo(o,",")}return r}function py(e,t=1e3){(t=Ir(t))<=0&&(t=1e3);let n={},r=[];return vn(be(e,"files",[]),function(e,i){let o=e.size/1024/1024;o>t&&(n[i]=`file size[${o}]mb > ${t}mb`),r.push(e)}),{files:r,errs:n}}function gy(e){let t=function(e,n){return null===e.parentNode?n:t(e.parentNode,n.concat([e]))};return e instanceof HTMLElement||e instanceof SVGElement?t(e.parentNode,[]):[]}function my(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],a=t(o);if(null!=a&&(void 0===s?a==a&&!N(a):n(a,s)))var s=a,l=o}return l}function yy(e,t){return e<t}function vy(e){return e&&e.length?my(e,un,yy):void 0}function Ay(e,t={}){let n=be(t,"tag","detector"),r=Hi();r.error=be(t,"error",null);let i="idle",o=[],a=()=>{let e=o;o=[];for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(e){}},s=e=>{if(Oi(e))if("disposed"!==i)o.push(e);else try{e()}catch(e){}},l=(e,t)=>{"running"===i&&qi(r,e,[t],{tag:n})};return r.create=()=>{"idle"===i&&(i="pending",Oi(e)&&Promise.resolve().then(()=>{if("pending"===i){i="running";try{e(l,s)}catch(e){r.error=e,i="disposed",a()}}}))},r.dispose=()=>(i="disposed",a(),!0),r}let by={getMode:function(e){return"event"===be(e,"mode","")?"event":"promise"},detectorEvent:Ay,detectorFail:function(e,t){return"event"===e?Ay(null,{error:t}):Promise.reject(t)}};function wy(){return!function(){try{return"IntersectionObserver"in window}catch(e){return!1}}()||!function(){try{return"IntersectionObserverEntry"in window}catch(e){return!1}}()||!(function(){try{return"intersectionRatio"in window.IntersectionObserverEntry.prototype}catch(e){return!1}}()||Oi(window.IntersectionObserverEntry))}function Iy(e){let t=null,n=-1/0;for(let r of e||[]){let e=Number(r&&r.time);Number.isFinite(e)||(e=n),e>=n&&(n=e,t=r)}return t?!!t.isIntersecting:null}function xy(e,t,n={}){if(!Su(e))return Promise.reject("invalid ele");let r=tc().markmap,{Transformer:i,Markmap:o,loadCSS:a,loadJS:s}=r,l=e=>{let t=new i,{root:n,features:r}=t.transform(e),{styles:o,scripts:a}=t.getUsedAssets(r);return{root:n,features:r,styles:o,scripts:a}},{root:c,styles:u,scripts:f}=l(t);u&&a(u),f&&s(f,{getMarkmap:()=>r}),e.innerHTML="";let d=o.create(e,null,c);return d.transMarkdown=l,d}const Cy=e=>void 0===e||"auto"===e||"instant"===e||"smooth"===e;function Ey(e,t){this.scrollLeft=e,this.scrollTop=t}const By=(e,t,n="cannot convert to dictionary.")=>`Failed to execute '${e}' on '${t}': ${n}`,Sy=(e,t,n)=>By(e,t,`The provided value '${n}' is not a valid enum value of type ScrollBehavior.`),ky=(e,t,n)=>{var r;const i=`__SEAMLESS.BACKUP$${t}`;return e[i]||!e[t]||(null===(r=e[t])||void 0===r?void 0:r.__isPolyfill)||(e[i]=e[t]),e[i]||n},Fy=e=>{const t=typeof e;return null!==e&&("object"===t||"function"===t)},Dy=e=>"scrollBehavior"in window.document.documentElement.style&&!0!==(null==e?void 0:e.forcePolyfill),Ny=e=>{Object.defineProperty(e,"__isPolyfill",{value:!0})},My=(e,t)=>{Ny(t),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach(n=>{ky(n,e),n[e]=t})},Ty=e=>e.ownerDocument.scrollingElement||e.ownerDocument.documentElement;const Qy=e=>.5*(1-Math.cos(Math.PI*e));function Ly(){var e;let t;return t=(null===(e=window.performance)||void 0===e?void 0:e.now)?()=>window.performance.now():()=>window.Date.now(),Ly=t,t()}const Ry=e=>{const t=(Ly()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();const n=(e.timingFunc||Qy)(t),r=e.startX+(e.targetX-e.startX)*n,i=e.startY+(e.targetY-e.startY)*n;e.method(r,i),e.rafId=window.requestAnimationFrame(()=>{Ry(e)})},Uy=e=>isFinite(e)?Number(e):0,Hy=(e,t,n)=>{var r,i;if(!(e=>{var t;return null!==(t=e.isConnected)&&void 0!==t?t:!(e.ownerDocument&&1&e.ownerDocument.compareDocumentPosition(e))})(e))return;const o=e.scrollLeft,a=e.scrollTop,s=Uy(null!==(r=t.left)&&void 0!==r?r:o),l=Uy(null!==(i=t.top)&&void 0!==i?i:a);if(s===o&&l===a)return;const c=ky(HTMLElement.prototype,"scroll",Ey),u=ky(Object.getPrototypeOf(e),"scroll",c).bind(e);if("smooth"!==t.behavior)return void u(s,l);const f=()=>{window.removeEventListener("wheel",h),window.removeEventListener("touchmove",h)},d=Object.assign(Object.assign({},n),{timeStamp:Ly(),startX:o,startY:a,targetX:s,targetY:l,rafId:0,method:u,callback:()=>{f();const t=9===e.nodeType;e.dispatchEvent(function(e){if("function"==typeof Event)return new Event("scrollend",{bubbles:e,cancelable:!1});const t=document.createEvent("Event");return t.initEvent("scrollend",e,!1),t}(t))}}),h=()=>{window.cancelAnimationFrame(d.rafId),f()};window.addEventListener("wheel",h,{passive:!0,once:!0}),window.addEventListener("touchmove",h,{passive:!0,once:!0}),Ry(d)},Oy=e=>(t,n,r)=>{const[i,o]=(a=t).window===a?[Ty(t.document.documentElement),"Window"]:[t,"Element"];var a;const s=null!=n?n:{};if(!Fy(s))throw new TypeError(By(e,o));if(!Cy(s.behavior))throw new TypeError(Sy(e,o,s.behavior));"scrollBy"===e&&(s.left=Uy(s.left)+i.scrollLeft,s.top=Uy(s.top)+i.scrollTop),Hy(i,s,r)},qy=Oy("scroll"),Py=Oy("scrollTo"),$y=Oy("scrollBy"),zy=qy,jy=e=>{switch(e){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},Vy=(e,t,n,r)=>{let i=0;switch(t||(i^=2),e){case 0:i=i>>1|(1&i)<<1,[n,r]=[r,n];break;case 1:case 3:i^=1;break;case 4:i^=2}return[i,n,r]},Yy=e=>!(1&~Vy(jy(e.writingMode),"rtl"!==e.direction,void 0,void 0)[0]),Wy=(e,t,n,r,i,o,a)=>0!==e?e:i<t&&o>n||i>t&&o<n?null:i<=t&&a<=r||o>=n&&a>=r?2:o>n&&a<r||i<t&&a>r?3:null,Gy=e=>"visible"!==e&&"clip"!==e,Jy=(e,t)=>(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth)&&(Gy(t.overflowY)||Gy(t.overflowX)||e===Ty(e)),_y=e=>{const t=e.parentNode,n=e.parentElement;if(null===n&&null!==t){if(11===t.nodeType)return t.host;if(9===t.nodeType)return(e=>{var t;try{return(null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.frameElement)||null}catch(e){return null}})(e)}return n},Xy=(e,t,n)=>e<t?t:e>n?n:e,Ky=(e,t,n)=>{switch(e){case 1:return(t+n)/2;case 3:return n;case 2:case 0:return t}},Zy=(e,t)=>{var n,r,i;const o=null===(n=e.ownerDocument.defaultView)||void 0===n?void 0:n.visualViewport,[a,s,l,c]=e===Ty(e)?[0,0,null!==(r=null==o?void 0:o.width)&&void 0!==r?r:e.clientWidth,null!==(i=null==o?void 0:o.height)&&void 0!==i?i:e.clientHeight]:[t.left,t.top,e.clientWidth,e.clientHeight],u=a+e.clientLeft,f=s+e.clientTop;return[f,u+l,f+c,u]},ev=(e,t)=>{const n=[];let r=e.ownerDocument,i=r.defaultView;if(!i)return n;const o=window.getComputedStyle(e),a="rtl"!==o.direction,s=jy(o.writingMode||o.getPropertyValue("-webkit-writing-mode")||o.getPropertyValue("-ms-writing-mode")),[l,c]=((e,t,n)=>{const[r,i,o]=Vy(t,n,e.block||"start",e.inline||"nearest");return[i,o].map((e,t)=>{switch(e){case"center":return 1;case"nearest":return 0;default:return"start"===e==!(r>>t&1)?2:3}})})(t,s,a);let[u,f,d,h]=((e,t,n)=>{const{top:r,right:i,bottom:o,left:a}=t,s=(l=e.ownerDocument,["scroll-margin","scroll-snap-margin"].filter(e=>e in l.documentElement.style)[0]);var l;if(!s)return[r,i,o,a];const c=e=>{const t=n.getPropertyValue(`${s}-${e}`);return parseInt(t,10)||0};return[r-c("top"),i+c("right"),o+c("bottom"),a-c("left")]})(e,e.getBoundingClientRect(),o);for(let o=_y(e);null!==o;o=_y(o)){if(r!==o.ownerDocument){if(r=o.ownerDocument,i=r.defaultView,!i)break;const{left:e,top:t}=o.getBoundingClientRect();u+=t,f+=e,d+=t,h+=e}const e=i.getComputedStyle(o);if("fixed"===e.position)break;if(!Jy(o,e))continue;const a=o.getBoundingClientRect(),[s,p,g,m]=Zy(o,a),y=Wy(l,m,p,o.clientWidth,h,f,f-h),v=Wy(c,s,g,o.clientHeight,u,d,d-u),A=null===y?0:Ky(y,h,f)-Ky(y,m,p),b=null===v?0:Ky(v,u,d)-Ky(v,s,g),w=Yy(e)?Xy(A,-o.scrollWidth+o.clientWidth-o.scrollLeft,-o.scrollLeft):Xy(A,-o.scrollLeft,o.scrollWidth-o.clientWidth-o.scrollLeft),I=Xy(b,-o.scrollTop,o.scrollHeight-o.clientHeight-o.scrollTop);n.push([o,{left:o.scrollLeft+w,top:o.scrollTop+I,behavior:t.behavior}]),u=Math.max(u-I,s),f=Math.min(f-w,p),d=Math.min(d-I,g),h=Math.max(h-w,m)}return n},tv=(e,t,n)=>{const r=t||{};if(!Cy(r.behavior))throw new TypeError(Sy("scrollIntoView","Element",r.behavior));ev(e,r).forEach(([e,t])=>{zy(e,t,n)})},nv=(e,t)=>n=>{if(Dy(n))return;const r={scroll:qy,scrollTo:Py,scrollBy:$y}[e];t(e,function(){const e=arguments;if(1===arguments.length)return void r(this,e[0],n);r(this,{left:e[0],top:e[1]})})},rv=nv("scroll",My),iv=nv("scrollTo",My),ov=nv("scrollBy",My),av=(e,t)=>{Ny(t),ky(window,e),window[e]=t},sv=nv("scroll",av),lv=nv("scrollTo",av),cv=nv("scrollBy",av);function uv(e){tv(this,{block:null==e||e?"start":"end",inline:"nearest"})}const fv=e=>{if(Dy(e))return;const t=ky(window.HTMLElement.prototype,"scrollIntoView",uv);My("scrollIntoView",function(){const n=arguments,r=n[0];1===n.length&&Fy(r)?tv(this,r,e):t.apply(this,n)})},dv=e=>{Dy(e)||(rv(e),iv(e),ov(e),fv(e),sv(e),lv(e),cv(e))};var hv={exports:{}};
|
|
15
|
+
var ys,vs,As=9e15,bs=1e9,ws="0123456789abcdef",Is="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",xs="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Cs={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-As,maxE:As,crypto:!1},Es=!0,Bs="[DecimalError] ",Ss=Bs+"Invalid argument: ",ks=Bs+"Precision limit exceeded",Fs=Bs+"crypto unavailable",Ds="[object Decimal]",Ns=Math.floor,Ms=Math.pow,Ts=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Qs=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ls=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Rs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Us=1e7,Hs=Is.length-1,Os=xs.length-1,qs={toStringTag:Ds};function Ps(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(o+=Ks(n)),o+=r;(n=7-(r=(a=e[t])+"").length)&&(o+=Ks(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function $s(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ss+e)}function zs(e,t,n,r){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=Ms(10,7-t),s=e[i]%o|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(e[i+1]/o/100|0)==Ms(10,t-2)-1||(s==o/2||0==s)&&!(e[i+1]/o/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==Ms(10,t-3)-1,a}function js(e,t,n){for(var r,i,o=[0],a=0,s=e.length;a<s;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=ws.indexOf(e.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}qs.absoluteValue=qs.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Ys(e)},qs.ceil=function(){return Ys(new this.constructor(this),this.e+1,2)},qs.clampedTo=qs.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(Ss+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},qs.comparedTo=qs.cmp=function(e){var t,n,r,i,o=this,a=o.d,s=(e=new o.constructor(e)).d,l=o.s,c=e.s;if(!a||!s)return l&&c?l!==c?l:a===s?0:!a^l<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?l:s[0]?-c:0;if(l!==c)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(t=0,n=(r=a.length)<(i=s.length)?r:i;t<n;++t)if(a[t]!==s[t])return a[t]>s[t]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1},qs.cosine=qs.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?i=(1/ll(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10");e.precision+=n,t=sl(e,1,t.times(i),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(r,cl(r,n)),r.precision=e,r.rounding=t,Ys(2==vs||3==vs?n.neg():n,e,t,!0)):new r(1):new r(NaN)},qs.cubeRoot=qs.cbrt=function(){var e,t,n,r,i,o,a,s,l,c,u=this,f=u.constructor;if(!u.isFinite()||u.isZero())return new f(u);for(Es=!1,(o=u.s*Ms(u.s*u,1/3))&&Math.abs(o)!=1/0?r=new f(o.toString()):(n=Ps(u.d),(o=((e=u.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=Ms(n,1/3),e=Ns((e+1)/3)-(e%3==(e<0?-1:2)),(r=new f(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=u.s),a=(e=f.precision)+3;;)if(c=(l=(s=r).times(s).times(s)).plus(u),r=Vs(c.plus(u).times(s),c.plus(l),a+2,1),Ps(s.d).slice(0,a)===(n=Ps(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Ys(r,e+1,1),t=!r.times(r).times(r).eq(u));break}if(!i&&(Ys(s,e+1,0),s.times(s).times(s).eq(u))){r=s;break}a+=4,i=1}return Es=!0,Ys(r,e,f.rounding,t)},qs.decimalPlaces=qs.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-Ns(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},qs.dividedBy=qs.div=function(e){return Vs(this,new this.constructor(e))},qs.dividedToIntegerBy=qs.divToInt=function(e){var t=this.constructor;return Ys(Vs(this,new t(e),0,1,1),t.precision,t.rounding)},qs.equals=qs.eq=function(e){return 0===this.cmp(e)},qs.floor=function(){return Ys(new this.constructor(this),this.e+1,3)},qs.greaterThan=qs.gt=function(e){return this.cmp(e)>0},qs.greaterThanOrEqualTo=qs.gte=function(e){var t=this.cmp(e);return 1==t||0===t},qs.hyperbolicCosine=qs.cosh=function(){var e,t,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/ll(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=sl(a,1,o.times(t),new a(1),!0);for(var l,c=e,u=new a(8);c--;)l=o.times(o),o=s.minus(l.times(u.minus(l.times(u))));return Ys(o,a.precision=n,a.rounding=r,!0)},qs.hyperbolicSine=qs.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=sl(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=sl(o,2,i=i.times(1/ll(5,e)),i,!0);for(var a,s=new o(5),l=new o(16),c=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(l.times(a).plus(c))))}return o.precision=t,o.rounding=n,Ys(i,t,n,!0)},qs.hyperbolicTangent=qs.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,Vs(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},qs.inverseCosine=qs.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return-1!==n?0===n?e.isNeg()?_s(t,r,i):new t(0):new t(NaN):e.isZero()?_s(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},qs.inverseHyperbolicCosine=qs.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Es=!1,n=n.times(n).minus(1).sqrt().plus(n),Es=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},qs.inverseHyperbolicSine=qs.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Es=!1,n=n.times(n).plus(1).sqrt().plus(n),Es=!0,r.precision=e,r.rounding=t,n.ln())},qs.inverseHyperbolicTangent=qs.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?Ys(new o(i),e,t,!0):(o.precision=n=r-i.e,i=Vs(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},qs.inverseSine=qs.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t?0===t?((e=_s(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},qs.inverseTangent=qs.atan=function(){var e,t,n,r,i,o,a,s,l,c=this,u=c.constructor,f=u.precision,d=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&f+4<=Os)return(a=_s(u,f+4,d).times(.25)).s=c.s,a}else{if(!c.s)return new u(NaN);if(f+4<=Os)return(a=_s(u,f+4,d).times(.5)).s=c.s,a}for(u.precision=s=f+10,u.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(Es=!1,t=Math.ceil(s/7),r=1,l=c.times(c),a=new u(c),i=c;-1!==e;)if(i=i.times(l),o=a.minus(i.div(r+=2)),i=i.times(l),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),Es=!0,Ys(a,u.precision=f,u.rounding=d,!0)},qs.isFinite=function(){return!!this.d},qs.isInteger=qs.isInt=function(){return!!this.d&&Ns(this.e/7)>this.d.length-2},qs.isNaN=function(){return!this.s},qs.isNegative=qs.isNeg=function(){return this.s<0},qs.isPositive=qs.isPos=function(){return this.s>0},qs.isZero=function(){return!!this.d&&0===this.d[0]},qs.lessThan=qs.lt=function(e){return this.cmp(e)<0},qs.lessThanOrEqualTo=qs.lte=function(e){return this.cmp(e)<1},qs.logarithm=qs.log=function(e){var t,n,r,i,o,a,s,l,c=this,u=c.constructor,f=u.precision,d=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new u(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(Es=!1,a=rl(c,s=f+5),r=t?Js(u,s+10):rl(e,s),zs((l=Vs(a,r,s,1)).d,i=f,d))do{if(a=rl(c,s+=10),r=t?Js(u,s+10):rl(e,s),l=Vs(a,r,s,1),!o){+Ps(l.d).slice(i+1,i+15)+1==1e14&&(l=Ys(l,f+1,0));break}}while(zs(l.d,i+=10,d));return Es=!0,Ys(l,f,d)},qs.minus=qs.sub=function(e){var t,n,r,i,o,a,s,l,c,u,f,d,h=this,p=h.constructor;if(e=new p(e),!h.d||!e.d)return h.s&&e.s?h.d?e.s=-e.s:e=new p(e.d||h.s!==e.s?h:NaN):e=new p(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(c=h.d,d=e.d,s=p.precision,l=p.rounding,!c[0]||!d[0]){if(d[0])e.s=-e.s;else{if(!c[0])return new p(3===l?-0:0);e=new p(h)}return Es?Ys(e,s,l):e}if(n=Ns(e.e/7),u=Ns(h.e/7),c=c.slice(),o=u-n){for((f=o<0)?(t=c,o=-o,a=d.length):(t=d,n=u,a=c.length),o>(r=Math.max(Math.ceil(s/7),a)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((f=(r=c.length)<(a=d.length))&&(a=r),r=0;r<a;r++)if(c[r]!=d[r]){f=c[r]<d[r];break}o=0}for(f&&(t=c,c=d,d=t,e.s=-e.s),a=c.length,r=d.length-a;r>0;--r)c[a++]=0;for(r=d.length;r>o;){if(c[--r]<d[r]){for(i=r;i&&0===c[--i];)c[i]=Us-1;--c[i],c[r]+=Us}c[r]-=d[r]}for(;0===c[--a];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(e.d=c,e.e=Gs(c,n),Es?Ys(e,s,l):e):new p(3===l?-0:0)},qs.modulo=qs.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?Ys(new r(n),r.precision,r.rounding):(Es=!1,9==r.modulo?(t=Vs(n,e.abs(),0,3,1)).s*=e.s:t=Vs(n,e,0,r.modulo,1),t=t.times(e),Es=!0,n.minus(t))},qs.naturalExponential=qs.exp=function(){return nl(this)},qs.naturalLogarithm=qs.ln=function(){return rl(this)},qs.negated=qs.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Ys(e)},qs.plus=qs.add=function(e){var t,n,r,i,o,a,s,l,c,u,f=this,d=f.constructor;if(e=new d(e),!f.d||!e.d)return f.s&&e.s?f.d||(e=new d(e.d||f.s===e.s?f:NaN)):e=new d(NaN),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,u=e.d,s=d.precision,l=d.rounding,!c[0]||!u[0])return u[0]||(e=new d(f)),Es?Ys(e,s,l):e;if(o=Ns(f.e/7),r=Ns(e.e/7),c=c.slice(),i=o-r){for(i<0?(n=c,i=-i,a=u.length):(n=u,r=o,a=c.length),i>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=c.length)-(i=u.length)<0&&(i=a,n=u,u=c,c=n),t=0;i;)t=(c[--i]=c[i]+u[i]+t)/Us|0,c[i]%=Us;for(t&&(c.unshift(t),++r),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=Gs(c,r),Es?Ys(e,s,l):e},qs.precision=qs.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(Ss+e);return n.d?(t=Xs(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},qs.round=function(){var e=this,t=e.constructor;return Ys(new t(e),e.e+1,t.rounding)},qs.sine=qs.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:sl(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=t.times(1/ll(5,n)),t=sl(e,2,t,t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,cl(r,n)),r.precision=e,r.rounding=t,Ys(vs>2?n.neg():n,e,t,!0)):new r(NaN)},qs.squareRoot=qs.sqrt=function(){var e,t,n,r,i,o,a=this,s=a.d,l=a.e,c=a.s,u=a.constructor;if(1!==c||!s||!s[0])return new u(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(Es=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=Ps(s)).length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=Ns((l+1)/2)-(l<0||l%2),r=new u(t=c==1/0?"5e"+l:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+l)):r=new u(c.toString()),n=(l=u.precision)+3;;)if(r=(o=r).plus(Vs(a,o,n+2,1)).times(.5),Ps(o.d).slice(0,n)===(t=Ps(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Ys(r,l+1,1),e=!r.times(r).eq(a));break}if(!i&&(Ys(o,l+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return Es=!0,Ys(r,l,u.rounding,e)},qs.tangent=qs.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=Vs(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,Ys(2==vs||4==vs?n.neg():n,e,t,!0)):new r(NaN)},qs.times=qs.mul=function(e){var t,n,r,i,o,a,s,l,c,u=this,f=u.constructor,d=u.d,h=(e=new f(e)).d;if(e.s*=u.s,!(d&&d[0]&&h&&h[0]))return new f(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:d&&h?0*e.s:e.s/0);for(n=Ns(u.e/7)+Ns(e.e/7),(l=d.length)<(c=h.length)&&(o=d,d=h,h=o,a=l,l=c,c=a),o=[],r=a=l+c;r--;)o.push(0);for(r=c;--r>=0;){for(t=0,i=l+r;i>r;)s=o[i]+h[r]*d[i-r-1]+t,o[i--]=s%Us|0,t=s/Us|0;o[i]=(o[i]+t)%Us|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=Gs(o,n),Es?Ys(e,f.precision,f.rounding):e},qs.toBinary=function(e,t){return ul(this,2,e,t)},qs.toDecimalPlaces=qs.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:($s(e,0,bs),void 0===t?t=r.rounding:$s(t,0,8),Ys(n,e+n.e+1,t))},qs.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=Ws(r,!0):($s(e,0,bs),void 0===t?t=i.rounding:$s(t,0,8),n=Ws(r=Ys(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},qs.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?n=Ws(i):($s(e,0,bs),void 0===t?t=o.rounding:$s(t,0,8),n=Ws(r=Ys(new o(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},qs.toFraction=function(e){var t,n,r,i,o,a,s,l,c,u,f,d,h=this,p=h.d,g=h.constructor;if(!p)return new g(h);if(c=n=new g(1),r=l=new g(0),a=(o=(t=new g(r)).e=Xs(p)-h.e-1)%7,t.d[0]=Ms(10,a<0?7+a:a),null==e)e=o>0?t:c;else{if(!(s=new g(e)).isInt()||s.lt(c))throw Error(Ss+s);e=s.gt(t)?o>0?t:c:s}for(Es=!1,s=new g(Ps(p)),u=g.precision,g.precision=o=7*p.length*2;f=Vs(s,t,0,1,1),1!=(i=n.plus(f.times(r))).cmp(e);)n=r,r=i,i=c,c=l.plus(f.times(i)),l=i,i=t,t=s.minus(f.times(i)),s=i;return i=Vs(e.minus(n),r,0,1,1),l=l.plus(i.times(c)),n=n.plus(i.times(r)),l.s=c.s=h.s,d=Vs(c,r,o,1).minus(h).abs().cmp(Vs(l,n,o,1).minus(h).abs())<1?[c,r]:[l,n],g.precision=u,Es=!0,d},qs.toHexadecimal=qs.toHex=function(e,t){return ul(this,16,e,t)},qs.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:$s(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Es=!1,n=Vs(n,e,0,t,1).times(e),Es=!0,Ys(n)):(e.s=n.s,n=e),n},qs.toNumber=function(){return+this},qs.toOctal=function(e,t){return ul(this,8,e,t)},qs.toPower=qs.pow=function(e){var t,n,r,i,o,a,s=this,l=s.constructor,c=+(e=new l(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new l(Ms(+s,c));if((s=new l(s)).eq(1))return s;if(r=l.precision,o=l.rounding,e.eq(1))return Ys(s,r,o);if((t=Ns(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=Zs(l,s,n,r),e.s<0?new l(1).div(i):Ys(i,r,o);if((a=s.s)<0){if(t<e.d.length-1)return new l(NaN);if(1&e.d[t]||(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(t=0!=(n=Ms(+s,c))&&isFinite(n)?new l(n+"").e:Ns(c*(Math.log("0."+Ps(s.d))/Math.LN10+s.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?a/0:0):(Es=!1,l.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=nl(e.times(rl(s,r+n)),r)).d&&zs((i=Ys(i,r+5,1)).d,r,o)&&(t=r+10,+Ps((i=Ys(nl(e.times(rl(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Ys(i,r+1,0))),i.s=a,Es=!0,l.rounding=o,Ys(i,r,o))},qs.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=Ws(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):($s(e,1,bs),void 0===t?t=i.rounding:$s(t,0,8),n=Ws(r=Ys(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},qs.toSignificantDigits=qs.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):($s(e,1,bs),void 0===t?t=n.rounding:$s(t,0,8)),Ys(new n(this),e,t)},qs.toString=function(){var e=this,t=e.constructor,n=Ws(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},qs.truncated=qs.trunc=function(){return Ys(new this.constructor(this),this.e+1,1)},qs.valueOf=qs.toJSON=function(){var e=this,t=e.constructor,n=Ws(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var Vs=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,a,s,l){var c,u,f,d,h,p,g,m,y,v,A,b,w,I,x,C,E,B,S,k,F=r.constructor,D=r.s==i.s?1:-1,N=r.d,M=i.d;if(!(N&&N[0]&&M&&M[0]))return new F(r.s&&i.s&&(N?!M||N[0]!=M[0]:M)?N&&0==N[0]||!M?0*D:D/0:NaN);for(l?(h=1,u=r.e-i.e):(l=Us,h=7,u=Ns(r.e/h)-Ns(i.e/h)),S=M.length,E=N.length,v=(y=new F(D)).d=[],f=0;M[f]==(N[f]||0);f++);if(M[f]>(N[f]||0)&&u--,null==o?(I=o=F.precision,a=F.rounding):I=s?o+(r.e-i.e)+1:o,I<0)v.push(1),p=!0;else{if(I=I/h+2|0,f=0,1==S){for(d=0,M=M[0],I++;(f<E||d)&&I--;f++)x=d*l+(N[f]||0),v[f]=x/M|0,d=x%M|0;p=d||f<E}else{for((d=l/(M[0]+1)|0)>1&&(M=e(M,d,l),N=e(N,d,l),S=M.length,E=N.length),C=S,b=(A=N.slice(0,S)).length;b<S;)A[b++]=0;(k=M.slice()).unshift(0),B=M[0],M[1]>=l/2&&++B;do{d=0,(c=t(M,A,S,b))<0?(w=A[0],S!=b&&(w=w*l+(A[1]||0)),(d=w/B|0)>1?(d>=l&&(d=l-1),1==(c=t(g=e(M,d,l),A,m=g.length,b=A.length))&&(d--,n(g,S<m?k:M,m,l))):(0==d&&(c=d=1),g=M.slice()),(m=g.length)<b&&g.unshift(0),n(A,g,b,l),-1==c&&(c=t(M,A,S,b=A.length))<1&&(d++,n(A,S<b?k:M,b,l)),b=A.length):0===c&&(d++,A=[0]),v[f++]=d,c&&A[0]?A[b++]=N[C]||0:(A=[N[C]],b=1)}while((C++<E||void 0!==A[0])&&I--);p=void 0!==A[0]}v[0]||v.shift()}if(1==h)y.e=u,ys=p;else{for(f=1,d=v[0];d>=10;d/=10)f++;y.e=f+u*h-1,Ys(y,s?o+y.e+1:o,a,p)}return y}}();function Ys(e,t,n,r){var i,o,a,s,l,c,u,f,d,h=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,s=f[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=7,a=t,l=(u=f[d=0])/Ms(10,i-a-1)%10|0;else if((d=Math.ceil((o+1)/7))>=(s=f.length)){if(!r)break e;for(;s++<=d;)f.push(0);u=l=0,i=1,a=(o%=7)-7+1}else{for(u=s=f[d],i=1;s>=10;s/=10)i++;l=(a=(o%=7)-7+i)<0?0:u/Ms(10,i-a-1)%10|0}if(r=r||t<0||void 0!==f[d+1]||(a<0?u:u%Ms(10,i-a-1)),c=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?u/Ms(10,i-a):0:f[d-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=Ms(10,(7-t%7)%7),e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=d,s=1,d--):(f.length=d+1,s=Ms(10,7-o),f[d]=a>0?(u/Ms(10,i-a)%Ms(10,a)|0)*s:0),c)for(;;){if(0==d){for(o=1,a=f[0];a>=10;a/=10)o++;for(a=f[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,f[0]==Us&&(f[0]=1));break}if(f[d]+=s,f[d]!=Us)break;f[d--]=0,s=1}for(o=f.length;0===f[--o];)f.pop()}return Es&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function Ws(e,t,n){if(!e.isFinite())return il(e);var r,i=e.e,o=Ps(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+Ks(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Ks(-i-1)+o,n&&(r=n-a)>0&&(o+=Ks(r))):i>=a?(o+=Ks(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Ks(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=Ks(r))),o}function Gs(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function Js(e,t,n){if(t>Hs)throw Es=!0,n&&(e.precision=n),Error(ks);return Ys(new e(Is),t,1,!0)}function _s(e,t,n){if(t>Os)throw Error(ks);return Ys(new e(xs),t,n,!0)}function Xs(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Ks(e){for(var t="";e--;)t+="0";return t}function Zs(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/7+4);for(Es=!1;;){if(n%2&&fl((o=o.times(t)).d,a)&&(i=!0),0===(n=Ns(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}fl((t=t.times(t)).d,a)}return Es=!0,o}function el(e){return 1&e.d[e.d.length-1]}function tl(e,t,n){for(var r,i,o=new e(t[0]),a=0;++a<t.length;){if(!(i=new e(t[a])).s){o=i;break}((r=o.cmp(i))===n||0===r&&o.s===n)&&(o=i)}return o}function nl(e,t){var n,r,i,o,a,s,l,c=0,u=0,f=0,d=e.constructor,h=d.rounding,p=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(Es=!1,l=p):l=t,s=new d(.03125);e.e>-2;)e=e.times(s),f+=5;for(l+=r=Math.log(Ms(2,f))/Math.LN10*2+5|0,n=o=a=new d(1),d.precision=l;;){if(o=Ys(o.times(e),l,1),n=n.times(++u),Ps((s=a.plus(Vs(o,n,l,1))).d).slice(0,l)===Ps(a.d).slice(0,l)){for(i=f;i--;)a=Ys(a.times(a),l,1);if(null!=t)return d.precision=p,a;if(!(c<3&&zs(a.d,l-r,h,c)))return Ys(a,d.precision=p,h,Es=!0);d.precision=l+=10,n=o=s=new d(1),u=0,c++}a=s}}function rl(e,t){var n,r,i,o,a,s,l,c,u,f,d,h=1,p=e,g=p.d,m=p.constructor,y=m.rounding,v=m.precision;if(p.s<0||!g||!g[0]||!p.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=p.s?NaN:g?0:p);if(null==t?(Es=!1,u=v):u=t,m.precision=u+=10,r=(n=Ps(g)).charAt(0),!(Math.abs(o=p.e)<15e14))return c=Js(m,u+2,v).times(o+""),p=rl(new m(r+"."+n.slice(1)),u-10).plus(c),m.precision=v,null==t?Ys(p,v,y,Es=!0):p;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=Ps((p=p.times(e)).d)).charAt(0),h++;for(o=p.e,r>1?(p=new m("0."+n),o++):p=new m(r+"."+n.slice(1)),f=p,l=a=p=Vs(p.minus(1),p.plus(1),u,1),d=Ys(p.times(p),u,1),i=3;;){if(a=Ys(a.times(d),u,1),Ps((c=l.plus(Vs(a,new m(i),u,1))).d).slice(0,u)===Ps(l.d).slice(0,u)){if(l=l.times(2),0!==o&&(l=l.plus(Js(m,u+2,v).times(o+""))),l=Vs(l,new m(h),u,1),null!=t)return m.precision=v,l;if(!zs(l.d,u-10,y,s))return Ys(l,m.precision=v,y,Es=!0);m.precision=u+=10,c=a=p=Vs(f.minus(1),f.plus(1),u,1),d=Ys(p.times(p),u,1),i=s=1}l=c,i+=2}}function il(e){return String(e.s*e.s/0)}function ol(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";e.d.push(+t),Es&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function al(e,t){var n,r,i,o,a,s,l,c,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Rs.test(t))return ol(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Qs.test(t))n=16,t=t.toLowerCase();else if(Ts.test(t))n=2;else{if(!Ls.test(t))throw Error(Ss+t);n=8}for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,r=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=Zs(r,new r(n),o,2*o)),o=u=(c=js(t,n,Us)).length-1;0===c[o];--o)c.pop();return o<0?new r(0*e.s):(e.e=Gs(c,u),e.d=c,Es=!1,a&&(e=Vs(e,i,4*s)),l&&(e=e.times(Math.abs(l)<54?Ms(2,l):Kl.pow(2,l))),Es=!0,e)}function sl(e,t,n,r,i){var o,a,s,l,c=e.precision,u=Math.ceil(c/7);for(Es=!1,l=n.times(n),s=new e(r);;){if(a=Vs(s.times(l),new e(t++*t++),c,1),s=i?r.plus(a):r.minus(a),r=Vs(a.times(l),new e(t++*t++),c,1),void 0!==(a=s.plus(r)).d[u]){for(o=u;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return Es=!0,a.d.length=u+1,a}function ll(e,t){for(var n=e;--t;)n*=e;return n}function cl(e,t){var n,r=t.s<0,i=_s(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return vs=r?4:1,t;if((n=t.divToInt(i)).isZero())vs=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return vs=el(n)?r?2:3:r?4:1,t;vs=el(n)?r?1:4:r?3:2}return t.minus(i).abs()}function ul(e,t,n,r){var i,o,a,s,l,c,u,f,d,h=e.constructor,p=void 0!==n;if(p?($s(n,1,bs),void 0===r?r=h.rounding:$s(r,0,8)):(n=h.precision,r=h.rounding),e.isFinite()){for(p?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(a=(u=Ws(e)).indexOf("."))>=0&&(u=u.replace(".",""),(d=new h(1)).e=u.length-a,d.d=js(Ws(d),10,i),d.e=d.d.length),o=l=(f=js(u,10,i)).length;0==f[--l];)f.pop();if(f[0]){if(a<0?o--:((e=new h(e)).d=f,e.e=o,f=(e=Vs(e,d,n,r,0,i)).d,o=e.e,c=ys),a=f[n],s=i/2,c=c||void 0!==f[n+1],c=r<4?(void 0!==a||c)&&(0===r||r===(e.s<0?3:2)):a>s||a===s&&(4===r||c||6===r&&1&f[n-1]||r===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(l=f.length;!f[l-1];--l);for(a=0,u="";a<l;a++)u+=ws.charAt(f[a]);if(p){if(l>1)if(16==t||8==t){for(a=16==t?4:3,--l;l%a;l++)u+="0";for(l=(f=js(u,i,t)).length;!f[l-1];--l);for(a=1,u="1.";a<l;a++)u+=ws.charAt(f[a])}else u=u.charAt(0)+"."+u.slice(1);u=u+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)u="0"+u;u="0."+u}else if(++o>l)for(o-=l;o--;)u+="0";else o<l&&(u=u.slice(0,o)+"."+u.slice(o))}else u=p?"0p+0":"0";u=(16==t?"0x":2==t?"0b":8==t?"0o":"")+u}else u=il(e);return e.s<0?"-"+u:u}function fl(e,t){if(e.length>t)return e.length=t,!0}function dl(e){return new this(e).abs()}function hl(e){return new this(e).acos()}function pl(e){return new this(e).acosh()}function gl(e,t){return new this(e).plus(t)}function ml(e){return new this(e).asin()}function yl(e){return new this(e).asinh()}function vl(e){return new this(e).atan()}function Al(e){return new this(e).atanh()}function bl(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?_s(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=_s(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(Vs(e,t,o,1)),t=_s(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(Vs(e,t,o,1)):(n=_s(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function wl(e){return new this(e).cbrt()}function Il(e){return Ys(e=new this(e),e.e+1,2)}function xl(e,t,n){return new this(e).clamp(t,n)}function Cl(e){if(!e||"object"!=typeof e)throw Error(Bs+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,bs,"rounding",0,8,"toExpNeg",-As,0,"toExpPos",0,As,"maxE",0,As,"minE",-As,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=Cs[n]),void 0!==(r=e[n])){if(!(Ns(r)===r&&r>=o[t+1]&&r<=o[t+2]))throw Error(Ss+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=Cs[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(Ss+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(Fs);this[n]=!0}else this[n]=!1}return this}function El(e){return new this(e).cos()}function Bl(e){return new this(e).cosh()}function Sl(e,t){return new this(e).div(t)}function kl(e){return new this(e).exp()}function Fl(e){return Ys(e=new this(e),e.e+1,3)}function Dl(){var e,t,n=new this(0);for(Es=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Es=!0,new this(1/0);n=t}return Es=!0,n.sqrt()}function Nl(e){return e instanceof Kl||e&&e.toStringTag===Ds||!1}function Ml(e){return new this(e).ln()}function Tl(e,t){return new this(e).log(t)}function Ql(e){return new this(e).log(2)}function Ll(e){return new this(e).log(10)}function Rl(){return tl(this,arguments,-1)}function Ul(){return tl(this,arguments,1)}function Hl(e,t){return new this(e).mod(t)}function Ol(e,t){return new this(e).mul(t)}function ql(e,t){return new this(e).pow(t)}function Pl(e){var t,n,r,i,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:$s(e,1,bs),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(Fs);for(t=crypto.randomBytes(r*=4);o<r;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=r/4}else for(;o<r;)s[o++]=1e7*Math.random()|0;for(e%=7,(r=s[--o])&&e&&(i=Ms(10,7-e),s[o]=(r/i|0)*i);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=7)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=s,a}function $l(e){return Ys(e=new this(e),e.e+1,this.rounding)}function zl(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function jl(e){return new this(e).sin()}function Vl(e){return new this(e).sinh()}function Yl(e){return new this(e).sqrt()}function Wl(e,t){return new this(e).sub(t)}function Gl(){var e=0,t=arguments,n=new this(t[e]);for(Es=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Es=!0,Ys(n,this.precision,this.rounding)}function Jl(e){return new this(e).tan()}function _l(e){return new this(e).tanh()}function Xl(e){return Ys(e=new this(e),e.e+1,1)}qs[Symbol.for("nodejs.util.inspect.custom")]=qs.toString,qs[Symbol.toStringTag]="Decimal";var Kl=qs.constructor=function e(t){var n,r,i;function o(e){var t,n,r,i=this;if(!(i instanceof o))return new o(e);if(i.constructor=o,Nl(e))return i.s=e.s,void(Es?!e.d||e.e>o.maxE?(i.e=NaN,i.d=null):e.e<o.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"===(r=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;return void(Es?t>o.maxE?(i.e=NaN,i.d=null):t<o.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):ol(i,e.toString())}if("string"===r)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===n&&(e=e.slice(1)),i.s=1),Rs.test(e)?ol(i,e):al(i,e);if("bigint"===r)return e<0?(e=-e,i.s=-1):i.s=1,ol(i,e.toString());throw Error(Ss+e)}if(o.prototype=qs,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=Cl,o.clone=e,o.isDecimal=Nl,o.abs=dl,o.acos=hl,o.acosh=pl,o.add=gl,o.asin=ml,o.asinh=yl,o.atan=vl,o.atanh=Al,o.atan2=bl,o.cbrt=wl,o.ceil=Il,o.clamp=xl,o.cos=El,o.cosh=Bl,o.div=Sl,o.exp=kl,o.floor=Fl,o.hypot=Dl,o.ln=Ml,o.log=Tl,o.log10=Ll,o.log2=Ql,o.max=Rl,o.min=Ul,o.mod=Hl,o.mul=Ol,o.pow=ql,o.random=Pl,o.round=$l,o.sign=zl,o.sin=jl,o.sinh=Vl,o.sqrt=Yl,o.sub=Wl,o.sum=Gl,o.tan=Jl,o.tanh=_l,o.trunc=Xl,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(Cs);function Zl(e,t=0){if(go(t)||(t=0),t=Vi(t),!Ne(e))return"";return new Kl(e).toDecimalPlaces(t,Kl.ROUND_CEIL).toNumber()}function ec(e,t=0){if(!Ne(e))return"";if(!go(t))return"";return e=Ir(e),ji(e,t).toFixed(t)}function tc(){return"undefined"!=typeof self?self:Xa()?window:"undefined"!=typeof global?global:null}function nc(e){let t=function(){let e=tc();return n||e.xss}();let r=function e(n){return Ce(n)||Ee(n)?(vn(n,function(t,r){n[r]=e(t)}),n):ke(n)?t(n,{onIgnoreTagAttr:function(e,n,r,i){if("style"===n)return n+'="'+t.escapeAttrValue(r)+'"'}}):n}(Qi(e));return r}function rc(e,t){let n=Ja();if(!Ce(e)&&!Ee(e))return n.reject("rs is not an array or object"),n;let r=!1;if(Ee(e)){r=!0;let t=[];vn(e,(e,n)=>{t.push({k:n,v:e})}),e=t}Oi(t)||(t=function(e){return e});let i=-1,o=[];return e.reduce(function(e,n){return e.then(function(e){o.push(e),i+=1;let a=i,s=n;return r&&(a=n.k,s=n.v),Oi(t)?t(s,a):s})},Promise.resolve()).then(function(e){o.push(e),o=Ta(o),n.resolve(o)}).catch(function(e){n.reject(e)}),n}Is=new Kl(Is),xs=new Kl(xs);let ic={},oc={};function ac({tagName:e,path:t,attributes:n={},func:r}){let i=Ja();if("done"===ic[t])return i.resolve("loaded"),i;if("loading"===ic[t])return gs(()=>"done"===ic[t]).then(function(){i.resolve("loaded")}),i;ic[t]="loading";let o=document.createElement(e);return vn(n,(e,t)=>{o.setAttribute(t,e)}),n.rel&&"stylesheet"===n.rel?(o.setAttribute("href",t),setTimeout(()=>{i.resolve(o),ic[t]="done"},1)):(o.src=t,o.addEventListener("load",()=>{let e;Oi(r)?e=gs(r):(e=Ja(),e.resolve()),e.then(()=>hs(500)).then(function(){i.resolve(o),ic[t]="done"})}),o.addEventListener("error",()=>{i.reject(o),ic[t]="done"})),document.getElementsByTagName("head")[0].appendChild(o),i}function sc(e){let t=Ja();Ce(e)||(e=[e]),vn(e,(t,n)=>{Se(t)&&(e[n]={path:t})});let n=vo(bn(e,"path"),"|");return"done"===oc[n]?(t.resolve("loaded"),t):"loading"===oc[n]?(gs(()=>"done"===oc[n]).then(function(){t.resolve("loaded")}),t):(oc[n]="loading",vn(e,(e,t)=>{e.type||(".js"===ra(e.path,3)?e.type="js":".css"===ra(e.path,4)?e.type="css":e.type="unknow")}),rc(e,e=>{let t=Ja();if("js"===e.type)t=ac({tagName:"script",path:e.path,attributes:{type:"text/javascript"},func:e.func});else if("css"===e.type)t=ac({tagName:"link",path:e.path,attributes:{rel:"stylesheet"}});else{let n="invalid pathItem.type: "+e.type;console.log(n),t.reject(n)}return t}).finally(()=>{oc[n]="done"}))}function lc(e){return me(e).toUpperCase()}function cc(e,t,n){if(!ke(e))return"";if(!ke(t))return"";if(!Se(n))return"";return String(e).replaceAll(t,n)}function uc(e,t,n=1){return ke(e)&&go(t)?(n=Yi(n)?Vi(n):1,e.substring(t,t+n)):""}let fc={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function dc(e){return pc(e,1)}function hc(e){return pc(e,360)}function pc(e,t=1){if(e.indexOf("%")>=0){if(!Ne(e=cc(e,"%","")))throw new Error("invalid color: value is not a number");e=Ir(e)/100}else{if(!Ne(e))throw new Error("invalid color: value is not a number");e=Ir(e)/t}if(e>1)throw new Error("invalid color: value > 1");if(e<0)throw new Error("invalid color: value < 0");return e}function gc(e){if(!Ne(e))throw new Error("invalid color: value is not a number");if((e=Ir(e))>1)throw new Error("invalid color: value > 1");if(e<0)throw new Error("invalid color: value < 0");return e}function mc(e,t="rgba"){if(!Ce(e))throw new Error("invalid colors array");let n=be(e,0,0),r=be(e,1,0),i=be(e,2,0),o=be(e,3,1);if(4!==or(t=t.split("")))throw new Error("tar.length !== 4");let a=be(t,0),s=be(t,1),l=be(t,2),c=be(t,3);return{[a]:n,[s]:r,[l]:i,[c]:o}}function yc(e){let t=(e=ia(e,1)).length;if(2===t)e=`${e}${e}${e}ff`;else if(3===t){let t=uc(e,0,1),n=uc(e,1,1),r=uc(e,2,1);e=`${t}${t}${n}${n}${r}${r}ff`}else if(6===t)e=`${e}ff`;else if(8!==t)throw new Error("invalid hex color");function n(e){if(2!==e.length)throw new Error("hex.length of color is not equal to 2");if(!Ne(e=parseInt(e,16)))throw new Error("invalid hex of color");return(e=Ir(e))/255}return{r:n(uc(e,0,2)),g:n(uc(e,2,2)),b:n(uc(e,4,2)),a:n(uc(e,6,2))}}function vc(e){return e=mc(e=bn(e,(e,t)=>t<=2?pc(e,255):3===t?gc(e):null),"rgba")}function Ac(e){return e=Sc(e=mc(e=bn(e,(e,t)=>0===t?hc(e):1===t||2===t?dc(e):3===t?gc(e):null),"hsla"))}function bc(e){return e=kc(e=mc(e=bn(e,(e,t)=>0===t?hc(e):1===t||2===t?dc(e):3===t?gc(e):null),"hsva"))}function wc(e){if("transparent"===e)return{r:0,g:0,b:0,a:0};if(function(e){return Me(fc,e)}(e))return yc(e=function(e){return`#${fc[e]}`}(e));if(function(e){return"#"===na(e,1)&&(!!/[0-9A-Fa-f]{2}/g.test(e)||(!!/[0-9A-Fa-f]{3}/g.test(e)||(!!/[0-9A-Fa-f]{6}/g.test(e)||!!/[0-9A-Fa-f]{8}/g.test(e))))}(e))return yc(e);if(function(e){return"rgb"===na(e,3)||"rgba"===na(e,4)}(e))return function(e){return e=cc(e,"rgba",""),e=cc(e,"rgb",""),vc(ta(e=cc(e=e.replace(/[()]/g,""),","," ")," "))}(e);if(function(e){return"hsl"===na(e,3)||"hsla"===na(e,4)}(e))return function(e){return e=cc(e,"hsla",""),e=cc(e,"hsl",""),Ac(ta(e=cc(e=e.replace(/[()]/g,""),","," ")," "))}(e);if(function(e){return"hsv"===na(e,3)||"hsva"===na(e,4)}(e))return function(e){return e=cc(e,"hsva",""),e=cc(e,"hsv",""),bc(ta(e=cc(e=e.replace(/[()]/g,""),","," ")," "))}(e);throw new Error("format of color string is not hex-color, name-color, rgba, hsla, hsva")}function Ic(e,t){return!!Me(e,t=ms(t))||!!Me(e,t=lc(t))}function xc(e,t,n){let r;return r=be(e,t,null),null!==r?r:(r=be(e,t=lc(t),null),null!==r?r:n)}function Cc(e){if(function(e){let t=Ic(e,"r"),n=Ic(e,"g"),r=Ic(e,"b");return t&&n&&r}(e))return function(e){let t=[xc(e,"r",null),xc(e,"g",null),xc(e,"b",null),xc(e,"a",1)];return t=bn(t,Ma),vc(t)}(e);if(function(e){let t=Ic(e,"h"),n=Ic(e,"s"),r=Ic(e,"l");return t&&n&&r}(e))return function(e){let t=[xc(e,"h",null),xc(e,"s",null),xc(e,"l",null),xc(e,"a",1)];return t=bn(t,Ma),Ac(t)}(e);if(function(e){let t=Ic(e,"h"),n=Ic(e,"s"),r=Ic(e,"v");return t&&n&&r}(e))return function(e){let t=[xc(e,"h",null),xc(e,"s",null),xc(e,"v",null),xc(e,"a",1)];return t=bn(t,Ma),bc(t)}(e);throw new Error("color object is not one of rgba, hsla, hsva")}function Ec(e){let t,n,r=e.r,i=e.g,o=e.b,a=Math.max(r,i,o),s=Math.min(r,i,o),l=(a+s)/2;if(a===s)t=n=0;else{let e=a-s;switch(n=l>.5?e/(2-a-s):e/(a+s),a){case r:t=(i-o)/e+(i<o?6:0);break;case i:t=(o-r)/e+2;break;case o:t=(r-i)/e+4}t/=6}return{h:t,s:n,l:l,a:e.a}}function Bc(e){let t,n,r=e.r,i=e.g,o=e.b,a=Math.max(r,i,o),s=Math.min(r,i,o),l=a,c=a-s;if(n=0===a?0:c/a,a===s)t=0;else{switch(a){case r:t=(i-o)/c+(i<o?6:0);break;case i:t=(o-r)/c+2;break;case o:t=(r-i)/c+4}t/=6}return{h:t,s:n,v:l,a:e.a}}function Sc(e){let t,n,r,i=e.h,o=e.s,a=e.l;function s(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0===o)t=n=r=a;else{let e=a<.5?a*(1+o):a+o-a*o,l=2*a-e;t=s(l,e,i+1/3),n=s(l,e,i),r=s(l,e,i-1/3)}return{r:t,g:n,b:r,a:e.a}}function kc(e){let t,n,r,i=e.h,o=e.s,a=e.v,s=Math.floor(6*i),l=6*i-s,c=a*(1-o),u=a*(1-l*o),f=a*(1-(1-l)*o);switch(s%6){case 0:t=a,n=f,r=c;break;case 1:t=u,n=a,r=c;break;case 2:t=c,n=a,r=f;break;case 3:t=c,n=u,r=a;break;case 4:t=f,n=c,r=a;break;case 5:t=a,n=c,r=u}return{r:t,g:n,b:r,a:e.a}}function Fc(e){let t=Math.round(255*e).toString(16);if(1===t.length)return`0${t}`;if(2===t.length)return t;throw new Error("invalid value")}function Dc(e,t=!0){let n=e.r,r=e.g,i=e.b,o=e.a,a=`${Fc(n)}${Fc(r)}${Fc(i)}`;return t&&(a=`${a}${Fc(o)}`),a}function Nc(e){return Math.min(1,Math.max(0,e))}function Mc(e,t){if(!ke(t))throw new Error("fmtOutput is not a string");if(!du[t])throw console.log(`fmtOutput must be [${ht(du)}]`),new Error("invalid fmtOutput");return e=du[t](e)}function Tc(e,t,n="toRgbString"){if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=Ec(e);return r.h+=t,r.h=r.h%1,Mc(Sc(r),n)}function Qc(e,t,n,r,i="toRgbString"){if(t<0||t>1)throw new Error("w1 < 0 or > 1");if(r<0||r>1)throw new Error("w1 < 0 or > 1");return Mc({r:e.r*t+n.r*r,g:e.g*t+n.g*r,b:e.b*t+n.b*r,a:e.a*t+n.a*r},i)}function Lc(e){return`${ji(100*e,1)}%`}function Rc(e){return ji(e,0)}function Uc(e){return ji(e,3)}function Hc(e){return{r:Rc(255*e.r),g:Rc(255*e.g),b:Rc(255*e.b)}}function Oc(e){return`rgb(${Rc(255*e.r)}, ${Rc(255*e.g)}, ${Rc(255*e.b)})`}function qc(e){return{r:Rc(255*e.r),g:Rc(255*e.g),b:Rc(255*e.b),a:Uc(e.a)}}function Pc(e){return`rgba(${Rc(255*e.r)}, ${Rc(255*e.g)}, ${Rc(255*e.b)}, ${Uc(e.a)})`}function $c(e){let t=Ec(e);return{h:Rc(360*t.h),s:Uc(t.s),l:Uc(t.l)}}function zc(e){let t=Ec(e);return`hsl(${Rc(360*t.h)}, ${Uc(t.s)}, ${Uc(t.l)})`}function jc(e){let t=Ec(e);return{h:Rc(360*t.h),s:Uc(t.s),l:Uc(t.l),a:Uc(t.a)}}function Vc(e){let t=Ec(e);return`hsla(${Rc(360*t.h)}, ${Uc(t.s)}, ${Uc(t.l)}, ${Uc(t.a)})`}function Yc(e){let t=Bc(e);return{h:Rc(360*t.h),s:Uc(t.s),v:Uc(t.v)}}function Wc(e){let t=Bc(e);return`hsv(${Rc(360*t.h)}, ${Uc(t.s)}, ${Uc(t.v)})`}function Gc(e){let t=Bc(e);return{h:Rc(360*t.h),s:Uc(t.s),v:Uc(t.v),a:Uc(t.a)}}function Jc(e){let t=Bc(e);return`hsva(${Rc(360*t.h)}, ${Uc(t.s)}, ${Uc(t.v)}, ${Uc(t.a)})`}function _c(e){return{r:Lc(e.r),g:Lc(e.g),b:Lc(e.b)}}function Xc(e){return`rgb(${Lc(e.r)}, ${Lc(e.g)}, ${Lc(e.b)})`}function Kc(e){return{r:Lc(e.r),g:Lc(e.g),b:Lc(e.b),a:Uc(e.a)}}function Zc(e){return`rgba(${Lc(e.r)}, ${Lc(e.g)}, ${Lc(e.b)}, ${Uc(e.a)})`}function eu(e){let t=Ec(e);return{h:Rc(360*t.h),s:Lc(t.s),l:Lc(t.l)}}function tu(e){let t=Ec(e);return`hsl(${Rc(360*t.h)}, ${Lc(t.s)}, ${Lc(t.l)})`}function nu(e){let t=Ec(e);return{h:Rc(360*t.h),s:Lc(t.s),l:Lc(t.l),a:Uc(t.a)}}function ru(e){let t=Ec(e);return`hsla(${Rc(360*t.h)}, ${Lc(t.s)}, ${Lc(t.l)}, ${Uc(t.a)})`}function iu(e){let t=Bc(e);return{h:Rc(360*t.h),s:Lc(t.s),v:Lc(t.v)}}function ou(e){let t=Bc(e);return`hsv(${Rc(360*t.h)}, ${Lc(t.s)}, ${Lc(t.v)})`}function au(e){let t=Bc(e);return{h:Rc(360*t.h),s:Lc(t.s),v:Lc(t.v),a:Uc(t.a)}}function su(e){let t=Bc(e);return`hsva(${Rc(360*t.h)}, ${Lc(t.s)}, ${Lc(t.v)}, ${Uc(t.a)})`}function lu(e){let t=function(e){return Dc(e,!1)}(e);return`#${t}`}function cu(e){return`#${Dc(e)}`}function uu(e){let t=null,n=null,r=null;if(ke(e))t=ms(Zo(e));else{if(!Be(e))throw console.log("color=",e),new Error("color is not a string or an object");n=e}if(null!==t)try{r=wc(t)}catch(e){throw console.log(e),new Error(`can not parse color: ${t}`)}else if(null!==n)try{r=Cc(n)}catch(e){throw console.log(e),new Error(`can not parse color: ${JSON.stringify(n)}`)}return r}function fu(e){if(!Be(e))return console.log("gradient is not an effective object"),e=>`rgb(${255*(e=Math.min(Math.max(e,0),1))},${255*e},${255*e})`;let t=[];return vn(e,(e,n)=>{t.push([Ir(n),qc(uu(e)),e])}),t=Da(t,0),function(e){let n=null;for(let r=1;r<t.length;r++){let i=t[r-1][0],o=t[r-1][1],a=t[r][0],s=t[r][1];if(i<=e&&a>=e){let t=(a-e)/(a-i),r=(e-i)/(a-i);n=Qc(uu(o),t,uu(s),r,"toRgbaString");break}}return n}}let du={toRgb:Hc,toRgbString:Oc,toRgba:qc,toRgbaString:Pc,toHsl:$c,toHslString:zc,toHsla:jc,toHslaString:Vc,toHsv:Yc,toHsvString:Wc,toHsva:Gc,toHsvaString:Jc,toRgbP:_c,toRgbPString:Xc,toRgbaP:Kc,toRgbaPString:Zc,toHslP:eu,toHslPString:tu,toHslaP:nu,toHslaPString:ru,toHsvP:iu,toHsvPString:ou,toHsvaP:au,toHsvaPString:su,toHexString:lu,toHex8String:cu};var hu=function(){let e={toRgb:e=>Hc(uu(e)),toRgbString:e=>Oc(uu(e)),toRgba:e=>qc(uu(e)),toRgbaString:e=>Pc(uu(e)),toHsl:e=>$c(uu(e)),toHslString:e=>zc(uu(e)),toHsla:e=>jc(uu(e)),toHslaString:e=>Vc(uu(e)),toHsv:e=>Yc(uu(e)),toHsvString:e=>Wc(uu(e)),toHsva:e=>Gc(uu(e)),toHsvaString:e=>Jc(uu(e)),toRgbP:e=>_c(uu(e)),toRgbPString:e=>Xc(uu(e)),toRgbaP:e=>Kc(uu(e)),toRgbaPString:e=>Zc(uu(e)),toHslP:e=>eu(uu(e)),toHslPString:e=>tu(uu(e)),toHslaP:e=>nu(uu(e)),toHslaPString:e=>ru(uu(e)),toHsvP:e=>iu(uu(e)),toHsvPString:e=>ou(uu(e)),toHsvaP:e=>au(uu(e)),toHsvaPString:e=>su(uu(e)),toHexString:e=>lu(uu(e)),toHex8String:e=>cu(uu(e)),modSaturate:(e,t,n)=>function(e,t,n="toRgbString"){if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=Ec(e);return r.s+=t,r.s=Nc(r.s),Mc(Sc(r),n)}(uu(e),t,n),modGrey:(e,t)=>function(e,t="toRgbString"){let n=Ec(e);return n.s=0,Mc(Sc(n),t)}(uu(e),t),modLighten:(e,t,n)=>function(e,t,n="toRgbString"){if(t<0||t>1)throw new Error("amount < 0 or > 1");let r=Ec(e);return r.l+=t,r.l=Nc(r.l),Mc(Sc(r),n)}(uu(e),t,n),modBrighten:(e,t,n)=>function(e,t,n="toRgbString"){if(t<0||t>1)throw new Error("amount < 0 or > 1");return e.r+=t,e.r=Nc(e.r),e.g+=t,e.g=Nc(e.g),e.b+=t,e.b=Nc(e.b),Mc(e,n)}(uu(e),t,n),modHue:(e,t,n)=>Tc(uu(e),t,n),modComplement:(e,t)=>function(e,t="toRgbString"){return Tc(e,.5,t)}(uu(e),t),spreadHue:(e,t,n)=>function(e,t,n="toRgbString"){if(!xr(t))throw new Error("num is not an integer");if((t=Vi(t))<=1)return[e];let r=Ec(e),i=1/t,o=[];for(let e=0;e<t;e++)o.push(Mc(Sc(r),n)),r.h+=i,r.h=r.h%1;return o}(uu(e),t,n),spreadMonochromatic:(e,t,n)=>function(e,t,n="toRgbString"){if(!xr(t))throw new Error("num is not an integer");if((t=Vi(t))<=1)return[e];let r=Bc(e);r.s=1,r.l=1;let i=1/t,o=[];for(let e=0;e<t;e++)o.push(Mc(kc(r),n)),r.h-=i,r.l-=i;return o}(uu(e),t,n),mix:(e,t,n,r,i)=>Qc(uu(e),t,uu(n),r,i),getBrightness:e=>function(e){if(1!==e.a)throw new Error("alpha of color can not be equal to 1");return(299*e.r+587*e.g+114*e.b)/1e3}(uu(e)),getLuminance:e=>function(e){if(1!==e.a)throw new Error("alpha of color can not be equal to 1");let t,n,r,i=e.r,o=e.g,a=e.b;return t=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),n=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),r=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r}(uu(e)),interp:fu};return e}();function pu(e,t,n){return null==e?e:function(e,t,n,r){if(!L(e))return e;for(var i=-1,o=(t=ye(t,e)).length,a=o-1,s=e;null!=s&&++i<o;){var l=ve(t[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(i!=a){var u=s[l];void 0===(c=r?r(u,l,s):void 0)&&(c=L(u)?u:Ge(t[i+1])?[]:{})}ni(s,l,c),s=s[l]}return e}(e,t,n)}var gu=Function.prototype,mu=Object.prototype,yu=gu.toString,vu=mu.hasOwnProperty,Au=yu.call(Object);function bu(e){if(!D(e)||"[object Object]"!=F(e))return!1;var t=di(e);if(null===t)return!0;var n=vu.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&yu.call(n)==Au}function wu(e){return bu(e)?void 0:e}var Iu=ho(function(e,t){var n={};if(null==e)return n;var r=!1;t=de(t,function(t){return t=ye(t,e),r||(r=t.length>1),t}),ri(e,pi(e),n),r&&(n=Ti(n,7,wu));for(var i=t.length;i--;)Ia(n,t[i]);return n}),xu=Iu;function Cu(e,t={}){let n="$level",r="$parents";if(!Mn(e))return[];let i=be(t,"bindKey",null);ke(i)||(i="id");let o=be(t,"bindParent",null);ke(o)||(o="parentId");let a=be(t,"bindChildren",null);ke(a)||(a="children");let s=be(t,"saveExtProps",null);we(s)||(s=!1),e=function(e){let t=[];function a(a){let s=[];vn(e,(e,l)=>{let c=be(e,o),u=be(a,i);if(c&&u&&c===u){let o=be(a,r,[]);o=Qi(o),o.push(a[i]),t.push({[n]:a[n]+1,[r]:o,...e})}else s.push(e)}),e=s}if(e=Qi(e),function(){let i=[];vn(e,(e,a)=>{Nn(e[o])?t.push({[n]:0,[r]:[],...e}):i.push(e)}),e=i}(),0===t.length)return t;let s=-1;for(;s+=1,!(s>t.length-1);){if(a(t[s]),0===e.length)break}return t}(e);let l=function(e){let t=[];function l(e){return s?e:xu(e,[n,r])}let c={};return vn(e,(r,s)=>{if(0===r[n]){let e=l(r);t.push(e),c[r[i]]=[s]}else{let n=function(t){for(let n=0;n<e.length;n++){let r=e[n];if(t[o]===r[i])return r}return null}(r);if(null!==n){let e=c[n[i]];e=[...e,a];let o=be(t,e,[]),s=l(r);o.push(s),c[r[i]]=[...e,o.length-1],pu(t,e,o)}else console.log(`can not find parent for ${be(r,o)}`)}}),t}(e);return l}function Eu(e,t=null,n={}){Oi(t)||(t=e=>e);let r=be(n,"force",!1);return we(r)||(r=!1),function(e,t,n=!1){let r=[];if(!Ce(e)&&!Ee(e))return t(e,null,[]);function i(e){if(Ce(e))return Ki(or(e));if(Ee(e)){let t=Object.getOwnPropertyNames(e),r=null;return n&&(r=Object.getOwnPropertySymbols(e)),Ce(t)||(t=[]),Ce(r)||(r=[]),[...t,...r]}return e}return function e(n,o){if(Ce(n))return i(n).map(i=>{let o=n[i],a=Qi(r);return r.push(i),o=t(o,i,a),o=e(o),r.pop(),o});if(Ee(n)){let o=i(n),a={};return o.map(i=>{let o=n[i],s=Qi(r);r.push(i),o=t(o,i,s),o=e(o),r.pop(),a[i]=o}),a}return n}(e)}(e,t,r)}function Bu(e,t={}){if(!Be(e)&&!Mn(e))return[];let n=be(t,"bindKey",null);ke(n)||(n="id");let r=be(t,"bindParent",null);ke(r)||(r="parentId");let i=be(t,"bindBelong",null);ke(i)||(i="key");let o=be(t,"bindText",null);ke(o)||(o="text");let a=be(t,"bindType",null);ke(a)||(a="type");let s=be(t,"bindNumOfChilren",null);function l(e,t){return e=bn(e=Qi(e),e=>N(e)?Ma(e):e),N(t)&&(t=Ma(t)),(ke(t)||Ne(t))&&e.push(t),vo(e,"-")}ke(s)||(s="numOfChilren");let c=[];return Eu(e,(e,t,u)=>{let f=l(u,t),d=l(u,null),h="node";Ee(e)?h="object":Ce(e)&&(h="array");let p={[n]:f,[r]:d,[a]:h};if((ke(t)||ua(t))&&(p[i]=t),Ee(e)||Ce(e)||(p[o]=e),Ee(e)||Ce(e)){let t=null;Ee(e)?t=or(ht(e)):Ce(e)&&(t=or(e)),p[s]=t}return c.push(p),e},{force:!0}),c}function Su(e){return D(t=e)&&1===t.nodeType&&!bu(t);var t}function ku(e){if(!Su(e))return"invalid element";let t=!1;try{t=document.activeElement===e}catch(e){console.log(e)}return t}function Fu(e){return Ne(e)?(e=Ir(e),Math.cos(e*Math.PI/180)):null}function Du(e){return Ne(e)?(e=Ir(e),Math.tan(e*Math.PI/180)):null}function Nu(){return{sheets:[]}}function Mu(e){return Ne(e)?(e=Ir(e),Math.sin(e*Math.PI/180)):null}function Tu(e){if(!ke(e))return!1;let n="YYYY-MM-DD";return e===t(e,n).format(n)}function Qu(e=300){return new function(e){let t=[],n=null,r=Date.now();return Yi(e)||(e=300),e=Vi(e),function(i,...o){Oi(i)?(r=Date.now(),t.push({func:i,input:o}),null===n&&(n=setInterval(()=>{if(0===or(t))return clearInterval(n),void(n=null);if(Date.now()-r>e){let e=t.pop();t=[];try{e.func(...e.input)}catch(e){console.log("m.func catch",e)}}},10))):console.log("func is not a function")}}(e)}let Lu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Ru=Lu.length;function Uu(e=32){let t=[];e=Yi(e)?Vi(e):32;for(let n=0;n<e;n++)t[n]=Lu[0|Math.random()*Ru];return t.join("")}function Hu(e,t={}){if(!Su(e))return;let n=be(t,"duration",500);n=Ir(n),n<0&&(n=1e3);let r=be(t,"delay",0);r=Ir(r),r<0&&(r=0);let i=be(t,"opacityIni",0);i=Ir(i),i=Math.min(Math.max(i,0),1),Ne(e.style.opacity)&&(i=Ir(e.style.opacity));let o=10/n,a=`tag-${Uu()}`;e.setAttribute("dom-fade-tag",a),setTimeout(()=>{let t=setInterval(()=>{try{e.getAttribute("dom-fade-tag")!==a&&clearInterval(t),e.style.opacity=i,i>=1&&(clearInterval(t),e.removeAttribute("dom-fade-tag")),i+=o,i>1&&(i=1)}catch(e){console.log(e),clearInterval(t)}},10)},r)}function Ou(e,t={}){if(!Su(e))return;let n=be(t,"duration",500);n=Ir(n),n<0&&(n=1e3);let r=be(t,"delay",0);r=Ir(r),r<0&&(r=0);let i=be(t,"opacityIni",1);i=Ir(i),i=Math.min(Math.max(i,0),1),Ne(e.style.opacity)&&(i=Ir(e.style.opacity));let o=10/n,a=`tag-${Uu()}`;e.setAttribute("dom-fade-tag",a),setTimeout(()=>{let t=setInterval(()=>{try{e.getAttribute("dom-fade-tag")!==a&&clearInterval(t),e.style.opacity=i,i<=0&&(clearInterval(t),e.removeAttribute("dom-fade-tag")),i-=o,i<0&&(i=0)}catch(e){console.log(e),clearInterval(t)}},10)},r)}let qu='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 512.001 512.001" style="width:12px; height:12px; enable-background:new 0 0 512.001 512.001;" xml:space="preserve"><g><g><path d="M284.286,256.002L506.143,34.144c7.811-7.811,7.811-20.475,0-28.285c-7.811-7.81-20.475-7.811-28.285,0L256,227.717L34.143,5.859c-7.811-7.811-20.475-7.811-28.285,0c-7.81,7.811-7.811,20.475,0,28.285l221.857,221.857L5.858,477.859c-7.811,7.811-7.811,20.475,0,28.285c3.905,3.905,9.024,5.857,14.143,5.857c5.119,0,10.237-1.952,14.143-5.857L256,284.287l221.857,221.857c3.905,3.905,9.024,5.857,14.143,5.857s10.237-1.952,14.143-5.857c7.811-7.811,7.811-20.475,0-28.285L284.286,256.002z"/></g></g></svg>',Pu={success:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 426.667 426.667" style="width:24px; height:24px; enable-background:new 0 0 426.667 426.667" xml:space="preserve"><path style="fill:#6ac259" d="M213.333,0C95.518,0,0,95.514,0,213.333s95.518,213.333,213.333,213.333 c117.828,0,213.333-95.514,213.333-213.333S331.157,0,213.333,0z M174.199,322.918l-93.935-93.931l31.309-31.309l62.626,62.622 l140.894-140.898l31.309,31.309L174.199,322.918z"/></svg>',error:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 496.158 496.158" style="width:24px; height:24px; enable-background:new 0 0 496.158 496.158" xml:space="preserve"><path style="fill:#e04f5f" d="M496.158,248.085c0-137.021-111.07-248.082-248.076-248.082C111.07,0.003,0,111.063,0,248.085 c0,137.002,111.07,248.07,248.082,248.07C385.088,496.155,496.158,385.087,496.158,248.085z"/><path style="fill:#fff" d="M277.042,248.082l72.528-84.196c7.91-9.182,6.876-23.041-2.31-30.951 c-9.172-7.904-23.032-6.876-30.947,2.306l-68.236,79.212l-68.229-79.212c-7.91-9.188-21.771-10.216-30.954-2.306 c-9.186,7.91-10.214,21.77-2.304,30.951l72.522,84.196l-72.522,84.192c-7.91,9.182-6.882,23.041,2.304,30.951 c4.143,3.569,9.241,5.318,14.316,5.318c6.161,0,12.294-2.586,16.638-7.624l68.229-79.212l68.236,79.212 c4.338,5.041,10.47,7.624,16.637,7.624c5.069,0,10.168-1.749,14.311-5.318c9.186-7.91,10.22-21.77,2.31-30.951L277.042,248.082z"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 497.472 497.472" style="width:24px; height:24px; enable-background:new 0 0 497.472 497.472" xml:space="preserve"><g transform="matrix(1.25 0 0 -1.25 0 45)"><path style="fill:#ffcc4d" d="M24.374-357.857c-20.958,0-30.197,15.223-20.548,33.826L181.421,17.928 c9.648,18.603,25.463,18.603,35.123,0L394.14-324.031c9.671-18.603,0.421-33.826-20.548-33.826H24.374z"/><path style="fill:#231f20" d="M173.605-80.922c0,14.814,10.934,23.984,25.395,23.984c14.12,0,25.407-9.512,25.407-23.984 V-216.75c0-14.461-11.287-23.984-25.407-23.984c-14.461,0-25.395,9.182-25.395,23.984V-80.922z M171.489-289.056 c0,15.167,12.345,27.511,27.511,27.511c15.167,0,27.523-12.345,27.523-27.511c0-15.178-12.356-27.523-27.523-27.523 C183.834-316.579,171.489-304.234,171.489-289.056"/></g></svg>',infor:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 496.16 496.16" style="width:24px; height:24px; enable-background:new 0 0 496.158 496.158;" xml:space="preserve"><path d="m496.16 248.08c0-137.02-111.07-248.08-248.08-248.08-137.01 0-248.08 111.06-248.08 248.08 0 137 111.07 248.07 248.08 248.07 137.01 0 248.08-111.07 248.08-248.07z" fill="#25B7D3"/><g fill="#fff"><path d="m315.25 359.56c-1.387-2.032-4.048-2.755-6.27-1.702-24.582 11.637-52.482 23.94-57.958 25.015-0.138-0.123-0.357-0.348-0.644-0.737-0.742-1.005-1.103-2.318-1.103-4.015 0-13.905 10.495-56.205 31.192-125.72 17.451-58.406 19.469-70.499 19.469-74.514 0-6.198-2.373-11.435-6.865-15.146-4.267-3.519-10.229-5.302-17.719-5.302-12.459 0-26.899 4.73-44.146 14.461-16.713 9.433-35.352 25.41-55.396 47.487-1.569 1.729-1.733 4.314-0.395 6.228 1.34 1.915 3.825 2.644 5.986 1.764 7.037-2.872 42.402-17.359 47.557-20.597 4.221-2.646 7.875-3.989 10.861-3.989 0.107 0 0.199 4e-3 0.276 0.01 0.036 0.198 0.07 0.5 0.07 0.933 0 3.047-0.627 6.654-1.856 10.703-30.136 97.641-44.785 157.5-44.785 182.99 0 8.998 2.501 16.242 7.432 21.528 5.025 5.393 11.803 8.127 20.146 8.127 8.891 0 19.712-3.714 33.08-11.354 12.936-7.392 32.68-23.653 60.363-49.717 1.793-1.687 2.092-4.426 0.705-6.458z"/><path d="m314.28 76.672c-4.925-5.041-11.227-7.597-18.729-7.597-9.34 0-17.475 3.691-24.176 10.971-6.594 7.16-9.938 15.946-9.938 26.113 0 8.033 2.463 14.69 7.32 19.785 4.922 5.172 11.139 7.794 18.476 7.794 8.958 0 17.049-3.898 24.047-11.586 6.876-7.553 10.363-16.433 10.363-26.393 1e-3 -7.654-2.476-14.075-7.363-19.087z"/></g></svg>',cancel:qu},$u={},zu=null,ju=tc();function Vu(){vn(["top-right","top-left","bottom-right","bottom-left"],e=>{!function(e){let t=aa($u,{position:e});t=Da(t,"timeStart");let n=16;vn(t,e=>{$u[e.id].ele||($u[e.id].ele=document.querySelector(`#${e.id}`)),$u[e.id].loc.top=n,$u[e.id].loc.height=$u[e.id].ele.offsetHeight,n+=$u[e.id].loc.height+16}),vn(t,t=>{e.indexOf("bottom-")>=0?($u[t.id].ele.style.bottom=`${$u[t.id].loc.top}px`,$u[t.id].loc.bottom=$u[t.id].loc.top):$u[t.id].ele.style.top=`${$u[t.id].loc.top}px`,e.indexOf("-left")>=0?($u[t.id].ele.style.left="16px",$u[t.id].loc.left=16):($u[t.id].ele.style.right="16px",$u[t.id].loc.right=16),$u[t.id].ele.style.zIndex=2e5,$u[t.id].ele.style.opacity=1,$u[t.id].ele.style.transform="",$u[t.id].ele.style.transform=null})}(e)})}function Yu(e){$u[e].ele&&$u[e].ele.parentNode.removeChild($u[e].ele),$u[e]&&delete $u[e],Vu()}function Wu(e,t){if(!Su(e))return"invalid eleParent";if(Se(t))e.insertAdjacentHTML("beforeend",t);else{if(!Su(t))return"invalid itemChild";e.appendChild(t)}}function Gu(){return null!==navigator.userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)}function Ju(e){if(!e)return"invalid event";if(!e.cancelable)return"event is not cancelable";try{Gu()?e.cancelBubble=!0:e.stopPropagation(),e.preventDefault()}catch(e){}}var _u;ju.ttWAlertCancel=function(e){Yu(e)},ju.ttWAlertFadeIn=function(e){Hu(document.querySelector(`#${e}`))},ju.ttWAlertFadeOut=function(e){Ou(document.querySelector(`#${e}`))},function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"}(_u||(_u={}));var Xu;!function(e){e.AUTO="auto",e.DARK="dark",e.LIGHT="light"}(Xu||(Xu={}));const Ku=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function Zu(e){return e?e.replace(/\\/g,"/"):e}function ef(e){const t=e.length;let n=-1/0;for(let r=0;r<t;r++)n=Math.max(n,e[r]);return n}function tf(e,t){const n=e.split(".");return n.length>1?n[n.length-1]:t}function nf(e,t){return t.reduce((t,n)=>t||e.startsWith(n),!1)}const rf=["a/","b/","i/","w/","c/","o/"];function of(e,t,n){const r=void 0!==n?[...rf,n]:rf,i=t?new RegExp(`^${o=t,o.replace(Ku,"\\$&")} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$');var o;const[,a=""]=i.exec(e)||[],s=r.find(e=>0===a.indexOf(e));return(s?a.slice(s.length):a).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function af(e,t={}){const n=[];let r=null,i=null,o=null,a=null,s=null,l=null,c=null;const u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,p=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,m=/^new file mode (\d{6})/,y=/^copy from "?(.+)"?/,v=/^copy to "?(.+)"?/,A=/^rename from "?(.+)"?/,b=/^rename to "?(.+)"?/,w=/^similarity index (\d+)%/,I=/^dissimilarity index (\d+)%/,x=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,C=/^Binary files (.*) and (.*) differ/,E=/^GIT binary patch/,B=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,S=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,k=/^new file mode (\d{6})/,F=/^deleted file mode (\d{6}),(\d{6})/,D=e.replace(/\/g,"").replace(/\r\n?/g,"\n").split("\n");function N(){null!==i&&null!==r&&(r.blocks.push(i),i=null)}function M(){null!==r&&(r.oldName||null===l||(r.oldName=l),r.newName||null===c||(r.newName=c),r.newName&&(n.push(r),r=null)),l=null,c=null}function T(){N(),M(),r={blocks:[],deletedLines:0,addedLines:0}}function Q(e){let t;N(),null!==r&&((t=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(e))?(r.isCombined=!1,o=parseInt(t[1],10),s=parseInt(t[2],10)):(t=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(e))?(r.isCombined=!0,o=parseInt(t[1],10),a=parseInt(t[2],10),s=parseInt(t[3],10)):(e.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),o=0,s=0,r.isCombined=!1)),i={lines:[],oldStartLine:o,oldStartLine2:a,newStartLine:s,header:e}}return D.forEach((e,a)=>{if(!e||e.startsWith("*"))return;let N;const M=D[a-1],L=D[a+1],R=D[a+2];if(e.startsWith("diff --git")||e.startsWith("diff --combined")){T();if((N=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(e))&&(l=of(N[1],void 0,t.dstPrefix),c=of(N[2],void 0,t.srcPrefix)),null===r)throw new Error("Where is my file !!!");return void(r.isGitDiff=!0)}if(e.startsWith("Binary files")&&!(null==r?void 0:r.isGitDiff)){T();if((N=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(e))&&(l=of(N[1],void 0,t.dstPrefix),c=of(N[2],void 0,t.srcPrefix)),null===r)throw new Error("Where is my file !!!");return void(r.isBinary=!0)}if((!r||!r.isGitDiff&&r&&e.startsWith(u)&&L.startsWith(f)&&R.startsWith(d))&&T(),null==r?void 0:r.isTooBig)return;if(r&&("number"==typeof t.diffMaxChanges&&r.addedLines+r.deletedLines>t.diffMaxChanges||"number"==typeof t.diffMaxLineLength&&e.length>t.diffMaxLineLength)){r.isTooBig=!0,r.addedLines=0,r.deletedLines=0,r.blocks=[],i=null;return void Q("function"==typeof t.diffTooBigMessage?t.diffTooBigMessage(n.length):"Diff too big to be displayed")}if(e.startsWith(u)&&L.startsWith(f)||e.startsWith(f)&&M.startsWith(u)){if(r&&!r.oldName&&e.startsWith("--- ")&&(N=function(e,t){return of(e,"---",t)}(e,t.srcPrefix)))return r.oldName=N,void(r.language=tf(r.oldName,r.language));if(r&&!r.newName&&e.startsWith("+++ ")&&(N=function(e,t){return of(e,"+++",t)}(e,t.dstPrefix)))return r.newName=N,void(r.language=tf(r.newName,r.language))}if(r&&(e.startsWith(d)||r.isGitDiff&&r.oldName&&r.newName&&!i))return void Q(e);if(i&&(e.startsWith("+")||e.startsWith("-")||e.startsWith(" ")))return void function(e){if(null===r||null===i||null===o||null===s)return;const t={content:e},n=r.isCombined?["+ "," +","++"]:["+"],a=r.isCombined?["- "," -","--"]:["-"];nf(e,n)?(r.addedLines++,t.type=_u.INSERT,t.oldNumber=void 0,t.newNumber=s++):nf(e,a)?(r.deletedLines++,t.type=_u.DELETE,t.oldNumber=o++,t.newNumber=void 0):(t.type=_u.CONTEXT,t.oldNumber=o++,t.newNumber=s++),i.lines.push(t)}(e);const U=!function(e,t){let n=t;for(;n<D.length-3;){if(e.startsWith("diff"))return!1;if(D[n].startsWith(u)&&D[n+1].startsWith(f)&&D[n+2].startsWith(d))return!0;n++}return!1}(e,a);if(null===r)throw new Error("Where is my file !!!");(N=h.exec(e))?r.oldMode=N[1]:(N=p.exec(e))?r.newMode=N[1]:(N=g.exec(e))?(r.deletedFileMode=N[1],r.isDeleted=!0):(N=m.exec(e))?(r.newFileMode=N[1],r.isNew=!0):(N=y.exec(e))?(U&&(r.oldName=N[1]),r.isCopy=!0):(N=v.exec(e))?(U&&(r.newName=N[1]),r.isCopy=!0):(N=A.exec(e))?(U&&(r.oldName=N[1]),r.isRename=!0):(N=b.exec(e))?(U&&(r.newName=N[1]),r.isRename=!0):(N=C.exec(e))?(r.isBinary=!0,r.oldName=of(N[1],void 0,t.srcPrefix),r.newName=of(N[2],void 0,t.dstPrefix),Q("Binary file")):E.test(e)?(r.isBinary=!0,Q(e)):(N=w.exec(e))?r.unchangedPercentage=parseInt(N[1],10):(N=I.exec(e))?r.changedPercentage=parseInt(N[1],10):(N=x.exec(e))?(r.checksumBefore=N[1],r.checksumAfter=N[2],N[3]&&(r.mode=N[3])):(N=B.exec(e))?(r.checksumBefore=[N[2],N[3]],r.checksumAfter=N[1]):(N=S.exec(e))?(r.oldMode=[N[2],N[3]],r.newMode=N[1]):(N=k.exec(e))?(r.newFileMode=N[1],r.isNew=!0):(N=F.exec(e))&&(r.deletedFileMode=N[1],r.isDeleted=!0)}),N(),M(),n}class sf{diff(e,t,n={}){let r;"function"==typeof n?(r=n,n={}):"callback"in n&&(r=n.callback);const i=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,s,n,r)}diffWithOptionsObj(e,t,n,r){var i;const o=e=>(e=this.postProcess(e,n),r?void setTimeout(function(){r(e)},0):e),a=t.length,s=e.length;let l=1,c=a+s;null!=n.maxEditLength&&(c=Math.min(c,n.maxEditLength));const u=null!==(i=n.timeout)&&void 0!==i?i:1/0,f=Date.now()+u,d=[{oldPos:-1,lastComponent:void 0}];let h=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=s&&h+1>=a)return o(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,g=1/0;const m=()=>{for(let r=Math.max(p,-l);r<=Math.min(g,l);r+=2){let i;const l=d[r-1],c=d[r+1];l&&(d[r-1]=void 0);let u=!1;if(c){const e=c.oldPos-r;u=c&&0<=e&&e<a}const f=l&&l.oldPos+1<s;if(u||f){if(i=!f||u&&l.oldPos<c.oldPos?this.addToPath(c,!0,!1,0,n):this.addToPath(l,!1,!0,1,n),h=this.extractCommon(i,t,e,r,n),i.oldPos+1>=s&&h+1>=a)return o(this.buildValues(i.lastComponent,t,e))||!0;d[r]=i,i.oldPos+1>=s&&(g=Math.min(g,r-1)),h+1>=a&&(p=Math.max(p,r+1))}else d[r]=void 0}l++};if(r)!function e(){setTimeout(function(){if(l>c||Date.now()>f)return r(void 0);m()||e()},0)}();else for(;l<=c&&Date.now()<=f;){const e=m();if(e)return e}}addToPath(e,t,n,r,i){const o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,r,i){const o=t.length,a=n.length;let s=e.oldPos,l=s-r,c=0;for(;l+1<o&&s+1<a&&this.equals(n[s+1],t[l+1],i);)l++,s++,c++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!i.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){const r=[];let i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();const o=r.length;let a=0,s=0,l=0;for(;a<o;a++){const e=r[a];if(e.removed)e.value=this.join(n.slice(l,l+e.count)),l+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){const r=n[l+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(l+=e.count)}}return r}}const lf=new class extends sf{};const cf="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";const uf=new class extends sf{tokenize(e){const t=new RegExp(`(\\r?\\n)|[${cf}]+|[^\\S\\n\\r]+|[^${cf}]`,"ug");return e.match(t)||[]}};function ff(e){return(t,n)=>{const r=e(t).trim(),i=e(n).trim();return function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;const n=[];let r,i;for(r=0;r<=t.length;r++)n[r]=[r];for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]}(r,i)/(r.length+i.length)}}function df(e){return function t(n,r,i=0,o=new Map){const a=function(t,n,r=new Map){let i,o=1/0;for(let a=0;a<t.length;++a)for(let s=0;s<n.length;++s){const l=JSON.stringify([t[a],n[s]]);let c;r.has(l)&&(c=r.get(l))||(c=e(t[a],n[s]),r.set(l,c)),c<o&&(o=c,i={indexA:a,indexB:s,score:o})}return i}(n,r,o);if(!a||n.length+r.length<3)return[[n,r]];const s=n.slice(0,a.indexA),l=r.slice(0,a.indexB),c=[n[a.indexA]],u=[r[a.indexB]],f=a.indexA+1,d=a.indexB+1,h=n.slice(f),p=r.slice(d),g=t(s,l,i+1,o),m=t(c,u,i+1,o),y=t(h,p,i+1,o);let v=m;return(a.indexA>0||a.indexB>0)&&(v=g.concat(v)),(n.length>f||r.length>d)&&(v=v.concat(y)),v}}const hf={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},pf={matching:"none",matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:"word",colorScheme:Xu.LIGHT},gf="/",mf=ff(e=>e.value),yf=df(mf);function vf(e){return-1!==e.indexOf("dev/null")}function Af(e){return e.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function bf(e){switch(e){case _u.CONTEXT:return hf.CONTEXT;case _u.INSERT:return hf.INSERTS;case _u.DELETE:return hf.DELETES}}function wf(e){switch(e){case Xu.DARK:return"d2h-dark-color-scheme";case Xu.AUTO:return"d2h-auto-color-scheme";case Xu.LIGHT:default:return"d2h-light-color-scheme"}}function If(e){return e.slice(0).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function xf(e,t,n=!0){const r=function(e){return e?2:1}(t);return{prefix:e.substring(0,r),content:n?If(e.substring(r)):e.substring(r)}}function Cf(e){const t=Zu(e.oldName),n=Zu(e.newName);if(t===n||vf(t)||vf(n))return vf(n)?t:n;{const e=[],r=[],i=t.split(gf),o=n.split(gf);let a=0,s=i.length-1,l=o.length-1;for(;a<s&&a<l&&i[a]===o[a];)e.push(o[a]),a+=1;for(;s>a&&l>a&&i[s]===o[l];)r.unshift(o[l]),s-=1,l-=1;const c=e.join(gf),u=r.join(gf),f=i.slice(a,s+1).join(gf),d=o.slice(a,l+1).join(gf);return c.length&&u.length?c+gf+"{"+f+" → "+d+"}"+gf+u:c.length?c+gf+"{"+f+" → "+d+"}":u.length?"{"+f+" → "+d+"}"+gf+u:t+" → "+n}}function Ef(e){return`d2h-${function(e){let t,n,r,i=0;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i|=0;return i}(Cf(e)).toString().slice(-6)}`}function Bf(e){let t="file-changed";return e.isRename||e.isCopy?t="file-renamed":e.isNew?t="file-added":e.isDeleted?t="file-deleted":e.newName!==e.oldName&&(t="file-renamed"),t}function Sf(e,t,n,r={}){const{matching:i,maxLineLengthHighlight:o,matchWordsThreshold:a,diffStyle:s}=Object.assign(Object.assign({},pf),r),l=xf(e,n,!1),c=xf(t,n,!1);if(l.content.length>o||c.content.length>o)return{oldLine:{prefix:l.prefix,content:If(l.content)},newLine:{prefix:c.prefix,content:If(c.content)}};const u="char"===s?(f=l.content,d=c.content,lf.diff(f,d,h)):function(e,t,n){return uf.diff(e,t,n)}(l.content,c.content);var f,d,h;const p=[];if("word"===s&&"words"===i){const e=u.filter(e=>e.removed),t=u.filter(e=>e.added);yf(t,e).forEach(e=>{if(1===e[0].length&&1===e[1].length){mf(e[0][0],e[1][0])<a&&(p.push(e[0][0]),p.push(e[1][0]))}})}const g=u.reduce((e,t)=>{const n=t.added?"ins":t.removed?"del":null,r=p.indexOf(t)>-1?' class="d2h-change"':"",i=If(t.value);return null!==n?`${e}<${n}${r}>${i}</${n}>`:`${e}${i}`},"");return{oldLine:{prefix:l.prefix,content:(m=g,m.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,""))},newLine:{prefix:c.prefix,content:Af(g)}};var m}const kf="file-summary",Ff={colorScheme:pf.colorScheme};class Df{constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Ff),t)}render(e){const t=e.map(e=>this.hoganUtils.render(kf,"line",{fileHtmlId:Ef(e),oldName:e.oldName,newName:e.newName,fileName:Cf(e),deletedLines:"-"+e.deletedLines,addedLines:"+"+e.addedLines},{fileIcon:this.hoganUtils.template("icon",Bf(e))})).join("\n");return this.hoganUtils.render(kf,"wrapper",{colorScheme:wf(this.config.colorScheme),filesNumber:e.length,files:t})}}const Nf=Object.assign(Object.assign({},pf),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Mf="generic",Tf="line-by-line";class Qf{constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Nf),t)}render(e){const t=e.map(e=>{let t;return t=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,t)}).join("\n");return this.hoganUtils.render(Mf,"wrapper",{colorScheme:wf(this.config.colorScheme),content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const n=this.hoganUtils.template(Tf,"file-diff"),r=this.hoganUtils.template(Mf,"file-path"),i=this.hoganUtils.template("icon","file"),o=this.hoganUtils.template("tag",Bf(e));return n.render({file:e,fileHtmlId:Ef(e),diffs:t,filePath:r.render({fileDiffName:Cf(e)},{fileIcon:i,fileTag:o})})}generateEmptyDiff(){return this.hoganUtils.render(Mf,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:hf})}generateFileHtml(e){const t=df(ff(t=>xf(t.content,e.isCombined).content));return e.blocks.map(n=>{let r=this.hoganUtils.render(Mf,"block-header",{CSSLineClass:hf,blockHeader:e.isTooBig?n.header:If(n.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(n).forEach(([n,i,o])=>{if(i.length&&o.length&&!n.length)this.applyRematchMatching(i,o,t).map(([t,n])=>{const{left:i,right:o}=this.processChangedLines(e,e.isCombined,t,n);r+=i,r+=o});else if(n.length)n.forEach(t=>{const{prefix:n,content:i}=xf(t.content,e.isCombined);r+=this.generateSingleLineHtml(e,{type:hf.CONTEXT,prefix:n,content:i,oldNumber:t.oldNumber,newNumber:t.newNumber})});else if(i.length||o.length){const{left:t,right:n}=this.processChangedLines(e,e.isCombined,i,o);r+=t,r+=n}else console.error("Unknown state reached while processing groups of lines",n,i,o)}),r}).join("\n")}applyLineGroupping(e){const t=[];let n=[],r=[];for(let i=0;i<e.lines.length;i++){const o=e.lines[i];(o.type!==_u.INSERT&&r.length||o.type===_u.CONTEXT&&n.length>0)&&(t.push([[],n,r]),n=[],r=[]),o.type===_u.CONTEXT?t.push([[o],[],[]]):o.type===_u.INSERT&&0===n.length?t.push([[],[],[o]]):o.type===_u.INSERT&&n.length>0?r.push(o):o.type===_u.DELETE&&n.push(o)}return(n.length||r.length)&&(t.push([[],n,r]),n=[],r=[]),t}applyRematchMatching(e,t,n){const r=e.length*t.length,i=ef(e.concat(t).map(e=>e.content.length));return r<this.config.matchingMaxComparisons&&i<this.config.maxLineSizeInBlockForComparison&&("lines"===this.config.matching||"words"===this.config.matching)?n(e,t):[[e,t]]}processChangedLines(e,t,n,r){const i={right:"",left:""},o=Math.max(n.length,r.length);for(let a=0;a<o;a++){const o=n[a],s=r[a],l=void 0!==o&&void 0!==s?Sf(o.content,s.content,t,this.config):void 0,c=void 0!==o&&void 0!==o.oldNumber?Object.assign(Object.assign({},void 0!==l?{prefix:l.oldLine.prefix,content:l.oldLine.content,type:hf.DELETE_CHANGES}:Object.assign(Object.assign({},xf(o.content,t)),{type:bf(o.type)})),{oldNumber:o.oldNumber,newNumber:o.newNumber}):void 0,u=void 0!==s&&void 0!==s.newNumber?Object.assign(Object.assign({},void 0!==l?{prefix:l.newLine.prefix,content:l.newLine.content,type:hf.INSERT_CHANGES}:Object.assign(Object.assign({},xf(s.content,t)),{type:bf(s.type)})),{oldNumber:s.oldNumber,newNumber:s.newNumber}):void 0,{left:f,right:d}=this.generateLineHtml(e,c,u);i.left+=f,i.right+=d}return i}generateLineHtml(e,t,n){return{left:this.generateSingleLineHtml(e,t),right:this.generateSingleLineHtml(e,n)}}generateSingleLineHtml(e,t){if(void 0===t)return"";const n=this.hoganUtils.render(Tf,"numbers",{oldNumber:t.oldNumber||"",newNumber:t.newNumber||""});return this.hoganUtils.render(Mf,"line",{type:t.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:" "===t.prefix?" ":t.prefix,content:t.content,lineNumber:n,line:t,file:e})}}const Lf=Object.assign(Object.assign({},pf),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Rf="generic";class Uf{constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Lf),t)}render(e){const t=e.map(e=>{let t;return t=e.blocks.length?this.generateFileHtml(e):this.generateEmptyDiff(),this.makeFileDiffHtml(e,t)}).join("\n");return this.hoganUtils.render(Rf,"wrapper",{colorScheme:wf(this.config.colorScheme),content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&0===e.blocks.length)return"";const n=this.hoganUtils.template("side-by-side","file-diff"),r=this.hoganUtils.template(Rf,"file-path"),i=this.hoganUtils.template("icon","file"),o=this.hoganUtils.template("tag",Bf(e));return n.render({file:e,fileHtmlId:Ef(e),diffs:t,filePath:r.render({fileDiffName:Cf(e)},{fileIcon:i,fileTag:o})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Rf,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:hf})}}generateFileHtml(e){const t=df(ff(t=>xf(t.content,e.isCombined).content));return e.blocks.map(n=>{const r={left:this.makeHeaderHtml(n.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(n).forEach(([n,i,o])=>{if(i.length&&o.length&&!n.length)this.applyRematchMatching(i,o,t).map(([t,n])=>{const{left:i,right:o}=this.processChangedLines(e.isCombined,t,n);r.left+=i,r.right+=o});else if(n.length)n.forEach(t=>{const{prefix:n,content:i}=xf(t.content,e.isCombined),{left:o,right:a}=this.generateLineHtml({type:hf.CONTEXT,prefix:n,content:i,number:t.oldNumber},{type:hf.CONTEXT,prefix:n,content:i,number:t.newNumber});r.left+=o,r.right+=a});else if(i.length||o.length){const{left:t,right:n}=this.processChangedLines(e.isCombined,i,o);r.left+=t,r.right+=n}else console.error("Unknown state reached while processing groups of lines",n,i,o)}),r}).reduce((e,t)=>({left:e.left+t.left,right:e.right+t.right}),{left:"",right:""})}applyLineGroupping(e){const t=[];let n=[],r=[];for(let i=0;i<e.lines.length;i++){const o=e.lines[i];(o.type!==_u.INSERT&&r.length||o.type===_u.CONTEXT&&n.length>0)&&(t.push([[],n,r]),n=[],r=[]),o.type===_u.CONTEXT?t.push([[o],[],[]]):o.type===_u.INSERT&&0===n.length?t.push([[],[],[o]]):o.type===_u.INSERT&&n.length>0?r.push(o):o.type===_u.DELETE&&n.push(o)}return(n.length||r.length)&&(t.push([[],n,r]),n=[],r=[]),t}applyRematchMatching(e,t,n){const r=e.length*t.length,i=ef(e.concat(t).map(e=>e.content.length));return r<this.config.matchingMaxComparisons&&i<this.config.maxLineSizeInBlockForComparison&&("lines"===this.config.matching||"words"===this.config.matching)?n(e,t):[[e,t]]}makeHeaderHtml(e,t){return this.hoganUtils.render(Rf,"block-header",{CSSLineClass:hf,blockHeader:(null==t?void 0:t.isTooBig)?e:If(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,t,n){const r={right:"",left:""},i=Math.max(t.length,n.length);for(let o=0;o<i;o++){const i=t[o],a=n[o],s=void 0!==i&&void 0!==a?Sf(i.content,a.content,e,this.config):void 0,l=void 0!==i&&void 0!==i.oldNumber?Object.assign(Object.assign({},void 0!==s?{prefix:s.oldLine.prefix,content:s.oldLine.content,type:hf.DELETE_CHANGES}:Object.assign(Object.assign({},xf(i.content,e)),{type:bf(i.type)})),{number:i.oldNumber}):void 0,c=void 0!==a&&void 0!==a.newNumber?Object.assign(Object.assign({},void 0!==s?{prefix:s.newLine.prefix,content:s.newLine.content,type:hf.INSERT_CHANGES}:Object.assign(Object.assign({},xf(a.content,e)),{type:bf(a.type)})),{number:a.newNumber}):void 0,{left:u,right:f}=this.generateLineHtml(l,c);r.left+=u,r.right+=f}return r}generateLineHtml(e,t){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(t)}}generateSingleHtml(e){const t="d2h-code-side-linenumber",n="d2h-code-side-line";return this.hoganUtils.render(Rf,"line",{type:(null==e?void 0:e.type)||`${hf.CONTEXT} d2h-emptyplaceholder`,lineClass:void 0!==e?t:`${t} d2h-code-side-emptyplaceholder`,contentClass:void 0!==e?n:`${n} d2h-code-side-emptyplaceholder`,prefix:" "===(null==e?void 0:e.prefix)?" ":null==e?void 0:e.prefix,content:null==e?void 0:e.content,lineNumber:null==e?void 0:e.number})}}var Hf={};!function(e){!function(e){var t=/\S/,n=/\"/g,r=/\n/g,i=/\r/g,o=/\\/g,a=/\u2028/,s=/\u2029/;function l(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function c(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function u(e,t,n){if(t.charAt(n)!=e.charAt(0))return!1;for(var r=1,i=e.length;r<i;r++)if(t.charAt(n+r)!=e.charAt(r))return!1;return!0}e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(n,r){var i=n.length,o=0,a=null,s=null,f="",d=[],h=!1,p=0,g=0,m="{{",y="}}";function v(){f.length>0&&(d.push({tag:"_t",text:new String(f)}),f="")}function A(n,r){if(v(),n&&function(){for(var n=!0,r=g;r<d.length;r++)if(!(n=e.tags[d[r].tag]<e.tags._v||"_t"==d[r].tag&&null===d[r].text.match(t)))return!1;return n}())for(var i,o=g;o<d.length;o++)d[o].text&&((i=d[o+1])&&">"==i.tag&&(i.indent=d[o].text.toString()),d.splice(o,1));else r||d.push({tag:"\n"});h=!1,g=d.length}function b(e,t){var n="="+y,r=e.indexOf(n,t),i=c(e.substring(e.indexOf("=",t)+1,r)).split(" ");return m=i[0],y=i[i.length-1],r+n.length-1}for(r&&(r=r.split(" "),m=r[0],y=r[1]),p=0;p<i;p++)0==o?u(m,n,p)?(--p,v(),o=1):"\n"==n.charAt(p)?A(h):f+=n.charAt(p):1==o?(p+=m.length-1,"="==(a=(s=e.tags[n.charAt(p+1)])?n.charAt(p+1):"_v")?(p=b(n,p),o=0):(s&&p++,o=2),h=p):u(y,n,p)?(d.push({tag:a,n:c(f),otag:m,ctag:y,i:"/"==a?h-m.length:p+y.length}),f="",p+=y.length-1,o=0,"{"==a&&("}}"==y?p++:l(d[d.length-1]))):f+=n.charAt(p);return A(h,!0),d};var f={_t:!0,"\n":!0,$:!0,"/":!0};function d(t,n,r,i){var o,a=[],s=null,l=null;for(o=r[r.length-1];t.length>0;){if(l=t.shift(),o&&"<"==o.tag&&!(l.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[l.tag]<=e.tags.$||h(l,i))r.push(l),l.nodes=d(t,l.tag,r,i);else{if("/"==l.tag){if(0===r.length)throw new Error("Closing tag without opener: /"+l.n);if(s=r.pop(),l.n!=s.n&&!p(l.n,s.n,i))throw new Error("Nesting error: "+s.n+" vs. "+l.n);return s.end=l.i,a}"\n"==l.tag&&(l.last=0==t.length||"\n"==t[0].tag)}a.push(l)}if(r.length>0)throw new Error("missing closing tag: "+r.pop().n);return a}function h(e,t){for(var n=0,r=t.length;n<r;n++)if(t[n].o==e.n)return e.tag="#",!0}function p(e,t,n){for(var r=0,i=n.length;r<i;r++)if(n[r].c==e&&n[r].o==t)return!0}function g(e){var t=[];for(var n in e.partials)t.push('"'+y(n)+'":{name:"'+y(e.partials[n].name)+'", '+g(e.partials[n])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var n in e)t.push('"'+y(n)+'": function(c,p,t,i) {'+e[n]+"}");return"{ "+t.join(",")+" }"}(e.subs)}e.stringify=function(t,n,r){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+g(t)+"}"};var m=0;function y(e){return e.replace(o,"\\\\").replace(n,'\\"').replace(r,"\\n").replace(i,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function v(e){return~e.indexOf(".")?"d":"f"}function A(e,t){var n="<"+(t.prefix||"")+e.n+m++;return t.partials[n]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+y(n)+'",c,p,"'+(e.indent||"")+'"));',n}function b(e,t){t.code+="t.b(t.t(t."+v(e.n)+'("'+y(e.n)+'",c,p,0)));'}function w(e){return"t.b("+e+");"}e.generate=function(t,n,r){m=0;var i={code:"",subs:{},partials:{}};return e.walk(t,i),r.asString?this.stringify(i,n,r):this.makeTemplate(i,n,r)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,n){var r=this.makePartials(e);return r.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(r,t,this,n)},e.makePartials=function(e){var t,n={subs:{},partials:e.partials,name:e.name};for(t in n.partials)n.partials[t]=this.makePartials(n.partials[t]);for(t in e.subs)n.subs[t]=new Function("c","p","t","i",e.subs[t]);return n},e.codegen={"#":function(t,n){n.code+="if(t.s(t."+v(t.n)+'("'+y(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,n),n.code+="});c.pop();}"},"^":function(t,n){n.code+="if(!t.s(t."+v(t.n)+'("'+y(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,n),n.code+="};"},">":A,"<":function(t,n){var r={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,r);var i=n.partials[A(t,n)];i.subs=r.subs,i.partials=r.partials},$:function(t,n){var r={subs:{},code:"",partials:n.partials,prefix:t.n};e.walk(t.nodes,r),n.subs[t.n]=r.code,n.inPartial||(n.code+='t.sub("'+y(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=w('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+v(e.n)+'("'+y(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=w('"'+y(e.text)+'"')},"{":b,"&":b},e.walk=function(t,n){for(var r,i=0,o=t.length;i<o;i++)(r=e.codegen[t[i].tag])&&r(t[i],n);return n},e.parse=function(e,t,n){return d(e,0,[],(n=n||{}).sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,n){n=n||{};var r=e.cacheKey(t,n),i=this.cache[r];if(i){var o=i.partials;for(var a in o)delete o[a].instance;return i}return i=this.generate(this.parse(this.scan(t,n.delimiters),t,n),t,n),this.cache[r]=i}}(e)}(Hf);var Of={};!function(e){!function(e){function t(e,t,n){var r;return t&&"object"==typeof t&&(void 0!==t[e]?r=t[e]:n&&t.get&&"function"==typeof t.get&&(r=t.get(e))),r}e.Template=function(e,t,n,r){e=e||{},this.r=e.code||this.r,this.c=n,this.options=r||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,n){return""},v:function(e){return e=l(e),s.test(e)?e.replace(n,"&").replace(r,"<").replace(i,">").replace(o,"'").replace(a,"""):e},t:l,render:function(e,t,n){return this.ri([e],t||{},n)},ri:function(e,t,n){return this.r(e,t,n)},ep:function(e,t){var n=this.partials[e],r=t[n.name];if(n.instance&&n.base==r)return n.instance;if("string"==typeof r){if(!this.c)throw new Error("No compiler available.");r=this.c.compile(r,this.options)}if(!r)return null;if(this.partials[e].base=r,n.subs){for(key in t.stackText||(t.stackText={}),n.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);r=function(e,t,n,r,i,o){function a(){}function s(){}var l;a.prototype=e,s.prototype=e.subs;var c=new a;for(l in c.subs=new s,c.subsText={},c.buf="",r=r||{},c.stackSubs=r,c.subsText=o,t)r[l]||(r[l]=t[l]);for(l in r)c.subs[l]=r[l];for(l in i=i||{},c.stackPartials=i,n)i[l]||(i[l]=n[l]);for(l in i)c.partials[l]=i[l];return c}(r,n.subs,n.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=r,r},rp:function(e,t,n,r){var i=this.ep(e,n);return i?i.ri(t,n,r):""},rs:function(e,t,n){var r=e[e.length-1];if(c(r))for(var i=0;i<r.length;i++)e.push(r[i]),n(e,t,this),e.pop();else n(e,t,this)},s:function(e,t,n,r,i,o,a){var s;return(!c(e)||0!==e.length)&&("function"==typeof e&&(e=this.ms(e,t,n,r,i,o,a)),s=!!e,!r&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,n,r,i){var o,a=e.split("."),s=this.f(a[0],n,r,i),l=this.options.modelGet,u=null;if("."===e&&c(n[n.length-2]))s=n[n.length-1];else for(var f=1;f<a.length;f++)void 0!==(o=t(a[f],s,l))?(u=s,s=o):s="";return!(i&&!s)&&(i||"function"!=typeof s||(n.push(u),s=this.mv(s,n,r),n.pop()),s)},f:function(e,n,r,i){for(var o=!1,a=!1,s=this.options.modelGet,l=n.length-1;l>=0;l--)if(void 0!==(o=t(e,n[l],s))){a=!0;break}return a?(i||"function"!=typeof o||(o=this.mv(o,n,r)),o):!i&&""},ls:function(e,t,n,r,i,o){var a=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(l(e.call(t,i,n)),t,r)),this.options.delimiters=a,!1},ct:function(e,t,n){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,n)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,n,r,i,o,a){var s,l=t[t.length-1],c=e.call(l);return"function"==typeof c?!!r||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,l,t,n,s.substring(i,o),a)):c},mv:function(e,t,n){var r=t[t.length-1],i=e.call(r);return"function"==typeof i?this.ct(l(i.call(r)),r,n):i},sub:function(e,t,n,r){var i=this.subs[e];i&&(this.activeSub=e,i(t,n,this,r),this.activeSub=!1)}};var n=/&/g,r=/</g,i=/>/g,o=/\'/g,a=/\"/g,s=/[&<>\"\']/;function l(e){return String(null==e?"":e)}var c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(e)}(Of);var qf=Hf;qf.Template=Of.Template,qf.template=qf.Template;var Pf=qf;const $f={};$f["file-summary-line"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<li class="d2h-file-list-line">'),r.b("\n"+n),r.b(' <span class="d2h-file-name-wrapper">'),r.b("\n"+n),r.b(r.rp("<fileIcon0",e,t," ")),r.b(' <a href="#'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-name">'),r.b(r.v(r.f("fileName",e,t,0))),r.b("</a>"),r.b("\n"+n),r.b(' <span class="d2h-file-stats">'),r.b("\n"+n),r.b(' <span class="d2h-lines-added">'),r.b(r.v(r.f("addedLines",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(' <span class="d2h-lines-deleted">'),r.b(r.v(r.f("deletedLines",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b(" </span>"),r.b("\n"+n),r.b("</li>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}}),$f["file-summary-wrapper"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-file-list-wrapper '),r.b(r.v(r.f("colorScheme",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-list-header">'),r.b("\n"+n),r.b(' <span class="d2h-file-list-title">Files changed ('),r.b(r.v(r.f("filesNumber",e,t,0))),r.b(")</span>"),r.b("\n"+n),r.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),r.b("\n"+n),r.b(' <a class="d2h-file-switch d2h-show">show</a>'),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <ol class="d2h-file-list">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("files",e,t,0))),r.b("\n"+n),r.b(" </ol>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["generic-block-header"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",e,t,0))),r.b(" "),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('"></td>'),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.s(r.f("blockHeader",e,t,1),e,t,0,156,173,"{{ }}")&&(r.rs(e,t,function(e,t,n){n.b(n.t(n.f("blockHeader",e,t,0)))}),e.pop()),r.s(r.f("blockHeader",e,t,1),e,t,1,0,0,"")||r.b(" "),r.b("</div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),$f["generic-empty-diff"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.d("CSSLineClass.INFO",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" File without changes"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),$f["generic-file-path"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-file-name-wrapper">'),r.b("\n"+n),r.b(r.rp("<fileIcon0",e,t," ")),r.b(' <span class="d2h-file-name">'),r.b(r.v(r.f("fileDiffName",e,t,0))),r.b("</span>"),r.b("\n"+n),r.b(r.rp("<fileTag1",e,t," ")),r.b("</span>"),r.b("\n"+n),r.b('<label class="d2h-file-collapse">'),r.b("\n"+n),r.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),r.b("\n"+n),r.b(" Viewed"),r.b("\n"+n),r.b("</label>"),r.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}}),$f["generic-line"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b("<tr>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("lineClass",e,t,0))),r.b(" "),r.b(r.v(r.f("type",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("lineNumber",e,t,0))),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b(' <td class="'),r.b(r.v(r.f("type",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="'),r.b(r.v(r.f("contentClass",e,t,0))),r.b('">'),r.b("\n"+n),r.s(r.f("prefix",e,t,1),e,t,0,162,238,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <span class="d2h-code-line-prefix">'),r.b(r.t(r.f("prefix",e,t,0))),r.b("</span>"),r.b("\n"+n)}),e.pop()),r.s(r.f("prefix",e,t,1),e,t,1,0,0,"")||(r.b(' <span class="d2h-code-line-prefix"> </span>'),r.b("\n"+n)),r.s(r.f("content",e,t,1),e,t,0,371,445,"{{ }}")&&(r.rs(e,t,function(e,t,r){r.b(' <span class="d2h-code-line-ctn">'),r.b(r.t(r.f("content",e,t,0))),r.b("</span>"),r.b("\n"+n)}),e.pop()),r.s(r.f("content",e,t,1),e,t,1,0,0,"")||(r.b(' <span class="d2h-code-line-ctn"><br></span>'),r.b("\n"+n)),r.b(" </div>"),r.b("\n"+n),r.b(" </td>"),r.b("\n"+n),r.b("</tr>"),r.fl()},partials:{},subs:{}}),$f["generic-wrapper"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="d2h-wrapper '),r.b(r.v(r.f("colorScheme",e,t,0))),r.b('">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("content",e,t,0))),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["icon-file-added"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),r.b("\n"+n),r.b(' width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["icon-file-changed"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["icon-file-deleted"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["icon-file-renamed"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),r.b("\n"+n),r.b(' viewBox="0 0 14 16" width="14">'),r.b("\n"+n),r.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["icon-file"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),r.b("\n"+n),r.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),r.b("\n"+n),r.b("</svg>"),r.fl()},partials:{},subs:{}}),$f["line-by-line-file-diff"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-header">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("filePath",e,t,0))),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-file-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("diffs",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["line-by-line-numbers"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div class="line-num1">'),r.b(r.v(r.f("oldNumber",e,t,0))),r.b("</div>"),r.b("\n"+n),r.b('<div class="line-num2">'),r.b(r.v(r.f("newNumber",e,t,0))),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["side-by-side-file-diff"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<div id="'),r.b(r.v(r.f("fileHtmlId",e,t,0))),r.b('" class="d2h-file-wrapper" data-lang="'),r.b(r.v(r.d("file.language",e,t,0))),r.b('">'),r.b("\n"+n),r.b(' <div class="d2h-file-header">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.f("filePath",e,t,0))),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-files-diff">'),r.b("\n"+n),r.b(' <div class="d2h-file-side-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.d("diffs.left",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(' <div class="d2h-file-side-diff">'),r.b("\n"+n),r.b(' <div class="d2h-code-wrapper">'),r.b("\n"+n),r.b(' <table class="d2h-diff-table">'),r.b("\n"+n),r.b(' <tbody class="d2h-diff-tbody">'),r.b("\n"+n),r.b(" "),r.b(r.t(r.d("diffs.right",e,t,0))),r.b("\n"+n),r.b(" </tbody>"),r.b("\n"+n),r.b(" </table>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b(" </div>"),r.b("\n"+n),r.b("</div>"),r.fl()},partials:{},subs:{}}),$f["tag-file-added"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),r.fl()},partials:{},subs:{}}),$f["tag-file-changed"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),r.fl()},partials:{},subs:{}}),$f["tag-file-deleted"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),r.fl()},partials:{},subs:{}}),$f["tag-file-renamed"]=new Pf.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),r.fl()},partials:{},subs:{}});class zf{constructor({compiledTemplates:e={},rawTemplates:t={}}){const n=Object.entries(t).reduce((e,[t,n])=>{const r=Pf.compile(n,{asString:!1});return Object.assign(Object.assign({},e),{[t]:r})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},$f),e),n)}static compile(e){return Pf.compile(e,{asString:!1})}render(e,t,n,r,i){const o=this.templateKey(e,t);try{return this.preCompiledTemplates[o].render(n,r,i)}catch(e){throw new Error(`Could not find template to render '${o}'`)}}template(e,t){return this.preCompiledTemplates[this.templateKey(e,t)]}templateKey(e,t){return`${e}-${t}`}}const jf=Object.assign(Object.assign(Object.assign({},Nf),Lf),{outputFormat:"line-by-line",drawFileList:!0});var Vf=Object.freeze({__proto__:null,defaultDiff2HtmlConfig:jf,html:function(e,t={}){const n=Object.assign(Object.assign({},jf),t),r="string"==typeof e?af(e,n):e,i=new zf(n),{colorScheme:o}=n,a={colorScheme:o};return(n.drawFileList?new Df(i,a).render(r):"")+("side-by-side"===n.outputFormat?new Uf(i,n).render(r):new Qf(i,n).render(r))},parse:function(e,t={}){return af(e,Object.assign(Object.assign({},jf),t))}});function Yf(e=Vf){let t="html";if(Oi(be(e,t)))return e;if(Oi(be(e,["default",t])))return e.default;let n=tc(),r=be(n,"Diff2Html.default",null),i=be(n,"Diff2Html",null);if(Oi(be(r,t)))return r;if(Oi(be(i,t)))return i;throw console.log("Diff2Html",e,"g.Diff2Html",be(n,"Diff2Html")),new Error("invalid Diff2Html, g.Diff2Html, g.Diff2Html.default, use script for import")}var Wf=Object.defineProperty,Gf=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},Jf=(e,t)=>{for(var n in t)Wf(e,n,{get:t[n],enumerable:!0})};var _f,Xf,Kf=Gf(()=>{_f=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let e=this.keys().next().value;void 0!==e&&this.delete(e)}return super.set(e,t)}},Xf={image:new _f(100),background:new _f(100),resource:new _f(150),defaultStyle:new _f(30),baseStyle:new _f(50),compress:new _f(50),computedStyle:new WeakMap,measureHints:new WeakMap,burstAdvice:new WeakMap,warnedReconcile:!1,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function Zf(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith("#")?null:n}function ed(e,t=1){let n=e.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let e of n[1].split(",")){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)continue;let n=e.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(n&&!nd.test(n[1].trim()))continue;let i=e.match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)/i),o=1;if(i){let e=parseFloat(i[1]);o=/dpi/i.test(i[2])?e/96:e}r.push({url:t[2].trim(),dppx:o})}return r.length?(r.sort((e,t)=>e.dppx-t.dppx),(r.find(e=>e.dppx>=t)||r[r.length-1]).url):null}function td(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}var nd,rd=Gf(()=>{nd=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i});function id(e,t){if(!t||function(e){return/^data:|^blob:|^about:blank$/i.test(e)}(e)||function(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(r||".",n),o=new URL(e,n);if(o.origin===i.origin)return!0;let a=o.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}(e,t))return!1;try{let t=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,t);return!(typeof location<"u")||n.origin!==location.origin}catch{return!!t}}function od(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(e)})}async function ad(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,i=t.useProxy||"",o=t.errorTTL??8e3,a=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if("text"===n)return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if("dataURL"===n)return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,t="",r=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(t)?atob(r):decodeURIComponent(r),o=new Uint8Array([...i].map(e=>e.charCodeAt(0))),a=new Blob([o],{type:(t||"").split(";")[0]||""});return{ok:!0,data:a,status:200,url:e,fromCache:!1,mime:a.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let t=await fetch(e);if(!t.ok)return{ok:!1,data:null,status:t.status,url:e,fromCache:!1,reason:"http_error"};let r=await t.blob(),i=r.type||t.headers.get("content-type")||"";return"dataURL"===n?{ok:!0,data:await od(r),status:t.status,url:e,fromCache:!1,mime:i}:"text"===n?{ok:!0,data:await r.text(),status:t.status,url:e,fromCache:!1,mime:i}:{ok:!0,data:r,status:t.status,url:e,fromCache:!1,mime:i}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return"dataURL"===n?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:"text"===n?"":new Blob([]),status:200,url:e,fromCache:!1};let l=function(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}(e,{as:n,timeout:r,useProxy:i,errorTTL:o}),c=cd.get(l);if(c&&c.until>Date.now())return{...c.result,fromCache:!0};c&&cd.delete(l);let u=ld.get(l);if(u)return u;let f=id(e,i)?function(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",td(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${td(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}(e,i):e,d=t.credentials;if(!d)try{let t=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,t);d=typeof location<"u"&&n.origin===location.origin?"include":"omit"}catch{d="omit"}let h=new AbortController,p=setTimeout(()=>h.abort("timeout"),r),g=(async()=>{try{let r=await fetch(f,{signal:h.signal,credentials:d,headers:a});if(!r.ok){let i={ok:!1,data:null,status:r.status,url:f,fromCache:!1,reason:"http_error"};if(o>0&&cd.set(l,{until:Date.now()+o,result:i}),!s){let t=`${r.status} ${r.statusText||""}`.trim();sd.warnOnce(`http:${r.status}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${t} while fetching ${n} ${e}`)}return t.onError&&t.onError(i),i}if("text"===n)return{ok:!0,data:await r.text(),status:r.status,url:f,fromCache:!1};let i=await r.blob(),c=i.type||r.headers.get("content-type")||"";return"dataURL"===n?{ok:!0,data:await od(i),status:r.status,url:f,fromCache:!1,mime:c}:{ok:!0,data:i,status:r.status,url:f,fromCache:!1,mime:c}}catch(i){let a=i&&"object"==typeof i&&"name"in i&&"AbortError"===i.name?String(i.message||"").includes("timeout")?"timeout":"abort":"network",c={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:a};if(!/^blob:/i.test(e)&&o>0&&cd.set(l,{until:Date.now()+o,result:c}),!s){let t=`${a}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,i="timeout"===a?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:"abort"===a?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;sd.errorOnce(t,i)}return t.onError&&t.onError(c),c}finally{clearTimeout(p),ld.delete(l)}})();return ld.set(l,g),g}var sd,ld,cd,ud=Gf(()=>{rd(),sd=function(e="[snapDOM]",{ttlMs:t=3e5,maxEntries:n=12}={}){let r=new Map,i=0;function o(o,a,s){if(i>=n)return;let l=Date.now();(r.get(a)||0)>l||(r.set(a,l+t),i++,"warn"===o&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(e,t){o("warn",e,t)},errorOnce(e,t){o("error",e,t)},reset(){r.clear(),i=0}}}("[snapDOM]",{ttlMs:18e4,maxEntries:10}),ld=new Map,cd=new Map});async function fd(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||"none"===e.trim())return e;let n=ed(e,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Zf(e);if(!n)return e;let r=function(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,n).href}catch{return e}}(n),i=td(r),o=(t.useProxy||"")+"|"+i;if(Xf.background.has(o)){let e=Xf.background.get(o);return e?`url("${e}")`:"none"}try{let e=await ad(i,{as:"dataURL",useProxy:t.useProxy});return e.ok?(Xf.background.set(o,e.data),`url("${e.data}")`):(Xf.background.set(o,null),"none")}catch{return Xf.background.set(o,null),"none"}}var dd=Gf(()=>{Kf(),rd(),ud()});function hd(e){if(e=String(e).toLowerCase(),wd.has(e)){let t={};return Xf.defaultStyle.set(e,t),t}if(Xf.defaultStyle.has(e))return Xf.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let n=document.createElement(e);n.style.all="initial",t.appendChild(n);let r=getComputedStyle(n),i={};for(let e of r){if(pd(e))continue;let t=r.getPropertyValue(e);i[e]=t}return t.removeChild(n),Xf.defaultStyle.set(e,i),i}function pd(e){let t=Ed.get(e);if(void 0===t){let n=String(e).toLowerCase();t=Cd.has(n)||xd.test(n)||Id.test(n),Ed.set(e,t)}return t}function gd(e,t){return!kd.has(e)&&("inline"===t||Bd.has(e)||Sd.has(e))}function md(e,t,n=!0,r=!1){if(t=String(t||"").toLowerCase(),wd.has(t))return"";let i=[],o=hd(t),a=(e.display||"").toLowerCase(),s="inline"===a,l=gd(t,a),c=e["text-wrap-mode"]||e["white-space"]||"",u="nowrap"===c||"pre"===c,f=l&&n&&!(l&&n&&!s&&u),d=!1;for(let t in e){if(pd(t))continue;let n=e[t];if(f){if(Fd.has(t))continue;if(Dd.has(t)){n&&n!==o[t]&&(i.push(`${t}:${n}`),"auto"!==n&&(d=!0));continue}}if(n&&n!==o[t]){if(!u&&("width"===t||"inline-size"===t)&&n.endsWith("px")&&n.includes(".")){let e=parseFloat(n);if(Number.isFinite(e)){i.push(`${t}:${(e+Nd).toFixed(3)}px`);continue}}i.push(`${t}:${n}`)}}if(f&&!s&&!r&&!d){let t=e.width;t&&"auto"!==t&&t!==o.width&&i.push(`min-width:${t}`)}return i.sort(),i.join(";")}function yd(e,t=null){let n=()=>{let e={length:0,getPropertyValue:()=>"",item:()=>""};return e[Symbol.iterator]=function*(){},e};if(1!==e?.nodeType){let r=typeof window<"u"?window:null;if(r&&"function"==typeof r.getComputedStyle)try{return r.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=Xf.computedStyle.get(e);r||(r=new Map,Xf.computedStyle.set(e,r));let i=r.get(t);if(!i){let o=function(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let n=t.defaultView;if(n&&"function"==typeof n.getComputedStyle)return n;if(typeof window<"u"&&window.frames)for(let e=0;e<window.frames.length;e++)try{if(window.frames[e]?.document===t)return window.frames[e]}catch{}}catch{}return typeof window<"u"?window:null}(e),a=null;try{a=o&&"function"==typeof o.getComputedStyle?o.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&"function"==typeof window.getComputedStyle)try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}i=a||n(),r.set(t,i)}return i}function vd(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);for(let e of Td){let n=t[`border-${e}-style`],r=t[`border-${e}-width`];("none"===n||"hidden"===n||"0px"===r)&&(delete t[`border-${e}-style`],delete t[`border-${e}-width`],delete t[`border-${e}-color`])}return t}function Ad(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o&&n++,")"===o&&n--,","===o&&0===n&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var bd,wd,Id,xd,Cd,Ed,Bd,Sd,kd,Fd,Dd,Nd,Md,Td,Qd=Gf(()=>{Kf(),bd=new Set(["meta","script","noscript","title","link","template"]),wd=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","symbol","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Id=/(?:^|-)(animation|transition)(?:-|$)/i,xd=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Cd=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom","stroke-color"]),Ed=new Map,Bd=new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]),Sd=new Set(["table","thead","tbody","tfoot","tr","td","th"]),kd=new Set(["img","video","canvas","svg","iframe","embed","object","input","textarea","select"]),Fd=new Set(["width","max-width","inline-size","max-inline-size"]),Dd=new Set(["min-width","min-inline-size"]),Nd=.001,Md=new Set(["inline-block","inline-flex","inline-grid","inline-table","inline-flow-root","table"]),Td=["top","right","bottom","left"]});function Ld(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Rd(e=1e3){return"function"!=typeof requestAnimationFrame||typeof document<"u"&&"hidden"===document.visibilityState?Promise.resolve():new Promise(t=>{let n=!1,r=()=>{n||(n=!0,t())};try{requestAnimationFrame(r)}catch{return void r()}setTimeout(r,e)})}function Ud(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),n=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),r=/applewebkit/i.test(e),i=/mobile/i.test(e),o=!/safari/i.test(e),a=r&&i&&o,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),l=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),c=/ipad|iphone|ipod/.test(t)&&r;return n||a||s||l||c}var Hd=Gf(()=>{});function Od(e,t,n){let r=e&&"object"==typeof e&&(e.options||e);r&&r.debug&&(void 0!==n?console.warn("[snapdom]",t,n):console.warn("[snapdom]",t))}var qd=Gf(()=>{}),Pd=Gf(()=>{dd(),Qd(),Hd(),rd(),qd()}),$d={};function zd(e){return"string"==typeof e&&/^data:image\/svg\+xml/i.test(e)}function jd(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function Vd(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Yd(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o&&r++,")"===o&&(r=Math.max(0,r-1)),";"===o&&0===r?(t.push(n),n=""):n+=o}return n.trim()&&t.push(n),t.map(e=>e.trim()).filter(Boolean)}function Wd(e){let t=Yd(e),n=null,r=null,i=null,o=[];for(let e of t){let t=e.indexOf(":");if(t<0)continue;let a=e.slice(0,t).trim().toLowerCase(),s=e.slice(t+1).trim();"box-shadow"===a?i=s:"filter"===a?n=s:"-webkit-filter"===a?r=s:o.push([a,s])}if(i){let e=function(e){let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o&&r++,")"===o&&(r=Math.max(0,r-1)),","===o&&0===r?(t.push(n.trim()),n=""):n+=o}n.trim()&&t.push(n.trim());let i=[];for(let e of t){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(?:\.\d+)?px/gi)||[],[n="0px",r="0px",o="0px"]=t;o=parseFloat(o)/2+"px";let a=e.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/gi,"").trim().replace(/\s{2,}/g," "),s=!!a&&","!==a;i.push(`drop-shadow(${n} ${r} ${o}${s?` ${a}`:""})`)}return i.join(" ")}(i);e&&(n=n?`${n} ${e}`:e,r=r?`${r} ${e}`:e)}let a=[...o];return n&&a.push(["filter",n]),r&&a.push(["-webkit-filter",r]),a.map(([e,t])=>`${e}:${t}`).join(";")}function Gd(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,function(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,n)=>`${t}{${Wd(n)}}`)}(t))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,n)=>`style=${t}${Wd(n)}${t}`)}function Jd(e,t){let n=e=>Yd(e).map(e=>{let n=e.indexOf(":");if(n<0)return e;let r=e.slice(0,n).trim().toLowerCase();return"text-shadow"===r||t&&"box-shadow"===r?`${r}:${function(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o?n++:")"===o?n=Math.max(0,n-1):","===o&&0===n&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t.map(e=>{let t=0,n=0,r="",i=0;for(;i<e.length;){let o=e[i];if("("===o?t++:")"===o&&(t=Math.max(0,t-1)),0===t&&(0===i||" "===e[i-1])){let t=/^-?\d*\.?\d+px/.exec(e.slice(i));if(t){n++,r+=2===n?-parseFloat(t[0])+"px":t[0],i+=t[0].length;continue}}r+=o,i++}return r}).join(",")}(e.slice(n+1))}`:e}).join(";");return e=(e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,t.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,r)=>`${t}{${n(r)}}`)))).replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,r)=>`style=${t}${n(r)}${t}`)}async function _d(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:n}=await(eh||(eh=(async()=>{try{let e='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="20"><foreignObject width="8" height="20"><div xmlns="http://www.w3.org/1999/xhtml" style="width:4px;height:4px;margin-top:8px;background:#000;box-shadow:0 8px 0 0 #000"></div></foreignObject></svg>',t=new Image;t.decoding="sync",t.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,await t.decode();let n=document.createElement("canvas");n.width=8,n.height=20;let r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(t,0,0);let i=r.getImageData(2,18,1,1).data[3]>128,o=r.getImageData(2,2,1,1).data[3]>128;return{native:i||o,flippedY:o&&!i}}catch{return{native:!1,flippedY:!1}}})(),eh));try{let r=e;return t||(r=Gd(r)),n&&(r=Jd(r,t)),{svg:r,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}async function Xd(e,t){let{width:n,height:r,scale:i=1,dpr:o=1,meta:a={},backgroundColor:s,crop:l=null}=t,c=e,u=!1,f=!1;if(l&&!zd(e))throw new RangeError("[snapdom] canvas crop requires an SVG capture payload");if(zd(e)){let t=(function(e){let t=e.indexOf(",");if(t<0)return"";let n=e.slice(t+1,t+1201).replace(/%[0-9A-Fa-f]?$/,"");try{return decodeURIComponent(n)}catch{return""}}(e).match(/<svg\b[^>]*>/i)||[])[0]||"",n=parseFloat((t.match(/\bwidth="([\d.]+)/i)||[])[1]),r=parseFloat((t.match(/\bheight="([\d.]+)/i)||[])[1]),i=Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0&&Math.min(1,Kd/n,Kd/r,Math.sqrt(Zd/(n*r)))<1;if(l||i||Ud())try{let t=jd(e);if(l&&(t=function(e,t){let n=["x","y","width","height"].map(e=>Number(t?.[e]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw new RangeError("[snapdom] canvas crop requires finite x/y and positive width/height");let r=e.match(/<svg\b[^>]*>/i);if(!r)throw new Error("[snapdom] cannot crop a non-SVG capture");let i=r[0],o=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],a=String(o||"").trim().split(/[\s,]+/).map(Number);if(4!==a.length||!a.every(Number.isFinite)||a[2]<=0||a[3]<=0)throw new Error("[snapdom] cannot crop an SVG without a finite viewBox");let[s,l,c,u]=a,f=Math.max(s,n[0]),d=Math.max(l,n[1]),h=Math.min(s+c,n[0]+n[2]),p=Math.min(l+u,n[1]+n[3]);if(!(h>f&&p>d))throw new RangeError("[snapdom] canvas crop does not intersect the SVG viewBox");let g=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),m=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),y=Number.isFinite(g)&&g>0?g/c:1,v=Number.isFinite(m)&&m>0?m/u:1,A=Math.max(1,(h-f)*y),b=Math.max(1,(p-d)*v),w=i.replace(/(\bwidth=")[^"]*/i,`$1${A}`).replace(/(\bheight=")[^"]*/i,`$1${b}`).replace(/(\bviewBox=")[^"]*/i,`$1${f} ${d} ${h-f} ${p-d}`);return e.replace(i,w)}(t,l)),Ud()){let e=await _d(t);t=e.svg,u=e.naturalOnly,f=/@font-face|data:image\//i.test(t)}(i||l)&&(t=function(e){try{let t=e.match(/<svg\b[^>]*>/i);if(!t)return e;let n=t[0],r=parseFloat((n.match(/\bwidth="([\d.]+)/i)||[])[1]),i=parseFloat((n.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(r)||!Number.isFinite(i)||r<=0||i<=0)return e;let o=Math.min(1,Kd/r,Kd/i,Math.sqrt(Zd/(r*i)));if(o>=1)return e;let a=Math.max(1,Math.floor(r*o)),s=Math.max(1,Math.floor(i*o));return console.warn(`[snapDOM] Capture ${Math.round(r)}×${Math.round(i)}px exceeds the browser image-decode limit (${Kd}px/side); downscaling to ${a}×${s}px. Lower \`scale\` or set \`width\`/\`height\` to control output size.`),e.replace(n,n.replace(/(\bwidth=")[\d.]+/i,`$1${a}`).replace(/(\bheight=")[\d.]+/i,`$1${s}`))}catch{return e}}(t)),c=Vd(t)}catch(t){if(l)throw t;c=e}}let d=new Image;d.loading="eager",d.decoding="sync",d.crossOrigin="anonymous",d.src=c,await d.decode(),Ud()&&await async function(e,t){e.setAttribute("data-snapdom-internal",""),e.style.cssText="position:fixed;left:-99999px;top:-99999px;pointer-events:none",document.body.appendChild(e);try{let n=document.createElement("canvas");n.width=16,n.height=16;let r=()=>new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}),i=n.getContext("2d",{willReadFrequently:!0});if(!i)return await r(),void await r();let o=performance.now()+(t?600:150);for(;;){i.clearRect(0,0,16,16);try{i.drawImage(e,0,0,16,16)}catch{return}let t=i.getImageData(0,0,16,16).data,n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0){n=!0;break}if(n||performance.now()>o)return;await r()}}finally{try{e.remove()}catch{}}}(d,f);let h,p,g=d.naturalWidth,m=d.naturalHeight,y=l?g:Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:g,v=l?m:Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:m,A=Number.isFinite(n),b=Number.isFinite(r);if(A&&b)h=Math.max(1,n),p=Math.max(1,r);else if(A){h=n,p=v*(n/Math.max(1,y))}else if(b){p=r,h=y*(r/Math.max(1,v))}else h=g,p=m;h*=i,p*=i;let w=h*o,I=p*o,x=Math.max(w/Kd,I/Kd,Math.sqrt(w*I/Zd));x>1&&(console.warn(`[snapDOM] Output ${Math.round(w)}×${Math.round(I)}px exceeds the browser canvas limit (${Kd}px/side); downscaling. Lower \`scale\`/\`dpr\` or set \`width\`/\`height\`.`),h/=x,p/=x);let C=document.createElement("canvas");C.width=h*o,C.height=p*o,C.style.width=`${h}px`,C.style.height=`${p}px`;let E=C.getContext("2d");if(1!==o&&E.scale(o,o),s&&(E.save(),E.fillStyle=s,E.fillRect(0,0,h,p),E.restore()),!u||Math.round(h*o)===g&&Math.round(p*o)===m)E.drawImage(d,0,0,h,p);else{let e=document.createElement("canvas");e.width=g,e.height=m,e.getContext("2d").drawImage(d,0,0),E.drawImage(e,0,0,h,p)}return C}Jf($d,{decodeSvgFromDataURL:()=>jd,encodeSvgToDataURL:()=>Vd,fixSafariShadows:()=>_d,toCanvas:()=>Xd});var Kd,Zd,eh,th=Gf(()=>{Hd(),Kd=16384,Zd=268435456,eh=null}),nh={};async function rh(e,t){let n=await Xd(e,t),r=await new Promise(e=>{let r=()=>e(n.toDataURL(`image/${t.format}`,t.quality));try{n.toBlob(t=>{if(!t)return r();let n=new FileReader;n.onload=()=>e(String(n.result||"")),n.onerror=r,n.readAsDataURL(t)},`image/${t.format}`,t.quality)}catch{r()}}),i=new Image;return i.src=r,await i.decode(),i.style.width=n.width/t.dpr+"px",i.style.height=n.height/t.dpr+"px",i}Jf(nh,{rasterize:()=>rh});var ih=Gf(()=>{th()}),oh={};async function ah(e,t){let{scale:n=1,width:r,height:i,meta:o={}}=t,a=Number.isFinite(r),s=Number.isFinite(i),l=Number.isFinite(n)&&1!==n||a||s;if(Ud()&&l)try{let{svg:t}=await _d(jd(e)),l=(t.match(/<svg\b[^>]*>/i)||[])[0]||"",c=parseFloat((l.match(/\bwidth="([\d.]+)/i)||[])[1]),u=parseFloat((l.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(c)||!Number.isFinite(u))throw new Error("svg without dimensions");let f,d,h=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c,p=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:u;a&&s?(f=r,d=i):a?(f=r,d=Math.round(p*(r/Math.max(1,h)))):s?(d=i,f=Math.round(h*(i/Math.max(1,p)))):(f=Math.round(c*n),d=Math.round(u*n));let g=t.replace(/width="[^"]*"/,`width="${f}"`).replace(/height="[^"]*"/,`height="${d}"`),m=new Image;return m.decoding="sync",m.loading="eager",m.src=Vd(g),await m.decode(),m.style.width=`${f}px`,m.style.height=`${d}px`,m}catch(n){return Od(t,"safari vector toImg failed, falling back to PNG",n),rh(e,{...t,format:"png",quality:1,meta:o})}let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=e,await c.decode(),a&&s)c.style.width=`${r}px`,c.style.height=`${i}px`;else if(a){let e=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c.naturalWidth,t=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:c.naturalHeight,n=r/Math.max(1,e);c.style.width=`${r}px`,c.style.height=`${Math.round(t*n)}px`}else if(s){let e=Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:c.naturalWidth,t=Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:c.naturalHeight,n=i/Math.max(1,t);c.style.height=`${i}px`,c.style.width=`${Math.round(e*n)}px`}else{let r=Math.round(c.naturalWidth*n),i=Math.round(c.naturalHeight*n);if(c.style.width=`${r}px`,c.style.height=`${i}px`,"string"==typeof e&&e.startsWith("data:image/svg+xml"))try{let t=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${r}"`).replace(/height="[^"]*"/,`height="${i}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,c.src=e}catch(e){Od(t,"SVG width/height patch in toImg failed",e)}}return c}Jf(oh,{toImg:()=>ah,toSvg:()=>ah});var sh=Gf(()=>{Pd(),ih(),th()}),lh={};async function ch(e,t){let n=t.type;if("svg"===n){let t=decodeURIComponent(e.split(",")[1]);return new Blob([t],{type:"image/svg+xml"})}let r=await Xd(e,t);return new Promise(e=>r.toBlob(t=>e(t),`image/${n}`,t.quality))}Jf(lh,{toBlob:()=>ch});var uh=Gf(()=>{th()}),fh={};async function dh(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(e){if("AbortError"!==e.name)return!1}return!0}async function hh(e,t){let n=new Set(["png","jpeg","jpg","webp","svg"]),r=(t?.type||"").toLowerCase(),i=n.has(r)?r:"",o=(t?.format||i||"").toLowerCase(),a="jpg"===o?"jpeg":o||"png",s=t?.filename||`snapdom.${a}`,l={...t||{},format:a,type:a};l.dpr=1;let c=function(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return"iOS"===navigator.userAgentData.platform;let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}();if("svg"===a){let t=await ch(e,{...l,type:"svg"});if(c&&await dh(t,s))return;let n=URL.createObjectURL(t),r=document.createElement("a");return r.href=n,r.download=s,document.body.appendChild(r),r.click(),URL.revokeObjectURL(n),void r.remove()}let u=await Xd(e,l);if(c){let e=`image/${a}`,n=await new Promise(n=>u.toBlob(n,e,t?.quality));if(n&&await dh(n,s))return}let f=document.createElement("a");f.href=u.toDataURL(`image/${a}`,t?.quality),f.download=s,document.body.appendChild(f),f.click(),f.remove()}Jf(fh,{download:()=>hh});var ph=Gf(()=>{uh(),th(),Hd()});Pd(),Pd(),Kf();var gh=new WeakMap,mh=new Map,yh=0;function vh(){yh++,mh.size>2e3&&mh.clear()}function Ah(e){let t=e&&(1===e.nodeType?e:e.parentElement);return!!(t&&t.closest&&t.closest("[data-snapdom-sandbox],[data-snapdom-internal],[data-snapdom]"))}function bh(e){for(let t of e)if(!Ah(t.target)){if("childList"===t.type){let e=!0;for(let n of t.addedNodes)if(!Ah(n)){e=!1;break}if(e)for(let n of t.removedNodes)if(!Ah(n)){e=!1;break}if(e)continue}return!0}return!1}var wh=!1;var Ih=["mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"];function xh(e){let t=gh.get(e);if(t&&t.epoch===yh){let e=t.snapshot&&t.snapshot.__needsBgInline;if(void 0!==e)return e}return!0}function Ch(e,t,n){try{if("function"==typeof e.computedStyleMap){let t=e.computedStyleMap().get("width");if(null!=t)return!Bh(String(t).trim().toLowerCase())}}catch{}let r=e.style&&(e.style.width||e.style.inlineSize);return!(!r||Bh(String(r).trim().toLowerCase()))||!!function(e,t){let n=e.getBoundingClientRect().width-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)-(parseFloat(t.borderLeftWidth)||0)-(parseFloat(t.borderRightWidth)||0);if(!(n>0))return!1;let r=1/0,i=-1/0,o=null;for(let t=e.firstChild;t;t=t.nextSibling){let e;if(3===t.nodeType){if(!/\S/.test(t.nodeValue||"")||(o=o||document.createRange(),o.selectNode(t),e=o.getBoundingClientRect(),!e.width&&!e.height))continue}else{if(1!==t.nodeType)continue;{let n=yd(t);if("none"===n.display||"absolute"===n.position||"fixed"===n.position)continue;e=t.getBoundingClientRect()}}e.left<r&&(r=e.left),e.right>i&&(i=e.right)}return i!==-1/0&&i-r<n-.5}(e,t)&&(n||function(e,t){let n=e.parentElement;if(!n)return!1;let r=yd(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(t.marginLeft)||0)-(parseFloat(t.marginRight)||0);return i>0&&Math.abs(e.getBoundingClientRect().width-i)>.5}(e,t))}var Eh=new Set(["auto","min-content","max-content","stretch","fill-available","-webkit-fill-available"]);function Bh(e){return Eh.has(e)||e.startsWith("fit-content")}var Sh=new WeakMap;function kh(e,t=null,n={}){let r=gh.get(e),i=!(!n||!n.embedFonts),o=n&&n.excludeStyleProps||null;if(r&&r.epoch===yh&&r.embedFonts===i&&r.excludeStyleProps===o)return r.snapshot;let a=t||getComputedStyle(e),s=function(e,t={}){let n={},r=t.excludeStyleProps;for(let t=0;t<e.length;t++){let i=e[t];if(pd(i)||r&&(r instanceof RegExp&&r.test(i)||"function"==typeof r&&r(i)))continue;let o=e.getPropertyValue(i);("background-image"===i||"content"===i)&&o.includes("url(")&&!o.includes("data:")&&(o="none"),n[i]=o}let i=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let t of i)if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}let o=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let t of o)if(!n[t])try{let r=e.getPropertyValue(t);r&&(n[t]=r)}catch{}if(t.embedFonts){let t=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let r of t)if(!n[r])try{let t=e.getPropertyValue(r);t&&(n[r]=t)}catch{}}try{"hidden"===(n["content-visibility"]||e.getPropertyValue("content-visibility"))&&(n["content-visibility"]="hidden")}catch{}let a=!1;{let t=e.getPropertyValue("background-image");if(t&&"none"!==t&&(a=!0),!a){let t=e.getPropertyValue("background-color");t&&"rgba(0, 0, 0, 0)"!==t&&"transparent"!==t&&(a=!0)}if(!a)for(let t of Ih){let n=e.getPropertyValue(t);if(n&&"none"!==n){a=!0;break}}if(!a){let t=e.getPropertyValue("background");t&&/url\s*\(/i.test(t)&&(a=!0)}}Object.defineProperty(n,"__needsBgInline",{value:a,enumerable:!1});let s=parseFloat(e.getPropertyValue("border-top-width")||0)||0,l=parseFloat(e.getPropertyValue("border-right-width")||0)||0,c=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,u=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(0===s&&0===l&&0===c&&0===u){let t=(e.getPropertyValue("border-image-source")||"").trim(),r=t&&"none"!==t,i=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let e of i)delete n[e];r||(n.border="none")}return n}(a,n);return function(e,t,n){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||!["div","section","article","main","aside","header","footer","nav"].includes(r)||t.aspectRatio&&"none"!==t.aspectRatio&&"auto"!==t.aspectRatio)return;let i=t.display||"";if(i.includes("flex")||i.includes("grid"))return;let o=t.position;if("absolute"===o||"fixed"===o||"sticky"===o||"none"!==t.transform||function(e){return!!(e.backgroundImage&&"none"!==e.backgroundImage||e.backgroundColor&&"rgba(0, 0, 0, 0)"!==e.backgroundColor&&"transparent"!==e.backgroundColor||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0)||"visible"!==(e.overflowBlock||e.overflowY||"visible")}(t)||Dh(e))return;let a=t.overflowX||t.overflow||"visible",s=t.overflowY||t.overflow||"visible";if("visible"!==a||"visible"!==s)return;let l=t.clip;if(l&&"auto"!==l&&"rect(auto, auto, auto, auto)"!==l||"hidden"===t.visibility||"0"===t.opacity||!function(e){for(let t=e.firstChild;t;t=t.nextSibling)if(3===t.nodeType&&/\S/.test(t.nodeValue))return!0;let t=e.firstElementChild,n=e.lastElementChild;if(t&&"BR"===t.tagName||n&&"BR"===n.tagName)return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let e=yd(t);if("none"===e.display)continue;let n=e.position;if("absolute"!==n&&"fixed"!==n)return!0}return!1}(e))return;let c=parseFloat(t.height),u=function(e){let t=e.getBoundingClientRect().top,n=-1/0,r=null;for(let t=e.firstChild;t;t=t.nextSibling){if(3===t.nodeType){if(!/\S/.test(t.nodeValue||""))continue;r=r||document.createRange(),r.selectNode(t);let e=r.getBoundingClientRect();(e.width||e.height)&&(n=Math.max(n,e.bottom));continue}if(1!==t.nodeType)continue;let e=yd(t);if("none"===e.display)continue;let i=e.position;"absolute"===i||"fixed"===i||e.float&&"none"!==e.float||(n=Math.max(n,t.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-t}(e);Number.isFinite(c)&&Number.isFinite(u)&&Math.abs(c-u)>2||(delete n.height,delete n["block-size"])}(e,a,s),gh.set(e,{epoch:yh,snapshot:s,embedFonts:i,excludeStyleProps:o}),s}async function Fh(e,t,n,r){if("STYLE"===e.tagName)return;let i=function(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:mh,defaultStyle:Xf.defaultStyle,baseStyle:Xf.baseStyle,image:Xf.image,resource:Xf.resource,background:Xf.background,font:Xf.font},options:t||{}}:{session:Xf.session,persist:{snapshotKeyCache:mh,defaultStyle:Xf.defaultStyle,baseStyle:Xf.baseStyle,image:Xf.image,resource:Xf.resource,background:Xf.background,font:Xf.font},options:e||t||{}}}(n,r),o=i.options&&i.options.cache||"auto";"disabled"!==o&&function(e=document.documentElement){if(wh)return;wh=!0;let t=e=>{bh(e)&&vh()};try{new MutationObserver(t).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(t).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let e=document.fonts;e&&(e.addEventListener?.("loadingdone",vh),e.ready?.then(()=>vh()).catch(()=>{}))}catch{}}(document.documentElement),"disabled"===o&&!i.session.__bumpedForDisabled&&(vh(),mh.clear(),i.session.__bumpedForDisabled=!0);let{session:a,persist:s}=i;if(!a.styleCache.has(e)){let t=null;try{t=getComputedStyle(e)}catch{}a.styleCache.set(e,t||getComputedStyle(document.documentElement))}let l=a.styleCache.get(e);e.getAttribute?.("style")&&function(e,t,n){if(e.style&&0!==e.style.length)for(let r=0;r<e.style.length;r++){let i=e.style[r],o=n.getPropertyValue(i);o&&t.style.setProperty(i,o)}}(e,t,l);let c=l.getPropertyValue("animation-name");t&&t.style&&c&&"none"!==c&&t.style.setProperty("animation","none","important");let u=kh(e,l,i.options),f=Dh(e);if(f){let e=l.getPropertyValue("min-width");(!e||"auto"===e||"0px"===e)&&(u["min-width"]="0px")}let d=e.tagName?.toLowerCase()||"div",h=function(e){let t=Sh.get(e);return t||(t=Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0).map(([e,t])=>`${e}:${t}`).join(";"),Sh.set(e,t),t)}(u),p=!0;if(gd(d,(u.display||"").toLowerCase())){p=function(e){for(let t=e.firstChild;t;t=t.nextSibling){if(3===t.nodeType&&/\S/.test(t.nodeValue||""))return!0;if(1===t.nodeType){let e=yd(t).position;if("absolute"!==e&&"fixed"!==e)return!0}}return!1}(e),p&&function(e,t,n){let r=(t.display||"").toLowerCase();if("inline"===r||Sd.has(e))return!1;if(n)return!0;if("none"!==(t.float||"none").toLowerCase())return!1;let i=(t.position||"static").toLowerCase();return"absolute"!==i&&"fixed"!==i&&!Md.has(r)}(d,u,f)&&Ch(e,l,f)&&(p=!1),h=`${h}|${d}${p?"|c":""}${f?"|f":""}`;let t=u["text-wrap-mode"]||u["white-space"]||"";p&&"nowrap"!==t&&"pre"!==t&&(a.reconcileRisk=(a.reconcileRisk||0)+1)}let g=s.snapshotKeyCache.get(h);void 0===g&&(g=md(u,d,p,f),s.snapshotKeyCache.set(h,g)),a.styleMap.set(t,g)}function Dh(e){let t=e.parentElement;if(!t)return!1;let n=yd(t).display||"";return n.includes("flex")||n.includes("grid")}Qd();var Nh=["fill","stroke","color","background-color","stop-color"],Mh=new Set(["symbol","defs","pattern","marker","linearGradient","radialGradient","filter"]);function Th(e){let t=e;for(;t&&1===t.nodeType;){if("http://www.w3.org/2000/svg"===t.namespaceURI){if("mask"===t.localName||"clipPath"===t.localName)return!1;if(Mh.has(t.localName))return!0}t=t.parentNode}return!1}var Qh=new Map;function Lh(e,t){if(1!==e?.nodeType||1!==t?.nodeType||Th(e))return;let n=e.getAttribute?.("style"),r=!(!n||!n.includes("var("));if(!r&&e.attributes?.length){let t=e.attributes;for(let e=0;e<t.length;e++){let n=t[e];if(n&&"string"==typeof n.value&&n.value.includes("var(")){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let n=e.style;if(n&&n.length){let e=new Set;for(let r=0;r<n.length;r++){let o=n[r];if(e.has(o))continue;e.add(o);let a=n.getPropertyValue(o);if(!a||!a.includes("var("))continue;let s=i&&i.getPropertyValue(o);if(s)try{t.style.setProperty(o,s.trim(),n.getPropertyPriority(o))}catch{}}}}if(r&&e.attributes?.length){let n=e.attributes;for(let e=0;e<n.length;e++){let r=n[e];if(!r||"string"!=typeof r.value||!r.value.includes("var("))continue;let o=r.name,a=i&&i.getPropertyValue(o);if(a)try{t.style.setProperty(o,a.trim())}catch{}}}if(!r){if(!i)try{i=getComputedStyle(e)}catch{i=null}if(!i)return;let n=e.namespaceURI||"html",r=function(e,t){let n=t+"::"+e.toLowerCase(),r=Qh.get(n);if(r)return r;let i=document,o="http://www.w3.org/2000/svg"===t?i.createElementNS(t,e):i.createElement(e),a=i.createElement("div");a.setAttribute("data-snapdom-internal",""),a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(o),i.documentElement.appendChild(a);let s=getComputedStyle(o),l={};for(let e of Nh)l[e]=s.getPropertyValue(e)||"";return a.remove(),Qh.set(n,l),l}(e.tagName,n);for(let e of Nh){let n=i.getPropertyValue(e)||"",o=r[e]||"";if(n&&n!==o)try{t.style.setProperty(e,n.trim())}catch{}}}}function Rh(e){return!!(!e||e.startsWith("data:")||e.startsWith("blob:")||/^data:image\/(gif|png|svg)/.test(e)&&e.length<200)}Pd(),Pd(),Kf(),ud(),ud();var Uh="img[data-src], img[data-lazy-src], img[data-original], img[data-hi-res-src], img[data-srcset], img[data-lazy-srcset]";var Hh=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i;function Oh(e,t){if(!e)return null;let n=0;try{n=t?t.getBoundingClientRect().width||t.width:0}catch{}n||(n=window.innerWidth||1e3);let r=[];for(let t of e.split(",")){let e=t.trim().split(/\s+/);if(!e[0])continue;let i=e[1]||"",o=1;/^\d*\.?\d+x$/i.test(i)?o=parseFloat(i):/^\d+w$/i.test(i)&&(o=parseInt(i,10)/n),r.push({url:e[0],d:o})}if(!r.length)return null;r.sort((e,t)=>e.d-t.d);let i=window.devicePixelRatio||1;return(r.find(e=>e.d>=i)||r[r.length-1]).url}function qh(e,t){let n=e.currentSrc||"";if(n&&!Rh(n))return n;let r=t.querySelectorAll("source[srcset]"),i=null;for(let t of r){let n=t.getAttribute("srcset");if(!n||Rh(n))continue;let r=t.getAttribute("type");if(r&&!Hh.test(r.trim()))continue;let o=t.getAttribute("media");if(o)try{if(window.matchMedia(o).matches)return Oh(n,e)}catch{}i||(i=Oh(n,e))}return i}function Ph(e){let t=[e.getAttribute("data-src"),e.getAttribute("data-lazy-src"),e.getAttribute("data-original"),e.getAttribute("data-hi-res-src")];for(let e of t)if(e&&!Rh(e))return e;let n=e.getAttribute("data-srcset")||e.getAttribute("data-lazy-srcset");if(n){let e=n.split(",")[0].trim().split(/\s+/)[0];if(e&&!Rh(e))return e}return null}async function $h(e,t={}){if(!e||1!==e?.nodeType||!1===t.resolvePicturePlaceholders)return null;let{timeout:n,concurrency:r,resolveLazySrc:i,silent:o,useProxy:a}=function(e={}){let t=e.pictureResolver&&"object"==typeof e.pictureResolver?e.pictureResolver:{};return{timeout:t.timeout??5e3,concurrency:t.concurrency??4,resolveLazySrc:!1!==t.resolveLazySrc,silent:t.silent??!1,useProxy:"string"==typeof e.useProxy?e.useProxy:""}}(t);if(!function(e,t){return!!(e&&1===e?.nodeType&&(e.matches?.("picture")||e.querySelector("picture")||t&&(e.matches?.(Uh)||e.querySelector(Uh))))}(e,i))return null;let s=[],l=[];async function c(e){let t=await ad(e,{as:"dataURL",timeout:n,useProxy:a,silent:!0});return t.ok?t.data:null}let u=Array.from(e.querySelectorAll("picture"));e.matches?.("picture")&&u.unshift(e);for(let e of u){let t=e.querySelector("img");if(!t)continue;if(!Rh(t.getAttribute("src")||""))continue;let n=qh(t,e);n&&l.push(async()=>{let r=await c(n);if(!r)return void(o||console.warn(`[snapdom:picture-resolver] Failed to fetch: ${n.slice(0,60)}`));let i=t.getAttribute("src"),a=t.getAttribute("srcset"),l=t.getAttribute("sizes"),u=[];t.src=r,t.setAttribute("src",r),t.removeAttribute("srcset"),t.removeAttribute("sizes");let f=e.querySelectorAll("source");for(let e of f)u.push({el:e,parent:e.parentElement,next:e.nextSibling}),e.remove();s.push(()=>{null!==i?t.setAttribute("src",i):t.removeAttribute("src"),null!==a&&t.setAttribute("srcset",a),null!==l&&t.setAttribute("sizes",l);for(let{el:e,parent:t,next:n}of u)t&&t.insertBefore(e,n)})})}if(i){let t=Array.from(e.querySelectorAll("img"));"img"===e.localName&&t.unshift(e);for(let e of t){if(e.closest("picture")&&Rh(e.getAttribute("src")||""))continue;let t=e.getAttribute("src")||"",n=Ph(e);n&&Rh(t)&&l.push(async()=>{let t=await c(n);if(!t)return;let r=e.getAttribute("src");e.src=t,e.setAttribute("src",t),e.removeAttribute("srcset"),e.removeAttribute("sizes"),s.push(()=>{null!==r?e.setAttribute("src",r):e.removeAttribute("src")})})}}return 0===l.length?null:(await async function(e){for(let t=0;t<e.length;t+=r){let n=e.slice(t,t+r);await Promise.allSettled(n.map(e=>e()))}}(l),async function(){for(let e of s)try{e()}catch{}})}function zh(e,t,n){return n?Promise.all(e.map(e=>new Promise(n=>t(e,n)))):Promise.all(e.map(e=>new Promise(r=>{!function i(){Ld(n=>{!n||"function"!=typeof n.timeRemaining||n.timeRemaining()>0?t(e,r):i()},{fast:n})}()})))}function jh(e,t,n){return e?(e=(e=(e=(e=(e=e.replace(/:host\(([^)]+)\)/g,(e,n)=>`:where(${t}:is(${n.trim()}))`)).replace(/:host\b/g,`:where(${t})`)).replace(/:host-context\(([^)]+)\)/g,(e,n)=>`:where(:where(${n.trim()}) ${t})`)).replace(/::slotted\(([^)]+)\)/g,(e,n)=>`:where(${t} ${n.trim()})`)).replace(/(^|})(\s*)([^@}{]+){/g,(e,r,i,o)=>{let a=function(e,t,n=!0,r){return e.split(",").map(e=>e.trim()).filter(Boolean).map(e=>{if(e.startsWith(":where(")||e.startsWith("@"))return e;let i=n?function(e,t){if(!(e=e.trim()))return e;let n=t?`[data-sd-slotted~="${t}"]`:"[data-sd-slotted]";return e.endsWith(":not([data-sd-slotted])")||e.endsWith(`:not(${n})`)?e:`${e}:not(${n})`}(e,r):e;return`:where(${t} ${i})`}).join(", ")}(o,t,!0,n);return`${r}${i}${a}{`}),e):""}function Vh(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let e=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(e)return e}catch{}return""}function Yh(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),0===t||0===n)try{let r=getComputedStyle(e);if(0===t){let e=parseFloat(r.width);!isNaN(e)&&e>0&&(t=e)}if(0===n){let e=parseFloat(r.height);!isNaN(e)&&e>0&&(n=e)}}catch{}if(0===t||0===n)try{if(0===t){let n=parseFloat(e.getAttribute("width"));!isNaN(n)&&n>0&&(t=n)}if(0===n){let t=parseFloat(e.getAttribute("height"));!isNaN(t)&&t>0&&(n=t)}}catch{}if((0===t||0===n)&&(e.naturalWidth||e.naturalHeight))try{0===t&&e.naturalWidth>0&&(t=e.naturalWidth),0===n&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}async function Wh(e,t,n){let r=await async function(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<t&&(!r||!r.body&&!r.documentElement);)await new Promise(e=>setTimeout(e,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:i,contentHeight:o,rect:a}=function(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,o=0;try{let t=getComputedStyle(e);n=parseFloat(t.borderLeftWidth)||0,r=parseFloat(t.borderRightWidth)||0,i=parseFloat(t.borderTopWidth)||0,o=parseFloat(t.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(t.width-(n+r))),contentHeight:Math.max(0,Math.round(t.height-(i+o))),rect:t}}(e),s=n?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||"function"!=typeof s.toPng)throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let l,c={...n,scale:1,clip:null},u=function(e,t,n){let r=e.defaultView,i=r?r.scrollX:0,o=r?r.scrollY:0,a=e.body?e.body.scrollLeft:0,s=e.body?e.body.scrollTop:0,l=e.documentElement?e.documentElement.scrollLeft:0,c=e.documentElement?e.documentElement.scrollTop:0,u=0,f=0,d=0,h=0;try{let t=r&&e.body?r.getComputedStyle(e.body):null;t&&(u=(parseFloat(t.marginTop)||0)+(parseFloat(t.paddingTop)||0),f=(parseFloat(t.marginRight)||0)+(parseFloat(t.paddingRight)||0),d=(parseFloat(t.marginBottom)||0)+(parseFloat(t.paddingBottom)||0),h=(parseFloat(t.marginLeft)||0)+(parseFloat(t.paddingLeft)||0))}catch{}try{e.documentElement.setAttribute("data-sd-pinned","")}catch{}let p=e.createElement("style");return p.setAttribute("data-sd-iframe-pin",""),p.textContent=`html {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${u}px ${f}px ${d}px ${h}px !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(p),()=>{try{p.remove()}catch{}try{e.documentElement.removeAttribute("data-sd-pinned")}catch{}try{r&&"function"==typeof r.scrollTo&&r.scrollTo(i,o),e.body&&(e.body.scrollLeft=a,e.body.scrollTop=s),e.documentElement&&(e.documentElement.scrollLeft=l,e.documentElement.scrollTop=c)}catch{}}}(r,i,o),f=Xf.session.nodeMap,d=Xf.session.styleMap,h=Xf.session.styleCache;try{l=await s.toPng(r.documentElement,c)}finally{u(),Xf.session.nodeMap=f,Xf.session.styleMap=d,Xf.session.styleCache=h}l.style.display="block",l.style.width=`${i}px`,l.style.height=`${o}px`;let p=document.createElement("div");return t.nodeMap.set(p,e),Fh(e,p,t,n),p.style.overflow="hidden",p.style.display="block",p.style.width||(p.style.width=`${Math.round(a.width)}px`),p.style.height||(p.style.height=`${Math.round(a.height)}px`),p.appendChild(l),p}var Gh=new _f(80);async function Jh(e){if(Xf.resource?.has(e))return Xf.resource.get(e);if(Gh.has(e))return Gh.get(e);let t=(async()=>{let t=await ad(e,{as:"dataURL",silent:!0});if(!t.ok||"string"!=typeof t.data)throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return Xf.resource?.set(e,t.data),t.data})();Gh.set(e,t);try{let n=await t;return Gh.set(e,n),n}catch(t){throw Gh.delete(e),t}}var _h=/\bblob:[^)"'\s]+/g;async function Xh(e){if(!e||-1===e.indexOf("blob:"))return e;let t=Array.from(new Set(e.match(_h)||[]));if(0===t.length)return e;let n=e;for(let e of t)try{let t=await Jh(e);n=n.split(e).join(t)}catch{}return n}function Kh(e){return"string"==typeof e&&e.startsWith("blob:")}function Zh(e){return(e||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.match(/^(\S+)(\s+.+)?$/);return t?{url:t[1],desc:t[2]||""}:null}).filter(Boolean)}function ep(e){return e.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(", ")}function tp(e,t){let n=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&n.unshift(e),n}Hd();var np=new Map,rp=new Set(["IFRAME"]);function ip(e,t){np.set(String(e).toUpperCase(),t)}function op(e){let{width:t,height:n}=Yh(e),r=t,i=n;if(!r||!i){let t=e.getBoundingClientRect();r=r||t.width||0,i=i||t.height||0}let o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,o}var ap=200,sp=new Set(["img","canvas","video","iframe","object","embed"]);function lp(e,t){return e.right>=t.left-ap&&e.left<=t.right+ap&&e.bottom>=t.top-ap&&e.top<=t.bottom+ap}async function cp(e,t,n){if(!e)throw new Error("Invalid node");let r,i=new Set,o=null,a=null;if(e.nodeType===Node.ELEMENT_NODE){let n=(e.localName||e.tagName||"").toLowerCase();if("snapdom-sandbox"===e.id||e.hasAttribute("data-snapdom-sandbox")||bd.has(n))return null;if("foreignobject"===n&&e.parentElement?.closest?.("foreignObject"))return Od(t,"Nested <foreignObject> skipped (SVG spec limitation — not rendered by browsers)"),null;if("source"===n&&"picture"===e.parentElement?.localName)return null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if("exclude"===e.getAttribute("data-capture")){if("hide"===n.excludeMode)return op(e);if("remove"===n.excludeMode)return null}if(n.exclude&&Array.isArray(n.exclude))for(let t of n.exclude)try{if(e.matches?.(t)){if("hide"===n.excludeMode)return op(e);if("remove"===n.excludeMode)return null}}catch(e){console.warn(`Invalid selector in exclude option: ${t}`,e)}if("function"==typeof n.filter)try{if(!n.filter(e)){if("hide"===n.filterMode)return op(e);if("remove"===n.filterMode)return null}}catch(e){console.warn("Error in filter function:",e)}if(t.clip&&function(e,t){if(e===t.root)return!1;let n;try{n=e.getBoundingClientRect()}catch{return!1}if(0===n.width&&0===n.height)return!1;let r=yd(e);if("inline"===r.display&&!sp.has((e.localName||"").toLowerCase()))return!1;let i=t.rect,o=e.scrollWidth||0,a=e.scrollHeight||0,s={left:"rtl"===r.direction?Math.min(n.left,n.right-o):n.left,top:n.top,right:Math.max(n.right,n.left+o),bottom:Math.max(n.bottom,n.top+a)},l=r.writingMode||"";if((l.startsWith("vertical")||l.startsWith("sideways"))&&(s.top=Math.min(n.top,n.bottom-a),s.left=Math.min(s.left,n.right-o)),lp(s,i))return!1;let c=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;c.nextNode();){let e=c.currentNode.getBoundingClientRect();if((e.width>0||e.height>0)&&lp(e,i))return!1}return!0}(e,t.clip))return function(e,t,n){let r=e.cloneNode(!1);"IMG"===e.tagName&&(r.removeAttribute("src"),r.removeAttribute("srcset"),r.removeAttribute("sizes")),Fh(e,r,t,n);let{width:i,height:o}=Yh(e);return i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),o>0&&(r.style.height=`${o}px`,r.style.minHeight=`${o}px`,r.style.maxHeight=`${o}px`),r.style.visibility="hidden",r.style.overflow="hidden",r.style.boxSizing="border-box",r}(e,t,n);if(n.__resolveNodeHooks)for(let r of n.__resolveNodeHooks){let i;try{i=await r(e,n)}catch(e){Od(t,"resolveNode plugin hook failed",e)}if(null===i)return null;if(i instanceof Node)return i.nodeType===Node.ELEMENT_NODE&&(t.nodeMap.set(i,e),Fh(e,i,t,n)),i}{let r=rp.has(e.tagName)&&np.get(e.tagName);if(r){let i=await r(e,t,n);if(void 0!==i)return i}}if("placeholder"===e.getAttribute("data-capture")){let r=e.cloneNode(!1);t.nodeMap.set(r,e),Fh(e,r,t,n);let i=document.createElement("div");return i.textContent=e.getAttribute("data-placeholder-text")||"",i.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",r.appendChild(i),r}{let r=!rp.has(e.tagName)&&np.get(e.tagName);if(r){let i=await r(e,t,n);if(void 0!==i)return i}}try{if(r=e.cloneNode(!1),r.attributes?.length)try{for(let e of r.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(e.value)&&r.setAttribute(e.name,e.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Lh(e,r),t.nodeMap.set(r,e),"IMG"===e.tagName){!function(e,t){try{let n=null,r=yd(e).content;if(r&&r.includes("url(")){let e=r.match(/url\(["']?([^"')]+)["']?\)/);e&&(n=e[1])}let i=e.closest?.("picture"),o=n||(i?qh(e,i):e.currentSrc)||e.src||Oh(e.getAttribute("srcset"),e)||"";if(!o)return;t.setAttribute("src",o),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}(e,r);try{let{width:t,height:n}=Yh(e),i=Math.round(t||0),o=Math.round(n||0);i&&(r.dataset.snapdomWidth=String(i)),o&&(r.dataset.snapdomHeight=String(o))}catch(e){Od(t,"getUnscaledDimensions for IMG failed",e)}try{let t=e.getAttribute("style")||"",n=window.getComputedStyle(e),i=e=>{let r=t.match(new RegExp(`${e}\\s*:\\s*([^;]+)`,"i")),i=r?r[1].trim():n.getPropertyValue(e);return/%|auto/i.test(String(i||""))},o=parseInt(r.dataset.snapdomWidth||"0",10),a=parseInt(r.dataset.snapdomHeight||"0",10),s=i("width")||!o,l=i("height")||!a;s&&o&&(r.style.width=`${o}px`),l&&a&&(r.style.height=`${a}px`);let c=n.getPropertyValue("object-fit"),u=n.getPropertyValue("object-position");c&&"fill"!==c?(r.style.objectFit=c,u&&(r.style.objectPosition=u)):(o&&(r.style.minWidth=`${o}px`),a&&(r.style.minHeight=`${a}px`))}catch(e){Od(t,"IMG dimension freeze failed",e)}}}catch(t){throw console.error("[Snapdom] Failed to clone node:",e,t),t}let s=null;if(e instanceof HTMLTextAreaElement){let{width:t,height:n}=Yh(e),i=t||e.getBoundingClientRect().width||0,o=n||e.getBoundingClientRect().height||0;i&&(r.style.width=`${i}px`),o&&(r.style.height=`${o}px`)}if(e instanceof HTMLInputElement){let n=(e.type||"text").toLowerCase();if("checkbox"!==n&&"radio"!==n||!function(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}())r.value=e.value,r.setAttribute("value",e.value),void 0!==e.checked&&(r.checked=e.checked,e.checked&&r.setAttribute("checked",""),e.indeterminate&&(r.indeterminate=e.indeterminate));else{let{el:n,applyVisual:i}=function(e){let t,{width:n,height:r}=Yh(e),i=e.getBoundingClientRect();try{t=window.getComputedStyle(e)}catch{}let o=t?parseFloat(t.width):NaN,a=t?parseFloat(t.height):NaN,s=Math.round(n||i.width||0),l=Math.round(r||i.height||0),c=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,s||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,l||16),f="checkbox"===(e.type||"text").toLowerCase(),d=!!e.checked,h=!!e.indeterminate,p=Math.max(Math.min(c,u),12),g="middle";try{t&&t.verticalAlign&&(g=t.verticalAlign)}catch{}let m=document.createElement("div");m.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),m.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");function v(){let e="#0a6ed1";try{t&&(e=t.accentColor||t.color||e)}catch{}let n=p-2;if(y.innerHTML="",f){let t=document.createElementNS("http://www.w3.org/2000/svg","rect");if(t.setAttribute("x",String(1)),t.setAttribute("y",String(1)),t.setAttribute("width",String(n)),t.setAttribute("height",String(n)),t.setAttribute("rx","2"),t.setAttribute("ry","2"),t.setAttribute("fill",d?e:"none"),t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(2)),y.appendChild(t),d){let e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",`M 3 ${p/2} L ${p/2-1} ${p-1-2} L ${p-1-2} 3`),e.setAttribute("stroke","white"),e.setAttribute("stroke-width",String(Math.max(1.5,2))),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),y.appendChild(e)}else if(h){let t=document.createElementNS("http://www.w3.org/2000/svg","rect"),r=Math.max(6,n-4);t.setAttribute("x",String((p-r)/2)),t.setAttribute("y",String((p-2)/2)),t.setAttribute("width",String(r)),t.setAttribute("height",String(2)),t.setAttribute("fill",e),t.setAttribute("rx","1"),y.appendChild(t)}}else{let t=document.createElementNS("http://www.w3.org/2000/svg","circle");if(t.setAttribute("cx",String(p/2)),t.setAttribute("cy",String(p/2)),t.setAttribute("r",String((p-2)/2)),t.setAttribute("fill",d?e:"none"),t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(2)),y.appendChild(t),d){let e=document.createElementNS("http://www.w3.org/2000/svg","circle"),t=Math.max(2,.35*(p-4));e.setAttribute("cx",String(p/2)),e.setAttribute("cy",String(p/2)),e.setAttribute("r",String(t)),e.setAttribute("fill","white"),y.appendChild(e)}}m.style.setProperty("width",`${p}px`,"important"),m.style.setProperty("height",`${p}px`,"important"),m.style.setProperty("min-width",`${p}px`,"important"),m.style.setProperty("min-height",`${p}px`,"important")}return y.setAttribute("width",String(p)),y.setAttribute("height",String(p)),y.setAttribute("viewBox",`0 0 ${p} ${p}`),m.appendChild(y),v(),{el:m,applyVisual:v}}(e);t.nodeMap.set(n,e),s=i,r=n}}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let t=window.getComputedStyle(e,"::placeholder"),n=t&&t.color;if(n&&"rgba(0, 0, 0, 0)"!==n){let e="snapdom-ph-"+(1e6*Math.random()|0);r.classList.add(e);let i=document.createElement("style");i.textContent=`.${e}::placeholder{color:${n}!important;opacity:${t.opacity||"1"}!important;-webkit-text-fill-color:${n}!important;}`,r.prepend(i)}}catch{}if(e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(a=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&r.setAttribute("disabled",""),e.required&&r.setAttribute("required",""),e.readOnly&&r.setAttribute("readonly","");let t=e;void 0!==t.min&&""!==t.min&&r.setAttribute("min",t.min),void 0!==t.max&&""!==t.max&&r.setAttribute("max",t.max),void 0!==t.pattern&&""!==t.pattern&&r.setAttribute("pattern",t.pattern);let n=e.getAttribute("aria-invalid");null!==n&&r.setAttribute("aria-invalid",n)}if(Th(e)||Fh(e,r,t,n),s&&s(),e instanceof SVGElement&&!Th(e)){let t=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let n=window.getComputedStyle(e);for(let e of t){let t=n.getPropertyValue(e);t&&r.style.setProperty(e,t)}}catch{}}if(e.shadowRoot){try{let t=e.shadowRoot.querySelectorAll("slot");for(let e of t){let t=e.assignedNodes?.()||[];for(let e of t)i.add(e)}}catch{}let o=function(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}(t),a=`[data-sd="${o}"]`;t.shadowScopes||=new WeakMap,t.shadowScopes.set(e.shadowRoot,o);try{r.setAttribute("data-sd",o)}catch{}let s=function(e){let t="";try{e.querySelectorAll("style").forEach(e=>{t+=(e.textContent||"")+"\n"});let n=e.adoptedStyleSheets||[];for(let e of n)try{if(e&&e.cssRules)for(let n of e.cssRules)t+=n.cssText+"\n"}catch{}}catch{}return t}(e.shadowRoot),l=jh(s,a,o),c=function(e){let t=new Set;if(!e)return t;let n,r=/var\(\s*(--[A-Za-z0-9_-]+)\b/g;for(;n=r.exec(e);)t.add(n[1]);return t}(s),u=function(e,t,n){let r=[];for(let n of t){let t=Vh(e,n);t&&r.push(`${n}: ${t};`)}return r.length?`${n}{${r.join("")}}\n`:""}(e,c,a);!function(e,t,n){if(!t)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}(r,u+l,o);let f=document.createDocumentFragment(),d=(e,r)=>{if(e.nodeType===Node.ELEMENT_NODE&&"STYLE"===e.tagName)return r(null);cp(e,t,n).then(e=>{r(e||null)}).catch(()=>{r(null)})},h=await zh(Array.from(e.shadowRoot.childNodes),d,n.fast);f.append(...h.filter(e=>!!e)),r.appendChild(f)}if("SLOT"===e.tagName){let r=t.shadowScopes?.get(e.getRootNode()),i=e.assignedNodes?.()||[],o=i.length?e.assignedNodes?.({flatten:!0})||i:[],a=o.length?o:Array.from(e.childNodes),s=document.createDocumentFragment(),l=(e,o)=>{cp(e,t,n).then(e=>{e&&i.length&&function(e,t){if(!e)return;let n=e=>{let n=e.getAttribute("data-sd-slotted")||"";t?` ${n} `.includes(` ${t} `)||e.setAttribute("data-sd-slotted",n?`${n} ${t}`:t):e.setAttribute("data-sd-slotted",n)};e.nodeType===Node.ELEMENT_NODE&&n(e),e.querySelectorAll?.("*").forEach(n)}(e,r),o(e||null)}).catch(()=>{o(null)})},c=await zh(Array.from(a),l,n.fast);return s.append(...c.filter(e=>!!e)),s}let l=await zh(Array.from(e.childNodes),function(r,o){if(i.has(r)||e.shadowRoot&&!r.assignedSlot)return o(null);cp(r,t,n).then(e=>{o(e||null)}).catch(()=>{o(null)})},n.fast);if(r.append(...l.filter(e=>!!e)),null!==o&&r instanceof HTMLSelectElement){r.value=o;for(let e of r.options)e.value===o?e.setAttribute("selected",""):e.removeAttribute("selected")}return null!==a&&r instanceof HTMLTextAreaElement&&(r.textContent=a),r}ip("IFRAME",async function(e,t,n){let r=!1;try{r=!(!e.contentDocument&&!e.contentWindow?.document)}catch(e){Od(t,"iframe same-origin probe failed",e)}if(r)try{return await Wh(e,t,n)}catch(e){console.warn("[SnapDOM] iframe rasterization failed, fallback:",e)}if(r||console.warn("[snapdom] cross-origin <iframe> skipped (its document cannot be read). Captured as a placeholder that keeps the frame's box; pass { placeholders: false } for an invisible spacer.",e),n.placeholders){let{width:r,height:i}=Yh(e),o=document.createElement("div");return o.style.cssText=`width:${r}px;height:${i}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Fh(e,o,t,n),o}{let{width:r,height:i}=Yh(e),o=document.createElement("div");return o.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,Fh(e,o,t,n),o}}),ip("CANVAS",async function(e,t,n){let r="";try{let t=e.getContext("2d",{willReadFrequently:!0});try{t&&t.getImageData(0,0,1,1)}catch{}if((Ud()||!t)&&await Rd(),r=e.toDataURL("image/png"),!r||"data:,"===r){try{t&&t.getImageData(0,0,1,1)}catch{}if(await Rd(),r=e.toDataURL("image/png"),!r||"data:,"===r){let t=document.createElement("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n&&(n.drawImage(e,0,0),r=t.toDataURL("image/png"))}}}catch(e){Od(t,"Canvas toDataURL failed, using empty/fallback",e)}n&&n.debug&&r&&function(e){try{let t=Math.max(1,Math.min(32,e.width)),n=Math.max(1,Math.min(32,e.height)),r=document.createElement("canvas");r.width=t,r.height=n;let i=r.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(e,0,0,t,n);let o=i.getImageData(0,0,t,n).data;for(let e=3;e<o.length;e+=4)if(0!==o[e])return!1;return!0}catch{return!1}}(e)&&Od(t,"canvas is empty at capture time — capture it after its first frame is drawn",e);let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch(e){Od(t,"img decoding/loading hints failed",e)}r&&(i.src=r),i.width=e.width,i.height=e.height;let{width:o,height:a}=Yh(e);return o>0&&(i.style.width=`${o}px`),a>0&&(i.style.height=`${a}px`),t.nodeMap.set(i,e),Fh(e,i,t,n),i}),ip("VIDEO",async function(e,t,n){let r="";try{let t=document.createElement("canvas");t.width=e.videoWidth||e.offsetWidth||320,t.height=e.videoHeight||e.offsetHeight||240;let n=t.getContext("2d");n&&(n.drawImage(e,0,0,t.width,t.height),r=t.toDataURL("image/png"),(!r||"data:,"===r)&&(r=""))}catch(e){Od(t,"Video frame capture failed, using poster fallback",e)}let i=document.createElement("img");try{i.decoding="sync",i.loading="eager"}catch{}r?i.src=r:e.poster&&(i.src=e.poster),i.width=e.videoWidth||e.offsetWidth||0,i.height=e.videoHeight||e.offsetHeight||0;let{width:o,height:a}=Yh(e);return o>0&&(i.style.width=`${o}px`),a>0&&(i.style.height=`${a}px`),i.style.objectFit="contain",t.nodeMap.set(i,e),Fh(e,i,t,n),i}),ip("AUDIO",async function(e,t,n){if(!e.controls)return;let{width:r,height:i}=Yh(e),o=Math.round(r||e.offsetWidth||300),a=Math.round(i||e.offsetHeight||54),s=a/2,l=Math.max(4,.16*a),c=.34*a,u=o-.34*a,f=c+l+.55*a,d=Math.max(0,u-.7*a-f),h=Math.max(9,Math.round(.24*a)),p=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${a}" viewBox="0 0 ${o} ${a}"><rect width="${o}" height="${a}" rx="${Math.min(a/2,10)}" fill="#f1f3f4"/><path d="M ${c} ${s-l} L ${c+l} ${s} L ${c} ${s+l} Z" fill="#5f6368"/><rect x="${f}" y="${s-1.5}" width="${d}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${f}" cy="${s}" r="${Math.max(3,.09*a)}" fill="#5f6368"/><text x="${u}" y="${s}" fill="#5f6368" font-family="sans-serif" font-size="${h}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,g=document.createElement("img");try{g.decoding="sync",g.loading="eager"}catch{}return g.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(p)}`,g.width=o,g.height=a,g.style.width=`${o}px`,g.style.height=`${a}px`,t.nodeMap.set(g,e),Fh(e,g,t,n),g}),Pd(),rd(),Qd(),Kf(),Kf();var up=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],fp=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),dp=[],hp=new Set;function pp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gp(e){let t="string"==typeof e?e:"",n=[...up,...dp];for(let e of n)if(e instanceof RegExp&&e.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function mp(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var yp=new Map;function vp(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&"currentcolor"!==t.toLowerCase())return t;let r=e.color?.trim();return r&&"inherit"!==r?r:"#000"}async function Ap(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:i="#000",variation:o="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),l=window.devicePixelRatio||1,c=function(e=""){let t,n=Object.create(null),r=String(e||""),i=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g;for(;t=i.exec(r);)n[t[1].toUpperCase()]=Number(t[2]);return n}(o),{familyForMeasure:u,familyForCanvas:f}=await async function(e,t,n){let r=String(e||""),i=r.toLowerCase(),o=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),s="outlined";/\brounded\b/.test(o)||/\bround\b/.test(o)?s="rounded":/\bsharp\b/.test(o)?s="sharp":/\boutlined\b/.test(o)&&(s="outlined");let l=null;if(1===a&&("outlined"===s&&fp.materialIconsFilled?l={url:fp.materialIconsFilled,alias:"snapdom-mi-filled"}:"rounded"===s&&fp.materialIconsRound?l={url:fp.materialIconsRound,alias:"snapdom-mi-round"}:"sharp"===s&&fp.materialIconsSharp&&(l={url:fp.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!yp.has(l.alias))try{let e=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(e),await e.load(),yp.set(l.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let c=`"${l.alias}"`;return{familyForMeasure:c,familyForCanvas:c}}(s,a,c);await async function(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}(f.replace(/^["']+|["']+$/g,""),r);let d=document.createElement("span");d.setAttribute("data-snapdom-internal",""),d.textContent=e,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=u,d.style.fontWeight=String(n||"normal"),d.style.fontSize=`${r}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=i,document.body.appendChild(d);let h=d.getBoundingClientRect(),p=Math.max(1,Math.ceil(h.width)),g=Math.max(1,Math.ceil(h.height));document.body.removeChild(d);let m=document.createElement("canvas");m.width=p*l,m.height=g*l;let y=m.getContext("2d");y.scale(l,l),y.font=`${n?`${n} `:""}${r}px ${f}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=i;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:m.toDataURL(),width:p,height:g}}async function bp(e,t,n,r=32,i="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let o=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.setAttribute("data-snapdom-internal",""),a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=n||"normal",a.style.fontSize=`${r}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let s=a.getBoundingClientRect(),l=Math.ceil(s.width),c=Math.ceil(s.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,l*o),u.height=Math.max(1,c*o);let f=u.getContext("2d");return f.scale(o,o),f.font=n?`${n} ${r}px "${t}"`:`${r}px "${t}"`,f.textAlign="left",f.textBaseline="top",f.fillStyle=i,f.fillText(e,0,0),{dataUrl:u.toDataURL(),width:l,height:c}}ud(),Hd();var wp=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Ip=["katex","mathjax","mathml"];function xp(e){if(!e)return"";for(let t of e.split(",")){let e=t.trim().replace(/^['"]+|['"]+$/g,"");if(e&&!wp.has(e.toLowerCase()))return e}return""}function Cp(e){let t=String(e??"400").trim().toLowerCase();if("normal"===t)return 400;if("bold"===t)return 700;let n=parseInt(t,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function Ep(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Bp(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function Sp(e){return e&&"string"==typeof e?e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-"):""}function kp(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let i=r.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(e=>i.endsWith(e))||n.some(e=>i===e.toLowerCase()||i.endsWith("."+e.toLowerCase())))return!0;let o=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(o)||/\.woff2?(\b|$)/.test(o)||Ip.some(e=>o.includes(e)))return!0;for(let e of t){let t=e.toLowerCase().replace(/\s+/g,"+"),n=e.toLowerCase().replace(/\s+/g,"-"),r=Sp(e);if(o.includes(t)||o.includes(n)||r&&o.includes(r))return!0}return!1}catch{return!1}}function Fp(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(e,n,r)=>{let i=(r||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return e;let o=i;try{o=new URL(i,t||location.href).href}catch{}return`url("${o}")`})}var Dp=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g;async function Np(e,t,n){if(!e)return e;let r=new Set;function i(e,t){try{return new URL(e,t||location.href).href}catch{return e}}let o=Fp(e,t||location.href);return o=await async function e(t,o,a=0){if(a>4)return console.warn(`[snapDOM] @import depth exceeded (4) at ${o}`),t;let s,l="",c=0;for(;s=Dp.exec(t);){l+=t.slice(c,s.index),c=Dp.lastIndex;let u=i((s[2]||s[4]||"").trim(),o);if(r.has(u)){console.warn(`[snapDOM] Skipping circular @import: ${u}`);continue}r.add(u);let f="";try{let e=await ad(u,{as:"text",useProxy:n,silent:!0});e.ok&&"string"==typeof e.data&&(f=e.data)}catch{}f?(f=Fp(f,u),f=await e(f,u,a+1),l+=`\n/* inlined: ${u} */\n${f}\n`):l+=s[0]}return l+=t.slice(c),l}(o,t||location.href,0),o}var Mp=/url\((["']?)([^"')]+)\1\)/g,Tp=/@font-face[^{}]*\{[^}]*\}/g;function Qp(e,t,n=""){return(e.match(new RegExp(`${t}\\s*:\\s*([^;}]+)[;}]`,"i"))?.[1]||n).trim()}function Lp(e){if(!e)return[];let t=[],n=e.split(",").map(e=>e.trim()).filter(Boolean);for(let e of n){let n=e.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!n)continue;let r=n[1],i=n[2],o=e=>{if(!e.includes("?"))return parseInt(e,16);return[parseInt(e.replace(/\?/g,"0"),16),parseInt(e.replace(/\?/g,"F"),16)]};if(i){let e=o(r),n=o(i),a=Array.isArray(e)?e[0]:e,s=Array.isArray(n)?n[1]:n;t.push([Math.min(a,s),Math.max(a,s)])}else{let e=o(r);Array.isArray(e)?t.push([e[0],e[1]]):t.push([e,e])}}return t}function Rp(e,t){if(!t.length||!e||0===e.size)return!0;for(let n of e)for(let[e,r]of t)if(n>=e&&n<=r)return!0;return!1}function Up(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Mp)){let e=(r[2]||"").trim();if(e&&!e.startsWith("data:")){if(!/^https?:/i.test(e))try{e=new URL(e,t||location.href).href}catch{}n.push(e)}}return n}async function Hp(e,t,n=""){let r=e;for(let i of e.matchAll(Mp)){let e=Zf(i[0]);if(!e)continue;let o=e;if(!o.startsWith("http")&&!o.startsWith("data:"))try{o=new URL(o,t||location.href).href}catch{}if(!gp(o)){if(Xf.resource?.has(o)){Xf.font?.add(o),r=r.replace(i[0],`url(${Xf.resource.get(o)})`);continue}try{let e=await ad(o,{as:"dataURL",useProxy:n,silent:!0});if(e.ok&&"string"==typeof e.data){let t=e.data;Xf.resource?.set(o,t),Xf.font?.add(o),r=r.replace(i[0],`url(${t})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",o)}}}return r}function Op(e={}){let t=new Set((e.families||[]).map(e=>String(e).toLowerCase())),n=new Set((e.domains||[]).map(e=>String(e).toLowerCase())),r=new Set((e.subsets||[]).map(e=>String(e).toLowerCase()));return(e,i)=>{if(t.size&&t.has(e.family.toLowerCase()))return!0;if(n.size)for(let t of e.srcUrls)try{if(n.has(new URL(t).host.toLowerCase()))return!0}catch{}if(r.size){let e=function(e){if(!e.length)return null;let t=(t,n)=>e.some(([e,r])=>!(r<t||e>n)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),i=t(880,1023),o=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":o?"cyrillic":i?"greek":r?"latin-ext":n?"latin":null}(i);if(e&&r.has(e))return!0}return!1}}var qp=new WeakMap,Pp=0;function $p(e,t,n,r,i,o){let a=Array.from(e||[]).sort().join("|"),s=t?JSON.stringify({families:(t.families||[]).map(e=>String(e).toLowerCase()).sort(),domains:(t.domains||[]).map(e=>String(e).toLowerCase()).sort(),subsets:(t.subsets||[]).map(e=>String(e).toLowerCase()).sort()}):"",l=(n||[]).map(e=>`${(e.family||"").toLowerCase()}::${e.weight||"normal"}::${e.style||"normal"}::${e.src||""}`).sort().join("|"),c=r||"",u=(i||[]).map(e=>String(e).toLowerCase()).sort().join("|"),f=function(e){let t=qp.get(e);return void 0===t&&(t=Pp++,qp.set(e,t)),t}(o||document);return`fonts-embed-css::req=${a}::ex=${s}::lf=${l}::px=${c}::fd=${u}::doc=${f}`}async function zp(e,t,n,r){let i;try{i=e.cssRules||[]}catch{return}let o=(e,t)=>{try{return new URL(e,t||location.href).href}catch{return e}};for(let e of i){if(e.type===CSSRule.IMPORT_RULE&&e.styleSheet){let i=e.href?o(e.href,t):t;if(r.depth>=4){console.warn(`[snapDOM] CSSOM import depth exceeded (4) at ${i}`);continue}if(i&&r.visitedSheets.has(i)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${i}`);continue}i&&r.visitedSheets.add(i);let a={...r,depth:(r.depth||0)+1};await zp(e.styleSheet,i,n,a);continue}if(e.type===CSSRule.FONT_FACE_RULE){let i=xp((e.style.getPropertyValue("font-family")||"").trim());if(!i||gp(i))continue;let o=(e.style.getPropertyValue("font-weight")||"").trim(),a=(e.style.getPropertyValue("font-style")||"").trim(),s=(e.style.getPropertyValue("font-stretch")||"").trim(),l=(e.style.getPropertyValue("font-variation-settings")||"").trim(),c=(e.style.getPropertyValue("src")||"").trim(),u=(e.style.getPropertyValue("unicode-range")||"").trim(),f=o||"400",d=a||"normal",h=s||"100%",p=(a?`font-style:${a};`:"")+(o?`font-weight:${o};`:"")+(s?`font-stretch:${s};`:"")+(l?`font-variation-settings:${l};`:"")+(u?`unicode-range:${u};`:""),g=r.faceMatchesRequired(i,d,f,h);if(!g&&!r.requiredIndex.has(i.toLowerCase()))continue;let m=Lp(u);if(!Rp(r.usedCodepoints,m))continue;let y={family:i,weightSpec:f,styleSpec:d,stretchSpec:h,unicodeRange:u,srcRaw:c,srcUrls:Up(c,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(y,m))continue;if(!g){r.provisionalFaces.push({family:i.toLowerCase(),block:`@font-face{font-family:${i};src:${c};${p}}`,srcRaw:c,baseHref:t||location.href});continue}if(r.coveredFamilies.add(i.toLowerCase()),/url\(/i.test(c)){let e=await Hp(c,t||location.href,r.useProxy);await n(`@font-face{font-family:${i};src:${e};${p}}`)}else await n(`@font-face{font-family:${i};src:${c};${p}}`)}}}async function jp({required:e,usedCodepoints:t,exclude:n,localFonts:r=[],useProxy:i="",fontStylesheetDomains:o=[],doc:a=document}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let s=new Map;for(let t of e){let[e,n,r,i]=String(t).split("__");if(!e)continue;let o=e.toLowerCase(),a=s.get(o)||[];a.push({w:parseInt(n,10),s:r,st:parseInt(i,10)}),s.set(o,a)}function l(e,t,n,r){let i=String(e).toLowerCase();if(!s.has(i))return!1;let o=s.get(i),a=function(e){let t=String(e||"400").trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let e=Cp(n[1]),t=Cp(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=Cp(t);return{min:r,max:r}}(n),l=function(e){let t=String(e||"normal").trim().toLowerCase();return"italic"===t?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}(t),c=function(e){let t=String(e||"100%").trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let e=parseFloat(n[1]),t=parseFloat(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}(r),u=a.min!==a.max,f=a.min,d=e=>"normal"===l.kind&&"normal"===e||"normal"!==l.kind&&("italic"===e||"oblique"===e),h=!1;for(let e of o){let t=u?e.w>=a.min&&e.w<=a.max:e.w===f,n=d(Ep(e.s)),r=e.st>=c.min&&e.st<=c.max;if(t&&n&&r){h=!0;break}}if(h)return!0;if(!u)for(let e of o){let t=d(Ep(e.s)),n=e.st>=c.min&&e.st<=c.max;if(Math.abs(f-e.w)<=300&&t&&n)return!0}if(!u&&"normal"===l.kind&&o.some(e=>"normal"!==Ep(e.s)))for(let e of o){let t=Math.abs(f-e.w)<=300,n=e.st>=c.min&&e.st<=c.max;if(t&&n)return!0}return!1}let c=Op(n),u=$p(e,n,r,i,o,a);if(Xf.resource?.has(u))return Xf.resource.get(u);let f=function(e){let t=new Set;for(let n of e||[]){let e=String(n).split("__")[0]?.trim();e&&t.add(e)}return t}(e),d=[],h=Dp;for(let e of a.querySelectorAll("style")){let t=e.textContent||"";for(let e of t.matchAll(h)){let t=(e[2]||e[4]||"").trim();t&&!gp(t)&&(a.querySelector(`link[rel="stylesheet"][href="${t}"]`)||d.push(t))}}let p=[];d.length&&await Promise.all(d.map(e=>new Promise(t=>{if(a.querySelector(`link[rel="stylesheet"][href="${e}"]`))return t(null);let n=a.createElement("link");n.rel="stylesheet",n.href=e,n.setAttribute("data-snapdom","injected-import"),n.onload=()=>t(n),n.onerror=()=>t(null),a.head.appendChild(n),p.push(n)})));let g="",m=new Set,y=[],v=Array.from(a.querySelectorAll('link[rel="stylesheet"]')).filter(e=>!!e.href);for(let e of p)try{e.remove()}catch{}for(let e of v)try{if(gp(e.href))continue;let r="",u=!1;try{u=new URL(e.href,location.href).origin===location.origin}catch{}if(!u){let t=Array.isArray(o)?o:[];if(!kp(e.href,f,t))continue}if(u){let t=Array.from(a.styleSheets).find(t=>t.href===e.href);if(t)try{let e=t.cssRules||[];r=Array.from(e).map(e=>e.cssText).join("")}catch{}}if(!r){let t=await ad(e.href,{as:"text",useProxy:i});if(t?.ok&&"string"==typeof t.data&&(r=t.data),gp(e.href))continue}r=await Np(r,e.href,i);let d="";for(let o of r.match(Tp)||[]){let r=xp(Qp(o,"font-family"));if(!r||gp(r))continue;let a=Qp(o,"font-weight","400"),u=Qp(o,"font-style","normal"),f=Qp(o,"font-stretch","100%"),h=Qp(o,"unicode-range"),p=Qp(o,"src"),g=Up(p,e.href),v=l(r,u,a,f);if(!v&&!s.has(r.toLowerCase()))continue;let A=Lp(h);if(!Rp(t,A))continue;let b={family:r,weightSpec:a,styleSpec:u,stretchSpec:f,unicodeRange:h,srcRaw:p,srcUrls:g,href:e.href};n&&c(b,A)||(v?(m.add(r.toLowerCase()),d+=/url\(/i.test(p)?await Hp(o,e.href,i):o):y.push({family:r.toLowerCase(),block:o,srcRaw:p,baseHref:e.href}))}d.trim()&&(g+=d)}catch{console.warn("[snapDOM] Failed to process stylesheet:",e.href)}let A={requiredIndex:s,usedCodepoints:t,faceMatchesRequired:l,coveredFamilies:m,provisionalFaces:y,simpleExcluder:n?Op(n):null,useProxy:i,visitedSheets:new Set,depth:0};for(let e of a.styleSheets)if(!e.href||!v.some(t=>t.href===e.href))try{let t=e.href||location.origin+"/";t&&A.visitedSheets.add(t),await zp(e,t,async e=>{g+=e},A)}catch{}for(let e of y)m.has(e.family)||(g+=/url\(/i.test(e.srcRaw)?await Hp(e.block,e.baseHref,i):e.block);try{for(let e of a.fonts||[]){if(!e||!e.family||"loaded"!==e.status||!e._snapdomSrc)continue;let t=String(e.family).replace(/^['"]+|['"]+$/g,"");if(gp(t)||!s.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e._snapdomSrc;if(!String(r).startsWith("data:"))if(Xf.resource?.has(e._snapdomSrc))r=Xf.resource.get(e._snapdomSrc),Xf.font?.add(e._snapdomSrc);else if(!Xf.font?.has(e._snapdomSrc))try{let t=await ad(e._snapdomSrc,{as:"dataURL",useProxy:i,silent:!0});if(!t.ok||"string"!=typeof t.data)continue;r=t.data,Xf.resource?.set(e._snapdomSrc,r),Xf.font?.add(e._snapdomSrc)}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",e._snapdomSrc);continue}g+=`@font-face{font-family:'${t}';src:url(${r});font-style:${e.style||"normal"};font-weight:${e.weight||"normal"};}`}}catch{}for(let e of r){if(!e||"object"!=typeof e)continue;let t=String(e.family||"").replace(/^['"]+|['"]+$/g,"");if(!t||gp(t)||!s.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=null!=e.weight?String(e.weight):"normal",o=null!=e.style?String(e.style):"normal",a=null!=e.stretchPct?`${e.stretchPct}%`:"100%",l=String(e.src||""),c=l;if(!c.startsWith("data:"))if(Xf.resource?.has(l))c=Xf.resource.get(l),Xf.font?.add(l);else if(!Xf.font?.has(l))try{let e=await ad(l,{as:"dataURL",useProxy:i,silent:!0});if(!e.ok||"string"!=typeof e.data)continue;c=e.data,Xf.resource?.set(l,c),Xf.font?.add(l)}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",l);continue}g+=`@font-face{font-family:'${t}';src:url(${c});font-style:${o};font-weight:${r};font-stretch:${a};}`}return g&&(g=function(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let i of e.match(t)||[]){let e=xp(Qp(i,"font-family")),t=Qp(i,"font-weight","400"),o=Qp(i,"font-style","normal"),a=Qp(i,"font-stretch","100%"),s=Qp(i,"unicode-range"),l=Qp(i,"src"),c=Up(l,location.href),u=c.length?c.map(e=>String(e).toLowerCase()).sort().join("|"):l.toLowerCase(),f=[String(e||"").toLowerCase(),t,o,a,s.toLowerCase(),u].join("|");n.has(f)||(n.add(f),r.push(i))}if(0===r.length)return e;let i=0;return e.replace(t,()=>r[i++]||"")}(g),Xf.resource?.set(u,g)),g}function Vp(e,t){let n=new Set,r=new Set;if(!e)return{required:n,usedCodepoints:r};let i=e=>{if(e)for(let t of e)r.add(t.codePointAt(0))},o=e=>{let t=function(e){if(!e)return[];let t=[];for(let n of e.split(",")){let e=n.trim().replace(/^['"]+|['"]+$/g,"");e&&(wp.has(e.toLowerCase())||t.push(e))}return t}(e.fontFamily);if(t.length)for(let r of t)n.add(`${r}__${Cp(e.fontWeight)}__${Ep(e.fontStyle)}__${Bp(e.fontStretch)}`)},a=e=>{o(yd(e));for(let t of["::before","::after"]){let n=yd(e,t),a=n&&n.content;if(a&&"none"!==a&&"normal"!==a)if(o(n),/^["']/.test(a))i(a.slice(1,-1));else{let e=a.match(/\\[0-9A-Fa-f]{1,6}/g);if(e)for(let t of e)try{r.add(parseInt(t.slice(1),16))}catch{}}}};a(e);let s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;s.nextNode();){let e=s.currentNode;if(e.nodeType===Node.TEXT_NODE){if(t&&e.parentElement&&!t(e.parentElement))continue;i(e.nodeValue||"")}else{if(t&&!t(e))continue;a(e)}}return{required:n,usedCodepoints:r}}async function Yp(e,t=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(e||[]).filter(Boolean);if(0===r.length)return;let i=()=>{let e=n.createElement("div");e.setAttribute("data-snapdom-internal",""),e.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let t of r){let r=n.createElement("span");r.textContent="AaBbGg1234ÁÉÍÓÚçñ—∞",r.style.fontFamily=`"${t}"`,r.style.fontWeight="700",r.style.fontStyle="italic",r.style.fontSize="32px",r.style.lineHeight="1",r.style.whiteSpace="nowrap",r.style.margin="0",r.style.padding="0",e.appendChild(r)}n.body.appendChild(e),e.offsetWidth,n.body.removeChild(e)};for(let e=0;e<Math.max(1,t);e++)i(),await Rd(),await Rd()}function Wp(e,t=!1){let n="",r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function Gp(e,t=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,e)),i="";for(let[e,t]of n)for(;r>=e;)i+=t,r-=e;return t?i:i.toLowerCase()}function Jp(e,t){switch((t||"decimal").toLowerCase()){case"decimal":default:return String(e);case"decimal-leading-zero":{let t=Math.abs(e);return(e<0?"-":"")+(t<10?"0":"")+String(t)}case"lower-alpha":return Wp(e,!1);case"upper-alpha":return Wp(e,!0);case"lower-roman":return Gp(e,!1);case"upper-roman":return Gp(e,!0)}}function _p(e){let t=new WeakMap,n=e instanceof Document?e.documentElement:e,r=e=>{let t=0,n=e?.parentElement;if(!n)return 0;for(let r of n.children){if(r===e)break;"LI"===r.tagName&&t++}return t},i=(e,t,n)=>{let i,o,a,s=(e=>{let t=new Map;for(let[n,r]of e)t.set(n,r.slice());return t})(e);try{i=n.style?.counterReset||getComputedStyle(n).counterReset}catch{}if(i&&"none"!==i)for(let e of i.split(",")){let n=e.trim().split(/\s+/),r=n[0],i=Number.isFinite(Number(n[1]))?Number(n[1]):0;if(!r)continue;let o=t.get(r);if(o&&o.length){let e=o.slice();e.push(i),s.set(r,e)}else s.set(r,[i])}try{o=n.style?.counterSet||getComputedStyle(n).counterSet}catch{}if(o&&"none"!==o)for(let e of o.split(",")){let t=e.trim().split(/\s+/),n=t[0],r=Number.isFinite(Number(t[1]))?Number(t[1]):0;if(!n)continue;let i=s.get(n)||[];0===i.length&&i.push(0),i[i.length-1]=r,s.set(n,i)}try{a=n.style?.counterIncrement||getComputedStyle(n).counterIncrement}catch{}if(a&&"none"!==a)for(let e of a.split(",")){let t=e.trim().split(/\s+/),n=t[0],r=Number.isFinite(Number(t[1]))?Number(t[1]):1;if(!n)continue;let i=s.get(n)||[];0===i.length&&i.push(0),i[i.length-1]+=r,s.set(n,i)}try{if("list-item"===getComputedStyle(n).display&&(e=>e&&"LI"===e.tagName)(n)){let e=n.parentElement,t=1;if(e&&"OL"===e.tagName){let i=e.getAttribute("start"),o=Number.isFinite(Number(i))?Number(i):1,a=r(n),s=n.getAttribute("value");t=Number.isFinite(Number(s))?Number(s):o+a}else t=1+r(n);let i=s.get("list-item")||[];0===i.length&&i.push(0),i[i.length-1]=t,s.set("list-item",i)}}catch{}return s},o=(e,n,r)=>{let a=i(r,n,e);t.set(e,a);let s=a;for(let t of e.children)s=o(t,a,s);let l=new Map;for(let[e,t]of r){let n=t.length,r=s.get(e);l.set(e,r&&r.length?r.slice(0,n):t.slice())}for(let[e,t]of s)!l.has(e)&&t.length&&!n.has(e)&&l.set(e,t.slice(0,1));return l},a=new Map;return o(n,a,a),{get(e,n){let r=t.get(e)?.get(n);return r&&r.length?r[r.length-1]:0},getStack(e,n){let r=t.get(e)?.get(n);return r?r.slice():[]}}}ud();var Xp=new WeakMap;function Kp(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Zp(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let e=0;e<t.length;e++){let i=t[e];if("STYLE"===i.tagName){n+=`S${i.textContent?i.textContent.length:0}|`;let e=i.sheet,t=e?Kp(e):null;t&&(r+=t.length)}else{n+=`L${i.getAttribute("href")||""}|m:${i.getAttribute("media")||"all"}|`;let e=i.sheet,t=e?Kp(e):null;t&&(r+=t.length)}}let i=e.adoptedStyleSheets;return n+=`ass:${Array.isArray(i)?i.length:0}|tr:${r}`,n}function eg(e,t,n){let r=Kp(e);if(!r)return!1;for(let e=0;e<r.length;e++){if(n.budget<=0)return!1;let i=r[e],o=i&&i.cssText?i.cssText:"";n.budget--;for(let e of t)if(o.includes(e))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let e=0;e<i.cssRules.length&&n.budget>0;e++){let r=i.cssRules[e],o=r&&r.cssText?r.cssText:"";n.budget--;for(let e of t)if(o.includes(e))return!0}if(n.budget<=0)return!1}return!1}function tg(e=document,t=Zp(e)){let n=Xp.get(e);if(n&&n.fingerprint===t)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],i=e.querySelectorAll("style");for(let n=0;n<i.length;n++){let o=i[n].textContent||"";for(let n of r)if(o.includes(n))return Xp.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let n={budget:1e3};try{for(let i of o)if(eg(i,r,n))return Xp.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let n=e.querySelectorAll('style,link[rel~="stylesheet"]'),i={budget:1e3};for(let o=0;o<n.length&&i.budget>0;o++){let a=n[o],s=null;if(a.tagName,s=a.sheet||null,s&&eg(s,r,i))return Xp.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Xp.set(e,{fingerprint:t,result:!0}),!0):(Xp.set(e,{fingerprint:t,result:!1}),!1)}function ng(e){for(let t of["Top","Right","Bottom","Left"]){let n=parseFloat(e[`border${t}Width`])||0,r=e[`border${t}Style`];if(n>0&&r&&"none"!==r&&"hidden"!==r)return!0}return!1}function rg(e){if(!e)return"";let t,n=[],r=/"([^"]*)"/g,i=0;for(;t=r.exec(e);){let o=e.slice(i,t.index).trim();o&&n.push(o),n.push(t[1]),i=r.lastIndex}let o=e.slice(i).trim();return o&&n.push(o),n.join("")}function ig(e,t,n){let r=e.parentElement,i=r&&n?n.get(r):null;return i?{get(e,n){let r=t.get(e,n),o=i.get(n);return"number"==typeof o?Math.max(r,o):r},getStack(e,n){let r=t.getStack(e,n);if(!r.length)return r;let o=i.get(n);if("number"==typeof o){let e=r.slice();return e[e.length-1]=Math.max(e[e.length-1],o),e}return r}}:t}function og(e,t,n){let r=new Map;function i(e){let t=[];if(!e||"none"===e)return t;for(let n of String(e).split(",")){let e=n.trim().split(/\s+/),r=e[0],i=Number.isFinite(Number(e[1]))?Number(e[1]):void 0;r&&t.push({name:r,num:i})}return t}let o=i(t?.counterReset),a=i(t?.counterSet),s=i(t?.counterIncrement);function l(t){if(r.has(t))return r.get(t).slice();let i=n.getStack(e,t);i=i.length?i.slice():[];let l=o.find(e=>e.name===t);if(l){let e=Number.isFinite(l.num)?l.num:0;i=i.length?[...i,e]:[e]}let c=a.find(e=>e.name===t);if(c){let e=Number.isFinite(c.num)?c.num:0;0===i.length&&(i=[0]),i[i.length-1]=e}let u=s.find(e=>e.name===t);if(u){let e=Number.isFinite(u.num)?u.num:1;0===i.length&&(i=[0]),i[i.length-1]+=e}return r.set(t,i.slice()),i}return{get(e,t){let n=l(t);return n.length?n[n.length-1]:0},getStack:(e,t)=>l(t),__incs:s}}function ag(e,t,n,r){let i;try{i=yd(e,t)}catch{}let o=i?.content;if(!o||"none"===o||"normal"===o)return{text:"",incs:[]};o=function(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if('"'===r)t=!t;else if("/"===r&&!t)return e.slice(0,n).trim()}return e}(o);let a=og(e,i,ig(e,n,r)),s=function(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}(o)?function(e,t,n){if(!e||"none"===e)return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g;return e.replace(r,(e,r,i)=>{let o=String(i).split(",").map(e=>e.trim());if("counter"===r){let e=o[0]?.replace(/^["']|["']$/g,""),r=(o[1]||"decimal").toLowerCase();return Jp(n.get(t,e),r)}{let e=o[0]?.replace(/^["']|["']$/g,""),r=o[1]?.replace(/^["']|["']$/g,"")??"",i=(o[2]||"decimal").toLowerCase(),a=n.getStack(t,e);return a.length?a.map(e=>Jp(e,i)).join(r):""}})}catch{return"- "}}(o,e,a):o;return{text:rg(s),incs:a.__incs||[]}}async function sg(e,t,n,r){if(1!==e?.nodeType||1!==t?.nodeType||"TEXTAREA"===e.tagName)return;if(!function(e,t){let n=Zp(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=tg(e,n),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):tg(e,n)}(e.ownerDocument||document,n))return;n.__siblingCounters||(n.__siblingCounters=new WeakMap),n.__counterCtx||(n.__counterCtx=function(e,t){let n=null,r=()=>{if(!n)try{n=_p(e)}catch(e){Od(t,"buildCounterContext failed",e),n={get:()=>0,getStack:()=>[]}}return n};return{get:(e,t)=>r().get(e,t),getStack:(e,t)=>r().getStack(e,t)}}(e.ownerDocument||document,n));let i=n.__counterCtx;for(let o of["::before","::after","::first-letter"])try{let a=yd(e,o);if(!a||"none"===a.content&&"none"===a.backgroundImage&&"transparent"===a.backgroundColor&&!ng(a)&&(!a.transform||"none"===a.transform)&&"inline"===a.display)continue;if("::first-letter"===o){let r=yd(e),i=(r?.display||"").toLowerCase();if(i.includes("flex")||i.includes("grid"))continue;let o=e=>a[e]!==r[e]&&0!==(parseFloat(a[e])||0);if(!(a.color!==r.color||a.fontSize!==r.fontSize||a.fontWeight!==r.fontWeight||a.fontFamily!==r.fontFamily||a.fontStyle!==r.fontStyle||a.textTransform!==r.textTransform||a.float!==r.float&&"none"!==a.float||o("paddingTop")||o("paddingRight")||o("paddingBottom")||o("paddingLeft")||o("marginTop")||o("marginRight")||o("marginBottom")||o("marginLeft")))continue;let s=Array.from(t.childNodes).find(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim().length>0);if(!s)continue;let l=s.textContent,c=l.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],u=l.slice(c?.length||0);if(!c||/[\uD800-\uDFFF]/.test(c))continue;let f=document.createElement("span");f.textContent=c,f.dataset.snapdomPseudo="::first-letter";let d=md(vd(a),"span");n.styleMap.set(f,d);let h=document.createTextNode(u);t.replaceChild(h,s),t.insertBefore(f,h);continue}let s=a.content??"",l=""===s||"none"===s||"normal"===s,{text:c,incs:u}=ag(e,o,i,n.__siblingCounters),f=a.backgroundImage,d=a.backgroundColor,h=a.fontFamily,p=parseInt(a.fontSize)||32,g=parseInt(a.fontWeight)||!1,m=a.color||"#000",y=a.transform,v=gp(h),A=!l&&""!==c,b=f&&"none"!==f,w=d&&"transparent"!==d&&"rgba(0, 0, 0, 0)"!==d,I=ng(a),x=y&&"none"!==y,C="none"!==s&&"normal"!==s,E=C&&((parseFloat(a.width)||0)>0||(parseFloat(a.height)||0)>0),B=C&&a.boxShadow&&"none"!==a.boxShadow,S=C&&a.outlineStyle&&"none"!==a.outlineStyle&&(parseFloat(a.outlineWidth)||0)>0;if(!(A||b||w||I||x||E||B||S)){if(u&&u.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||new Map;for(let{name:r}of u){if(!r)continue;let a=ig(e,i,n.__siblingCounters),s=og(e,yd(e,o),a).get(e,r);t.set(r,s)}n.__siblingCounters.set(e.parentElement,t)}continue}let k=c.startsWith("url(")||/^-?(?:webkit-)?image-set\(/i.test(c),F=!1;if(A&&!v&&c.length>1&&!k){let n=yd(e),r=parseFloat(n.fontSize)||16,i=parseFloat(n.lineHeight);Number.isFinite(i)||(i=1.5*r),e.getBoundingClientRect().height<1.6*i&&(t.style.whiteSpace="nowrap",F=!0)}let D=document.createElement("span");D.dataset.snapdomPseudo=o,D.style.pointerEvents="none",F&&(D.style.whiteSpace="nowrap");let N=vd(a),M=(yd(e).display||"").toLowerCase(),T=M.includes("flex")||M.includes("grid");if(T){let e=N["min-width"];(!e||"auto"===e||"0px"===e)&&(N["min-width"]="0px")}let Q=md(N,"span",A,T);if(n.styleMap.set(D,Q),v&&c&&1===c.length){let{dataUrl:e,width:n,height:r}=await bp(c,h,g,p,m),i=document.createElement("img");i.src=e,i.style=`height:${p}px;width:${n/r*p}px;object-fit:contain;`,D.appendChild(i),t.dataset.snapdomHasIcon="true"}else if(c&&k){let t=ed(c,typeof devicePixelRatio<"u"&&devicePixelRatio||1)??Zf(c);if(t?.trim())try{let e=await ad(td(t),{as:"dataURL",useProxy:r.useProxy});if(e?.ok&&"string"==typeof e.data){let t=document.createElement("img");t.src=e.data,t.style=`width:${p}px;height:auto;object-fit:contain;`,D.appendChild(t)}}catch(t){console.error(`[snapdom] Error in pseudo ${o} for`,e,t)}}else!v&&A&&(D.textContent=c);D.style.backgroundImage="none","maskImage"in D.style&&(D.style.maskImage="none"),"webkitMaskImage"in D.style&&(D.style.webkitMaskImage="none");try{D.style.backgroundRepeat=a.backgroundRepeat,D.style.backgroundSize=a.backgroundSize,a.backgroundPositionX&&a.backgroundPositionY?(D.style.backgroundPositionX=a.backgroundPositionX,D.style.backgroundPositionY=a.backgroundPositionY):D.style.backgroundPosition=a.backgroundPosition,D.style.backgroundOrigin=a.backgroundOrigin,D.style.backgroundClip=a.backgroundClip,D.style.backgroundAttachment=a.backgroundAttachment,D.style.backgroundBlendMode=a.backgroundBlendMode}catch{}if(b)try{let e=Ad(f),t=await Promise.all(e.map(fd));D.style.backgroundImage=t.join(", ")}catch(e){console.warn(`[snapdom] Failed to inline background-image for ${o}`,e)}w&&(D.style.backgroundColor=d);let L=D.childNodes.length>0||""!==D.textContent?.trim()||b||w||I||x||E||B||S;if(u&&u.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||new Map,r=ig(e,i,n.__siblingCounters),a=og(e,yd(e,o),r);for(let{name:n}of u){if(!n)continue;let r=a.get(e,n);t.set(n,r)}n.__siblingCounters.set(e.parentElement,t)}if(!L)continue;"::before"===o?(t.dataset.snapdomHasBefore="1",t.insertBefore(D,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(D))}catch(t){console.warn(`[snapdom] Failed to capture ${o} for`,e,t)}let o=Array.from(t.children).filter(e=>!e.dataset.snapdomPseudo);if(n.nodeMap)for(let e of o){let t=n.nodeMap.get(e);1===t?.nodeType&&await sg(t,e,n,r)}else{let t=Array.from(e.children);for(let e=0;e<Math.min(t.length,o.length);e++)await sg(t[e],o[e],n,r)}}function lg(e,t){if(!e||1!==e?.nodeType)return;let n=e.ownerDocument||document,r=t||n,i=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(0===i.length)return;let o=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],s=e=>{if(!e||!e.getAttribute)return null;let t=e.getAttribute("href")||e.getAttribute("xlink:href")||("function"==typeof e.getAttributeNS?e.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(t)return t;let n=e.attributes;if(!n)return null;for(let e=0;e<n.length;e++){let t=n[e];if(!t||!t.name)continue;if("href"===t.name)return t.value;let r=t.name.indexOf(":");if(-1!==r&&"href"===t.name.slice(r+1))return t.value}return null},l=new Set(Array.from(e.querySelectorAll("[id]")).map(e=>e.id)),c=new Set,u=!1,f=(e,t=null)=>{if(!e)return;let n;for(o.lastIndex=0;n=o.exec(e);){u=!0;let e=(n[1]||"").trim();e&&(l.has(e)||(c.add(e),t&&!t.has(e)&&t.add(e)))}},d=e=>{let t=e.querySelectorAll("use");for(let e of t){let t=s(e);if(!t||!t.startsWith("#"))continue;u=!0;let n=t.slice(1).trim();n&&!l.has(n)&&c.add(n)}f(e.getAttribute("style")||"");for(let t of a)f(e.getAttribute(t));let n=e.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let e of n){f(e.getAttribute("style")||"");for(let t of a)f(e.getAttribute(t))}};for(let e of i)d(e);if(!u)return;let h=e.querySelector("svg.inline-defs-container");h||(h=n.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(h,e.firstChild||null));let p=h.querySelector("defs")||null,g=t=>{if(!t||l.has(t))return null;let n=(e=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,"\\$&"))(t),i=t=>{let n=r.querySelector(t);return n&&!e.contains(n)?n:null};return i(`svg defs > *#${n}`)||i(`svg > symbol#${n}`)||i(`*#${n}`)};if(!c.size)return;let m=new Set(c),y=new Set;for(;m.size;){let e=m.values().next().value;if(m.delete(e),!e||l.has(e)||y.has(e))continue;let t=g(e);if(!t){y.add(e);continue}p||(p=n.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(p));let r=t.cloneNode(!0);r.id||r.setAttribute("id",e),p.appendChild(r),y.add(e),l.add(e);let i=[r,...r.querySelectorAll("*")];for(let e of i){let t=s(e);if(t&&t.startsWith("#")){let e=t.slice(1).trim();e&&!l.has(e)&&!y.has(e)&&m.add(e)}let n=e.getAttribute?.("style")||"";n&&f(n,m);for(let t of a){let n=e.getAttribute?.(t);n&&f(n,m)}}}}function cg(e){if(!e||"none"===e)return{top:0,right:0,bottom:0,left:0};let t=[],n="",r=0;for(let i=0;i<e.length;i++){let o=e[i];"("===o?r++:")"===o&&(r=Math.max(0,r-1)),","===o&&0===r?(t.push(n),n=""):n+=o}n.trim()&&t.push(n);let i=0,o=0,a=0,s=0;for(let e of t){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(\.\d+)?px/g)?.map(e=>parseFloat(e))||[];if(t.length<2)continue;let[n,r,l=0,c=0]=t,u=Math.abs(n)+l+c,f=Math.abs(r)+l+c;o=Math.max(o,u+Math.max(n,0)),s=Math.max(s,u+Math.max(-n,0)),a=Math.max(a,f+Math.max(r,0)),i=Math.max(i,f+Math.max(-r,0))}return{top:Math.ceil(i),right:Math.ceil(o),bottom:Math.ceil(a),left:Math.ceil(s)}}function ug(e,t,n,r,i){let o=n.a,a=n.b,s=n.c,l=n.d,c=n.e||0,u=n.f||0;function f(e,t){let n=e-r,f=t-i,d=o*n+s*f,h=a*n+l*f;return d+=r+c,h+=i+u,[d,h]}let d=[f(0,0),f(e,0),f(0,t),f(e,t)],h=1/0,p=1/0,g=-1/0,m=-1/0;for(let[e,t]of d)e<h&&(h=e),t<p&&(p=t),e>g&&(g=e),t>m&&(m=t);return{minX:h,minY:p,maxX:g,maxY:m,width:g-h,height:m-p}}function fg(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[i,o]=[r[0]||"0",r[1]||"0"],a=(e,t)=>{let n=e.toLowerCase();return"left"===n||"top"===n?0:"center"===n?t/2:"right"===n||"bottom"===n?t:n.endsWith("px")?parseFloat(n)||0:n.endsWith("%")?(parseFloat(n)||0)*t/100:/^-?\d+(\.\d+)?$/.test(n)&&parseFloat(n)||0};return{ox:a(i,t),oy:a(o,n)}}function dg(e){let t={rotate:"0deg",scale:null,translate:null},n="function"==typeof e.computedStyleMap?e.computedStyleMap():null;if(n){let r=e=>{try{return"function"==typeof n.has&&!n.has(e)||"function"!=typeof n.get?null:n.get(e)}catch{return null}},i=r("rotate");if(i)if(i.angle){let e=i.angle;t.rotate="rad"===e.unit?180*e.value/Math.PI+"deg":e.value+e.unit}else i.unit?t.rotate="rad"===i.unit?180*i.value/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let n=getComputedStyle(e);t.rotate=n.rotate&&"none"!==n.rotate?n.rotate:"0deg"}let o=r("scale");if(o){let e="x"in o&&null!=o.x?.value?o.x.value:Array.isArray(o)?o[0]?.value:Number(o)||1,n="y"in o&&null!=o.y?.value?o.y.value:Array.isArray(o)?o[1]?.value:e;t.scale=`${e} ${n}`}else{let n=getComputedStyle(e);t.scale=n.scale&&"none"!==n.scale?n.scale:null}let a=r("translate");if(a){let e="x"in a&&"value"in a.x?a.x.value:Array.isArray(a)?a[0]?.value:0,n="y"in a&&"value"in a.y?a.y.value:Array.isArray(a)?a[1]?.value:0,r="x"in a&&a.x?.unit?a.x.unit:"px",i="y"in a&&a.y?.unit?a.y.unit:"px";t.translate=`${e}${r} ${n}${i}`}else{let n=getComputedStyle(e);t.translate=n.translate&&"none"!==n.translate?n.translate:null}return t}let r=getComputedStyle(e);return t.rotate=r.rotate&&"none"!==r.rotate?r.rotate:"0deg",t.scale=r.scale&&"none"!==r.scale?r.scale:null,t.translate=r.translate&&"none"!==r.translate?r.translate:null,t}Kf(),Pd(),Qd();var hg=null;function pg(e){let t=function(){if(hg)return hg;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),hg=e,e}(),n=document.createElement("div");n.style.transformOrigin="0 0",e.baseTransform&&(n.style.transform=e.baseTransform),e.rotate&&(n.style.rotate=e.rotate),e.scale&&(n.style.scale=e.scale),e.translate&&(n.style.translate=e.translate),t.appendChild(n);let r=function(e){let t=getComputedStyle(e).transform;if(!t||"none"===t)return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}(n);return t.removeChild(n),r}var gg="http://www.w3.org/1999/xhtml",mg=new WeakSet;function yg(e,t){if(!t)return null;let n,r,i,o,a=e.ownerDocument||document,s=a.defaultView||window;if("viewport"===t)n=0,r=0,i=a.documentElement?.clientWidth||s.innerWidth,o=a.documentElement?.clientHeight||s.innerHeight;else{if("object"!=typeof t)return null;n=(Number(t.x)||0)-(s.scrollX||0),r=(Number(t.y)||0)-(s.scrollY||0),i=Number(t.width),o=Number(t.height)}return i>0&&o>0?{left:n,top:r,width:i,height:o,right:n+i,bottom:r+o}:null}function vg(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode&&e.getRootNode();return t instanceof ShadowRoot?t.host:null}function Ag(e,t){for(let n=t;n;n=vg(n))if(n===e)return!0;return!1}function bg(e,t){for(let n=vg(e);n&&n!==t&&1===n?.nodeType;n=vg(n)){let e=yd(n);if("static"!==e.position||e.transform&&"none"!==e.transform||e.filter&&"none"!==e.filter||e.backdropFilter&&"none"!==e.backdropFilter||e.perspective&&"none"!==e.perspective||/transform|perspective|filter/.test(e.willChange||"")||/layout|paint|strict|content/.test(e.contain||""))return n}return null}function wg(e,t){try{let n=new DOMMatrix;if(t&&t.rotate&&"0deg"!==t.rotate&&(n=n.multiply(new DOMMatrix(`rotate(${t.rotate})`))),t&&t.scale){let e=String(t.scale).trim().split(/\s+/).filter(Boolean);e.length&&e.every(e=>Number.isFinite(Number(e)))&&(n=n.multiply(new DOMMatrix(`scale(${e.join(",")})`)))}return e&&(n=n.multiply(new DOMMatrix(e))),n}catch{return null}}function Ig(e){let t=e.display||"";if(t.includes("flex")||t.includes("grid")||t.startsWith("table")||"inline-block"===t||"flow-root"===t||"absolute"===e.position||"fixed"===e.position||e.float&&"none"!==e.float)return!0;let n=e.overflowX||e.overflow||"visible",r=e.overflowY||e.overflow||"visible";return!!("visible"!==n||"visible"!==r||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function xg(e,t){let n=Array.from(e.childNodes),r="top"===t?n:n.reverse();for(let e of r){if(e.nodeType===Node.TEXT_NODE){if(/\S/.test(e.textContent||""))return null;continue}if(e.nodeType!==Node.ELEMENT_NODE)continue;let t=getComputedStyle(e),n=String(t.display||"");if("none"!==n&&"contents"!==n&&"absolute"!==t.position&&"fixed"!==t.position)return t.float&&"none"!==t.float||n.startsWith("inline")?null:e}return null}var Cg=/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g;function Eg(e,t={}){e&&(function(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;i.nextNode();){let e=i.currentNode;for(let t of Array.from(e.attributes)){let i=t.name;if(i.startsWith("*"))e.removeAttribute(i);else if(i.includes("@"))e.removeAttribute(i);else{if(i.includes(":")){let t=i.split(":",1)[0];if(!r.has(t)){e.removeAttribute(i);continue}}n&&(i.startsWith("x-")||i.startsWith("v-")||i.startsWith(":")||i.startsWith("on:")||i.startsWith("bind:")||i.startsWith("let:")||i.startsWith("class:"))&&e.removeAttribute(i)}}}}(e,t),function(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let e of n)e.remove()}(e),function(e){if(!e)return;let t=e=>{if(e.nodeType===Node.ELEMENT_NODE){if(e.attributes)for(let t of Array.from(e.attributes)){let n=t.value.replace(Cg,"");if(n!==t.value)try{e.setAttribute(t.name,n)}catch{}}}else if(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.CDATA_SECTION_NODE){let t=e.data.replace(Cg,"");t!==e.data&&(e.data=t)}};t(e);let n,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);for(;n=r.nextNode();)t(n)}(e))}function Bg(e,t){if(1!==e?.nodeType||function(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}(e)||function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}(e))return!1;let n=t.position;if("absolute"===n||"fixed"===n||"sticky"===n)return!1;let r=t.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||t.transform&&"none"!==t.transform)}function Sg(e){let t=getComputedStyle(e);return!("none"===t.display||"absolute"===t.position||"fixed"===t.position)}function kg(e,t){if(1!==e?.nodeType)return!1;if("exclude"===e.getAttribute("data-capture")&&"remove"===t?.excludeMode)return!0;if(Array.isArray(t?.exclude))for(let n of t.exclude)try{if(e.matches(n))return"remove"===t.excludeMode}catch(e){Od(t,"exclude selector match failed",e)}if("function"==typeof t?.filter&&"remove"===t.filterMode)try{if(!t.filter(e))return!0}catch(e){Od(t,"filter function failed",e)}return!1}var Fg=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,Dg=.75;var Ng=/::-webkit-scrollbar(-[a-z]+)?\b/i;function Mg(e,t=new Set){let n="";if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=Mg(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let e=Mg(i.cssRules,t);e&&(n+=`@media ${i.conditionText}{${e}}`);continue}if(i.type===CSSRule.STYLE_RULE){let e=i.selectorText||"";if(Ng.test(e)){let e=i.cssText;e&&!t.has(e)&&(t.add(e),n+=e)}}}catch{}}return n}var Tg=new WeakMap;Hd();var Qg=new Set;async function Lg(e,t={}){let n=t.__session||Xf.session,r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:t},i=null;if(t.clip){let n=yg(e,t.clip);if(n){r.clip={rect:n,root:e};let t=e.getBoundingClientRect();i={x:n.left-t.left,y:n.top-t.top,width:n.width,height:n.height}}}let o,a="",s="";if(Qg.size){let t=(e,t)=>{for(let n=t;n;n=n.assignedSlot||n.parentElement||n.getRootNode()?.host)if(n===e)return!0;return!1};for(;;){let n=[...Qg].filter(({root:n})=>t(n,e)||t(e,n)).map(({promise:e})=>e.catch(()=>{}));if(!n.length)break;await Promise.all(n)}}if(!r.clip&&e.isConnected&&"hidden"!==e.ownerDocument?.visibilityState)try{let t=e.getBoundingClientRect(),n=e.ownerDocument?.defaultView||window,r=t.right<=0||t.bottom<=0||t.left>=n.innerWidth||t.top>=n.innerHeight,i=[];if(r&&(()=>{let t=[];e.shadowRoot&&t.push(e.shadowRoot);for(let n of e.querySelectorAll("*"))n.shadowRoot&&t.push(n.shadowRoot);for(;t.length;){let e=t.pop(),n="calcite-icon"===e.host?.localName;for(let r of e.querySelectorAll("*")){if(r.shadowRoot&&t.push(r.shadowRoot),!n||"svg"!==r.localName)continue;let e=r.querySelectorAll("path");if(!e.length||[...e].some(e=>e.getAttribute("d")?.trim()))continue;let o=r.getBoundingClientRect();o.width&&o.height&&i.push(r)}}})(),i.length){let t=(async()=>{let t=e.style,r=e.hasAttribute("style"),o=new Map,a=(e,n)=>{o.has(e)||o.set(e,{value:t.getPropertyValue(e),priority:t.getPropertyPriority(e)}),t.setProperty(e,n,"important");let r=o.get(e);r.forcedValue=t.getPropertyValue(e),r.forcedPriority=t.getPropertyPriority(e)};try{a("left","0"),a("top","0"),a("right","auto"),a("bottom","auto"),a("margin-top","0"),a("margin-right","0"),a("margin-bottom","0"),a("margin-left","0"),a("transform","none"),a("translate","none"),a("opacity","0"),a("pointer-events","none");let t=e.getBoundingClientRect();if(t.right<=0||t.bottom<=0||t.left>=n.innerWidth||t.top>=n.innerHeight){let t=e.parentElement?.getBoundingClientRect(),r=t&&t.right>0&&t.left<n.innerWidth?Math.max(0,t.left):0,i=t&&t.bottom>0&&t.top<n.innerHeight?Math.max(0,t.top):0;a("position","fixed"),a("left",`${r}px`),a("top",`${i}px`)}await Rd(100);let r=Date.now()+1500,o=()=>i.some(e=>{if([...e.querySelectorAll("path")].some(e=>e.getAttribute("d")?.trim()))return!1;let t=e.getBoundingClientRect();return t.width&&t.height&&t.right>0&&t.bottom>0&&t.left<n.innerWidth&&t.top<n.innerHeight});for(;Date.now()<r&&o();)await new Promise(e=>setTimeout(e,25));await Rd(100)}finally{for(let[e,n]of o)t.getPropertyValue(e)!==n.forcedValue||t.getPropertyPriority(e)!==n.forcedPriority||(n.value?t.setProperty(e,n.value,n.priority):t.removeProperty(e));!r&&!t.length&&e.removeAttribute("style"),await Rd(100)}})(),r={root:e,promise:t};Qg.add(r);try{await t}finally{Qg.delete(r)}}}catch{}let l=function(e){let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=t.borderStyle,o=t.borderWidth,a="none"!==n&&parseFloat(r)>0,s="none"===i||0===parseFloat(o);if(a&&s){let t=e.style.border;return e.style.border=`${r} solid transparent`,()=>{e.style.border=t}}return()=>{}}(e),c=r.clip?()=>{}:function(e){let t=[];try{let n=e.querySelectorAll("*");for(let e of n){if(!(e instanceof HTMLElement))continue;let n=e.style.contentVisibility||"",r=getComputedStyle(e);"auto"===(r.contentVisibility||r.getPropertyValue("content-visibility")||"")&&(t.push({el:e,original:n}),e.style.contentVisibility="visible")}if(e instanceof HTMLElement){let n=getComputedStyle(e);"auto"===(n.contentVisibility||n.getPropertyValue("content-visibility")||"")&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:e,original:n}of t)try{e.style.contentVisibility=n}catch{}}}(e);try{o=await cp(e,r,t)}catch(e){throw console.warn("deepClone failed:",e),e}finally{c(),l()}try{lg(o)}catch(e){console.warn("inlineExternal defs or symbol failed:",e)}try{await sg(e,o,r,t)}catch(e){console.warn("inlinePseudoElements failed:",e)}await async function(e,t=null){if(!e)return;let n=t,r=tp(e,"img");for(let e of r)try{let t=e.getAttribute("src")||e.currentSrc||"";if(Kh(t)){let n=await Jh(t);e.setAttribute("src",n)}let r=e.getAttribute("srcset");if(r&&r.includes("blob:")){let t=Zh(r),i=!1;for(let e of t)if(Kh(e.url))try{e.url=await Jh(e.url),i=!0}catch(e){Od(n,"blobUrlToDataUrl for srcset item failed",e)}i&&e.setAttribute("srcset",ep(t))}}catch(e){Od(n,"resolveBlobUrls for img failed",e)}let i=tp(e,"image");for(let e of i)try{let t="http://www.w3.org/1999/xlink",n=e.getAttribute("href")||e.getAttributeNS?.(t,"href");if(Kh(n)){let r=await Jh(n);e.setAttribute("href",r),e.removeAttributeNS?.(t,"href")}}catch(e){Od(n,"resolveBlobUrls for SVG image href failed",e)}let o=tp(e,"[style*='blob:']");for(let e of o)try{let t=e.getAttribute("style");if(t&&t.includes("blob:")){let n=await Xh(t);e.setAttribute("style",n)}}catch(e){Od(n,"replaceBlobUrls in inline style failed",e)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let e of a)try{let t=e.textContent||"";t.includes("blob:")&&(e.textContent=await Xh(t))}catch(e){Od(n,"replaceBlobUrls in style tag failed",e)}let s=["poster"];for(let t of s){let r=tp(e,`[${t}^='blob:']`);for(let e of r)try{let n=e.getAttribute(t);Kh(n)&&e.setAttribute(t,await Jh(n))}catch(e){Od(n,`resolveBlobUrls for ${t} failed`,e)}}}(o,r);try{let e=o.querySelectorAll("style[data-sd]");for(let t of e)s+=t.textContent||"",t.remove()}catch(e){Od(r,"Failed to extract shadow CSS from style[data-sd]",e)}let u=function(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let e of t)n.set(e,"c"+r++);return n}(r.styleMap);a=Array.from(u.entries()).map(([e,t])=>`.${t}{${e}}`).join(""),a=s+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+a;for(let[e,t]of r.styleMap.entries()){if("STYLE"===e.tagName)continue;if(e.getRootNode&&e.getRootNode()instanceof ShadowRoot){e.setAttribute("style",t.replace(/;/g,"; "));continue}let n=u.get(t);n&&e.classList.add(n);let r=e.style?.backgroundImage,i=e.dataset?.snapdomHasIcon;r&&"none"!==r&&(e.style.backgroundImage=r),i&&(e.style.verticalAlign="middle",e.style.display="inline")}if((r.clip||e.scrollTop||e.scrollLeft)&&1===o?.nodeType)try{let t=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};!function(e,t,n,r,i){let o=e.getBoundingClientRect();1===t?.nodeType&&t.namespaceURI===gg&&"static"===yd(e).position&&(t.style.position="relative");let a=[];for(let[t,s]of n){if(1!==t?.nodeType||t.namespaceURI!==gg||1!==s?.nodeType||s===e||!Ag(e,s))continue;let n=r.get(s)||yd(s),l=n.position;if("fixed"!==l&&"sticky"!==l&&"-webkit-sticky"!==l||"absolute"===t.style.position)continue;let c=s.getBoundingClientRect();if(!(c.width>0&&c.height>0))continue;mg.add(t);let u=n.transform&&"none"!==n.transform?n.transform:"",f=dg(s),d=!!(u||"0deg"!==f.rotate||f.scale||f.translate),h=d?wg(u,f):null,p=!h||!h.is2D||1===h.a&&0===h.b&&0===h.c&&1===h.d,g=c.width,m=c.height;p||(g=s.offsetWidth||c.width,m=s.offsetHeight||c.height);let y=s.getRootNode&&s.getRootNode()instanceof ShadowRoot,v=o,A=e.clientLeft||0,b=e.clientTop||0;if(y){let t=bg(s,e);t&&(v=t.getBoundingClientRect(),A=t.clientLeft||0,b=t.clientTop||0)}let w=c.left-v.left-A,I=c.top-v.top-b;if(d)if(t.style.translate="none",t.style.rotate="none",t.style.scale="none",p)t.style.transform="none";else{t.style.transform=`matrix(${h.a},${h.b},${h.c},${h.d},0,0)`;let{ox:e,oy:r}=fg(n,g,m),i=ug(g,m,{a:h.a,b:h.b,c:h.c,d:h.d,e:0,f:0},e,r);w-=i.minX,I-=i.minY}if("fixed"!==l){let e=t.cloneNode(!1);e.setAttribute("data-snap-ph","1"),e.style.position="static",e.style.visibility="hidden",e.style.width=`${g}px`,e.style.height=`${m}px`,e.style.boxSizing="border-box",t.parentElement?.insertBefore(e,t)}let x=g+2,C=m;i&&(Math.abs(I-i.y)<.5&&(I-=1,C+=1),Math.abs(w-i.x)<.5&&(w-=1,x+=1)),t.style.position="absolute",t.style.left=`${w}px`,t.style.top=`${I}px`,t.style.right="auto",t.style.bottom="auto",t.style.margin="0",t.style.width=`${x}px`,t.style.height=`${C}px`,t.style.boxSizing="border-box",y||a.push(t)}for(let e of a)t.appendChild(e)}(e,o,r.nodeMap,r.styleCache,t)}catch(e){Od(r,"freezeViewportPositioned failed",e)}for(let[t,n]of r.nodeMap.entries()){if(r.clip&&n===e)continue;let i=n.scrollLeft,o=n.scrollTop;if((i||o)&&1===t?.nodeType&&"http://www.w3.org/1999/xhtml"===t.namespaceURI){t.style.overflow="hidden",t.style.scrollbarWidth="none",t.style.msOverflowStyle="none";try{let e=t.querySelectorAll("*");for(let t of e){if(1!==t.nodeType||"http://www.w3.org/1999/xhtml"!==t.namespaceURI)continue;let e=t.style.position;if("fixed"===e||"absolute"===e){let n=parseFloat(t.style.top)||0,r=parseFloat(t.style.left)||0;t.style.top=`${n+o}px`,t.style.left=`${r+i}px`,"fixed"===e&&(t.style.position="absolute")}}}catch{}let e=document.createElement("div");for(e.style.all="unset",e.style.transform=`translate(${-i}px, ${-o}px)`,e.style.willChange="transform",e.style.display="inline-block",e.style.width="100%";t.firstChild;)e.appendChild(t.firstChild);t.appendChild(e)}}if(e===r.nodeMap.get(o)){let t=r.styleCache.get(e)||yd(e);r.styleCache.set(e,t);let n=function(e){if(!e||"none"===e)return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(e,t)=>{let n=t.split(",").map(e=>e.trim());return 6!==n.length?`matrix(${t})`:(n[4]="0",n[5]="0",`matrix(${n.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(e,t)=>{let n=t.split(",").map(e=>e.trim());return 16!==n.length?`matrix3d(${t})`:(n[12]="0",n[13]="0",`matrix3d(${n.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}(t.transform);o.style.margin="0",o.style.top="auto",o.style.left="auto",o.style.right="auto",o.style.bottom="auto",o.style.animation="none",o.style.transition="none",o.style.willChange="auto",o.style.float="none",o.style.clear="none",o.style.transform=n||""}for(let[e,t]of r.nodeMap.entries())"PRE"===t.tagName&&(e.style.marginTop="0",e.style.marginBlockStart="0");return{clone:o,classCSS:a,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}ud(),Kf();var Rg="http://www.w3.org/1999/xlink";async function Ug(e,t={}){let n=Array.from(e.querySelectorAll("img"));"IMG"===e.tagName&&n.unshift(e);let r=async e=>{if(!e.getAttribute("src")){let t=e.currentSrc||e.src||Oh(e.getAttribute("srcset"),e)||"";t&&e.setAttribute("src",t)}e.removeAttribute("srcset"),e.removeAttribute("sizes");let n=e.src||"";if(!n)return;let r=Xf.image?.get(n);if(r)return e.src=r,e.width||(e.width=e.naturalWidth||100),void(e.height||(e.height=e.naturalHeight||100));let i=await ad(n,{as:"dataURL",useProxy:t.useProxy});if(i.ok&&"string"==typeof i.data&&i.data.startsWith("data:"))return Xf.image?.set(n,i.data),e.src=i.data,e.width||(e.width=e.naturalWidth||100),void(e.height||(e.height=e.naturalHeight||100));let{width:o,height:a}=function(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,i=parseInt(e.getAttribute("height")||"",10)||0,o=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0;return{width:t||o||r||e.width||e.naturalWidth||100,height:n||a||i||e.height||e.naturalHeight||100}}(e),{fallbackURL:s}=t||{};if(s)try{let r="function"==typeof s?await s({width:o,height:a,src:n,element:e}):s;if(r){let n=await ad(r,{as:"dataURL",useProxy:t.useProxy});if(n?.ok&&"string"==typeof n.data)return e.src=n.data,e.width||(e.width=o),void(e.height||(e.height=a))}}catch{}if(!1!==t.placeholders){let t=document.createElement("div");t.style.cssText=[`width:${o}px`,`height:${a}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${a}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),t.textContent="img",e.replaceWith(t)}else{let t=document.createElement("div");t.style.cssText=`display:inline-block;width:${o}px;height:${a}px;visibility:hidden;`,e.replaceWith(t)}};for(let e=0;e<n.length;e+=6){let t=n.slice(e,e+6).map(r);await Promise.allSettled(t)}let i=Array.from(e.querySelectorAll("image"));"image"===e.localName&&i.unshift(e);let o=async e=>{let n=function(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||("function"==typeof e.getAttributeNS?e.getAttributeNS(Rg,"href"):null)}(e);if(!n||n.startsWith("data:")||n.startsWith("blob:"))return;let r=await ad(n,{as:"dataURL",useProxy:t.useProxy});r.ok&&"string"==typeof r.data&&r.data.startsWith("data:")&&(e.setAttribute("href",r.data),e.removeAttribute("xlink:href"),"function"==typeof e.removeAttributeNS&&e.removeAttributeNS(Rg,"href"))};for(let e=0;e<i.length;e+=6){let t=i.slice(e,e+6).map(o);await Promise.allSettled(t)}}Pd(),Kf();var Hg=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],Og=["mask-position","mask-size","mask-repeat","mask-mode","mask-composite","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","-webkit-mask-composite","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],qg=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],Pg=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];async function $g(e,t,n,r){let i=n.get(e)||yd(e);n.has(e)||n.set(e,i);let o=i.getPropertyValue("border-image"),a=i.getPropertyValue("border-image-source"),s=o&&"none"!==o||a&&"none"!==a,l=i.getPropertyValue("background-image"),c=i.getPropertyValue("background-color");if(l&&"none"!==l||c&&"rgba(0, 0, 0, 0)"!==c&&"transparent"!==c||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue("background")||""))for(let e of qg){let n=i.getPropertyValue(e);n&&t.style.setProperty(e,n)}for(let e of Hg){let n=i.getPropertyValue(e);if("background-image"===e&&(!n||"none"===n)){let e=i.getPropertyValue("background");e&&/url\s*\(/.test(e)&&(n=Ad(e).filter(e=>/url\s*\(/.test(e)).join(", ")||n)}if(!n||"none"===n)continue;let o=Ad(n),a=await Promise.all(o.map(e=>fd(e,r)));a.some(e=>e&&"none"!==e&&!/^url\(undefined/.test(e))&&t.style.setProperty(e,a.join(", "))}for(let e of Og){let n=i.getPropertyValue(e);!n||"initial"===n||t.style.setProperty(e,n)}if(s)for(let e of Pg){let n=i.getPropertyValue(e);!n||"initial"===n||t.style.setProperty(e,n)}}function zg(e,t,n=Xf.session.nodeMap){let r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let e=i.currentNode;e;e=i.nextNode()){let i=n.get(e);if(1!==i?.nodeType)continue;let o=yd(i),a=o.getPropertyValue("backdrop-filter")||o.getPropertyValue("-webkit-backdrop-filter");a&&"none"!==a&&e!==t&&r.push({cloneEl:e,orig:i,bf:a,path:Yg(t,e)})}if(!r.length)return;let o=e.getBoundingClientRect(),a=r.map((e,i)=>{let o=t.cloneNode(!0);(function(e,t,n,r){let i=[[e,t]];for(;i.length;){let[e,t]=i.pop(),o=r.get(t);if(1===o?.nodeType){let t=o.getBoundingClientRect();(t.left>n.right+Vg||t.right<n.left-Vg||t.top>n.bottom+Vg||t.bottom<n.top-Vg)&&("IMG"===e.tagName&&e.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA="),e.style&&(e.style.backgroundImage="none"))}let a=e.children,s=t.children;for(let e=0;e<a.length;e++)i.push([a[e],s[e]])}})(o,t,e.orig.getBoundingClientRect(),n),function(e){if(e)for(let t=e;t&&t.parentNode;){let n=t.parentNode;for(;t.nextSibling;)t.nextSibling.remove();t===e&&t.remove(),t=n}}(Wg(o,e.path));for(let e=0;e<i;e++){let t=Wg(o,r[e].path);t&&(t.style.setProperty("backdrop-filter","none","important"),t.style.setProperty("-webkit-backdrop-filter","none","important"))}return{...e,copy:o}});for(let{cloneEl:e,orig:t,bf:n,copy:r}of a)jg(e,t,n,r,o)}function jg(e,t,n,r,i){let o=t.getBoundingClientRect();if(!o.width||!o.height)return;let a=yd(t),s=t.offsetWidth?o.width/t.offsetWidth:1,l=Math.abs(s-1)>.001?1/s:1;r.style.position="absolute",r.style.left=(i.left-o.left)*l+"px",r.style.top=(i.top-o.top)*l+"px",r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin="0",r.style.filter=n,1!==l&&(r.style.transform=`scale(${l})`,r.style.transformOrigin="top left");let c=document.createElement("div");c.style.cssText="position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2",c.appendChild(r);let u=document.createElement("div");u.style.cssText="position:absolute;inset:0;border-radius:inherit;z-index:-1",u.style.backgroundColor=a.backgroundColor,u.style.backgroundImage=e.style.backgroundImage||a.backgroundImage;for(let e of["background-size","background-position","background-repeat","background-origin","background-clip"])u.style.setProperty(e,a.getPropertyValue(e));e.style.setProperty("background-color","transparent","important"),e.style.setProperty("background-image","none","important"),e.style.setProperty("backdrop-filter","none","important"),e.style.setProperty("-webkit-backdrop-filter","none","important"),"static"===a.position&&(e.style.position="relative"),e.style.isolation="isolate",e.prepend(u),e.prepend(c)}Kf(),Pd();var Vg=128;function Yg(e,t){let n=[];for(let r=t;r!==e;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function Wg(e,t){if(!t)return null;let n=e;for(let e of t)if(n=n.children[e],!n)return null;return n}function Gg(e,t){if(!e)return()=>{};let n=[],r=200;return function e(i){if(t){let e=i.getBoundingClientRect();if(e.width>0||e.height>0){let n=Math.max(e.right,e.left+(i.scrollWidth||0)),o=Math.max(e.bottom,e.top+(i.scrollHeight||0));if(n<t.left-r||e.left>t.right+r||o<t.top-r||e.top>t.bottom+r)return}}let o=getComputedStyle(i),a=function(e,t){if(!e)return()=>{};t=t||getComputedStyle(e);let n=function(e){let t=e.getPropertyValue("-webkit-line-clamp")||e.getPropertyValue("line-clamp");t=(t||"").trim();let n=parseInt(t,10);return Number.isFinite(n)&&n>0?n:0}(t);if(n<=0)return()=>{};if(!_g(e))return()=>{};let r=Jg(e),i=r.text,o=function(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}(t);r.write("X");let a=e.scrollHeight-o;r.restore();let s=a>0?a:function(e){let t=(e.lineHeight||"").trim(),n=parseFloat(e.fontSize)||16;return t&&"normal"!==t?t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith("%")?Math.round(parseFloat(t)/100*n):Math.round(1.2*n):Math.round(1.2*n)}(t),l=Math.round(s*n+o);if(e.scrollHeight<=l+.5)return()=>{};let c=0,u=i.length,f=-1;for(;c<=u;){let t=c+u>>1;r.write(i.slice(0,t)+"…"),e.scrollHeight<=l+.5?(f=t,c=t+1):u=t-1}return r.write((f>=0?i.slice(0,f):"")+"…"),()=>{r.restore()}}(i,o);a&&n.push(a);let s=function(e,t){if(!e)return()=>{};if(t=t||getComputedStyle(e),"ellipsis"!==t.textOverflow)return()=>{};if("nowrap"!==t.whiteSpace&&"pre"!==t.whiteSpace)return()=>{};if("hidden"!==t.overflowX&&"clip"!==t.overflowX)return()=>{};if(!_g(e))return()=>{};if(e.scrollWidth<=e.clientWidth+.5)return()=>{};let n=Jg(e),r=n.text,i=0,o=r.length,a=-1;for(;i<=o;){let t=i+o>>1;n.write(r.slice(0,t)+"…"),e.scrollWidth<=e.clientWidth+.5?(a=t,i=t+1):o=t-1}return n.write((a>=0?r.slice(0,a):"")+"…"),()=>{n.restore()}}(i,o);s&&n.push(s);for(let t of i.children||[])e(t)}(e),()=>n.forEach(e=>e())}function Jg(e){let t=[];for(let n=e.firstChild;n;n=n.nextSibling)n.nodeType===Node.TEXT_NODE&&t.push(n);let n=t.map(e=>e.data);return{text:n.join(""),write(e){t[0].data=e;for(let e=1;e<t.length;e++)t[e].data=""},restore(){for(let e=0;e<t.length;e++)t[e].data=n[e]}}}function _g(e){return!(e.childElementCount>0)&&Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}Pd(),Kf();var Xg=[];function Kg(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return"function"==typeof t?t(n):t}if("object"==typeof e&&"plugin"in e){let{plugin:t,options:n}=e;return"function"==typeof t?t(n):t}return"function"==typeof e?e():e}function Zg(e){return e&&Array.isArray(e.plugins)?e.plugins:Xg}async function em(e,t,n){let r=n,i=Zg(t);for(let n of i){let i=n&&"function"==typeof n[e]?n[e]:null;if(!i)continue;let o=await i(t,r);typeof o<"u"&&(r=o)}return r}function tm(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=function(e){let t=[];if(Array.isArray(e))for(let n of e){let e=Kg(n);if(!e||!e.name)continue;let r=t.findIndex(t=>t&&t.name===e.name);r>=0&&t.splice(r,1),t.push(e)}for(let e of Xg)e&&e.name&&!t.some(t=>t.name===e.name)&&t.push(e);return Object.freeze(t)}(t)),e}function nm(){return Xg.slice()}Kf();async function rm(e,t,n){if("string"!=typeof e||!e.startsWith("data:image")||e.startsWith("data:image/svg"))return null;let r=e.length+":"+e.slice(0,64)+e.slice(-64)+":"+Math.round(t)+"x"+Math.round(n);if(Xf.compress.has(r))return Xf.compress.get(r);let i=await(async()=>{let r;try{r=await async function(e){let t=new Image;if(t.decoding="sync",t.src=e,"function"==typeof t.decode)try{return await t.decode(),t}catch{}return await new Promise((e,n)=>{t.onload=()=>e(),t.onerror=n}),t}(e)}catch{return null}let i=r.naturalWidth||r.width,o=r.naturalHeight||r.height;if(!i||!o)return null;let a=Math.min(1,Math.max(t/i,n/o));if(!(a>0)||a>=.95)return null;let s=.95*a,l=Math.max(1,Math.round(i*s)),c=Math.max(1,Math.round(o*s)),u=document.createElement("canvas");u.width=l,u.height=c;let f=u.getContext("2d");if(!f)return null;f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high",f.drawImage(r,0,0,l,c);let d=function(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:""}(e),h="image/jpeg"===d?"image/jpeg":"image/webp"===d?"image/webp":"image/png";try{let t=u.toDataURL(h,.92);if("string"==typeof t&&t.startsWith("data:image")&&t.length<e.length)return t}catch{}return null})();return Xf.compress.set(r,i),i}async function im(e,t,n){t.compress&&(await async function(e,t){if(!t.compress)return{count:0,before:0,after:0};let n=(t.scale||1)*(t.dpr||1),r=Array.from(e.querySelectorAll("img"));"IMG"===e.tagName&&r.unshift(e);let i=0,o=0,a=0,s=async e=>{let t=e.getAttribute("src")||"";if(!t.startsWith("data:image")||t.startsWith("data:image/svg"))return;let r=parseFloat(e.dataset.snapdomWidth)||parseFloat(e.style.width)||e.width||0,s=parseFloat(e.dataset.snapdomHeight)||parseFloat(e.style.height)||e.height||0;if(!r||!s)return;let l=await rm(t,r*n,s*n);l&&(i++,o+=t.length,a+=l.length,e.setAttribute("src",l))};for(let e=0;e<r.length;e+=6)await Promise.allSettled(r.slice(e,e+6).map(s));return{count:i,before:o,after:a}}(e,t),await async function(e,t,n=Xf.session.nodeMap){if(!t.compress)return{count:0};let r=(t.scale||1)*(t.dpr||1),i=[],o=[e,...e.querySelectorAll("*")];for(let e of o){let t=e.style&&e.style.backgroundImage;t&&t.includes("data:image")&&i.push(e)}let a=0,s=async e=>{let t,i=n.get(e);if(!i||!i.isConnected)return;try{t=getComputedStyle(i)}catch{return}if((t.backgroundRepeat||"repeat").toLowerCase().split(",").some(e=>"no-repeat"!==e.trim()))return;let{w:o,h:s}=function(e){return{w:e.offsetWidth||e.getBoundingClientRect().width||0,h:e.offsetHeight||e.getBoundingClientRect().height||0}}(i);if(!o||!s)return;let l=o*r,c=s*r,u=e.style.backgroundImage,f=[...u.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],d=u;for(let e of f){let t=e[2];if(t.startsWith("data:image/svg"))continue;let n=await rm(t,l,c);n&&(d=d.split(t).join(n),a++)}d!==u&&(e.style.backgroundImage=d)};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(s));return{count:a}}(e,t,n),await async function(e,t){if(!t.compress)return{count:0};let n=(t.scale||1)*(t.dpr||1),r=Array.from(e.querySelectorAll("image"));"image"===e.localName&&r.unshift(e);let i=0,o=async e=>{let t=e.getAttribute("href")||("function"==typeof e.getAttributeNS?e.getAttributeNS("http://www.w3.org/1999/xlink","href"):null);if(!t||!t.startsWith("data:image")||t.startsWith("data:image/svg"))return;let r=parseFloat(e.getAttribute("width"))||0,o=parseFloat(e.getAttribute("height"))||0;if(!r||!o)return;let a=await rm(t,r*n,o*n);a&&(e.setAttribute("href",a),e.hasAttribute("xlink:href")&&e.setAttribute("xlink:href",a),i++)};for(let e=0;e<r.length;e+=6)await Promise.allSettled(r.slice(e,e+6).map(o));return{count:i}}(e,t))}async function om(e,t){if(!e)throw new Error("Element cannot be null or undefined");(function(e="soft"){switch(e){case"auto":return Xf.session.styleMap=new Map,void(Xf.session.nodeMap=new Map);case"soft":default:return Xf.session.styleMap=new Map,Xf.session.nodeMap=new Map,void(Xf.session.styleCache=new WeakMap);case"full":return;case"disabled":Xf.session.styleMap=new Map,Xf.session.nodeMap=new Map,Xf.session.styleCache=new WeakMap,Xf.computedStyle=new WeakMap,Xf.measureHints=new WeakMap,Xf.baseStyle=new _f(50),Xf.defaultStyle=new _f(30),Xf.image=new _f(100),Xf.background=new _f(100),Xf.resource=new _f(150),Xf.compress=new _f(50),Xf.font=new Set}})(t.cache),t.__session={styleMap:Xf.session.styleMap,styleCache:Xf.session.styleCache,nodeMap:Xf.session.nodeMap},t.burst||function(e){let t=Date.now(),n=Xf.burstAdvice.get(e);!n||t-n.firstTs>2e3?Xf.burstAdvice.set(e,{count:1,firstTs:t,warned:!1}):(n.count++,n.count>=3&&!n.warned&&(n.warned=!0,console.warn("[snapdom] Captured this element multiple times. Pass { burst: true } to increase the speed.")))}(e),t.__resolveNodeHooks=function(e){let t=Array.isArray(e.plugins)?e.plugins:nm(),n=[];for(let e of t){let t=Kg(e);t&&"function"==typeof t.resolveNode&&n.push(t.resolveNode.bind(t))}return n.length?n:null}(t);let n,r,i,o,a,s,l,c,u=t.fast,f=!1!==t.outerTransforms,d=!!t.outerShadows,h=t.clip?yg(e,t.clip):null,p={element:e,options:t,plugins:t.plugins},g="",m="",y=null;await em("beforeSnap",p);let v=null;!1!==t.resolvePicturePlaceholders&&!function(e){if(Array.isArray(e.plugins))for(let t of e.plugins)if("picture-resolver"===Kg(t)?.name)return!0;return nm().some(e=>"picture-resolver"===e?.name)}(t)&&(v=await $h(p.element,p.options)),await em("beforeClone",p);let A=Gg(p.element,h);try{({clone:n,classCSS:r,styleCache:i,nodeMap:o,reconcileRisk:a,clipWindow:s}=await Lg(p.element,p.options)),a>0&&!t.reconcile&&!Xf.warnedReconcile&&(Xf.warnedReconcile=!0,console.warn("[snapdom] Text in inline/table-cell elements kept its natural width and may re-wrap under font-fallback rasterization. Pass { reconcile: true } for pixel-exact layout (roughly doubles capture time).")),!f&&n&&(y=function(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||"none"===r){let n=null;try{n=dg(e).scale}catch{}try{t.style.transform="none"}catch{}if(!n)return{a:1,b:0,c:0,d:1};let r=n.trim().split(/\s+/).map(parseFloat),i=Number.isFinite(r[0])?r[0]:1;return{a:i,b:0,c:0,d:Number.isFinite(r[1])?r[1]:i}}function i(e,t,n,r){let i=Math.sqrt(e*e+t*t)||0,o=0,a=0;if(i>0){let s=e/i,l=t/i;o=s*n+l*r;let c=n-s*o,u=r-l*o;a=Math.sqrt(c*c+u*u)||0,a>0?o/=a:o=0}return{a:i,b:0,c:o*a,d:a}}let o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let e=o[1].split(",").map(e=>parseFloat(e.trim()));if(6===e.length&&e.every(Number.isFinite)){let[n,r,o,a]=e,s=i(n,r,o,a);try{t.style.transform=`matrix(${s.a}, ${s.b}, ${s.c}, ${s.d}, 0, 0)`}catch{}return s}}let a=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let e=a[1].split(",").map(e=>parseFloat(e.trim()));if(16===e.length&&e.every(Number.isFinite)){let n=i(e[0],e[1],e[4],e[5]);try{t.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, 0, 0)`}catch{}return n}}try{let e=new DOMMatrix(r),n=i(e.a,e.b,e.c,e.d);try{t.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, 0, 0)`}catch{}return n}catch{return null}}(p.element,n)),!d&&n&&function(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow="none"}catch(e){Od(n,"stripRootShadows boxShadow",e)}try{t.style.textShadow="none"}catch(e){Od(n,"stripRootShadows textShadow",e)}try{t.style.outline="none"}catch(e){Od(n,"stripRootShadows outline",e)}let i=(r.filter||"").replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=i.length?i:"none"}catch(e){Od(n,"stripRootShadows filter",e)}}(p.element,n,p.options),n&&(function(e,t,n){if(!e||!t||!t.style)return;let r=getComputedStyle(e);if(!Ig(r))for(let i of["top","bottom"]){let o="top"===i?"Top":"Bottom";if((parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)continue;let a=e,s=t;for(;a&&s;){let e=xg(a,i);if(!e)break;let t=n?Array.from(s.children).find(t=>n.get(t)===e)||null:s.children[Array.from(a.children).indexOf(e)]||null,r=getComputedStyle(e),l=parseFloat(r[`margin${o}`])||0;if(t&&t.style&&l>0&&(t.style[`margin${o}`]="0px"),Ig(r)||(parseFloat(r[`border${o}Width`])||0)>0||(parseFloat(r[`padding${o}`])||0)>0)break;a=e,s=t}}}(p.element,n,o),function(e,t){if(!e||!t||!t.style)return;let n=1;try{n=parseFloat(getComputedStyle(e).zoom)}catch{return}if(t.style.getPropertyValue("zoom")||Number.isFinite(n)&&1!==n)try{t.style.setProperty("zoom","1","important")}catch{}}(p.element,n))}finally{A()}if(p={clone:n,classCSS:r,styleCache:i,nodeMap:o,...p},await em("afterClone",p),v&&await v(),Eg(p.clone),"remove"===p.options?.excludeMode||"remove"===p.options?.filterMode)try{!function(e,t,n=new Map){!function e(t,r){if(1!==t?.nodeType||1!==r?.nodeType)return;let i=t.childElementCount>r.childElementCount,o=n.get(t)||getComputedStyle(t);if(n.has(t)||n.set(t,o),i&&Bg(t,o)){r.style.height||(r.style.height="auto"),r.style.width||(r.style.width="auto"),r.style.removeProperty("block-size"),r.style.removeProperty("inline-size"),r.style.minHeight||(r.style.minHeight="0"),r.style.minWidth||(r.style.minWidth="0"),r.style.maxHeight||(r.style.maxHeight="none"),r.style.maxWidth||(r.style.maxWidth="none");let e=o.overflowY||o.overflowBlock||"visible",t=o.overflowX||o.overflowInline||"visible";("visible"!==e||"visible"!==t)&&(r.style.overflow="visible")}let a=Array.from(t.children),s=Array.from(r.children);for(let t=0;t<Math.min(a.length,s.length);t++)e(a[t],s[t])}(e,t)}(p.element,p.clone,p.styleCache)}catch(e){console.warn("[snapdom] shrink pass failed:",e)}try{await async function(e,t,n=Xf.session.nodeMap){if(1!==e?.nodeType)return 0;let r='.material-icons, [class*="material-symbols"]',i=Array.from(e.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim());if(e.matches?.(r)&&e.textContent&&e.textContent.trim()&&i.unshift(e),0===i.length)return 0;let o=1===t?.nodeType?Array.from(t.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim()):[];1===t?.nodeType&&t.matches?.(r)&&t.textContent&&t.textContent.trim()&&o.unshift(t);let a=0;for(let e=0;e<i.length;e++){let t=i[e],r=n&&n.get(t)||o[e]||null;try{let e=getComputedStyle(r||t),n=e.fontFamily||"Material Icons";if(!mp(n))continue;let i=(r||t).textContent.trim();if(!i)continue;let o=parseInt(e.fontSize,10)||24,s=e.fontWeight&&"normal"!==e.fontWeight?e.fontWeight:"normal",l=vp(e),c=e.fontVariationSettings&&"normal"!==e.fontVariationSettings?e.fontVariationSettings:"",u=(r||t).className||"",{dataUrl:f,width:d,height:h}=await Ap(i,{family:n,weight:s,fontSize:o,color:l,variation:c,className:u});t.textContent="";let p=t.ownerDocument.createElement("img");p.src=f,p.alt=i,p.style.height=`${o}px`,p.style.width=`${Math.max(1,Math.round(d/h*o))}px`,p.style.objectFit="contain",p.style.verticalAlign=getComputedStyle(t).verticalAlign||"baseline",t.appendChild(p),a++}catch{}}return a}(p.clone,p.element,p.nodeMap)}catch{}let b=e=>new Promise((t,n)=>{Ld(()=>{Promise.resolve().then(e).then(t,n)},{fast:u})}),w=(async()=>{await Promise.all([b(()=>Ug(p.clone,p.options)),b(()=>async function(e,t,n,r={},i=Xf.session.nodeMap){if(!t)return;let o=[];e&&xh(e)&&o.push([e,t]);let a=[t];for(;a.length;){let e=a.pop();if(e.children)for(let t of e.children){if("STYLE"===t.tagName)continue;let e=i.get(t);e&&xh(e)&&o.push([e,t]),a.push(t)}}for(let e=0;e<o.length;e+=6)await Promise.allSettled(o.slice(e,e+6).map(([e,t])=>$g(e,t,n,r)))}(p.element,p.clone,p.styleCache,p.options,p.nodeMap))]);try{zg(p.element,p.clone,p.nodeMap)}catch(e){console.warn("[snapdom] backdrop-filter emulation failed:",e)}t.compress&&await b(()=>im(p.clone,p.options,p.nodeMap))})(),I=Promise.resolve();t.embedFonts&&(I=b(async()=>{let e=p.element.ownerDocument||document,t=h?e=>{try{let t=e.getBoundingClientRect();return t.right>=h.left-200&&t.left<=h.right+200&&t.bottom>=h.top-200&&t.top<=h.bottom+200}catch{return!0}}:null,{required:n,usedCodepoints:r}=Vp(p.element,t);if(Ud()){let t=new Set(Array.from(n).map(e=>String(e).split("__")[0]).filter(Boolean));await Yp(t,1,e)}g=await jp({required:n,usedCodepoints:r,preCached:!1,exclude:p.options.excludeFonts,localFonts:p.options.localFonts,useProxy:p.options.useProxy,fontStylesheetDomains:p.options.fontStylesheetDomains,doc:e})})),await Promise.all([w,I]);let x=function(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),"function"==typeof e.querySelectorAll&&e.querySelectorAll("*").forEach(e=>t.add(e.tagName.toLowerCase())),Array.from(t))}(p.clone).sort(),C=x.join(",");Xf.baseStyle.has(C)?m=Xf.baseStyle.get(C):await new Promise(e=>{Ld(()=>{m=function(e){let t=new Map;for(let n of e){let e=hd(n);if(!e)continue;let r=Object.entries(e).map(([e,t])=>`${e}:${t};`).sort().join("");r&&(t.has(r)||t.set(r,[]),t.get(r).push(n))}let n="";for(let[e,r]of t.entries())n+=`${r.join(",")} { ${e} }\n`;return n}(x),Xf.baseStyle.set(C,m),e()},{fast:u})});let E=function(e){if(!e||!e.styleSheets)return"";let t=function(e){let t="";for(let n of e.styleSheets){let e=-1;try{e=n.cssRules?n.cssRules.length:-1}catch{}t+=(n.href||"inline")+":"+e+"|"}return t}(e),n=Tg.get(e);if(n&&n.fp===t)return n.css;let r=new Set,i="";for(let t of Array.from(e.styleSheets))try{let e=t.cssRules;e&&(i+=Mg(e,r))}catch{}return Tg.set(e,{fp:t,css:i}),i}(p.element?.ownerDocument||document);p={fontsCSS:g,baseCSS:m,scrollbarCSS:E,...p},await em("beforeRender",p),await new Promise(e=>{Ld(()=>{let n=yd(p.element),r=p.element.getBoundingClientRect(),i=Math.max(1,Fg(p.element.offsetWidth||parseFloat(n.width)||r.width||1)),o=Math.max(1,Fg(p.element.offsetHeight||parseFloat(n.height)||r.height||1)),a=p.element.ownerDocument||document;if(!(s||p.element!==a.body&&p.element!==a.documentElement||a.documentElement.hasAttribute("data-sd-pinned"))){let e=Math.max(p.element.scrollHeight||0,a.documentElement?.scrollHeight||0,a.body?.scrollHeight||0),t=Math.max(p.element.scrollWidth||0,a.documentElement?.scrollWidth||0,a.body?.scrollWidth||0);e>0&&(o=Math.max(o,Fg(e))),t>0&&(i=Math.max(i,Fg(t)));try{let e=(p.scrollbarCSS||"").length+(p.baseCSS||"").length+(p.fontsCSS||"").length+(p.classCSS||"").length,t=Xf.measureHints.get(p.element);if(t&&t.cssLen===e&&t.w0===i)t.csh>0&&(o=Math.max(o,Fg(t.csh))),t.csw>0&&(i=Math.max(i,Fg(t.csw)));else{let t=a.createElement("div");t.setAttribute("data-snapdom-internal",""),t.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let n=t.attachShadow({mode:"open"}),r=a.createElement("style");r.textContent=(p.scrollbarCSS||"")+p.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+p.classCSS,n.appendChild(r),n.appendChild(p.clone.cloneNode(!0)),a.body.appendChild(t);let s=t.scrollHeight,l=t.scrollWidth;a.body.removeChild(t),Xf.measureHints.set(p.element,{cssLen:e,w0:i,csh:s,csw:l}),s>0&&(o=Math.max(o,Fg(s))),l>0&&(i=Math.max(i,Fg(l)))}}catch{}}if("remove"===p.options?.excludeMode||"remove"===p.options?.filterMode){let e=function(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,o=-1/0,a=!1,s=Array.from(e.children);for(let e of s){if(kg(e,t)||!Sg(e))continue;let n=e.getBoundingClientRect(),s=n.top-r.top,l=n.bottom-r.top;l<=s||(s<i&&(i=s),l>o&&(o=l),a=!0)}let l=a?Math.max(0,o-i):0;return(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0)+(parseFloat(n.paddingTop)||0)+(parseFloat(n.paddingBottom)||0)+l}(p.element,p.options);Number.isFinite(e)&&e>0&&(o=Math.max(1,Math.min(o,Fg(e+1))))}if(p.options?.reconcile)try{let e=(p.scrollbarCSS||"")+p.baseCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+p.classCSS;!function(e,t,n,r,i,o){let a=e.ownerDocument||document,s=e.getBoundingClientRect(),l=i>0&&s.width>0?s.width/i:1,c=o>0&&s.height>0?s.height/o:1;if(Math.abs(l-c)>.02)return 0;let u=a.createElement("div");u.setAttribute("data-snapdom-internal",""),u.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+i+"px!important;overflow:visible!important;visibility:hidden!important;";let f=u.attachShadow({mode:"open"}),d=a.createElement("style");d.textContent=n,f.appendChild(d);let h=t.cloneNode(!0);f.appendChild(h),a.body.appendChild(u);let p=0,g=(e,t,n)=>{let r=yd(e),i="border-box"===r.boxSizing,o=(e,t,...n)=>{let r=parseFloat(e);if(!Number.isFinite(r))return t;let o=r+(i?0:n.reduce((e,t)=>e+(parseFloat(t)||0),0));return Math.abs(o-t)<=.51?o:t};return{width:o(r.width,t,r.paddingLeft,r.paddingRight,r.borderLeftWidth,r.borderRightWidth),height:o(r.height,n,r.paddingTop,r.paddingBottom,r.borderTopWidth,r.borderBottomWidth)}};try{let e=h.getBoundingClientRect(),n=h.offsetWidth||i,a=h.offsetHeight||o,s=n>0&&e.width>0?e.width/n:1,u=a>0&&e.height>0?e.height/a:1,f=(e,t,n=!1)=>{let i=e.children,o=t.children,a=Math.min(i.length,o.length);for(let e=0;e<a;e++){let t=i[e],a=o[e],d=r.get(t),h=n||mg.has(t);if(1===d?.nodeType&&t?.namespaceURI===gg&&t.style&&d.isConnected){let e=d.getBoundingClientRect();if(e.width>0&&e.height>0){let n=a.getBoundingClientRect(),r=e.width/l,i=e.height/c,o=n.width,f=n.height,m=d.offsetWidth||r,y=d.offsetHeight||i,v=a.offsetWidth||o,A=a.offsetHeight||f,b=Math.abs(r-m)>Dg||Math.abs(i-y)>Dg||Math.abs(o-v)>Dg||Math.abs(f-A)>Dg;if(h){let e=g(a,v,A);r=o>0?r*s*e.width/o:r,i=f>0?i*u*e.height/f:i,o=e.width,f=e.height}else if(b){let e=g(d,m,y),t=g(a,v,A);r=e.width,i=e.height,o=t.width,f=t.height}let w=o-r,I=f-i;(Math.abs(w)>Dg||Math.abs(I)>Dg)&&(t.style.boxSizing="border-box",t.style.width=`${Fg(r)}px`,t.style.height=`${Fg(i)}px`,p++)}}f(t,a,h)}};f(t,h)}finally{u.remove()}}(p.element,p.clone,e,p.nodeMap,i,o)}catch(e){console.warn("[snapdom] reconcile pass failed:",e)}let u=(e,t=NaN)=>{let n="string"==typeof e?parseFloat(e):e;return Number.isFinite(n)?n:t},h=u(p.options.width),g=u(p.options.height),m=s?Fg(s.width):i,v=s?Fg(s.height):o,A=m,b=v,w=Number.isFinite(h),I=Number.isFinite(g),x=v>0?m/v:1;w&&I?(A=Math.max(1,Fg(h)),b=Math.max(1,Fg(g))):w?(A=Math.max(1,Fg(h)),b=Math.max(1,Fg(A/(x||1)))):I&&(b=Math.max(1,Fg(g)),A=Math.max(1,Fg(b*(x||1))));let C=0,E=0,B=i,S=o;if(s){let e=0,t=0;if(am(p.element)){let r=null;if(!f&&y&&Number.isFinite(y.a))r={a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0};else{let e=dg(p.element),t=wg(n.transform&&"none"!==n.transform?n.transform:"",e);t&&t.is2D&&(r={a:t.a,b:t.b,c:t.c,d:t.d,e:0,f:0})}if(r&&(1!==r.a||0!==r.b||0!==r.c||1!==r.d)){let{ox:a,oy:s}=fg(n,i,o),l=ug(i,o,r,a,s);e=l.minX,t=l.minY}}C=Fg(s.x+e),E=Fg(s.y+t),B=Fg(C+s.width),S=Fg(E+s.height)}else if(!f&&y&&Number.isFinite(y.a)){let e=ug(i,o,{a:y.a,b:y.b||0,c:y.c||0,d:y.d||1,e:0,f:0},0,0);C=Fg(e.minX),E=Fg(e.minY),B=Fg(e.maxX),S=Fg(e.maxY)}else if(f&&am(p.element)){let e=n.transform&&"none"!==n.transform?n.transform:"",t=dg(p.element),r=pg({baseTransform:e,rotate:t.rotate||"0deg",scale:t.scale,translate:t.translate}),{ox:a,oy:s}=fg(n,i,o),l=r.is2D?r:new DOMMatrix(r.toString()),c=ug(i,o,{a:l.a,b:l.b,c:l.c,d:l.d,e:0,f:0},a,s);C=Fg(c.minX),E=Fg(c.minY),B=Fg(c.maxX),S=Fg(c.maxY)}let k=function(e){return cg(e.boxShadow)}(n),F=function(e){return cg(e.textShadow)}(n),D=function(e){let t,n=e.filter&&"none"!==e.filter?e.filter:e.webkitFilter||"",r=/blur\(\s*([0-9.]+)px\s*\)/gi,i=0;for(;t=r.exec(n);)i+=parseFloat(t[1])||0;let o=Math.ceil(i);return{top:o,right:o,bottom:o,left:o}}(n),N=function(e){if("none"===(e.outlineStyle||"none"))return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),n=parseFloat(e.outlineOffset||"0")||0,r=t+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}(n),M=function(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||"none"===t)return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,o=0,a=0,s=!1;for(let e of n){s=!0;let t=e.match(/-?\d+(?:\.\d+)?px/gi)?.map(e=>parseFloat(e))||[],[n=0,l=0,c=0]=t,u=Math.abs(n)+c,f=Math.abs(l)+c;i=Math.max(i,u+Math.max(n,0)),a=Math.max(a,u+Math.max(-n,0)),o=Math.max(o,f+Math.max(l,0)),r=Math.max(r,f+Math.max(-l,0))}return{bleed:{top:Fg(r),right:Fg(i),bottom:Fg(o),left:Fg(a)},has:s}}(n),T=s?{top:0,right:0,bottom:0,left:0}:d?{top:Fg(Math.max(k.top,F.top)+D.top+N.top+M.bleed.top),right:Fg(Math.max(k.right,F.right)+D.right+N.right+M.bleed.right),bottom:Fg(Math.max(k.bottom,F.bottom)+D.bottom+N.bottom+M.bleed.bottom),left:Fg(Math.max(k.left,F.left)+D.left+N.left+M.bleed.left)}:{top:D.top,right:D.right,bottom:D.bottom,left:D.left};C=Fg(C-T.left),E=Fg(E-T.top),B=Fg(B+T.right),S=Fg(S+T.bottom);let Q=Math.max(1,Fg(B-C)),L=Math.max(1,Fg(S-E)),R=w||I?Fg(A/m):1,U=I||w?Fg(b/v):1,H=Math.max(1,Fg(Q*R)),O=Math.max(1,Fg(L*U)),q="http://www.w3.org/2000/svg",P=am(p.element)?2:0,$=Fg(P+(f?0:1)),z=Math.ceil(Q+2*$),j=Math.ceil(L+2*$),V=Fg(-(Fg(C)-$)),Y=Fg(-(Fg(E)-$)),W=Math.max(0,V),G=Math.max(0,Y),J=Fg(z-Math.min(0,V)),_=Fg(j-Math.min(0,Y)),X=document.createElementNS(q,"foreignObject");X.setAttribute("x",String(Math.min(0,V))),X.setAttribute("y",String(Math.min(0,Y))),X.setAttribute("width",String(J)),X.setAttribute("height",String(_)),X.style.overflow="visible";let K=document.createElement("style");K.textContent=(p.scrollbarCSS||"")+p.baseCSS+p.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}"+p.classCSS,X.appendChild(K);let Z=document.createElement("div");Z.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Z.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${J}px;height:${_}px`+(0!==W||0!==G?`;padding:${G}px 0 0 ${W}px !important`:""),Z.appendChild(p.clone),X.appendChild(Z);let ee=(new XMLSerializer).serializeToString(X),te=w||I,ne=Object.freeze({w0:m,h0:v,vbW:z,vbH:j,targetW:A,targetH:b,contentX:Fg(V+(s?C:0)),contentY:Fg(Y+(s?E:0)),clip:s?Object.freeze({x:Fg(C),y:Fg(E),width:m,height:v}):null});Object.defineProperty(t,"meta",{value:ne,enumerable:!0,writable:!1,configurable:!0});let re=!te||Ud()?z:Fg(H+2*$),ie=!te||Ud()?j:Fg(O+2*$),oe=parseFloat(yd(a.documentElement)?.fontSize)||16;c=`<svg xmlns="${q}" width="${re}" height="${ie}" viewBox="0 0 ${z} ${j}" font-size="${oe}px">`+ee+"</svg>",l=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,p={svgString:c,dataURL:l,...p},e()},{fast:u})}),await em("afterRender",p);let B=document.getElementById("snapdom-sandbox");return B&&"absolute"===B.style.position&&B.remove(),p.dataURL}function am(e){return function(e){let t=yd(e),n=t.transform||"none";if("none"!==n&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=t.rotate&&"none"!==t.rotate&&"0deg"!==t.rotate,i=t.scale&&"none"!==t.scale&&"1"!==t.scale,o=t.translate&&"none"!==t.translate&&"0px 0px"!==t.translate;return!!(r||i||o)}(e)}Kf(),Hd(),qd();var sm=new WeakMap;function lm(e,t,n){let r=new Set;if(e instanceof HTMLVideoElement&&r.add(e),e.querySelectorAll)for(let t of e.querySelectorAll("video"))r.add(t);for(let e of t.trackedVideos)r.has(e)||(e.removeEventListener("timeupdate",n),e.removeEventListener("seeked",n),t.trackedVideos.delete(e));for(let e of r)t.trackedVideos.has(e)||(e.addEventListener("timeupdate",n),e.addEventListener("seeked",n),t.trackedVideos.add(e))}function cm(e){let{burst:t,invalidate:n,...r}=e||{};try{return JSON.stringify(r,Object.keys(r).sort())}catch{return null}}function um(e,t,n,r){let i=sm.get(e);i||(i=function(e){let t={dirty:!0,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedVideos:new Set},n=e=>{t.capturing||bh(e)&&(t.dirty=!0)},r=()=>{t.capturing||(t.dirty=!0)},i=e.ownerDocument||document;try{let r=new MutationObserver(n);r.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),t.observers.push(r)}catch{}try{if(i.head){let e=new MutationObserver(n);e.observe(i.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),t.observers.push(e)}}catch{}return t.markDirty=n,t.onMediaDirty=r,lm(e,t,r),t}(e),i.baselineSignature=cm(t),sm.set(e,i));let o=cm(t),a=null===o||o!==i.baselineSignature,s=async()=>{for(let e of i.observers)i.markDirty(e.takeRecords());if(n.invalidate&&(i.dirty=!0),!a&&!i.dirty&&i.last)return i.last;i.capturing=!0,a||(i.dirty=!1);try{let e=await r();return a||(i.last=e),e}finally{for(let e of i.observers)e.takeRecords();i.capturing=!1,lm(e,i,i.onMediaDirty)}},l=i.inflight.then(s,s);return i.inflight=l.catch(()=>{}),l}Pd(),ud(),Kf();var fm=Object.assign(async function(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=function(e={}){let t=e.format??"png";"jpg"===t&&(t="jpeg");let n=function(e){if(!0===e)return"soft";if(!1===e)return"disabled";if("string"==typeof e){let t=e.toLowerCase().trim();if("auto"===t)return"auto";if("full"===t)return"full";if("soft"===t||"disabled"===t)return t}return"soft"}(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:!1!==e.placeholders,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:n,useProxy:"string"==typeof e.useProxy?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,reconcile:e.reconcile??!1,burst:e.burst??!1,invalidate:e.invalidate??!1,clip:e.clip??null,compress:!1!==e.compress,excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:!1!==e.resolvePicturePlaceholders,pictureResolver:e.pictureResolver&&"object"==typeof e.pictureResolver?e.pictureResolver:{}}}(t);if(tm(n,t&&t.plugins),Ud()){if(!0===n.embedFonts)try{let t=function(e,t){return Vp(e,t).required}(e),n=new Set([...t].map(e=>String(e).split("__")[0]).filter(Boolean));await Yp(n,1)}catch{}let r=Array.from(e.querySelectorAll("canvas"));"CANVAS"===e.tagName&&r.unshift(e);for(let e of r)try{let t=e.getContext("2d",{willReadFrequently:!0});t&&t.getImageData(0,0,1,1)}catch(e){Od(t,"safari canvas poke failed",e)}}return n.iconFonts&&n.iconFonts.length>0&&function(e){let t=Array.isArray(e)?e:[e];for(let e of t){let t;if(e instanceof RegExp)t=e;else{if("string"!=typeof e){console.warn("[snapdom] Ignored invalid iconFont value:",e);continue}t=new RegExp(pp(e),"i")}let n=`${t.source}/${t.flags}`;hp.has(n)||(hp.add(n),dp.push(t))}}(n.iconFonts),n.snap||(n.snap={toPng:(e,t)=>fm.toPng(e,t),toSvg:(e,t)=>fm.toSvg(e,t)}),n.burst?um(e,t,n,()=>fm.capture(e,n,dm)):fm.capture(e,n,dm)},{plugins:function(...e){return function(...e){let t=e.flat();for(let e of t){let t=Kg(e);t&&(Xg.some(e=>e&&e.name&&t.name&&e.name===t.name)||Xg.push(t))}}(...e),fm}}),dm=Symbol("snapdom.internal"),hm=Symbol("snapdom.internal.silent");function pm(e){return document.querySelectorAll(e)}function gm(e){function t(e){e.parentNode.removeChild(e)}if(Su(e)){return void t(e)}if(!ke(e))return;vn(pm(e),function(e){t(e)})}function mm(e,t){if(!Su(e))return"invalid eleParent";if(Se(t))e.insertAdjacentHTML("afterbegin",t);else{if(!Su(t))return"invalid itemChild";e.insertBefore(t,e.firstChild)}}async function ym(e,t={}){if(!Su(e))return Promise.reject("invalid ele");let n=be(t,"scale",null);if(Ne(n)||(n=1),n=Ir(n),n<1)return Promise.reject("opt.scale can not less then 1");let r=be(t,"picType",null);"image/jpg"!==r&&"image/jpeg"!==r&&"image/png"!==r&&"svg"!==r&&(r="image/png");let i=be(t,"toBase64",null);we(i)||(i=!0);let o=e.cloneNode(!0),a=document.createElement("div");a.style.position="absolute",a.style.top=0,a.style.left=0,a.style.zIndex=-1,a.appendChild(o);let s=document.createElement("div");s.style.opacity=0,s.style.position="relative",s.appendChild(a),mm(document.querySelector("body"),s);let l,c={scale:n,quality:1,cache:"disabled"};return"image/jpg"===r||"image/jpeg"===r?l=await fm.toJpg(a,c):"image/png"===r?l=await fm.toPng(a,c):"svg"===r&&(l=await fm.toSvg(a,c)),i&&(l=be(l,"src","")),gm(s),l}fm.capture=async(e,t,n)=>{if(n!==dm)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");t.element=e;let r=await om(e,t),i={img:async(e,t)=>{let{toImg:n}=await Promise.resolve().then(()=>(sh(),oh));return n(r,{...e,...t||{}})},svg:async(e,t)=>{let{toSvg:n}=await Promise.resolve().then(()=>(sh(),oh));return n(r,{...e,...t||{}})},canvas:async(e,t)=>{let{toCanvas:n}=await Promise.resolve().then(()=>(th(),$d));return n(r,{...e,...t||{}})},blob:async(e,t)=>{let{toBlob:n}=await Promise.resolve().then(()=>(uh(),lh));return n(r,{...e,...t||{}})},png:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(ih(),nh));return n(r,{...e,...t||{},format:"png"})},jpeg:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(ih(),nh));return n(r,{...e,...t||{},format:"jpeg"})},webp:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(ih(),nh));return n(r,{...e,...t||{},format:"webp"})},download:async(e,t)=>{let{download:n}=await Promise.resolve().then(()=>(ph(),fh));return n(r,{...e,...t||{}})}},o={};for(let e of["img","svg","canvas","blob","png","jpeg","webp"])o[e]=async n=>i[e](t,{...n||{},[hm]:!0});o.jpg=o.jpeg;let a={...t,export:{url:r},exports:o},s=await async function(e,t,n){let r=[],i=Zg(t);for(let o of i){let i=o&&"function"==typeof o[e]?o[e]:null;if(!i)continue;let a=await i(t,n);typeof a<"u"&&r.push(a)}return r}("defineExports",a),l=Object.assign({},...s.filter(e=>e&&"object"==typeof e).reverse()),c={...i,...l};c.jpeg&&!c.jpg&&(c.jpg=(e,t)=>c.jpeg(e,t));let u=!1,f=Promise.resolve();async function d(e,n){let i=Object.freeze(n&&"object"==typeof n?{...n}:{}),o=f.then(async()=>{let n=c[e];if(!n)throw new Error(`[snapdom] Unknown export type: ${e}`);let o=function(e,n){let r={...t,...n||{}};return[e,r.format,r.type].map(e=>"string"==typeof e?e.toLowerCase():"").find(e=>"jpeg"===e||"jpg"===e||"webp"===e)&&(null==r.backgroundColor||"transparent"===r.backgroundColor)&&(r.backgroundColor="#ffffff"),r}(e,i),a={...t,export:{type:e,options:o,requestedOptions:i,url:r}};await em("beforeExport",a,{format:e,options:o});let s=await n(a,o);return await em("afterExport",a,{format:e,options:o,result:s}),u||(u=!0,await em("afterSnap",t)),s});return f=o.catch(()=>{}),o}let h={url:r,toRaw:()=>r,to:(e,t)=>d(e,t),toImg:e=>d("img",e),toSvg:e=>d("svg",e),toCanvas:e=>d("canvas",e),toBlob:e=>d("blob",e),toPng:e=>d("png",e),toJpg:e=>d("jpg",e),toWebp:e=>d("webp",e),download:e=>d("download",e)};Object.defineProperty(h,"meta",{value:t.meta,enumerable:!0,writable:!1,configurable:!1});for(let e of Object.keys(c)){let t="to"+e.charAt(0).toUpperCase()+e.slice(1);h[t]||(h[t]=t=>d(e,t))}return h},fm.toRaw=(e,t)=>fm(e,t).then(e=>e.toRaw()),fm.toImg=(e,t)=>fm(e,t).then(e=>e.toImg()),fm.toSvg=(e,t)=>fm(e,t).then(e=>e.toSvg()),fm.toCanvas=(e,t)=>fm(e,t).then(e=>e.toCanvas()),fm.toBlob=(e,t)=>fm(e,t).then(e=>e.toBlob()),fm.toPng=(e,t)=>fm(e,{...t,format:"png"}).then(e=>e.toPng()),fm.toJpg=(e,t)=>fm(e,{...t,format:"jpeg"}).then(e=>e.toJpg()),fm.toWebp=(e,t)=>fm(e,{...t,format:"webp"}).then(e=>e.toWebp()),fm.download=(e,t)=>fm(e,t).then(e=>e.download());var vm=function(){return w.Date.now()},Am=Math.max,bm=Math.min;function wm(e,t,n){var r,i,o,a,s,l,c=0,u=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,o=i;return r=i=void 0,c=t,a=e.apply(o,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||f&&e-c>=o}function g(){var e=vm();if(p(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return f?bm(n,o-(e-c)):n}(e))}function m(e){return s=void 0,d&&r?h(e):(r=i=void 0,a)}function y(){var e=vm(),n=p(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?h(e):a}(l);if(f)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=vr(t)||0,L(n)&&(u=!!n.leading,o=(f="maxWait"in n)?Am(vr(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:m(vm())},y}function Im(e){if(!e||1!==e.nodeType||!e.isConnected)return!1;if(Oi(e.checkVisibility))try{return e.checkVisibility()}catch(e){}let t=e;for(;t&&1===t.nodeType;){let e="";try{e=window.getComputedStyle(t).display}catch(t){e=""}if("none"===e)return!1;t=t.parentElement||t.parentNode&&t.parentNode.host||null}return!0}function xm(e,t,n,r={}){let i=be(r,"min",-1/0),o=!0===be(r,"minOpen",!1),a="clamp"===be(r,"below","def"),s=!0===be(r,"int",!1),l=!0===be(r,"timer",!1),c="keep"===be(r,"inf","def"),u=be(e,t,null);return Ne(u)?(u=Number(u),(o?u>i:u>=i)?u===1/0?l?Li:c?1/0:n:Number.isFinite(u)?s&&!Number.isInteger(u)?n:(l&&(u=Math.min(u,Li)),u):n:a&&!o&&Number.isFinite(i)?i:n):n}let Cm=new Set,Em=null;function Bm(e){Cm.delete(e),0===Cm.size&&Em&&(Em.disconnect(),Em=null)}function Sm(e){return xm(e,"timeInterval",20,{int:!0,min:0,minOpen:!0,timer:!0})}function km(e,t){let n=be(e,t,null);return Oi(n)?n:null}function Fm(e){let t=null;try{t=e()}catch(e){t=null}return t&&1===t.nodeType?t:null}function Dm(e){return Ne(e)?Ir(e):null}function Nm(e){return e.offsetWidth>0&&e.offsetHeight>0&&e.width>0&&e.height>0}function Mm(e,t,n){let r=function(e){return xm(e,"tolerancePixel",1,{int:!0,min:0,inf:"keep"})}(t),i=function(e){return xm(e,"toleranceBounce",3,{int:!0,min:0,inf:"keep"})}(t),o={width:{dir:0,n:0,m:0},height:{dir:0,n:0,m:0}},a=!0===be(t,"sync",!1),s=km(t,"getSize"),l=km(t,"getBase"),c=function(e){return xm(e,"throttle",0,{int:!0,min:0,minOpen:!0,timer:!0})}(t),u=!1,f={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},d={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},h=null,p=new Set,g=0,m=0,y=(e,t)=>{let n=(e=>{if(!l)return{width:d.width,height:d.height};let t=null;try{t=l()}catch(e){t=null}let n=Dm(be(t,"width",null)),r=Dm(be(t,"height",null));return e&&m<g?{width:null===n?null:d.width,height:null===r?null:d.height}:{width:n,height:r}})(t),i=null===n.width?0:n.width-e.width,o=null===n.height?0:n.height-e.height;return{dw:i,dh:o,bw:Math.abs(i)>r,bh:Math.abs(o)>r}},v=(e,t,n,a)=>{let s=o[e],l=a>0?1:a<0?-1:0;if(0!==l){let e=0!==s.dir&&l!==s.dir;s.n=e?s.n+1:0,e&&(s.m=0),s.dir=l}return n?(s.n=0,s.m=0,!0):0!==t&&r!==1/0&&(i===1/0||!(s.n>=i||s.m>=10)&&(0!==l&&s.m++,!0))},A=(e,t)=>({width:t.cw&&0!==e.dw?e.dw>0?"smaller":"larger":"",height:t.ch&&0!==e.dh?e.dh>0?"smaller":"larger":""}),b=(t,r,o,a,s,c)=>{if(!u&&!(s<m)&&(m=s,Nm(r))){if(c){if(!Im(a))return void(e=>{d===e&&(d={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},f={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},n&&n())})(r);if(l){let e=y(r,!1),t=i>0,n={cw:e.bw||t&&""!==o.width&&0!==e.dw,ch:e.bh||t&&""!==o.height&&0!==e.dh};if(!n.cw&&!n.ch)return;o=A(e,n)}}e.emit("resize",{sold:t,snew:r,smode:o,ele:a}),u||e.emit("resizeWithWindow",{sold:t,snew:r,smode:o,ele:a,from:"dom"})}},w=!1,I=(e,t,n,r,i)=>{if(w)return void b(e,t,n,r,i,!1);let o=setTimeout(()=>{p.delete(o),b(e,t,n,r,i,!0)},1);p.add(o)},x=null;c>0&&(x=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return L(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),wm(e,t,{leading:r,maxWait:t,trailing:i})}(I,c));let C=t=>{u||(f={...f,windowWidth:window.innerWidth,windowHeight:window.innerHeight},Nm(f)&&Im(h)&&e.emit("resizeWithWindow",{sold:d,snew:f,smode:{width:"",height:""},from:"window"}))};window.addEventListener("resize",C);return{check:(e,t)=>{if(u)return;if(!e)return f={offsetWidth:0,offsetHeight:0,clientWidth:0,clientHeight:0,windowWidth:0,windowHeight:0,width:0,height:0},void(h=null);let n=function(e,t){let n={offsetWidth:e.offsetWidth,offsetHeight:e.offsetHeight,clientWidth:e.clientWidth,clientHeight:e.clientHeight,windowWidth:window.innerWidth,windowHeight:window.innerHeight,width:e.offsetWidth,height:e.offsetHeight};if(t){let r=null;try{r=t(e)}catch(e){r=null}n.width=Dm(be(r,"width",null))||0,n.height=Dm(be(r,"height",null))||0}return n}(e,s),r=e===h&&Nm(f)&&Nm(n);r||(o={width:{dir:0,n:0,m:0},height:{dir:0,n:0,m:0}});let i=r?n.width-f.width:0,l=r?n.height-f.height:0;f=n,h=e;let c=y(n,!0),p={cw:v("width",c.dw,c.bw,i),ch:v("height",c.dh,c.bh,l)};if(!p.cw&&!p.ch)return;let m=d;d=n,g++,((e,t,n,r,i,o)=>{w=o;try{x?x(e,t,n,r,i):I(e,t,n,r,i)}finally{w=!1}})(m,n,A(c,p),e,g,t&&a)},clear:()=>{u=!0;for(let e of p)clearTimeout(e);p.clear(),x&&x.cancel(),window.removeEventListener("resize",C),h=null},isCleared:()=>u,isVisible:()=>f.offsetWidth>0&&f.offsetHeight>0}}function Tm(e,t={}){if(!Oi(e))return console.log("invalid f",e),null;let n=!0===be(t,"watchIdentity",!1),r=Sm(t),i=Hi(),o=Mm(i,t,()=>{h(),m()}),a=null,s=null,l=!1,c=!1,u=null,f=null,d=()=>{u.observe(a,{box:"border-box"}),f.observe(a)},h=()=>{!o.isCleared()&&a&&(u.unobserve(a),f.unobserve(a),d())},p=()=>{let e="";if(a)try{e=window.getComputedStyle(a).display}catch(t){e=""}l=!(!a||!a.isConnected),"inline"===e?c=!0:"none"!==e&&""!==e&&(c=!1);let t="inline"===e||"none"===e&&c;t&&null===s?s=setInterval(v,r):t||null===s||(clearInterval(s),s=null)},g=()=>{if(o.isCleared())return;let t=Fm(e);t!==a&&(a&&(u.unobserve(a),f.unobserve(a)),a=t,c=!1,a&&d(),p())},m=()=>{if(o.isCleared())return;a&&a.isConnected&&o.isVisible()&&!n?Bm(y):function(e){Cm.add(e),Em||(Em=new window.MutationObserver(()=>{for(let e of Array.from(Cm))e()}),Em.observe(document.documentElement,{childList:!0,subtree:!0}))}(y)},y=()=>{g(),a&&a.isConnected!==l&&p(),m()},v=()=>{g();try{o.check(a,!0)}finally{p(),m()}};return u=new window.ResizeObserver(v),f=new window.ResizeObserver(v),g(),m(),i.refresh=()=>{g(),o.check(a,!1),p(),m()},i.clear=()=>{o.isCleared()||(o.clear(),Bm(y),u.disconnect(),f.disconnect(),null!==s&&(clearInterval(s),s=null),a=null)},i}function Qm(e){if(!Su(e))return null;try{return e.getBoundingClientRect()}catch(e){}return null}function Lm(e,t){if(!Be(e))return null;if(!ua(e.clientX)||!ua(e.clientY))return null;if(!Su(t))return null;let n=Qm(t);return n?{x:e.clientX-n.left,y:e.clientY-n.top,w:t.offsetWidth,h:t.offsetHeight}:null}function Rm(e){let t=be(e,"clientX",null),n=be(e,"clientY",null),r=be(e,"pageX",null),i=be(e,"pageY",null);if(null!==t&&null!==n&&null!==r&&null!==i)return{clientX:t,clientY:n,pageX:r,pageY:i};let o=be(e,"changedTouches",[]);if(1!==or(o))return null;let a=o[0];return{clientX:be(a,"clientX",null),clientY:be(a,"clientY",null),pageX:be(a,"pageX",null),pageY:be(a,"pageY",null)}}function Um(e={}){let t=null,n=!1,r=be(e,"attIdentify",null);ke(r)||(r="dragprevid");let i=xm(e,"containerOpacity",.4),o=be(e,"containerBackground",null);ke(o)||(o="white");let a=xm(e,"containerBorderWidth",1),s=be(e,"containerBorderColor",null);ke(s)||(s="#f26");let l=`c${Uu(8)}`;function c(e,t,n){let c=function(e,t,n){let i=Qm(e);if(!i)return null;let o=e.cloneNode(!0);o.tShiftX=t-i.left,o.tShiftY=n-i.top,o.tWidth=e.offsetWidth,o.tHeight=e.offsetHeight,o.tParent=e.parentNode,o.setAttribute(r,"");let a=[];try{a=Array.from(o.querySelectorAll("input[type=radio]")),o.matches("input[type=radio]")&&a.push(o)}catch(e){}for(let e of a)e.removeAttribute("name");return o}(e,t,n);if(null===c)return null;let u=document.createElement("div");u.style.position="absolute",u.style.zIndex=1,u.style.top=0,u.style.left=0,u.style.width="100%",u.style.height="100%",u.appendChild(c);let f=document.createElement("div");f.style.position="relative",f.appendChild(u);let d=document.createElement("div");return d.setAttribute("dragpreviewid",l),d.style.position="fixed",d.style.zIndex=1e5,d.style.width=`${c.tWidth+2*a}px`,d.style.height=`${c.tHeight+2*a}px`,d.style.opacity=i,d.style.background=o,d.style.border=`${a}px solid ${s}`,d.style.pointerEvents="none",d.appendChild(f),document.querySelector("body").appendChild(d),{ele:e,node:c,cover:u,shell:f,container:d,timer:null,offs:[]}}function u(e,t,n){window.addEventListener(t,n,!0),e.offs.push(()=>{window.removeEventListener(t,n,!0)})}function f(e,r,i){t&&!n&&(t.container.style.top=r-t.node.tShiftY+"px",t.container.style.left=e-t.node.tShiftX+"px")}function d(){let e=t;if(!e)return;t=null,clearInterval(e.timer);for(let t of e.offs)t();e.offs=[];let n=e.container;n.parentNode&&n.parentNode.removeChild(n)}function h(e,n){if(t)try{for(let r of Object.keys(n))t[e].style[r]=n[r]}catch(e){}}return{createPreview:function(e,n,r){d();let i=null;try{i=c(e,n,r)}catch(e){i=null}null!==i&&(t=i,u(i,"mousemove",e=>{f(e.clientX,e.clientY)}),u(i,"touchmove",e=>{let t=Rm(e);t&&f(t.clientX,t.clientY)}),f(n,r),i.timer=setInterval(()=>{t===i?i.ele.isConnected||d():clearInterval(i.timer)},500))},updateDragPreview:f,pauseDragPreview:function(e){n=e},removeDragPreview:d,setNodeStyle:function(e){h("node",e)},setCoverStyle:function(e){h("cover",e)},setSellStyle:function(e){h("shell",e)},setContainerStyle:function(e){h("container",e)},clear:function(){d()}}}let Hm=new Map,Om=null,qm=-1/0;function Pm(){return"undefined"!=typeof performance&&Oi(performance.now)?performance.now():Date.now()}function $m(e,t){try{return e.getAttribute(t)}catch(e){return null}}function zm(e,t){let n=$m(e,t);return Ne(n)&&Number.isFinite(Number(n))?Vi(n):null}function jm(e,t){let n=be(e,"length",0);if(null===t)return 1===n?e[0]:null;for(let r=0;r<n;r++)if(be(e[r],"identifier",null)===t)return e[r];return null}function Vm(e){let t=be(e,"clientX",null),n=be(e,"clientY",null);return ua(t)&&ua(n)?{clientX:t,clientY:n}:null}function Ym(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Wm(e){for(;e.length>0;){let t=e.pop();try{t()}catch(e){}}}function Gm(e,t,n,r){let i=t?e.members.get(t):null;if(!i)return;let o=r(i);i.ev.emit("change",{mode:n,...o}),e.members.get(t)===i&&i.ev.emit(n,o)}function Jm(e,t){let n=[];try{n=document.elementsFromPoint(t.clientX,t.clientY)}catch(e){n=[]}for(let t of n){let n=e.members.get(t);if(!n)continue;let r=zm(t,n.o.attIndex);if(null!==r)return{ele:t,ind:r}}return null}function _m(e,t=null,n=null){let r=e.drag;if(!r)return;e.drag=null,Om===e&&(Om=null),null!==r.timer&&(clearTimeout(r.timer),r.timer=null),Wm(r.offs),r.pv&&(r.pv.clear(),r.pv=null);let i=r.endEle,o=r.endInd;!i||n&&o===n.ind||Gm(e,i,"leave",e=>({event:t,startInd:r.startInd,startEle:r.startEle,endInd:o,endEle:i,tarInd:o,tarEid:e.eid})),n&&Gm(e,n.ele,"drop",e=>({event:t,startInd:r.startInd,startEle:r.startEle,endInd:n.ind,endEle:n.ele,tarInd:n.ind,tarEid:e.eid}))}function Xm(e,t,n){if(e.drag!==t)return;let r=null;if(t.touch)r=Vm(jm(be(n,"changedTouches",null),t.touchId));else{if(!0===n.isTrusted&&ua(n.buttons)&&!(1&n.buttons))return void _m(e,n);r=Vm(n)}if(!r)return;if(!e.members.has(t.startEle))return void _m(e,n);t.lastP=r,t.pv&&t.pv.updateDragPreview(r.clientX,r.clientY,"domDrag");let i=Jm(e,r),o=t.o,a=()=>{let r=t.endEle,i=t.endInd;t.endEle=null,t.endInd=null,Gm(e,r,"leave",e=>({event:n,startInd:t.startInd,startEle:t.startEle,endInd:i,endEle:r,tarInd:i,tarEid:e.eid})),t.pv&&t.pv.setContainerStyle({opacity:o.previewDisabledOpacity})};if(!i)return void(null!==t.endInd&&a());if(i.ind===t.startInd)return void(null!==t.endInd&&a());if(i.ind!==t.endInd){if(null!==t.endInd&&(a(),e.drag!==t))return;return t.endInd=i.ind,t.endEle=i.ele,Gm(e,i.ele,"enter",e=>({event:n,startInd:t.startInd,startEle:t.startEle,endInd:i.ind,endEle:i.ele,tarInd:i.ind,tarEid:e.eid})),void(t.pv&&t.pv.setContainerStyle({opacity:o.previewOpacity}))}t.endEle=i.ele;let s=Lm(r,i.ele);if(!s)return;let l=s.w>0?s.x/s.w:0,c=s.h>0?s.y/s.h:0;l>=0&&l<=1&&c>=0&&c<=1&&(Gm(e,i.ele,"move",e=>({event:n,startInd:t.startInd,startEle:t.startEle,endInd:t.endInd,endEle:t.endEle,tarInd:t.endInd,tarEid:e.eid,...s,rx:l,ry:c})),t.pv&&t.pv.setContainerStyle({opacity:o.previewOpacity}))}function Km(e,t,n){if(e.drag!==t)return;let r=n;if(t.touch){if(r=jm(be(n,"changedTouches",null),t.touchId),!r)return;qm=Pm()}else if("button"in n&&0!==n.button)return;if(!e.members.has(t.startEle))return void _m(e,n);t.pv&&(t.pv.clear(),t.pv=null);let i=Vm(r);_m(e,n,i?Jm(e,i):null)}function Zm(e,t,n){e.drag===t&&(null!==t.touchId&&null===jm(be(n,"changedTouches",null),t.touchId)||_m(e,n))}function ey(e,t,n){let r=e.g;if(!e.alive||!r.isActive)return;if(Om&&Om.drag&&Om.drag.pressEvent===t)return;if(!n){if("button"in t&&0!==t.button)return;let e=be(t,"sourceCapabilities.firesTouchEvents",null);if(!0===e)return;if(!1!==e&&Pm()-qm<800)return}let i=n?be(t,"changedTouches[0]",null):t,o=n?be(i,"identifier",null):null;void 0===o&&(o=null);let a=Om?Om.drag:null;if(a&&n){if(!a.touch)return;if(null!==a.touchId&&null!==jm(be(t,"touches",null),a.touchId))return}let s=e.o,l=zm(e.ele,s.attIndex);if(null===l)return;Om&&_m(Om,t);let c={touch:n,touchId:o,pressEvent:t,o:s,startInd:l,startEle:e.ele,endInd:null,endEle:null,timer:null,pv:null,offs:[],lastEv:null,lastP:null};r.drag=c,Om=r;let u=e=>t=>{t!==c.lastEv&&(c.lastEv=t,e(r,c,t))},f=u(Xm),d=u(Km),h=u(Zm);if(n){c.offs.push(Ym(window,"touchmove",f,!0)),c.offs.push(Ym(window,"touchend",d,!0)),c.offs.push(Ym(window,"touchcancel",h,!0));let e=be(t,"target",null);e&&Oi(e.addEventListener)&&(c.offs.push(Ym(e,"touchmove",e=>{e.cancelable&&e.preventDefault(),f(e)},{passive:!1})),c.offs.push(Ym(e,"touchend",d)),c.offs.push(Ym(e,"touchcancel",h)))}else c.offs.push(Ym(window,"mousemove",f,!0)),c.offs.push(Ym(window,"mouseup",d,!0));if(c.offs.push(Ym(window,"blur",e=>{r.drag===c&&_m(r,e)})),Gm(r,c.startEle,"start",e=>({event:t,startInd:c.startInd,startEle:c.startEle,tarInd:c.startInd,tarEid:e.eid})),r.drag!==c)return;let p=Vm(i);p&&(c.timer=setTimeout(()=>{c.timer=null,r.drag===c&&(c.pv=Um({attIdentify:s.attIdentify,containerOpacity:s.previewOpacity,containerBackground:s.previewBackground,containerBorderWidth:s.previewBorderWidth,containerBorderColor:s.previewBorderColor}),c.pv.createPreview(c.startEle,p.clientX,p.clientY),c.lastP&&c.pv.updateDragPreview(c.lastP.clientX,c.lastP.clientY,"domDrag"),c.pv.setContainerStyle({opacity:c.endEle?s.previewOpacity:s.previewDisabledOpacity}))},s.timeDragStartDelay))}function ty(e,t={}){function n(e){return(Array.isArray(e)?e:[e]).filter(e=>e&&Oi(e.addEventListener))}let r=n(e),i=be(t,"canPress",null);Oi(i)||(i=()=>!0);let o=be(t,"cancelTouchMove",null);we(o)?o=o?()=>!0:null:Oi(o)||(o=()=>!0);let a=n(be(t,"eleTouchMove",null));0===a.length&&(a=r);let s=Hi(),l="",c=null,u=null,f=[];function d(){return""!==l}function h(e){return"touch"===e||"pen"===e}function p(e){let t=be(e,"pointerType","");return"touch"!==t&&"pen"!==t&&(t="mouse"),t}function g(e){let t=be(e,"pointerId",null);return void 0===t&&(t=null),t}function m(e){if("pointerType"in e&&p(e)!==l)return!1;let t=g(e);return null===c||null===t||t===c}function y(){l="",c=null}function v(e){return{clientX:e.clientX,clientY:e.clientY,pointerType:p(e),event:e}}function A(e){let t=d(),n=l;var r,i;r=p(e),i=g(e),l=r,c=i,t&&(s.emit("free",{pointerType:n,reason:"takeover",event:e}),!d())||s.emit("press",v(e))}function b(e,t){let n=l;y(),s.emit("free",{pointerType:n,reason:t,event:e})}function w(e,t,n,r){e.addEventListener(t,n,r),f.push({target:e,type:t,fun:n,options:r})}let I=e=>{if(e===u)return;if(u=e,!function(e){return!("button"in e)||("pen"===p(e)?0===e.button||5===e.button:0===e.button)}(e))return;if(!i(e))return;let t=p(e);if(d())if("mouse"===t);else{if(l!==t)return;if(!function(e){let t=g(e);if(null!==t&&null!==c&&t===c)return!0;let n=be(e,"isPrimary",null);return!0===n||!1!==n}(e))return}A(e)},x=e=>{d()&&m(e)&&(!function(e){return!(!ua(e.buttons)||33&e.buttons)}(e)?s.emit("drag",v(e)):b(e,"buttonsLost"))},C=e=>{d()&&m(e)&&b(e,"pointercancel"===be(e,"type","")?"cancel":"up")},E=e=>{h(l)&&o(e)&&Ju(e)},B=e=>{h(l)&&"mouse"!==be(e,"pointerType","")&&e.preventDefault()};return function(){for(let e of r)w(e,"pointerdown",I),w(e,"contextmenu",B);if(null!==o)for(let e of a)w(e,"touchmove",E,{passive:!1});w(window,"pointermove",x,{capture:!0}),w(window,"pointerup",C,{capture:!0}),w(window,"pointercancel",C,{capture:!0})}(),s.clear=function(){y(),u=null;for(let e of f)e.target.removeEventListener(e.type,e.fun,e.options);f=[]},s}async function ny(e){let t=[],n=Ja();return await async function e(n){let r=null;if(n.isFile&&(r=await function(e){let t=Ja();try{e.file(t.resolve,t.reject)}catch(e){t.reject(e)}return t}(n)),t.push({type:n.isDirectory?"folder":n.isFile?"file":"unknow",path:n.fullPath,name:n.name,entry:n,file:r}),n.isDirectory){let t=n.createReader(),r=await function(e){let t=Ja();try{e.readEntries(t.resolve,t.reject)}catch(e){t.reject(e)}return t}(t);await rc(r,async t=>{await e(t)})}}(e),n.resolve(t),n}async function ry(e){let t=[];vn(e,e=>{let n=e.webkitGetAsEntry();n&&t.push(n)});let n=await async function(e){let t=[];return await rc(e,async e=>{vn(await ny(e),e=>{t.push(e)})}),t}(t);return n}async function iy(e){let t=[],n=[];try{t=await async function(e){let t=[];return vn(e,e=>{e.type&&t.push({type:"file",name:e.name,file:e})}),t}(be(e,"files",[])),Gu()||(n=await ry(be(e,"items",[])).catch(e=>{console.log(e)}))}catch(e){return Promise.reject(e)}return{files:t,entries:n}}function oy(e){return document.querySelector(e)}function ay(e){return!Nn(e)}var sy=Math.max;var ly,cy=(ly=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:wr(n);return i<0&&(i=sy(r+i,0)),Tn(e,hn(t),i)},function(e,t,n){var r=Object(e);if(!dt(e)){var i=hn(t);e=ht(e),t=function(e){return i(r[e],e,r)}}var o=ly(e,t,n);return o>-1?r[i?e[o]:o]:void 0});let uy=[{name:"pic",group:"image",acp:"image/*",exec:"imageviwer"},{name:"xml",group:"data",acp:"text/xml",exec:"textviwer"},{name:"htm",group:"docums",acp:"text/html",exec:"browser"},{name:"html",group:"docums",acp:"text/html",exec:"browser"},{name:"json",group:"data",acp:"application/json",exec:"textviwer"},{name:"geojson",group:"data",acp:"application/geo+json",exec:"textviwer"},{name:"txt",group:"data",acp:"text/plain",exec:"textviwer"},{name:"csv",group:"data",acp:"text/csv",exec:"excel"},{name:"dat",group:"data",acp:"application/octet-stream",exec:"binaryviwer"},{name:"7z",group:"compress",acp:"application/x-7z-compressed",exec:"compressor"},{name:"bzip",group:"compress",acp:"application/x-bzip",exec:"7z"},{name:"bzip2",group:"compress",acp:"application/x-bzip2",exec:"compressor"},{name:"bz2",group:"compress",acp:"application/x-bzip2",exec:"compressor"},{name:"ace",group:"compress",acp:"application/x-ace-compressed",exec:"compressor"},{name:"Z",group:"compress",acp:"application/x-compress",exec:"compressor"},{name:"lzh",group:"compress",acp:"application/x-lzh-compressed",exec:"compressor"},{name:"lz",group:"compress",acp:"application/x-lzip",exec:"compressor"},{name:"rar",group:"compress",acp:"application/x-rar-compressed",exec:"compressor"},{name:"tar",group:"compress",acp:"application/x-tar",exec:"compressor"},{name:"ar",group:"compress",acp:"application/x-unix-archive",exec:"compressor"},{name:"zip",group:"compress",acp:"application/zip",exec:"compressor"},{name:"gz",group:"compress",acp:"application/gzip",exec:"compressor"},{name:"avro",group:"",acp:"application/avro",exec:""},{name:"dcm",group:"",acp:"application/dicom",exec:""},{name:"eps",group:"",acp:"application/eps",exec:""},{name:"epub",group:"",acp:"application/epub+zip",exec:""},{name:"class",group:"",acp:"application/java-vm",exec:""},{name:"mxf",group:"",acp:"application/mxf",exec:""},{name:"ogx",group:"",acp:"application/ogg",exec:""},{name:"pdf",group:"docums",acp:"application/pdf",exec:"acrobat"},{name:"pgp",group:"",acp:"application/pgp-encrypted",exec:""},{name:"ps",group:"",acp:"application/postscript",exec:""},{name:"ai",group:"",acp:"application/postscript",exec:""},{name:"rtf",group:"docums",acp:"application/rtf",exec:"word"},{name:"icc",group:"",acp:"application/vnd.iccprofile",exec:""},{name:"asf",group:"",acp:"application/vnd.ms-asf",exec:"",msg:"asf的acp可能為application/vnd.ms-asf或audio/x-ms-asf或video/x-ms-asf"},{name:"cab",group:"",acp:"application/vnd.ms-cab-compressed",exec:""},{name:"eot",group:"",acp:"application/vnd.ms-fontobject",exec:""},{name:"chm",group:"",acp:"application/vnd.ms-htmlhelp",exec:""},{name:"pst",group:"",acp:"application/vnd.ms-outlook",exec:""},{name:"odp",group:"docums",acp:"application/vnd.oasis.opendocument.presentation",exec:"powerpoint"},{name:"ods",group:"docums",acp:"application/vnd.oasis.opendocument.spreadsheet",exec:"excel"},{name:"odt",group:"docums",acp:"application/vnd.oasis.opendocument.text",exec:"word"},{name:"ppt",group:"docums",acp:"application/vnd.ms-powerpoint",exec:"powerpoint"},{name:"pptx",group:"docums",acp:"application/vnd.openxmlformats-officedocument.presentationml.presentation",exec:"powerpoint"},{name:"xls",group:"docums",acp:"application/vnd.ms-excel",exec:"excel"},{name:"xlsx",group:"docums",acp:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exec:"excel"},{name:"doc",group:"docums",acp:"application/msword",exec:"word"},{name:"docx",group:"docums",acp:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",exec:"word"},{name:"skp",group:"",acp:"application/vnd.sketchup.skp",exec:""},{name:"pcap",group:"",acp:"application/vnd.tcpdump.pcap",exec:""},{name:"wasm",group:"",acp:"application/wasm",exec:""},{name:"arrow",group:"",acp:"application/x-apache-arrow",exec:""},{name:"dmg",group:"",acp:"application/x-apple-diskimage",exec:""},{name:"arj",group:"",acp:"application/x-arj",exec:""},{name:"asar",group:"",acp:"application/x-asar",exec:""},{name:"blend",group:"",acp:"application/x-blender",exec:"blender"},{name:"cfb",group:"",acp:"application/x-cfb",exec:""},{name:"cpio",group:"",acp:"application/x-cpio",exec:""},{name:"deb",group:"",acp:"application/x-deb",exec:""},{name:"elf",group:"",acp:"application/x-elf",exec:""},{name:"shp",group:"",acp:"application/x-esri-shape",exec:""},{name:"crx",group:"",acp:"application/x-google-chrome-extension",exec:""},{name:"indd",group:"",acp:"application/x-indesign",exec:""},{name:"macho",group:"",acp:"application/x-mach-binary",exec:""},{name:"mie",group:"",acp:"application/x-mie",exec:""},{name:"mobi",group:"",acp:"application/x-mobipocket-ebook",exec:""},{name:"exe",group:"",acp:"application/x-msdownload",exec:""},{name:"nes",group:"",acp:"application/x-nintendo-nes-rom",exec:""},{name:"parquet",group:"",acp:"application/x-parquet",exec:""},{name:"rpm",group:"",acp:"application/x-rpm",exec:""},{name:"swf",group:"",acp:"application/x-shockwave-flash",exec:""},{name:"sqlite",group:"",acp:"application/x-sqlite3",exec:""},{name:"xpi",group:"",acp:"application/x-xpinstall",exec:""},{name:"xz",group:"",acp:"application/x-xz",exec:""},{name:"alias",group:"",acp:"application/x.apple.alias",exec:""},{name:"fbx",group:"",acp:"application/x.autodesk.fbx",exec:""},{name:"lnk",group:"",acp:"application/x.ms.shortcut",exec:""},{name:"zst",group:"",acp:"application/zstd",exec:""},{name:"aac",group:"audio",acp:"audio/aac",exec:"audioplayer"},{name:"aif",group:"audio",acp:"audio/aiff",exec:"audioplayer"},{name:"amr",group:"audio",acp:"audio/amr",exec:"audioplayer"},{name:"ape",group:"audio",acp:"audio/ape",exec:"audioplayer"},{name:"mid",group:"audio",acp:"audio/midi",exec:"audioplayer"},{name:"m4b",group:"audio",acp:"audio/mp4",exec:"audioplayer"},{name:"f4a",group:"audio",acp:"audio/mp4",exec:"audioplayer"},{name:"f4b",group:"audio",acp:"audio/mp4",exec:"audioplayer"},{name:"mp3",group:"audio",acp:"audio/mpeg",exec:"audioplayer"},{name:"mp2",group:"audio",acp:"audio/mpeg",exec:"audioplayer"},{name:"mp1",group:"audio",acp:"audio/mpeg",exec:"audioplayer"},{name:"oga",group:"audio",acp:"audio/ogg",exec:"audioplayer"},{name:"spx",group:"audio",acp:"audio/ogg",exec:"audioplayer"},{name:"ogg",group:"audio",acp:"audio/ogg",exec:"audioplayer"},{name:"opus",group:"audio",acp:"audio/opus",exec:"audioplayer"},{name:"qcp",group:"audio",acp:"audio/qcelp",exec:"audioplayer"},{name:"ac3",group:"audio",acp:"audio/vnd.dolby.dd-raw",exec:"audioplayer"},{name:"wav",group:"audio",acp:"audio/wav",exec:"audioplayer"},{name:"wv",group:"audio",acp:"audio/wavpack",exec:"audioplayer"},{name:"dsf",group:"audio",acp:"audio/x-dsf",exec:"audioplayer"},{name:"flac",group:"audio",acp:"audio/x-flac",exec:"audioplayer"},{name:"it",group:"audio",acp:"audio/x-it",exec:"audioplayer"},{name:"m4a",group:"audio",acp:"audio/x-m4a",exec:"audioplayer"},{name:"mpc",group:"audio",acp:"audio/x-musepack",exec:"audioplayer"},{name:"s3m",group:"audio",acp:"audio/x-s3m",exec:"audioplayer"},{name:"voc",group:"audio",acp:"audio/x-voc",exec:"audioplayer"},{name:"xm",group:"audio",acp:"audio/x-xm",exec:"audioplayer"},{name:"otf",group:"",acp:"font/otf",exec:""},{name:"ttf",group:"",acp:"font/ttf",exec:""},{name:"woff",group:"",acp:"font/woff",exec:""},{name:"woff2",group:"",acp:"font/woff2",exec:""},{name:"apng",group:"image",acp:"image/apng",exec:"imageviwer"},{name:"avif",group:"image",acp:"image/avif",exec:"imageviwer"},{name:"bmp",group:"image",acp:"image/bmp",exec:"imageviwer"},{name:"bpg",group:"image",acp:"image/bpg",exec:"imageviwer"},{name:"flif",group:"image",acp:"image/flif",exec:"imageviwer"},{name:"gif",group:"image",acp:"image/gif",exec:"imageviwer"},{name:"heic",group:"image",acp:"image/heif",exec:"imageviwer"},{name:"icns",group:"image",acp:"image/icns",exec:"imageviwer"},{name:"j2c",group:"image",acp:"image/j2c",exec:"imageviwer"},{name:"jls",group:"image",acp:"image/jls",exec:"imageviwer"},{name:"jp2",group:"image",acp:"image/jp2",exec:"imageviwer"},{name:"jpg",group:"image",acp:"image/jpeg",exec:"imageviwer"},{name:"jpm",group:"image",acp:"image/jpm",exec:"imageviwer"},{name:"jpx",group:"image",acp:"image/jpx",exec:"imageviwer"},{name:"jxl",group:"image",acp:"image/jxl",exec:"imageviwer"},{name:"ktx",group:"image",acp:"image/ktx",exec:"imageviwer"},{name:"mj2",group:"image",acp:"image/mj2",exec:"imageviwer"},{name:"png",group:"image",acp:"image/png",exec:"imageviwer"},{name:"tif",group:"image",acp:"image/tiff",exec:"imageviwer"},{name:"psd",group:"image",acp:"image/vnd.adobe.photoshop",exec:"imageviwer"},{name:"dwg",group:"image",acp:"image/vnd.dwg",exec:"imageviwer"},{name:"jxr",group:"image",acp:"image/vnd.ms-photo",exec:"imageviwer"},{name:"webp",group:"image",acp:"image/webp",exec:"imageviwer"},{name:"dng",group:"image",acp:"image/x-adobe-dng",exec:"imageviwer"},{name:"cr2",group:"image",acp:"image/x-canon-cr2",exec:"imageviwer"},{name:"cr3",group:"image",acp:"image/x-canon-cr3",exec:"imageviwer"},{name:"raf",group:"image",acp:"image/x-fujifilm-raf",exec:"imageviwer"},{name:"ico",group:"image",acp:"image/x-icon",exec:"imageviwer"},{name:"cur",group:"image",acp:"image/x-icon",exec:"imageviwer"},{name:"nef",group:"image",acp:"image/x-nikon-nef",exec:"imageviwer"},{name:"orf",group:"image",acp:"image/x-olympus-orf",exec:"imageviwer"},{name:"rw2",group:"image",acp:"image/x-panasonic-rw2",exec:"imageviwer"},{name:"arw",group:"image",acp:"image/x-sony-arw",exec:"imageviwer"},{name:"xcf",group:"image",acp:"image/x-xcf",exec:"imageviwer"},{name:"3mf",group:"",acp:"model/3mf",exec:""},{name:"glb",group:"",acp:"model/gltf-binary",exec:""},{name:"stl",group:"",acp:"model/stl",exec:""},{name:"vtp",group:"",acp:"model/vtp",exec:""},{name:"vtk",group:"",acp:"model/vtk",exec:""},{name:"vtu",group:"",acp:"model/vtu",exec:""},{name:"vti",group:"",acp:"model/vti",exec:""},{name:"vts",group:"",acp:"model/vts",exec:""},{name:"vtr",group:"",acp:"model/vtr",exec:""},{name:"ics",group:"",acp:"text/calendar",exec:""},{name:"vcf",group:"",acp:"text/vcard",exec:""},{name:"3gp",group:"video",acp:"video/3gpp",exec:"videoplayer"},{name:"3g2",group:"video",acp:"video/3gpp2",exec:"videoplayer"},{name:"m2p",group:"video",acp:"video/MP2P",exec:"videoplayer"},{name:"vob",group:"video",acp:"video/MP2P",exec:"videoplayer"},{name:"sub",group:"video",acp:"video/MP2P",exec:"videoplayer",msg:"與字幕檔衝突"},{name:"mts",group:"video",acp:"video/mp2t",exec:"videoplayer"},{name:"m4p",group:"video",acp:"video/mp4",exec:"videoplayer"},{name:"f4v",group:"video",acp:"video/mp4",exec:"videoplayer"},{name:"f4p",group:"video",acp:"video/mp4",exec:"videoplayer"},{name:"mp4",group:"video",acp:"video/mp4",exec:"videoplayer"},{name:"mpg",group:"video",acp:"video/mpeg",exec:"videoplayer",msg:"mpg可能為mpeg或video/MP1S或video/MP2S"},{name:"ogv",group:"video",acp:"video/ogg",exec:"videoplayer"},{name:"ogm",group:"video",acp:"video/ogg",exec:"videoplayer"},{name:"mov",group:"video",acp:"video/quicktime",exec:"videoplayer"},{name:"avi",group:"video",acp:"video/vnd.avi",exec:"videoplayer"},{name:"webm",group:"video",acp:"video/webm",exec:"videoplayer"},{name:"flv",group:"video",acp:"video/x-flv",exec:"videoplayer"},{name:"m4v",group:"video",acp:"video/x-m4v",exec:"videoplayer"},{name:"mkv",group:"video",acp:"video/x-matroska",exec:"videoplayer"}];function fy(e=""){let t=null;return ke(e)?(t=cy(uy,{name:e}),Be(t)||(t=null)):t=uy,t}function dy(e=""){if(""!==e&&"name"!==e&&"group"!==e&&"acp"!==e&&"exec"!==e)return[];let t=fy();if(""===e)return t;let n={};return vn(t,function(t){let r=t[e];Me(n,r)||(n[r]=[]),n[r].push(t)}),n}function hy(e="*"){if("*"===e)return e;if(!Se(e)&&!Mn(e))return"*";"common"===e&&(e=["docums","compress","image","data"]);let t=dy();function n(e){return Pn(bn(e,"acp"))}Se(e)&&(e=[e]);let r="";if(Mn(e)){let i=bn(e,function(e){return function(e){return n(aa(t,{group:e}))}(e)}),o=En(i,bn(e,function(e){return n(aa(t,{name:e}))}));o=aa(o,ay),r=vo(o,",")}return r}function py(e,t=1e3){(t=Ir(t))<=0&&(t=1e3);let n={},r=[];return vn(be(e,"files",[]),function(e,i){let o=e.size/1024/1024;o>t&&(n[i]=`file size[${o}]mb > ${t}mb`),r.push(e)}),{files:r,errs:n}}function gy(e){let t=function(e,n){return null===e.parentNode?n:t(e.parentNode,n.concat([e]))};return e instanceof HTMLElement||e instanceof SVGElement?t(e.parentNode,[]):[]}function my(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],a=t(o);if(null!=a&&(void 0===s?a==a&&!N(a):n(a,s)))var s=a,l=o}return l}function yy(e,t){return e<t}function vy(e){return e&&e.length?my(e,un,yy):void 0}function Ay(e,t={}){let n=be(t,"tag","detector"),r=Hi();r.error=be(t,"error",null);let i="idle",o=[],a=()=>{let e=o;o=[];for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(e){}},s=e=>{if(Oi(e))if("disposed"!==i)o.push(e);else try{e()}catch(e){}},l=(e,t)=>{"running"===i&&qi(r,e,[t],{tag:n})};return r.create=()=>{"idle"===i&&(i="pending",Oi(e)&&Promise.resolve().then(()=>{if("pending"===i){i="running";try{e(l,s)}catch(e){r.error=e,i="disposed",a()}}}))},r.dispose=()=>(i="disposed",a(),!0),r}let by={getMode:function(e){return"event"===be(e,"mode","")?"event":"promise"},detectorEvent:Ay,detectorFail:function(e,t){return"event"===e?Ay(null,{error:t}):Promise.reject(t)}};function wy(){return!function(){try{return"IntersectionObserver"in window}catch(e){return!1}}()||!function(){try{return"IntersectionObserverEntry"in window}catch(e){return!1}}()||!(function(){try{return"intersectionRatio"in window.IntersectionObserverEntry.prototype}catch(e){return!1}}()||Oi(window.IntersectionObserverEntry))}function Iy(e){let t=null,n=-1/0;for(let r of e||[]){let e=Number(r&&r.time);Number.isFinite(e)||(e=n),e>=n&&(n=e,t=r)}return t?!!t.isIntersecting:null}function xy(e,t,n={}){if(!Su(e))return Promise.reject("invalid ele");let r=tc().markmap,{Transformer:i,Markmap:o,loadCSS:a,loadJS:s}=r,l=e=>{let t=new i,{root:n,features:r}=t.transform(e),{styles:o,scripts:a}=t.getUsedAssets(r);return{root:n,features:r,styles:o,scripts:a}},{root:c,styles:u,scripts:f}=l(t);u&&a(u),f&&s(f,{getMarkmap:()=>r}),e.innerHTML="";let d=o.create(e,null,c);return d.transMarkdown=l,d}const Cy=e=>void 0===e||"auto"===e||"instant"===e||"smooth"===e;function Ey(e,t){this.scrollLeft=e,this.scrollTop=t}const By=(e,t,n="cannot convert to dictionary.")=>`Failed to execute '${e}' on '${t}': ${n}`,Sy=(e,t,n)=>By(e,t,`The provided value '${n}' is not a valid enum value of type ScrollBehavior.`),ky=(e,t,n)=>{var r;const i=`__SEAMLESS.BACKUP$${t}`;return e[i]||!e[t]||(null===(r=e[t])||void 0===r?void 0:r.__isPolyfill)||(e[i]=e[t]),e[i]||n},Fy=e=>{const t=typeof e;return null!==e&&("object"===t||"function"===t)},Dy=e=>"scrollBehavior"in window.document.documentElement.style&&!0!==(null==e?void 0:e.forcePolyfill),Ny=e=>{Object.defineProperty(e,"__isPolyfill",{value:!0})},My=(e,t)=>{Ny(t),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach(n=>{ky(n,e),n[e]=t})},Ty=e=>e.ownerDocument.scrollingElement||e.ownerDocument.documentElement;const Qy=e=>.5*(1-Math.cos(Math.PI*e));function Ly(){var e;let t;return t=(null===(e=window.performance)||void 0===e?void 0:e.now)?()=>window.performance.now():()=>window.Date.now(),Ly=t,t()}const Ry=e=>{const t=(Ly()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();const n=(e.timingFunc||Qy)(t),r=e.startX+(e.targetX-e.startX)*n,i=e.startY+(e.targetY-e.startY)*n;e.method(r,i),e.rafId=window.requestAnimationFrame(()=>{Ry(e)})},Uy=e=>isFinite(e)?Number(e):0,Hy=(e,t,n)=>{var r,i;if(!(e=>{var t;return null!==(t=e.isConnected)&&void 0!==t?t:!(e.ownerDocument&&1&e.ownerDocument.compareDocumentPosition(e))})(e))return;const o=e.scrollLeft,a=e.scrollTop,s=Uy(null!==(r=t.left)&&void 0!==r?r:o),l=Uy(null!==(i=t.top)&&void 0!==i?i:a);if(s===o&&l===a)return;const c=ky(HTMLElement.prototype,"scroll",Ey),u=ky(Object.getPrototypeOf(e),"scroll",c).bind(e);if("smooth"!==t.behavior)return void u(s,l);const f=()=>{window.removeEventListener("wheel",h),window.removeEventListener("touchmove",h)},d=Object.assign(Object.assign({},n),{timeStamp:Ly(),startX:o,startY:a,targetX:s,targetY:l,rafId:0,method:u,callback:()=>{f();const t=9===e.nodeType;e.dispatchEvent(function(e){if("function"==typeof Event)return new Event("scrollend",{bubbles:e,cancelable:!1});const t=document.createEvent("Event");return t.initEvent("scrollend",e,!1),t}(t))}}),h=()=>{window.cancelAnimationFrame(d.rafId),f()};window.addEventListener("wheel",h,{passive:!0,once:!0}),window.addEventListener("touchmove",h,{passive:!0,once:!0}),Ry(d)},Oy=e=>(t,n,r)=>{const[i,o]=(a=t).window===a?[Ty(t.document.documentElement),"Window"]:[t,"Element"];var a;const s=null!=n?n:{};if(!Fy(s))throw new TypeError(By(e,o));if(!Cy(s.behavior))throw new TypeError(Sy(e,o,s.behavior));"scrollBy"===e&&(s.left=Uy(s.left)+i.scrollLeft,s.top=Uy(s.top)+i.scrollTop),Hy(i,s,r)},qy=Oy("scroll"),Py=Oy("scrollTo"),$y=Oy("scrollBy"),zy=qy,jy=e=>{switch(e){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0},Vy=(e,t,n,r)=>{let i=0;switch(t||(i^=2),e){case 0:i=i>>1|(1&i)<<1,[n,r]=[r,n];break;case 1:case 3:i^=1;break;case 4:i^=2}return[i,n,r]},Yy=e=>!(1&~Vy(jy(e.writingMode),"rtl"!==e.direction,void 0,void 0)[0]),Wy=(e,t,n,r,i,o,a)=>0!==e?e:i<t&&o>n||i>t&&o<n?null:i<=t&&a<=r||o>=n&&a>=r?2:o>n&&a<r||i<t&&a>r?3:null,Gy=e=>"visible"!==e&&"clip"!==e,Jy=(e,t)=>(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth)&&(Gy(t.overflowY)||Gy(t.overflowX)||e===Ty(e)),_y=e=>{const t=e.parentNode,n=e.parentElement;if(null===n&&null!==t){if(11===t.nodeType)return t.host;if(9===t.nodeType)return(e=>{var t;try{return(null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.frameElement)||null}catch(e){return null}})(e)}return n},Xy=(e,t,n)=>e<t?t:e>n?n:e,Ky=(e,t,n)=>{switch(e){case 1:return(t+n)/2;case 3:return n;case 2:case 0:return t}},Zy=(e,t)=>{var n,r,i;const o=null===(n=e.ownerDocument.defaultView)||void 0===n?void 0:n.visualViewport,[a,s,l,c]=e===Ty(e)?[0,0,null!==(r=null==o?void 0:o.width)&&void 0!==r?r:e.clientWidth,null!==(i=null==o?void 0:o.height)&&void 0!==i?i:e.clientHeight]:[t.left,t.top,e.clientWidth,e.clientHeight],u=a+e.clientLeft,f=s+e.clientTop;return[f,u+l,f+c,u]},ev=(e,t)=>{const n=[];let r=e.ownerDocument,i=r.defaultView;if(!i)return n;const o=window.getComputedStyle(e),a="rtl"!==o.direction,s=jy(o.writingMode||o.getPropertyValue("-webkit-writing-mode")||o.getPropertyValue("-ms-writing-mode")),[l,c]=((e,t,n)=>{const[r,i,o]=Vy(t,n,e.block||"start",e.inline||"nearest");return[i,o].map((e,t)=>{switch(e){case"center":return 1;case"nearest":return 0;default:return"start"===e==!(r>>t&1)?2:3}})})(t,s,a);let[u,f,d,h]=((e,t,n)=>{const{top:r,right:i,bottom:o,left:a}=t,s=(l=e.ownerDocument,["scroll-margin","scroll-snap-margin"].filter(e=>e in l.documentElement.style)[0]);var l;if(!s)return[r,i,o,a];const c=e=>{const t=n.getPropertyValue(`${s}-${e}`);return parseInt(t,10)||0};return[r-c("top"),i+c("right"),o+c("bottom"),a-c("left")]})(e,e.getBoundingClientRect(),o);for(let o=_y(e);null!==o;o=_y(o)){if(r!==o.ownerDocument){if(r=o.ownerDocument,i=r.defaultView,!i)break;const{left:e,top:t}=o.getBoundingClientRect();u+=t,f+=e,d+=t,h+=e}const e=i.getComputedStyle(o);if("fixed"===e.position)break;if(!Jy(o,e))continue;const a=o.getBoundingClientRect(),[s,p,g,m]=Zy(o,a),y=Wy(l,m,p,o.clientWidth,h,f,f-h),v=Wy(c,s,g,o.clientHeight,u,d,d-u),A=null===y?0:Ky(y,h,f)-Ky(y,m,p),b=null===v?0:Ky(v,u,d)-Ky(v,s,g),w=Yy(e)?Xy(A,-o.scrollWidth+o.clientWidth-o.scrollLeft,-o.scrollLeft):Xy(A,-o.scrollLeft,o.scrollWidth-o.clientWidth-o.scrollLeft),I=Xy(b,-o.scrollTop,o.scrollHeight-o.clientHeight-o.scrollTop);n.push([o,{left:o.scrollLeft+w,top:o.scrollTop+I,behavior:t.behavior}]),u=Math.max(u-I,s),f=Math.min(f-w,p),d=Math.min(d-I,g),h=Math.max(h-w,m)}return n},tv=(e,t,n)=>{const r=t||{};if(!Cy(r.behavior))throw new TypeError(Sy("scrollIntoView","Element",r.behavior));ev(e,r).forEach(([e,t])=>{zy(e,t,n)})},nv=(e,t)=>n=>{if(Dy(n))return;const r={scroll:qy,scrollTo:Py,scrollBy:$y}[e];t(e,function(){const e=arguments;if(1===arguments.length)return void r(this,e[0],n);r(this,{left:e[0],top:e[1]})})},rv=nv("scroll",My),iv=nv("scrollTo",My),ov=nv("scrollBy",My),av=(e,t)=>{Ny(t),ky(window,e),window[e]=t},sv=nv("scroll",av),lv=nv("scrollTo",av),cv=nv("scrollBy",av);function uv(e){tv(this,{block:null==e||e?"start":"end",inline:"nearest"})}const fv=e=>{if(Dy(e))return;const t=ky(window.HTMLElement.prototype,"scrollIntoView",uv);My("scrollIntoView",function(){const n=arguments,r=n[0];1===n.length&&Fy(r)?tv(this,r,e):t.apply(this,n)})},dv=e=>{Dy(e)||(rv(e),iv(e),ov(e),fv(e),sv(e),lv(e),cv(e))};var hv={exports:{}};
|
|
16
16
|
/*!
|
|
17
17
|
* Viewer.js v1.12.0
|
|
18
18
|
* https://fengyuanchen.github.io/viewerjs
|