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X,WAC5C,GAAmB,iBAARD,GAAmC,IAAfA,EAAIoC,OAC/B,MAAM,IAAIiB,MAAM,gBAEpB,QAA0B,IAAfpD,GAAoD,iBAAfA,EAC5C,MAAM,IAAIoD,MAAM,wCAEpB,OAAO,IAAIxC,GAAgB,SAAUG,EAASsC,GAE1C,GAAwB,oBAAbnD,SACP,OAAOa,IA9HnB,IAA6BC,EACqBsC,EAA0BC,EACpEtD,EAFqBe,EA+HD,CAChBjB,IAAKA,EACLC,WAAYA,EACZsD,UAAW,WAAc,OAAOvC,GAAW,EAC3CwC,QAAS,WACL,IAAIC,EAAe,IAAIJ,MAAM,eAAgBlB,OAAOnC,EAAK,8FACzD,OAAOsD,EAAOG,EAClB,GArIsCF,EAAYtC,EAAGsC,UAAWC,EAAUvC,EAAGuC,SACjFtD,EAAYH,EADNkB,EAAGjB,IAAkBiB,EAAGhB,aAExByD,QAAUF,EACpBtD,EAAUyD,OAASJ,EACnBpD,SAASyD,KAAKC,aAAa3D,EAAWC,SAASyD,KAAKE,kBAmIpD,GACJ,CACA,SAAStB,EAAyBF,GAE9B,OAAOyB,OAAOzB,EAClB,CACA,SAASvB,EAAkBH,EAASC,GAChC,GAAuB,iBAAZD,GAAoC,OAAZA,EAC/B,MAAM,IAAIyC,MAAM,+BAEpB,QAA+B,IAApBxC,GACoB,mBAApBA,EACP,MAAM,IAAIwC,MAAM,6CAExB,oHAGA,IAAIW,EAAU","sources":["webpack://woo-payment-gateway/./node_modules/@paypal/paypal-js/dist/esm/paypal-js.js"],"sourcesContent":["/*!\n * paypal-js v8.0.5 (2024-04-16T22:14:11.318Z)\n * Copyright 2020-present, PayPal, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction findScript(url, attributes) {\n var currentScript = document.querySelector(\"script[src=\\\"\".concat(url, \"\\\"]\"));\n if (currentScript === null)\n return null;\n var nextScript = createScriptElement(url, attributes);\n // ignore the data-uid-auto attribute that gets auto-assigned to every script tag\n var currentScriptClone = currentScript.cloneNode();\n delete currentScriptClone.dataset.uidAuto;\n // check if the new script has the same number of data attributes\n if (Object.keys(currentScriptClone.dataset).length !==\n Object.keys(nextScript.dataset).length) {\n return null;\n }\n var isExactMatch = true;\n // check if the data attribute values are the same\n Object.keys(currentScriptClone.dataset).forEach(function (key) {\n if (currentScriptClone.dataset[key] !== nextScript.dataset[key]) {\n isExactMatch = false;\n }\n });\n return isExactMatch ? currentScript : null;\n}\nfunction insertScriptElement(_a) {\n var url = _a.url, attributes = _a.attributes, onSuccess = _a.onSuccess, onError = _a.onError;\n var newScript = createScriptElement(url, attributes);\n newScript.onerror = onError;\n newScript.onload = onSuccess;\n document.head.insertBefore(newScript, document.head.firstElementChild);\n}\nfunction processOptions(options) {\n var sdkBaseUrl = \"https://www.paypal.com/sdk/js\";\n if (options.sdkBaseUrl) {\n sdkBaseUrl = options.sdkBaseUrl;\n delete options.sdkBaseUrl;\n }\n var optionsWithStringIndex = options;\n var _a = Object.keys(optionsWithStringIndex)\n .filter(function (key) {\n return (typeof optionsWithStringIndex[key] !== \"undefined\" &&\n optionsWithStringIndex[key] !== null &&\n optionsWithStringIndex[key] !== \"\");\n })\n .reduce(function (accumulator, key) {\n var value = optionsWithStringIndex[key].toString();\n key = camelCaseToKebabCase(key);\n if (key.substring(0, 4) === \"data\" || key === \"crossorigin\") {\n accumulator.attributes[key] = value;\n }\n else {\n accumulator.queryParams[key] = value;\n }\n return accumulator;\n }, {\n queryParams: {},\n attributes: {},\n }), queryParams = _a.queryParams, attributes = _a.attributes;\n if (queryParams[\"merchant-id\"] &&\n queryParams[\"merchant-id\"].indexOf(\",\") !== -1) {\n attributes[\"data-merchant-id\"] = queryParams[\"merchant-id\"];\n queryParams[\"merchant-id\"] = \"*\";\n }\n return {\n url: \"\".concat(sdkBaseUrl, \"?\").concat(objectToQueryString(queryParams)),\n attributes: attributes,\n };\n}\nfunction camelCaseToKebabCase(str) {\n var replacer = function (match, indexOfMatch) {\n return (indexOfMatch ? \"-\" : \"\") + match.toLowerCase();\n };\n return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, replacer);\n}\nfunction objectToQueryString(params) {\n var queryString = \"\";\n Object.keys(params).forEach(function (key) {\n if (queryString.length !== 0)\n queryString += \"&\";\n queryString += key + \"=\" + params[key];\n });\n return queryString;\n}\nfunction createScriptElement(url, attributes) {\n if (attributes === void 0) { attributes = {}; }\n var newScript = document.createElement(\"script\");\n newScript.src = url;\n Object.keys(attributes).forEach(function (key) {\n newScript.setAttribute(key, attributes[key]);\n if (key === \"data-csp-nonce\") {\n newScript.setAttribute(\"nonce\", attributes[\"data-csp-nonce\"]);\n }\n });\n return newScript;\n}\n\n/**\n * Load the Paypal JS SDK script asynchronously.\n *\n * @param {Object} options - used to configure query parameters and data attributes for the JS SDK.\n * @param {PromiseConstructor} [PromisePonyfill=window.Promise] - optional Promise Constructor ponyfill.\n * @return {Promise} paypalObject - reference to the global window PayPal object.\n */\nfunction loadScript(options, PromisePonyfill) {\n if (PromisePonyfill === void 0) { PromisePonyfill = Promise; }\n validateArguments(options, PromisePonyfill);\n // resolve with null when running in Node or Deno\n if (typeof document === \"undefined\")\n return PromisePonyfill.resolve(null);\n var _a = processOptions(options), url = _a.url, attributes = _a.attributes;\n var namespace = attributes[\"data-namespace\"] || \"paypal\";\n var existingWindowNamespace = getPayPalWindowNamespace(namespace);\n if (!attributes[\"data-js-sdk-library\"]) {\n attributes[\"data-js-sdk-library\"] = \"paypal-js\";\n }\n // resolve with the existing global paypal namespace when a script with the same params already exists\n if (findScript(url, attributes) && existingWindowNamespace) {\n return PromisePonyfill.resolve(existingWindowNamespace);\n }\n return loadCustomScript({\n url: url,\n attributes: attributes,\n }, PromisePonyfill).then(function () {\n var newWindowNamespace = getPayPalWindowNamespace(namespace);\n if (newWindowNamespace) {\n return newWindowNamespace;\n }\n throw new Error(\"The window.\".concat(namespace, \" global variable is not available.\"));\n });\n}\n/**\n * Load a custom script asynchronously.\n *\n * @param {Object} options - used to set the script url and attributes.\n * @param {PromiseConstructor} [PromisePonyfill=window.Promise] - optional Promise Constructor ponyfill.\n * @return {Promise} returns a promise to indicate if the script was successfully loaded.\n */\nfunction loadCustomScript(options, PromisePonyfill) {\n if (PromisePonyfill === void 0) { PromisePonyfill = Promise; }\n validateArguments(options, PromisePonyfill);\n var url = options.url, attributes = options.attributes;\n if (typeof url !== \"string\" || url.length === 0) {\n throw new Error(\"Invalid url.\");\n }\n if (typeof attributes !== \"undefined\" && typeof attributes !== \"object\") {\n throw new Error(\"Expected attributes to be an object.\");\n }\n return new PromisePonyfill(function (resolve, reject) {\n // resolve with undefined when running in Node or Deno\n if (typeof document === \"undefined\")\n return resolve();\n insertScriptElement({\n url: url,\n attributes: attributes,\n onSuccess: function () { return resolve(); },\n onError: function () {\n var defaultError = new Error(\"The script \\\"\".concat(url, \"\\\" failed to load. Check the HTTP status code and response body in DevTools to learn more.\"));\n return reject(defaultError);\n },\n });\n });\n}\nfunction getPayPalWindowNamespace(namespace) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return window[namespace];\n}\nfunction validateArguments(options, PromisePonyfill) {\n if (typeof options !== \"object\" || options === null) {\n throw new Error(\"Expected an options object.\");\n }\n if (typeof PromisePonyfill !== \"undefined\" &&\n typeof PromisePonyfill !== \"function\") {\n throw new Error(\"Expected PromisePonyfill to be a function.\");\n }\n}\n\n// replaced with the package.json version at build time\nvar version = \"8.0.5\";\n\nexport { loadCustomScript, loadScript, version };\n"],"names":["createScriptElement","url","attributes","newScript","document","createElement","src","Object","keys","forEach","key","setAttribute","loadScript","options","PromisePonyfill","Promise","validateArguments","resolve","_a","sdkBaseUrl","params","queryString","optionsWithStringIndex","filter","reduce","accumulator","replacer","value","toString","match","indexOfMatch","toLowerCase","replace","substring","queryParams","indexOf","concat","length","processOptions","namespace","existingWindowNamespace","getPayPalWindowNamespace","currentScript","querySelector","nextScript","currentScriptClone","cloneNode","dataset","uidAuto","isExactMatch","findScript","loadCustomScript","then","newWindowNamespace","Error","reject","onSuccess","onError","defaultError","onerror","onload","head","insertBefore","firstElementChild","window","version"],"sourceRoot":""}