\n

{\n sendWidgetMessage({ type: 'widgetCollapse' });\n setLocalIsOpen(false); // Optimistic update\n }}\n />\n
\n
\n );\n}\n\nexport default ThirdPartyBookingWidget;\n","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport * as React from 'react';\nimport Alert from '.';\nvar ErrorBoundary = /*#__PURE__*/function (_React$Component) {\n _inherits(ErrorBoundary, _React$Component);\n var _super = _createSuper(ErrorBoundary);\n function ErrorBoundary() {\n var _this;\n _classCallCheck(this, ErrorBoundary);\n _this = _super.apply(this, arguments);\n _this.state = {\n error: undefined,\n info: {\n componentStack: ''\n }\n };\n return _this;\n }\n _createClass(ErrorBoundary, [{\n key: \"componentDidCatch\",\n value: function componentDidCatch(error, info) {\n this.setState({\n error: error,\n info: info\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n message = _this$props.message,\n description = _this$props.description,\n children = _this$props.children;\n var _this$state = this.state,\n error = _this$state.error,\n info = _this$state.info;\n var componentStack = info && info.componentStack ? info.componentStack : null;\n var errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;\n var errorDescription = typeof description === 'undefined' ? componentStack : description;\n if (error) {\n return /*#__PURE__*/React.createElement(Alert, {\n type: \"error\",\n message: errorMessage,\n description: /*#__PURE__*/React.createElement(\"pre\", null, errorDescription)\n });\n }\n return children;\n }\n }]);\n return ErrorBoundary;\n}(React.Component);\nexport default ErrorBoundary;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CheckCircleFilled from \"@ant-design/icons/es/icons/CheckCircleFilled\";\nimport CheckCircleOutlined from \"@ant-design/icons/es/icons/CheckCircleOutlined\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport CloseCircleOutlined from \"@ant-design/icons/es/icons/CloseCircleOutlined\";\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport ExclamationCircleFilled from \"@ant-design/icons/es/icons/ExclamationCircleFilled\";\nimport ExclamationCircleOutlined from \"@ant-design/icons/es/icons/ExclamationCircleOutlined\";\nimport InfoCircleFilled from \"@ant-design/icons/es/icons/InfoCircleFilled\";\nimport InfoCircleOutlined from \"@ant-design/icons/es/icons/InfoCircleOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport getDataOrAriaProps from '../_util/getDataOrAriaProps';\nimport { replaceElement } from '../_util/reactNode';\nimport ErrorBoundary from './ErrorBoundary';\nvar iconMapFilled = {\n success: CheckCircleFilled,\n info: InfoCircleFilled,\n error: CloseCircleFilled,\n warning: ExclamationCircleFilled\n};\nvar iconMapOutlined = {\n success: CheckCircleOutlined,\n info: InfoCircleOutlined,\n error: CloseCircleOutlined,\n warning: ExclamationCircleOutlined\n};\nvar IconNode = function IconNode(props) {\n var description = props.description,\n icon = props.icon,\n prefixCls = props.prefixCls,\n type = props.type;\n var iconType = (description ? iconMapOutlined : iconMapFilled)[type] || null;\n if (icon) {\n return replaceElement(icon, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-icon\")\n }, icon), function () {\n return {\n className: classNames(\"\".concat(prefixCls, \"-icon\"), _defineProperty({}, icon.props.className, icon.props.className))\n };\n });\n }\n return /*#__PURE__*/React.createElement(iconType, {\n className: \"\".concat(prefixCls, \"-icon\")\n });\n};\nvar CloseIcon = function CloseIcon(props) {\n var isClosable = props.isClosable,\n closeText = props.closeText,\n prefixCls = props.prefixCls,\n closeIcon = props.closeIcon,\n handleClose = props.handleClose;\n return isClosable ? /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n onClick: handleClose,\n className: \"\".concat(prefixCls, \"-close-icon\"),\n tabIndex: 0\n }, closeText ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-close-text\")\n }, closeText) : closeIcon) : null;\n};\nvar Alert = function Alert(_a) {\n var _classNames2;\n var description = _a.description,\n customizePrefixCls = _a.prefixCls,\n message = _a.message,\n banner = _a.banner,\n _a$className = _a.className,\n className = _a$className === void 0 ? '' : _a$className,\n style = _a.style,\n onMouseEnter = _a.onMouseEnter,\n onMouseLeave = _a.onMouseLeave,\n onClick = _a.onClick,\n afterClose = _a.afterClose,\n showIcon = _a.showIcon,\n closable = _a.closable,\n closeText = _a.closeText,\n _a$closeIcon = _a.closeIcon,\n closeIcon = _a$closeIcon === void 0 ? /*#__PURE__*/React.createElement(CloseOutlined, null) : _a$closeIcon,\n action = _a.action,\n props = __rest(_a, [\"description\", \"prefixCls\", \"message\", \"banner\", \"className\", \"style\", \"onMouseEnter\", \"onMouseLeave\", \"onClick\", \"afterClose\", \"showIcon\", \"closable\", \"closeText\", \"closeIcon\", \"action\"]);\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n closed = _React$useState2[0],\n setClosed = _React$useState2[1];\n var ref = React.useRef();\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n var prefixCls = getPrefixCls('alert', customizePrefixCls);\n var handleClose = function handleClose(e) {\n var _a;\n setClosed(true);\n (_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);\n };\n var getType = function getType() {\n var type = props.type;\n if (type !== undefined) {\n return type;\n }\n // banner 模式默认为警告\n return banner ? 'warning' : 'info';\n };\n // closeable when closeText is assigned\n var isClosable = closeText ? true : closable;\n var type = getType();\n // banner 模式默认有 Icon\n var isShowIcon = banner && showIcon === undefined ? true : showIcon;\n var alertCls = classNames(prefixCls, \"\".concat(prefixCls, \"-\").concat(type), (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-with-description\"), !!description), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-no-icon\"), !isShowIcon), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-banner\"), !!banner), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames2), className);\n var dataOrAriaProps = getDataOrAriaProps(props);\n return /*#__PURE__*/React.createElement(CSSMotion, {\n visible: !closed,\n motionName: \"\".concat(prefixCls, \"-motion\"),\n motionAppear: false,\n motionEnter: false,\n onLeaveStart: function onLeaveStart(node) {\n return {\n maxHeight: node.offsetHeight\n };\n },\n onLeaveEnd: afterClose\n }, function (_ref) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref,\n \"data-show\": !closed,\n className: classNames(alertCls, motionClassName),\n style: _extends(_extends({}, style), motionStyle),\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onClick: onClick,\n role: \"alert\"\n }, dataOrAriaProps), isShowIcon ? /*#__PURE__*/React.createElement(IconNode, {\n description: description,\n icon: props.icon,\n prefixCls: prefixCls,\n type: type\n }) : null, /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-content\")\n }, message ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-message\")\n }, message) : null, description ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-description\")\n }, description) : null), action ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-action\")\n }, action) : null, /*#__PURE__*/React.createElement(CloseIcon, {\n isClosable: !!isClosable,\n closeText: closeText,\n prefixCls: prefixCls,\n closeIcon: closeIcon,\n handleClose: handleClose\n }));\n });\n};\nAlert.ErrorBoundary = ErrorBoundary;\nexport default Alert;"],"names":["submitRatingAndCommentTogether","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref","api","extraOptions","executeBaseQuery","fishery_id","score","comments","requests","results","error","wrap","_context","prev","next","push","url","method","data","rating","comment","Promise","all","sent","every","res","status","abrupt","result","find","stop","_x","_x2","_x3","_x4","apply","arguments","extendedApiSlice","apiSlice","addTagTypes","injectEndpoints","endpoints","builder","getFishery","query","fisheryPublicId","params","id","providesTags","type","getMembershipPlan","_ref3","useDefaultErrorHandler","getUserMemberships","_ref4","getMembershipsPaymentLink","_ref5","plan_id","requestMembership","mutation","invalidatesTags","_ref6","markFisheryAsFavourite","_ref7","submitReview","queryFn","_ref8","getAllQuickFacts","concat","_toConsumableArray","map","_ref9","getAllFacilities","_ref10","useGetFisheryQuery","useGetMembershipPlanQuery","useGetUserMembershipsQuery","useMarkFisheryAsFavouriteMutation","useSubmitReviewMutation","useGetAllQuickFactsQuery","useGetAllFacilitiesQuery","useRequestMembershipMutation","useGetMembershipsPaymentLinkQuery","props","_jsxs","_objectSpread","xmlns","width","height","fill","viewBox","children","_jsx","x","y","stroke","strokeWidth","rx","d","_ref$toLowerCase","_searchParams$get","searchParams","URLSearchParams","useLocation","search","fisheryId","useParams","isOpen","get","toLowerCase","call","_useState","useState","_useState2","_slicedToArray","localIsOpen","setLocalIsOpen","useEffect","publicIdSelector","useMemo","createSelector","fisheryData","public_id","_useGetFisheryQuery","selectFromResult","loading","isLoading","errorLoadingFisheryId","isError","WidgetLoading","Alert","message","description","className","src","widgetClose","alt","role","onClick","sendWidgetMessage","UserBookings","String","inWidget","StartBookingButton","ErrorBoundary","_React$Component","_inherits","_super","_createSuper","_this","_classCallCheck","this","state","undefined","info","componentStack","_createClass","key","value","setState","_this$props","_this$state","errorMessage","toString","errorDescription","React","__rest","s","e","t","p","Object","prototype","hasOwnProperty","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","iconMapFilled","success","CheckCircleFilled","InfoCircleFilled","CloseCircleFilled","warning","ExclamationCircleFilled","iconMapOutlined","CheckCircleOutlined","InfoCircleOutlined","CloseCircleOutlined","ExclamationCircleOutlined","IconNode","icon","prefixCls","iconType","replaceElement","classNames","_defineProperty","CloseIcon","isClosable","closeText","closeIcon","handleClose","tabIndex","_a","_classNames2","customizePrefixCls","banner","_a$className","style","onMouseEnter","onMouseLeave","afterClose","showIcon","closable","_a$closeIcon","CloseOutlined","action","_React$useState","_React$useState2","closed","setClosed","ref","_React$useContext","ConfigContext","getPrefixCls","direction","onClose","getType","isShowIcon","alertCls","dataOrAriaProps","getDataOrAriaProps","CSSMotion","visible","motionName","motionAppear","motionEnter","onLeaveStart","node","maxHeight","offsetHeight","onLeaveEnd","motionClassName","motionStyle","_extends"],"sourceRoot":""}