HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wordpress/wp-content/plugins/bit-integrations/assets/bi.110.773.js
var _=Object.defineProperty;var A=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var D=(s,e,i)=>e in s?_(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,k=(s,e)=>{for(var i in e||(e={}))y.call(e,i)&&D(s,i,e[i]);if(A)for(var i of A(e))I.call(e,i)&&D(s,i,e[i]);return s};var m=(s,e,i)=>new Promise((n,o)=>{var t=a=>{try{d(i.next(a))}catch(r){o(r)}},h=a=>{try{d(i.throw(a))}catch(r){o(r)}},d=a=>a.done?n(a.value):Promise.resolve(a.value).then(t,h);d((i=i.apply(s,e)).next())});import{c as w,_ as u,s as R}from"./bi.878.0.js";import{y as z,u as S}from"./bi.451.455.js";const O=(s,e,i,n,o,t,h,d,a)=>{let r=k({},e);if(h){const f=k({},d);f[s.target.name]="",a(k({},f))}switch(r[s.target.name]=s.target.value,s.target.name){case"spreadsheetId":r=F(r,n,i,o,t);break;case"worksheetName":r=$(r,n,i,o,t);break}i(k({},r))},F=(s,e,i,n,o)=>{var h,d,a,r,f,c,l,g,p;const t=z(s);return t.worksheetName="",t.headerRow="A1",t.field_map=[{formField:"",googleSheetField:""}],(d=(h=t==null?void 0:t.default)==null?void 0:h.worksheets)!=null&&d[s.spreadsheetId]?Object.keys((r=(a=t==null?void 0:t.default)==null?void 0:a.worksheets)==null?void 0:r[s.spreadsheetId]).length===1&&(t.worksheetName=(c=(f=t==null?void 0:t.default)==null?void 0:f.worksheets)==null?void 0:c[s.spreadsheetId][0].properties.title,(p=(g=(l=t==null?void 0:t.default)==null?void 0:l.worksheets)==null?void 0:g.headers)!=null&&p[t.worksheetName]||b(e,t,i,n,o)):U(e,t,i,n,o),t},$=(s,e,i,n,o)=>{var h,d,a;const t=k({},s);return t.headerRow="A1",t.field_map=[{formField:"",googleSheetField:""}],(a=(d=(h=t==null?void 0:t.default)==null?void 0:h.worksheets)==null?void 0:d.headers)!=null&&a[s.worksheetName]||b(e,t,i,n,o),t},H=(s,e,i,n,o)=>{var d;const t=!((d=e.tokenDetails)!=null&&d.selectedAuthType)||e.tokenDetails.selectedAuthType==="Custom Authorization",h={formID:s,id:e.id,clientId:t?e.clientId:e.oneClickAuthCredentials.clientId,clientSecret:t?e.clientSecret:e.oneClickAuthCredentials.clientSecret,tokenDetails:e.tokenDetails,ownerEmail:e.ownerEmail};n(!0),w(h,"gsheet_refresh_spreadsheets").then(a=>{if(a&&a.success){const r=k({},e);r.default||(r.default={}),a.data.spreadsheets&&(r.default.spreadsheets=a.data.spreadsheets),a.data.tokenDetails&&(r.tokenDetails=a.data.tokenDetails),o({show:!0,msg:u("Spreadsheet refreshed","bit-integrations")}),i(k({},r))}else a&&a.data&&a.data.data||!a.success&&typeof a.data=="string"?o({show:!0,msg:R(u("Spreadsheet refresh failed Cause: %s. please try again","bit-integrations"),a.data.data||a.data)}):o({show:!0,msg:u("Spreadsheet refresh failed. please try again","bit-integrations")});n(!1)}).catch(()=>n(!1))},U=(s,e,i,n,o)=>{const{spreadsheetId:t}=e;if(!t)return;n(!0);const h={formID:s,spreadsheetId:t,tokenDetails:e.tokenDetails};w(h,"gsheet_refresh_worksheets").then(d=>{if(d&&d.success){const a=k({},e);d.data.worksheets&&(a.default.worksheets||(a.default.worksheets={}),a.default.worksheets[t]=d.data.worksheets),d.data.tokenDetails&&(a.tokenDetails=d.data.tokenDetails),o({show:!0,msg:u("Worksheets refreshed","bit-integrations")}),i(k({},a))}else o({show:!0,msg:u("Worksheets refresh failed. please try again","bit-integrations")});n(!1)}).catch(()=>n(!1))},b=(s,e,i,n,o)=>{var c;const{spreadsheetId:t,worksheetName:h,header:d,headerRow:a}=e;if(!t&&!h&&!d&&!a)return;n(!0);const r=!((c=e.tokenDetails)!=null&&c.selectedAuthType)||e.tokenDetails.selectedAuthType==="Custom Authorization",f={formID:s,spreadsheetId:t,worksheetName:h,header:d,headerRow:a,clientId:r?e.clientId:e.oneClickAuthCredentials.clientId,clientSecret:r?e.clientSecret:e.oneClickAuthCredentials.clientSecret,tokenDetails:e.tokenDetails};w(f,"gsheet_refresh_worksheet_headers").then(l=>{var g;if(l&&l.success){const p=k({},e);((g=l.data.worksheet_headers)==null?void 0:g.length)>0?(p.default.headers||(p.default.headers={}),p.default.headers[t]||(p.default.headers[t]={}),p.default.headers[t][h]||(p.default.headers[t][h]={}),p.default.headers[t][h][a]=l.data.worksheet_headers,l.data.tokenDetails&&(p.tokenDetails=l.data.tokenDetails),o({show:!0,msg:u("Worksheet Headers refreshed","bit-integrations")})):o({show:!0,msg:u("No Worksheet headers found. Try changing the header row number or try again","bit-integrations")}),l.data.tokenDetails&&(p.tokenDetails=l.data.tokenDetails),i(k({},p))}else o({show:!0,msg:u("Worksheet Headers refresh failed. please try again","bit-integrations")});n(!1)}).catch(()=>n(!1))},q=(s,e,i,n)=>{let o="";if(e==="One Click Authorization")o=s.oneClickAuthCredentials.clientId;else if(e==="Custom Authorization"){if(!s.clientId||!s.clientSecret){i({clientId:s.clientId?"":u("Client Id can't be empty","bit-integrations"),clientSecret:s.clientSecret?"":u("Secret key can't be empty","bit-integrations")});return}o=s.clientId}n(!0);const t="https://www.googleapis.com/auth/drive",d=e==="One Click Authorization"?"https://auth-apps.bitapps.pro/redirect/v2":`${btcbi.api.base}/redirect`,{href:a,hash:r}=window.location,f=r?a.replace(r,"#/auth-response/"):`${a}#/auth-response/`,c=`https://accounts.google.com/o/oauth2/v2/auth?scope=${t}&access_type=offline&prompt=consent&response_type=code&state=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(d)}&client_id=${o}`,l=window.open(c,"googleSheet","width=400,height=609,toolbar=off");if(e==="Custom Authorization"){const g=setInterval(()=>{l.closed&&(clearInterval(g),n(!1))},500)}},C=(s,e,i,n,o,t,h,d,a)=>m(void 0,null,function*(){if(!o)return;const r={};r.code=s.code||"",r.clientId=o==="One Click Authorization"?e.oneClickAuthCredentials.clientId:e.clientId,r.clientSecret=o==="One Click Authorization"?e.oneClickAuthCredentials.clientSecret:e.clientSecret;const f="https://auth-apps.bitapps.pro/redirect/v2";r.redirectURI=o==="One Click Authorization"?f:`${btcbi.api.base}/redirect`,d(!0),yield w(r,"gsheet_generate_token").then(c=>c).then(c=>m(void 0,null,function*(){c&&c.success?(i(l=>S(l,g=>{g.tokenDetails=c.data})),n(!0),a({show:!0,msg:u("Authorized Successfully","bit-integrations")})):c&&c.data&&c.data.data||!c.success&&typeof c.data=="string"?a({show:!0,msg:`${u("Authorization failed Cause:","bit-integrations")}${c.data.data||c.data}. ${u("please try again","bit-integrations")}`}):a({show:!0,msg:u("Authorization failed. please try again","bit-integrations")}),d(!1)}))}),E=s=>!((s.field_map?s.field_map.filter(i=>!i.formField&&!i.googleSheetField):[]).length>0);export{U as a,b,q as c,E as d,O as h,H as r,C as t};