Files
php_assessment_2/wp-content/plugins/woocommerce-payments/dist/index.js
T

9 lines
1.1 MiB
JavaScript
Raw Normal View History

2025-02-05 23:15:46 +01:00
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={7138:(e,t)=>{"use strict";const n={setOnLoadError:e=>{},setOnLoaderStart:e=>{}},o={"account-onboarding":{setFullTermsOfServiceUrl:e=>{},setRecipientTermsOfServiceUrl:e=>{},setPrivacyPolicyUrl:e=>{},setSkipTermsOfServiceCollection:e=>{},setCollectionOptions:e=>{},setOnExit:e=>{},setOnStepChange:e=>{}},"account-management":{setCollectionOptions:e=>{}},"notification-banner":{setCollectionOptions:e=>{},setOnNotificationsChange:e=>{}},payments:{setDefaultFilters:e=>{}},"payment-details":{setPayment:e=>{},setOnClose:e=>{}},"tax-settings":{setHideProductTaxCodeSelector:e=>{},setDisplayHeadOfficeCountries:e=>{},setOnTaxSettingsUpdated:e=>{}},"tax-registrations":{setOnAfterTaxRegistrationAdded:e=>{},setDisplayCountries:e=>{}}},r={"account-onboarding":"stripe-connect-account-onboarding",payments:"stripe-connect-payments","payment-details":"stripe-connect-payment-details",payouts:"stripe-connect-payouts","payouts-list":"stripe-connect-payouts-list",balances:"stripe-connect-balances","account-management":"stripe-connect-account-management","notification-banner":"stripe-connect-notification-banner",documents:"stripe-connect-documents","tax-registrations":"stripe-connect-tax-registrations","tax-settings":"stripe-connect-tax-settings"},a="loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used",i="https://connect-js.stripe.com/v1.0/connect.js";let s=null;const c=(e,t)=>{var a;const i=(()=>{try{return t.fetchClientSecret()}catch(e){return Promise.reject(e)}})(),s=null!==(a=t.metaOptions)&&void 0!==a?a:{},c=e.then((e=>e.initialize(Object.assign(Object.assign({},t),{metaOptions:Object.assign(Object.assign({},s),{eagerClientSecretPromise:i})}))));return{create:e=>{let t=r[e];t||(t=e);const a=document.createElement(t),i=(e=>e in o)(e)?o[e]:{},s=Object.assign(Object.assign({},i),n);for(const e in s)a[e]=function(t){c.then((()=>{this[`${e}InternalOnly`](t)}))};return c.then((t=>{if(!a.isConnected&&!a.setConnector){const e=a.style.display;a.style.display="none",document.body.appendChild(a),document.body.removeChild(a),a.style.display=e}if(!a||!a.setConnector)throw new Error(`Element ${e} was not transformed into a custom element. Are you using a documented component? See https://docs.stripe.com/connect/supported-embedded-components for a list of supported components`);a.setConnector(t.connect)})),a},update:e=>{c.then((t=>{t.update(e)}))},debugInstance:()=>c,logout:()=>c.then((e=>e.logout()))}},d=e=>(window.StripeConnect=window.StripeConnect||{},window.StripeConnect.optimizedLoading=!0,{initialize:t=>{var n;const o=null!==(n=t.metaOptions)&&void 0!==n?n:{};return e.init(Object.assign(Object.assign({},t),{metaOptions:Object.assign(Object.assign({},o),{sdk:!0,sdkOptions:{sdkVersion:"3.3.15"}})}))}});t.loadConnectAndInitialize=e=>{const t=(null!==s||(s=new Promise(((e,t)=>{if("undefined"!=typeof window)if(window.StripeConnect&&console.warn(a),window.StripeConnect){const t=d(window.StripeConnect);e(t)}else try{let n=document.querySelectorAll(`script[src="${i}"]`)[0]||document.querySelectorAll('script[src="https://connect-js.stripe.com/v0.1/connect.js"]')[0]||null;n?console.warn(a):n||(n=(()=>{const e=document.createElement("script");if(e.src=i,!document.head)throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");return document.head.appendChild(e),e})()),n.addEventListener("load",(()=>{if(window.StripeConnect){const t=d(window.StripeConnect);e(t)}else t(new Error("Connect.js did not load the necessary objects"))})),n.addEventListener("error",(()=>{t(new Error("Failed to load Connect.js"))}))}catch(e){t(e)}else t("ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.")}))),s);if(null==e)throw new Err
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,cv=Ft("svg",{target:"e1bj2jdf2"})("width:",Yn.spinnerSize,"px;height:",Yn.spinnerSize,"px;display:inline-block;margin:5px 11px 0;position:relative;color:var( --wp-admin-theme-color );overflow:visible;"),dv={name:"9s4963",styles:"fill:transparent;stroke-width:1.5px"},lv=Ft("circle",{target:"e1bj2jdf1"})(dv,";stroke:",zn.gray[300],";"),uv=Ft("path",{target:"e1bj2jdf0"})(dv,";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ",sv,";");function mv(e){let{className:t,...n}=e;return(0,q.createElement)(cv,K({className:Ro()("components-spinner",t),viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",role:"presentation",focusable:"false"},n),(0,q.createElement)(lv,{cx:"50",cy:"50",r:"50",vectorEffect:"non-scaling-stroke"}),(0,q.createElement)(uv,{d:"m 50 0 a 50 50 0 0 1 50 50",vectorEffect:"non-scaling-stroke"}))}const pv=G().createElement(Po.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},G().createElement(Po.Path,{d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z",stroke:"#F0B849",strokeWidth:"1.5"}),G().createElement(Po.Path,{d:"M13 7H11V13H13V7Z",fill:"#F0B849"}),G().createElement(Po.Path,{d:"M13 15H11V17H13V15Z",fill:"#F0B849"})),yv=({query:{id:e}})=>{const{dispute:t,error:n,isLoading:o}=(e=>{const{dispute:t,error:n,isLoading:o}=(0,oc.useSelect)((t=>{const{getDispute:n,getDisputeError:o,isResolving:r}=t(Li);return{dispute:n(e),error:o(e),isLoading:r("getDispute",[e])}}),[e]);return{dispute:t,isLoading:o,error:n}})(e);return(0,Y.useEffect)((()=>{if(!o&&(null==t?void 0:t.charge)){const e=t.charge,n=Pi({page:"wc-admin",path:"/payments/transactions/details",id:e.payment_intent,transaction_id:e.balance_transaction,type:"dispute"});(0,My.getHistory)().replace(n)}}),[t,o]),G().createElement(La,null,G().createElement(Sa,{direction:"column",className:"wcpay-dispute-detail-legacy-redirect"},n?G().createElement(G().Fragment,null,G().createElement(ka,null,G().createElement(Or,{icon:pv,type:"warning",size:32})),G().createElement(ka,null,G().createElement("div",null,G().createElement("b",null,"Error retrieving dispute")),G().createElement("div",null,"Please check your network and try again."))):G().createElement(G().Fragment,null,G().createElement(ka,null,G().createElement(mv,null)),G().createElement(ka,null,G().createElement("div",null,G().createElement("b",null,"One moment please")),G().createElement("div",null,"Redirecting to payment details…")))))},hv=(0,q.forwardRef)((function e(t,n){let{label:o,hideLabelFromVision:r,value:a,help:i,className:s,onChange:c,type:d="text",...l}=t;const u=`inspector-text-control-${(0,Do.useInstanceId)(e)}`;return(0,q.createElement)(eg,{label:o,hideLabelFromVision:r,id:u,help:i,className:s},(0,q.createElement)("input",K({className:"components-text-control__input",type:d,id:u,value:a,onChange:e=>c(e.target.value),"aria-describedby":i?u+"__help":void 0,ref:n},l)))})),_v=ut("box-shadow:0 0 0 transparent;transition:box-shadow 0.1s linear;border-radius:",Yn.radiusBlockUi,";border:",Yn.borderWidth," solid ",zn.ui.border,";",""),fv=ut("border-color:var( --wp-admin-theme-color );box-shadow:0 0 0 calc( ",Yn.borderWidthFocus," - ",Yn.borderWidth," ) var( --wp-admin-theme-color );outline:2px solid transparent;",""),gv=ut("font-family:",Hf("default.fontFamily"),";padding:6px 8px;",_v,";font-size:",Hf("mobileTextMinFontSize"),";line-height:normal;","@media (min-width: 600px)","{font-size:",Hf("default.fontSize"),";line-height:normal;}&:focus{",fv,";}&::-webkit-input-placeholder{color:",zn.darkGray.placeholder,";}&::-moz-placeholder{opacity:1;color:",zn.darkGray.placeholder,";}&:-ms-input-placeholder{color:",zn.darkGray.placeholder,";}.is-dark-theme &{&::-webkit-input-placeholder{color:",zn.lightGray.placeholder,";}&::-moz-placeholder{opacity:1;color:",zn.lightGray.placeholder,";}&:-ms-input-placeholder{color:",zn.lightGray.placeholder,";}}",""),vv=Ft("textarea",{target:"ebk7yr50"})("width:100%;",gv,";");function wv(e){let{label:t,hideLabelFromVi