1var __async = (__this, __arguments, generator) => { 2 return new Promise((resolve, reject) => { 3 var fulfilled = (value) => { 4 try { 5 step(generator.next(value)); 6 } catch (e2) { 7 reject(e2); 8 } 9 }; 10 var rejected = (value) => { 11 try { 12 step(generator.throw(value)); 13 } catch (e2) { 14 reject(e2); 15 } 16 }; 17 var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); 18 step((generator = generator.apply(__this, __arguments)).next()); 19 }); 20}; 21import { a3 as u$2 } from "./index.es.es-CGxJBMfD.js"; 22import { ap as u$1, at as e, au as r$1, w as r$2, as as r$3, av as s, N, z as s$1, K as p, aw as useActions, q as u$3, v as e$1 } from "./odin-DIiukhnD.js"; 23import { J as Ji, A as At, t as tr, o as or, k as kn, r as rl, e as Je, _ as _e, j as pe$1, I, d as xi, b as Mn, L as Li } from "./vendor-CZvMt8Uf.js"; 24import { a as axios } from "./vendor-axios-B5u-j0E8.js"; 25import "./odin-utils-Dx2y7OLM.js"; 26import { I as Icon } from "./odin-assets-D7LmUGe7.js"; 27import "./vendor-utils-j6SE9MGc.js"; 28import "./vendor-qrcode-DVLuOpww.js"; 29import "./vendor-vue-CIEl4Ose.js"; 30import "./vendor-sentry-DRCyJRFj.js"; 31function a(e2, o) { 32 return __async(this, null, function* () { 33 const { data: s2 } = yield axios.post(e2, { onDeviceAppAuth: o }); 34 return r(s2); 35 }); 36} 37function u(e2, o) { 38 return __async(this, null, function* () { 39 const { data: s2 } = yield axios.post(e2, { orderRefId: o }); 40 return t(s2); 41 }); 42} 43const r = (e2) => { 44 var _a; 45 return { 46 orderRefId: (_a = e2.orderRefId) != null ? _a : e2.orderRef, 47 autoStartToken: e2.autoStartToken 48 }; 49}, t = (e2) => { 50 var _a, _b; 51 return { 52 status: e2.status, 53 qrCode: (_a = e2.qrCode) != null ? _a : null, 54 errorMessage: (_b = e2.errorMessage) != null ? _b : e2.statusMessage, 55 hintCode: e2.hintCode 56 }; 57}; 58const le = { class: "bankid-qr-code text-center" }, ne = ["data-test"], ie = ["data-test"], ce = ["data-test"], ue = ["data-test"], de = ["data-test"], pe = ["data-test"], ve = ["data-test"], c = {}, Ae = /* @__PURE__ */ Ji({ 59 __name: "WsBankIdQrCode", 60 props: { 61 beginSession: { 62 type: Function, 63 default: null 64 }, 65 resolveSession: { 66 type: Function, 67 default: null 68 }, 69 beginUrl: { 70 type: String, 71 default: null 72 }, 73 resolveUrl: { 74 type: String, 75 default: null 76 }, 77 initialOrderRefId: { 78 type: String, 79 default: null 80 }, 81 successMethod: { 82 type: String, 83 default: null 84 }, 85 successLabel: { 86 type: String, 87 default: null 88 }, 89 onSuccess: { 90 type: Object, 91 default: () => ({}) 92 } 93 }, 94 emits: ["complete", "failed", "error"], 95 setup(F, { expose: O, emit: z }) { 96 const { responseAction: Q } = useActions(), t2 = F, m = z, o = At(false), _ = At(t2.initialOrderRefId), i = At(null), y = At(""), k = At(false), R = At(false), g = At(false), p$1 = At(""), v = At(null), W = u$1(), S = Li(() => !W.platform.is.desktop); 97 tr(() => { 98 t2.initialOrderRefId ? (o.value = true, U()) : I$1(); 99 }); 100 const I$1 = () => __async(null, null, function* () { 101 B(), o.value = true, k.value = false, i.value = null; 102 try { 103 const e2 = yield E(false); 104 _.value = e2.orderRefId; 105 } catch (e2) { 106 b(e2); 107 return; 108 } 109 S.value || (yield w()), g.value || (o.value = false); 110 }), E = (e2) => __async(null, null, function* () { 111 if (t2.beginSession) 112 return t2.beginSession(e2); 113 if (t2.beginUrl) 114 try { 115 return yield a(t2.beginUrl, e2); 116 } catch (l) { 117 b(l); 118 } 119 throw new Error("BankIdQrCode: either beginSession or beginUrl prop is required"); 120 }), D = (e2) => __async(null, null, function* () { 121 if (t2.resolveSession) 122 return t2.resolveSession(e2); 123 if (t2.resolveUrl) 124 try { 125 return yield u(t2.resolveUrl, e2); 126 } catch (l) { 127 b(l); 128 } 129 throw new Error("BankIdQrCode: either resolveSession or resolveUrl prop is required"); 130 }), w = () => __async(null, null, function* () { 131 if (_.value) 132 try {
133 const e$12 = yield D(_.value); 134 e$12.qrCode && (i.value = e$12.qrCode), y.value = e$12.status || e.FAILED, P(e$12); 135 } catch (e2) { 136 u$22(), i.value = null, b(e2), m("error", e2); 137 } 138 }), P = (e$12) => __async(null, null, function* () { 139 y.value === e.COMPLETE ? (u$22(), o.value = false, i.value = null, R.value = true, m("complete", e$12), t2.onSuccess && Object.keys(t2.onSuccess).length > 0 && (yield Q(e$12, {}, t2.onSuccess))) : y.value === e.PENDING ? v.value === null && U() : y.value === e.FAILED && (u$22(), i.value = null, p$1.value = e$12.errorMessage || "RFA22", M(), m("failed", { errorMessage: e$12.errorMessage || "RFA22" })); 140 }), C = () => __async(null, null, function* () { 141 o.value = true, u$22(), B(); 142 try { 143 const e2 = yield E(true); 144 _.value = e2.orderRefId; 145 const l = e2.autoStartToken; 146 if (S.value || (yield w()), S.value) { 147 const j = encodeURIComponent( 148 `${window.location.origin}${window.location.pathname}?orderRefId=${_.value}` 149 ); 150 window.location.href = `https://app.bankid.com/?autostarttoken=${l}&redirect=${j}`; 151 } else 152 window.location.href = encodeURI( 153 `bankid:///?autostarttoken=${l}&redirect=null` 154 ); 155 } catch (e2) { 156 b(e2), m("error", e2); 157 } 158 }), U = () => { 159 v.value === null && (v.value = setInterval(w, 2e3)); 160 }, u$22 = () => { 161 v.value !== null && (clearInterval(v.value), v.value = null); 162 }, A = () => { 163 I$1(); 164 }, b = (e2) => { 165 if (axios.isAxiosError(e2) && e2.response) { 166 const { status: l } = e2.response; 167 l === 403 ? p$1.value = "session_expired" : p$1.value = "RFA22"; 168 } else 169 p$1.value = "RFA22"; 170 M(), u$22(), i.value = null, m("error", e2); 171 }, M = () => { 172 o.value = false, g.value = true, k.value = true; 173 }, B = () => { 174 g.value = false, p$1.value = ""; 175 }; 176 return or(() => { 177 u$22(); 178 }), O({ 179 initiateQrCode: I$1, 180 openInApp: C, 181 retry: A, 182 stopPolling: u$22, 183 testNames: c 184 }), (e2, l) => { 185 var _a; 186 return kn(), rl("div", le, [ 187 R.value && t2.successMethod ? (kn(), rl("div", { 188 key: 0, 189 class: "bankid-qr-code__success q-pa-xl", 190 "data-test": Je(c).success 191 }, [ 192 t2.successMethod === Je(r$1).ICON ? (kn(), rl(_e, { key: 0 }, [ 193 pe$1(r$2, { 194 name: Je(Icon).SUCCESS, 195 size: 66, 196 color: "ots-success-graphic-dark", 197 class: "q-mt-md q-mb-sm" 198 }, null, 8, ["name"]), 199 t2.successLabel ? (kn(), rl("div", { 200 key: 0, 201 class: "q-mb-xl", 202 "data-test": Je(c).successLabel 203 }, I(t2.successLabel), 9, ie)) : xi("", true) 204 ], 64)) : t2.successMethod === Je(r$1).BANNER ? (kn(), Mn(r$3, { 205 key: 1, 206 type: "success", 207 text: (_a = t2.successLabel) != null ? _a : "" 208 }, null, 8, ["text"])) : xi("", true) 209 ], 8, ne)) : (kn(), rl(_e, { key: 1 }, [ 210 g.value ? (kn(), rl("div", { 211 key: 0, 212 class: "bankid-qr-code__error q-mb-lg", 213 "data-test": Je(c).error 214 }, [ 215 pe$1(r$3, { 216 type: "alert", 217 text: e2.$t(`uikit:ws_bank_id_qr_code.status.error.${p$1.value}`) 218 }, null, 8, ["text"]) 219 ], 8, ce)) : xi("", true), 220 !o.value && !k.value && !S.value && i.value ? (kn(), rl("div", { 221 key: 1, 222 class: "bankid-qr-code__qr q-mb-md", 223 "data-test": Je(c).qr 224 }, [ 225 pe$1(s, { content: i.value }, null, 8, ["content"]) 226 ], 8, ue)) : xi("", true), 227 !o.value && !k.value ? (kn(), rl("div", { 228 key: 2, 229 class: "bankid-qr-code__open-in-app q-mt-lg", 230 "data-test": Je(c).openInApp 231 }, [ 232 pe$1(s$1, { 233 type: Je(N).Type.TERTIARY_NEUTRAL, 234 size: Je(N).Size.MEDIUM, 235 "aria-label": e2.$t("uikit:ws_bank_id_qr_code.accessibility.open_bank_id_application"), 236 label: e2.$t("uikit:ws_bank_id_qr_code.open_in_app"), 237 onClick: C 238 }, null, 8, ["type", "size", "aria-label", "label"]) 239 ], 8, de)) : xi("", true), 240 !o.value && k.value ? (kn(), rl("div", { 241 key: 3, 242 class: "bankid-qr-code__retry q-mt-lg", 243 "data-test": Je(c).retry 244 }, [ 245 pe$1(s$1, { 246 type: Je(N).Type.TERTIARY_NEUTRAL, 247 size: Je(N).Size.MEDIUM, 248 icon: Je(Icon).RESTORE, 249 "aria-label": e2.$t("uikit:ws_bank_id_qr_code.accessibility.start_again"), 250 label: e2.$t("uikit:ws_bank_id_qr_code.retry"), 251 onClick: A 252 }, null, 8, ["type", "size", "icon", "aria-label", "label"]) 253 ], 8, pe)) : xi("", true), 254 o.value ? (kn(), rl("div", { 255 key: 4, 256 class: "bankid-qr-code__loading q-py-xl", 257 "data-test": Je(c).loading 258 }, [ 259 pe$1(p) 260 ], 8, ve)) : xi("", true) 261 ], 64)) 262 ]); 263 }; 264 } 265}); 266const d = u$2(e$1, "ws-bank-id-qr-code", Ae, u$3); 267export { 268 d as default 269}; 270//# sourceMappingURL=WsBankIdQrCode.proxy.es.es-CkCjTr_k.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.