@fudanda/admin-antd 2.20261109.1-beta.1 → 2.20261109.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/ApiTokensPage-w3JGRNQC.js +2 -0
- package/dist/chunks/ApiTokensPage-w3JGRNQC.js.map +1 -0
- package/dist/chunks/{App-CfQx7jWq.js → App-nh6_qOo8.js} +5 -5
- package/dist/chunks/{App-CfQx7jWq.js.map → App-nh6_qOo8.js.map} +1 -1
- package/dist/chunks/{AppModal-CVoUC2t3.js → AppModal-CEouaU03.js} +2 -2
- package/dist/chunks/{AppModal-CVoUC2t3.js.map → AppModal-CEouaU03.js.map} +1 -1
- package/dist/chunks/{ArcBaseAdmin-DQyddbFC.js → ArcBaseAdmin-CX7fQz4x.js} +2 -2
- package/dist/chunks/{ArcBaseAdmin-DQyddbFC.js.map → ArcBaseAdmin-CX7fQz4x.js.map} +1 -1
- package/dist/chunks/{DepartmentsPage-CQx53QGE.js → DepartmentsPage-BdD9VfDI.js} +2 -2
- package/dist/chunks/{DepartmentsPage-CQx53QGE.js.map → DepartmentsPage-BdD9VfDI.js.map} +1 -1
- package/dist/chunks/{DictsPage-BGnamkWk.js → DictsPage-fxBdV1-3.js} +2 -2
- package/dist/chunks/{DictsPage-BGnamkWk.js.map → DictsPage-fxBdV1-3.js.map} +1 -1
- package/dist/chunks/{EntityContextRuntime-CbzeMNXR.js → EntityContextRuntime-CMhoj6qe.js} +2 -2
- package/dist/chunks/{EntityContextRuntime-CbzeMNXR.js.map → EntityContextRuntime-CMhoj6qe.js.map} +1 -1
- package/dist/chunks/EntityContextRuntime-Dc89ZSnM.js +1 -0
- package/dist/chunks/{ExportButton-sMPAV2hd.js → ExportButton-DGxB2tcu.js} +2 -2
- package/dist/chunks/{ExportButton-sMPAV2hd.js.map → ExportButton-DGxB2tcu.js.map} +1 -1
- package/dist/chunks/{FileViewerPreviewPanel-Rti7pUhU.js → FileViewerPreviewPanel-BMZ7FdKV.js} +3 -3
- package/dist/chunks/{FileViewerPreviewPanel-Rti7pUhU.js.map → FileViewerPreviewPanel-BMZ7FdKV.js.map} +1 -1
- package/dist/chunks/{FilesPage-D_iYsUwl.js → FilesPage-DrgWELKy.js} +3 -3
- package/dist/chunks/{FilesPage-D_iYsUwl.js.map → FilesPage-DrgWELKy.js.map} +1 -1
- package/dist/chunks/{IdentitySecurityPage-rDYX5ksX.js → IdentitySecurityPage-BjTKvr-O.js} +2 -2
- package/dist/chunks/{IdentitySecurityPage-rDYX5ksX.js.map → IdentitySecurityPage-BjTKvr-O.js.map} +1 -1
- package/dist/chunks/{LogStatsScaffold-CMIz4z0a.js → LogStatsScaffold-DaB0JeAN.js} +2 -2
- package/dist/chunks/{LogStatsScaffold-CMIz4z0a.js.map → LogStatsScaffold-DaB0JeAN.js.map} +1 -1
- package/dist/chunks/{LoginLogsPage-Bv5pPJb2.js → LoginLogsPage-VmYC7i6q.js} +2 -2
- package/dist/chunks/{LoginLogsPage-Bv5pPJb2.js.map → LoginLogsPage-VmYC7i6q.js.map} +1 -1
- package/dist/chunks/{LoginLogsTable-DYcTx2oR.js → LoginLogsTable-CULcc_e8.js} +2 -2
- package/dist/chunks/{LoginLogsTable-DYcTx2oR.js.map → LoginLogsTable-CULcc_e8.js.map} +1 -1
- package/dist/chunks/{MarkdownPreviewPanel-lqs6AsoN.js → MarkdownPreviewPanel-CBcPc7Wv.js} +2 -2
- package/dist/chunks/{MarkdownPreviewPanel-lqs6AsoN.js.map → MarkdownPreviewPanel-CBcPc7Wv.js.map} +1 -1
- package/dist/chunks/{MasterDetailLayout-B5uqvh98.js → MasterDetailLayout-ByIBpmkZ.js} +2 -2
- package/dist/chunks/{MasterDetailLayout-B5uqvh98.js.map → MasterDetailLayout-ByIBpmkZ.js.map} +1 -1
- package/dist/chunks/{McpSettingsPage-Cdej9Evi.js → McpSettingsPage-C5V_rj2V.js} +2 -2
- package/dist/chunks/{McpSettingsPage-Cdej9Evi.js.map → McpSettingsPage-C5V_rj2V.js.map} +1 -1
- package/dist/chunks/{MemberAssignmentSheet-AKvLbbYW.js → MemberAssignmentSheet-DL0fg1Yf.js} +2 -2
- package/dist/chunks/{MemberAssignmentSheet-AKvLbbYW.js.map → MemberAssignmentSheet-DL0fg1Yf.js.map} +1 -1
- package/dist/chunks/{MenuCommandPalette-ia0pSIFg.js → MenuCommandPalette-C2PvK3Gh.js} +2 -2
- package/dist/chunks/{MenuCommandPalette-ia0pSIFg.js.map → MenuCommandPalette-C2PvK3Gh.js.map} +1 -1
- package/dist/chunks/{MenusPage-Bh55bvKH.js → MenusPage-Bytd1HlW.js} +2 -2
- package/dist/chunks/{MenusPage-Bh55bvKH.js.map → MenusPage-Bytd1HlW.js.map} +1 -1
- package/dist/chunks/{MonacoPreviewPanel-CT_sjf7Z.js → MonacoPreviewPanel-BZrNIcFZ.js} +2 -2
- package/dist/chunks/{MonacoPreviewPanel-CT_sjf7Z.js.map → MonacoPreviewPanel-BZrNIcFZ.js.map} +1 -1
- package/dist/chunks/{NavListPanel-DMIUMh7q.js → NavListPanel-zwUDIYSP.js} +2 -2
- package/dist/chunks/{NavListPanel-DMIUMh7q.js.map → NavListPanel-zwUDIYSP.js.map} +1 -1
- package/dist/chunks/{OperationLogsPage-7XVfmhxP.js → OperationLogsPage-D2BQdGNp.js} +2 -2
- package/dist/chunks/{OperationLogsPage-7XVfmhxP.js.map → OperationLogsPage-D2BQdGNp.js.map} +1 -1
- package/dist/chunks/{OperationLogsTable-gp-WZxiF.js → OperationLogsTable-DaaON4QR.js} +3 -3
- package/dist/chunks/{OperationLogsTable-gp-WZxiF.js.map → OperationLogsTable-DaaON4QR.js.map} +1 -1
- package/dist/chunks/{PDFPreviewPanel-CyfhyWav.js → PDFPreviewPanel-CMmnWBKW.js} +3 -3
- package/dist/chunks/{PDFPreviewPanel-CyfhyWav.js.map → PDFPreviewPanel-CMmnWBKW.js.map} +1 -1
- package/dist/chunks/{PositionsPage-Bwua1vNV.js → PositionsPage-CBZITssT.js} +2 -2
- package/dist/chunks/{PositionsPage-Bwua1vNV.js.map → PositionsPage-CBZITssT.js.map} +1 -1
- package/dist/chunks/{PreferencesSheetBody-C80D3dOM.js → PreferencesSheetBody-B0poTPEA.js} +2 -2
- package/dist/chunks/{PreferencesSheetBody-C80D3dOM.js.map → PreferencesSheetBody-B0poTPEA.js.map} +1 -1
- package/dist/chunks/{ProfilePage-DeTw-59a.js → ProfilePage-DLhacdWt.js} +2 -2
- package/dist/chunks/{ProfilePage-DeTw-59a.js.map → ProfilePage-DLhacdWt.js.map} +1 -1
- package/dist/chunks/{ProjectInfoPage-Bqn3gfXa.js → ProjectInfoPage-CJpGxpu5.js} +2 -2
- package/dist/chunks/{ProjectInfoPage-Bqn3gfXa.js.map → ProjectInfoPage-CJpGxpu5.js.map} +1 -1
- package/dist/chunks/{RelationPanel-Bio-ig-l.js → RelationPanel-BsbfEDo2.js} +2 -2
- package/dist/chunks/{RelationPanel-Bio-ig-l.js.map → RelationPanel-BsbfEDo2.js.map} +1 -1
- package/dist/chunks/{RolesPage-fwUSs2HR.js → RolesPage-46dzdiah.js} +2 -2
- package/dist/chunks/{RolesPage-fwUSs2HR.js.map → RolesPage-46dzdiah.js.map} +1 -1
- package/dist/chunks/{SessionConflictModal-Dw4opoNP.js → SessionConflictModal-Bm38eExL.js} +2 -2
- package/dist/chunks/{SessionConflictModal-Dw4opoNP.js.map → SessionConflictModal-Bm38eExL.js.map} +1 -1
- package/dist/chunks/SettingModuleDetail-BjxUJeH5.js +17 -0
- package/dist/chunks/SettingModuleDetail-BjxUJeH5.js.map +1 -0
- package/dist/chunks/{SettingsPage-Cy5-q-P6.js → SettingsPage-C32Vuizm.js} +2 -2
- package/dist/chunks/{SettingsPage-Cy5-q-P6.js.map → SettingsPage-C32Vuizm.js.map} +1 -1
- package/dist/chunks/{StatCard-BROG4NSp.js → StatCard-CRPfkSBY.js} +2 -2
- package/dist/chunks/{StatCard-BROG4NSp.js.map → StatCard-CRPfkSBY.js.map} +1 -1
- package/dist/chunks/{UserGroupsPage-CsTBkUPy.js → UserGroupsPage-08G5MdGm.js} +2 -2
- package/dist/chunks/{UserGroupsPage-CsTBkUPy.js.map → UserGroupsPage-08G5MdGm.js.map} +1 -1
- package/dist/chunks/{UserLogsPanels-3u8Z93YU.js → UserLogsPanels-nbIrMym9.js} +2 -2
- package/dist/chunks/{UserLogsPanels-3u8Z93YU.js.map → UserLogsPanels-nbIrMym9.js.map} +1 -1
- package/dist/chunks/{UserTransferSelect-ChLj4EkS.js → UserTransferSelect-C8betaWG.js} +2 -2
- package/dist/chunks/{UserTransferSelect-ChLj4EkS.js.map → UserTransferSelect-C8betaWG.js.map} +1 -1
- package/dist/chunks/{UsersPage-CfNnQJi4.js → UsersPage-BjTiNEqF.js} +2 -2
- package/dist/chunks/{UsersPage-CfNnQJi4.js.map → UsersPage-BjTiNEqF.js.map} +1 -1
- package/dist/chunks/{browser-BKLM0ThC-D0TgzKTC.js → browser-BKLM0ThC-Cp7Gi4-F.js} +1 -1
- package/dist/chunks/{code-BkkeN2fd.js → code-LswxAr98.js} +1 -1
- package/dist/chunks/{direct-engine-m32m22nx.js → direct-engine-Dv_6v4sx.js} +1 -1
- package/dist/chunks/{html-BGNWR_Bp.js → html-BokjxlLb.js} +1 -1
- package/dist/chunks/{line-CsTeuEcK.js → line-Bqh6atHH.js} +1 -1
- package/dist/chunks/{lrc-D6gjnGZ5.js → lrc-T5e1svZG.js} +1 -1
- package/dist/chunks/{markdown-BglUe9j8.js → markdown-BpWokN1s.js} +1 -1
- package/dist/chunks/{patch-C97Yl3jr.js → patch-BYVX5C9G.js} +1 -1
- package/dist/chunks/{worker-engine-B7_3qQVS.js → worker-engine-CtUAeI4G.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-DAkFn9SG.js → src-D6UlLiVN.js} +2 -2
- package/dist/{src-DAkFn9SG.js.map → src-D6UlLiVN.js.map} +1 -1
- package/package.json +9 -9
- package/dist/chunks/ApiTokensPage-DiRMgViD.js +0 -2
- package/dist/chunks/ApiTokensPage-DiRMgViD.js.map +0 -1
- package/dist/chunks/EntityContextRuntime-C9q95WDf.js +0 -1
- package/dist/chunks/SettingModuleDetail-I9CSJ-fh.js +0 -17
- package/dist/chunks/SettingModuleDetail-I9CSJ-fh.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"s2CAEM,GAAW,GAAU,CAGvB,IAAMA,GADUC,EAAM,KAAK,CAAC,CAAC,QAAQ,gCAAiC,EACrC,CAAC,CAAC,MAAM,wBAAwB,IAA2C,KAA4C,YAAY,EACpK,MAAO,CAACD,GAAU,CAAC,OAAQ,QAAS,SAAU,KAAK,CAAC,CAAC,SAASA,CAAM,CACxE,EACa,IAA8B,EAAa,EAAM,EAAU,CAAC,IAAM,CAC3E,IAAME,MAAiB,CACnB,IAAMC,EAAWC,EAAY,uBAAuB,EAEpD,OADAD,EAAS,OAAOC,EAAY,eAAeC,CAAI,CAAC,EACzCF,CACX,EACMG,EAAYF,EAAY,YAC9B,GAAI,CAACE,EACD,OAAOJ,EAAS,EACpB,IAAMK,EAAWC,EAAgBF,CAAS,EAC1C,GAAI,CAACC,EAAS,YACV,OAAOL,EAAS,EACpB,IAAMC,EAAWI,EAAS,SAASF,EAAM,CACrC,oBAAqB,GACrB,aAAcI,EAAQ,SAChB,CAAE,KAAM,GAAM,IAAK,GAAM,WAAY,EAAK,EAC1C,CAAE,KAAM,EAAK,EACnB,SAAU,CAAC,QAAQ,EACnB,YAAa,CAAC,OAAQ,QAAS,OAAQ,SAAU,SAAU,SAAU,QAAS,UAAU,EACxF,YAAa,CAAC,SAAU,aAAc,SAAU,OAAO,CAC3D,CAAC,EAgBD,OAfAN,EAAS,iBAAiB,GAAG,CAAC,CAAC,QAAQ,GAAW,CAC9C,IAAK,IAAMO,KAAa,MAAM,KAAKC,EAAQ,UAAU,EAC7C,OAAO,KAAKD,EAAU,IAAI,GAC1BC,EAAQ,gBAAgBD,EAAU,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AK,MAAO,CAAE,MAAO,OAAQ,OAAQ,OAAQ,SAAU,EAAG,UAAW,EAAG,GAAGiB,CAAM,EACvF,2BAACs5B,EAAD,CAAkB,OAAe,UAAS,MAAO,CAAE,MAAO,OAAQ,OAAQ,MAAO,CAAG,EACjF,EACT,C,4EAvEM,GAAsB,CACxB,GAAI,MAAM,QAAQC,EAA6B,EACzCA,GACA,CAACA,EAA6B,EACpCC,EACJ,C","names":["scheme","value","fallback","fragment","documentRef","html","windowRef","purifier","createDOMPurify","options","attribute","element","href","anchor","safeUrl","sanitizeFileViewerSvgResources","fileViewerCoreRendererRegistry","_a","controllerRef","container","forwardRef","containerProps","props","containerRef","useRef","appliedViewerOptionsRef","viewerOptions","useMemo","url","file","buffer","name","filename","type","size","onEvent","onStateChange","useEffect","mountViewer","viewerCoreOptions","destroyController","useImperativeHandle","forwardedRef","createViewerControllerHandle","_jsx","defaultStyle","style","DEFAULT_RENDERER_DEFINITIONS","definition","archiveDefinition","__vitePreload","renderArchive","target","context","archiveRendererDefinition","renderFileViewerArchive","import.meta.ROLLDOWN_FILE_URL_VRAku6fjghkApIISiBWPzg","import.meta.ROLLDOWN_FILE_URL_WPGYjwIlzWVNM1bYhOc83w","match","format","decimal","axis","formatPptxChartNumber","labels","axesFor","model","group","primary","secondary","rows","groupIndex","index","coordinates","position","point","series","coordinate","indices","a","b","categories","valueFor","points","resolvePptxChartAxes","factory","library","row","originalValues","columns","id","types","dataAxes","groups","normalizeAll","totals","total","rowIndex","i","colors","color","gap","hasLabels","byId","labelFormat","properties","defined","originalIndex","result","axisOptions","category","fonts","font","families","_b","view","surface","scope","selector","sheet","rule","suffix","applyPptxChartFont","mergePptxChartFonts","legendFont","column","escape","chart","texts","document","original","wrapped","stopped","plugin","internal","svg","source","className","base","rectangles","text","node","box","metrics","width","height","refresh","_c","legend","left","layout","list","xs","entries","button","swatch","observer","instance","api","visible","entry","nextWidth","nextHeight","charts","rootElement","root","chartID","digits","units","label","place","unit","digit","omitLeadingOne","remainder","formatEastAsianNumber","remaining","symbol","scopes","bullets","counters","bullet","key","startAt","nextIndex","getNumericBulletText","property","getFitDataKey","existing","computed","readOriginalPx","scale","elements","block","paragraph","child","fontSize","collectTextFitElements","setScaledPx","TEXT_FIT_TOLERANCE","fitWidth","mode","hasTextOverflow","pass","TEXT_FIT_MAX_PASSES","heightRatio","widthRatio","nextScale","TEXT_FIT_MIN_SCALE","applyTextFitScale","fitOverflowingTextBlock","payload","message","chartTarget","findPptxChartTarget","chartRenderer","chartLibraryLoader","bb","billboard","chartData","cartesian","createPptxCartesianChart","names","fill","hole","holeRatio","angle","adjustingWidth","donut","radius","arc","item","y","line","bar","pie","area","scatter","d3Format","used","reserved","createPptxChartLegend","fontStyle","stylePptxChartText","textPlugin","createPptxChartTextPlugin","logicalSize","plotSize","error","restoreNumericBullets","fitOverflowingTextBlocks","queue","asChartQueue","chartInstances","results","renderChart","destroyed","defaults","createDefaultPptxOptions","clamp","min","max","viewer","fullscreen","overlay","stage","counter","hint","exit","event","slideNumber","shouldExitFullscreen","containers","byNumber","isActive","slide","slideWidth","slideHeight","viewWidth","viewHeight","offsetX","offsetY","content","scaleBox","slots","listener","bounds","otherOverlay","_OverloadYield","d","_arrayLikeToArray","r","e","n","_arrayWithHoles","_iterableToArrayLimit","t","u","f","o","l","_nonIterableRest","_slicedToArray","_unsupportedIterableToArray","AsyncGenerator","resume","settle","unapply","thisArg","args","apply","func","unconstruct","construct","Func","addToSet","transformCaseFunc","stringToLowerCase","setPrototypeOf","set","arrayIsArray","array","lcElement","isFrozen","cleanArray","objectHasOwnProperty","clone","newObject","create","_ref2","object","_ref3","stringifyValue","numberToString","booleanToString","bigintToString","symbolToString","objectToString","valueAsRecord","valueToString","lookupGetter","stringified","desc","getOwnPropertyDescriptor","prop","getPrototypeOf","fallbackValue","lookupAccessor","isRegex","regExpTest","window","getGlobal","DOMPurify","NODE_TYPE","originalDocument","currentScript","HTMLTemplateElement","Node","Element","NodeFilter","DOMParser","trustedTypes","ElementPrototype","cloneNode","remove","removeAttributeNode","getNextSibling","getChildNodes","getParentNode","getShadowRoot","getAttributes","getNodeType","getNodeName","getOwnerDocument","_readNodeType","_readNodeName","getNamespaceURI","_readNamespaceURI","template","trustedTypesPolicy","emptyHTML","defaultTrustedTypesPolicy","defaultTrustedTypesPolicyResolved","IN_TRUSTED_TYPES_POLICY","_assertNotInTrustedTypesPolicy","typeErrorCreate","_createTrustedHTML","_createTrustedScriptURL","scriptUrl","_getDefaultTrustedTypesPolicy","_createTrustedTypesPolicy","_document","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","_createHooksMap","MUSTACHE_EXPR$1","MUSTACHE_EXPR","ERB_EXPR$1","ERB_EXPR","TMPLIT_EXPR$1","TMPLIT_EXPR","DATA_ATTR$1","DATA_ATTR","ARIA_ATTR$1","ARIA_ATTR","IS_SCRIPT_OR_DATA$1","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE$1","ATTR_WHITESPACE","CUSTOM_ELEMENT$1","CUSTOM_ELEMENT","IS_ALLOWED_URI$1","IS_ALLOWED_URI","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","html$1","svg$1","svgFilters","mathMl$1","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","mathMl","xml","CUSTOM_ELEMENT_HANDLING","FORBID_TAGS","FORBID_ATTR","EXTRA_ELEMENT_HANDLING","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","SET_CONFIG_ALLOWED_TAGS","SET_CONFIG_ALLOWED_ATTR","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","IN_PLACE_VISITED","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","stringToString","DEFAULT_MATHML_TEXT_INTEGRATION_POINTS","freeze","MATHML_TEXT_INTEGRATION_POINTS","DEFAULT_HTML_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","CONFIG","formElement","isRegexOrFunction","testValue","_parseConfig","cfg","_resolveSetOption","_resolveObjectOption","customElementHandling","seal","previousTrustedTypesPolicy","ALL_SVG_TAGS","svgDisallowed","ALL_MATHML_TAGS","mathMlDisallowed","_checkSvgNamespace","parent","tagName","parentTagName","_checkMathMlNamespace","_checkHtmlNamespace","_checkValidNamespace","elementNamespace","parentNode","_forceRemove","arrayPush","_stripAttributeNode","_neutralizeRoot","_neutralizeSubtree","childNodes","arrayForEach","arraySlice","attributes","_removeAttribute","attr","_stripDisallowedAttributes","_walkTree","intoShadow","stack","visit","shadowRoot","_isDocumentFragment","_collectLiveNodes","nodes","_neutralizeEscapedElements","reachable","setCreate","setAdd","before","setHas","_neutralizeDiscarded","rootRemoved","_sanitizeUnvisitedNodes","visited","getOriginal","beforeNode","round","live","pending","_sanitizeUnvisitedIn","iterator","_createNodeIterator","inShadow","_executeHooks","_sanitizeElements","_sanitizeAttributes","_sanitizeShadowDOM2","_markVisited","_isPatchLinkageAttribute","lcName","lcTag","_neutralizePatchLinkage","nodeType","COMMENT_MARKUP_PROBE","_initDocument","doc","leadingWhitespace","dirty","matches","stringMatch","dirtyPayload","body","_stripTemplateExpressions","stringReplace","_scrubTemplateExpressions2","_scrubOwnCharacterData","templates","tmpl","walker","currentNode","_isClobbered","realTagName","_isNode","hook","data","_isUnsafeNode","ELEMENT_MARKUP_PROBE","LITERAL_TEXT_ELEMENTS","_matchesNameCheck","check","_sanitizeDisallowedNode","_isBasicCustomElement","childCount","hoisted","_forkSharedAllowlist","hookList","defaultSet","setConfigSet","_handleHookDetachedNode","removed","FALLBACK_TAG_CLOSE","_isValidAttribute","nameIsPermitted","stringIndexOf","RESERVED_CUSTOM_ELEMENT_NAMES","_applyTrustedTypesToAttribute","namespaceURI","_setAttributeValue","_isUnsafeAttributeValue","hookEvent","attrValue","initValue","stringTrim","recreatedNamedProp","SELF_CLOSING_TAG","arrayPop","shadowNode","shadowIterator","innerSr","_sanitizeAttachedShadowRoots","isElement","rootName","sr","importedNode","returnNode","inPlace","inPlaceNodes","outerVisited","nn","walkRoot","nodeIterator","serializedHTML","DOCTYPE_NAME","tag","hookFunction","entryPoint","arrayLastIndexOf","arraySplice","_ref","x","ATTR_NAME","purifyHostElement","policyName","makeFallback","PPTX_CONTENT_STYLE_SCOPE","cached","purifierByDocument","normalized","allowFragment","unsafeUrl","withoutUrls","isAllowedCssUrl","probe","cssText","propertyNames","propertyName","isSafeCssValue","sanitized","sanitizeStyleDeclaration","attributeName","isSafeEmbeddedResourceUrl","rules","offset","GENERATED_STYLE_RULE","declarations","getPurifier","createSafeFallbackFragment","sanitizeStyleAttributes","sanitizeEmbeddedResourceUrls","sanitizeSvgUrlAttributes","boundary","selectorList","scopePptxContentStyleText","legacyPptxCss","PPTX_STYLE_ID","pptxViewerCss","dependencyRelativeUrl","moduleUrl","assetUrl","viteSourceWorkerModulePattern","import.meta.ROLLDOWN_FILE_URL_P4DPfwIRieI8P6q8r4JZRw","cacheIndex","baseUrl","angularCachePath","workerUrl","workerPath","request","viteOptimizedPptxSourcePattern","resolveAngularVitePptxWorkerUrl","defaultPptxWorkerUrl","resolveBundledPptxWorkerUrl","isResolvedPptxWorkerLocation","viteOptimizedWorkerPathPattern","optimizedUrl","resolveViteOptimizedPptxWorkerUrl","allowDependencyRelativeUrl","resolvePptxWorkerUrl","serialized","stringifyErrorDetail","detailOrError","limits","RECOMMENDED_ZIP_LIMITS","createPptxDiagnosticError","sanitizePptxMarkup","escapeHtml","PptxViewer","toPercent","ShadowRootCtor","styleRoot","record","HTMLElementCtor","scroller","state","PptxPresentation","ensureZipWithinLimits","ensurePptxViewerStyles","desiredEffectivePercent","percent","_d","_e","createPptxWorker","resolvePptxEngineOptions","_f","_g","_h","_j","_k","_l","_m","_o","_p","_q","_r","appendHtml","buildSlideErrorHtml","sanitizePptxCss","css","base64Jpeg","image","listOptions","toPositiveInteger","DEFAULT_INITIAL_SLIDES","DEFAULT_BATCH_SIZE","toPositiveNumber","DEFAULT_OVERSCAN_VIEWPORTS","sizeHeight","measuredHeight","DEFAULT_SLIDE_GAP","slot","estimatedHeight","designerCanvases","marginTop","marginBottom","windowOptions","indexesToRender","presentation","activeIndex","changed","wasRendered","viewport","maxMountedSlides","selected","candidates","candidate","closestFallback","capped","rect","overscan","overscanViewport","top","bottom","DEFAULT_SLIDE_HEIGHT","handle","renderPptxPostProcessing","version","postProcessPromise","previouslyRendered","media","mediaId","BlobCtor","UrlApi","objectUrl","slides","sizeWidth","fallbackWidth","viewportWidth","effectiveScale","firstChild","renderPptx","createFileViewerTranslator","targetWindow","zoomEmitter","createFileViewerZoomChangeEmitter","errorMessage","zoomPercent","progressiveReady","disposed","createStyle","shell","createElement","loading","errorTitle","errorText","slideshowButton","slideshowGlyph","slideshowText","slideshowKey","SLIDESHOW_HOTKEY_LABEL","activateShell","activePptxShells","deactivateShell","targetElement","isEditableTarget","handleShortcut","targetShell","hasFirstVisual","signal","resolve","response","getCurrentZoomPercent","clampZoomPercent","getZoomState","setZoom","nextPercent","notifyProgressiveReady","syncUi","presenting","registerExportAdapter","buildExportAdapter","reportPptxFailure","formatErrorMessage","failure","attachFileViewerErrorMessage","registerFileViewerZoomProvider","openPresentation","presentationOptions","resolveCompletion","rejectCompletion","completion","reject","abort","reason","getDefaultFileViewerAssetBaseUrl","resolveFileViewerPresentationWorkerUrl","resolveFileViewerRuntimeAssetBaseUrl","resolvePptxPackageWorkerUrl","resolveFileViewerCopiedAssetUrl","nextViewer","resolvePptxStyleRoot","cleanup","unregisterFileViewerZoomProvider","pptxStyle","getFileViewerShadowRootForNode","copy","locale","lower","resolveFileViewerLocale","code","localizedReason","localizePptxDiagnosticCopy","pptxDiagnosticMessages","rawReason","sanitizePptxDiagnosticText","detail","pptxDiagnosticFallbackHints","usesWesternPunctuation","parts","isPptxDiagnosticErrorLike","formatPptxDiagnosticError","normalizeFileViewerErrorMessage","classified","classifyPptxErrorString","waitForFileViewerNextPaint","collectPptxPrintMaskPages","pptxPrintStyle","getViewer","presentationDefinition","presentationRendererDefinition","renderFileViewerPresentation","documentStart","closing","end","decodeNamespace","named","entity","isWordMlRoot","wordMlRoot","start","xmlName","beforeSpace","wordMlNamespace","quote","hasWordMlDocument","bytes","sample","utf16le","utf16be","utf8Bom","detected","prefix","declaration","declared","resolveWordContainer","ole","byte","resolveFileViewerTextEncoding","decodeFileViewerTextBuffer","xmlNameStart","wordRendererIds","wordDefinitions","renderFileViewerWordDoc","_type","renderWordText","renderWordDocx","convertWordMlToDocx","renderWordDoc","renderOpenDocument","wordRendererDefinitions","renderFileViewerWordDocx","renderFileViewerOpenDocument","spreadsheetDefinition","dbfDefinition","renderSpreadsheet","spreadsheetRendererDefinition","dbfRendererDefinition","renderFileViewerSpreadsheet","ofdDefinition","renderOfd","ofdRendererDefinition","renderFileViewerOfd","emailDefinition","renderEmail","emailRendererDefinition","renderFileViewerEmail","mindmapDefinition","renderXMind","mindmapRendererDefinition","renderFileViewerMindMap","drawingDefinition","renderDrawing","drawingRendererDefinition","renderFileViewerDrawing","dataDefinition","renderDataAsset","dataRendererDefinition","renderFileViewerData","geoDefinition","renderGeo","geoRendererDefinition","renderFileViewerGeo","getXmlProfilesLoader","registry","textRendererIds","textDefinitions","renderLrc","renderHtml","loader","renderXml","renderCode","renderLargeText","shouldVirtualizeMarkdownBuffer","renderMarkdown","textRendererDefinitions","renderFileViewerCode","renderFileViewerMarkdown","FileViewerPreviewPanel","useThemeController","legacy","usePreviewOptions","missingLegacy","downloadUrl","setDownloadUrl","useState","isSpreadsheet","isSpreadsheetFile","resolveFileMimeType","useDarkTheme","isDark","fileViewerRenderers","archiveWorkerUrl","archiveWasmUrl","FileViewer","configuredFileViewerRenderers","archiveRenderer"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],"sources":["../../../../node_modules/@file-viewer/renderer-text/dist/sanitizeHtml.js","../../../../node_modules/@file-viewer/react/dist/index.js","../../../../node_modules/@file-viewer/renderer-archive/dist/index.js","../../../../node_modules/libarchive.js/dist/worker-bundle.js?url","../../../../node_modules/libarchive.js/dist/libarchive.wasm?url","../../node_modules/@file-viewer/pptx/dist/chart-config.js","../../node_modules/@file-viewer/pptx/dist/chart-text.js","../../node_modules/@file-viewer/pptx/dist/chart-legend.js","../../node_modules/@file-viewer/pptx/dist/chart.js","../../node_modules/@file-viewer/pptx/dist/options.js","../../node_modules/@file-viewer/pptx/dist/presentation.js","../../node_modules/dompurify/dist/purify.es.mjs","../../node_modules/@file-viewer/pptx/dist/sanitize.js","../../node_modules/@file-viewer/pptx/dist/styles.js","../../node_modules/@file-viewer/pptx/dist/worker-location.js","../../node_modules/@file-viewer/pptx/dist/worker.js","../../node_modules/@file-viewer/pptx/dist/viewer.js","../../node_modules/@file-viewer/renderer-pptx/dist/index.js","../../../../node_modules/@file-viewer/renderer-word/dist/wordContainer.js","../../../../node_modules/@file-viewer/renderer-word/dist/index.js","../../../../node_modules/@file-viewer/renderer-spreadsheet/dist/index.js","../../../../node_modules/@file-viewer/renderer-ofd/dist/index.js","../../../../node_modules/@file-viewer/renderer-email/dist/index.js","../../../../node_modules/@file-viewer/renderer-mindmap/dist/index.js","../../../../node_modules/@file-viewer/renderer-drawing/dist/index.js","../../../../node_modules/@file-viewer/renderer-data/dist/index.js","../../../../node_modules/@file-viewer/renderer-geo/dist/index.js","../../../../node_modules/@file-viewer/renderer-text/dist/xmlRegistration.js","../../../../node_modules/@file-viewer/renderer-text/dist/index.js","../../src/components/FileViewerPreviewPanel.tsx"],"sourcesContent":["import createDOMPurify from 'dompurify';\nimport { sanitizeFileViewerSvgResources } from '@file-viewer/core';\nconst safeUrl = (value) => {\n var _a, _b;\n const compact = value.trim().replace(/[\\u0000-\\u0020\\u007f-\\u009f]/g, '');\n const scheme = (_b = (_a = compact.match(/^([a-z][a-z0-9+.-]*):/i)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.toLowerCase();\n return !scheme || ['http', 'https', 'mailto', 'tel'].includes(scheme);\n};\nexport const sanitizeFileViewerRichHtml = (documentRef, html, options = {}) => {\n const fallback = () => {\n const fragment = documentRef.createDocumentFragment();\n fragment.append(documentRef.createTextNode(html));\n return fragment;\n };\n const windowRef = documentRef.defaultView;\n if (!windowRef)\n return fallback();\n const purifier = createDOMPurify(windowRef);\n if (!purifier.isSupported)\n return fallback();\n const fragment = purifier.sanitize(html, {\n RETURN_DOM_FRAGMENT: true,\n USE_PROFILES: options.allowSvg\n ? { html: true, svg: true, svgFilters: true }\n : { html: true },\n ADD_ATTR: ['target'],\n FORBID_TAGS: ['base', 'embed', 'form', 'iframe', 'object', 'script', 'style', 'template'],\n FORBID_ATTR: ['action', 'formaction', 'srcdoc', 'style'],\n });\n fragment.querySelectorAll('*').forEach(element => {\n for (const attribute of Array.from(element.attributes)) {\n if (/^on/i.test(attribute.name))\n element.removeAttribute(attribute.name);\n }\n });\n fragment.querySelectorAll('a[href]').forEach(anchor => {\n const href = anchor.getAttribute('href') || '';\n if (!safeUrl(href))\n anchor.removeAttribute('href');\n if ((anchor.getAttribute('target') || '').toLowerCase() === '_blank')\n anchor.rel = 'noopener noreferrer';\n });\n if (options.allowSvg)\n sanitizeFileViewerSvgResources(fragment);\n return fragment;\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport { createViewerControllerHandle, mountViewer } from './controller.js';\nimport { fileViewerCoreRendererRegistry } from '@file-viewer/core';\nconst defaultStyle = {\n width: '100%',\n height: '100%',\n minHeight: 0\n};\nconst viewerCoreOptions = {\n registry: fileViewerCoreRendererRegistry\n};\nconst createInitialViewerState = () => ({\n loading: false,\n ready: false,\n error: null,\n lastEvent: null,\n lifecycle: null,\n availability: null,\n search: null,\n zoom: null,\n location: null,\n viewState: null\n});\nconst destroyController = (controllerRef, container) => {\n var _a;\n (_a = controllerRef.current) === null || _a === void 0 ? void 0 : _a.destroy();\n controllerRef.current = null;\n if (container) {\n container.innerHTML = '';\n }\n};\nexport const FileViewer = forwardRef((props, forwardedRef) => {\n const { url, file, buffer, name, filename, type, size, options, onEvent, onStateChange, style, ...containerProps } = props;\n const containerRef = useRef(null);\n const controllerRef = useRef(null);\n const appliedViewerOptionsRef = useRef(null);\n const viewerOptions = useMemo(() => ({\n url,\n file,\n buffer,\n name,\n filename,\n type,\n size,\n options,\n onEvent,\n onStateChange\n }), [url, file, buffer, name, filename, type, size, options, onEvent, onStateChange]);\n useEffect(() => {\n const container = containerRef.current;\n if (!container || controllerRef.current) {\n return undefined;\n }\n appliedViewerOptionsRef.current = viewerOptions;\n controllerRef.current = mountViewer(container, viewerOptions, viewerCoreOptions);\n return () => {\n appliedViewerOptionsRef.current = null;\n destroyController(controllerRef, container);\n };\n }, []);\n useEffect(() => {\n var _a;\n if (appliedViewerOptionsRef.current === viewerOptions) {\n return;\n }\n appliedViewerOptionsRef.current = viewerOptions;\n void ((_a = controllerRef.current) === null || _a === void 0 ? void 0 : _a.update(viewerOptions));\n }, [viewerOptions]);\n useImperativeHandle(forwardedRef, () => createViewerControllerHandle(() => controllerRef.current, () => destroyController(controllerRef, containerRef.current)), []);\n return (_jsx(\"div\", { ...containerProps, ref: containerRef, style: { ...defaultStyle, ...style } }));\n});\nFileViewer.displayName = 'FileViewer';\nexport const useFileViewerState = (onEvent) => {\n const [state, setState] = useState(() => createInitialViewerState());\n const onStateChange = useCallback((nextState, event) => {\n setState(nextState);\n if (event) {\n onEvent === null || onEvent === void 0 ? void 0 : onEvent(event);\n }\n }, [onEvent]);\n const resetState = useCallback(() => {\n setState(createInitialViewerState());\n }, []);\n return {\n state,\n onStateChange,\n resetState\n };\n};\nexport const useFileViewer = (options = {}) => {\n const ref = useRef(null);\n const { onEvent, ...viewerOptions } = options;\n const { state, onStateChange, resetState } = useFileViewerState(onEvent);\n const props = useMemo(() => ({\n ...viewerOptions,\n onStateChange\n }), [viewerOptions, onStateChange]);\n const handle = useMemo(() => createViewerControllerHandle(() => { var _a, _b; return (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getController()) !== null && _b !== void 0 ? _b : null; }, () => { var _a; return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.destroy(); }), []);\n return {\n ref,\n props,\n state,\n handle,\n resetState\n };\n};\nexport default FileViewer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst archiveDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'archive');\nif (!archiveDefinition) {\n throw new Error('@file-viewer/renderer-archive could not locate the shared archive format definition.');\n}\nexport const archiveRendererDefinition = archiveDefinition;\nexport const renderFileViewerArchive = (buffer, target, type, context) => import('./archive.js').then(({ default: renderArchive }) => renderArchive(buffer, target, type, context));\nexport const archiveRenderer = {\n id: 'file-viewer-renderer-archive',\n label: 'Flyfish File Viewer archive renderer',\n definitions: [archiveRendererDefinition],\n handlers: [{\n rendererId: archiveRendererDefinition.id,\n handler: renderFileViewerArchive,\n }],\n};\nexport default archiveRenderer;\n","export default import.meta.ROLLDOWN_FILE_URL_VRAku6fjghkApIISiBWPzg","export default import.meta.ROLLDOWN_FILE_URL_WPGYjwIlzWVNM1bYhOc83w","export const formatPptxChartNumber = (value, format = 'General') => {\n if (!Number.isFinite(value))\n return '';\n const match = /^([$€£]?)[#0,]+(?:\\.([0#]+))?(%)?$/.exec(format);\n if (!match)\n return String(value);\n const decimal = (match[2] || '').slice(0, 20);\n return match[1] + new Intl.NumberFormat('en-US', {\n minimumFractionDigits: (decimal.match(/0/g) || []).length,\n maximumFractionDigits: decimal.length,\n useGrouping: format.includes(','),\n style: match[3] ? 'percent' : 'decimal',\n }).format(value);\n};\nconst axisOptions = (axis) => {\n if (!axis)\n return {};\n const bounds = axis.min === undefined || axis.max === undefined || axis.min < axis.max\n ? { min: axis.min, max: axis.max } : {};\n return {\n ...bounds,\n ...(axis.min !== undefined || axis.max !== undefined ? { padding: { top: 0, bottom: 0 } } : {}),\n show: !axis.deleted,\n inverted: axis.reversed,\n ...(axis.logBase ? { type: 'log' } : {}),\n ...(axis.title ? { label: { text: axis.title, position: 'outer-middle' } } : {}),\n ...(axis.numberFormat ? { tick: { format: (value) => formatPptxChartNumber(value, axis.numberFormat.code) } } : {}),\n };\n};\nconst defined = (labels) => Object.fromEntries(Object.entries(labels || {}).filter(([, value]) => value !== undefined));\nexport const resolvePptxChartAxes = (model) => {\n var _a, _b;\n const axesFor = (group) => model.axes.filter(axis => group === null || group === void 0 ? void 0 : group.axisIds.includes(axis.id));\n const primary = (_a = axesFor(model.groups[0]).find(axis => axis.kind === 'value')) !== null && _a !== void 0 ? _a : model.axes.find(axis => axis.kind === 'value');\n const secondary = model.groups.filter(group => group.series.length > 0).flatMap(axesFor).find(axis => axis.kind === 'value' && axis.id !== (primary === null || primary === void 0 ? void 0 : primary.id));\n const category = (_b = axesFor(model.groups[0]).find(axis => axis.kind === 'category' || axis.kind === 'date')) !== null && _b !== void 0 ? _b : model.axes.find(axis => axis.kind === 'category' || axis.kind === 'date');\n return { category, primary, secondary };\n};\nexport const createPptxCartesianChart = (model, library) => {\n var _a, _b, _c, _d;\n if (!model.groups.length || model.groups.some(group => !['lineChart', 'barChart', 'areaChart'].includes(group.chartType)))\n return null;\n const rows = model.groups.flatMap((group, groupIndex) => group.series.map((series, index) => ({\n group, groupIndex, series, index, id: `pptx-series-${groupIndex}-${index}`,\n })));\n const coordinates = new Set();\n const labels = new Map();\n for (const { series } of rows)\n for (const [position, point] of series.values.entries()) {\n const coordinate = String(point.x);\n coordinates.add(coordinate);\n if (!labels.has(coordinate))\n labels.set(coordinate, String((_a = series.xlabels[position]) !== null && _a !== void 0 ? _a : coordinate));\n }\n const indices = [...coordinates].sort((a, b) => Number(a) - Number(b));\n const categories = indices.map(index => labels.get(index));\n const valueFor = (series) => {\n const points = new Map(series.values.map(point => [String(point.x), point.y]));\n return indices.map(index => { var _a; return (_a = points.get(index)) !== null && _a !== void 0 ? _a : null; });\n };\n const { primary, secondary, category } = resolvePptxChartAxes(model);\n const factory = { barChart: library.bar, lineChart: library.line, areaChart: library.area };\n if (rows.some(row => typeof factory[row.group.chartType] !== 'function'))\n return null;\n const originalValues = rows.map(row => valueFor(row.series));\n const columns = rows.map(({ id }, index) => [id, ...originalValues[index]]);\n const types = Object.fromEntries(rows.map(row => [row.id, factory[row.group.chartType]()]));\n const dataAxes = Object.fromEntries(rows.map(row => [row.id,\n secondary && row.group.axisIds.includes(secondary.id) ? 'y2' : 'y',\n ]));\n const groups = model.groups.flatMap((group, groupIndex) => group.options.grouping === 'stacked' || group.options.grouping === 'percentStacked'\n ? [rows.filter(row => row.groupIndex === groupIndex).map(row => row.id)] : []);\n const normalizeAll = model.groups.length === 1 && model.groups[0].options.grouping === 'percentStacked';\n const totals = new Map();\n rows.forEach((row, rowIndex) => {\n if (normalizeAll || row.group.options.grouping !== 'percentStacked')\n return;\n let total = totals.get(row.groupIndex);\n if (!total) {\n total = indices.map(() => 0);\n totals.set(row.groupIndex, total);\n }\n originalValues[rowIndex].forEach((value, index) => { total[index] += Math.abs(value || 0); });\n });\n rows.forEach((row, rowIndex) => {\n if (normalizeAll || row.group.options.grouping !== 'percentStacked')\n return;\n for (let i = 1; i < columns[rowIndex].length; i++) {\n const total = totals.get(row.groupIndex)[i - 1];\n if (typeof columns[rowIndex][i] === 'number' && total)\n columns[rowIndex][i] = Number(columns[rowIndex][i]) / total * 100;\n }\n });\n const colors = Object.fromEntries(rows.flatMap(row => {\n var _a, _b;\n const color = (_b = (_a = row.group.options.series) === null || _a === void 0 ? void 0 : _a[row.index]) === null || _b === void 0 ? void 0 : _b.color;\n return color && /^(?:#[\\da-f]{6}(?:[\\da-f]{2})?|transparent)$/i.test(color) ? [[row.id, color]] : [];\n }));\n const gap = (_b = model.groups.find(group => group.chartType === 'barChart')) === null || _b === void 0 ? void 0 : _b.options.gapWidth;\n const hasLabels = rows.some(row => { var _a, _b; return row.group.options.labels || ((_b = (_a = row.group.options.series) === null || _a === void 0 ? void 0 : _a[row.index]) === null || _b === void 0 ? void 0 : _b.labels); });\n const byId = new Map(rows.map(row => [row.id, row]));\n const labelFormat = (value, id, position) => {\n var _a, _b, _c;\n const row = byId.get(id);\n if (!row)\n return '';\n const properties = { ...defined(row.group.options.labels), ...defined((_b = (_a = row.group.options.series) === null || _a === void 0 ? void 0 : _a[row.index]) === null || _b === void 0 ? void 0 : _b.labels) };\n const originalIndex = indices[position];\n const point = (_c = properties.points) === null || _c === void 0 ? void 0 : _c[originalIndex];\n Object.assign(properties, defined(point));\n if (properties.deleted)\n return '';\n const result = [];\n if (properties.showSeries)\n result.push(String(row.series.key));\n if (properties.showCategory)\n result.push(categories[position] || '');\n if (properties.showValue)\n result.push(formatPptxChartNumber(value, properties.formatCode));\n return result.join(' ');\n };\n return {\n data: {\n columns, types, type: types[(_c = rows[0]) === null || _c === void 0 ? void 0 : _c.id], axes: dataAxes,\n names: Object.fromEntries(rows.map(row => [row.id, String(row.series.key)])),\n ...(Object.keys(colors).length ? { colors } : {}),\n ...(groups.length ? { groups, order: null } : {}),\n ...(normalizeAll ? { stack: { normalize: true } } : {}),\n ...(hasLabels ? { labels: { format: labelFormat } } : {}),\n },\n axis: {\n rotated: model.groups.some(group => group.barDirection === 'bar'),\n x: { ...axisOptions(category), type: 'category', categories, tick: model.groups.some(group => group.barDirection === 'bar')\n ? { multiline: true }\n : { multiline: false, culling: false, rotate: (_d = category === null || category === void 0 ? void 0 : category.labelRotation) !== null && _d !== void 0 ? _d : 60, autorotate: (category === null || category === void 0 ? void 0 : category.labelRotation) === undefined } },\n y: axisOptions(primary),\n ...(secondary ? { y2: axisOptions(secondary) } : {}),\n },\n grid: { x: { show: (category === null || category === void 0 ? void 0 : category.majorGridlines) === true }, y: { show: (primary === null || primary === void 0 ? void 0 : primary.majorGridlines) === true } },\n ...(gap !== undefined ? { bar: { width: { ratio: 100 / (100 + gap) } } } : {}),\n ...(model.title ? { title: { text: model.title } } : {}),\n interaction: { enabled: true },\n };\n};\n","import { resolvePptxChartAxes } from \"./chart-config.js\";\nexport const mergePptxChartFonts = (...fonts) => Object.assign({}, ...fonts.map(font => Object.fromEntries(Object.entries(font || {}).filter(([, value]) => value !== undefined))));\nexport const applyPptxChartFont = (style, font) => {\n if (!font)\n return;\n const families = [...new Set([font.family, font.eastAsianFamily, font.complexScriptFamily]\n .filter((value) => typeof value === 'string' && !!value.trim())\n .filter(value => !/^\\+(?:mj|mn)-(?:lt|ea|cs)$/.test(value))\n .map(value => /^(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded|emoji|math|fangsong)$/i.test(value.trim())\n ? value.trim().toLowerCase() : JSON.stringify(value.slice(0, 512))))];\n if (families.length)\n style.fontFamily = [...families, 'sans-serif'].join(',');\n if (typeof font.sizePt === 'number' && Number.isFinite(font.sizePt) && font.sizePt > 0 && font.sizePt <= 4000) {\n style.fontSize = `${font.sizePt * 96 / 72}px`;\n }\n if (font.bold !== undefined)\n style.fontWeight = font.bold ? 'bold' : 'normal';\n if (font.italic !== undefined)\n style.fontStyle = font.italic ? 'italic' : 'normal';\n if (typeof font.color === 'string' && /^(?:#[\\da-f]{6}(?:[\\da-f]{2})?|transparent)$/i.test(font.color)) {\n style.color = font.color;\n style.fill = font.color;\n }\n};\nexport const stylePptxChartText = (surface, model, chart, legendFont) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n const view = (_a = surface.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;\n if (!view || typeof surface.appendChild !== 'function')\n return;\n const scope = `chart-${Math.random().toString(36).slice(2)}`;\n surface.dataset.pptxChartText = scope;\n surface.classList.add('pptx-chart-typed');\n const selector = `.pptx-chart-surface.pptx-chart-typed[data-pptx-chart-text=\"${scope}\"]`;\n const element = surface.ownerDocument.createElement('style');\n element.dataset.pptxChartFonts = '';\n (_b = surface.parentNode) === null || _b === void 0 ? void 0 : _b.appendChild(element);\n const sheet = element.sheet;\n if (!sheet)\n return element;\n const rule = (suffix, font) => {\n if (!font || !Object.values(font).some(value => value !== undefined))\n return;\n const index = sheet.insertRule(suffix.split(',').map(value => `${selector} ${value.trim()}`).join(',') + '{}', sheet.cssRules.length);\n applyPptxChartFont(sheet.cssRules[index].style, font);\n };\n rule('svg', model === null || model === void 0 ? void 0 : model.font);\n rule('.bb-legend-item,.bb-legend-item text', mergePptxChartFonts(model === null || model === void 0 ? void 0 : model.font, legendFont));\n if (!model)\n return element;\n const { category, primary, secondary } = resolvePptxChartAxes(model);\n for (const [axis, font] of [['x', category === null || category === void 0 ? void 0 : category.font], ['y', primary === null || primary === void 0 ? void 0 : primary.font], ['y2', secondary === null || secondary === void 0 ? void 0 : secondary.font]]) {\n rule(`.bb-axis-${axis},.bb-axis-${axis} text`, mergePptxChartFonts(model.font, font));\n }\n let column = 0;\n const escape = (_c = view.CSS) === null || _c === void 0 ? void 0 : _c.escape;\n if (!escape)\n return element;\n for (const group of model.groups)\n for (let index = 0; index < group.series.length; index++, column++) {\n const id = String((_g = (_f = (_e = (_d = chart === null || chart === void 0 ? void 0 : chart.data) === null || _d === void 0 ? void 0 : _d.columns) === null || _e === void 0 ? void 0 : _e[column]) === null || _f === void 0 ? void 0 : _f[0]) !== null && _g !== void 0 ? _g : '');\n if (!id)\n continue;\n const labels = (_j = (_h = group.options.series) === null || _h === void 0 ? void 0 : _h[index]) === null || _j === void 0 ? void 0 : _j.labels;\n const font = mergePptxChartFonts(model.font, (_k = group.options.labels) === null || _k === void 0 ? void 0 : _k.font, labels === null || labels === void 0 ? void 0 : labels.font);\n const texts = `.bb-texts-${escape(id)}`;\n rule(`${texts},${texts} text`, font);\n const points = { ...(_l = group.options.labels) === null || _l === void 0 ? void 0 : _l.points, ...labels === null || labels === void 0 ? void 0 : labels.points };\n for (const [position, point] of Object.entries(points)) {\n if (!/^\\d+$/.test(position) || !point.font)\n continue;\n rule(`${texts} .bb-text-${escape(position)}`, mergePptxChartFonts(font, point.font));\n }\n }\n return element;\n};\nexport const createPptxChartTextPlugin = (surface) => {\n const document = surface.ownerDocument;\n const view = document === null || document === void 0 ? void 0 : document.defaultView;\n if (!view || typeof surface.appendChild !== 'function')\n return undefined;\n let original;\n let wrapped;\n let stopped = false;\n let context;\n const plugin = {\n $$: undefined,\n $beforeInit() {\n const internal = this.$$;\n if (typeof (internal === null || internal === void 0 ? void 0 : internal.getTextRect) !== 'function')\n return;\n original = internal.getTextRect;\n wrapped = (source, className) => {\n var _a, _b, _c, _d, _e;\n const svg = ((_c = (_b = (_a = internal.$el) === null || _a === void 0 ? void 0 : _a.svg) === null || _b === void 0 ? void 0 : _b.node) === null || _c === void 0 ? void 0 : _c.call(_b)) || surface.querySelector('svg');\n if (!svg)\n return original.call(internal, source, className);\n let base = ((_d = source === null || source === void 0 ? void 0 : source.node) === null || _d === void 0 ? void 0 : _d.call(source)) || source;\n if (!Array.isArray(source) && !/text/i.test((base === null || base === void 0 ? void 0 : base.tagName) || ''))\n base = (_e = base === null || base === void 0 ? void 0 : base.querySelector) === null || _e === void 0 ? void 0 : _e.call(base, 'text');\n if (!Array.isArray(source) && !base)\n return original.call(internal, source, className);\n const values = Array.isArray(source) ? source : [base.textContent || ''];\n const rectangles = values.map((value) => {\n var _a;\n const text = String(value !== null && value !== void 0 ? value : '');\n const node = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n if (className)\n node.setAttribute('class', className);\n node.style.visibility = 'hidden';\n if (base && !Array.isArray(source))\n node.style.font = view.getComputedStyle(base).font;\n node.textContent = text;\n svg.appendChild(node);\n try {\n const box = node.getBBox();\n if (box.height > 0 && (box.width > 0 || !text)) {\n return { x: box.x, y: box.y, left: box.x, top: box.y, right: box.x + box.width,\n bottom: box.y + box.height, width: box.width, height: box.height };\n }\n const style = view.getComputedStyle(node);\n context !== null && context !== void 0 ? context : (context = document.createElement('canvas').getContext('2d'));\n const size = Number.parseFloat(style.fontSize) || 10;\n if (context)\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize} ${style.fontFamily}`;\n const metrics = context === null || context === void 0 ? void 0 : context.measureText(text);\n const width = (_a = metrics === null || metrics === void 0 ? void 0 : metrics.width) !== null && _a !== void 0 ? _a : 0;\n const height = ((metrics === null || metrics === void 0 ? void 0 : metrics.fontBoundingBoxAscent) || 0) + ((metrics === null || metrics === void 0 ? void 0 : metrics.fontBoundingBoxDescent) || 0) || size * 1.2;\n return { x: 0, y: 0, left: 0, top: 0, right: width, bottom: height, width, height };\n }\n finally {\n node.remove();\n }\n });\n return rectangles.length > 1 ? rectangles : rectangles[0];\n };\n internal.getTextRect = wrapped;\n },\n $init() { },\n $afterInit() { var _a; (_a = document.fonts) === null || _a === void 0 ? void 0 : _a.addEventListener('loadingdone', refresh); },\n $redraw() { },\n $willDestroy() {\n var _a, _b;\n stopped = true;\n (_a = document.fonts) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadingdone', refresh);\n if (((_b = this.$$) === null || _b === void 0 ? void 0 : _b.getTextRect) === wrapped)\n this.$$.getTextRect = original;\n original = wrapped = context = undefined;\n this.$$ = undefined;\n },\n };\n const refresh = () => { var _a, _b, _c; if (!stopped)\n (_c = (_b = (_a = plugin.$$) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.flush) === null || _c === void 0 ? void 0 : _c.call(_b); };\n return plugin;\n};\n","import { applyPptxChartFont } from \"./chart-text.js\";\nexport const createPptxChartLegend = (surface, chart, legend, font) => {\n var _a, _b;\n const document = surface.ownerDocument;\n const view = document === null || document === void 0 ? void 0 : document.defaultView;\n if (!view || (legend === null || legend === void 0 ? void 0 : legend.show) === false || !((legend === null || legend === void 0 ? void 0 : legend.overlay) || ['t', 'tr', 'l'].includes((legend === null || legend === void 0 ? void 0 : legend.position) || '')))\n return;\n const left = (legend === null || legend === void 0 ? void 0 : legend.position) === 'l' || (legend === null || legend === void 0 ? void 0 : legend.position) === 'r';\n const layout = document.createElement('div');\n layout.className = 'pptx-chart-layout';\n layout.style.cssText = `display:flex;flex-direction:${left ? 'row' : 'column'};width:100%;height:100%;min-width:0;min-height:0;position:relative`;\n surface.replaceWith(layout);\n const list = document.createElement('div');\n list.className = 'pptx-chart-legend';\n list.setAttribute('role', 'group');\n list.setAttribute('aria-label', 'Chart legend');\n list.style.cssText = `display:flex;flex:${left ? '0 1 auto' : '0 0 auto'};flex-direction:${left ? 'column' : 'row'};flex-wrap:${left ? 'nowrap' : 'wrap'};gap:4px 12px;align-items:${left ? 'stretch' : 'center'};justify-content:${(legend === null || legend === void 0 ? void 0 : legend.position) === 'tr' ? 'flex-end' : 'center'};box-sizing:border-box;padding:4px;overflow:auto;${left ? 'max-width:50%' : 'max-height:50%'};font:12px sans-serif`;\n applyPptxChartFont(list.style, font);\n if (legend === null || legend === void 0 ? void 0 : legend.overlay) {\n list.style.position = 'absolute';\n list.style.zIndex = '1';\n list.style[legend.position === 'b' ? 'bottom' : 'top'] = '0';\n list.style[legend.position === 'tr' || legend.position === 'r' ? 'right' : 'left'] = '0';\n if (left)\n list.style.height = '100%';\n else\n list.style.width = '100%';\n }\n surface.style.width = left ? '0' : '100%';\n surface.style.height = left ? '100%' : '0';\n surface.style.alignSelf = 'stretch';\n if (legend === null || legend === void 0 ? void 0 : legend.overlay)\n surface.style.width = surface.style.height = '100%';\n layout.append(list, surface);\n const xs = new Set(Object.values(((_a = chart.data) === null || _a === void 0 ? void 0 : _a.xs) || {}).map(String));\n const entries = (((_b = chart.data) === null || _b === void 0 ? void 0 : _b.columns) || []).filter((column) => !xs.has(String(column[0])))\n .map((column) => {\n var _a, _b, _c;\n const id = String(column[0]);\n const button = document.createElement('button');\n button.type = 'button';\n button.setAttribute('aria-pressed', 'true');\n button.style.cssText = 'display:inline-flex;flex:0 0 auto;align-items:center;gap:4px;min-width:0;max-width:100%;border:0;padding:2px;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer';\n const swatch = document.createElement('span');\n swatch.setAttribute('aria-hidden', 'true');\n swatch.style.cssText = 'display:inline-block;flex:0 0 10px;width:10px;height:10px';\n const text = document.createElement('span');\n text.className = 'pptx-chart-legend-label';\n text.style.cssText = 'min-width:0;overflow-wrap:anywhere';\n text.textContent = String((_c = (_b = (_a = chart.data) === null || _a === void 0 ? void 0 : _a.names) === null || _b === void 0 ? void 0 : _b[id]) !== null && _c !== void 0 ? _c : id) || '\\u200b';\n button.append(swatch, text);\n list.append(button);\n return { id, button, swatch };\n });\n chart.legend = { ...chart.legend, show: false };\n let observer;\n let instance;\n let width = 0, height = 0;\n return {\n size() {\n return { width: surface.clientWidth, height: surface.clientHeight };\n },\n bind(api) {\n var _a;\n instance = api;\n for (const { id, button, swatch } of entries) {\n swatch.style.backgroundColor = ((_a = api.color) === null || _a === void 0 ? void 0 : _a.call(api, id)) || 'currentColor';\n button.onclick = () => {\n var _a;\n (_a = api.toggle) === null || _a === void 0 ? void 0 : _a.call(api, id);\n const visible = button.getAttribute('aria-pressed') !== 'true';\n button.setAttribute('aria-pressed', String(visible));\n button.style.opacity = visible ? '1' : '.45';\n };\n button.onmouseenter = () => { var _a; return (_a = api.focus) === null || _a === void 0 ? void 0 : _a.call(api, id); };\n button.onmouseleave = () => { var _a; return (_a = api.revert) === null || _a === void 0 ? void 0 : _a.call(api); };\n }\n if (view.ResizeObserver) {\n observer = new view.ResizeObserver(([entry]) => {\n var _a;\n const { width: nextWidth, height: nextHeight } = entry.contentRect;\n if (nextWidth > 0 && nextHeight > 0 && (Math.abs(nextWidth - width) > .5 || Math.abs(nextHeight - height) > .5)) {\n width = nextWidth;\n height = nextHeight;\n (_a = instance === null || instance === void 0 ? void 0 : instance.resize) === null || _a === void 0 ? void 0 : _a.call(instance, { width, height });\n }\n });\n observer.observe(surface);\n }\n },\n destroy() {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n instance = undefined;\n for (const { button } of entries)\n button.onclick = button.onmouseenter = button.onmouseleave = null;\n layout.remove();\n },\n };\n};\n","import { createPptxCartesianChart } from \"./chart-config.js\";\nimport { createPptxChartTextPlugin, mergePptxChartFonts, stylePptxChartText } from \"./chart-text.js\";\nimport { createPptxChartLegend } from \"./chart-legend.js\";\nlet chartLibraryLoader = null;\nlet chartRenderer = null;\nexport const registerPptxChartRenderer = (renderer) => {\n chartRenderer = renderer;\n};\nexport const registerPptxChartLibraryLoader = (loader) => {\n chartLibraryLoader = loader;\n};\nconst asChartQueue = (charts) => {\n return Array.isArray(charts === null || charts === void 0 ? void 0 : charts.MsgQueue) ? charts.MsgQueue : [];\n};\nexport const findPptxChartTarget = (root, chartID) => {\n const rootElement = root;\n if (rootElement.id === chartID) {\n return rootElement;\n }\n return Array.from(root.querySelectorAll('[id]'))\n .find(element => element.id === chartID) || null;\n};\nconst formatEastAsianNumber = (index) => {\n const digits = '零一二三四五六七八九';\n const units = [[1000, '千'], [100, '百'], [10, '十'], [1, '']];\n const group = (value, omitLeadingOne = true) => {\n let label = '';\n let gap = false;\n for (const [place, unit] of units) {\n const digit = Math.floor(value / place);\n value %= place;\n if (digit) {\n if (gap)\n label += digits[0];\n label += (place === 10 && digit === 1 && !label && omitLeadingOne ? '' : digits[digit]) + unit;\n gap = false;\n }\n else if (label && value)\n gap = true;\n }\n return label;\n };\n if (index < 10000)\n return group(index);\n const remainder = index % 10000;\n return digits[Math.floor(index / 10000)] + '万' +\n (remainder ? (remainder < 1000 ? digits[0] : '') + group(remainder, false) : '');\n};\nexport const getNumericBulletText = (type, index) => {\n if (!Number.isInteger(index) || index < 1 || index > 32767) {\n return String(index);\n }\n if (type === 'ea1JpnChsDbPeriod') {\n return `${formatEastAsianNumber(index)}. `;\n }\n const match = /^(arabic|alphaLc|alphaUc|romanLc|romanUc)(Period|ParenR|ParenBoth|Plain)$/.exec(type);\n if (!match) {\n return String(index);\n }\n let label = String(index);\n if (match[1].startsWith('alpha')) {\n label = '';\n for (let remaining = index; remaining > 0; remaining = Math.floor((remaining - 1) / 26)) {\n label = String.fromCharCode(65 + (remaining - 1) % 26) + label;\n }\n }\n else if (match[1].startsWith('roman')) {\n label = '';\n let remaining = index;\n const digits = [\n [1000, 'M'], [900, 'CM'], [500, 'D'], [400, 'CD'], [100, 'C'], [90, 'XC'],\n [50, 'L'], [40, 'XL'], [10, 'X'], [9, 'IX'], [5, 'V'], [4, 'IV'], [1, 'I'],\n ];\n for (const [value, symbol] of digits) {\n label += symbol.repeat(Math.floor(remaining / value));\n remaining %= value;\n }\n }\n if (match[1].endsWith('Lc'))\n label = label.toLowerCase();\n switch (match[2]) {\n case 'Period': return `${label}. `;\n case 'ParenR': return `${label}) `;\n case 'ParenBoth': return `(${label}) `;\n default: return label;\n }\n};\nconst restoreNumericBullets = (root) => {\n const scopes = [\n ...Array.from(root.querySelectorAll('.block')),\n ...Array.from(root.querySelectorAll('table td')),\n ];\n for (const scope of scopes) {\n const bullets = Array.from(scope.querySelectorAll('.numeric-bullet-style'));\n const counters = new Map();\n for (const bullet of bullets) {\n const type = String(bullet.dataset.bulltname || 'arabicPeriod');\n const level = String(bullet.dataset.bulltlvl || '0');\n const key = `${level}:${type}`;\n const startAt = Number(bullet.dataset.bulltstartat);\n const nextIndex = Number.isInteger(startAt) && startAt >= 1 && startAt <= 32767\n ? startAt\n : (counters.get(key) || 0) + 1;\n counters.set(key, nextIndex);\n bullet.textContent = getNumericBulletText(type, nextIndex);\n }\n }\n};\nconst TEXT_FIT_MIN_SCALE = 0.7;\nconst TEXT_FIT_MAX_PASSES = 8;\nconst TEXT_FIT_TOLERANCE = 1;\nconst getFitDataKey = (property) => `pptxFit${property.charAt(0).toUpperCase()}${property.slice(1)}`;\nconst readOriginalPx = (element, property, computed = getComputedStyle(element)) => {\n const key = getFitDataKey(property);\n const existing = Number(element.dataset[key]);\n if (Number.isFinite(existing) && existing > 0) {\n return existing;\n }\n const value = parseFloat(computed[property]);\n if (!Number.isFinite(value) || value <= 0) {\n return undefined;\n }\n element.dataset[key] = String(value);\n return value;\n};\nconst setScaledPx = (element, property, scale, computed = getComputedStyle(element)) => {\n const original = readOriginalPx(element, property, computed);\n if (original === undefined) {\n return;\n }\n element.style[property] = `${original * scale}px`;\n};\nconst collectTextFitElements = (block) => {\n const elements = new Set();\n block.querySelectorAll('.text-block, .numeric-bullet-style').forEach(element => {\n elements.add(element);\n });\n block.querySelectorAll('.slide-prgrph').forEach(paragraph => {\n Array.from(paragraph.children).forEach(child => {\n if (!(child instanceof HTMLElement) || child.querySelector('.text-block')) {\n return;\n }\n const computed = getComputedStyle(child);\n const fontSize = parseFloat(computed.fontSize);\n if (Number.isFinite(fontSize) && fontSize > 0) {\n elements.add(child);\n }\n });\n });\n return elements;\n};\nconst applyTextFitScale = (block, scale) => {\n block.dataset.pptxTextFitScale = String(scale);\n for (const element of collectTextFitElements(block)) {\n const computed = getComputedStyle(element);\n setScaledPx(element, 'fontSize', scale, computed);\n setScaledPx(element, 'lineHeight', scale, computed);\n setScaledPx(element, 'paddingLeft', scale, computed);\n setScaledPx(element, 'paddingRight', scale, computed);\n }\n block.querySelectorAll('.slide-prgrph').forEach(paragraph => {\n const computed = getComputedStyle(paragraph);\n setScaledPx(paragraph, 'lineHeight', scale, computed);\n setScaledPx(paragraph, 'marginTop', scale, computed);\n setScaledPx(paragraph, 'marginBottom', scale, computed);\n setScaledPx(paragraph, 'paddingTop', scale, computed);\n setScaledPx(paragraph, 'paddingBottom', scale, computed);\n });\n block.querySelectorAll('.slide-prgrph > *').forEach(child => {\n const computed = getComputedStyle(child);\n setScaledPx(child, 'marginLeft', scale, computed);\n setScaledPx(child, 'marginRight', scale, computed);\n setScaledPx(child, 'paddingLeft', scale, computed);\n setScaledPx(child, 'paddingRight', scale, computed);\n });\n};\nconst hasTextOverflow = (block, fitWidth = true) => block.scrollHeight > block.clientHeight + TEXT_FIT_TOLERANCE ||\n (fitWidth && block.scrollWidth > block.clientWidth + TEXT_FIT_TOLERANCE);\nconst fitOverflowingTextBlock = (block, fitWidth = true) => {\n const mode = block.dataset.pptxAutofit;\n if (mode && mode !== 'normal')\n return;\n if (block.dataset.pptxWrap === 'none')\n fitWidth = false;\n if (!block.querySelector('.text-block') || block.clientWidth <= 0 || block.clientHeight <= 0) {\n return;\n }\n let scale = Number(block.dataset.pptxTextFitScale) || 1;\n if (!hasTextOverflow(block, fitWidth)) {\n return;\n }\n for (let pass = 0; pass < TEXT_FIT_MAX_PASSES && hasTextOverflow(block, fitWidth); pass += 1) {\n const heightRatio = block.scrollHeight > 0\n ? Math.min(1, block.clientHeight / block.scrollHeight)\n : 1;\n const widthRatio = fitWidth && block.scrollWidth > 0\n ? Math.min(1, block.clientWidth / block.scrollWidth)\n : 1;\n const ratio = Math.min(heightRatio, widthRatio, 0.98);\n const nextScale = Math.max(TEXT_FIT_MIN_SCALE, scale * Math.max(ratio, 0.95));\n if (nextScale >= scale - 0.002) {\n scale = Math.max(TEXT_FIT_MIN_SCALE, scale * 0.97);\n }\n else {\n scale = nextScale;\n }\n applyTextFitScale(block, scale);\n if (scale <= TEXT_FIT_MIN_SCALE && hasTextOverflow(block, fitWidth)) {\n break;\n }\n }\n};\nconst fitOverflowingTextBlocks = (root) => {\n root\n .querySelectorAll('.slide div.content, .slide div.content-rtl')\n .forEach(block => fitOverflowingTextBlock(block));\n root\n .querySelectorAll('.slide .pptx-table-cell-content')\n .forEach(block => fitOverflowingTextBlock(block, false));\n};\nconst renderChart = async (message, root) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;\n const payload = message.data;\n if (!(payload === null || payload === void 0 ? void 0 : payload.chartID) || !payload.chartType || !payload.chartData) {\n return;\n }\n const chartTarget = findPptxChartTarget(root, payload.chartID);\n if (!chartTarget) {\n return;\n }\n if (chartRenderer && payload.chartModel) {\n return await chartRenderer(payload.chartModel, chartTarget);\n }\n if (!chartLibraryLoader) {\n chartTarget.dataset.fileViewerMissingCapability = 'pptx-charts';\n chartTarget.setAttribute('title', 'PPTX chart rendering requires @file-viewer/capability-pptx-charts. Run `npx file-viewer-cli add pptx-charts --write`, then `npx file-viewer-cli install --yes`.');\n console.warn('[file-viewer] PPTX chart rendering requires @file-viewer/capability-pptx-charts. Run `npx file-viewer-cli add pptx-charts --write`, then `npx file-viewer-cli install --yes`.');\n return;\n }\n const { billboard, d3Format } = await chartLibraryLoader();\n const bb = billboard.default || billboard;\n const { area, bar, line, pie, donut, scatter } = billboard;\n if (typeof billboard.grid === 'function') {\n billboard.grid();\n }\n const chart = {\n bindto: chartTarget,\n };\n const chartData = payload.chartData;\n const axis = {\n x: {\n tick: {\n format(index) {\n var _a, _b, _c;\n return (_c = (_b = (_a = chartData[0]) === null || _a === void 0 ? void 0 : _a.xlabels) === null || _b === void 0 ? void 0 : _b[index]) !== null && _c !== void 0 ? _c : index;\n },\n },\n },\n };\n const cartesian = payload.chartModel ? createPptxCartesianChart(payload.chartModel, billboard) : null;\n if (cartesian)\n Object.assign(chart, cartesian);\n else\n switch (payload.chartType) {\n case 'doughnutChart': {\n const series = chartData[0];\n const columns = [];\n const names = {};\n const colors = {};\n for (const [index, point] of ((series === null || series === void 0 ? void 0 : series.values) || []).entries()) {\n if (typeof point.y !== 'number' || !Number.isFinite(point.y) || point.y === 0)\n continue;\n const id = `point-${index}`;\n columns.push([id, Math.abs(point.y)]);\n names[id] = String((_c = (_b = (_a = series.xlabels) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : point.x) !== null && _c !== void 0 ? _c : index);\n const fill = (_h = (_g = (_f = (_e = (_d = payload.chartOptions) === null || _d === void 0 ? void 0 : _d.series) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.points) === null || _g === void 0 ? void 0 : _g[point.x]) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = payload.chartOptions) === null || _j === void 0 ? void 0 : _j.series) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.color;\n if (fill && /^(?:#[\\da-f]{6}(?:[\\da-f]{2})?|transparent)$/i.test(fill))\n colors[id] = fill;\n }\n const hole = (_m = payload.chartOptions) === null || _m === void 0 ? void 0 : _m.holeSize;\n const holeRatio = (typeof hole === 'number' && Number.isFinite(hole) && hole >= 10 && hole <= 90 ? hole : 50) / 100;\n const angle = (_o = payload.chartOptions) === null || _o === void 0 ? void 0 : _o.firstSliceAngle;\n let adjustingWidth = false;\n Object.assign(chart, {\n data: { columns, names, colors, type: donut(), order: null },\n donut: {\n startingAngle: typeof angle === 'number' && Number.isFinite(angle) ? angle * Math.PI / 180 : 0,\n expand: false,\n label: { show: false },\n },\n transition: { duration: 0 },\n onrendered() {\n if (adjustingWidth || typeof this.config !== 'function')\n return;\n let radius = 0;\n for (const arc of chartTarget.querySelectorAll('.bb-arc')) {\n const match = /[Aa]([\\d.+eE-]+)[ ,]+([\\d.+eE-]+)/.exec(arc.getAttribute('d') || '');\n if (match)\n radius = Math.max(radius, Number(match[1]));\n }\n if (!(radius > 0) || !Number.isFinite(radius))\n return;\n const width = radius * (1 - holeRatio);\n if (Math.abs(Number(this.config('donut.width')) - width) <= 0.01)\n return;\n adjustingWidth = true;\n try {\n this.config('donut.width', width, true);\n }\n finally {\n adjustingWidth = false;\n }\n },\n });\n break;\n }\n case 'lineChart':\n Object.assign(chart, {\n data: {\n columns: chartData.map((item) => [item.key, ...item.values.map(({ y }) => y)]),\n type: line(),\n },\n axis,\n interaction: { enabled: true },\n });\n break;\n case 'barChart':\n Object.assign(chart, {\n data: {\n columns: chartData.map((item) => [item.key, ...item.values.map(({ y }) => y)]),\n type: bar(),\n },\n axis: {\n rotated: payload.barDirection === 'bar',\n x: {\n tick: {\n multiline: true,\n format(index) {\n var _a, _b, _c;\n return (_c = (_b = (_a = chartData[0]) === null || _a === void 0 ? void 0 : _a.xlabels) === null || _b === void 0 ? void 0 : _b[index]) !== null && _c !== void 0 ? _c : index;\n },\n },\n },\n },\n });\n break;\n case 'pieChart':\n case 'pie3DChart':\n Object.assign(chart, {\n data: {\n columns: Object.values(((_p = chartData[0]) === null || _p === void 0 ? void 0 : _p.xlabels) || {}).map((value, index) => {\n var _a, _b, _c;\n return [\n value,\n (_c = (_b = (_a = chartData[0]) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.y,\n ];\n }),\n type: pie(),\n },\n });\n break;\n case 'areaChart':\n Object.assign(chart, {\n data: {\n columns: chartData.map((item) => [item.key, ...item.values.map(({ y }) => y)]),\n type: area(),\n },\n axis,\n interaction: { enabled: true },\n });\n break;\n case 'scatterChart':\n Object.assign(chart, {\n data: {\n xs: { y: 'x' },\n columns: chartData.map((item, index) => [index ? 'y' : 'x', ...item]),\n type: scatter(),\n },\n axis: {\n x: {\n label: 'X',\n showDist: true,\n tick: {\n format: d3Format.format('.02f'),\n },\n },\n y: {\n label: 'Y',\n showDist: true,\n tick: {\n format: d3Format.format('.02f'),\n },\n },\n },\n });\n break;\n default:\n return;\n }\n if (chart.data) {\n const options = payload.chartOptions;\n if (options === null || options === void 0 ? void 0 : options.legend) {\n chart.legend = {\n show: options.legend.show !== false,\n position: options.legend.position === 'b' ? 'bottom' : 'right',\n format: (label) => label === '' ? '\\u200b' : label,\n };\n }\n if (!cartesian && ['barChart', 'areaChart', 'lineChart'].includes(payload.chartType)) {\n const used = new Set();\n const reserved = new Set(chart.data.columns.map((column) => String(column[0])));\n const names = {};\n chart.data.columns.forEach((column, index) => {\n const label = String(column[0]);\n let id = label;\n if (used.has(id)) {\n id = `pptx-series-${index}`;\n while (reserved.has(id) || used.has(id))\n id += '-';\n column[0] = id;\n }\n used.add(id);\n Object.defineProperty(names, id, { value: label, enumerable: true });\n });\n chart.data.names = names;\n if ((options === null || options === void 0 ? void 0 : options.grouping) === 'stacked' || (options === null || options === void 0 ? void 0 : options.grouping) === 'percentStacked') {\n chart.data.groups = [chart.data.columns.map((column) => column[0])];\n if (options.grouping === 'percentStacked')\n chart.data.stack = { normalize: true };\n chart.data.order = null;\n }\n const colors = {};\n chartData.forEach((item, index) => {\n var _a, _b;\n const fill = (_b = (_a = options === null || options === void 0 ? void 0 : options.series) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.color;\n if (fill && /^(?:#[\\da-f]{6}(?:[\\da-f]{2})?|transparent)$/i.test(fill))\n Object.defineProperty(colors, String(chart.data.columns[index][0]), { value: fill, enumerable: true });\n });\n if (Object.keys(colors).length)\n chart.data.colors = colors;\n }\n const surface = chartTarget.ownerDocument.createElement('div');\n surface.className = 'pptx-chart-surface';\n surface.style.cssText = 'width:100%;height:100%;min-width:0;min-height:0;flex:1 1 auto';\n chartTarget.replaceChildren(surface);\n chart.bindto = surface;\n const legend = createPptxChartLegend(surface, chart, options === null || options === void 0 ? void 0 : options.legend, mergePptxChartFonts((_q = payload.chartModel) === null || _q === void 0 ? void 0 : _q.font, (_r = options === null || options === void 0 ? void 0 : options.legend) === null || _r === void 0 ? void 0 : _r.font));\n const fontStyle = stylePptxChartText(surface, payload.chartModel, chart, (_t = (_s = payload.chartOptions) === null || _s === void 0 ? void 0 : _s.legend) === null || _t === void 0 ? void 0 : _t.font);\n const textPlugin = createPptxChartTextPlugin(surface);\n if (textPlugin)\n chart.plugins = [...(chart.plugins || []), textPlugin];\n const logicalSize = [((_u = chartTarget.style) === null || _u === void 0 ? void 0 : _u.width) || '', ((_v = chartTarget.style) === null || _v === void 0 ? void 0 : _v.height) || '']\n .map(value => /^\\d+(?:\\.\\d+)?px$/.test(value) ? Number.parseFloat(value) : NaN);\n if (logicalSize.every(value => Number.isFinite(value) && value > 0)) {\n const plotSize = legend === null || legend === void 0 ? void 0 : legend.size();\n chart.size = plotSize && plotSize.width > 0 && plotSize.height > 0 ? plotSize : { width: logicalSize[0], height: logicalSize[1] };\n chart.resize = { auto: false };\n }\n try {\n const instance = bb.generate(chart);\n legend === null || legend === void 0 ? void 0 : legend.bind(instance);\n return {\n destroy() {\n var _a;\n try {\n legend === null || legend === void 0 ? void 0 : legend.destroy();\n (_a = instance.destroy) === null || _a === void 0 ? void 0 : _a.call(instance);\n }\n finally {\n surface.remove();\n fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.remove();\n }\n },\n };\n }\n catch (error) {\n surface.remove();\n fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.remove();\n legend === null || legend === void 0 ? void 0 : legend.destroy();\n throw error;\n }\n }\n};\nexport const renderPptxPostProcessing = async (charts, root) => {\n restoreNumericBullets(root);\n fitOverflowingTextBlocks(root);\n const queue = asChartQueue(charts);\n const chartInstances = [];\n if (queue.length) {\n const results = await Promise.allSettled(queue.map(message => renderChart(message, root)));\n for (const result of results) {\n if (result.status === 'fulfilled') {\n if (result.value) {\n chartInstances.push(result.value);\n }\n }\n else {\n console.warn('PPTX chart rendering skipped:', result.reason);\n }\n }\n }\n let destroyed = false;\n return {\n destroy() {\n var _a;\n if (destroyed) {\n return;\n }\n destroyed = true;\n for (const chart of chartInstances) {\n try {\n (_a = chart.destroy) === null || _a === void 0 ? void 0 : _a.call(chart);\n }\n catch {\n }\n }\n chartInstances.length = 0;\n },\n };\n};\n","export const RECOMMENDED_ZIP_LIMITS = {\n maxFileBytes: 160 * 1024 * 1024,\n};\nexport const createDefaultPptxOptions = () => ({\n slidesScale: '',\n slideMode: false,\n slideType: 'divs2slidesjs',\n revealjsPath: '',\n keyBoardShortCut: false,\n mediaProcess: true,\n jsZipV2: false,\n themeProcess: true,\n incSlide: {\n width: 0,\n height: 0,\n },\n slideModeConfig: {\n first: 1,\n nav: true,\n navTxtColor: 'black',\n keyBoardShortCut: true,\n showSlideNum: true,\n showTotalSlideNum: true,\n autoSlide: true,\n randomAutoSlide: false,\n loop: false,\n background: false,\n transition: 'default',\n transitionTime: 1,\n },\n revealjsConfig: {},\n});\nexport const resolvePptxEngineOptions = (options) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const defaults = createDefaultPptxOptions();\n return {\n ...defaults,\n ...options,\n incSlide: {\n width: (_d = (_b = (_a = options === null || options === void 0 ? void 0 : options.incSlide) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : (_c = defaults.incSlide) === null || _c === void 0 ? void 0 : _c.width) !== null && _d !== void 0 ? _d : 0,\n height: (_h = (_f = (_e = options === null || options === void 0 ? void 0 : options.incSlide) === null || _e === void 0 ? void 0 : _e.height) !== null && _f !== void 0 ? _f : (_g = defaults.incSlide) === null || _g === void 0 ? void 0 : _g.height) !== null && _h !== void 0 ? _h : 0,\n },\n slideModeConfig: {\n ...defaults.slideModeConfig,\n ...options === null || options === void 0 ? void 0 : options.slideModeConfig,\n },\n revealjsConfig: {\n ...defaults.revealjsConfig,\n ...options === null || options === void 0 ? void 0 : options.revealjsConfig,\n },\n };\n};\n","const clamp = (value, min, max) => Math.min(Math.max(value, min), max);\nexport class PptxPresentation {\n constructor(viewer, labels = {}, fullscreen = true) {\n this.overlay = null;\n this.stage = null;\n this.counter = null;\n this.placeholder = null;\n this.listeners = [];\n this.layoutFrame = 0;\n this.ownsFullscreen = false;\n this.current = 1;\n this.viewer = viewer;\n this.labels = labels;\n this.fullscreen = fullscreen;\n }\n get active() {\n return Boolean(this.overlay);\n }\n get slideNumber() {\n return this.current;\n }\n get state() {\n return { active: this.active, slideNumber: this.current, total: this.viewer.slideCount };\n }\n async enter(slideNumber = this.current) {\n var _a, _b;\n if (this.active || this.viewer.slideCount === 0) {\n return;\n }\n const documentRef = this.viewer.target.ownerDocument || document;\n const overlay = documentRef.createElement('div');\n overlay.className = 'flyfish-pptx-presentation';\n overlay.tabIndex = -1;\n overlay.setAttribute('role', 'region');\n overlay.setAttribute('aria-label', this.labels.hint || 'Slideshow');\n const stage = documentRef.createElement('div');\n stage.className = 'flyfish-pptx-presentation-stage';\n const counter = documentRef.createElement('div');\n counter.className = 'flyfish-pptx-presentation-counter';\n const hint = documentRef.createElement('div');\n hint.className = 'flyfish-pptx-presentation-hint';\n hint.textContent = this.labels.hint || '';\n hint.hidden = !this.labels.hint;\n const exit = documentRef.createElement('button');\n exit.type = 'button';\n exit.className = 'flyfish-pptx-presentation-exit';\n exit.textContent = '✕';\n exit.setAttribute('aria-label', this.labels.exit || 'Exit slideshow');\n exit.addEventListener('click', event => {\n event.stopPropagation();\n this.exit();\n });\n overlay.append(stage, counter, hint, exit);\n this.overlay = overlay;\n this.stage = stage;\n this.counter = counter;\n const styleRoot = this.viewer.presentationRoot;\n styleRoot.appendChild(overlay);\n this.placeholder = documentRef.createComment('flyfish-pptx-presentation');\n this.viewer.saveScrollPosition();\n this.viewer.scaleBox.replaceWith(this.placeholder);\n stage.appendChild(this.viewer.scaleBox);\n this.viewer.content.classList.add('is-presenting');\n this.attach(documentRef, overlay);\n this.goTo(slideNumber);\n if (this.fullscreen) {\n try {\n await ((_a = overlay.requestFullscreen) === null || _a === void 0 ? void 0 : _a.call(overlay));\n this.ownsFullscreen = this.isFullscreenElement(overlay);\n }\n catch {\n this.ownsFullscreen = false;\n }\n }\n if (this.overlay !== overlay) {\n if (this.ownsFullscreen) {\n void ((_b = documentRef.exitFullscreen) === null || _b === void 0 ? void 0 : _b.call(documentRef).catch(() => undefined));\n }\n this.ownsFullscreen = false;\n return;\n }\n overlay.focus({ preventScroll: true });\n this.scheduleLayout();\n this.notify();\n }\n exit() {\n var _a, _b;\n const overlay = this.overlay;\n if (!overlay) {\n return;\n }\n const documentRef = this.viewer.target.ownerDocument || document;\n const shouldExitFullscreen = this.ownsFullscreen && this.isFullscreenElement(overlay);\n this.detach();\n if (this.layoutFrame) {\n (documentRef.defaultView || window).cancelAnimationFrame(this.layoutFrame);\n this.layoutFrame = 0;\n }\n this.viewer.content.classList.remove('is-presenting');\n for (const container of this.slideContainers()) {\n container.classList.remove('is-active-slide');\n }\n if ((_a = this.placeholder) === null || _a === void 0 ? void 0 : _a.parentNode) {\n this.placeholder.replaceWith(this.viewer.scaleBox);\n }\n else {\n this.viewer.target.appendChild(this.viewer.scaleBox);\n }\n this.placeholder = null;\n overlay.remove();\n this.overlay = null;\n this.stage = null;\n this.counter = null;\n if (shouldExitFullscreen) {\n void ((_b = documentRef.exitFullscreen) === null || _b === void 0 ? void 0 : _b.call(documentRef).catch(() => undefined));\n }\n this.ownsFullscreen = false;\n this.viewer.restoreScrollPosition();\n this.notify();\n }\n async toggle(slideNumber) {\n if (this.active) {\n this.exit();\n return;\n }\n await this.enter(slideNumber);\n }\n goTo(slideNumber) {\n const total = this.viewer.slideCount;\n if (total === 0) {\n return;\n }\n this.current = clamp(Math.round(slideNumber) || 1, 1, total);\n this.viewer.ensureSlideRendered(this.current);\n this.viewer.ensureSlideRendered(this.current + 1);\n const containers = this.slideContainers();\n const byNumber = containers.some(container => Boolean(container.dataset.slideNumber));\n containers.forEach((container, index) => {\n const isActive = byNumber\n ? Number(container.dataset.slideNumber) === this.current\n : index === this.current - 1;\n container.classList.toggle('is-active-slide', isActive);\n });\n if (this.counter) {\n this.counter.textContent = `${this.current} / ${total}`;\n }\n if (this.active) {\n this.scheduleLayout();\n this.notify();\n }\n }\n next() {\n if (this.current < this.viewer.slideCount) {\n this.goTo(this.current + 1);\n }\n }\n previous() {\n if (this.current > 1) {\n this.goTo(this.current - 1);\n }\n }\n layout() {\n const overlay = this.overlay;\n if (!overlay) {\n return;\n }\n const container = this.slideContainers().find((item, index) => {\n if (item.dataset.slideNumber) {\n return Number(item.dataset.slideNumber) === this.current;\n }\n return index === this.current - 1;\n });\n const slide = container && container.classList.contains('flyfish-pptx-slide-slot')\n ? container.firstElementChild\n : container;\n const size = this.viewer.slideDimensions;\n const slideWidth = (slide === null || slide === void 0 ? void 0 : slide.offsetWidth) || (size === null || size === void 0 ? void 0 : size.width) || 0;\n const slideHeight = (slide === null || slide === void 0 ? void 0 : slide.offsetHeight) || (size === null || size === void 0 ? void 0 : size.height) || 0;\n if (!slideWidth || !slideHeight) {\n return;\n }\n const viewWidth = overlay.clientWidth;\n const viewHeight = overlay.clientHeight;\n const scale = Math.min(viewWidth / slideWidth, viewHeight / slideHeight);\n const offsetX = Math.max(0, (viewWidth - slideWidth * scale) / 2);\n const offsetY = Math.max(0, (viewHeight - slideHeight * scale) / 2);\n const content = this.viewer.content;\n content.style.width = `${slideWidth}px`;\n content.style.transform = `translate(${offsetX}px, ${offsetY}px) scale(${scale})`;\n const scaleBox = this.viewer.scaleBox;\n scaleBox.style.width = '100%';\n scaleBox.style.height = '100%';\n scaleBox.style.minHeight = '';\n }\n destroy() {\n this.exit();\n }\n slots() {\n return Array.from(this.viewer.content.querySelectorAll(':scope > .flyfish-pptx-slide-slot'));\n }\n slideContainers() {\n const slots = this.slots();\n if (slots.length > 0) {\n return slots;\n }\n return Array.from(this.viewer.content.querySelectorAll(':scope > .slide'));\n }\n isFullscreenElement(overlay) {\n const documentRef = this.viewer.target.ownerDocument || document;\n if (documentRef.fullscreenElement === overlay) {\n return true;\n }\n const root = overlay.getRootNode();\n if (root !== documentRef && 'fullscreenElement' in root) {\n return root.fullscreenElement === overlay;\n }\n return false;\n }\n scheduleLayout() {\n const view = this.viewer.target.ownerDocument.defaultView || window;\n if (this.layoutFrame) {\n view.cancelAnimationFrame(this.layoutFrame);\n }\n this.layoutFrame = view.requestAnimationFrame(() => {\n this.layoutFrame = 0;\n this.layout();\n });\n }\n notify() {\n this.viewer.emitPresentationChange(this.state);\n }\n on(target, type, listener) {\n target.addEventListener(type, listener);\n this.listeners.push({ target, type, listener });\n }\n attach(documentRef, overlay) {\n const view = documentRef.defaultView || window;\n this.on(documentRef, 'keydown', (event) => this.handleKey(event));\n this.on(overlay, 'click', (event) => this.handleClick(event));\n this.on(overlay, 'contextmenu', (event) => {\n event.preventDefault();\n this.previous();\n });\n this.on(view, 'resize', () => this.scheduleLayout());\n this.on(documentRef, 'fullscreenchange', () => {\n if (this.ownsFullscreen && !this.isFullscreenElement(overlay)) {\n this.ownsFullscreen = false;\n this.exit();\n }\n });\n }\n detach() {\n for (const { target, type, listener } of this.listeners) {\n target.removeEventListener(type, listener);\n }\n this.listeners = [];\n }\n handleClick(event) {\n var _a;\n const overlay = this.overlay;\n if (!overlay || ((_a = event.target) === null || _a === void 0 ? void 0 : _a.closest('.flyfish-pptx-presentation-exit'))) {\n return;\n }\n const bounds = overlay.getBoundingClientRect();\n const ratio = (event.clientX - bounds.left) / (bounds.width || 1);\n if (ratio < 0.2) {\n this.previous();\n }\n else {\n this.next();\n }\n }\n handleKey(event) {\n if (!this.active || event.altKey || event.metaKey || event.ctrlKey) {\n return;\n }\n const target = event.target;\n if (target &&\n typeof target.closest === 'function' &&\n target.closest('button, a, input, textarea, select, [contenteditable=\"true\"], [contenteditable=\"\"]')) {\n return;\n }\n if (target && typeof target.closest === 'function') {\n const otherOverlay = target.closest('.flyfish-pptx-presentation');\n if (otherOverlay && otherOverlay !== this.overlay) {\n return;\n }\n }\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n case 'PageDown':\n case ' ':\n case 'Enter':\n event.preventDefault();\n this.next();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n case 'PageUp':\n case 'Backspace':\n event.preventDefault();\n this.previous();\n break;\n case 'Home':\n event.preventDefault();\n this.goTo(1);\n break;\n case 'End':\n event.preventDefault();\n this.goTo(this.viewer.slideCount);\n break;\n case 'Escape':\n event.preventDefault();\n this.exit();\n break;\n default:\n break;\n }\n }\n}\n","/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */\nfunction _OverloadYield(e, d) {\n\tthis.v = e, this.k = d;\n}\nfunction _arrayLikeToArray(r, a) {\n\t(null == a || a > r.length) && (a = r.length);\n\tfor (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n\treturn n;\n}\nfunction _arrayWithHoles(r) {\n\tif (Array.isArray(r)) return r;\n}\nfunction _iterableToArrayLimit(r, l) {\n\tvar t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n\tif (null != t) {\n\t\tvar e, n, i, u, a = [], f = !0, o = !1;\n\t\ttry {\n\t\t\tif (i = (t = t.call(r)).next, 0 === l) {\n\t\t\t\tif (Object(t) !== t) return;\n\t\t\t\tf = !1;\n\t\t\t} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n\t\t} catch (r) {\n\t\t\to = !0, n = r;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n\t\t\t} finally {\n\t\t\t\tif (o) throw n;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}\nfunction _nonIterableRest() {\n\tthrow new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\nfunction _slicedToArray(r, e) {\n\treturn _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _unsupportedIterableToArray(r, a) {\n\tif (r) {\n\t\tif (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n\t\tvar t = {}.toString.call(r).slice(8, -1);\n\t\treturn \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n\t}\n}\nfunction AsyncGenerator(e) {\n\tvar t, n;\n\tfunction resume(t, n) {\n\t\ttry {\n\t\t\tvar r = e[t](n), o = r.value, u = o instanceof _OverloadYield;\n\t\t\tPromise.resolve(u ? o.v : o).then(function(n) {\n\t\t\t\tif (u) {\n\t\t\t\t\tvar i = \"return\" === t && o.k ? t : \"next\";\n\t\t\t\t\tif (!o.k || n.done) return resume(i, n);\n\t\t\t\t\tn = e[i](n).value;\n\t\t\t\t}\n\t\t\t\tsettle(!!r.done, n);\n\t\t\t}, function(e) {\n\t\t\t\tresume(\"throw\", e);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tsettle(2, e);\n\t\t}\n\t}\n\tfunction settle(e, r) {\n\t\t2 === e ? t.reject(r) : t.resolve({\n\t\t\tvalue: r,\n\t\t\tdone: e\n\t\t}), (t = t.next) ? resume(t.key, t.arg) : n = null;\n\t}\n\tthis._invoke = function(e, r) {\n\t\treturn new Promise(function(o, u) {\n\t\t\tvar i = {\n\t\t\t\tkey: e,\n\t\t\t\targ: r,\n\t\t\t\tresolve: o,\n\t\t\t\treject: u,\n\t\t\t\tnext: null\n\t\t\t};\n\t\t\tn ? n = n.next = i : (t = n = i, resume(e, r));\n\t\t});\n\t}, \"function\" != typeof e.return && (this.return = void 0);\n}\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function() {\n\treturn this;\n}, AsyncGenerator.prototype.next = function(e) {\n\treturn this._invoke(\"next\", e);\n}, AsyncGenerator.prototype.throw = function(e) {\n\treturn this._invoke(\"throw\", e);\n}, AsyncGenerator.prototype.return = function(e) {\n\treturn this._invoke(\"return\", e);\n};\nconst entries = Object.entries;\nconst setPrototypeOf = Object.setPrototypeOf;\nconst isFrozen = Object.isFrozen;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nlet freeze = Object.freeze;\nlet seal = Object.seal;\nlet create = Object.create;\nlet _ref = typeof Reflect !== \"undefined\" && Reflect;\nlet apply = _ref.apply;\nlet construct = _ref.construct;\nif (!freeze) freeze = function freeze(x) {\n\treturn x;\n};\nif (!seal) seal = function seal(x) {\n\treturn x;\n};\nif (!apply) apply = function apply(func, thisArg) {\n\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\treturn func.apply(thisArg, args);\n};\nif (!construct) construct = function construct(Func) {\n\tfor (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];\n\treturn new Func(...args);\n};\nconst arrayForEach = unapply(Array.prototype.forEach);\nArray.prototype.indexOf;\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\nconst arraySplice = unapply(Array.prototype.splice);\nconst arrayIsArray = Array.isArray;\nconst setCreate = unconstruct(Set);\nconst setAdd = unapply(Set.prototype.add);\nconst setHas = unapply(Set.prototype.has);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst numberToString = unapply(Number.prototype.toString);\nconst booleanToString = unapply(Boolean.prototype.toString);\nconst bigintToString = typeof BigInt === \"undefined\" ? null : unapply(BigInt.prototype.toString);\nconst symbolToString = typeof Symbol === \"undefined\" ? null : unapply(Symbol.prototype.toString);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst objectToString = unapply(Object.prototype.toString);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n* Creates a new function that calls the given function with a specified thisArg and arguments.\n*\n* @param func - The function to be wrapped and called.\n* @returns A new function that calls the given function with a specified thisArg and arguments.\n*/\nfunction unapply(func) {\n\treturn function(thisArg) {\n\t\tif (thisArg instanceof RegExp) thisArg.lastIndex = 0;\n\t\tfor (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n\t\treturn apply(func, thisArg, args);\n\t};\n}\n/**\n* Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n*\n* @param func - The constructor function to be wrapped and called.\n* @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n*/\nfunction unconstruct(Func) {\n\treturn function() {\n\t\tfor (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n\t\treturn construct(Func, args);\n\t};\n}\n/**\n* Add properties to a lookup table\n*\n* @param set - The set to which elements will be added.\n* @param array - The array containing elements to be added to the set.\n* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n* @returns The modified set with added elements.\n*/\nfunction addToSet(set, array) {\n\tlet transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;\n\tif (setPrototypeOf) setPrototypeOf(set, null);\n\tif (!arrayIsArray(array)) return set;\n\tlet l = array.length;\n\twhile (l--) {\n\t\tlet element = array[l];\n\t\tif (typeof element === \"string\") {\n\t\t\tconst lcElement = transformCaseFunc(element);\n\t\t\tif (lcElement !== element) {\n\t\t\t\tif (!isFrozen(array)) array[l] = lcElement;\n\t\t\t\telement = lcElement;\n\t\t\t}\n\t\t}\n\t\tset[element] = true;\n\t}\n\treturn set;\n}\n/**\n* Clean up an array to harden against CSPP\n*\n* @param array - The array to be cleaned.\n* @returns The cleaned version of the array\n*/\nfunction cleanArray(array) {\n\tfor (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;\n\treturn array;\n}\n/**\n* Shallow clone an object\n*\n* @param object - The object to be cloned.\n* @returns A new object that copies the original.\n*/\nfunction clone(object) {\n\tconst newObject = create(null);\n\tfor (const _ref2 of entries(object)) {\n\t\tvar _ref3 = _slicedToArray(_ref2, 2);\n\t\tconst property = _ref3[0];\n\t\tconst value = _ref3[1];\n\t\tif (objectHasOwnProperty(object, property)) {\n\t\t\tif (arrayIsArray(value)) newObject[property] = cleanArray(value);\n\t\t\telse if (value && typeof value === \"object\" && value.constructor === Object) newObject[property] = clone(value);\n\t\t\telse newObject[property] = value;\n\t\t}\n\t}\n\treturn newObject;\n}\n/**\n* Convert non-node values into strings without depending on direct property access.\n*\n* @param value - The value to stringify.\n* @returns A string representation of the provided value.\n*/\nfunction stringifyValue(value) {\n\tswitch (typeof value) {\n\t\tcase \"string\": return value;\n\t\tcase \"number\": return numberToString(value);\n\t\tcase \"boolean\": return booleanToString(value);\n\t\tcase \"bigint\": return bigintToString ? bigintToString(value) : \"0\";\n\t\tcase \"symbol\": return symbolToString ? symbolToString(value) : \"Symbol()\";\n\t\tcase \"undefined\": return objectToString(value);\n\t\tcase \"function\":\n\t\tcase \"object\": {\n\t\t\tif (value === null) return objectToString(value);\n\t\t\tconst valueAsRecord = value;\n\t\t\tconst valueToString = lookupGetter(valueAsRecord, \"toString\");\n\t\t\tif (typeof valueToString === \"function\") {\n\t\t\t\tconst stringified = valueToString(valueAsRecord);\n\t\t\t\treturn typeof stringified === \"string\" ? stringified : objectToString(stringified);\n\t\t\t}\n\t\t\treturn objectToString(value);\n\t\t}\n\t\tdefault: return objectToString(value);\n\t}\n}\n/**\n* This method automatically checks if the prop is function or getter and behaves accordingly.\n*\n* @param object - The object to look up the getter function in its prototype chain.\n* @param prop - The property name for which to find the getter function.\n* @returns The getter function found in the prototype chain or a fallback function.\n*/\nfunction lookupGetter(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) {\n\t\t\tif (desc.get) return unapply(desc.get);\n\t\t\tif (typeof desc.value === \"function\") return unapply(desc.value);\n\t\t}\n\t\tobject = getPrototypeOf(object);\n\t}\n\tfunction fallbackValue() {\n\t\treturn null;\n\t}\n\treturn fallbackValue;\n}\n/**\n* Like lookupGetter, but for accessor properties only, and returns null\n* instead of a null-returning fallback when no getter exists on the chain.\n* Lets a caller fall back to a direct property read in environments that\n* lack the getter, where a fallback returning null would be indistinguishable\n* from a legitimate null value (e.g. namespaceURI of a no-namespace element).\n*\n* @param object - The object (usually a prototype) to start the lookup at.\n* @param prop - The accessor property name.\n* @returns The unapplied getter, or null if none was found.\n*/\nfunction lookupAccessor(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) return desc.get ? unapply(desc.get) : null;\n\t\tobject = getPrototypeOf(object);\n\t}\n\treturn null;\n}\nfunction isRegex(value) {\n\ttry {\n\t\tregExpTest(value, \"\");\n\t\treturn true;\n\t} catch (_unused) {\n\t\treturn false;\n\t}\n}\nconst html$1 = freeze([\n\t\"a\",\n\t\"abbr\",\n\t\"acronym\",\n\t\"address\",\n\t\"area\",\n\t\"article\",\n\t\"aside\",\n\t\"audio\",\n\t\"b\",\n\t\"bdi\",\n\t\"bdo\",\n\t\"big\",\n\t\"blink\",\n\t\"blockquote\",\n\t\"body\",\n\t\"br\",\n\t\"button\",\n\t\"canvas\",\n\t\"caption\",\n\t\"center\",\n\t\"cite\",\n\t\"code\",\n\t\"col\",\n\t\"colgroup\",\n\t\"content\",\n\t\"data\",\n\t\"datalist\",\n\t\"dd\",\n\t\"decorator\",\n\t\"del\",\n\t\"details\",\n\t\"dfn\",\n\t\"dialog\",\n\t\"dir\",\n\t\"div\",\n\t\"dl\",\n\t\"dt\",\n\t\"element\",\n\t\"em\",\n\t\"fieldset\",\n\t\"figcaption\",\n\t\"figure\",\n\t\"font\",\n\t\"footer\",\n\t\"form\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"head\",\n\t\"header\",\n\t\"hgroup\",\n\t\"hr\",\n\t\"html\",\n\t\"i\",\n\t\"img\",\n\t\"input\",\n\t\"ins\",\n\t\"kbd\",\n\t\"label\",\n\t\"legend\",\n\t\"li\",\n\t\"main\",\n\t\"map\",\n\t\"mark\",\n\t\"marquee\",\n\t\"menu\",\n\t\"menuitem\",\n\t\"meter\",\n\t\"nav\",\n\t\"nobr\",\n\t\"ol\",\n\t\"optgroup\",\n\t\"option\",\n\t\"output\",\n\t\"p\",\n\t\"picture\",\n\t\"pre\",\n\t\"progress\",\n\t\"q\",\n\t\"rp\",\n\t\"rt\",\n\t\"ruby\",\n\t\"s\",\n\t\"samp\",\n\t\"search\",\n\t\"section\",\n\t\"select\",\n\t\"shadow\",\n\t\"slot\",\n\t\"small\",\n\t\"source\",\n\t\"spacer\",\n\t\"span\",\n\t\"strike\",\n\t\"strong\",\n\t\"style\",\n\t\"sub\",\n\t\"summary\",\n\t\"sup\",\n\t\"table\",\n\t\"tbody\",\n\t\"td\",\n\t\"template\",\n\t\"textarea\",\n\t\"tfoot\",\n\t\"th\",\n\t\"thead\",\n\t\"time\",\n\t\"tr\",\n\t\"track\",\n\t\"tt\",\n\t\"u\",\n\t\"ul\",\n\t\"var\",\n\t\"video\",\n\t\"wbr\"\n]);\nconst svg$1 = freeze([\n\t\"svg\",\n\t\"a\",\n\t\"altglyph\",\n\t\"altglyphdef\",\n\t\"altglyphitem\",\n\t\"animatecolor\",\n\t\"animatemotion\",\n\t\"animatetransform\",\n\t\"circle\",\n\t\"clippath\",\n\t\"defs\",\n\t\"desc\",\n\t\"ellipse\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"filter\",\n\t\"font\",\n\t\"g\",\n\t\"glyph\",\n\t\"glyphref\",\n\t\"hkern\",\n\t\"image\",\n\t\"inputmode\",\n\t\"line\",\n\t\"lineargradient\",\n\t\"marker\",\n\t\"mask\",\n\t\"metadata\",\n\t\"mpath\",\n\t\"part\",\n\t\"path\",\n\t\"pattern\",\n\t\"polygon\",\n\t\"polyline\",\n\t\"radialgradient\",\n\t\"rect\",\n\t\"stop\",\n\t\"style\",\n\t\"switch\",\n\t\"symbol\",\n\t\"text\",\n\t\"textpath\",\n\t\"title\",\n\t\"tref\",\n\t\"tspan\",\n\t\"view\",\n\t\"vkern\"\n]);\nconst svgFilters = freeze([\n\t\"feBlend\",\n\t\"feColorMatrix\",\n\t\"feComponentTransfer\",\n\t\"feComposite\",\n\t\"feConvolveMatrix\",\n\t\"feDiffuseLighting\",\n\t\"feDisplacementMap\",\n\t\"feDistantLight\",\n\t\"feDropShadow\",\n\t\"feFlood\",\n\t\"feFuncA\",\n\t\"feFuncB\",\n\t\"feFuncG\",\n\t\"feFuncR\",\n\t\"feGaussianBlur\",\n\t\"feImage\",\n\t\"feMerge\",\n\t\"feMergeNode\",\n\t\"feMorphology\",\n\t\"feOffset\",\n\t\"fePointLight\",\n\t\"feSpecularLighting\",\n\t\"feSpotLight\",\n\t\"feTile\",\n\t\"feTurbulence\"\n]);\nconst svgDisallowed = freeze([\n\t\"animate\",\n\t\"color-profile\",\n\t\"cursor\",\n\t\"discard\",\n\t\"font-face\",\n\t\"font-face-format\",\n\t\"font-face-name\",\n\t\"font-face-src\",\n\t\"font-face-uri\",\n\t\"foreignobject\",\n\t\"hatch\",\n\t\"hatchpath\",\n\t\"mesh\",\n\t\"meshgradient\",\n\t\"meshpatch\",\n\t\"meshrow\",\n\t\"missing-glyph\",\n\t\"script\",\n\t\"set\",\n\t\"solidcolor\",\n\t\"unknown\",\n\t\"use\"\n]);\nconst mathMl$1 = freeze([\n\t\"math\",\n\t\"menclose\",\n\t\"merror\",\n\t\"mfenced\",\n\t\"mfrac\",\n\t\"mglyph\",\n\t\"mi\",\n\t\"mlabeledtr\",\n\t\"mmultiscripts\",\n\t\"mn\",\n\t\"mo\",\n\t\"mover\",\n\t\"mpadded\",\n\t\"mphantom\",\n\t\"mroot\",\n\t\"mrow\",\n\t\"ms\",\n\t\"mspace\",\n\t\"msqrt\",\n\t\"mstyle\",\n\t\"msub\",\n\t\"msup\",\n\t\"msubsup\",\n\t\"mtable\",\n\t\"mtd\",\n\t\"mtext\",\n\t\"mtr\",\n\t\"munder\",\n\t\"munderover\",\n\t\"mprescripts\"\n]);\nconst mathMlDisallowed = freeze([\n\t\"maction\",\n\t\"maligngroup\",\n\t\"malignmark\",\n\t\"mlongdiv\",\n\t\"mscarries\",\n\t\"mscarry\",\n\t\"msgroup\",\n\t\"mstack\",\n\t\"msline\",\n\t\"msrow\",\n\t\"semantics\",\n\t\"annotation\",\n\t\"annotation-xml\",\n\t\"mprescripts\",\n\t\"none\"\n]);\nconst text = freeze([\"#text\"]);\nconst html = freeze([\n\t\"accept\",\n\t\"action\",\n\t\"align\",\n\t\"alt\",\n\t\"autocapitalize\",\n\t\"autocomplete\",\n\t\"autopictureinpicture\",\n\t\"autoplay\",\n\t\"background\",\n\t\"bgcolor\",\n\t\"border\",\n\t\"capture\",\n\t\"cellpadding\",\n\t\"cellspacing\",\n\t\"checked\",\n\t\"cite\",\n\t\"class\",\n\t\"clear\",\n\t\"color\",\n\t\"cols\",\n\t\"colspan\",\n\t\"command\",\n\t\"commandfor\",\n\t\"controls\",\n\t\"controlslist\",\n\t\"coords\",\n\t\"crossorigin\",\n\t\"datetime\",\n\t\"decoding\",\n\t\"default\",\n\t\"dir\",\n\t\"disabled\",\n\t\"disablepictureinpicture\",\n\t\"disableremoteplayback\",\n\t\"download\",\n\t\"draggable\",\n\t\"enctype\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"face\",\n\t\"for\",\n\t\"headers\",\n\t\"height\",\n\t\"hidden\",\n\t\"high\",\n\t\"href\",\n\t\"hreflang\",\n\t\"id\",\n\t\"inert\",\n\t\"inputmode\",\n\t\"integrity\",\n\t\"ismap\",\n\t\"kind\",\n\t\"label\",\n\t\"lang\",\n\t\"list\",\n\t\"loading\",\n\t\"loop\",\n\t\"low\",\n\t\"max\",\n\t\"maxlength\",\n\t\"media\",\n\t\"method\",\n\t\"min\",\n\t\"minlength\",\n\t\"multiple\",\n\t\"muted\",\n\t\"name\",\n\t\"nonce\",\n\t\"noshade\",\n\t\"novalidate\",\n\t\"nowrap\",\n\t\"open\",\n\t\"optimum\",\n\t\"part\",\n\t\"pattern\",\n\t\"placeholder\",\n\t\"playsinline\",\n\t\"popover\",\n\t\"popovertarget\",\n\t\"popovertargetaction\",\n\t\"poster\",\n\t\"preload\",\n\t\"pubdate\",\n\t\"radiogroup\",\n\t\"readonly\",\n\t\"rel\",\n\t\"required\",\n\t\"rev\",\n\t\"reversed\",\n\t\"role\",\n\t\"rows\",\n\t\"rowspan\",\n\t\"spellcheck\",\n\t\"scope\",\n\t\"selected\",\n\t\"shape\",\n\t\"size\",\n\t\"sizes\",\n\t\"slot\",\n\t\"span\",\n\t\"srclang\",\n\t\"start\",\n\t\"src\",\n\t\"srcset\",\n\t\"step\",\n\t\"style\",\n\t\"summary\",\n\t\"tabindex\",\n\t\"title\",\n\t\"translate\",\n\t\"type\",\n\t\"usemap\",\n\t\"valign\",\n\t\"value\",\n\t\"width\",\n\t\"wrap\",\n\t\"xmlns\"\n]);\nconst svg = freeze([\n\t\"accent-height\",\n\t\"accumulate\",\n\t\"additive\",\n\t\"alignment-baseline\",\n\t\"amplitude\",\n\t\"ascent\",\n\t\"attributename\",\n\t\"attributetype\",\n\t\"azimuth\",\n\t\"basefrequency\",\n\t\"baseline-shift\",\n\t\"begin\",\n\t\"bias\",\n\t\"by\",\n\t\"class\",\n\t\"clip\",\n\t\"clippathunits\",\n\t\"clip-path\",\n\t\"clip-rule\",\n\t\"color\",\n\t\"color-interpolation\",\n\t\"color-interpolation-filters\",\n\t\"color-profile\",\n\t\"color-rendering\",\n\t\"cx\",\n\t\"cy\",\n\t\"d\",\n\t\"dx\",\n\t\"dy\",\n\t\"diffuseconstant\",\n\t\"direction\",\n\t\"display\",\n\t\"divisor\",\n\t\"dominant-baseline\",\n\t\"dur\",\n\t\"edgemode\",\n\t\"elevation\",\n\t\"end\",\n\t\"exponent\",\n\t\"fill\",\n\t\"fill-opacity\",\n\t\"fill-rule\",\n\t\"filter\",\n\t\"filterunits\",\n\t\"flood-color\",\n\t\"flood-opacity\",\n\t\"font-family\",\n\t\"font-size\",\n\t\"font-size-adjust\",\n\t\"font-stretch\",\n\t\"font-style\",\n\t\"font-variant\",\n\t\"font-weight\",\n\t\"fx\",\n\t\"fy\",\n\t\"g1\",\n\t\"g2\",\n\t\"glyph-name\",\n\t\"glyphref\",\n\t\"gradientunits\",\n\t\"gradienttransform\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"image-rendering\",\n\t\"in\",\n\t\"in2\",\n\t\"intercept\",\n\t\"k\",\n\t\"k1\",\n\t\"k2\",\n\t\"k3\",\n\t\"k4\",\n\t\"kerning\",\n\t\"keypoints\",\n\t\"keysplines\",\n\t\"keytimes\",\n\t\"lang\",\n\t\"lengthadjust\",\n\t\"letter-spacing\",\n\t\"kernelmatrix\",\n\t\"kernelunitlength\",\n\t\"lighting-color\",\n\t\"local\",\n\t\"marker-end\",\n\t\"marker-mid\",\n\t\"marker-start\",\n\t\"markerheight\",\n\t\"markerunits\",\n\t\"markerwidth\",\n\t\"maskcontentunits\",\n\t\"maskunits\",\n\t\"max\",\n\t\"mask\",\n\t\"mask-type\",\n\t\"media\",\n\t\"method\",\n\t\"mode\",\n\t\"min\",\n\t\"name\",\n\t\"numoctaves\",\n\t\"offset\",\n\t\"operator\",\n\t\"opacity\",\n\t\"order\",\n\t\"orient\",\n\t\"orientation\",\n\t\"origin\",\n\t\"overflow\",\n\t\"paint-order\",\n\t\"path\",\n\t\"pathlength\",\n\t\"patterncontentunits\",\n\t\"patterntransform\",\n\t\"patternunits\",\n\t\"pointer-events\",\n\t\"points\",\n\t\"preservealpha\",\n\t\"preserveaspectratio\",\n\t\"primitiveunits\",\n\t\"r\",\n\t\"rx\",\n\t\"ry\",\n\t\"radius\",\n\t\"refx\",\n\t\"refy\",\n\t\"repeatcount\",\n\t\"repeatdur\",\n\t\"restart\",\n\t\"result\",\n\t\"rotate\",\n\t\"scale\",\n\t\"seed\",\n\t\"shape-rendering\",\n\t\"slope\",\n\t\"specularconstant\",\n\t\"specularexponent\",\n\t\"spreadmethod\",\n\t\"startoffset\",\n\t\"stddeviation\",\n\t\"stitchtiles\",\n\t\"stop-color\",\n\t\"stop-opacity\",\n\t\"stroke-dasharray\",\n\t\"stroke-dashoffset\",\n\t\"stroke-linecap\",\n\t\"stroke-linejoin\",\n\t\"stroke-miterlimit\",\n\t\"stroke-opacity\",\n\t\"stroke\",\n\t\"stroke-width\",\n\t\"style\",\n\t\"surfacescale\",\n\t\"systemlanguage\",\n\t\"tabindex\",\n\t\"tablevalues\",\n\t\"targetx\",\n\t\"targety\",\n\t\"transform\",\n\t\"transform-origin\",\n\t\"text-anchor\",\n\t\"text-decoration\",\n\t\"text-orientation\",\n\t\"text-rendering\",\n\t\"textlength\",\n\t\"type\",\n\t\"u1\",\n\t\"u2\",\n\t\"unicode\",\n\t\"values\",\n\t\"vector-effect\",\n\t\"viewbox\",\n\t\"visibility\",\n\t\"version\",\n\t\"vert-adv-y\",\n\t\"vert-origin-x\",\n\t\"vert-origin-y\",\n\t\"width\",\n\t\"word-spacing\",\n\t\"wrap\",\n\t\"writing-mode\",\n\t\"xchannelselector\",\n\t\"ychannelselector\",\n\t\"x\",\n\t\"x1\",\n\t\"x2\",\n\t\"xmlns\",\n\t\"y\",\n\t\"y1\",\n\t\"y2\",\n\t\"z\",\n\t\"zoomandpan\"\n]);\nconst mathMl = freeze([\n\t\"accent\",\n\t\"accentunder\",\n\t\"align\",\n\t\"bevelled\",\n\t\"close\",\n\t\"columnalign\",\n\t\"columnlines\",\n\t\"columnspacing\",\n\t\"columnspan\",\n\t\"denomalign\",\n\t\"depth\",\n\t\"dir\",\n\t\"display\",\n\t\"displaystyle\",\n\t\"encoding\",\n\t\"fence\",\n\t\"frame\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"largeop\",\n\t\"length\",\n\t\"linethickness\",\n\t\"lquote\",\n\t\"lspace\",\n\t\"mathbackground\",\n\t\"mathcolor\",\n\t\"mathsize\",\n\t\"mathvariant\",\n\t\"maxsize\",\n\t\"minsize\",\n\t\"movablelimits\",\n\t\"notation\",\n\t\"numalign\",\n\t\"open\",\n\t\"rowalign\",\n\t\"rowlines\",\n\t\"rowspacing\",\n\t\"rowspan\",\n\t\"rspace\",\n\t\"rquote\",\n\t\"scriptlevel\",\n\t\"scriptminsize\",\n\t\"scriptsizemultiplier\",\n\t\"selection\",\n\t\"separator\",\n\t\"separators\",\n\t\"stretchy\",\n\t\"subscriptshift\",\n\t\"supscriptshift\",\n\t\"symmetric\",\n\t\"voffset\",\n\t\"width\",\n\t\"xmlns\"\n]);\nconst xml = freeze([\n\t\"xlink:href\",\n\t\"xml:id\",\n\t\"xlink:title\",\n\t\"xml:space\",\n\t\"xmlns:xlink\"\n]);\nconst MUSTACHE_EXPR = seal(/{{[\\w\\W]*|^[\\w\\W]*}}/g);\nconst ERB_EXPR = seal(/<%[\\w\\W]*|^[\\w\\W]*%>/g);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*/g);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/);\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/);\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\nconst ELEMENT_MARKUP_PROBE = seal(/<[/\\w!]/g);\nconst COMMENT_MARKUP_PROBE = seal(/<[/\\w]/g);\nconst FALLBACK_TAG_CLOSE = seal(/<\\/no(script|embed|frames)/i);\nconst SELF_CLOSING_TAG = seal(/\\/>/i);\nconst NODE_TYPE = {\n\telement: 1,\n\tattribute: 2,\n\ttext: 3,\n\tcdataSection: 4,\n\tentityReference: 5,\n\tentityNode: 6,\n\tprocessingInstruction: 7,\n\tcomment: 8,\n\tdocument: 9,\n\tdocumentType: 10,\n\tdocumentFragment: 11,\n\tnotation: 12\n};\nconst LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, [\n\t\"style\",\n\t\"script\",\n\t\"xmp\",\n\t\"iframe\",\n\t\"noembed\",\n\t\"noframes\",\n\t\"plaintext\",\n\t\"noscript\"\n]));\nconst getGlobal = function getGlobal() {\n\treturn typeof window === \"undefined\" ? null : window;\n};\n/**\n* Creates a no-op policy for internal use only.\n* Don't export this function outside this module!\n* @param trustedTypes The policy factory.\n* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n* @return The policy created (or null, if Trusted Types\n* are not supported or creating the policy failed).\n*/\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n\tif (typeof trustedTypes !== \"object\" || typeof trustedTypes.createPolicy !== \"function\") return null;\n\tlet suffix = null;\n\tconst ATTR_NAME = \"data-tt-policy-suffix\";\n\tif (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);\n\tconst policyName = \"dompurify\" + (suffix ? \"#\" + suffix : \"\");\n\ttry {\n\t\treturn trustedTypes.createPolicy(policyName, {\n\t\t\tcreateHTML(html) {\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tcreateScriptURL(scriptUrl) {\n\t\t\t\treturn scriptUrl;\n\t\t\t}\n\t\t});\n\t} catch (_) {\n\t\tconsole.warn(\"TrustedTypes policy \" + policyName + \" could not be created.\");\n\t\treturn null;\n\t}\n};\nconst _createHooksMap = function _createHooksMap() {\n\treturn {\n\t\tafterSanitizeAttributes: [],\n\t\tafterSanitizeElements: [],\n\t\tafterSanitizeShadowDOM: [],\n\t\tbeforeSanitizeAttributes: [],\n\t\tbeforeSanitizeElements: [],\n\t\tbeforeSanitizeShadowDOM: [],\n\t\tuponSanitizeAttribute: [],\n\t\tuponSanitizeElement: [],\n\t\tuponSanitizeShadowNode: []\n\t};\n};\n/**\n* Resolve a set-valued configuration option: a fresh set built from\n* cfg[key] when it is an own array property (seeded with a clone of\n* options.base when given, case-normalized via options.transform),\n* the fallback set otherwise.\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param fallback the set to use when the option is absent or not an array\n* @param options transform and optional base set to merge into\n* @returns the resolved set\n*/\nconst _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {\n\treturn objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;\n};\n/**\n* Resolve an object-valued configuration option: a prototype-free clone\n* of cfg[key] when it is an own, truthy object property, else a fresh\n* fallback built by makeFallback (fresh on every parse, so a previous\n* parse can never leak state into the next one).\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param makeFallback builds the fallback value when the option is absent\n* @returns the resolved object\n*/\nconst _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {\n\tconst value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;\n\treturn value && typeof value === \"object\" ? clone(value) : makeFallback();\n};\nfunction createDOMPurify() {\n\tlet window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();\n\tconst DOMPurify = (root) => createDOMPurify(root);\n\tDOMPurify.version = \"3.4.17\";\n\tDOMPurify.removed = [];\n\tif (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n\t\tDOMPurify.isSupported = false;\n\t\treturn DOMPurify;\n\t}\n\tlet document = window.document;\n\tconst originalDocument = document;\n\tconst currentScript = originalDocument.currentScript;\n\twindow.DocumentFragment;\n\tconst HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter;\n\twindow.NamedNodeMap === void 0 && (window.NamedNodeMap || window.MozNamedAttrMap);\n\twindow.HTMLFormElement;\n\tconst DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;\n\tconst ElementPrototype = Element.prototype;\n\tconst cloneNode = lookupGetter(ElementPrototype, \"cloneNode\");\n\tconst remove = lookupGetter(ElementPrototype, \"remove\");\n\tconst removeAttributeNode = lookupGetter(ElementPrototype, \"removeAttributeNode\");\n\tconst getNextSibling = lookupGetter(ElementPrototype, \"nextSibling\");\n\tconst getChildNodes = lookupGetter(ElementPrototype, \"childNodes\");\n\tconst getParentNode = lookupGetter(ElementPrototype, \"parentNode\");\n\tconst getShadowRoot = lookupGetter(ElementPrototype, \"shadowRoot\");\n\tconst getAttributes = lookupGetter(ElementPrototype, \"attributes\");\n\tconst getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeType\") : null;\n\tconst getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeName\") : null;\n\tconst getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, \"ownerDocument\") : null;\n\tconst _readNodeType = function _readNodeType(node) {\n\t\treturn getNodeType ? getNodeType(node) : node.nodeType;\n\t};\n\tconst _readNodeName = function _readNodeName(node) {\n\t\treturn getNodeName ? getNodeName(node) : node.nodeName;\n\t};\n\tconst getNamespaceURI = lookupAccessor(ElementPrototype, \"namespaceURI\");\n\tconst _readNamespaceURI = function _readNamespaceURI(element) {\n\t\treturn getNamespaceURI ? getNamespaceURI(element) : element.namespaceURI;\n\t};\n\tif (typeof HTMLTemplateElement === \"function\") {\n\t\tconst template = document.createElement(\"template\");\n\t\tif (template.content && template.content.ownerDocument) document = template.content.ownerDocument;\n\t}\n\tlet trustedTypesPolicy;\n\tlet emptyHTML = \"\";\n\tlet defaultTrustedTypesPolicy;\n\tlet defaultTrustedTypesPolicyResolved = false;\n\tlet IN_TRUSTED_TYPES_POLICY = 0;\n\tconst _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {\n\t\tif (IN_TRUSTED_TYPES_POLICY > 0) throw typeErrorCreate(\"A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \\\"DOMPurify and Trusted Types\\\" section of the README.\");\n\t};\n\tconst _createTrustedHTML = function _createTrustedHTML(html) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createHTML(html);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createScriptURL(scriptUrl);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {\n\t\tif (!defaultTrustedTypesPolicyResolved) {\n\t\t\tdefaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n\t\t\tdefaultTrustedTypesPolicyResolved = true;\n\t\t}\n\t\treturn defaultTrustedTypesPolicy;\n\t};\n\tconst _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;\n\tconst importNode = originalDocument.importNode;\n\tlet hooks = _createHooksMap();\n\t/**\n\t* Expose whether this browser supports running the full DOMPurify.\n\t*/\n\tDOMPurify.isSupported = typeof entries === \"function\" && typeof getParentNode === \"function\" && implementation && implementation.createHTMLDocument !== void 0;\n\tconst MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;\n\tlet IS_ALLOWED_URI$1 = IS_ALLOWED_URI;\n\t/**\n\t* We consider the elements and attributes below to be safe. Ideally\n\t* don't add any new ones but feel free to remove unwanted ones.\n\t*/\n\tlet ALLOWED_TAGS = null;\n\tconst DEFAULT_ALLOWED_TAGS = addToSet({}, [\n\t\t...html$1,\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...mathMl$1,\n\t\t...text\n\t]);\n\tlet ALLOWED_ATTR = null;\n\tconst DEFAULT_ALLOWED_ATTR = addToSet({}, [\n\t\t...html,\n\t\t...svg,\n\t\t...mathMl,\n\t\t...xml\n\t]);\n\tlet CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tallowCustomizedBuiltInElements: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: false\n\t\t}\n\t}));\n\tlet FORBID_TAGS = null;\n\tlet FORBID_ATTR = null;\n\tconst EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t}\n\t}));\n\tlet ALLOW_ARIA_ATTR = true;\n\tlet ALLOW_DATA_ATTR = true;\n\tlet ALLOW_UNKNOWN_PROTOCOLS = false;\n\tlet ALLOW_SELF_CLOSE_IN_ATTR = true;\n\tlet SAFE_FOR_TEMPLATES = false;\n\tlet SAFE_FOR_XML = true;\n\tlet WHOLE_DOCUMENT = false;\n\tlet SET_CONFIG = false;\n\tlet SET_CONFIG_ALLOWED_TAGS = null;\n\tlet SET_CONFIG_ALLOWED_ATTR = null;\n\tlet FORCE_BODY = false;\n\tlet RETURN_DOM = false;\n\tlet RETURN_DOM_FRAGMENT = false;\n\tlet RETURN_TRUSTED_TYPE = false;\n\tlet SANITIZE_DOM = true;\n\tlet SANITIZE_NAMED_PROPS = false;\n\tconst SANITIZE_NAMED_PROPS_PREFIX = \"user-content-\";\n\tlet KEEP_CONTENT = true;\n\tlet IN_PLACE = false;\n\tlet IN_PLACE_VISITED = null;\n\tlet USE_PROFILES = {};\n\tlet FORBID_CONTENTS = null;\n\tconst DEFAULT_FORBID_CONTENTS = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"audio\",\n\t\t\"colgroup\",\n\t\t\"desc\",\n\t\t\"foreignobject\",\n\t\t\"head\",\n\t\t\"iframe\",\n\t\t\"math\",\n\t\t\"mi\",\n\t\t\"mn\",\n\t\t\"mo\",\n\t\t\"ms\",\n\t\t\"mtext\",\n\t\t\"noembed\",\n\t\t\"noframes\",\n\t\t\"noscript\",\n\t\t\"plaintext\",\n\t\t\"script\",\n\t\t\"selectedcontent\",\n\t\t\"style\",\n\t\t\"svg\",\n\t\t\"template\",\n\t\t\"thead\",\n\t\t\"title\",\n\t\t\"video\",\n\t\t\"xmp\"\n\t]);\n\tlet DATA_URI_TAGS = null;\n\tconst DEFAULT_DATA_URI_TAGS = addToSet({}, [\n\t\t\"audio\",\n\t\t\"video\",\n\t\t\"img\",\n\t\t\"source\",\n\t\t\"image\",\n\t\t\"track\"\n\t]);\n\tlet URI_SAFE_ATTRIBUTES = null;\n\tconst DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n\t\t\"alt\",\n\t\t\"class\",\n\t\t\"for\",\n\t\t\"id\",\n\t\t\"label\",\n\t\t\"name\",\n\t\t\"pattern\",\n\t\t\"placeholder\",\n\t\t\"role\",\n\t\t\"summary\",\n\t\t\"title\",\n\t\t\"value\",\n\t\t\"style\",\n\t\t\"xmlns\"\n\t]);\n\tconst MATHML_NAMESPACE = \"http://www.w3.org/1998/Math/MathML\";\n\tconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\n\tconst HTML_NAMESPACE = \"http://www.w3.org/1999/xhtml\";\n\tlet NAMESPACE = HTML_NAMESPACE;\n\tlet IS_EMPTY_INPUT = false;\n\tlet ALLOWED_NAMESPACES = null;\n\tconst DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [\n\t\tMATHML_NAMESPACE,\n\t\tSVG_NAMESPACE,\n\t\tHTML_NAMESPACE\n\t], stringToString);\n\tconst DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([\n\t\t\"mi\",\n\t\t\"mo\",\n\t\t\"mn\",\n\t\t\"ms\",\n\t\t\"mtext\"\n\t]);\n\tlet MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);\n\tconst DEFAULT_HTML_INTEGRATION_POINTS = freeze([\"annotation-xml\"]);\n\tlet HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);\n\tconst COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n\t\t\"title\",\n\t\t\"style\",\n\t\t\"font\",\n\t\t\"a\",\n\t\t\"script\"\n\t]);\n\tlet PARSER_MEDIA_TYPE = null;\n\tconst SUPPORTED_PARSER_MEDIA_TYPES = [\"application/xhtml+xml\", \"text/html\"];\n\tconst DEFAULT_PARSER_MEDIA_TYPE = \"text/html\";\n\tlet transformCaseFunc = null;\n\tlet CONFIG = null;\n\tconst formElement = document.createElement(\"form\");\n\tconst isRegexOrFunction = function isRegexOrFunction(testValue) {\n\t\treturn testValue instanceof RegExp || testValue instanceof Function;\n\t};\n\t/**\n\t* _parseConfig\n\t*\n\t* @param cfg optional config literal\n\t*/\n\tconst _parseConfig = function _parseConfig() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tif (CONFIG && CONFIG === cfg) return;\n\t\tif (!cfg || typeof cfg !== \"object\") cfg = {};\n\t\tcfg = clone(cfg);\n\t\tPARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\t\ttransformCaseFunc = PARSER_MEDIA_TYPE === \"application/xhtml+xml\" ? stringToString : stringToLowerCase;\n\t\tALLOWED_TAGS = _resolveSetOption(cfg, \"ALLOWED_TAGS\", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });\n\t\tALLOWED_ATTR = _resolveSetOption(cfg, \"ALLOWED_ATTR\", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });\n\t\tALLOWED_NAMESPACES = _resolveSetOption(cfg, \"ALLOWED_NAMESPACES\", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });\n\t\tURI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, \"ADD_URI_SAFE_ATTR\", DEFAULT_URI_SAFE_ATTRIBUTES, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_URI_SAFE_ATTRIBUTES\n\t\t});\n\t\tDATA_URI_TAGS = _resolveSetOption(cfg, \"ADD_DATA_URI_TAGS\", DEFAULT_DATA_URI_TAGS, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_DATA_URI_TAGS\n\t\t});\n\t\tFORBID_CONTENTS = _resolveSetOption(cfg, \"FORBID_CONTENTS\", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });\n\t\tFORBID_TAGS = _resolveSetOption(cfg, \"FORBID_TAGS\", clone({}), { transform: transformCaseFunc });\n\t\tFORBID_ATTR = _resolveSetOption(cfg, \"FORBID_ATTR\", clone({}), { transform: transformCaseFunc });\n\t\tUSE_PROFILES = objectHasOwnProperty(cfg, \"USE_PROFILES\") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === \"object\" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;\n\t\tALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;\n\t\tALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;\n\t\tALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;\n\t\tALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;\n\t\tSAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;\n\t\tSAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;\n\t\tWHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;\n\t\tRETURN_DOM = cfg.RETURN_DOM || false;\n\t\tRETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;\n\t\tRETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;\n\t\tFORCE_BODY = cfg.FORCE_BODY || false;\n\t\tSANITIZE_DOM = cfg.SANITIZE_DOM !== false;\n\t\tSANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;\n\t\tKEEP_CONTENT = cfg.KEEP_CONTENT !== false;\n\t\tIN_PLACE = cfg.IN_PLACE || false;\n\t\tIS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;\n\t\tNAMESPACE = typeof cfg.NAMESPACE === \"string\" ? cfg.NAMESPACE : HTML_NAMESPACE;\n\t\tMATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"MATHML_TEXT_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));\n\t\tHTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"HTML_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));\n\t\tconst customElementHandling = _resolveObjectOption(cfg, \"CUSTOM_ELEMENT_HANDLING\", () => create(null));\n\t\tCUSTOM_ELEMENT_HANDLING = create(null);\n\t\tif (objectHasOwnProperty(customElementHandling, \"tagNameCheck\") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"attributeNameCheck\") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"allowCustomizedBuiltInElements\") && typeof customElementHandling.allowCustomizedBuiltInElements === \"boolean\") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;\n\t\tseal(CUSTOM_ELEMENT_HANDLING);\n\t\tif (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;\n\t\tif (RETURN_DOM_FRAGMENT) RETURN_DOM = true;\n\t\tif (USE_PROFILES) {\n\t\t\tALLOWED_TAGS = addToSet({}, text);\n\t\t\tALLOWED_ATTR = create(null);\n\t\t\tif (USE_PROFILES.html === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, html$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, html);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svg === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svg$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svgFilters === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svgFilters);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.mathMl === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, mathMl$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, mathMl);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t}\n\t\tEXTRA_ELEMENT_HANDLING.tagCheck = null;\n\t\tEXTRA_ELEMENT_HANDLING.attributeCheck = null;\n\t\tif (objectHasOwnProperty(cfg, \"ADD_TAGS\")) {\n\t\t\tif (typeof cfg.ADD_TAGS === \"function\") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n\t\t\telse if (arrayIsArray(cfg.ADD_TAGS)) {\n\t\t\t\tif (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\t\t\taddToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_ATTR\")) {\n\t\t\tif (typeof cfg.ADD_ATTR === \"function\") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n\t\t\telse if (arrayIsArray(cfg.ADD_ATTR)) {\n\t\t\t\tif (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\t\t\taddToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_FORBID_CONTENTS\") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {\n\t\t\tif (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);\n\t\t\taddToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n\t\t}\n\t\tif (KEEP_CONTENT) ALLOWED_TAGS[\"#text\"] = true;\n\t\tif (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [\n\t\t\t\"html\",\n\t\t\t\"head\",\n\t\t\t\"body\"\n\t\t]);\n\t\tif (ALLOWED_TAGS.table) {\n\t\t\taddToSet(ALLOWED_TAGS, [\"tbody\"]);\n\t\t\tdelete FORBID_TAGS.tbody;\n\t\t}\n\t\tif (cfg.TRUSTED_TYPES_POLICY) {\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createHTML\\\" hook.\");\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createScriptURL\\\" hook.\");\n\t\t\tconst previousTrustedTypesPolicy = trustedTypesPolicy;\n\t\t\ttrustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\t\t\ttry {\n\t\t\t\temptyHTML = _createTrustedHTML(\"\");\n\t\t\t} catch (error) {\n\t\t\t\ttrustedTypesPolicy = previousTrustedTypesPolicy;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} else if (cfg.TRUSTED_TYPES_POLICY === null) {\n\t\t\ttrustedTypesPolicy = void 0;\n\t\t\temptyHTML = \"\";\n\t\t} else {\n\t\t\tif (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();\n\t\t\tif (trustedTypesPolicy && typeof emptyHTML === \"string\") emptyHTML = _createTrustedHTML(\"\");\n\t\t}\n\t\tif (freeze) freeze(cfg);\n\t\tCONFIG = cfg;\n\t};\n\tconst ALL_SVG_TAGS = addToSet({}, [\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...svgDisallowed\n\t]);\n\tconst ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\t/**\n\t* Namespace rules for an element in the SVG namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"svg\";\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE) return tagName === \"svg\" && (parentTagName === \"annotation-xml\" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n\t\treturn Boolean(ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the MathML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"math\";\n\t\tif (parent.namespaceURI === SVG_NAMESPACE) return tagName === \"math\" && HTML_INTEGRATION_POINTS[parentTagName];\n\t\treturn Boolean(ALL_MATHML_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the HTML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;\n\t\treturn !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* @param element a DOM element whose namespace is being checked\n\t* @returns Return false if the element has a\n\t* namespace that a spec-compliant parser would never\n\t* return. Return true otherwise.\n\t*/\n\tconst _checkValidNamespace = function _checkValidNamespace(element) {\n\t\tconst elementNamespace = _readNamespaceURI(element);\n\t\tconst tagName = stringToLowerCase(_readNodeName(element));\n\t\tconst parentNode = getParentNode(element);\n\t\tlet parent;\n\t\tlet parentTagName;\n\t\tif (parentNode && _readNodeType(parentNode) === NODE_TYPE.element) {\n\t\t\tparent = { namespaceURI: _readNamespaceURI(parentNode) };\n\t\t\tparentTagName = stringToLowerCase(_readNodeName(parentNode));\n\t\t} else {\n\t\t\tparent = { namespaceURI: NAMESPACE };\n\t\t\tparentTagName = \"template\";\n\t\t}\n\t\tif (!ALLOWED_NAMESPACES[elementNamespace]) return false;\n\t\tif (elementNamespace === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);\n\t\tif (elementNamespace === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);\n\t\tif (elementNamespace === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && ALLOWED_NAMESPACES[elementNamespace]) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* _forceRemove\n\t*\n\t* @param node a DOM node\n\t*/\n\tconst _forceRemove = function _forceRemove(node) {\n\t\tarrayPush(DOMPurify.removed, { element: node });\n\t\ttry {\n\t\t\tgetParentNode(node).removeChild(node);\n\t\t} catch (_) {\n\t\t\tremove(node);\n\t\t\tif (!getParentNode(node)) throw typeErrorCreate(\"a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place\");\n\t\t}\n\t};\n\t/**\n\t* _stripAttributeNode\n\t*\n\t* Remove a single Attr node case/namespace-exactly on an attribute-teardown\n\t* path. Name-based removeAttribute() ASCII-lowercases its lookup key for an\n\t* HTML element in an HTML document and so silently misses a case-preserved\n\t* handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect\n\t* _removeAttribute() was fixed for, which a name-based call would reintroduce\n\t* on these IN_PLACE teardown paths. Unlike _removeAttribute this does not\n\t* record into DOMPurify.removed: the neutralize passes intentionally do not\n\t* book-keep. A clobbered/detached node falls back to best-effort name-based\n\t* removal.\n\t*\n\t* @param element the element to strip the attribute from\n\t* @param attribute the Attr node to remove\n\t* @param name the attribute's name, for the fallback path\n\t*/\n\tconst _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {\n\t\ttry {\n\t\t\tremoveAttributeNode(element, attribute);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* Fail-closed teardown of an in-place root: strip every disallowed attribute\n\t* in the subtree first, so nothing armed is left behind, then remove all\n\t* children and the root's own attributes.\n\t*\n\t* @param root the in-place root to empty\n\t*/\n\tconst _neutralizeRoot = function _neutralizeRoot(root) {\n\t\t_neutralizeSubtree(root);\n\t\tconst childNodes = getChildNodes(root);\n\t\tif (childNodes) arrayForEach(arraySlice(childNodes), (child) => {\n\t\t\ttry {\n\t\t\t\tremove(child);\n\t\t\t} catch (_) {}\n\t\t});\n\t\tconst attributes = _readNodeType(root) === NODE_TYPE.element ? getAttributes(root) : null;\n\t\tif (attributes) for (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name === \"string\") _stripAttributeNode(root, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* Removes an attribute, preferably as its exact Attr node: name-based\n\t* removal lowercases the name in HTML documents and misses case-preserved\n\t* names, e.g. from imported XHTML.\n\t*\n\t* @param name an Attribute name\n\t* @param element a DOM node\n\t* @param attr the exact Attr node to remove, when the caller has it\n\t*/\n\tconst _removeAttribute = function _removeAttribute(name, element, attr) {\n\t\tif (!attr) try {\n\t\t\tattr = element.getAttributeNode(name);\n\t\t} catch (_) {\n\t\t\tattr = null;\n\t\t}\n\t\tarrayPush(DOMPurify.removed, {\n\t\t\tattribute: attr || null,\n\t\t\tfrom: element\n\t\t});\n\t\ttry {\n\t\t\tif (attr) removeAttributeNode(element, attr);\n\t\t\telse element.removeAttribute(name);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t\tif (name === \"is\") {\n\t\t\tif (RETURN_DOM || RETURN_DOM_FRAGMENT) try {\n\t\t\t\t_forceRemove(element);\n\t\t\t} catch (_) {}\n\t\t\telse try {\n\t\t\t\telement.setAttribute(name, \"\");\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* Removes every attribute the configuration does not allow. Used to\n\t* neutralize nodes discarded from an in-place tree.\n\t*\n\t* @param element the element to strip\n\t*/\n\tconst _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {\n\t\tconst attributes = getAttributes(element);\n\t\tif (!attributes) return;\n\t\tfor (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name !== \"string\" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;\n\t\t\t_stripAttributeNode(element, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* Iterative depth-first walk, so deep trees cannot overflow the call stack,\n\t* reading through the cached getters, so clobbering cannot hide children.\n\t* When `visit` returns false, the node's children are skipped. With\n\t* `intoShadow`, open shadow roots are walked after their host's children.\n\t*\n\t* @param root where to start\n\t* @param visit called for every node\n\t* @param intoShadow whether to enter open shadow roots\n\t*/\n\tconst _walkTree = function _walkTree(root, visit) {\n\t\tlet intoShadow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\t\tconst stack = [root];\n\t\twhile (stack.length > 0) {\n\t\t\tconst node = stack.pop();\n\t\t\tif (visit(node) === false) continue;\n\t\t\tif (intoShadow && _readNodeType(node) === NODE_TYPE.element) {\n\t\t\t\tconst shadowRoot = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(shadowRoot)) stack.push(shadowRoot);\n\t\t\t}\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);\n\t\t}\n\t};\n\t/**\n\t* Strips disallowed attributes from every element of a discarded subtree,\n\t* so a handler that is already queued (a loading image) cannot fire.\n\t*\n\t* @param root the root of a removed subtree\n\t*/\n\tconst _neutralizeSubtree = function _neutralizeSubtree(root) {\n\t\t_walkTree(root, (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);\n\t\t});\n\t};\n\t/**\n\t* All nodes under `root`, root first, including open shadow roots. Template\n\t* content is not entered, it is inert.\n\t*\n\t* @param root the in-place root\n\t* @return the nodes\n\t*/\n\tconst _collectLiveNodes = function _collectLiveNodes(root) {\n\t\tconst nodes = [];\n\t\t_walkTree(root, (node) => {\n\t\t\tnodes.push(node);\n\t\t}, true);\n\t\treturn nodes;\n\t};\n\t/**\n\t* Strips disallowed attributes from every element that was under the\n\t* in-place root when the call started and no longer is, whatever removed\n\t* or moved it.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t*/\n\tconst _neutralizeEscapedElements = function _neutralizeEscapedElements(root, before) {\n\t\tconst reachable = setCreate();\n\t\tarrayForEach(_collectLiveNodes(root), (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) setAdd(reachable, node);\n\t\t});\n\t\tarrayForEach(before, (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element && !setHas(reachable, node)) _stripDisallowedAttributes(node);\n\t\t});\n\t};\n\t/**\n\t* Neutralizes everything that left the in-place tree during the call: what\n\t* DOMPurify removed, and what hooks or custom elements removed or moved out.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t* @return true if the root itself was removed\n\t*/\n\tconst _neutralizeDiscarded = function _neutralizeDiscarded(root, before) {\n\t\tlet rootRemoved = false;\n\t\tarrayForEach(DOMPurify.removed, (entry) => {\n\t\t\tif (entry.element) {\n\t\t\t\trootRemoved = rootRemoved || entry.element === root;\n\t\t\t\t_neutralizeSubtree(entry.element);\n\t\t\t}\n\t\t});\n\t\t_neutralizeEscapedElements(root, before);\n\t\treturn rootRemoved;\n\t};\n\tconst MAX_UNVISITED_ROUNDS = 8;\n\t/**\n\t* The walk only moves forward, so a node moved to a position it already\n\t* passed is never visited. Give every original node that is still in the\n\t* tree but unvisited the normal treatment, hooks included. Nodes created\n\t* during the call are left alone. Fails closed if the tree keeps changing.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t*/\n\tconst _sanitizeUnvisitedNodes = function _sanitizeUnvisitedNodes(root, before) {\n\t\tconst visited = IN_PLACE_VISITED;\n\t\tlet original = null;\n\t\tconst getOriginal = () => {\n\t\t\tif (!original) {\n\t\t\t\toriginal = setCreate();\n\t\t\t\tarrayForEach(before, (beforeNode) => {\n\t\t\t\t\tsetAdd(original, beforeNode);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn original;\n\t\t};\n\t\tfor (let round = 0;; round++) {\n\t\t\tconst live = _collectLiveNodes(root);\n\t\t\tconst containers = [root];\n\t\t\tlet pending = false;\n\t\t\tarrayForEach(live, (node) => {\n\t\t\t\tif (_readNodeType(node) === NODE_TYPE.documentFragment) arrayPush(containers, node);\n\t\t\t\telse if (!pending && !setHas(visited, node)) pending = setHas(getOriginal(), node);\n\t\t\t});\n\t\t\tif (!pending) return;\n\t\t\tif (round >= MAX_UNVISITED_ROUNDS) throw typeErrorCreate(\"the tree kept changing during in-place sanitization; refusing to return it\");\n\t\t\tarrayForEach(containers, (container, index) => {\n\t\t\t\t_sanitizeUnvisitedIn(container, index > 0, root, getOriginal());\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* One _sanitizeUnvisitedNodes pass over the root or an open shadow root.\n\t*\n\t* @param container the root or an open shadow root\n\t* @param inShadow whether container is a shadow root\n\t* @param root the in-place root\n\t* @param original the root's nodes collected before the walk, as a set\n\t*/\n\tconst _sanitizeUnvisitedIn = function _sanitizeUnvisitedIn(container, inShadow, root, original) {\n\t\tconst iterator = _createNodeIterator(container);\n\t\tlet node;\n\t\twhile (node = iterator.nextNode()) {\n\t\t\tif (!setHas(original, node) || setHas(IN_PLACE_VISITED, node)) continue;\n\t\t\tif (inShadow) _executeHooks(hooks.uponSanitizeShadowNode, node, null);\n\t\t\t_sanitizeElements(node, root);\n\t\t\t_sanitizeAttributes(node, root);\n\t\t\tif (_isDocumentFragment(node.content)) _sanitizeShadowDOM2(node.content);\n\t\t}\n\t};\n\t/**\n\t* Records that _sanitizeElements processed `node`. No-op outside IN_PLACE.\n\t*\n\t* @param node the node being processed\n\t*/\n\tconst _markVisited = function _markVisited(node) {\n\t\tif (IN_PLACE_VISITED) setAdd(IN_PLACE_VISITED, node);\n\t};\n\t/**\n\t* Patch-linkage attributes (declarative partial updates): `patchsrc`\n\t* always, `for` everywhere except on <label> and <output>. Gated on\n\t* SAFE_FOR_XML. Shared by the IN_PLACE pre-pass and _isValidAttribute.\n\t*\n\t* @param lcName the transformCaseFunc'd attribute name\n\t* @param lcTag the transformCaseFunc'd tag name of the carrying element\n\t* @return true if the attribute is patch linkage and must be dropped\n\t*/\n\tconst _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {\n\t\tif (!SAFE_FOR_XML) return false;\n\t\tif (lcName === \"patchsrc\") return true;\n\t\treturn lcName === \"for\" && lcTag !== \"label\" && lcTag !== \"output\";\n\t};\n\t/**\n\t* IN_PLACE pre-pass: sever all patch linkage before the walk, so no patch\n\t* can fire mid-walk into a part of the tree the walker already passed.\n\t* Removes range markers (processing instructions, comments with markup)\n\t* and strips linkage attributes. It cannot undo a patch that already fired.\n\t*\n\t* TODO: if the shipped feature can patch through `for` on <label>/<output>,\n\t* drop that pair here too (see test/declarative-patch-probe.html).\n\t*\n\t* @param root the in-place root to sweep\n\t*/\n\tconst _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {\n\t\tif (!SAFE_FOR_XML) return;\n\t\t_walkTree(root, (node) => {\n\t\t\tconst nodeType = _readNodeType(node);\n\t\t\tif (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {\n\t\t\t\ttry {\n\t\t\t\t\tremove(node);\n\t\t\t\t} catch (_) {}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (nodeType === NODE_TYPE.element) {\n\t\t\t\tconst element = node;\n\t\t\t\tconst lcTag = transformCaseFunc(_readNodeName(node));\n\t\t\t\ttry {\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"patchsrc\")) element.removeAttribute(\"patchsrc\");\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"for\") && _isPatchLinkageAttribute(\"for\", lcTag)) element.removeAttribute(\"for\");\n\t\t\t\t} catch (_) {}\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* _initDocument\n\t*\n\t* @param dirty - a string of dirty markup\n\t* @return a DOM, filled with the dirty markup\n\t*/\n\tconst _initDocument = function _initDocument(dirty) {\n\t\tlet doc = null;\n\t\tlet leadingWhitespace = null;\n\t\tif (FORCE_BODY) dirty = \"<remove></remove>\" + dirty;\n\t\telse {\n\t\t\tconst matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n\t\t\tleadingWhitespace = matches && matches[0];\n\t\t}\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && NAMESPACE === HTML_NAMESPACE) dirty = \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\"><head></head><body>\" + dirty + \"</body></html>\";\n\t\tconst dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;\n\t\tif (NAMESPACE === HTML_NAMESPACE) try {\n\t\t\tdoc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n\t\t} catch (_) {}\n\t\tif (!doc || !doc.documentElement) {\n\t\t\tdoc = implementation.createDocument(NAMESPACE, \"template\", null);\n\t\t\ttry {\n\t\t\t\tdoc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n\t\t\t} catch (_) {}\n\t\t}\n\t\tconst body = doc.body || doc.documentElement;\n\t\tif (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n\t\tif (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? \"html\" : \"body\")[0];\n\t\treturn WHOLE_DOCUMENT ? doc.documentElement : body;\n\t};\n\t/**\n\t* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n\t*\n\t* @param root The root element or node to start traversing on.\n\t* @return The created NodeIterator\n\t*/\n\tconst _createNodeIterator = function _createNodeIterator(root) {\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;\n\t\treturn createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n\t};\n\t/**\n\t* Replace template expression syntax (mustache, ERB, template\n\t* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub\n\t* sites. Order matters: mustache, then ERB, then template literal.\n\t*\n\t* @param value the string to scrub\n\t* @returns the scrubbed string\n\t*/\n\tconst _stripTemplateExpressions = function _stripTemplateExpressions(value) {\n\t\tvalue = stringReplace(value, MUSTACHE_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, ERB_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, TMPLIT_EXPR$1, \" \");\n\t\treturn value;\n\t};\n\t/**\n\t* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the\n\t* character data of an element subtree. Used as the final safety net for\n\t* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions\n\t* which only form after text-node normalization (e.g. fragments split across\n\t* stripped elements) cannot survive into a template-evaluating framework.\n\t*\n\t* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`\n\t* in place rather than round-tripping through innerHTML. This preserves\n\t* descendant node references (important for IN_PLACE callers), avoids a\n\t* serialize/reparse cycle, and reads literal character data — which means\n\t* `<%...%>` in text content matches the ERB regex against its real bytes\n\t* instead of the HTML-entity-escaped form innerHTML would produce.\n\t*\n\t* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for\n\t* attributes is performed during the per-node `_sanitizeAttributes` pass.\n\t*\n\t* @param node The root element whose character data should be scrubbed.\n\t*/\n\tconst _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {\n\t\tvar _node$querySelectorAl;\n\t\t_scrubOwnCharacterData(node);\n\t\tconst templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, \"template\");\n\t\tif (templates) arrayForEach(templates, (tmpl) => {\n\t\t\tif (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);\n\t\t});\n\t};\n\t/**\n\t* _scrubOwnCharacterData\n\t*\n\t* Non-recursive core of _scrubTemplateExpressions: normalize `node` and\n\t* strip template expressions from its own character data only. Does not\n\t* enter <template>.content or attached shadow roots (NodeIterator never\n\t* does). Used by _sanitizeShadowDOM, where every nested template content\n\t* and shadow root is already walked - and therefore scrubbed - by its own\n\t* recursive _sanitizeShadowDOM call; recursing here as well would rescrub\n\t* each nested fragment once per ancestor, which is quadratic in nesting\n\t* depth.\n\t*\n\t* @param node The root whose own character data should be scrubbed.\n\t*/\n\tconst _scrubOwnCharacterData = function _scrubOwnCharacterData(node) {\n\t\tnode.normalize();\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;\n\t\tconst walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);\n\t\tlet currentNode = walker.nextNode();\n\t\twhile (currentNode) {\n\t\t\tcurrentNode.data = _stripTemplateExpressions(currentNode.data);\n\t\t\tcurrentNode = walker.nextNode();\n\t\t}\n\t};\n\t/**\n\t* _isClobbered\n\t*\n\t* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML\n\t* interface with [LegacyOverrideBuiltIns]; a descendant element with a\n\t* `name` attribute matching a prototype property shadows that property\n\t* on direct reads. We use this check at the IN_PLACE entry-point and\n\t* during attribute sanitization to refuse clobbered forms.\n\t*\n\t* @param element element to check for clobbering attacks\n\t* @return true if clobbered, false if safe\n\t*/\n\tconst _isClobbered = function _isClobbered(element) {\n\t\tconst realTagName = getNodeName ? getNodeName(element) : null;\n\t\tif (typeof realTagName !== \"string\") return false;\n\t\tif (transformCaseFunc(realTagName) !== \"form\") return false;\n\t\treturn typeof element.nodeName !== \"string\" || typeof element.textContent !== \"string\" || typeof element.removeChild !== \"function\" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== \"function\" || typeof element.removeAttributeNode !== \"function\" || typeof element.getAttributeNode !== \"function\" || typeof element.setAttribute !== \"function\" || typeof element.namespaceURI !== \"string\" || typeof element.insertBefore !== \"function\" || typeof element.hasChildNodes !== \"function\" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);\n\t};\n\t/**\n\t* Checks whether the given value is a DocumentFragment from any realm.\n\t*\n\t* The realm-independent replacement reads `nodeType` through the cached\n\t* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE\n\t* constant (11). nodeType is a numeric value resolved from the node's\n\t* internal slot, identical across realms for the same kind of node.\n\t*\n\t* @param value object to check\n\t* @return true if value is a DocumentFragment-shaped node from any realm\n\t*/\n\tconst _isDocumentFragment = function _isDocumentFragment(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn getNodeType(value) === NODE_TYPE.documentFragment;\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* Checks whether the given object is a DOM node, including nodes that\n\t* originate from a different window/realm (e.g. an iframe's\n\t* contentDocument). The previous `value instanceof Node` check was\n\t* realm-bound: nodes from a different window failed it, causing\n\t* sanitize() to silently stringify them and reset IN_PLACE to false,\n\t* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.\n\t*\n\t* @param value object to check whether it's a DOM node\n\t* @return true if value is a DOM node from any realm\n\t*/\n\tconst _isNode = function _isNode(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn typeof getNodeType(value) === \"number\";\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\tfunction _executeHooks(hooks, currentNode, data) {\n\t\tif (hooks.length === 0) return;\n\t\tarrayForEach(hooks, (hook) => {\n\t\t\thook.call(DOMPurify, currentNode, data, CONFIG);\n\t\t});\n\t}\n\t/**\n\t* Structural-threat checks that condemn a node regardless of the\n\t* allowlists: mXSS via namespace confusion, risky CSS construction,\n\t* processing instructions, markup-bearing comments. Pure predicate;\n\t* the caller removes. Check order is load-bearing.\n\t*\n\t* @param currentNode the node to inspect\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node must be removed\n\t*/\n\tconst _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {\n\t\tif (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;\n\t\tif (SAFE_FOR_XML && LITERAL_TEXT_ELEMENTS[tagName] && _readNodeType(currentNode) === NODE_TYPE.element && _readNamespaceURI(currentNode) === HTML_NAMESPACE && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === \"string\" && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent))) return true;\n\t\tif (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;\n\t\tif (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate\n\t* function, per the validation in _parseConfig) against a name.\n\t* Additional arguments are forwarded to predicate functions - the\n\t* attributeNameCheck predicate receives the tag name as its second\n\t* argument. A null/absent check never matches.\n\t*\n\t* @param check the configured tagNameCheck / attributeNameCheck value\n\t* @param name the name to test\n\t* @param args extra arguments forwarded to a predicate function\n\t* @return true if the check matches the name\n\t*/\n\tconst _matchesNameCheck = function _matchesNameCheck(check, name) {\n\t\tif (check instanceof RegExp) return regExpTest(check, name);\n\t\tif (check instanceof Function) {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\t\t\treturn Boolean(check(name, ...args));\n\t\t}\n\t\treturn false;\n\t};\n\t/**\n\t* Handle a node whose tag is forbidden or not allowlisted: keep\n\t* allowed custom elements (false return exits _sanitizeElements\n\t* early - the namespace and fallback-tag removal checks are\n\t* intentionally skipped for kept custom elements), else hoist\n\t* content per KEEP_CONTENT and remove.\n\t*\n\t* A kept custom element is the ONLY case in which this function\n\t* returns false, so the caller uses that return value to run the\n\t* afterSanitizeElements hook on the kept element and keep the\n\t* element-hook lifecycle consistent with normal allowlisted\n\t* elements (GHSA-c2j3-45gr-mqc4).\n\t*\n\t* @param currentNode the disallowed node\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node was removed, false if kept\n\t*/\n\tconst _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {\n\t\tif (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;\n\t\tif (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && !FORBID_CONTENTS[stringToLowerCase(tagName)]) {\n\t\t\tconst parentNode = getParentNode(currentNode);\n\t\t\tconst childNodes = getChildNodes(currentNode);\n\t\t\tif (childNodes && parentNode) {\n\t\t\t\tconst childCount = childNodes.length;\n\t\t\t\tfor (let i = childCount - 1; i >= 0; --i) {\n\t\t\t\t\tconst hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];\n\t\t\t\t\tparentNode.insertBefore(hoisted, getNextSibling(currentNode));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_forceRemove(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* Fork a hook-mutable allowlist off its shared binding the first time a\n\t* (possibly lazily-installed) uponSanitize* hook is about to see it, so the\n\t* hook cannot widen the per-instance default or the setConfig binding by\n\t* reference and leak past the call. Returns the set unchanged once it is\n\t* already call-local, so repeated calls across elements are idempotent.\n\t*\n\t* @param hookList the uponSanitize* hook array for this event\n\t* @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding\n\t* @param defaultSet the per-instance DEFAULT_ALLOWED_* constant\n\t* @param setConfigSet the captured setConfig() binding, or null\n\t* @return a call-local clone if a hook is present and set is still shared,\n\t* else set unchanged\n\t*/\n\tconst _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {\n\t\tif (hookList.length === 0) return set;\n\t\treturn set === defaultSet || set === setConfigSet ? clone(set) : set;\n\t};\n\t/**\n\t* A hook may have detached the node it was called for. If so, treat it as\n\t* removed and stop processing it; the walk root is exempt. On the IN_PLACE\n\t* path the detached subtree is neutralized right away.\n\t*\n\t* @param currentNode the node a hook may have detached\n\t* @param root the current walk root\n\t* @return true if the node was detached\n\t*/\n\tconst _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {\n\t\tif (currentNode === root || getParentNode(currentNode) !== null) return false;\n\t\tif (IN_PLACE) _neutralizeSubtree(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* _sanitizeElements\n\t*\n\t* @protect nodeName\n\t* @protect textContent\n\t* @protect removeChild\n\t* @param currentNode to check for permission to exist\n\t* @return true if node was killed, false if left alive\n\t*/\n\tconst _sanitizeElements = function _sanitizeElements(currentNode, root) {\n\t\t_markVisited(currentNode);\n\t\t_executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isClobbered(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tconst tagName = transformCaseFunc(_readNodeName(currentNode));\n\t\tALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);\n\t\t_executeHooks(hooks.uponSanitizeElement, currentNode, {\n\t\t\ttagName,\n\t\t\tallowedTags: ALLOWED_TAGS\n\t\t});\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isUnsafeNode(currentNode, tagName)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {\n\t\t\tconst removed = _sanitizeDisallowedNode(currentNode, tagName, root);\n\t\t\tif (removed === false) {\n\t\t\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\t\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\t\t}\n\t\t\treturn removed;\n\t\t}\n\t\tif (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif ((tagName === \"noscript\" || tagName === \"noembed\" || tagName === \"noframes\") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n\t\t\tconst content = _stripTemplateExpressions(currentNode.textContent);\n\t\t\tif (currentNode.textContent !== content) {\n\t\t\t\tarrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n\t\t\t\tcurrentNode.textContent = content;\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\treturn _handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _isValidAttribute\n\t*\n\t* @param lcTag Lowercase tag name of containing element.\n\t* @param lcName Lowercase attribute name.\n\t* @param value Attribute value.\n\t* @return Returns true if `value` is valid, otherwise false.\n\t*/\n\tconst _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n\t\tif (FORBID_ATTR[lcName]) return false;\n\t\tif (_isPatchLinkageAttribute(lcName, lcTag)) return false;\n\t\tif (SANITIZE_DOM && (lcName === \"id\" || lcName === \"name\") && (value in document || value in formElement)) return false;\n\t\tconst nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);\n\t\tif (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;\n\t\tif (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;\n\t\tif (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === \"is\" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value);\n\t\tif (URI_SAFE_ATTRIBUTES[lcName]) return true;\n\t\tif (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\tif ((lcName === \"src\" || lcName === \"xlink:href\" || lcName === \"href\") && lcTag !== \"script\" && stringIndexOf(value, \"data:\") === 0 && DATA_URI_TAGS[lcTag]) return true;\n\t\tif (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\treturn !value;\n\t};\n\tconst RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"color-profile\",\n\t\t\"font-face\",\n\t\t\"font-face-format\",\n\t\t\"font-face-name\",\n\t\t\"font-face-src\",\n\t\t\"font-face-uri\",\n\t\t\"missing-glyph\"\n\t]);\n\t/**\n\t* _isBasicCustomElement\n\t* checks if at least one dash is included in tagName, and it's not the first char\n\t* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n\t*\n\t* @param tagName name of the tag of the node to sanitize\n\t* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n\t*/\n\tconst _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n\t\treturn !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);\n\t};\n\t/**\n\t* Wrap an attribute value in the matching Trusted Types object when\n\t* the active policy requires it. Namespaced attributes pass through\n\t* unchanged (no TT support yet, see\n\t* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).\n\t*\n\t* @param lcTag lowercase tag name of the containing element\n\t* @param lcName lowercase attribute name\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the attribute value to wrap\n\t* @return the value, wrapped when Trusted Types demand it\n\t*/\n\tconst _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {\n\t\tif (trustedTypesPolicy && typeof trustedTypes === \"object\" && typeof trustedTypes.getAttributeType === \"function\" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n\t\t\tcase \"TrustedHTML\": return _createTrustedHTML(value);\n\t\t\tcase \"TrustedScriptURL\": return _createTrustedScriptURL(value);\n\t\t}\n\t\treturn value;\n\t};\n\t/**\n\t* Write a modified attribute value back onto the element. On\n\t* success, re-probe for clobbering introduced by the new value and\n\t* remove the element when found; otherwise, when this writeback is the\n\t* recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the\n\t* removal entry that path recorded so it does not show as removed. On\n\t* failure, remove the attribute instead.\n\t*\n\t* Returns true only on a clean write (the value was set and the new value\n\t* introduced no clobbering). The caller uses that, together with its own\n\t* knowledge of whether this attribute pushed a DOMPurify.removed record, to\n\t* decide whether to pop that record. The pop must happen ONLY for the\n\t* named-prop remove-and-recreate; popping on any other value change (trim,\n\t* template scrubbing, Trusted Types) would consume an unrelated _forceRemove\n\t* subtree-cleanup record and let that detached subtree keep a live event\n\t* handler through the IN_PLACE neutralization pass (SO-001).\n\t*\n\t* @param currentNode the element carrying the attribute\n\t* @param name the attribute name as present on the element\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the new attribute value\n\t* @return true if the value was written without introducing clobbering\n\t*/\n\tconst _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {\n\t\ttry {\n\t\t\tif (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);\n\t\t\telse currentNode.setAttribute(name, value);\n\t\t\tif (_isClobbered(currentNode)) {\n\t\t\t\t_forceRemove(currentNode);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (_) {\n\t\t\t_removeAttribute(name, currentNode);\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* _isUnsafeAttributeValue\n\t*\n\t* Value-based attribute checks that the attribute walk applies before any\n\t* hook can force-keep an attribute, shared with the public\n\t* isValidAttribute() so that it never approves a value sanitize() would\n\t* strip.\n\t*\n\t* @param name the attribute name as found on the node (case preserved)\n\t* @param value the attribute value\n\t* @returns true if the attribute must be removed because of its value\n\t*/\n\tconst _isUnsafeAttributeValue = function _isUnsafeAttributeValue(name, value) {\n\t\tif (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) return true;\n\t\treturn stringToLowerCase(name) === \"attributename\" && stringMatch(value, \"href\") !== null;\n\t};\n\t/**\n\t* _sanitizeAttributes\n\t*\n\t* @protect attributes\n\t* @protect nodeName\n\t* @protect removeAttribute\n\t* @protect setAttribute\n\t*\n\t* @param currentNode to sanitize\n\t* @param root the current walk root\n\t*/\n\tconst _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {\n\t\t_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return;\n\t\tconst attributes = currentNode.attributes;\n\t\tif (!attributes || _isClobbered(currentNode)) return;\n\t\tALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);\n\t\tconst hookEvent = {\n\t\t\tattrName: \"\",\n\t\t\tattrValue: \"\",\n\t\t\tkeepAttr: true,\n\t\t\tallowedAttributes: ALLOWED_ATTR,\n\t\t\tforceKeepAttr: void 0\n\t\t};\n\t\tlet l = attributes.length;\n\t\tconst lcTag = transformCaseFunc(currentNode.nodeName);\n\t\twhile (l--) {\n\t\t\tconst attr = attributes[l];\n\t\t\tconst name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;\n\t\t\tconst lcName = transformCaseFunc(name);\n\t\t\tconst initValue = attrValue;\n\t\t\tlet value = name === \"value\" ? initValue : stringTrim(initValue);\n\t\t\tlet recreatedNamedProp = false;\n\t\t\thookEvent.attrName = lcName;\n\t\t\thookEvent.attrValue = value;\n\t\t\thookEvent.keepAttr = true;\n\t\t\thookEvent.forceKeepAttr = void 0;\n\t\t\t_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n\t\t\tvalue = hookEvent.attrValue;\n\t\t\tif (SANITIZE_NAMED_PROPS && (lcName === \"id\" || lcName === \"name\") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tvalue = SANITIZE_NAMED_PROPS_PREFIX + value;\n\t\t\t\trecreatedNamedProp = true;\n\t\t\t}\n\t\t\tif (_isUnsafeAttributeValue(name, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hookEvent.forceKeepAttr) continue;\n\t\t\tif (!hookEvent.keepAttr) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);\n\t\t\tif (!_isValidAttribute(lcTag, lcName, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvalue = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);\n\t\t\tif (value !== initValue) {\n\t\t\t\tif (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n\t\t_handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _sanitizeShadowDOM\n\t*\n\t* @param fragment to iterate over recursively\n\t*/\n\tconst _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {\n\t\tlet shadowNode = null;\n\t\tconst shadowIterator = _createNodeIterator(fragment);\n\t\t_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n\t\twhile (shadowNode = shadowIterator.nextNode()) {\n\t\t\t_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n\t\t\t_sanitizeElements(shadowNode, fragment);\n\t\t\t_sanitizeAttributes(shadowNode, fragment);\n\t\t\tif (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);\n\t\t\tif (_readNodeType(shadowNode) === NODE_TYPE.element) {\n\t\t\t\tconst innerSr = getShadowRoot(shadowNode);\n\t\t\t\tif (_isDocumentFragment(innerSr)) {\n\t\t\t\t\t_sanitizeAttachedShadowRoots(innerSr);\n\t\t\t\t\t_sanitizeShadowDOM2(innerSr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES) _scrubOwnCharacterData(fragment);\n\t\t_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n\t};\n\t/**\n\t* Sanitizes every attached shadow root under `root`, since the node\n\t* iterator does not enter shadow trees. Needed for IN_PLACE input and for\n\t* DOM input whose clonable shadow roots were copied by importNode().\n\t*\n\t* @param root the subtree root to walk for attached shadow roots\n\t*/\n\tconst _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {\n\t\tconst stack = [{\n\t\t\tnode: root,\n\t\t\tshadow: null\n\t\t}];\n\t\twhile (stack.length > 0) {\n\t\t\tconst item = stack.pop();\n\t\t\tif (item.shadow) {\n\t\t\t\t_sanitizeShadowDOM2(item.shadow);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst node = item.node;\n\t\t\tconst isElement = _readNodeType(node) === NODE_TYPE.element;\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({\n\t\t\t\tnode: childNodes[i],\n\t\t\t\tshadow: null\n\t\t\t});\n\t\t\tif (isElement) {\n\t\t\t\tconst rootName = getNodeName ? getNodeName(node) : null;\n\t\t\t\tif (typeof rootName === \"string\" && transformCaseFunc(rootName) === \"template\") {\n\t\t\t\t\tconst content = node.content;\n\t\t\t\t\tif (_isDocumentFragment(content)) stack.push({\n\t\t\t\t\t\tnode: content,\n\t\t\t\t\t\tshadow: null\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isElement) {\n\t\t\t\tconst sr = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(sr)) stack.push({\n\t\t\t\t\tnode: null,\n\t\t\t\t\tshadow: sr\n\t\t\t\t}, {\n\t\t\t\t\tnode: sr,\n\t\t\t\t\tshadow: null\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tDOMPurify.sanitize = function(dirty) {\n\t\tlet cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\t\tlet body = null;\n\t\tlet importedNode = null;\n\t\tlet currentNode = null;\n\t\tlet returnNode = null;\n\t\tIS_EMPTY_INPUT = !dirty;\n\t\tif (IS_EMPTY_INPUT) dirty = \"<!-->\";\n\t\tif (typeof dirty !== \"string\" && !_isNode(dirty)) {\n\t\t\tdirty = stringifyValue(dirty);\n\t\t\tif (typeof dirty !== \"string\") throw typeErrorCreate(\"dirty is not a string, aborting\");\n\t\t}\n\t\tif (!DOMPurify.isSupported) return dirty;\n\t\tif (SET_CONFIG) {\n\t\t\tALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;\n\t\t\tALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;\n\t\t} else _parseConfig(cfg);\n\t\tif (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\tif (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\tDOMPurify.removed = [];\n\t\tconst inPlace = IN_PLACE && typeof dirty !== \"string\" && _isNode(dirty);\n\t\tlet inPlaceNodes = [];\n\t\tconst outerVisited = IN_PLACE_VISITED;\n\t\tif (inPlace) {\n\t\t\t_neutralizePatchLinkage(dirty);\n\t\t\tconst nn = _readNodeName(dirty);\n\t\t\tif (typeof nn === \"string\") {\n\t\t\t\tconst tagName = transformCaseFunc(nn);\n\t\t\t\tif (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n\t\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t\tthrow typeErrorCreate(\"root node is forbidden and cannot be sanitized in-place\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_isClobbered(dirty)) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\tthrow typeErrorCreate(\"root node is clobbered and cannot be sanitized in-place\");\n\t\t\t}\n\t\t\tinPlaceNodes = _collectLiveNodes(dirty);\n\t\t\tIN_PLACE_VISITED = setCreate();\n\t\t} else if (_isNode(dirty)) {\n\t\t\tbody = _initDocument(\"<!---->\");\n\t\t\timportedNode = body.ownerDocument.importNode(dirty, true);\n\t\t\tif (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === \"BODY\") body = importedNode;\n\t\t\telse if (importedNode.nodeName === \"HTML\") body = importedNode;\n\t\t\telse body.appendChild(importedNode);\n\t\t\t_sanitizeAttachedShadowRoots(body);\n\t\t} else {\n\t\t\tif (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf(\"<\") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;\n\t\t\tbody = _initDocument(dirty);\n\t\t\tif (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : \"\";\n\t\t}\n\t\tif (body && FORCE_BODY) _forceRemove(body.firstChild);\n\t\tconst walkRoot = inPlace ? dirty : body;\n\t\ttry {\n\t\t\tif (inPlace) _sanitizeAttachedShadowRoots(dirty);\n\t\t\tconst nodeIterator = _createNodeIterator(walkRoot);\n\t\t\twhile (currentNode = nodeIterator.nextNode()) {\n\t\t\t\t_sanitizeElements(currentNode, walkRoot);\n\t\t\t\t_sanitizeAttributes(currentNode, walkRoot);\n\t\t\t\tif (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);\n\t\t\t}\n\t\t\tif (inPlace) _sanitizeUnvisitedNodes(dirty, inPlaceNodes);\n\t\t} catch (error) {\n\t\t\tif (inPlace) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t_neutralizeDiscarded(dirty, inPlaceNodes);\n\t\t\t}\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tIN_PLACE_VISITED = outerVisited;\n\t\t}\n\t\tif (inPlace) {\n\t\t\tif (_neutralizeDiscarded(dirty, inPlaceNodes)) throw typeErrorCreate(\"a node selected for removal could not be safely returned; refusing to sanitize in place\");\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);\n\t\t\treturn dirty;\n\t\t}\n\t\tif (RETURN_DOM) {\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);\n\t\t\tif (RETURN_DOM_FRAGMENT) {\n\t\t\t\treturnNode = createDocumentFragment.call(body.ownerDocument);\n\t\t\t\twhile (body.firstChild) returnNode.appendChild(body.firstChild);\n\t\t\t} else returnNode = body;\n\t\t\tif (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);\n\t\t\treturn returnNode;\n\t\t}\n\t\tlet serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\t\tif (WHOLE_DOCUMENT && ALLOWED_TAGS[\"!doctype\"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = \"<!DOCTYPE \" + body.ownerDocument.doctype.name + \">\\n\" + serializedHTML;\n\t\tif (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);\n\t\treturn trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;\n\t};\n\tDOMPurify.setConfig = function() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\t_parseConfig(cfg);\n\t\tSET_CONFIG = true;\n\t\tSET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;\n\t\tSET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;\n\t};\n\tDOMPurify.clearConfig = function() {\n\t\tCONFIG = null;\n\t\tSET_CONFIG = false;\n\t\tSET_CONFIG_ALLOWED_TAGS = null;\n\t\tSET_CONFIG_ALLOWED_ATTR = null;\n\t\ttrustedTypesPolicy = defaultTrustedTypesPolicy;\n\t\temptyHTML = \"\";\n\t};\n\tDOMPurify.isValidAttribute = function(tag, attr, value) {\n\t\tif (!CONFIG) _parseConfig({});\n\t\tconst lcTag = transformCaseFunc(tag);\n\t\tconst lcName = transformCaseFunc(attr);\n\t\tif (typeof value === \"string\" && (_isUnsafeAttributeValue(attr, value) || !ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value))) return false;\n\t\treturn _isValidAttribute(lcTag, lcName, value);\n\t};\n\tDOMPurify.addHook = function(entryPoint, hookFunction) {\n\t\tif (typeof hookFunction !== \"function\") return;\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tarrayPush(hooks[entryPoint], hookFunction);\n\t};\n\tDOMPurify.removeHook = function(entryPoint, hookFunction) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tif (hookFunction !== void 0) {\n\t\t\tconst index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n\t\t\treturn index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];\n\t\t}\n\t\treturn arrayPop(hooks[entryPoint]);\n\t};\n\tDOMPurify.removeHooks = function(entryPoint) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\thooks[entryPoint] = [];\n\t};\n\tDOMPurify.removeAllHooks = function() {\n\t\thooks = _createHooksMap();\n\t};\n\treturn DOMPurify;\n}\nvar purify_default = createDOMPurify();\nexport { purify_default as default };\n\n//# sourceMappingURL=purify.es.mjs.map","import createDOMPurify from 'dompurify';\nconst PPTX_CONTENT_STYLE_SCOPE = '.flyfish-pptx-content';\nconst GENERATED_STYLE_RULE = /\\s*(\\._(?:css|svg_css|tbl_cell_css)_[A-Za-z0-9_-]+)\\s*\\{([^{}]*)\\}/y;\nconst purifierByDocument = new WeakMap();\nconst createSafeFallbackFragment = (documentRef) => {\n const fragment = documentRef.createDocumentFragment();\n const fallback = documentRef.createElement('section');\n fallback.className = 'slide flyfish-pptx-slide-error';\n fallback.textContent = 'This slide could not be displayed safely.';\n fragment.append(fallback);\n return fragment;\n};\nconst getPurifier = (documentRef) => {\n const cached = purifierByDocument.get(documentRef);\n if (cached) {\n return cached;\n }\n const windowRef = documentRef.defaultView;\n if (!windowRef) {\n return null;\n }\n const purifier = createDOMPurify(windowRef);\n if (!purifier.isSupported) {\n return null;\n }\n purifierByDocument.set(documentRef, purifier);\n return purifier;\n};\nconst isAllowedCssUrl = (value) => {\n const target = value\n .trim()\n .replace(/^(?:\"([\\s\\S]*)\"|'([\\s\\S]*)')$/, '$1$2')\n .trim();\n if (/^#[A-Za-z0-9_.:-]+$/.test(target)) {\n return true;\n }\n return /^data:image\\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=\\s]+$/i.test(target);\n};\nconst isSafeEmbeddedResourceUrl = (value, allowFragment) => {\n const normalized = value.trim();\n if (allowFragment && /^#[A-Za-z0-9_.:-]+$/.test(normalized)) {\n return true;\n }\n if (/^blob:/i.test(normalized)) {\n return true;\n }\n return /^data:image\\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=\\s]+$/i.test(normalized);\n};\nconst isSafeCssValue = (value) => {\n const normalized = value.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').trim();\n if (/(?:expression|image(?:-set)?|paint|var)\\s*\\(/i.test(normalized) ||\n /(?:javascript|vbscript)\\s*:/i.test(normalized) ||\n /(?:^|[^-])behavior\\s*:/i.test(normalized) ||\n /-moz-binding/i.test(normalized) ||\n normalized.includes('\\\\')) {\n return false;\n }\n let unsafeUrl = false;\n const withoutUrls = normalized.replace(/url\\(\\s*([^)]*?)\\s*\\)/gi, (_match, target) => {\n if (!isAllowedCssUrl(target)) {\n unsafeUrl = true;\n }\n return '';\n });\n return !unsafeUrl && !/url\\s*\\(/i.test(withoutUrls);\n};\nconst sanitizeStyleDeclaration = (documentRef, cssText) => {\n const probe = documentRef.createElement('span');\n probe.setAttribute('style', cssText);\n const style = probe.style;\n const propertyNames = Array.from({ length: style.length }, (_, index) => style.item(index));\n for (const propertyName of propertyNames) {\n const value = style.getPropertyValue(propertyName);\n if (!propertyName ||\n propertyName.startsWith('--') ||\n propertyName === 'behavior' ||\n propertyName === '-moz-binding' ||\n (propertyName === 'position' && /^(?:fixed|sticky)$/i.test(value.trim())) ||\n !isSafeCssValue(value)) {\n style.removeProperty(propertyName);\n }\n }\n return style.cssText;\n};\nconst sanitizeStyleAttributes = (documentRef, root) => {\n root.querySelectorAll('[style]').forEach((element) => {\n const sanitized = sanitizeStyleDeclaration(documentRef, element.getAttribute('style') || '');\n if (sanitized) {\n element.setAttribute('style', sanitized);\n }\n else {\n element.removeAttribute('style');\n }\n });\n};\nconst sanitizeEmbeddedResourceUrls = (root) => {\n root\n .querySelectorAll('[src],[srcset],[poster],[href],[xlink\\\\:href]')\n .forEach((element) => {\n for (const attributeName of ['src', 'srcset', 'poster', 'href', 'xlink:href']) {\n if (!element.hasAttribute(attributeName)) {\n continue;\n }\n const isHtmlAnchor = element.namespaceURI === 'http://www.w3.org/1999/xhtml' && element.localName === 'a';\n if (isHtmlAnchor && attributeName === 'href') {\n continue;\n }\n const allowFragment = element.namespaceURI === 'http://www.w3.org/2000/svg' &&\n (attributeName === 'href' || attributeName === 'xlink:href');\n if (!isSafeEmbeddedResourceUrl(element.getAttribute(attributeName) || '', allowFragment)) {\n element.removeAttribute(attributeName);\n }\n }\n });\n};\nconst sanitizeSvgUrlAttributes = (root) => {\n root.querySelectorAll('svg, svg *').forEach((element) => {\n for (const attribute of Array.from(element.attributes)) {\n const value = attribute.value;\n if (/url\\s*\\(/i.test(value) && !isSafeCssValue(value)) {\n element.removeAttribute(attribute.name);\n }\n }\n });\n};\nexport const sanitizePptxCss = (documentRef, cssText) => {\n const rules = [];\n let offset = 0;\n while (offset < cssText.length) {\n if (!cssText.slice(offset).trim()) {\n break;\n }\n GENERATED_STYLE_RULE.lastIndex = offset;\n const match = GENERATED_STYLE_RULE.exec(cssText);\n if (!match) {\n return '';\n }\n const declarations = sanitizeStyleDeclaration(documentRef, match[2]);\n if (declarations) {\n rules.push(`${PPTX_CONTENT_STYLE_SCOPE} ${match[1]}{${declarations}}`);\n }\n offset = GENERATED_STYLE_RULE.lastIndex;\n }\n return rules.join('\\n');\n};\nexport const sanitizePptxMarkup = (documentRef, html) => {\n const purifier = getPurifier(documentRef);\n if (!purifier) {\n return createSafeFallbackFragment(documentRef);\n }\n const fragment = purifier.sanitize(html, {\n RETURN_DOM_FRAGMENT: true,\n USE_PROFILES: { html: true, svg: true, svgFilters: true },\n ADD_ATTR: ['target'],\n FORBID_TAGS: ['script', 'style', 'iframe', 'object', 'embed', 'form'],\n FORBID_ATTR: ['srcdoc']\n });\n sanitizeStyleAttributes(documentRef, fragment);\n sanitizeEmbeddedResourceUrls(fragment);\n sanitizeSvgUrlAttributes(fragment);\n fragment.querySelectorAll('a[target]').forEach((anchor) => {\n if ((anchor.getAttribute('target') || '').trim().toLowerCase() === '_blank') {\n anchor.rel = 'noopener noreferrer';\n }\n });\n return fragment;\n};\n","const legacyPptxCss = `\n.slide{position:relative;border:0;border-radius:0;overflow:hidden;margin-bottom:50px;margin-left:auto;margin-right:auto;z-index:100}\n.slide div.block{position:absolute;top:0;left:0;width:100%;line-height:1}\n.slide div.content{display:flex;flex-direction:column}\n.slide div.diagram-content{display:flex;flex-direction:column}\n.slide div.content-rtl{display:flex;flex-direction:column;direction:rtl}\n.slide .pregraph-rtl{direction:rtl}\n.slide .pregraph-ltr{direction:ltr}\n.slide .pregraph-inherit{direction:inherit}\n.slide .slide-prgrph{width:100%}\n.slide .line-break-br::before{content:\"\\\\A\";white-space:pre}\n.slide div.v-up{justify-content:flex-start}\n.slide div.v-mid{justify-content:center}\n.slide div.v-down{justify-content:flex-end}\n.slide div.h-left{justify-content:flex-start;align-items:flex-start;text-align:left}\n.slide div.h-left-rtl{justify-content:flex-end;align-items:flex-end;text-align:left}\n.slide div.h-mid{justify-content:center;align-items:center;text-align:center}\n.slide div.h-right{justify-content:flex-end;align-items:flex-end;text-align:right}\n.slide div.h-right-rtl{justify-content:flex-start;align-items:flex-start;text-align:right}\n.slide div.h-just,.slide div.h-dist{text-align:justify}\n.slide div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}\n.slide div.up-center{justify-content:flex-start;align-items:center}\n.slide div.up-right{justify-content:flex-start;align-items:flex-end}\n.slide div.center-left{justify-content:center;align-items:flex-start;text-align:left}\n.slide div.center-center{justify-content:center;align-items:center}\n.slide div.center-right{justify-content:center;align-items:flex-end}\n.slide div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}\n.slide div.down-center{justify-content:flex-end;align-items:center}\n.slide div.down-right{justify-content:flex-end;align-items:flex-end}\n.slide li.slide{margin:10px 0;font-size:18px}\n.slide table{position:absolute;table-layout:fixed;box-sizing:border-box;overflow:hidden}\n.slide table tr,.slide table td{box-sizing:border-box;min-width:0;overflow:hidden}\n.slide .pptx-table-cell-content{box-sizing:border-box;min-height:0;overflow:hidden}\n.slide svg.drawing{position:absolute;overflow:visible}\n/* Chart shapes need renderer-owned styling even in offline / Shadow DOM hosts.\n Without it SVG's default black fill closes line and axis paths into polygons. */\n.slide .pptx-chart-surface svg{font:10px sans-serif;overflow:hidden}\n.slide .pptx-chart-surface .bb-axis path,.slide .pptx-chart-surface .bb-axis line{fill:none;stroke:currentColor}\n.slide .pptx-chart-surface .bb-line{fill:none;stroke-width:1px}\n.slide .pptx-chart-surface .bb-bar{stroke-width:0}\n.slide .pptx-chart-surface .bb-area{stroke-width:0;opacity:.2}\n.slide .pptx-chart-surface .bb-chart-arc path{stroke:#fff}\n.slide .pptx-chart-surface .bb-chart-arc text{fill:#fff;font-size:13px}\n.slide .pptx-chart-surface .bb-grid line{fill:none;stroke:#aaa}\n.slide .pptx-chart-surface .bb-xgrid,.slide .pptx-chart-surface .bb-ygrid{stroke-dasharray:3 3}\n.slide .pptx-chart-surface .bb-xgrid-focus,.slide .pptx-chart-surface .bb-ygrid-focus{pointer-events:none}\n.slide .pptx-chart-surface .bb-legend-item{font-size:12px}\n.slide .pptx-chart-surface .bb-tooltip-container{z-index:10;pointer-events:none}\n.slide .pptx-chart-surface table.bb-tooltip{position:static;width:auto;table-layout:auto;background:#fff;color:#172033;border:1px solid #ccc;opacity:.95;font-size:12px}\n.slide .pptx-chart-surface .bb-tooltip td,.slide .pptx-chart-surface .bb-tooltip th{padding:4px 6px}\n\n`;\nconst PPTX_CONTENT_STYLE_SCOPE = '.flyfish-pptx-content';\nexport const scopePptxContentStyleText = (cssText) => cssText.replace(/(^|})\\s*(\\.[^{}]+)\\{/g, (_match, boundary, selectorList) => {\n const scopedSelectors = selectorList\n .split(',')\n .map(selector => `${PPTX_CONTENT_STYLE_SCOPE} ${selector.trim()}`)\n .join(',');\n return `${boundary}${scopedSelectors}{`;\n});\nexport const pptxViewerCss = `\n.flyfish-pptx-scale-box{position:relative;box-sizing:border-box;max-width:100%;margin:0 auto;min-width:0}\n.flyfish-pptx-content{position:absolute;top:0;left:0;box-sizing:border-box;max-width:none;min-width:0;transform-origin:top left;will-change:transform}\n.flyfish-pptx-content[data-render-state=\"loading\"]{opacity:.82}\n.flyfish-pptx-slide-slot{display:flow-root;box-sizing:border-box;width:100%;min-width:0}\n.flyfish-pptx-slide-error{display:flex;align-items:center;justify-content:center;background:#fff7ed!important;color:#9a3412}\n.flyfish-pptx-slide-error-card{display:grid;gap:10px;max-width:70%;padding:24px;border:1px solid #fdba74;border-radius:12px;background:#fff;text-align:center;font:14px/1.5 system-ui,sans-serif}\n.flyfish-pptx-slide-error-card strong{font-size:18px}\n.flyfish-pptx-content .slide{background:#fff;box-shadow:0 18px 36px rgba(18,35,52,.12)}\n.flyfish-pptx-thumbnail{display:block;box-sizing:border-box;width:min(960px,100%);height:auto;margin:0 auto 28px;border-radius:12px;background:#fff;box-shadow:0 18px 36px rgba(18,35,52,.14)}\n${scopePptxContentStyleText(legacyPptxCss)}\n.flyfish-pptx-content > .slide:last-of-type{margin-bottom:0}\n.flyfish-pptx-slide-slot:last-of-type > .slide{margin-bottom:0}\n.flyfish-pptx-presentation{position:fixed;inset:0;z-index:2147483000;display:block;overflow:hidden;background:#000;cursor:default;user-select:none;-webkit-user-select:none}\n.flyfish-pptx-presentation:focus{outline:none}\n.flyfish-pptx-presentation-stage{position:absolute;inset:0;overflow:hidden}\n.flyfish-pptx-presentation .flyfish-pptx-scale-box{position:absolute;inset:0;width:100%;height:100%;margin:0}\n.flyfish-pptx-presentation .flyfish-pptx-thumbnail{display:none}\n.flyfish-pptx-content.is-presenting > .flyfish-pptx-slide-slot{display:none;min-height:0}\n.flyfish-pptx-content.is-presenting > .flyfish-pptx-slide-slot.is-active-slide{display:flow-root}\n.flyfish-pptx-content.is-presenting > .slide{display:none}\n.flyfish-pptx-content.is-presenting > .slide.is-active-slide{display:block}\n.flyfish-pptx-content.is-presenting .slide{margin:0!important;box-shadow:none}\n.flyfish-pptx-presentation-counter{position:absolute;right:18px;bottom:14px;padding:5px 12px;border-radius:999px;background:rgba(255,255,255,.14);color:#fff;font:13px/1.4 system-ui,sans-serif;letter-spacing:.02em;pointer-events:none}\n.flyfish-pptx-presentation-hint{position:absolute;left:18px;bottom:14px;color:rgba(255,255,255,.55);font:12px/1.4 system-ui,sans-serif;pointer-events:none}\n.flyfish-pptx-presentation-hint[hidden]{display:none}\n.flyfish-pptx-presentation-exit{position:absolute;top:14px;right:14px;width:34px;height:34px;padding:0;border:0;border-radius:999px;background:rgba(255,255,255,.14);color:#fff;font-size:15px;line-height:1;cursor:pointer}\n.flyfish-pptx-presentation-exit:hover{background:rgba(255,255,255,.26)}\n.flyfish-pptx-presentation-exit:focus-visible{outline:2px solid #fff;outline-offset:2px}\n@media (prefers-reduced-motion:no-preference){.flyfish-pptx-content.is-presenting > .flyfish-pptx-slide-slot.is-active-slide,.flyfish-pptx-content.is-presenting > .slide.is-active-slide{animation:flyfish-pptx-slide-in 140ms ease-out}}\n@keyframes flyfish-pptx-slide-in{from{opacity:.35}to{opacity:1}}\n`;\nconst PPTX_STYLE_ID = 'flyfish-pptx-native-style';\nexport const ensurePptxViewerStyles = (documentRef, root = documentRef) => {\n if (root instanceof Document && root.getElementById(PPTX_STYLE_ID)) {\n return;\n }\n if (!(root instanceof Document) && root.querySelector(`#${PPTX_STYLE_ID}`)) {\n return;\n }\n const style = documentRef.createElement('style');\n style.id = PPTX_STYLE_ID;\n style.textContent = pptxViewerCss;\n if (root instanceof Document) {\n (root.head || root.documentElement).appendChild(style);\n return;\n }\n root.appendChild(style);\n};\n","export const isResolvedPptxWorkerLocation = (moduleUrl, assetUrl) => {\n const relativePath = ['worker', 'pptx.worker.js'].join('/');\n const dependencyRelativeUrl = new URL(relativePath, moduleUrl);\n return assetUrl.href !== dependencyRelativeUrl.href || /\\/dist\\/worker\\.[cm]?js$/.test(moduleUrl.pathname);\n};\n","import { isResolvedPptxWorkerLocation } from \"./worker-location.js\";\nconst viteOptimizedWorkerPathPattern = /\\/\\.?vite\\/deps\\/worker\\/pptx\\.worker\\.js$/;\nconst viteSourceWorkerModulePattern = /\\/src\\/worker\\.[cm]?[jt]s$/;\nconst angularCachePath = '/.angular/cache/';\nconst viteOptimizedPptxSourcePattern = /\\/\\/\\s+(node_modules\\/(?:\\.pnpm\\/[^\\n]+?\\/node_modules\\/)?@file-viewer\\/pptx\\/dist\\/worker\\.js)\\b/;\nconst resolveBundledPptxWorkerUrl = () => {\n const moduleUrl = new URL(import.meta.url);\n if (viteSourceWorkerModulePattern.test(moduleUrl.pathname)) {\n return new URL('../dist/worker/pptx.worker.js', moduleUrl);\n }\n return new URL('./worker/pptx.worker.js', import.meta.url);\n};\nconst resolveAngularVitePptxWorkerUrl = (baseUrl, workerPath) => {\n const cacheIndex = baseUrl.pathname.indexOf(angularCachePath);\n if (cacheIndex < 0) {\n return null;\n }\n const workerUrl = new URL(baseUrl.href);\n workerUrl.pathname = `${workerUrl.pathname.slice(0, cacheIndex)}/${workerPath}`;\n workerUrl.search = '';\n workerUrl.hash = '';\n return workerUrl;\n};\nconst resolveViteOptimizedPptxWorkerUrl = (defaultPptxWorkerUrl) => {\n if (typeof XMLHttpRequest === 'undefined') {\n return null;\n }\n try {\n const request = new XMLHttpRequest();\n request.open('GET', import.meta.url, false);\n request.send(null);\n if ((request.status > 0 && request.status < 200) || request.status >= 400) {\n return null;\n }\n const match = viteOptimizedPptxSourcePattern.exec(request.responseText || '');\n if (!match) {\n return null;\n }\n const workerPath = match[1].replace(/dist\\/worker\\.js$/, 'dist/worker/pptx.worker.js');\n const angularWorkerUrl = resolveAngularVitePptxWorkerUrl(defaultPptxWorkerUrl, workerPath);\n if (angularWorkerUrl) {\n return angularWorkerUrl;\n }\n const origin = typeof location !== 'undefined' && location.origin\n ? location.origin\n : defaultPptxWorkerUrl.origin;\n return `${origin}/${workerPath}`;\n }\n catch {\n return null;\n }\n};\nconst resolvePptxWorkerUrl = (allowDependencyRelativeUrl) => {\n try {\n const moduleUrl = new URL(import.meta.url);\n const workerUrl = resolveBundledPptxWorkerUrl();\n if (isResolvedPptxWorkerLocation(moduleUrl, workerUrl))\n return workerUrl.href;\n if (viteOptimizedWorkerPathPattern.test(workerUrl.pathname)) {\n const optimizedUrl = resolveViteOptimizedPptxWorkerUrl(workerUrl);\n return optimizedUrl ? String(optimizedUrl) : undefined;\n }\n return allowDependencyRelativeUrl ? workerUrl.href : undefined;\n }\n catch {\n }\n return undefined;\n};\nexport const resolvePptxPackageWorkerUrl = () => {\n return resolvePptxWorkerUrl(false);\n};\nexport const createPptxWorker = (options = {}) => {\n var _a;\n if (options.workerFactory) {\n return options.workerFactory();\n }\n if (options.workerUrl) {\n return new Worker(options.workerUrl, {\n type: (_a = options.workerType) !== null && _a !== void 0 ? _a : 'module',\n });\n }\n const workerUrl = resolvePptxWorkerUrl(true);\n if (!workerUrl) {\n throw new Error('PPTX Worker URL is unavailable. Run file-viewer-copy-assets or provide workerUrl.');\n }\n return new Worker(workerUrl, { type: 'module' });\n};\n","import { renderPptxPostProcessing } from \"./chart.js\";\nimport { resolvePptxEngineOptions, RECOMMENDED_ZIP_LIMITS } from \"./options.js\";\nimport { PptxPresentation } from \"./presentation.js\";\nimport { sanitizePptxCss, sanitizePptxMarkup } from \"./sanitize.js\";\nimport { ensurePptxViewerStyles } from \"./styles.js\";\nimport { createPptxWorker } from \"./worker.js\";\nconst clamp = (value, min, max) => {\n return Math.min(max, Math.max(min, value));\n};\nconst toPercent = (value) => {\n const numeric = typeof value === 'number' && Number.isFinite(value) ? value : 100;\n return clamp(numeric, 25, 300);\n};\nconst stringifyErrorDetail = (error) => {\n if (error === undefined || error === null) {\n return '';\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error instanceof Error && error.message) {\n return error.message;\n }\n try {\n const serialized = JSON.stringify(error);\n return serialized && serialized !== '{}' ? serialized : String(error);\n }\n catch {\n return String(error);\n }\n};\nconst createPptxDiagnosticError = (code, stage, message, detailOrError, hint) => ({\n name: 'PptxDiagnosticError',\n code,\n stage,\n message,\n detail: stringifyErrorDetail(detailOrError),\n hint,\n});\nconst ensureZipWithinLimits = (buffer, options) => {\n const limits = {\n ...RECOMMENDED_ZIP_LIMITS,\n ...options.zipLimits,\n };\n if (limits.maxFileBytes && buffer.byteLength > limits.maxFileBytes) {\n throw createPptxDiagnosticError('PPTX_FILE_TOO_LARGE', 'preflight', 'PPTX 文件超过浏览器安全预览体积限制。', `${buffer.byteLength} bytes > ${limits.maxFileBytes} bytes`, '请压缩图片、拆分演示文稿,或在业务侧提高 zipLimits.maxFileBytes 后再预览。');\n }\n};\nconst appendHtml = (container, html) => {\n const fragment = sanitizePptxMarkup(container.ownerDocument, html);\n const nodes = Array.from(fragment.children);\n container.append(fragment);\n return nodes[0] || null;\n};\nconst escapeHtml = (value) => String(value !== null && value !== void 0 ? value : '')\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\nconst buildSlideErrorHtml = (slideNumber, error) => {\n const diagnostic = error && typeof error === 'object'\n ? error\n : null;\n const message = (diagnostic === null || diagnostic === void 0 ? void 0 : diagnostic.message) || stringifyErrorDetail(error) || 'This slide could not be rendered.';\n return `<section class=\"slide flyfish-pptx-slide-error\" data-slide-index=\"${slideNumber}\"><div class=\"flyfish-pptx-slide-error-card\" role=\"status\"><strong>Slide ${slideNumber}</strong><span>${escapeHtml(message)}</span></div></section>`;\n};\nconst DEFAULT_INITIAL_SLIDES = 3;\nconst DEFAULT_BATCH_SIZE = 4;\nconst DEFAULT_OVERSCAN_VIEWPORTS = 1.5;\nconst DEFAULT_SLIDE_HEIGHT = 540;\nconst DEFAULT_SLIDE_GAP = 50;\nconst toPositiveInteger = (value, fallback, min = 1, max = Number.MAX_SAFE_INTEGER) => {\n const numeric = typeof value === 'number' && Number.isFinite(value)\n ? Math.floor(value)\n : fallback;\n return clamp(numeric, min, max);\n};\nconst toPositiveNumber = (value, fallback, min = 0, max = Number.MAX_SAFE_INTEGER) => {\n const numeric = typeof value === 'number' && Number.isFinite(value) ? value : fallback;\n return clamp(numeric, min, max);\n};\nexport class PptxViewer {\n static async open(buffer, target, options = {}) {\n const viewer = new PptxViewer(buffer, target, options);\n await viewer.open();\n return viewer;\n }\n constructor(buffer, target, options) {\n this.worker = null;\n this.resizeObserver = null;\n this.resizeFrame = 0;\n this.fitScale = 1;\n this.userZoomPercent = 100;\n this.currentZoomPercent = 100;\n this.thumbnailElement = null;\n this.previewThumbnailDataUrl = null;\n this.slideSize = null;\n this.slideRecords = [];\n this.totalSlides = 0;\n this.savedScroll = null;\n this.pendingScrollRestore = null;\n this.slideWindowTarget = null;\n this.slideWindowListeners = [];\n this.slideWindowFrame = 0;\n this.charts = null;\n this.chartHandles = new Set();\n this.mediaRecords = new Map();\n this.disposed = false;\n this.completed = false;\n this.presentation = null;\n this.handleSlideWindowChange = () => this.scheduleSlideWindowUpdate();\n this.buffer = buffer;\n this.target = target;\n this.options = options;\n this.userZoomPercent = toPercent(options.zoomPercent);\n this.currentZoomPercent = this.userZoomPercent;\n const documentRef = target.ownerDocument || document;\n this.scaleBox = documentRef.createElement('div');\n this.scaleBox.className = 'flyfish-pptx-scale-box';\n this.content = documentRef.createElement('div');\n this.content.className = 'flyfish-pptx-content';\n this.content.dataset.renderState = 'loading';\n this.scaleBox.append(this.content);\n }\n get zoomPercent() {\n return Math.round(this.currentZoomPercent);\n }\n get thumbnailDataUrl() {\n return this.previewThumbnailDataUrl;\n }\n get slideCount() {\n return this.totalSlides;\n }\n get slideDimensions() {\n var _a, _b;\n const width = Number((_a = this.slideSize) === null || _a === void 0 ? void 0 : _a.width);\n const height = Number((_b = this.slideSize) === null || _b === void 0 ? void 0 : _b.height);\n return Number.isFinite(width) && width > 0 && Number.isFinite(height) && height > 0\n ? { width, height }\n : null;\n }\n get presenting() {\n var _a;\n return Boolean((_a = this.presentation) === null || _a === void 0 ? void 0 : _a.active);\n }\n get presentationSlideNumber() {\n var _a, _b;\n return (_b = (_a = this.presentation) === null || _a === void 0 ? void 0 : _a.slideNumber) !== null && _b !== void 0 ? _b : 1;\n }\n get styleRoot() {\n var _a;\n if (this.options.styleRoot) {\n return this.options.styleRoot;\n }\n const documentRef = this.target.ownerDocument || document;\n const root = this.target.getRootNode();\n const ShadowRootCtor = (_a = documentRef.defaultView) === null || _a === void 0 ? void 0 : _a.ShadowRoot;\n return ShadowRootCtor && root instanceof ShadowRootCtor\n ? root\n : documentRef;\n }\n get presentationRoot() {\n const documentRef = this.target.ownerDocument || document;\n const styleRoot = this.styleRoot;\n if (styleRoot !== documentRef) {\n return styleRoot;\n }\n return documentRef.body || documentRef.documentElement;\n }\n ensureSlideRendered(slideNumber) {\n const record = this.slideRecords.find(item => item.slideNumber === slideNumber);\n if (!record) {\n return null;\n }\n if (!record.rendered) {\n this.renderSlideRecord(record);\n }\n return record.element;\n }\n refreshLayout() {\n this.scheduleResize();\n }\n saveScrollPosition() {\n const view = this.target.ownerDocument.defaultView || window;\n const HTMLElementCtor = view.HTMLElement;\n const scroller = this.slideWindowTarget || this.findSlideWindowTarget();\n if (scroller instanceof HTMLElementCtor) {\n this.savedScroll = { top: scroller.scrollTop, left: scroller.scrollLeft };\n }\n else {\n this.savedScroll = { top: view.scrollY, left: view.scrollX };\n }\n }\n restoreScrollPosition() {\n if (this.savedScroll) {\n this.pendingScrollRestore = this.savedScroll;\n this.savedScroll = null;\n }\n this.scheduleResize();\n }\n emitPresentationChange(state) {\n var _a, _b;\n (_b = (_a = this.options).onPresentationChange) === null || _b === void 0 ? void 0 : _b.call(_a, state);\n }\n async enterPresentation(slideNumber) {\n if (this.disposed || this.totalSlides === 0) {\n return;\n }\n this.presentation || (this.presentation = new PptxPresentation(this, this.options.presentationLabels, this.options.presentationFullscreen));\n await this.presentation.enter(slideNumber);\n }\n exitPresentation() {\n var _a;\n (_a = this.presentation) === null || _a === void 0 ? void 0 : _a.exit();\n }\n async togglePresentation(slideNumber) {\n if (this.presenting) {\n this.exitPresentation();\n return;\n }\n await this.enterPresentation(slideNumber);\n }\n async open() {\n ensureZipWithinLimits(this.buffer, this.options);\n ensurePptxViewerStyles(this.target.ownerDocument || document, this.styleRoot);\n this.target.replaceChildren(this.scaleBox);\n this.attachResizeObserver();\n this.attachSlideWindowListeners();\n this.startWorker();\n }\n async setZoom(percent) {\n const desiredEffectivePercent = toPercent(percent);\n this.userZoomPercent = clamp(desiredEffectivePercent / Math.max(this.fitScale, 0.01), 25, 600);\n this.scheduleResize();\n }\n destroy() {\n var _a, _b, _c, _d, _e;\n this.disposed = true;\n (_a = this.presentation) === null || _a === void 0 ? void 0 : _a.destroy();\n this.presentation = null;\n this.previewThumbnailDataUrl = null;\n this.releaseCharts();\n this.releaseMedia();\n (_b = this.worker) === null || _b === void 0 ? void 0 : _b.terminate();\n this.worker = null;\n (_c = this.resizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();\n this.resizeObserver = null;\n if (this.resizeFrame) {\n (_d = this.target.ownerDocument.defaultView) === null || _d === void 0 ? void 0 : _d.cancelAnimationFrame(this.resizeFrame);\n }\n if (this.slideWindowFrame) {\n (_e = this.target.ownerDocument.defaultView) === null || _e === void 0 ? void 0 : _e.cancelAnimationFrame(this.slideWindowFrame);\n }\n this.detachSlideWindowListeners();\n this.target.replaceChildren();\n }\n startWorker() {\n var _a;\n (_a = this.worker) === null || _a === void 0 ? void 0 : _a.terminate();\n this.releaseCharts();\n this.releaseMedia();\n this.completed = false;\n this.charts = null;\n this.previewThumbnailDataUrl = null;\n this.slideSize = null;\n this.slideRecords = [];\n this.totalSlides = 0;\n this.content.replaceChildren();\n this.content.dataset.renderState = 'loading';\n try {\n this.worker = createPptxWorker(this.options);\n }\n catch (error) {\n throw createPptxDiagnosticError('PPTX_WORKER_FAILED', 'start-worker', 'PPTX Worker 启动失败。', error, '请检查 presentation.workerUrl、Worker 文件是否 200 返回、MIME/CSP/跨域策略是否允许加载。');\n }\n this.worker.addEventListener('message', event => this.processMessage(event.data));\n this.worker.addEventListener('error', event => this.fail(createPptxDiagnosticError('PPTX_WORKER_FAILED', 'worker-runtime', 'PPTX Worker 运行失败。', event.error || event.message, '请检查 Worker 脚本是否完整、浏览器控制台是否有 CSP/MIME/跨域或语法错误。')));\n try {\n this.worker.postMessage({\n type: 'processPPTX',\n data: this.buffer,\n IE11: false,\n options: resolvePptxEngineOptions(this.options.engineOptions),\n });\n }\n catch (error) {\n throw createPptxDiagnosticError('PPTX_WORKER_FAILED', 'post-worker-message', 'PPTX 数据发送到 Worker 失败。', error, '请确认浏览器支持 Worker 消息传递,并避免传入已被释放或不可克隆的数据。');\n }\n }\n processMessage(message) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;\n if (this.disposed || this.completed) {\n return;\n }\n switch (message.type) {\n case 'slide': {\n this.clearThumbnail();\n this.totalSlides += 1;\n if (this.shouldWindowSlides()) {\n this.appendWindowedSlide(String(message.data || ''), Number(message.slide_num || 0));\n }\n else {\n const element = appendHtml(this.content, String(message.data || ''));\n this.hydrateMedia(element);\n this.scheduleResize();\n (_b = (_a = this.options).onSlideRendered) === null || _b === void 0 ? void 0 : _b.call(_a, Number(message.slide_num || 0), element);\n }\n break;\n }\n case 'media':\n this.storeMedia(message.data);\n break;\n case 'slide-error': {\n const slideNumber = Number(message.slide_num || 0);\n const error = message.data;\n const html = buildSlideErrorHtml(slideNumber, error);\n this.clearThumbnail();\n this.totalSlides += 1;\n if (this.shouldWindowSlides()) {\n this.appendWindowedSlide(html, slideNumber);\n }\n else {\n const element = appendHtml(this.content, html);\n this.scheduleResize();\n (_d = (_c = this.options).onSlideRendered) === null || _d === void 0 ? void 0 : _d.call(_c, slideNumber, element);\n }\n (_f = (_e = this.options).onSlideError) === null || _f === void 0 ? void 0 : _f.call(_e, slideNumber, error);\n (_h = (_g = this.options).onWarning) === null || _h === void 0 ? void 0 : _h.call(_g, error);\n break;\n }\n case 'pptx-thumb':\n this.showThumbnail(String(message.data || ''));\n (_k = (_j = this.options).onThumbnail) === null || _k === void 0 ? void 0 : _k.call(_j, String(message.data || ''));\n break;\n case 'slideSize':\n this.slideSize = (message.data || {});\n this.syncWindowedPlaceholderHeights();\n (_m = (_l = this.options).onSlideSize) === null || _m === void 0 ? void 0 : _m.call(_l, (message.data || {}));\n break;\n case 'globalCSS':\n this.appendGlobalCss(String(message.data || ''));\n break;\n case 'progress-update':\n (_p = (_o = this.options).onProgress) === null || _p === void 0 ? void 0 : _p.call(_o, Number(message.data || 0), message);\n break;\n case 'ExecutionTime':\n case 'Done':\n void this.complete(message.charts).catch(error => this.fail(createPptxDiagnosticError('PPTX_PARSE_FAILED', 'post-process', 'PPTX 渲染后处理失败。', error)));\n break;\n case 'WARN':\n (_r = (_q = this.options).onWarning) === null || _r === void 0 ? void 0 : _r.call(_q, message.data);\n break;\n case 'ERROR':\n this.fail(message.data);\n break;\n default:\n break;\n }\n }\n appendGlobalCss(css) {\n const sanitized = sanitizePptxCss(this.target.ownerDocument, css);\n if (!sanitized) {\n return;\n }\n const style = this.target.ownerDocument.createElement('style');\n style.textContent = sanitized;\n this.content.append(style);\n }\n showThumbnail(base64Jpeg) {\n if (!base64Jpeg) {\n return;\n }\n this.previewThumbnailDataUrl = `data:image/jpeg;base64,${base64Jpeg}`;\n if (this.content.children.length > 0) {\n return;\n }\n const image = this.target.ownerDocument.createElement('img');\n image.className = 'flyfish-pptx-thumbnail';\n image.alt = 'PPTX preview thumbnail';\n image.src = this.previewThumbnailDataUrl;\n this.thumbnailElement = image;\n this.scaleBox.insertBefore(image, this.content);\n }\n clearThumbnail() {\n var _a;\n (_a = this.thumbnailElement) === null || _a === void 0 ? void 0 : _a.remove();\n this.thumbnailElement = null;\n }\n shouldWindowSlides() {\n var _a;\n return Boolean(this.options.lazySlides || ((_a = this.options.listOptions) === null || _a === void 0 ? void 0 : _a.windowed));\n }\n getSlideWindowOptions() {\n const listOptions = this.options.listOptions || {};\n return {\n initialSlides: toPositiveInteger(listOptions.initialSlides, DEFAULT_INITIAL_SLIDES, 1, 20),\n batchSize: toPositiveInteger(listOptions.batchSize, DEFAULT_BATCH_SIZE, 1, 20),\n overscanViewport: toPositiveNumber(listOptions.overscanViewport, DEFAULT_OVERSCAN_VIEWPORTS, 0.25, 6),\n };\n }\n getEstimatedSlideHeight() {\n var _a, _b;\n const sizeHeight = Number((_a = this.slideSize) === null || _a === void 0 ? void 0 : _a.height);\n const measuredHeight = (_b = this.slideRecords.find(record => record.estimatedHeight > 0)) === null || _b === void 0 ? void 0 : _b.estimatedHeight;\n return Math.ceil((Number.isFinite(sizeHeight) && sizeHeight > 0\n ? sizeHeight + DEFAULT_SLIDE_GAP\n : measuredHeight || DEFAULT_SLIDE_HEIGHT + DEFAULT_SLIDE_GAP));\n }\n appendWindowedSlide(html, slideNumber) {\n const record = this.createWindowedSlideRecord(html, slideNumber || this.slideRecords.length + 1);\n this.slideRecords.push(record);\n this.content.append(record.slot);\n if (this.slideRecords.length <= this.getSlideWindowOptions().initialSlides) {\n this.renderSlideRecord(record);\n }\n this.scheduleResize();\n this.scheduleSlideWindowUpdate();\n }\n createWindowedSlideRecord(html, slideNumber) {\n const slot = this.target.ownerDocument.createElement('div');\n const estimatedHeight = this.getEstimatedSlideHeight();\n slot.className = 'flyfish-pptx-slide-slot';\n slot.dataset.slideNumber = String(slideNumber);\n slot.style.minHeight = `${estimatedHeight}px`;\n return {\n slideNumber,\n html,\n slot,\n element: null,\n estimatedHeight,\n rendered: false,\n notified: false,\n postProcessed: false,\n postProcessPromise: null,\n postProcessVersion: 0,\n chartHandle: null,\n };\n }\n getDesignerCanvases(record) {\n return Array.from(record.slot.children).filter(element => (element.classList.contains('fv-print-mask-canvas')));\n }\n renderSlideRecord(record) {\n var _a, _b;\n if (record.rendered || this.disposed) {\n return;\n }\n const designerCanvases = this.getDesignerCanvases(record);\n record.slot.replaceChildren();\n record.element = appendHtml(record.slot, record.html);\n this.hydrateMedia(record.element);\n record.slot.append(...designerCanvases);\n record.rendered = true;\n record.postProcessed = false;\n record.postProcessVersion += 1;\n this.updateMeasuredSlideHeight(record);\n if (!record.notified) {\n record.notified = true;\n (_b = (_a = this.options).onSlideRendered) === null || _b === void 0 ? void 0 : _b.call(_a, record.slideNumber, record.element);\n }\n if (this.completed) {\n void this.postProcessSlideRecord(record).finally(() => this.scheduleResize());\n }\n this.scheduleResize();\n }\n unmountSlideRecord(record) {\n if (!record.rendered || this.getDesignerCanvases(record).length > 0) {\n return;\n }\n this.updateMeasuredSlideHeight(record);\n this.releaseChartHandle(record.chartHandle);\n record.chartHandle = null;\n record.postProcessVersion += 1;\n record.slot.replaceChildren();\n record.element = null;\n record.rendered = false;\n record.postProcessed = false;\n record.postProcessPromise = null;\n }\n updateMeasuredSlideHeight(record) {\n var _a;\n const HTMLElementCtor = ((_a = this.target.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.HTMLElement) || HTMLElement;\n if (!(record.element instanceof HTMLElementCtor)) {\n return;\n }\n const view = this.target.ownerDocument.defaultView || window;\n const computed = view.getComputedStyle(record.element);\n const marginTop = parseFloat(computed.marginTop) || 0;\n const marginBottom = parseFloat(computed.marginBottom) || 0;\n const measuredHeight = Math.ceil(record.element.offsetHeight + marginTop + marginBottom);\n const nextHeight = Math.max(measuredHeight, record.estimatedHeight, 1);\n record.estimatedHeight = nextHeight;\n record.slot.style.minHeight = `${nextHeight}px`;\n }\n syncWindowedPlaceholderHeights() {\n if (!this.shouldWindowSlides() || !this.slideRecords.length) {\n return;\n }\n const estimatedHeight = this.getEstimatedSlideHeight();\n for (const record of this.slideRecords) {\n if (!record.rendered && record.estimatedHeight < estimatedHeight) {\n record.estimatedHeight = estimatedHeight;\n record.slot.style.minHeight = `${estimatedHeight}px`;\n }\n }\n this.scheduleResize();\n }\n scheduleSlideWindowUpdate() {\n if (!this.shouldWindowSlides() || this.disposed) {\n return;\n }\n const view = this.target.ownerDocument.defaultView || window;\n if (this.slideWindowFrame) {\n view.cancelAnimationFrame(this.slideWindowFrame);\n }\n this.slideWindowFrame = view.requestAnimationFrame(() => this.updateSlideWindow());\n }\n updateSlideWindow() {\n this.slideWindowFrame = 0;\n if (!this.shouldWindowSlides() || !this.slideRecords.length || this.disposed) {\n return;\n }\n const windowOptions = this.getSlideWindowOptions();\n const indexesToRender = this.getWindowedSlideIndexes(windowOptions);\n const presentation = this.presentation;\n if (presentation === null || presentation === void 0 ? void 0 : presentation.active) {\n const activeIndex = this.slideRecords.findIndex(record => record.slideNumber === presentation.slideNumber);\n if (activeIndex >= 0) {\n indexesToRender.add(activeIndex);\n if (activeIndex + 1 < this.slideRecords.length) {\n indexesToRender.add(activeIndex + 1);\n }\n }\n }\n let changed = false;\n this.slideRecords.forEach((record, index) => {\n if (indexesToRender.has(index)) {\n const wasRendered = record.rendered;\n this.renderSlideRecord(record);\n changed || (changed = !wasRendered);\n }\n else if (record.rendered) {\n this.unmountSlideRecord(record);\n changed = true;\n }\n });\n if (changed) {\n this.scheduleResize();\n }\n }\n getWindowedSlideIndexes(windowOptions) {\n const viewport = this.getSlideViewport();\n const maxMountedSlides = Math.max(windowOptions.initialSlides, windowOptions.initialSlides + windowOptions.batchSize * 4, 12);\n const selected = new Set();\n for (let index = 0; index < Math.min(windowOptions.initialSlides, this.slideRecords.length); index += 1) {\n selected.add(index);\n }\n const candidates = this.slideRecords\n .map((record, index) => ({\n index,\n distance: this.getDistanceFromViewport(record, viewport, windowOptions.overscanViewport),\n }))\n .filter(candidate => candidate.distance !== Number.POSITIVE_INFINITY)\n .sort((a, b) => a.distance - b.distance || a.index - b.index);\n const closestFallback = candidates[0];\n for (const candidate of candidates) {\n if (candidate.distance > 0 && selected.size >= windowOptions.initialSlides) {\n continue;\n }\n selected.add(candidate.index);\n }\n if (closestFallback) {\n selected.add(closestFallback.index);\n }\n if (selected.size <= maxMountedSlides) {\n return selected;\n }\n const capped = new Set();\n for (let index = 0; index < Math.min(windowOptions.initialSlides, this.slideRecords.length); index += 1) {\n capped.add(index);\n }\n for (const candidate of candidates) {\n if (capped.size >= maxMountedSlides) {\n break;\n }\n capped.add(candidate.index);\n }\n return capped;\n }\n getDistanceFromViewport(record, viewport, overscanViewport) {\n const rect = record.slot.getBoundingClientRect();\n const overscan = viewport.height * overscanViewport;\n const top = viewport.top - overscan;\n const bottom = viewport.bottom + overscan;\n if (rect.bottom >= top && rect.top <= bottom) {\n return 0;\n }\n if (rect.bottom < top) {\n return top - rect.bottom;\n }\n if (rect.top > bottom) {\n return rect.top - bottom;\n }\n return Number.POSITIVE_INFINITY;\n }\n getSlideViewport() {\n const view = this.target.ownerDocument.defaultView || window;\n const HTMLElementCtor = view.HTMLElement;\n if (this.slideWindowTarget instanceof HTMLElementCtor) {\n const rect = this.slideWindowTarget.getBoundingClientRect();\n const height = Math.max(1, rect.height || this.slideWindowTarget.clientHeight || view.innerHeight || 1);\n return {\n top: rect.top,\n bottom: rect.top + height,\n height,\n };\n }\n const height = Math.max(1, view.innerHeight || this.target.ownerDocument.documentElement.clientHeight || DEFAULT_SLIDE_HEIGHT);\n return {\n top: 0,\n bottom: height,\n height,\n };\n }\n attachSlideWindowListeners() {\n if (!this.shouldWindowSlides()) {\n return;\n }\n this.detachSlideWindowListeners();\n const view = this.target.ownerDocument.defaultView || window;\n this.slideWindowTarget = this.findSlideWindowTarget();\n this.addSlideWindowListener(view, 'scroll');\n this.addSlideWindowListener(view, 'resize');\n if (this.slideWindowTarget && this.slideWindowTarget !== view) {\n this.addSlideWindowListener(this.slideWindowTarget, 'scroll');\n }\n }\n addSlideWindowListener(target, type) {\n target.addEventListener(type, this.handleSlideWindowChange, { passive: true });\n this.slideWindowListeners.push({ target, type, listener: this.handleSlideWindowChange });\n }\n detachSlideWindowListeners() {\n for (const { target, type, listener } of this.slideWindowListeners) {\n target.removeEventListener(type, listener);\n }\n this.slideWindowListeners = [];\n this.slideWindowTarget = null;\n }\n findSlideWindowTarget() {\n const view = this.target.ownerDocument.defaultView || window;\n let element = this.target.parentElement;\n while (element && element !== this.target.ownerDocument.body && element !== this.target.ownerDocument.documentElement) {\n const style = view.getComputedStyle(element);\n if (/(auto|scroll|overlay)/.test(`${style.overflowY} ${style.overflow}`)) {\n return element;\n }\n element = element.parentElement;\n }\n return view;\n }\n async postProcessRenderedContent(charts) {\n if (!this.shouldWindowSlides()) {\n const handle = await renderPptxPostProcessing(charts, this.content);\n this.trackChartHandle(handle);\n return;\n }\n await Promise.all(this.slideRecords\n .filter(record => record.rendered)\n .map(record => this.postProcessSlideRecord(record)));\n }\n async postProcessSlideRecord(record) {\n if (!record.rendered || record.postProcessed || this.disposed) {\n return;\n }\n if (!record.postProcessPromise) {\n const version = record.postProcessVersion;\n const postProcessPromise = (async () => {\n const handle = await renderPptxPostProcessing(this.charts, record.slot);\n if (this.disposed || !record.rendered || record.postProcessVersion !== version) {\n handle === null || handle === void 0 ? void 0 : handle.destroy();\n return;\n }\n this.releaseChartHandle(record.chartHandle);\n record.chartHandle = handle;\n this.trackChartHandle(handle);\n record.postProcessed = true;\n this.updateMeasuredSlideHeight(record);\n })().finally(() => {\n if (record.postProcessPromise === postProcessPromise) {\n record.postProcessPromise = null;\n }\n });\n record.postProcessPromise = postProcessPromise;\n }\n await record.postProcessPromise;\n }\n async cloneForExport() {\n if (!this.shouldWindowSlides()) {\n return this.target.cloneNode(true);\n }\n const previouslyRendered = new Set(this.slideRecords.filter(record => record.rendered));\n try {\n this.slideRecords.forEach(record => this.renderSlideRecord(record));\n await Promise.all(this.slideRecords.map(record => this.postProcessSlideRecord(record)));\n return this.target.cloneNode(true);\n }\n finally {\n this.slideRecords.forEach(record => {\n if (!previouslyRendered.has(record)) {\n this.unmountSlideRecord(record);\n }\n });\n this.scheduleSlideWindowUpdate();\n this.scheduleResize();\n }\n }\n async complete(charts) {\n var _a, _b, _c;\n if (this.disposed || this.completed) {\n return;\n }\n this.completed = true;\n this.charts = charts;\n this.content.dataset.renderState = 'ready';\n (_a = this.worker) === null || _a === void 0 ? void 0 : _a.terminate();\n this.worker = null;\n this.scheduleSlideWindowUpdate();\n this.scheduleResize();\n await this.postProcessRenderedContent(charts);\n if (this.disposed) {\n return;\n }\n this.scheduleResize();\n (_c = (_b = this.options).onRenderComplete) === null || _c === void 0 ? void 0 : _c.call(_b);\n }\n fail(error) {\n var _a, _b, _c;\n if (this.disposed) {\n return;\n }\n this.completed = true;\n (_a = this.worker) === null || _a === void 0 ? void 0 : _a.terminate();\n this.worker = null;\n this.releaseCharts();\n this.releaseMedia();\n this.content.dataset.renderState = 'error';\n (_c = (_b = this.options).onError) === null || _c === void 0 ? void 0 : _c.call(_b, error);\n }\n trackChartHandle(handle) {\n if (!handle) {\n return;\n }\n if (this.disposed) {\n handle.destroy();\n return;\n }\n this.chartHandles.add(handle);\n }\n releaseChartHandle(handle) {\n if (!handle) {\n return;\n }\n this.chartHandles.delete(handle);\n handle.destroy();\n }\n releaseCharts() {\n for (const handle of this.chartHandles) {\n handle.destroy();\n }\n this.chartHandles.clear();\n for (const record of this.slideRecords) {\n record.chartHandle = null;\n }\n }\n storeMedia(data) {\n if (!data || typeof data !== 'object') {\n return;\n }\n const media = data;\n if (typeof media.id !== 'string' ||\n !media.id ||\n typeof media.mimeType !== 'string' ||\n !(media.buffer instanceof ArrayBuffer)) {\n return;\n }\n this.releaseMedia(media.id);\n this.mediaRecords.set(media.id, {\n buffer: media.buffer,\n mimeType: media.mimeType,\n objectUrl: null,\n revokeObjectUrl: null,\n });\n this.hydrateMedia(this.content);\n }\n hydrateMedia(root) {\n var _a;\n if (!root) {\n return;\n }\n const elements = Array.from(root.querySelectorAll('[data-pptx-media-id]'));\n if (root.matches('[data-pptx-media-id]')) {\n elements.unshift(root);\n }\n for (const element of elements) {\n const mediaId = element.dataset.pptxMediaId;\n const record = mediaId ? this.mediaRecords.get(mediaId) : undefined;\n if (!record) {\n continue;\n }\n if (!record.objectUrl) {\n const view = this.target.ownerDocument.defaultView;\n const BlobCtor = (view === null || view === void 0 ? void 0 : view.Blob) || globalThis.Blob;\n const UrlApi = (view === null || view === void 0 ? void 0 : view.URL) || globalThis.URL;\n if (typeof BlobCtor !== 'function' ||\n typeof (UrlApi === null || UrlApi === void 0 ? void 0 : UrlApi.createObjectURL) !== 'function') {\n continue;\n }\n const objectUrl = UrlApi.createObjectURL(new BlobCtor([record.buffer], { type: record.mimeType }));\n record.objectUrl = objectUrl;\n record.revokeObjectUrl = () => UrlApi.revokeObjectURL(objectUrl);\n }\n if (element.src !== record.objectUrl) {\n element.src = record.objectUrl;\n (_a = element.load) === null || _a === void 0 ? void 0 : _a.call(element);\n }\n }\n }\n releaseMedia(mediaId) {\n var _a, _b;\n if (mediaId) {\n const record = this.mediaRecords.get(mediaId);\n (_a = record === null || record === void 0 ? void 0 : record.revokeObjectUrl) === null || _a === void 0 ? void 0 : _a.call(record);\n this.mediaRecords.delete(mediaId);\n return;\n }\n for (const record of this.mediaRecords.values()) {\n (_b = record.revokeObjectUrl) === null || _b === void 0 ? void 0 : _b.call(record);\n }\n this.mediaRecords.clear();\n }\n attachResizeObserver() {\n if (typeof ResizeObserver === 'undefined') {\n return;\n }\n this.resizeObserver = new ResizeObserver(() => {\n this.scheduleResize();\n this.scheduleSlideWindowUpdate();\n });\n this.resizeObserver.observe(this.target);\n if (this.target.parentElement) {\n this.resizeObserver.observe(this.target.parentElement);\n }\n }\n scheduleResize() {\n const view = this.target.ownerDocument.defaultView || window;\n if (this.resizeFrame) {\n view.cancelAnimationFrame(this.resizeFrame);\n }\n this.resizeFrame = view.requestAnimationFrame(() => this.resize());\n }\n resize() {\n var _a, _b, _c;\n if ((_a = this.presentation) === null || _a === void 0 ? void 0 : _a.active) {\n this.presentation.layout();\n return;\n }\n const slides = this.getMountedSlideElements();\n const sizeWidth = Number((_b = this.slideSize) === null || _b === void 0 ? void 0 : _b.width);\n const fallbackWidth = Number.isFinite(sizeWidth) && sizeWidth > 0 ? sizeWidth : 0;\n const slideWidth = Math.max(...slides.map(slide => slide.offsetWidth), fallbackWidth);\n if (!slideWidth) {\n return;\n }\n const viewportWidth = this.target.clientWidth || ((_c = this.target.parentElement) === null || _c === void 0 ? void 0 : _c.clientWidth) || slideWidth;\n this.fitScale = this.options.fitMode === 'none'\n ? 1\n : Math.min(1, viewportWidth / slideWidth);\n const effectiveScale = clamp(this.fitScale * (this.userZoomPercent / 100), 0.25, 3);\n this.currentZoomPercent = effectiveScale * 100;\n this.content.style.width = `${slideWidth}px`;\n this.content.style.transform = `scale(${effectiveScale})`;\n this.scaleBox.style.width = `${Math.ceil(slideWidth * effectiveScale)}px`;\n this.scaleBox.style.height = `${Math.ceil(this.content.scrollHeight * effectiveScale)}px`;\n this.scaleBox.style.minHeight = '';\n if (this.pendingScrollRestore) {\n const { top, left } = this.pendingScrollRestore;\n this.pendingScrollRestore = null;\n const view = this.target.ownerDocument.defaultView || window;\n const HTMLElementCtor = view.HTMLElement;\n const scroller = this.slideWindowTarget || this.findSlideWindowTarget();\n if (scroller instanceof HTMLElementCtor) {\n scroller.scrollTop = top;\n scroller.scrollLeft = left;\n }\n else {\n view.scrollTo(left, top);\n }\n }\n }\n getMountedSlideElements() {\n var _a;\n const HTMLElementCtor = ((_a = this.target.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.HTMLElement) || HTMLElement;\n const slides = [];\n for (const child of Array.from(this.content.children)) {\n if (!(child instanceof HTMLElementCtor)) {\n continue;\n }\n if (this.isSlideElement(child)) {\n slides.push(child);\n continue;\n }\n if (!child.classList.contains('flyfish-pptx-slide-slot')) {\n continue;\n }\n const firstChild = child.firstElementChild;\n if (firstChild instanceof HTMLElementCtor && this.isSlideElement(firstChild)) {\n slides.push(firstChild);\n }\n }\n return slides;\n }\n isSlideElement(element) {\n return element.classList.contains('slide') || element.tagName === 'SECTION';\n }\n}\n","import { PptxViewer, RECOMMENDED_ZIP_LIMITS, resolvePptxPackageWorkerUrl } from '@file-viewer/pptx';\nimport { DEFAULT_RENDERER_DEFINITIONS, attachFileViewerErrorMessage, createFileViewerTranslator, createFileViewerZoomChangeEmitter, getFileViewerShadowRootForNode, getDefaultFileViewerAssetBaseUrl, normalizeFileViewerErrorMessage, registerFileViewerZoomProvider, resolveFileViewerLocale, resolveFileViewerPresentationWorkerUrl, resolveFileViewerCopiedAssetUrl, resolveFileViewerRuntimeAssetBaseUrl, waitForFileViewerNextPaint, unregisterFileViewerZoomProvider, } from '@file-viewer/core';\nconst pptxStyle = `\n.pptx-viewer-shell{position:relative;box-sizing:border-box;min-height:100%;padding:24px 20px;background:var(--file-viewer-render-surface-background,#eef3f8);color:#1f2d3b;font-family:Aptos,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif}\n.pptx-render-surface{min-height:240px}\n.pptx-render-surface.is-loading{opacity:.72}\n.pptx-loading{position:sticky;top:12px;z-index:3;box-sizing:border-box;display:inline-flex;align-items:center;gap:10px;margin:0 0 16px 50%;padding:10px 14px;border:1px solid rgba(42,94,144,.14);border-radius:999px;background:rgba(255,255,255,.92);color:#41556b;box-shadow:0 12px 32px rgba(24,44,64,.12);transform:translateX(-50%)}\n.pptx-loading[hidden],.pptx-error[hidden]{display:none!important}\n.pptx-loading-dot{width:9px;height:9px;border-radius:999px;background:#1f9d67;box-shadow:0 0 0 6px rgba(31,157,103,.13)}\n.pptx-error{box-sizing:border-box;width:min(680px,calc(100% - 32px));margin:48px auto;padding:24px;border:1px solid rgba(28,43,58,.12);border-radius:14px;background:#fff;color:#1f2d3b;box-shadow:0 16px 42px rgba(25,42,54,.08)}\n.pptx-slideshow-button{position:sticky;top:12px;z-index:4;float:right;display:inline-flex;align-items:center;gap:8px;margin:0 0 12px;padding:8px 14px;border:1px solid rgba(42,94,144,.16);border-radius:999px;background:rgba(255,255,255,.94);color:#2a5e90;font:13px/1.2 inherit;cursor:pointer;box-shadow:0 10px 26px rgba(24,44,64,.12)}\n.pptx-slideshow-button:hover{border-color:rgba(42,94,144,.34);color:#1d4a75}\n.pptx-slideshow-button:focus-visible{outline:2px solid #2a5e90;outline-offset:2px}\n.pptx-slideshow-button[hidden]{display:none!important}\n.pptx-slideshow-button-glyph{font-size:11px;line-height:1}\n.pptx-slideshow-button-key{padding:1px 6px;border-radius:6px;background:rgba(42,94,144,.1);font-size:11px;letter-spacing:.04em}\n[data-viewer-theme='dark'] .pptx-slideshow-button{border-color:rgba(148,163,184,.2);background:rgba(15,23,42,.92);color:#cbd5e1}\n[data-viewer-theme='dark'] .pptx-slideshow-button-key{background:rgba(148,163,184,.16)}\n.pptx-error strong{display:block;margin-bottom:10px;font-size:18px}\n.pptx-error p{margin:0;color:#607282;line-height:1.7}\n[data-viewer-theme='dark'] .pptx-viewer-shell{background:var(--file-viewer-render-surface-background,#101820);color:#e5eef8}\n[data-viewer-theme='dark'] .pptx-loading{border-color:rgba(148,163,184,.18);background:rgba(15,23,42,.9);color:#cbd5e1;box-shadow:0 18px 44px rgba(0,0,0,.26)}\n[data-viewer-theme='dark'] .pptx-error{border-color:rgba(148,163,184,.18);background:#151f2b;color:#f8fafc;box-shadow:0 22px 56px rgba(0,0,0,.32)}\n[data-viewer-theme='dark'] .pptx-error p{color:#94a3b8}\n[data-viewer-theme='dark'] .pptx-render-surface .slide,[data-viewer-theme='dark'] .pptx-render-surface [data-slide-index]{color-scheme:only light;forced-color-adjust:none}\n@media (prefers-color-scheme:dark){[data-viewer-theme='system'] .pptx-viewer-shell{background:var(--file-viewer-render-surface-background,#101820);color:#e5eef8}[data-viewer-theme='system'] .pptx-loading{border-color:rgba(148,163,184,.18);background:rgba(15,23,42,.9);color:#cbd5e1;box-shadow:0 18px 44px rgba(0,0,0,.26)}[data-viewer-theme='system'] .pptx-error{border-color:rgba(148,163,184,.18);background:#151f2b;color:#f8fafc;box-shadow:0 22px 56px rgba(0,0,0,.32)}[data-viewer-theme='system'] .pptx-error p{color:#94a3b8}[data-viewer-theme='system'] .pptx-render-surface .slide,[data-viewer-theme='system'] .pptx-render-surface [data-slide-index]{color-scheme:only light;forced-color-adjust:none}}\n`;\nconst pptxPrintStyle = `\n .pptx-viewer-shell {\n background: #fff !important;\n padding: 0 !important;\n }\n .pptx-render-surface {\n display: block !important;\n overflow: visible !important;\n }\n .pptx-render-surface [data-slide-index] {\n break-after: page;\n page-break-after: always;\n margin: 0 auto !important;\n }\n .pptx-render-surface [data-slide-index]:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n`;\nconst SLIDESHOW_HOTKEY_LABEL = 'F5 / P';\nconst activePptxShells = new WeakMap();\nconst createStyle = (documentRef) => {\n const style = documentRef.createElement('style');\n style.textContent = pptxStyle;\n return style;\n};\nconst createElement = (documentRef, tagName, className, text) => {\n const element = documentRef.createElement(tagName);\n if (className) {\n element.className = className;\n }\n if (text !== undefined) {\n element.textContent = text;\n }\n return element;\n};\nconst resolvePptxStyleRoot = (surface, context) => {\n var _a, _b;\n return ((_a = context === null || context === void 0 ? void 0 : context.surface) === null || _a === void 0 ? void 0 : _a.shadowRoot) ||\n getFileViewerShadowRootForNode((_b = context === null || context === void 0 ? void 0 : context.surface) === null || _b === void 0 ? void 0 : _b.container) ||\n getFileViewerShadowRootForNode(surface) ||\n undefined;\n};\nconst clampZoomPercent = (value) => {\n return Math.min(300, Math.max(25, Math.round(value)));\n};\nconst pptxDiagnosticMessages = {\n PPTX_FILE_EMPTY: {\n zh: '文件为空或过小,无法读取。',\n en: 'The file is empty or too small to read.',\n ja: 'ファイルが空であるか小さすぎるため、読み込めません。',\n de: 'Die Datei ist leer oder zu klein zum Lesen.',\n },\n PPTX_FILE_TOO_LARGE: {\n zh: '文件超过浏览器安全预览体积限制。',\n en: 'The file is larger than the browser-safe preview limit.',\n ja: 'ファイルがブラウザーで安全にプレビューできるサイズ上限を超えています。',\n de: 'Die Datei überschreitet die sichere Vorschaugröße des Browsers.',\n },\n PPTX_INVALID_ZIP: {\n zh: '文件不是有效的 PowerPoint OpenXML 压缩包。',\n en: 'The file is not a valid PowerPoint OpenXML package.',\n ja: '有効な PowerPoint OpenXML パッケージではありません。',\n de: 'Die Datei ist kein gültiges PowerPoint-OpenXML-Paket.',\n },\n PPTX_MISSING_CONTENT_TYPES: {\n zh: '文件缺少 [Content_Types].xml,无法识别内部结构。',\n en: 'The package is missing [Content_Types].xml, so its structure cannot be identified.',\n ja: '[Content_Types].xml がないため、内部構造を識別できません。',\n de: '[Content_Types].xml fehlt; die Paketstruktur kann nicht erkannt werden.',\n },\n PPTX_MISSING_PRESENTATION: {\n zh: '文件缺少 ppt/presentation.xml,无法读取幻灯片列表。',\n en: 'The package is missing ppt/presentation.xml, so the slide list cannot be read.',\n ja: 'ppt/presentation.xml がないため、スライド一覧を読み込めません。',\n de: 'ppt/presentation.xml fehlt; die Folienliste kann nicht gelesen werden.',\n },\n PPTX_NO_SLIDES: {\n zh: '文件中没有找到可预览的幻灯片。',\n en: 'No previewable slides were found in the file.',\n ja: 'プレビュー可能なスライドが見つかりませんでした。',\n de: 'Es wurden keine Folien für die Vorschau gefunden.',\n },\n PPTX_MISSING_SLIDE: {\n zh: '文件缺少某一页幻灯片内容。',\n en: 'The package is missing one of the slide parts.',\n ja: 'スライド部品の一部がありません。',\n de: 'Ein Folienbestandteil fehlt im Paket.',\n },\n PPTX_SLIDE_RENDER_FAILED: {\n zh: '某一页幻灯片解析失败。',\n en: 'One slide failed to parse.',\n ja: 'スライドの解析に失敗しました。',\n de: 'Eine Folie konnte nicht verarbeitet werden.',\n },\n PPTX_WORKER_FAILED: {\n zh: 'PPTX Worker 启动或运行失败。',\n en: 'The PPTX Worker failed to start or run.',\n ja: 'PPTX Worker の起動または実行に失敗しました。',\n de: 'Der PPTX-Worker konnte nicht gestartet oder ausgeführt werden.',\n },\n PPTX_PARSE_FAILED: {\n zh: 'PPTX 文件解析失败。',\n en: 'The PPTX file could not be parsed.',\n ja: 'PPTX ファイルを解析できませんでした。ファイルを再保存するか、入力元を確認してください。',\n de: 'Die PPTX-Datei konnte nicht verarbeitet werden.',\n },\n};\nconst pptxDiagnosticFallbackHints = {\n PPTX_INVALID_ZIP: {\n zh: '请确认接口返回的是原始 .pptx 二进制文件,而不是登录页、HTML/JSON 错误响应或被截断的内容。',\n en: 'Confirm that the response is the original .pptx binary, not a login page, HTML/JSON error response, or truncated download.',\n ja: 'レスポンスがログインページや HTML/JSON エラー、途中で切れたデータではなく、元の .pptx バイナリであることを確認してください。',\n de: 'Prüfen Sie, ob die Antwort die ursprüngliche .pptx-Datei und keine Anmeldeseite, HTML/JSON-Fehlerantwort oder unvollständige Datei enthält.',\n },\n PPTX_WORKER_FAILED: {\n zh: '请检查 presentation.workerUrl、Worker 文件路径、MIME 类型、CSP 和跨域策略。',\n en: 'Check presentation.workerUrl, the Worker file path, MIME type, CSP, and cross-origin policy.',\n ja: 'presentation.workerUrl、Worker のパス、MIME type、CSP、cross-origin policy を確認してください。',\n de: 'Prüfen Sie presentation.workerUrl, den Worker-Pfad, den MIME-Typ, CSP und die Cross-Origin-Richtlinie.',\n },\n PPTX_NO_SLIDES: {\n zh: '请重新保存演示文稿,或检查包内是否存在 ppt/slides/slide*.xml。',\n en: 'Re-save the presentation, or check whether ppt/slides/slide*.xml exists inside the package.',\n ja: 'プレゼンテーションを再保存するか、パッケージに ppt/slides/slide*.xml があるか確認してください。',\n de: 'Speichern Sie die Präsentation erneut oder prüfen Sie, ob ppt/slides/slide*.xml im Paket vorhanden ist.',\n },\n};\nconst localizePptxDiagnosticCopy = (copy, locale) => {\n if (!copy) {\n return '';\n }\n return locale === 'zh-CN' ? copy.zh : locale === 'ja-JP' ? copy.ja : locale === 'de-DE' ? copy.de : copy.en;\n};\nconst sanitizePptxDiagnosticText = (value) => {\n if (typeof value !== 'string') {\n return '';\n }\n return value.replace(/^Error:\\s*/i, '').trim();\n};\nconst isPptxDiagnosticErrorLike = (error) => {\n return Boolean(error &&\n typeof error === 'object' &&\n (error.name === 'PptxDiagnosticError' ||\n error.code ||\n error.stage));\n};\nconst classifyPptxErrorString = (message) => {\n const lower = message.toLowerCase();\n if (lower.includes('end of central directory') ||\n lower.includes('corrupt zip') ||\n lower.includes('invalid zip') ||\n lower.includes('not a zip') ||\n lower.includes('jszip')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_INVALID_ZIP',\n stage: 'read-zip',\n detail: message,\n };\n }\n if (lower.includes('worker') ||\n lower.includes('script error') ||\n lower.includes('failed to construct') ||\n lower.includes('failed to load')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_WORKER_FAILED',\n stage: 'worker-runtime',\n detail: message,\n };\n }\n if (lower.includes('[content_types].xml')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_MISSING_CONTENT_TYPES',\n stage: 'read-content-types',\n detail: message,\n };\n }\n if (lower.includes('ppt/presentation.xml')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_MISSING_PRESENTATION',\n stage: 'read-presentation',\n detail: message,\n };\n }\n if (lower.includes('slide') || lower.includes('ppt/slides/')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_SLIDE_RENDER_FAILED',\n stage: 'render-slide',\n detail: message,\n };\n }\n return null;\n};\nconst formatPptxDiagnosticError = (error, fallback, context) => {\n const locale = resolveFileViewerLocale(context === null || context === void 0 ? void 0 : context.options);\n const code = String(error.code || 'PPTX_PARSE_FAILED');\n const localizedReason = localizePptxDiagnosticCopy(pptxDiagnosticMessages[code], locale);\n const rawReason = sanitizePptxDiagnosticText(error.message);\n const reason = (locale === 'zh-CN'\n ? rawReason || localizedReason\n : localizedReason || rawReason) || fallback;\n const detail = sanitizePptxDiagnosticText(error.detail);\n const hint = localizePptxDiagnosticCopy(pptxDiagnosticFallbackHints[code], locale) ||\n sanitizePptxDiagnosticText(error.hint);\n const stage = sanitizePptxDiagnosticText(error.stage);\n const usesWesternPunctuation = locale === 'en-US' || locale === 'de-DE';\n const separator = usesWesternPunctuation ? ': ' : ':';\n const parts = [`${fallback}${separator}${reason}`];\n if (stage) {\n parts.push(locale === 'zh-CN' ? `阶段:${stage}` : locale === 'ja-JP' ? `段階:${stage}` : locale === 'de-DE' ? `Phase: ${stage}` : `Stage: ${stage}`);\n }\n if (detail && detail !== reason) {\n parts.push(locale === 'zh-CN' ? `详情:${detail}` : locale === 'ja-JP' ? `詳細:${detail}` : locale === 'de-DE' ? `Details: ${detail}` : `Detail: ${detail}`);\n }\n if (hint) {\n parts.push(locale === 'zh-CN' ? `建议:${hint}` : locale === 'ja-JP' ? `対処:${hint}` : locale === 'de-DE' ? `Hinweis: ${hint}` : `Hint: ${hint}`);\n }\n return parts.join(usesWesternPunctuation ? '; ' : ';');\n};\nconst formatErrorMessage = (error, fallback, context) => {\n if (isPptxDiagnosticErrorLike(error)) {\n return formatPptxDiagnosticError(error, fallback, context);\n }\n if (error instanceof Error || typeof error === 'string') {\n const normalized = normalizeFileViewerErrorMessage(error, context === null || context === void 0 ? void 0 : context.options);\n const classified = classifyPptxErrorString(normalized);\n if (classified) {\n return formatPptxDiagnosticError(classified, fallback, context);\n }\n return normalized || fallback;\n }\n if (error === undefined || error === null) {\n return fallback;\n }\n try {\n const serialized = JSON.stringify(error) || '';\n if (serialized) {\n const classified = classifyPptxErrorString(serialized);\n if (classified) {\n return formatPptxDiagnosticError(classified, fallback, context);\n }\n }\n return serialized || fallback;\n }\n catch {\n return String(error || fallback);\n }\n};\nexport const resolvePptxPreviewErrorMessage = formatErrorMessage;\nconst collectPptxPrintMaskPages = (surface) => {\n const slots = Array.from(surface.querySelectorAll('.flyfish-pptx-slide-slot'));\n return slots.length\n ? slots\n : Array.from(surface.querySelectorAll('[data-slide-index], .slide'));\n};\nconst buildExportAdapter = (surface, targetWindow, getViewer) => ({\n print: true,\n exportHtml: true,\n includeDocumentStyles: true,\n beforeSnapshot: () => waitForFileViewerNextPaint(targetWindow || undefined),\n getPrintMaskPages: () => collectPptxPrintMaskPages(surface),\n printStyle: pptxPrintStyle,\n toHtml: async () => {\n var _a;\n const clone = await ((_a = getViewer()) === null || _a === void 0 ? void 0 : _a.cloneForExport()) || surface.cloneNode(true);\n collectPptxPrintMaskPages(clone).forEach((page, index) => {\n page.dataset.viewerPrintPageIndex = String(index);\n });\n return clone.outerHTML;\n },\n});\nexport default async function renderPptx(buffer, target, _type, context) {\n var _a;\n const t = createFileViewerTranslator(context === null || context === void 0 ? void 0 : context.options);\n const documentRef = target.ownerDocument || document;\n const targetWindow = documentRef.defaultView || (typeof window !== 'undefined' ? window : null);\n const zoomEmitter = createFileViewerZoomChangeEmitter();\n let viewer = null;\n let state = 'loading';\n let errorMessage = '';\n let zoomPercent = 100;\n let progressiveReady = false;\n let disposed = false;\n const style = createStyle(documentRef);\n const shell = createElement(documentRef, 'div', 'pptx-viewer-shell');\n shell.dataset.viewerZoomProvider = 'pptx';\n const loading = createElement(documentRef, 'div', 'pptx-loading');\n loading.setAttribute('aria-live', 'polite');\n loading.append(createElement(documentRef, 'span', 'pptx-loading-dot'), createElement(documentRef, 'span', undefined, t('presentation.state.loading')));\n const error = createElement(documentRef, 'div', 'pptx-error');\n const errorTitle = createElement(documentRef, 'strong', undefined, t('presentation.error.title'));\n const errorText = createElement(documentRef, 'p');\n error.append(errorTitle, errorText);\n const slideshowButton = createElement(documentRef, 'button', 'pptx-slideshow-button');\n slideshowButton.type = 'button';\n slideshowButton.hidden = true;\n const slideshowGlyph = createElement(documentRef, 'span', 'pptx-slideshow-button-glyph', '▶');\n const slideshowText = createElement(documentRef, 'span', undefined, t('presentation.slideshow.start'));\n const slideshowKey = createElement(documentRef, 'span', 'pptx-slideshow-button-key', SLIDESHOW_HOTKEY_LABEL);\n slideshowButton.append(slideshowGlyph, slideshowText, slideshowKey);\n slideshowButton.addEventListener('click', () => {\n void (viewer === null || viewer === void 0 ? void 0 : viewer.togglePresentation());\n });\n const surface = createElement(documentRef, 'div', 'pptx-render-surface');\n shell.append(loading, error, slideshowButton, surface);\n target.replaceChildren(style, shell);\n const activateShell = () => {\n activePptxShells.set(documentRef, shell);\n };\n const deactivateShell = (event) => {\n if ((viewer === null || viewer === void 0 ? void 0 : viewer.presenting) || activePptxShells.get(documentRef) !== shell) {\n return;\n }\n if (event.composedPath().includes(shell)) {\n return;\n }\n const targetElement = event.target;\n if (event.type === 'focusin' &&\n !(targetElement === null || targetElement === void 0 ? void 0 : targetElement.matches('button, a, input, textarea, select, [contenteditable], [tabindex]'))) {\n return;\n }\n activePptxShells.delete(documentRef);\n };\n shell.addEventListener('pointerdown', activateShell);\n shell.addEventListener('focusin', activateShell);\n documentRef.addEventListener('pointerdown', deactivateShell);\n documentRef.addEventListener('focusin', deactivateShell);\n const isEditableTarget = (node) => {\n const element = node;\n if (!element || typeof element.closest !== 'function') {\n return false;\n }\n return Boolean(element.closest('input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]'));\n };\n const handleShortcut = (event) => {\n if (disposed || !viewer || event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n if (event.key !== 'F5' && event.key !== 'p' && event.key !== 'P') {\n return;\n }\n if (!shell.isConnected || isEditableTarget(event.target)) {\n return;\n }\n if (activePptxShells.get(documentRef) !== shell) {\n return;\n }\n const targetElement = event.target;\n if (targetElement && typeof targetElement.closest === 'function') {\n const targetShell = targetElement.closest('.pptx-viewer-shell');\n if (targetShell && targetShell !== shell) {\n return;\n }\n }\n event.preventDefault();\n void viewer.togglePresentation();\n };\n documentRef.addEventListener('keydown', handleShortcut);\n (_a = context === null || context === void 0 ? void 0 : context.registerThumbnailAdapter) === null || _a === void 0 ? void 0 : _a.call(context, {\n captureSource: 'embedded',\n beforeCapture: async ({ signal }) => {\n const hasFirstVisual = () => Boolean((viewer === null || viewer === void 0 ? void 0 : viewer.thumbnailDataUrl) || surface.querySelector('.slide, .flyfish-pptx-thumbnail'));\n while ((state === 'loading' || (state === 'ready' && !hasFirstVisual())) && !disposed) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw signal.reason;\n }\n await new Promise(resolve => {\n if (targetWindow)\n targetWindow.setTimeout(resolve, 16);\n else\n setTimeout(resolve, 16);\n });\n }\n if (state === 'error') {\n throw new Error(errorMessage || t('presentation.error.parseFailed'));\n }\n },\n capture: () => (viewer === null || viewer === void 0 ? void 0 : viewer.thumbnailDataUrl)\n ? fetch(viewer.thumbnailDataUrl).then(response => response.blob())\n : null,\n getTarget: () => surface,\n });\n const getCurrentZoomPercent = () => { var _a; return clampZoomPercent((_a = viewer === null || viewer === void 0 ? void 0 : viewer.zoomPercent) !== null && _a !== void 0 ? _a : zoomPercent); };\n const getZoomState = () => {\n const percent = getCurrentZoomPercent();\n return {\n scale: percent / 100,\n label: `${percent}%`,\n canZoomIn: percent < 300,\n canZoomOut: percent > 25,\n canReset: percent !== 100,\n minScale: 0.25,\n maxScale: 3,\n };\n };\n const setZoom = async (percent) => {\n const nextPercent = clampZoomPercent(percent);\n zoomPercent = nextPercent;\n if (viewer) {\n await viewer.setZoom(nextPercent);\n zoomPercent = getCurrentZoomPercent();\n }\n zoomEmitter.emit();\n return getZoomState();\n };\n const notifyProgressiveReady = () => {\n var _a, _b;\n if (progressiveReady || disposed || ((_a = context === null || context === void 0 ? void 0 : context.signal) === null || _a === void 0 ? void 0 : _a.aborted)) {\n return;\n }\n progressiveReady = true;\n (_b = context === null || context === void 0 ? void 0 : context.onProgressiveRender) === null || _b === void 0 ? void 0 : _b.call(context);\n };\n const syncUi = () => {\n var _a;\n loading.hidden = !(state === 'loading' && !errorMessage);\n error.hidden = state !== 'error';\n errorText.textContent = errorMessage;\n surface.classList.toggle('is-loading', state === 'loading');\n const presenting = Boolean(viewer === null || viewer === void 0 ? void 0 : viewer.presenting);\n slideshowButton.hidden = state !== 'ready' || ((_a = viewer === null || viewer === void 0 ? void 0 : viewer.slideCount) !== null && _a !== void 0 ? _a : 0) === 0;\n slideshowText.textContent = presenting\n ? t('presentation.slideshow.exit')\n : t('presentation.slideshow.start');\n slideshowButton.setAttribute('aria-pressed', presenting ? 'true' : 'false');\n };\n const registerExportAdapter = () => {\n var _a;\n (_a = context === null || context === void 0 ? void 0 : context.registerExportAdapter) === null || _a === void 0 ? void 0 : _a.call(context, buildExportAdapter(surface, targetWindow, () => viewer));\n };\n const reportPptxFailure = (failure) => {\n var _a;\n state = 'error';\n errorMessage = formatErrorMessage(failure, t('presentation.error.parseFailed'), context);\n (_a = context === null || context === void 0 ? void 0 : context.registerExportAdapter) === null || _a === void 0 ? void 0 : _a.call(context, null);\n syncUi();\n return attachFileViewerErrorMessage(failure, errorMessage);\n };\n registerFileViewerZoomProvider(shell, {\n zoomIn: () => setZoom(getCurrentZoomPercent() + 15),\n zoomOut: () => setZoom(getCurrentZoomPercent() - 15),\n resetZoom: () => setZoom(100),\n setZoom: scale => setZoom(scale * 100),\n getState: getZoomState,\n subscribe: zoomEmitter.subscribe,\n });\n const openPresentation = async () => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n state = 'loading';\n errorMessage = '';\n progressiveReady = false;\n syncUi();\n const presentationOptions = (_a = context === null || context === void 0 ? void 0 : context.options) === null || _a === void 0 ? void 0 : _a.presentation;\n let resolveCompletion;\n let rejectCompletion;\n const completion = new Promise((resolve, reject) => {\n resolveCompletion = resolve;\n rejectCompletion = reject;\n });\n void completion.catch(() => { });\n const abort = () => {\n var _a;\n const reason = ((_a = context === null || context === void 0 ? void 0 : context.signal) === null || _a === void 0 ? void 0 : _a.reason) || new DOMException('PPTX rendering aborted.', 'AbortError');\n viewer === null || viewer === void 0 ? void 0 : viewer.destroy();\n viewer = null;\n rejectCompletion(reason);\n };\n (_b = context === null || context === void 0 ? void 0 : context.signal) === null || _b === void 0 ? void 0 : _b.addEventListener('abort', abort, { once: true });\n try {\n if ((_c = context === null || context === void 0 ? void 0 : context.signal) === null || _c === void 0 ? void 0 : _c.aborted) {\n throw context.signal.reason || new DOMException('PPTX rendering aborted.', 'AbortError');\n }\n const workerUrl = (presentationOptions === null || presentationOptions === void 0 ? void 0 : presentationOptions.workerUrl) || getDefaultFileViewerAssetBaseUrl()\n ? resolveFileViewerPresentationWorkerUrl(presentationOptions, resolveFileViewerRuntimeAssetBaseUrl(documentRef))\n : resolvePptxPackageWorkerUrl() ||\n await resolveFileViewerCopiedAssetUrl(documentRef, 'office-presentation', 'pptx-worker', context === null || context === void 0 ? void 0 : context.signal);\n if ((_d = context === null || context === void 0 ? void 0 : context.signal) === null || _d === void 0 ? void 0 : _d.aborted) {\n throw context.signal.reason || new DOMException('PPTX rendering aborted.', 'AbortError');\n }\n if (!workerUrl) {\n throw new Error('PPTX Worker URL is unavailable. Run file-viewer-copy-assets or provide presentation.workerUrl.');\n }\n const nextViewer = await PptxViewer.open(buffer, surface, {\n styleRoot: resolvePptxStyleRoot(surface, context),\n fitMode: 'contain',\n zoomPercent,\n workerUrl,\n workerType: presentationOptions === null || presentationOptions === void 0 ? void 0 : presentationOptions.workerType,\n zipLimits: RECOMMENDED_ZIP_LIMITS,\n lazySlides: true,\n lazyMedia: true,\n listOptions: {\n windowed: true,\n initialSlides: 3,\n batchSize: 4,\n overscanViewport: 1.5,\n },\n presentationLabels: {\n exit: t('presentation.slideshow.exit'),\n hint: t('presentation.slideshow.hint'),\n },\n onPresentationChange: state => {\n if (!disposed) {\n if (state.active) {\n activePptxShells.set(documentRef, shell);\n }\n syncUi();\n }\n },\n onSlideRendered: () => notifyProgressiveReady(),\n onRenderComplete: () => {\n var _a;\n if (disposed || ((_a = context === null || context === void 0 ? void 0 : context.signal) === null || _a === void 0 ? void 0 : _a.aborted)) {\n return;\n }\n state = 'ready';\n notifyProgressiveReady();\n zoomPercent = getCurrentZoomPercent();\n syncUi();\n zoomEmitter.emit();\n resolveCompletion();\n },\n onSlideError: (_index, error) => {\n console.warn('PPTX slide render warning:', error);\n },\n onError: error => {\n var _a;\n if (disposed || ((_a = context === null || context === void 0 ? void 0 : context.signal) === null || _a === void 0 ? void 0 : _a.aborted)) {\n return;\n }\n rejectCompletion(reportPptxFailure(error));\n },\n });\n if (disposed || ((_e = context === null || context === void 0 ? void 0 : context.signal) === null || _e === void 0 ? void 0 : _e.aborted)) {\n nextViewer.destroy();\n throw ((_f = context === null || context === void 0 ? void 0 : context.signal) === null || _f === void 0 ? void 0 : _f.reason) || new DOMException('PPTX rendering aborted.', 'AbortError');\n }\n viewer = nextViewer;\n await completion;\n if (disposed || ((_g = context === null || context === void 0 ? void 0 : context.signal) === null || _g === void 0 ? void 0 : _g.aborted)) {\n throw ((_h = context === null || context === void 0 ? void 0 : context.signal) === null || _h === void 0 ? void 0 : _h.reason) || new DOMException('PPTX rendering aborted.', 'AbortError');\n }\n zoomPercent = getCurrentZoomPercent();\n registerExportAdapter();\n syncUi();\n zoomEmitter.emit();\n }\n catch (error) {\n if (disposed || ((_j = context === null || context === void 0 ? void 0 : context.signal) === null || _j === void 0 ? void 0 : _j.aborted)) {\n throw error;\n }\n viewer === null || viewer === void 0 ? void 0 : viewer.destroy();\n viewer = null;\n throw reportPptxFailure(error);\n }\n finally {\n (_k = context === null || context === void 0 ? void 0 : context.signal) === null || _k === void 0 ? void 0 : _k.removeEventListener('abort', abort);\n }\n };\n const cleanup = () => {\n var _a, _b;\n if (disposed) {\n return;\n }\n disposed = true;\n documentRef.removeEventListener('keydown', handleShortcut);\n documentRef.removeEventListener('pointerdown', deactivateShell);\n documentRef.removeEventListener('focusin', deactivateShell);\n shell.removeEventListener('pointerdown', activateShell);\n shell.removeEventListener('focusin', activateShell);\n if (activePptxShells.get(documentRef) === shell) {\n activePptxShells.delete(documentRef);\n }\n (_a = context === null || context === void 0 ? void 0 : context.registerExportAdapter) === null || _a === void 0 ? void 0 : _a.call(context, null);\n (_b = context === null || context === void 0 ? void 0 : context.registerThumbnailAdapter) === null || _b === void 0 ? void 0 : _b.call(context, null);\n unregisterFileViewerZoomProvider(shell);\n viewer === null || viewer === void 0 ? void 0 : viewer.destroy();\n viewer = null;\n target.replaceChildren();\n };\n try {\n await openPresentation();\n }\n catch (error) {\n cleanup();\n throw error;\n }\n return {\n $el: shell,\n unmount: cleanup,\n };\n}\nconst presentationDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'office-presentation');\nif (!presentationDefinition) {\n throw new Error('@file-viewer/renderer-pptx could not locate the core PPTX renderer definition.');\n}\nexport const presentationRendererDefinition = presentationDefinition;\nexport const renderFileViewerPresentation = renderPptx;\nexport const pptxRenderer = {\n id: 'file-viewer-renderer-presentation-pptx',\n label: 'Flyfish File Viewer PPTX renderer',\n definitions: [presentationRendererDefinition],\n handlers: [\n {\n rendererId: presentationRendererDefinition.id,\n handler: renderFileViewerPresentation,\n },\n ],\n};\n","import { decodeFileViewerTextBuffer, resolveFileViewerTextEncoding } from '@file-viewer/core';\nconst ole = [0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1];\nconst wordMlNamespace = 'http://schemas.microsoft.com/office/word/2003/wordml';\nconst xmlNameStart = String.raw `A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF` +\n String.raw `\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F` +\n String.raw `\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}`;\nconst xmlName = String.raw `[${xmlNameStart}][${xmlNameStart}.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040-]*`;\nconst wordMlRoot = new RegExp(String.raw `^<(?:(${xmlName}):)?wordDocument(?=[\\t\\n\\r />])`, 'u');\nfunction documentStart(text) {\n let index = text.charCodeAt(0) === 0xfeff ? 1 : 0;\n while (index <= text.length) {\n while (index < text.length && /\\s/.test(text[index]))\n index++;\n const closing = text.startsWith('<?', index) ? '?>' : text.startsWith('<!--', index) ? '-->' : null;\n if (!closing)\n return text.slice(index);\n const end = text.indexOf(closing, index + 2);\n if (end < 0)\n return null;\n index = end + closing.length;\n }\n return '';\n}\nfunction decodeNamespace(value) {\n const named = { amp: '&', lt: '<', gt: '>', quot: '\"', apos: \"'\" };\n return value.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, (entity, name) => {\n if (!name.startsWith('#'))\n return named[name];\n const point = name.startsWith('#x') ? Number.parseInt(name.slice(2), 16) : Number.parseInt(name.slice(1), 10);\n return point > 0 && point <= 0x10ffff && !(point >= 0xd800 && point <= 0xdfff)\n ? String.fromCodePoint(point) : entity;\n });\n}\nfunction isWordMlRoot(start) {\n var _a;\n const root = wordMlRoot.exec(start);\n if (!root)\n return false;\n const attributes = new Map();\n const attributeName = new RegExp(String.raw `(?:${xmlName}:)?${xmlName}`, 'uy');\n let index = root[0].length;\n while (index < start.length) {\n const beforeSpace = index;\n while (index < start.length && /[\\t\\n\\r ]/.test(start[index]))\n index++;\n if (start[index] === '>' || start.startsWith('/>', index)) {\n return decodeNamespace(attributes.get(root[1] ? 'xmlns:' + root[1] : 'xmlns') || '') === wordMlNamespace;\n }\n if (index === beforeSpace)\n return false;\n attributeName.lastIndex = index;\n const name = (_a = attributeName.exec(start)) === null || _a === void 0 ? void 0 : _a[0];\n if (!name || attributes.has(name))\n return false;\n index = attributeName.lastIndex;\n while (index < start.length && /[\\t\\n\\r ]/.test(start[index]))\n index++;\n if (start[index++] !== '=')\n return false;\n while (index < start.length && /[\\t\\n\\r ]/.test(start[index]))\n index++;\n const quote = start[index++];\n if (quote !== '\"' && quote !== \"'\")\n return false;\n const end = start.indexOf(quote, index);\n if (end < 0 || start.slice(index, end).includes('<'))\n return false;\n attributes.set(name, start.slice(index, end));\n index = end + 1;\n }\n return false;\n}\nfunction hasWordMlDocument(sample) {\n var _a, _b;\n const bytes = new Uint8Array(sample);\n const utf16le = (bytes[0] === 0xff && bytes[1] === 0xfe) || (bytes[0] === 0x3c && bytes[1] === 0);\n const utf16be = (bytes[0] === 0xfe && bytes[1] === 0xff) || (bytes[0] === 0 && bytes[1] === 0x3c);\n const utf8Bom = bytes[0] === 0xef && bytes[1] === 0xbb && bytes[2] === 0xbf;\n const detected = utf16le ? 'utf-16le' : utf16be ? 'utf-16be' : utf8Bom ? 'utf-8' : null;\n try {\n const prefix = new TextDecoder(detected || 'windows-1252').decode(bytes.subarray(0, 1024));\n const declaration = (_a = /^<\\?xml\\s[^?]*\\?>/.exec(prefix)) === null || _a === void 0 ? void 0 : _a[0];\n const declared = declaration && ((_b = /\\sencoding\\s*=\\s*([\"'])([A-Za-z][A-Za-z0-9._-]*)\\1/.exec(declaration)) === null || _b === void 0 ? void 0 : _b[2]);\n const start = documentStart(new TextDecoder(detected || declared || 'utf-8').decode(bytes));\n return start !== null && isWordMlRoot(start);\n }\n catch {\n return false;\n }\n}\nexport function resolveWordContainer(buffer) {\n const bytes = new Uint8Array(buffer);\n if (bytes[0] === 0x50 && bytes[1] === 0x4b)\n return 'openxml';\n if (!bytes.length || ole.every((byte, index) => bytes[index] === byte))\n return 'binary';\n const sample = buffer.slice(0, Math.min(buffer.byteLength, 65536));\n const encoding = resolveFileViewerTextEncoding(new Uint8Array(sample)).encoding;\n if (encoding.startsWith('utf-16') && buffer.byteLength % 2 !== 0)\n return 'binary';\n if (hasWordMlDocument(sample))\n return 'wordml';\n let text;\n try {\n text = decodeFileViewerTextBuffer(sample).text;\n }\n catch {\n return 'binary';\n }\n const start = documentStart(text);\n if (start === null)\n return 'binary';\n if (/^(?:<!doctype\\s+html\\b|<html\\b|<head\\b|<body\\b)/i.test(start))\n return 'html';\n if (/^[<{]/.test(start) || /[\\u0000-\\u0008\\u000b\\u000e-\\u001f\\u007f]/.test(text))\n return 'binary';\n const replacements = (text.match(/\\uFFFD/g) || []).length;\n return replacements > Math.max(1, text.length * 0.01) ? 'binary' : 'text';\n}\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nexport { getFileViewerRtfLoader, registerFileViewerRtfLoader, } from './optionalCapabilities.js';\nexport { createFileViewerRtfHyperlinkContainer, isSafeFileViewerRtfHyperlink, sanitizeFileViewerRtfElement, sanitizeFileViewerRtfHtml, sanitizeFileViewerRtfHyperlink, } from './sanitizeRtf.js';\nconst wordRendererIds = [\n 'office-word-openxml',\n 'office-word-binary',\n 'open-document',\n];\nconst wordDefinitions = DEFAULT_RENDERER_DEFINITIONS.filter(definition => wordRendererIds.includes(definition.id));\nif (wordDefinitions.length !== wordRendererIds.length) {\n throw new Error('@file-viewer/renderer-word could not locate the shared Word renderer definitions.');\n}\nexport const wordRendererDefinitions = wordDefinitions;\nexport const renderFileViewerWordDocx = (buffer, target, _type, context) => renderFileViewerWordDoc(buffer, target, _type, context);\nexport { resolveWordContainer as resolveFileViewerWordContainer } from './wordContainer.js';\nimport { resolveWordContainer } from './wordContainer.js';\nexport const renderFileViewerWordDoc = (buffer, target, _type, context) => {\n const container = resolveWordContainer(buffer);\n if (container === 'html' || container === 'text') {\n return import('./wordText.js').then(({ renderWordText }) => renderWordText(buffer, target, container, context));\n }\n if (container === 'wordml') {\n return Promise.all([import('./wordMl.js'), import('./wordDocx.js')])\n .then(async ([{ convertWordMlToDocx }, { default: renderWordDocx }]) => renderWordDocx(await convertWordMlToDocx(buffer, target), target, context));\n }\n return container === 'openxml'\n ? import('./wordDocx.js').then(({ default: renderWordDocx }) => renderWordDocx(buffer, target, context))\n : import('./wordDoc.js').then(({ default: renderWordDoc }) => renderWordDoc(buffer, target, context));\n};\nexport const renderFileViewerOpenDocument = (buffer, target, type, context) => import('./openDocument.js').then(({ default: renderOpenDocument }) => renderOpenDocument(buffer, target, type, context));\nexport const wordRenderer = {\n id: 'file-viewer-renderer-word',\n label: 'Flyfish File Viewer Word renderer',\n definitions: wordRendererDefinitions,\n handlers: [\n {\n rendererId: 'office-word-openxml',\n handler: renderFileViewerWordDocx,\n },\n {\n rendererId: 'office-word-binary',\n handler: renderFileViewerWordDoc,\n },\n {\n rendererId: 'open-document',\n handler: renderFileViewerOpenDocument,\n },\n ],\n};\nexport default wordRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst spreadsheetDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'spreadsheet-openxml');\nconst dbfDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'spreadsheet-dbf');\nif (!spreadsheetDefinition || !dbfDefinition) {\n throw new Error('@file-viewer/renderer-spreadsheet could not locate the shared Spreadsheet format definition.');\n}\nexport const spreadsheetRendererDefinition = spreadsheetDefinition;\nexport const dbfRendererDefinition = dbfDefinition;\nexport const renderFileViewerSpreadsheet = (buffer, target, type, context) => import('./spreadsheet.js').then(({ default: renderSpreadsheet }) => renderSpreadsheet(buffer, target, type, context));\nexport const spreadsheetRenderer = {\n id: 'file-viewer-renderer-spreadsheet',\n label: 'Flyfish File Viewer Spreadsheet renderer',\n definitions: [spreadsheetRendererDefinition, dbfRendererDefinition],\n handlers: [spreadsheetRendererDefinition, dbfRendererDefinition].map(definition => ({\n rendererId: definition.id,\n handler: renderFileViewerSpreadsheet,\n })),\n};\nexport default spreadsheetRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst ofdDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'ofd');\nif (!ofdDefinition) {\n throw new Error('@file-viewer/renderer-ofd could not locate the core OFD renderer definition.');\n}\nexport const ofdRendererDefinition = ofdDefinition;\nexport const renderFileViewerOfd = (buffer, target, _type, context) => import('./ofd.js').then(({ default: renderOfd }) => renderOfd(buffer, target, context));\nexport const ofdRenderer = {\n id: 'file-viewer-renderer-ofd',\n label: 'Flyfish File Viewer OFD renderer',\n definitions: [ofdRendererDefinition],\n handlers: [{\n rendererId: ofdRendererDefinition.id,\n handler: renderFileViewerOfd,\n }],\n};\nexport default ofdRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst emailDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'email');\nif (!emailDefinition) {\n throw new Error('@file-viewer/renderer-email could not locate the shared email format definition.');\n}\nexport const emailRendererDefinition = emailDefinition;\nexport const renderFileViewerEmail = (buffer, target, type, context) => import('./email.js').then(({ default: renderEmail }) => renderEmail(buffer, target, type, context));\nexport const emailRenderer = {\n id: 'file-viewer-renderer-email',\n label: 'Flyfish File Viewer email renderer',\n definitions: [emailRendererDefinition],\n handlers: [{\n rendererId: emailRendererDefinition.id,\n handler: renderFileViewerEmail,\n }],\n};\nexport default emailRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst mindmapDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'mindmap');\nif (!mindmapDefinition) {\n throw new Error('@file-viewer/renderer-mindmap could not locate the core mind map renderer definition.');\n}\nexport const mindmapRendererDefinition = mindmapDefinition;\nexport const renderFileViewerMindMap = (buffer, target, type, context) => import('./xmind.js').then(({ default: renderXMind }) => renderXMind(buffer, target, type, context));\nexport const mindmapRenderer = {\n id: 'file-viewer-renderer-mindmap',\n label: 'Flyfish File Viewer mind map renderer',\n definitions: [mindmapRendererDefinition],\n handlers: [{\n rendererId: mindmapRendererDefinition.id,\n handler: renderFileViewerMindMap,\n }],\n};\nexport default mindmapRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nexport { disableFileViewerDrawioOfficialViewer, enableFileViewerDrawioOfficialViewer, isFileViewerDrawioOfficialViewerEnabled, } from './optionalCapabilities.js';\nconst drawingDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'drawing');\nif (!drawingDefinition) {\n throw new Error('@file-viewer/renderer-drawing could not locate the core drawing renderer definition.');\n}\nexport const drawingRendererDefinition = drawingDefinition;\nexport const renderFileViewerDrawing = (buffer, target, type, context) => import('./drawing.js').then(({ default: renderDrawing }) => renderDrawing(buffer, target, type, context));\nexport const drawingRenderer = {\n id: 'file-viewer-renderer-drawing',\n label: 'Flyfish File Viewer drawing renderer',\n definitions: [drawingRendererDefinition],\n handlers: [{\n rendererId: drawingRendererDefinition.id,\n handler: renderFileViewerDrawing,\n }],\n};\nexport default drawingRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst dataDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'data-asset');\nif (!dataDefinition) {\n throw new Error('@file-viewer/renderer-data could not locate the shared data asset renderer definition.');\n}\nexport const dataRendererDefinition = dataDefinition;\nexport const renderFileViewerData = (buffer, target, type, context) => import('./data.js').then(({ default: renderDataAsset }) => renderDataAsset(buffer, target, type, context));\nexport const dataRenderer = {\n id: 'file-viewer-renderer-data',\n label: 'Flyfish File Viewer data asset renderer',\n definitions: [dataRendererDefinition],\n handlers: [{\n rendererId: dataRendererDefinition.id,\n handler: renderFileViewerData,\n }],\n};\nexport default dataRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst geoDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'geo');\nif (!geoDefinition) {\n throw new Error('@file-viewer/renderer-geo could not locate the core geospatial renderer definition.');\n}\nexport const geoRendererDefinition = geoDefinition;\nexport const renderFileViewerGeo = (buffer, target, type, context) => import('./geo.js').then(({ default: renderGeo }) => renderGeo(buffer, target, type, context));\nexport const geoRenderer = {\n id: 'file-viewer-renderer-geo',\n label: 'Flyfish File Viewer geospatial renderer',\n definitions: [geoRendererDefinition],\n handlers: [{\n rendererId: geoRendererDefinition.id,\n handler: renderFileViewerGeo,\n }],\n};\nexport default geoRenderer;\n","const key = Symbol.for('@file-viewer/renderer-text/xml-profiles');\nconst registry = globalThis;\nexport function registerXmlProfiles(loader) {\n var _a;\n const registrations = (_a = registry[key]) !== null && _a !== void 0 ? _a : (registry[key] = new Map());\n const token = Symbol();\n registrations.set(token, loader);\n return () => { registrations.delete(token); };\n}\nexport function getXmlProfilesLoader() {\n var _a;\n return (_a = registry[key]) === null || _a === void 0 ? void 0 : _a.values().next().value;\n}\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nimport { getXmlProfilesLoader } from './xmlRegistration.js';\nexport { getFileViewerMermaidLoader, getFileViewerDiffToHtml, getFileViewerPakoLoader, registerFileViewerDiffToHtml, registerFileViewerMermaidLoader, registerFileViewerPakoLoader, } from './optionalCapabilities.js';\nexport { sanitizeFileViewerRichHtml } from './sanitizeHtml.js';\nconst textRendererIds = ['code', 'markdown'];\nconst textDefinitions = DEFAULT_RENDERER_DEFINITIONS.filter(definition => textRendererIds.includes(definition.id));\nif (textDefinitions.length !== textRendererIds.length) {\n throw new Error('@file-viewer/renderer-text could not locate the shared code/markdown format definitions.');\n}\nexport const textRendererDefinitions = textDefinitions;\nexport const renderFileViewerCode = async (buffer, target, type, context) => {\n var _a, _b, _c, _d, _e;\n if ((type === null || type === void 0 ? void 0 : type.trim().toLowerCase()) === 'lrc') {\n const { default: renderLrc } = await import('./lrc.js');\n return renderLrc(buffer, target, type, context);\n }\n if (/^(?:html|htm)$/i.test(type || '')) {\n const { default: renderHtml } = await import('./html.js');\n return renderHtml(buffer, target, type, context);\n }\n if ((type === null || type === void 0 ? void 0 : type.trim().toLowerCase()) === 'xml' && ((_a = context === null || context === void 0 ? void 0 : context.options) === null || _a === void 0 ? void 0 : _a.xml)) {\n const loader = getXmlProfilesLoader();\n if (loader) {\n const { default: renderXml } = await loader();\n return renderXml(buffer, target, context);\n }\n const message = 'Enable @file-viewer/renderer-text/xml-profiles and deploy its self-hosted runtime assets.';\n try {\n (_c = (_b = context.options.xml).onDiagnostic) === null || _c === void 0 ? void 0 : _c.call(_b, { code: 'capability-unavailable', message });\n }\n catch { }\n try {\n (_e = (_d = context.options).onDiagnostic) === null || _e === void 0 ? void 0 : _e.call(_d, { code: 'xml-profile-capability-unavailable', level: 'warning', message });\n }\n catch { }\n }\n const { default: renderCode } = await import('./code.js');\n return renderCode(buffer, target, type, context);\n};\nexport const renderFileViewerMarkdown = (buffer, target, type, context) => import('./largeText.js').then(async ({ default: renderLargeText, shouldVirtualizeMarkdownBuffer }) => {\n if (shouldVirtualizeMarkdownBuffer(buffer, context)) {\n return renderLargeText(buffer, target, type || 'md', context);\n }\n const { default: renderMarkdown } = await import('./markdown.js');\n return renderMarkdown(buffer, target, context);\n});\nexport const textRenderer = {\n id: 'file-viewer-renderer-text',\n label: 'Flyfish File Viewer text renderer',\n definitions: textRendererDefinitions,\n handlers: [\n {\n rendererId: 'code',\n handler: renderFileViewerCode,\n },\n {\n rendererId: 'markdown',\n handler: renderFileViewerMarkdown,\n },\n ],\n};\nexport default textRenderer;\n","import { useEffect, useMemo, useState } from 'react';\nimport FileViewer from '@file-viewer/react';\nimport { archiveRenderer } from '@file-viewer/renderer-archive';\nimport { usePreviewOptions } from '../preview-context';\nimport archiveWorkerUrl from 'libarchive.js/dist/worker-bundle.js?url';\nimport archiveWasmUrl from 'libarchive.js/dist/libarchive.wasm?url';\nimport { configuredFileViewerRenderers } from 'virtual:file-viewer-renderers';\nimport { useThemeController } from \"@/providers/theme-controller\";\nimport { isSpreadsheetFile, resolveFileMimeType } from \"@/utils/file-utils\";\nimport type { CSSProperties } from 'react';\nimport type { ViewerOptions } from '@file-viewer/react';\ninterface FileViewerPreviewPanelProps {\n readonly file: File;\n readonly style?: CSSProperties;\n}\nconst fileViewerRenderers = [\n ...(Array.isArray(configuredFileViewerRenderers)\n ? configuredFileViewerRenderers\n : [configuredFileViewerRenderers]),\n archiveRenderer,\n] satisfies NonNullable<ViewerOptions['renderers']>;\n/** 文件浏览器端只读预览,不依赖外部预览或转换服务。 */\nexport default function FileViewerPreviewPanel({ file, style }: FileViewerPreviewPanelProps) {\n const { isDark } = useThemeController();\n const preview = usePreviewOptions();\n const legacy = preview?.legacyPpt;\n const missingLegacy = /\\.(?:ppt|pot|pps)$/i.test(file.name) && !legacy;\n const [downloadUrl, setDownloadUrl] = useState('');\n useEffect(() => {\n if (!missingLegacy) return;\n const url = URL.createObjectURL(file); setDownloadUrl(url);\n return () => URL.revokeObjectURL(url);\n }, [file, missingLegacy]);\n // 表格渲染器的暗色主题不会调和文件内嵌样式(如导出文件的黑字、浅灰表头填充),\n // 会出现黑字压暗底 / 亮字压浅底的不可读组合,因此表格预览恒用亮色渲染\n const isSpreadsheet = isSpreadsheetFile(resolveFileMimeType(file.type, file.name));\n const useDarkTheme = isDark && !isSpreadsheet;\n const options = useMemo<ViewerOptions>(() => ({\n theme: useDarkTheme ? 'dark' : 'light',\n locale: 'zh-CN',\n styleIsolation: 'shadow',\n rendererMode: 'replace',\n autoRenderers: false,\n // FileViewer creates a div rendering target; upstream's default generic\n // uses HTMLElement and otherwise rejects correctly typed div renderers.\n renderers: [...fileViewerRenderers, ...(Array.isArray(legacy?.renderers) ? legacy.renderers : legacy?.renderers ? [legacy.renderers] : [])] as ViewerOptions['renderers'],\n presentation: legacy?.presentation,\n ui: { density: 'compact' },\n toolbar: {\n position: 'top-center',\n download: false,\n print: true,\n exportHtml: false,\n zoom: true,\n search: true,\n theme: false,\n },\n docx: {\n worker: true,\n visualPagination: true,\n },\n spreadsheet: {\n worker: 'auto',\n textEncoding: 'auto',\n resizableColumns: true,\n resizableRows: true,\n },\n archive: {\n workerUrl: archiveWorkerUrl,\n wasmUrl: archiveWasmUrl,\n },\n drawing: {\n // vite-plugin 的 copyAssets 不分发 vendor/drawio/viewer-static.min.js(仅 full 包带),\n // 走官方 diagrams.net viewer 只会 404 后等超时再回退,这里直接使用内置离线 SVG 渲染。\n preferOfficial: false,\n },\n geo: {\n // 默认即离线空底图;显式声明避免将来默认值变化后悄悄请求外部瓦片服务\n // (OpenFreeMap / OSM / 天地图 均需显式配置才会启用)。\n basemap: 'offline',\n },\n }), [useDarkTheme, legacy]);\n if (missingLegacy) return <div role=\"status\">此文件使用旧版 PowerPoint 格式,当前站点未启用预览。您可以<a href={downloadUrl || undefined} download={file.name}>下载文件</a>。</div>;\n return (<div style={{ width: '100%', height: '100%', minWidth: 0, minHeight: 0, ...style }}>\n <FileViewer file={file} options={options} style={{ width: '100%', height: '100%' }}/>\n </div>);\n}\n"],"file":"FileViewerPreviewPanel-Rti7pUhU.js"}
|
|
1
|
+
{"version":3,"mappings":"s2CAEM,GAAW,GAAU,CAGvB,IAAMA,GADUC,EAAM,KAAK,CAAC,CAAC,QAAQ,gCAAiC,EACrC,CAAC,CAAC,MAAM,wBAAwB,IAA2C,KAA4C,YAAY,EACpK,MAAO,CAACD,GAAU,CAAC,OAAQ,QAAS,SAAU,KAAK,CAAC,CAAC,SAASA,CAAM,CACxE,EACa,IAA8B,EAAa,EAAM,EAAU,CAAC,IAAM,CAC3E,IAA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,SAChB,aAAc,UACd,cAAe,GAGf,UAAW,CAAC,GAAGE,GAAqB,GAAI,MAAM,QAAQX,GAAQ,SAAS,EAAIA,EAAO,UAAYA,GAAQ,UAAY,CAACA,EAAO,SAAS,EAAI,CAAC,CAAE,EAC1I,aAAcA,GAAQ,aACtB,GAAI,CAAE,QAAS,SAAU,EACzB,QAAS,CACL,SAAU,aACV,SAAU,GACV,MAAO,GACP,WAAY,GACZ,KAAM,GACN,OAAQ,GACR,MAAO,EACX,EACA,KAAM,CACF,OAAQ,GACR,iBAAkB,EACtB,EACA,YAAa,CACT,OAAQ,OACR,aAAc,OACd,iBAAkB,GAClB,cAAe,EACnB,EACA,QAAS,CACL,UAAWY,EACX,QAASC,EACb,EACA,QAAS,CAGL,eAAgB,EACpB,EACA,IAAK,CAGD,QAAS,SACb,CACJ,GAAI,CAACJ,EAAcT,CAAM,CAAC,EAE1B,OADIE,EAAsB,kBAAC,MAAD,CAAK,KAAK,SAAV,UAAmB,sCAAmC,kBAAC,IAAD,CAAG,KAAMC,GAAe,OAAW,SAAU55B,EAAK,KAAM,eAAO,GAAC,GAAM,C,GAC9I,kBAAC,MAAD,CAAK,MAAO,CAAE,MAAO,OAAQ,OAAQ,OAAQ,SAAU,EAAG,UAAW,EAAG,GAAGiB,CAAM,EACvF,2BAACs5B,EAAD,CAAkB,OAAe,UAAS,MAAO,CAAE,MAAO,OAAQ,OAAQ,MAAO,CAAG,EACjF,EACT,C,4EAvEM,GAAsB,CACxB,GAAI,MAAM,QAAQC,EAA6B,EACzCA,GACA,CAACA,EAA6B,EACpCC,EACJ,C","names":["scheme","value","fallback","fragment","documentRef","html","windowRef","purifier","createDOMPurify","options","attribute","element","href","anchor","safeUrl","sanitizeFileViewerSvgResources","fileViewerCoreRendererRegistry","_a","controllerRef","container","forwardRef","containerProps","props","containerRef","useRef","appliedViewerOptionsRef","viewerOptions","useMemo","url","file","buffer","name","filename","type","size","onEvent","onStateChange","useEffect","mountViewer","viewerCoreOptions","destroyController","useImperativeHandle","forwardedRef","createViewerControllerHandle","_jsx","defaultStyle","style","DEFAULT_RENDERER_DEFINITIONS","definition","archiveDefinition","__vitePreload","renderArchive","target","context","archiveRendererDefinition","renderFileViewerArchive","import.meta.ROLLDOWN_FILE_URL_FKNdLzKnlftW3t_gzo81yw","import.meta.ROLLDOWN_FILE_URL_WPGYjwIlzWVNM1bYhOc83w","match","format","decimal","axis","formatPptxChartNumber","labels","axesFor","model","group","primary","secondary","rows","groupIndex","index","coordinates","position","point","series","coordinate","indices","a","b","categories","valueFor","points","resolvePptxChartAxes","factory","library","row","originalValues","columns","id","types","dataAxes","groups","normalizeAll","totals","total","rowIndex","i","colors","color","gap","hasLabels","byId","labelFormat","properties","defined","originalIndex","result","axisOptions","category","fonts","font","families","_b","view","surface","scope","selector","sheet","rule","suffix","applyPptxChartFont","mergePptxChartFonts","legendFont","column","escape","chart","texts","document","original","wrapped","stopped","plugin","internal","svg","source","className","base","rectangles","text","node","box","metrics","width","height","refresh","_c","legend","left","layout","list","xs","entries","button","swatch","observer","instance","api","visible","entry","nextWidth","nextHeight","charts","rootElement","root","chartID","digits","units","label","place","unit","digit","omitLeadingOne","remainder","formatEastAsianNumber","remaining","symbol","scopes","bullets","counters","bullet","key","startAt","nextIndex","getNumericBulletText","property","getFitDataKey","existing","computed","readOriginalPx","scale","elements","block","paragraph","child","fontSize","collectTextFitElements","setScaledPx","TEXT_FIT_TOLERANCE","fitWidth","mode","hasTextOverflow","pass","TEXT_FIT_MAX_PASSES","heightRatio","widthRatio","nextScale","TEXT_FIT_MIN_SCALE","applyTextFitScale","fitOverflowingTextBlock","payload","message","chartTarget","findPptxChartTarget","chartRenderer","chartLibraryLoader","bb","billboard","chartData","cartesian","createPptxCartesianChart","names","fill","hole","holeRatio","angle","adjustingWidth","donut","radius","arc","item","y","line","bar","pie","area","scatter","d3Format","used","reserved","createPptxChartLegend","fontStyle","stylePptxChartText","textPlugin","createPptxChartTextPlugin","logicalSize","plotSize","error","restoreNumericBullets","fitOverflowingTextBlocks","queue","asChartQueue","chartInstances","results","renderChart","destroyed","defaults","createDefaultPptxOptions","clamp","min","max","viewer","fullscreen","overlay","stage","counter","hint","exit","event","slideNumber","shouldExitFullscreen","containers","byNumber","isActive","slide","slideWidth","slideHeight","viewWidth","viewHeight","offsetX","offsetY","content","scaleBox","slots","listener","bounds","otherOverlay","_OverloadYield","d","_arrayLikeToArray","r","e","n","_arrayWithHoles","_iterableToArrayLimit","t","u","f","o","l","_nonIterableRest","_slicedToArray","_unsupportedIterableToArray","AsyncGenerator","resume","settle","unapply","thisArg","args","apply","func","unconstruct","construct","Func","addToSet","transformCaseFunc","stringToLowerCase","setPrototypeOf","set","arrayIsArray","array","lcElement","isFrozen","cleanArray","objectHasOwnProperty","clone","newObject","create","_ref2","object","_ref3","stringifyValue","numberToString","booleanToString","bigintToString","symbolToString","objectToString","valueAsRecord","valueToString","lookupGetter","stringified","desc","getOwnPropertyDescriptor","prop","getPrototypeOf","fallbackValue","lookupAccessor","isRegex","regExpTest","window","getGlobal","DOMPurify","NODE_TYPE","originalDocument","currentScript","HTMLTemplateElement","Node","Element","NodeFilter","DOMParser","trustedTypes","ElementPrototype","cloneNode","remove","removeAttributeNode","getNextSibling","getChildNodes","getParentNode","getShadowRoot","getAttributes","getNodeType","getNodeName","getOwnerDocument","_readNodeType","_readNodeName","getNamespaceURI","_readNamespaceURI","template","trustedTypesPolicy","emptyHTML","defaultTrustedTypesPolicy","defaultTrustedTypesPolicyResolved","IN_TRUSTED_TYPES_POLICY","_assertNotInTrustedTypesPolicy","typeErrorCreate","_createTrustedHTML","_createTrustedScriptURL","scriptUrl","_getDefaultTrustedTypesPolicy","_createTrustedTypesPolicy","_document","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","_createHooksMap","MUSTACHE_EXPR$1","MUSTACHE_EXPR","ERB_EXPR$1","ERB_EXPR","TMPLIT_EXPR$1","TMPLIT_EXPR","DATA_ATTR$1","DATA_ATTR","ARIA_ATTR$1","ARIA_ATTR","IS_SCRIPT_OR_DATA$1","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE$1","ATTR_WHITESPACE","CUSTOM_ELEMENT$1","CUSTOM_ELEMENT","IS_ALLOWED_URI$1","IS_ALLOWED_URI","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","html$1","svg$1","svgFilters","mathMl$1","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","mathMl","xml","CUSTOM_ELEMENT_HANDLING","FORBID_TAGS","FORBID_ATTR","EXTRA_ELEMENT_HANDLING","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","SET_CONFIG_ALLOWED_TAGS","SET_CONFIG_ALLOWED_ATTR","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","IN_PLACE_VISITED","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","stringToString","DEFAULT_MATHML_TEXT_INTEGRATION_POINTS","freeze","MATHML_TEXT_INTEGRATION_POINTS","DEFAULT_HTML_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","CONFIG","formElement","isRegexOrFunction","testValue","_parseConfig","cfg","_resolveSetOption","_resolveObjectOption","customElementHandling","seal","previousTrustedTypesPolicy","ALL_SVG_TAGS","svgDisallowed","ALL_MATHML_TAGS","mathMlDisallowed","_checkSvgNamespace","parent","tagName","parentTagName","_checkMathMlNamespace","_checkHtmlNamespace","_checkValidNamespace","elementNamespace","parentNode","_forceRemove","arrayPush","_stripAttributeNode","_neutralizeRoot","_neutralizeSubtree","childNodes","arrayForEach","arraySlice","attributes","_removeAttribute","attr","_stripDisallowedAttributes","_walkTree","intoShadow","stack","visit","shadowRoot","_isDocumentFragment","_collectLiveNodes","nodes","_neutralizeEscapedElements","reachable","setCreate","setAdd","before","setHas","_neutralizeDiscarded","rootRemoved","_sanitizeUnvisitedNodes","visited","getOriginal","beforeNode","round","live","pending","_sanitizeUnvisitedIn","iterator","_createNodeIterator","inShadow","_executeHooks","_sanitizeElements","_sanitizeAttributes","_sanitizeShadowDOM2","_markVisited","_isPatchLinkageAttribute","lcName","lcTag","_neutralizePatchLinkage","nodeType","COMMENT_MARKUP_PROBE","_initDocument","doc","leadingWhitespace","dirty","matches","stringMatch","dirtyPayload","body","_stripTemplateExpressions","stringReplace","_scrubTemplateExpressions2","_scrubOwnCharacterData","templates","tmpl","walker","currentNode","_isClobbered","realTagName","_isNode","hook","data","_isUnsafeNode","ELEMENT_MARKUP_PROBE","LITERAL_TEXT_ELEMENTS","_matchesNameCheck","check","_sanitizeDisallowedNode","_isBasicCustomElement","childCount","hoisted","_forkSharedAllowlist","hookList","defaultSet","setConfigSet","_handleHookDetachedNode","removed","FALLBACK_TAG_CLOSE","_isValidAttribute","nameIsPermitted","stringIndexOf","RESERVED_CUSTOM_ELEMENT_NAMES","_applyTrustedTypesToAttribute","namespaceURI","_setAttributeValue","_isUnsafeAttributeValue","hookEvent","attrValue","initValue","stringTrim","recreatedNamedProp","SELF_CLOSING_TAG","arrayPop","shadowNode","shadowIterator","innerSr","_sanitizeAttachedShadowRoots","isElement","rootName","sr","importedNode","returnNode","inPlace","inPlaceNodes","outerVisited","nn","walkRoot","nodeIterator","serializedHTML","DOCTYPE_NAME","tag","hookFunction","entryPoint","arrayLastIndexOf","arraySplice","_ref","x","ATTR_NAME","purifyHostElement","policyName","makeFallback","PPTX_CONTENT_STYLE_SCOPE","cached","purifierByDocument","normalized","allowFragment","unsafeUrl","withoutUrls","isAllowedCssUrl","probe","cssText","propertyNames","propertyName","isSafeCssValue","sanitized","sanitizeStyleDeclaration","attributeName","isSafeEmbeddedResourceUrl","rules","offset","GENERATED_STYLE_RULE","declarations","getPurifier","createSafeFallbackFragment","sanitizeStyleAttributes","sanitizeEmbeddedResourceUrls","sanitizeSvgUrlAttributes","boundary","selectorList","scopePptxContentStyleText","legacyPptxCss","PPTX_STYLE_ID","pptxViewerCss","dependencyRelativeUrl","moduleUrl","assetUrl","viteSourceWorkerModulePattern","import.meta.ROLLDOWN_FILE_URL_cn7IAAGY294pWGc7MpElVg","cacheIndex","baseUrl","angularCachePath","workerUrl","workerPath","request","viteOptimizedPptxSourcePattern","resolveAngularVitePptxWorkerUrl","defaultPptxWorkerUrl","resolveBundledPptxWorkerUrl","isResolvedPptxWorkerLocation","viteOptimizedWorkerPathPattern","optimizedUrl","resolveViteOptimizedPptxWorkerUrl","allowDependencyRelativeUrl","resolvePptxWorkerUrl","serialized","stringifyErrorDetail","detailOrError","limits","RECOMMENDED_ZIP_LIMITS","createPptxDiagnosticError","sanitizePptxMarkup","escapeHtml","PptxViewer","toPercent","ShadowRootCtor","styleRoot","record","HTMLElementCtor","scroller","state","PptxPresentation","ensureZipWithinLimits","ensurePptxViewerStyles","desiredEffectivePercent","percent","_d","_e","createPptxWorker","resolvePptxEngineOptions","_f","_g","_h","_j","_k","_l","_m","_o","_p","_q","_r","appendHtml","buildSlideErrorHtml","sanitizePptxCss","css","base64Jpeg","image","listOptions","toPositiveInteger","DEFAULT_INITIAL_SLIDES","DEFAULT_BATCH_SIZE","toPositiveNumber","DEFAULT_OVERSCAN_VIEWPORTS","sizeHeight","measuredHeight","DEFAULT_SLIDE_GAP","slot","estimatedHeight","designerCanvases","marginTop","marginBottom","windowOptions","indexesToRender","presentation","activeIndex","changed","wasRendered","viewport","maxMountedSlides","selected","candidates","candidate","closestFallback","capped","rect","overscan","overscanViewport","top","bottom","DEFAULT_SLIDE_HEIGHT","handle","renderPptxPostProcessing","version","postProcessPromise","previouslyRendered","media","mediaId","BlobCtor","UrlApi","objectUrl","slides","sizeWidth","fallbackWidth","viewportWidth","effectiveScale","firstChild","renderPptx","createFileViewerTranslator","targetWindow","zoomEmitter","createFileViewerZoomChangeEmitter","errorMessage","zoomPercent","progressiveReady","disposed","createStyle","shell","createElement","loading","errorTitle","errorText","slideshowButton","slideshowGlyph","slideshowText","slideshowKey","SLIDESHOW_HOTKEY_LABEL","activateShell","activePptxShells","deactivateShell","targetElement","isEditableTarget","handleShortcut","targetShell","hasFirstVisual","signal","resolve","response","getCurrentZoomPercent","clampZoomPercent","getZoomState","setZoom","nextPercent","notifyProgressiveReady","syncUi","presenting","registerExportAdapter","buildExportAdapter","reportPptxFailure","formatErrorMessage","failure","attachFileViewerErrorMessage","registerFileViewerZoomProvider","openPresentation","presentationOptions","resolveCompletion","rejectCompletion","completion","reject","abort","reason","getDefaultFileViewerAssetBaseUrl","resolveFileViewerPresentationWorkerUrl","resolveFileViewerRuntimeAssetBaseUrl","resolvePptxPackageWorkerUrl","resolveFileViewerCopiedAssetUrl","nextViewer","resolvePptxStyleRoot","cleanup","unregisterFileViewerZoomProvider","pptxStyle","getFileViewerShadowRootForNode","copy","locale","lower","resolveFileViewerLocale","code","localizedReason","localizePptxDiagnosticCopy","pptxDiagnosticMessages","rawReason","sanitizePptxDiagnosticText","detail","pptxDiagnosticFallbackHints","usesWesternPunctuation","parts","isPptxDiagnosticErrorLike","formatPptxDiagnosticError","normalizeFileViewerErrorMessage","classified","classifyPptxErrorString","waitForFileViewerNextPaint","collectPptxPrintMaskPages","pptxPrintStyle","getViewer","presentationDefinition","presentationRendererDefinition","renderFileViewerPresentation","documentStart","closing","end","decodeNamespace","named","entity","isWordMlRoot","wordMlRoot","start","xmlName","beforeSpace","wordMlNamespace","quote","hasWordMlDocument","bytes","sample","utf16le","utf16be","utf8Bom","detected","prefix","declaration","declared","resolveWordContainer","ole","byte","resolveFileViewerTextEncoding","decodeFileViewerTextBuffer","xmlNameStart","wordRendererIds","wordDefinitions","renderFileViewerWordDoc","_type","renderWordText","renderWordDocx","convertWordMlToDocx","renderWordDoc","renderOpenDocument","wordRendererDefinitions","renderFileViewerWordDocx","renderFileViewerOpenDocument","spreadsheetDefinition","dbfDefinition","renderSpreadsheet","spreadsheetRendererDefinition","dbfRendererDefinition","renderFileViewerSpreadsheet","ofdDefinition","renderOfd","ofdRendererDefinition","renderFileViewerOfd","emailDefinition","renderEmail","emailRendererDefinition","renderFileViewerEmail","mindmapDefinition","renderXMind","mindmapRendererDefinition","renderFileViewerMindMap","drawingDefinition","renderDrawing","drawingRendererDefinition","renderFileViewerDrawing","dataDefinition","renderDataAsset","dataRendererDefinition","renderFileViewerData","geoDefinition","renderGeo","geoRendererDefinition","renderFileViewerGeo","getXmlProfilesLoader","registry","textRendererIds","textDefinitions","renderLrc","renderHtml","loader","renderXml","renderCode","renderLargeText","shouldVirtualizeMarkdownBuffer","renderMarkdown","textRendererDefinitions","renderFileViewerCode","renderFileViewerMarkdown","FileViewerPreviewPanel","useThemeController","legacy","usePreviewOptions","missingLegacy","downloadUrl","setDownloadUrl","useState","isSpreadsheet","isSpreadsheetFile","resolveFileMimeType","useDarkTheme","isDark","fileViewerRenderers","archiveWorkerUrl","archiveWasmUrl","FileViewer","configuredFileViewerRenderers","archiveRenderer"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],"sources":["../../../../node_modules/@file-viewer/renderer-text/dist/sanitizeHtml.js","../../../../node_modules/@file-viewer/react/dist/index.js","../../../../node_modules/@file-viewer/renderer-archive/dist/index.js","../../../../node_modules/libarchive.js/dist/worker-bundle.js?url","../../../../node_modules/libarchive.js/dist/libarchive.wasm?url","../../node_modules/@file-viewer/pptx/dist/chart-config.js","../../node_modules/@file-viewer/pptx/dist/chart-text.js","../../node_modules/@file-viewer/pptx/dist/chart-legend.js","../../node_modules/@file-viewer/pptx/dist/chart.js","../../node_modules/@file-viewer/pptx/dist/options.js","../../node_modules/@file-viewer/pptx/dist/presentation.js","../../node_modules/dompurify/dist/purify.es.mjs","../../node_modules/@file-viewer/pptx/dist/sanitize.js","../../node_modules/@file-viewer/pptx/dist/styles.js","../../node_modules/@file-viewer/pptx/dist/worker-location.js","../../node_modules/@file-viewer/pptx/dist/worker.js","../../node_modules/@file-viewer/pptx/dist/viewer.js","../../node_modules/@file-viewer/renderer-pptx/dist/index.js","../../../../node_modules/@file-viewer/renderer-word/dist/wordContainer.js","../../../../node_modules/@file-viewer/renderer-word/dist/index.js","../../../../node_modules/@file-viewer/renderer-spreadsheet/dist/index.js","../../../../node_modules/@file-viewer/renderer-ofd/dist/index.js","../../../../node_modules/@file-viewer/renderer-email/dist/index.js","../../../../node_modules/@file-viewer/renderer-mindmap/dist/index.js","../../../../node_modules/@file-viewer/renderer-drawing/dist/index.js","../../../../node_modules/@file-viewer/renderer-data/dist/index.js","../../../../node_modules/@file-viewer/renderer-geo/dist/index.js","../../../../node_modules/@file-viewer/renderer-text/dist/xmlRegistration.js","../../../../node_modules/@file-viewer/renderer-text/dist/index.js","../../src/components/FileViewerPreviewPanel.tsx"],"sourcesContent":["import createDOMPurify from 'dompurify';\nimport { sanitizeFileViewerSvgResources } from '@file-viewer/core';\nconst safeUrl = (value) => {\n var _a, _b;\n const compact = value.trim().replace(/[\\u0000-\\u0020\\u007f-\\u009f]/g, '');\n const scheme = (_b = (_a = compact.match(/^([a-z][a-z0-9+.-]*):/i)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.toLowerCase();\n return !scheme || ['http', 'https', 'mailto', 'tel'].includes(scheme);\n};\nexport const sanitizeFileViewerRichHtml = (documentRef, html, options = {}) => {\n const fallback = () => {\n const fragment = documentRef.createDocumentFragment();\n fragment.append(documentRef.createTextNode(html));\n return fragment;\n };\n const windowRef = documentRef.defaultView;\n if (!windowRef)\n return fallback();\n const purifier = createDOMPurify(windowRef);\n if (!purifier.isSupported)\n return fallback();\n const fragment = purifier.sanitize(html, {\n RETURN_DOM_FRAGMENT: true,\n USE_PROFILES: options.allowSvg\n ? { html: true, svg: true, svgFilters: true }\n : { html: true },\n ADD_ATTR: ['target'],\n FORBID_TAGS: ['base', 'embed', 'form', 'iframe', 'object', 'script', 'style', 'template'],\n FORBID_ATTR: ['action', 'formaction', 'srcdoc', 'style'],\n });\n fragment.querySelectorAll('*').forEach(element => {\n for (const attribute of Array.from(element.attributes)) {\n if (/^on/i.test(attribute.name))\n element.removeAttribute(attribute.name);\n }\n });\n fragment.querySelectorAll('a[href]').forEach(anchor => {\n const href = anchor.getAttribute('href') || '';\n if (!safeUrl(href))\n anchor.removeAttribute('href');\n if ((anchor.getAttribute('target') || '').toLowerCase() === '_blank')\n anchor.rel = 'noopener noreferrer';\n });\n if (options.allowSvg)\n sanitizeFileViewerSvgResources(fragment);\n return fragment;\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport { createViewerControllerHandle, mountViewer } from './controller.js';\nimport { fileViewerCoreRendererRegistry } from '@file-viewer/core';\nconst defaultStyle = {\n width: '100%',\n height: '100%',\n minHeight: 0\n};\nconst viewerCoreOptions = {\n registry: fileViewerCoreRendererRegistry\n};\nconst createInitialViewerState = () => ({\n loading: false,\n ready: false,\n error: null,\n lastEvent: null,\n lifecycle: null,\n availability: null,\n search: null,\n zoom: null,\n location: null,\n viewState: null\n});\nconst destroyController = (controllerRef, container) => {\n var _a;\n (_a = controllerRef.current) === null || _a === void 0 ? void 0 : _a.destroy();\n controllerRef.current = null;\n if (container) {\n container.innerHTML = '';\n }\n};\nexport const FileViewer = forwardRef((props, forwardedRef) => {\n const { url, file, buffer, name, filename, type, size, options, onEvent, onStateChange, style, ...containerProps } = props;\n const containerRef = useRef(null);\n const controllerRef = useRef(null);\n const appliedViewerOptionsRef = useRef(null);\n const viewerOptions = useMemo(() => ({\n url,\n file,\n buffer,\n name,\n filename,\n type,\n size,\n options,\n onEvent,\n onStateChange\n }), [url, file, buffer, name, filename, type, size, options, onEvent, onStateChange]);\n useEffect(() => {\n const container = containerRef.current;\n if (!container || controllerRef.current) {\n return undefined;\n }\n appliedViewerOptionsRef.current = viewerOptions;\n controllerRef.current = mountViewer(container, viewerOptions, viewerCoreOptions);\n return () => {\n appliedViewerOptionsRef.current = null;\n destroyController(controllerRef, container);\n };\n }, []);\n useEffect(() => {\n var _a;\n if (appliedViewerOptionsRef.current === viewerOptions) {\n return;\n }\n appliedViewerOptionsRef.current = viewerOptions;\n void ((_a = controllerRef.current) === null || _a === void 0 ? void 0 : _a.update(viewerOptions));\n }, [viewerOptions]);\n useImperativeHandle(forwardedRef, () => createViewerControllerHandle(() => controllerRef.current, () => destroyController(controllerRef, containerRef.current)), []);\n return (_jsx(\"div\", { ...containerProps, ref: containerRef, style: { ...defaultStyle, ...style } }));\n});\nFileViewer.displayName = 'FileViewer';\nexport const useFileViewerState = (onEvent) => {\n const [state, setState] = useState(() => createInitialViewerState());\n const onStateChange = useCallback((nextState, event) => {\n setState(nextState);\n if (event) {\n onEvent === null || onEvent === void 0 ? void 0 : onEvent(event);\n }\n }, [onEvent]);\n const resetState = useCallback(() => {\n setState(createInitialViewerState());\n }, []);\n return {\n state,\n onStateChange,\n resetState\n };\n};\nexport const useFileViewer = (options = {}) => {\n const ref = useRef(null);\n const { onEvent, ...viewerOptions } = options;\n const { state, onStateChange, resetState } = useFileViewerState(onEvent);\n const props = useMemo(() => ({\n ...viewerOptions,\n onStateChange\n }), [viewerOptions, onStateChange]);\n const handle = useMemo(() => createViewerControllerHandle(() => { var _a, _b; return (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getController()) !== null && _b !== void 0 ? _b : null; }, () => { var _a; return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.destroy(); }), []);\n return {\n ref,\n props,\n state,\n handle,\n resetState\n };\n};\nexport default FileViewer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst archiveDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'archive');\nif (!archiveDefinition) {\n throw new Error('@file-viewer/renderer-archive could not locate the shared archive format definition.');\n}\nexport const archiveRendererDefinition = archiveDefinition;\nexport const renderFileViewerArchive = (buffer, target, type, context) => import('./archive.js').then(({ default: renderArchive }) => renderArchive(buffer, target, type, context));\nexport const archiveRenderer = {\n id: 'file-viewer-renderer-archive',\n label: 'Flyfish File Viewer archive renderer',\n definitions: [archiveRendererDefinition],\n handlers: [{\n rendererId: archiveRendererDefinition.id,\n handler: renderFileViewerArchive,\n }],\n};\nexport default archiveRenderer;\n","export default import.meta.ROLLDOWN_FILE_URL_FKNdLzKnlftW3t_gzo81yw","export default import.meta.ROLLDOWN_FILE_URL_WPGYjwIlzWVNM1bYhOc83w","export const formatPptxChartNumber = (value, format = 'General') => {\n if (!Number.isFinite(value))\n return '';\n const match = /^([$€£]?)[#0,]+(?:\\.([0#]+))?(%)?$/.exec(format);\n if (!match)\n return String(value);\n const decimal = (match[2] || '').slice(0, 20);\n return match[1] + new Intl.NumberFormat('en-US', {\n minimumFractionDigits: (decimal.match(/0/g) || []).length,\n maximumFractionDigits: decimal.length,\n useGrouping: format.includes(','),\n style: match[3] ? 'percent' : 'decimal',\n }).format(value);\n};\nconst axisOptions = (axis) => {\n if (!axis)\n return {};\n const bounds = axis.min === undefined || axis.max === undefined || axis.min < axis.max\n ? { min: axis.min, max: axis.max } : {};\n return {\n ...bounds,\n ...(axis.min !== undefined || axis.max !== undefined ? { padding: { top: 0, bottom: 0 } } : {}),\n show: !axis.deleted,\n inverted: axis.reversed,\n ...(axis.logBase ? { type: 'log' } : {}),\n ...(axis.title ? { label: { text: axis.title, position: 'outer-middle' } } : {}),\n ...(axis.numberFormat ? { tick: { format: (value) => formatPptxChartNumber(value, axis.numberFormat.code) } } : {}),\n };\n};\nconst defined = (labels) => Object.fromEntries(Object.entries(labels || {}).filter(([, value]) => value !== undefined));\nexport const resolvePptxChartAxes = (model) => {\n var _a, _b;\n const axesFor = (group) => model.axes.filter(axis => group === null || group === void 0 ? void 0 : group.axisIds.includes(axis.id));\n const primary = (_a = axesFor(model.groups[0]).find(axis => axis.kind === 'value')) !== null && _a !== void 0 ? _a : model.axes.find(axis => axis.kind === 'value');\n const secondary = model.groups.filter(group => group.series.length > 0).flatMap(axesFor).find(axis => axis.kind === 'value' && axis.id !== (primary === null || primary === void 0 ? void 0 : primary.id));\n const category = (_b = axesFor(model.groups[0]).find(axis => axis.kind === 'category' || axis.kind === 'date')) !== null && _b !== void 0 ? _b : model.axes.find(axis => axis.kind === 'category' || axis.kind === 'date');\n return { category, primary, secondary };\n};\nexport const createPptxCartesianChart = (model, library) => {\n var _a, _b, _c, _d;\n if (!model.groups.length || model.groups.some(group => !['lineChart', 'barChart', 'areaChart'].includes(group.chartType)))\n return null;\n const rows = model.groups.flatMap((group, groupIndex) => group.series.map((series, index) => ({\n group, groupIndex, series, index, id: `pptx-series-${groupIndex}-${index}`,\n })));\n const coordinates = new Set();\n const labels = new Map();\n for (const { series } of rows)\n for (const [position, point] of series.values.entries()) {\n const coordinate = String(point.x);\n coordinates.add(coordinate);\n if (!labels.has(coordinate))\n labels.set(coordinate, String((_a = series.xlabels[position]) !== null && _a !== void 0 ? _a : coordinate));\n }\n const indices = [...coordinates].sort((a, b) => Number(a) - Number(b));\n const categories = indices.map(index => labels.get(index));\n const valueFor = (series) => {\n const points = new Map(series.values.map(point => [String(point.x), point.y]));\n return indices.map(index => { var _a; return (_a = points.get(index)) !== null && _a !== void 0 ? _a : null; });\n };\n const { primary, secondary, category } = resolvePptxChartAxes(model);\n const factory = { barChart: library.bar, lineChart: library.line, areaChart: library.area };\n if (rows.some(row => typeof factory[row.group.chartType] !== 'function'))\n return null;\n const originalValues = rows.map(row => valueFor(row.series));\n const columns = rows.map(({ id }, index) => [id, ...originalValues[index]]);\n const types = Object.fromEntries(rows.map(row => [row.id, factory[row.group.chartType]()]));\n const dataAxes = Object.fromEntries(rows.map(row => [row.id,\n secondary && row.group.axisIds.includes(secondary.id) ? 'y2' : 'y',\n ]));\n const groups = model.groups.flatMap((group, groupIndex) => group.options.grouping === 'stacked' || group.options.grouping === 'percentStacked'\n ? [rows.filter(row => row.groupIndex === groupIndex).map(row => row.id)] : []);\n const normalizeAll = model.groups.length === 1 && model.groups[0].options.grouping === 'percentStacked';\n const totals = new Map();\n rows.forEach((row, rowIndex) => {\n if (normalizeAll || row.group.options.grouping !== 'percentStacked')\n return;\n let total = totals.get(row.groupIndex);\n if (!total) {\n total = indices.map(() => 0);\n totals.set(row.groupIndex, total);\n }\n originalValues[rowIndex].forEach((value, index) => { total[index] += Math.abs(value || 0); });\n });\n rows.forEach((row, rowIndex) => {\n if (normalizeAll || row.group.options.grouping !== 'percentStacked')\n return;\n for (let i = 1; i < columns[rowIndex].length; i++) {\n const total = totals.get(row.groupIndex)[i - 1];\n if (typeof columns[rowIndex][i] === 'number' && total)\n columns[rowIndex][i] = Number(columns[rowIndex][i]) / total * 100;\n }\n });\n const colors = Object.fromEntries(rows.flatMap(row => {\n var _a, _b;\n const color = (_b = (_a = row.group.options.series) === null || _a === void 0 ? void 0 : _a[row.index]) === null || _b === void 0 ? void 0 : _b.color;\n return color && /^(?:#[\\da-f]{6}(?:[\\da-f]{2})?|transparent)$/i.test(color) ? [[row.id, color]] : [];\n }));\n const gap = (_b = model.groups.find(group => group.chartType === 'barChart')) === null || _b === void 0 ? void 0 : _b.options.gapWidth;\n const hasLabels = rows.some(row => { var _a, _b; return row.group.options.labels || ((_b = (_a = row.group.options.series) === null || _a === void 0 ? void 0 : _a[row.index]) === null || _b === void 0 ? void 0 : _b.labels); });\n const byId = new Map(rows.map(row => [row.id, row]));\n const labelFormat = (value, id, position) => {\n var _a, _b, _c;\n const row = byId.get(id);\n if (!row)\n return '';\n const properties = { ...defined(row.group.options.labels), ...defined((_b = (_a = row.group.options.series) === null || _a === void 0 ? void 0 : _a[row.index]) === null || _b === void 0 ? void 0 : _b.labels) };\n const originalIndex = indices[position];\n const point = (_c = properties.points) === null || _c === void 0 ? void 0 : _c[originalIndex];\n Object.assign(properties, defined(point));\n if (properties.deleted)\n return '';\n const result = [];\n if (properties.showSeries)\n result.push(String(row.series.key));\n if (properties.showCategory)\n result.push(categories[position] || '');\n if (properties.showValue)\n result.push(formatPptxChartNumber(value, properties.formatCode));\n return result.join(' ');\n };\n return {\n data: {\n columns, types, type: types[(_c = rows[0]) === null || _c === void 0 ? void 0 : _c.id], axes: dataAxes,\n names: Object.fromEntries(rows.map(row => [row.id, String(row.series.key)])),\n ...(Object.keys(colors).length ? { colors } : {}),\n ...(groups.length ? { groups, order: null } : {}),\n ...(normalizeAll ? { stack: { normalize: true } } : {}),\n ...(hasLabels ? { labels: { format: labelFormat } } : {}),\n },\n axis: {\n rotated: model.groups.some(group => group.barDirection === 'bar'),\n x: { ...axisOptions(category), type: 'category', categories, tick: model.groups.some(group => group.barDirection === 'bar')\n ? { multiline: true }\n : { multiline: false, culling: false, rotate: (_d = category === null || category === void 0 ? void 0 : category.labelRotation) !== null && _d !== void 0 ? _d : 60, autorotate: (category === null || category === void 0 ? void 0 : category.labelRotation) === undefined } },\n y: axisOptions(primary),\n ...(secondary ? { y2: axisOptions(secondary) } : {}),\n },\n grid: { x: { show: (category === null || category === void 0 ? void 0 : category.majorGridlines) === true }, y: { show: (primary === null || primary === void 0 ? void 0 : primary.majorGridlines) === true } },\n ...(gap !== undefined ? { bar: { width: { ratio: 100 / (100 + gap) } } } : {}),\n ...(model.title ? { title: { text: model.title } } : {}),\n interaction: { enabled: true },\n };\n};\n","import { resolvePptxChartAxes } from \"./chart-config.js\";\nexport const mergePptxChartFonts = (...fonts) => Object.assign({}, ...fonts.map(font => Object.fromEntries(Object.entries(font || {}).filter(([, value]) => value !== undefined))));\nexport const applyPptxChartFont = (style, font) => {\n if (!font)\n return;\n const families = [...new Set([font.family, font.eastAsianFamily, font.complexScriptFamily]\n .filter((value) => typeof value === 'string' && !!value.trim())\n .filter(value => !/^\\+(?:mj|mn)-(?:lt|ea|cs)$/.test(value))\n .map(value => /^(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded|emoji|math|fangsong)$/i.test(value.trim())\n ? value.trim().toLowerCase() : JSON.stringify(value.slice(0, 512))))];\n if (families.length)\n style.fontFamily = [...families, 'sans-serif'].join(',');\n if (typeof font.sizePt === 'number' && Number.isFinite(font.sizePt) && font.sizePt > 0 && font.sizePt <= 4000) {\n style.fontSize = `${font.sizePt * 96 / 72}px`;\n }\n if (font.bold !== undefined)\n style.fontWeight = font.bold ? 'bold' : 'normal';\n if (font.italic !== undefined)\n style.fontStyle = font.italic ? 'italic' : 'normal';\n if (typeof font.color === 'string' && /^(?:#[\\da-f]{6}(?:[\\da-f]{2})?|transparent)$/i.test(font.color)) {\n style.color = font.color;\n style.fill = font.color;\n }\n};\nexport const stylePptxChartText = (surface, model, chart, legendFont) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n const view = (_a = surface.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;\n if (!view || typeof surface.appendChild !== 'function')\n return;\n const scope = `chart-${Math.random().toString(36).slice(2)}`;\n surface.dataset.pptxChartText = scope;\n surface.classList.add('pptx-chart-typed');\n const selector = `.pptx-chart-surface.pptx-chart-typed[data-pptx-chart-text=\"${scope}\"]`;\n const element = surface.ownerDocument.createElement('style');\n element.dataset.pptxChartFonts = '';\n (_b = surface.parentNode) === null || _b === void 0 ? void 0 : _b.appendChild(element);\n const sheet = element.sheet;\n if (!sheet)\n return element;\n const rule = (suffix, font) => {\n if (!font || !Object.values(font).some(value => value !== undefined))\n return;\n const index = sheet.insertRule(suffix.split(',').map(value => `${selector} ${value.trim()}`).join(',') + '{}', sheet.cssRules.length);\n applyPptxChartFont(sheet.cssRules[index].style, font);\n };\n rule('svg', model === null || model === void 0 ? void 0 : model.font);\n rule('.bb-legend-item,.bb-legend-item text', mergePptxChartFonts(model === null || model === void 0 ? void 0 : model.font, legendFont));\n if (!model)\n return element;\n const { category, primary, secondary } = resolvePptxChartAxes(model);\n for (const [axis, font] of [['x', category === null || category === void 0 ? void 0 : category.font], ['y', primary === null || primary === void 0 ? void 0 : primary.font], ['y2', secondary === null || secondary === void 0 ? void 0 : secondary.font]]) {\n rule(`.bb-axis-${axis},.bb-axis-${axis} text`, mergePptxChartFonts(model.font, font));\n }\n let column = 0;\n const escape = (_c = view.CSS) === null || _c === void 0 ? void 0 : _c.escape;\n if (!escape)\n return element;\n for (const group of model.groups)\n for (let index = 0; index < group.series.length; index++, column++) {\n const id = String((_g = (_f = (_e = (_d = chart === null || chart === void 0 ? void 0 : chart.data) === null || _d === void 0 ? void 0 : _d.columns) === null || _e === void 0 ? void 0 : _e[column]) === null || _f === void 0 ? void 0 : _f[0]) !== null && _g !== void 0 ? _g : '');\n if (!id)\n continue;\n const labels = (_j = (_h = group.options.series) === null || _h === void 0 ? void 0 : _h[index]) === null || _j === void 0 ? void 0 : _j.labels;\n const font = mergePptxChartFonts(model.font, (_k = group.options.labels) === null || _k === void 0 ? void 0 : _k.font, labels === null || labels === void 0 ? void 0 : labels.font);\n const texts = `.bb-texts-${escape(id)}`;\n rule(`${texts},${texts} text`, font);\n const points = { ...(_l = group.options.labels) === null || _l === void 0 ? void 0 : _l.points, ...labels === null || labels === void 0 ? void 0 : labels.points };\n for (const [position, point] of Object.entries(points)) {\n if (!/^\\d+$/.test(position) || !point.font)\n continue;\n rule(`${texts} .bb-text-${escape(position)}`, mergePptxChartFonts(font, point.font));\n }\n }\n return element;\n};\nexport const createPptxChartTextPlugin = (surface) => {\n const document = surface.ownerDocument;\n const view = document === null || document === void 0 ? void 0 : document.defaultView;\n if (!view || typeof surface.appendChild !== 'function')\n return undefined;\n let original;\n let wrapped;\n let stopped = false;\n let context;\n const plugin = {\n $$: undefined,\n $beforeInit() {\n const internal = this.$$;\n if (typeof (internal === null || internal === void 0 ? void 0 : internal.getTextRect) !== 'function')\n return;\n original = internal.getTextRect;\n wrapped = (source, className) => {\n var _a, _b, _c, _d, _e;\n const svg = ((_c = (_b = (_a = internal.$el) === null || _a === void 0 ? void 0 : _a.svg) === null || _b === void 0 ? void 0 : _b.node) === null || _c === void 0 ? void 0 : _c.call(_b)) || surface.querySelector('svg');\n if (!svg)\n return original.call(internal, source, className);\n let base = ((_d = source === null || source === void 0 ? void 0 : source.node) === null || _d === void 0 ? void 0 : _d.call(source)) || source;\n if (!Array.isArray(source) && !/text/i.test((base === null || base === void 0 ? void 0 : base.tagName) || ''))\n base = (_e = base === null || base === void 0 ? void 0 : base.querySelector) === null || _e === void 0 ? void 0 : _e.call(base, 'text');\n if (!Array.isArray(source) && !base)\n return original.call(internal, source, className);\n const values = Array.isArray(source) ? source : [base.textContent || ''];\n const rectangles = values.map((value) => {\n var _a;\n const text = String(value !== null && value !== void 0 ? value : '');\n const node = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n if (className)\n node.setAttribute('class', className);\n node.style.visibility = 'hidden';\n if (base && !Array.isArray(source))\n node.style.font = view.getComputedStyle(base).font;\n node.textContent = text;\n svg.appendChild(node);\n try {\n const box = node.getBBox();\n if (box.height > 0 && (box.width > 0 || !text)) {\n return { x: box.x, y: box.y, left: box.x, top: box.y, right: box.x + box.width,\n bottom: box.y + box.height, width: box.width, height: box.height };\n }\n const style = view.getComputedStyle(node);\n context !== null && context !== void 0 ? context : (context = document.createElement('canvas').getContext('2d'));\n const size = Number.parseFloat(style.fontSize) || 10;\n if (context)\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize} ${style.fontFamily}`;\n const metrics = context === null || context === void 0 ? void 0 : context.measureText(text);\n const width = (_a = metrics === null || metrics === void 0 ? void 0 : metrics.width) !== null && _a !== void 0 ? _a : 0;\n const height = ((metrics === null || metrics === void 0 ? void 0 : metrics.fontBoundingBoxAscent) || 0) + ((metrics === null || metrics === void 0 ? void 0 : metrics.fontBoundingBoxDescent) || 0) || size * 1.2;\n return { x: 0, y: 0, left: 0, top: 0, right: width, bottom: height, width, height };\n }\n finally {\n node.remove();\n }\n });\n return rectangles.length > 1 ? rectangles : rectangles[0];\n };\n internal.getTextRect = wrapped;\n },\n $init() { },\n $afterInit() { var _a; (_a = document.fonts) === null || _a === void 0 ? void 0 : _a.addEventListener('loadingdone', refresh); },\n $redraw() { },\n $willDestroy() {\n var _a, _b;\n stopped = true;\n (_a = document.fonts) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadingdone', refresh);\n if (((_b = this.$$) === null || _b === void 0 ? void 0 : _b.getTextRect) === wrapped)\n this.$$.getTextRect = original;\n original = wrapped = context = undefined;\n this.$$ = undefined;\n },\n };\n const refresh = () => { var _a, _b, _c; if (!stopped)\n (_c = (_b = (_a = plugin.$$) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.flush) === null || _c === void 0 ? void 0 : _c.call(_b); };\n return plugin;\n};\n","import { applyPptxChartFont } from \"./chart-text.js\";\nexport const createPptxChartLegend = (surface, chart, legend, font) => {\n var _a, _b;\n const document = surface.ownerDocument;\n const view = document === null || document === void 0 ? void 0 : document.defaultView;\n if (!view || (legend === null || legend === void 0 ? void 0 : legend.show) === false || !((legend === null || legend === void 0 ? void 0 : legend.overlay) || ['t', 'tr', 'l'].includes((legend === null || legend === void 0 ? void 0 : legend.position) || '')))\n return;\n const left = (legend === null || legend === void 0 ? void 0 : legend.position) === 'l' || (legend === null || legend === void 0 ? void 0 : legend.position) === 'r';\n const layout = document.createElement('div');\n layout.className = 'pptx-chart-layout';\n layout.style.cssText = `display:flex;flex-direction:${left ? 'row' : 'column'};width:100%;height:100%;min-width:0;min-height:0;position:relative`;\n surface.replaceWith(layout);\n const list = document.createElement('div');\n list.className = 'pptx-chart-legend';\n list.setAttribute('role', 'group');\n list.setAttribute('aria-label', 'Chart legend');\n list.style.cssText = `display:flex;flex:${left ? '0 1 auto' : '0 0 auto'};flex-direction:${left ? 'column' : 'row'};flex-wrap:${left ? 'nowrap' : 'wrap'};gap:4px 12px;align-items:${left ? 'stretch' : 'center'};justify-content:${(legend === null || legend === void 0 ? void 0 : legend.position) === 'tr' ? 'flex-end' : 'center'};box-sizing:border-box;padding:4px;overflow:auto;${left ? 'max-width:50%' : 'max-height:50%'};font:12px sans-serif`;\n applyPptxChartFont(list.style, font);\n if (legend === null || legend === void 0 ? void 0 : legend.overlay) {\n list.style.position = 'absolute';\n list.style.zIndex = '1';\n list.style[legend.position === 'b' ? 'bottom' : 'top'] = '0';\n list.style[legend.position === 'tr' || legend.position === 'r' ? 'right' : 'left'] = '0';\n if (left)\n list.style.height = '100%';\n else\n list.style.width = '100%';\n }\n surface.style.width = left ? '0' : '100%';\n surface.style.height = left ? '100%' : '0';\n surface.style.alignSelf = 'stretch';\n if (legend === null || legend === void 0 ? void 0 : legend.overlay)\n surface.style.width = surface.style.height = '100%';\n layout.append(list, surface);\n const xs = new Set(Object.values(((_a = chart.data) === null || _a === void 0 ? void 0 : _a.xs) || {}).map(String));\n const entries = (((_b = chart.data) === null || _b === void 0 ? void 0 : _b.columns) || []).filter((column) => !xs.has(String(column[0])))\n .map((column) => {\n var _a, _b, _c;\n const id = String(column[0]);\n const button = document.createElement('button');\n button.type = 'button';\n button.setAttribute('aria-pressed', 'true');\n button.style.cssText = 'display:inline-flex;flex:0 0 auto;align-items:center;gap:4px;min-width:0;max-width:100%;border:0;padding:2px;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer';\n const swatch = document.createElement('span');\n swatch.setAttribute('aria-hidden', 'true');\n swatch.style.cssText = 'display:inline-block;flex:0 0 10px;width:10px;height:10px';\n const text = document.createElement('span');\n text.className = 'pptx-chart-legend-label';\n text.style.cssText = 'min-width:0;overflow-wrap:anywhere';\n text.textContent = String((_c = (_b = (_a = chart.data) === null || _a === void 0 ? void 0 : _a.names) === null || _b === void 0 ? void 0 : _b[id]) !== null && _c !== void 0 ? _c : id) || '\\u200b';\n button.append(swatch, text);\n list.append(button);\n return { id, button, swatch };\n });\n chart.legend = { ...chart.legend, show: false };\n let observer;\n let instance;\n let width = 0, height = 0;\n return {\n size() {\n return { width: surface.clientWidth, height: surface.clientHeight };\n },\n bind(api) {\n var _a;\n instance = api;\n for (const { id, button, swatch } of entries) {\n swatch.style.backgroundColor = ((_a = api.color) === null || _a === void 0 ? void 0 : _a.call(api, id)) || 'currentColor';\n button.onclick = () => {\n var _a;\n (_a = api.toggle) === null || _a === void 0 ? void 0 : _a.call(api, id);\n const visible = button.getAttribute('aria-pressed') !== 'true';\n button.setAttribute('aria-pressed', String(visible));\n button.style.opacity = visible ? '1' : '.45';\n };\n button.onmouseenter = () => { var _a; return (_a = api.focus) === null || _a === void 0 ? void 0 : _a.call(api, id); };\n button.onmouseleave = () => { var _a; return (_a = api.revert) === null || _a === void 0 ? void 0 : _a.call(api); };\n }\n if (view.ResizeObserver) {\n observer = new view.ResizeObserver(([entry]) => {\n var _a;\n const { width: nextWidth, height: nextHeight } = entry.contentRect;\n if (nextWidth > 0 && nextHeight > 0 && (Math.abs(nextWidth - width) > .5 || Math.abs(nextHeight - height) > .5)) {\n width = nextWidth;\n height = nextHeight;\n (_a = instance === null || instance === void 0 ? void 0 : instance.resize) === null || _a === void 0 ? void 0 : _a.call(instance, { width, height });\n }\n });\n observer.observe(surface);\n }\n },\n destroy() {\n observer === null || observer === void 0 ? void 0 : observer.disconnect();\n instance = undefined;\n for (const { button } of entries)\n button.onclick = button.onmouseenter = button.onmouseleave = null;\n layout.remove();\n },\n };\n};\n","import { createPptxCartesianChart } from \"./chart-config.js\";\nimport { createPptxChartTextPlugin, mergePptxChartFonts, stylePptxChartText } from \"./chart-text.js\";\nimport { createPptxChartLegend } from \"./chart-legend.js\";\nlet chartLibraryLoader = null;\nlet chartRenderer = null;\nexport const registerPptxChartRenderer = (renderer) => {\n chartRenderer = renderer;\n};\nexport const registerPptxChartLibraryLoader = (loader) => {\n chartLibraryLoader = loader;\n};\nconst asChartQueue = (charts) => {\n return Array.isArray(charts === null || charts === void 0 ? void 0 : charts.MsgQueue) ? charts.MsgQueue : [];\n};\nexport const findPptxChartTarget = (root, chartID) => {\n const rootElement = root;\n if (rootElement.id === chartID) {\n return rootElement;\n }\n return Array.from(root.querySelectorAll('[id]'))\n .find(element => element.id === chartID) || null;\n};\nconst formatEastAsianNumber = (index) => {\n const digits = '零一二三四五六七八九';\n const units = [[1000, '千'], [100, '百'], [10, '十'], [1, '']];\n const group = (value, omitLeadingOne = true) => {\n let label = '';\n let gap = false;\n for (const [place, unit] of units) {\n const digit = Math.floor(value / place);\n value %= place;\n if (digit) {\n if (gap)\n label += digits[0];\n label += (place === 10 && digit === 1 && !label && omitLeadingOne ? '' : digits[digit]) + unit;\n gap = false;\n }\n else if (label && value)\n gap = true;\n }\n return label;\n };\n if (index < 10000)\n return group(index);\n const remainder = index % 10000;\n return digits[Math.floor(index / 10000)] + '万' +\n (remainder ? (remainder < 1000 ? digits[0] : '') + group(remainder, false) : '');\n};\nexport const getNumericBulletText = (type, index) => {\n if (!Number.isInteger(index) || index < 1 || index > 32767) {\n return String(index);\n }\n if (type === 'ea1JpnChsDbPeriod') {\n return `${formatEastAsianNumber(index)}. `;\n }\n const match = /^(arabic|alphaLc|alphaUc|romanLc|romanUc)(Period|ParenR|ParenBoth|Plain)$/.exec(type);\n if (!match) {\n return String(index);\n }\n let label = String(index);\n if (match[1].startsWith('alpha')) {\n label = '';\n for (let remaining = index; remaining > 0; remaining = Math.floor((remaining - 1) / 26)) {\n label = String.fromCharCode(65 + (remaining - 1) % 26) + label;\n }\n }\n else if (match[1].startsWith('roman')) {\n label = '';\n let remaining = index;\n const digits = [\n [1000, 'M'], [900, 'CM'], [500, 'D'], [400, 'CD'], [100, 'C'], [90, 'XC'],\n [50, 'L'], [40, 'XL'], [10, 'X'], [9, 'IX'], [5, 'V'], [4, 'IV'], [1, 'I'],\n ];\n for (const [value, symbol] of digits) {\n label += symbol.repeat(Math.floor(remaining / value));\n remaining %= value;\n }\n }\n if (match[1].endsWith('Lc'))\n label = label.toLowerCase();\n switch (match[2]) {\n case 'Period': return `${label}. `;\n case 'ParenR': return `${label}) `;\n case 'ParenBoth': return `(${label}) `;\n default: return label;\n }\n};\nconst restoreNumericBullets = (root) => {\n const scopes = [\n ...Array.from(root.querySelectorAll('.block')),\n ...Array.from(root.querySelectorAll('table td')),\n ];\n for (const scope of scopes) {\n const bullets = Array.from(scope.querySelectorAll('.numeric-bullet-style'));\n const counters = new Map();\n for (const bullet of bullets) {\n const type = String(bullet.dataset.bulltname || 'arabicPeriod');\n const level = String(bullet.dataset.bulltlvl || '0');\n const key = `${level}:${type}`;\n const startAt = Number(bullet.dataset.bulltstartat);\n const nextIndex = Number.isInteger(startAt) && startAt >= 1 && startAt <= 32767\n ? startAt\n : (counters.get(key) || 0) + 1;\n counters.set(key, nextIndex);\n bullet.textContent = getNumericBulletText(type, nextIndex);\n }\n }\n};\nconst TEXT_FIT_MIN_SCALE = 0.7;\nconst TEXT_FIT_MAX_PASSES = 8;\nconst TEXT_FIT_TOLERANCE = 1;\nconst getFitDataKey = (property) => `pptxFit${property.charAt(0).toUpperCase()}${property.slice(1)}`;\nconst readOriginalPx = (element, property, computed = getComputedStyle(element)) => {\n const key = getFitDataKey(property);\n const existing = Number(element.dataset[key]);\n if (Number.isFinite(existing) && existing > 0) {\n return existing;\n }\n const value = parseFloat(computed[property]);\n if (!Number.isFinite(value) || value <= 0) {\n return undefined;\n }\n element.dataset[key] = String(value);\n return value;\n};\nconst setScaledPx = (element, property, scale, computed = getComputedStyle(element)) => {\n const original = readOriginalPx(element, property, computed);\n if (original === undefined) {\n return;\n }\n element.style[property] = `${original * scale}px`;\n};\nconst collectTextFitElements = (block) => {\n const elements = new Set();\n block.querySelectorAll('.text-block, .numeric-bullet-style').forEach(element => {\n elements.add(element);\n });\n block.querySelectorAll('.slide-prgrph').forEach(paragraph => {\n Array.from(paragraph.children).forEach(child => {\n if (!(child instanceof HTMLElement) || child.querySelector('.text-block')) {\n return;\n }\n const computed = getComputedStyle(child);\n const fontSize = parseFloat(computed.fontSize);\n if (Number.isFinite(fontSize) && fontSize > 0) {\n elements.add(child);\n }\n });\n });\n return elements;\n};\nconst applyTextFitScale = (block, scale) => {\n block.dataset.pptxTextFitScale = String(scale);\n for (const element of collectTextFitElements(block)) {\n const computed = getComputedStyle(element);\n setScaledPx(element, 'fontSize', scale, computed);\n setScaledPx(element, 'lineHeight', scale, computed);\n setScaledPx(element, 'paddingLeft', scale, computed);\n setScaledPx(element, 'paddingRight', scale, computed);\n }\n block.querySelectorAll('.slide-prgrph').forEach(paragraph => {\n const computed = getComputedStyle(paragraph);\n setScaledPx(paragraph, 'lineHeight', scale, computed);\n setScaledPx(paragraph, 'marginTop', scale, computed);\n setScaledPx(paragraph, 'marginBottom', scale, computed);\n setScaledPx(paragraph, 'paddingTop', scale, computed);\n setScaledPx(paragraph, 'paddingBottom', scale, computed);\n });\n block.querySelectorAll('.slide-prgrph > *').forEach(child => {\n const computed = getComputedStyle(child);\n setScaledPx(child, 'marginLeft', scale, computed);\n setScaledPx(child, 'marginRight', scale, computed);\n setScaledPx(child, 'paddingLeft', scale, computed);\n setScaledPx(child, 'paddingRight', scale, computed);\n });\n};\nconst hasTextOverflow = (block, fitWidth = true) => block.scrollHeight > block.clientHeight + TEXT_FIT_TOLERANCE ||\n (fitWidth && block.scrollWidth > block.clientWidth + TEXT_FIT_TOLERANCE);\nconst fitOverflowingTextBlock = (block, fitWidth = true) => {\n const mode = block.dataset.pptxAutofit;\n if (mode && mode !== 'normal')\n return;\n if (block.dataset.pptxWrap === 'none')\n fitWidth = false;\n if (!block.querySelector('.text-block') || block.clientWidth <= 0 || block.clientHeight <= 0) {\n return;\n }\n let scale = Number(block.dataset.pptxTextFitScale) || 1;\n if (!hasTextOverflow(block, fitWidth)) {\n return;\n }\n for (let pass = 0; pass < TEXT_FIT_MAX_PASSES && hasTextOverflow(block, fitWidth); pass += 1) {\n const heightRatio = block.scrollHeight > 0\n ? Math.min(1, block.clientHeight / block.scrollHeight)\n : 1;\n const widthRatio = fitWidth && block.scrollWidth > 0\n ? Math.min(1, block.clientWidth / block.scrollWidth)\n : 1;\n const ratio = Math.min(heightRatio, widthRatio, 0.98);\n const nextScale = Math.max(TEXT_FIT_MIN_SCALE, scale * Math.max(ratio, 0.95));\n if (nextScale >= scale - 0.002) {\n scale = Math.max(TEXT_FIT_MIN_SCALE, scale * 0.97);\n }\n else {\n scale = nextScale;\n }\n applyTextFitScale(block, scale);\n if (scale <= TEXT_FIT_MIN_SCALE && hasTextOverflow(block, fitWidth)) {\n break;\n }\n }\n};\nconst fitOverflowingTextBlocks = (root) => {\n root\n .querySelectorAll('.slide div.content, .slide div.content-rtl')\n .forEach(block => fitOverflowingTextBlock(block));\n root\n .querySelectorAll('.slide .pptx-table-cell-content')\n .forEach(block => fitOverflowingTextBlock(block, false));\n};\nconst renderChart = async (message, root) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;\n const payload = message.data;\n if (!(payload === null || payload === void 0 ? void 0 : payload.chartID) || !payload.chartType || !payload.chartData) {\n return;\n }\n const chartTarget = findPptxChartTarget(root, payload.chartID);\n if (!chartTarget) {\n return;\n }\n if (chartRenderer && payload.chartModel) {\n return await chartRenderer(payload.chartModel, chartTarget);\n }\n if (!chartLibraryLoader) {\n chartTarget.dataset.fileViewerMissingCapability = 'pptx-charts';\n chartTarget.setAttribute('title', 'PPTX chart rendering requires @file-viewer/capability-pptx-charts. Run `npx file-viewer-cli add pptx-charts --write`, then `npx file-viewer-cli install --yes`.');\n console.warn('[file-viewer] PPTX chart rendering requires @file-viewer/capability-pptx-charts. Run `npx file-viewer-cli add pptx-charts --write`, then `npx file-viewer-cli install --yes`.');\n return;\n }\n const { billboard, d3Format } = await chartLibraryLoader();\n const bb = billboard.default || billboard;\n const { area, bar, line, pie, donut, scatter } = billboard;\n if (typeof billboard.grid === 'function') {\n billboard.grid();\n }\n const chart = {\n bindto: chartTarget,\n };\n const chartData = payload.chartData;\n const axis = {\n x: {\n tick: {\n format(index) {\n var _a, _b, _c;\n return (_c = (_b = (_a = chartData[0]) === null || _a === void 0 ? void 0 : _a.xlabels) === null || _b === void 0 ? void 0 : _b[index]) !== null && _c !== void 0 ? _c : index;\n },\n },\n },\n };\n const cartesian = payload.chartModel ? createPptxCartesianChart(payload.chartModel, billboard) : null;\n if (cartesian)\n Object.assign(chart, cartesian);\n else\n switch (payload.chartType) {\n case 'doughnutChart': {\n const series = chartData[0];\n const columns = [];\n const names = {};\n const colors = {};\n for (const [index, point] of ((series === null || series === void 0 ? void 0 : series.values) || []).entries()) {\n if (typeof point.y !== 'number' || !Number.isFinite(point.y) || point.y === 0)\n continue;\n const id = `point-${index}`;\n columns.push([id, Math.abs(point.y)]);\n names[id] = String((_c = (_b = (_a = series.xlabels) === null || _a === void 0 ? void 0 : _a[index]) !== null && _b !== void 0 ? _b : point.x) !== null && _c !== void 0 ? _c : index);\n const fill = (_h = (_g = (_f = (_e = (_d = payload.chartOptions) === null || _d === void 0 ? void 0 : _d.series) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.points) === null || _g === void 0 ? void 0 : _g[point.x]) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = payload.chartOptions) === null || _j === void 0 ? void 0 : _j.series) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.color;\n if (fill && /^(?:#[\\da-f]{6}(?:[\\da-f]{2})?|transparent)$/i.test(fill))\n colors[id] = fill;\n }\n const hole = (_m = payload.chartOptions) === null || _m === void 0 ? void 0 : _m.holeSize;\n const holeRatio = (typeof hole === 'number' && Number.isFinite(hole) && hole >= 10 && hole <= 90 ? hole : 50) / 100;\n const angle = (_o = payload.chartOptions) === null || _o === void 0 ? void 0 : _o.firstSliceAngle;\n let adjustingWidth = false;\n Object.assign(chart, {\n data: { columns, names, colors, type: donut(), order: null },\n donut: {\n startingAngle: typeof angle === 'number' && Number.isFinite(angle) ? angle * Math.PI / 180 : 0,\n expand: false,\n label: { show: false },\n },\n transition: { duration: 0 },\n onrendered() {\n if (adjustingWidth || typeof this.config !== 'function')\n return;\n let radius = 0;\n for (const arc of chartTarget.querySelectorAll('.bb-arc')) {\n const match = /[Aa]([\\d.+eE-]+)[ ,]+([\\d.+eE-]+)/.exec(arc.getAttribute('d') || '');\n if (match)\n radius = Math.max(radius, Number(match[1]));\n }\n if (!(radius > 0) || !Number.isFinite(radius))\n return;\n const width = radius * (1 - holeRatio);\n if (Math.abs(Number(this.config('donut.width')) - width) <= 0.01)\n return;\n adjustingWidth = true;\n try {\n this.config('donut.width', width, true);\n }\n finally {\n adjustingWidth = false;\n }\n },\n });\n break;\n }\n case 'lineChart':\n Object.assign(chart, {\n data: {\n columns: chartData.map((item) => [item.key, ...item.values.map(({ y }) => y)]),\n type: line(),\n },\n axis,\n interaction: { enabled: true },\n });\n break;\n case 'barChart':\n Object.assign(chart, {\n data: {\n columns: chartData.map((item) => [item.key, ...item.values.map(({ y }) => y)]),\n type: bar(),\n },\n axis: {\n rotated: payload.barDirection === 'bar',\n x: {\n tick: {\n multiline: true,\n format(index) {\n var _a, _b, _c;\n return (_c = (_b = (_a = chartData[0]) === null || _a === void 0 ? void 0 : _a.xlabels) === null || _b === void 0 ? void 0 : _b[index]) !== null && _c !== void 0 ? _c : index;\n },\n },\n },\n },\n });\n break;\n case 'pieChart':\n case 'pie3DChart':\n Object.assign(chart, {\n data: {\n columns: Object.values(((_p = chartData[0]) === null || _p === void 0 ? void 0 : _p.xlabels) || {}).map((value, index) => {\n var _a, _b, _c;\n return [\n value,\n (_c = (_b = (_a = chartData[0]) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.y,\n ];\n }),\n type: pie(),\n },\n });\n break;\n case 'areaChart':\n Object.assign(chart, {\n data: {\n columns: chartData.map((item) => [item.key, ...item.values.map(({ y }) => y)]),\n type: area(),\n },\n axis,\n interaction: { enabled: true },\n });\n break;\n case 'scatterChart':\n Object.assign(chart, {\n data: {\n xs: { y: 'x' },\n columns: chartData.map((item, index) => [index ? 'y' : 'x', ...item]),\n type: scatter(),\n },\n axis: {\n x: {\n label: 'X',\n showDist: true,\n tick: {\n format: d3Format.format('.02f'),\n },\n },\n y: {\n label: 'Y',\n showDist: true,\n tick: {\n format: d3Format.format('.02f'),\n },\n },\n },\n });\n break;\n default:\n return;\n }\n if (chart.data) {\n const options = payload.chartOptions;\n if (options === null || options === void 0 ? void 0 : options.legend) {\n chart.legend = {\n show: options.legend.show !== false,\n position: options.legend.position === 'b' ? 'bottom' : 'right',\n format: (label) => label === '' ? '\\u200b' : label,\n };\n }\n if (!cartesian && ['barChart', 'areaChart', 'lineChart'].includes(payload.chartType)) {\n const used = new Set();\n const reserved = new Set(chart.data.columns.map((column) => String(column[0])));\n const names = {};\n chart.data.columns.forEach((column, index) => {\n const label = String(column[0]);\n let id = label;\n if (used.has(id)) {\n id = `pptx-series-${index}`;\n while (reserved.has(id) || used.has(id))\n id += '-';\n column[0] = id;\n }\n used.add(id);\n Object.defineProperty(names, id, { value: label, enumerable: true });\n });\n chart.data.names = names;\n if ((options === null || options === void 0 ? void 0 : options.grouping) === 'stacked' || (options === null || options === void 0 ? void 0 : options.grouping) === 'percentStacked') {\n chart.data.groups = [chart.data.columns.map((column) => column[0])];\n if (options.grouping === 'percentStacked')\n chart.data.stack = { normalize: true };\n chart.data.order = null;\n }\n const colors = {};\n chartData.forEach((item, index) => {\n var _a, _b;\n const fill = (_b = (_a = options === null || options === void 0 ? void 0 : options.series) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.color;\n if (fill && /^(?:#[\\da-f]{6}(?:[\\da-f]{2})?|transparent)$/i.test(fill))\n Object.defineProperty(colors, String(chart.data.columns[index][0]), { value: fill, enumerable: true });\n });\n if (Object.keys(colors).length)\n chart.data.colors = colors;\n }\n const surface = chartTarget.ownerDocument.createElement('div');\n surface.className = 'pptx-chart-surface';\n surface.style.cssText = 'width:100%;height:100%;min-width:0;min-height:0;flex:1 1 auto';\n chartTarget.replaceChildren(surface);\n chart.bindto = surface;\n const legend = createPptxChartLegend(surface, chart, options === null || options === void 0 ? void 0 : options.legend, mergePptxChartFonts((_q = payload.chartModel) === null || _q === void 0 ? void 0 : _q.font, (_r = options === null || options === void 0 ? void 0 : options.legend) === null || _r === void 0 ? void 0 : _r.font));\n const fontStyle = stylePptxChartText(surface, payload.chartModel, chart, (_t = (_s = payload.chartOptions) === null || _s === void 0 ? void 0 : _s.legend) === null || _t === void 0 ? void 0 : _t.font);\n const textPlugin = createPptxChartTextPlugin(surface);\n if (textPlugin)\n chart.plugins = [...(chart.plugins || []), textPlugin];\n const logicalSize = [((_u = chartTarget.style) === null || _u === void 0 ? void 0 : _u.width) || '', ((_v = chartTarget.style) === null || _v === void 0 ? void 0 : _v.height) || '']\n .map(value => /^\\d+(?:\\.\\d+)?px$/.test(value) ? Number.parseFloat(value) : NaN);\n if (logicalSize.every(value => Number.isFinite(value) && value > 0)) {\n const plotSize = legend === null || legend === void 0 ? void 0 : legend.size();\n chart.size = plotSize && plotSize.width > 0 && plotSize.height > 0 ? plotSize : { width: logicalSize[0], height: logicalSize[1] };\n chart.resize = { auto: false };\n }\n try {\n const instance = bb.generate(chart);\n legend === null || legend === void 0 ? void 0 : legend.bind(instance);\n return {\n destroy() {\n var _a;\n try {\n legend === null || legend === void 0 ? void 0 : legend.destroy();\n (_a = instance.destroy) === null || _a === void 0 ? void 0 : _a.call(instance);\n }\n finally {\n surface.remove();\n fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.remove();\n }\n },\n };\n }\n catch (error) {\n surface.remove();\n fontStyle === null || fontStyle === void 0 ? void 0 : fontStyle.remove();\n legend === null || legend === void 0 ? void 0 : legend.destroy();\n throw error;\n }\n }\n};\nexport const renderPptxPostProcessing = async (charts, root) => {\n restoreNumericBullets(root);\n fitOverflowingTextBlocks(root);\n const queue = asChartQueue(charts);\n const chartInstances = [];\n if (queue.length) {\n const results = await Promise.allSettled(queue.map(message => renderChart(message, root)));\n for (const result of results) {\n if (result.status === 'fulfilled') {\n if (result.value) {\n chartInstances.push(result.value);\n }\n }\n else {\n console.warn('PPTX chart rendering skipped:', result.reason);\n }\n }\n }\n let destroyed = false;\n return {\n destroy() {\n var _a;\n if (destroyed) {\n return;\n }\n destroyed = true;\n for (const chart of chartInstances) {\n try {\n (_a = chart.destroy) === null || _a === void 0 ? void 0 : _a.call(chart);\n }\n catch {\n }\n }\n chartInstances.length = 0;\n },\n };\n};\n","export const RECOMMENDED_ZIP_LIMITS = {\n maxFileBytes: 160 * 1024 * 1024,\n};\nexport const createDefaultPptxOptions = () => ({\n slidesScale: '',\n slideMode: false,\n slideType: 'divs2slidesjs',\n revealjsPath: '',\n keyBoardShortCut: false,\n mediaProcess: true,\n jsZipV2: false,\n themeProcess: true,\n incSlide: {\n width: 0,\n height: 0,\n },\n slideModeConfig: {\n first: 1,\n nav: true,\n navTxtColor: 'black',\n keyBoardShortCut: true,\n showSlideNum: true,\n showTotalSlideNum: true,\n autoSlide: true,\n randomAutoSlide: false,\n loop: false,\n background: false,\n transition: 'default',\n transitionTime: 1,\n },\n revealjsConfig: {},\n});\nexport const resolvePptxEngineOptions = (options) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const defaults = createDefaultPptxOptions();\n return {\n ...defaults,\n ...options,\n incSlide: {\n width: (_d = (_b = (_a = options === null || options === void 0 ? void 0 : options.incSlide) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : (_c = defaults.incSlide) === null || _c === void 0 ? void 0 : _c.width) !== null && _d !== void 0 ? _d : 0,\n height: (_h = (_f = (_e = options === null || options === void 0 ? void 0 : options.incSlide) === null || _e === void 0 ? void 0 : _e.height) !== null && _f !== void 0 ? _f : (_g = defaults.incSlide) === null || _g === void 0 ? void 0 : _g.height) !== null && _h !== void 0 ? _h : 0,\n },\n slideModeConfig: {\n ...defaults.slideModeConfig,\n ...options === null || options === void 0 ? void 0 : options.slideModeConfig,\n },\n revealjsConfig: {\n ...defaults.revealjsConfig,\n ...options === null || options === void 0 ? void 0 : options.revealjsConfig,\n },\n };\n};\n","const clamp = (value, min, max) => Math.min(Math.max(value, min), max);\nexport class PptxPresentation {\n constructor(viewer, labels = {}, fullscreen = true) {\n this.overlay = null;\n this.stage = null;\n this.counter = null;\n this.placeholder = null;\n this.listeners = [];\n this.layoutFrame = 0;\n this.ownsFullscreen = false;\n this.current = 1;\n this.viewer = viewer;\n this.labels = labels;\n this.fullscreen = fullscreen;\n }\n get active() {\n return Boolean(this.overlay);\n }\n get slideNumber() {\n return this.current;\n }\n get state() {\n return { active: this.active, slideNumber: this.current, total: this.viewer.slideCount };\n }\n async enter(slideNumber = this.current) {\n var _a, _b;\n if (this.active || this.viewer.slideCount === 0) {\n return;\n }\n const documentRef = this.viewer.target.ownerDocument || document;\n const overlay = documentRef.createElement('div');\n overlay.className = 'flyfish-pptx-presentation';\n overlay.tabIndex = -1;\n overlay.setAttribute('role', 'region');\n overlay.setAttribute('aria-label', this.labels.hint || 'Slideshow');\n const stage = documentRef.createElement('div');\n stage.className = 'flyfish-pptx-presentation-stage';\n const counter = documentRef.createElement('div');\n counter.className = 'flyfish-pptx-presentation-counter';\n const hint = documentRef.createElement('div');\n hint.className = 'flyfish-pptx-presentation-hint';\n hint.textContent = this.labels.hint || '';\n hint.hidden = !this.labels.hint;\n const exit = documentRef.createElement('button');\n exit.type = 'button';\n exit.className = 'flyfish-pptx-presentation-exit';\n exit.textContent = '✕';\n exit.setAttribute('aria-label', this.labels.exit || 'Exit slideshow');\n exit.addEventListener('click', event => {\n event.stopPropagation();\n this.exit();\n });\n overlay.append(stage, counter, hint, exit);\n this.overlay = overlay;\n this.stage = stage;\n this.counter = counter;\n const styleRoot = this.viewer.presentationRoot;\n styleRoot.appendChild(overlay);\n this.placeholder = documentRef.createComment('flyfish-pptx-presentation');\n this.viewer.saveScrollPosition();\n this.viewer.scaleBox.replaceWith(this.placeholder);\n stage.appendChild(this.viewer.scaleBox);\n this.viewer.content.classList.add('is-presenting');\n this.attach(documentRef, overlay);\n this.goTo(slideNumber);\n if (this.fullscreen) {\n try {\n await ((_a = overlay.requestFullscreen) === null || _a === void 0 ? void 0 : _a.call(overlay));\n this.ownsFullscreen = this.isFullscreenElement(overlay);\n }\n catch {\n this.ownsFullscreen = false;\n }\n }\n if (this.overlay !== overlay) {\n if (this.ownsFullscreen) {\n void ((_b = documentRef.exitFullscreen) === null || _b === void 0 ? void 0 : _b.call(documentRef).catch(() => undefined));\n }\n this.ownsFullscreen = false;\n return;\n }\n overlay.focus({ preventScroll: true });\n this.scheduleLayout();\n this.notify();\n }\n exit() {\n var _a, _b;\n const overlay = this.overlay;\n if (!overlay) {\n return;\n }\n const documentRef = this.viewer.target.ownerDocument || document;\n const shouldExitFullscreen = this.ownsFullscreen && this.isFullscreenElement(overlay);\n this.detach();\n if (this.layoutFrame) {\n (documentRef.defaultView || window).cancelAnimationFrame(this.layoutFrame);\n this.layoutFrame = 0;\n }\n this.viewer.content.classList.remove('is-presenting');\n for (const container of this.slideContainers()) {\n container.classList.remove('is-active-slide');\n }\n if ((_a = this.placeholder) === null || _a === void 0 ? void 0 : _a.parentNode) {\n this.placeholder.replaceWith(this.viewer.scaleBox);\n }\n else {\n this.viewer.target.appendChild(this.viewer.scaleBox);\n }\n this.placeholder = null;\n overlay.remove();\n this.overlay = null;\n this.stage = null;\n this.counter = null;\n if (shouldExitFullscreen) {\n void ((_b = documentRef.exitFullscreen) === null || _b === void 0 ? void 0 : _b.call(documentRef).catch(() => undefined));\n }\n this.ownsFullscreen = false;\n this.viewer.restoreScrollPosition();\n this.notify();\n }\n async toggle(slideNumber) {\n if (this.active) {\n this.exit();\n return;\n }\n await this.enter(slideNumber);\n }\n goTo(slideNumber) {\n const total = this.viewer.slideCount;\n if (total === 0) {\n return;\n }\n this.current = clamp(Math.round(slideNumber) || 1, 1, total);\n this.viewer.ensureSlideRendered(this.current);\n this.viewer.ensureSlideRendered(this.current + 1);\n const containers = this.slideContainers();\n const byNumber = containers.some(container => Boolean(container.dataset.slideNumber));\n containers.forEach((container, index) => {\n const isActive = byNumber\n ? Number(container.dataset.slideNumber) === this.current\n : index === this.current - 1;\n container.classList.toggle('is-active-slide', isActive);\n });\n if (this.counter) {\n this.counter.textContent = `${this.current} / ${total}`;\n }\n if (this.active) {\n this.scheduleLayout();\n this.notify();\n }\n }\n next() {\n if (this.current < this.viewer.slideCount) {\n this.goTo(this.current + 1);\n }\n }\n previous() {\n if (this.current > 1) {\n this.goTo(this.current - 1);\n }\n }\n layout() {\n const overlay = this.overlay;\n if (!overlay) {\n return;\n }\n const container = this.slideContainers().find((item, index) => {\n if (item.dataset.slideNumber) {\n return Number(item.dataset.slideNumber) === this.current;\n }\n return index === this.current - 1;\n });\n const slide = container && container.classList.contains('flyfish-pptx-slide-slot')\n ? container.firstElementChild\n : container;\n const size = this.viewer.slideDimensions;\n const slideWidth = (slide === null || slide === void 0 ? void 0 : slide.offsetWidth) || (size === null || size === void 0 ? void 0 : size.width) || 0;\n const slideHeight = (slide === null || slide === void 0 ? void 0 : slide.offsetHeight) || (size === null || size === void 0 ? void 0 : size.height) || 0;\n if (!slideWidth || !slideHeight) {\n return;\n }\n const viewWidth = overlay.clientWidth;\n const viewHeight = overlay.clientHeight;\n const scale = Math.min(viewWidth / slideWidth, viewHeight / slideHeight);\n const offsetX = Math.max(0, (viewWidth - slideWidth * scale) / 2);\n const offsetY = Math.max(0, (viewHeight - slideHeight * scale) / 2);\n const content = this.viewer.content;\n content.style.width = `${slideWidth}px`;\n content.style.transform = `translate(${offsetX}px, ${offsetY}px) scale(${scale})`;\n const scaleBox = this.viewer.scaleBox;\n scaleBox.style.width = '100%';\n scaleBox.style.height = '100%';\n scaleBox.style.minHeight = '';\n }\n destroy() {\n this.exit();\n }\n slots() {\n return Array.from(this.viewer.content.querySelectorAll(':scope > .flyfish-pptx-slide-slot'));\n }\n slideContainers() {\n const slots = this.slots();\n if (slots.length > 0) {\n return slots;\n }\n return Array.from(this.viewer.content.querySelectorAll(':scope > .slide'));\n }\n isFullscreenElement(overlay) {\n const documentRef = this.viewer.target.ownerDocument || document;\n if (documentRef.fullscreenElement === overlay) {\n return true;\n }\n const root = overlay.getRootNode();\n if (root !== documentRef && 'fullscreenElement' in root) {\n return root.fullscreenElement === overlay;\n }\n return false;\n }\n scheduleLayout() {\n const view = this.viewer.target.ownerDocument.defaultView || window;\n if (this.layoutFrame) {\n view.cancelAnimationFrame(this.layoutFrame);\n }\n this.layoutFrame = view.requestAnimationFrame(() => {\n this.layoutFrame = 0;\n this.layout();\n });\n }\n notify() {\n this.viewer.emitPresentationChange(this.state);\n }\n on(target, type, listener) {\n target.addEventListener(type, listener);\n this.listeners.push({ target, type, listener });\n }\n attach(documentRef, overlay) {\n const view = documentRef.defaultView || window;\n this.on(documentRef, 'keydown', (event) => this.handleKey(event));\n this.on(overlay, 'click', (event) => this.handleClick(event));\n this.on(overlay, 'contextmenu', (event) => {\n event.preventDefault();\n this.previous();\n });\n this.on(view, 'resize', () => this.scheduleLayout());\n this.on(documentRef, 'fullscreenchange', () => {\n if (this.ownsFullscreen && !this.isFullscreenElement(overlay)) {\n this.ownsFullscreen = false;\n this.exit();\n }\n });\n }\n detach() {\n for (const { target, type, listener } of this.listeners) {\n target.removeEventListener(type, listener);\n }\n this.listeners = [];\n }\n handleClick(event) {\n var _a;\n const overlay = this.overlay;\n if (!overlay || ((_a = event.target) === null || _a === void 0 ? void 0 : _a.closest('.flyfish-pptx-presentation-exit'))) {\n return;\n }\n const bounds = overlay.getBoundingClientRect();\n const ratio = (event.clientX - bounds.left) / (bounds.width || 1);\n if (ratio < 0.2) {\n this.previous();\n }\n else {\n this.next();\n }\n }\n handleKey(event) {\n if (!this.active || event.altKey || event.metaKey || event.ctrlKey) {\n return;\n }\n const target = event.target;\n if (target &&\n typeof target.closest === 'function' &&\n target.closest('button, a, input, textarea, select, [contenteditable=\"true\"], [contenteditable=\"\"]')) {\n return;\n }\n if (target && typeof target.closest === 'function') {\n const otherOverlay = target.closest('.flyfish-pptx-presentation');\n if (otherOverlay && otherOverlay !== this.overlay) {\n return;\n }\n }\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n case 'PageDown':\n case ' ':\n case 'Enter':\n event.preventDefault();\n this.next();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n case 'PageUp':\n case 'Backspace':\n event.preventDefault();\n this.previous();\n break;\n case 'Home':\n event.preventDefault();\n this.goTo(1);\n break;\n case 'End':\n event.preventDefault();\n this.goTo(this.viewer.slideCount);\n break;\n case 'Escape':\n event.preventDefault();\n this.exit();\n break;\n default:\n break;\n }\n }\n}\n","/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */\nfunction _OverloadYield(e, d) {\n\tthis.v = e, this.k = d;\n}\nfunction _arrayLikeToArray(r, a) {\n\t(null == a || a > r.length) && (a = r.length);\n\tfor (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n\treturn n;\n}\nfunction _arrayWithHoles(r) {\n\tif (Array.isArray(r)) return r;\n}\nfunction _iterableToArrayLimit(r, l) {\n\tvar t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n\tif (null != t) {\n\t\tvar e, n, i, u, a = [], f = !0, o = !1;\n\t\ttry {\n\t\t\tif (i = (t = t.call(r)).next, 0 === l) {\n\t\t\t\tif (Object(t) !== t) return;\n\t\t\t\tf = !1;\n\t\t\t} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n\t\t} catch (r) {\n\t\t\to = !0, n = r;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n\t\t\t} finally {\n\t\t\t\tif (o) throw n;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}\nfunction _nonIterableRest() {\n\tthrow new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\nfunction _slicedToArray(r, e) {\n\treturn _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _unsupportedIterableToArray(r, a) {\n\tif (r) {\n\t\tif (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n\t\tvar t = {}.toString.call(r).slice(8, -1);\n\t\treturn \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n\t}\n}\nfunction AsyncGenerator(e) {\n\tvar t, n;\n\tfunction resume(t, n) {\n\t\ttry {\n\t\t\tvar r = e[t](n), o = r.value, u = o instanceof _OverloadYield;\n\t\t\tPromise.resolve(u ? o.v : o).then(function(n) {\n\t\t\t\tif (u) {\n\t\t\t\t\tvar i = \"return\" === t && o.k ? t : \"next\";\n\t\t\t\t\tif (!o.k || n.done) return resume(i, n);\n\t\t\t\t\tn = e[i](n).value;\n\t\t\t\t}\n\t\t\t\tsettle(!!r.done, n);\n\t\t\t}, function(e) {\n\t\t\t\tresume(\"throw\", e);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tsettle(2, e);\n\t\t}\n\t}\n\tfunction settle(e, r) {\n\t\t2 === e ? t.reject(r) : t.resolve({\n\t\t\tvalue: r,\n\t\t\tdone: e\n\t\t}), (t = t.next) ? resume(t.key, t.arg) : n = null;\n\t}\n\tthis._invoke = function(e, r) {\n\t\treturn new Promise(function(o, u) {\n\t\t\tvar i = {\n\t\t\t\tkey: e,\n\t\t\t\targ: r,\n\t\t\t\tresolve: o,\n\t\t\t\treject: u,\n\t\t\t\tnext: null\n\t\t\t};\n\t\t\tn ? n = n.next = i : (t = n = i, resume(e, r));\n\t\t});\n\t}, \"function\" != typeof e.return && (this.return = void 0);\n}\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function() {\n\treturn this;\n}, AsyncGenerator.prototype.next = function(e) {\n\treturn this._invoke(\"next\", e);\n}, AsyncGenerator.prototype.throw = function(e) {\n\treturn this._invoke(\"throw\", e);\n}, AsyncGenerator.prototype.return = function(e) {\n\treturn this._invoke(\"return\", e);\n};\nconst entries = Object.entries;\nconst setPrototypeOf = Object.setPrototypeOf;\nconst isFrozen = Object.isFrozen;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nlet freeze = Object.freeze;\nlet seal = Object.seal;\nlet create = Object.create;\nlet _ref = typeof Reflect !== \"undefined\" && Reflect;\nlet apply = _ref.apply;\nlet construct = _ref.construct;\nif (!freeze) freeze = function freeze(x) {\n\treturn x;\n};\nif (!seal) seal = function seal(x) {\n\treturn x;\n};\nif (!apply) apply = function apply(func, thisArg) {\n\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\treturn func.apply(thisArg, args);\n};\nif (!construct) construct = function construct(Func) {\n\tfor (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];\n\treturn new Func(...args);\n};\nconst arrayForEach = unapply(Array.prototype.forEach);\nArray.prototype.indexOf;\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\nconst arraySplice = unapply(Array.prototype.splice);\nconst arrayIsArray = Array.isArray;\nconst setCreate = unconstruct(Set);\nconst setAdd = unapply(Set.prototype.add);\nconst setHas = unapply(Set.prototype.has);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst numberToString = unapply(Number.prototype.toString);\nconst booleanToString = unapply(Boolean.prototype.toString);\nconst bigintToString = typeof BigInt === \"undefined\" ? null : unapply(BigInt.prototype.toString);\nconst symbolToString = typeof Symbol === \"undefined\" ? null : unapply(Symbol.prototype.toString);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst objectToString = unapply(Object.prototype.toString);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n* Creates a new function that calls the given function with a specified thisArg and arguments.\n*\n* @param func - The function to be wrapped and called.\n* @returns A new function that calls the given function with a specified thisArg and arguments.\n*/\nfunction unapply(func) {\n\treturn function(thisArg) {\n\t\tif (thisArg instanceof RegExp) thisArg.lastIndex = 0;\n\t\tfor (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n\t\treturn apply(func, thisArg, args);\n\t};\n}\n/**\n* Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n*\n* @param func - The constructor function to be wrapped and called.\n* @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n*/\nfunction unconstruct(Func) {\n\treturn function() {\n\t\tfor (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n\t\treturn construct(Func, args);\n\t};\n}\n/**\n* Add properties to a lookup table\n*\n* @param set - The set to which elements will be added.\n* @param array - The array containing elements to be added to the set.\n* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n* @returns The modified set with added elements.\n*/\nfunction addToSet(set, array) {\n\tlet transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;\n\tif (setPrototypeOf) setPrototypeOf(set, null);\n\tif (!arrayIsArray(array)) return set;\n\tlet l = array.length;\n\twhile (l--) {\n\t\tlet element = array[l];\n\t\tif (typeof element === \"string\") {\n\t\t\tconst lcElement = transformCaseFunc(element);\n\t\t\tif (lcElement !== element) {\n\t\t\t\tif (!isFrozen(array)) array[l] = lcElement;\n\t\t\t\telement = lcElement;\n\t\t\t}\n\t\t}\n\t\tset[element] = true;\n\t}\n\treturn set;\n}\n/**\n* Clean up an array to harden against CSPP\n*\n* @param array - The array to be cleaned.\n* @returns The cleaned version of the array\n*/\nfunction cleanArray(array) {\n\tfor (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;\n\treturn array;\n}\n/**\n* Shallow clone an object\n*\n* @param object - The object to be cloned.\n* @returns A new object that copies the original.\n*/\nfunction clone(object) {\n\tconst newObject = create(null);\n\tfor (const _ref2 of entries(object)) {\n\t\tvar _ref3 = _slicedToArray(_ref2, 2);\n\t\tconst property = _ref3[0];\n\t\tconst value = _ref3[1];\n\t\tif (objectHasOwnProperty(object, property)) {\n\t\t\tif (arrayIsArray(value)) newObject[property] = cleanArray(value);\n\t\t\telse if (value && typeof value === \"object\" && value.constructor === Object) newObject[property] = clone(value);\n\t\t\telse newObject[property] = value;\n\t\t}\n\t}\n\treturn newObject;\n}\n/**\n* Convert non-node values into strings without depending on direct property access.\n*\n* @param value - The value to stringify.\n* @returns A string representation of the provided value.\n*/\nfunction stringifyValue(value) {\n\tswitch (typeof value) {\n\t\tcase \"string\": return value;\n\t\tcase \"number\": return numberToString(value);\n\t\tcase \"boolean\": return booleanToString(value);\n\t\tcase \"bigint\": return bigintToString ? bigintToString(value) : \"0\";\n\t\tcase \"symbol\": return symbolToString ? symbolToString(value) : \"Symbol()\";\n\t\tcase \"undefined\": return objectToString(value);\n\t\tcase \"function\":\n\t\tcase \"object\": {\n\t\t\tif (value === null) return objectToString(value);\n\t\t\tconst valueAsRecord = value;\n\t\t\tconst valueToString = lookupGetter(valueAsRecord, \"toString\");\n\t\t\tif (typeof valueToString === \"function\") {\n\t\t\t\tconst stringified = valueToString(valueAsRecord);\n\t\t\t\treturn typeof stringified === \"string\" ? stringified : objectToString(stringified);\n\t\t\t}\n\t\t\treturn objectToString(value);\n\t\t}\n\t\tdefault: return objectToString(value);\n\t}\n}\n/**\n* This method automatically checks if the prop is function or getter and behaves accordingly.\n*\n* @param object - The object to look up the getter function in its prototype chain.\n* @param prop - The property name for which to find the getter function.\n* @returns The getter function found in the prototype chain or a fallback function.\n*/\nfunction lookupGetter(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) {\n\t\t\tif (desc.get) return unapply(desc.get);\n\t\t\tif (typeof desc.value === \"function\") return unapply(desc.value);\n\t\t}\n\t\tobject = getPrototypeOf(object);\n\t}\n\tfunction fallbackValue() {\n\t\treturn null;\n\t}\n\treturn fallbackValue;\n}\n/**\n* Like lookupGetter, but for accessor properties only, and returns null\n* instead of a null-returning fallback when no getter exists on the chain.\n* Lets a caller fall back to a direct property read in environments that\n* lack the getter, where a fallback returning null would be indistinguishable\n* from a legitimate null value (e.g. namespaceURI of a no-namespace element).\n*\n* @param object - The object (usually a prototype) to start the lookup at.\n* @param prop - The accessor property name.\n* @returns The unapplied getter, or null if none was found.\n*/\nfunction lookupAccessor(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) return desc.get ? unapply(desc.get) : null;\n\t\tobject = getPrototypeOf(object);\n\t}\n\treturn null;\n}\nfunction isRegex(value) {\n\ttry {\n\t\tregExpTest(value, \"\");\n\t\treturn true;\n\t} catch (_unused) {\n\t\treturn false;\n\t}\n}\nconst html$1 = freeze([\n\t\"a\",\n\t\"abbr\",\n\t\"acronym\",\n\t\"address\",\n\t\"area\",\n\t\"article\",\n\t\"aside\",\n\t\"audio\",\n\t\"b\",\n\t\"bdi\",\n\t\"bdo\",\n\t\"big\",\n\t\"blink\",\n\t\"blockquote\",\n\t\"body\",\n\t\"br\",\n\t\"button\",\n\t\"canvas\",\n\t\"caption\",\n\t\"center\",\n\t\"cite\",\n\t\"code\",\n\t\"col\",\n\t\"colgroup\",\n\t\"content\",\n\t\"data\",\n\t\"datalist\",\n\t\"dd\",\n\t\"decorator\",\n\t\"del\",\n\t\"details\",\n\t\"dfn\",\n\t\"dialog\",\n\t\"dir\",\n\t\"div\",\n\t\"dl\",\n\t\"dt\",\n\t\"element\",\n\t\"em\",\n\t\"fieldset\",\n\t\"figcaption\",\n\t\"figure\",\n\t\"font\",\n\t\"footer\",\n\t\"form\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"head\",\n\t\"header\",\n\t\"hgroup\",\n\t\"hr\",\n\t\"html\",\n\t\"i\",\n\t\"img\",\n\t\"input\",\n\t\"ins\",\n\t\"kbd\",\n\t\"label\",\n\t\"legend\",\n\t\"li\",\n\t\"main\",\n\t\"map\",\n\t\"mark\",\n\t\"marquee\",\n\t\"menu\",\n\t\"menuitem\",\n\t\"meter\",\n\t\"nav\",\n\t\"nobr\",\n\t\"ol\",\n\t\"optgroup\",\n\t\"option\",\n\t\"output\",\n\t\"p\",\n\t\"picture\",\n\t\"pre\",\n\t\"progress\",\n\t\"q\",\n\t\"rp\",\n\t\"rt\",\n\t\"ruby\",\n\t\"s\",\n\t\"samp\",\n\t\"search\",\n\t\"section\",\n\t\"select\",\n\t\"shadow\",\n\t\"slot\",\n\t\"small\",\n\t\"source\",\n\t\"spacer\",\n\t\"span\",\n\t\"strike\",\n\t\"strong\",\n\t\"style\",\n\t\"sub\",\n\t\"summary\",\n\t\"sup\",\n\t\"table\",\n\t\"tbody\",\n\t\"td\",\n\t\"template\",\n\t\"textarea\",\n\t\"tfoot\",\n\t\"th\",\n\t\"thead\",\n\t\"time\",\n\t\"tr\",\n\t\"track\",\n\t\"tt\",\n\t\"u\",\n\t\"ul\",\n\t\"var\",\n\t\"video\",\n\t\"wbr\"\n]);\nconst svg$1 = freeze([\n\t\"svg\",\n\t\"a\",\n\t\"altglyph\",\n\t\"altglyphdef\",\n\t\"altglyphitem\",\n\t\"animatecolor\",\n\t\"animatemotion\",\n\t\"animatetransform\",\n\t\"circle\",\n\t\"clippath\",\n\t\"defs\",\n\t\"desc\",\n\t\"ellipse\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"filter\",\n\t\"font\",\n\t\"g\",\n\t\"glyph\",\n\t\"glyphref\",\n\t\"hkern\",\n\t\"image\",\n\t\"inputmode\",\n\t\"line\",\n\t\"lineargradient\",\n\t\"marker\",\n\t\"mask\",\n\t\"metadata\",\n\t\"mpath\",\n\t\"part\",\n\t\"path\",\n\t\"pattern\",\n\t\"polygon\",\n\t\"polyline\",\n\t\"radialgradient\",\n\t\"rect\",\n\t\"stop\",\n\t\"style\",\n\t\"switch\",\n\t\"symbol\",\n\t\"text\",\n\t\"textpath\",\n\t\"title\",\n\t\"tref\",\n\t\"tspan\",\n\t\"view\",\n\t\"vkern\"\n]);\nconst svgFilters = freeze([\n\t\"feBlend\",\n\t\"feColorMatrix\",\n\t\"feComponentTransfer\",\n\t\"feComposite\",\n\t\"feConvolveMatrix\",\n\t\"feDiffuseLighting\",\n\t\"feDisplacementMap\",\n\t\"feDistantLight\",\n\t\"feDropShadow\",\n\t\"feFlood\",\n\t\"feFuncA\",\n\t\"feFuncB\",\n\t\"feFuncG\",\n\t\"feFuncR\",\n\t\"feGaussianBlur\",\n\t\"feImage\",\n\t\"feMerge\",\n\t\"feMergeNode\",\n\t\"feMorphology\",\n\t\"feOffset\",\n\t\"fePointLight\",\n\t\"feSpecularLighting\",\n\t\"feSpotLight\",\n\t\"feTile\",\n\t\"feTurbulence\"\n]);\nconst svgDisallowed = freeze([\n\t\"animate\",\n\t\"color-profile\",\n\t\"cursor\",\n\t\"discard\",\n\t\"font-face\",\n\t\"font-face-format\",\n\t\"font-face-name\",\n\t\"font-face-src\",\n\t\"font-face-uri\",\n\t\"foreignobject\",\n\t\"hatch\",\n\t\"hatchpath\",\n\t\"mesh\",\n\t\"meshgradient\",\n\t\"meshpatch\",\n\t\"meshrow\",\n\t\"missing-glyph\",\n\t\"script\",\n\t\"set\",\n\t\"solidcolor\",\n\t\"unknown\",\n\t\"use\"\n]);\nconst mathMl$1 = freeze([\n\t\"math\",\n\t\"menclose\",\n\t\"merror\",\n\t\"mfenced\",\n\t\"mfrac\",\n\t\"mglyph\",\n\t\"mi\",\n\t\"mlabeledtr\",\n\t\"mmultiscripts\",\n\t\"mn\",\n\t\"mo\",\n\t\"mover\",\n\t\"mpadded\",\n\t\"mphantom\",\n\t\"mroot\",\n\t\"mrow\",\n\t\"ms\",\n\t\"mspace\",\n\t\"msqrt\",\n\t\"mstyle\",\n\t\"msub\",\n\t\"msup\",\n\t\"msubsup\",\n\t\"mtable\",\n\t\"mtd\",\n\t\"mtext\",\n\t\"mtr\",\n\t\"munder\",\n\t\"munderover\",\n\t\"mprescripts\"\n]);\nconst mathMlDisallowed = freeze([\n\t\"maction\",\n\t\"maligngroup\",\n\t\"malignmark\",\n\t\"mlongdiv\",\n\t\"mscarries\",\n\t\"mscarry\",\n\t\"msgroup\",\n\t\"mstack\",\n\t\"msline\",\n\t\"msrow\",\n\t\"semantics\",\n\t\"annotation\",\n\t\"annotation-xml\",\n\t\"mprescripts\",\n\t\"none\"\n]);\nconst text = freeze([\"#text\"]);\nconst html = freeze([\n\t\"accept\",\n\t\"action\",\n\t\"align\",\n\t\"alt\",\n\t\"autocapitalize\",\n\t\"autocomplete\",\n\t\"autopictureinpicture\",\n\t\"autoplay\",\n\t\"background\",\n\t\"bgcolor\",\n\t\"border\",\n\t\"capture\",\n\t\"cellpadding\",\n\t\"cellspacing\",\n\t\"checked\",\n\t\"cite\",\n\t\"class\",\n\t\"clear\",\n\t\"color\",\n\t\"cols\",\n\t\"colspan\",\n\t\"command\",\n\t\"commandfor\",\n\t\"controls\",\n\t\"controlslist\",\n\t\"coords\",\n\t\"crossorigin\",\n\t\"datetime\",\n\t\"decoding\",\n\t\"default\",\n\t\"dir\",\n\t\"disabled\",\n\t\"disablepictureinpicture\",\n\t\"disableremoteplayback\",\n\t\"download\",\n\t\"draggable\",\n\t\"enctype\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"face\",\n\t\"for\",\n\t\"headers\",\n\t\"height\",\n\t\"hidden\",\n\t\"high\",\n\t\"href\",\n\t\"hreflang\",\n\t\"id\",\n\t\"inert\",\n\t\"inputmode\",\n\t\"integrity\",\n\t\"ismap\",\n\t\"kind\",\n\t\"label\",\n\t\"lang\",\n\t\"list\",\n\t\"loading\",\n\t\"loop\",\n\t\"low\",\n\t\"max\",\n\t\"maxlength\",\n\t\"media\",\n\t\"method\",\n\t\"min\",\n\t\"minlength\",\n\t\"multiple\",\n\t\"muted\",\n\t\"name\",\n\t\"nonce\",\n\t\"noshade\",\n\t\"novalidate\",\n\t\"nowrap\",\n\t\"open\",\n\t\"optimum\",\n\t\"part\",\n\t\"pattern\",\n\t\"placeholder\",\n\t\"playsinline\",\n\t\"popover\",\n\t\"popovertarget\",\n\t\"popovertargetaction\",\n\t\"poster\",\n\t\"preload\",\n\t\"pubdate\",\n\t\"radiogroup\",\n\t\"readonly\",\n\t\"rel\",\n\t\"required\",\n\t\"rev\",\n\t\"reversed\",\n\t\"role\",\n\t\"rows\",\n\t\"rowspan\",\n\t\"spellcheck\",\n\t\"scope\",\n\t\"selected\",\n\t\"shape\",\n\t\"size\",\n\t\"sizes\",\n\t\"slot\",\n\t\"span\",\n\t\"srclang\",\n\t\"start\",\n\t\"src\",\n\t\"srcset\",\n\t\"step\",\n\t\"style\",\n\t\"summary\",\n\t\"tabindex\",\n\t\"title\",\n\t\"translate\",\n\t\"type\",\n\t\"usemap\",\n\t\"valign\",\n\t\"value\",\n\t\"width\",\n\t\"wrap\",\n\t\"xmlns\"\n]);\nconst svg = freeze([\n\t\"accent-height\",\n\t\"accumulate\",\n\t\"additive\",\n\t\"alignment-baseline\",\n\t\"amplitude\",\n\t\"ascent\",\n\t\"attributename\",\n\t\"attributetype\",\n\t\"azimuth\",\n\t\"basefrequency\",\n\t\"baseline-shift\",\n\t\"begin\",\n\t\"bias\",\n\t\"by\",\n\t\"class\",\n\t\"clip\",\n\t\"clippathunits\",\n\t\"clip-path\",\n\t\"clip-rule\",\n\t\"color\",\n\t\"color-interpolation\",\n\t\"color-interpolation-filters\",\n\t\"color-profile\",\n\t\"color-rendering\",\n\t\"cx\",\n\t\"cy\",\n\t\"d\",\n\t\"dx\",\n\t\"dy\",\n\t\"diffuseconstant\",\n\t\"direction\",\n\t\"display\",\n\t\"divisor\",\n\t\"dominant-baseline\",\n\t\"dur\",\n\t\"edgemode\",\n\t\"elevation\",\n\t\"end\",\n\t\"exponent\",\n\t\"fill\",\n\t\"fill-opacity\",\n\t\"fill-rule\",\n\t\"filter\",\n\t\"filterunits\",\n\t\"flood-color\",\n\t\"flood-opacity\",\n\t\"font-family\",\n\t\"font-size\",\n\t\"font-size-adjust\",\n\t\"font-stretch\",\n\t\"font-style\",\n\t\"font-variant\",\n\t\"font-weight\",\n\t\"fx\",\n\t\"fy\",\n\t\"g1\",\n\t\"g2\",\n\t\"glyph-name\",\n\t\"glyphref\",\n\t\"gradientunits\",\n\t\"gradienttransform\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"image-rendering\",\n\t\"in\",\n\t\"in2\",\n\t\"intercept\",\n\t\"k\",\n\t\"k1\",\n\t\"k2\",\n\t\"k3\",\n\t\"k4\",\n\t\"kerning\",\n\t\"keypoints\",\n\t\"keysplines\",\n\t\"keytimes\",\n\t\"lang\",\n\t\"lengthadjust\",\n\t\"letter-spacing\",\n\t\"kernelmatrix\",\n\t\"kernelunitlength\",\n\t\"lighting-color\",\n\t\"local\",\n\t\"marker-end\",\n\t\"marker-mid\",\n\t\"marker-start\",\n\t\"markerheight\",\n\t\"markerunits\",\n\t\"markerwidth\",\n\t\"maskcontentunits\",\n\t\"maskunits\",\n\t\"max\",\n\t\"mask\",\n\t\"mask-type\",\n\t\"media\",\n\t\"method\",\n\t\"mode\",\n\t\"min\",\n\t\"name\",\n\t\"numoctaves\",\n\t\"offset\",\n\t\"operator\",\n\t\"opacity\",\n\t\"order\",\n\t\"orient\",\n\t\"orientation\",\n\t\"origin\",\n\t\"overflow\",\n\t\"paint-order\",\n\t\"path\",\n\t\"pathlength\",\n\t\"patterncontentunits\",\n\t\"patterntransform\",\n\t\"patternunits\",\n\t\"pointer-events\",\n\t\"points\",\n\t\"preservealpha\",\n\t\"preserveaspectratio\",\n\t\"primitiveunits\",\n\t\"r\",\n\t\"rx\",\n\t\"ry\",\n\t\"radius\",\n\t\"refx\",\n\t\"refy\",\n\t\"repeatcount\",\n\t\"repeatdur\",\n\t\"restart\",\n\t\"result\",\n\t\"rotate\",\n\t\"scale\",\n\t\"seed\",\n\t\"shape-rendering\",\n\t\"slope\",\n\t\"specularconstant\",\n\t\"specularexponent\",\n\t\"spreadmethod\",\n\t\"startoffset\",\n\t\"stddeviation\",\n\t\"stitchtiles\",\n\t\"stop-color\",\n\t\"stop-opacity\",\n\t\"stroke-dasharray\",\n\t\"stroke-dashoffset\",\n\t\"stroke-linecap\",\n\t\"stroke-linejoin\",\n\t\"stroke-miterlimit\",\n\t\"stroke-opacity\",\n\t\"stroke\",\n\t\"stroke-width\",\n\t\"style\",\n\t\"surfacescale\",\n\t\"systemlanguage\",\n\t\"tabindex\",\n\t\"tablevalues\",\n\t\"targetx\",\n\t\"targety\",\n\t\"transform\",\n\t\"transform-origin\",\n\t\"text-anchor\",\n\t\"text-decoration\",\n\t\"text-orientation\",\n\t\"text-rendering\",\n\t\"textlength\",\n\t\"type\",\n\t\"u1\",\n\t\"u2\",\n\t\"unicode\",\n\t\"values\",\n\t\"vector-effect\",\n\t\"viewbox\",\n\t\"visibility\",\n\t\"version\",\n\t\"vert-adv-y\",\n\t\"vert-origin-x\",\n\t\"vert-origin-y\",\n\t\"width\",\n\t\"word-spacing\",\n\t\"wrap\",\n\t\"writing-mode\",\n\t\"xchannelselector\",\n\t\"ychannelselector\",\n\t\"x\",\n\t\"x1\",\n\t\"x2\",\n\t\"xmlns\",\n\t\"y\",\n\t\"y1\",\n\t\"y2\",\n\t\"z\",\n\t\"zoomandpan\"\n]);\nconst mathMl = freeze([\n\t\"accent\",\n\t\"accentunder\",\n\t\"align\",\n\t\"bevelled\",\n\t\"close\",\n\t\"columnalign\",\n\t\"columnlines\",\n\t\"columnspacing\",\n\t\"columnspan\",\n\t\"denomalign\",\n\t\"depth\",\n\t\"dir\",\n\t\"display\",\n\t\"displaystyle\",\n\t\"encoding\",\n\t\"fence\",\n\t\"frame\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"largeop\",\n\t\"length\",\n\t\"linethickness\",\n\t\"lquote\",\n\t\"lspace\",\n\t\"mathbackground\",\n\t\"mathcolor\",\n\t\"mathsize\",\n\t\"mathvariant\",\n\t\"maxsize\",\n\t\"minsize\",\n\t\"movablelimits\",\n\t\"notation\",\n\t\"numalign\",\n\t\"open\",\n\t\"rowalign\",\n\t\"rowlines\",\n\t\"rowspacing\",\n\t\"rowspan\",\n\t\"rspace\",\n\t\"rquote\",\n\t\"scriptlevel\",\n\t\"scriptminsize\",\n\t\"scriptsizemultiplier\",\n\t\"selection\",\n\t\"separator\",\n\t\"separators\",\n\t\"stretchy\",\n\t\"subscriptshift\",\n\t\"supscriptshift\",\n\t\"symmetric\",\n\t\"voffset\",\n\t\"width\",\n\t\"xmlns\"\n]);\nconst xml = freeze([\n\t\"xlink:href\",\n\t\"xml:id\",\n\t\"xlink:title\",\n\t\"xml:space\",\n\t\"xmlns:xlink\"\n]);\nconst MUSTACHE_EXPR = seal(/{{[\\w\\W]*|^[\\w\\W]*}}/g);\nconst ERB_EXPR = seal(/<%[\\w\\W]*|^[\\w\\W]*%>/g);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*/g);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/);\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/);\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\nconst ELEMENT_MARKUP_PROBE = seal(/<[/\\w!]/g);\nconst COMMENT_MARKUP_PROBE = seal(/<[/\\w]/g);\nconst FALLBACK_TAG_CLOSE = seal(/<\\/no(script|embed|frames)/i);\nconst SELF_CLOSING_TAG = seal(/\\/>/i);\nconst NODE_TYPE = {\n\telement: 1,\n\tattribute: 2,\n\ttext: 3,\n\tcdataSection: 4,\n\tentityReference: 5,\n\tentityNode: 6,\n\tprocessingInstruction: 7,\n\tcomment: 8,\n\tdocument: 9,\n\tdocumentType: 10,\n\tdocumentFragment: 11,\n\tnotation: 12\n};\nconst LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, [\n\t\"style\",\n\t\"script\",\n\t\"xmp\",\n\t\"iframe\",\n\t\"noembed\",\n\t\"noframes\",\n\t\"plaintext\",\n\t\"noscript\"\n]));\nconst getGlobal = function getGlobal() {\n\treturn typeof window === \"undefined\" ? null : window;\n};\n/**\n* Creates a no-op policy for internal use only.\n* Don't export this function outside this module!\n* @param trustedTypes The policy factory.\n* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n* @return The policy created (or null, if Trusted Types\n* are not supported or creating the policy failed).\n*/\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n\tif (typeof trustedTypes !== \"object\" || typeof trustedTypes.createPolicy !== \"function\") return null;\n\tlet suffix = null;\n\tconst ATTR_NAME = \"data-tt-policy-suffix\";\n\tif (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);\n\tconst policyName = \"dompurify\" + (suffix ? \"#\" + suffix : \"\");\n\ttry {\n\t\treturn trustedTypes.createPolicy(policyName, {\n\t\t\tcreateHTML(html) {\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tcreateScriptURL(scriptUrl) {\n\t\t\t\treturn scriptUrl;\n\t\t\t}\n\t\t});\n\t} catch (_) {\n\t\tconsole.warn(\"TrustedTypes policy \" + policyName + \" could not be created.\");\n\t\treturn null;\n\t}\n};\nconst _createHooksMap = function _createHooksMap() {\n\treturn {\n\t\tafterSanitizeAttributes: [],\n\t\tafterSanitizeElements: [],\n\t\tafterSanitizeShadowDOM: [],\n\t\tbeforeSanitizeAttributes: [],\n\t\tbeforeSanitizeElements: [],\n\t\tbeforeSanitizeShadowDOM: [],\n\t\tuponSanitizeAttribute: [],\n\t\tuponSanitizeElement: [],\n\t\tuponSanitizeShadowNode: []\n\t};\n};\n/**\n* Resolve a set-valued configuration option: a fresh set built from\n* cfg[key] when it is an own array property (seeded with a clone of\n* options.base when given, case-normalized via options.transform),\n* the fallback set otherwise.\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param fallback the set to use when the option is absent or not an array\n* @param options transform and optional base set to merge into\n* @returns the resolved set\n*/\nconst _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {\n\treturn objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;\n};\n/**\n* Resolve an object-valued configuration option: a prototype-free clone\n* of cfg[key] when it is an own, truthy object property, else a fresh\n* fallback built by makeFallback (fresh on every parse, so a previous\n* parse can never leak state into the next one).\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param makeFallback builds the fallback value when the option is absent\n* @returns the resolved object\n*/\nconst _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {\n\tconst value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;\n\treturn value && typeof value === \"object\" ? clone(value) : makeFallback();\n};\nfunction createDOMPurify() {\n\tlet window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();\n\tconst DOMPurify = (root) => createDOMPurify(root);\n\tDOMPurify.version = \"3.4.17\";\n\tDOMPurify.removed = [];\n\tif (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n\t\tDOMPurify.isSupported = false;\n\t\treturn DOMPurify;\n\t}\n\tlet document = window.document;\n\tconst originalDocument = document;\n\tconst currentScript = originalDocument.currentScript;\n\twindow.DocumentFragment;\n\tconst HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter;\n\twindow.NamedNodeMap === void 0 && (window.NamedNodeMap || window.MozNamedAttrMap);\n\twindow.HTMLFormElement;\n\tconst DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;\n\tconst ElementPrototype = Element.prototype;\n\tconst cloneNode = lookupGetter(ElementPrototype, \"cloneNode\");\n\tconst remove = lookupGetter(ElementPrototype, \"remove\");\n\tconst removeAttributeNode = lookupGetter(ElementPrototype, \"removeAttributeNode\");\n\tconst getNextSibling = lookupGetter(ElementPrototype, \"nextSibling\");\n\tconst getChildNodes = lookupGetter(ElementPrototype, \"childNodes\");\n\tconst getParentNode = lookupGetter(ElementPrototype, \"parentNode\");\n\tconst getShadowRoot = lookupGetter(ElementPrototype, \"shadowRoot\");\n\tconst getAttributes = lookupGetter(ElementPrototype, \"attributes\");\n\tconst getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeType\") : null;\n\tconst getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeName\") : null;\n\tconst getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, \"ownerDocument\") : null;\n\tconst _readNodeType = function _readNodeType(node) {\n\t\treturn getNodeType ? getNodeType(node) : node.nodeType;\n\t};\n\tconst _readNodeName = function _readNodeName(node) {\n\t\treturn getNodeName ? getNodeName(node) : node.nodeName;\n\t};\n\tconst getNamespaceURI = lookupAccessor(ElementPrototype, \"namespaceURI\");\n\tconst _readNamespaceURI = function _readNamespaceURI(element) {\n\t\treturn getNamespaceURI ? getNamespaceURI(element) : element.namespaceURI;\n\t};\n\tif (typeof HTMLTemplateElement === \"function\") {\n\t\tconst template = document.createElement(\"template\");\n\t\tif (template.content && template.content.ownerDocument) document = template.content.ownerDocument;\n\t}\n\tlet trustedTypesPolicy;\n\tlet emptyHTML = \"\";\n\tlet defaultTrustedTypesPolicy;\n\tlet defaultTrustedTypesPolicyResolved = false;\n\tlet IN_TRUSTED_TYPES_POLICY = 0;\n\tconst _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {\n\t\tif (IN_TRUSTED_TYPES_POLICY > 0) throw typeErrorCreate(\"A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \\\"DOMPurify and Trusted Types\\\" section of the README.\");\n\t};\n\tconst _createTrustedHTML = function _createTrustedHTML(html) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createHTML(html);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createScriptURL(scriptUrl);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {\n\t\tif (!defaultTrustedTypesPolicyResolved) {\n\t\t\tdefaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n\t\t\tdefaultTrustedTypesPolicyResolved = true;\n\t\t}\n\t\treturn defaultTrustedTypesPolicy;\n\t};\n\tconst _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;\n\tconst importNode = originalDocument.importNode;\n\tlet hooks = _createHooksMap();\n\t/**\n\t* Expose whether this browser supports running the full DOMPurify.\n\t*/\n\tDOMPurify.isSupported = typeof entries === \"function\" && typeof getParentNode === \"function\" && implementation && implementation.createHTMLDocument !== void 0;\n\tconst MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;\n\tlet IS_ALLOWED_URI$1 = IS_ALLOWED_URI;\n\t/**\n\t* We consider the elements and attributes below to be safe. Ideally\n\t* don't add any new ones but feel free to remove unwanted ones.\n\t*/\n\tlet ALLOWED_TAGS = null;\n\tconst DEFAULT_ALLOWED_TAGS = addToSet({}, [\n\t\t...html$1,\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...mathMl$1,\n\t\t...text\n\t]);\n\tlet ALLOWED_ATTR = null;\n\tconst DEFAULT_ALLOWED_ATTR = addToSet({}, [\n\t\t...html,\n\t\t...svg,\n\t\t...mathMl,\n\t\t...xml\n\t]);\n\tlet CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tallowCustomizedBuiltInElements: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: false\n\t\t}\n\t}));\n\tlet FORBID_TAGS = null;\n\tlet FORBID_ATTR = null;\n\tconst EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t}\n\t}));\n\tlet ALLOW_ARIA_ATTR = true;\n\tlet ALLOW_DATA_ATTR = true;\n\tlet ALLOW_UNKNOWN_PROTOCOLS = false;\n\tlet ALLOW_SELF_CLOSE_IN_ATTR = true;\n\tlet SAFE_FOR_TEMPLATES = false;\n\tlet SAFE_FOR_XML = true;\n\tlet WHOLE_DOCUMENT = false;\n\tlet SET_CONFIG = false;\n\tlet SET_CONFIG_ALLOWED_TAGS = null;\n\tlet SET_CONFIG_ALLOWED_ATTR = null;\n\tlet FORCE_BODY = false;\n\tlet RETURN_DOM = false;\n\tlet RETURN_DOM_FRAGMENT = false;\n\tlet RETURN_TRUSTED_TYPE = false;\n\tlet SANITIZE_DOM = true;\n\tlet SANITIZE_NAMED_PROPS = false;\n\tconst SANITIZE_NAMED_PROPS_PREFIX = \"user-content-\";\n\tlet KEEP_CONTENT = true;\n\tlet IN_PLACE = false;\n\tlet IN_PLACE_VISITED = null;\n\tlet USE_PROFILES = {};\n\tlet FORBID_CONTENTS = null;\n\tconst DEFAULT_FORBID_CONTENTS = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"audio\",\n\t\t\"colgroup\",\n\t\t\"desc\",\n\t\t\"foreignobject\",\n\t\t\"head\",\n\t\t\"iframe\",\n\t\t\"math\",\n\t\t\"mi\",\n\t\t\"mn\",\n\t\t\"mo\",\n\t\t\"ms\",\n\t\t\"mtext\",\n\t\t\"noembed\",\n\t\t\"noframes\",\n\t\t\"noscript\",\n\t\t\"plaintext\",\n\t\t\"script\",\n\t\t\"selectedcontent\",\n\t\t\"style\",\n\t\t\"svg\",\n\t\t\"template\",\n\t\t\"thead\",\n\t\t\"title\",\n\t\t\"video\",\n\t\t\"xmp\"\n\t]);\n\tlet DATA_URI_TAGS = null;\n\tconst DEFAULT_DATA_URI_TAGS = addToSet({}, [\n\t\t\"audio\",\n\t\t\"video\",\n\t\t\"img\",\n\t\t\"source\",\n\t\t\"image\",\n\t\t\"track\"\n\t]);\n\tlet URI_SAFE_ATTRIBUTES = null;\n\tconst DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n\t\t\"alt\",\n\t\t\"class\",\n\t\t\"for\",\n\t\t\"id\",\n\t\t\"label\",\n\t\t\"name\",\n\t\t\"pattern\",\n\t\t\"placeholder\",\n\t\t\"role\",\n\t\t\"summary\",\n\t\t\"title\",\n\t\t\"value\",\n\t\t\"style\",\n\t\t\"xmlns\"\n\t]);\n\tconst MATHML_NAMESPACE = \"http://www.w3.org/1998/Math/MathML\";\n\tconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\n\tconst HTML_NAMESPACE = \"http://www.w3.org/1999/xhtml\";\n\tlet NAMESPACE = HTML_NAMESPACE;\n\tlet IS_EMPTY_INPUT = false;\n\tlet ALLOWED_NAMESPACES = null;\n\tconst DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [\n\t\tMATHML_NAMESPACE,\n\t\tSVG_NAMESPACE,\n\t\tHTML_NAMESPACE\n\t], stringToString);\n\tconst DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([\n\t\t\"mi\",\n\t\t\"mo\",\n\t\t\"mn\",\n\t\t\"ms\",\n\t\t\"mtext\"\n\t]);\n\tlet MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);\n\tconst DEFAULT_HTML_INTEGRATION_POINTS = freeze([\"annotation-xml\"]);\n\tlet HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);\n\tconst COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n\t\t\"title\",\n\t\t\"style\",\n\t\t\"font\",\n\t\t\"a\",\n\t\t\"script\"\n\t]);\n\tlet PARSER_MEDIA_TYPE = null;\n\tconst SUPPORTED_PARSER_MEDIA_TYPES = [\"application/xhtml+xml\", \"text/html\"];\n\tconst DEFAULT_PARSER_MEDIA_TYPE = \"text/html\";\n\tlet transformCaseFunc = null;\n\tlet CONFIG = null;\n\tconst formElement = document.createElement(\"form\");\n\tconst isRegexOrFunction = function isRegexOrFunction(testValue) {\n\t\treturn testValue instanceof RegExp || testValue instanceof Function;\n\t};\n\t/**\n\t* _parseConfig\n\t*\n\t* @param cfg optional config literal\n\t*/\n\tconst _parseConfig = function _parseConfig() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tif (CONFIG && CONFIG === cfg) return;\n\t\tif (!cfg || typeof cfg !== \"object\") cfg = {};\n\t\tcfg = clone(cfg);\n\t\tPARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\t\ttransformCaseFunc = PARSER_MEDIA_TYPE === \"application/xhtml+xml\" ? stringToString : stringToLowerCase;\n\t\tALLOWED_TAGS = _resolveSetOption(cfg, \"ALLOWED_TAGS\", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });\n\t\tALLOWED_ATTR = _resolveSetOption(cfg, \"ALLOWED_ATTR\", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });\n\t\tALLOWED_NAMESPACES = _resolveSetOption(cfg, \"ALLOWED_NAMESPACES\", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });\n\t\tURI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, \"ADD_URI_SAFE_ATTR\", DEFAULT_URI_SAFE_ATTRIBUTES, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_URI_SAFE_ATTRIBUTES\n\t\t});\n\t\tDATA_URI_TAGS = _resolveSetOption(cfg, \"ADD_DATA_URI_TAGS\", DEFAULT_DATA_URI_TAGS, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_DATA_URI_TAGS\n\t\t});\n\t\tFORBID_CONTENTS = _resolveSetOption(cfg, \"FORBID_CONTENTS\", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });\n\t\tFORBID_TAGS = _resolveSetOption(cfg, \"FORBID_TAGS\", clone({}), { transform: transformCaseFunc });\n\t\tFORBID_ATTR = _resolveSetOption(cfg, \"FORBID_ATTR\", clone({}), { transform: transformCaseFunc });\n\t\tUSE_PROFILES = objectHasOwnProperty(cfg, \"USE_PROFILES\") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === \"object\" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;\n\t\tALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;\n\t\tALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;\n\t\tALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;\n\t\tALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;\n\t\tSAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;\n\t\tSAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;\n\t\tWHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;\n\t\tRETURN_DOM = cfg.RETURN_DOM || false;\n\t\tRETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;\n\t\tRETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;\n\t\tFORCE_BODY = cfg.FORCE_BODY || false;\n\t\tSANITIZE_DOM = cfg.SANITIZE_DOM !== false;\n\t\tSANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;\n\t\tKEEP_CONTENT = cfg.KEEP_CONTENT !== false;\n\t\tIN_PLACE = cfg.IN_PLACE || false;\n\t\tIS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;\n\t\tNAMESPACE = typeof cfg.NAMESPACE === \"string\" ? cfg.NAMESPACE : HTML_NAMESPACE;\n\t\tMATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"MATHML_TEXT_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));\n\t\tHTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"HTML_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));\n\t\tconst customElementHandling = _resolveObjectOption(cfg, \"CUSTOM_ELEMENT_HANDLING\", () => create(null));\n\t\tCUSTOM_ELEMENT_HANDLING = create(null);\n\t\tif (objectHasOwnProperty(customElementHandling, \"tagNameCheck\") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"attributeNameCheck\") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"allowCustomizedBuiltInElements\") && typeof customElementHandling.allowCustomizedBuiltInElements === \"boolean\") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;\n\t\tseal(CUSTOM_ELEMENT_HANDLING);\n\t\tif (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;\n\t\tif (RETURN_DOM_FRAGMENT) RETURN_DOM = true;\n\t\tif (USE_PROFILES) {\n\t\t\tALLOWED_TAGS = addToSet({}, text);\n\t\t\tALLOWED_ATTR = create(null);\n\t\t\tif (USE_PROFILES.html === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, html$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, html);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svg === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svg$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svgFilters === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svgFilters);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.mathMl === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, mathMl$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, mathMl);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t}\n\t\tEXTRA_ELEMENT_HANDLING.tagCheck = null;\n\t\tEXTRA_ELEMENT_HANDLING.attributeCheck = null;\n\t\tif (objectHasOwnProperty(cfg, \"ADD_TAGS\")) {\n\t\t\tif (typeof cfg.ADD_TAGS === \"function\") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n\t\t\telse if (arrayIsArray(cfg.ADD_TAGS)) {\n\t\t\t\tif (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\t\t\taddToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_ATTR\")) {\n\t\t\tif (typeof cfg.ADD_ATTR === \"function\") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n\t\t\telse if (arrayIsArray(cfg.ADD_ATTR)) {\n\t\t\t\tif (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\t\t\taddToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_FORBID_CONTENTS\") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {\n\t\t\tif (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);\n\t\t\taddToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n\t\t}\n\t\tif (KEEP_CONTENT) ALLOWED_TAGS[\"#text\"] = true;\n\t\tif (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [\n\t\t\t\"html\",\n\t\t\t\"head\",\n\t\t\t\"body\"\n\t\t]);\n\t\tif (ALLOWED_TAGS.table) {\n\t\t\taddToSet(ALLOWED_TAGS, [\"tbody\"]);\n\t\t\tdelete FORBID_TAGS.tbody;\n\t\t}\n\t\tif (cfg.TRUSTED_TYPES_POLICY) {\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createHTML\\\" hook.\");\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createScriptURL\\\" hook.\");\n\t\t\tconst previousTrustedTypesPolicy = trustedTypesPolicy;\n\t\t\ttrustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\t\t\ttry {\n\t\t\t\temptyHTML = _createTrustedHTML(\"\");\n\t\t\t} catch (error) {\n\t\t\t\ttrustedTypesPolicy = previousTrustedTypesPolicy;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} else if (cfg.TRUSTED_TYPES_POLICY === null) {\n\t\t\ttrustedTypesPolicy = void 0;\n\t\t\temptyHTML = \"\";\n\t\t} else {\n\t\t\tif (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();\n\t\t\tif (trustedTypesPolicy && typeof emptyHTML === \"string\") emptyHTML = _createTrustedHTML(\"\");\n\t\t}\n\t\tif (freeze) freeze(cfg);\n\t\tCONFIG = cfg;\n\t};\n\tconst ALL_SVG_TAGS = addToSet({}, [\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...svgDisallowed\n\t]);\n\tconst ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\t/**\n\t* Namespace rules for an element in the SVG namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"svg\";\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE) return tagName === \"svg\" && (parentTagName === \"annotation-xml\" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n\t\treturn Boolean(ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the MathML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"math\";\n\t\tif (parent.namespaceURI === SVG_NAMESPACE) return tagName === \"math\" && HTML_INTEGRATION_POINTS[parentTagName];\n\t\treturn Boolean(ALL_MATHML_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the HTML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;\n\t\treturn !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* @param element a DOM element whose namespace is being checked\n\t* @returns Return false if the element has a\n\t* namespace that a spec-compliant parser would never\n\t* return. Return true otherwise.\n\t*/\n\tconst _checkValidNamespace = function _checkValidNamespace(element) {\n\t\tconst elementNamespace = _readNamespaceURI(element);\n\t\tconst tagName = stringToLowerCase(_readNodeName(element));\n\t\tconst parentNode = getParentNode(element);\n\t\tlet parent;\n\t\tlet parentTagName;\n\t\tif (parentNode && _readNodeType(parentNode) === NODE_TYPE.element) {\n\t\t\tparent = { namespaceURI: _readNamespaceURI(parentNode) };\n\t\t\tparentTagName = stringToLowerCase(_readNodeName(parentNode));\n\t\t} else {\n\t\t\tparent = { namespaceURI: NAMESPACE };\n\t\t\tparentTagName = \"template\";\n\t\t}\n\t\tif (!ALLOWED_NAMESPACES[elementNamespace]) return false;\n\t\tif (elementNamespace === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);\n\t\tif (elementNamespace === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);\n\t\tif (elementNamespace === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && ALLOWED_NAMESPACES[elementNamespace]) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* _forceRemove\n\t*\n\t* @param node a DOM node\n\t*/\n\tconst _forceRemove = function _forceRemove(node) {\n\t\tarrayPush(DOMPurify.removed, { element: node });\n\t\ttry {\n\t\t\tgetParentNode(node).removeChild(node);\n\t\t} catch (_) {\n\t\t\tremove(node);\n\t\t\tif (!getParentNode(node)) throw typeErrorCreate(\"a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place\");\n\t\t}\n\t};\n\t/**\n\t* _stripAttributeNode\n\t*\n\t* Remove a single Attr node case/namespace-exactly on an attribute-teardown\n\t* path. Name-based removeAttribute() ASCII-lowercases its lookup key for an\n\t* HTML element in an HTML document and so silently misses a case-preserved\n\t* handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect\n\t* _removeAttribute() was fixed for, which a name-based call would reintroduce\n\t* on these IN_PLACE teardown paths. Unlike _removeAttribute this does not\n\t* record into DOMPurify.removed: the neutralize passes intentionally do not\n\t* book-keep. A clobbered/detached node falls back to best-effort name-based\n\t* removal.\n\t*\n\t* @param element the element to strip the attribute from\n\t* @param attribute the Attr node to remove\n\t* @param name the attribute's name, for the fallback path\n\t*/\n\tconst _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {\n\t\ttry {\n\t\t\tremoveAttributeNode(element, attribute);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* Fail-closed teardown of an in-place root: strip every disallowed attribute\n\t* in the subtree first, so nothing armed is left behind, then remove all\n\t* children and the root's own attributes.\n\t*\n\t* @param root the in-place root to empty\n\t*/\n\tconst _neutralizeRoot = function _neutralizeRoot(root) {\n\t\t_neutralizeSubtree(root);\n\t\tconst childNodes = getChildNodes(root);\n\t\tif (childNodes) arrayForEach(arraySlice(childNodes), (child) => {\n\t\t\ttry {\n\t\t\t\tremove(child);\n\t\t\t} catch (_) {}\n\t\t});\n\t\tconst attributes = _readNodeType(root) === NODE_TYPE.element ? getAttributes(root) : null;\n\t\tif (attributes) for (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name === \"string\") _stripAttributeNode(root, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* Removes an attribute, preferably as its exact Attr node: name-based\n\t* removal lowercases the name in HTML documents and misses case-preserved\n\t* names, e.g. from imported XHTML.\n\t*\n\t* @param name an Attribute name\n\t* @param element a DOM node\n\t* @param attr the exact Attr node to remove, when the caller has it\n\t*/\n\tconst _removeAttribute = function _removeAttribute(name, element, attr) {\n\t\tif (!attr) try {\n\t\t\tattr = element.getAttributeNode(name);\n\t\t} catch (_) {\n\t\t\tattr = null;\n\t\t}\n\t\tarrayPush(DOMPurify.removed, {\n\t\t\tattribute: attr || null,\n\t\t\tfrom: element\n\t\t});\n\t\ttry {\n\t\t\tif (attr) removeAttributeNode(element, attr);\n\t\t\telse element.removeAttribute(name);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t\tif (name === \"is\") {\n\t\t\tif (RETURN_DOM || RETURN_DOM_FRAGMENT) try {\n\t\t\t\t_forceRemove(element);\n\t\t\t} catch (_) {}\n\t\t\telse try {\n\t\t\t\telement.setAttribute(name, \"\");\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* Removes every attribute the configuration does not allow. Used to\n\t* neutralize nodes discarded from an in-place tree.\n\t*\n\t* @param element the element to strip\n\t*/\n\tconst _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {\n\t\tconst attributes = getAttributes(element);\n\t\tif (!attributes) return;\n\t\tfor (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name !== \"string\" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;\n\t\t\t_stripAttributeNode(element, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* Iterative depth-first walk, so deep trees cannot overflow the call stack,\n\t* reading through the cached getters, so clobbering cannot hide children.\n\t* When `visit` returns false, the node's children are skipped. With\n\t* `intoShadow`, open shadow roots are walked after their host's children.\n\t*\n\t* @param root where to start\n\t* @param visit called for every node\n\t* @param intoShadow whether to enter open shadow roots\n\t*/\n\tconst _walkTree = function _walkTree(root, visit) {\n\t\tlet intoShadow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\t\tconst stack = [root];\n\t\twhile (stack.length > 0) {\n\t\t\tconst node = stack.pop();\n\t\t\tif (visit(node) === false) continue;\n\t\t\tif (intoShadow && _readNodeType(node) === NODE_TYPE.element) {\n\t\t\t\tconst shadowRoot = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(shadowRoot)) stack.push(shadowRoot);\n\t\t\t}\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);\n\t\t}\n\t};\n\t/**\n\t* Strips disallowed attributes from every element of a discarded subtree,\n\t* so a handler that is already queued (a loading image) cannot fire.\n\t*\n\t* @param root the root of a removed subtree\n\t*/\n\tconst _neutralizeSubtree = function _neutralizeSubtree(root) {\n\t\t_walkTree(root, (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);\n\t\t});\n\t};\n\t/**\n\t* All nodes under `root`, root first, including open shadow roots. Template\n\t* content is not entered, it is inert.\n\t*\n\t* @param root the in-place root\n\t* @return the nodes\n\t*/\n\tconst _collectLiveNodes = function _collectLiveNodes(root) {\n\t\tconst nodes = [];\n\t\t_walkTree(root, (node) => {\n\t\t\tnodes.push(node);\n\t\t}, true);\n\t\treturn nodes;\n\t};\n\t/**\n\t* Strips disallowed attributes from every element that was under the\n\t* in-place root when the call started and no longer is, whatever removed\n\t* or moved it.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t*/\n\tconst _neutralizeEscapedElements = function _neutralizeEscapedElements(root, before) {\n\t\tconst reachable = setCreate();\n\t\tarrayForEach(_collectLiveNodes(root), (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) setAdd(reachable, node);\n\t\t});\n\t\tarrayForEach(before, (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element && !setHas(reachable, node)) _stripDisallowedAttributes(node);\n\t\t});\n\t};\n\t/**\n\t* Neutralizes everything that left the in-place tree during the call: what\n\t* DOMPurify removed, and what hooks or custom elements removed or moved out.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t* @return true if the root itself was removed\n\t*/\n\tconst _neutralizeDiscarded = function _neutralizeDiscarded(root, before) {\n\t\tlet rootRemoved = false;\n\t\tarrayForEach(DOMPurify.removed, (entry) => {\n\t\t\tif (entry.element) {\n\t\t\t\trootRemoved = rootRemoved || entry.element === root;\n\t\t\t\t_neutralizeSubtree(entry.element);\n\t\t\t}\n\t\t});\n\t\t_neutralizeEscapedElements(root, before);\n\t\treturn rootRemoved;\n\t};\n\tconst MAX_UNVISITED_ROUNDS = 8;\n\t/**\n\t* The walk only moves forward, so a node moved to a position it already\n\t* passed is never visited. Give every original node that is still in the\n\t* tree but unvisited the normal treatment, hooks included. Nodes created\n\t* during the call are left alone. Fails closed if the tree keeps changing.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t*/\n\tconst _sanitizeUnvisitedNodes = function _sanitizeUnvisitedNodes(root, before) {\n\t\tconst visited = IN_PLACE_VISITED;\n\t\tlet original = null;\n\t\tconst getOriginal = () => {\n\t\t\tif (!original) {\n\t\t\t\toriginal = setCreate();\n\t\t\t\tarrayForEach(before, (beforeNode) => {\n\t\t\t\t\tsetAdd(original, beforeNode);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn original;\n\t\t};\n\t\tfor (let round = 0;; round++) {\n\t\t\tconst live = _collectLiveNodes(root);\n\t\t\tconst containers = [root];\n\t\t\tlet pending = false;\n\t\t\tarrayForEach(live, (node) => {\n\t\t\t\tif (_readNodeType(node) === NODE_TYPE.documentFragment) arrayPush(containers, node);\n\t\t\t\telse if (!pending && !setHas(visited, node)) pending = setHas(getOriginal(), node);\n\t\t\t});\n\t\t\tif (!pending) return;\n\t\t\tif (round >= MAX_UNVISITED_ROUNDS) throw typeErrorCreate(\"the tree kept changing during in-place sanitization; refusing to return it\");\n\t\t\tarrayForEach(containers, (container, index) => {\n\t\t\t\t_sanitizeUnvisitedIn(container, index > 0, root, getOriginal());\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* One _sanitizeUnvisitedNodes pass over the root or an open shadow root.\n\t*\n\t* @param container the root or an open shadow root\n\t* @param inShadow whether container is a shadow root\n\t* @param root the in-place root\n\t* @param original the root's nodes collected before the walk, as a set\n\t*/\n\tconst _sanitizeUnvisitedIn = function _sanitizeUnvisitedIn(container, inShadow, root, original) {\n\t\tconst iterator = _createNodeIterator(container);\n\t\tlet node;\n\t\twhile (node = iterator.nextNode()) {\n\t\t\tif (!setHas(original, node) || setHas(IN_PLACE_VISITED, node)) continue;\n\t\t\tif (inShadow) _executeHooks(hooks.uponSanitizeShadowNode, node, null);\n\t\t\t_sanitizeElements(node, root);\n\t\t\t_sanitizeAttributes(node, root);\n\t\t\tif (_isDocumentFragment(node.content)) _sanitizeShadowDOM2(node.content);\n\t\t}\n\t};\n\t/**\n\t* Records that _sanitizeElements processed `node`. No-op outside IN_PLACE.\n\t*\n\t* @param node the node being processed\n\t*/\n\tconst _markVisited = function _markVisited(node) {\n\t\tif (IN_PLACE_VISITED) setAdd(IN_PLACE_VISITED, node);\n\t};\n\t/**\n\t* Patch-linkage attributes (declarative partial updates): `patchsrc`\n\t* always, `for` everywhere except on <label> and <output>. Gated on\n\t* SAFE_FOR_XML. Shared by the IN_PLACE pre-pass and _isValidAttribute.\n\t*\n\t* @param lcName the transformCaseFunc'd attribute name\n\t* @param lcTag the transformCaseFunc'd tag name of the carrying element\n\t* @return true if the attribute is patch linkage and must be dropped\n\t*/\n\tconst _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {\n\t\tif (!SAFE_FOR_XML) return false;\n\t\tif (lcName === \"patchsrc\") return true;\n\t\treturn lcName === \"for\" && lcTag !== \"label\" && lcTag !== \"output\";\n\t};\n\t/**\n\t* IN_PLACE pre-pass: sever all patch linkage before the walk, so no patch\n\t* can fire mid-walk into a part of the tree the walker already passed.\n\t* Removes range markers (processing instructions, comments with markup)\n\t* and strips linkage attributes. It cannot undo a patch that already fired.\n\t*\n\t* TODO: if the shipped feature can patch through `for` on <label>/<output>,\n\t* drop that pair here too (see test/declarative-patch-probe.html).\n\t*\n\t* @param root the in-place root to sweep\n\t*/\n\tconst _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {\n\t\tif (!SAFE_FOR_XML) return;\n\t\t_walkTree(root, (node) => {\n\t\t\tconst nodeType = _readNodeType(node);\n\t\t\tif (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {\n\t\t\t\ttry {\n\t\t\t\t\tremove(node);\n\t\t\t\t} catch (_) {}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (nodeType === NODE_TYPE.element) {\n\t\t\t\tconst element = node;\n\t\t\t\tconst lcTag = transformCaseFunc(_readNodeName(node));\n\t\t\t\ttry {\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"patchsrc\")) element.removeAttribute(\"patchsrc\");\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"for\") && _isPatchLinkageAttribute(\"for\", lcTag)) element.removeAttribute(\"for\");\n\t\t\t\t} catch (_) {}\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* _initDocument\n\t*\n\t* @param dirty - a string of dirty markup\n\t* @return a DOM, filled with the dirty markup\n\t*/\n\tconst _initDocument = function _initDocument(dirty) {\n\t\tlet doc = null;\n\t\tlet leadingWhitespace = null;\n\t\tif (FORCE_BODY) dirty = \"<remove></remove>\" + dirty;\n\t\telse {\n\t\t\tconst matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n\t\t\tleadingWhitespace = matches && matches[0];\n\t\t}\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && NAMESPACE === HTML_NAMESPACE) dirty = \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\"><head></head><body>\" + dirty + \"</body></html>\";\n\t\tconst dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;\n\t\tif (NAMESPACE === HTML_NAMESPACE) try {\n\t\t\tdoc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n\t\t} catch (_) {}\n\t\tif (!doc || !doc.documentElement) {\n\t\t\tdoc = implementation.createDocument(NAMESPACE, \"template\", null);\n\t\t\ttry {\n\t\t\t\tdoc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n\t\t\t} catch (_) {}\n\t\t}\n\t\tconst body = doc.body || doc.documentElement;\n\t\tif (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n\t\tif (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? \"html\" : \"body\")[0];\n\t\treturn WHOLE_DOCUMENT ? doc.documentElement : body;\n\t};\n\t/**\n\t* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n\t*\n\t* @param root The root element or node to start traversing on.\n\t* @return The created NodeIterator\n\t*/\n\tconst _createNodeIterator = function _createNodeIterator(root) {\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;\n\t\treturn createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n\t};\n\t/**\n\t* Replace template expression syntax (mustache, ERB, template\n\t* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub\n\t* sites. Order matters: mustache, then ERB, then template literal.\n\t*\n\t* @param value the string to scrub\n\t* @returns the scrubbed string\n\t*/\n\tconst _stripTemplateExpressions = function _stripTemplateExpressions(value) {\n\t\tvalue = stringReplace(value, MUSTACHE_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, ERB_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, TMPLIT_EXPR$1, \" \");\n\t\treturn value;\n\t};\n\t/**\n\t* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the\n\t* character data of an element subtree. Used as the final safety net for\n\t* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions\n\t* which only form after text-node normalization (e.g. fragments split across\n\t* stripped elements) cannot survive into a template-evaluating framework.\n\t*\n\t* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`\n\t* in place rather than round-tripping through innerHTML. This preserves\n\t* descendant node references (important for IN_PLACE callers), avoids a\n\t* serialize/reparse cycle, and reads literal character data — which means\n\t* `<%...%>` in text content matches the ERB regex against its real bytes\n\t* instead of the HTML-entity-escaped form innerHTML would produce.\n\t*\n\t* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for\n\t* attributes is performed during the per-node `_sanitizeAttributes` pass.\n\t*\n\t* @param node The root element whose character data should be scrubbed.\n\t*/\n\tconst _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {\n\t\tvar _node$querySelectorAl;\n\t\t_scrubOwnCharacterData(node);\n\t\tconst templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, \"template\");\n\t\tif (templates) arrayForEach(templates, (tmpl) => {\n\t\t\tif (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);\n\t\t});\n\t};\n\t/**\n\t* _scrubOwnCharacterData\n\t*\n\t* Non-recursive core of _scrubTemplateExpressions: normalize `node` and\n\t* strip template expressions from its own character data only. Does not\n\t* enter <template>.content or attached shadow roots (NodeIterator never\n\t* does). Used by _sanitizeShadowDOM, where every nested template content\n\t* and shadow root is already walked - and therefore scrubbed - by its own\n\t* recursive _sanitizeShadowDOM call; recursing here as well would rescrub\n\t* each nested fragment once per ancestor, which is quadratic in nesting\n\t* depth.\n\t*\n\t* @param node The root whose own character data should be scrubbed.\n\t*/\n\tconst _scrubOwnCharacterData = function _scrubOwnCharacterData(node) {\n\t\tnode.normalize();\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;\n\t\tconst walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);\n\t\tlet currentNode = walker.nextNode();\n\t\twhile (currentNode) {\n\t\t\tcurrentNode.data = _stripTemplateExpressions(currentNode.data);\n\t\t\tcurrentNode = walker.nextNode();\n\t\t}\n\t};\n\t/**\n\t* _isClobbered\n\t*\n\t* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML\n\t* interface with [LegacyOverrideBuiltIns]; a descendant element with a\n\t* `name` attribute matching a prototype property shadows that property\n\t* on direct reads. We use this check at the IN_PLACE entry-point and\n\t* during attribute sanitization to refuse clobbered forms.\n\t*\n\t* @param element element to check for clobbering attacks\n\t* @return true if clobbered, false if safe\n\t*/\n\tconst _isClobbered = function _isClobbered(element) {\n\t\tconst realTagName = getNodeName ? getNodeName(element) : null;\n\t\tif (typeof realTagName !== \"string\") return false;\n\t\tif (transformCaseFunc(realTagName) !== \"form\") return false;\n\t\treturn typeof element.nodeName !== \"string\" || typeof element.textContent !== \"string\" || typeof element.removeChild !== \"function\" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== \"function\" || typeof element.removeAttributeNode !== \"function\" || typeof element.getAttributeNode !== \"function\" || typeof element.setAttribute !== \"function\" || typeof element.namespaceURI !== \"string\" || typeof element.insertBefore !== \"function\" || typeof element.hasChildNodes !== \"function\" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);\n\t};\n\t/**\n\t* Checks whether the given value is a DocumentFragment from any realm.\n\t*\n\t* The realm-independent replacement reads `nodeType` through the cached\n\t* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE\n\t* constant (11). nodeType is a numeric value resolved from the node's\n\t* internal slot, identical across realms for the same kind of node.\n\t*\n\t* @param value object to check\n\t* @return true if value is a DocumentFragment-shaped node from any realm\n\t*/\n\tconst _isDocumentFragment = function _isDocumentFragment(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn getNodeType(value) === NODE_TYPE.documentFragment;\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* Checks whether the given object is a DOM node, including nodes that\n\t* originate from a different window/realm (e.g. an iframe's\n\t* contentDocument). The previous `value instanceof Node` check was\n\t* realm-bound: nodes from a different window failed it, causing\n\t* sanitize() to silently stringify them and reset IN_PLACE to false,\n\t* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.\n\t*\n\t* @param value object to check whether it's a DOM node\n\t* @return true if value is a DOM node from any realm\n\t*/\n\tconst _isNode = function _isNode(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn typeof getNodeType(value) === \"number\";\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\tfunction _executeHooks(hooks, currentNode, data) {\n\t\tif (hooks.length === 0) return;\n\t\tarrayForEach(hooks, (hook) => {\n\t\t\thook.call(DOMPurify, currentNode, data, CONFIG);\n\t\t});\n\t}\n\t/**\n\t* Structural-threat checks that condemn a node regardless of the\n\t* allowlists: mXSS via namespace confusion, risky CSS construction,\n\t* processing instructions, markup-bearing comments. Pure predicate;\n\t* the caller removes. Check order is load-bearing.\n\t*\n\t* @param currentNode the node to inspect\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node must be removed\n\t*/\n\tconst _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {\n\t\tif (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;\n\t\tif (SAFE_FOR_XML && LITERAL_TEXT_ELEMENTS[tagName] && _readNodeType(currentNode) === NODE_TYPE.element && _readNamespaceURI(currentNode) === HTML_NAMESPACE && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === \"string\" && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent))) return true;\n\t\tif (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;\n\t\tif (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate\n\t* function, per the validation in _parseConfig) against a name.\n\t* Additional arguments are forwarded to predicate functions - the\n\t* attributeNameCheck predicate receives the tag name as its second\n\t* argument. A null/absent check never matches.\n\t*\n\t* @param check the configured tagNameCheck / attributeNameCheck value\n\t* @param name the name to test\n\t* @param args extra arguments forwarded to a predicate function\n\t* @return true if the check matches the name\n\t*/\n\tconst _matchesNameCheck = function _matchesNameCheck(check, name) {\n\t\tif (check instanceof RegExp) return regExpTest(check, name);\n\t\tif (check instanceof Function) {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\t\t\treturn Boolean(check(name, ...args));\n\t\t}\n\t\treturn false;\n\t};\n\t/**\n\t* Handle a node whose tag is forbidden or not allowlisted: keep\n\t* allowed custom elements (false return exits _sanitizeElements\n\t* early - the namespace and fallback-tag removal checks are\n\t* intentionally skipped for kept custom elements), else hoist\n\t* content per KEEP_CONTENT and remove.\n\t*\n\t* A kept custom element is the ONLY case in which this function\n\t* returns false, so the caller uses that return value to run the\n\t* afterSanitizeElements hook on the kept element and keep the\n\t* element-hook lifecycle consistent with normal allowlisted\n\t* elements (GHSA-c2j3-45gr-mqc4).\n\t*\n\t* @param currentNode the disallowed node\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node was removed, false if kept\n\t*/\n\tconst _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {\n\t\tif (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;\n\t\tif (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && !FORBID_CONTENTS[stringToLowerCase(tagName)]) {\n\t\t\tconst parentNode = getParentNode(currentNode);\n\t\t\tconst childNodes = getChildNodes(currentNode);\n\t\t\tif (childNodes && parentNode) {\n\t\t\t\tconst childCount = childNodes.length;\n\t\t\t\tfor (let i = childCount - 1; i >= 0; --i) {\n\t\t\t\t\tconst hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];\n\t\t\t\t\tparentNode.insertBefore(hoisted, getNextSibling(currentNode));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_forceRemove(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* Fork a hook-mutable allowlist off its shared binding the first time a\n\t* (possibly lazily-installed) uponSanitize* hook is about to see it, so the\n\t* hook cannot widen the per-instance default or the setConfig binding by\n\t* reference and leak past the call. Returns the set unchanged once it is\n\t* already call-local, so repeated calls across elements are idempotent.\n\t*\n\t* @param hookList the uponSanitize* hook array for this event\n\t* @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding\n\t* @param defaultSet the per-instance DEFAULT_ALLOWED_* constant\n\t* @param setConfigSet the captured setConfig() binding, or null\n\t* @return a call-local clone if a hook is present and set is still shared,\n\t* else set unchanged\n\t*/\n\tconst _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {\n\t\tif (hookList.length === 0) return set;\n\t\treturn set === defaultSet || set === setConfigSet ? clone(set) : set;\n\t};\n\t/**\n\t* A hook may have detached the node it was called for. If so, treat it as\n\t* removed and stop processing it; the walk root is exempt. On the IN_PLACE\n\t* path the detached subtree is neutralized right away.\n\t*\n\t* @param currentNode the node a hook may have detached\n\t* @param root the current walk root\n\t* @return true if the node was detached\n\t*/\n\tconst _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {\n\t\tif (currentNode === root || getParentNode(currentNode) !== null) return false;\n\t\tif (IN_PLACE) _neutralizeSubtree(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* _sanitizeElements\n\t*\n\t* @protect nodeName\n\t* @protect textContent\n\t* @protect removeChild\n\t* @param currentNode to check for permission to exist\n\t* @return true if node was killed, false if left alive\n\t*/\n\tconst _sanitizeElements = function _sanitizeElements(currentNode, root) {\n\t\t_markVisited(currentNode);\n\t\t_executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isClobbered(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tconst tagName = transformCaseFunc(_readNodeName(currentNode));\n\t\tALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);\n\t\t_executeHooks(hooks.uponSanitizeElement, currentNode, {\n\t\t\ttagName,\n\t\t\tallowedTags: ALLOWED_TAGS\n\t\t});\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isUnsafeNode(currentNode, tagName)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {\n\t\t\tconst removed = _sanitizeDisallowedNode(currentNode, tagName, root);\n\t\t\tif (removed === false) {\n\t\t\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\t\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\t\t}\n\t\t\treturn removed;\n\t\t}\n\t\tif (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif ((tagName === \"noscript\" || tagName === \"noembed\" || tagName === \"noframes\") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n\t\t\tconst content = _stripTemplateExpressions(currentNode.textContent);\n\t\t\tif (currentNode.textContent !== content) {\n\t\t\t\tarrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n\t\t\t\tcurrentNode.textContent = content;\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\treturn _handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _isValidAttribute\n\t*\n\t* @param lcTag Lowercase tag name of containing element.\n\t* @param lcName Lowercase attribute name.\n\t* @param value Attribute value.\n\t* @return Returns true if `value` is valid, otherwise false.\n\t*/\n\tconst _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n\t\tif (FORBID_ATTR[lcName]) return false;\n\t\tif (_isPatchLinkageAttribute(lcName, lcTag)) return false;\n\t\tif (SANITIZE_DOM && (lcName === \"id\" || lcName === \"name\") && (value in document || value in formElement)) return false;\n\t\tconst nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);\n\t\tif (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;\n\t\tif (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;\n\t\tif (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === \"is\" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value);\n\t\tif (URI_SAFE_ATTRIBUTES[lcName]) return true;\n\t\tif (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\tif ((lcName === \"src\" || lcName === \"xlink:href\" || lcName === \"href\") && lcTag !== \"script\" && stringIndexOf(value, \"data:\") === 0 && DATA_URI_TAGS[lcTag]) return true;\n\t\tif (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\treturn !value;\n\t};\n\tconst RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"color-profile\",\n\t\t\"font-face\",\n\t\t\"font-face-format\",\n\t\t\"font-face-name\",\n\t\t\"font-face-src\",\n\t\t\"font-face-uri\",\n\t\t\"missing-glyph\"\n\t]);\n\t/**\n\t* _isBasicCustomElement\n\t* checks if at least one dash is included in tagName, and it's not the first char\n\t* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n\t*\n\t* @param tagName name of the tag of the node to sanitize\n\t* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n\t*/\n\tconst _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n\t\treturn !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);\n\t};\n\t/**\n\t* Wrap an attribute value in the matching Trusted Types object when\n\t* the active policy requires it. Namespaced attributes pass through\n\t* unchanged (no TT support yet, see\n\t* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).\n\t*\n\t* @param lcTag lowercase tag name of the containing element\n\t* @param lcName lowercase attribute name\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the attribute value to wrap\n\t* @return the value, wrapped when Trusted Types demand it\n\t*/\n\tconst _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {\n\t\tif (trustedTypesPolicy && typeof trustedTypes === \"object\" && typeof trustedTypes.getAttributeType === \"function\" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n\t\t\tcase \"TrustedHTML\": return _createTrustedHTML(value);\n\t\t\tcase \"TrustedScriptURL\": return _createTrustedScriptURL(value);\n\t\t}\n\t\treturn value;\n\t};\n\t/**\n\t* Write a modified attribute value back onto the element. On\n\t* success, re-probe for clobbering introduced by the new value and\n\t* remove the element when found; otherwise, when this writeback is the\n\t* recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the\n\t* removal entry that path recorded so it does not show as removed. On\n\t* failure, remove the attribute instead.\n\t*\n\t* Returns true only on a clean write (the value was set and the new value\n\t* introduced no clobbering). The caller uses that, together with its own\n\t* knowledge of whether this attribute pushed a DOMPurify.removed record, to\n\t* decide whether to pop that record. The pop must happen ONLY for the\n\t* named-prop remove-and-recreate; popping on any other value change (trim,\n\t* template scrubbing, Trusted Types) would consume an unrelated _forceRemove\n\t* subtree-cleanup record and let that detached subtree keep a live event\n\t* handler through the IN_PLACE neutralization pass (SO-001).\n\t*\n\t* @param currentNode the element carrying the attribute\n\t* @param name the attribute name as present on the element\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the new attribute value\n\t* @return true if the value was written without introducing clobbering\n\t*/\n\tconst _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {\n\t\ttry {\n\t\t\tif (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);\n\t\t\telse currentNode.setAttribute(name, value);\n\t\t\tif (_isClobbered(currentNode)) {\n\t\t\t\t_forceRemove(currentNode);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (_) {\n\t\t\t_removeAttribute(name, currentNode);\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* _isUnsafeAttributeValue\n\t*\n\t* Value-based attribute checks that the attribute walk applies before any\n\t* hook can force-keep an attribute, shared with the public\n\t* isValidAttribute() so that it never approves a value sanitize() would\n\t* strip.\n\t*\n\t* @param name the attribute name as found on the node (case preserved)\n\t* @param value the attribute value\n\t* @returns true if the attribute must be removed because of its value\n\t*/\n\tconst _isUnsafeAttributeValue = function _isUnsafeAttributeValue(name, value) {\n\t\tif (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) return true;\n\t\treturn stringToLowerCase(name) === \"attributename\" && stringMatch(value, \"href\") !== null;\n\t};\n\t/**\n\t* _sanitizeAttributes\n\t*\n\t* @protect attributes\n\t* @protect nodeName\n\t* @protect removeAttribute\n\t* @protect setAttribute\n\t*\n\t* @param currentNode to sanitize\n\t* @param root the current walk root\n\t*/\n\tconst _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {\n\t\t_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return;\n\t\tconst attributes = currentNode.attributes;\n\t\tif (!attributes || _isClobbered(currentNode)) return;\n\t\tALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);\n\t\tconst hookEvent = {\n\t\t\tattrName: \"\",\n\t\t\tattrValue: \"\",\n\t\t\tkeepAttr: true,\n\t\t\tallowedAttributes: ALLOWED_ATTR,\n\t\t\tforceKeepAttr: void 0\n\t\t};\n\t\tlet l = attributes.length;\n\t\tconst lcTag = transformCaseFunc(currentNode.nodeName);\n\t\twhile (l--) {\n\t\t\tconst attr = attributes[l];\n\t\t\tconst name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;\n\t\t\tconst lcName = transformCaseFunc(name);\n\t\t\tconst initValue = attrValue;\n\t\t\tlet value = name === \"value\" ? initValue : stringTrim(initValue);\n\t\t\tlet recreatedNamedProp = false;\n\t\t\thookEvent.attrName = lcName;\n\t\t\thookEvent.attrValue = value;\n\t\t\thookEvent.keepAttr = true;\n\t\t\thookEvent.forceKeepAttr = void 0;\n\t\t\t_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n\t\t\tvalue = hookEvent.attrValue;\n\t\t\tif (SANITIZE_NAMED_PROPS && (lcName === \"id\" || lcName === \"name\") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tvalue = SANITIZE_NAMED_PROPS_PREFIX + value;\n\t\t\t\trecreatedNamedProp = true;\n\t\t\t}\n\t\t\tif (_isUnsafeAttributeValue(name, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hookEvent.forceKeepAttr) continue;\n\t\t\tif (!hookEvent.keepAttr) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);\n\t\t\tif (!_isValidAttribute(lcTag, lcName, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvalue = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);\n\t\t\tif (value !== initValue) {\n\t\t\t\tif (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n\t\t_handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _sanitizeShadowDOM\n\t*\n\t* @param fragment to iterate over recursively\n\t*/\n\tconst _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {\n\t\tlet shadowNode = null;\n\t\tconst shadowIterator = _createNodeIterator(fragment);\n\t\t_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n\t\twhile (shadowNode = shadowIterator.nextNode()) {\n\t\t\t_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n\t\t\t_sanitizeElements(shadowNode, fragment);\n\t\t\t_sanitizeAttributes(shadowNode, fragment);\n\t\t\tif (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);\n\t\t\tif (_readNodeType(shadowNode) === NODE_TYPE.element) {\n\t\t\t\tconst innerSr = getShadowRoot(shadowNode);\n\t\t\t\tif (_isDocumentFragment(innerSr)) {\n\t\t\t\t\t_sanitizeAttachedShadowRoots(innerSr);\n\t\t\t\t\t_sanitizeShadowDOM2(innerSr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES) _scrubOwnCharacterData(fragment);\n\t\t_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n\t};\n\t/**\n\t* Sanitizes every attached shadow root under `root`, since the node\n\t* iterator does not enter shadow trees. Needed for IN_PLACE input and for\n\t* DOM input whose clonable shadow roots were copied by importNode().\n\t*\n\t* @param root the subtree root to walk for attached shadow roots\n\t*/\n\tconst _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {\n\t\tconst stack = [{\n\t\t\tnode: root,\n\t\t\tshadow: null\n\t\t}];\n\t\twhile (stack.length > 0) {\n\t\t\tconst item = stack.pop();\n\t\t\tif (item.shadow) {\n\t\t\t\t_sanitizeShadowDOM2(item.shadow);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst node = item.node;\n\t\t\tconst isElement = _readNodeType(node) === NODE_TYPE.element;\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({\n\t\t\t\tnode: childNodes[i],\n\t\t\t\tshadow: null\n\t\t\t});\n\t\t\tif (isElement) {\n\t\t\t\tconst rootName = getNodeName ? getNodeName(node) : null;\n\t\t\t\tif (typeof rootName === \"string\" && transformCaseFunc(rootName) === \"template\") {\n\t\t\t\t\tconst content = node.content;\n\t\t\t\t\tif (_isDocumentFragment(content)) stack.push({\n\t\t\t\t\t\tnode: content,\n\t\t\t\t\t\tshadow: null\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isElement) {\n\t\t\t\tconst sr = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(sr)) stack.push({\n\t\t\t\t\tnode: null,\n\t\t\t\t\tshadow: sr\n\t\t\t\t}, {\n\t\t\t\t\tnode: sr,\n\t\t\t\t\tshadow: null\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tDOMPurify.sanitize = function(dirty) {\n\t\tlet cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\t\tlet body = null;\n\t\tlet importedNode = null;\n\t\tlet currentNode = null;\n\t\tlet returnNode = null;\n\t\tIS_EMPTY_INPUT = !dirty;\n\t\tif (IS_EMPTY_INPUT) dirty = \"<!-->\";\n\t\tif (typeof dirty !== \"string\" && !_isNode(dirty)) {\n\t\t\tdirty = stringifyValue(dirty);\n\t\t\tif (typeof dirty !== \"string\") throw typeErrorCreate(\"dirty is not a string, aborting\");\n\t\t}\n\t\tif (!DOMPurify.isSupported) return dirty;\n\t\tif (SET_CONFIG) {\n\t\t\tALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;\n\t\t\tALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;\n\t\t} else _parseConfig(cfg);\n\t\tif (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\tif (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\tDOMPurify.removed = [];\n\t\tconst inPlace = IN_PLACE && typeof dirty !== \"string\" && _isNode(dirty);\n\t\tlet inPlaceNodes = [];\n\t\tconst outerVisited = IN_PLACE_VISITED;\n\t\tif (inPlace) {\n\t\t\t_neutralizePatchLinkage(dirty);\n\t\t\tconst nn = _readNodeName(dirty);\n\t\t\tif (typeof nn === \"string\") {\n\t\t\t\tconst tagName = transformCaseFunc(nn);\n\t\t\t\tif (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n\t\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t\tthrow typeErrorCreate(\"root node is forbidden and cannot be sanitized in-place\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_isClobbered(dirty)) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\tthrow typeErrorCreate(\"root node is clobbered and cannot be sanitized in-place\");\n\t\t\t}\n\t\t\tinPlaceNodes = _collectLiveNodes(dirty);\n\t\t\tIN_PLACE_VISITED = setCreate();\n\t\t} else if (_isNode(dirty)) {\n\t\t\tbody = _initDocument(\"<!---->\");\n\t\t\timportedNode = body.ownerDocument.importNode(dirty, true);\n\t\t\tif (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === \"BODY\") body = importedNode;\n\t\t\telse if (importedNode.nodeName === \"HTML\") body = importedNode;\n\t\t\telse body.appendChild(importedNode);\n\t\t\t_sanitizeAttachedShadowRoots(body);\n\t\t} else {\n\t\t\tif (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf(\"<\") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;\n\t\t\tbody = _initDocument(dirty);\n\t\t\tif (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : \"\";\n\t\t}\n\t\tif (body && FORCE_BODY) _forceRemove(body.firstChild);\n\t\tconst walkRoot = inPlace ? dirty : body;\n\t\ttry {\n\t\t\tif (inPlace) _sanitizeAttachedShadowRoots(dirty);\n\t\t\tconst nodeIterator = _createNodeIterator(walkRoot);\n\t\t\twhile (currentNode = nodeIterator.nextNode()) {\n\t\t\t\t_sanitizeElements(currentNode, walkRoot);\n\t\t\t\t_sanitizeAttributes(currentNode, walkRoot);\n\t\t\t\tif (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);\n\t\t\t}\n\t\t\tif (inPlace) _sanitizeUnvisitedNodes(dirty, inPlaceNodes);\n\t\t} catch (error) {\n\t\t\tif (inPlace) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t_neutralizeDiscarded(dirty, inPlaceNodes);\n\t\t\t}\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tIN_PLACE_VISITED = outerVisited;\n\t\t}\n\t\tif (inPlace) {\n\t\t\tif (_neutralizeDiscarded(dirty, inPlaceNodes)) throw typeErrorCreate(\"a node selected for removal could not be safely returned; refusing to sanitize in place\");\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);\n\t\t\treturn dirty;\n\t\t}\n\t\tif (RETURN_DOM) {\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);\n\t\t\tif (RETURN_DOM_FRAGMENT) {\n\t\t\t\treturnNode = createDocumentFragment.call(body.ownerDocument);\n\t\t\t\twhile (body.firstChild) returnNode.appendChild(body.firstChild);\n\t\t\t} else returnNode = body;\n\t\t\tif (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);\n\t\t\treturn returnNode;\n\t\t}\n\t\tlet serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\t\tif (WHOLE_DOCUMENT && ALLOWED_TAGS[\"!doctype\"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = \"<!DOCTYPE \" + body.ownerDocument.doctype.name + \">\\n\" + serializedHTML;\n\t\tif (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);\n\t\treturn trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;\n\t};\n\tDOMPurify.setConfig = function() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\t_parseConfig(cfg);\n\t\tSET_CONFIG = true;\n\t\tSET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;\n\t\tSET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;\n\t};\n\tDOMPurify.clearConfig = function() {\n\t\tCONFIG = null;\n\t\tSET_CONFIG = false;\n\t\tSET_CONFIG_ALLOWED_TAGS = null;\n\t\tSET_CONFIG_ALLOWED_ATTR = null;\n\t\ttrustedTypesPolicy = defaultTrustedTypesPolicy;\n\t\temptyHTML = \"\";\n\t};\n\tDOMPurify.isValidAttribute = function(tag, attr, value) {\n\t\tif (!CONFIG) _parseConfig({});\n\t\tconst lcTag = transformCaseFunc(tag);\n\t\tconst lcName = transformCaseFunc(attr);\n\t\tif (typeof value === \"string\" && (_isUnsafeAttributeValue(attr, value) || !ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value))) return false;\n\t\treturn _isValidAttribute(lcTag, lcName, value);\n\t};\n\tDOMPurify.addHook = function(entryPoint, hookFunction) {\n\t\tif (typeof hookFunction !== \"function\") return;\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tarrayPush(hooks[entryPoint], hookFunction);\n\t};\n\tDOMPurify.removeHook = function(entryPoint, hookFunction) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tif (hookFunction !== void 0) {\n\t\t\tconst index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n\t\t\treturn index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];\n\t\t}\n\t\treturn arrayPop(hooks[entryPoint]);\n\t};\n\tDOMPurify.removeHooks = function(entryPoint) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\thooks[entryPoint] = [];\n\t};\n\tDOMPurify.removeAllHooks = function() {\n\t\thooks = _createHooksMap();\n\t};\n\treturn DOMPurify;\n}\nvar purify_default = createDOMPurify();\nexport { purify_default as default };\n\n//# sourceMappingURL=purify.es.mjs.map","import createDOMPurify from 'dompurify';\nconst PPTX_CONTENT_STYLE_SCOPE = '.flyfish-pptx-content';\nconst GENERATED_STYLE_RULE = /\\s*(\\._(?:css|svg_css|tbl_cell_css)_[A-Za-z0-9_-]+)\\s*\\{([^{}]*)\\}/y;\nconst purifierByDocument = new WeakMap();\nconst createSafeFallbackFragment = (documentRef) => {\n const fragment = documentRef.createDocumentFragment();\n const fallback = documentRef.createElement('section');\n fallback.className = 'slide flyfish-pptx-slide-error';\n fallback.textContent = 'This slide could not be displayed safely.';\n fragment.append(fallback);\n return fragment;\n};\nconst getPurifier = (documentRef) => {\n const cached = purifierByDocument.get(documentRef);\n if (cached) {\n return cached;\n }\n const windowRef = documentRef.defaultView;\n if (!windowRef) {\n return null;\n }\n const purifier = createDOMPurify(windowRef);\n if (!purifier.isSupported) {\n return null;\n }\n purifierByDocument.set(documentRef, purifier);\n return purifier;\n};\nconst isAllowedCssUrl = (value) => {\n const target = value\n .trim()\n .replace(/^(?:\"([\\s\\S]*)\"|'([\\s\\S]*)')$/, '$1$2')\n .trim();\n if (/^#[A-Za-z0-9_.:-]+$/.test(target)) {\n return true;\n }\n return /^data:image\\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=\\s]+$/i.test(target);\n};\nconst isSafeEmbeddedResourceUrl = (value, allowFragment) => {\n const normalized = value.trim();\n if (allowFragment && /^#[A-Za-z0-9_.:-]+$/.test(normalized)) {\n return true;\n }\n if (/^blob:/i.test(normalized)) {\n return true;\n }\n return /^data:image\\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=\\s]+$/i.test(normalized);\n};\nconst isSafeCssValue = (value) => {\n const normalized = value.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').trim();\n if (/(?:expression|image(?:-set)?|paint|var)\\s*\\(/i.test(normalized) ||\n /(?:javascript|vbscript)\\s*:/i.test(normalized) ||\n /(?:^|[^-])behavior\\s*:/i.test(normalized) ||\n /-moz-binding/i.test(normalized) ||\n normalized.includes('\\\\')) {\n return false;\n }\n let unsafeUrl = false;\n const withoutUrls = normalized.replace(/url\\(\\s*([^)]*?)\\s*\\)/gi, (_match, target) => {\n if (!isAllowedCssUrl(target)) {\n unsafeUrl = true;\n }\n return '';\n });\n return !unsafeUrl && !/url\\s*\\(/i.test(withoutUrls);\n};\nconst sanitizeStyleDeclaration = (documentRef, cssText) => {\n const probe = documentRef.createElement('span');\n probe.setAttribute('style', cssText);\n const style = probe.style;\n const propertyNames = Array.from({ length: style.length }, (_, index) => style.item(index));\n for (const propertyName of propertyNames) {\n const value = style.getPropertyValue(propertyName);\n if (!propertyName ||\n propertyName.startsWith('--') ||\n propertyName === 'behavior' ||\n propertyName === '-moz-binding' ||\n (propertyName === 'position' && /^(?:fixed|sticky)$/i.test(value.trim())) ||\n !isSafeCssValue(value)) {\n style.removeProperty(propertyName);\n }\n }\n return style.cssText;\n};\nconst sanitizeStyleAttributes = (documentRef, root) => {\n root.querySelectorAll('[style]').forEach((element) => {\n const sanitized = sanitizeStyleDeclaration(documentRef, element.getAttribute('style') || '');\n if (sanitized) {\n element.setAttribute('style', sanitized);\n }\n else {\n element.removeAttribute('style');\n }\n });\n};\nconst sanitizeEmbeddedResourceUrls = (root) => {\n root\n .querySelectorAll('[src],[srcset],[poster],[href],[xlink\\\\:href]')\n .forEach((element) => {\n for (const attributeName of ['src', 'srcset', 'poster', 'href', 'xlink:href']) {\n if (!element.hasAttribute(attributeName)) {\n continue;\n }\n const isHtmlAnchor = element.namespaceURI === 'http://www.w3.org/1999/xhtml' && element.localName === 'a';\n if (isHtmlAnchor && attributeName === 'href') {\n continue;\n }\n const allowFragment = element.namespaceURI === 'http://www.w3.org/2000/svg' &&\n (attributeName === 'href' || attributeName === 'xlink:href');\n if (!isSafeEmbeddedResourceUrl(element.getAttribute(attributeName) || '', allowFragment)) {\n element.removeAttribute(attributeName);\n }\n }\n });\n};\nconst sanitizeSvgUrlAttributes = (root) => {\n root.querySelectorAll('svg, svg *').forEach((element) => {\n for (const attribute of Array.from(element.attributes)) {\n const value = attribute.value;\n if (/url\\s*\\(/i.test(value) && !isSafeCssValue(value)) {\n element.removeAttribute(attribute.name);\n }\n }\n });\n};\nexport const sanitizePptxCss = (documentRef, cssText) => {\n const rules = [];\n let offset = 0;\n while (offset < cssText.length) {\n if (!cssText.slice(offset).trim()) {\n break;\n }\n GENERATED_STYLE_RULE.lastIndex = offset;\n const match = GENERATED_STYLE_RULE.exec(cssText);\n if (!match) {\n return '';\n }\n const declarations = sanitizeStyleDeclaration(documentRef, match[2]);\n if (declarations) {\n rules.push(`${PPTX_CONTENT_STYLE_SCOPE} ${match[1]}{${declarations}}`);\n }\n offset = GENERATED_STYLE_RULE.lastIndex;\n }\n return rules.join('\\n');\n};\nexport const sanitizePptxMarkup = (documentRef, html) => {\n const purifier = getPurifier(documentRef);\n if (!purifier) {\n return createSafeFallbackFragment(documentRef);\n }\n const fragment = purifier.sanitize(html, {\n RETURN_DOM_FRAGMENT: true,\n USE_PROFILES: { html: true, svg: true, svgFilters: true },\n ADD_ATTR: ['target'],\n FORBID_TAGS: ['script', 'style', 'iframe', 'object', 'embed', 'form'],\n FORBID_ATTR: ['srcdoc']\n });\n sanitizeStyleAttributes(documentRef, fragment);\n sanitizeEmbeddedResourceUrls(fragment);\n sanitizeSvgUrlAttributes(fragment);\n fragment.querySelectorAll('a[target]').forEach((anchor) => {\n if ((anchor.getAttribute('target') || '').trim().toLowerCase() === '_blank') {\n anchor.rel = 'noopener noreferrer';\n }\n });\n return fragment;\n};\n","const legacyPptxCss = `\n.slide{position:relative;border:0;border-radius:0;overflow:hidden;margin-bottom:50px;margin-left:auto;margin-right:auto;z-index:100}\n.slide div.block{position:absolute;top:0;left:0;width:100%;line-height:1}\n.slide div.content{display:flex;flex-direction:column}\n.slide div.diagram-content{display:flex;flex-direction:column}\n.slide div.content-rtl{display:flex;flex-direction:column;direction:rtl}\n.slide .pregraph-rtl{direction:rtl}\n.slide .pregraph-ltr{direction:ltr}\n.slide .pregraph-inherit{direction:inherit}\n.slide .slide-prgrph{width:100%}\n.slide .line-break-br::before{content:\"\\\\A\";white-space:pre}\n.slide div.v-up{justify-content:flex-start}\n.slide div.v-mid{justify-content:center}\n.slide div.v-down{justify-content:flex-end}\n.slide div.h-left{justify-content:flex-start;align-items:flex-start;text-align:left}\n.slide div.h-left-rtl{justify-content:flex-end;align-items:flex-end;text-align:left}\n.slide div.h-mid{justify-content:center;align-items:center;text-align:center}\n.slide div.h-right{justify-content:flex-end;align-items:flex-end;text-align:right}\n.slide div.h-right-rtl{justify-content:flex-start;align-items:flex-start;text-align:right}\n.slide div.h-just,.slide div.h-dist{text-align:justify}\n.slide div.up-left{justify-content:flex-start;align-items:flex-start;text-align:left}\n.slide div.up-center{justify-content:flex-start;align-items:center}\n.slide div.up-right{justify-content:flex-start;align-items:flex-end}\n.slide div.center-left{justify-content:center;align-items:flex-start;text-align:left}\n.slide div.center-center{justify-content:center;align-items:center}\n.slide div.center-right{justify-content:center;align-items:flex-end}\n.slide div.down-left{justify-content:flex-end;align-items:flex-start;text-align:left}\n.slide div.down-center{justify-content:flex-end;align-items:center}\n.slide div.down-right{justify-content:flex-end;align-items:flex-end}\n.slide li.slide{margin:10px 0;font-size:18px}\n.slide table{position:absolute;table-layout:fixed;box-sizing:border-box;overflow:hidden}\n.slide table tr,.slide table td{box-sizing:border-box;min-width:0;overflow:hidden}\n.slide .pptx-table-cell-content{box-sizing:border-box;min-height:0;overflow:hidden}\n.slide svg.drawing{position:absolute;overflow:visible}\n/* Chart shapes need renderer-owned styling even in offline / Shadow DOM hosts.\n Without it SVG's default black fill closes line and axis paths into polygons. */\n.slide .pptx-chart-surface svg{font:10px sans-serif;overflow:hidden}\n.slide .pptx-chart-surface .bb-axis path,.slide .pptx-chart-surface .bb-axis line{fill:none;stroke:currentColor}\n.slide .pptx-chart-surface .bb-line{fill:none;stroke-width:1px}\n.slide .pptx-chart-surface .bb-bar{stroke-width:0}\n.slide .pptx-chart-surface .bb-area{stroke-width:0;opacity:.2}\n.slide .pptx-chart-surface .bb-chart-arc path{stroke:#fff}\n.slide .pptx-chart-surface .bb-chart-arc text{fill:#fff;font-size:13px}\n.slide .pptx-chart-surface .bb-grid line{fill:none;stroke:#aaa}\n.slide .pptx-chart-surface .bb-xgrid,.slide .pptx-chart-surface .bb-ygrid{stroke-dasharray:3 3}\n.slide .pptx-chart-surface .bb-xgrid-focus,.slide .pptx-chart-surface .bb-ygrid-focus{pointer-events:none}\n.slide .pptx-chart-surface .bb-legend-item{font-size:12px}\n.slide .pptx-chart-surface .bb-tooltip-container{z-index:10;pointer-events:none}\n.slide .pptx-chart-surface table.bb-tooltip{position:static;width:auto;table-layout:auto;background:#fff;color:#172033;border:1px solid #ccc;opacity:.95;font-size:12px}\n.slide .pptx-chart-surface .bb-tooltip td,.slide .pptx-chart-surface .bb-tooltip th{padding:4px 6px}\n\n`;\nconst PPTX_CONTENT_STYLE_SCOPE = '.flyfish-pptx-content';\nexport const scopePptxContentStyleText = (cssText) => cssText.replace(/(^|})\\s*(\\.[^{}]+)\\{/g, (_match, boundary, selectorList) => {\n const scopedSelectors = selectorList\n .split(',')\n .map(selector => `${PPTX_CONTENT_STYLE_SCOPE} ${selector.trim()}`)\n .join(',');\n return `${boundary}${scopedSelectors}{`;\n});\nexport const pptxViewerCss = `\n.flyfish-pptx-scale-box{position:relative;box-sizing:border-box;max-width:100%;margin:0 auto;min-width:0}\n.flyfish-pptx-content{position:absolute;top:0;left:0;box-sizing:border-box;max-width:none;min-width:0;transform-origin:top left;will-change:transform}\n.flyfish-pptx-content[data-render-state=\"loading\"]{opacity:.82}\n.flyfish-pptx-slide-slot{display:flow-root;box-sizing:border-box;width:100%;min-width:0}\n.flyfish-pptx-slide-error{display:flex;align-items:center;justify-content:center;background:#fff7ed!important;color:#9a3412}\n.flyfish-pptx-slide-error-card{display:grid;gap:10px;max-width:70%;padding:24px;border:1px solid #fdba74;border-radius:12px;background:#fff;text-align:center;font:14px/1.5 system-ui,sans-serif}\n.flyfish-pptx-slide-error-card strong{font-size:18px}\n.flyfish-pptx-content .slide{background:#fff;box-shadow:0 18px 36px rgba(18,35,52,.12)}\n.flyfish-pptx-thumbnail{display:block;box-sizing:border-box;width:min(960px,100%);height:auto;margin:0 auto 28px;border-radius:12px;background:#fff;box-shadow:0 18px 36px rgba(18,35,52,.14)}\n${scopePptxContentStyleText(legacyPptxCss)}\n.flyfish-pptx-content > .slide:last-of-type{margin-bottom:0}\n.flyfish-pptx-slide-slot:last-of-type > .slide{margin-bottom:0}\n.flyfish-pptx-presentation{position:fixed;inset:0;z-index:2147483000;display:block;overflow:hidden;background:#000;cursor:default;user-select:none;-webkit-user-select:none}\n.flyfish-pptx-presentation:focus{outline:none}\n.flyfish-pptx-presentation-stage{position:absolute;inset:0;overflow:hidden}\n.flyfish-pptx-presentation .flyfish-pptx-scale-box{position:absolute;inset:0;width:100%;height:100%;margin:0}\n.flyfish-pptx-presentation .flyfish-pptx-thumbnail{display:none}\n.flyfish-pptx-content.is-presenting > .flyfish-pptx-slide-slot{display:none;min-height:0}\n.flyfish-pptx-content.is-presenting > .flyfish-pptx-slide-slot.is-active-slide{display:flow-root}\n.flyfish-pptx-content.is-presenting > .slide{display:none}\n.flyfish-pptx-content.is-presenting > .slide.is-active-slide{display:block}\n.flyfish-pptx-content.is-presenting .slide{margin:0!important;box-shadow:none}\n.flyfish-pptx-presentation-counter{position:absolute;right:18px;bottom:14px;padding:5px 12px;border-radius:999px;background:rgba(255,255,255,.14);color:#fff;font:13px/1.4 system-ui,sans-serif;letter-spacing:.02em;pointer-events:none}\n.flyfish-pptx-presentation-hint{position:absolute;left:18px;bottom:14px;color:rgba(255,255,255,.55);font:12px/1.4 system-ui,sans-serif;pointer-events:none}\n.flyfish-pptx-presentation-hint[hidden]{display:none}\n.flyfish-pptx-presentation-exit{position:absolute;top:14px;right:14px;width:34px;height:34px;padding:0;border:0;border-radius:999px;background:rgba(255,255,255,.14);color:#fff;font-size:15px;line-height:1;cursor:pointer}\n.flyfish-pptx-presentation-exit:hover{background:rgba(255,255,255,.26)}\n.flyfish-pptx-presentation-exit:focus-visible{outline:2px solid #fff;outline-offset:2px}\n@media (prefers-reduced-motion:no-preference){.flyfish-pptx-content.is-presenting > .flyfish-pptx-slide-slot.is-active-slide,.flyfish-pptx-content.is-presenting > .slide.is-active-slide{animation:flyfish-pptx-slide-in 140ms ease-out}}\n@keyframes flyfish-pptx-slide-in{from{opacity:.35}to{opacity:1}}\n`;\nconst PPTX_STYLE_ID = 'flyfish-pptx-native-style';\nexport const ensurePptxViewerStyles = (documentRef, root = documentRef) => {\n if (root instanceof Document && root.getElementById(PPTX_STYLE_ID)) {\n return;\n }\n if (!(root instanceof Document) && root.querySelector(`#${PPTX_STYLE_ID}`)) {\n return;\n }\n const style = documentRef.createElement('style');\n style.id = PPTX_STYLE_ID;\n style.textContent = pptxViewerCss;\n if (root instanceof Document) {\n (root.head || root.documentElement).appendChild(style);\n return;\n }\n root.appendChild(style);\n};\n","export const isResolvedPptxWorkerLocation = (moduleUrl, assetUrl) => {\n const relativePath = ['worker', 'pptx.worker.js'].join('/');\n const dependencyRelativeUrl = new URL(relativePath, moduleUrl);\n return assetUrl.href !== dependencyRelativeUrl.href || /\\/dist\\/worker\\.[cm]?js$/.test(moduleUrl.pathname);\n};\n","import { isResolvedPptxWorkerLocation } from \"./worker-location.js\";\nconst viteOptimizedWorkerPathPattern = /\\/\\.?vite\\/deps\\/worker\\/pptx\\.worker\\.js$/;\nconst viteSourceWorkerModulePattern = /\\/src\\/worker\\.[cm]?[jt]s$/;\nconst angularCachePath = '/.angular/cache/';\nconst viteOptimizedPptxSourcePattern = /\\/\\/\\s+(node_modules\\/(?:\\.pnpm\\/[^\\n]+?\\/node_modules\\/)?@file-viewer\\/pptx\\/dist\\/worker\\.js)\\b/;\nconst resolveBundledPptxWorkerUrl = () => {\n const moduleUrl = new URL(import.meta.url);\n if (viteSourceWorkerModulePattern.test(moduleUrl.pathname)) {\n return new URL('../dist/worker/pptx.worker.js', moduleUrl);\n }\n return new URL('./worker/pptx.worker.js', import.meta.url);\n};\nconst resolveAngularVitePptxWorkerUrl = (baseUrl, workerPath) => {\n const cacheIndex = baseUrl.pathname.indexOf(angularCachePath);\n if (cacheIndex < 0) {\n return null;\n }\n const workerUrl = new URL(baseUrl.href);\n workerUrl.pathname = `${workerUrl.pathname.slice(0, cacheIndex)}/${workerPath}`;\n workerUrl.search = '';\n workerUrl.hash = '';\n return workerUrl;\n};\nconst resolveViteOptimizedPptxWorkerUrl = (defaultPptxWorkerUrl) => {\n if (typeof XMLHttpRequest === 'undefined') {\n return null;\n }\n try {\n const request = new XMLHttpRequest();\n request.open('GET', import.meta.url, false);\n request.send(null);\n if ((request.status > 0 && request.status < 200) || request.status >= 400) {\n return null;\n }\n const match = viteOptimizedPptxSourcePattern.exec(request.responseText || '');\n if (!match) {\n return null;\n }\n const workerPath = match[1].replace(/dist\\/worker\\.js$/, 'dist/worker/pptx.worker.js');\n const angularWorkerUrl = resolveAngularVitePptxWorkerUrl(defaultPptxWorkerUrl, workerPath);\n if (angularWorkerUrl) {\n return angularWorkerUrl;\n }\n const origin = typeof location !== 'undefined' && location.origin\n ? location.origin\n : defaultPptxWorkerUrl.origin;\n return `${origin}/${workerPath}`;\n }\n catch {\n return null;\n }\n};\nconst resolvePptxWorkerUrl = (allowDependencyRelativeUrl) => {\n try {\n const moduleUrl = new URL(import.meta.url);\n const workerUrl = resolveBundledPptxWorkerUrl();\n if (isResolvedPptxWorkerLocation(moduleUrl, workerUrl))\n return workerUrl.href;\n if (viteOptimizedWorkerPathPattern.test(workerUrl.pathname)) {\n const optimizedUrl = resolveViteOptimizedPptxWorkerUrl(workerUrl);\n return optimizedUrl ? String(optimizedUrl) : undefined;\n }\n return allowDependencyRelativeUrl ? workerUrl.href : undefined;\n }\n catch {\n }\n return undefined;\n};\nexport const resolvePptxPackageWorkerUrl = () => {\n return resolvePptxWorkerUrl(false);\n};\nexport const createPptxWorker = (options = {}) => {\n var _a;\n if (options.workerFactory) {\n return options.workerFactory();\n }\n if (options.workerUrl) {\n return new Worker(options.workerUrl, {\n type: (_a = options.workerType) !== null && _a !== void 0 ? _a : 'module',\n });\n }\n const workerUrl = resolvePptxWorkerUrl(true);\n if (!workerUrl) {\n throw new Error('PPTX Worker URL is unavailable. Run file-viewer-copy-assets or provide workerUrl.');\n }\n return new Worker(workerUrl, { type: 'module' });\n};\n","import { renderPptxPostProcessing } from \"./chart.js\";\nimport { resolvePptxEngineOptions, RECOMMENDED_ZIP_LIMITS } from \"./options.js\";\nimport { PptxPresentation } from \"./presentation.js\";\nimport { sanitizePptxCss, sanitizePptxMarkup } from \"./sanitize.js\";\nimport { ensurePptxViewerStyles } from \"./styles.js\";\nimport { createPptxWorker } from \"./worker.js\";\nconst clamp = (value, min, max) => {\n return Math.min(max, Math.max(min, value));\n};\nconst toPercent = (value) => {\n const numeric = typeof value === 'number' && Number.isFinite(value) ? value : 100;\n return clamp(numeric, 25, 300);\n};\nconst stringifyErrorDetail = (error) => {\n if (error === undefined || error === null) {\n return '';\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error instanceof Error && error.message) {\n return error.message;\n }\n try {\n const serialized = JSON.stringify(error);\n return serialized && serialized !== '{}' ? serialized : String(error);\n }\n catch {\n return String(error);\n }\n};\nconst createPptxDiagnosticError = (code, stage, message, detailOrError, hint) => ({\n name: 'PptxDiagnosticError',\n code,\n stage,\n message,\n detail: stringifyErrorDetail(detailOrError),\n hint,\n});\nconst ensureZipWithinLimits = (buffer, options) => {\n const limits = {\n ...RECOMMENDED_ZIP_LIMITS,\n ...options.zipLimits,\n };\n if (limits.maxFileBytes && buffer.byteLength > limits.maxFileBytes) {\n throw createPptxDiagnosticError('PPTX_FILE_TOO_LARGE', 'preflight', 'PPTX 文件超过浏览器安全预览体积限制。', `${buffer.byteLength} bytes > ${limits.maxFileBytes} bytes`, '请压缩图片、拆分演示文稿,或在业务侧提高 zipLimits.maxFileBytes 后再预览。');\n }\n};\nconst appendHtml = (container, html) => {\n const fragment = sanitizePptxMarkup(container.ownerDocument, html);\n const nodes = Array.from(fragment.children);\n container.append(fragment);\n return nodes[0] || null;\n};\nconst escapeHtml = (value) => String(value !== null && value !== void 0 ? value : '')\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\nconst buildSlideErrorHtml = (slideNumber, error) => {\n const diagnostic = error && typeof error === 'object'\n ? error\n : null;\n const message = (diagnostic === null || diagnostic === void 0 ? void 0 : diagnostic.message) || stringifyErrorDetail(error) || 'This slide could not be rendered.';\n return `<section class=\"slide flyfish-pptx-slide-error\" data-slide-index=\"${slideNumber}\"><div class=\"flyfish-pptx-slide-error-card\" role=\"status\"><strong>Slide ${slideNumber}</strong><span>${escapeHtml(message)}</span></div></section>`;\n};\nconst DEFAULT_INITIAL_SLIDES = 3;\nconst DEFAULT_BATCH_SIZE = 4;\nconst DEFAULT_OVERSCAN_VIEWPORTS = 1.5;\nconst DEFAULT_SLIDE_HEIGHT = 540;\nconst DEFAULT_SLIDE_GAP = 50;\nconst toPositiveInteger = (value, fallback, min = 1, max = Number.MAX_SAFE_INTEGER) => {\n const numeric = typeof value === 'number' && Number.isFinite(value)\n ? Math.floor(value)\n : fallback;\n return clamp(numeric, min, max);\n};\nconst toPositiveNumber = (value, fallback, min = 0, max = Number.MAX_SAFE_INTEGER) => {\n const numeric = typeof value === 'number' && Number.isFinite(value) ? value : fallback;\n return clamp(numeric, min, max);\n};\nexport class PptxViewer {\n static async open(buffer, target, options = {}) {\n const viewer = new PptxViewer(buffer, target, options);\n await viewer.open();\n return viewer;\n }\n constructor(buffer, target, options) {\n this.worker = null;\n this.resizeObserver = null;\n this.resizeFrame = 0;\n this.fitScale = 1;\n this.userZoomPercent = 100;\n this.currentZoomPercent = 100;\n this.thumbnailElement = null;\n this.previewThumbnailDataUrl = null;\n this.slideSize = null;\n this.slideRecords = [];\n this.totalSlides = 0;\n this.savedScroll = null;\n this.pendingScrollRestore = null;\n this.slideWindowTarget = null;\n this.slideWindowListeners = [];\n this.slideWindowFrame = 0;\n this.charts = null;\n this.chartHandles = new Set();\n this.mediaRecords = new Map();\n this.disposed = false;\n this.completed = false;\n this.presentation = null;\n this.handleSlideWindowChange = () => this.scheduleSlideWindowUpdate();\n this.buffer = buffer;\n this.target = target;\n this.options = options;\n this.userZoomPercent = toPercent(options.zoomPercent);\n this.currentZoomPercent = this.userZoomPercent;\n const documentRef = target.ownerDocument || document;\n this.scaleBox = documentRef.createElement('div');\n this.scaleBox.className = 'flyfish-pptx-scale-box';\n this.content = documentRef.createElement('div');\n this.content.className = 'flyfish-pptx-content';\n this.content.dataset.renderState = 'loading';\n this.scaleBox.append(this.content);\n }\n get zoomPercent() {\n return Math.round(this.currentZoomPercent);\n }\n get thumbnailDataUrl() {\n return this.previewThumbnailDataUrl;\n }\n get slideCount() {\n return this.totalSlides;\n }\n get slideDimensions() {\n var _a, _b;\n const width = Number((_a = this.slideSize) === null || _a === void 0 ? void 0 : _a.width);\n const height = Number((_b = this.slideSize) === null || _b === void 0 ? void 0 : _b.height);\n return Number.isFinite(width) && width > 0 && Number.isFinite(height) && height > 0\n ? { width, height }\n : null;\n }\n get presenting() {\n var _a;\n return Boolean((_a = this.presentation) === null || _a === void 0 ? void 0 : _a.active);\n }\n get presentationSlideNumber() {\n var _a, _b;\n return (_b = (_a = this.presentation) === null || _a === void 0 ? void 0 : _a.slideNumber) !== null && _b !== void 0 ? _b : 1;\n }\n get styleRoot() {\n var _a;\n if (this.options.styleRoot) {\n return this.options.styleRoot;\n }\n const documentRef = this.target.ownerDocument || document;\n const root = this.target.getRootNode();\n const ShadowRootCtor = (_a = documentRef.defaultView) === null || _a === void 0 ? void 0 : _a.ShadowRoot;\n return ShadowRootCtor && root instanceof ShadowRootCtor\n ? root\n : documentRef;\n }\n get presentationRoot() {\n const documentRef = this.target.ownerDocument || document;\n const styleRoot = this.styleRoot;\n if (styleRoot !== documentRef) {\n return styleRoot;\n }\n return documentRef.body || documentRef.documentElement;\n }\n ensureSlideRendered(slideNumber) {\n const record = this.slideRecords.find(item => item.slideNumber === slideNumber);\n if (!record) {\n return null;\n }\n if (!record.rendered) {\n this.renderSlideRecord(record);\n }\n return record.element;\n }\n refreshLayout() {\n this.scheduleResize();\n }\n saveScrollPosition() {\n const view = this.target.ownerDocument.defaultView || window;\n const HTMLElementCtor = view.HTMLElement;\n const scroller = this.slideWindowTarget || this.findSlideWindowTarget();\n if (scroller instanceof HTMLElementCtor) {\n this.savedScroll = { top: scroller.scrollTop, left: scroller.scrollLeft };\n }\n else {\n this.savedScroll = { top: view.scrollY, left: view.scrollX };\n }\n }\n restoreScrollPosition() {\n if (this.savedScroll) {\n this.pendingScrollRestore = this.savedScroll;\n this.savedScroll = null;\n }\n this.scheduleResize();\n }\n emitPresentationChange(state) {\n var _a, _b;\n (_b = (_a = this.options).onPresentationChange) === null || _b === void 0 ? void 0 : _b.call(_a, state);\n }\n async enterPresentation(slideNumber) {\n if (this.disposed || this.totalSlides === 0) {\n return;\n }\n this.presentation || (this.presentation = new PptxPresentation(this, this.options.presentationLabels, this.options.presentationFullscreen));\n await this.presentation.enter(slideNumber);\n }\n exitPresentation() {\n var _a;\n (_a = this.presentation) === null || _a === void 0 ? void 0 : _a.exit();\n }\n async togglePresentation(slideNumber) {\n if (this.presenting) {\n this.exitPresentation();\n return;\n }\n await this.enterPresentation(slideNumber);\n }\n async open() {\n ensureZipWithinLimits(this.buffer, this.options);\n ensurePptxViewerStyles(this.target.ownerDocument || document, this.styleRoot);\n this.target.replaceChildren(this.scaleBox);\n this.attachResizeObserver();\n this.attachSlideWindowListeners();\n this.startWorker();\n }\n async setZoom(percent) {\n const desiredEffectivePercent = toPercent(percent);\n this.userZoomPercent = clamp(desiredEffectivePercent / Math.max(this.fitScale, 0.01), 25, 600);\n this.scheduleResize();\n }\n destroy() {\n var _a, _b, _c, _d, _e;\n this.disposed = true;\n (_a = this.presentation) === null || _a === void 0 ? void 0 : _a.destroy();\n this.presentation = null;\n this.previewThumbnailDataUrl = null;\n this.releaseCharts();\n this.releaseMedia();\n (_b = this.worker) === null || _b === void 0 ? void 0 : _b.terminate();\n this.worker = null;\n (_c = this.resizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();\n this.resizeObserver = null;\n if (this.resizeFrame) {\n (_d = this.target.ownerDocument.defaultView) === null || _d === void 0 ? void 0 : _d.cancelAnimationFrame(this.resizeFrame);\n }\n if (this.slideWindowFrame) {\n (_e = this.target.ownerDocument.defaultView) === null || _e === void 0 ? void 0 : _e.cancelAnimationFrame(this.slideWindowFrame);\n }\n this.detachSlideWindowListeners();\n this.target.replaceChildren();\n }\n startWorker() {\n var _a;\n (_a = this.worker) === null || _a === void 0 ? void 0 : _a.terminate();\n this.releaseCharts();\n this.releaseMedia();\n this.completed = false;\n this.charts = null;\n this.previewThumbnailDataUrl = null;\n this.slideSize = null;\n this.slideRecords = [];\n this.totalSlides = 0;\n this.content.replaceChildren();\n this.content.dataset.renderState = 'loading';\n try {\n this.worker = createPptxWorker(this.options);\n }\n catch (error) {\n throw createPptxDiagnosticError('PPTX_WORKER_FAILED', 'start-worker', 'PPTX Worker 启动失败。', error, '请检查 presentation.workerUrl、Worker 文件是否 200 返回、MIME/CSP/跨域策略是否允许加载。');\n }\n this.worker.addEventListener('message', event => this.processMessage(event.data));\n this.worker.addEventListener('error', event => this.fail(createPptxDiagnosticError('PPTX_WORKER_FAILED', 'worker-runtime', 'PPTX Worker 运行失败。', event.error || event.message, '请检查 Worker 脚本是否完整、浏览器控制台是否有 CSP/MIME/跨域或语法错误。')));\n try {\n this.worker.postMessage({\n type: 'processPPTX',\n data: this.buffer,\n IE11: false,\n options: resolvePptxEngineOptions(this.options.engineOptions),\n });\n }\n catch (error) {\n throw createPptxDiagnosticError('PPTX_WORKER_FAILED', 'post-worker-message', 'PPTX 数据发送到 Worker 失败。', error, '请确认浏览器支持 Worker 消息传递,并避免传入已被释放或不可克隆的数据。');\n }\n }\n processMessage(message) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;\n if (this.disposed || this.completed) {\n return;\n }\n switch (message.type) {\n case 'slide': {\n this.clearThumbnail();\n this.totalSlides += 1;\n if (this.shouldWindowSlides()) {\n this.appendWindowedSlide(String(message.data || ''), Number(message.slide_num || 0));\n }\n else {\n const element = appendHtml(this.content, String(message.data || ''));\n this.hydrateMedia(element);\n this.scheduleResize();\n (_b = (_a = this.options).onSlideRendered) === null || _b === void 0 ? void 0 : _b.call(_a, Number(message.slide_num || 0), element);\n }\n break;\n }\n case 'media':\n this.storeMedia(message.data);\n break;\n case 'slide-error': {\n const slideNumber = Number(message.slide_num || 0);\n const error = message.data;\n const html = buildSlideErrorHtml(slideNumber, error);\n this.clearThumbnail();\n this.totalSlides += 1;\n if (this.shouldWindowSlides()) {\n this.appendWindowedSlide(html, slideNumber);\n }\n else {\n const element = appendHtml(this.content, html);\n this.scheduleResize();\n (_d = (_c = this.options).onSlideRendered) === null || _d === void 0 ? void 0 : _d.call(_c, slideNumber, element);\n }\n (_f = (_e = this.options).onSlideError) === null || _f === void 0 ? void 0 : _f.call(_e, slideNumber, error);\n (_h = (_g = this.options).onWarning) === null || _h === void 0 ? void 0 : _h.call(_g, error);\n break;\n }\n case 'pptx-thumb':\n this.showThumbnail(String(message.data || ''));\n (_k = (_j = this.options).onThumbnail) === null || _k === void 0 ? void 0 : _k.call(_j, String(message.data || ''));\n break;\n case 'slideSize':\n this.slideSize = (message.data || {});\n this.syncWindowedPlaceholderHeights();\n (_m = (_l = this.options).onSlideSize) === null || _m === void 0 ? void 0 : _m.call(_l, (message.data || {}));\n break;\n case 'globalCSS':\n this.appendGlobalCss(String(message.data || ''));\n break;\n case 'progress-update':\n (_p = (_o = this.options).onProgress) === null || _p === void 0 ? void 0 : _p.call(_o, Number(message.data || 0), message);\n break;\n case 'ExecutionTime':\n case 'Done':\n void this.complete(message.charts).catch(error => this.fail(createPptxDiagnosticError('PPTX_PARSE_FAILED', 'post-process', 'PPTX 渲染后处理失败。', error)));\n break;\n case 'WARN':\n (_r = (_q = this.options).onWarning) === null || _r === void 0 ? void 0 : _r.call(_q, message.data);\n break;\n case 'ERROR':\n this.fail(message.data);\n break;\n default:\n break;\n }\n }\n appendGlobalCss(css) {\n const sanitized = sanitizePptxCss(this.target.ownerDocument, css);\n if (!sanitized) {\n return;\n }\n const style = this.target.ownerDocument.createElement('style');\n style.textContent = sanitized;\n this.content.append(style);\n }\n showThumbnail(base64Jpeg) {\n if (!base64Jpeg) {\n return;\n }\n this.previewThumbnailDataUrl = `data:image/jpeg;base64,${base64Jpeg}`;\n if (this.content.children.length > 0) {\n return;\n }\n const image = this.target.ownerDocument.createElement('img');\n image.className = 'flyfish-pptx-thumbnail';\n image.alt = 'PPTX preview thumbnail';\n image.src = this.previewThumbnailDataUrl;\n this.thumbnailElement = image;\n this.scaleBox.insertBefore(image, this.content);\n }\n clearThumbnail() {\n var _a;\n (_a = this.thumbnailElement) === null || _a === void 0 ? void 0 : _a.remove();\n this.thumbnailElement = null;\n }\n shouldWindowSlides() {\n var _a;\n return Boolean(this.options.lazySlides || ((_a = this.options.listOptions) === null || _a === void 0 ? void 0 : _a.windowed));\n }\n getSlideWindowOptions() {\n const listOptions = this.options.listOptions || {};\n return {\n initialSlides: toPositiveInteger(listOptions.initialSlides, DEFAULT_INITIAL_SLIDES, 1, 20),\n batchSize: toPositiveInteger(listOptions.batchSize, DEFAULT_BATCH_SIZE, 1, 20),\n overscanViewport: toPositiveNumber(listOptions.overscanViewport, DEFAULT_OVERSCAN_VIEWPORTS, 0.25, 6),\n };\n }\n getEstimatedSlideHeight() {\n var _a, _b;\n const sizeHeight = Number((_a = this.slideSize) === null || _a === void 0 ? void 0 : _a.height);\n const measuredHeight = (_b = this.slideRecords.find(record => record.estimatedHeight > 0)) === null || _b === void 0 ? void 0 : _b.estimatedHeight;\n return Math.ceil((Number.isFinite(sizeHeight) && sizeHeight > 0\n ? sizeHeight + DEFAULT_SLIDE_GAP\n : measuredHeight || DEFAULT_SLIDE_HEIGHT + DEFAULT_SLIDE_GAP));\n }\n appendWindowedSlide(html, slideNumber) {\n const record = this.createWindowedSlideRecord(html, slideNumber || this.slideRecords.length + 1);\n this.slideRecords.push(record);\n this.content.append(record.slot);\n if (this.slideRecords.length <= this.getSlideWindowOptions().initialSlides) {\n this.renderSlideRecord(record);\n }\n this.scheduleResize();\n this.scheduleSlideWindowUpdate();\n }\n createWindowedSlideRecord(html, slideNumber) {\n const slot = this.target.ownerDocument.createElement('div');\n const estimatedHeight = this.getEstimatedSlideHeight();\n slot.className = 'flyfish-pptx-slide-slot';\n slot.dataset.slideNumber = String(slideNumber);\n slot.style.minHeight = `${estimatedHeight}px`;\n return {\n slideNumber,\n html,\n slot,\n element: null,\n estimatedHeight,\n rendered: false,\n notified: false,\n postProcessed: false,\n postProcessPromise: null,\n postProcessVersion: 0,\n chartHandle: null,\n };\n }\n getDesignerCanvases(record) {\n return Array.from(record.slot.children).filter(element => (element.classList.contains('fv-print-mask-canvas')));\n }\n renderSlideRecord(record) {\n var _a, _b;\n if (record.rendered || this.disposed) {\n return;\n }\n const designerCanvases = this.getDesignerCanvases(record);\n record.slot.replaceChildren();\n record.element = appendHtml(record.slot, record.html);\n this.hydrateMedia(record.element);\n record.slot.append(...designerCanvases);\n record.rendered = true;\n record.postProcessed = false;\n record.postProcessVersion += 1;\n this.updateMeasuredSlideHeight(record);\n if (!record.notified) {\n record.notified = true;\n (_b = (_a = this.options).onSlideRendered) === null || _b === void 0 ? void 0 : _b.call(_a, record.slideNumber, record.element);\n }\n if (this.completed) {\n void this.postProcessSlideRecord(record).finally(() => this.scheduleResize());\n }\n this.scheduleResize();\n }\n unmountSlideRecord(record) {\n if (!record.rendered || this.getDesignerCanvases(record).length > 0) {\n return;\n }\n this.updateMeasuredSlideHeight(record);\n this.releaseChartHandle(record.chartHandle);\n record.chartHandle = null;\n record.postProcessVersion += 1;\n record.slot.replaceChildren();\n record.element = null;\n record.rendered = false;\n record.postProcessed = false;\n record.postProcessPromise = null;\n }\n updateMeasuredSlideHeight(record) {\n var _a;\n const HTMLElementCtor = ((_a = this.target.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.HTMLElement) || HTMLElement;\n if (!(record.element instanceof HTMLElementCtor)) {\n return;\n }\n const view = this.target.ownerDocument.defaultView || window;\n const computed = view.getComputedStyle(record.element);\n const marginTop = parseFloat(computed.marginTop) || 0;\n const marginBottom = parseFloat(computed.marginBottom) || 0;\n const measuredHeight = Math.ceil(record.element.offsetHeight + marginTop + marginBottom);\n const nextHeight = Math.max(measuredHeight, record.estimatedHeight, 1);\n record.estimatedHeight = nextHeight;\n record.slot.style.minHeight = `${nextHeight}px`;\n }\n syncWindowedPlaceholderHeights() {\n if (!this.shouldWindowSlides() || !this.slideRecords.length) {\n return;\n }\n const estimatedHeight = this.getEstimatedSlideHeight();\n for (const record of this.slideRecords) {\n if (!record.rendered && record.estimatedHeight < estimatedHeight) {\n record.estimatedHeight = estimatedHeight;\n record.slot.style.minHeight = `${estimatedHeight}px`;\n }\n }\n this.scheduleResize();\n }\n scheduleSlideWindowUpdate() {\n if (!this.shouldWindowSlides() || this.disposed) {\n return;\n }\n const view = this.target.ownerDocument.defaultView || window;\n if (this.slideWindowFrame) {\n view.cancelAnimationFrame(this.slideWindowFrame);\n }\n this.slideWindowFrame = view.requestAnimationFrame(() => this.updateSlideWindow());\n }\n updateSlideWindow() {\n this.slideWindowFrame = 0;\n if (!this.shouldWindowSlides() || !this.slideRecords.length || this.disposed) {\n return;\n }\n const windowOptions = this.getSlideWindowOptions();\n const indexesToRender = this.getWindowedSlideIndexes(windowOptions);\n const presentation = this.presentation;\n if (presentation === null || presentation === void 0 ? void 0 : presentation.active) {\n const activeIndex = this.slideRecords.findIndex(record => record.slideNumber === presentation.slideNumber);\n if (activeIndex >= 0) {\n indexesToRender.add(activeIndex);\n if (activeIndex + 1 < this.slideRecords.length) {\n indexesToRender.add(activeIndex + 1);\n }\n }\n }\n let changed = false;\n this.slideRecords.forEach((record, index) => {\n if (indexesToRender.has(index)) {\n const wasRendered = record.rendered;\n this.renderSlideRecord(record);\n changed || (changed = !wasRendered);\n }\n else if (record.rendered) {\n this.unmountSlideRecord(record);\n changed = true;\n }\n });\n if (changed) {\n this.scheduleResize();\n }\n }\n getWindowedSlideIndexes(windowOptions) {\n const viewport = this.getSlideViewport();\n const maxMountedSlides = Math.max(windowOptions.initialSlides, windowOptions.initialSlides + windowOptions.batchSize * 4, 12);\n const selected = new Set();\n for (let index = 0; index < Math.min(windowOptions.initialSlides, this.slideRecords.length); index += 1) {\n selected.add(index);\n }\n const candidates = this.slideRecords\n .map((record, index) => ({\n index,\n distance: this.getDistanceFromViewport(record, viewport, windowOptions.overscanViewport),\n }))\n .filter(candidate => candidate.distance !== Number.POSITIVE_INFINITY)\n .sort((a, b) => a.distance - b.distance || a.index - b.index);\n const closestFallback = candidates[0];\n for (const candidate of candidates) {\n if (candidate.distance > 0 && selected.size >= windowOptions.initialSlides) {\n continue;\n }\n selected.add(candidate.index);\n }\n if (closestFallback) {\n selected.add(closestFallback.index);\n }\n if (selected.size <= maxMountedSlides) {\n return selected;\n }\n const capped = new Set();\n for (let index = 0; index < Math.min(windowOptions.initialSlides, this.slideRecords.length); index += 1) {\n capped.add(index);\n }\n for (const candidate of candidates) {\n if (capped.size >= maxMountedSlides) {\n break;\n }\n capped.add(candidate.index);\n }\n return capped;\n }\n getDistanceFromViewport(record, viewport, overscanViewport) {\n const rect = record.slot.getBoundingClientRect();\n const overscan = viewport.height * overscanViewport;\n const top = viewport.top - overscan;\n const bottom = viewport.bottom + overscan;\n if (rect.bottom >= top && rect.top <= bottom) {\n return 0;\n }\n if (rect.bottom < top) {\n return top - rect.bottom;\n }\n if (rect.top > bottom) {\n return rect.top - bottom;\n }\n return Number.POSITIVE_INFINITY;\n }\n getSlideViewport() {\n const view = this.target.ownerDocument.defaultView || window;\n const HTMLElementCtor = view.HTMLElement;\n if (this.slideWindowTarget instanceof HTMLElementCtor) {\n const rect = this.slideWindowTarget.getBoundingClientRect();\n const height = Math.max(1, rect.height || this.slideWindowTarget.clientHeight || view.innerHeight || 1);\n return {\n top: rect.top,\n bottom: rect.top + height,\n height,\n };\n }\n const height = Math.max(1, view.innerHeight || this.target.ownerDocument.documentElement.clientHeight || DEFAULT_SLIDE_HEIGHT);\n return {\n top: 0,\n bottom: height,\n height,\n };\n }\n attachSlideWindowListeners() {\n if (!this.shouldWindowSlides()) {\n return;\n }\n this.detachSlideWindowListeners();\n const view = this.target.ownerDocument.defaultView || window;\n this.slideWindowTarget = this.findSlideWindowTarget();\n this.addSlideWindowListener(view, 'scroll');\n this.addSlideWindowListener(view, 'resize');\n if (this.slideWindowTarget && this.slideWindowTarget !== view) {\n this.addSlideWindowListener(this.slideWindowTarget, 'scroll');\n }\n }\n addSlideWindowListener(target, type) {\n target.addEventListener(type, this.handleSlideWindowChange, { passive: true });\n this.slideWindowListeners.push({ target, type, listener: this.handleSlideWindowChange });\n }\n detachSlideWindowListeners() {\n for (const { target, type, listener } of this.slideWindowListeners) {\n target.removeEventListener(type, listener);\n }\n this.slideWindowListeners = [];\n this.slideWindowTarget = null;\n }\n findSlideWindowTarget() {\n const view = this.target.ownerDocument.defaultView || window;\n let element = this.target.parentElement;\n while (element && element !== this.target.ownerDocument.body && element !== this.target.ownerDocument.documentElement) {\n const style = view.getComputedStyle(element);\n if (/(auto|scroll|overlay)/.test(`${style.overflowY} ${style.overflow}`)) {\n return element;\n }\n element = element.parentElement;\n }\n return view;\n }\n async postProcessRenderedContent(charts) {\n if (!this.shouldWindowSlides()) {\n const handle = await renderPptxPostProcessing(charts, this.content);\n this.trackChartHandle(handle);\n return;\n }\n await Promise.all(this.slideRecords\n .filter(record => record.rendered)\n .map(record => this.postProcessSlideRecord(record)));\n }\n async postProcessSlideRecord(record) {\n if (!record.rendered || record.postProcessed || this.disposed) {\n return;\n }\n if (!record.postProcessPromise) {\n const version = record.postProcessVersion;\n const postProcessPromise = (async () => {\n const handle = await renderPptxPostProcessing(this.charts, record.slot);\n if (this.disposed || !record.rendered || record.postProcessVersion !== version) {\n handle === null || handle === void 0 ? void 0 : handle.destroy();\n return;\n }\n this.releaseChartHandle(record.chartHandle);\n record.chartHandle = handle;\n this.trackChartHandle(handle);\n record.postProcessed = true;\n this.updateMeasuredSlideHeight(record);\n })().finally(() => {\n if (record.postProcessPromise === postProcessPromise) {\n record.postProcessPromise = null;\n }\n });\n record.postProcessPromise = postProcessPromise;\n }\n await record.postProcessPromise;\n }\n async cloneForExport() {\n if (!this.shouldWindowSlides()) {\n return this.target.cloneNode(true);\n }\n const previouslyRendered = new Set(this.slideRecords.filter(record => record.rendered));\n try {\n this.slideRecords.forEach(record => this.renderSlideRecord(record));\n await Promise.all(this.slideRecords.map(record => this.postProcessSlideRecord(record)));\n return this.target.cloneNode(true);\n }\n finally {\n this.slideRecords.forEach(record => {\n if (!previouslyRendered.has(record)) {\n this.unmountSlideRecord(record);\n }\n });\n this.scheduleSlideWindowUpdate();\n this.scheduleResize();\n }\n }\n async complete(charts) {\n var _a, _b, _c;\n if (this.disposed || this.completed) {\n return;\n }\n this.completed = true;\n this.charts = charts;\n this.content.dataset.renderState = 'ready';\n (_a = this.worker) === null || _a === void 0 ? void 0 : _a.terminate();\n this.worker = null;\n this.scheduleSlideWindowUpdate();\n this.scheduleResize();\n await this.postProcessRenderedContent(charts);\n if (this.disposed) {\n return;\n }\n this.scheduleResize();\n (_c = (_b = this.options).onRenderComplete) === null || _c === void 0 ? void 0 : _c.call(_b);\n }\n fail(error) {\n var _a, _b, _c;\n if (this.disposed) {\n return;\n }\n this.completed = true;\n (_a = this.worker) === null || _a === void 0 ? void 0 : _a.terminate();\n this.worker = null;\n this.releaseCharts();\n this.releaseMedia();\n this.content.dataset.renderState = 'error';\n (_c = (_b = this.options).onError) === null || _c === void 0 ? void 0 : _c.call(_b, error);\n }\n trackChartHandle(handle) {\n if (!handle) {\n return;\n }\n if (this.disposed) {\n handle.destroy();\n return;\n }\n this.chartHandles.add(handle);\n }\n releaseChartHandle(handle) {\n if (!handle) {\n return;\n }\n this.chartHandles.delete(handle);\n handle.destroy();\n }\n releaseCharts() {\n for (const handle of this.chartHandles) {\n handle.destroy();\n }\n this.chartHandles.clear();\n for (const record of this.slideRecords) {\n record.chartHandle = null;\n }\n }\n storeMedia(data) {\n if (!data || typeof data !== 'object') {\n return;\n }\n const media = data;\n if (typeof media.id !== 'string' ||\n !media.id ||\n typeof media.mimeType !== 'string' ||\n !(media.buffer instanceof ArrayBuffer)) {\n return;\n }\n this.releaseMedia(media.id);\n this.mediaRecords.set(media.id, {\n buffer: media.buffer,\n mimeType: media.mimeType,\n objectUrl: null,\n revokeObjectUrl: null,\n });\n this.hydrateMedia(this.content);\n }\n hydrateMedia(root) {\n var _a;\n if (!root) {\n return;\n }\n const elements = Array.from(root.querySelectorAll('[data-pptx-media-id]'));\n if (root.matches('[data-pptx-media-id]')) {\n elements.unshift(root);\n }\n for (const element of elements) {\n const mediaId = element.dataset.pptxMediaId;\n const record = mediaId ? this.mediaRecords.get(mediaId) : undefined;\n if (!record) {\n continue;\n }\n if (!record.objectUrl) {\n const view = this.target.ownerDocument.defaultView;\n const BlobCtor = (view === null || view === void 0 ? void 0 : view.Blob) || globalThis.Blob;\n const UrlApi = (view === null || view === void 0 ? void 0 : view.URL) || globalThis.URL;\n if (typeof BlobCtor !== 'function' ||\n typeof (UrlApi === null || UrlApi === void 0 ? void 0 : UrlApi.createObjectURL) !== 'function') {\n continue;\n }\n const objectUrl = UrlApi.createObjectURL(new BlobCtor([record.buffer], { type: record.mimeType }));\n record.objectUrl = objectUrl;\n record.revokeObjectUrl = () => UrlApi.revokeObjectURL(objectUrl);\n }\n if (element.src !== record.objectUrl) {\n element.src = record.objectUrl;\n (_a = element.load) === null || _a === void 0 ? void 0 : _a.call(element);\n }\n }\n }\n releaseMedia(mediaId) {\n var _a, _b;\n if (mediaId) {\n const record = this.mediaRecords.get(mediaId);\n (_a = record === null || record === void 0 ? void 0 : record.revokeObjectUrl) === null || _a === void 0 ? void 0 : _a.call(record);\n this.mediaRecords.delete(mediaId);\n return;\n }\n for (const record of this.mediaRecords.values()) {\n (_b = record.revokeObjectUrl) === null || _b === void 0 ? void 0 : _b.call(record);\n }\n this.mediaRecords.clear();\n }\n attachResizeObserver() {\n if (typeof ResizeObserver === 'undefined') {\n return;\n }\n this.resizeObserver = new ResizeObserver(() => {\n this.scheduleResize();\n this.scheduleSlideWindowUpdate();\n });\n this.resizeObserver.observe(this.target);\n if (this.target.parentElement) {\n this.resizeObserver.observe(this.target.parentElement);\n }\n }\n scheduleResize() {\n const view = this.target.ownerDocument.defaultView || window;\n if (this.resizeFrame) {\n view.cancelAnimationFrame(this.resizeFrame);\n }\n this.resizeFrame = view.requestAnimationFrame(() => this.resize());\n }\n resize() {\n var _a, _b, _c;\n if ((_a = this.presentation) === null || _a === void 0 ? void 0 : _a.active) {\n this.presentation.layout();\n return;\n }\n const slides = this.getMountedSlideElements();\n const sizeWidth = Number((_b = this.slideSize) === null || _b === void 0 ? void 0 : _b.width);\n const fallbackWidth = Number.isFinite(sizeWidth) && sizeWidth > 0 ? sizeWidth : 0;\n const slideWidth = Math.max(...slides.map(slide => slide.offsetWidth), fallbackWidth);\n if (!slideWidth) {\n return;\n }\n const viewportWidth = this.target.clientWidth || ((_c = this.target.parentElement) === null || _c === void 0 ? void 0 : _c.clientWidth) || slideWidth;\n this.fitScale = this.options.fitMode === 'none'\n ? 1\n : Math.min(1, viewportWidth / slideWidth);\n const effectiveScale = clamp(this.fitScale * (this.userZoomPercent / 100), 0.25, 3);\n this.currentZoomPercent = effectiveScale * 100;\n this.content.style.width = `${slideWidth}px`;\n this.content.style.transform = `scale(${effectiveScale})`;\n this.scaleBox.style.width = `${Math.ceil(slideWidth * effectiveScale)}px`;\n this.scaleBox.style.height = `${Math.ceil(this.content.scrollHeight * effectiveScale)}px`;\n this.scaleBox.style.minHeight = '';\n if (this.pendingScrollRestore) {\n const { top, left } = this.pendingScrollRestore;\n this.pendingScrollRestore = null;\n const view = this.target.ownerDocument.defaultView || window;\n const HTMLElementCtor = view.HTMLElement;\n const scroller = this.slideWindowTarget || this.findSlideWindowTarget();\n if (scroller instanceof HTMLElementCtor) {\n scroller.scrollTop = top;\n scroller.scrollLeft = left;\n }\n else {\n view.scrollTo(left, top);\n }\n }\n }\n getMountedSlideElements() {\n var _a;\n const HTMLElementCtor = ((_a = this.target.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.HTMLElement) || HTMLElement;\n const slides = [];\n for (const child of Array.from(this.content.children)) {\n if (!(child instanceof HTMLElementCtor)) {\n continue;\n }\n if (this.isSlideElement(child)) {\n slides.push(child);\n continue;\n }\n if (!child.classList.contains('flyfish-pptx-slide-slot')) {\n continue;\n }\n const firstChild = child.firstElementChild;\n if (firstChild instanceof HTMLElementCtor && this.isSlideElement(firstChild)) {\n slides.push(firstChild);\n }\n }\n return slides;\n }\n isSlideElement(element) {\n return element.classList.contains('slide') || element.tagName === 'SECTION';\n }\n}\n","import { PptxViewer, RECOMMENDED_ZIP_LIMITS, resolvePptxPackageWorkerUrl } from '@file-viewer/pptx';\nimport { DEFAULT_RENDERER_DEFINITIONS, attachFileViewerErrorMessage, createFileViewerTranslator, createFileViewerZoomChangeEmitter, getFileViewerShadowRootForNode, getDefaultFileViewerAssetBaseUrl, normalizeFileViewerErrorMessage, registerFileViewerZoomProvider, resolveFileViewerLocale, resolveFileViewerPresentationWorkerUrl, resolveFileViewerCopiedAssetUrl, resolveFileViewerRuntimeAssetBaseUrl, waitForFileViewerNextPaint, unregisterFileViewerZoomProvider, } from '@file-viewer/core';\nconst pptxStyle = `\n.pptx-viewer-shell{position:relative;box-sizing:border-box;min-height:100%;padding:24px 20px;background:var(--file-viewer-render-surface-background,#eef3f8);color:#1f2d3b;font-family:Aptos,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif}\n.pptx-render-surface{min-height:240px}\n.pptx-render-surface.is-loading{opacity:.72}\n.pptx-loading{position:sticky;top:12px;z-index:3;box-sizing:border-box;display:inline-flex;align-items:center;gap:10px;margin:0 0 16px 50%;padding:10px 14px;border:1px solid rgba(42,94,144,.14);border-radius:999px;background:rgba(255,255,255,.92);color:#41556b;box-shadow:0 12px 32px rgba(24,44,64,.12);transform:translateX(-50%)}\n.pptx-loading[hidden],.pptx-error[hidden]{display:none!important}\n.pptx-loading-dot{width:9px;height:9px;border-radius:999px;background:#1f9d67;box-shadow:0 0 0 6px rgba(31,157,103,.13)}\n.pptx-error{box-sizing:border-box;width:min(680px,calc(100% - 32px));margin:48px auto;padding:24px;border:1px solid rgba(28,43,58,.12);border-radius:14px;background:#fff;color:#1f2d3b;box-shadow:0 16px 42px rgba(25,42,54,.08)}\n.pptx-slideshow-button{position:sticky;top:12px;z-index:4;float:right;display:inline-flex;align-items:center;gap:8px;margin:0 0 12px;padding:8px 14px;border:1px solid rgba(42,94,144,.16);border-radius:999px;background:rgba(255,255,255,.94);color:#2a5e90;font:13px/1.2 inherit;cursor:pointer;box-shadow:0 10px 26px rgba(24,44,64,.12)}\n.pptx-slideshow-button:hover{border-color:rgba(42,94,144,.34);color:#1d4a75}\n.pptx-slideshow-button:focus-visible{outline:2px solid #2a5e90;outline-offset:2px}\n.pptx-slideshow-button[hidden]{display:none!important}\n.pptx-slideshow-button-glyph{font-size:11px;line-height:1}\n.pptx-slideshow-button-key{padding:1px 6px;border-radius:6px;background:rgba(42,94,144,.1);font-size:11px;letter-spacing:.04em}\n[data-viewer-theme='dark'] .pptx-slideshow-button{border-color:rgba(148,163,184,.2);background:rgba(15,23,42,.92);color:#cbd5e1}\n[data-viewer-theme='dark'] .pptx-slideshow-button-key{background:rgba(148,163,184,.16)}\n.pptx-error strong{display:block;margin-bottom:10px;font-size:18px}\n.pptx-error p{margin:0;color:#607282;line-height:1.7}\n[data-viewer-theme='dark'] .pptx-viewer-shell{background:var(--file-viewer-render-surface-background,#101820);color:#e5eef8}\n[data-viewer-theme='dark'] .pptx-loading{border-color:rgba(148,163,184,.18);background:rgba(15,23,42,.9);color:#cbd5e1;box-shadow:0 18px 44px rgba(0,0,0,.26)}\n[data-viewer-theme='dark'] .pptx-error{border-color:rgba(148,163,184,.18);background:#151f2b;color:#f8fafc;box-shadow:0 22px 56px rgba(0,0,0,.32)}\n[data-viewer-theme='dark'] .pptx-error p{color:#94a3b8}\n[data-viewer-theme='dark'] .pptx-render-surface .slide,[data-viewer-theme='dark'] .pptx-render-surface [data-slide-index]{color-scheme:only light;forced-color-adjust:none}\n@media (prefers-color-scheme:dark){[data-viewer-theme='system'] .pptx-viewer-shell{background:var(--file-viewer-render-surface-background,#101820);color:#e5eef8}[data-viewer-theme='system'] .pptx-loading{border-color:rgba(148,163,184,.18);background:rgba(15,23,42,.9);color:#cbd5e1;box-shadow:0 18px 44px rgba(0,0,0,.26)}[data-viewer-theme='system'] .pptx-error{border-color:rgba(148,163,184,.18);background:#151f2b;color:#f8fafc;box-shadow:0 22px 56px rgba(0,0,0,.32)}[data-viewer-theme='system'] .pptx-error p{color:#94a3b8}[data-viewer-theme='system'] .pptx-render-surface .slide,[data-viewer-theme='system'] .pptx-render-surface [data-slide-index]{color-scheme:only light;forced-color-adjust:none}}\n`;\nconst pptxPrintStyle = `\n .pptx-viewer-shell {\n background: #fff !important;\n padding: 0 !important;\n }\n .pptx-render-surface {\n display: block !important;\n overflow: visible !important;\n }\n .pptx-render-surface [data-slide-index] {\n break-after: page;\n page-break-after: always;\n margin: 0 auto !important;\n }\n .pptx-render-surface [data-slide-index]:last-child {\n break-after: auto;\n page-break-after: auto;\n }\n`;\nconst SLIDESHOW_HOTKEY_LABEL = 'F5 / P';\nconst activePptxShells = new WeakMap();\nconst createStyle = (documentRef) => {\n const style = documentRef.createElement('style');\n style.textContent = pptxStyle;\n return style;\n};\nconst createElement = (documentRef, tagName, className, text) => {\n const element = documentRef.createElement(tagName);\n if (className) {\n element.className = className;\n }\n if (text !== undefined) {\n element.textContent = text;\n }\n return element;\n};\nconst resolvePptxStyleRoot = (surface, context) => {\n var _a, _b;\n return ((_a = context === null || context === void 0 ? void 0 : context.surface) === null || _a === void 0 ? void 0 : _a.shadowRoot) ||\n getFileViewerShadowRootForNode((_b = context === null || context === void 0 ? void 0 : context.surface) === null || _b === void 0 ? void 0 : _b.container) ||\n getFileViewerShadowRootForNode(surface) ||\n undefined;\n};\nconst clampZoomPercent = (value) => {\n return Math.min(300, Math.max(25, Math.round(value)));\n};\nconst pptxDiagnosticMessages = {\n PPTX_FILE_EMPTY: {\n zh: '文件为空或过小,无法读取。',\n en: 'The file is empty or too small to read.',\n ja: 'ファイルが空であるか小さすぎるため、読み込めません。',\n de: 'Die Datei ist leer oder zu klein zum Lesen.',\n },\n PPTX_FILE_TOO_LARGE: {\n zh: '文件超过浏览器安全预览体积限制。',\n en: 'The file is larger than the browser-safe preview limit.',\n ja: 'ファイルがブラウザーで安全にプレビューできるサイズ上限を超えています。',\n de: 'Die Datei überschreitet die sichere Vorschaugröße des Browsers.',\n },\n PPTX_INVALID_ZIP: {\n zh: '文件不是有效的 PowerPoint OpenXML 压缩包。',\n en: 'The file is not a valid PowerPoint OpenXML package.',\n ja: '有効な PowerPoint OpenXML パッケージではありません。',\n de: 'Die Datei ist kein gültiges PowerPoint-OpenXML-Paket.',\n },\n PPTX_MISSING_CONTENT_TYPES: {\n zh: '文件缺少 [Content_Types].xml,无法识别内部结构。',\n en: 'The package is missing [Content_Types].xml, so its structure cannot be identified.',\n ja: '[Content_Types].xml がないため、内部構造を識別できません。',\n de: '[Content_Types].xml fehlt; die Paketstruktur kann nicht erkannt werden.',\n },\n PPTX_MISSING_PRESENTATION: {\n zh: '文件缺少 ppt/presentation.xml,无法读取幻灯片列表。',\n en: 'The package is missing ppt/presentation.xml, so the slide list cannot be read.',\n ja: 'ppt/presentation.xml がないため、スライド一覧を読み込めません。',\n de: 'ppt/presentation.xml fehlt; die Folienliste kann nicht gelesen werden.',\n },\n PPTX_NO_SLIDES: {\n zh: '文件中没有找到可预览的幻灯片。',\n en: 'No previewable slides were found in the file.',\n ja: 'プレビュー可能なスライドが見つかりませんでした。',\n de: 'Es wurden keine Folien für die Vorschau gefunden.',\n },\n PPTX_MISSING_SLIDE: {\n zh: '文件缺少某一页幻灯片内容。',\n en: 'The package is missing one of the slide parts.',\n ja: 'スライド部品の一部がありません。',\n de: 'Ein Folienbestandteil fehlt im Paket.',\n },\n PPTX_SLIDE_RENDER_FAILED: {\n zh: '某一页幻灯片解析失败。',\n en: 'One slide failed to parse.',\n ja: 'スライドの解析に失敗しました。',\n de: 'Eine Folie konnte nicht verarbeitet werden.',\n },\n PPTX_WORKER_FAILED: {\n zh: 'PPTX Worker 启动或运行失败。',\n en: 'The PPTX Worker failed to start or run.',\n ja: 'PPTX Worker の起動または実行に失敗しました。',\n de: 'Der PPTX-Worker konnte nicht gestartet oder ausgeführt werden.',\n },\n PPTX_PARSE_FAILED: {\n zh: 'PPTX 文件解析失败。',\n en: 'The PPTX file could not be parsed.',\n ja: 'PPTX ファイルを解析できませんでした。ファイルを再保存するか、入力元を確認してください。',\n de: 'Die PPTX-Datei konnte nicht verarbeitet werden.',\n },\n};\nconst pptxDiagnosticFallbackHints = {\n PPTX_INVALID_ZIP: {\n zh: '请确认接口返回的是原始 .pptx 二进制文件,而不是登录页、HTML/JSON 错误响应或被截断的内容。',\n en: 'Confirm that the response is the original .pptx binary, not a login page, HTML/JSON error response, or truncated download.',\n ja: 'レスポンスがログインページや HTML/JSON エラー、途中で切れたデータではなく、元の .pptx バイナリであることを確認してください。',\n de: 'Prüfen Sie, ob die Antwort die ursprüngliche .pptx-Datei und keine Anmeldeseite, HTML/JSON-Fehlerantwort oder unvollständige Datei enthält.',\n },\n PPTX_WORKER_FAILED: {\n zh: '请检查 presentation.workerUrl、Worker 文件路径、MIME 类型、CSP 和跨域策略。',\n en: 'Check presentation.workerUrl, the Worker file path, MIME type, CSP, and cross-origin policy.',\n ja: 'presentation.workerUrl、Worker のパス、MIME type、CSP、cross-origin policy を確認してください。',\n de: 'Prüfen Sie presentation.workerUrl, den Worker-Pfad, den MIME-Typ, CSP und die Cross-Origin-Richtlinie.',\n },\n PPTX_NO_SLIDES: {\n zh: '请重新保存演示文稿,或检查包内是否存在 ppt/slides/slide*.xml。',\n en: 'Re-save the presentation, or check whether ppt/slides/slide*.xml exists inside the package.',\n ja: 'プレゼンテーションを再保存するか、パッケージに ppt/slides/slide*.xml があるか確認してください。',\n de: 'Speichern Sie die Präsentation erneut oder prüfen Sie, ob ppt/slides/slide*.xml im Paket vorhanden ist.',\n },\n};\nconst localizePptxDiagnosticCopy = (copy, locale) => {\n if (!copy) {\n return '';\n }\n return locale === 'zh-CN' ? copy.zh : locale === 'ja-JP' ? copy.ja : locale === 'de-DE' ? copy.de : copy.en;\n};\nconst sanitizePptxDiagnosticText = (value) => {\n if (typeof value !== 'string') {\n return '';\n }\n return value.replace(/^Error:\\s*/i, '').trim();\n};\nconst isPptxDiagnosticErrorLike = (error) => {\n return Boolean(error &&\n typeof error === 'object' &&\n (error.name === 'PptxDiagnosticError' ||\n error.code ||\n error.stage));\n};\nconst classifyPptxErrorString = (message) => {\n const lower = message.toLowerCase();\n if (lower.includes('end of central directory') ||\n lower.includes('corrupt zip') ||\n lower.includes('invalid zip') ||\n lower.includes('not a zip') ||\n lower.includes('jszip')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_INVALID_ZIP',\n stage: 'read-zip',\n detail: message,\n };\n }\n if (lower.includes('worker') ||\n lower.includes('script error') ||\n lower.includes('failed to construct') ||\n lower.includes('failed to load')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_WORKER_FAILED',\n stage: 'worker-runtime',\n detail: message,\n };\n }\n if (lower.includes('[content_types].xml')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_MISSING_CONTENT_TYPES',\n stage: 'read-content-types',\n detail: message,\n };\n }\n if (lower.includes('ppt/presentation.xml')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_MISSING_PRESENTATION',\n stage: 'read-presentation',\n detail: message,\n };\n }\n if (lower.includes('slide') || lower.includes('ppt/slides/')) {\n return {\n name: 'PptxDiagnosticError',\n code: 'PPTX_SLIDE_RENDER_FAILED',\n stage: 'render-slide',\n detail: message,\n };\n }\n return null;\n};\nconst formatPptxDiagnosticError = (error, fallback, context) => {\n const locale = resolveFileViewerLocale(context === null || context === void 0 ? void 0 : context.options);\n const code = String(error.code || 'PPTX_PARSE_FAILED');\n const localizedReason = localizePptxDiagnosticCopy(pptxDiagnosticMessages[code], locale);\n const rawReason = sanitizePptxDiagnosticText(error.message);\n const reason = (locale === 'zh-CN'\n ? rawReason || localizedReason\n : localizedReason || rawReason) || fallback;\n const detail = sanitizePptxDiagnosticText(error.detail);\n const hint = localizePptxDiagnosticCopy(pptxDiagnosticFallbackHints[code], locale) ||\n sanitizePptxDiagnosticText(error.hint);\n const stage = sanitizePptxDiagnosticText(error.stage);\n const usesWesternPunctuation = locale === 'en-US' || locale === 'de-DE';\n const separator = usesWesternPunctuation ? ': ' : ':';\n const parts = [`${fallback}${separator}${reason}`];\n if (stage) {\n parts.push(locale === 'zh-CN' ? `阶段:${stage}` : locale === 'ja-JP' ? `段階:${stage}` : locale === 'de-DE' ? `Phase: ${stage}` : `Stage: ${stage}`);\n }\n if (detail && detail !== reason) {\n parts.push(locale === 'zh-CN' ? `详情:${detail}` : locale === 'ja-JP' ? `詳細:${detail}` : locale === 'de-DE' ? `Details: ${detail}` : `Detail: ${detail}`);\n }\n if (hint) {\n parts.push(locale === 'zh-CN' ? `建议:${hint}` : locale === 'ja-JP' ? `対処:${hint}` : locale === 'de-DE' ? `Hinweis: ${hint}` : `Hint: ${hint}`);\n }\n return parts.join(usesWesternPunctuation ? '; ' : ';');\n};\nconst formatErrorMessage = (error, fallback, context) => {\n if (isPptxDiagnosticErrorLike(error)) {\n return formatPptxDiagnosticError(error, fallback, context);\n }\n if (error instanceof Error || typeof error === 'string') {\n const normalized = normalizeFileViewerErrorMessage(error, context === null || context === void 0 ? void 0 : context.options);\n const classified = classifyPptxErrorString(normalized);\n if (classified) {\n return formatPptxDiagnosticError(classified, fallback, context);\n }\n return normalized || fallback;\n }\n if (error === undefined || error === null) {\n return fallback;\n }\n try {\n const serialized = JSON.stringify(error) || '';\n if (serialized) {\n const classified = classifyPptxErrorString(serialized);\n if (classified) {\n return formatPptxDiagnosticError(classified, fallback, context);\n }\n }\n return serialized || fallback;\n }\n catch {\n return String(error || fallback);\n }\n};\nexport const resolvePptxPreviewErrorMessage = formatErrorMessage;\nconst collectPptxPrintMaskPages = (surface) => {\n const slots = Array.from(surface.querySelectorAll('.flyfish-pptx-slide-slot'));\n return slots.length\n ? slots\n : Array.from(surface.querySelectorAll('[data-slide-index], .slide'));\n};\nconst buildExportAdapter = (surface, targetWindow, getViewer) => ({\n print: true,\n exportHtml: true,\n includeDocumentStyles: true,\n beforeSnapshot: () => waitForFileViewerNextPaint(targetWindow || undefined),\n getPrintMaskPages: () => collectPptxPrintMaskPages(surface),\n printStyle: pptxPrintStyle,\n toHtml: async () => {\n var _a;\n const clone = await ((_a = getViewer()) === null || _a === void 0 ? void 0 : _a.cloneForExport()) || surface.cloneNode(true);\n collectPptxPrintMaskPages(clone).forEach((page, index) => {\n page.dataset.viewerPrintPageIndex = String(index);\n });\n return clone.outerHTML;\n },\n});\nexport default async function renderPptx(buffer, target, _type, context) {\n var _a;\n const t = createFileViewerTranslator(context === null || context === void 0 ? void 0 : context.options);\n const documentRef = target.ownerDocument || document;\n const targetWindow = documentRef.defaultView || (typeof window !== 'undefined' ? window : null);\n const zoomEmitter = createFileViewerZoomChangeEmitter();\n let viewer = null;\n let state = 'loading';\n let errorMessage = '';\n let zoomPercent = 100;\n let progressiveReady = false;\n let disposed = false;\n const style = createStyle(documentRef);\n const shell = createElement(documentRef, 'div', 'pptx-viewer-shell');\n shell.dataset.viewerZoomProvider = 'pptx';\n const loading = createElement(documentRef, 'div', 'pptx-loading');\n loading.setAttribute('aria-live', 'polite');\n loading.append(createElement(documentRef, 'span', 'pptx-loading-dot'), createElement(documentRef, 'span', undefined, t('presentation.state.loading')));\n const error = createElement(documentRef, 'div', 'pptx-error');\n const errorTitle = createElement(documentRef, 'strong', undefined, t('presentation.error.title'));\n const errorText = createElement(documentRef, 'p');\n error.append(errorTitle, errorText);\n const slideshowButton = createElement(documentRef, 'button', 'pptx-slideshow-button');\n slideshowButton.type = 'button';\n slideshowButton.hidden = true;\n const slideshowGlyph = createElement(documentRef, 'span', 'pptx-slideshow-button-glyph', '▶');\n const slideshowText = createElement(documentRef, 'span', undefined, t('presentation.slideshow.start'));\n const slideshowKey = createElement(documentRef, 'span', 'pptx-slideshow-button-key', SLIDESHOW_HOTKEY_LABEL);\n slideshowButton.append(slideshowGlyph, slideshowText, slideshowKey);\n slideshowButton.addEventListener('click', () => {\n void (viewer === null || viewer === void 0 ? void 0 : viewer.togglePresentation());\n });\n const surface = createElement(documentRef, 'div', 'pptx-render-surface');\n shell.append(loading, error, slideshowButton, surface);\n target.replaceChildren(style, shell);\n const activateShell = () => {\n activePptxShells.set(documentRef, shell);\n };\n const deactivateShell = (event) => {\n if ((viewer === null || viewer === void 0 ? void 0 : viewer.presenting) || activePptxShells.get(documentRef) !== shell) {\n return;\n }\n if (event.composedPath().includes(shell)) {\n return;\n }\n const targetElement = event.target;\n if (event.type === 'focusin' &&\n !(targetElement === null || targetElement === void 0 ? void 0 : targetElement.matches('button, a, input, textarea, select, [contenteditable], [tabindex]'))) {\n return;\n }\n activePptxShells.delete(documentRef);\n };\n shell.addEventListener('pointerdown', activateShell);\n shell.addEventListener('focusin', activateShell);\n documentRef.addEventListener('pointerdown', deactivateShell);\n documentRef.addEventListener('focusin', deactivateShell);\n const isEditableTarget = (node) => {\n const element = node;\n if (!element || typeof element.closest !== 'function') {\n return false;\n }\n return Boolean(element.closest('input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]'));\n };\n const handleShortcut = (event) => {\n if (disposed || !viewer || event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n if (event.key !== 'F5' && event.key !== 'p' && event.key !== 'P') {\n return;\n }\n if (!shell.isConnected || isEditableTarget(event.target)) {\n return;\n }\n if (activePptxShells.get(documentRef) !== shell) {\n return;\n }\n const targetElement = event.target;\n if (targetElement && typeof targetElement.closest === 'function') {\n const targetShell = targetElement.closest('.pptx-viewer-shell');\n if (targetShell && targetShell !== shell) {\n return;\n }\n }\n event.preventDefault();\n void viewer.togglePresentation();\n };\n documentRef.addEventListener('keydown', handleShortcut);\n (_a = context === null || context === void 0 ? void 0 : context.registerThumbnailAdapter) === null || _a === void 0 ? void 0 : _a.call(context, {\n captureSource: 'embedded',\n beforeCapture: async ({ signal }) => {\n const hasFirstVisual = () => Boolean((viewer === null || viewer === void 0 ? void 0 : viewer.thumbnailDataUrl) || surface.querySelector('.slide, .flyfish-pptx-thumbnail'));\n while ((state === 'loading' || (state === 'ready' && !hasFirstVisual())) && !disposed) {\n if (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n throw signal.reason;\n }\n await new Promise(resolve => {\n if (targetWindow)\n targetWindow.setTimeout(resolve, 16);\n else\n setTimeout(resolve, 16);\n });\n }\n if (state === 'error') {\n throw new Error(errorMessage || t('presentation.error.parseFailed'));\n }\n },\n capture: () => (viewer === null || viewer === void 0 ? void 0 : viewer.thumbnailDataUrl)\n ? fetch(viewer.thumbnailDataUrl).then(response => response.blob())\n : null,\n getTarget: () => surface,\n });\n const getCurrentZoomPercent = () => { var _a; return clampZoomPercent((_a = viewer === null || viewer === void 0 ? void 0 : viewer.zoomPercent) !== null && _a !== void 0 ? _a : zoomPercent); };\n const getZoomState = () => {\n const percent = getCurrentZoomPercent();\n return {\n scale: percent / 100,\n label: `${percent}%`,\n canZoomIn: percent < 300,\n canZoomOut: percent > 25,\n canReset: percent !== 100,\n minScale: 0.25,\n maxScale: 3,\n };\n };\n const setZoom = async (percent) => {\n const nextPercent = clampZoomPercent(percent);\n zoomPercent = nextPercent;\n if (viewer) {\n await viewer.setZoom(nextPercent);\n zoomPercent = getCurrentZoomPercent();\n }\n zoomEmitter.emit();\n return getZoomState();\n };\n const notifyProgressiveReady = () => {\n var _a, _b;\n if (progressiveReady || disposed || ((_a = context === null || context === void 0 ? void 0 : context.signal) === null || _a === void 0 ? void 0 : _a.aborted)) {\n return;\n }\n progressiveReady = true;\n (_b = context === null || context === void 0 ? void 0 : context.onProgressiveRender) === null || _b === void 0 ? void 0 : _b.call(context);\n };\n const syncUi = () => {\n var _a;\n loading.hidden = !(state === 'loading' && !errorMessage);\n error.hidden = state !== 'error';\n errorText.textContent = errorMessage;\n surface.classList.toggle('is-loading', state === 'loading');\n const presenting = Boolean(viewer === null || viewer === void 0 ? void 0 : viewer.presenting);\n slideshowButton.hidden = state !== 'ready' || ((_a = viewer === null || viewer === void 0 ? void 0 : viewer.slideCount) !== null && _a !== void 0 ? _a : 0) === 0;\n slideshowText.textContent = presenting\n ? t('presentation.slideshow.exit')\n : t('presentation.slideshow.start');\n slideshowButton.setAttribute('aria-pressed', presenting ? 'true' : 'false');\n };\n const registerExportAdapter = () => {\n var _a;\n (_a = context === null || context === void 0 ? void 0 : context.registerExportAdapter) === null || _a === void 0 ? void 0 : _a.call(context, buildExportAdapter(surface, targetWindow, () => viewer));\n };\n const reportPptxFailure = (failure) => {\n var _a;\n state = 'error';\n errorMessage = formatErrorMessage(failure, t('presentation.error.parseFailed'), context);\n (_a = context === null || context === void 0 ? void 0 : context.registerExportAdapter) === null || _a === void 0 ? void 0 : _a.call(context, null);\n syncUi();\n return attachFileViewerErrorMessage(failure, errorMessage);\n };\n registerFileViewerZoomProvider(shell, {\n zoomIn: () => setZoom(getCurrentZoomPercent() + 15),\n zoomOut: () => setZoom(getCurrentZoomPercent() - 15),\n resetZoom: () => setZoom(100),\n setZoom: scale => setZoom(scale * 100),\n getState: getZoomState,\n subscribe: zoomEmitter.subscribe,\n });\n const openPresentation = async () => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n state = 'loading';\n errorMessage = '';\n progressiveReady = false;\n syncUi();\n const presentationOptions = (_a = context === null || context === void 0 ? void 0 : context.options) === null || _a === void 0 ? void 0 : _a.presentation;\n let resolveCompletion;\n let rejectCompletion;\n const completion = new Promise((resolve, reject) => {\n resolveCompletion = resolve;\n rejectCompletion = reject;\n });\n void completion.catch(() => { });\n const abort = () => {\n var _a;\n const reason = ((_a = context === null || context === void 0 ? void 0 : context.signal) === null || _a === void 0 ? void 0 : _a.reason) || new DOMException('PPTX rendering aborted.', 'AbortError');\n viewer === null || viewer === void 0 ? void 0 : viewer.destroy();\n viewer = null;\n rejectCompletion(reason);\n };\n (_b = context === null || context === void 0 ? void 0 : context.signal) === null || _b === void 0 ? void 0 : _b.addEventListener('abort', abort, { once: true });\n try {\n if ((_c = context === null || context === void 0 ? void 0 : context.signal) === null || _c === void 0 ? void 0 : _c.aborted) {\n throw context.signal.reason || new DOMException('PPTX rendering aborted.', 'AbortError');\n }\n const workerUrl = (presentationOptions === null || presentationOptions === void 0 ? void 0 : presentationOptions.workerUrl) || getDefaultFileViewerAssetBaseUrl()\n ? resolveFileViewerPresentationWorkerUrl(presentationOptions, resolveFileViewerRuntimeAssetBaseUrl(documentRef))\n : resolvePptxPackageWorkerUrl() ||\n await resolveFileViewerCopiedAssetUrl(documentRef, 'office-presentation', 'pptx-worker', context === null || context === void 0 ? void 0 : context.signal);\n if ((_d = context === null || context === void 0 ? void 0 : context.signal) === null || _d === void 0 ? void 0 : _d.aborted) {\n throw context.signal.reason || new DOMException('PPTX rendering aborted.', 'AbortError');\n }\n if (!workerUrl) {\n throw new Error('PPTX Worker URL is unavailable. Run file-viewer-copy-assets or provide presentation.workerUrl.');\n }\n const nextViewer = await PptxViewer.open(buffer, surface, {\n styleRoot: resolvePptxStyleRoot(surface, context),\n fitMode: 'contain',\n zoomPercent,\n workerUrl,\n workerType: presentationOptions === null || presentationOptions === void 0 ? void 0 : presentationOptions.workerType,\n zipLimits: RECOMMENDED_ZIP_LIMITS,\n lazySlides: true,\n lazyMedia: true,\n listOptions: {\n windowed: true,\n initialSlides: 3,\n batchSize: 4,\n overscanViewport: 1.5,\n },\n presentationLabels: {\n exit: t('presentation.slideshow.exit'),\n hint: t('presentation.slideshow.hint'),\n },\n onPresentationChange: state => {\n if (!disposed) {\n if (state.active) {\n activePptxShells.set(documentRef, shell);\n }\n syncUi();\n }\n },\n onSlideRendered: () => notifyProgressiveReady(),\n onRenderComplete: () => {\n var _a;\n if (disposed || ((_a = context === null || context === void 0 ? void 0 : context.signal) === null || _a === void 0 ? void 0 : _a.aborted)) {\n return;\n }\n state = 'ready';\n notifyProgressiveReady();\n zoomPercent = getCurrentZoomPercent();\n syncUi();\n zoomEmitter.emit();\n resolveCompletion();\n },\n onSlideError: (_index, error) => {\n console.warn('PPTX slide render warning:', error);\n },\n onError: error => {\n var _a;\n if (disposed || ((_a = context === null || context === void 0 ? void 0 : context.signal) === null || _a === void 0 ? void 0 : _a.aborted)) {\n return;\n }\n rejectCompletion(reportPptxFailure(error));\n },\n });\n if (disposed || ((_e = context === null || context === void 0 ? void 0 : context.signal) === null || _e === void 0 ? void 0 : _e.aborted)) {\n nextViewer.destroy();\n throw ((_f = context === null || context === void 0 ? void 0 : context.signal) === null || _f === void 0 ? void 0 : _f.reason) || new DOMException('PPTX rendering aborted.', 'AbortError');\n }\n viewer = nextViewer;\n await completion;\n if (disposed || ((_g = context === null || context === void 0 ? void 0 : context.signal) === null || _g === void 0 ? void 0 : _g.aborted)) {\n throw ((_h = context === null || context === void 0 ? void 0 : context.signal) === null || _h === void 0 ? void 0 : _h.reason) || new DOMException('PPTX rendering aborted.', 'AbortError');\n }\n zoomPercent = getCurrentZoomPercent();\n registerExportAdapter();\n syncUi();\n zoomEmitter.emit();\n }\n catch (error) {\n if (disposed || ((_j = context === null || context === void 0 ? void 0 : context.signal) === null || _j === void 0 ? void 0 : _j.aborted)) {\n throw error;\n }\n viewer === null || viewer === void 0 ? void 0 : viewer.destroy();\n viewer = null;\n throw reportPptxFailure(error);\n }\n finally {\n (_k = context === null || context === void 0 ? void 0 : context.signal) === null || _k === void 0 ? void 0 : _k.removeEventListener('abort', abort);\n }\n };\n const cleanup = () => {\n var _a, _b;\n if (disposed) {\n return;\n }\n disposed = true;\n documentRef.removeEventListener('keydown', handleShortcut);\n documentRef.removeEventListener('pointerdown', deactivateShell);\n documentRef.removeEventListener('focusin', deactivateShell);\n shell.removeEventListener('pointerdown', activateShell);\n shell.removeEventListener('focusin', activateShell);\n if (activePptxShells.get(documentRef) === shell) {\n activePptxShells.delete(documentRef);\n }\n (_a = context === null || context === void 0 ? void 0 : context.registerExportAdapter) === null || _a === void 0 ? void 0 : _a.call(context, null);\n (_b = context === null || context === void 0 ? void 0 : context.registerThumbnailAdapter) === null || _b === void 0 ? void 0 : _b.call(context, null);\n unregisterFileViewerZoomProvider(shell);\n viewer === null || viewer === void 0 ? void 0 : viewer.destroy();\n viewer = null;\n target.replaceChildren();\n };\n try {\n await openPresentation();\n }\n catch (error) {\n cleanup();\n throw error;\n }\n return {\n $el: shell,\n unmount: cleanup,\n };\n}\nconst presentationDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'office-presentation');\nif (!presentationDefinition) {\n throw new Error('@file-viewer/renderer-pptx could not locate the core PPTX renderer definition.');\n}\nexport const presentationRendererDefinition = presentationDefinition;\nexport const renderFileViewerPresentation = renderPptx;\nexport const pptxRenderer = {\n id: 'file-viewer-renderer-presentation-pptx',\n label: 'Flyfish File Viewer PPTX renderer',\n definitions: [presentationRendererDefinition],\n handlers: [\n {\n rendererId: presentationRendererDefinition.id,\n handler: renderFileViewerPresentation,\n },\n ],\n};\n","import { decodeFileViewerTextBuffer, resolveFileViewerTextEncoding } from '@file-viewer/core';\nconst ole = [0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1];\nconst wordMlNamespace = 'http://schemas.microsoft.com/office/word/2003/wordml';\nconst xmlNameStart = String.raw `A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF` +\n String.raw `\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F` +\n String.raw `\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}`;\nconst xmlName = String.raw `[${xmlNameStart}][${xmlNameStart}.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040-]*`;\nconst wordMlRoot = new RegExp(String.raw `^<(?:(${xmlName}):)?wordDocument(?=[\\t\\n\\r />])`, 'u');\nfunction documentStart(text) {\n let index = text.charCodeAt(0) === 0xfeff ? 1 : 0;\n while (index <= text.length) {\n while (index < text.length && /\\s/.test(text[index]))\n index++;\n const closing = text.startsWith('<?', index) ? '?>' : text.startsWith('<!--', index) ? '-->' : null;\n if (!closing)\n return text.slice(index);\n const end = text.indexOf(closing, index + 2);\n if (end < 0)\n return null;\n index = end + closing.length;\n }\n return '';\n}\nfunction decodeNamespace(value) {\n const named = { amp: '&', lt: '<', gt: '>', quot: '\"', apos: \"'\" };\n return value.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, (entity, name) => {\n if (!name.startsWith('#'))\n return named[name];\n const point = name.startsWith('#x') ? Number.parseInt(name.slice(2), 16) : Number.parseInt(name.slice(1), 10);\n return point > 0 && point <= 0x10ffff && !(point >= 0xd800 && point <= 0xdfff)\n ? String.fromCodePoint(point) : entity;\n });\n}\nfunction isWordMlRoot(start) {\n var _a;\n const root = wordMlRoot.exec(start);\n if (!root)\n return false;\n const attributes = new Map();\n const attributeName = new RegExp(String.raw `(?:${xmlName}:)?${xmlName}`, 'uy');\n let index = root[0].length;\n while (index < start.length) {\n const beforeSpace = index;\n while (index < start.length && /[\\t\\n\\r ]/.test(start[index]))\n index++;\n if (start[index] === '>' || start.startsWith('/>', index)) {\n return decodeNamespace(attributes.get(root[1] ? 'xmlns:' + root[1] : 'xmlns') || '') === wordMlNamespace;\n }\n if (index === beforeSpace)\n return false;\n attributeName.lastIndex = index;\n const name = (_a = attributeName.exec(start)) === null || _a === void 0 ? void 0 : _a[0];\n if (!name || attributes.has(name))\n return false;\n index = attributeName.lastIndex;\n while (index < start.length && /[\\t\\n\\r ]/.test(start[index]))\n index++;\n if (start[index++] !== '=')\n return false;\n while (index < start.length && /[\\t\\n\\r ]/.test(start[index]))\n index++;\n const quote = start[index++];\n if (quote !== '\"' && quote !== \"'\")\n return false;\n const end = start.indexOf(quote, index);\n if (end < 0 || start.slice(index, end).includes('<'))\n return false;\n attributes.set(name, start.slice(index, end));\n index = end + 1;\n }\n return false;\n}\nfunction hasWordMlDocument(sample) {\n var _a, _b;\n const bytes = new Uint8Array(sample);\n const utf16le = (bytes[0] === 0xff && bytes[1] === 0xfe) || (bytes[0] === 0x3c && bytes[1] === 0);\n const utf16be = (bytes[0] === 0xfe && bytes[1] === 0xff) || (bytes[0] === 0 && bytes[1] === 0x3c);\n const utf8Bom = bytes[0] === 0xef && bytes[1] === 0xbb && bytes[2] === 0xbf;\n const detected = utf16le ? 'utf-16le' : utf16be ? 'utf-16be' : utf8Bom ? 'utf-8' : null;\n try {\n const prefix = new TextDecoder(detected || 'windows-1252').decode(bytes.subarray(0, 1024));\n const declaration = (_a = /^<\\?xml\\s[^?]*\\?>/.exec(prefix)) === null || _a === void 0 ? void 0 : _a[0];\n const declared = declaration && ((_b = /\\sencoding\\s*=\\s*([\"'])([A-Za-z][A-Za-z0-9._-]*)\\1/.exec(declaration)) === null || _b === void 0 ? void 0 : _b[2]);\n const start = documentStart(new TextDecoder(detected || declared || 'utf-8').decode(bytes));\n return start !== null && isWordMlRoot(start);\n }\n catch {\n return false;\n }\n}\nexport function resolveWordContainer(buffer) {\n const bytes = new Uint8Array(buffer);\n if (bytes[0] === 0x50 && bytes[1] === 0x4b)\n return 'openxml';\n if (!bytes.length || ole.every((byte, index) => bytes[index] === byte))\n return 'binary';\n const sample = buffer.slice(0, Math.min(buffer.byteLength, 65536));\n const encoding = resolveFileViewerTextEncoding(new Uint8Array(sample)).encoding;\n if (encoding.startsWith('utf-16') && buffer.byteLength % 2 !== 0)\n return 'binary';\n if (hasWordMlDocument(sample))\n return 'wordml';\n let text;\n try {\n text = decodeFileViewerTextBuffer(sample).text;\n }\n catch {\n return 'binary';\n }\n const start = documentStart(text);\n if (start === null)\n return 'binary';\n if (/^(?:<!doctype\\s+html\\b|<html\\b|<head\\b|<body\\b)/i.test(start))\n return 'html';\n if (/^[<{]/.test(start) || /[\\u0000-\\u0008\\u000b\\u000e-\\u001f\\u007f]/.test(text))\n return 'binary';\n const replacements = (text.match(/\\uFFFD/g) || []).length;\n return replacements > Math.max(1, text.length * 0.01) ? 'binary' : 'text';\n}\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nexport { getFileViewerRtfLoader, registerFileViewerRtfLoader, } from './optionalCapabilities.js';\nexport { createFileViewerRtfHyperlinkContainer, isSafeFileViewerRtfHyperlink, sanitizeFileViewerRtfElement, sanitizeFileViewerRtfHtml, sanitizeFileViewerRtfHyperlink, } from './sanitizeRtf.js';\nconst wordRendererIds = [\n 'office-word-openxml',\n 'office-word-binary',\n 'open-document',\n];\nconst wordDefinitions = DEFAULT_RENDERER_DEFINITIONS.filter(definition => wordRendererIds.includes(definition.id));\nif (wordDefinitions.length !== wordRendererIds.length) {\n throw new Error('@file-viewer/renderer-word could not locate the shared Word renderer definitions.');\n}\nexport const wordRendererDefinitions = wordDefinitions;\nexport const renderFileViewerWordDocx = (buffer, target, _type, context) => renderFileViewerWordDoc(buffer, target, _type, context);\nexport { resolveWordContainer as resolveFileViewerWordContainer } from './wordContainer.js';\nimport { resolveWordContainer } from './wordContainer.js';\nexport const renderFileViewerWordDoc = (buffer, target, _type, context) => {\n const container = resolveWordContainer(buffer);\n if (container === 'html' || container === 'text') {\n return import('./wordText.js').then(({ renderWordText }) => renderWordText(buffer, target, container, context));\n }\n if (container === 'wordml') {\n return Promise.all([import('./wordMl.js'), import('./wordDocx.js')])\n .then(async ([{ convertWordMlToDocx }, { default: renderWordDocx }]) => renderWordDocx(await convertWordMlToDocx(buffer, target), target, context));\n }\n return container === 'openxml'\n ? import('./wordDocx.js').then(({ default: renderWordDocx }) => renderWordDocx(buffer, target, context))\n : import('./wordDoc.js').then(({ default: renderWordDoc }) => renderWordDoc(buffer, target, context));\n};\nexport const renderFileViewerOpenDocument = (buffer, target, type, context) => import('./openDocument.js').then(({ default: renderOpenDocument }) => renderOpenDocument(buffer, target, type, context));\nexport const wordRenderer = {\n id: 'file-viewer-renderer-word',\n label: 'Flyfish File Viewer Word renderer',\n definitions: wordRendererDefinitions,\n handlers: [\n {\n rendererId: 'office-word-openxml',\n handler: renderFileViewerWordDocx,\n },\n {\n rendererId: 'office-word-binary',\n handler: renderFileViewerWordDoc,\n },\n {\n rendererId: 'open-document',\n handler: renderFileViewerOpenDocument,\n },\n ],\n};\nexport default wordRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst spreadsheetDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'spreadsheet-openxml');\nconst dbfDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'spreadsheet-dbf');\nif (!spreadsheetDefinition || !dbfDefinition) {\n throw new Error('@file-viewer/renderer-spreadsheet could not locate the shared Spreadsheet format definition.');\n}\nexport const spreadsheetRendererDefinition = spreadsheetDefinition;\nexport const dbfRendererDefinition = dbfDefinition;\nexport const renderFileViewerSpreadsheet = (buffer, target, type, context) => import('./spreadsheet.js').then(({ default: renderSpreadsheet }) => renderSpreadsheet(buffer, target, type, context));\nexport const spreadsheetRenderer = {\n id: 'file-viewer-renderer-spreadsheet',\n label: 'Flyfish File Viewer Spreadsheet renderer',\n definitions: [spreadsheetRendererDefinition, dbfRendererDefinition],\n handlers: [spreadsheetRendererDefinition, dbfRendererDefinition].map(definition => ({\n rendererId: definition.id,\n handler: renderFileViewerSpreadsheet,\n })),\n};\nexport default spreadsheetRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst ofdDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'ofd');\nif (!ofdDefinition) {\n throw new Error('@file-viewer/renderer-ofd could not locate the core OFD renderer definition.');\n}\nexport const ofdRendererDefinition = ofdDefinition;\nexport const renderFileViewerOfd = (buffer, target, _type, context) => import('./ofd.js').then(({ default: renderOfd }) => renderOfd(buffer, target, context));\nexport const ofdRenderer = {\n id: 'file-viewer-renderer-ofd',\n label: 'Flyfish File Viewer OFD renderer',\n definitions: [ofdRendererDefinition],\n handlers: [{\n rendererId: ofdRendererDefinition.id,\n handler: renderFileViewerOfd,\n }],\n};\nexport default ofdRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst emailDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'email');\nif (!emailDefinition) {\n throw new Error('@file-viewer/renderer-email could not locate the shared email format definition.');\n}\nexport const emailRendererDefinition = emailDefinition;\nexport const renderFileViewerEmail = (buffer, target, type, context) => import('./email.js').then(({ default: renderEmail }) => renderEmail(buffer, target, type, context));\nexport const emailRenderer = {\n id: 'file-viewer-renderer-email',\n label: 'Flyfish File Viewer email renderer',\n definitions: [emailRendererDefinition],\n handlers: [{\n rendererId: emailRendererDefinition.id,\n handler: renderFileViewerEmail,\n }],\n};\nexport default emailRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst mindmapDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'mindmap');\nif (!mindmapDefinition) {\n throw new Error('@file-viewer/renderer-mindmap could not locate the core mind map renderer definition.');\n}\nexport const mindmapRendererDefinition = mindmapDefinition;\nexport const renderFileViewerMindMap = (buffer, target, type, context) => import('./xmind.js').then(({ default: renderXMind }) => renderXMind(buffer, target, type, context));\nexport const mindmapRenderer = {\n id: 'file-viewer-renderer-mindmap',\n label: 'Flyfish File Viewer mind map renderer',\n definitions: [mindmapRendererDefinition],\n handlers: [{\n rendererId: mindmapRendererDefinition.id,\n handler: renderFileViewerMindMap,\n }],\n};\nexport default mindmapRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nexport { disableFileViewerDrawioOfficialViewer, enableFileViewerDrawioOfficialViewer, isFileViewerDrawioOfficialViewerEnabled, } from './optionalCapabilities.js';\nconst drawingDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'drawing');\nif (!drawingDefinition) {\n throw new Error('@file-viewer/renderer-drawing could not locate the core drawing renderer definition.');\n}\nexport const drawingRendererDefinition = drawingDefinition;\nexport const renderFileViewerDrawing = (buffer, target, type, context) => import('./drawing.js').then(({ default: renderDrawing }) => renderDrawing(buffer, target, type, context));\nexport const drawingRenderer = {\n id: 'file-viewer-renderer-drawing',\n label: 'Flyfish File Viewer drawing renderer',\n definitions: [drawingRendererDefinition],\n handlers: [{\n rendererId: drawingRendererDefinition.id,\n handler: renderFileViewerDrawing,\n }],\n};\nexport default drawingRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst dataDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'data-asset');\nif (!dataDefinition) {\n throw new Error('@file-viewer/renderer-data could not locate the shared data asset renderer definition.');\n}\nexport const dataRendererDefinition = dataDefinition;\nexport const renderFileViewerData = (buffer, target, type, context) => import('./data.js').then(({ default: renderDataAsset }) => renderDataAsset(buffer, target, type, context));\nexport const dataRenderer = {\n id: 'file-viewer-renderer-data',\n label: 'Flyfish File Viewer data asset renderer',\n definitions: [dataRendererDefinition],\n handlers: [{\n rendererId: dataRendererDefinition.id,\n handler: renderFileViewerData,\n }],\n};\nexport default dataRenderer;\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nconst geoDefinition = DEFAULT_RENDERER_DEFINITIONS.find(definition => definition.id === 'geo');\nif (!geoDefinition) {\n throw new Error('@file-viewer/renderer-geo could not locate the core geospatial renderer definition.');\n}\nexport const geoRendererDefinition = geoDefinition;\nexport const renderFileViewerGeo = (buffer, target, type, context) => import('./geo.js').then(({ default: renderGeo }) => renderGeo(buffer, target, type, context));\nexport const geoRenderer = {\n id: 'file-viewer-renderer-geo',\n label: 'Flyfish File Viewer geospatial renderer',\n definitions: [geoRendererDefinition],\n handlers: [{\n rendererId: geoRendererDefinition.id,\n handler: renderFileViewerGeo,\n }],\n};\nexport default geoRenderer;\n","const key = Symbol.for('@file-viewer/renderer-text/xml-profiles');\nconst registry = globalThis;\nexport function registerXmlProfiles(loader) {\n var _a;\n const registrations = (_a = registry[key]) !== null && _a !== void 0 ? _a : (registry[key] = new Map());\n const token = Symbol();\n registrations.set(token, loader);\n return () => { registrations.delete(token); };\n}\nexport function getXmlProfilesLoader() {\n var _a;\n return (_a = registry[key]) === null || _a === void 0 ? void 0 : _a.values().next().value;\n}\n","import { DEFAULT_RENDERER_DEFINITIONS, } from '@file-viewer/core';\nimport { getXmlProfilesLoader } from './xmlRegistration.js';\nexport { getFileViewerMermaidLoader, getFileViewerDiffToHtml, getFileViewerPakoLoader, registerFileViewerDiffToHtml, registerFileViewerMermaidLoader, registerFileViewerPakoLoader, } from './optionalCapabilities.js';\nexport { sanitizeFileViewerRichHtml } from './sanitizeHtml.js';\nconst textRendererIds = ['code', 'markdown'];\nconst textDefinitions = DEFAULT_RENDERER_DEFINITIONS.filter(definition => textRendererIds.includes(definition.id));\nif (textDefinitions.length !== textRendererIds.length) {\n throw new Error('@file-viewer/renderer-text could not locate the shared code/markdown format definitions.');\n}\nexport const textRendererDefinitions = textDefinitions;\nexport const renderFileViewerCode = async (buffer, target, type, context) => {\n var _a, _b, _c, _d, _e;\n if ((type === null || type === void 0 ? void 0 : type.trim().toLowerCase()) === 'lrc') {\n const { default: renderLrc } = await import('./lrc.js');\n return renderLrc(buffer, target, type, context);\n }\n if (/^(?:html|htm)$/i.test(type || '')) {\n const { default: renderHtml } = await import('./html.js');\n return renderHtml(buffer, target, type, context);\n }\n if ((type === null || type === void 0 ? void 0 : type.trim().toLowerCase()) === 'xml' && ((_a = context === null || context === void 0 ? void 0 : context.options) === null || _a === void 0 ? void 0 : _a.xml)) {\n const loader = getXmlProfilesLoader();\n if (loader) {\n const { default: renderXml } = await loader();\n return renderXml(buffer, target, context);\n }\n const message = 'Enable @file-viewer/renderer-text/xml-profiles and deploy its self-hosted runtime assets.';\n try {\n (_c = (_b = context.options.xml).onDiagnostic) === null || _c === void 0 ? void 0 : _c.call(_b, { code: 'capability-unavailable', message });\n }\n catch { }\n try {\n (_e = (_d = context.options).onDiagnostic) === null || _e === void 0 ? void 0 : _e.call(_d, { code: 'xml-profile-capability-unavailable', level: 'warning', message });\n }\n catch { }\n }\n const { default: renderCode } = await import('./code.js');\n return renderCode(buffer, target, type, context);\n};\nexport const renderFileViewerMarkdown = (buffer, target, type, context) => import('./largeText.js').then(async ({ default: renderLargeText, shouldVirtualizeMarkdownBuffer }) => {\n if (shouldVirtualizeMarkdownBuffer(buffer, context)) {\n return renderLargeText(buffer, target, type || 'md', context);\n }\n const { default: renderMarkdown } = await import('./markdown.js');\n return renderMarkdown(buffer, target, context);\n});\nexport const textRenderer = {\n id: 'file-viewer-renderer-text',\n label: 'Flyfish File Viewer text renderer',\n definitions: textRendererDefinitions,\n handlers: [\n {\n rendererId: 'code',\n handler: renderFileViewerCode,\n },\n {\n rendererId: 'markdown',\n handler: renderFileViewerMarkdown,\n },\n ],\n};\nexport default textRenderer;\n","import { useEffect, useMemo, useState } from 'react';\nimport FileViewer from '@file-viewer/react';\nimport { archiveRenderer } from '@file-viewer/renderer-archive';\nimport { usePreviewOptions } from '../preview-context';\nimport archiveWorkerUrl from 'libarchive.js/dist/worker-bundle.js?url';\nimport archiveWasmUrl from 'libarchive.js/dist/libarchive.wasm?url';\nimport { configuredFileViewerRenderers } from 'virtual:file-viewer-renderers';\nimport { useThemeController } from \"@/providers/theme-controller\";\nimport { isSpreadsheetFile, resolveFileMimeType } from \"@/utils/file-utils\";\nimport type { CSSProperties } from 'react';\nimport type { ViewerOptions } from '@file-viewer/react';\ninterface FileViewerPreviewPanelProps {\n readonly file: File;\n readonly style?: CSSProperties;\n}\nconst fileViewerRenderers = [\n ...(Array.isArray(configuredFileViewerRenderers)\n ? configuredFileViewerRenderers\n : [configuredFileViewerRenderers]),\n archiveRenderer,\n] satisfies NonNullable<ViewerOptions['renderers']>;\n/** 文件浏览器端只读预览,不依赖外部预览或转换服务。 */\nexport default function FileViewerPreviewPanel({ file, style }: FileViewerPreviewPanelProps) {\n const { isDark } = useThemeController();\n const preview = usePreviewOptions();\n const legacy = preview?.legacyPpt;\n const missingLegacy = /\\.(?:ppt|pot|pps)$/i.test(file.name) && !legacy;\n const [downloadUrl, setDownloadUrl] = useState('');\n useEffect(() => {\n if (!missingLegacy) return;\n const url = URL.createObjectURL(file); setDownloadUrl(url);\n return () => URL.revokeObjectURL(url);\n }, [file, missingLegacy]);\n // 表格渲染器的暗色主题不会调和文件内嵌样式(如导出文件的黑字、浅灰表头填充),\n // 会出现黑字压暗底 / 亮字压浅底的不可读组合,因此表格预览恒用亮色渲染\n const isSpreadsheet = isSpreadsheetFile(resolveFileMimeType(file.type, file.name));\n const useDarkTheme = isDark && !isSpreadsheet;\n const options = useMemo<ViewerOptions>(() => ({\n theme: useDarkTheme ? 'dark' : 'light',\n locale: 'zh-CN',\n styleIsolation: 'shadow',\n rendererMode: 'replace',\n autoRenderers: false,\n // FileViewer creates a div rendering target; upstream's default generic\n // uses HTMLElement and otherwise rejects correctly typed div renderers.\n renderers: [...fileViewerRenderers, ...(Array.isArray(legacy?.renderers) ? legacy.renderers : legacy?.renderers ? [legacy.renderers] : [])] as ViewerOptions['renderers'],\n presentation: legacy?.presentation,\n ui: { density: 'compact' },\n toolbar: {\n position: 'top-center',\n download: false,\n print: true,\n exportHtml: false,\n zoom: true,\n search: true,\n theme: false,\n },\n docx: {\n worker: true,\n visualPagination: true,\n },\n spreadsheet: {\n worker: 'auto',\n textEncoding: 'auto',\n resizableColumns: true,\n resizableRows: true,\n },\n archive: {\n workerUrl: archiveWorkerUrl,\n wasmUrl: archiveWasmUrl,\n },\n drawing: {\n // vite-plugin 的 copyAssets 不分发 vendor/drawio/viewer-static.min.js(仅 full 包带),\n // 走官方 diagrams.net viewer 只会 404 后等超时再回退,这里直接使用内置离线 SVG 渲染。\n preferOfficial: false,\n },\n geo: {\n // 默认即离线空底图;显式声明避免将来默认值变化后悄悄请求外部瓦片服务\n // (OpenFreeMap / OSM / 天地图 均需显式配置才会启用)。\n basemap: 'offline',\n },\n }), [useDarkTheme, legacy]);\n if (missingLegacy) return <div role=\"status\">此文件使用旧版 PowerPoint 格式,当前站点未启用预览。您可以<a href={downloadUrl || undefined} download={file.name}>下载文件</a>。</div>;\n return (<div style={{ width: '100%', height: '100%', minWidth: 0, minHeight: 0, ...style }}>\n <FileViewer file={file} options={options} style={{ width: '100%', height: '100%' }}/>\n </div>);\n}\n"],"file":"FileViewerPreviewPanel-BMZ7FdKV.js"}
|