PageSourceSearch

https://app.opus1.io/releases/20260925T143842Z-e1befdfb692b/async/2113.4bb2dc5f.js

js opus1.io collected 2026-09-25 18:56:35 UTC 6,827 bytes, 2 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="7ed69d6f-888e-4cea-aaed-7720287a6423",e._sentryDebugIdIdentifier="sentry-dbid-7ed69d6f-888e-4cea-aaed-7720287a6423")}catch(e){}}();var _global="u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{};_global.SENTRY_RELEASE={id:"e1befdfb692b28496829f71c2490b06d48ba02c9"};"use strict";(self.webpackChunkopus1io=self.webpackChunkopus1io||[]).push([["2113"],{7288:function(e,r,t){t.r(r);var l=t(41374),a=t(71893),s=t(55456),o=t(84577);t(43831),t(93632),t(42196),t(45336),t(79936),t(23446),t(60726);var i=t(74848),n=t(96540),d=t(52956),c=t(6251),g=t(78258),u=t(62193),h=t.n(u),m=t(26479),f=t.n(m);t(12936);var E=t(31778),p=t(12163),S=t(77999),_=t(60469),y=t(70537),b=t(50613),x=t(32114),v=t(21002),G=t(89949),N=t(38566);function j(){var e=(0,o._)(["\n    mutation importCredits($business: ID!, $url: String!, $dryrun: Boolean) {\n        importCredits(business: $business, url: $url, dryrun: $dryrun) {\n            errors\n            rawData\n            importId\n            status\n            info\n        }\n    }\n"]);return j=function(){return e},e}var I=(0,g.J1)(j()),O=(e,r)=>{switch(r.type){case"SET_GOOGLE_SHEET_URL":return(0,s._)((0,a._)({},e),{googleSheetUrl:r.payload.trim(),googleSheetValid:!1});case"TRIGGER_GOOGLE_SHEET_VALIDATION":return(0,s._)((0,a._)({},e),{triggerGoogleSheetValidation:!0});case"SET_CHECKING_GOOGLE_SHEET":return(0,s._)((0,a._)({},e),{checkingGoogleSheet:r.payload,triggerGoogleSheetValidation:!1});case"SET_GOOGLE_SHEET_ERROR":return(0,s._)((0,a._)({},e),{googleSheetError:r.payload});case"SET_GOOGLE_SHEET_DETAILS":return(0,s._)((0,a._)({},e),{checkingGoogleSheet:!1,googleSheetValid:!0,googleSheetDetails:r.payload});case"SET_QUICK_PREVIEW":return(0,s._)((0,a._)({},e),{quickPreview:r.payload});default:return e}},R=e=>{var{state:r,dispatch:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"d-flex flex-row align-items-center",children:[(0,i.jsx)(p.A,{className:"w-100p mr-3",field:{title:"Google sheet URL",materialIcon:"description",value:r.googleSheetUrl},onChange:e=>{t({type:"SET_GOOGLE_SHEET_URL",payload:e.target.value})}}),(0,i.jsx)(G.GoogleSheetStatusWrapper,{children:r.checkingGoogleSheet?(0,i.jsx)(y.A,{className:"fa fa-refresh fa-spin"}):(0,i.jsx)(y.A,{className:"fa fa-refresh",onClick:()=>{r.googleSheetUrl&&t({type:"TRIGGER_GOOGLE_SHEET_VALIDATION"})}})})]}),r.googleSheetValid&&r.googleSheetDetails&&(0,i.jsxs)("div",{className:"d-flex flex-row align-items-center mb-2",children:[(0,i.jsx)(y.A,{className:"fa fa-check mr-2"}),r.googleSheetDetails]}),!r.googleSheetValid&&r.googleSheetError&&(0,i.jsx)("div",{className:"d-flex flex-row align-items-center mb-2 text-danger",children:r.googleSheetError})]})};r.default=()=>{var{name:e}=(0,d.useSelector)(e=>e.app.business),[r,t]=(0,n.useState)(!1),[a,s]=(0,n.useState)(!1),[o,g]=(0,n.useState)(!1),[u,m]=(0,n.useState)(),[p,y]=(0,n.useState)({}
1),[j,A]=(0,n.useState)(["INFO","WARNING","ERROR","CRITICAL"]),[T,C]=(0,n.useReducer)(O,{googleSheetUrl:null,googleSheetValid:!1,googleSheetError:null,checkingGoogleSheet:!1,triggerGoogleSheetValidation:!1,quickPreview:!1}),{data:w,loading:L,error:k,refetch:D}=(0,b.A)({query:G.VALIDATE_GOOGLE_SHEET,variables:{business:e,url:T.googleSheetUrl},skip:!T.googleSheetUrl,processor:e=>e.validateGoogleSheet,fetchPolicy:"no-cache"}),[V]=(0,N.A)(I,{successMessage:"Import processing..."});(0,n.useEffect)(()=>{C({type:"SET_GOOGLE_SHEET_ERROR",payload:k?"".concat(k):null})},[k]),(0,n.useEffect)(()=>{T.triggerGoogleSheetValidation&&D()},[T.triggerGoogleSheetValidation,D]),(0,n.useEffect)(()=>{C({type:"SET_CHECKING_GOOGLE_SHEET",payload:L})},[L]),(0,n.useEffect)(()=>{if(w){var e;C({type:"SET_GOOGLE_SHEET_DETAILS",payload:(null==(e=w.info)?void 0:e.length)>0&&w.info[0]})}},[w]);var U=r=>{var{dryrun:a=!0}=r;return(0,l._)(function*(){try{a?t(!0):s(!0),m(null),y(null);var r=yield V({variables:{business:e,url:T.googleSheetUrl,dryrun:a}});r.data.importCredits.errors&&m(r.data.importCredits.errors),r.data.importCredits.rawData&&y(JSON.parse(r.data.importCredits.rawData)),t(!1),s(!1)}catch(e){console.log({err:e}),t(!1),s(!1)}})()},H=T.googleSheetUrl&&T.googleSheetValid,W=T.googleSheetUrl&&T.googleSheetValid,P=null==u?void 0:u.filter(e=>e.startsWith("CRITICAL")).length,$=null==u?void 0:u.filter(e=>e.startsWith("ERROR")).length,F=null==u?void 0:u.filter(e=>e.startsWith("WARNING")).length,K=null==u?void 0:u.filter(e=>e.startsWith("INFO")).length;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(E.A,{className:"mb-2",children:"Credit import"}),(0,i.jsx)(x.A,{className:"mb-2",children:"Import params"}),(0,i.jsx)(R,{state:T,dispatch:C}),(0,i.jsxs)("div",{className:"d-flex flex-row justify-content-end mb-4",children:[(0,i.jsx)(_.A,{id:"btn-save-pdf",className:"btn btn-primary btn-rounded mr-2",onClick:U,disabled:!H,loading:r,children:"Analyze"}),(0,i.jsx)(_.A,{id:"btn-save-pdf",className:"btn btn-primary btn-rounded",onClick:()=>g(!0),disabled:!W,loading:a,children:"Process Import"})]}),r&&(0,i.jsx)("div",{className:"mb-2 muted",style:{color:"#666"},children:"Processing... preview will take a few minutes"}),u&&(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsx)(x.A,{className:"mb-2",children:"Errors"}),(0,i.jsxs)("div",{style:{maxWidth:"600px",marginBottom:"20px"},children:[(0,i.jsx)(c.Ay,{id:"loglevel",isMulti:!0,placeholder:"Log level",options:["DEBUG","INFO","WARNING","ERROR","CRITICAL"].map(e=>({value:e,label:e})),value:j.map(e=>({value:e,label:e})),onChange:e=>A(e.map(e=>e.value)),styles:S.K6}),(0,i.jsx)("div",{className:"mb-2 muted",style:{color:"#666"},children:"".concat(P," critical -  ").concat($," error - ").concat(F," warning - ").concat(K," info")})]}),u.filter(e=>{if(e.includes(":")){var r=e.split(":")[0];return j.includes(r)}return!0}).map(e=>(0,i.jsxs)("div",{className:"mb-2",children:[(0,i.jsx)("code",{children:e}),(0,i.jsx)("br",{})]}))]}),!h()(p)&&(0,i.jsx)("div",{className:"d-flex flex-row",children:(0,i.jsxs)("div",{className:"col-5",children:[(0,i.jsx)(x.A,{className:"mb-2",children:"Raw Output"}),(0,i.jsx)("div",{className:"mb-2 muted",style:{color:"#666"},children:"".concat(p.length," entries validated")}),(0,i.jsx)(f(),{id:"json-pretty",data:p,style:{fontSize:"1.2em"}})]})}),(0,i.jsx)(v.A,{isOpen:o,title:"Process credit import?",message:(0,i.jsx)("p",{className:"text-danger",children:(0,i.jsxs)("b",{children:["Are you sure you are ready to proceed?",(0,i.jsx)("br",{}),"Make sure you run Analyze first and there are no Critical error left"," "]})}),loading:r,toggle:()=>g(!o),typeConfirmation:"PROCEED",onConfirmation:()=>{g(!1),U({dryrun:!1})}})]})}}}]);
2//# sourceMappingURL=2113.4bb2dc5f.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.