@basis-theory/web-elements 1.24.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [2.0.0] - 2025-09-08
2
+
3
+ ### Breaking Changes
4
+
5
+ - eb651be 2025-08-29 feat!: remove material ui (#478) by kevin@basistheory.com
6
+
7
+ ### Features
8
+
9
+ - 5f3b347 2025-09-03 feat: collect device info (#516) by kevin@basistheory.com
10
+ - c7f606d 2025-09-01 feat: allow style customization of elements container (#518) by kevin@basistheory.com
11
+ - 97264fd 2025-08-21 feat: remove axios and btjs (#495) by kevin@basistheory.com
12
+
13
+ ### Bug Fixes
14
+
15
+ - 8dbb18a 2025-08-29 fix: make input field always transparent (#517) by kevin@basistheory.com
16
+
1
17
  ## [1.24.2] - 2025-08-21
2
18
 
3
19
  ### Bug Fixes
@@ -50,6 +66,12 @@
50
66
  - 528c197 2025-07-29 fix: release (#480) by kevin@basistheory.com
51
67
  - a9f3fae 2025-07-29 fix: revert latest (#479) by kevin@basistheory.com
52
68
 
69
+ ## [1.22.1] - 2025-07-29
70
+
71
+ ### Bug Fixes
72
+
73
+ - a229582 2025-07-22 fix: do not snakeCase/camelCase tokenize (#477) by kevin@basistheory.com
74
+
53
75
  ## [1.22.0] - 2025-07-18
54
76
 
55
77
  ### Features
@@ -1 +1 @@
1
- !function(){function e(e,r,t,n,o,i,l){try{var c=e[i](l),u=c.value}catch(e){t(e);return}c.done?r(u):Promise.resolve(u).then(n,o)}function r(r){return function(){var t=this,n=arguments;return new Promise(function(o,i){var l=r.apply(t,n);function c(r){e(l,o,i,c,u,"next",r)}function u(r){e(l,o,i,c,u,"throw",r)}c(void 0)})}}function t(e,r){var t,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){var u=[i,c];if(t)throw TypeError("Generator is already executing.");for(;l;)try{if(t=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return l.label++,{value:u[1],done:!1};case 5:l.label++,n=u[1],u=[0];continue;case 7:u=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){l=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){l.label=u[1];break}if(6===u[0]&&l.label<o[1]){l.label=o[1],o=u;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(u);break}o[2]&&l.ops.pop(),l.trys.pop();continue}u=r.call(e,l)}catch(e){u=[6,e],n=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var n,o,i,l,c,u,s,a=(l=r(function(e,r){var n,l,c,u,s,a,d,f=arguments;return t(this,function(t){switch(t.label){case 0:if(n=f.length>2&&void 0!==f[2]?f[2]:{},o)return[2];d=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({level:r,message:e,service:"web-elements-loader",env:a=!i||(null==i?void 0:i.includes("localhost"))?"local":i.includes("dev")?"dev":"prod",referrer:null===(l=document)||void 0===l?void 0:l.referrer,origin:null===(c=window)||void 0===c?void 0:c.location.origin,url:null===(u=window)||void 0===u?void 0:u.location.href,userAgent:null===(s=navigator)||void 0===s?void 0:s.userAgent},n),["local","dev"].includes(a)&&console.log(d),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch("https://http-intake.logs.datadoghq.com/v1/input/".concat("pubb96b84a13912504f4354f2d794ea4fab"),{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json"}})];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("There was an error sending telemetry."),[3,4];case 4:return[2]}})}),c=function(e,r){return l.apply(this,arguments)},{disableTelemetry:function(e){o=e},setBaseUrl:function(e){i=e},log:{error:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"error",r)},info:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"info",r)},warn:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"warn",r)}}}),d=function(e){var r=document.querySelector('script[src^="'.concat(e,'"]'));if(r)return r;var t=document.head||document.body;if(!t)throw Error("No <head> or <body> elements found in the document.");var n=Object.assign(document.createElement("script"),{src:e});return t.append(n),n},f="Tried to load BasisTheoryElements in a non-DOM environment.",p="Unable to load the Elements script. This may be due to network restrictions or browser extensions like ad blockers interfering with script loading. Check browser settings or network connection and try again.",h=function(e,n){return new Promise(function(o,i){var l,c=d(e),u=!1;c.addEventListener("load",function(){window.BasisTheoryElements?o(window.BasisTheoryElements):(r(function(){return t(this,function(e){switch(e.label){case 0:return[4,a.log.error("Elements not found on window on load",{logType:"elementsNotFoundOnWindow",logOrigin:"loadScript",retryCount:n})];case 1:return e.sent(),[2]}})})(),i(Error("Basis Theory Elements did not load properly. Check network tab for more details.")))}),c.addEventListener("error",(l=r(function(r){var l,s,d;return t(this,function(t){switch(t.label){case 0:if(u)return[2];return u=!0,[4,a.log.error("Elements script onError event",{logType:"elementsScriptOnError",logOrigin:"loadScript",retryCount:n,event:{message:null==r?void 0:r.message,source:null==r?void 0:r.filename,lineno:null==r?void 0:r.lineno,colno:null==r?void 0:r.colno,error:null==r?void 0:r.error,target:null==r?void 0:r.target}})];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,3,,5]),null==c||c.remove(),[3,5];case 3:return l=t.sent(),[4,a.log.error("Error removing script from DOM on retry attempt ".concat(n),{logType:"scriptRemovalError",logOrigin:"loadScript",retryCount:n,removalError:l})];case 4:return t.sent(),[3,5];case 5:if(0===n)return h(e,n+1).then(o).catch(i),[2];t.label=6;case 6:return t.trys.push([6,12,,14]),[4,fetch(e)];case 7:if((s=t.sent()).ok)return[3,9];return[4,a.log.error("Second attempt to load elements script failed, fetch failed with status: ".concat(s.status,"."),{logType:"elementsScriptFetchFailure",logOrigin:"loadScript",retryCount:n,fetchResult:"error",fetchResponse:s})];case 8:return t.sent(),i(Error(f)),[3,11];case 9:return[4,a.log.error("Second attempt to load elements script failed, fetch success",{logType:"elementsScriptFetchFailure",logOrigin:"loadScript",retryCount:n,fetchResult:"success",fetchResponse:s})];case 10:t.sent(),i(Error(p)),t.label=11;case 11:return[3,14];case 12:return d=t.sent(),[4,a.log.error("Second attempt failed to load elements script failed, fetch network error.",{logType:"elementsScriptFetchError",logOrigin:"loadScript",retryCount:n,fetchResult:"error",fetchError:d})];case 13:return t.sent(),i(Error(p)),[3,14];case 14:return i((null==r?void 0:r.error)||(null==r?void 0:r.message)||Error(p)),[2]}})}),function(e){return l.apply(this,arguments)}))})},v="1.24.2",y=(u=r(function(e,o){var i,l,c,u,s,d,p,y;return t(this,function(m){switch(m.label){case 0:if(!e||0===e.length)throw Error("API key is required");return i=(null==o?void 0:o._devMode)?"js.flock-dev.com":"js.basistheory.com",a.setBaseUrl(i),a.disableTelemetry(!!(null==o?void 0:o.disableTelemetry)),l="https://".concat(i,"/web-elements/").concat(v,"/client/index.js"),c="https://".concat(i,"/web-elements/").concat(v,"/hosted-elements/"),[4,(n||(n=new Promise(function(e,n){var o;if(("undefined"==typeof window?"undefined":(o=window)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)!="object"){r(function(){return t(this,function(e){switch(e.label){case 0:return[4,a.log.warn(f,{logType:"elementsNonDomError",logOrigin:"loadElements"})];case 1:return e.sent(),n(Error(f)),[2]}})})();return}if(window.BasisTheoryElements){e(window.BasisTheoryElements);return}h(new URL(l).toString().replace(RegExp("\\/$","u"),""),0).then(e).catch(function(e){n(e)})})),n)];case 1:return[2,m.sent().init(e,c,!1,null===(u=null==o?void 0:o.useSameOriginApi)||void 0===u||u,null!==(s=null==o?void 0:o.disableTelemetry)&&void 0!==s&&s,null!==(d=null==o?void 0:o.debug)&&void 0!==d&&d,null!==(p=null==o?void 0:o.useUat)&&void 0!==p&&p,null!==(y=null==o?void 0:o.useNetworkCheck)&&void 0!==y&&y)]}})}),function(e,r){return u.apply(this,arguments)}),m=((s=m||{}).DECIMAL="decimal",s.EMAIL="email",s.NONE="none",s.NUMERIC="numeric",s.SEARCH="search",s.TEL="tel",s.TEXT="text",s.URL="url",s);function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function w(e,r){return(w=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function E(e,r,t){return(E=g()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&w(o,t.prototype),o}).apply(null,arguments)}function O(e){var r="function"==typeof Map?new Map:void 0;return(O=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return E(e,arguments,b(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),w(t,e)})(e)}O(Error),O(Error),O(Error),"undefined"!=typeof window&&document.currentScript&&!window.basistheory&&(window.basistheory=y)}();
1
+ !function(){function e(e,r,t,n,o,i,l){try{var c=e[i](l),u=c.value}catch(e){t(e);return}c.done?r(u):Promise.resolve(u).then(n,o)}function r(r){return function(){var t=this,n=arguments;return new Promise(function(o,i){var l=r.apply(t,n);function c(r){e(l,o,i,c,u,"next",r)}function u(r){e(l,o,i,c,u,"throw",r)}c(void 0)})}}function t(e,r){var t,n,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){var u=[i,c];if(t)throw TypeError("Generator is already executing.");for(;l;)try{if(t=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return l.label++,{value:u[1],done:!1};case 5:l.label++,n=u[1],u=[0];continue;case 7:u=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){l=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){l.label=u[1];break}if(6===u[0]&&l.label<o[1]){l.label=o[1],o=u;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(u);break}o[2]&&l.ops.pop(),l.trys.pop();continue}u=r.call(e,l)}catch(e){u=[6,e],n=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var n,o,i,l,c,u,s,a=(l=r(function(e,r){var n,l,c,u,s,a,d,f=arguments;return t(this,function(t){switch(t.label){case 0:if(n=f.length>2&&void 0!==f[2]?f[2]:{},o)return[2];d=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({level:r,message:e,service:"web-elements-loader",env:a=!i||(null==i?void 0:i.includes("localhost"))?"local":i.includes("dev")?"dev":"prod",referrer:null===(l=document)||void 0===l?void 0:l.referrer,origin:null===(c=window)||void 0===c?void 0:c.location.origin,url:null===(u=window)||void 0===u?void 0:u.location.href,userAgent:null===(s=navigator)||void 0===s?void 0:s.userAgent},n),["local","dev"].includes(a)&&console.log(d),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,fetch("https://http-intake.logs.datadoghq.com/v1/input/".concat("pubb96b84a13912504f4354f2d794ea4fab"),{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json"}})];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("There was an error sending telemetry."),[3,4];case 4:return[2]}})}),c=function(e,r){return l.apply(this,arguments)},{disableTelemetry:function(e){o=e},setBaseUrl:function(e){i=e},log:{error:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"error",r)},info:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"info",r)},warn:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c(e,"warn",r)}}}),d=function(e){var r=document.querySelector('script[src^="'.concat(e,'"]'));if(r)return r;var t=document.head||document.body;if(!t)throw Error("No <head> or <body> elements found in the document.");var n=Object.assign(document.createElement("script"),{src:e});return t.append(n),n},f="Tried to load BasisTheoryElements in a non-DOM environment.",p="Unable to load the Elements script. This may be due to network restrictions or browser extensions like ad blockers interfering with script loading. Check browser settings or network connection and try again.",h=function(e,n){return new Promise(function(o,i){var l,c=d(e),u=!1;c.addEventListener("load",function(){window.BasisTheoryElements?o(window.BasisTheoryElements):(r(function(){return t(this,function(e){switch(e.label){case 0:return[4,a.log.error("Elements not found on window on load",{logType:"elementsNotFoundOnWindow",logOrigin:"loadScript",retryCount:n})];case 1:return e.sent(),[2]}})})(),i(Error("Basis Theory Elements did not load properly. Check network tab for more details.")))}),c.addEventListener("error",(l=r(function(r){var l,s,d;return t(this,function(t){switch(t.label){case 0:if(u)return[2];return u=!0,[4,a.log.error("Elements script onError event",{logType:"elementsScriptOnError",logOrigin:"loadScript",retryCount:n,event:{message:null==r?void 0:r.message,source:null==r?void 0:r.filename,lineno:null==r?void 0:r.lineno,colno:null==r?void 0:r.colno,error:null==r?void 0:r.error,target:null==r?void 0:r.target}})];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,3,,5]),null==c||c.remove(),[3,5];case 3:return l=t.sent(),[4,a.log.error("Error removing script from DOM on retry attempt ".concat(n),{logType:"scriptRemovalError",logOrigin:"loadScript",retryCount:n,removalError:l})];case 4:return t.sent(),[3,5];case 5:if(0===n)return h(e,n+1).then(o).catch(i),[2];t.label=6;case 6:return t.trys.push([6,12,,14]),[4,fetch(e)];case 7:if((s=t.sent()).ok)return[3,9];return[4,a.log.error("Second attempt to load elements script failed, fetch failed with status: ".concat(s.status,"."),{logType:"elementsScriptFetchFailure",logOrigin:"loadScript",retryCount:n,fetchResult:"error",fetchResponse:s})];case 8:return t.sent(),i(Error(f)),[3,11];case 9:return[4,a.log.error("Second attempt to load elements script failed, fetch success",{logType:"elementsScriptFetchFailure",logOrigin:"loadScript",retryCount:n,fetchResult:"success",fetchResponse:s})];case 10:t.sent(),i(Error(p)),t.label=11;case 11:return[3,14];case 12:return d=t.sent(),[4,a.log.error("Second attempt failed to load elements script failed, fetch network error.",{logType:"elementsScriptFetchError",logOrigin:"loadScript",retryCount:n,fetchResult:"error",fetchError:d})];case 13:return t.sent(),i(Error(p)),[3,14];case 14:return i((null==r?void 0:r.error)||(null==r?void 0:r.message)||Error(p)),[2]}})}),function(e){return l.apply(this,arguments)}))})},v="2.0.0",y=(u=r(function(e,o){var i,l,c,u,s,d,p,y;return t(this,function(m){switch(m.label){case 0:if(!e||0===e.length)throw Error("API key is required");return i=(null==o?void 0:o._devMode)?"js.flock-dev.com":"js.basistheory.com",a.setBaseUrl(i),a.disableTelemetry(!!(null==o?void 0:o.disableTelemetry)),l="https://".concat(i,"/web-elements/").concat(v,"/client/index.js"),c="https://".concat(i,"/web-elements/").concat(v,"/hosted-elements/"),[4,(n||(n=new Promise(function(e,n){var o;if(("undefined"==typeof window?"undefined":(o=window)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o)!="object"){r(function(){return t(this,function(e){switch(e.label){case 0:return[4,a.log.warn(f,{logType:"elementsNonDomError",logOrigin:"loadElements"})];case 1:return e.sent(),n(Error(f)),[2]}})})();return}if(window.BasisTheoryElements){e(window.BasisTheoryElements);return}h(new URL(l).toString().replace(RegExp("\\/$","u"),""),0).then(e).catch(function(e){n(e)})})),n)];case 1:return[2,m.sent().init(e,c,!1,null===(u=null==o?void 0:o.useSameOriginApi)||void 0===u||u,null!==(s=null==o?void 0:o.disableTelemetry)&&void 0!==s&&s,null!==(d=null==o?void 0:o.debug)&&void 0!==d&&d,null!==(p=null==o?void 0:o.useUat)&&void 0!==p&&p,null!==(y=null==o?void 0:o.useNetworkCheck)&&void 0!==y&&y)]}})}),function(e,r){return u.apply(this,arguments)}),m=((s=m||{}).DECIMAL="decimal",s.EMAIL="email",s.NONE="none",s.NUMERIC="numeric",s.SEARCH="search",s.TEL="tel",s.TEXT="text",s.URL="url",s);function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function w(e,r){return(w=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function E(e,r,t){return(E=g()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&w(o,t.prototype),o}).apply(null,arguments)}function O(e){var r="function"==typeof Map?new Map:void 0;return(O=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return E(e,arguments,b(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),w(t,e)})(e)}O(Error),O(Error),O(Error),"undefined"!=typeof window&&document.currentScript&&!window.basistheory&&(window.basistheory=y)}();
@@ -318,15 +318,15 @@ const $6477b722f43d24f2$export$2b0a6e5a1c78018f = (elementsUrl)=>{
318
318
 
319
319
 
320
320
 
321
- // Auto-generated version file
322
- const $eef42ce81412d9ae$export$83d89fbfd8236492 = '1.24.2';
323
-
324
-
325
321
  // Build-time generated URLs for regular deployment
326
322
  const $5dbc1ef1648671b0$export$67c92c3b857d033a = null;
327
323
  const $5dbc1ef1648671b0$export$9c5c779c8690dca6 = null;
328
324
 
329
325
 
326
+ // Auto-generated version file
327
+ const $eef42ce81412d9ae$export$83d89fbfd8236492 = '2.0.0';
328
+
329
+
330
330
  const $316c9c8f85cead13$var$TEST_ENV = 'js.flock-dev.com';
331
331
  const $316c9c8f85cead13$var$DEFAULT_ENV = 'js.basistheory.com';
332
332
  const $316c9c8f85cead13$export$cbe2892587230861 = async (apiKey, options)=>{
@@ -344,7 +344,9 @@ const $316c9c8f85cead13$export$cbe2892587230861 = async (apiKey, options)=>{
344
344
 
345
345
  var $001f46d7c9d998c1$exports = {};
346
346
 
347
+ $parcel$export($001f46d7c9d998c1$exports, "AUTOCOMPLETE_VALUES", () => $ef6e1b024b683770$export$dea6ebbc92df4fa3);
347
348
  $parcel$export($001f46d7c9d998c1$exports, "CARD_BRANDS", () => $ef6e1b024b683770$export$51be6d94c4fcf45);
349
+ $parcel$export($001f46d7c9d998c1$exports, "CARD_ICON_POSITIONS", () => $ef6e1b024b683770$export$829c91d8f039f695);
348
350
  var $94e2e5607fad631e$exports = {};
349
351
  var $eb72fa80cc6cce99$exports = {};
350
352
 
@@ -921,6 +923,7 @@ const $79ee1b48c572ec2c$export$fc323aec0bf844b = [
921
923
  ];
922
924
  const $79ee1b48c572ec2c$export$a15fff7fac404fd9 = [
923
925
  'base',
926
+ 'container',
924
927
  'complete',
925
928
  'invalid',
926
929
  'empty'
@@ -318,15 +318,15 @@ const $2cc07a9862fd14af$export$2b0a6e5a1c78018f = (elementsUrl)=>{
318
318
 
319
319
 
320
320
 
321
- // Auto-generated version file
322
- const $6a2f0bfcc5905f21$export$83d89fbfd8236492 = '1.24.2';
323
-
324
-
325
321
  // Build-time generated URLs for regular deployment
326
322
  const $c9bd4b894cc03378$export$67c92c3b857d033a = null;
327
323
  const $c9bd4b894cc03378$export$9c5c779c8690dca6 = null;
328
324
 
329
325
 
326
+ // Auto-generated version file
327
+ const $6a2f0bfcc5905f21$export$83d89fbfd8236492 = '2.0.0';
328
+
329
+
330
330
  const $65168f0452925da7$var$TEST_ENV = 'js.flock-dev.com';
331
331
  const $65168f0452925da7$var$DEFAULT_ENV = 'js.basistheory.com';
332
332
  const $65168f0452925da7$export$cbe2892587230861 = async (apiKey, options)=>{
@@ -344,7 +344,9 @@ const $65168f0452925da7$export$cbe2892587230861 = async (apiKey, options)=>{
344
344
 
345
345
  var $e8df50a6ced49e58$exports = {};
346
346
 
347
+ $parcel$export($e8df50a6ced49e58$exports, "AUTOCOMPLETE_VALUES", () => $2e9038c0999bba06$export$dea6ebbc92df4fa3);
347
348
  $parcel$export($e8df50a6ced49e58$exports, "CARD_BRANDS", () => $2e9038c0999bba06$export$51be6d94c4fcf45);
349
+ $parcel$export($e8df50a6ced49e58$exports, "CARD_ICON_POSITIONS", () => $2e9038c0999bba06$export$829c91d8f039f695);
348
350
  var $8142f8fc8bbedd0b$exports = {};
349
351
  var $6011935a2a75da1d$exports = {};
350
352
 
@@ -921,6 +923,7 @@ const $ce70703c3ce2f3a0$export$fc323aec0bf844b = [
921
923
  ];
922
924
  const $ce70703c3ce2f3a0$export$a15fff7fac404fd9 = [
923
925
  'base',
926
+ 'container',
924
927
  'complete',
925
928
  'invalid',
926
929
  'empty'
@@ -1055,4 +1058,4 @@ class $3753a300b9392464$export$83d862a6bd4a93c5 extends Error {
1055
1058
  */ if (typeof window !== 'undefined' && document.currentScript && !window.basistheory) window.basistheory = (0, $65168f0452925da7$export$cbe2892587230861);
1056
1059
 
1057
1060
 
1058
- export {$65168f0452925da7$export$cbe2892587230861 as basistheory, $2e9038c0999bba06$export$51be6d94c4fcf45 as CARD_BRANDS, $6011935a2a75da1d$export$1748c2651c2c6e25 as VISA, $6011935a2a75da1d$export$1c604828de4cf9cf as MASTERCARD, $6011935a2a75da1d$export$67c5e4e99638ee87 as AMERICAN_EXPRESS, $6011935a2a75da1d$export$fcf88132c9601d5d as DINERS_CLUB, $6011935a2a75da1d$export$27b2e48e28163360 as DISCOVER, $6011935a2a75da1d$export$bf30f1ca7b266454 as JCB, $6011935a2a75da1d$export$8ed8e9ea6bbca19f as UNION_PAY, $6011935a2a75da1d$export$f08651c87c943e8 as MAESTRO, $6011935a2a75da1d$export$c4b8f606caaecf2c as ELO, $6011935a2a75da1d$export$58f9d4150439d06e as MIR, $6011935a2a75da1d$export$8f50e2757841117b as HIPER, $6011935a2a75da1d$export$adb072c9761d9e59 as HIPERCARD, $6011935a2a75da1d$export$35b475386df8059d as DEFAULT_CARD_TYPES, $a7c0ed47a726bc77$export$8dde18ea9019c560 as CoBadgedSupport, $0b7f2ce91f71c8fb$export$8141e4f9a897abe6 as ELEMENTS_TYPES, $ce70703c3ce2f3a0$export$e2bf52fc7723ec89 as SAFE_CSS_PROPERTIES, $ce70703c3ce2f3a0$export$e22a44f86989e3f4 as SAFE_CSS_PROPERTIES_ALTERNATES, $ce70703c3ce2f3a0$export$b5b27feb4cf29129 as SAFE_CSS_PROPERTIES_WITH_ALTERNATES, $ce70703c3ce2f3a0$export$fc323aec0bf844b as CARD_ELEMENT_STYLE_VARIANT_SELECTORS, $ce70703c3ce2f3a0$export$a15fff7fac404fd9 as CARD_ELEMENT_STYLE_VARIANTS, $ce70703c3ce2f3a0$export$c3a88e1ff160bfd6 as CARD_ELEMENT_STYLE_FONTS_ATTR, $88bdfff2114854bc$export$f9a8af5874660c13 as DATA_CLASSIFICATIONS, $88bdfff2114854bc$export$7ea51ced9080f153 as DATA_IMPACT_LEVELS, $88bdfff2114854bc$export$23716d8c8b579500 as DATA_RESTRICTION_POLICIES, $cc8dceaa5ea02f81$export$5a9a4feb38dee587 as BasisTheoryApiError, $16b549d313b97bf4$export$925a29a6f046f0b5 as BasisTheoryValidationError, $3753a300b9392464$export$83d862a6bd4a93c5 as HttpClientError};
1061
+ export {$65168f0452925da7$export$cbe2892587230861 as basistheory, $2e9038c0999bba06$export$dea6ebbc92df4fa3 as AUTOCOMPLETE_VALUES, $2e9038c0999bba06$export$51be6d94c4fcf45 as CARD_BRANDS, $2e9038c0999bba06$export$829c91d8f039f695 as CARD_ICON_POSITIONS, $6011935a2a75da1d$export$1748c2651c2c6e25 as VISA, $6011935a2a75da1d$export$1c604828de4cf9cf as MASTERCARD, $6011935a2a75da1d$export$67c5e4e99638ee87 as AMERICAN_EXPRESS, $6011935a2a75da1d$export$fcf88132c9601d5d as DINERS_CLUB, $6011935a2a75da1d$export$27b2e48e28163360 as DISCOVER, $6011935a2a75da1d$export$bf30f1ca7b266454 as JCB, $6011935a2a75da1d$export$8ed8e9ea6bbca19f as UNION_PAY, $6011935a2a75da1d$export$f08651c87c943e8 as MAESTRO, $6011935a2a75da1d$export$c4b8f606caaecf2c as ELO, $6011935a2a75da1d$export$58f9d4150439d06e as MIR, $6011935a2a75da1d$export$8f50e2757841117b as HIPER, $6011935a2a75da1d$export$adb072c9761d9e59 as HIPERCARD, $6011935a2a75da1d$export$35b475386df8059d as DEFAULT_CARD_TYPES, $a7c0ed47a726bc77$export$8dde18ea9019c560 as CoBadgedSupport, $0b7f2ce91f71c8fb$export$8141e4f9a897abe6 as ELEMENTS_TYPES, $ce70703c3ce2f3a0$export$e2bf52fc7723ec89 as SAFE_CSS_PROPERTIES, $ce70703c3ce2f3a0$export$e22a44f86989e3f4 as SAFE_CSS_PROPERTIES_ALTERNATES, $ce70703c3ce2f3a0$export$b5b27feb4cf29129 as SAFE_CSS_PROPERTIES_WITH_ALTERNATES, $ce70703c3ce2f3a0$export$fc323aec0bf844b as CARD_ELEMENT_STYLE_VARIANT_SELECTORS, $ce70703c3ce2f3a0$export$a15fff7fac404fd9 as CARD_ELEMENT_STYLE_VARIANTS, $ce70703c3ce2f3a0$export$c3a88e1ff160bfd6 as CARD_ELEMENT_STYLE_FONTS_ATTR, $88bdfff2114854bc$export$f9a8af5874660c13 as DATA_CLASSIFICATIONS, $88bdfff2114854bc$export$7ea51ced9080f153 as DATA_IMPACT_LEVELS, $88bdfff2114854bc$export$23716d8c8b579500 as DATA_RESTRICTION_POLICIES, $cc8dceaa5ea02f81$export$5a9a4feb38dee587 as BasisTheoryApiError, $16b549d313b97bf4$export$925a29a6f046f0b5 as BasisTheoryValidationError, $3753a300b9392464$export$83d862a6bd4a93c5 as HttpClientError};
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/web-elements",
3
- "version": "1.24.2",
3
+ "version": "2.0.0",
4
4
  "repository": "https://github.com/basis-theory/web-elements",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -39,9 +39,55 @@ export interface HttpClient {
39
39
  get(url: string, config?: RequestConfig): Promise<unknown>;
40
40
  delete(url: string, config?: RequestConfig): Promise<unknown>;
41
41
  }
42
+ interface NetworkInformation {
43
+ downlink: number;
44
+ downlinkMax?: number;
45
+ effectiveType: 'slow-2g' | '2g' | '3g' | '4g';
46
+ rtt: number;
47
+ saveData: boolean;
48
+ type?: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown';
49
+ }
50
+ type DeviceInfo = {
51
+ uaBrands?: Array<{
52
+ brand: string;
53
+ version: string;
54
+ }>;
55
+ uaMobile?: boolean;
56
+ uaPlatform?: string;
57
+ uaPlatformVersion?: string;
58
+ languages?: string[];
59
+ timeZone?: string;
60
+ cookiesEnabled?: boolean;
61
+ localStorageEnabled?: boolean;
62
+ sessionStorageEnabled?: boolean;
63
+ platform?: string;
64
+ hardwareConcurrency?: number;
65
+ deviceMemoryGb?: number | null;
66
+ screenWidth?: number;
67
+ screenHeight?: number;
68
+ screenAvailWidth?: number;
69
+ screenAvailHeight?: number;
70
+ innerWidth?: number;
71
+ innerHeight?: number;
72
+ devicePixelRatio?: number;
73
+ maxTouchPoints?: number;
74
+ plugins?: string[];
75
+ mimeTypes?: string[];
76
+ webdriver?: boolean;
77
+ suspectedHeadless?: boolean;
78
+ webglVendor?: string;
79
+ webglRenderer?: string;
80
+ canvasHash?: string;
81
+ network?: NetworkInformation;
82
+ };
83
+ interface Device {
84
+ getDeviceInfo(options?: {
85
+ includeCanvasHash?: boolean;
86
+ }): DeviceInfo;
87
+ }
42
88
  export const CARD_BRANDS: readonly ["accel", "bancontact", "cartes-bancaires", "culiance", "dankort", "ebt", "eftpos-australia", "nyce", "private-label", "prop", "pulse", "rupay", "star", "uatp", "korean-local", "visa", "mastercard", "american-express", "discover", "diners-club", "jcb", "unionpay", "maestro", "elo", "hiper", "hipercard", "mir", "unknown"];
43
- declare const CARD_ICON_POSITIONS: readonly ["left", "right", "none"];
44
- declare const AUTOCOMPLETE_VALUES: readonly ["additional-name", "address-level1", "address-level2", "address-level3", "address-level4", "address-line1", "address-line2", "address-line3", "bday-day", "bday-month", "bday-year", "bday", "billing", "cc-additional-name", "cc-csc", "cc-exp-month", "cc-exp-year", "cc-exp", "cc-family-name", "cc-given-name", "cc-name", "cc-number", "cc-type", "country-name", "country", "current-password", "email", "family-name", "fax", "given-name", "home", "honorific-prefix", "honorific-suffix", "language", "mobile", "name", "new-password", "nickname", "off", "on", "one-time-code", "organization-title", "organization", "page", "postal-code", "sex", "shipping", "street-address", "tel-area-code", "tel-country-code", "tel-extension", "tel-local-prefix", "tel-local-suffix", "tel-local", "tel-national", "tel", "transaction-amount", "transaction-currency", "url", "username", "work"];
89
+ export const CARD_ICON_POSITIONS: readonly ["left", "right", "none"];
90
+ export const AUTOCOMPLETE_VALUES: readonly ["additional-name", "address-level1", "address-level2", "address-level3", "address-level4", "address-line1", "address-line2", "address-line3", "bday-day", "bday-month", "bday-year", "bday", "billing", "cc-additional-name", "cc-csc", "cc-exp-month", "cc-exp-year", "cc-exp", "cc-family-name", "cc-given-name", "cc-name", "cc-number", "cc-type", "country-name", "country", "current-password", "email", "family-name", "fax", "given-name", "home", "honorific-prefix", "honorific-suffix", "language", "mobile", "name", "new-password", "nickname", "off", "on", "one-time-code", "organization-title", "organization", "page", "postal-code", "sex", "shipping", "street-address", "tel-area-code", "tel-country-code", "tel-extension", "tel-local-prefix", "tel-local-suffix", "tel-local", "tel-national", "tel", "transaction-amount", "transaction-currency", "url", "username", "work"];
45
91
  export type FieldErrorType = 'incomplete' | 'invalid';
46
92
  export type ConfigErrorType = 'missing-configuration' | 'missing-permission' | 'invalid-configuration';
47
93
  export interface ConfigError {
@@ -137,7 +183,7 @@ export type SafeStyle = Pick<Properties, SafeCSSProperty>;
137
183
  export const CARD_ELEMENT_STYLE_VARIANT_SELECTORS: readonly [":hover", ":focus", ":read-only", "::placeholder", "::selection", ":disabled"];
138
184
  export type CardElementStyleVariantSelector = (typeof CARD_ELEMENT_STYLE_VARIANT_SELECTORS)[number];
139
185
  export type CardElementStyleVariantStyle = SafeStyle & Partial<Record<CardElementStyleVariantSelector, SafeStyle>>;
140
- export const CARD_ELEMENT_STYLE_VARIANTS: readonly ["base", "complete", "invalid", "empty"];
186
+ export const CARD_ELEMENT_STYLE_VARIANTS: readonly ["base", "container", "complete", "invalid", "empty"];
141
187
  export const CARD_ELEMENT_STYLE_FONTS_ATTR: "fonts";
142
188
  export type CardElementStyleVariant = (typeof CARD_ELEMENT_STYLE_VARIANTS)[number];
143
189
  type CardElementStyleFontAttr = typeof CARD_ELEMENT_STYLE_FONTS_ATTR;
@@ -277,12 +323,20 @@ export interface BinDetails {
277
323
  issuerCurrency?: string;
278
324
  comboCard?: string;
279
325
  binLength?: number;
280
- authentication?: unknown;
281
- cost?: unknown;
326
+ authentication?: Authentication;
327
+ cost?: Cost;
282
328
  bank?: BinDetailsBank;
283
329
  country?: BinDetailsCountry;
284
330
  product?: BinDetailsProduct;
285
331
  }
332
+ interface Cost {
333
+ capAdvaloremAmount: string;
334
+ capTypeName: string;
335
+ capFixedAmount: string;
336
+ }
337
+ interface Authentication {
338
+ authenticationName: string;
339
+ }
286
340
  export interface BinDetailsBank {
287
341
  name?: string;
288
342
  phone?: string;
@@ -581,6 +635,7 @@ export interface BasisTheoryElements {
581
635
  tokenIntents: TokenIntents;
582
636
  tokenize: Tokenize['tokenize'];
583
637
  client: HttpClient;
638
+ device: Device;
584
639
  createElement(type: 'card', options?: CreateCardElementOptions): ICardElement;
585
640
  createElement(type: 'text', options: CreateTextElementOptions): ITextElement;
586
641
  createElement(type: 'cardNumber', options: CreateCardNumberElementOptions): ICardNumberElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/web-elements",
3
- "version": "1.24.2",
3
+ "version": "2.0.0",
4
4
  "repository": "https://github.com/basis-theory/web-elements",
5
5
  "license": "Apache-2.0",
6
6
  "author": {