* Support webfinger requests for the live account. Closes https://github.com/owncast/owncast/issues/1193 * Support for actor requests. Returns response for live actor. Closes https://github.com/owncast/owncast/issues/1203 * Handle follow and unfollow requests. Closes https://github.com/owncast/owncast/issues/1191 and https://github.com/owncast/owncast/issues/1205 and https://github.com/owncast/owncast/issues/1206 and https://github.com/owncast/owncast/issues/1194 * Add basic support for sending out text activities. For https://github.com/owncast/owncast/issues/1192 * Some error handling and passing of dynamic local account names. * Add hardcoded example image attachment to test post * Centralize the map of accounts and inboxes * No longer disable the preview generator based on YP toggle * Send a federated message to followers when stream starts. For https://github.com/owncast/owncast/issues/1192 * Placeholder for attaching tags * Add image description * Save and get to outbox persistence. Return using outbox endpoint for actor * Pass payloads to be handled through the gochan * Handle undo follow requests explitly, not all undo requests * Add API for manually sending simple federated messages. Closes #1215 * Verify inbox requests. Closes #1321 * Add route to fetch a single AP object by ID. For #1329 * Add responses to fediverse nodeinfo requests * Set and get federation config values for admin * Handle host-meta requests * Do not send out message if disabled. Use saved go live message. * Require AP-compatible content types for AP-related requests * Rename ap models to apmodels for clarity * Change how content type matching takes place. * io -> ioutil * Add stub delete activity callback * Handle likes and announces to surface engagement in chat. Part of #1229 * Append url to go live posts * Do not require specific content types for nodeinfo requests * Add follow engagement chat message via AP * add owncast user-agent to requests * Set note visibility to public (for now) * Fix saving/fetching a single object * Add support for x-nodeinfo2 responses * Point to the dev admin branch for ap * Bundle in dev admin for testing * Add error logging * Add AP middleware back * Point to the new external compatible logo endpoint * Clean up more AP logging to help testing * Tweak go live text and link hashtags * Fix bug in fetching init time * Send update actor activities when server details/profile is updated * Add federation config overview to web client config * Add additional actor properties * Make the AP middleware checking more flexible when looking at types * First pass at remote fediverse follow flow. For #1371 * Added a basic AP actor followers endpoint * WIP client followers API * Add profile-page reference to webfinger response * Add aliases to webfinger response * Fix content-type returned to be expected activitypub+json * First pass at followers api * Point at local dev copy of go-fed/activity * Add custom toot Hashtag objects to posts * Store additional user details to followers table * Fix AP followers endpoint. Closes #1204 * Add owncast hashtag as an invisible tag to go live posts * Reject AP requests when it is disabled * Add actor util for generating full account user from person object * Verify inbox requests before performing any other work * Accept actor update requests * Fix linter errors in federation branch * Migrate AP SQL to sqlc for type safe queries * Use the @unclearParadigm REST parameter helper * Fix verifying post ID on AP engagement * WIP privacy/request approval * Style the remote follow modal * First pass at a followers list component w/ mock data. #1370 * Revert "Use the @unclearParadigm REST parameter helper" This reverts commit c8af8a413f6f53e7d1a15a7d823ff28be2db3c23. * Fix get followers API * Add support for requiring approval. Closes https://github.com/owncast/owncast/issues/1208 * Handle Applications as Actors partly for PeerTube support * add temp todo list * check route on load, this might change later * style followers * account for just 1 tab case * Remove mock data. Allow showing follow button even when there are no external actions defined * Point to actual followers API * Support fallback img for follower views * Remove duplicate verification. Add some additional verbose logging * Bundle dev admin * Add type to host-meta webfinger template response * Tweak remote follow modal content * WIP federation followers refactor * Do not send pointer to middleware * Update admin * Add setting for toggling displaying fediverse engagement. Closes #1404 * Add in-development admin * Do not enable cors on admin followers api * Add db migration for updating messages table * Enable empty string go live messages to disable * Remove debug messages * Rework some ActivityPub handling. Create new Actor->Person handling. Create new Actor->Service handling. Add engagement handlers to send chat events and store event objects. Store inbound activities to new ap_inbound_activities table. * Support federated engagement events. Store them in the messages table and surface them via chat events. * Support federated event engatement in the chat * Tweak web UI followers handling * Point go.mod at remote fork instead of local * Update admin * Merged in develop. Couple fixes * Update dev admin * Update fedi engagement posts. - Fix incorrect action text. - Add action icons. * Set public as to instead of cc for ap msg * Updated styling for federated actions in chat * Add support for blocking federated domains. Closes #1209 * Force checking of https in verify step * Update dev admin * Return user scopes in chat history api. Closes #1586 * Update dev admin * Add AP outbound request worker pool. Closes #1571 * Disable (temporarily?) owncast tag on AP posts * Consolidate creating activity+notes in outbound AP messages * Add inbox worker pool. Closes #1570 * Update dev admin bundle * Clean up some logs * Re-enable inbound verfication * Save full IRI to outbox instead of path * Reject if full IRI is not found in outbox * Use full ActivityPub user account in chat event * Fix and expand follower APIs - Add missing IDs to AP follower endpoints - Split AP follower endpoints into initial request and pages. - Support pagination in AP requests. * Include IRI in error message * Hide chat toggle when chat is hidden. Closes #1606 * Updates to followers pagination * Set default go live message * Remove log * indirect -> direct import * Updates for inbound federated event handling. - Keep track of existing events and reject duplicates. - Change what is sent to chat for surfing federated engagement. - Keep track if outbound events are automated "go live" events or not. * Update chat federated engagement. * Update dev admin. * Move from being a person to a bot (service). Closes #1619 * Only set server init date if not already set * Only save notes to outbox able * Rework private-mode followers/approvals * API for returning a list of federated actions for #1573 * Fix too-small follower cells and jumpy tabs. Closes #1616 and closes #1516 * Fix shortcuts getting fired on inputs. Fixes #1489 and #1201 * Add spinner, autoclose + other fixes to follow modal. Fixes #1593 * Fix fetching a single object by IRI * SendFederationMessage -> SendFederatedMessage * Autolink and create tag objects from manual posts. Closes #1620 * Update dev admin bundle * Handle engagement from non-automated/live posts * Reject federated engagement actions if they do not match a local post * Update dev admin bundle * A bunch of cleanup * Fix unused assignments and logic * Remove unused function * Add content warning and sentive content flag if stream is NSFW. Closes #1624 * Disable fetching objects by IRI when in private mode. Closes #1623 * Update the error message of the remote follow dialog. closes #1622 * Update dev admin * Fix NREs throwing in test content * Fix query that wasn't properly filtering out hidden messages * Test against user being disabled instead of message visibility * Fix automated test NRE * Update comment * Adjust federated engagement chat views. Closes #1617 * Add additional index to users table * Add support for removing followers/requests. Closes #1630 * Reject federated actions from blocked actors. #1631 * Use fallback avatar if it fails to load. Closes #1635 * Fix styling of follower list. Closes #1636 * Add basic blurb stating they should follow the server. Closes #1641 * Update dev admin * Set default go live message in migration. Closes #1642 * Reset the messages table on 0.0.11 schema migration * Fix js error with moderation actions. Closes #1621 * Add a bit more clarification on follow modal. Closes #1599 * Remove todos * Split out actor and domain blocking checks * Check for errors on default values being set * Clean up actor rejection due to being blocked * Update dev admin * Add colon to error to make it easier to read * Remove markdown rendering of go live message. Reorganize text. Remove content warning. Closes #1645 * Break out the sort+render messages logic so it can be fired on visibility change. Closes #1643 * Do not send profile updates if federation is disabled * Save follow references to inbound activities table * Update dev admin * Add blocked actor test * Remove the overloaded term of Follow from social links * Fix test running in memory only * Remove "just" in engagement messags * Replace star with heart for like action. * Update dev admin * Explicitly set cc as public * Remove overly using the stream name in fediverse engagement messages * Some federated/follow UI tweaks * Remove explicit cc and bcc as they are not required * Explicitly set the audience * Remove extra margin * Add Join Fediverse button to follow modal. Closes #1651 * Do not allow multiple follows to send multiple events. Closes #1650 * Give events a min height * Do not allow old posts to be liked/shared. Closes #1652 * Remove value from log message * Alert followers on private mode toggle * Ignore clicks to follow button if disabled * Remove underline from action buttons * Add moderator icon to join message * Update admin * Post-merge remove unused var * Remove pointing at feature branch Co-authored-by: Ginger Wong <omqmail@gmail.com>
1 line
34 KiB
JavaScript
Vendored
1 line
34 KiB
JavaScript
Vendored
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[556],{48689:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(1413),r=n(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},i=n(42135),s=function(e,t){return r.createElement(i.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:t,icon:o}))};s.displayName="DeleteOutlined";var l=r.forwardRef(s)},6226:function(e,t,n){n.d(t,{Z:function(){return p}});var a=n(4942),r=n(87462),o=n(71002),i=n(67294),s=n(94184),l=n.n(s),u=n(99134),c=n(59844),d=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};var f=["xs","sm","md","lg","xl","xxl"],v=i.forwardRef((function(e,t){var n,s=i.useContext(c.E_),v=s.getPrefixCls,p=s.direction,h=i.useContext(u.Z),m=h.gutter,g=h.wrap,y=h.supportFlexGap,b=e.prefixCls,Z=e.span,k=e.order,x=e.offset,C=e.push,M=e.pull,w=e.className,S=e.children,E=e.flex,O=e.style,P=d(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),N=v("col",b),T={};f.forEach((function(t){var n,i={},s=e[t];"number"===typeof s?i.span=s:"object"===(0,o.Z)(s)&&(i=s||{}),delete P[t],T=(0,r.Z)((0,r.Z)({},T),(n={},(0,a.Z)(n,"".concat(N,"-").concat(t,"-").concat(i.span),void 0!==i.span),(0,a.Z)(n,"".concat(N,"-").concat(t,"-order-").concat(i.order),i.order||0===i.order),(0,a.Z)(n,"".concat(N,"-").concat(t,"-offset-").concat(i.offset),i.offset||0===i.offset),(0,a.Z)(n,"".concat(N,"-").concat(t,"-push-").concat(i.push),i.push||0===i.push),(0,a.Z)(n,"".concat(N,"-").concat(t,"-pull-").concat(i.pull),i.pull||0===i.pull),(0,a.Z)(n,"".concat(N,"-rtl"),"rtl"===p),n))}));var B=l()(N,(n={},(0,a.Z)(n,"".concat(N,"-").concat(Z),void 0!==Z),(0,a.Z)(n,"".concat(N,"-order-").concat(k),k),(0,a.Z)(n,"".concat(N,"-offset-").concat(x),x),(0,a.Z)(n,"".concat(N,"-push-").concat(C),C),(0,a.Z)(n,"".concat(N,"-pull-").concat(M),M),n),w,T),L={};if(m&&m[0]>0){var R=m[0]/2;L.paddingLeft=R,L.paddingRight=R}if(m&&m[1]>0&&!y){var D=m[1]/2;L.paddingTop=D,L.paddingBottom=D}return E&&(L.flex=function(e){return"number"===typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(E),!1!==g||L.minWidth||(L.minWidth=0)),i.createElement("div",(0,r.Z)({},P,{style:(0,r.Z)((0,r.Z)({},L),O),className:B,ref:t}),S)}));v.displayName="Col";var p=v},99134:function(e,t,n){var a=(0,n(67294).createContext)({});t.Z=a},25968:function(e,t,n){n.d(t,{Z:function(){return g}});var a=n(87462),r=n(4942),o=n(71002),i=n(97685),s=n(67294),l=n(94184),u=n.n(l),c=n(59844),d=n(99134),f=n(93355),v=n(24308),p=n(98082),h=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n},m=((0,f.b)("top","middle","bottom","stretch"),(0,f.b)("start","end","center","space-around","space-between"),s.forwardRef((function(e,t){var n,l=e.prefixCls,f=e.justify,m=e.align,g=e.className,y=e.style,b=e.children,Z=e.gutter,k=void 0===Z?0:Z,x=e.wrap,C=h(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),M=s.useContext(c.E_),w=M.getPrefixCls,S=M.direction,E=s.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),O=(0,i.Z)(E,2),P=O[0],N=O[1],T=(0,p.Z)(),B=s.useRef(k);s.useEffect((function(){var e=v.ZP.subscribe((function(e){var t=B.current||0;(!Array.isArray(t)&&"object"===(0,o.Z)(t)||Array.isArray(t)&&("object"===(0,o.Z)(t[0])||"object"===(0,o.Z)(t[1])))&&N(e)}));return function(){return v.ZP.unsubscribe(e)}}),[]);var L=w("row",l),R=function(){var e=[0,0];return(Array.isArray(k)?k:[k,0]).forEach((function(t,n){if("object"===(0,o.Z)(t))for(var a=0;a<v.c4.length;a++){var r=v.c4[a];if(P[r]&&void 0!==t[r]){e[n]=t[r];break}}else e[n]=t||0})),e}(),D=u()(L,(n={},(0,r.Z)(n,"".concat(L,"-no-wrap"),!1===x),(0,r.Z)(n,"".concat(L,"-").concat(f),f),(0,r.Z)(n,"".concat(L,"-").concat(m),m),(0,r.Z)(n,"".concat(L,"-rtl"),"rtl"===S),n),g),F={},V=R[0]>0?R[0]/-2:void 0,H=R[1]>0?R[1]/-2:void 0;if(V&&(F.marginLeft=V,F.marginRight=V),T){var j=(0,i.Z)(R,2);F.rowGap=j[1]}else H&&(F.marginTop=H,F.marginBottom=H);var I=s.useMemo((function(){return{gutter:R,wrap:x,supportFlexGap:T}}),[R,x,T]);return s.createElement(d.Z.Provider,{value:I},s.createElement("div",(0,a.Z)({},C,{className:D,style:(0,a.Z)((0,a.Z)({},F),y),ref:t}),b))})));m.displayName="Row";var g=m},48761:function(e,t,n){n.d(t,{Z:function(){return ie}});var a=n(71002),r=n(4942),o=n(87462),i=n(97685),s=n(67294),l=n(1413),u=n(15671),c=n(43144),d=n(60136),f=n(3289),v=n(80334),p=function(e){var t,n,a=e.className,o=e.included,i=e.vertical,u=e.style,c=e.length,d=e.offset,f=e.reverse;c<0&&(f=!f,c=Math.abs(c),d=100-d);var v=i?(t={},(0,r.Z)(t,f?"top":"bottom","".concat(d,"%")),(0,r.Z)(t,f?"bottom":"top","auto"),(0,r.Z)(t,"height","".concat(c,"%")),t):(n={},(0,r.Z)(n,f?"right":"left","".concat(d,"%")),(0,r.Z)(n,f?"left":"right","auto"),(0,r.Z)(n,"width","".concat(c,"%")),n),p=(0,l.Z)((0,l.Z)({},u),v);return o?s.createElement("div",{className:a,style:p}):null},h=n(91),m=n(74902),g=n(61120);function y(e,t,n){return(y="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var a=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=(0,g.Z)(e)););return e}(e,t);if(a){var r=Object.getOwnPropertyDescriptor(a,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}var b=n(64019),Z=n(94184),k=n.n(Z),x=function(e){var t=e.prefixCls,n=e.vertical,a=e.reverse,o=e.marks,i=e.dots,u=e.step,c=e.included,d=e.lowerBound,f=e.upperBound,p=e.max,h=e.min,m=e.dotStyle,g=e.activeDotStyle,y=p-h,b=function(e,t,n,a,r,o){(0,v.ZP)(!n||a>0,"`Slider[step]` should be a positive number in order to make Slider[dots] work.");var i=Object.keys(t).map(parseFloat).sort((function(e,t){return e-t}));if(n&&a)for(var s=r;s<=o;s+=a)-1===i.indexOf(s)&&i.push(s);return i}(0,o,i,u,h,p).map((function(e){var o,i="".concat(Math.abs(e-h)/y*100,"%"),u=!c&&e===f||c&&e<=f&&e>=d,v=n?(0,l.Z)((0,l.Z)({},m),{},(0,r.Z)({},a?"top":"bottom",i)):(0,l.Z)((0,l.Z)({},m),{},(0,r.Z)({},a?"right":"left",i));u&&(v=(0,l.Z)((0,l.Z)({},v),g));var p=k()((o={},(0,r.Z)(o,"".concat(t,"-dot"),!0),(0,r.Z)(o,"".concat(t,"-dot-active"),u),(0,r.Z)(o,"".concat(t,"-dot-reverse"),a),o));return s.createElement("span",{className:p,style:v,key:e})}));return s.createElement("div",{className:"".concat(t,"-step")},b)},C=function(e){var t=e.className,n=e.vertical,o=e.reverse,i=e.marks,u=e.included,c=e.upperBound,d=e.lowerBound,f=e.max,v=e.min,p=e.onClickLabel,h=Object.keys(i),m=f-v,g=h.map(parseFloat).sort((function(e,t){return e-t})).map((function(e){var f,h=i[e],g="object"===(0,a.Z)(h)&&!s.isValidElement(h),y=g?h.label:h;if(!y&&0!==y)return null;var b=!u&&e===c||u&&e<=c&&e>=d,Z=k()((f={},(0,r.Z)(f,"".concat(t,"-text"),!0),(0,r.Z)(f,"".concat(t,"-text-active"),b),f)),x=(0,r.Z)({marginBottom:"-50%"},o?"top":"bottom","".concat((e-v)/m*100,"%")),C=(0,r.Z)({transform:"translateX(".concat(o?"50%":"-50%",")"),msTransform:"translateX(".concat(o?"50%":"-50%",")")},o?"right":"left","".concat((e-v)/m*100,"%")),M=n?x:C,w=g?(0,l.Z)((0,l.Z)({},M),h.style):M;return s.createElement("span",{className:Z,style:w,key:e,onMouseDown:function(t){return p(t,e)},onTouchStart:function(t){return p(t,e)}},y)}));return s.createElement("div",{className:t},g)},M=["prefixCls","vertical","reverse","offset","style","disabled","min","max","value","tabIndex","ariaLabel","ariaLabelledBy","ariaValueTextFormatter"],w=function(e){(0,d.Z)(n,e);var t=(0,f.Z)(n);function n(){var e;(0,u.Z)(this,n);for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={clickFocused:!1},e.onMouseUpListener=void 0,e.handle=void 0,e.setHandleRef=function(t){e.handle=t},e.handleMouseUp=function(){document.activeElement===e.handle&&e.setClickFocus(!0)},e.handleMouseDown=function(t){t.preventDefault(),e.focus()},e.handleBlur=function(){e.setClickFocus(!1)},e.handleKeyDown=function(){e.setClickFocus(!1)},e}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){this.onMouseUpListener=(0,b.Z)(document,"mouseup",this.handleMouseUp)}},{key:"componentWillUnmount",value:function(){this.onMouseUpListener&&this.onMouseUpListener.remove()}},{key:"setClickFocus",value:function(e){this.setState({clickFocused:e})}},{key:"clickFocus",value:function(){this.setClickFocus(!0),this.focus()}},{key:"focus",value:function(){this.handle.focus()}},{key:"blur",value:function(){this.handle.blur()}},{key:"render",value:function(){var e,t,n,a=this.props,i=a.prefixCls,u=a.vertical,c=a.reverse,d=a.offset,f=a.style,v=a.disabled,p=a.min,m=a.max,g=a.value,y=a.tabIndex,b=a.ariaLabel,Z=a.ariaLabelledBy,x=a.ariaValueTextFormatter,C=(0,h.Z)(a,M),w=k()(this.props.className,(0,r.Z)({},"".concat(i,"-handle-click-focused"),this.state.clickFocused)),S=u?(e={},(0,r.Z)(e,c?"top":"bottom","".concat(d,"%")),(0,r.Z)(e,c?"bottom":"top","auto"),(0,r.Z)(e,"transform",c?null:"translateY(+50%)"),e):(t={},(0,r.Z)(t,c?"right":"left","".concat(d,"%")),(0,r.Z)(t,c?"left":"right","auto"),(0,r.Z)(t,"transform","translateX(".concat(c?"+":"-","50%)")),t),E=(0,l.Z)((0,l.Z)({},f),S),O=y||0;return(v||null===y)&&(O=null),x&&(n=x(g)),s.createElement("div",(0,o.Z)({ref:this.setHandleRef,tabIndex:O},C,{className:w,style:E,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,role:"slider","aria-valuemin":p,"aria-valuemax":m,"aria-valuenow":g,"aria-disabled":!!v,"aria-label":b,"aria-labelledby":Z,"aria-valuetext":n}))}}]),n}(s.Component),S=n(73935),E=n(15105);function O(e,t){try{return Object.keys(t).some((function(n){return e.target===(0,S.findDOMNode)(t[n])}))}catch(n){return!1}}function P(e,t){var n=t.min,a=t.max;return e<n||e>a}function N(e){return e.touches.length>1||"touchend"===e.type.toLowerCase()&&e.touches.length>0}function T(e,t){var n=t.marks,a=t.step,r=t.min,o=t.max,i=Object.keys(n).map(parseFloat);if(null!==a){var s=Math.pow(10,B(a)),l=Math.floor((o*s-r*s)/(a*s)),u=Math.min((e-r)/a,l),c=Math.round(u)*a+r;i.push(c)}var d=i.map((function(t){return Math.abs(e-t)}));return i[d.indexOf(Math.min.apply(Math,(0,m.Z)(d)))]}function B(e){var t=e.toString(),n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n}function L(e,t){return e?t.clientY:t.pageX}function R(e,t){return e?t.touches[0].clientY:t.touches[0].pageX}function D(e,t){var n=t.getBoundingClientRect();return e?n.top+.5*n.height:window.pageXOffset+n.left+.5*n.width}function F(e,t){var n=t.max,a=t.min;return e<=a?a:e>=n?n:e}function V(e,t){var n=t.step,a=isFinite(T(e,t))?T(e,t):0;return null===n?a:parseFloat(a.toFixed(B(n)))}function H(e){e.stopPropagation(),e.preventDefault()}function j(e,t,n){var a="increase",r="decrease",o=a;switch(e.keyCode){case E.Z.UP:o=t&&n?r:a;break;case E.Z.RIGHT:o=!t&&n?r:a;break;case E.Z.DOWN:o=t&&n?a:r;break;case E.Z.LEFT:o=!t&&n?a:r;break;case E.Z.END:return function(e,t){return t.max};case E.Z.HOME:return function(e,t){return t.min};case E.Z.PAGE_UP:return function(e,t){return e+2*t.step};case E.Z.PAGE_DOWN:return function(e,t){return e-2*t.step};default:return}return function(e,t){return function(e,t,n){var a={increase:function(e,t){return e+t},decrease:function(e,t){return e-t}},r=a[e](Object.keys(n.marks).indexOf(JSON.stringify(t)),1),o=Object.keys(n.marks)[r];return n.step?a[e](t,n.step):Object.keys(n.marks).length&&n.marks[o]?n.marks[o]:t}(o,e,t)}}var I=["index"];function U(){}function A(e){var t,n;return n=t=function(e){(0,d.Z)(n,e);var t=(0,f.Z)(n);function n(e){var a;(0,u.Z)(this,n),(a=t.call(this,e)).handlesRefs=void 0,a.sliderRef=void 0,a.document=void 0,a.dragOffset=void 0,a.prevMovedHandleIndex=void 0,a.onTouchMoveListener=void 0,a.onTouchUpListener=void 0,a.onMouseMoveListener=void 0,a.onMouseUpListener=void 0,a.dragTrack=void 0,a.startBounds=void 0,a.onDown=function(e,t){var n=t,r=a.props,o=r.draggableTrack,i=r.vertical,s=a.state.bounds,l=o&&a.positionGetValue&&a.positionGetValue(n)||[],u=O(e,a.handlesRefs);if(a.dragTrack=o&&s.length>=2&&!u&&!l.map((function(e,t){var n=!!t||e>=s[t];return t===l.length-1?e<=s[t]:n})).some((function(e){return!e})),a.dragTrack)a.dragOffset=n,a.startBounds=(0,m.Z)(s);else{if(u){var c=D(i,e.target);a.dragOffset=n-c,n=c}else a.dragOffset=0;a.onStart(n)}},a.onMouseDown=function(e){if(0===e.button){a.removeDocumentEvents();var t=L(a.props.vertical,e);a.onDown(e,t),a.addDocumentMouseEvents()}},a.onTouchStart=function(e){if(!N(e)){var t=R(a.props.vertical,e);a.onDown(e,t),a.addDocumentTouchEvents(),H(e)}},a.onFocus=function(e){var t=a.props,n=t.onFocus,r=t.vertical;if(O(e,a.handlesRefs)&&!a.dragTrack){var o=D(r,e.target);a.dragOffset=0,a.onStart(o),H(e),n&&n(e)}},a.onBlur=function(e){var t=a.props.onBlur;a.dragTrack||a.onEnd(),t&&t(e)},a.onMouseUp=function(){a.handlesRefs[a.prevMovedHandleIndex]&&a.handlesRefs[a.prevMovedHandleIndex].clickFocus()},a.onMouseMove=function(e){if(a.sliderRef){var t=L(a.props.vertical,e);a.onMove(e,t-a.dragOffset,a.dragTrack,a.startBounds)}else a.onEnd()},a.onTouchMove=function(e){if(!N(e)&&a.sliderRef){var t=R(a.props.vertical,e);a.onMove(e,t-a.dragOffset,a.dragTrack,a.startBounds)}else a.onEnd()},a.onKeyDown=function(e){a.sliderRef&&O(e,a.handlesRefs)&&a.onKeyboard(e)},a.onClickMarkLabel=function(e,t){e.stopPropagation(),a.onChange({value:t}),a.setState({value:t},(function(){return a.onEnd(!0)}))},a.saveSlider=function(e){a.sliderRef=e};var r=e.step,o=e.max,i=e.min,s=!isFinite(o-i)||(o-i)%r===0;return(0,v.ZP)(!r||Math.floor(r)!==r||s,"Slider[max] - Slider[min] (".concat(o-i,") should be a multiple of Slider[step] (").concat(r,")")),a.handlesRefs={},a}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){this.document=this.sliderRef&&this.sliderRef.ownerDocument;var e=this.props,t=e.autoFocus,n=e.disabled;t&&!n&&this.focus()}},{key:"componentWillUnmount",value:function(){y((0,g.Z)(n.prototype),"componentWillUnmount",this)&&y((0,g.Z)(n.prototype),"componentWillUnmount",this).call(this),this.removeDocumentEvents()}},{key:"getSliderStart",value:function(){var e=this.sliderRef,t=this.props,n=t.vertical,a=t.reverse,r=e.getBoundingClientRect();return n?a?r.bottom:r.top:window.pageXOffset+(a?r.right:r.left)}},{key:"getSliderLength",value:function(){var e=this.sliderRef;if(!e)return 0;var t=e.getBoundingClientRect();return this.props.vertical?t.height:t.width}},{key:"addDocumentTouchEvents",value:function(){this.onTouchMoveListener=(0,b.Z)(this.document,"touchmove",this.onTouchMove),this.onTouchUpListener=(0,b.Z)(this.document,"touchend",this.onEnd)}},{key:"addDocumentMouseEvents",value:function(){this.onMouseMoveListener=(0,b.Z)(this.document,"mousemove",this.onMouseMove),this.onMouseUpListener=(0,b.Z)(this.document,"mouseup",this.onEnd)}},{key:"removeDocumentEvents",value:function(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()}},{key:"focus",value:function(){var e;this.props.disabled||null===(e=this.handlesRefs[0])||void 0===e||e.focus()}},{key:"blur",value:function(){var e=this;this.props.disabled||Object.keys(this.handlesRefs).forEach((function(t){var n,a;null===(n=e.handlesRefs[t])||void 0===n||null===(a=n.blur)||void 0===a||a.call(n)}))}},{key:"calcValue",value:function(e){var t=this.props,n=t.vertical,a=t.min,r=t.max,o=Math.abs(Math.max(e,0)/this.getSliderLength());return n?(1-o)*(r-a)+a:o*(r-a)+a}},{key:"calcValueByPos",value:function(e){var t=(this.props.reverse?-1:1)*(e-this.getSliderStart());return this.trimAlignValue(this.calcValue(t))}},{key:"calcOffset",value:function(e){var t=this.props,n=t.min,a=(e-n)/(t.max-n);return Math.max(0,100*a)}},{key:"saveHandle",value:function(e,t){this.handlesRefs[e]=t}},{key:"render",value:function(){var e,t=this.props,a=t.prefixCls,o=t.className,i=t.marks,u=t.dots,c=t.step,d=t.included,f=t.disabled,v=t.vertical,p=t.reverse,h=t.min,m=t.max,b=t.children,Z=t.maximumTrackStyle,M=t.style,w=t.railStyle,S=t.dotStyle,E=t.activeDotStyle,O=y((0,g.Z)(n.prototype),"render",this).call(this),P=O.tracks,N=O.handles,T=k()(a,(e={},(0,r.Z)(e,"".concat(a,"-with-marks"),Object.keys(i).length),(0,r.Z)(e,"".concat(a,"-disabled"),f),(0,r.Z)(e,"".concat(a,"-vertical"),v),(0,r.Z)(e,o,o),e));return s.createElement("div",{ref:this.saveSlider,className:T,onTouchStart:f?U:this.onTouchStart,onMouseDown:f?U:this.onMouseDown,onMouseUp:f?U:this.onMouseUp,onKeyDown:f?U:this.onKeyDown,onFocus:f?U:this.onFocus,onBlur:f?U:this.onBlur,style:M},s.createElement("div",{className:"".concat(a,"-rail"),style:(0,l.Z)((0,l.Z)({},Z),w)}),P,s.createElement(x,{prefixCls:a,vertical:v,reverse:p,marks:i,dots:u,step:c,included:d,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:m,min:h,dotStyle:S,activeDotStyle:E}),N,s.createElement(C,{className:"".concat(a,"-mark"),onClickLabel:f?U:this.onClickMarkLabel,vertical:v,marks:i,included:d,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:m,min:h,reverse:p}),b)}}]),n}(e),t.displayName="ComponentEnhancer(".concat(e.displayName,")"),t.defaultProps=(0,l.Z)((0,l.Z)({},e.defaultProps),{},{prefixCls:"rc-slider",className:"",min:0,max:100,step:1,marks:{},handle:function(e){var t=e.index,n=(0,h.Z)(e,I);return delete n.dragging,null===n.value?null:s.createElement(w,(0,o.Z)({},n,{key:t}))},onBeforeChange:U,onChange:U,onAfterChange:U,included:!0,disabled:!1,dots:!1,vertical:!1,reverse:!1,trackStyle:[{}],handleStyle:[{}],railStyle:{},dotStyle:{},activeDotStyle:{}}),n}var G=A(function(e){(0,d.Z)(n,e);var t=(0,f.Z)(n);function n(e){var a;(0,u.Z)(this,n),(a=t.call(this,e)).positionGetValue=function(e){return[]},a.startValue=void 0,a.startPosition=void 0,a.prevMovedHandleIndex=void 0,a.onEnd=function(e){var t=a.state.dragging;a.removeDocumentEvents(),(t||e)&&a.props.onAfterChange(a.getValue()),a.setState({dragging:!1})};var r=void 0!==e.defaultValue?e.defaultValue:e.min,o=void 0!==e.value?e.value:r;return a.state={value:a.trimAlignValue(o),dragging:!1},(0,v.ZP)(!("minimumTrackStyle"in e),"minimumTrackStyle will be deprecated, please use trackStyle instead."),(0,v.ZP)(!("maximumTrackStyle"in e),"maximumTrackStyle will be deprecated, please use railStyle instead."),a}return(0,c.Z)(n,[{key:"calcValueByPos",value:function(e){return 0}},{key:"calcOffset",value:function(e){return 0}},{key:"saveHandle",value:function(e,t){}},{key:"removeDocumentEvents",value:function(){}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,a=n.min,r=n.max,o=n.value,i=n.onChange;if("min"in this.props||"max"in this.props){var s=void 0!==o?o:t.value,l=this.trimAlignValue(s,this.props);l!==t.value&&(this.setState({value:l}),a===e.min&&r===e.max||!P(s,this.props)||i(l))}}},{key:"onChange",value:function(e){var t=this.props,n=!("value"in t),a=e.value>this.props.max?(0,l.Z)((0,l.Z)({},e),{},{value:this.props.max}):e;n&&this.setState(a);var r=a.value;t.onChange(r)}},{key:"onStart",value:function(e){this.setState({dragging:!0});var t=this.props,n=this.getValue();t.onBeforeChange(n);var a=this.calcValueByPos(e);this.startValue=a,this.startPosition=e,a!==n&&(this.prevMovedHandleIndex=0,this.onChange({value:a}))}},{key:"onMove",value:function(e,t){H(e);var n=this.state.value,a=this.calcValueByPos(t);a!==n&&this.onChange({value:a})}},{key:"onKeyboard",value:function(e){var t=this.props,n=t.reverse,a=j(e,t.vertical,n);if(a){H(e);var r=this.state.value,o=a(r,this.props),i=this.trimAlignValue(o);if(i===r)return;this.onChange({value:i}),this.props.onAfterChange(i),this.onEnd()}}},{key:"getValue",value:function(){return this.state.value}},{key:"getLowerBound",value:function(){var e=this.props.startPoint||this.props.min;return this.state.value>e?e:this.state.value}},{key:"getUpperBound",value:function(){return this.state.value<this.props.startPoint?this.props.startPoint:this.state.value}},{key:"trimAlignValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===e)return null;var n=(0,l.Z)((0,l.Z)({},this.props),t),a=F(e,n);return V(a,n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,a=t.vertical,r=t.included,o=t.disabled,i=t.minimumTrackStyle,u=t.trackStyle,c=t.handleStyle,d=t.tabIndex,f=t.ariaLabelForHandle,v=t.ariaLabelledByForHandle,h=t.ariaValueTextFormatterForHandle,m=t.min,g=t.max,y=t.startPoint,b=t.reverse,Z=t.handle,k=this.state,x=k.value,C=k.dragging,M=this.calcOffset(x),w=Z({className:"".concat(n,"-handle"),prefixCls:n,vertical:a,offset:M,value:x,dragging:C,disabled:o,min:m,max:g,reverse:b,index:0,tabIndex:d,ariaLabel:f,ariaLabelledBy:v,ariaValueTextFormatter:h,style:c[0]||c,ref:function(t){return e.saveHandle(0,t)}}),S=void 0!==y?this.calcOffset(y):0,E=u[0]||u;return{tracks:s.createElement(p,{className:"".concat(n,"-track"),vertical:a,included:r,offset:S,reverse:b,length:M-S,style:(0,l.Z)((0,l.Z)({},i),E)}),handles:w}}}]),n}(s.Component)),_=function(e){var t=e.value,n=e.handle,a=e.bounds,r=e.props,o=r.allowCross,i=r.pushable,s=Number(i),l=F(t,r),u=l;return o||null==n||void 0===a||(n>0&&l<=a[n-1]+s&&(u=a[n-1]+s),n<a.length-1&&l>=a[n+1]-s&&(u=a[n+1]-s)),V(u,r)},K=function(e){(0,d.Z)(n,e);var t=(0,f.Z)(n);function n(e){var a;(0,u.Z)(this,n),(a=t.call(this,e)).startValue=void 0,a.startPosition=void 0,a.prevMovedHandleIndex=void 0,a.internalPointsCache=void 0,a.handlesRefs=void 0,a.dragTrack=void 0,a.positionGetValue=function(e){var t=a.getValue(),n=a.calcValueByPos(e),r=a.getClosestBound(n),o=a.getBoundNeedMoving(n,r);if(n===t[o])return null;var i=(0,m.Z)(t);return i[o]=n,i},a.onEnd=function(e){var t=a.state.handle;a.removeDocumentEvents(),t||(a.dragTrack=!1),(null!==t||e)&&a.props.onAfterChange(a.getValue()),a.setState({handle:null})};var r=e.count,o=e.min,i=e.max,s=Array.apply(void 0,(0,m.Z)(Array(r+1))).map((function(){return o})),l="defaultValue"in e?e.defaultValue:s,c=(void 0!==e.value?e.value:l).map((function(t,n){return _({value:t,handle:n,props:e})})),d=c[0]===i?0:c.length-1;return a.state={handle:null,recent:d,bounds:c},a}return(0,c.Z)(n,[{key:"calcValueByPos",value:function(e){return 0}},{key:"getSliderLength",value:function(){return 0}},{key:"calcOffset",value:function(e){return 0}},{key:"saveHandle",value:function(e,t){}},{key:"removeDocumentEvents",value:function(){}},{key:"componentDidUpdate",value:function(e,t){var n=this,a=this.props,r=a.onChange,o=a.value,i=a.min,s=a.max;if(("min"in this.props||"max"in this.props)&&(i!==e.min||s!==e.max)){var l=o||t.bounds;if(l.some((function(e){return P(e,n.props)})))r(l.map((function(e){return F(e,n.props)})))}}},{key:"onChange",value:function(e){var t=this.props;if(!("value"in t))this.setState(e);else{var n={};["handle","recent"].forEach((function(t){void 0!==e[t]&&(n[t]=e[t])})),Object.keys(n).length&&this.setState(n)}var a=(0,l.Z)((0,l.Z)({},this.state),e).bounds;t.onChange(a)}},{key:"onStart",value:function(e){var t=this.props,n=this.state,a=this.getValue();t.onBeforeChange(a);var r=this.calcValueByPos(e);this.startValue=r,this.startPosition=e;var o=this.getClosestBound(r);if(this.prevMovedHandleIndex=this.getBoundNeedMoving(r,o),this.setState({handle:this.prevMovedHandleIndex,recent:this.prevMovedHandleIndex}),r!==a[this.prevMovedHandleIndex]){var i=(0,m.Z)(n.bounds);i[this.prevMovedHandleIndex]=r,this.onChange({bounds:i})}}},{key:"onMove",value:function(e,t,n,a){H(e);var r=this.state,o=this.props,i=o.max||100,s=o.min||0;if(n){var l=o.vertical?-t:t;l=o.reverse?-l:l;var u=i-Math.max.apply(Math,(0,m.Z)(a)),c=s-Math.min.apply(Math,(0,m.Z)(a)),d=Math.min(Math.max(l/(this.getSliderLength()/(i-s)),c),u),f=a.map((function(e){return Math.floor(Math.max(Math.min(e+d,i),s))}));r.bounds.map((function(e,t){return e===f[t]})).some((function(e){return!e}))&&this.onChange({bounds:f})}else{var v=this.calcValueByPos(t);v!==r.bounds[r.handle]&&this.moveTo(v)}}},{key:"onKeyboard",value:function(e){var t=this.props,n=t.reverse,a=j(e,t.vertical,n);if(a){H(e);var r=this.state,o=this.props,i=r.bounds,s=r.handle,l=i[null===s?r.recent:s],u=a(l,o),c=_({value:u,handle:s,bounds:r.bounds,props:o});if(c===l)return;this.moveTo(c,!0)}}},{key:"getValue",value:function(){return this.state.bounds}},{key:"getClosestBound",value:function(e){for(var t=this.state.bounds,n=0,a=1;a<t.length-1;a+=1)e>=t[a]&&(n=a);return Math.abs(t[n+1]-e)<Math.abs(t[n]-e)&&(n+=1),n}},{key:"getBoundNeedMoving",value:function(e,t){var n=this.state,a=n.bounds,r=n.recent,o=t,i=a[t+1]===a[t];return i&&a[r]===a[t]&&(o=r),i&&e!==a[t+1]&&(o=e<a[t+1]?t:t+1),o}},{key:"getLowerBound",value:function(){return this.state.bounds[0]}},{key:"getUpperBound",value:function(){var e=this.state.bounds;return e[e.length-1]}},{key:"getPoints",value:function(){var e=this.props,t=e.marks,n=e.step,a=e.min,r=e.max,o=this.internalPointsCache;if(!o||o.marks!==t||o.step!==n){var i=(0,l.Z)({},t);if(null!==n)for(var s=a;s<=r;s+=n)i[s]=s;var u=Object.keys(i).map(parseFloat);u.sort((function(e,t){return e-t})),this.internalPointsCache={marks:t,step:n,points:u}}return this.internalPointsCache.points}},{key:"moveTo",value:function(e,t){var n=this,a=this.state,r=this.props,o=(0,m.Z)(a.bounds),i=null===a.handle?a.recent:a.handle;o[i]=e;var s=i;!1!==r.pushable?this.pushSurroundingHandles(o,s):r.allowCross&&(o.sort((function(e,t){return e-t})),s=o.indexOf(e)),this.onChange({recent:s,handle:s,bounds:o}),t&&(this.props.onAfterChange(o),this.setState({},(function(){n.handlesRefs[s].focus()})),this.onEnd())}},{key:"pushSurroundingHandles",value:function(e,t){var n=e[t],a=this.props.pushable,r=Number(a),o=0;if(e[t+1]-n<r&&(o=1),n-e[t-1]<r&&(o=-1),0!==o){var i=t+o,s=o*(e[i]-n);this.pushHandle(e,i,o,r-s)||(e[t]=e[i]-o*r)}}},{key:"pushHandle",value:function(e,t,n,a){for(var r=e[t],o=e[t];n*(o-r)<a;){if(!this.pushHandleOnePoint(e,t,n))return e[t]=r,!1;o=e[t]}return!0}},{key:"pushHandleOnePoint",value:function(e,t,n){var a=this.getPoints(),r=a.indexOf(e[t])+n;if(r>=a.length||r<0)return!1;var o=t+n,i=a[r],s=this.props.pushable,l=Number(s),u=n*(e[o]-i);return!!this.pushHandle(e,o,n,l-u)&&(e[t]=i,!0)}},{key:"trimAlignValue",value:function(e){var t=this.state,n=t.handle,a=t.bounds;return _({value:e,handle:n,bounds:a,props:this.props})}},{key:"render",value:function(){var e=this,t=this.state,n=t.handle,a=t.bounds,o=this.props,i=o.prefixCls,l=o.vertical,u=o.included,c=o.disabled,d=o.min,f=o.max,v=o.reverse,h=o.handle,m=o.trackStyle,g=o.handleStyle,y=o.tabIndex,b=o.ariaLabelGroupForHandles,Z=o.ariaLabelledByGroupForHandles,x=o.ariaValueTextFormatterGroupForHandles,C=a.map((function(t){return e.calcOffset(t)})),M="".concat(i,"-handle"),w=a.map((function(t,a){var o,s=y[a]||0;(c||null===y[a])&&(s=null);var u=n===a;return h({className:k()((o={},(0,r.Z)(o,M,!0),(0,r.Z)(o,"".concat(M,"-").concat(a+1),!0),(0,r.Z)(o,"".concat(M,"-dragging"),u),o)),prefixCls:i,vertical:l,dragging:u,offset:C[a],value:t,index:a,tabIndex:s,min:d,max:f,reverse:v,disabled:c,style:g[a],ref:function(t){return e.saveHandle(a,t)},ariaLabel:b[a],ariaLabelledBy:Z[a],ariaValueTextFormatter:x[a]})}));return{tracks:a.slice(0,-1).map((function(e,t){var n,a=t+1,o=k()((n={},(0,r.Z)(n,"".concat(i,"-track"),!0),(0,r.Z)(n,"".concat(i,"-track-").concat(a),!0),n));return s.createElement(p,{className:o,vertical:l,reverse:v,included:u,offset:C[a-1],length:C[a]-C[a-1],style:m[t],key:a})})),handles:w}}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(!("value"in e||"min"in e||"max"in e))return null;var n=e.value||t.bounds,a=n.map((function(n,a){return _({value:n,handle:a,bounds:t.bounds,props:e})}));if(t.bounds.length===a.length){if(a.every((function(e,n){return e===t.bounds[n]})))return null}else a=n.map((function(t,n){return _({value:t,handle:n,props:e})}));return(0,l.Z)((0,l.Z)({},t),{},{bounds:a})}}]),n}(s.Component);K.displayName="Range",K.defaultProps={count:1,allowCross:!0,pushable:!1,draggableTrack:!1,tabIndex:[],ariaLabelGroupForHandles:[],ariaLabelledByGroupForHandles:[],ariaValueTextFormatterGroupForHandles:[]};var W=A(K),X=n(22972),z=n(42550),Y=n(75164),Q=s.forwardRef((function(e,t){var n=e.visible,a=e.overlay,r=s.useRef(null),i=(0,z.sQ)(t,r),l=s.useRef(null);function u(){Y.Z.cancel(l.current)}return s.useEffect((function(){return n?l.current=(0,Y.Z)((function(){var e;null===(e=r.current)||void 0===e||e.forcePopupAlign()})):u(),u}),[n,a]),s.createElement(X.default,(0,o.Z)({ref:i},e))})),J=["value","dragging","index","disabled"],$=["prefixCls","overlay","placement","visible"];var q=G;q.Range=W,q.Handle=w,q.createSliderWithTooltip=function(e){var t,n;return n=t=function(t){(0,d.Z)(a,t);var n=(0,f.Z)(a);function a(){var e;(0,u.Z)(this,a);for(var t=arguments.length,i=new Array(t),c=0;c<t;c++)i[c]=arguments[c];return(e=n.call.apply(n,[this].concat(i))).state={visibles:{}},e.handleTooltipVisibleChange=function(t,n){e.setState((function(e){return{visibles:(0,l.Z)((0,l.Z)({},e.visibles),{},(0,r.Z)({},t,n))}}))},e.handleWithTooltip=function(t){var n,a=t.value,r=t.dragging,i=t.index,u=t.disabled,c=(0,h.Z)(t,J),d=e.props,f=d.tipFormatter,v=d.tipProps,p=d.handleStyle,m=d.getTooltipContainer,g=v.prefixCls,y=void 0===g?"rc-slider-tooltip":g,b=v.overlay,Z=void 0===b?f(a):b,k=v.placement,x=void 0===k?"top":k,C=v.visible,M=void 0!==C&&C,S=(0,h.Z)(v,$);return n=Array.isArray(p)?p[i]||p[0]:p,s.createElement(Q,(0,o.Z)({},S,{getTooltipContainer:m,prefixCls:y,overlay:Z,placement:x,visible:!u&&(e.state.visibles[i]||r)||M,key:i}),s.createElement(w,(0,o.Z)({},c,{style:(0,l.Z)({},n),value:a,onMouseEnter:function(){return e.handleTooltipVisibleChange(i,!0)},onMouseLeave:function(){return e.handleTooltipVisibleChange(i,!1)}})))},e}return(0,c.Z)(a,[{key:"render",value:function(){return s.createElement(e,(0,o.Z)({},this.props,{handle:this.handleWithTooltip}))}}]),a}(s.Component),t.defaultProps={tipFormatter:function(e){return e},handleStyle:[{}],tipProps:{},getTooltipContainer:function(e){return e.parentNode}},n};var ee=q,te=n(56266),ne=s.forwardRef((function(e,t){var n=e.visible,a=(0,s.useRef)(null),r=(0,s.useRef)(null);function i(){Y.Z.cancel(r.current),r.current=null}return s.useEffect((function(){return n?r.current=(0,Y.Z)((function(){var e;null===(e=a.current)||void 0===e||e.forcePopupAlign(),r.current=null})):i(),i}),[n,e.title]),s.createElement(te.Z,(0,o.Z)({ref:(0,z.sQ)(a,t)},e))})),ae=n(59844),re=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n},oe=s.forwardRef((function(e,t){var n,l=s.useContext(ae.E_),u=l.getPrefixCls,c=l.direction,d=l.getPopupContainer,f=s.useState({}),v=(0,i.Z)(f,2),p=v[0],h=v[1],m=function(e,t){h((function(n){return(0,o.Z)((0,o.Z)({},n),(0,r.Z)({},e,t))}))},g=function(e,t){return e||(t?"rtl"===c?"left":"right":"top")},y=function(t){var n=t.tooltipPrefixCls,a=t.prefixCls,r=t.info,i=r.value,l=r.dragging,c=r.index,f=re(r,["value","dragging","index"]),v=e.tipFormatter,h=e.tooltipVisible,y=e.tooltipPlacement,b=e.getTooltipPopupContainer,Z=e.vertical,k=!!v&&(p[c]||l),x=h||void 0===h&&k,C=u();return s.createElement(ne,{prefixCls:n,title:v?v(i):"",visible:x,placement:g(y,Z),transitionName:"".concat(C,"-zoom-down"),key:c,overlayClassName:"".concat(a,"-tooltip"),getPopupContainer:b||d},s.createElement(w,(0,o.Z)({},f,{value:i,onMouseEnter:function(){return m(c,!0)},onMouseLeave:function(){return m(c,!1)}})))},b=e.prefixCls,Z=e.tooltipPrefixCls,x=e.range,C=e.className,M=re(e,["prefixCls","tooltipPrefixCls","range","className"]),S=u("slider",b),E=u("tooltip",Z),O=k()(C,(0,r.Z)({},"".concat(S,"-rtl"),"rtl"===c));return"rtl"!==c||M.vertical||(M.reverse=!M.reverse),"object"===(0,a.Z)(x)&&(n=x.draggableTrack),x?s.createElement(W,(0,o.Z)({},M,{step:M.step,draggableTrack:n,className:O,ref:t,handle:function(e){return y({tooltipPrefixCls:E,prefixCls:S,info:e})},prefixCls:S})):s.createElement(ee,(0,o.Z)({},M,{step:M.step,className:O,ref:t,handle:function(e){return y({tooltipPrefixCls:E,prefixCls:S,info:e})},prefixCls:S}))}));oe.displayName="Slider",oe.defaultProps={tipFormatter:function(e){return"number"===typeof e?e.toString():""}};var ie=oe},94594:function(e,t,n){n.d(t,{Z:function(){return k}});var a=n(87462),r=n(4942),o=n(67294),i=n(97685),s=n(91),l=n(94184),u=n.n(l),c=n(21770),d=n(15105),f=o.forwardRef((function(e,t){var n,a=e.prefixCls,l=void 0===a?"rc-switch":a,f=e.className,v=e.checked,p=e.defaultChecked,h=e.disabled,m=e.loadingIcon,g=e.checkedChildren,y=e.unCheckedChildren,b=e.onClick,Z=e.onChange,k=e.onKeyDown,x=(0,s.Z)(e,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),C=(0,c.Z)(!1,{value:v,defaultValue:p}),M=(0,i.Z)(C,2),w=M[0],S=M[1];function E(e,t){var n=w;return h||(S(n=e),null===Z||void 0===Z||Z(n,t)),n}var O=u()(l,f,(n={},(0,r.Z)(n,"".concat(l,"-checked"),w),(0,r.Z)(n,"".concat(l,"-disabled"),h),n));return o.createElement("button",Object.assign({},x,{type:"button",role:"switch","aria-checked":w,disabled:h,className:O,ref:t,onKeyDown:function(e){e.which===d.Z.LEFT?E(!1,e):e.which===d.Z.RIGHT&&E(!0,e),null===k||void 0===k||k(e)},onClick:function(e){var t=E(!w,e);null===b||void 0===b||b(t,e)}}),m,o.createElement("span",{className:"".concat(l,"-inner")},w?g:y))}));f.displayName="Switch";var v=f,p=n(50888),h=n(97202),m=n(59844),g=n(97647),y=n(21687),b=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n},Z=o.forwardRef((function(e,t){var n,i=e.prefixCls,s=e.size,l=e.loading,c=e.className,d=void 0===c?"":c,f=e.disabled,Z=b(e,["prefixCls","size","loading","className","disabled"]);(0,y.Z)("checked"in Z||!("value"in Z),"Switch","`value` is not a valid prop, do you mean `checked`?");var k=o.useContext(m.E_),x=k.getPrefixCls,C=k.direction,M=o.useContext(g.Z),w=x("switch",i),S=o.createElement("div",{className:"".concat(w,"-handle")},l&&o.createElement(p.Z,{className:"".concat(w,"-loading-icon")})),E=u()((n={},(0,r.Z)(n,"".concat(w,"-small"),"small"===(s||M)),(0,r.Z)(n,"".concat(w,"-loading"),l),(0,r.Z)(n,"".concat(w,"-rtl"),"rtl"===C),n),d);return o.createElement(h.Z,{insertExtraNode:!0},o.createElement(v,(0,a.Z)({},Z,{prefixCls:w,className:E,disabled:f||l,ref:t,loadingIcon:S})))}));Z.__ANT_SWITCH=!0,Z.displayName="Switch";var k=Z}}]); |