forked from bombastictranz/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
9411-f229883578ae3fb4.js.download
1 lines (1 loc) · 10.6 KB
/
9411-f229883578ae3fb4.js.download
1
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9411],{32052:function(e,t,n){n.d(t,{Z:function(){return global_Number_Number}});var r=["","k","M","B","T",""],Number_abbreviateNumber=function(e){if(!e||e<1&&e>-1)return"number"==typeof e?e.toString():null;var t=Math.floor(Math.log(Math.abs(e))/Math.log(1e3)),n=r[Math.min(t,r.length)],o=String(Math.abs(e)/Math.pow(1e3,t)).substring(0,3),a=o.endsWith(".")?o.slice(0,-1):o;return"".concat(e<0?"-":"").concat(a).concat(n)},Number_relativeRound=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(!e)return 0;var n=Math.floor(Math.log10(Math.abs(e)))-t;return parseFloat((Math[e<0?"floor":"ceil"](e/Math.pow(10,n))*Math.pow(10,n)).toPrecision(12))},o=n(52903),global_Number_Number=function(e){var t=e.children,n=e.infinityLabel,r=e.isAbbreviated,a=void 0!==r&&r,l=e.isFriendly,i=e.isNegativeOneInfinity,c=e.maxDecimals,s=e.minDecimals,d=e.nanLabel,u=t;return isNaN(u)||"number"!=typeof u?(0,o.tZ)("span",{children:void 0===d?"NaN":d}):!isFinite(u)||void 0!==i&&i&&-1===u?(0,o.tZ)("span",{children:void 0===n?"Infinity":n}):(void 0!==l&&l&&(u=Number_relativeRound(u)),u=a?Number_abbreviateNumber(u):u.toLocaleString(void 0,{maximumFractionDigits:void 0===c?2:c,minimumFractionDigits:void 0===s?0:s}),(0,o.tZ)("span",{title:a?t.toLocaleString():void 0,children:u}))}},79411:function(e,t,n){n.d(t,{ez:function(){return ChangeLogEmbedWrapper},Vm:function(){return r},Vj:function(){return RunLogEmbedWrapper},Sd:function(){return UsageEmbedWrapper},e6:function(){return useIsIframe}});var r={deleteSuccess:"deleteSuccess",openDeleteModal:"openDeleteModal",openDownloadRunsModal:"openDownloadRunsModal",openErrorModal:"openErrorModal",openReplayModal:"openReplayModal",replaySuccess:"replaySuccess",routeChange:"routeChange",sizeChange:"sizeChange"},o=n(2784),a=n(17712),l=n(52903);function ChangeLogEmbedWrapper(e){var t=e.events,n=e.push,i=e.url,c=e.zapId,s=(0,o.useRef)(null),d=(0,o.useState)(),u=d[0],p=d[1];return((0,o.useEffect)(function(){var e,t=null===(e=window)||void 0===e?void 0:e.location.search.slice(1);p("/embed/reporting/change-log?".concat(t,"&zapId=").concat(c))},[c]),(0,o.useEffect)(function(){return window.onmessage=function(e){e.data.type===r.routeChange?n((0,a.Hn)("".concat(i).concat(e.data.filters),["zapId"])):e.data.type===r.sizeChange&&s.current&&(s.current.height=e.data.height)},function(){window.onmessage=null}},[n]),(0,o.useEffect)(function(){var handleRouteChange=function(){var e;if(null!==(e=s.current)&&void 0!==e&&e.contentWindow){var t="?".concat(window.location.search.substring(1),"&zapId=").concat(c);s.current.contentWindow.postMessage({filters:t,type:r.routeChange},"*")}};return t.on("routeChangeComplete",handleRouteChange),function(){t.off("routeChangeComplete",handleRouteChange)}},[t,c]),u&&c)?(0,l.tZ)("iframe",{height:"100%",ref:s,src:u,style:{border:"none",margin:"-30px",overflow:"hidden",width:"calc(100% + 60px)"},title:"Change Log Embed",scrolling:"no"},u):null}var i=n(95235),c=n(28952),s=n(66266),d=n(55414),u=n(20110);function DeleteModal(e){var t=e.onClose,n=e.onDelete;return(0,l.tZ)(c.u,{onClosed:t,children:(0,l.tZ)(s.hz,{children:(0,l.BX)("div",{style:{display:"grid",gridGap:"20px",justifyItems:"center"},id:"delete-modal",children:[(0,l.tZ)(d.x,{color:"neutral800",type:"paragraph1ShortBold",children:"Delete run logs?"}),(0,l.tZ)(d.x,{color:"neutral700",tag:"p",type:"paragraph3",children:"Any tasks from these runs will be counted in your monthly usage."}),(0,l.BX)("div",{style:{display:"grid",gridGap:"20px",gridAutoFlow:"column"},children:[(0,l.tZ)(u.z,{color:"secondary",onClick:t,size:"small",children:"Cancel"}),(0,l.tZ)(u.z,{color:"danger",onClick:n,size:"small",children:"Delete"})]})]})})})}var p=n(20271),h=n(26215),g=n(32052);function DownloadRunsModal(e){var t=e.closeModal,n=e.exportedTaskCount,r=e.isSuccess;return(0,l.tZ)(c.u,{onClosed:t,children:(0,l.tZ)(s.hz,{children:(0,l.BX)("div",{style:{display:"grid",gridGap:20,maxWidth:480,textAlign:"center"},children:[(0,l.tZ)(d.x,{color:"neutral800",type:"paragraph1ShortBold",children:"Exporting Zap history"}),(0,l.tZ)(d.x,{color:"neutral700",tag:"p",type:"paragraph3",children:"It may take a few minutes to prepare your data for export. Once complete, we will email you a link to download a CSV."}),(0,l.tZ)("span",{style:{justifySelf:"center"},children:r?(0,l.BX)(p.b,{type:"info",children:["Your export will contain ",n," ",n&&n>1?"".concat("run","s"):"run"]}):(0,l.tZ)(p.b,{type:"error",children:"It looks like there was an issue with your request. Please try again later."})}),(0,l.BX)(d.x,{color:"neutral700",tag:"p",type:"paragraph3",children:["Exports are limited to ",(0,l.tZ)(g.Z,{children:5e3})," rows. Need more?"," ",(0,l.tZ)(h.r,{style:{textDecoration:"none",outline:"none"},href:"/app/get-help",children:"Contact us"})]})]})})})}var ErrorModal_ErrorModal=function(e){return(0,l.tZ)(c.u,{onClosed:e.onClose,children:(0,l.tZ)(s.hz,{children:(0,l.BX)("div",{style:{display:"grid",gridGap:20},children:[(0,l.tZ)(d.x,{type:"sectionHeader3",children:e.error}),(0,l.tZ)(d.x,{tag:"p",type:"paragraph3",children:"Unfortunately, that’s all we know. Please try again."}),(0,l.BX)(d.x,{tag:"p",type:"paragraph3",children:["Please ",(0,l.tZ)(h.r,{href:"mailto:contact@zapier.com",children:"contact support"})," ","if this persists."]})]})})})};function ReplayModal(e){return(0,l.tZ)(c.u,{onClosed:e.onClose,children:(0,l.tZ)(s.hz,{children:e.allowTaskReplay?(0,l.BX)("div",{style:{display:"grid",gridGap:"20px",justifyItems:"center"},id:"replay-modal",children:[(0,l.tZ)(d.x,{color:"neutral800",type:"paragraph1ShortBold",children:"Replay Zap runs"}),(0,l.tZ)(d.x,{color:"neutral700",tag:"p",type:"paragraph3",children:"Replaying only retries failed steps, not successful steps."}),(0,l.BX)("div",{style:{display:"grid",gridGap:"30px",gridAutoFlow:"column"},children:[(0,l.tZ)(u.z,{color:"secondary",onClick:e.onClose,size:"small",children:"Close"}),(0,l.tZ)(u.z,{onClick:e.onReplay,size:"small",children:"Replay"})]})]}):(0,l.BX)("div",{style:{display:"grid",gridGap:"20px"},id:"replay-modal",children:[(0,l.tZ)(d.x,{color:"neutral800",type:"sectionHeader3",children:"Manual Replay"}),(0,l.BX)(d.x,{color:"neutral700",tag:"p",type:"paragraph3",children:["The ",(0,l.tZ)("strong",{children:"Manual Replay"})," feature lets you replay failed tasks on demand - making it easy to recover from temporary service outages or other small interruptions between Zapier and external apps."]}),(0,l.tZ)(u.z,{href:"/app/billing/plans",children:"Upgrade to Starter"})]})})})}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){(0,i.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function RunLogEmbedWrapper(e){var t=e.push,n=e.zapId,a=e.events,i=e.url,c=(0,o.useRef)(null),s=(0,o.useState)({onDelete:function(){},show:!1}),d=s[0],u=s[1],p=(0,o.useState)({isSuccess:!1,showDownloadRunsModal:!1}),h=p[0],g=p[1],f=(0,o.useState)({error:"",showErrorModal:!1}),y=f[0],w=f[1],m=(0,o.useState)({onReplay:function(){},show:!1,allowTaskReplay:!1}),b=m[0],v=m[1],C=(0,o.useState)(),M=C[0],S=C[1];return((0,o.useEffect)(function(){var e=window.location.search.slice(1);S("/embed/reporting/run-log?".concat(e,"&zapId=").concat(n))},[n]),(0,o.useEffect)(function(){return window.onmessage=function(e){e.data.type===r.routeChange?t("".concat(i).concat(e.data.filters)):e.data.type===r.sizeChange?c.current&&(c.current.height=e.data.height):e.data.type===r.openDeleteModal?u(_objectSpread(_objectSpread({},e.data),{},{show:e.data.show})):e.data.type===r.openDownloadRunsModal?g(_objectSpread(_objectSpread({},e.data),{},{showDownloadRunsModal:!0})):e.data.type===r.openErrorModal?w(_objectSpread(_objectSpread({},e.data),{},{showErrorModal:!0})):e.data.type===r.openReplayModal&&v(_objectSpread(_objectSpread({},e.data),{},{allowTaskReplay:e.data.allowTaskReplay,show:e.data.show}))},function(){window.onmessage=null}},[]),(0,o.useEffect)(function(){var handleRouteChange=function(){var e,t="?".concat(window.location.search.substring(1),"&zapId=").concat(n);null!==(e=c.current)&&void 0!==e&&e.contentWindow&&c.current.contentWindow.postMessage({filters:t,type:r.routeChange},"*")};return a.on("routeChangeComplete",handleRouteChange),function(){a.off("routeChangeComplete",handleRouteChange)}},[a,n]),M)?(0,l.BX)(o.Fragment,{children:[(0,l.tZ)("iframe",{height:"100%",ref:c,src:M,style:{border:"none",margin:"-30px",overflow:"hidden",width:"calc(100% + 60px)"},title:"Run Log Embed",scrolling:"no"},M),(null==d?void 0:d.show)&&(0,l.tZ)(DeleteModal,{onClose:function(){return u(function(e){return _objectSpread(_objectSpread({},e),{},{show:!1})})},onDelete:function(){c&&c.current&&c.current.contentWindow&&c.current.contentWindow.postMessage({type:r.deleteSuccess},"*")}}),(null==h?void 0:h.showDownloadRunsModal)&&(0,l.tZ)(DownloadRunsModal,{closeModal:function(){return g(function(e){return _objectSpread(_objectSpread({},e),{},{showDownloadRunsModal:!1})})},exportedTaskCount:h.exportedTaskCount,isSuccess:h.isSuccess}),(null==y?void 0:y.showErrorModal)&&(0,l.tZ)(ErrorModal_ErrorModal,{error:y.error,onClose:function(){return w(function(e){return _objectSpread(_objectSpread({},e),{},{showErrorModal:!1})})}}),(null==b?void 0:b.show)&&(0,l.tZ)(ReplayModal,{allowTaskReplay:b.allowTaskReplay,onClose:function(){return v(function(e){return _objectSpread(_objectSpread({},e),{},{show:!1})})},onReplay:function(){c&&c.current&&c.current.contentWindow&&c.current.contentWindow.postMessage({type:r.replaySuccess},"*")}})]}):null}function UsageEmbedWrapper(e){var t=e.zapId,n=(0,o.useRef)(null);(0,o.useEffect)(function(){return window.onmessage=function(e){e.data.type===r.sizeChange&&n.current&&(n.current.height=e.data.height)},function(){window.onmessage=null}},[]);var a=(0,o.useState)(),i=a[0],c=a[1];return((0,o.useEffect)(function(){var e=window.location.search.slice(1);c("/embed/reporting/usage?".concat(e,"&zapId=").concat(t))},[t]),i)?(0,l.tZ)("iframe",{height:"100%",ref:n,src:i,style:{border:"none",margin:"-30px",overflow:"hidden",width:"calc(100% + 60px)"},title:"Usage Embed",scrolling:"no"},i):null}var f=n(81333),y=n(93542);function useIsIframe(){var e=o.useState(!1),t=(0,f.Z)(e,2),n=t[0],r=t[1];return o.useEffect(function(){var e,t=window.self!==window.top,n=!(null!==(e=y.env.CYPRESS_BASE_URL)&&void 0!==e&&e.includes("zapier.com"));r(t||n)},[]),n}}}]);