Module 728321

1,583 characters · in f08fed5b39d8e5b5.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>h});var l=n(627968),i=n(64700),s=n(621466),r=n(17928),a=n(531685),o=n(787541),c=n(159730),u=n(79858);class d extends i.Component{static defaultProps={position:"top",offsetX:0,offsetY:0,autoInvert:!0};componentDidMount(){let{visible:e,inlineSpecs:t}=this.props;null==t&&this.show(e)}componentWillUnmount(){let{inlineSpecs:e}=this.props;null==e&&this.show(!1)}componentDidUpdate(e){let{position:t,offsetX:n,offsetY:l,tutorialId:i,visible:s,windowSize:r}=e;i!==this.props.tutorialId?o.jD(i):(s!==this.props.visible||t!==this.props.position||n!==this.props.offsetX||l!==this.props.offsetY||r!==this.props.windowSize)&&this.show(this.props.visible)}show(e){let{childRef:t,tutorialId:n,position:l,offsetX:i,offsetY:r,visible:a,inlineSpecs:c,autoInvert:u}=this.props;if(e&&null==c){let e=t?.current;if(!(0,s.vq)(e))return;let{top:a,left:c,right:d,bottom:h}=e.getBoundingClientRect();o.WU(n,{position:l,targetWidth:d-c,targetHeight:h-a,autoInvert:u,origin:{x:c,y:a},offset:{x:i,y:r}})}else a&&o.jD(n)}render(){let{inlineSpecs:e,tutorialId:t,children:n,visible:s,windowFocused:r,position:a,autoInvert:o}=this.props,d=u.A.getData()[t];return null!=e&&null!=d?(0,l.jsxs)(l.Fragment,{children:[n,s&&(0,l.jsx)(c.Y,{autoInvert:o,position:a,tutorialId:t,tutorialDefinition:d,focused:r,...e})]}):i.Children.only(n)}}function h(e){let{tutorialId:t,disabled:n}=e,i=(0,r.bG)([u.A],()=>!n&&u.A.shouldShow(t),[n,t]),s=(0,r.bG)([a.A],()=>a.A.isFocused()),o=(0,r.bG)([a.A],()=>a.A.windowSize(),[]);return(0,l.jsx)(d,{...e,visible:i,windowFocused:s,windowSize:o})}}