Files
Twain/src/OAP/Oap.Theme/wwwroot/index-DmYf-7v-.js

3495 lines
82 KiB
JavaScript

var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
var __publicField = (obj, key, value2) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value2);
return value2;
};
(function polyfill() {
const relList = document.createElement("link").relList;
if (relList && relList.supports && relList.supports("modulepreload")) {
return;
}
for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
processPreload(link);
}
new MutationObserver((mutations) => {
for (const mutation of mutations) {
if (mutation.type !== "childList") {
continue;
}
for (const node of mutation.addedNodes) {
if (node.tagName === "LINK" && node.rel === "modulepreload")
processPreload(node);
}
}
}).observe(document, { childList: true, subtree: true });
function getFetchOpts(link) {
const fetchOpts = {};
if (link.integrity)
fetchOpts.integrity = link.integrity;
if (link.referrerPolicy)
fetchOpts.referrerPolicy = link.referrerPolicy;
if (link.crossOrigin === "use-credentials")
fetchOpts.credentials = "include";
else if (link.crossOrigin === "anonymous")
fetchOpts.credentials = "omit";
else
fetchOpts.credentials = "same-origin";
return fetchOpts;
}
function processPreload(link) {
if (link.ep)
return;
link.ep = true;
const fetchOpts = getFetchOpts(link);
fetch(link.href, fetchOpts);
}
})();
var e$1 = {
NAME: "Name",
DOCUMENT: "Document",
OPERATION_DEFINITION: "OperationDefinition",
VARIABLE_DEFINITION: "VariableDefinition",
SELECTION_SET: "SelectionSet",
FIELD: "Field",
ARGUMENT: "Argument",
FRAGMENT_SPREAD: "FragmentSpread",
INLINE_FRAGMENT: "InlineFragment",
FRAGMENT_DEFINITION: "FragmentDefinition",
VARIABLE: "Variable",
INT: "IntValue",
FLOAT: "FloatValue",
STRING: "StringValue",
BOOLEAN: "BooleanValue",
NULL: "NullValue",
ENUM: "EnumValue",
LIST: "ListValue",
OBJECT: "ObjectValue",
OBJECT_FIELD: "ObjectField",
DIRECTIVE: "Directive",
NAMED_TYPE: "NamedType",
LIST_TYPE: "ListType",
NON_NULL_TYPE: "NonNullType"
};
class GraphQLError extends Error {
constructor(e2, r2, i2, n2, a2, t2, l2) {
super(e2);
this.name = "GraphQLError";
this.message = e2;
if (a2) {
this.path = a2;
}
if (r2) {
this.nodes = Array.isArray(r2) ? r2 : [r2];
}
if (i2) {
this.source = i2;
}
if (n2) {
this.positions = n2;
}
if (t2) {
this.originalError = t2;
}
var o2 = l2;
if (!o2 && t2) {
var u2 = t2.extensions;
if (u2 && "object" == typeof u2) {
o2 = u2;
}
}
this.extensions = o2 || {};
}
toJSON() {
return {
...this,
message: this.message
};
}
toString() {
return this.message;
}
get [Symbol.toStringTag]() {
return "GraphQLError";
}
}
var i$1;
var n;
function error(e2) {
return new GraphQLError(`Syntax Error: Unexpected token at ${n} in ${e2}`);
}
function advance(e2) {
e2.lastIndex = n;
if (e2.test(i$1)) {
return i$1.slice(n, n = e2.lastIndex);
}
}
var a = / +(?=[^\s])/y;
function blockString(e2) {
var r2 = e2.split("\n");
var i2 = "";
var n2 = 0;
var t2 = 0;
var l2 = r2.length - 1;
for (var o2 = 0; o2 < r2.length; o2++) {
a.lastIndex = 0;
if (a.test(r2[o2])) {
if (o2 && (!n2 || a.lastIndex < n2)) {
n2 = a.lastIndex;
}
t2 = t2 || o2;
l2 = o2;
}
}
for (var u2 = t2; u2 <= l2; u2++) {
if (u2 !== t2) {
i2 += "\n";
}
i2 += r2[u2].slice(n2).replace(/\\"""/g, '"""');
}
return i2;
}
function ignored() {
for (var e2 = 0 | i$1.charCodeAt(n++); 9 === e2 || 10 === e2 || 13 === e2 || 32 === e2 || 35 === e2 || 44 === e2 || 65279 === e2; e2 = 0 | i$1.charCodeAt(n++)) {
if (35 === e2) {
while (10 !== (e2 = i$1.charCodeAt(n++)) && 13 !== e2) {
}
}
}
n--;
}
var t = /[_A-Za-z]\w*/y;
var l$1 = new RegExp("(?:(null|true|false)|\\$(" + t.source + ')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|(' + t.source + "))", "y");
var o = function(e2) {
e2[e2.Const = 1] = "Const";
e2[e2.Var = 2] = "Var";
e2[e2.Int = 3] = "Int";
e2[e2.Float = 4] = "Float";
e2[e2.BlockString = 5] = "BlockString";
e2[e2.String = 6] = "String";
e2[e2.Enum = 7] = "Enum";
return e2;
}(o || {});
var u$1 = /\\/g;
function value(e2) {
var r2;
var a2;
l$1.lastIndex = n;
if (91 === i$1.charCodeAt(n)) {
n++;
ignored();
var d2 = [];
while (93 !== i$1.charCodeAt(n)) {
d2.push(value(e2));
}
n++;
ignored();
return {
kind: "ListValue",
values: d2
};
} else if (123 === i$1.charCodeAt(n)) {
n++;
ignored();
var v2 = [];
while (125 !== i$1.charCodeAt(n)) {
if (null == (r2 = advance(t))) {
throw error("ObjectField");
}
ignored();
if (58 !== i$1.charCodeAt(n++)) {
throw error("ObjectField");
}
ignored();
v2.push({
kind: "ObjectField",
name: {
kind: "Name",
value: r2
},
value: value(e2)
});
}
n++;
ignored();
return {
kind: "ObjectValue",
fields: v2
};
} else if (null != (a2 = l$1.exec(i$1))) {
n = l$1.lastIndex;
ignored();
if (null != (r2 = a2[o.Const])) {
return "null" === r2 ? {
kind: "NullValue"
} : {
kind: "BooleanValue",
value: "true" === r2
};
} else if (null != (r2 = a2[o.Var])) {
if (e2) {
throw error("Variable");
} else {
return {
kind: "Variable",
name: {
kind: "Name",
value: r2
}
};
}
} else if (null != (r2 = a2[o.Int])) {
var s2;
if (null != (s2 = a2[o.Float])) {
return {
kind: "FloatValue",
value: r2 + s2
};
} else {
return {
kind: "IntValue",
value: r2
};
}
} else if (null != (r2 = a2[o.BlockString])) {
return {
kind: "StringValue",
value: blockString(r2.slice(3, -3)),
block: true
};
} else if (null != (r2 = a2[o.String])) {
return {
kind: "StringValue",
value: u$1.test(r2) ? JSON.parse(r2) : r2.slice(1, -1),
block: false
};
} else if (null != (r2 = a2[o.Enum])) {
return {
kind: "EnumValue",
value: r2
};
}
}
throw error("Value");
}
function arguments_(e2) {
if (40 === i$1.charCodeAt(n)) {
var r2 = [];
n++;
ignored();
var a2;
do {
if (null == (a2 = advance(t))) {
throw error("Argument");
}
ignored();
if (58 !== i$1.charCodeAt(n++)) {
throw error("Argument");
}
ignored();
r2.push({
kind: "Argument",
name: {
kind: "Name",
value: a2
},
value: value(e2)
});
} while (41 !== i$1.charCodeAt(n));
n++;
ignored();
return r2;
}
}
function directives(e2) {
if (64 === i$1.charCodeAt(n)) {
var r2 = [];
var a2;
do {
n++;
if (null == (a2 = advance(t))) {
throw error("Directive");
}
ignored();
r2.push({
kind: "Directive",
name: {
kind: "Name",
value: a2
},
arguments: arguments_(e2)
});
} while (64 === i$1.charCodeAt(n));
return r2;
}
}
function type() {
var e2;
var r2 = 0;
while (91 === i$1.charCodeAt(n)) {
r2++;
n++;
ignored();
}
if (null == (e2 = advance(t))) {
throw error("NamedType");
}
ignored();
var a2 = {
kind: "NamedType",
name: {
kind: "Name",
value: e2
}
};
do {
if (33 === i$1.charCodeAt(n)) {
n++;
ignored();
a2 = {
kind: "NonNullType",
type: a2
};
}
if (r2) {
if (93 !== i$1.charCodeAt(n++)) {
throw error("NamedType");
}
ignored();
a2 = {
kind: "ListType",
type: a2
};
}
} while (r2--);
return a2;
}
var d$2 = new RegExp("(?:(\\.{3})|(" + t.source + "))", "y");
var v$1 = function(e2) {
e2[e2.Spread = 1] = "Spread";
e2[e2.Name = 2] = "Name";
return e2;
}(v$1 || {});
function selectionSet() {
var e2 = [];
var r2;
var a2;
do {
d$2.lastIndex = n;
if (null != (a2 = d$2.exec(i$1))) {
n = d$2.lastIndex;
if (null != a2[v$1.Spread]) {
ignored();
var l2 = advance(t);
if (null != l2 && "on" !== l2) {
ignored();
e2.push({
kind: "FragmentSpread",
name: {
kind: "Name",
value: l2
},
directives: directives(false)
});
} else {
ignored();
if ("on" === l2) {
if (null == (l2 = advance(t))) {
throw error("NamedType");
}
ignored();
}
var o2 = directives(false);
if (123 !== i$1.charCodeAt(n++)) {
throw error("InlineFragment");
}
ignored();
e2.push({
kind: "InlineFragment",
typeCondition: l2 ? {
kind: "NamedType",
name: {
kind: "Name",
value: l2
}
} : void 0,
directives: o2,
selectionSet: selectionSet()
});
}
} else if (null != (r2 = a2[v$1.Name])) {
var u2 = void 0;
ignored();
if (58 === i$1.charCodeAt(n)) {
n++;
ignored();
u2 = r2;
if (null == (r2 = advance(t))) {
throw error("Field");
}
ignored();
}
var s2 = arguments_(false);
ignored();
var c2 = directives(false);
var f2 = void 0;
if (123 === i$1.charCodeAt(n)) {
n++;
ignored();
f2 = selectionSet();
}
e2.push({
kind: "Field",
alias: u2 ? {
kind: "Name",
value: u2
} : void 0,
name: {
kind: "Name",
value: r2
},
arguments: s2,
directives: c2,
selectionSet: f2
});
}
} else {
throw error("SelectionSet");
}
} while (125 !== i$1.charCodeAt(n));
n++;
ignored();
return {
kind: "SelectionSet",
selections: e2
};
}
function fragmentDefinition() {
var e2;
var r2;
if (null == (e2 = advance(t))) {
throw error("FragmentDefinition");
}
ignored();
if ("on" !== advance(t)) {
throw error("FragmentDefinition");
}
ignored();
if (null == (r2 = advance(t))) {
throw error("FragmentDefinition");
}
ignored();
var a2 = directives(false);
if (123 !== i$1.charCodeAt(n++)) {
throw error("FragmentDefinition");
}
ignored();
return {
kind: "FragmentDefinition",
name: {
kind: "Name",
value: e2
},
typeCondition: {
kind: "NamedType",
name: {
kind: "Name",
value: r2
}
},
directives: a2,
selectionSet: selectionSet()
};
}
var s = /(?:query|mutation|subscription|fragment)/y;
function operationDefinition(e2) {
var r2;
var a2;
var l2;
if (e2) {
ignored();
r2 = advance(t);
a2 = function variableDefinitions() {
ignored();
if (40 === i$1.charCodeAt(n)) {
var e3 = [];
n++;
ignored();
var r3;
do {
if (36 !== i$1.charCodeAt(n++)) {
throw error("Variable");
}
if (null == (r3 = advance(t))) {
throw error("Variable");
}
ignored();
if (58 !== i$1.charCodeAt(n++)) {
throw error("VariableDefinition");
}
ignored();
var a3 = type();
var l3 = void 0;
if (61 === i$1.charCodeAt(n)) {
n++;
ignored();
l3 = value(true);
}
ignored();
e3.push({
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: {
kind: "Name",
value: r3
}
},
type: a3,
defaultValue: l3,
directives: directives(true)
});
} while (41 !== i$1.charCodeAt(n));
n++;
ignored();
return e3;
}
}();
l2 = directives(false);
}
if (123 === i$1.charCodeAt(n)) {
n++;
ignored();
return {
kind: "OperationDefinition",
operation: e2 || "query",
name: r2 ? {
kind: "Name",
value: r2
} : void 0,
variableDefinitions: a2,
directives: l2,
selectionSet: selectionSet()
};
}
}
function parse(e2, r2) {
i$1 = "string" == typeof e2.body ? e2.body : e2;
n = 0;
return function document2() {
var e3;
var r3;
ignored();
var a2 = [];
do {
if ("fragment" === (e3 = advance(s))) {
ignored();
a2.push(fragmentDefinition());
} else if (null != (r3 = operationDefinition(e3))) {
a2.push(r3);
} else {
throw error("Document");
}
} while (n < i$1.length);
return {
kind: "Document",
definitions: a2
};
}();
}
function mapJoin(e2, r2, i2) {
var n2 = "";
for (var a2 = 0; a2 < e2.length; a2++) {
if (a2) {
n2 += r2;
}
n2 += i2(e2[a2]);
}
return n2;
}
function printString(e2) {
return JSON.stringify(e2);
}
function printBlockString(e2) {
return '"""\n' + e2.replace(/"""/g, '\\"""') + '\n"""';
}
var f$1 = "\n";
var m$1 = {
OperationDefinition(e2) {
var r2 = e2.operation;
if (e2.name) {
r2 += " " + e2.name.value;
}
if (e2.variableDefinitions && e2.variableDefinitions.length) {
if (!e2.name) {
r2 += " ";
}
r2 += "(" + mapJoin(e2.variableDefinitions, ", ", m$1.VariableDefinition) + ")";
}
if (e2.directives && e2.directives.length) {
r2 += " " + mapJoin(e2.directives, " ", m$1.Directive);
}
return "query" !== r2 ? r2 + " " + m$1.SelectionSet(e2.selectionSet) : m$1.SelectionSet(e2.selectionSet);
},
VariableDefinition(e2) {
var r2 = m$1.Variable(e2.variable) + ": " + _print(e2.type);
if (e2.defaultValue) {
r2 += " = " + _print(e2.defaultValue);
}
if (e2.directives && e2.directives.length) {
r2 += " " + mapJoin(e2.directives, " ", m$1.Directive);
}
return r2;
},
Field(e2) {
var r2 = e2.alias ? e2.alias.value + ": " + e2.name.value : e2.name.value;
if (e2.arguments && e2.arguments.length) {
var i2 = mapJoin(e2.arguments, ", ", m$1.Argument);
if (r2.length + i2.length + 2 > 80) {
r2 += "(" + (f$1 += " ") + mapJoin(e2.arguments, f$1, m$1.Argument) + (f$1 = f$1.slice(0, -2)) + ")";
} else {
r2 += "(" + i2 + ")";
}
}
if (e2.directives && e2.directives.length) {
r2 += " " + mapJoin(e2.directives, " ", m$1.Directive);
}
if (e2.selectionSet) {
r2 += " " + m$1.SelectionSet(e2.selectionSet);
}
return r2;
},
StringValue(e2) {
if (e2.block) {
return printBlockString(e2.value).replace(/\n/g, f$1);
} else {
return printString(e2.value);
}
},
BooleanValue: (e2) => "" + e2.value,
NullValue: (e2) => "null",
IntValue: (e2) => e2.value,
FloatValue: (e2) => e2.value,
EnumValue: (e2) => e2.value,
Name: (e2) => e2.value,
Variable: (e2) => "$" + e2.name.value,
ListValue: (e2) => "[" + mapJoin(e2.values, ", ", _print) + "]",
ObjectValue: (e2) => "{" + mapJoin(e2.fields, ", ", m$1.ObjectField) + "}",
ObjectField: (e2) => e2.name.value + ": " + _print(e2.value),
Document(e2) {
if (!e2.definitions || !e2.definitions.length) {
return "";
}
return mapJoin(e2.definitions, "\n\n", _print);
},
SelectionSet: (e2) => "{" + (f$1 += " ") + mapJoin(e2.selections, f$1, _print) + (f$1 = f$1.slice(0, -2)) + "}",
Argument: (e2) => e2.name.value + ": " + _print(e2.value),
FragmentSpread(e2) {
var r2 = "..." + e2.name.value;
if (e2.directives && e2.directives.length) {
r2 += " " + mapJoin(e2.directives, " ", m$1.Directive);
}
return r2;
},
InlineFragment(e2) {
var r2 = "...";
if (e2.typeCondition) {
r2 += " on " + e2.typeCondition.name.value;
}
if (e2.directives && e2.directives.length) {
r2 += " " + mapJoin(e2.directives, " ", m$1.Directive);
}
return r2 += " " + m$1.SelectionSet(e2.selectionSet);
},
FragmentDefinition(e2) {
var r2 = "fragment " + e2.name.value;
r2 += " on " + e2.typeCondition.name.value;
if (e2.directives && e2.directives.length) {
r2 += " " + mapJoin(e2.directives, " ", m$1.Directive);
}
return r2 + " " + m$1.SelectionSet(e2.selectionSet);
},
Directive(e2) {
var r2 = "@" + e2.name.value;
if (e2.arguments && e2.arguments.length) {
r2 += "(" + mapJoin(e2.arguments, ", ", m$1.Argument) + ")";
}
return r2;
},
NamedType: (e2) => e2.name.value,
ListType: (e2) => "[" + _print(e2.type) + "]",
NonNullType: (e2) => _print(e2.type) + "!"
};
var _print = (e2) => m$1[e2.kind](e2);
function print(e2) {
f$1 = "\n";
return m$1[e2.kind] ? m$1[e2.kind](e2) : "";
}
var teardownPlaceholder = () => {
};
var e = teardownPlaceholder;
function start(e2) {
return {
tag: 0,
0: e2
};
}
function push(e2) {
return {
tag: 1,
0: e2
};
}
var asyncIteratorSymbol = () => "function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator";
var identity = (e2) => e2;
function concatMap(r2) {
return (t2) => (i2) => {
var a2 = [];
var f2 = e;
var n2 = e;
var s2 = false;
var l2 = false;
var u2 = false;
var o2 = false;
function applyInnerSource(e2) {
u2 = true;
e2((e3) => {
if (0 === e3) {
if (u2) {
u2 = false;
if (a2.length) {
applyInnerSource(r2(a2.shift()));
} else if (o2) {
i2(0);
} else if (!s2) {
s2 = true;
f2(0);
}
}
} else if (0 === e3.tag) {
l2 = false;
(n2 = e3[0])(0);
} else if (u2) {
i2(e3);
if (l2) {
l2 = false;
} else {
n2(0);
}
}
});
}
t2((e2) => {
if (o2)
;
else if (0 === e2) {
o2 = true;
if (!u2 && !a2.length) {
i2(0);
}
} else if (0 === e2.tag) {
f2 = e2[0];
} else {
s2 = false;
if (u2) {
a2.push(e2[0]);
} else {
applyInnerSource(r2(e2[0]));
}
}
});
i2(start((e2) => {
if (1 === e2) {
if (!o2) {
o2 = true;
f2(1);
}
if (u2) {
u2 = false;
n2(1);
}
} else {
if (!o2 && !s2) {
s2 = true;
f2(0);
}
if (u2 && !l2) {
l2 = true;
n2(0);
}
}
}));
};
}
function concatAll(e2) {
return concatMap(identity)(e2);
}
function concat(e2) {
return concatAll(r(e2));
}
function filter(r2) {
return (t2) => (i2) => {
var a2 = e;
t2((e2) => {
if (0 === e2) {
i2(0);
} else if (0 === e2.tag) {
a2 = e2[0];
i2(e2);
} else if (!r2(e2[0])) {
a2(0);
} else {
i2(e2);
}
});
};
}
function map(e2) {
return (r2) => (t2) => r2((r3) => {
if (0 === r3 || 0 === r3.tag) {
t2(r3);
} else {
t2(push(e2(r3[0])));
}
});
}
function mergeMap(r2) {
return (t2) => (i2) => {
var a2 = [];
var f2 = e;
var n2 = false;
var s2 = false;
t2((t3) => {
if (s2)
;
else if (0 === t3) {
s2 = true;
if (!a2.length) {
i2(0);
}
} else if (0 === t3.tag) {
f2 = t3[0];
} else {
n2 = false;
!function applyInnerSource(r3) {
var t4 = e;
r3((e2) => {
if (0 === e2) {
if (a2.length) {
var r4 = a2.indexOf(t4);
if (r4 > -1) {
(a2 = a2.slice()).splice(r4, 1);
}
if (!a2.length) {
if (s2) {
i2(0);
} else if (!n2) {
n2 = true;
f2(0);
}
}
}
} else if (0 === e2.tag) {
a2.push(t4 = e2[0]);
t4(0);
} else if (a2.length) {
i2(e2);
t4(0);
}
});
}(r2(t3[0]));
if (!n2) {
n2 = true;
f2(0);
}
}
});
i2(start((e2) => {
if (1 === e2) {
if (!s2) {
s2 = true;
f2(1);
}
for (var r3 = 0, t3 = a2, i3 = a2.length; r3 < i3; r3++) {
t3[r3](1);
}
a2.length = 0;
} else {
if (!s2 && !n2) {
n2 = true;
f2(0);
} else {
n2 = false;
}
for (var l2 = 0, u2 = a2, o2 = a2.length; l2 < o2; l2++) {
u2[l2](0);
}
}
}));
};
}
function mergeAll(e2) {
return mergeMap(identity)(e2);
}
function merge(e2) {
return mergeAll(r(e2));
}
function onEnd(e2) {
return (r2) => (t2) => {
var i2 = false;
r2((r3) => {
if (i2)
;
else if (0 === r3) {
i2 = true;
t2(0);
e2();
} else if (0 === r3.tag) {
var a2 = r3[0];
t2(start((r4) => {
if (1 === r4) {
i2 = true;
a2(1);
e2();
} else {
a2(r4);
}
}));
} else {
t2(r3);
}
});
};
}
function onPush(e2) {
return (r2) => (t2) => {
var i2 = false;
r2((r3) => {
if (i2)
;
else if (0 === r3) {
i2 = true;
t2(0);
} else if (0 === r3.tag) {
var a2 = r3[0];
t2(start((e3) => {
if (1 === e3) {
i2 = true;
}
a2(e3);
}));
} else {
e2(r3[0]);
t2(r3);
}
});
};
}
function onStart(e2) {
return (r2) => (t2) => r2((r3) => {
if (0 === r3) {
t2(0);
} else if (0 === r3.tag) {
t2(r3);
e2();
} else {
t2(r3);
}
});
}
function scan(e2, r2) {
return (t2) => (i2) => {
var a2 = r2;
t2((r3) => {
if (0 === r3) {
i2(0);
} else if (0 === r3.tag) {
i2(r3);
} else {
i2(push(a2 = e2(a2, r3[0])));
}
});
};
}
function share(r2) {
var t2 = [];
var i2 = e;
var a2 = false;
return (e2) => {
t2.push(e2);
if (1 === t2.length) {
r2((e3) => {
if (0 === e3) {
for (var r3 = 0, f2 = t2, n2 = t2.length; r3 < n2; r3++) {
f2[r3](0);
}
t2.length = 0;
} else if (0 === e3.tag) {
i2 = e3[0];
} else {
a2 = false;
for (var s2 = 0, l2 = t2, u2 = t2.length; s2 < u2; s2++) {
l2[s2](e3);
}
}
});
}
e2(start((r3) => {
if (1 === r3) {
var f2 = t2.indexOf(e2);
if (f2 > -1) {
(t2 = t2.slice()).splice(f2, 1);
}
if (!t2.length) {
i2(1);
}
} else if (!a2) {
a2 = true;
i2(0);
}
}));
};
}
function switchMap(r2) {
return (t2) => (i2) => {
var a2 = e;
var f2 = e;
var n2 = false;
var s2 = false;
var l2 = false;
var u2 = false;
t2((t3) => {
if (u2)
;
else if (0 === t3) {
u2 = true;
if (!l2) {
i2(0);
}
} else if (0 === t3.tag) {
a2 = t3[0];
} else {
if (l2) {
f2(1);
f2 = e;
}
if (!n2) {
n2 = true;
a2(0);
} else {
n2 = false;
}
!function applyInnerSource(e2) {
l2 = true;
e2((e3) => {
if (!l2)
;
else if (0 === e3) {
l2 = false;
if (u2) {
i2(0);
} else if (!n2) {
n2 = true;
a2(0);
}
} else if (0 === e3.tag) {
s2 = false;
(f2 = e3[0])(0);
} else {
i2(e3);
if (!s2) {
f2(0);
} else {
s2 = false;
}
}
});
}(r2(t3[0]));
}
});
i2(start((e2) => {
if (1 === e2) {
if (!u2) {
u2 = true;
a2(1);
}
if (l2) {
l2 = false;
f2(1);
}
} else {
if (!u2 && !n2) {
n2 = true;
a2(0);
}
if (l2 && !s2) {
s2 = true;
f2(0);
}
}
}));
};
}
function take(r2) {
return (t2) => (i2) => {
var a2 = e;
var f2 = false;
var n2 = 0;
t2((e2) => {
if (f2)
;
else if (0 === e2) {
f2 = true;
i2(0);
} else if (0 === e2.tag) {
if (r2 <= 0) {
f2 = true;
i2(0);
e2[0](1);
} else {
a2 = e2[0];
}
} else if (n2++ < r2) {
i2(e2);
if (!f2 && n2 >= r2) {
f2 = true;
i2(0);
a2(1);
}
} else {
i2(e2);
}
});
i2(start((e2) => {
if (1 === e2 && !f2) {
f2 = true;
a2(1);
} else if (0 === e2 && !f2 && n2 < r2) {
a2(0);
}
}));
};
}
function takeUntil(r2) {
return (t2) => (i2) => {
var a2 = e;
var f2 = e;
var n2 = false;
t2((e2) => {
if (n2)
;
else if (0 === e2) {
n2 = true;
f2(1);
i2(0);
} else if (0 === e2.tag) {
a2 = e2[0];
r2((e3) => {
if (0 === e3)
;
else if (0 === e3.tag) {
(f2 = e3[0])(0);
} else {
n2 = true;
f2(1);
a2(1);
i2(0);
}
});
} else {
i2(e2);
}
});
i2(start((e2) => {
if (1 === e2 && !n2) {
n2 = true;
a2(1);
f2(1);
} else if (!n2) {
a2(0);
}
}));
};
}
function takeWhile(r2, t2) {
return (i2) => (a2) => {
var f2 = e;
var n2 = false;
i2((e2) => {
if (n2)
;
else if (0 === e2) {
n2 = true;
a2(0);
} else if (0 === e2.tag) {
f2 = e2[0];
a2(e2);
} else if (!r2(e2[0])) {
n2 = true;
if (t2) {
a2(e2);
}
a2(0);
f2(1);
} else {
a2(e2);
}
});
};
}
function lazy(e2) {
return (r2) => e2()(r2);
}
function fromAsyncIterable(e2) {
return (r2) => {
var t2 = e2[asyncIteratorSymbol()] && e2[asyncIteratorSymbol()]() || e2;
var i2 = false;
var a2 = false;
var f2 = false;
var n2;
r2(start(async (e3) => {
if (1 === e3) {
i2 = true;
if (t2.return) {
t2.return();
}
} else if (a2) {
f2 = true;
} else {
for (f2 = a2 = true; f2 && !i2; ) {
if ((n2 = await t2.next()).done) {
i2 = true;
if (t2.return) {
await t2.return();
}
r2(0);
} else {
try {
f2 = false;
r2(push(n2.value));
} catch (e4) {
if (t2.throw) {
if (i2 = !!(await t2.throw(e4)).done) {
r2(0);
}
} else {
throw e4;
}
}
}
}
a2 = false;
}
}));
};
}
function fromIterable(e2) {
if (e2[Symbol.asyncIterator]) {
return fromAsyncIterable(e2);
}
return (r2) => {
var t2 = e2[Symbol.iterator]();
var i2 = false;
var a2 = false;
var f2 = false;
var n2;
r2(start((e3) => {
if (1 === e3) {
i2 = true;
if (t2.return) {
t2.return();
}
} else if (a2) {
f2 = true;
} else {
for (f2 = a2 = true; f2 && !i2; ) {
if ((n2 = t2.next()).done) {
i2 = true;
if (t2.return) {
t2.return();
}
r2(0);
} else {
try {
f2 = false;
r2(push(n2.value));
} catch (e4) {
if (t2.throw) {
if (i2 = !!t2.throw(e4).done) {
r2(0);
}
} else {
throw e4;
}
}
}
}
a2 = false;
}
}));
};
}
var r = fromIterable;
function fromValue(e2) {
return (r2) => {
var t2 = false;
r2(start((i2) => {
if (1 === i2) {
t2 = true;
} else if (!t2) {
t2 = true;
r2(push(e2));
r2(0);
}
}));
};
}
function make(e2) {
return (r2) => {
var t2 = false;
var i2 = e2({
next(e3) {
if (!t2) {
r2(push(e3));
}
},
complete() {
if (!t2) {
t2 = true;
r2(0);
}
}
});
r2(start((e3) => {
if (1 === e3 && !t2) {
t2 = true;
i2();
}
}));
};
}
function makeSubject() {
var e2;
var r2;
return {
source: share(make((t2) => {
e2 = t2.next;
r2 = t2.complete;
return teardownPlaceholder;
})),
next(r3) {
if (e2) {
e2(r3);
}
},
complete() {
if (r2) {
r2();
}
}
};
}
var never = (r2) => {
r2(start(e));
};
function subscribe$1(r2) {
return (t2) => {
var i2 = e;
var a2 = false;
t2((e2) => {
if (0 === e2) {
a2 = true;
} else if (0 === e2.tag) {
(i2 = e2[0])(0);
} else if (!a2) {
r2(e2[0]);
i2(0);
}
});
return {
unsubscribe() {
if (!a2) {
a2 = true;
i2(1);
}
}
};
};
}
function publish(e2) {
subscribe$1((e3) => {
})(e2);
}
function toPromise(r2) {
return new Promise((t2) => {
var i2 = e;
var a2;
r2((e2) => {
if (0 === e2) {
Promise.resolve(a2).then(t2);
} else if (0 === e2.tag) {
(i2 = e2[0])(0);
} else {
a2 = e2[0];
i2(0);
}
});
});
}
var rehydrateGraphQlError = (r2) => {
if (r2 && r2.message && (r2.extensions || "GraphQLError" === r2.name)) {
return r2;
} else if ("object" == typeof r2 && r2.message) {
return new GraphQLError(r2.message, r2.nodes, r2.source, r2.positions, r2.path, r2, r2.extensions || {});
} else {
return new GraphQLError(r2);
}
};
class CombinedError extends Error {
constructor(e2) {
var r2 = (e2.graphQLErrors || []).map(rehydrateGraphQlError);
var t2 = ((e3, r3) => {
var t3 = "";
if (e3) {
return `[Network] ${e3.message}`;
}
if (r3) {
for (var a2 of r3) {
if (t3) {
t3 += "\n";
}
t3 += `[GraphQL] ${a2.message}`;
}
}
return t3;
})(e2.networkError, r2);
super(t2);
this.name = "CombinedError";
this.message = t2;
this.graphQLErrors = r2;
this.networkError = e2.networkError;
this.response = e2.response;
}
toString() {
return this.message;
}
}
var phash = (e2, r2) => {
var t2 = 0 | (r2 || 5381);
for (var a2 = 0, o2 = 0 | e2.length; a2 < o2; a2++) {
t2 = (t2 << 5) + t2 + e2.charCodeAt(a2);
}
return t2;
};
var i = /* @__PURE__ */ new Set();
var f = /* @__PURE__ */ new WeakMap();
var stringify = (e2) => {
if (null === e2 || i.has(e2)) {
return "null";
} else if ("object" != typeof e2) {
return JSON.stringify(e2) || "";
} else if (e2.toJSON) {
return stringify(e2.toJSON());
} else if (Array.isArray(e2)) {
var r2 = "[";
for (var t2 of e2) {
if (r2.length > 1) {
r2 += ",";
}
r2 += stringify(t2) || "null";
}
return r2 += "]";
} else if (l !== NoopConstructor && e2 instanceof l || c !== NoopConstructor && e2 instanceof c) {
return "null";
}
var a2 = Object.keys(e2).sort();
if (!a2.length && e2.constructor && Object.getPrototypeOf(e2).constructor !== Object.prototype.constructor) {
var o2 = f.get(e2) || Math.random().toString(36).slice(2);
f.set(e2, o2);
return stringify({
__key: o2
});
}
i.add(e2);
var n2 = "{";
for (var s2 of a2) {
var d2 = stringify(e2[s2]);
if (d2) {
if (n2.length > 1) {
n2 += ",";
}
n2 += stringify(s2) + ":" + d2;
}
}
i.delete(e2);
return n2 += "}";
};
var extract = (e2, r2, t2) => {
if (null == t2 || "object" != typeof t2 || t2.toJSON || i.has(t2))
;
else if (Array.isArray(t2)) {
for (var a2 = 0, o2 = t2.length; a2 < o2; a2++) {
extract(e2, `${r2}.${a2}`, t2[a2]);
}
} else if (t2 instanceof l || t2 instanceof c) {
e2.set(r2, t2);
} else {
i.add(t2);
for (var n2 of Object.keys(t2)) {
extract(e2, `${r2}.${n2}`, t2[n2]);
}
}
};
var stringifyVariables = (e2) => {
i.clear();
return stringify(e2);
};
class NoopConstructor {
}
var l = "undefined" != typeof File ? File : NoopConstructor;
var c = "undefined" != typeof Blob ? Blob : NoopConstructor;
var d$1 = /("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g;
var v = /(?:#[^\n\r]+)?(?:[\r\n]+|$)/g;
var replaceOutsideStrings = (e2, r2) => r2 % 2 == 0 ? e2.replace(v, "\n") : e2;
var sanitizeDocument = (e2) => e2.split(d$1).map(replaceOutsideStrings).join("").trim();
var p = /* @__PURE__ */ new Map();
var u = /* @__PURE__ */ new Map();
var stringifyDocument = (e2) => {
var t2;
if ("string" == typeof e2) {
t2 = sanitizeDocument(e2);
} else if (e2.loc && u.get(e2.__key) === e2) {
t2 = e2.loc.source.body;
} else {
t2 = p.get(e2) || sanitizeDocument(print(e2));
p.set(e2, t2);
}
if ("string" != typeof e2 && !e2.loc) {
e2.loc = {
start: 0,
end: t2.length,
source: {
body: t2,
name: "gql",
locationOffset: {
line: 1,
column: 1
}
}
};
}
return t2;
};
var hashDocument = (e2) => {
var r2 = phash(stringifyDocument(e2));
if (e2.definitions) {
var t2 = getOperationName(e2);
if (t2) {
r2 = phash(`
# ${t2}`, r2);
}
}
return r2;
};
var keyDocument = (e2) => {
var r2;
var a2;
if ("string" == typeof e2) {
r2 = hashDocument(e2);
a2 = u.get(r2) || parse(e2);
} else {
r2 = e2.__key || hashDocument(e2);
a2 = u.get(r2) || e2;
}
if (!a2.loc) {
stringifyDocument(a2);
}
a2.__key = r2;
u.set(r2, a2);
return a2;
};
var createRequest = (e2, r2, t2) => {
var a2 = r2 || {};
var o2 = keyDocument(e2);
var n2 = stringifyVariables(a2);
var s2 = o2.__key;
if ("{}" !== n2) {
s2 = phash(n2, s2);
}
return {
key: s2,
query: o2,
variables: a2,
extensions: t2
};
};
var getOperationName = (e2) => {
for (var r2 of e2.definitions) {
if (r2.kind === e$1.OPERATION_DEFINITION) {
return r2.name ? r2.name.value : void 0;
}
}
};
var makeResult = (e2, r2, t2) => {
if (!("data" in r2 || "errors" in r2 && Array.isArray(r2.errors))) {
throw new Error("No Content");
}
var a2 = "subscription" === e2.kind;
return {
operation: e2,
data: r2.data,
error: Array.isArray(r2.errors) ? new CombinedError({
graphQLErrors: r2.errors,
response: t2
}) : void 0,
extensions: r2.extensions ? {
...r2.extensions
} : void 0,
hasNext: null == r2.hasNext ? a2 : r2.hasNext,
stale: false
};
};
var deepMerge = (e2, r2) => {
if ("object" == typeof e2 && null != e2) {
if (!e2.constructor || e2.constructor === Object || Array.isArray(e2)) {
e2 = Array.isArray(e2) ? [...e2] : {
...e2
};
for (var t2 of Object.keys(r2)) {
e2[t2] = deepMerge(e2[t2], r2[t2]);
}
return e2;
}
}
return r2;
};
var mergeResultPatch = (e2, r2, t2, a2) => {
var o2 = e2.error ? e2.error.graphQLErrors : [];
var n2 = !!e2.extensions || !!(r2.payload || r2).extensions;
var s2 = {
...e2.extensions,
...(r2.payload || r2).extensions
};
var i2 = r2.incremental;
if ("path" in r2) {
i2 = [r2];
}
var f2 = {
data: e2.data
};
if (i2) {
var _loop = function(e3) {
if (Array.isArray(e3.errors)) {
o2.push(...e3.errors);
}
if (e3.extensions) {
Object.assign(s2, e3.extensions);
n2 = true;
}
var r3 = "data";
var t3 = f2;
var i3 = [];
if (e3.path) {
i3 = e3.path;
} else if (a2) {
var l3 = a2.find((r4) => r4.id === e3.id);
if (e3.subPath) {
i3 = [...l3.path, ...e3.subPath];
} else {
i3 = l3.path;
}
}
for (var c2 = 0, d2 = i3.length; c2 < d2; r3 = i3[c2++]) {
t3 = t3[r3] = Array.isArray(t3[r3]) ? [...t3[r3]] : {
...t3[r3]
};
}
if (e3.items) {
var v2 = +r3 >= 0 ? r3 : 0;
for (var p2 = 0, u2 = e3.items.length; p2 < u2; p2++) {
t3[v2 + p2] = deepMerge(t3[v2 + p2], e3.items[p2]);
}
} else if (void 0 !== e3.data) {
t3[r3] = deepMerge(t3[r3], e3.data);
}
};
for (var l2 of i2) {
_loop(l2);
}
} else {
f2.data = (r2.payload || r2).data || e2.data;
o2 = r2.errors || r2.payload && r2.payload.errors || o2;
}
return {
operation: e2.operation,
data: f2.data,
error: o2.length ? new CombinedError({
graphQLErrors: o2,
response: t2
}) : void 0,
extensions: n2 ? s2 : void 0,
hasNext: null != r2.hasNext ? r2.hasNext : e2.hasNext,
stale: false
};
};
var makeErrorResult = (e2, r2, t2) => ({
operation: e2,
data: void 0,
error: new CombinedError({
networkError: r2,
response: t2
}),
extensions: void 0,
hasNext: false,
stale: false
});
function makeFetchBody(e2) {
var r2 = {
query: void 0,
documentId: void 0,
operationName: getOperationName(e2.query),
variables: e2.variables || void 0,
extensions: e2.extensions
};
if ("documentId" in e2.query && e2.query.documentId && (!e2.query.definitions || !e2.query.definitions.length)) {
r2.documentId = e2.query.documentId;
} else if (!e2.extensions || !e2.extensions.persistedQuery || e2.extensions.persistedQuery.miss) {
r2.query = stringifyDocument(e2.query);
}
return r2;
}
var makeFetchURL = (e2, r2) => {
var t2 = "query" === e2.kind && e2.context.preferGetMethod;
if (!t2 || !r2) {
return e2.context.url;
}
var a2 = splitOutSearchParams(e2.context.url);
for (var o2 in r2) {
var n2 = r2[o2];
if (n2) {
a2[1].set(o2, "object" == typeof n2 ? stringifyVariables(n2) : n2);
}
}
var s2 = a2.join("?");
if (s2.length > 2047 && "force" !== t2) {
e2.context.preferGetMethod = false;
return e2.context.url;
}
return s2;
};
var splitOutSearchParams = (e2) => {
var r2 = e2.indexOf("?");
return r2 > -1 ? [e2.slice(0, r2), new URLSearchParams(e2.slice(r2 + 1))] : [e2, new URLSearchParams()];
};
var serializeBody = (e2, r2) => {
if (r2 && !("query" === e2.kind && !!e2.context.preferGetMethod)) {
var t2 = stringifyVariables(r2);
var a2 = ((e3) => {
var r3 = /* @__PURE__ */ new Map();
if (l !== NoopConstructor || c !== NoopConstructor) {
i.clear();
extract(r3, "variables", e3);
}
return r3;
})(r2.variables);
if (a2.size) {
var o2 = new FormData();
o2.append("operations", t2);
o2.append("map", stringifyVariables({
...[...a2.keys()].map((e3) => [e3])
}));
var n2 = 0;
for (var s2 of a2.values()) {
o2.append("" + n2++, s2);
}
return o2;
}
return t2;
}
};
var makeFetchOptions = (e2, r2) => {
var t2 = {
accept: "subscription" === e2.kind ? "text/event-stream, multipart/mixed" : "application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"
};
var a2 = ("function" == typeof e2.context.fetchOptions ? e2.context.fetchOptions() : e2.context.fetchOptions) || {};
if (a2.headers) {
if (((e3) => "has" in e3 && !Object.keys(e3).length)(a2.headers)) {
a2.headers.forEach((e3, r3) => {
t2[r3] = e3;
});
} else if (Array.isArray(a2.headers)) {
a2.headers.forEach((e3, r3) => {
if (Array.isArray(e3)) {
if (t2[e3[0]]) {
t2[e3[0]] = `${t2[e3[0]]},${e3[1]}`;
} else {
t2[e3[0]] = e3[1];
}
} else {
t2[r3] = e3;
}
});
} else {
for (var o2 in a2.headers) {
t2[o2.toLowerCase()] = a2.headers[o2];
}
}
}
var n2 = serializeBody(e2, r2);
if ("string" == typeof n2 && !t2["content-type"]) {
t2["content-type"] = "application/json";
}
return {
...a2,
method: n2 ? "POST" : "GET",
body: n2,
headers: t2
};
};
var y = "undefined" != typeof TextDecoder ? new TextDecoder() : null;
var h = /boundary="?([^=";]+)"?/i;
var m = /data: ?([^\n]+)/;
var toString = (e2) => "Buffer" === e2.constructor.name ? e2.toString() : y.decode(e2);
async function* streamBody(e2) {
if (e2.body[Symbol.asyncIterator]) {
for await (var r2 of e2.body) {
yield toString(r2);
}
} else {
var t2 = e2.body.getReader();
var a2;
try {
while (!(a2 = await t2.read()).done) {
yield toString(a2.value);
}
} finally {
t2.cancel();
}
}
}
async function* split(e2, r2) {
var t2 = "";
var a2;
for await (var o2 of e2) {
t2 += o2;
while ((a2 = t2.indexOf(r2)) > -1) {
yield t2.slice(0, a2);
t2 = t2.slice(a2 + r2.length);
}
}
}
async function* fetchOperation(e2, r2, t2) {
var a2 = true;
var o2 = null;
var n2;
try {
yield await Promise.resolve();
var s2 = (n2 = await (e2.context.fetch || fetch)(r2, t2)).headers.get("Content-Type") || "";
var i2;
if (/multipart\/mixed/i.test(s2)) {
i2 = async function* parseMultipartMixed(e3, r3) {
var t3 = e3.match(h);
var a3 = "--" + (t3 ? t3[1] : "-");
var o3 = true;
var n3;
for await (var s3 of split(streamBody(r3), "\r\n" + a3)) {
if (o3) {
o3 = false;
var i3 = s3.indexOf(a3);
if (i3 > -1) {
s3 = s3.slice(i3 + a3.length);
} else {
continue;
}
}
try {
yield n3 = JSON.parse(s3.slice(s3.indexOf("\r\n\r\n") + 4));
} catch (e4) {
if (!n3) {
throw e4;
}
}
if (n3 && false === n3.hasNext) {
break;
}
}
if (n3 && false !== n3.hasNext) {
yield {
hasNext: false
};
}
}(s2, n2);
} else if (/text\/event-stream/i.test(s2)) {
i2 = async function* parseEventStream(e3) {
var r3;
for await (var t3 of split(streamBody(e3), "\n\n")) {
var a3 = t3.match(m);
if (a3) {
var o3 = a3[1];
try {
yield r3 = JSON.parse(o3);
} catch (e4) {
if (!r3) {
throw e4;
}
}
if (r3 && false === r3.hasNext) {
break;
}
}
}
if (r3 && false !== r3.hasNext) {
yield {
hasNext: false
};
}
}(n2);
} else if (!/text\//i.test(s2)) {
i2 = async function* parseJSON(e3) {
yield JSON.parse(await e3.text());
}(n2);
} else {
i2 = async function* parseMaybeJSON(e3) {
var r3 = await e3.text();
try {
var t3 = JSON.parse(r3);
if (false)
;
yield t3;
} catch (e4) {
throw new Error(r3);
}
}(n2);
}
var f2;
for await (var l2 of i2) {
if (l2.pending && !o2) {
f2 = l2.pending;
} else if (l2.pending) {
f2 = [...f2, ...l2.pending];
}
o2 = o2 ? mergeResultPatch(o2, l2, n2, f2) : makeResult(e2, l2, n2);
a2 = false;
yield o2;
a2 = true;
}
if (!o2) {
yield o2 = makeResult(e2, {}, n2);
}
} catch (r3) {
if (!a2) {
throw r3;
}
yield makeErrorResult(e2, n2 && (n2.status < 200 || n2.status >= 300) && n2.statusText ? new Error(n2.statusText) : r3, n2);
}
}
function makeFetchSource(e2, r2, t2) {
var a2;
if ("undefined" != typeof AbortController) {
t2.signal = (a2 = new AbortController()).signal;
}
return onEnd(() => {
if (a2) {
a2.abort();
}
})(filter((e3) => !!e3)(fromAsyncIterable(fetchOperation(e2, r2, t2))));
}
var collectTypes = (e2, r2) => {
if (Array.isArray(e2)) {
for (var t2 of e2) {
collectTypes(t2, r2);
}
} else if ("object" == typeof e2 && null !== e2) {
for (var n2 in e2) {
if ("__typename" === n2 && "string" == typeof e2[n2]) {
r2.add(e2[n2]);
} else {
collectTypes(e2[n2], r2);
}
}
}
return r2;
};
var formatNode = (r2) => {
if ("definitions" in r2) {
var t2 = [];
for (var n2 of r2.definitions) {
var a2 = formatNode(n2);
t2.push(a2);
}
return {
...r2,
definitions: t2
};
}
if ("directives" in r2 && r2.directives && r2.directives.length) {
var o2 = [];
var i2 = {};
for (var s2 of r2.directives) {
var c2 = s2.name.value;
if ("_" !== c2[0]) {
o2.push(s2);
} else {
c2 = c2.slice(1);
}
i2[c2] = s2;
}
r2 = {
...r2,
directives: o2,
_directives: i2
};
}
if ("selectionSet" in r2) {
var u2 = [];
var p2 = r2.kind === e$1.OPERATION_DEFINITION;
if (r2.selectionSet) {
for (var d2 of r2.selectionSet.selections || []) {
p2 = p2 || d2.kind === e$1.FIELD && "__typename" === d2.name.value && !d2.alias;
var v2 = formatNode(d2);
u2.push(v2);
}
if (!p2) {
u2.push({
kind: e$1.FIELD,
name: {
kind: e$1.NAME,
value: "__typename"
},
_generated: true
});
}
return {
...r2,
selectionSet: {
...r2.selectionSet,
selections: u2
}
};
}
}
return r2;
};
var I = /* @__PURE__ */ new Map();
var formatDocument = (e2) => {
var t2 = keyDocument(e2);
var n2 = I.get(t2.__key);
if (!n2) {
I.set(t2.__key, n2 = formatNode(t2));
Object.defineProperty(n2, "__key", {
value: t2.__key,
enumerable: false
});
}
return n2;
};
function withPromise(e2) {
var source$ = (r2) => e2(r2);
source$.toPromise = () => toPromise(take(1)(filter((e3) => !e3.stale && !e3.hasNext)(source$)));
source$.then = (e3, r2) => source$.toPromise().then(e3, r2);
source$.subscribe = (e3) => subscribe$1(e3)(source$);
return source$;
}
function makeOperation(e2, r2, t2) {
return {
...r2,
kind: e2,
context: r2.context ? {
...r2.context,
...t2
} : t2 || r2.context
};
}
var noop$1 = () => {
};
function gql(n2) {
var a2 = /* @__PURE__ */ new Map();
var o2 = [];
var i2 = [];
var s2 = Array.isArray(n2) ? n2[0] : n2 || "";
for (var c2 = 1; c2 < arguments.length; c2++) {
var u2 = arguments[c2];
if (u2 && u2.definitions) {
i2.push(u2);
} else {
s2 += u2;
}
s2 += arguments[0][c2];
}
i2.unshift(keyDocument(s2));
for (var p2 of i2) {
for (var d2 of p2.definitions) {
if (d2.kind === e$1.FRAGMENT_DEFINITION) {
var v2 = d2.name.value;
var f2 = stringifyDocument(d2);
if (!a2.has(v2)) {
a2.set(v2, f2);
o2.push(d2);
}
} else {
o2.push(d2);
}
}
}
return keyDocument({
kind: e$1.DOCUMENT,
definitions: o2
});
}
var shouldSkip = ({ kind: e2 }) => "mutation" !== e2 && "query" !== e2;
var mapTypeNames = (e2) => {
var r2 = formatDocument(e2.query);
if (r2 !== e2.query) {
var t2 = makeOperation(e2.kind, e2);
t2.query = r2;
return t2;
} else {
return e2;
}
};
var cacheExchange = ({ forward: e2, client: r2, dispatchDebug: t2 }) => {
var a2 = /* @__PURE__ */ new Map();
var o2 = /* @__PURE__ */ new Map();
var isOperationCached = (e3) => "query" === e3.kind && "network-only" !== e3.context.requestPolicy && ("cache-only" === e3.context.requestPolicy || a2.has(e3.key));
return (i2) => {
var s2 = map((e3) => {
var o3 = a2.get(e3.key);
var i3 = o3 || makeResult(e3, {
data: null
});
i3 = {
...i3,
operation: e3
};
if ("cache-and-network" === e3.context.requestPolicy) {
i3.stale = true;
reexecuteOperation(r2, e3);
}
return i3;
})(filter((e3) => !shouldSkip(e3) && isOperationCached(e3))(i2));
var c2 = onPush((e3) => {
var { operation: n2 } = e3;
if (!n2) {
return;
}
var i3 = n2.context.additionalTypenames || [];
if ("subscription" !== e3.operation.kind) {
i3 = ((e4) => [...collectTypes(e4, /* @__PURE__ */ new Set())])(e3.data).concat(i3);
}
if ("mutation" === e3.operation.kind || "subscription" === e3.operation.kind) {
var s3 = /* @__PURE__ */ new Set();
for (var c3 = 0; c3 < i3.length; c3++) {
var u2 = i3[c3];
var p2 = o2.get(u2);
if (!p2) {
o2.set(u2, p2 = /* @__PURE__ */ new Set());
}
for (var d2 of p2.values()) {
s3.add(d2);
}
p2.clear();
}
for (var v2 of s3.values()) {
if (a2.has(v2)) {
n2 = a2.get(v2).operation;
a2.delete(v2);
reexecuteOperation(r2, n2);
}
}
} else if ("query" === n2.kind && e3.data) {
a2.set(n2.key, e3);
for (var f2 = 0; f2 < i3.length; f2++) {
var l2 = i3[f2];
var h2 = o2.get(l2);
if (!h2) {
o2.set(l2, h2 = /* @__PURE__ */ new Set());
}
h2.add(n2.key);
}
}
})(e2(filter((e3) => "query" !== e3.kind || "cache-only" !== e3.context.requestPolicy)(map((e3) => e3)(merge([map(mapTypeNames)(filter((e3) => !shouldSkip(e3) && !isOperationCached(e3))(i2)), filter((e3) => shouldSkip(e3))(i2)])))));
return merge([s2, c2]);
};
};
var reexecuteOperation = (e2, r2) => e2.reexecuteOperation(makeOperation(r2.kind, r2, {
requestPolicy: "network-only"
}));
var fetchExchange = ({ forward: e2, dispatchDebug: r2 }) => (t2) => {
var n2 = mergeMap((e3) => {
var n3 = makeFetchBody(e3);
var a3 = makeFetchURL(e3, n3);
var i2 = makeFetchOptions(e3, n3);
var s2 = takeUntil(filter((r3) => "teardown" === r3.kind && r3.key === e3.key)(t2))(makeFetchSource(e3, a3, i2));
return s2;
})(filter((e3) => "teardown" !== e3.kind && ("subscription" !== e3.kind || !!e3.context.fetchSubscriptions))(t2));
var a2 = e2(filter((e3) => "teardown" === e3.kind || "subscription" === e3.kind && !e3.context.fetchSubscriptions)(t2));
return merge([n2, a2]);
};
var composeExchanges = (e2) => ({ client: r2, forward: t2, dispatchDebug: n2 }) => e2.reduceRight((e3, t3) => {
return t3({
client: r2,
forward(r3) {
return share(e3(share(r3)));
},
dispatchDebug(e4) {
}
});
}, t2);
var fallbackExchange = ({ dispatchDebug: e2 }) => (r2) => {
return filter((e3) => false)(r2);
};
var C = function Client(e2) {
var r2 = 0;
var t2 = /* @__PURE__ */ new Map();
var n2 = /* @__PURE__ */ new Map();
var a2 = /* @__PURE__ */ new Set();
var o2 = [];
var i2 = {
url: e2.url,
fetchSubscriptions: e2.fetchSubscriptions,
fetchOptions: e2.fetchOptions,
fetch: e2.fetch,
preferGetMethod: e2.preferGetMethod,
requestPolicy: e2.requestPolicy || "cache-first"
};
var s2 = makeSubject();
function nextOperation(e3) {
if ("mutation" === e3.kind || "teardown" === e3.kind || !a2.has(e3.key)) {
if ("teardown" === e3.kind) {
a2.delete(e3.key);
} else if ("mutation" !== e3.kind) {
a2.add(e3.key);
}
s2.next(e3);
}
}
var c2 = false;
function dispatchOperation(e3) {
if (e3) {
nextOperation(e3);
}
if (!c2) {
c2 = true;
while (c2 && (e3 = o2.shift())) {
nextOperation(e3);
}
c2 = false;
}
}
var makeResultSource = (e3) => {
var r3 = takeUntil(filter((r4) => "teardown" === r4.kind && r4.key === e3.key)(s2.source))(filter((r4) => r4.operation.kind === e3.kind && r4.operation.key === e3.key && (!r4.operation.context._instance || r4.operation.context._instance === e3.context._instance))(O2));
if ("query" !== e3.kind) {
r3 = takeWhile((e4) => !!e4.hasNext, true)(r3);
} else {
r3 = switchMap((r4) => {
var t3 = fromValue(r4);
return r4.stale || r4.hasNext ? t3 : merge([t3, map(() => {
r4.stale = true;
return r4;
})(take(1)(filter((r5) => r5.key === e3.key)(s2.source)))]);
})(r3);
}
if ("mutation" !== e3.kind) {
r3 = onEnd(() => {
a2.delete(e3.key);
t2.delete(e3.key);
n2.delete(e3.key);
c2 = false;
for (var r4 = o2.length - 1; r4 >= 0; r4--) {
if (o2[r4].key === e3.key) {
o2.splice(r4, 1);
}
}
nextOperation(makeOperation("teardown", e3, e3.context));
})(onPush((r4) => {
if (r4.stale) {
for (var n3 of o2) {
if (n3.key === r4.operation.key) {
a2.delete(n3.key);
break;
}
}
} else if (!r4.hasNext) {
a2.delete(e3.key);
}
t2.set(e3.key, r4);
})(r3));
} else {
r3 = onStart(() => {
nextOperation(e3);
})(r3);
}
return share(r3);
};
var u2 = this instanceof Client ? this : Object.create(Client.prototype);
var p2 = Object.assign(u2, {
suspense: !!e2.suspense,
operations$: s2.source,
reexecuteOperation(e3) {
if ("teardown" === e3.kind) {
dispatchOperation(e3);
} else if ("mutation" === e3.kind || n2.has(e3.key)) {
var r3 = false;
for (var t3 = 0; t3 < o2.length; t3++) {
r3 = r3 || o2[t3].key === e3.key;
}
if (!r3) {
a2.delete(e3.key);
}
o2.push(e3);
Promise.resolve().then(dispatchOperation);
}
},
createRequestOperation(e3, t3, n3) {
if (!n3) {
n3 = {};
}
return makeOperation(e3, t3, {
_instance: "mutation" === e3 ? r2 = r2 + 1 | 0 : void 0,
...i2,
...n3,
requestPolicy: n3.requestPolicy || i2.requestPolicy,
suspense: n3.suspense || false !== n3.suspense && p2.suspense
});
},
executeRequestOperation(e3) {
if ("mutation" === e3.kind) {
return withPromise(makeResultSource(e3));
}
return withPromise(lazy(() => {
var r3 = n2.get(e3.key);
if (!r3) {
n2.set(e3.key, r3 = makeResultSource(e3));
}
r3 = onStart(() => {
dispatchOperation(e3);
})(r3);
var a3 = t2.get(e3.key);
if ("query" === e3.kind && a3 && (a3.stale || a3.hasNext)) {
return switchMap(fromValue)(merge([r3, filter((r4) => r4 === t2.get(e3.key))(fromValue(a3))]));
} else {
return r3;
}
}));
},
executeQuery(e3, r3) {
var t3 = p2.createRequestOperation("query", e3, r3);
return p2.executeRequestOperation(t3);
},
executeSubscription(e3, r3) {
var t3 = p2.createRequestOperation("subscription", e3, r3);
return p2.executeRequestOperation(t3);
},
executeMutation(e3, r3) {
var t3 = p2.createRequestOperation("mutation", e3, r3);
return p2.executeRequestOperation(t3);
},
readQuery(e3, r3, t3) {
var n3 = null;
subscribe$1((e4) => {
n3 = e4;
})(p2.query(e3, r3, t3)).unsubscribe();
return n3;
},
query: (e3, r3, t3) => p2.executeQuery(createRequest(e3, r3), t3),
subscription: (e3, r3, t3) => p2.executeSubscription(createRequest(e3, r3), t3),
mutation: (e3, r3, t3) => p2.executeMutation(createRequest(e3, r3), t3)
});
var d2 = noop$1;
var w2 = composeExchanges(e2.exchanges);
var O2 = share(w2({
client: p2,
dispatchDebug: d2,
forward: fallbackExchange({
dispatchDebug: d2
})
})(s2.source));
publish(O2);
return p2;
};
function noop() {
}
function run(fn) {
return fn();
}
function blank_object() {
return /* @__PURE__ */ Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === "function";
}
function safe_not_equal(a2, b) {
return a2 != a2 ? b == b : a2 !== b || a2 && typeof a2 === "object" || typeof a2 === "function";
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function subscribe(store, ...callbacks) {
if (store == null) {
for (const callback of callbacks) {
callback(void 0);
}
return noop;
}
const unsub = store.subscribe(...callbacks);
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
}
function component_subscribe(component, store, callback) {
component.$$.on_destroy.push(subscribe(store, callback));
}
function append(target, node) {
target.appendChild(node);
}
function insert(target, node, anchor) {
target.insertBefore(node, anchor || null);
}
function detach(node) {
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
function destroy_each(iterations, detaching) {
for (let i2 = 0; i2 < iterations.length; i2 += 1) {
if (iterations[i2])
iterations[i2].d(detaching);
}
}
function element(name) {
return document.createElement(name);
}
function text(data) {
return document.createTextNode(data);
}
function space() {
return text(" ");
}
function empty() {
return text("");
}
function attr(node, attribute, value2) {
if (value2 == null)
node.removeAttribute(attribute);
else if (node.getAttribute(attribute) !== value2)
node.setAttribute(attribute, value2);
}
function children(element2) {
return Array.from(element2.childNodes);
}
function set_data(text2, data) {
data = "" + data;
if (text2.data === data)
return;
text2.data = /** @type {string} */
data;
}
let current_component;
function set_current_component(component) {
current_component = component;
}
function get_current_component() {
if (!current_component)
throw new Error("Function called outside component initialization");
return current_component;
}
function setContext(key, context) {
get_current_component().$$.context.set(key, context);
return context;
}
const dirty_components = [];
const binding_callbacks = [];
let render_callbacks = [];
const flush_callbacks = [];
const resolved_promise = /* @__PURE__ */ Promise.resolve();
let update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
const seen_callbacks = /* @__PURE__ */ new Set();
let flushidx = 0;
function flush() {
if (flushidx !== 0) {
return;
}
const saved_component = current_component;
do {
try {
while (flushidx < dirty_components.length) {
const component = dirty_components[flushidx];
flushidx++;
set_current_component(component);
update(component.$$);
}
} catch (e2) {
dirty_components.length = 0;
flushidx = 0;
throw e2;
}
set_current_component(null);
dirty_components.length = 0;
flushidx = 0;
while (binding_callbacks.length)
binding_callbacks.pop()();
for (let i2 = 0; i2 < render_callbacks.length; i2 += 1) {
const callback = render_callbacks[i2];
if (!seen_callbacks.has(callback)) {
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
seen_callbacks.clear();
set_current_component(saved_component);
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
const dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
function flush_render_callbacks(fns) {
const filtered = [];
const targets = [];
render_callbacks.forEach((c2) => fns.indexOf(c2) === -1 ? filtered.push(c2) : targets.push(c2));
targets.forEach((c2) => c2());
render_callbacks = filtered;
}
const outroing = /* @__PURE__ */ new Set();
let outros;
function group_outros() {
outros = {
r: 0,
c: [],
p: outros
// parent group
};
}
function check_outros() {
if (!outros.r) {
run_all(outros.c);
}
outros = outros.p;
}
function transition_in(block, local) {
if (block && block.i) {
outroing.delete(block);
block.i(local);
}
}
function transition_out(block, local, detach2, callback) {
if (block && block.o) {
if (outroing.has(block))
return;
outroing.add(block);
outros.c.push(() => {
outroing.delete(block);
if (callback) {
if (detach2)
block.d(1);
callback();
}
});
block.o(local);
} else if (callback) {
callback();
}
}
function ensure_array_like(array_like_or_iterator) {
return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
}
function create_component(block) {
block && block.c();
}
function mount_component(component, target, anchor) {
const { fragment, after_update } = component.$$;
fragment && fragment.m(target, anchor);
add_render_callback(() => {
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
if (component.$$.on_destroy) {
component.$$.on_destroy.push(...new_on_destroy);
} else {
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
const $$ = component.$$;
if ($$.fragment !== null) {
flush_render_callbacks($$.after_update);
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching);
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i2) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[i2 / 31 | 0] |= 1 << i2 % 31;
}
function init(component, options, instance2, create_fragment2, not_equal, props, append_styles = null, dirty = [-1]) {
const parent_component = current_component;
set_current_component(component);
const $$ = component.$$ = {
fragment: null,
ctx: [],
// state
props,
update: noop,
not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
on_disconnect: [],
before_update: [],
after_update: [],
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
// everything else
callbacks: blank_object(),
dirty,
skip_bound: false,
root: options.target || parent_component.$$.root
};
append_styles && append_styles($$.root);
let ready = false;
$$.ctx = instance2 ? instance2(component, options.props || {}, (i2, ret, ...rest) => {
const value2 = rest.length ? rest[0] : ret;
if ($$.ctx && not_equal($$.ctx[i2], $$.ctx[i2] = value2)) {
if (!$$.skip_bound && $$.bound[i2])
$$.bound[i2](value2);
if (ready)
make_dirty(component, i2);
}
return ret;
}) : [];
$$.update();
ready = true;
run_all($$.before_update);
$$.fragment = create_fragment2 ? create_fragment2($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
const nodes = children(options.target);
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
} else {
$$.fragment && $$.fragment.c();
}
if (options.intro)
transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
class SvelteComponent {
constructor() {
/**
* ### PRIVATE API
*
* Do not use, may change at any time
*
* @type {any}
*/
__publicField(this, "$$");
/**
* ### PRIVATE API
*
* Do not use, may change at any time
*
* @type {any}
*/
__publicField(this, "$$set");
}
/** @returns {void} */
$destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
/**
* @template {Extract<keyof Events, string>} K
* @param {K} type
* @param {((e: Events[K]) => void) | null | undefined} callback
* @returns {() => void}
*/
$on(type2, callback) {
if (!is_function(callback)) {
return noop;
}
const callbacks = this.$$.callbacks[type2] || (this.$$.callbacks[type2] = []);
callbacks.push(callback);
return () => {
const index = callbacks.indexOf(callback);
if (index !== -1)
callbacks.splice(index, 1);
};
}
/**
* @param {Partial<Props>} props
* @returns {void}
*/
$set(props) {
if (this.$$set && !is_empty(props)) {
this.$$.skip_bound = true;
this.$$set(props);
this.$$.skip_bound = false;
}
}
}
const PUBLIC_VERSION = "4";
const subscriber_queue = [];
function readable(value2, start2) {
return {
subscribe: writable(value2, start2).subscribe
};
}
function writable(value2, start2 = noop) {
let stop;
const subscribers = /* @__PURE__ */ new Set();
function set(new_value) {
if (safe_not_equal(value2, new_value)) {
value2 = new_value;
if (stop) {
const run_queue = !subscriber_queue.length;
for (const subscriber of subscribers) {
subscriber[1]();
subscriber_queue.push(subscriber, value2);
}
if (run_queue) {
for (let i2 = 0; i2 < subscriber_queue.length; i2 += 2) {
subscriber_queue[i2][0](subscriber_queue[i2 + 1]);
}
subscriber_queue.length = 0;
}
}
}
}
function update2(fn) {
set(fn(value2));
}
function subscribe2(run2, invalidate = noop) {
const subscriber = [run2, invalidate];
subscribers.add(subscriber);
if (subscribers.size === 1) {
stop = start2(set, update2) || noop;
}
run2(value2);
return () => {
subscribers.delete(subscriber);
if (subscribers.size === 0 && stop) {
stop();
stop = null;
}
};
}
return { set, update: update2, subscribe: subscribe2 };
}
function derived(stores, fn, initial_value) {
const single = !Array.isArray(stores);
const stores_array = single ? [stores] : stores;
if (!stores_array.every(Boolean)) {
throw new Error("derived() expects stores as input, got a falsy value");
}
const auto = fn.length < 2;
return readable(initial_value, (set, update2) => {
let started = false;
const values = [];
let pending = 0;
let cleanup = noop;
const sync = () => {
if (pending) {
return;
}
cleanup();
const result = fn(single ? values[0] : values, set, update2);
if (auto) {
set(result);
} else {
cleanup = is_function(result) ? result : noop;
}
};
const unsubscribers = stores_array.map(
(store, i2) => subscribe(
store,
(value2) => {
values[i2] = value2;
pending &= ~(1 << i2);
if (started) {
sync();
}
},
() => {
pending |= 1 << i2;
}
)
);
started = true;
sync();
return function stop() {
run_all(unsubscribers);
cleanup();
started = false;
};
});
}
var fromStore = (e2) => make((t2) => e2.subscribe(t2.next));
var d = {
operation: void 0,
fetching: false,
data: void 0,
error: void 0,
extensions: void 0,
hasNext: false,
stale: false
};
var createPausable = (e2) => ({
isPaused$: e2,
pause() {
e2.set(true);
},
resume() {
e2.set(false);
}
});
function queryStore(t2) {
var r2 = createRequest(t2.query, t2.variables);
var p2 = {
requestPolicy: t2.requestPolicy,
...t2.context
};
var f2 = t2.client.createRequestOperation("query", r2, p2);
var x2 = writable(f2);
var q = {
...d,
operation: f2
};
var b = writable(!!t2.pause);
var m2 = writable(q, () => subscribe$1((e2) => {
m2.set(e2);
})(scan((e2, t3) => ({
...e2,
...t3
}), q)(switchMap((e2) => {
if (e2) {
return never;
}
return switchMap((e3) => concat([fromValue({
fetching: true,
stale: false
}), map(({ stale: e4, data: t3, error: r3, extensions: a2, operation: o2 }) => ({
fetching: false,
stale: !!e4,
data: t3,
error: r3,
operation: o2,
extensions: a2
}))(t2.client.executeRequestOperation(e3)), fromValue({
fetching: false
})]))(fromStore(x2));
})(fromStore(b)))).unsubscribe);
return {
...derived(m2, (e2, t3) => {
t3(e2);
}),
...createPausable(b),
reexecute: (e2) => {
var a2 = {
...e2,
...t2.context
};
var o2 = t2.client.createRequestOperation("query", r2, a2);
b.set(false);
x2.set(o2);
}
};
}
var x = "$$_urql";
var setContextClient = (e2) => {
setContext(x, e2);
};
if (typeof window !== "undefined")
(window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION);
const OapApplicationFormQuery = gql`
query ($contentItemId: ID!) {
oapApplicationForm(where: { contentItemId: $contentItemId }) {
list {
contentItems {
displayText
contentType
contentItemId
... on OapApplicationFormStep {
htmlBody {
html
}
flow {
widgets {
contentType
... on Form {
displayText
modifiedUtc
form {
action
method
}
formElement {
id
}
flow {
widgets {
contentType
}
}
}
}
}
}
}
}
displayText
contentItemId
}
}
`;
function create_fragment$3(ctx) {
let div;
let t_value = (
/*content*/
ctx[0].html + ""
);
let t2;
return {
c() {
div = element("div");
t2 = text(t_value);
attr(div, "class", "richtext");
},
m(target, anchor) {
insert(target, div, anchor);
append(div, t2);
},
p(ctx2, [dirty]) {
if (dirty & /*content*/
1 && t_value !== (t_value = /*content*/
ctx2[0].html + ""))
set_data(t2, t_value);
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(div);
}
}
};
}
function instance$3($$self, $$props, $$invalidate) {
let { content } = $$props;
$$self.$$set = ($$props2) => {
if ("content" in $$props2)
$$invalidate(0, content = $$props2.content);
};
return [content];
}
class RichText extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$3, create_fragment$3, safe_not_equal, { content: 0 });
}
}
function get_each_context(ctx, list, i2) {
const child_ctx = ctx.slice();
child_ctx[1] = list[i2];
return child_ctx;
}
function create_each_block(ctx) {
let p2;
let t0;
let t1_value = (
/*widget*/
ctx[1].contentType + ""
);
let t1;
return {
c() {
p2 = element("p");
t0 = text("a widget: ");
t1 = text(t1_value);
},
m(target, anchor) {
insert(target, p2, anchor);
append(p2, t0);
append(p2, t1);
},
p(ctx2, dirty) {
if (dirty & /*widgets*/
1 && t1_value !== (t1_value = /*widget*/
ctx2[1].contentType + ""))
set_data(t1, t1_value);
},
d(detaching) {
if (detaching) {
detach(p2);
}
}
};
}
function create_fragment$2(ctx) {
let each_1_anchor;
let each_value = ensure_array_like(
/*widgets*/
ctx[0]
);
let each_blocks = [];
for (let i2 = 0; i2 < each_value.length; i2 += 1) {
each_blocks[i2] = create_each_block(get_each_context(ctx, each_value, i2));
}
return {
c() {
for (let i2 = 0; i2 < each_blocks.length; i2 += 1) {
each_blocks[i2].c();
}
each_1_anchor = empty();
},
m(target, anchor) {
for (let i2 = 0; i2 < each_blocks.length; i2 += 1) {
if (each_blocks[i2]) {
each_blocks[i2].m(target, anchor);
}
}
insert(target, each_1_anchor, anchor);
},
p(ctx2, [dirty]) {
if (dirty & /*widgets*/
1) {
each_value = ensure_array_like(
/*widgets*/
ctx2[0]
);
let i2;
for (i2 = 0; i2 < each_value.length; i2 += 1) {
const child_ctx = get_each_context(ctx2, each_value, i2);
if (each_blocks[i2]) {
each_blocks[i2].p(child_ctx, dirty);
} else {
each_blocks[i2] = create_each_block(child_ctx);
each_blocks[i2].c();
each_blocks[i2].m(each_1_anchor.parentNode, each_1_anchor);
}
}
for (; i2 < each_blocks.length; i2 += 1) {
each_blocks[i2].d(1);
}
each_blocks.length = each_value.length;
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(each_1_anchor);
}
destroy_each(each_blocks, detaching);
}
};
}
function instance$2($$self, $$props, $$invalidate) {
let { widgets } = $$props;
$$self.$$set = ($$props2) => {
if ("widgets" in $$props2)
$$invalidate(0, widgets = $$props2.widgets);
};
return [widgets];
}
class FlowPart extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$2, create_fragment$2, safe_not_equal, { widgets: 0 });
}
}
function create_fragment$1(ctx) {
let h2;
let t0_value = (
/*content*/
ctx[0].displayText + ""
);
let t0;
let t1;
let div;
let richtext;
let t2;
let flowpart;
let current;
richtext = new RichText({
props: { content: (
/*content*/
ctx[0].html
) }
});
flowpart = new FlowPart({
props: { widgets: (
/*content*/
ctx[0].flow.widgets
) }
});
return {
c() {
h2 = element("h2");
t0 = text(t0_value);
t1 = space();
div = element("div");
create_component(richtext.$$.fragment);
t2 = space();
create_component(flowpart.$$.fragment);
attr(h2, "class", "text-lg font-bold");
attr(div, "class", "mt-2 mb-6");
},
m(target, anchor) {
insert(target, h2, anchor);
append(h2, t0);
insert(target, t1, anchor);
insert(target, div, anchor);
mount_component(richtext, div, null);
insert(target, t2, anchor);
mount_component(flowpart, target, anchor);
current = true;
},
p(ctx2, [dirty]) {
if ((!current || dirty & /*content*/
1) && t0_value !== (t0_value = /*content*/
ctx2[0].displayText + ""))
set_data(t0, t0_value);
const richtext_changes = {};
if (dirty & /*content*/
1)
richtext_changes.content = /*content*/
ctx2[0].html;
richtext.$set(richtext_changes);
const flowpart_changes = {};
if (dirty & /*content*/
1)
flowpart_changes.widgets = /*content*/
ctx2[0].flow.widgets;
flowpart.$set(flowpart_changes);
},
i(local) {
if (current)
return;
transition_in(richtext.$$.fragment, local);
transition_in(flowpart.$$.fragment, local);
current = true;
},
o(local) {
transition_out(richtext.$$.fragment, local);
transition_out(flowpart.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching) {
detach(h2);
detach(t1);
detach(div);
detach(t2);
}
destroy_component(richtext);
destroy_component(flowpart, detaching);
}
};
}
function instance$1($$self, $$props, $$invalidate) {
let { content } = $$props;
$$self.$$set = ($$props2) => {
if ("content" in $$props2)
$$invalidate(0, content = $$props2.content);
};
return [content];
}
class OapApplicationFormStep extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$1, create_fragment$1, safe_not_equal, { content: 0 });
}
}
function create_else_block(ctx) {
let oapapplicationformstep;
let current;
oapapplicationformstep = new OapApplicationFormStep({
props: {
content: (
/*$content*/
ctx[0].data.oapApplicationForm[0].list.contentItems[0]
)
}
});
return {
c() {
create_component(oapapplicationformstep.$$.fragment);
},
m(target, anchor) {
mount_component(oapapplicationformstep, target, anchor);
current = true;
},
p(ctx2, dirty) {
const oapapplicationformstep_changes = {};
if (dirty & /*$content*/
1)
oapapplicationformstep_changes.content = /*$content*/
ctx2[0].data.oapApplicationForm[0].list.contentItems[0];
oapapplicationformstep.$set(oapapplicationformstep_changes);
},
i(local) {
if (current)
return;
transition_in(oapapplicationformstep.$$.fragment, local);
current = true;
},
o(local) {
transition_out(oapapplicationformstep.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(oapapplicationformstep, detaching);
}
};
}
function create_if_block_3(ctx) {
let p2;
return {
c() {
p2 = element("p");
p2.textContent = "Content is not an application from step??";
},
m(target, anchor) {
insert(target, p2, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(p2);
}
}
};
}
function create_if_block_2(ctx) {
let p2;
return {
c() {
p2 = element("p");
p2.textContent = "No content data??";
},
m(target, anchor) {
insert(target, p2, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(p2);
}
}
};
}
function create_if_block_1(ctx) {
let p2;
let t0;
let t1_value = (
/*$content*/
ctx[0].error.message + ""
);
let t1;
return {
c() {
p2 = element("p");
t0 = text("Oh no... ");
t1 = text(t1_value);
},
m(target, anchor) {
insert(target, p2, anchor);
append(p2, t0);
append(p2, t1);
},
p(ctx2, dirty) {
if (dirty & /*$content*/
1 && t1_value !== (t1_value = /*$content*/
ctx2[0].error.message + ""))
set_data(t1, t1_value);
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(p2);
}
}
};
}
function create_if_block(ctx) {
let p2;
return {
c() {
p2 = element("p");
p2.textContent = "Loading...";
},
m(target, anchor) {
insert(target, p2, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(p2);
}
}
};
}
function create_fragment(ctx) {
let div;
let current_block_type_index;
let if_block;
let current;
const if_block_creators = [
create_if_block,
create_if_block_1,
create_if_block_2,
create_if_block_3,
create_else_block
];
const if_blocks = [];
function select_block_type(ctx2, dirty) {
if (
/*$content*/
ctx2[0].fetching
)
return 0;
if (
/*$content*/
ctx2[0].error
)
return 1;
if (!/*$content*/
ctx2[0].data)
return 2;
if (
/*$content*/
ctx2[0].data.oapApplicationForm[0].list.contentItems[0].contentType != "OapApplicationFormStep"
)
return 3;
return 4;
}
current_block_type_index = select_block_type(ctx);
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
return {
c() {
div = element("div");
if_block.c();
},
m(target, anchor) {
insert(target, div, anchor);
if_blocks[current_block_type_index].m(div, null);
current = true;
},
p(ctx2, [dirty]) {
let previous_block_index = current_block_type_index;
current_block_type_index = select_block_type(ctx2);
if (current_block_type_index === previous_block_index) {
if_blocks[current_block_type_index].p(ctx2, dirty);
} else {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
if_block.c();
} else {
if_block.p(ctx2, dirty);
}
transition_in(if_block, 1);
if_block.m(div, null);
}
},
i(local) {
if (current)
return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if (detaching) {
detach(div);
}
if_blocks[current_block_type_index].d();
}
};
}
function instance($$self, $$props, $$invalidate) {
let $content;
let { contentItemId } = $$props;
let { client: client2 } = $$props;
setContextClient(client2);
const content = queryStore({
client: client2,
query: OapApplicationFormQuery,
variables: { contentItemId }
});
component_subscribe($$self, content, (value2) => $$invalidate(0, $content = value2));
$$self.$$set = ($$props2) => {
if ("contentItemId" in $$props2)
$$invalidate(2, contentItemId = $$props2.contentItemId);
if ("client" in $$props2)
$$invalidate(3, client2 = $$props2.client);
};
return [$content, content, contentItemId, client2];
}
class OapApplicationForm extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { contentItemId: 2, client: 3 });
}
}
const client = new C({
url: "https://localhost:5001/oap/api/graphql",
exchanges: [cacheExchange, fetchExchange]
});
var oapApplicationForms = document.getElementsByClassName("OapApplicationForm");
if (oapApplicationForms.length === 1) {
new OapApplicationForm({
target: oapApplicationForms[0],
props: {
contentItemId: oapApplicationForms[0].id,
client
}
});
}