@frankieone/one-sdk 1.2.0-rc → 1.2.0-rc.2

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,2 +1,2 @@
1
- (self.webpackChunkOneSdk=self.webpackChunkOneSdk||[]).push([[942],{74057:e=>{function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=()=>[],n.resolve=n,n.id=74057,e.exports=n},51794:(e,n,t)=>{"use strict";t.r(n),t.d(n,{initialise:()=>v});var o=t(38253),i=t(77494),d=t(99434),r=t(35527),a=t(32898),s=t(52283);var c=t(3023);function m(e){const n=c.hW[e];return n?n.alpha2:null}function l(e){const n=c.hW[e];return n?n.name:null}Object.keys(c.hW).filter((e=>3===e.length)).map((e=>({value:e,label:l(e)})));const u=[function(e,n){const{basicPiiForm:{data:{firstName:t,middleName:o,lastName:i,dateOfBirth:d}}}=e;n.access("name").setValue({givenName:t,middleName:o,familyName:i,displayName:""});const r=new Date(d).toISOString().split("T")[0];n.access("dateOfBirth").setValue(r)},function(e,n){var t;const{addressComponentForm:{data:{residentialAddress:o}}}=e,i=n.access("addresses").getValue().find((e=>e.addressId===o.addressId)),d=i||(()=>{const e=new a.k;return e.addressType="RESIDENTIAL",e})();d.country=function(e){const n=c.hW[e];return n?n.alpha3:null}((e=>{var n,t;return null!==(t=null===(n=e.find((e=>e.types.includes("country"))))||void 0===n?void 0:n.short_name)&&void 0!==t?t:null})(o.address_components)),d.longForm=o.formatted_address,d.addressId=null!==(t=o.addressId)&&void 0!==t?t:null,i?n.updateAddress(i.addressId,i):n.addAddress(d)},function(e,n){const{documents:t}=e;t.filter((e=>["PASSPORT","DRIVERS_LICENCE","NATIONAL_HEALTH_ID"].includes(e.genericDocument.data.idType))).map((e=>function(e,n){var t;const o=n.access("documents").getValue().find((n=>n.documentId===e.documentId))||new s.B;o.idType=e.idType,o.documentId=null!==(t=e.documentId)&&void 0!==t?t:null;const i=e.idType;if("PASSPORT"===i)o.idNumber=e.pass_idNumber,o.country=e.issuingCountry,o.idExpiry=e.pass_idExpiry;else if("DRIVERS_LICENCE"===i)o.country=e.issuingCountry,o.region=e.dl_region,o.idNumber=e.dl_idNumber,o.extraData.document_number=e.dl_cardNumber;else{if("NATIONAL_HEALTH_ID"!==i)throw new Error(`Unknown document type '${i}', can't map unknown data.`);o.country="AUS",o.idNumber=e.medi_idNumber,o.idExpiry=e.medi_idExpiry,o.extraData.reference=e.medi_cardPosition,o.idSubType=e.medi_cardColour}return o}(e.genericDocument.data,n))).forEach((e=>{e.documentId?n.updateDocument(e.documentId,e):n.addDocument(e)}))}];function f(e){const n=e.idType,t={documentId:e.documentId,idType:n,issuingCountry:e.country};if("PASSPORT"===n)Object.assign(t,{pass_idNumber:e.idNumber,pass_idExpiry:e.idExpiry});else if("DRIVERS_LICENCE"===n)Object.assign(t,{dl_idNumber:e.idNumber,dl_idExpiry:e.idExpiry,dl_cardNumber:e.extraData.document_number,dl_region:e.region});else{if("NATIONAL_HEALTH_ID"!==n)throw new Error(`Unknown document type '${n}', can't map to formio as this could have unexpected results`);Object.assign(t,{medi_idNumber:e.idNumber,medi_idExpiry:e.idExpiry,medi_cardPosition:e.extraData.reference,medi_cardColour:e.idSubType})}return t}var p=function(e,n,t,o){return new(t||(t=Promise))((function(i,d){function r(e){try{s(o.next(e))}catch(e){d(e)}}function a(e){try{s(o.throw(e))}catch(e){d(e)}}function s(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,a)}s((o=o.apply(e,n||[])).next())}))};const y=[["https://cdn.form.io/formiojs/formio.full.js","script"],["https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css","style"],[(0,o.l)("modules.smartUI.font.cdnUrl"),"style"]],h=["https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css","https://cdn.form.io/formiojs/formio.full.min.css"],b=["smart-ui","formio"],v=(0,d.J)("formio",((e,n)=>p(void 0,void 0,void 0,(function*(){const{mountElement:t}=n,d=e.recipe.smartUI.implementation;if("formio"!==d.name||!d.formUrl)throw new Error("Formio implementation requires a formUrl");t.classList.add(...b);const r=(0,o.l)("modules.smartUI.wrappingMode"),[a,s,c]=yield"shadow"===r?I(t):"iframe"===r?E(t):g(t);return"iframe"===r||window.Formio?"iframe"===r&&(yield Promise.all(y.map((([e,n])=>(0,i.loadAsyncAsset)(e,{type:n,targetNode:c.document.body}))))):yield Promise.all(y.map((e=>(0,i.loadAsyncAsset)(...e)))),yield function(e,n){return p(this,void 0,void 0,(function*(){const{mountElement:t,windowWithFormio:o}=n,i=e.localEventHub,d=e.recipe.smartUI.implementation,r="formio"===d.name&&d.formUrl,a=e.oneSdkInstance.individual(),[s]=yield Promise.all([o.Formio.createForm(t,r),a.search()]);!function(e){var n,t,o,i,d;t=this,o=void 0,d=function*(){const t=window.__ONE_SDK__DEVTOOLS.moduleInstances.components["smart-ui"];(null==t?void 0:t.formioInstances)||null!==(n=t.formioInstances)&&void 0!==n||(t.formioInstances=[]),t.formioInstances.push(e)},new((i=void 0)||(i=Promise))((function(e,n){function r(e){try{s(d.next(e))}catch(e){n(e)}}function a(e){try{s(d.throw(e))}catch(e){n(e)}}function s(n){var t;n.done?e(n.value):(t=n.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}s((d=d.apply(t,o||[])).next())}))}(s),s.ready.then((()=>i.emit("ready",{domElement:t}))),s.on("submitPressed",(()=>p(this,void 0,void 0,(function*(){if(!s.checkValidity(null,!1,null,!0))return;var e,n;e=s.data,n=a,u.forEach((t=>t(e,n))),yield a.submit();const o=a.access("entityId").getValue(),d=a.access("__deprecated_applicant").getValue(),r=a.access("__deprecated_documents").getValue();i.emit("results",{applicant:d,documents:r,entityId:o}),t.innerHTML=""})))),function(e,n){var t;const{givenName:o,middleName:i,familyName:d}=e.access("name").getValue(),r=e.access("dateOfBirth").getValue(),a=e.access("documents").getValue(),s=e.access("addresses").getValue(),c=e.access("entityId").getValue(),{longForm:u,country:p,addressId:y}=null!==(t=s[0])&&void 0!==t?t:{};n.setSubmission({data:{basicPiiForm:{data:{entityId:c,firstName:o,middleName:i,lastName:d,dateOfBirth:r}},documents:a.filter((e=>["PASSPORT","DRIVERS_LICENCE","NATIONAL_HEALTH_ID"].includes(e.idType))).map((e=>({genericDocument:{data:f(e)}}))),addressComponentForm:{data:{useManualAddress:!1,residentialAddress:{addressId:y,formatted_address:null!=u?u:"",address_components:p?[{long_name:l(p),short_name:m(p),types:["country"]}]:[]}}}}})}(a,s),s.language="en"}))}(e,{mountElement:a,windowWithFormio:c}),e.localEventHub.emit("loaded",{domElement:s,implementation:"formio"}),{cleanup:()=>{}}})))),_=e=>{const n=e.ownerDocument;h.forEach((t=>{const o=n.createElement("link");o.setAttribute("rel","stylesheet"),o.setAttribute("href",t),e.appendChild(o)}));const t=n.createElement("style"),i=(0,o.l)("modules.smartUI.font.fontFamilyCSSRule"),d=e instanceof ShadowRoot?":host":".smart-ui.formio";t.innerHTML=`${d} { font-family: ${i} }`+function(e){return(0,r.kM)(`${e} { ${["\n label {\n font-size: 0.8rem;\n }\n ","\n .card.card-body {\n padding: 0;\n background-color: initial !important;\n border: none !important;\n border-width: 0 !important;\n border-color: transparent !important;\n margin-bottom: 0 !important;\n }\n ",'\n .formio-component-datagrid table,\n .formio-component-datagrid table tbody,\n .formio-component-datagrid table tr,\n .formio-component-datagrid table td {\n border: none !important;\n border-width: 0 !important;\n border-color: transparent !important;\n }\n\n [ref^="datagrid-"] {\n padding: 0 !important;\n }\n [ref^="datagrid-"]:not(:first-of-type) {\n padding-top: 24px;\n }\n ',"\n .main-page-title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n "].join("\n")} }`).css}(d),e.appendChild(t)},E=e=>p(void 0,void 0,void 0,(function*(){const n=document.createElement("iframe");return n.srcdoc="<html><body><div class='smart-ui formio'></div></body></html>",n.style.minHeight="600px",n.style.width="100%",n.style.height="100%",n.style.border="none",e.appendChild(n),yield new Promise(((e,t)=>{n.onload=e,n.onerror=t})),_(n.contentDocument.body),[n.contentDocument.querySelector(".smart-ui.formio"),n,n.contentWindow]})),g=e=>p(void 0,void 0,void 0,(function*(){_(e);const n=document.createElement("div");return e.appendChild(n),[n,e,window]})),I=e=>p(void 0,void 0,void 0,(function*(){const n=e.attachShadow({mode:"open"});_(n);const t=document.createElement("div");return n.appendChild(t),[t,n,window]}))}}]);
1
+ "use strict";(self.webpackChunkOneSdk=self.webpackChunkOneSdk||[]).push([[942],{51794:(e,n,t)=>{t.r(n),t.d(n,{initialise:()=>b});var o=t(38253),i=t(77494),d=t(99434),r=t(32898),a=t(52283);var s=t(3023);function c(e){const n=s.hW[e];return n?n.alpha2:null}function m(e){const n=s.hW[e];return n?n.name:null}Object.keys(s.hW).filter((e=>3===e.length)).map((e=>({value:e,label:m(e)})));const l=[function(e,n){const{basicPiiForm:{data:{firstName:t,middleName:o,lastName:i,dateOfBirth:d}}}=e;n.access("name").setValue({givenName:t,middleName:o,familyName:i,displayName:""});const r=new Date(d).toISOString().split("T")[0];n.access("dateOfBirth").setValue(r)},function(e,n){var t;const{addressComponentForm:{data:{residentialAddress:o}}}=e,i=n.access("addresses").getValue().find((e=>e.addressId===o.addressId)),d=i||(()=>{const e=new r.k;return e.addressType="RESIDENTIAL",e})();d.country=function(e){const n=s.hW[e];return n?n.alpha3:null}((e=>{var n,t;return null!==(t=null===(n=e.find((e=>e.types.includes("country"))))||void 0===n?void 0:n.short_name)&&void 0!==t?t:null})(o.address_components)),d.longForm=o.formatted_address,d.addressId=null!==(t=o.addressId)&&void 0!==t?t:null,i?n.updateAddress(i.addressId,i):n.addAddress(d)},function(e,n){const{documents:t}=e;t.filter((e=>["PASSPORT","DRIVERS_LICENCE","NATIONAL_HEALTH_ID"].includes(e.genericDocument.data.idType))).map((e=>function(e,n){var t;const o=n.access("documents").getValue().find((n=>n.documentId===e.documentId))||new a.B;o.idType=e.idType,o.documentId=null!==(t=e.documentId)&&void 0!==t?t:null;const i=e.idType;if("PASSPORT"===i)o.idNumber=e.pass_idNumber,o.country=e.issuingCountry,o.idExpiry=e.pass_idExpiry;else if("DRIVERS_LICENCE"===i)o.country=e.issuingCountry,o.region=e.dl_region,o.idNumber=e.dl_idNumber,o.extraData.document_number=e.dl_cardNumber;else{if("NATIONAL_HEALTH_ID"!==i)throw new Error(`Unknown document type '${i}', can't map unknown data.`);o.country="AUS",o.idNumber=e.medi_idNumber,o.idExpiry=e.medi_idExpiry,o.extraData.reference=e.medi_cardPosition,o.idSubType=e.medi_cardColour}return o}(e.genericDocument.data,n))).forEach((e=>{e.documentId?n.updateDocument(e.documentId,e):n.addDocument(e)}))}];function u(e){const n=e.idType,t={documentId:e.documentId,idType:n,issuingCountry:e.country};if("PASSPORT"===n)Object.assign(t,{pass_idNumber:e.idNumber,pass_idExpiry:e.idExpiry});else if("DRIVERS_LICENCE"===n)Object.assign(t,{dl_idNumber:e.idNumber,dl_idExpiry:e.idExpiry,dl_cardNumber:e.extraData.document_number,dl_region:e.region});else{if("NATIONAL_HEALTH_ID"!==n)throw new Error(`Unknown document type '${n}', can't map to formio as this could have unexpected results`);Object.assign(t,{medi_idNumber:e.idNumber,medi_idExpiry:e.idExpiry,medi_cardPosition:e.extraData.reference,medi_cardColour:e.idSubType})}return t}var p=function(e,n,t,o){return new(t||(t=Promise))((function(i,d){function r(e){try{s(o.next(e))}catch(e){d(e)}}function a(e){try{s(o.throw(e))}catch(e){d(e)}}function s(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,a)}s((o=o.apply(e,n||[])).next())}))};const f=[["https://cdn.form.io/formiojs/formio.full.js","script"],["https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css","style"],[(0,o.l)("modules.smartUI.font.cdnUrl"),"style"]],y=["https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css","https://cdn.form.io/formiojs/formio.full.min.css"],h=["smart-ui","formio"],b=(0,d.J)("formio",((e,n)=>p(void 0,void 0,void 0,(function*(){const{mountElement:t}=n,d=e.recipe.smartUI.implementation;if("formio"!==d.name||!d.formUrl)throw new Error("Formio implementation requires a formUrl");t.classList.add(...h);const r=(0,o.l)("modules.smartUI.wrappingMode"),[a,s,y]=yield"shadow"===r?I(t):"iframe"===r?_(t):g(t);return"iframe"===r||window.Formio?"iframe"===r&&(yield Promise.all(f.map((([e,n])=>(0,i.loadAsyncAsset)(e,{type:n,targetNode:y.document.body}))))):yield Promise.all(f.map((e=>(0,i.loadAsyncAsset)(...e)))),yield function(e,n){return p(this,void 0,void 0,(function*(){const{mountElement:t,windowWithFormio:o}=n,i=e.localEventHub,d=e.recipe.smartUI.implementation,r="formio"===d.name&&d.formUrl,a=e.oneSdkInstance.individual(),[s]=yield Promise.all([o.Formio.createForm(t,r),a.search()]);!function(e){var n,t,o,i,d;t=this,o=void 0,d=function*(){const t=window.__ONE_SDK__DEVTOOLS.moduleInstances.components["smart-ui"];(null==t?void 0:t.formioInstances)||null!==(n=t.formioInstances)&&void 0!==n||(t.formioInstances=[]),t.formioInstances.push(e)},new((i=void 0)||(i=Promise))((function(e,n){function r(e){try{s(d.next(e))}catch(e){n(e)}}function a(e){try{s(d.throw(e))}catch(e){n(e)}}function s(n){var t;n.done?e(n.value):(t=n.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}s((d=d.apply(t,o||[])).next())}))}(s),s.ready.then((()=>i.emit("ready",{domElement:t}))),s.on("submitPressed",(()=>p(this,void 0,void 0,(function*(){if(!s.checkValidity(null,!1,null,!0))return;var e,n;e=s.data,n=a,l.forEach((t=>t(e,n))),yield a.submit();const o=a.access("entityId").getValue(),d=a.access("__deprecated_applicant").getValue(),r=a.access("__deprecated_documents").getValue();i.emit("results",{applicant:d,documents:r,entityId:o}),t.innerHTML=""})))),function(e,n){var t;const{givenName:o,middleName:i,familyName:d}=e.access("name").getValue(),r=e.access("dateOfBirth").getValue(),a=e.access("documents").getValue(),s=e.access("addresses").getValue(),l=e.access("entityId").getValue(),{longForm:p,country:f,addressId:y}=null!==(t=s[0])&&void 0!==t?t:{};n.setSubmission({data:{basicPiiForm:{data:{entityId:l,firstName:o,middleName:i,lastName:d,dateOfBirth:r}},documents:a.filter((e=>["PASSPORT","DRIVERS_LICENCE","NATIONAL_HEALTH_ID"].includes(e.idType))).map((e=>({genericDocument:{data:u(e)}}))),addressComponentForm:{data:{useManualAddress:!1,residentialAddress:{addressId:y,formatted_address:null!=p?p:"",address_components:f?[{long_name:m(f),short_name:c(f),types:["country"]}]:[]}}}}})}(a,s),s.language="en"}))}(e,{mountElement:a,windowWithFormio:y}),e.localEventHub.emit("loaded",{domElement:s,implementation:"formio"}),{cleanup:()=>{}}})))),v=e=>{const n=e.ownerDocument;y.forEach((t=>{const o=n.createElement("link");o.setAttribute("rel","stylesheet"),o.setAttribute("href",t),e.appendChild(o)}));const t=n.createElement("style"),i=(0,o.l)("modules.smartUI.font.fontFamilyCSSRule"),d=e instanceof ShadowRoot?":host":".smart-ui.formio";t.innerHTML=`${d} { font-family: ${i} }`+function(e){return`${e} { ${["\n label {\n font-size: 0.8rem;\n }\n ","\n .card.card-body {\n padding: 0;\n background-color: initial !important;\n border: none !important;\n border-width: 0 !important;\n border-color: transparent !important;\n margin-bottom: 0 !important;\n }\n ",'\n .formio-component-datagrid table,\n .formio-component-datagrid table tbody,\n .formio-component-datagrid table tr,\n .formio-component-datagrid table td {\n border: none !important;\n border-width: 0 !important;\n border-color: transparent !important;\n }\n\n [ref^="datagrid-"] {\n padding: 0 !important;\n }\n [ref^="datagrid-"]:not(:first-of-type) {\n padding-top: 24px;\n }\n ',"\n .main-page-title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n "].join("\n")} }`}(d),e.appendChild(t)},_=e=>p(void 0,void 0,void 0,(function*(){const n=document.createElement("iframe");return n.srcdoc="<html><body><div class='smart-ui formio'></div></body></html>",n.style.minHeight="600px",n.style.width="100%",n.style.height="100%",n.style.border="none",e.appendChild(n),yield new Promise(((e,t)=>{n.onload=e,n.onerror=t})),v(n.contentDocument.body),[n.contentDocument.querySelector(".smart-ui.formio"),n,n.contentWindow]})),g=e=>p(void 0,void 0,void 0,(function*(){v(e);const n=document.createElement("div");return e.appendChild(n),[n,e,window]})),I=e=>p(void 0,void 0,void 0,(function*(){const n=e.attachShadow({mode:"open"});v(n);const t=document.createElement("div");return n.appendChild(t),[t,n,window]}))}}]);
2
2
  //# sourceMappingURL=smartui-formio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"smartui-formio.js","mappings":"6EAAA,SAASA,EAAoBC,GAC5B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBF,EAAM,KAEjD,MADAC,EAAEE,KAAO,mBACHF,CACP,CACAF,EAAoBK,KAAO,IAAM,GACjCL,EAAoBM,QAAUN,EAC9BA,EAAoBO,GAAK,MACzBC,EAAOC,QAAUT,C,oJCFV,SAASU,EAAeC,GAC7B,MAAMC,EAAU,KAAUD,GAC1B,OAAOC,EAAUA,EAAQC,OAAS,IACpC,CACO,SAASC,EAAaH,GAC3B,MAAMC,EAAU,KAAUD,GAC1B,OAAOC,EAAUA,EAAQG,KAAO,IAClC,CAE4BC,OAAOX,KAAK,MACrCY,QAAQb,GAAiC,IAAhBA,EAAKc,SAC9BC,KAAKR,IAAW,CAAGS,MAAOT,EAAQU,MAAOP,EAAaH,OAFlD,MCEDW,EAAmC,CAMzC,SAAoBC,EAAwCC,GAC1D,MACEC,cACEC,MAAM,UAAEC,EAAS,WAAEC,EAAU,SAAEC,EAAQ,YAAEC,KAEzCP,EAGJC,EAAiBO,OAAO,QAAQC,SAAS,CACvCC,UAAWN,EACXC,WAAYA,EACZM,WAAYL,EACZM,YAAa,KAEf,MAAMC,EAAc,IAAIC,KAAKP,GAAaQ,cAAcC,MAAM,KAAK,GACnEf,EAAiBO,OAAO,eAAeC,SAASI,EAClD,EACA,SAA0Bb,EAAwCC,G,MAGhE,MACEgB,sBACEd,MAAM,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,EAAsBZ,GAAoE,oCAC9F,MAAMuF,EAAavF,EAAaY,aAAa,CAAE4E,KAAM,SACrD5B,EAAU2B,GACV,MAAMD,EAAuB/D,SAASwC,cAAc,OAEpD,OADAwB,EAAWtB,YAAYqB,GAChB,CAACA,EAAsBC,EAAYxE,OAC5C,G","sources":["webpack://OneSdk/./node_modules/sass/ sync","webpack://OneSdk/./modules/smart-ui/implementations/formio/transformers/countryData.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/transformers/assignFormioDataToIndividualModule.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/formioSdk.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/transformers/assignIndividualDataToFormioSdk.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/index.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/transformers/initialiseFormio.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/styleOverrides.ts"],"sourcesContent":["function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = () => ([]);\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 74057;\nmodule.exports = webpackEmptyContext;","import { countries } from 'country-data';\n\nexport function alpha2ToAlpha3(alpha2: string): string | null {\n const country = countries[alpha2];\n return country ? country.alpha3 : null;\n}\nexport function alpha3ToAlpha2(alpha3: string): string | null {\n const country = countries[alpha3];\n return country ? country.alpha2 : null;\n}\nexport function alpha3ToName(alpha3: string): string | null {\n const country = countries[alpha3];\n return country ? country.name : null;\n}\n\nexport const allCountries = Object.keys(countries)\n .filter((code: string) => code.length === 3)\n .map((alpha3) => ({ value: alpha3, label: alpha3ToName(alpha3) }));\n","import { Address } from '@module/common/shared/models/Address';\nimport { Document } from '@module/common/shared/models/Document';\nimport type { IndividualModuleContext } from '@module/types';\n\nimport { findCountryAlpha2 } from '../formioSdk';\n\nimport { alpha2ToAlpha3 } from './countryData';\n\nimport type { FormIOOnboardingDataScheme } from '../formioSdk';\n\n// In order to increase cohesion, the transformation from formio data into the individual module is done by applying a series of transformations\n// To make sure the transformations aren't too convoluted, each transformation is done in a separate function, for different purposes (pipeline pattern):\n// - mapPIIData will inject name and date of birth into the individual module\n// - mapAddressObject will inject the residential address into the individual module\n// - mapDocumentObject will inject the document into the individual module.\n// !--> This is the place where the mapping for each document type is done <--!\n// All the \"transformer\" functions are defined below\nconst formioToIndividualModulePipeline = [mapPIIData, mapAddressObject, mapDocumentObjects];\nexport const assignFormioDataToIndividualModule = (\n formioData: FormIOOnboardingDataScheme,\n individualModule: IndividualModuleContext,\n) => formioToIndividualModulePipeline.forEach((transformer) => transformer(formioData, individualModule));\n\nfunction mapPIIData(formioData: FormIOOnboardingDataScheme, individualModule: IndividualModuleContext) {\n const {\n basicPiiForm: {\n data: { firstName, middleName, lastName, dateOfBirth },\n },\n } = formioData;\n\n /** NAME, DOB */\n individualModule.access('name').setValue({\n givenName: firstName,\n middleName: middleName,\n familyName: lastName,\n displayName: '',\n });\n const reformatted = new Date(dateOfBirth).toISOString().split('T')[0];\n individualModule.access('dateOfBirth').setValue(reformatted);\n}\nfunction mapAddressObject(formioData: FormIOOnboardingDataScheme, individualModule: IndividualModuleContext) {\n // If individual already has a residential address, simply update it with the new information\n // Otherwise, add new address object\n const {\n addressComponentForm: {\n data: { residentialAddress },\n },\n } = formioData;\n\n const addresses = individualModule.access('addresses');\n const findByAddressId = (address: Address) => address.addressId === residentialAddress.addressId;\n const createResidentialAddress = () => {\n const newAddress = new Address();\n newAddress.addressType = 'RESIDENTIAL';\n return newAddress;\n };\n const existingAddressObject = addresses.getValue().find(findByAddressId);\n\n const addressObject = existingAddressObject ? existingAddressObject : createResidentialAddress();\n addressObject.country = alpha2ToAlpha3(findCountryAlpha2(residentialAddress.address_components));\n // TODO: Does formio only support longForm address? When user manually inputs individual fields does this not return a broken down address?\n addressObject.longForm = residentialAddress.formatted_address;\n addressObject.addressId = residentialAddress.addressId ?? null;\n\n if (existingAddressObject) individualModule.updateAddress(existingAddressObject.addressId, existingAddressObject);\n else individualModule.addAddress(addressObject);\n}\nfunction mapDocumentObjects(formioData: FormIOOnboardingDataScheme, individualModule: IndividualModuleContext) {\n const { documents } = formioData;\n\n const documentObjects = documents\n .filter((doc) =>\n [\n // These are the document types we are including in the conversion\n // Whenever supporting new doc types add it here and add it to\n // the mapSingleDocumentObject function below\n // Also do the same in assignIndividualDataToFormioSdk.ts\n 'PASSPORT',\n 'DRIVERS_LICENCE',\n 'NATIONAL_HEALTH_ID',\n ].includes(doc.genericDocument.data.idType),\n )\n .map((documentData) => mapSingleDocumentObject(documentData.genericDocument.data, individualModule));\n\n documentObjects.forEach((documentObject) => {\n if (documentObject.documentId) individualModule.updateDocument(documentObject.documentId, documentObject);\n else individualModule.addDocument(documentObject);\n });\n}\nfunction mapSingleDocumentObject(\n documentData: FormIOOnboardingDataScheme['documents'][number]['genericDocument']['data'],\n individualModule: IndividualModuleContext,\n): Document {\n // If individual already has a document that matches the returned type from formio, simply update it with the new information\n // Otherwise, add new document object object\n\n // Determine the type of id coming from formio.\n const existingDocumentObject = individualModule\n .access('documents')\n .getValue()\n .find((doc) => doc.documentId === documentData.documentId);\n\n const documentObject: Document = existingDocumentObject ? existingDocumentObject : new Document();\n documentObject.idType = documentData.idType;\n documentObject.documentId = documentData.documentId ?? null;\n\n const idType = documentData.idType;\n\n // TODO: Convert this into a more generic mapping, instead of having a condition for each document type\n if (idType === 'PASSPORT') {\n documentObject.idNumber = documentData.pass_idNumber;\n documentObject.country = documentData.issuingCountry;\n documentObject.idExpiry = documentData.pass_idExpiry;\n } else if (idType === 'DRIVERS_LICENCE') {\n documentObject.country = documentData.issuingCountry;\n documentObject.region = documentData.dl_region;\n documentObject.idNumber = documentData.dl_idNumber;\n documentObject.extraData.document_number = documentData.dl_cardNumber;\n } else if (idType === 'NATIONAL_HEALTH_ID') {\n documentObject.country = 'AUS';\n documentObject.idNumber = documentData.medi_idNumber;\n documentObject.idExpiry = documentData.medi_idExpiry;\n documentObject.extraData.reference = documentData.medi_cardPosition;\n documentObject.idSubType = documentData.medi_cardColour;\n // TODO: map more medicare fields\n } else {\n throw new Error(`Unknown document type '${idType}', can't map unknown data.`);\n }\n\n return documentObject;\n}\n","import type { Document } from '@module/common/shared/models/Document';\n\nimport type { Paths } from 'type-fest';\n\ndeclare global {\n interface Window {\n Formio: {\n createForm: <Schema>(mountElement: Node, formUrl: string, options?: unknown) => Promise<FormIOInstance<Schema>>;\n };\n }\n}\n\nexport type FormIOInstance<Schema> = {\n on: (evName: string, ...args: unknown[]) => void;\n ready: Promise<void>;\n language: string;\n data: Schema; // Check if this is correct\n setSubmission(submission: { data: Partial<Schema> });\n checkValidity: (data, dirty, row, client) => boolean;\n getComponent: <Component>(path: Paths<FormIOOnboardingDataScheme>) => Component;\n redraw: () => Promise<void>;\n};\n\n/** Component types */\nexport type SelectComponent = {\n data: {\n values: { label: string; value: string }[];\n };\n};\n\n/** Formio Onboarding data scheme (smart ui equivalent data) */\nexport type FormIOOnboardingDataScheme = {\n basicPiiForm: {\n data: {\n entityId: string;\n firstName: string;\n middleName: string;\n lastName: string;\n dateOfBirth: string;\n };\n };\n documents: {\n genericDocument: {\n data: {\n documentId: string;\n idType: Document['idType'];\n issuingCountry: string;\n\n dl_region: string;\n dl_idNumber: string;\n dl_cardNumber: string;\n\n pass_idNumber: string;\n pass_idExpiry: string;\n\n medi_idNumber: string;\n medi_cardPosition: string;\n medi_cardColour: string;\n medi_idExpiry: string;\n\n any_idNumber: string;\n };\n };\n }[];\n addressComponentForm: {\n data: {\n useManualAddress: boolean;\n residentialAddress: {\n addressId: string;\n formatted_address: string;\n address_components: {\n long_name: string;\n short_name: string;\n types: string[];\n }[];\n };\n };\n };\n};\n\ntype AddressData = FormIOOnboardingDataScheme['addressComponentForm']['data']['residentialAddress'];\nexport const findCountryAlpha2 = (comps: AddressData['address_components']) => {\n return comps.find((comp) => comp.types.includes('country'))?.short_name ?? null;\n};\n","import type { Document } from '@module/common/shared/models/Document';\nimport type { IndividualModuleContext } from '@module/individual';\n\nimport { alpha3ToAlpha2, alpha3ToName } from './countryData';\n\nimport type { FormIOInstance, FormIOOnboardingDataScheme } from '../formioSdk';\n\nexport function assignIndividualDataToFormioSdk(\n individual: IndividualModuleContext,\n formio: FormIOInstance<FormIOOnboardingDataScheme>,\n) {\n // Take pre existing data from the individual module and inject into the form\n const { givenName, middleName, familyName } = individual.access('name').getValue();\n const dateOfBirth = individual.access('dateOfBirth').getValue();\n const documents = individual.access('documents').getValue();\n const addresses = individual.access('addresses').getValue();\n const entityId = individual.access('entityId').getValue();\n\n const { longForm: addressLongForm, country: addressCountryAlpha3, addressId } = addresses[0] ?? {};\n\n // https://help.form.io/developers/form-development/form-renderer#submission-data\n formio.setSubmission({\n data: {\n basicPiiForm: {\n data: {\n entityId,\n firstName: givenName,\n middleName,\n lastName: familyName,\n dateOfBirth,\n },\n },\n documents: documents\n .filter((doc) =>\n [\n // These are the document types we are including in the conversion\n // Whenever supporting new doc types add it here and add it to\n // the documentObjectToGenericDocumentFields function below\n // Also do the same in assignFormioDataToIndividualModule.ts\n 'PASSPORT',\n 'DRIVERS_LICENCE',\n 'NATIONAL_HEALTH_ID',\n ].includes(doc.idType),\n )\n .map((doc) => ({\n genericDocument: {\n data: documentObjectToGenericDocumentFields(doc),\n },\n })),\n addressComponentForm: {\n data: {\n useManualAddress: false,\n residentialAddress: {\n addressId,\n formatted_address: addressLongForm ?? '',\n address_components: addressCountryAlpha3\n ? [\n {\n long_name: alpha3ToName(addressCountryAlpha3),\n short_name: alpha3ToAlpha2(addressCountryAlpha3),\n types: ['country'],\n },\n ]\n : [],\n },\n },\n },\n },\n });\n}\n\ntype GenericDocumentData = FormIOOnboardingDataScheme['documents'][number]['genericDocument']['data'];\nfunction documentObjectToGenericDocumentFields(documentObject: Document): GenericDocumentData {\n const idType = documentObject.idType;\n const genericDocumentFields = {\n documentId: documentObject.documentId,\n idType,\n issuingCountry: documentObject.country,\n } as GenericDocumentData;\n if (idType === 'PASSPORT') {\n Object.assign(genericDocumentFields, {\n pass_idNumber: documentObject.idNumber,\n pass_idExpiry: documentObject.idExpiry,\n });\n } else if (idType === 'DRIVERS_LICENCE') {\n Object.assign(genericDocumentFields, {\n dl_idNumber: documentObject.idNumber,\n dl_idExpiry: documentObject.idExpiry,\n dl_cardNumber: documentObject.extraData.document_number,\n dl_region: documentObject.region,\n });\n } else if (idType === 'NATIONAL_HEALTH_ID') {\n Object.assign(genericDocumentFields, {\n medi_idNumber: documentObject.idNumber,\n medi_idExpiry: documentObject.idExpiry,\n medi_cardPosition: documentObject.extraData.reference,\n medi_cardColour: documentObject.idSubType,\n // TODO: map more medicare fields\n });\n } else {\n throw new Error(`Unknown document type '${idType}', can't map to formio as this could have unexpected results`);\n }\n\n return genericDocumentFields;\n}\n","import { feat } from '@feature-flags';\nimport { loadAsyncAsset } from '@module/common';\nimport type { WrapperParameters } from '@module/common/modules/defineModule';\nimport { defineWrapper } from '@module/common/modules/defineModule';\nimport type { SmartUIModule } from '@module/smart-ui/definition';\n\nimport { generateScopeStyleOverrides } from './styleOverrides';\nimport { assignFormioDataToIndividualModule } from './transformers/assignFormioDataToIndividualModule';\nimport { assignIndividualDataToFormioSdk } from './transformers/assignIndividualDataToFormioSdk';\nimport { initialiseFormio } from './transformers/initialiseFormio';\n\nimport type { FormIOOnboardingDataScheme } from './formioSdk';\n\nconst GLOBAL_ASSETS: [string, 'script' | 'style'][] = [\n ['https://cdn.form.io/formiojs/formio.full.js', 'script'],\n // Since fonts won't work when loaded from inside the shadow dom, load FontAwesome icons here\n ['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css', 'style'],\n // Also the general font chosen for the form in the feature flag\n [feat('modules.smartUI.font.cdnUrl'), 'style'],\n];\nconst SCOPED_STYLES = [\n 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css',\n 'https://cdn.form.io/formiojs/formio.full.min.css',\n];\nconst CONTAINER_CLASSLIST = ['smart-ui', 'formio'];\nexport const initialise = defineWrapper<SmartUIModule>('formio', async (shared, options) => {\n const { mountElement } = options;\n const smartUiImplementation = shared.recipe.smartUI.implementation;\n const formUrl = smartUiImplementation.name === 'formio' && smartUiImplementation.formUrl;\n\n if (!formUrl) {\n throw new Error('Formio implementation requires a formUrl');\n }\n\n mountElement.classList.add(...CONTAINER_CLASSLIST);\n const wrappingMode = feat('modules.smartUI.wrappingMode');\n\n const [styledMountElement, wrapperElement, windowWithFormio] = await ((): Promise<[HTMLElement, Node, Window]> => {\n if (wrappingMode === 'shadow') return attachShadow(mountElement);\n if (wrappingMode === 'iframe') return attachIframe(mountElement);\n return attachDiv(mountElement);\n })();\n\n if (wrappingMode !== 'iframe' && !window.Formio) {\n await Promise.all(GLOBAL_ASSETS.map((asset) => loadAsyncAsset(...asset)));\n } else if (wrappingMode === 'iframe') {\n // Iframe will load the script inside the iframe, so we need to wait for it to load\n await Promise.all(\n GLOBAL_ASSETS.map(([url, type]) =>\n loadAsyncAsset(url, {\n type,\n targetNode: windowWithFormio.document.body,\n }),\n ),\n );\n }\n\n await loadFormio(shared, { mountElement: styledMountElement, windowWithFormio });\n\n // DONE\n\n const localEventHub = shared.localEventHub;\n localEventHub.emit('loaded', {\n //TODO: make domElement take Node instead of HTMLElement\n domElement: wrapperElement as HTMLElement,\n implementation: 'formio',\n });\n\n return {\n cleanup: () => {},\n };\n});\nconst addStyles = (mountElement: Node) => {\n const document = mountElement.ownerDocument;\n // Adding scoped styles\n SCOPED_STYLES.forEach((url) => {\n const link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', url);\n mountElement.appendChild(link);\n });\n // Assigning Font styles\n const customStyles = document.createElement('style');\n const fontFamilyName = feat('modules.smartUI.font.fontFamilyCSSRule');\n\n const isShadowDom = mountElement instanceof ShadowRoot;\n const rootSelector = isShadowDom ? ':host' : '.smart-ui.formio';\n\n customStyles.innerHTML =\n `${rootSelector} { font-family: ${fontFamilyName} }` + generateScopeStyleOverrides(rootSelector);\n mountElement.appendChild(customStyles);\n};\nconst attachIframe = async (mountElement: HTMLElement): Promise<[HTMLElement, Node, Window]> => {\n const iframe = document.createElement('iframe');\n\n iframe.srcdoc = `<html><body><div class='smart-ui formio'></div></body></html>`;\n iframe.style.minHeight = '600px';\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n iframe.style.border = 'none';\n\n mountElement.appendChild(iframe);\n // Wait till iframe parses the srcdoc\n await new Promise((resolve, reject) => {\n iframe.onload = resolve;\n iframe.onerror = reject;\n });\n addStyles(iframe.contentDocument.body);\n const internalMountElement = iframe.contentDocument.querySelector<HTMLElement>('.smart-ui.formio');\n return [internalMountElement, iframe, iframe.contentWindow];\n};\nconst attachDiv = async (mountElement: HTMLElement): Promise<[HTMLElement, Node, Window]> => {\n addStyles(mountElement);\n // Formio will remove all contents of the mount element, so we need to create a new internal mountElement\n const internalMountElement = document.createElement('div');\n mountElement.appendChild(internalMountElement);\n return [internalMountElement, mountElement, window];\n};\nconst attachShadow = async (mountElement: HTMLElement): Promise<[HTMLElement, Node, Window]> => {\n const shadowRoot = mountElement.attachShadow({ mode: 'open' });\n addStyles(shadowRoot);\n const internalMountElement = document.createElement('div');\n shadowRoot.appendChild(internalMountElement);\n return [internalMountElement, shadowRoot, window];\n};\n// FORM IO LIB\nasync function loadFormio(\n shared: WrapperParameters<SmartUIModule>[0],\n options: { mountElement: HTMLElement; windowWithFormio: Window },\n) {\n const { mountElement, windowWithFormio } = options;\n\n const localEventHub = shared.localEventHub;\n const smartUiImplementation = shared.recipe.smartUI.implementation;\n const formUrl = smartUiImplementation.name === 'formio' && smartUiImplementation.formUrl;\n\n const individual = shared.oneSdkInstance.individual();\n\n const [formio] = await Promise.all([\n windowWithFormio.Formio.createForm<FormIOOnboardingDataScheme>(mountElement, formUrl),\n individual.search(),\n ]);\n initialiseFormio(formio);\n // 1) set all listeners first\n formio.ready.then(() => localEventHub.emit('ready', { domElement: mountElement as HTMLElement }));\n formio.on('submitPressed', async () => {\n if (!formio.checkValidity(null, false, null, true)) return;\n // When button is clicked, convert plain formio data to BFF data\n assignFormioDataToIndividualModule(formio.data, individual);\n // Submit data to BFF\n await individual.submit();\n\n const entityId = individual.access('entityId').getValue();\n const applicant = individual.access('__deprecated_applicant').getValue();\n const documents = individual.access('__deprecated_documents').getValue();\n // Emit \"results\" event, just like smart ui also does.\n localEventHub.emit('results', { applicant, documents, entityId });\n mountElement.innerHTML = '';\n });\n\n assignIndividualDataToFormioSdk(individual, formio);\n\n // set additional configuration. This can be taken from the recipe\n formio.language = 'en';\n}\n","import { type FormIOInstance, type FormIOOnboardingDataScheme } from '../formioSdk';\n\nexport async function initialiseFormio(formio: FormIOInstance<FormIOOnboardingDataScheme>) {\n // Adding formio instance to the devtools\n const smartUIComponent = window.__ONE_SDK__DEVTOOLS.moduleInstances.components['smart-ui'] as {\n formioInstances: FormIOInstance<FormIOOnboardingDataScheme>[];\n };\n if (!smartUIComponent?.formioInstances) smartUIComponent.formioInstances ??= [];\n smartUIComponent.formioInstances.push(formio);\n\n /**\n * Leaving this as an example of how OneSDK can programmatically change formio's components.\n * !Attention: UI Logic should not be done here, but in the formio platform directly.\n * !For example: The list of supported countries for each customer needs to be defined by techops using the drag and drop tool, not programmatically/through recipe.\n * !This will avoid the formio implementation from repeating the same problems of complex configuration we had with the legacy smart-ui implementation\n **/\n\n // const issuingCountrySelect = formio.getComponent<SelectComponent>('genericDocument.data.issuingCountry');\n // issuingCountrySelect.data.values = allCountries;\n // await formio.redraw();\n}\n","import { compileString } from 'sass';\n/**\n *\n * @param rootSelector The root selector to be used to scope the styles\n * @returns\n */\nexport function generateScopeStyleOverrides(rootSelector: string): string {\n const scopedStyleRules = [\n generalStyleOverrides(),\n overrideCardComponent(),\n overrideDataGridComponent(),\n genericClassnames(),\n ];\n // This line will join all the styles declared above and will scope them using the Sass library\n // When not using the shadow dom, this will prevent styles from leaking outside of the form elements\n return compileString(`${rootSelector} { ${scopedStyleRules.join('\\n')} }`).css;\n}\n/**\n * Add all the different classnames we want to be available for use in the Formio builder\n * This is our preferred way of styling. Avoid making specific style changes to any HTML elements and simply provide a way for\n * our peers to customise reusable elements.\n * ie: Main titles, Section titles, Description text, Buttons, Section devider, Section Wrappers...\n **/\nfunction genericClassnames() {\n return `\n .main-page-title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n `;\n}\n/** Generic styling that doesn't apply to any other category.\n * This might be unwanted and we might want to instead create a classname above such as:\n * .form-input label { ... }\n **/\nfunction generalStyleOverrides() {\n return `\n label {\n font-size: 0.8rem;\n }\n `;\n}\n\n// Below we add very specific styling overrides, which we want to avoid doing, unless absolutely necessary\n\n/**\n * Fix/Remove the appearence of the .card-body,\n * The card appearence is used when we bundle components in \"sections\" called \"Wells\"\n * We used them for example to group the PII, Address and Document fields together\n **/\nfunction overrideCardComponent() {\n return `\n .card.card-body {\n padding: 0;\n background-color: initial !important;\n border: none !important;\n border-width: 0 !important;\n border-color: transparent !important;\n margin-bottom: 0 !important;\n }\n `;\n}\n/**\n * Fix/Remove the appearence of the Datagrid component,\n * The datagrid is used is used when we want some form/resource to be rendered multiple times\n * ie: Array of Document objects\n * It looks terrible by default.\n **/\nfunction overrideDataGridComponent() {\n return `\n .formio-component-datagrid table,\n .formio-component-datagrid table tbody,\n .formio-component-datagrid table tr,\n .formio-component-datagrid table td {\n border: none !important;\n border-width: 0 !important;\n border-color: transparent !important;\n }\n\n [ref^=\"datagrid-\"] {\n padding: 0 !important;\n }\n [ref^=\"datagrid-\"]:not(:first-of-type) {\n padding-top: 24px;\n }\n `;\n}\n"],"names":["webpackEmptyContext","req","e","Error","code","keys","resolve","id","module","exports","alpha3ToAlpha2","alpha3","country","alpha2","alpha3ToName","name","Object","filter","length","map","value","label","formioToIndividualModulePipeline","formioData","individualModule","basicPiiForm","data","firstName","middleName","lastName","dateOfBirth","access","setValue","givenName","familyName","displayName","reformatted","Date","toISOString","split","addressComponentForm","residentialAddress","existingAddressObject","getValue","find","address","addressId","addressObject","newAddress","Address","addressType","createResidentialAddress","alpha2ToAlpha3","comps","comp","types","includes","short_name","findCountryAlpha2","address_components","longForm","formatted_address","updateAddress","addAddress","documents","doc","genericDocument","idType","documentData","documentObject","documentId","Document","idNumber","pass_idNumber","issuingCountry","idExpiry","pass_idExpiry","region","dl_region","dl_idNumber","extraData","document_number","dl_cardNumber","medi_idNumber","medi_idExpiry","reference","medi_cardPosition","idSubType","medi_cardColour","mapSingleDocumentObject","forEach","updateDocument","addDocument","documentObjectToGenericDocumentFields","genericDocumentFields","assign","dl_idExpiry","GLOBAL_ASSETS","SCOPED_STYLES","CONTAINER_CLASSLIST","initialise","shared","options","mountElement","smartUiImplementation","recipe","smartUI","implementation","formUrl","classList","add","wrappingMode","styledMountElement","wrapperElement","windowWithFormio","attachShadow","attachIframe","attachDiv","window","Formio","Promise","all","url","type","loadAsyncAsset","targetNode","document","body","asset","localEventHub","individual","oneSdkInstance","formio","createForm","search","smartUIComponent","__ONE_SDK__DEVTOOLS","moduleInstances","components","formioInstances","push","initialiseFormio","ready","then","emit","domElement","on","checkValidity","transformer","submit","entityId","applicant","innerHTML","addresses","addressLongForm","addressCountryAlpha3","setSubmission","useManualAddress","long_name","assignIndividualDataToFormioSdk","language","loadFormio","cleanup","addStyles","ownerDocument","link","createElement","setAttribute","appendChild","customStyles","fontFamilyName","rootSelector","ShadowRoot","join","css","generateScopeStyleOverrides","iframe","srcdoc","style","minHeight","width","height","border","reject","onload","onerror","contentDocument","querySelector","contentWindow","internalMountElement","shadowRoot","mode"],"sourceRoot":""}
1
+ {"version":3,"file":"smartui-formio.js","mappings":"0MAMO,SAASA,EAAeC,GAC7B,MAAMC,EAAU,KAAUD,GAC1B,OAAOC,EAAUA,EAAQC,OAAS,IACpC,CACO,SAASC,EAAaH,GAC3B,MAAMC,EAAU,KAAUD,GAC1B,OAAOC,EAAUA,EAAQG,KAAO,IAClC,CAE4BC,OAA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AAOE,MAAMC,UAAY,QACzBH,EAAOE,MAAME,MAAQ,OACrBJ,EAAOE,MAAMG,OAAS,OACtBL,EAAOE,MAAMI,OAAS,OAEtB9E,EAAaiE,YAAYO,SAEnB,IAAIvD,SAAQ,CAAC8D,EAASC,KAC1BR,EAAOS,OAASF,EAChBP,EAAOU,QAAUF,CAAM,IAEzBpB,EAAUY,EAAOW,gBAAgB3D,MAE1B,CADsBgD,EAAOW,gBAAgBC,cAA2B,oBACjDZ,EAAQA,EAAOa,cAC/C,IACMvE,EAAmBd,GAAoE,oCAC3F4D,EAAU5D,GAEV,MAAMsF,EAAuB/D,SAASwC,cAAc,OAEpD,OADA/D,EAAaiE,YAAYqB,GAClB,CAACA,EAAsBtF,EAAce,OAC9C,IACMH,EAAsBZ,GAAoE,oCAC9F,MAAMuF,EAAavF,EAAaY,aAAa,CAAE4E,KAAM,SACrD5B,EAAU2B,GACV,MAAMD,EAAuB/D,SAASwC,cAAc,OAEpD,OADAwB,EAAWtB,YAAYqB,GAChB,CAACA,EAAsBC,EAAYxE,OAC5C,G","sources":["webpack://OneSdk/./modules/smart-ui/implementations/formio/transformers/countryData.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/transformers/assignFormioDataToIndividualModule.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/formioSdk.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/transformers/assignIndividualDataToFormioSdk.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/index.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/transformers/initialiseFormio.ts","webpack://OneSdk/./modules/smart-ui/implementations/formio/styleOverrides.ts"],"sourcesContent":["import { countries } from 'country-data';\n\nexport function alpha2ToAlpha3(alpha2: string): string | null {\n const country = countries[alpha2];\n return country ? country.alpha3 : null;\n}\nexport function alpha3ToAlpha2(alpha3: string): string | null {\n const country = countries[alpha3];\n return country ? country.alpha2 : null;\n}\nexport function alpha3ToName(alpha3: string): string | null {\n const country = countries[alpha3];\n return country ? country.name : null;\n}\n\nexport const allCountries = Object.keys(countries)\n .filter((code: string) => code.length === 3)\n .map((alpha3) => ({ value: alpha3, label: alpha3ToName(alpha3) }));\n","import { Address } from '@module/common/shared/models/Address';\nimport { Document } from '@module/common/shared/models/Document';\nimport type { IndividualModuleContext } from '@module/types';\n\nimport { findCountryAlpha2 } from '../formioSdk';\n\nimport { alpha2ToAlpha3 } from './countryData';\n\nimport type { FormIOOnboardingDataScheme } from '../formioSdk';\n\n// In order to increase cohesion, the transformation from formio data into the individual module is done by applying a series of transformations\n// To make sure the transformations aren't too convoluted, each transformation is done in a separate function, for different purposes (pipeline pattern):\n// - mapPIIData will inject name and date of birth into the individual module\n// - mapAddressObject will inject the residential address into the individual module\n// - mapDocumentObject will inject the document into the individual module.\n// !--> This is the place where the mapping for each document type is done <--!\n// All the \"transformer\" functions are defined below\nconst formioToIndividualModulePipeline = [mapPIIData, mapAddressObject, mapDocumentObjects];\nexport const assignFormioDataToIndividualModule = (\n formioData: FormIOOnboardingDataScheme,\n individualModule: IndividualModuleContext,\n) => formioToIndividualModulePipeline.forEach((transformer) => transformer(formioData, individualModule));\n\nfunction mapPIIData(formioData: FormIOOnboardingDataScheme, individualModule: IndividualModuleContext) {\n const {\n basicPiiForm: {\n data: { firstName, middleName, lastName, dateOfBirth },\n },\n } = formioData;\n\n /** NAME, DOB */\n individualModule.access('name').setValue({\n givenName: firstName,\n middleName: middleName,\n familyName: lastName,\n displayName: '',\n });\n const reformatted = new Date(dateOfBirth).toISOString().split('T')[0];\n individualModule.access('dateOfBirth').setValue(reformatted);\n}\nfunction mapAddressObject(formioData: FormIOOnboardingDataScheme, individualModule: IndividualModuleContext) {\n // If individual already has a residential address, simply update it with the new information\n // Otherwise, add new address object\n const {\n addressComponentForm: {\n data: { residentialAddress },\n },\n } = formioData;\n\n const addresses = individualModule.access('addresses');\n const findByAddressId = (address: Address) => address.addressId === residentialAddress.addressId;\n const createResidentialAddress = () => {\n const newAddress = new Address();\n newAddress.addressType = 'RESIDENTIAL';\n return newAddress;\n };\n const existingAddressObject = addresses.getValue().find(findByAddressId);\n\n const addressObject = existingAddressObject ? existingAddressObject : createResidentialAddress();\n addressObject.country = alpha2ToAlpha3(findCountryAlpha2(residentialAddress.address_components));\n // TODO: Does formio only support longForm address? When user manually inputs individual fields does this not return a broken down address?\n addressObject.longForm = residentialAddress.formatted_address;\n addressObject.addressId = residentialAddress.addressId ?? null;\n\n if (existingAddressObject) individualModule.updateAddress(existingAddressObject.addressId, existingAddressObject);\n else individualModule.addAddress(addressObject);\n}\nfunction mapDocumentObjects(formioData: FormIOOnboardingDataScheme, individualModule: IndividualModuleContext) {\n const { documents } = formioData;\n\n const documentObjects = documents\n .filter((doc) =>\n [\n // These are the document types we are including in the conversion\n // Whenever supporting new doc types add it here and add it to\n // the mapSingleDocumentObject function below\n // Also do the same in assignIndividualDataToFormioSdk.ts\n 'PASSPORT',\n 'DRIVERS_LICENCE',\n 'NATIONAL_HEALTH_ID',\n ].includes(doc.genericDocument.data.idType),\n )\n .map((documentData) => mapSingleDocumentObject(documentData.genericDocument.data, individualModule));\n\n documentObjects.forEach((documentObject) => {\n if (documentObject.documentId) individualModule.updateDocument(documentObject.documentId, documentObject);\n else individualModule.addDocument(documentObject);\n });\n}\nfunction mapSingleDocumentObject(\n documentData: FormIOOnboardingDataScheme['documents'][number]['genericDocument']['data'],\n individualModule: IndividualModuleContext,\n): Document {\n // If individual already has a document that matches the returned type from formio, simply update it with the new information\n // Otherwise, add new document object object\n\n // Determine the type of id coming from formio.\n const existingDocumentObject = individualModule\n .access('documents')\n .getValue()\n .find((doc) => doc.documentId === documentData.documentId);\n\n const documentObject: Document = existingDocumentObject ? existingDocumentObject : new Document();\n documentObject.idType = documentData.idType;\n documentObject.documentId = documentData.documentId ?? null;\n\n const idType = documentData.idType;\n\n // TODO: Convert this into a more generic mapping, instead of having a condition for each document type\n if (idType === 'PASSPORT') {\n documentObject.idNumber = documentData.pass_idNumber;\n documentObject.country = documentData.issuingCountry;\n documentObject.idExpiry = documentData.pass_idExpiry;\n } else if (idType === 'DRIVERS_LICENCE') {\n documentObject.country = documentData.issuingCountry;\n documentObject.region = documentData.dl_region;\n documentObject.idNumber = documentData.dl_idNumber;\n documentObject.extraData.document_number = documentData.dl_cardNumber;\n } else if (idType === 'NATIONAL_HEALTH_ID') {\n documentObject.country = 'AUS';\n documentObject.idNumber = documentData.medi_idNumber;\n documentObject.idExpiry = documentData.medi_idExpiry;\n documentObject.extraData.reference = documentData.medi_cardPosition;\n documentObject.idSubType = documentData.medi_cardColour;\n // TODO: map more medicare fields\n } else {\n throw new Error(`Unknown document type '${idType}', can't map unknown data.`);\n }\n\n return documentObject;\n}\n","import type { Document } from '@module/common/shared/models/Document';\n\nimport type { Paths } from 'type-fest';\n\ndeclare global {\n interface Window {\n Formio: {\n createForm: <Schema>(mountElement: Node, formUrl: string, options?: unknown) => Promise<FormIOInstance<Schema>>;\n };\n }\n}\n\nexport type FormIOInstance<Schema> = {\n on: (evName: string, ...args: unknown[]) => void;\n ready: Promise<void>;\n language: string;\n data: Schema; // Check if this is correct\n setSubmission(submission: { data: Partial<Schema> });\n checkValidity: (data, dirty, row, client) => boolean;\n getComponent: <Component>(path: Paths<FormIOOnboardingDataScheme>) => Component;\n redraw: () => Promise<void>;\n};\n\n/** Component types */\nexport type SelectComponent = {\n data: {\n values: { label: string; value: string }[];\n };\n};\n\n/** Formio Onboarding data scheme (smart ui equivalent data) */\nexport type FormIOOnboardingDataScheme = {\n basicPiiForm: {\n data: {\n entityId: string;\n firstName: string;\n middleName: string;\n lastName: string;\n dateOfBirth: string;\n };\n };\n documents: {\n genericDocument: {\n data: {\n documentId: string;\n idType: Document['idType'];\n issuingCountry: string;\n\n dl_region: string;\n dl_idNumber: string;\n dl_cardNumber: string;\n\n pass_idNumber: string;\n pass_idExpiry: string;\n\n medi_idNumber: string;\n medi_cardPosition: string;\n medi_cardColour: string;\n medi_idExpiry: string;\n\n any_idNumber: string;\n };\n };\n }[];\n addressComponentForm: {\n data: {\n useManualAddress: boolean;\n residentialAddress: {\n addressId: string;\n formatted_address: string;\n address_components: {\n long_name: string;\n short_name: string;\n types: string[];\n }[];\n };\n };\n };\n};\n\ntype AddressData = FormIOOnboardingDataScheme['addressComponentForm']['data']['residentialAddress'];\nexport const findCountryAlpha2 = (comps: AddressData['address_components']) => {\n return comps.find((comp) => comp.types.includes('country'))?.short_name ?? null;\n};\n","import type { Document } from '@module/common/shared/models/Document';\nimport type { IndividualModuleContext } from '@module/individual';\n\nimport { alpha3ToAlpha2, alpha3ToName } from './countryData';\n\nimport type { FormIOInstance, FormIOOnboardingDataScheme } from '../formioSdk';\n\nexport function assignIndividualDataToFormioSdk(\n individual: IndividualModuleContext,\n formio: FormIOInstance<FormIOOnboardingDataScheme>,\n) {\n // Take pre existing data from the individual module and inject into the form\n const { givenName, middleName, familyName } = individual.access('name').getValue();\n const dateOfBirth = individual.access('dateOfBirth').getValue();\n const documents = individual.access('documents').getValue();\n const addresses = individual.access('addresses').getValue();\n const entityId = individual.access('entityId').getValue();\n\n const { longForm: addressLongForm, country: addressCountryAlpha3, addressId } = addresses[0] ?? {};\n\n // https://help.form.io/developers/form-development/form-renderer#submission-data\n formio.setSubmission({\n data: {\n basicPiiForm: {\n data: {\n entityId,\n firstName: givenName,\n middleName,\n lastName: familyName,\n dateOfBirth,\n },\n },\n documents: documents\n .filter((doc) =>\n [\n // These are the document types we are including in the conversion\n // Whenever supporting new doc types add it here and add it to\n // the documentObjectToGenericDocumentFields function below\n // Also do the same in assignFormioDataToIndividualModule.ts\n 'PASSPORT',\n 'DRIVERS_LICENCE',\n 'NATIONAL_HEALTH_ID',\n ].includes(doc.idType),\n )\n .map((doc) => ({\n genericDocument: {\n data: documentObjectToGenericDocumentFields(doc),\n },\n })),\n addressComponentForm: {\n data: {\n useManualAddress: false,\n residentialAddress: {\n addressId,\n formatted_address: addressLongForm ?? '',\n address_components: addressCountryAlpha3\n ? [\n {\n long_name: alpha3ToName(addressCountryAlpha3),\n short_name: alpha3ToAlpha2(addressCountryAlpha3),\n types: ['country'],\n },\n ]\n : [],\n },\n },\n },\n },\n });\n}\n\ntype GenericDocumentData = FormIOOnboardingDataScheme['documents'][number]['genericDocument']['data'];\nfunction documentObjectToGenericDocumentFields(documentObject: Document): GenericDocumentData {\n const idType = documentObject.idType;\n const genericDocumentFields = {\n documentId: documentObject.documentId,\n idType,\n issuingCountry: documentObject.country,\n } as GenericDocumentData;\n if (idType === 'PASSPORT') {\n Object.assign(genericDocumentFields, {\n pass_idNumber: documentObject.idNumber,\n pass_idExpiry: documentObject.idExpiry,\n });\n } else if (idType === 'DRIVERS_LICENCE') {\n Object.assign(genericDocumentFields, {\n dl_idNumber: documentObject.idNumber,\n dl_idExpiry: documentObject.idExpiry,\n dl_cardNumber: documentObject.extraData.document_number,\n dl_region: documentObject.region,\n });\n } else if (idType === 'NATIONAL_HEALTH_ID') {\n Object.assign(genericDocumentFields, {\n medi_idNumber: documentObject.idNumber,\n medi_idExpiry: documentObject.idExpiry,\n medi_cardPosition: documentObject.extraData.reference,\n medi_cardColour: documentObject.idSubType,\n // TODO: map more medicare fields\n });\n } else {\n throw new Error(`Unknown document type '${idType}', can't map to formio as this could have unexpected results`);\n }\n\n return genericDocumentFields;\n}\n","import { feat } from '@feature-flags';\nimport { loadAsyncAsset } from '@module/common';\nimport type { WrapperParameters } from '@module/common/modules/defineModule';\nimport { defineWrapper } from '@module/common/modules/defineModule';\nimport type { SmartUIModule } from '@module/smart-ui/definition';\n\nimport { generateScopeStyleOverrides } from './styleOverrides';\nimport { assignFormioDataToIndividualModule } from './transformers/assignFormioDataToIndividualModule';\nimport { assignIndividualDataToFormioSdk } from './transformers/assignIndividualDataToFormioSdk';\nimport { initialiseFormio } from './transformers/initialiseFormio';\n\nimport type { FormIOOnboardingDataScheme } from './formioSdk';\n\nconst GLOBAL_ASSETS: [string, 'script' | 'style'][] = [\n ['https://cdn.form.io/formiojs/formio.full.js', 'script'],\n // Since fonts won't work when loaded from inside the shadow dom, load FontAwesome icons here\n ['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css', 'style'],\n // Also the general font chosen for the form in the feature flag\n [feat('modules.smartUI.font.cdnUrl'), 'style'],\n];\nconst SCOPED_STYLES = [\n 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css',\n 'https://cdn.form.io/formiojs/formio.full.min.css',\n];\nconst CONTAINER_CLASSLIST = ['smart-ui', 'formio'];\nexport const initialise = defineWrapper<SmartUIModule>('formio', async (shared, options) => {\n const { mountElement } = options;\n const smartUiImplementation = shared.recipe.smartUI.implementation;\n const formUrl = smartUiImplementation.name === 'formio' && smartUiImplementation.formUrl;\n\n if (!formUrl) {\n throw new Error('Formio implementation requires a formUrl');\n }\n\n mountElement.classList.add(...CONTAINER_CLASSLIST);\n const wrappingMode = feat('modules.smartUI.wrappingMode');\n\n const [styledMountElement, wrapperElement, windowWithFormio] = await ((): Promise<[HTMLElement, Node, Window]> => {\n if (wrappingMode === 'shadow') return attachShadow(mountElement);\n if (wrappingMode === 'iframe') return attachIframe(mountElement);\n return attachDiv(mountElement);\n })();\n\n if (wrappingMode !== 'iframe' && !window.Formio) {\n await Promise.all(GLOBAL_ASSETS.map((asset) => loadAsyncAsset(...asset)));\n } else if (wrappingMode === 'iframe') {\n // Iframe will load the script inside the iframe, so we need to wait for it to load\n await Promise.all(\n GLOBAL_ASSETS.map(([url, type]) =>\n loadAsyncAsset(url, {\n type,\n targetNode: windowWithFormio.document.body,\n }),\n ),\n );\n }\n\n await loadFormio(shared, { mountElement: styledMountElement, windowWithFormio });\n\n // DONE\n\n const localEventHub = shared.localEventHub;\n localEventHub.emit('loaded', {\n //TODO: make domElement take Node instead of HTMLElement\n domElement: wrapperElement as HTMLElement,\n implementation: 'formio',\n });\n\n return {\n cleanup: () => {},\n };\n});\nconst addStyles = (mountElement: Node) => {\n const document = mountElement.ownerDocument;\n // Adding scoped styles\n SCOPED_STYLES.forEach((url) => {\n const link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', url);\n mountElement.appendChild(link);\n });\n // Assigning Font styles\n const customStyles = document.createElement('style');\n const fontFamilyName = feat('modules.smartUI.font.fontFamilyCSSRule');\n\n const isShadowDom = mountElement instanceof ShadowRoot;\n const rootSelector = isShadowDom ? ':host' : '.smart-ui.formio';\n\n customStyles.innerHTML =\n `${rootSelector} { font-family: ${fontFamilyName} }` + generateScopeStyleOverrides(rootSelector);\n mountElement.appendChild(customStyles);\n};\nconst attachIframe = async (mountElement: HTMLElement): Promise<[HTMLElement, Node, Window]> => {\n const iframe = document.createElement('iframe');\n\n iframe.srcdoc = `<html><body><div class='smart-ui formio'></div></body></html>`;\n iframe.style.minHeight = '600px';\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n iframe.style.border = 'none';\n\n mountElement.appendChild(iframe);\n // Wait till iframe parses the srcdoc\n await new Promise((resolve, reject) => {\n iframe.onload = resolve;\n iframe.onerror = reject;\n });\n addStyles(iframe.contentDocument.body);\n const internalMountElement = iframe.contentDocument.querySelector<HTMLElement>('.smart-ui.formio');\n return [internalMountElement, iframe, iframe.contentWindow];\n};\nconst attachDiv = async (mountElement: HTMLElement): Promise<[HTMLElement, Node, Window]> => {\n addStyles(mountElement);\n // Formio will remove all contents of the mount element, so we need to create a new internal mountElement\n const internalMountElement = document.createElement('div');\n mountElement.appendChild(internalMountElement);\n return [internalMountElement, mountElement, window];\n};\nconst attachShadow = async (mountElement: HTMLElement): Promise<[HTMLElement, Node, Window]> => {\n const shadowRoot = mountElement.attachShadow({ mode: 'open' });\n addStyles(shadowRoot);\n const internalMountElement = document.createElement('div');\n shadowRoot.appendChild(internalMountElement);\n return [internalMountElement, shadowRoot, window];\n};\n// FORM IO LIB\nasync function loadFormio(\n shared: WrapperParameters<SmartUIModule>[0],\n options: { mountElement: HTMLElement; windowWithFormio: Window },\n) {\n const { mountElement, windowWithFormio } = options;\n\n const localEventHub = shared.localEventHub;\n const smartUiImplementation = shared.recipe.smartUI.implementation;\n const formUrl = smartUiImplementation.name === 'formio' && smartUiImplementation.formUrl;\n\n const individual = shared.oneSdkInstance.individual();\n\n const [formio] = await Promise.all([\n windowWithFormio.Formio.createForm<FormIOOnboardingDataScheme>(mountElement, formUrl),\n individual.search(),\n ]);\n initialiseFormio(formio);\n // 1) set all listeners first\n formio.ready.then(() => localEventHub.emit('ready', { domElement: mountElement as HTMLElement }));\n formio.on('submitPressed', async () => {\n if (!formio.checkValidity(null, false, null, true)) return;\n // When button is clicked, convert plain formio data to BFF data\n assignFormioDataToIndividualModule(formio.data, individual);\n // Submit data to BFF\n await individual.submit();\n\n const entityId = individual.access('entityId').getValue();\n const applicant = individual.access('__deprecated_applicant').getValue();\n const documents = individual.access('__deprecated_documents').getValue();\n // Emit \"results\" event, just like smart ui also does.\n localEventHub.emit('results', { applicant, documents, entityId });\n mountElement.innerHTML = '';\n });\n\n assignIndividualDataToFormioSdk(individual, formio);\n\n // set additional configuration. This can be taken from the recipe\n formio.language = 'en';\n}\n","import { type FormIOInstance, type FormIOOnboardingDataScheme } from '../formioSdk';\n\nexport async function initialiseFormio(formio: FormIOInstance<FormIOOnboardingDataScheme>) {\n // Adding formio instance to the devtools\n const smartUIComponent = window.__ONE_SDK__DEVTOOLS.moduleInstances.components['smart-ui'] as {\n formioInstances: FormIOInstance<FormIOOnboardingDataScheme>[];\n };\n if (!smartUIComponent?.formioInstances) smartUIComponent.formioInstances ??= [];\n smartUIComponent.formioInstances.push(formio);\n\n /**\n * Leaving this as an example of how OneSDK can programmatically change formio's components.\n * !Attention: UI Logic should not be done here, but in the formio platform directly.\n * !For example: The list of supported countries for each customer needs to be defined by techops using the drag and drop tool, not programmatically/through recipe.\n * !This will avoid the formio implementation from repeating the same problems of complex configuration we had with the legacy smart-ui implementation\n **/\n\n // const issuingCountrySelect = formio.getComponent<SelectComponent>('genericDocument.data.issuingCountry');\n // issuingCountrySelect.data.values = allCountries;\n // await formio.redraw();\n}\n","/**\n *\n * @param rootSelector The root selector to be used to scope the styles\n * @returns\n */\nexport function generateScopeStyleOverrides(rootSelector: string): string {\n const scopedStyleRules = [\n generalStyleOverrides(),\n overrideCardComponent(),\n overrideDataGridComponent(),\n genericClassnames(),\n ];\n // This line will join all the styles declared above and will scope them using the Sass library\n // When not using the shadow dom, this will prevent styles from leaking outside of the form elements\n return (`${rootSelector} { ${scopedStyleRules.join('\\n')} }`);\n}\n\n/**\n * Add all the different classnames we want to be available for use in the Formio builder\n * This is our preferred way of styling. Avoid making specific style changes to any HTML elements and simply provide a way for\n * our peers to customise reusable elements.\n * ie: Main titles, Section titles, Description text, Buttons, Section devider, Section Wrappers...\n **/\nfunction genericClassnames() {\n return `\n .main-page-title {\n font-size: 1.2rem;\n font-weight: bold;\n }\n `;\n}\n\n/** Generic styling that doesn't apply to any other category.\n * This might be unwanted and we might want to instead create a classname above such as:\n * .form-input label { ... }\n **/\nfunction generalStyleOverrides() {\n return `\n label {\n font-size: 0.8rem;\n }\n `;\n}\n\n// Below we add very specific styling overrides, which we want to avoid doing, unless absolutely necessary\n\n/**\n * Fix/Remove the appearence of the .card-body,\n * The card appearence is used when we bundle components in \"sections\" called \"Wells\"\n * We used them for example to group the PII, Address and Document fields together\n **/\nfunction overrideCardComponent() {\n return `\n .card.card-body {\n padding: 0;\n background-color: initial !important;\n border: none !important;\n border-width: 0 !important;\n border-color: transparent !important;\n margin-bottom: 0 !important;\n }\n `;\n}\n\n/**\n * Fix/Remove the appearence of the Datagrid component,\n * The datagrid is used is used when we want some form/resource to be rendered multiple times\n * ie: Array of Document objects\n * It looks terrible by default.\n **/\nfunction overrideDataGridComponent() {\n return `\n .formio-component-datagrid table,\n .formio-component-datagrid table tbody,\n .formio-component-datagrid table tr,\n .formio-component-datagrid table td {\n border: none !important;\n border-width: 0 !important;\n border-color: transparent !important;\n }\n\n [ref^=\"datagrid-\"] {\n padding: 0 !important;\n }\n [ref^=\"datagrid-\"]:not(:first-of-type) {\n padding-top: 24px;\n }\n `;\n}\n"],"names":["alpha3ToAlpha2","alpha3","country","alpha2","alpha3ToName","name","Object","keys","filter","code","length","map","value","label","formioToIndividualModulePipeline","formioData","individualModule","basicPiiForm","data","firstName","middleName","lastName","dateOfBirth","access","setValue","givenName","familyName","displayName","reformatted","Date","toISOString","split","addressComponentForm","residentialAddress","existingAddressObject","getValue","find","address","addressId","addressObject","newAddress","Address","addressType","createResidentialAddress","alpha2ToAlpha3","comps","comp","types","includes","short_name","findCountryAlpha2","address_components","longForm","formatted_address","updateAddress","addAddress","documents","doc","genericDocument","idType","documentData","documentObject","documentId","Document","idNumber","pass_idNumber","issuingCountry","idExpiry","pass_idExpiry","region","dl_region","dl_idNumber","extraData","document_number","dl_cardNumber","Error","medi_idNumber","medi_idExpiry","reference","medi_cardPosition","idSubType","medi_cardColour","mapSingleDocumentObject","forEach","updateDocument","addDocument","documentObjectToGenericDocumentFields","genericDocumentFields","assign","dl_idExpiry","GLOBAL_ASSETS","SCOPED_STYLES","CONTAINER_CLASSLIST","initialise","shared","options","mountElement","smartUiImplementation","recipe","smartUI","implementation","formUrl","classList","add","wrappingMode","styledMountElement","wrapperElement","windowWithFormio","attachShadow","attachIframe","attachDiv","window","Formio","Promise","all","url","type","loadAsyncAsset","targetNode","document","body","asset","localEventHub","individual","oneSdkInstance","formio","createForm","search","smartUIComponent","__ONE_SDK__DEVTOOLS","moduleInstances","components","formioInstances","push","initialiseFormio","ready","then","emit","domElement","on","checkValidity","transformer","submit","entityId","applicant","innerHTML","addresses","addressLongForm","addressCountryAlpha3","setSubmission","useManualAddress","long_name","assignIndividualDataToFormioSdk","language","loadFormio","cleanup","addStyles","ownerDocument","link","createElement","setAttribute","appendChild","customStyles","fontFamilyName","rootSelector","ShadowRoot","join","generateScopeStyleOverrides","iframe","srcdoc","style","minHeight","width","height","border","resolve","reject","onload","onerror","contentDocument","querySelector","contentWindow","internalMountElement","shadowRoot","mode"],"sourceRoot":""}
package/dist/version.txt CHANGED
@@ -1,2 +1,2 @@
1
- 1.2.0-rc
2
- v1.2.0-rc
1
+ 1.2.0-rc.2
2
+ v1.2.0-rc.2
package/package.json CHANGED
@@ -159,7 +159,7 @@
159
159
  },
160
160
  "types": "./dist/esm/modules/index.d.ts",
161
161
  "type": "module",
162
- "version": "1.2.0-rc",
162
+ "version": "1.2.0-rc.2",
163
163
  "files": [
164
164
  "dist/**/*",
165
165
  "README.md"