@azure/ai-vision-face-ui 1.4.0 → 1.4.1

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.
@@ -1,4 +1,4 @@
1
- var t="./";const e=t+"facelivenessdetector-assets/images/Smile.svg",s=t+"facelivenessdetector-assets/images/Brightness.svg",n=t+"facelivenessdetector-assets/images/FaceId.svg",i=t+"facelivenessdetector-assets/images/activeMotionVisualHint.png";function a(){const t=["181951jxDkIt","2943236XjwNrV","11276073wUczst","4684BNLzDF","arc","180872YgduiK","khw","4306236iOmcLT","427ViZZpg","5689965koKOWq","1233AYZrao"];return(a=function(){return t})()}function r(t,e){const s=a();return(r=function(t,e){return s[t-=226]})(t,e)}const o=r;!function(){const t=r,e=a();for(;;)try{if(994601==-parseInt(t(236))/1+parseInt(t(226))/2+parseInt(t(235))/3*(parseInt(t(228))/4)+parseInt(t(234))/5+parseInt(t(232))/6+-parseInt(t(233))/7*(parseInt(t(230))/8)+-parseInt(t(227))/9)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const c=["ar",o(229),"dv","fa","ha","he",o(231),"ks","ku","ps","ur","yi"],h=u;function u(t,e){const s=l();return(u=function(t,e){return s[t-=150]})(t,e)}function l(){const t=["Failed to load locale: ","/en.json","95646ensalh","_skipInstructions","78023hrEpHU","connectedCallback","fontSize","statusText","text","FaceRecoEngineAdapter",".wasm","21jkvmEa","languageDictionary","_locale","head","undefined","_userCorrelationId","440qXNJmA","validate","AzureAIVisionFace.js","skipInstructions","loadLanguageDictionary","AzureAIVisionFace_SIMD.js","replace","_deviceCorrelationId","_mediaInfoDeviceId","_languageDictionary","24750HEnmvi","authToken","32104imAghh","_brightnessImagePath","None","bind","keys","isHTMLInit","1132929WEBKuO","_feedbackMessageStyles","activeMotionVisualHint","786578gZvfvq","isDefined","./facelivenessdetector-assets/i18n/","_continueButtonStyles","_fontFamily","brightnessImagePath","function","buttonStyles","cleanup","734676xQCMqX","287UHkueu","_fontSize","start","createElement","script","smilePath","checkModuleDefined","_baseAssetsURL","src","parse","isRtl","userCorrelationId","deviceCorrelationId","feedbackMessageStyles","length","disconnectedCallback","56anwbCC"," strings file: ","290wrKvAx"];return(l=function(){return t})()}!function(){const t=u,e=l();for(;;)try{if(446906==-parseInt(t(190))/1+-parseInt(t(179))/2*(parseInt(t(163))/3)+parseInt(t(181))/4*(-parseInt(t(151))/5)+-parseInt(t(154))/6*(-parseInt(t(200))/7)+parseInt(t(216))/8*(parseInt(t(187))/9)+parseInt(t(169))/10*(parseInt(t(156))/11)+-parseInt(t(199))/12)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();var f=h(174);try{0==WebAssembly[h(170)](new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))&&(f=h(171))}catch(t){f="AzureAIVisionFace.js"}class d extends HTMLElement{constructor(){const t=h;super(),this[t(205)]=e,this.start=this[t(202)][t(184)](this),this[t(182)]="",this[t(193)]="",this._feedbackMessageStyles="",this[t(201)]="",this._fontFamily="",this[t(178)]={},this[t(210)]=!1,this[t(165)]="en-US",this[t(207)]="./",this._mediaInfoDeviceId="",this[t(155)]=!0,this[t(176)]="",this[t(168)]="",this[t(191)]=!1,this[t(186)]=!1,this[t(180)]="",this.faceId=n,this[t(189)]=i,this.brightnessSVGPath=s}set[h(195)](t){this[h(182)]=t}set[h(158)](t){this._fontSize=t}set fontFamily(t){this[h(194)]=t}set[h(197)](t){this[h(193)]=t}set[h(213)](t){this[h(188)]=t}set locale(t){this[h(165)]=t,c.includes(t)&&(this.isRtl=!0)}set[h(164)](t){const e=h;this._languageDictionary=t||this[e(178)]}set mediaInfoDeviceId(t){this[h(177)]=t}set[h(172)](t){this[h(155)]=t}set[h(212)](t){this._deviceCorrelationId=t}set[h(211)](t){this[h(168)]=t}[h(202)]=async t=>{const e=h;return this.authToken=t,this[e(191)]=await this[e(206)](1e3,15),this[e(191)]?(await this[e(173)](),Module[e(202)](this)):new Promise((t,s)=>{s({livenessError:"Unexpected",recognitionError:e(183)})})};async[h(157)](){const t=h;if(this.isConnected&&(typeof Module===t(167)||typeof Module.FaceRecoEngineAdapter===t(167))){const e=this[t(207)][t(175)](/\/$/,"")+"/facelivenessdetector-assets/js/";window.Module={locateFile:function(s,n){const i=t;return s.includes("AzureAIVisionFace")&&s.endsWith(i(162))?e+s:n+s}};const s=document[t(203)](t(204));s[t(208)]=e+f,document[t(166)].appendChild(s)}}[h(215)](){const t=h;typeof Module!==t(167)&&typeof Module[t(198)]===t(196)&&Module[t(198)]()}async[h(173)](){const t=h;if(0===Object[t(185)](this[t(178)])[t(214)]){let e=await fetch(t(192)+this[t(165)]+t(153));if(!e.ok)throw new Error(t(152)+this._locale+t(150)+e[t(159)]+".");let s=await e[t(160)]();this[t(178)]=JSON[t(209)](s)}}async[h(206)](t,e){const s=h;let n=0;for(;n<e;){if(n++,typeof Module!==s(167)&&typeof Module[s(161)]!==s(167))return!0;await new Promise(e=>setTimeout(e,t))}return!1}}var p=g;function I(){var t=["44DdvGwq","2931485PpbuGd","312550JRSagP","2113068pXStvb","9337QBgmEd","define","azure-ai-vision-face-ui","8132210WRYzyh","6ACAcPh","2469760EtBUOB","1163348lMklRR","9XpNnCM"];return(I=function(){return t})()}function g(t,e){var s=I();return(g=function(t,e){return s[t-=266]})(t,e)}!function(){for(var t=g,e=I();;)try{if(317710==parseInt(t(266))/1*(parseInt(t(274))/2)+-parseInt(t(270))/3*(parseInt(t(272))/4)+parseInt(t(275))/5+-parseInt(t(277))/6+-parseInt(t(276))/7+-parseInt(t(271))/8+-parseInt(t(273))/9*(-parseInt(t(269))/10))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),customElements[p(267)](p(268),d);export var LivenessStatus;
1
+ var t="./";const e=t+"facelivenessdetector-assets/images/Smile.svg",s=t+"facelivenessdetector-assets/images/Brightness.svg",n=t+"facelivenessdetector-assets/images/FaceId.svg",i=t+"facelivenessdetector-assets/images/activeMotionVisualHint.png";function a(t,e){const s=c();return(a=function(t,e){return s[t-=169]})(t,e)}const r=a;!function(){const t=a,e=c();for(;;)try{if(213835==-parseInt(t(169))/1+parseInt(t(174))/2+parseInt(t(178))/3+-parseInt(t(171))/4+parseInt(t(170))/5+-parseInt(t(175))/6*(-parseInt(t(177))/7)+parseInt(t(172))/8)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const o=["ar",r(173),"dv","fa","ha","he",r(176),"ks","ku","ps","ur","yi"];function c(){const t=["arc","405786Xqxrta","459342QcDPNI","khw","14kWcUSs","109737GeHMsD","308475rvDVUw","57205EIuEwW","156880NjMmUk","1260024ZbckQZ"];return(c=function(){return t})()}const u=h;function h(t,e){const s=l();return(h=function(t,e){return s[t-=135]})(t,e)}function l(){const t=["None","/facelivenessdetector-assets/js/","79709BYDXuQ","AzureAIVisionFace.js","_feedbackMessageStyles","length","feedbackMessageStyles","_mediaInfoDeviceId","keys","authToken","_skipInstructions","brightnessSVGPath","_deviceCorrelationId","2nmgAtz","checkModuleDefined","_continueButtonStyles","disconnectedCallback","Failed to load locale: ","FaceRecoEngineAdapter","endsWith","30OyHhaH","fontFamily","881472tOXZug","isConnected","33498btRtqN","statusText","createElement","24obvNMv","641436nfmkcv","text","AzureAIVisionFace_SIMD.js","start","buttonStyles","Unexpected","_locale","smilePath","isDefined","validate","fontSize","activeMotionVisualHint","1406170EFdssf","deviceCorrelationId","parse","_brightnessImagePath","connectedCallback","function","_fontFamily","bind","cleanup","brightnessImagePath","8072834uItpST","languageDictionary","includes","_fontSize",".wasm","script","en-US"," strings file: ","undefined","_baseAssetsURL","./facelivenessdetector-assets/i18n/","_languageDictionary","mediaInfoDeviceId","loadLanguageDictionary","isRtl","12IanqHX","/en.json","1963467fifFaY"];return(l=function(){return t})()}!function(){const t=h,e=l();for(;;)try{if(408848==-parseInt(t(139))/1+parseInt(t(196))/2*(parseInt(t(143))/3)+-parseInt(t(137))/4+-parseInt(t(155))/5*(-parseInt(t(180))/6)+parseInt(t(185))/7*(-parseInt(t(142))/8)+-parseInt(t(182))/9*(-parseInt(t(135))/10)+-parseInt(t(165))/11)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();var f=u(145);try{0==WebAssembly[u(152)](new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))&&(f="AzureAIVisionFace.js")}catch(t){f=u(186)}class d extends HTMLElement{constructor(){const t=u;super(),this[t(150)]=e,this.start=this[t(146)][t(162)](this),this[t(158)]="",this[t(198)]="",this._feedbackMessageStyles="",this[t(168)]="",this[t(161)]="",this._languageDictionary={},this.isRtl=!1,this[t(149)]=t(171),this[t(174)]="./",this[t(190)]="",this[t(193)]=!0,this[t(195)]="",this._userCorrelationId="",this[t(151)]=!1,this.isHTMLInit=!1,this[t(192)]="",this.faceId=n,this[t(154)]=i,this[t(194)]=s}set[u(164)](t){this[u(158)]=t}set[u(153)](t){this[u(168)]=t}set[u(136)](t){this[u(161)]=t}set[u(147)](t){this[u(198)]=t}set[u(189)](t){this[u(187)]=t}set locale(t){const e=u;this[e(149)]=t,o[e(167)](t)&&(this[e(179)]=!0)}set[u(166)](t){const e=u;this[e(176)]=t||this[e(176)]}set[u(177)](t){this[u(190)]=t}set skipInstructions(t){this[u(193)]=t}set[u(156)](t){this[u(195)]=t}set userCorrelationId(t){this._userCorrelationId=t}[u(146)]=async t=>{const e=u;return this[e(192)]=t,this[e(151)]=await this[e(197)](1e3,15),this[e(151)]?(await this[e(178)](),Module[e(146)](this)):new Promise((t,s)=>{const n=e;s({livenessError:n(148),recognitionError:n(183)})})};async[u(159)](){const t=u;if(this[t(138)]&&(typeof Module===t(173)||void 0===Module[t(201)])){const e=this._baseAssetsURL.replace(/\/$/,"")+t(184);window.Module={locateFile:function(s,n){const i=t;return s[i(167)]("AzureAIVisionFace")&&s[i(202)](i(169))?e+s:n+s}};const s=document[t(141)](t(170));s.src=e+f,document.head.appendChild(s)}}[u(199)](){const t=u;typeof Module!==t(173)&&typeof Module[t(163)]===t(160)&&Module.cleanup()}async[u(178)](){const t=u;if(0===Object[t(191)](this[t(176)])[t(188)]){let e=await fetch(t(175)+this[t(149)]+t(181));if(!e.ok)throw new Error(t(200)+this[t(149)]+t(172)+e[t(140)]+".");let s=await e[t(144)]();this[t(176)]=JSON[t(157)](s)}}async[u(197)](t,e){const s=u;let n=0;for(;n<e;){if(n++,typeof Module!==s(173)&&void 0!==Module.FaceRecoEngineAdapter)return!0;await new Promise(e=>setTimeout(e,t))}return!1}}function p(t,e){var s=g();return(p=function(t,e){return s[t-=128]})(t,e)}var I=p;function g(){var t=["1633668kRRUuL","102335jFFBHA","24oLInpL","2783344YaRFyT","1350PFuQXp","1999203dgkrsX","180bcjvUZ","define","459mjqpAQ","970307xNyEwp","1749475ziQYTs"];return(g=function(){return t})()}!function(){for(var t=p,e=g();;)try{if(717217==-parseInt(t(129))/1+parseInt(t(134))/2+-parseInt(t(136))/3+-parseInt(t(131))/4+parseInt(t(132))/5*(parseInt(t(137))/6)+-parseInt(t(130))/7*(-parseInt(t(133))/8)+-parseInt(t(128))/9*(-parseInt(t(135))/10))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),customElements[I(138)]("azure-ai-vision-face-ui",d);export var LivenessStatus;
2
2
  (function (LivenessStatus) {
3
3
  LivenessStatus["RealFace"] = "RealFace";
4
4
  LivenessStatus["SpoofFace"] = "SpoofFace";
package/README.md CHANGED
@@ -6,9 +6,8 @@ In this sample, you will learn how to build and run the face liveness detection
6
6
 
7
7
  * [Introduction](#introduction)
8
8
  * [Prerequisites](#prerequisites)
9
- * [Step 1: Set up the environment](SetupEnvironment.md)
10
- * [Step 2: Build and run sample app](#step-2-build-and-run-sample-app)
11
- * [Step 3: Integrate face liveness detector into your own application](#step-3-integrate-face-liveness-detector-into-your-own-application)
9
+ * [Installation](#installation)
10
+ * [Integrate face liveness detector into your own application](#integrate-face-liveness-detector-into-your-own-application)
12
11
  * [Obtaining a session token](#obtaining-a-session-token)
13
12
  * [Injecting the web component](#injecting-the-web-component)
14
13
  * [Deployment](#deployment)
@@ -35,23 +34,22 @@ The Azure AI Vision Face UI Web SDK is a client library intended to enable the i
35
34
  1. An Azure Face API resource subscription.
36
35
  2. Install node from https://nodejs.org/en/download/prebuilt-installer
37
36
 
38
- ## Step 2: Build and run sample app
37
+ ## Installation
39
38
 
40
- Follow these steps to quickly run a sample app built with Next.js, Angular, or Vue.js.
39
+ 1. Create .npmrc file in root of app folder to pull packages from `https://pkgs.dev.azure.com/msface/SDK/_packaging/AzureAIVision/npm/registry/` registry.
40
+ An example .npmrc file is available here(https://github.com/Azure-Samples/azure-ai-vision-sdk/blob/main/samples/web/angularjs/.npmrc).
41
41
 
42
- 1. Follow the steps in [SetupEnvironment.md](https://github.com/Azure-Samples/azure-ai-vision-sdk/tree/main/samples/web/SetupEnvironment.md) to install the npm package.
42
+ 2. Fetch the base64 access token required in the .npmrc file using the API: [Liveness Session Operations - Get Client Assets Access Token](https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-client-assets-access-token?view=rest-face-v1.3-preview)
43
43
 
44
- 2. Copy `facelivenessdetector-assets/` folder from `node_modules/azure-ai-vision-face-ui` to `public/`.
44
+ 3. To install the SDK via NPM, run the following command in the root of the app folder:
45
45
 
46
- 3. Update the variables in `.env.local` with your own face-api key and endpoint.
46
+ ```sh
47
+ npm install @azure/ai-vision-face-ui@latest
48
+ ```
47
49
 
48
- 4. Run the app with `npm run dev`. On the first run, the development server may take a few minutes to initialize.
50
+ ## Integrate face liveness detector into your own application
49
51
 
50
- Note: the [`samples/web/javascript`](https://github.com/Azure-Samples/azure-ai-vision-sdk/tree/main/samples/web/javascript/) contains a fully featured vanilla-javascript sample
51
-
52
- ## Step 3: Integrate face liveness detector into your own application
53
-
54
- First run through the steps in the [SetupEnvironment.md](https://github.com/Azure-Samples/azure-ai-vision-sdk/tree/main/samples/web/SetupEnvironment.md) section to install the npm package.
52
+ First, ensure you have installed the npm package as described in the [Installation](#installation) section.
55
53
 
56
54
  ### Obtaining a session token
57
55
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "types": "types/index.d.ts",
6
6
  "homepage": "https://github.com/Azure-Samples/azure-ai-vision-sdk",
7
7
  "dependencies": {
8
- "@azure-ai-vision-face/ui-assets": "1.4.0"
8
+ "@azure-ai-vision-face/ui-assets": "1.4.1"
9
9
  },
10
- "version": "1.4.0"
10
+ "version": "1.4.1"
11
11
  }