@everymatrix/cashier-iframe-redirect 1.35.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).app=e()}(this,(function(){"use strict";function t(){}function e(t){return t()}function r(){return Object.create(null)}function n(t){t.forEach(e)}function i(t){return"function"==typeof t}function o(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let s,a;function l(t,e){return s||(s=document.createElement("a")),s.href=e,t===s.href}function h(e,...r){if(null==e)return t;const n=e.subscribe(...r);return n.unsubscribe?()=>n.unsubscribe():n}function c(t,e){t.appendChild(e)}function u(t,e,r){t.insertBefore(e,r||null)}function f(t){t.parentNode&&t.parentNode.removeChild(t)}function p(t){return document.createElement(t)}function m(t){return document.createTextNode(t)}function g(){return m(" ")}function d(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function b(t,e,r){null==r?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}function y(t,e,r){e in t?t[e]="boolean"==typeof t[e]&&""===r||r:b(t,e,r)}function E(t){const e={};for(const r of t)e[r.name]=r.value;return e}function v(t){a=t}
|
|
2
2
|
/**
|
|
3
3
|
* Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).
|
|
4
4
|
* Event dispatchers are functions that can take two arguments: `name` and `detail`.
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
*
|
|
12
12
|
* https://svelte.dev/docs#run-time-svelte-createeventdispatcher
|
|
13
13
|
*/
|
|
14
|
-
function
|
|
14
|
+
function H(){const t=function(){if(!a)throw new Error("Function called outside component initialization");return a}();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){
|
|
15
15
|
// TODO are there situations where events could be dispatched
|
|
16
16
|
// in a server (non-DOM) environment?
|
|
17
|
-
const o=function(e,
|
|
17
|
+
const o=function(t,e,{bubbles:r=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r,n,e),i}(e,r,{cancelable:n});return i.slice().forEach((e=>{e.call(t,o)})),!o.defaultPrevented}return!0}}const T=[],B=[];let C=[];const w=[],_=Promise.resolve();let L=!1;function A(t){C.push(t)}
|
|
18
18
|
// flush() calls callbacks in this order:
|
|
19
19
|
// 1. All beforeUpdate callbacks, in order: parents before children
|
|
20
20
|
// 2. All bind:this callbacks, in reverse order: children before parents.
|
|
@@ -33,56 +33,56 @@ const o=function(e,t,{bubbles:r=!1,cancelable:n=!1}={}){const i=document.createE
|
|
|
33
33
|
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
|
34
34
|
// callback called a second time; the seen_callbacks set, outside the flush()
|
|
35
35
|
// function, guarantees this behavior.
|
|
36
|
-
const
|
|
37
|
-
function
|
|
36
|
+
const P=new Set;let S=0;// Do *not* move this inside the flush() function
|
|
37
|
+
function O(){
|
|
38
38
|
// Do not reenter flush while dirty components are updated, as this can
|
|
39
39
|
// result in an infinite loop. Instead, let the inner flush handle it.
|
|
40
40
|
// Reentrancy is ok afterwards for bindings etc.
|
|
41
|
-
if(0!==
|
|
41
|
+
if(0!==S)return;const t=a;do{
|
|
42
42
|
// first, call beforeUpdate functions
|
|
43
43
|
// and update components
|
|
44
|
-
try{for(;
|
|
44
|
+
try{for(;S<T.length;){const t=T[S];S++,v(t),N(t.$$)}}catch(t){
|
|
45
45
|
// reset dirty state to not end up in a deadlocked state and then rethrow
|
|
46
|
-
throw
|
|
46
|
+
throw T.length=0,S=0,t}for(v(null),T.length=0,S=0;B.length;)B.pop()();
|
|
47
47
|
// then, once components are updated, call
|
|
48
48
|
// afterUpdate functions. This may cause
|
|
49
49
|
// subsequent updates...
|
|
50
|
-
for(let
|
|
50
|
+
for(let t=0;t<C.length;t+=1){const e=C[t];P.has(e)||(
|
|
51
51
|
// ...so guard against infinite loops
|
|
52
|
-
|
|
52
|
+
P.add(e),e())}C.length=0}while(T.length);for(;w.length;)w.pop()();L=!1,P.clear(),v(t)}function N(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(A)}}
|
|
53
53
|
/**
|
|
54
54
|
* Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
|
|
55
|
-
*/const
|
|
55
|
+
*/const M=new Set;function I(t,e){const r=t.$$;null!==r.fragment&&(!function(t){const e=[],r=[];C.forEach((n=>-1===t.indexOf(n)?e.push(n):r.push(n))),r.forEach((t=>t())),C=e}(r.after_update),n(r.on_destroy),r.fragment&&r.fragment.d(e),
|
|
56
56
|
// TODO null out other refs, including component.$$ (but need to
|
|
57
57
|
// preserve final state?)
|
|
58
|
-
r.on_destroy=r.fragment=null,r.ctx=[])}function
|
|
58
|
+
r.on_destroy=r.fragment=null,r.ctx=[])}function R(t,e){-1===t.$$.dirty[0]&&(T.push(t),L||(L=!0,_.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function $(o,s,l,h,c,u,p,m=[-1]){const g=a;v(o);const d=o.$$={fragment:null,ctx:[],
|
|
59
59
|
// state
|
|
60
|
-
props:u,update:
|
|
60
|
+
props:u,update:t,not_equal:c,bound:r(),
|
|
61
61
|
// lifecycle
|
|
62
62
|
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(g?g.$$.context:[])),
|
|
63
63
|
// everything else
|
|
64
|
-
callbacks:r(),dirty:m,skip_bound:!1,root:s.target||g.$$.root};p&&p(
|
|
64
|
+
callbacks:r(),dirty:m,skip_bound:!1,root:s.target||g.$$.root};p&&p(d.root);let b=!1;if(d.ctx=l?l(o,s.props||{},((t,e,...r)=>{const n=r.length?r[0]:e;return d.ctx&&c(d.ctx[t],d.ctx[t]=n)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](n),b&&R(o,t)),e})):[],d.update(),b=!0,n(d.before_update),
|
|
65
65
|
// `false` as a special case of no DOM component
|
|
66
|
-
|
|
66
|
+
d.fragment=!!h&&h(d.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);
|
|
67
67
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
68
|
-
|
|
68
|
+
d.fragment&&d.fragment.l(t),t.forEach(f)}else
|
|
69
69
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
70
|
-
|
|
70
|
+
d.fragment&&d.fragment.c();s.intro&&((y=o.$$.fragment)&&y.i&&(M.delete(y),y.i(E))),function(t,r,o,s){const{fragment:a,after_update:l}=t.$$;a&&a.m(r,o),s||
|
|
71
71
|
// onMount happens before the initial afterUpdate
|
|
72
|
-
|
|
72
|
+
A((()=>{const r=t.$$.on_mount.map(e).filter(i);
|
|
73
73
|
// if the component was destroyed immediately
|
|
74
74
|
// it will update the `$$.on_destroy` reference to `null`.
|
|
75
75
|
// the destructured on_destroy may still reference to the old array
|
|
76
|
-
|
|
76
|
+
t.$$.on_destroy?t.$$.on_destroy.push(...r):
|
|
77
77
|
// Edge case - component was destroyed immediately,
|
|
78
78
|
// most likely as a result of a binding initialising
|
|
79
|
-
n(r),
|
|
79
|
+
n(r),t.$$.on_mount=[]})),l.forEach(A)}(o,s.target,s.anchor,s.customElement),O()}var y,E;v(g)}let U;"function"==typeof HTMLElement&&(U=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(i);
|
|
80
80
|
// @ts-ignore todo: improve typings
|
|
81
|
-
for(const
|
|
81
|
+
for(const t in this.$$.slotted)
|
|
82
82
|
// @ts-ignore todo: improve typings
|
|
83
|
-
this.appendChild(this.$$.slotted[
|
|
83
|
+
this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){I(this,1),this.$destroy=t}$on(e,r){
|
|
84
84
|
// TODO should this delegate to addEventListener?
|
|
85
|
-
if(!i(r))return
|
|
85
|
+
if(!i(r))return t;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const t=n.indexOf(r);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const k=[];
|
|
86
86
|
/**
|
|
87
87
|
* Creates a `Readable` store that allows reading by subscription.
|
|
88
88
|
* @param value initial value
|
|
@@ -93,123 +93,123 @@ if(!i(r))return e;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return
|
|
|
93
93
|
* @param {*=}value initial value
|
|
94
94
|
* @param {StartStopNotifier=} start
|
|
95
95
|
*/
|
|
96
|
-
function
|
|
97
|
-
const
|
|
96
|
+
function G(e,r=t){let n;const i=new Set;function s(t){if(o(e,t)&&(e=t,n)){// store is ready
|
|
97
|
+
const t=!k.length;for(const t of i)t[1](),k.push(t,e);if(t){for(let t=0;t<k.length;t+=2)k[t][0](k[t+1]);k.length=0}}}return{set:s,update:function(t){s(t(e))},subscribe:function(o,a=t){const l=[o,a];return i.add(l),1===i.size&&(n=r(s)||t),o(e),()=>{i.delete(l),0===i.size&&n&&(n(),n=null)}}}}function x(e,r,o){const s=!Array.isArray(e),a=s?[e]:e,l=r.length<2;return c=e=>{let o=!1;const c=[];let u=0,f=t;const p=()=>{if(u)return;f();const n=r(s?c[0]:c,e);l?e(n):f=i(n)?n:t},m=a.map(((t,e)=>h(t,(t=>{c[e]=t,u&=~(1<<e),o&&p()}),(()=>{u|=1<<e}))));return o=!0,p(),function(){n(m),f(),
|
|
98
98
|
// We need to set this to false because callbacks can still happen despite having unsubscribed:
|
|
99
99
|
// Callbacks might already be placed in the queue which doesn't know it should no longer
|
|
100
100
|
// invoke this derived store.
|
|
101
|
-
o=!1}},{subscribe:
|
|
101
|
+
o=!1}},{subscribe:G(o,c).subscribe};var c}var D=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===F}(t)}
|
|
102
102
|
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
103
|
-
(
|
|
103
|
+
(t)};var F="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function j(t,e){return!1!==e.clone&&e.isMergeableObject(t)?z((r=t,Array.isArray(r)?[]:{}),t,e):t;var r}function V(t,e,r){return t.concat(e).map((function(t){return j(t,r)}))}function X(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function K(t,e){try{return e in t}catch(t){return!1}}
|
|
104
104
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
105
|
-
function
|
|
106
|
-
})(
|
|
105
|
+
function Z(t,e,r){var n={};return r.isMergeableObject(t)&&X(t).forEach((function(e){n[e]=j(t[e],r)})),X(e).forEach((function(i){(function(t,e){return K(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e));// and also unsafe if they're nonenumerable.
|
|
106
|
+
})(t,i)||(K(t,i)&&r.isMergeableObject(e[i])?n[i]=function(t,e){if(!e.customMerge)return z;var r=e.customMerge(t);return"function"==typeof r?r:z}(i,r)(t[i],e[i],r):n[i]=j(e[i],r))})),n}function z(t,e,r){(r=r||{}).arrayMerge=r.arrayMerge||V,r.isMergeableObject=r.isMergeableObject||D,
|
|
107
107
|
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
108
108
|
// implementations can use it. The caller may not replace it.
|
|
109
|
-
r.cloneUnlessOtherwiseSpecified=
|
|
109
|
+
r.cloneUnlessOtherwiseSpecified=j;var n=Array.isArray(e);return n===Array.isArray(t)?n?r.arrayMerge(t,e,r):Z(t,e,r):j(e,r)}z.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,r){return z(t,r,e)}),{})};var Y=z,W=function(t,e){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},W(t,e)};function Q(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}W(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var J,q,tt,et=function(){return et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},et.apply(this,arguments)};function rt(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}
|
|
110
110
|
/**
|
|
111
111
|
* Type Guards
|
|
112
112
|
*/
|
|
113
|
-
function
|
|
113
|
+
function nt(t){return t.type===q.literal}function it(t){return t.type===q.argument}function ot(t){return t.type===q.number}function st(t){return t.type===q.date}function at(t){return t.type===q.time}function lt(t){return t.type===q.select}function ht(t){return t.type===q.plural}function ct(t){return t.type===q.pound}function ut(t){return t.type===q.tag}function ft(t){return!(!t||"object"!=typeof t||t.type!==tt.number)}function pt(t){return!(!t||"object"!=typeof t||t.type!==tt.dateTime)}
|
|
114
114
|
// @generated from regex-gen.ts
|
|
115
|
-
"function"==typeof SuppressedError&&SuppressedError,function(
|
|
115
|
+
"function"==typeof SuppressedError&&SuppressedError,function(t){
|
|
116
116
|
/** Argument is unclosed (e.g. `{0`) */
|
|
117
|
-
|
|
117
|
+
t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",
|
|
118
118
|
/** Argument is empty (e.g. `{}`). */
|
|
119
|
-
|
|
119
|
+
t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",
|
|
120
120
|
/** Argument is malformed (e.g. `{foo!}``) */
|
|
121
|
-
|
|
121
|
+
t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",
|
|
122
122
|
/** Expect an argument type (e.g. `{foo,}`) */
|
|
123
|
-
|
|
123
|
+
t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",
|
|
124
124
|
/** Unsupported argument type (e.g. `{foo,foo}`) */
|
|
125
|
-
|
|
125
|
+
t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",
|
|
126
126
|
/** Expect an argument style (e.g. `{foo, number, }`) */
|
|
127
|
-
|
|
127
|
+
t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",
|
|
128
128
|
/** The number skeleton is invalid. */
|
|
129
|
-
|
|
129
|
+
t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",
|
|
130
130
|
/** The date time skeleton is invalid. */
|
|
131
|
-
|
|
131
|
+
t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",
|
|
132
132
|
/** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
|
|
133
|
-
|
|
133
|
+
t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",
|
|
134
134
|
/** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
|
|
135
|
-
|
|
135
|
+
t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",
|
|
136
136
|
/** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
|
|
137
|
-
|
|
137
|
+
t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",
|
|
138
138
|
/** Missing select argument options (e.g. `{foo, select}`) */
|
|
139
|
-
|
|
139
|
+
t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",
|
|
140
140
|
/** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
|
|
141
|
-
|
|
141
|
+
t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",
|
|
142
142
|
/** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
|
|
143
|
-
|
|
143
|
+
t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",
|
|
144
144
|
/** Expecting a selector in `select` argument (e.g `{foo, select}`) */
|
|
145
|
-
|
|
145
|
+
t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",
|
|
146
146
|
/** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
|
|
147
|
-
|
|
147
|
+
t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",
|
|
148
148
|
/** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
|
|
149
|
-
|
|
149
|
+
t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",
|
|
150
150
|
/**
|
|
151
151
|
* Expecting a message fragment after the `plural` or `selectordinal` selector
|
|
152
152
|
* (e.g. `{foo, plural, one}`)
|
|
153
153
|
*/
|
|
154
|
-
|
|
154
|
+
t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",
|
|
155
155
|
/** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
|
|
156
|
-
|
|
156
|
+
t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",
|
|
157
157
|
/**
|
|
158
158
|
* Duplicate selectors in `plural` or `selectordinal` argument.
|
|
159
159
|
* (e.g. {foo, plural, one {#} one {#}})
|
|
160
160
|
*/
|
|
161
|
-
|
|
161
|
+
t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",
|
|
162
162
|
/** Duplicate selectors in `select` argument.
|
|
163
163
|
* (e.g. {foo, select, apple {apple} apple {apple}})
|
|
164
164
|
*/
|
|
165
|
-
|
|
165
|
+
t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",
|
|
166
166
|
/** Plural or select argument option must have `other` clause. */
|
|
167
|
-
|
|
167
|
+
t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",
|
|
168
168
|
/** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
|
|
169
|
-
|
|
169
|
+
t[t.INVALID_TAG=23]="INVALID_TAG",
|
|
170
170
|
/** The tag name is invalid. (e.g. `<123>foo</123>`) */
|
|
171
|
-
|
|
171
|
+
t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",
|
|
172
172
|
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
173
|
-
|
|
173
|
+
t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",
|
|
174
174
|
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
175
|
-
|
|
175
|
+
t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(J||(J={})),function(t){
|
|
176
176
|
/**
|
|
177
177
|
* Raw text
|
|
178
178
|
*/
|
|
179
|
-
|
|
179
|
+
t[t.literal=0]="literal",
|
|
180
180
|
/**
|
|
181
181
|
* Variable w/o any format, e.g `var` in `this is a {var}`
|
|
182
182
|
*/
|
|
183
|
-
|
|
183
|
+
t[t.argument=1]="argument",
|
|
184
184
|
/**
|
|
185
185
|
* Variable w/ number format
|
|
186
186
|
*/
|
|
187
|
-
|
|
187
|
+
t[t.number=2]="number",
|
|
188
188
|
/**
|
|
189
189
|
* Variable w/ date format
|
|
190
190
|
*/
|
|
191
|
-
|
|
191
|
+
t[t.date=3]="date",
|
|
192
192
|
/**
|
|
193
193
|
* Variable w/ time format
|
|
194
194
|
*/
|
|
195
|
-
|
|
195
|
+
t[t.time=4]="time",
|
|
196
196
|
/**
|
|
197
197
|
* Variable w/ select format
|
|
198
198
|
*/
|
|
199
|
-
|
|
199
|
+
t[t.select=5]="select",
|
|
200
200
|
/**
|
|
201
201
|
* Variable w/ plural format
|
|
202
202
|
*/
|
|
203
|
-
|
|
203
|
+
t[t.plural=6]="plural",
|
|
204
204
|
/**
|
|
205
205
|
* Only possible within plural argument.
|
|
206
206
|
* This is the `#` symbol that will be substituted with the count.
|
|
207
207
|
*/
|
|
208
|
-
|
|
208
|
+
t[t.pound=7]="pound",
|
|
209
209
|
/**
|
|
210
210
|
* XML-like tag
|
|
211
211
|
*/
|
|
212
|
-
|
|
212
|
+
t[t.tag=8]="tag"}(q||(q={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(tt||(tt={}));var mt=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,gt=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
213
213
|
/**
|
|
214
214
|
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
215
215
|
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
@@ -221,67 +221,67 @@ e[e.tag=8]="tag"}(J||(J={})),function(e){e[e.number=0]="number",e[e.dateTime=1]=
|
|
|
221
221
|
* @public
|
|
222
222
|
* @param skeleton skeleton string
|
|
223
223
|
*/
|
|
224
|
-
function
|
|
224
|
+
function dt(t){var e={};return t.replace(gt,(function(t){var r=t.length;switch(t[0]){
|
|
225
225
|
// Era
|
|
226
|
-
case"G":
|
|
226
|
+
case"G":e.era=4===r?"long":5===r?"narrow":"short";break;
|
|
227
227
|
// Year
|
|
228
|
-
case"y":
|
|
228
|
+
case"y":e.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
229
229
|
// Quarter
|
|
230
230
|
case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
231
231
|
// Month
|
|
232
|
-
case"M":case"L":
|
|
232
|
+
case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][r-1];break;
|
|
233
233
|
// Week
|
|
234
|
-
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":
|
|
234
|
+
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
235
235
|
// Weekday
|
|
236
|
-
case"E":
|
|
236
|
+
case"E":e.weekday=4===r?"short":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][r-4];break;
|
|
237
237
|
// Period
|
|
238
238
|
case"a":// AM, PM
|
|
239
|
-
|
|
239
|
+
e.hour12=!0;break;case"b":// am, pm, noon, midnight
|
|
240
240
|
case"B":// flexible day periods
|
|
241
241
|
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
242
242
|
// Hour
|
|
243
|
-
case"h":
|
|
243
|
+
case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][r-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][r-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][r-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
244
244
|
// Minute
|
|
245
|
-
case"m":
|
|
245
|
+
case"m":e.minute=["numeric","2-digit"][r-1];break;
|
|
246
246
|
// Second
|
|
247
|
-
case"s":
|
|
247
|
+
case"s":e.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
248
248
|
// Zone
|
|
249
249
|
case"z":// 1..3, 4: specific non-location format
|
|
250
|
-
|
|
250
|
+
e.timeZoneName=r<4?"short":"long";break;case"Z":// 1..3, 4, 5: The ISO8601 varios formats
|
|
251
251
|
case"O":// 1, 4: miliseconds in day short, long
|
|
252
252
|
case"v":// 1, 4: generic non-location format
|
|
253
253
|
case"V":// 1, 2, 3, 4: time zone ID or city
|
|
254
254
|
case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
255
255
|
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
256
|
-
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),
|
|
256
|
+
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}
|
|
257
257
|
// @generated from regex-gen.ts
|
|
258
|
-
var
|
|
258
|
+
var bt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var yt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Et=/^(@+)?(\+|#+)?[rs]?$/g,vt=/(\*)(0+)|(#+)(0+)|(0+)/g,Ht=/^(0+)$/;function Tt(t){var e={};return"r"===t[t.length-1]?e.roundingPriority="morePrecision":"s"===t[t.length-1]&&(e.roundingPriority="lessPrecision"),t.replace(Et,(function(t,r,n){
|
|
259
259
|
// @@@ case
|
|
260
|
-
return"string"!=typeof n?(
|
|
260
|
+
return"string"!=typeof n?(e.minimumSignificantDigits=r.length,e.maximumSignificantDigits=r.length):"+"===n?e.minimumSignificantDigits=r.length:"#"===r[0]?e.maximumSignificantDigits=r.length:(e.minimumSignificantDigits=r.length,e.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""})),e}function Bt(t){switch(t){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Ct(t){
|
|
261
261
|
// Engineering
|
|
262
|
-
var
|
|
262
|
+
var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var r=t.slice(0,2);if("+!"===r?(e.signDisplay="always",t=t.slice(2)):"+?"===r&&(e.signDisplay="exceptZero",t=t.slice(2)),!Ht.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function wt(t){var e=Bt(t);return e||{}}
|
|
263
263
|
/**
|
|
264
264
|
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
|
265
|
-
*/function
|
|
265
|
+
*/function _t(t){for(var e={},r=0,n=t;r<n.length;r++){var i=n[r];switch(i.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=i.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=i.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=et(et(et({},e),{notation:"scientific"}),i.options.reduce((function(t,e){return et(et({},t),wt(e))}),{}));continue;case"engineering":e=et(et(et({},e),{notation:"engineering"}),i.options.reduce((function(t,e){return et(et({},t),wt(e))}),{}));continue;case"notation-simple":e.notation="standard";continue;
|
|
266
266
|
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
|
267
|
-
case"unit-width-narrow":
|
|
267
|
+
case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(i.options[0]);continue;
|
|
268
268
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
269
|
-
case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(
|
|
269
|
+
case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(vt,(function(t,r,n,i,o,s){if(r)e.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}
|
|
270
270
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
271
|
-
if(
|
|
271
|
+
if(Ht.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(yt.test(i.stem)){
|
|
272
272
|
// Precision
|
|
273
273
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
|
274
274
|
// precision-integer case
|
|
275
|
-
if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(
|
|
275
|
+
if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(yt,(function(t,r,n,i,o,s){
|
|
276
276
|
// .000* case (before ICU67 it was .000+)
|
|
277
|
-
return"*"===n?
|
|
277
|
+
return"*"===n?e.minimumFractionDigits=r.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:o&&s?(e.minimumFractionDigits=o.length,e.maximumFractionDigits=o.length+s.length):(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length),""}));var o=i.options[0];
|
|
278
278
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
279
|
-
"w"===o?
|
|
279
|
+
"w"===o?e=et(et({},e),{trailingZeroDisplay:"stripIfInteger"}):o&&(e=et(et({},e),Tt(o)))}
|
|
280
280
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
|
281
|
-
else if(
|
|
281
|
+
else if(Et.test(i.stem))e=et(et({},e),Tt(i.stem));else{var s=Bt(i.stem);s&&(e=et(et({},e),s));var a=Ct(i.stem);a&&(e=et(et({},e),a))}}return e}
|
|
282
282
|
// @generated from time-data-gen.ts
|
|
283
283
|
// prettier-ignore
|
|
284
|
-
var
|
|
284
|
+
var Lt,At={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};
|
|
285
285
|
/**
|
|
286
286
|
* Returns the best matching date time pattern if a date time skeleton
|
|
287
287
|
* pattern is provided with a locale. Follows the Unicode specification:
|
|
@@ -294,45 +294,45 @@ var Le,Pe={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H
|
|
|
294
294
|
* of the given `locale` to the corresponding time pattern.
|
|
295
295
|
* @param locale
|
|
296
296
|
*/
|
|
297
|
-
function
|
|
297
|
+
function Pt(t){var e=t.hourCycle;if(void 0===e&&
|
|
298
298
|
// @ts-ignore hourCycle(s) is not identified yet
|
|
299
|
-
|
|
299
|
+
t.hourCycles&&
|
|
300
300
|
// @ts-ignore
|
|
301
|
-
|
|
301
|
+
t.hourCycles.length&&(
|
|
302
302
|
// @ts-ignore
|
|
303
|
-
t
|
|
303
|
+
e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}
|
|
304
304
|
// TODO: Once hourCycle is fully supported remove the following with data generation
|
|
305
|
-
var r,n=
|
|
305
|
+
var r,n=t.language;return"root"!==n&&(r=t.maximize().region),(At[r||""]||At[n||""]||At["".concat(n,"-001")]||At["001"])[0]}var St=new RegExp("^".concat(mt.source,"*")),Ot=new RegExp("".concat(mt.source,"*$"));function Nt(t,e){return{start:t,end:e}}
|
|
306
306
|
// #region Ponyfills
|
|
307
307
|
// Consolidate these variables up top for easier toggling during debugging
|
|
308
|
-
var
|
|
308
|
+
var Mt=!!String.prototype.startsWith,It=!!String.fromCodePoint,Rt=!!Object.fromEntries,$t=!!String.prototype.codePointAt,Ut=!!String.prototype.trimStart,kt=!!String.prototype.trimEnd,Gt=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},xt=!0;try{
|
|
309
309
|
/**
|
|
310
310
|
* legacy Edge or Xbox One browser
|
|
311
311
|
* Unicode flag support: supported
|
|
312
312
|
* Pattern_Syntax support: not supported
|
|
313
313
|
* See https://github.com/formatjs/formatjs/issues/2822
|
|
314
314
|
*/
|
|
315
|
-
|
|
316
|
-
function(e,
|
|
317
|
-
function(e,
|
|
318
|
-
function(){for(var
|
|
315
|
+
xt="a"===(null===(Lt=zt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Lt?void 0:Lt[0])}catch(t){xt=!1}var Dt,Ft=Mt?// Native
|
|
316
|
+
function(t,e,r){return t.startsWith(e,r)}:// For IE11
|
|
317
|
+
function(t,e,r){return t.slice(r,r+e.length)===e},jt=It?String.fromCodePoint:// IE11
|
|
318
|
+
function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r,n="",i=t.length,o=0;i>o;){if((r=t[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},Vt=
|
|
319
319
|
// native
|
|
320
|
-
|
|
321
|
-
function(
|
|
322
|
-
function(e
|
|
323
|
-
function(e
|
|
324
|
-
function(
|
|
325
|
-
function(
|
|
326
|
-
function(
|
|
327
|
-
function(
|
|
320
|
+
Rt?Object.fromEntries:// Ponyfill
|
|
321
|
+
function(t){for(var e={},r=0,n=t;r<n.length;r++){var i=n[r],o=i[0],s=i[1];e[o]=s}return e},Xt=$t?// Native
|
|
322
|
+
function(t,e){return t.codePointAt(e)}:// IE 11
|
|
323
|
+
function(t,e){var r=t.length;if(!(e<0||e>=r)){var n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===r||(n=t.charCodeAt(e+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},Kt=Ut?// Native
|
|
324
|
+
function(t){return t.trimStart()}:// Ponyfill
|
|
325
|
+
function(t){return t.replace(St,"")},Zt=kt?// Native
|
|
326
|
+
function(t){return t.trimEnd()}:// Ponyfill
|
|
327
|
+
function(t){return t.replace(Ot,"")};
|
|
328
328
|
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
|
329
|
-
function
|
|
329
|
+
function zt(t,e){return new RegExp(t,e)}
|
|
330
330
|
// #endregion
|
|
331
|
-
if(
|
|
331
|
+
if(xt){
|
|
332
332
|
// Native
|
|
333
|
-
var
|
|
333
|
+
var Yt=zt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Dt=function(t,e){var r;return Yt.lastIndex=e,null!==(r=Yt.exec(t)[1])&&void 0!==r?r:""}}else
|
|
334
334
|
// IE11
|
|
335
|
-
|
|
335
|
+
Dt=function(t,e){for(var r=[];;){var n=Xt(t,e);if(void 0===n||Jt(n)||qt(n))break;r.push(n),e+=n>=65536?2:1}return jt.apply(void 0,r)};var Wt=/** @class */function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,r){for(var n=[];!this.isEOF();){var i=this.char();if(123/* `{` */===i){if((o=this.parseArgument(t,r)).err)return o;n.push(o.val)}else{if(125/* `}` */===i&&t>0)break;if(35/* `#` */!==i||"plural"!==e&&"selectordinal"!==e){if(60/* `<` */===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(J.UNMATCHED_CLOSING_TAG,Nt(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===i&&!this.ignoreTag&&Qt(this.peek()||0)){if((o=this.parseTag(t,e)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(t,e)).err)return o;n.push(o.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:q.pound,location:Nt(s,this.clonePosition())})}}}return{val:n,err:null}},
|
|
336
336
|
/**
|
|
337
337
|
* A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
|
|
338
338
|
* [custom element name][] except that a dash is NOT always mandatory and uppercase letters
|
|
@@ -351,24 +351,24 @@ $e=function(e,t){for(var r=[];;){var n=Ve(e,t);if(void 0===n||Qe(n)||Je(n))break
|
|
|
351
351
|
* NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
|
|
352
352
|
* since other tag-based engines like React allow it
|
|
353
353
|
*/
|
|
354
|
-
|
|
354
|
+
t.prototype.parseTag=function(t,e){var r=this.clonePosition();this.bump();// `<`
|
|
355
355
|
var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))
|
|
356
356
|
// Self closing tag
|
|
357
|
-
return{val:{type:
|
|
357
|
+
return{val:{type:q.literal,value:"<".concat(n,"/>"),location:Nt(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,e,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();
|
|
358
358
|
// Expecting a close tag
|
|
359
|
-
if(this.bumpIf("</")){if(this.isEOF()||!
|
|
359
|
+
if(this.bumpIf("</")){if(this.isEOF()||!Qt(this.char()))return this.error(J.INVALID_TAG,Nt(s,this.clonePosition()));var a=this.clonePosition();return n!==this.parseTagName()?this.error(J.UNMATCHED_CLOSING_TAG,Nt(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:q.tag,value:n,children:o,location:Nt(r,this.clonePosition())},err:null}:this.error(J.INVALID_TAG,Nt(s,this.clonePosition())))}return this.error(J.UNCLOSED_TAG,Nt(r,this.clonePosition()))}return this.error(J.INVALID_TAG,Nt(r,this.clonePosition()))},
|
|
360
360
|
/**
|
|
361
361
|
* This method assumes that the caller has peeked ahead for the first tag character.
|
|
362
362
|
*/
|
|
363
|
-
|
|
364
|
-
for(this.bump();!this.isEOF()&&(45/* '-' */===(
|
|
363
|
+
t.prototype.parseTagName=function(){var t,e=this.offset();// the first tag name character
|
|
364
|
+
for(this.bump();!this.isEOF()&&(45/* '-' */===(t=this.char())||46/* '.' */===t||t>=48&&t<=57/* 0..9 */||95/* '_' */===t||t>=97&&t<=122/** a..z */||t>=65&&t<=90/* A..Z */||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(e);if(i)n+=i;else{var o=this.tryParseUnquoted(t,e);if(o)n+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=Nt(r,this.clonePosition());return{val:{type:q.literal,value:n,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60/* `<` */!==this.char()||!this.ignoreTag&&(Qt(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t;
|
|
365
365
|
/** See `parseTag` function docs. */},
|
|
366
366
|
/**
|
|
367
367
|
* Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
|
|
368
368
|
* a character that requires quoting (that is, "only where needed"), and works the same in
|
|
369
369
|
* nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
|
|
370
370
|
*/
|
|
371
|
-
|
|
371
|
+
t.prototype.tryParseQuote=function(t){if(this.isEOF()||39/* `'` */!==this.char())return null;
|
|
372
372
|
// Parse escaped char following the apostrophe, or early return if there is no escaped char.
|
|
373
373
|
// Check if is valid escaped character
|
|
374
374
|
switch(this.peek()){case 39/* `'` */:
|
|
@@ -376,74 +376,74 @@ switch(this.peek()){case 39/* `'` */:
|
|
|
376
376
|
return this.bump(),this.bump(),"'";
|
|
377
377
|
// '{', '<', '>', '}'
|
|
378
378
|
case 123:case 60:case 62:case 125:break;case 35:// '#'
|
|
379
|
-
if("plural"===
|
|
380
|
-
var
|
|
379
|
+
if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();// apostrophe
|
|
380
|
+
var e=[this.char()];// escaped char
|
|
381
381
|
// read chars until the optional closing apostrophe is found
|
|
382
382
|
for(this.bump();!this.isEOF();){var r=this.char();if(39/* `'` */===r){if(39/* `'` */!==this.peek()){
|
|
383
383
|
// Optional closing apostrophe.
|
|
384
|
-
this.bump();break}
|
|
384
|
+
this.bump();break}e.push(39),
|
|
385
385
|
// Bump one more time because we need to skip 2 characters.
|
|
386
|
-
this.bump()}else
|
|
387
|
-
this.bumpSpace(),this.isEOF())return this.error(
|
|
386
|
+
this.bump()}else e.push(r);this.bump()}return jt.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var r=this.char();return 60/* `<` */===r||123/* `{` */===r||35/* `#` */===r&&("plural"===e||"selectordinal"===e)||125/* `}` */===r&&t>0?null:(this.bump(),jt(r))},t.prototype.parseArgument=function(t,e){var r=this.clonePosition();if(this.bump(),// `{`
|
|
387
|
+
this.bumpSpace(),this.isEOF())return this.error(J.EXPECT_ARGUMENT_CLOSING_BRACE,Nt(r,this.clonePosition()));if(125/* `}` */===this.char())return this.bump(),this.error(J.EMPTY_ARGUMENT,Nt(r,this.clonePosition()));
|
|
388
388
|
// argument name
|
|
389
|
-
var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(
|
|
389
|
+
var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(J.MALFORMED_ARGUMENT,Nt(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(J.EXPECT_ARGUMENT_CLOSING_BRACE,Nt(r,this.clonePosition()));switch(this.char()){
|
|
390
390
|
// Simple argument: `{name}`
|
|
391
391
|
case 125/* `}` */:// `}`
|
|
392
|
-
return this.bump(),{val:{type:
|
|
392
|
+
return this.bump(),{val:{type:q.argument,
|
|
393
393
|
// value does not include the opening and closing braces.
|
|
394
|
-
value:n,location:
|
|
394
|
+
value:n,location:Nt(r,this.clonePosition())},err:null};
|
|
395
395
|
// Argument with options: `{name, format, ...}`
|
|
396
396
|
case 44/* `,` */:return this.bump(),// `,`
|
|
397
|
-
this.bumpSpace(),this.isEOF()?this.error(
|
|
397
|
+
this.bumpSpace(),this.isEOF()?this.error(J.EXPECT_ARGUMENT_CLOSING_BRACE,Nt(r,this.clonePosition())):this.parseArgumentOptions(t,e,n,r);default:return this.error(J.MALFORMED_ARGUMENT,Nt(r,this.clonePosition()))}},
|
|
398
398
|
/**
|
|
399
399
|
* Advance the parser until the end of the identifier, if it is currently on
|
|
400
400
|
* an identifier character. Return an empty string otherwise.
|
|
401
401
|
*/
|
|
402
|
-
|
|
402
|
+
t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),r=Dt(this.message,e),n=e+r.length;return this.bumpTo(n),{value:r,location:Nt(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,r,n){var i,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();
|
|
403
403
|
// Parse this range:
|
|
404
404
|
// {name, type, style}
|
|
405
405
|
// ^---^
|
|
406
406
|
switch(s){case"":
|
|
407
407
|
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
|
408
|
-
return this.error(
|
|
408
|
+
return this.error(J.EXPECT_ARGUMENT_TYPE,Nt(o,a));case"number":case"date":case"time":
|
|
409
409
|
// Parse this range:
|
|
410
410
|
// {name, number, style}
|
|
411
411
|
// ^-------^
|
|
412
|
-
this.bumpSpace();var
|
|
412
|
+
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var h=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(p=Zt(b.val)).length)return this.error(J.EXPECT_ARGUMENT_STYLE,Nt(this.clonePosition(),this.clonePosition()));l={style:p,styleLocation:Nt(h,this.clonePosition())}}if((y=this.tryParseArgumentClose(n)).err)return y;var c=Nt(n,this.clonePosition());
|
|
413
413
|
// Extract style or skeleton
|
|
414
|
-
if(
|
|
414
|
+
if(l&&Ft(null==l?void 0:l.style,"::",0)){
|
|
415
415
|
// Skeleton starts with `::`.
|
|
416
|
-
var u=
|
|
416
|
+
var u=Kt(l.style.slice(2));if("number"===s)return(b=this.parseNumberSkeletonFromString(u,l.styleLocation)).err?b:{val:{type:q.number,value:r,location:c,style:b.val},err:null};if(0===u.length)return this.error(J.EXPECT_DATE_TIME_SKELETON,c);var f=u;
|
|
417
417
|
// Get "best match" pattern only if locale is passed, if not, let it
|
|
418
418
|
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
|
419
419
|
// for unsupported patterns.
|
|
420
|
-
this.locale&&(f=function(e
|
|
420
|
+
this.locale&&(f=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t.charAt(n);if("j"===i){for(var o=0;n+1<t.length&&t.charAt(n+1)===i;)o++,n++;var s=1+(1&o),a=o<2?1:3+(o>>1),l=Pt(e);for("H"!=l&&"k"!=l||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=l+r}else r+="J"===i?"H":i}return r}(u,this.locale));var p={type:tt.dateTime,pattern:f,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?dt(f):{}};return{val:{type:"date"===s?q.date:q.time,value:r,location:c,style:p},err:null}}
|
|
421
421
|
// Regular style or no style.
|
|
422
|
-
return{val:{type:"number"===s?
|
|
422
|
+
return{val:{type:"number"===s?q.number:"date"===s?q.date:q.time,value:r,location:c,style:null!==(i=null==l?void 0:l.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":
|
|
423
423
|
// Parse this range:
|
|
424
424
|
// {name, plural, options}
|
|
425
425
|
// ^---------^
|
|
426
|
-
var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(
|
|
426
|
+
var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(J.EXPECT_SELECT_ARGUMENT_OPTIONS,Nt(m,et({},m)));this.bumpSpace();
|
|
427
427
|
// Parse offset:
|
|
428
428
|
// {name, plural, offset:1, options}
|
|
429
429
|
// ^-----^
|
|
430
430
|
// or the first option:
|
|
431
431
|
// {name, plural, one {...} other {...}}
|
|
432
432
|
// ^--^
|
|
433
|
-
var g=this.parseIdentifierIfPossible(),
|
|
433
|
+
var g=this.parseIdentifierIfPossible(),d=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(J.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Nt(this.clonePosition(),this.clonePosition()));var b;if(this.bumpSpace(),(b=this.tryParseDecimalInteger(J.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,J.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return b;
|
|
434
434
|
// Parse another identifier for option parsing
|
|
435
|
-
this.bumpSpace(),g=this.parseIdentifierIfPossible(),b
|
|
435
|
+
this.bumpSpace(),g=this.parseIdentifierIfPossible(),d=b.val}var y,E=this.tryParsePluralOrSelectOptions(t,s,e,g);if(E.err)return E;if((y=this.tryParseArgumentClose(n)).err)return y;var v=Nt(n,this.clonePosition());return"select"===s?{val:{type:q.select,value:r,options:Vt(E.val),location:v},err:null}:{val:{type:q.plural,value:r,options:Vt(E.val),offset:d,pluralType:"plural"===s?"cardinal":"ordinal",location:v},err:null};default:return this.error(J.INVALID_ARGUMENT_TYPE,Nt(o,a))}},t.prototype.tryParseArgumentClose=function(t){
|
|
436
436
|
// Parse: {value, number, ::currency/GBP }
|
|
437
|
-
return this.isEOF()||125/* `}` */!==this.char()?this.error(
|
|
437
|
+
return this.isEOF()||125/* `}` */!==this.char()?this.error(J.EXPECT_ARGUMENT_CLOSING_BRACE,Nt(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
|
438
438
|
/**
|
|
439
439
|
* See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
|
|
440
440
|
*/
|
|
441
|
-
|
|
441
|
+
t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39/* `'` */:
|
|
442
442
|
// Treat apostrophe as quoting but include it in the style part.
|
|
443
443
|
// Find the end of the quoted literal text.
|
|
444
|
-
this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(
|
|
444
|
+
this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(J.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Nt(r,this.clonePosition()));this.bump();break;case 123/* `{` */:t+=1,this.bump();break;case 125/* `}` */:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var r=[];try{r=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");
|
|
445
445
|
// Parse the skeleton
|
|
446
|
-
for(var
|
|
446
|
+
for(var e=[],r=0,n=t.split(bt).filter((function(t){return t.length>0}));r<n.length;r++){var i=n[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,l=s;a<l.length;a++)if(0===l[a].length)throw new Error("Invalid number skeleton");e.push({stem:o,options:s})}return e}(t)}catch(t){return this.error(J.INVALID_NUMBER_SKELETON,e)}return{val:{type:tt.number,tokens:r,location:e,parsedOptions:this.shouldParseSkeletons?_t(r):{}},err:null}},
|
|
447
447
|
/**
|
|
448
448
|
* @param nesting_level The current nesting level of messages.
|
|
449
449
|
* This can be positive when parsing message fragment in select or plural argument options.
|
|
@@ -454,136 +454,150 @@ for(var t=[],r=0,n=e.split(be).filter((function(e){return e.length>0}));r<n.leng
|
|
|
454
454
|
* between a pair of opening and closing tags. The nested message will not parse beyond
|
|
455
455
|
* the closing tag boundary.
|
|
456
456
|
*/
|
|
457
|
-
|
|
457
|
+
t.prototype.tryParsePluralOrSelectOptions=function(t,e,r,n){
|
|
458
458
|
// Parse:
|
|
459
459
|
// one {one apple}
|
|
460
460
|
// ^--^
|
|
461
|
-
for(var i,o=!1,s=[],a=new Set,
|
|
461
|
+
for(var i,o=!1,s=[],a=new Set,l=n.value,h=n.location;;){if(0===l.length){var c=this.clonePosition();if("select"===e||!this.bumpIf("="))break;
|
|
462
462
|
// Try parse `={number}` selector
|
|
463
|
-
var u=this.tryParseDecimalInteger(
|
|
463
|
+
var u=this.tryParseDecimalInteger(J.EXPECT_PLURAL_ARGUMENT_SELECTOR,J.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;h=Nt(c,this.clonePosition()),l=this.message.slice(c.offset,this.offset())}
|
|
464
464
|
// Duplicate selector clauses
|
|
465
|
-
if(a.has(
|
|
465
|
+
if(a.has(l))return this.error("select"===e?J.DUPLICATE_SELECT_ARGUMENT_SELECTOR:J.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);"other"===l&&(o=!0),
|
|
466
466
|
// Parse:
|
|
467
467
|
// one {one apple}
|
|
468
468
|
// ^----------^
|
|
469
|
-
this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===
|
|
469
|
+
this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?J.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:J.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Nt(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(t+1,e,r);if(p.err)return p;var m=this.tryParseArgumentClose(f);if(m.err)return m;s.push([l,{value:p.val,location:Nt(f,this.clonePosition())}]),
|
|
470
470
|
// Keep track of the existing selectors
|
|
471
|
-
a.add(
|
|
471
|
+
a.add(l),
|
|
472
472
|
// Prep next selector clause.
|
|
473
|
-
this.bumpSpace(),
|
|
473
|
+
this.bumpSpace(),l=(i=this.parseIdentifierIfPossible()).value,h=i.location}return 0===s.length?this.error("select"===e?J.EXPECT_SELECT_ARGUMENT_SELECTOR:J.EXPECT_PLURAL_ARGUMENT_SELECTOR,Nt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(J.MISSING_OTHER_CLAUSE,Nt(this.clonePosition(),this.clonePosition())):{val:s,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var i=!1,o=0;!this.isEOF();){var s=this.char();if(!(s>=48/* `0` */&&s<=57/* `9` */))break;i=!0,o=10*o+(s-48),this.bump()}var a=Nt(n,this.clonePosition());return i?Gt(o*=r)?{val:o,err:null}:this.error(e,a):this.error(t,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){
|
|
474
474
|
// This is much faster than `Object.assign` or spread.
|
|
475
475
|
return{offset:this.position.offset,line:this.position.line,column:this.position.column}},
|
|
476
476
|
/**
|
|
477
477
|
* Return the code point at the current position of the parser.
|
|
478
478
|
* Throws if the index is out of bound.
|
|
479
479
|
*/
|
|
480
|
-
|
|
480
|
+
t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=Xt(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},
|
|
481
481
|
/** Bump the parser to the next UTF-16 code unit. */
|
|
482
|
-
|
|
482
|
+
t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10/* '\n' */===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,
|
|
483
483
|
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
|
484
|
-
this.position.offset+=
|
|
484
|
+
this.position.offset+=t<65536?1:2)}},
|
|
485
485
|
/**
|
|
486
486
|
* If the substring starting at the current position of the parser has
|
|
487
487
|
* the given prefix, then bump the parser to the character immediately
|
|
488
488
|
* following the prefix and return true. Otherwise, don't bump the parser
|
|
489
489
|
* and return false.
|
|
490
490
|
*/
|
|
491
|
-
|
|
491
|
+
t.prototype.bumpIf=function(t){if(Ft(this.message,t,this.offset())){for(var e=0;e<t.length;e++)this.bump();return!0}return!1},
|
|
492
492
|
/**
|
|
493
493
|
* Bump the parser until the pattern character is found and return `true`.
|
|
494
494
|
* Otherwise bump to the end of the file and return `false`.
|
|
495
495
|
*/
|
|
496
|
-
|
|
496
|
+
t.prototype.bumpUntil=function(t){var e=this.offset(),r=this.message.indexOf(t,e);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},
|
|
497
497
|
/**
|
|
498
498
|
* Bump the parser to the target offset.
|
|
499
499
|
* If target offset is beyond the end of the input, bump the parser to the end of the input.
|
|
500
500
|
*/
|
|
501
|
-
|
|
501
|
+
t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},
|
|
502
502
|
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
|
503
|
-
|
|
503
|
+
t.prototype.bumpSpace=function(){for(;!this.isEOF()&&Jt(this.char());)this.bump()},
|
|
504
504
|
/**
|
|
505
505
|
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
|
506
506
|
* If the input has been exhausted, then this returns null.
|
|
507
507
|
*/
|
|
508
|
-
|
|
508
|
+
t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),r=this.message.charCodeAt(e+(t>=65536?2:1));return null!=r?r:null},t}();
|
|
509
509
|
/**
|
|
510
510
|
* This check if codepoint is alphabet (lower & uppercase)
|
|
511
511
|
* @param codepoint
|
|
512
512
|
* @returns
|
|
513
|
-
*/function
|
|
513
|
+
*/function Qt(t){return t>=97&&t<=122||t>=65&&t<=90}
|
|
514
514
|
/**
|
|
515
515
|
* Code point equivalent of regex `\p{White_Space}`.
|
|
516
516
|
* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
517
517
|
*/
|
|
518
|
-
function
|
|
518
|
+
function Jt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}
|
|
519
519
|
/**
|
|
520
520
|
* Code point equivalent of regex `\p{Pattern_Syntax}`.
|
|
521
521
|
* See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
522
|
-
*/function
|
|
522
|
+
*/function qt(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function te(t){t.forEach((function(t){if(delete t.location,lt(t)||ht(t))for(var e in t.options)delete t.options[e].location,te(t.options[e].value);else ot(t)&&ft(t.style)||(st(t)||at(t))&&pt(t.style)?delete t.style.location:ut(t)&&te(t.children)}))}function ee(t,e){void 0===e&&(e={}),e=et({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new Wt(t,e).parse();if(r.err){var n=SyntaxError(J[r.err.kind]);
|
|
523
523
|
// @ts-expect-error Assign to error object
|
|
524
524
|
throw n.location=r.err.location,
|
|
525
525
|
// @ts-expect-error Assign to error object
|
|
526
|
-
n.originalMessage=r.err.message,n}return(null==
|
|
526
|
+
n.originalMessage=r.err.message,n}return(null==e?void 0:e.captureLocation)||te(r.val),r.val}
|
|
527
527
|
|
|
528
528
|
// Main
|
|
529
529
|
|
|
530
|
-
function
|
|
530
|
+
function re(t,e){var r=e&&e.cache?e.cache:ce,n=e&&e.serializer?e.serializer:ae;return(e&&e.strategy?e.strategy:se)(t,{cache:r,serializer:n})}
|
|
531
531
|
|
|
532
532
|
// Strategy
|
|
533
533
|
|
|
534
|
-
function
|
|
534
|
+
function ne(t,e,r,n){var i,o=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),s=e.get(o);return void 0===s&&(s=t.call(this,n),e.set(o,s)),s}function ie(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=e.get(i);return void 0===o&&(o=t.apply(this,n),e.set(i,o)),o}function oe(t,e,r,n,i){return r.bind(e,t,n,i)}function se(t,e){return oe(t,this,1===t.length?ne:ie,e.cache.create(),e.serializer)}
|
|
535
535
|
// Serializer
|
|
536
|
-
var
|
|
536
|
+
var ae=function(){return JSON.stringify(arguments)};
|
|
537
537
|
|
|
538
538
|
// Cache
|
|
539
539
|
|
|
540
|
-
function
|
|
540
|
+
function le(){this.cache=Object.create(null)}le.prototype.get=function(t){return this.cache[t]},le.prototype.set=function(t,e){this.cache[t]=e};var he,ce={create:function(){
|
|
541
541
|
// @ts-ignore
|
|
542
|
-
return new
|
|
542
|
+
return new le}},ue={variadic:function(t,e){return oe(t,this,ie,e.cache.create(),e.serializer)},monadic:function(t,e){return oe(t,this,ne,e.cache.create(),e.serializer)}};!function(t){
|
|
543
543
|
// When we have a placeholder but no value to format
|
|
544
|
-
|
|
544
|
+
t.MISSING_VALUE="MISSING_VALUE",
|
|
545
545
|
// When value supplied is invalid
|
|
546
|
-
|
|
546
|
+
t.INVALID_VALUE="INVALID_VALUE",
|
|
547
547
|
// When we need specific Intl API but it's not available
|
|
548
|
-
|
|
548
|
+
t.MISSING_INTL_API="MISSING_INTL_API"}(he||(he={}));var fe,pe=/** @class */function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.code=r,i.originalMessage=n,i}return Q(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),me=/** @class */function(t){function e(e,r,n,i){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),he.INVALID_VALUE,i)||this}return Q(e,t),e}(pe),ge=/** @class */function(t){function e(e,r,n){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(r),he.INVALID_VALUE,n)||this}return Q(e,t),e}(pe),de=/** @class */function(t){function e(e,r){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(r,'"'),he.MISSING_VALUE,r)||this}return Q(e,t),e}(pe);function be(t){return"function"==typeof t}
|
|
549
549
|
// TODO(skeleton): add skeleton support
|
|
550
|
-
function
|
|
550
|
+
function ye(t,e,r,n,i,o,
|
|
551
551
|
// For debugging
|
|
552
552
|
s){
|
|
553
553
|
// Hot path for straight simple msg translations
|
|
554
|
-
if(1===
|
|
554
|
+
if(1===t.length&&nt(t[0]))return[{type:fe.literal,value:t[0].value}];for(var a=[],l=0,h=t;l<h.length;l++){var c=h[l];
|
|
555
555
|
// Exit early for string parts.
|
|
556
|
-
if(
|
|
556
|
+
if(nt(c))a.push({type:fe.literal,value:c.value});else
|
|
557
557
|
// TODO: should this part be literal type?
|
|
558
558
|
// Replace `#` in plural rules with the actual numeric value.
|
|
559
|
-
if(
|
|
559
|
+
if(ct(c))"number"==typeof o&&a.push({type:fe.literal,value:r.getNumberFormat(e).format(o)});else{var u=c.value;
|
|
560
560
|
// Enforce that all required values are provided by the caller.
|
|
561
|
-
if(!i||!(u in i))throw new
|
|
561
|
+
if(!i||!(u in i))throw new de(u,s);var f=i[u];if(it(c))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),a.push({type:"string"==typeof f?fe.literal:fe.object,value:f});else
|
|
562
562
|
// Recursively format plural and select parts' option — which can be a
|
|
563
563
|
// nested pattern structure. The choosing of the option to use is
|
|
564
564
|
// abstracted-by and delegated-to the part helper object.
|
|
565
|
-
if(
|
|
565
|
+
if(st(c)){var p="string"==typeof c.style?n.date[c.style]:pt(c.style)?c.style.parsedOptions:void 0;a.push({type:fe.literal,value:r.getDateTimeFormat(e,p).format(f)})}else if(at(c)){p="string"==typeof c.style?n.time[c.style]:pt(c.style)?c.style.parsedOptions:n.time.medium;a.push({type:fe.literal,value:r.getDateTimeFormat(e,p).format(f)})}else if(ot(c)){(p="string"==typeof c.style?n.number[c.style]:ft(c.style)?c.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:fe.literal,value:r.getNumberFormat(e,p).format(f)})}else{if(ut(c)){var m=c.children,g=c.value,d=i[g];if(!be(d))throw new ge(g,"function",s);var b=d(ye(m,e,r,n,i,o).map((function(t){return t.value})));Array.isArray(b)||(b=[b]),a.push.apply(a,b.map((function(t){return{type:"string"==typeof t?fe.literal:fe.object,value:t}})))}if(lt(c)){if(!(y=c.options[f]||c.options.other))throw new me(c.value,f,Object.keys(c.options),s);a.push.apply(a,ye(y.value,e,r,n,i))}else if(ht(c)){var y;if(!(y=c.options["=".concat(f)])){if(!Intl.PluralRules)throw new pe('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',he.MISSING_INTL_API,s);var E=r.getPluralRules(e,{type:c.pluralType}).select(f-(c.offset||0));y=c.options[E]||c.options.other}if(!y)throw new me(c.value,f,Object.keys(c.options),s);a.push.apply(a,ye(y.value,e,r,n,i,f-(c.offset||0)))}else;}}}return function(t){return t.length<2?t:t.reduce((function(t,e){var r=t[t.length-1];return r&&r.type===fe.literal&&e.type===fe.literal?r.value+=e.value:t.push(e),t}),[])}(a)}
|
|
566
566
|
/*
|
|
567
567
|
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
568
568
|
Copyrights licensed under the New BSD License.
|
|
569
569
|
See the accompanying LICENSE file for terms.
|
|
570
570
|
*/
|
|
571
571
|
// -- MessageFormat --------------------------------------------------------
|
|
572
|
-
function
|
|
572
|
+
function Ee(t,e){return e?Object.keys(t).reduce((function(r,n){var i,o;return r[n]=(i=t[n],(o=e[n])?et(et(et({},i||{}),o||{}),Object.keys(i).reduce((function(t,e){return t[e]=et(et({},i[e]),o[e]||{}),t}),{})):i),r}),et({},t)):t}function ve(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,r){t[e]=r}}}}}!function(t){t[t.literal=0]="literal",t[t.object=1]="object"}(fe||(fe={}));var He=/** @class */function(){function t(e,r,n,i){var o,s=this;if(void 0===r&&(r=t.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(t){var e=s.formatToParts(t);
|
|
573
573
|
// Hot path for straight simple msg translations
|
|
574
|
-
if(1===
|
|
574
|
+
if(1===e.length)return e[0].value;var r=e.reduce((function(t,e){return t.length&&e.type===fe.literal&&"string"==typeof t[t.length-1]?t[t.length-1]+=e.value:t.push(e.value),t}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(t){return ye(s.ast,s.locales,s.formatters,s.formats,t,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},
|
|
575
575
|
// Defined first because it's used to build the format pattern.
|
|
576
|
-
this.locales=r,this.resolvedLocale=
|
|
576
|
+
this.locales=r,this.resolvedLocale=t.resolveLocale(r),"string"==typeof e){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
577
577
|
// Parse string messages into an AST.
|
|
578
|
-
this.ast=
|
|
578
|
+
this.ast=t.__parse(e,{ignoreTag:null==i?void 0:i.ignoreTag,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");
|
|
579
579
|
// Creates a new object with the specified `formats` merged with the default
|
|
580
580
|
// formats.
|
|
581
|
-
this.formats=
|
|
581
|
+
this.formats=Ee(t.formats,n),this.formatters=i&&i.formatters||(void 0===(o=this.formatterCache)&&(o={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:re((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,rt([void 0],e,!1)))}),{cache:ve(o.number),strategy:ue.variadic}),getDateTimeFormat:re((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,rt([void 0],e,!1)))}),{cache:ve(o.dateTime),strategy:ue.variadic}),getPluralRules:re((function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,rt([void 0],e,!1)))}),{cache:ve(o.pluralRules),strategy:ue.variadic})})}return Object.defineProperty(t,"defaultLocale",{get:function(){return t.memoizedDefaultLocale||(t.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),t.memoizedDefaultLocale},enumerable:!1,configurable:!0}),t.memoizedDefaultLocale=null,t.resolveLocale=function(t){var e=Intl.NumberFormat.supportedLocalesOf(t);return e.length>0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])},t.__parse=ee,
|
|
582
582
|
// Default format options used as the prototype of the `formats` provided to the
|
|
583
583
|
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
584
584
|
// and Intl.DateTimeFormat instances.
|
|
585
|
-
|
|
585
|
+
t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();const Te={},Be=(t,e,r)=>r?(e in Te||(Te[e]={}),t in Te[e]||(Te[e][t]=r),r):r,Ce=(t,e)=>{if(null==e)return;if(e in Te&&t in Te[e])return Te[e][t];const r=tr(e);for(let n=0;n<r.length;n++){const i=Ae(r[n],t);if(i)return Be(t,e,i)}};let we;const _e=G({});function Le(t){return t in we}function Ae(t,e){if(!Le(t))return null;const r=function(t){return we[t]||null}(t);return function(t,e){if(null==e)return;if(e in t)return t[e];const r=e.split(".");let n=t;for(let t=0;t<r.length;t++)if("object"==typeof n){if(t>0){const e=r.slice(t,r.length).join(".");if(e in n){n=n[e];break}}n=n[r[t]]}else n=void 0;return n}(r,e)}function Pe(t,...e){delete Te[t],_e.update((r=>(r[t]=Y.all([r[t]||{},...e]),r)))}x([_e],(([t])=>Object.keys(t))),_e.subscribe((t=>we=t));const Se={};function Oe(t){return Se[t]}function Ne(t){return null!=t&&tr(t).some((t=>{var e;return null==(e=Oe(t))?void 0:e.size}))}function Me(t,e){const r=Promise.all(e.map((e=>(function(t,e){Se[t].delete(e),0===Se[t].size&&delete Se[t]}(t,e),e().then((t=>t.default||t))))));return r.then((e=>Pe(t,...e)))}const Ie={};function Re(t){if(!Ne(t))return t in Ie?Ie[t]:Promise.resolve();const e=function(t){return tr(t).map((t=>{const e=Oe(t);return[t,e?[...e]:[]]})).filter((([,t])=>t.length>0))}(t);return Ie[t]=Promise.all(e.map((([t,e])=>Me(t,e)))).then((()=>{if(Ne(t))return Re(t);delete Ie[t]})),Ie[t]}var $e=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable;function Ge({locale:t,id:e}){console.warn(`[svelte-i18n] The message "${e}" was not found in "${tr(t).join('", "')}".${Ne(er())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`)}const xe={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function De(){return xe}function Fe(t){const e=t,{formats:r}=e,n=((t,e)=>{var r={};for(var n in t)Ue.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&$e)for(var n of $e(t))e.indexOf(n)<0&&ke.call(t,n)&&(r[n]=t[n]);return r})(e,["formats"]);let i=t.fallbackLocale;if(t.initialLocale)try{He.resolveLocale(t.initialLocale)&&(i=t.initialLocale)}catch(e){console.warn(`[svelte-i18n] The initial locale "${t.initialLocale}" is not a valid locale.`)}return n.warnOnMissingMessages&&(delete n.warnOnMissingMessages,null==n.handleMissingMessage?n.handleMissingMessage=Ge:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(xe,n,{initialLocale:i}),r&&("number"in r&&Object.assign(xe.formats.number,r.number),"date"in r&&Object.assign(xe.formats.date,r.date),"time"in r&&Object.assign(xe.formats.time,r.time)),rr.set(i)}const je=G(!1);var Ve=Object.defineProperty,Xe=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,Ze=Object.getOwnPropertySymbols,ze=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,We=(t,e,r)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;let Qe;const Je=G(null);function qe(t){return t.split("-").map(((t,e,r)=>r.slice(0,e+1).join("-"))).reverse()}function tr(t,e=De().fallbackLocale){const r=qe(t);return e?[...new Set([...r,...qe(e)])]:r}function er(){return null!=Qe?Qe:void 0}Je.subscribe((t=>{Qe=null!=t?t:void 0,"undefined"!=typeof window&&null!=t&&document.documentElement.setAttribute("lang",t)}));const rr=(nr=((t,e)=>{for(var r in e||(e={}))ze.call(e,r)&&We(t,r,e[r]);if(Ze)for(var r of Ze(e))Ye.call(e,r)&&We(t,r,e[r]);return t})({},Je),Xe(nr,Ke({set:t=>{if(t&&function(t){if(null==t)return;const e=tr(t);for(let t=0;t<e.length;t++){const r=e[t];if(Le(r))return r}}(t)&&Ne(t)){const{loadingDelay:e}=De();let r;return"undefined"!=typeof window&&null!=er()&&e?r=window.setTimeout((()=>je.set(!0)),e):je.set(!0),Re(t).then((()=>{Je.set(t)})).finally((()=>{clearTimeout(r),je.set(!1)}))}return Je.set(t)}})));var nr;const ir=t=>{const e=Object.create(null);return r=>{const n=JSON.stringify(r);return n in e?e[n]:e[n]=t(r)}};var or=Object.defineProperty,sr=Object.getOwnPropertySymbols,ar=Object.prototype.hasOwnProperty,lr=Object.prototype.propertyIsEnumerable,hr=(t,e,r)=>e in t?or(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cr=(t,e)=>{for(var r in e||(e={}))ar.call(e,r)&&hr(t,r,e[r]);if(sr)for(var r of sr(e))lr.call(e,r)&&hr(t,r,e[r]);return t},ur=(t,e)=>{var r={};for(var n in t)ar.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&sr)for(var n of sr(t))e.indexOf(n)<0&&lr.call(t,n)&&(r[n]=t[n]);return r};const fr=(t,e)=>{const{formats:r}=De();if(t in r&&e in r[t])return r[t][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${t} format.`)},pr=ir((t=>{var e=t,{locale:r,format:n}=e,i=ur(e,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(i=fr("number",n)),new Intl.NumberFormat(r,i)})),mr=ir((t=>{var e=t,{locale:r,format:n}=e,i=ur(e,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?i=fr("date",n):0===Object.keys(i).length&&(i=fr("date","short")),new Intl.DateTimeFormat(r,i)})),gr=ir((t=>{var e=t,{locale:r,format:n}=e,i=ur(e,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?i=fr("time",n):0===Object.keys(i).length&&(i=fr("time","short")),new Intl.DateTimeFormat(r,i)})),dr=ir((
|
|
586
586
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
587
|
-
(e
|
|
588
|
-
/* src/
|
|
587
|
+
(t,e=er())=>new He(t,e,De().formats,{ignoreTag:De().ignoreTag}))),br=(t,e={})=>{var r,n,i,o;let s=e;"object"==typeof t&&(s=t,t=s.id);const{values:a,locale:l=er(),default:h}=s;if(null==l)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let c=Ce(t,l);if(c){if("string"!=typeof c)return console.warn(`[svelte-i18n] Message with id "${t}" must be of type "string", found: "${typeof c}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),c}else c=null!=(o=null!=(i=null==(n=(r=De()).handleMissingMessage)?void 0:n.call(r,{locale:l,id:t,defaultValue:h}))?i:h)?o:t;if(!a)return c;let u=c;try{u=dr(c,l).format(a)}catch(e){e instanceof Error&&console.warn(`[svelte-i18n] Message "${t}" has syntax error:`,e.message)}return u},yr=(t,e)=>((t={})=>{var e=t,{locale:r=er()}=e,n=ur(e,["locale"]);return gr(cr({locale:r},n))})(e).format(t),Er=(t,e)=>((t={})=>{var e=t,{locale:r=er()}=e,n=ur(e,["locale"]);return mr(cr({locale:r},n))})(e).format(t),vr=(t,e)=>((t={})=>{var e=t,{locale:r=er()}=e,n=ur(e,["locale"]);return pr(cr({locale:r},n))})(e).format(t),Hr=(t,e=er())=>Ce(t,e),Tr=x([rr,_e],(()=>br));function Br(t,e){Pe(t,e)}x([rr],(()=>yr)),x([rr],(()=>Er)),x([rr],(()=>vr)),x([rr,_e],(()=>Hr)),Fe({fallbackLocale:"en"});const Cr={en:{redirectHeader:"Deposit redirect"},"pt-br":{redirectHeader:"Redirecionar depósito"},"es-mx":{redirectHeader:"Redirigir depósito"},tr:{redirectHeader:"Para yatırma yönlendirmesi"}};function wr(t,e){Pe(t,e)}Fe({fallbackLocale:"en"});const _r={en:{header:{general:"Cashier",deposit:"Deposit",withdraw:"Withdraw"}}};
|
|
588
|
+
/* ../cashier-header/src/CashierHeader.svelte generated by Svelte v3.59.2 */function Lr(e){let r,n,i;return{c(){r=p("div"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.5632 3.47782C12.4787 3.50138 12.3362 3.57505 12.2465 3.64153C12.1567 3.70806 10.8069 5.04216 9.24694 6.60626C6.11944 9.74192 6.25999 9.58204 6.25999 10.0037C6.25999 10.4243 6.13093 10.2784 9.34296 13.4903C12.4449 16.5921 12.356 16.5116 12.7278 16.5556C13.1855 16.6098 13.6413 16.2585 13.7301 15.783C13.7612 15.6164 13.7212 15.3395 13.6437 15.1847C13.6158 15.129 12.451 13.9396 11.0553 12.5417L8.51768 10L11.0553 7.45837C12.451 6.06048 13.6158 4.87114 13.6437 4.81544C13.7729 4.55751 13.7703 4.2006 13.6374 3.94274C13.4469 3.5731 12.9668 3.36532 12.5632 3.47782Z" fill="#111111"></path></svg>',b(r,"class","CashierHeaderLeftButton")},m(t,o){u(t,r,o),n||(i=d(r,"click",/*back*/e[5]),n=!0)},p:t,d(t){t&&f(r),n=!1,i()}}}function Ar(e){let r,n,i,o,s,a,l,h,y,E,v,H=/*$_*/e[3](/*titleText*/e[2])+"",T=/*backButton*/e[1]&&Lr(e);return{c(){r=p("div"),n=p("slot"),T&&T.c(),i=g(),o=p("slot"),s=p("span"),a=m(H),l=g(),h=p("slot"),y=p("span"),y.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="20" viewBox="0 0 13 13" fill="none"><path d="M12.7711 0.229435C13.0582 0.517619 13.0755 0.973729 12.8215 1.28141L12.7711 1.33721L7.60685 6.50068L12.7711 11.6641C12.9128 11.8066 12.9944 11.998 12.999 12.1988C13.0035 12.3997 12.9308 12.5946 12.7957 12.7433C12.6606 12.892 12.4735 12.9832 12.2731 12.9979C12.0728 13.0126 11.8744 12.9497 11.7191 12.8223L11.6633 12.7719L6.49958 7.60791L1.3359 12.7719C1.19349 12.9136 1.00207 12.9952 0.801203 12.9998C0.60034 13.0044 0.405398 12.9316 0.256676 12.7965C0.107955 12.6614 0.0168256 12.4744 0.00212786 12.274C-0.0125699 12.0736 0.0502877 11.8753 0.177706 11.7199L0.228086 11.6641L5.3923 6.50068L0.228086 1.33721C0.0863637 1.1948 0.00478102 1.00338 0.000203544 0.802529C-0.00437393 0.601674 0.0684038 0.40674 0.203491 0.258024C0.338579 0.109308 0.525647 0.0181829 0.726024 0.00348576C0.9264 -0.0112114 1.12476 0.0516437 1.28011 0.179057L1.3359 0.229435L6.49958 5.39345L11.6633 0.229435C11.736 0.156695 11.8223 0.0989949 11.9174 0.0596283C12.0124 0.0202617 12.1143 0 12.2172 0C12.32 0 12.4219 0.0202617 12.5169 0.0596283C12.612 0.0989949 12.6983 0.156695 12.7711 0.229435Z" fill="#111111"></path></svg>',this.c=t,b(n,"name","leftButton"),b(s,"class","CashierHeaderTitle"),b(o,"name","title"),b(y,"class","CashierHeaderRightButton"),b(h,"name","rightButton"),b(r,"class","CashierHeader")},m(t,f){u(t,r,f),c(r,n),T&&T.m(n,null),c(r,i),c(r,o),c(o,s),c(s,a),c(r,l),c(r,h),c(h,y),
|
|
589
|
+
/*div_binding*/e[12](r),E||(v=d(y,"click",/*close*/e[4]),E=!0)},p(t,[e]){/*backButton*/t[1]?T?T.p(t,e):(T=Lr(t),T.c(),T.m(n,null)):T&&(T.d(1),T=null),/*$_, titleText*/12&e&&H!==(H=/*$_*/t[3](/*titleText*/t[2])+"")&&function(t,e){e=""+e,t.data!==e&&(t.data=e)}(a,H)},i:t,o:t,d(t){t&&f(r),T&&T.d()
|
|
590
|
+
/*div_binding*/,e[12](null),E=!1,v()}}}function Pr(t,e,r){let n;var i,o;i=Tr,o=t=>r(3,n=t),t.$$.on_destroy.push(h(i,o));let s,a,{clientstyling:l=""}=e,{clientstylingurl:c=""}=e,{translationurl:u=""}=e,{showbackbutton:f=""}=e,{title:p=""}=e,{lang:m="en"}=e,g=!1;Object.keys(_r).forEach((t=>{wr(t,_r[t])}));const d=()=>{var t;t=m,rr.set(t)};return t.$$set=t=>{"clientstyling"in t&&r(6,l=t.clientstyling),"clientstylingurl"in t&&r(7,c=t.clientstylingurl),"translationurl"in t&&r(8,u=t.translationurl),"showbackbutton"in t&&r(9,f=t.showbackbutton),"title"in t&&r(10,p=t.title),"lang"in t&&r(11,m=t.lang)},t.$$.update=()=>{/*lang*/2048&t.$$.dirty&&m&&d(),/*clientstyling, customStylingContainer*/65&t.$$.dirty&&l&&s&&(()=>{let t=document.createElement("style");t.innerHTML=l,s.appendChild(t)})(),/*clientstylingurl, customStylingContainer*/129&t.$$.dirty&&c&&s&&(()=>{let t=new URL(c),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{s.appendChild(e)}),1)}))})(),/*translationurl*/256&t.$$.dirty&&u&&u&&fetch(u).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{wr(e,t[e])}))})).catch((t=>{console.log(t)})),/*showbackbutton*/512&t.$$.dirty&&f&&r(1,g=!!f&&"false"!==f),/*lang, title*/3072&t.$$.dirty&&m&&p&&r(2,a=p||"header.general")},[s,g,a,n,()=>{window.postMessage({type:"CloseCashier"},window.location.href)},()=>{window.postMessage({type:"BackCashier"},window.location.href)},l,c,u,f,p,m,function(t){B[t?"unshift":"push"]((()=>{s=t,r(0,s)}))}]}
|
|
591
|
+
/* ../cashier-spinner/src/CashierSpinner.svelte generated by Svelte v3.59.2 */
|
|
592
|
+
function Sr(e){let r;return{c(){r=p("div"),r.innerHTML='<svg class="spinner" viewBox="25 25 50 50"><circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"></circle></svg>',this.c=t,b(r,"class","CashierSpinner")},m(t,n){u(t,r,n),
|
|
593
|
+
/*div_binding*/e[3](r)},p:t,i:t,o:t,d(t){t&&f(r)
|
|
594
|
+
/*div_binding*/,e[3](null)}}}function Or(t,e,r){let n,{clientstyling:i=""}=e,{clientstylingurl:o=""}=e;return t.$$set=t=>{"clientstyling"in t&&r(1,i=t.clientstyling),"clientstylingurl"in t&&r(2,o=t.clientstylingurl)},t.$$.update=()=>{/*clientstyling, customStylingContainer*/3&t.$$.dirty&&i&&n&&(()=>{let t=document.createElement("style");t.innerHTML=i,n.appendChild(t)})(),/*clientstylingurl, customStylingContainer*/5&t.$$.dirty&&o&&n&&(()=>{let t=new URL(o),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{n.appendChild(e)}),1)}))})()},[n,i,o,function(t){B[t?"unshift":"push"]((()=>{n=t,r(0,n)}))}]}!customElements.get("cashier-header")&&customElements.define("cashier-header",class extends U{constructor(t){super();const e=document.createElement("style");e.textContent=".CashierHeader{display:flex;position:relative;align-items:center;height:var(--mmw--header-height, 32px);background-color:var(--mmw--color-grey-105, #E8E9EB);width:100%;border-radius:6px 6px 0 0}.CashierHeader .CashierHeaderLeftButton{color:var(--mmw--color-grey-10, #111);font-size:var(--emw--font-size-small, 14px);font-weight:var(--emw--font-weight-semibold, 500);margin-bottom:0;position:absolute;display:flex;align-items:center;font-variant:all-small-caps;height:32px;left:7px;gap:2px;cursor:pointer}.CashierHeader .CashierHeaderLeftButton svg path{fill:var(--mmw--color-grey-10, #111)}.CashierHeader .CashierHeaderTitle{color:var(--mmw--color-grey-10, #111);font-size:var(--emw--font-size-small, 14px);font-weight:var(--emw--font-weight-semibold, 500);margin:auto;max-width:calc(100% - 150px);overflow:hidden;text-overflow:ellipsis}.CashierHeader .CashierHeaderRightButton{position:absolute;display:flex;justify-content:space-between;align-items:center;padding:0 var(--emw--spacing-small, 12px);height:inherit;right:0;gap:var(--emw--spacing-small, 12px);cursor:pointer}.CashierHeader .CashierHeaderRightButton .close-button svg path{fill:var(--mmw--color-grey-10, #111)}",this.shadowRoot.appendChild(e),$(this,{target:this.shadowRoot,props:E(this.attributes),customElement:!0},Pr,Ar,o,{clientstyling:6,clientstylingurl:7,translationurl:8,showbackbutton:9,title:10,lang:11},null),t&&(t.target&&u(t.target,this,t.anchor),t.props&&(this.$set(t.props),O()))}static get observedAttributes(){return["clientstyling","clientstylingurl","translationurl","showbackbutton","title","lang"]}get clientstyling(){return this.$$.ctx[6]}set clientstyling(t){this.$$set({clientstyling:t}),O()}get clientstylingurl(){return this.$$.ctx[7]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),O()}get translationurl(){return this.$$.ctx[8]}set translationurl(t){this.$$set({translationurl:t}),O()}get showbackbutton(){return this.$$.ctx[9]}set showbackbutton(t){this.$$set({showbackbutton:t}),O()}get title(){return this.$$.ctx[10]}set title(t){this.$$set({title:t}),O()}get lang(){return this.$$.ctx[11]}set lang(t){this.$$set({lang:t}),O()}});
|
|
595
|
+
/* src/CashierIframeRedirect.svelte generated by Svelte v3.59.2 */
|
|
596
|
+
function Nr(e){let r,n,i;return{c(){r=p("div"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.5632 3.47782C12.4787 3.50138 12.3362 3.57505 12.2465 3.64153C12.1567 3.70806 10.8069 5.04216 9.24694 6.60626C6.11944 9.74192 6.25999 9.58204 6.25999 10.0037C6.25999 10.4243 6.13093 10.2784 9.34296 13.4903C12.4449 16.5921 12.356 16.5116 12.7278 16.5556C13.1855 16.6098 13.6413 16.2585 13.7301 15.783C13.7612 15.6164 13.7212 15.3395 13.6437 15.1847C13.6158 15.129 12.451 13.9396 11.0553 12.5417L8.51768 10L11.0553 7.45837C12.451 6.06048 13.6158 4.87114 13.6437 4.81544C13.7729 4.55751 13.7703 4.2006 13.6374 3.94274C13.4469 3.5731 12.9668 3.36532 12.5632 3.47782Z" fill="#111111"></path></svg>',b(r,"slot","leftButton"),b(r,"class","CashierHeaderLeftButton")},m(t,o){u(t,r,o),n||(i=d(r,"click",/*close*/e[9]),n=!0)},p:t,d(t){t&&f(r),n=!1,i()}}}
|
|
597
|
+
// (87:6) {#if !showbackbutton || showbackbutton === 'false'}
|
|
598
|
+
function Mr(e){let r,n,i;return{c(){r=p("div"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="20" viewBox="0 0 13 13" fill="none"><path d="M12.7711 0.229435C13.0582 0.517619 13.0755 0.973729 12.8215 1.28141L12.7711 1.33721L7.60685 6.50068L12.7711 11.6641C12.9128 11.8066 12.9944 11.998 12.999 12.1988C13.0035 12.3997 12.9308 12.5946 12.7957 12.7433C12.6606 12.892 12.4735 12.9832 12.2731 12.9979C12.0728 13.0126 11.8744 12.9497 11.7191 12.8223L11.6633 12.7719L6.49958 7.60791L1.3359 12.7719C1.19349 12.9136 1.00207 12.9952 0.801203 12.9998C0.60034 13.0044 0.405398 12.9316 0.256676 12.7965C0.107955 12.6614 0.0168256 12.4744 0.00212786 12.274C-0.0125699 12.0736 0.0502877 11.8753 0.177706 11.7199L0.228086 11.6641L5.3923 6.50068L0.228086 1.33721C0.0863637 1.1948 0.00478102 1.00338 0.000203544 0.802529C-0.00437393 0.601674 0.0684038 0.40674 0.203491 0.258024C0.338579 0.109308 0.525647 0.0181829 0.726024 0.00348576C0.9264 -0.0112114 1.12476 0.0516437 1.28011 0.179057L1.3359 0.229435L6.49958 5.39345L11.6633 0.229435C11.736 0.156695 11.8223 0.0989949 11.9174 0.0596283C12.0124 0.0202617 12.1143 0 12.2172 0C12.32 0 12.4219 0.0202617 12.5169 0.0596283C12.612 0.0989949 12.6983 0.156695 12.7711 0.229435Z" fill="#111111"></path></svg>',b(r,"slot","rightButton"),b(r,"class","CashierHeaderRightButton")},m(t,o){u(t,r,o),n||(i=d(r,"click",/*close*/e[9]),n=!0)},p:t,d(t){t&&f(r),n=!1,i()}}}
|
|
599
|
+
// (95:2) {#if isLoading}
|
|
600
|
+
function Ir(t){let e;return{c(){e=p("cashier-spinner"),y(e,"clientstylingurl",/*clientstylingurl*/t[5]),y(e,"clientstyling",/*clientstyling*/t[4])},m(t,r){u(t,e,r)},p(t,r){/*clientstylingurl*/32&r&&y(e,"clientstylingurl",/*clientstylingurl*/t[5]),/*clientstyling*/16&r&&y(e,"clientstyling",/*clientstyling*/t[4])},d(t){t&&f(e)}}}function Rr(e){let r,n,i,o,s,a,h,m,E,v=!!/*showbackbutton*/e[3]&&/*showbackbutton*/"false"!==e[3]&&Nr(e),H=(!/*showbackbutton*/e[3]||/*showbackbutton*/"false"===e[3])&&Mr(e),T=/*isLoading*/e[8]&&Ir(e);return{c(){r=p("div"),n=p("cashier-header"),v&&v.c(),i=g(),H&&H.c(),o=g(),T&&T.c(),s=g(),a=p("iframe"),this.c=t,y(n,"lang",/*lang*/e[0]),y(n,"translationurl",/*translationurl*/e[2]),y(n,"title",/*title*/e[6]),y(n,"showbackbutton",/*showbackbutton*/e[3]),y(n,"clientstylingurl",/*clientstylingurl*/e[5]),y(n,"clientstyling",/*clientstyling*/e[4]),l(a.src,h=/*iframeurl*/e[1])||b(a,"src",h),b(a,"frameborder","0"),b(r,"class","CashierRedirectIframe")},m(t,l){u(t,r,l),c(r,n),v&&v.m(n,null),c(n,i),H&&H.m(n,null),c(r,o),T&&T.m(r,null),c(r,s),c(r,a),
|
|
601
|
+
/*div_binding*/e[12](r),m||(E=d(a,"load",/*load_handler*/e[11]),m=!0)},p(t,[e]){/*showbackbutton*/t[3]&&/*showbackbutton*/"false"!==t[3]?v?v.p(t,e):(v=Nr(t),v.c(),v.m(n,i)):v&&(v.d(1),v=null),/*showbackbutton*/t[3]&&/*showbackbutton*/"false"!==t[3]?H&&(H.d(1),H=null):H?H.p(t,e):(H=Mr(t),H.c(),H.m(n,null)),/*lang*/1&e&&y(n,"lang",/*lang*/t[0]),/*translationurl*/4&e&&y(n,"translationurl",/*translationurl*/t[2]),/*title*/64&e&&y(n,"title",/*title*/t[6]),/*showbackbutton*/8&e&&y(n,"showbackbutton",/*showbackbutton*/t[3]),/*clientstylingurl*/32&e&&y(n,"clientstylingurl",/*clientstylingurl*/t[5]),/*clientstyling*/16&e&&y(n,"clientstyling",/*clientstyling*/t[4]),/*isLoading*/t[8]?T?T.p(t,e):(T=Ir(t),T.c(),T.m(r,s)):T&&(T.d(1),T=null),/*iframeurl*/2&e&&!l(a.src,h=/*iframeurl*/t[1])&&b(a,"src",h)},i:t,o:t,d(t){t&&f(r),v&&v.d(),H&&H.d(),T&&T.d()
|
|
602
|
+
/*div_binding*/,e[12](null),m=!1,E()}}}function $r(t,e,r){let n,{lang:i="en"}=e,{iframeurl:o}=e,{translationurl:s=""}=e,{showbackbutton:a=""}=e,{clientstyling:l=""}=e,{clientstylingurl:h=""}=e,{title:c=""}=e,u=!0;H();Object.keys(Cr).forEach((t=>{Br(t,Cr[t])}));const f=()=>{var t;t=i,rr.set(t)},p=t=>{t.target.src&&r(8,u=!1)};return t.$$set=t=>{"lang"in t&&r(0,i=t.lang),"iframeurl"in t&&r(1,o=t.iframeurl),"translationurl"in t&&r(2,s=t.translationurl),"showbackbutton"in t&&r(3,a=t.showbackbutton),"clientstyling"in t&&r(4,l=t.clientstyling),"clientstylingurl"in t&&r(5,h=t.clientstylingurl),"title"in t&&r(6,c=t.title)},t.$$.update=()=>{/*lang*/1&t.$$.dirty&&i&&f(),/*translationurl*/4&t.$$.dirty&&s&&(()=>{if(s)fetch(s).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{Br(e,t[e])}))})).catch((t=>{console.log(t)}))})(),/*clientstyling, customStylingContainer*/144&t.$$.dirty&&l&&n&&(()=>{let t=document.createElement("style");t.innerHTML=l,n.appendChild(t)})(),/*clientstylingurl, customStylingContainer*/160&t.$$.dirty&&h&&n&&(()=>{let t=new URL(h),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{n.appendChild(e)}),1)}))})()},[i,o,s,a,l,h,c,n,u,()=>{dispatchEvent(new CustomEvent("closeIframe",{bubbles:!0,cancelable:!0,composed:!0}))},p,t=>p(t),function(t){B[t?"unshift":"push"]((()=>{n=t,r(7,n)}))}]}!customElements.get("cashier-spinner")&&customElements.define("cashier-spinner",class extends U{constructor(t){super();const e=document.createElement("style");e.textContent=".CashierSpinner{display:block;width:80px;height:80px;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.CashierSpinner .spinner{animation:rotate 2s linear infinite;transform-origin:center center}.CashierSpinner .spinner .path{stroke-dasharray:1, 200;stroke-dashoffset:0;animation:dash 1.5s ease-in-out infinite;stroke-linecap:round;stroke:var(--emw--color-primary, #7EC51E)}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:89, 200;stroke-dashoffset:-35px}100%{stroke-dasharray:89, 200;stroke-dashoffset:-124px}}",this.shadowRoot.appendChild(e),$(this,{target:this.shadowRoot,props:E(this.attributes),customElement:!0},Or,Sr,o,{clientstyling:1,clientstylingurl:2},null),t&&(t.target&&u(t.target,this,t.anchor),t.props&&(this.$set(t.props),O()))}static get observedAttributes(){return["clientstyling","clientstylingurl"]}get clientstyling(){return this.$$.ctx[1]}set clientstyling(t){this.$$set({clientstyling:t}),O()}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),O()}});class Ur extends U{constructor(t){super();const e=document.createElement("style");e.textContent=".CashierRedirectIframe{height:inherit;width:inherit}iframe{border-radius:0 0 6px 6px;border:1px solid var(--mmw--color-grey-105, #E8E9EB);height:calc(100% - var(--mmw--header-height, 32px));width:100%;box-sizing:border-box}.CashierHeaderLeftButton{color:var(--mmw--color-grey-10, #111);font-size:var(--emw--font-size-small, 14px);font-weight:var(--emw--font-weight-semibold, 500);margin-bottom:0;position:absolute;display:flex;align-items:center;font-variant:all-small-caps;height:32px;left:7px;gap:2px;cursor:pointer}.CashierHeaderLeftButton svg path{fill:var(--mmw--color-grey-10, #111)}.CashierHeaderRightButton{position:absolute;display:flex;justify-content:space-between;align-items:center;padding:0 var(--emw--spacing-small, 12px);height:inherit;right:0;gap:var(--emw--spacing-small, 12px);cursor:pointer}.CashierHeaderRightButton .close-button svg path{fill:var(--mmw--color-grey-10, #111)}",this.shadowRoot.appendChild(e),$(this,{target:this.shadowRoot,props:E(this.attributes),customElement:!0},$r,Rr,o,{lang:0,iframeurl:1,translationurl:2,showbackbutton:3,clientstyling:4,clientstylingurl:5,title:6},null),t&&(t.target&&u(t.target,this,t.anchor),t.props&&(this.$set(t.props),O()))}static get observedAttributes(){return["lang","iframeurl","translationurl","showbackbutton","clientstyling","clientstylingurl","title"]}get lang(){return this.$$.ctx[0]}set lang(t){this.$$set({lang:t}),O()}get iframeurl(){return this.$$.ctx[1]}set iframeurl(t){this.$$set({iframeurl:t}),O()}get translationurl(){return this.$$.ctx[2]}set translationurl(t){this.$$set({translationurl:t}),O()}get showbackbutton(){return this.$$.ctx[3]}set showbackbutton(t){this.$$set({showbackbutton:t}),O()}get clientstyling(){return this.$$.ctx[4]}set clientstyling(t){this.$$set({clientstyling:t}),O()}get clientstylingurl(){return this.$$.ctx[5]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),O()}get title(){return this.$$.ctx[6]}set title(t){this.$$set({title:t}),O()}}return!customElements.get("cashier-iframe-redirect")&&customElements.define("cashier-iframe-redirect",Ur),Ur}));
|
|
589
603
|
//# sourceMappingURL=cashier-iframe-redirect.js.map
|