{"version":3,"sources":["jsdelivr-header.js","/npm/react-native-pdf-painter@0.10.1/lib/module/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,oBAEO,yBAA2B,aAAgB,4CAC3C,OAAS,WAAY,UAAW,oBAAqB,OAAQ,aAAgB,eAC3E,SAAU,WAAY,iBAAkB,KAAM,eAAkB,6BACzD,aAAc,UAAa,0BAClC,KAAK,4CACP,MAAM,cAAgB,EAC3B,UACA,YAEoB,KAAK,iBAAkB,CACzC,QAAS,EACT,SAAuB,KAAK,KAAM,CAChC,MAAO,CAAC,OAAO,cAAe,GAAU,OAAO,gCAI9C,MAAM,kBAAiC,YAAW,EACvD,gBACA,cACA,QACA,0BACA,cACA,eACA,kBACA,+BACA,qBACA,yBACG,GACF,KACD,MAAM,EAAY,OAAO,OAClB,EAAkB,GAAuB,SAAS,IAClD,EAAW,GAAgB,SAAS,GAC3C,WAAU,KACH,EAAU,SAGf,SAAS,QAAQ,EAAU,QAAS,GAAe,EAAiB,GACnE,CAAC,EAAkB,IAYtB,oBAAoB,GAAK,KAAM,CAC7B,eAAA,CAAgB,GACT,EAAU,SAGf,SAAS,gBAAgB,EAAU,QAAS,EAC9C,EACA,eAAA,CAAgB,GACT,EAAU,SAGf,SAAS,gBAAgB,EAAU,QAAS,EAC9C,EACA,IAAA,GACO,EAAU,SAGf,SAAS,KAAK,EAAU,QAC1B,EACA,IAAA,GACO,EAAU,SAGf,SAAS,KAAK,EAAU,QAC1B,EACA,KAAA,GACO,EAAU,SAGf,SAAS,MAAM,EAAU,QAC3B,EACA,OAAA,CAAQ,GACD,EAAU,SAGf,SAAS,QAAQ,EAAU,QAAS,EACtC,MAEF,MAAM,EAAa,GAA2B,cACxC,EAAsB,GAAuB,WACnD,OAAoB,MAAM,KAAM,CAC9B,MAAO,CAAC,OAAO,UAAW,GAC1B,SAAU,CAAc,KAAK,wBAAyB,IACjD,EACH,MAAO,CAAC,OAAO,OAAQ,GACvB,IAAK,EACL,cAAe,SAAS,OAAO,CAC7B,IAAK,GAAiB,CACpB,KAAM,OACN,MAAO,UACP,KAAM,GAER,QAAS,IAEX,YAjEoB,IACtB,EAAa,EAAM,YAAY,WAC/B,IAAc,EAAM,YAAY,UAAU,EAgExC,aA9DqB,IACvB,EAAoB,EAAM,YAAY,aACtC,IAAe,EAAM,YAAY,YAAY,EA6D3C,mBA3D2B,IAC7B,IAAqB,EAAM,YAAY,KAAO,OAAS,WAAW,KA2D7D,EAAM,gBAAkB,EAAM,gBAA+B,KAAK,KAAM,CAC3E,MAAO,CAAC,OAAO,uBAAwB,GACvC,SAAuB,KAAK,EAAqB,CAC/C,YAAY,EACZ,sBAAuB,OAAO,gBAC9B,SAAU,MAAM,KAAK,MAAM,GAAW,QAAQ,KAAI,GAAkB,KAAK,EAAY,CACnF,QAAS,GAAe,KAAsB,EAC9C,QAAS,KACH,GAAe,EACjB,EAAa,GAGf,EAAoB,EAAE,EAExB,MAAO,GACN,WAGP,IAEJ,MAAM,OAAS,WAAW,OAAO,CAC/B,UAAW,CACT,KAAM,GAER,uBAAwB,CACtB,SAAU,WACV,OAAQ,EACR,MAAO,OACP,QAAS,OACT,cAAe,MACf,eAAgB,UAElB,gBAAiB,CACf,SAAU,EACV,eAAgB,UAElB,cAAe,CACb,MAAO,GACP,OAAQ,GACR,aAAc,GACd,gBAAiB,OACjB,iBAAkB,GAEpB,oBAAqB,CACnB,gBAAiB,YAEnB,OAAQ,CACN,KAAM","file":"/npm/react-native-pdf-painter@0.10.1/lib/module/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-native-pdf-painter@0.10.1/lib/module/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nimport NativePdfAnnotationView, { Commands } from './PdfAnnotationViewNativeComponent';\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { Platform, StyleSheet, TouchableOpacity, View, ScrollView } from 'react-native';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport * from './PdfAnnotationViewNativeComponent';\nexport const PageIndicator = ({\n  onClick,\n  active\n}) => {\n  return /*#__PURE__*/_jsx(TouchableOpacity, {\n    onPress: onClick,\n    children: /*#__PURE__*/_jsx(View, {\n      style: [styles.pageIndicator, active && styles.pageIndicatorActive]\n    })\n  });\n};\nexport const PdfAnnotationView = /*#__PURE__*/forwardRef(({\n  brushSettings,\n  currentPage,\n  style,\n  renderPageIndicatorItem,\n  onPageCount,\n  onPageChange,\n  containerStyles,\n  pageIndicatorContainerStyles,\n  onDocumentFinished,\n  scrollViewComponent,\n  ...props\n}, ref) => {\n  const nativeRef = useRef(null);\n  const [stateCurrentPage, setStateCurrentPage] = useState(0);\n  const [pageCount, setPageCount] = useState(0);\n  useEffect(() => {\n    if (!nativeRef.current) {\n      return;\n    }\n    Commands.setPage(nativeRef.current, currentPage ?? stateCurrentPage);\n  }, [stateCurrentPage, currentPage]);\n  const handlePageCount = event => {\n    setPageCount(event.nativeEvent.pageCount);\n    onPageCount?.(event.nativeEvent.pageCount);\n  };\n  const handlePageChange = event => {\n    setStateCurrentPage(event.nativeEvent.currentPage);\n    onPageChange?.(event.nativeEvent.currentPage);\n  };\n  const handleDocumentFinished = event => {\n    onDocumentFinished?.(event.nativeEvent.next ? 'next' : 'previous');\n  };\n  useImperativeHandle(ref, () => ({\n    saveAnnotations(file) {\n      if (!nativeRef.current) {\n        return;\n      }\n      Commands.saveAnnotations(nativeRef.current, file);\n    },\n    loadAnnotations(file) {\n      if (!nativeRef.current) {\n        return;\n      }\n      Commands.loadAnnotations(nativeRef.current, file);\n    },\n    undo() {\n      if (!nativeRef.current) {\n        return;\n      }\n      Commands.undo(nativeRef.current);\n    },\n    redo() {\n      if (!nativeRef.current) {\n        return;\n      }\n      Commands.redo(nativeRef.current);\n    },\n    clear() {\n      if (!nativeRef.current) {\n        return;\n      }\n      Commands.clear(nativeRef.current);\n    },\n    setPage(page) {\n      if (!nativeRef.current) {\n        return;\n      }\n      Commands.setPage(nativeRef.current, page);\n    }\n  }));\n  const RenderItem = renderPageIndicatorItem ?? PageIndicator;\n  const ScrollViewComponent = scrollViewComponent ?? ScrollView;\n  return /*#__PURE__*/_jsxs(View, {\n    style: [styles.container, containerStyles],\n    children: [/*#__PURE__*/_jsx(NativePdfAnnotationView, {\n      ...props,\n      style: [styles.viewer, style],\n      ref: nativeRef,\n      brushSettings: Platform.select({\n        ios: brushSettings ?? {\n          type: 'none',\n          color: '#000000',\n          size: 0\n        },\n        default: brushSettings\n      }),\n      onPageCount: handlePageCount,\n      onPageChange: handlePageChange,\n      onDocumentFinished: handleDocumentFinished\n    }), !props.thumbnailMode && !props.hidePagination && /*#__PURE__*/_jsx(View, {\n      style: [styles.pageIndicatorContainer, pageIndicatorContainerStyles],\n      children: /*#__PURE__*/_jsx(ScrollViewComponent, {\n        horizontal: true,\n        contentContainerStyle: styles.scrollContainer,\n        children: Array.from(Array(pageCount).keys()).map(i => /*#__PURE__*/_jsx(RenderItem, {\n          active: (currentPage ?? stateCurrentPage) === i,\n          onClick: () => {\n            if (currentPage && onPageChange) {\n              onPageChange(i);\n              return;\n            }\n            setStateCurrentPage(i);\n          },\n          index: i\n        }, i))\n      })\n    })]\n  });\n});\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1\n  },\n  pageIndicatorContainer: {\n    position: 'absolute',\n    bottom: 5,\n    width: '100%',\n    display: 'flex',\n    flexDirection: 'row',\n    justifyContent: 'center'\n  },\n  scrollContainer: {\n    flexGrow: 1,\n    justifyContent: 'center'\n  },\n  pageIndicator: {\n    width: 20,\n    height: 20,\n    borderRadius: 10,\n    backgroundColor: 'grey',\n    marginHorizontal: 5\n  },\n  pageIndicatorActive: {\n    backgroundColor: 'darkgrey'\n  },\n  viewer: {\n    flex: 1\n  }\n});\n"]}