cotomy 0.1.7 → 0.1.9
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.
- package/README.md +15 -12
- package/dist/api.d.ts +1 -1
- package/dist/debug.d.ts +15 -0
- package/dist/form.d.ts +16 -4
- package/dist/index.d.ts +1 -22
- package/dist/index.js +1 -1
- package/dist/view.d.ts +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,18 +20,21 @@ The core of Cotomy is `CotomyElement`, which is constructed as a wrapper for `El
|
|
|
20
20
|
By passing HTML and CSS strings to the constructor, it is possible to generate Element designs with a limited scope.
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
const ce = new CotomyElement({
|
|
24
|
+
html: /* html */`
|
|
25
|
+
<div>
|
|
26
|
+
<p>Text</p>
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
css: /* css */`
|
|
30
|
+
[scope] {
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
[scope] > p {
|
|
34
|
+
text-align: center;
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
});
|
|
35
38
|
```
|
|
36
39
|
|
|
37
40
|
## License
|
package/dist/api.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class CotomyViewRenderer {
|
|
|
31
31
|
protected get currency(): string;
|
|
32
32
|
renderer(type: string, callback: (element: CotomyElement, value: any) => void): this;
|
|
33
33
|
get builded(): boolean;
|
|
34
|
-
build(): this;
|
|
34
|
+
protected build(): this;
|
|
35
35
|
applyAsync(respose: CotomyRestApiResponse): Promise<this>;
|
|
36
36
|
}
|
|
37
37
|
export interface ICotomyRestApiOptions {
|
package/dist/debug.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum CotomyDebugFeature {
|
|
2
|
+
Api = "api",
|
|
3
|
+
Fill = "fill",
|
|
4
|
+
Bind = "bind",
|
|
5
|
+
FormData = "formdata"
|
|
6
|
+
}
|
|
7
|
+
export declare class CotomyDebugSettings {
|
|
8
|
+
private static readonly PREFIX;
|
|
9
|
+
static isEnabled(key?: string | CotomyDebugFeature): boolean;
|
|
10
|
+
static enable(key: string | CotomyDebugFeature): void;
|
|
11
|
+
static disable(key: string | CotomyDebugFeature): void;
|
|
12
|
+
static enableAll(): void;
|
|
13
|
+
static disableAll(): void;
|
|
14
|
+
static clear(key?: string | CotomyDebugFeature): void;
|
|
15
|
+
}
|
package/dist/form.d.ts
CHANGED
|
@@ -5,7 +5,10 @@ export declare class CotomyActionEvent extends Event {
|
|
|
5
5
|
constructor(action: string);
|
|
6
6
|
}
|
|
7
7
|
export declare abstract class CotomyFormBase extends CotomyElement {
|
|
8
|
-
constructor(element:
|
|
8
|
+
constructor(element: HTMLElement | {
|
|
9
|
+
html: string;
|
|
10
|
+
css?: string | null;
|
|
11
|
+
});
|
|
9
12
|
get formId(): string;
|
|
10
13
|
method(): string;
|
|
11
14
|
actionUri(): string;
|
|
@@ -19,14 +22,20 @@ export declare abstract class CotomyFormBase extends CotomyElement {
|
|
|
19
22
|
action(handle: ((event: CotomyActionEvent) => void | Promise<void>) | string): this;
|
|
20
23
|
}
|
|
21
24
|
export declare class CotomyQueryForm extends CotomyFormBase {
|
|
22
|
-
constructor(element:
|
|
25
|
+
constructor(element: HTMLElement | {
|
|
26
|
+
html: string;
|
|
27
|
+
css?: string | null;
|
|
28
|
+
});
|
|
23
29
|
method(): string;
|
|
24
30
|
protected submitAsync(e: Event): Promise<void>;
|
|
25
31
|
}
|
|
26
32
|
export declare class CotomyApiForm extends CotomyFormBase {
|
|
27
33
|
private _apiClient;
|
|
28
34
|
private _unauthorizedHandler;
|
|
29
|
-
constructor(element:
|
|
35
|
+
constructor(element: HTMLElement | {
|
|
36
|
+
html: string;
|
|
37
|
+
css?: string | null;
|
|
38
|
+
});
|
|
30
39
|
apiClient(): CotomyRestApi;
|
|
31
40
|
actionUri(): string;
|
|
32
41
|
get identifier(): string | undefined;
|
|
@@ -42,7 +51,10 @@ export declare class CotomyApiForm extends CotomyFormBase {
|
|
|
42
51
|
}
|
|
43
52
|
export declare class CotomyFillApiForm extends CotomyApiForm {
|
|
44
53
|
private _fillers;
|
|
45
|
-
constructor(element:
|
|
54
|
+
constructor(element: HTMLElement | {
|
|
55
|
+
html: string;
|
|
56
|
+
css?: string | null;
|
|
57
|
+
});
|
|
46
58
|
filler(type: string, callback: (input: CotomyElement, value: any) => void): this;
|
|
47
59
|
build(): this;
|
|
48
60
|
protected submitToApiAsync(formData: globalThis.FormData): Promise<CotomyRestApiResponse>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
import { CotomyInvalidFormDataBodyException, CotomyResponseJsonParseException, CotomyRestApi, CotomyRestApiResponse, CotomyViewRenderer } from "./api";
|
|
2
|
-
import { CotomyActionEvent, CotomyApiForm, CotomyFillApiForm, CotomyFormBase, CotomyQueryForm } from "./form";
|
|
3
|
-
import { CotomyPageController, CotomyUrl } from "./page";
|
|
4
|
-
import { CotomyElement, CotomyMetaElement, CotomyWindow } from "./view";
|
|
5
1
|
export { CotomyInvalidFormDataBodyException, CotomyResponseJsonParseException, CotomyRestApi, CotomyRestApiResponse, CotomyViewRenderer } from "./api";
|
|
2
|
+
export { CotomyDebugFeature, CotomyDebugSettings } from "./debug";
|
|
6
3
|
export { CotomyActionEvent, CotomyApiForm, CotomyFillApiForm, CotomyFormBase, CotomyQueryForm } from "./form";
|
|
7
4
|
export { CotomyPageController, CotomyUrl } from "./page";
|
|
8
5
|
export { CotomyElement, CotomyMetaElement, CotomyWindow } from "./view";
|
|
9
|
-
declare const _default: {
|
|
10
|
-
CotomyInvalidFormDataBodyException: typeof CotomyInvalidFormDataBodyException;
|
|
11
|
-
CotomyResponseJsonParseException: typeof CotomyResponseJsonParseException;
|
|
12
|
-
CotomyRestApi: typeof CotomyRestApi;
|
|
13
|
-
CotomyRestApiResponse: typeof CotomyRestApiResponse;
|
|
14
|
-
CotomyViewRenderer: typeof CotomyViewRenderer;
|
|
15
|
-
CotomyActionEvent: typeof CotomyActionEvent;
|
|
16
|
-
CotomyApiForm: typeof CotomyApiForm;
|
|
17
|
-
CotomyFillApiForm: typeof CotomyFillApiForm;
|
|
18
|
-
CotomyFormBase: typeof CotomyFormBase;
|
|
19
|
-
CotomyQueryForm: typeof CotomyQueryForm;
|
|
20
|
-
CotomyPageController: typeof CotomyPageController;
|
|
21
|
-
CotomyUrl: typeof CotomyUrl;
|
|
22
|
-
CotomyElement: typeof CotomyElement;
|
|
23
|
-
CotomyMetaElement: typeof CotomyMetaElement;
|
|
24
|
-
CotomyWindow: typeof CotomyWindow;
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cotomy=t():e.Cotomy=t()}(this,()=>(()=>{var e={48:e=>{var t,n="undefined"!=typeof window&&(window.crypto||window.msCrypto)||"undefined"!=typeof self&&self.crypto;if(n){var r=Math.pow(2,32)-1;t=function(){return Math.abs(n.getRandomValues(new Uint32Array(1))[0]/r)}}else t=Math.random;e.exports=t},146:(e,t,n)=>{var r=n(473),i="object"==typeof window?window:self,s=Object.keys(i).length,a=r(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+s.toString(36),4);e.exports=function(){return a}},353:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",s="hour",a="day",o="week",l="month",u="quarter",c="year",h="date",d="Invalid Date",E=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},p=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},T={s:p,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+p(r,2,"0")+":"+p(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),s=n-i<0,a=t.clone().add(r+(s?-1:1),l);return+(-(r+(n-i)/(s?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:c,w:o,d:a,D:h,h:s,m:i,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",f={};f[y]=g;var A="$isDayjsObject",_=function(e){return e instanceof O||!(!e||!e[A])},R=function e(t,n,r){var i;if(!t)return y;if("string"==typeof t){var s=t.toLowerCase();f[s]&&(i=s),n&&(f[s]=n,i=s);var a=t.split("-");if(!i&&a.length>1)return e(a[0])}else{var o=t.name;f[o]=t,i=o}return!r&&i&&(y=i),i||!r&&y},S=function(e,t){if(_(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},D=T;D.l=R,D.i=_,D.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function g(e){this.$L=R(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[A]=!0}var p=g.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(E);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===d)},p.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},p.isAfter=function(e,t){return S(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<S(e)},p.$g=function(e,t,n){return D.u(e)?this[t]:this.set(n,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var n=this,u=!!D.u(t)||t,d=D.p(e),E=function(e,t){var r=D.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return u?r:r.endOf(a)},m=function(e,t){return D.w(n.toDate()[e].apply(n.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,p=this.$M,T=this.$D,y="set"+(this.$u?"UTC":"");switch(d){case c:return u?E(1,0):E(31,11);case l:return u?E(1,p):E(0,p+1);case o:var f=this.$locale().weekStart||0,A=(g<f?g+7:g)-f;return E(u?T-A:T+(6-A),p);case a:case h:return m(y+"Hours",0);case s:return m(y+"Minutes",1);case i:return m(y+"Seconds",2);case r:return m(y+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var o,u=D.p(e),d="set"+(this.$u?"UTC":""),E=(o={},o[a]=d+"Date",o[h]=d+"Date",o[l]=d+"Month",o[c]=d+"FullYear",o[s]=d+"Hours",o[i]=d+"Minutes",o[r]=d+"Seconds",o[n]=d+"Milliseconds",o)[u],m=u===a?this.$D+(t-this.$W):t;if(u===l||u===c){var g=this.clone().set(h,1);g.$d[E](m),g.init(),this.$d=g.set(h,Math.min(this.$D,g.daysInMonth())).$d}else E&&this.$d[E](m);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(n,u){var h,d=this;n=Number(n);var E=D.p(u),m=function(e){var t=S(d);return D.w(t.date(t.date()+Math.round(e*n)),d)};if(E===l)return this.set(l,this.$M+n);if(E===c)return this.set(c,this.$y+n);if(E===a)return m(1);if(E===o)return m(7);var g=(h={},h[i]=e,h[s]=t,h[r]=1e3,h)[E]||1,p=this.$d.getTime()+n*g;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=D.z(this),s=this.$H,a=this.$m,o=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,h=function(e,n,i,s){return e&&(e[n]||e(t,r))||i[n].slice(0,s)},E=function(e){return D.s(s%12||12,e,"0")},g=c||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return o+1;case"MM":return D.s(o+1,2,"0");case"MMM":return h(n.monthsShort,o,u,3);case"MMMM":return h(u,o);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return h(n.weekdaysMin,t.$W,l,2);case"ddd":return h(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(s);case"HH":return D.s(s,2,"0");case"h":return E(1);case"hh":return E(2);case"a":return g(s,a,!0);case"A":return g(s,a,!1);case"m":return String(a);case"mm":return D.s(a,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(n,h,d){var E,m=this,g=D.p(h),p=S(n),T=(p.utcOffset()-this.utcOffset())*e,y=this-p,f=function(){return D.m(m,p)};switch(g){case c:E=f()/12;break;case l:E=f();break;case u:E=f()/3;break;case o:E=(y-T)/6048e5;break;case a:E=(y-T)/864e5;break;case s:E=y/t;break;case i:E=y/e;break;case r:E=y/1e3;break;default:E=y}return d?E:D.a(E)},p.daysInMonth=function(){return this.endOf(l).$D},p.$locale=function(){return f[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=R(e,t,!0);return r&&(n.$L=r),n},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},g}(),N=O.prototype;return S.prototype=N,[["$ms",n],["$s",r],["$m",i],["$H",s],["$W",a],["$M",l],["$y",c],["$D",h]].forEach(function(e){N[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),S.extend=function(e,t){return e.$i||(e(t,O,S),e.$i=!0),S},S.locale=R,S.isDayjs=_,S.unix=function(e){return S(1e3*e)},S.en=f[y],S.Ls=f,S.p={},S}()},473:e=>{e.exports=function(e,t){var n="000000000"+e;return n.substr(n.length-t)}},584:(e,t,n)=>{var r=n(146),i=n(473),s=n(48),a=0,o=Math.pow(36,4);function l(){return i((s()*o|0).toString(36),4)}function u(){return a=a<o?a:0,++a-1}function c(){return"c"+(new Date).getTime().toString(36)+i(u().toString(36),4)+r()+(l()+l())}c.slug=function(){var e=(new Date).getTime().toString(36),t=u().toString(36).slice(-4),n=r().slice(0,1)+r().slice(-1),i=l().slice(-2);return e.slice(-2)+t+n+i},c.isCuid=function(e){return"string"==typeof e&&!!e.startsWith("c")},c.isSlug=function(e){if("string"!=typeof e)return!1;var t=e.length;return t>=7&&t<=10},c.fingerprint=r,e.exports=c},831:e=>{e.exports={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AQ:"EUR",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"SVC",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",UM:"USD",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VED",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWG"}},869:(e,t,n)=>{var r=n(831);t.getCurrency=function(e){var t,n,i=(t=e,n=t.split("_"),2==n.length||2==(n=t.split("-")).length?n.pop():t).toUpperCase();return i in r?r[i]:null},t.getLocales=function(e){e=e.toUpperCase();var t=[];for(var n in r)r[n]===e&&t.push(n);return t}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{CotomyActionEvent:()=>y,CotomyApiForm:()=>_,CotomyElement:()=>l,CotomyFillApiForm:()=>R,CotomyFormBase:()=>f,CotomyInvalidFormDataBodyException:()=>d,CotomyMetaElement:()=>u,CotomyPageController:()=>D,CotomyQueryForm:()=>A,CotomyResponseJsonParseException:()=>h,CotomyRestApi:()=>T,CotomyRestApiResponse:()=>g,CotomyUrl:()=>S,CotomyViewRenderer:()=>p,CotomyWindow:()=>c,default:()=>O});var e,t=n(353),i=n.n(t);!function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.EARLY_HINTS=103]="EARLY_HINTS",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(e||(e={}));var s=n(869),a=n(584),o=n.n(a);class l{static createHTMLElement(e){const t=(new DOMParser).parseFromString(e,"text/html");if(0===t.body.childNodes.length)throw new Error("Invalid HTML string provided.");return t.body.firstChild}static create(e,t=l){return new t(l.createHTMLElement(e))}static first(e,t=l){const n=document.querySelector(e);return n?new t(n):l.empty(t)}static find(e,t=l){const n=document.querySelectorAll(e);return Array.from(n).map(e=>new t(e))}static byId(e,t=l){return l.first(`#${e}`,t)}static contains(e){return null!==document.querySelector(e)}static empty(e=l){return new e(document.createElement("div")).setAttribute("data-empty","").setElementStyle("display","none")}constructor(e,t=null){this._parentElement=null,this._removed=!1,this._scopeId=null,this._element=e instanceof HTMLElement?e:l.createHTMLElement(e),this.removed(()=>{this._element=document.createElement("div")}),t&&this.useScopedCss(t)}get scopeId(){return this._scopeId||(this._scopeId=`_${o()()}`,this.setAttribute(this._scopeId,"")),this._scopeId}get scopedSelector(){return`[${this.scopeId}]`}get stylable(){return!["script","style","link","meta"].includes(this.tagname)}useScopedCss(e){if(e&&this.stylable){const t=`css-${this.scopeId}`;l.find(`#${t}`).forEach(e=>e.remove());const n=document.createElement("style"),r=e.replace(/\[scope\]/g,`[${this.scopeId}]`),i=document.createTextNode(r);n.appendChild(i),n.id=t,l.first("head").append(new l(n)),this.removed(()=>{l.find(`#${t}`).forEach(e=>e.remove())})}return this}listenLayoutEvents(){return this.setAttribute(l.LISTEN_LAYOUT_EVENTS_ATTRIBUTE,""),this}get id(){return this.attribute("id")}setId(e){return this.setAttribute("id",e),this}get element(){return this._element}get tagname(){return this.element.tagName.toLowerCase()}is(e){const t=e.split(/\s+(?![^\[]*\])|(?<=\>)\s+/);let n=this.element;for(let e=t.length-1;e>=0;e--){let r=t[e].trim(),i=!1;if(r.startsWith(">")&&(i=!0,r=r.slice(1).trim()),!n||!n.matches(r))return!1;if(i)n=n.parentElement;else if(e>0)for(;n&&!n.matches(t[e-1].trim());)n=n.parentElement}return!0}get empty(){return this.hasAttribute("data-empty")}get attached(){return document.contains(this.element)}get readonly(){return"readOnly"in this.element?this.element.readOnly:this.element.hasAttribute("readonly")}set readonly(e){"readOnly"in this.element?this.element.readOnly=e:e?this.setAttribute("readonly","readonly"):this.removeAttribute("readonly")}get value(){return"value"in this.element?this.element.value:this.attribute("data-value")??""}set value(e){"value"in this.element?this.element.value=e:this.setAttribute("data-value",e)}get text(){return this.element.textContent??""}set text(e){this.element.textContent=e??""}get html(){return this.element.innerHTML}set html(e){this.element.innerHTML=e}convertUtcToLocal(e="YYYY-MM-DD HH:mm",t=!0){if(this.hasClass("utc")){if(""===this.text.trim())return this;const t=/[+-]\d{2}:\d{2}$/.test(this.text),n=new Date(this.text+(t?"":"Z"));this.text=isNaN(n.getTime())?"":i()(n).format(e),this.removeClass("utc")}if("datetime-local"===this.attribute("type")){const t=/[+-]\d{2}:\d{2}$/.test(this.value),n=new Date(this.value+(t?"":"Z"));this.value=isNaN(n.getTime())?"":i()(n).format(e)}return t&&this.find(".utc").forEach(n=>{n.convertUtcToLocal(e,t)}),this}setFocus(){this.element.focus()}get visible(){if(!this.attached)return!1;if(!this.element.offsetParent&&!document.contains(this.element))return!1;const e=this.element.getBoundingClientRect();if(e.width>0&&e.height>0){const e=this.computedStyle;return"none"!==e.display&&"hidden"!==e.visibility&&"collapse"!==e.visibility}return!1}get enabled(){return!(this.element.hasAttribute("disabled")&&null!==this.element.getAttribute("disabled"))}set enabled(e){e?this.element.removeAttribute("disabled"):this.element.setAttribute("disabled","disabled")}remove(){this._removed||(this._element.remove(),this._element=document.createElement("div"))}clone(){return new l(document.createElement(this.tagname))}clean(){this.find("*").forEach(e=>e.remove())}get width(){return this.element.offsetWidth}set width(e){let t=e.toString()+"px";this.setElementStyle("width",t)}get height(){return this.element.offsetHeight}set height(e){let t=e.toString()+"px";this.setElementStyle("height",t)}get innerWidth(){return this.element.clientWidth}get innerHeight(){return this.element.clientHeight}get outerWidth(){const e=parseFloat(this.computedStyle.marginLeft)+parseFloat(this.computedStyle.marginRight);return this.element.offsetWidth+e}get outerHeight(){const e=this.computedStyle,t=parseFloat(e.marginTop)+parseFloat(e.marginBottom);return this.element.offsetHeight+t}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get scrollTop(){return this.element.scrollTop}get position(){const e=this.element.getBoundingClientRect();return{top:e.top,left:e.left}}get absolutePosition(){const e=this.element.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX}}get screenPosition(){const e=this.element.getBoundingClientRect();return{top:e.top,left:e.left}}get rect(){const e=this.element.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}}get innerRect(){const e=this.element.getBoundingClientRect(),t=this.computedStyle,n=parseFloat(t.paddingTop),r=parseFloat(t.paddingRight),i=parseFloat(t.paddingBottom),s=parseFloat(t.paddingLeft);return{top:e.top+n,left:e.left+s,width:e.width-s-r,height:e.height-n-i}}get outerRect(){const e=this.element.getBoundingClientRect(),t=this.computedStyle,n=parseFloat(t.marginTop),r=parseFloat(t.marginRight),i=parseFloat(t.marginBottom),s=parseFloat(t.marginLeft);return{top:e.top-n,left:e.left-s,width:e.width+s+r,height:e.height+n+i}}get padding(){const e=this.computedStyle;return{top:parseFloat(e.paddingTop),right:parseFloat(e.paddingRight),bottom:parseFloat(e.paddingBottom),left:parseFloat(e.paddingLeft)}}get margin(){const e=this.computedStyle;return{top:parseFloat(e.marginTop),right:parseFloat(e.marginRight),bottom:parseFloat(e.marginBottom),left:parseFloat(e.marginLeft)}}get inViewport(){const e=this.element.getBoundingClientRect();return e.top<window.innerHeight&&e.bottom>0}get isAboveViewport(){return this.element.getBoundingClientRect().bottom<0}get isBelowViewport(){return this.element.getBoundingClientRect().top>window.innerHeight}get isLeftViewport(){return this.element.getBoundingClientRect().right<0}get isRightViewport(){return this.element.getBoundingClientRect().left>window.innerWidth}hasAttribute(e){return this.element.hasAttribute(e)}attribute(e){return this.element.hasAttribute(e)?this.element.getAttribute(e):void 0}setAttribute(e,t=void 0){return this.element.setAttribute(e,t?.toString()??""),this}removeAttribute(e){this.element.removeAttribute(e)}hasClass(e){return this.element.classList.contains(e)}addClass(e){return this.element.classList.add(e),this}removeClass(e){return this.element.classList.remove(e),this}setElementStyle(e,t){return this.element.style.setProperty(e,t),this}removeElementStyle(e){return this.element.style.removeProperty(e),this}get computedStyle(){return window.getComputedStyle(this.element)}style(e){return this.computedStyle.getPropertyValue(e)}get parent(){return null==this._parentElement&&null!==this.element.parentElement&&(this._parentElement=new l(this.element.parentElement)),this._parentElement??l.empty()}get parents(){let e=[],t=this.element.parentElement;for(;null!==t;)e.push(new l(t)),t=t.parentElement;return e}hasChildren(e="*"){return null!==this.element.querySelector(e)}children(e="*",t=l){return Array.from(this.element.querySelectorAll(e)).filter(e=>e.parentElement===this.element).filter(e=>e instanceof HTMLElement).map(e=>new t(e))}firstChild(e="*",t=l){return this.children(e,t).shift()??l.empty(t)}lastChild(e="*",t=l){return this.children(e,t).pop()??l.empty(t)}closest(e,t=l){const n=this.element.closest(e);return null!==n&&n instanceof HTMLElement?new t(n):l.empty(t)}find(e,t=l){return Array.from(this.element.querySelectorAll(e)).map(e=>new t(e))}first(e="*",t=l){return this.find(e,t).shift()??l.empty(t)}prepend(e){return this._element.prepend(e.element),this}append(e){return this.element.append(e.element),this}appends(e){return e.forEach(e=>this.append(e)),this}appendTo(e){return e.element.append(this.element),this}appendBefore(e){return this.element.before(e.element),this}appendAfter(e){return this.element.after(e.element),this}trigger(e,t=null){return this.element.dispatchEvent(t??new Event(e)),this}on(e,t){return this.element.addEventListener(e,t),this}once(e,t){return this.element.addEventListener(e,t,{once:!0}),this}off(e,t){return this.element.removeEventListener(e,t),this}click(e=null){return e?this.element.addEventListener("click",async t=>await e(t)):this.trigger("click"),this}dblclick(e=null){return e?this.element.addEventListener("dblclick",async t=>await e(t)):this.trigger("dblclick"),this}mouseover(e=null){return e?this.element.addEventListener("mouseover",async t=>await e(t)):this.trigger("mouseover"),this}mouseout(e=null){return e?this.element.addEventListener("mouseout",async t=>await e(t)):this.trigger("mouseout"),this}mousedown(e=null){return e?this.element.addEventListener("mousedown",async t=>await e(t)):this.trigger("mousedown"),this}mouseup(e=null){return e?this.element.addEventListener("mouseup",async t=>await e(t)):this.trigger("mouseup"),this}mousemove(e=null){return e?this.element.addEventListener("mousemove",async t=>await e(t)):this.trigger("mousemove"),this}mouseenter(e=null){return e?this.element.addEventListener("mouseenter",async t=>await e(t)):this.trigger("mouseenter"),this}mouseleave(e=null){return e?this.element.addEventListener("mouseleave",async t=>await e(t)):this.trigger("mouseleave"),this}dragstart(e=null){return e?this.element.addEventListener("dragstart",async t=>await e(t)):this.trigger("dragstart"),this}dragend(e=null){return e?this.element.addEventListener("dragend",async t=>await e(t)):this.trigger("dragend"),this}dragover(e=null){return e?this.element.addEventListener("dragover",async t=>await e(t)):this.trigger("dragover"),this}dragenter(e=null){return e?this.element.addEventListener("dragenter",async t=>await e(t)):this.trigger("dragenter"),this}dragleave(e=null){return e?this.element.addEventListener("dragleave",async t=>await e(t)):this.trigger("dragleave"),this}drop(e=null){return e?this.element.addEventListener("drop",async t=>await e(t)):this.trigger("drop"),this}drag(e=null){return e?this.element.addEventListener("drag",async t=>await e(t)):this.trigger("drag"),this}removed(e){return this.element.addEventListener("removed",async t=>await e(t)),this}keydown(e=null){return e?this.element.addEventListener("keydown",async t=>await e(t)):this.trigger("keydown"),this}keyup(e=null){return e?this.element.addEventListener("keyup",async t=>await e(t)):this.trigger("keyup"),this}keypress(e=null){return e?this.element.addEventListener("keypress",async t=>await e(t)):this.trigger("keypress"),this}change(e=null){return e?this.element.addEventListener("change",async t=>await e(t)):this.trigger("change"),this}input(e=null){return e?this.element.addEventListener("input",async t=>await e(t)):this.trigger("input"),this}static get intersectionObserver(){return l._intersectionObserver=l._intersectionObserver??new IntersectionObserver(e=>{e.filter(e=>e.isIntersecting).forEach(e=>e.target.dispatchEvent(new Event("inview"))),e.filter(e=>!e.isIntersecting).forEach(e=>e.target.dispatchEvent(new Event("outview")))})}inview(e=null){return e?(l.intersectionObserver.observe(this.element),this.element.addEventListener("inview",async t=>await e(t))):this.trigger("inview"),this}outview(e=null){return e?(l.intersectionObserver.observe(this.element),this.element.addEventListener("outview",async t=>await e(t))):this.trigger("outview"),this}focus(e=null){return e?this.element.addEventListener("focus",async t=>await e(t)):this.trigger("focus"),this}blur(e=null){return e?this.element.addEventListener("blur",async t=>await e(t)):this.trigger("blur"),this}focusin(e=null){return e?this.element.addEventListener("focusin",async t=>await e(t)):this.trigger("focusin"),this}focusout(e=null){return e?this.element.addEventListener("focusout",async t=>await e(t)):this.trigger("focusout"),this}filedrop(e){return this.element.addEventListener("drop",async t=>{t.preventDefault();const n=t.dataTransfer;n&&n.files&&await e(Array.from(n.files))}),this}resize(e=null){return this.listenLayoutEvents(),e?this.element.addEventListener("cotomy:resize",async t=>await e(t)):this.trigger("cotomy:resize"),this}scroll(e=null){return this.listenLayoutEvents(),e?this.element.addEventListener("cotomy:scroll",async t=>await e(t)):this.trigger("cotomy:scroll"),this}changelayout(e=null){return this.listenLayoutEvents(),e?this.element.addEventListener("cotomy:changelayout",async t=>await e(t)):this.trigger("cotomy:changelayout"),this}}l.LISTEN_LAYOUT_EVENTS_ATTRIBUTE="data-layout",l._intersectionObserver=null;class u extends l{static get(e){return l.first(`meta[name="${e}" i]`,u)}get content(){return this.attribute("content")??""}}class c{constructor(){this._body=l.empty(),this._mutationObserver=null}static get instance(){return c._instance??(c._instance=new c)}initialize(){this.initialized||(this._body=l.first("body"),["resize","scroll","orientationchange","fullscreenchange","cotomy:ready"].forEach(e=>{window.addEventListener(e,()=>{const e=new CustomEvent("cotomy:changelayout");window.dispatchEvent(e)},{passive:!0})}),document.addEventListener("dragover",e=>{e.stopPropagation(),e.preventDefault()}),document.addEventListener("dragover",e=>{e.stopPropagation(),e.preventDefault()}),this.resize(()=>{document.querySelectorAll(`[${l.LISTEN_LAYOUT_EVENTS_ATTRIBUTE}]`).forEach(e=>{e.dispatchEvent(new CustomEvent("cotomy:resize"))})}),this.scroll(()=>{document.querySelectorAll(`[${l.LISTEN_LAYOUT_EVENTS_ATTRIBUTE}]`).forEach(e=>{e.dispatchEvent(new CustomEvent("cotomy:scroll"))})}),this.changeLayout(()=>{document.querySelectorAll(`[${l.LISTEN_LAYOUT_EVENTS_ATTRIBUTE}]`).forEach(e=>{e.dispatchEvent(new CustomEvent("cotomy:changelayout"))})}),this._mutationObserver=new MutationObserver(e=>{e.forEach(e=>{e.removedNodes.forEach(e=>{e instanceof HTMLElement&&new l(e).trigger("removed")})})}),this._mutationObserver.observe(this.body.element,{childList:!0,subtree:!0}))}get initialized(){return this._body.attached}get body(){return this._body}append(e){this._body.append(e)}moveNext(e,t=!1){const n=Array.from(this.body.element.querySelectorAll("input, a, select, button, textarea")).map(e=>new l(e)).filter(e=>e.width>0&&e.height>0&&e.visible&&e.enabled&&!e.hasAttribute("readonly"));let r=n.map(e=>e.element).indexOf(e.element)+(t?-1:1);r>=n.length?r=0:r<0&&(r=n.length-1),n[r]&&n[r].setFocus()}trigger(e){window.dispatchEvent(new Event(e))}load(e){window.addEventListener("load",async t=>await e(t))}ready(e){window.addEventListener("cotomy:ready",async t=>await e(t))}on(e,t){window.addEventListener(e,async e=>await t(e))}resize(e=null){e?window.addEventListener("resize",async t=>await e(t)):this.trigger("resize")}scroll(e=null){e?window.addEventListener("scroll",async t=>await e(t)):this.trigger("scroll")}changeLayout(e=null){e?window.addEventListener("cotomy:changelayout",async t=>await e(t)):this.trigger("cotomy:changelayout")}pageshow(e=null){e?window.addEventListener("pageshow",async t=>await e(t)):this.trigger("pageshow")}get scrollTop(){return window.scrollY||document.documentElement.scrollTop}get scrollLeft(){return window.scrollX||document.documentElement.scrollLeft}get width(){return window.innerWidth}get height(){return window.innerHeight}get documentWidth(){return document.documentElement.scrollWidth}get documentHeight(){return document.documentElement.scrollHeight}}c._instance=null;class h extends Error{constructor(e="Failed to parse JSON response."){super(e),this.name="ResponseJsonParseException"}}class d extends Error{constructor(e="Body must be an instance of FormData."){super(e),this.name="InvalidFormDataBodyException"}}class E{}E.GET="GET",E.POST="POST",E.PUT="PUT",E.PATCH="PATCH",E.DELETE="DELETE",E.HEAD="HEAD",E.OPTIONS="OPTIONS",E.TRACE="TRACE",E.CONNECT="CONNECT";class m{static getMessage(e){return this._responseMessages[e]||`Unexpected error: ${e}`}}m._responseMessages={[e.BAD_REQUEST]:"There is an error in the input. Please check and try again.",[e.UNAUTHORIZED]:"You are not authenticated. Please log in again.",[e.FORBIDDEN]:"You do not have permission to use this feature. If necessary, please contact the administrator.",[e.NOT_FOUND]:"The specified information could not be found. It may have been deleted. Please start over or contact the administrator.",[e.METHOD_NOT_ALLOWED]:"This operation is currently prohibited on the server.",[e.NOT_ACCEPTABLE]:"The request cannot be accepted. Processing has been stopped.",[e.PROXY_AUTHENTICATION_REQUIRED]:"Proxy authentication is required for internet access.",[e.REQUEST_TIMEOUT]:"The request timed out. Please try again.",[e.CONFLICT]:"The identifier you are trying to register already exists. Please check the content and try again.",[e.PAYMENT_REQUIRED]:"Payment is required for this operation. Please check.",[e.GONE]:"The requested resource is no longer available.",[e.LENGTH_REQUIRED]:"The Content-Length header field is required for the request.",[e.PRECONDITION_FAILED]:"The request failed because the precondition was not met.",[e.UNSUPPORTED_MEDIA_TYPE]:"The requested media type is not supported.",[e.EXPECTATION_FAILED]:"The server cannot meet the Expect header of the request.",[e.MISDIRECTED_REQUEST]:"The server cannot appropriately process this request.",[e.UNPROCESSABLE_ENTITY]:"There is an error in the request content.",[e.LOCKED]:"The requested resource is locked.",[e.FAILED_DEPENDENCY]:"The request failed due to dependency on a previous failed request.",[e.UPGRADE_REQUIRED]:"A protocol upgrade is required to perform this operation.",[e.PRECONDITION_REQUIRED]:"This request requires a precondition.",[e.TOO_MANY_REQUESTS]:"Too many requests have been sent in a short time. Please wait and try again.",[e.REQUEST_HEADER_FIELDS_TOO_LARGE]:"The request headers are too large.",[e.INTERNAL_SERVER_ERROR]:"An unexpected error occurred. Please try again later.",[e.BAD_GATEWAY]:"The server is currently overloaded. Please wait and try again later.",[e.SERVICE_UNAVAILABLE]:"The service is temporarily unavailable. Please try again later.",[e.GATEWAY_TIMEOUT]:"The communication timed out. Please try again.",[e.HTTP_VERSION_NOT_SUPPORTED]:"The current communication method is not supported.",[e.NOT_IMPLEMENTED]:"The server does not support the requested functionality.",[e.INSUFFICIENT_STORAGE]:"The server has insufficient storage.",[e.NETWORK_AUTHENTICATION_REQUIRED]:"Network authentication is required.",413:"The payload of the request is too large. Please check the size.",414:"The request URI is too long.",416:"The requested range is invalid.",508:"The server detected a loop.",510:"The request does not include the required extensions."};class g{constructor(e){this._response=e,this._json=null,this._map=null}get available(){return!!this._response}get empty(){return!this._response||0===this._response.status}get ok(){return this._response?.ok??!1}get status(){return this._response?.status??0}get statusText(){return this._response?.statusText??""}get headers(){return this._response?.headers??new Headers}async textAsync(){return await(this._response?.text())||""}async blobAsync(){return await(this._response?.blob())||new Blob}async objectAsync(e={}){if(this._response&&!this._json)try{const t=await this._response.text();if(!t)return e;this._json=JSON.parse(t)}catch(e){throw new h(`Failed to parse JSON response: ${e instanceof Error?e.message:String(e)}`)}return this._json}}class p{constructor(e){this.element=e,this._locale=null,this._currency=null,this._renderers={},this._builded=!1}get locale(){return this._locale=this._locale||navigator.language||"en-US"}get currency(){return this._currency=this._currency||s.getCurrency(this.locale)||"USD"}renderer(e,t){return this._renderers[e]=t,this}get builded(){return this._builded}build(){return this.builded||(this.renderer("mail",(e,t)=>{l.create(`<a href="mailto:${t}">${t}</a>`).appendTo(e)}),this.renderer("tel",(e,t)=>{l.create(`<a href="tel:${t}">${t}</a>`).appendTo(e)}),this.renderer("url",(e,t)=>{l.create(`<a href="${t}" target="_blank">${t}</a>`).appendTo(e)}),this.renderer("number",(e,t)=>{e.text=new Intl.NumberFormat(navigator.language||this.locale).format(t)}),this.renderer("currency",(e,t)=>{e.text=new Intl.NumberFormat(navigator.language||this.locale,{style:"currency",currency:this.currency}).format(t)}),this.renderer("utc",(e,t)=>{const n=/[+-]\d{2}:\d{2}$/.test(t)?new Date(t):new Date(`${t}Z`);if(isNaN(n.getTime()))e.text="";else{const t=e.attribute("data-format")??"YYYY/MM/DD HH:mm";e.text=i()(n).format(t)}})),this}async applyAsync(e){if(!e.available)throw new Error("Response is not available.");for(const[t,n]of Object.entries(await e.objectAsync()))this.element.find(`[data-bind="${t}" i]`).forEach(e=>{const t=e.attribute("data-type")?.toLowerCase();t&&this._renderers[t]?this._renderers[t](e,n):e.text=String(n)});return this}}class T{constructor(e={baseUrl:null,headers:null,credentials:null,redirect:null,cache:null,referrerPolicy:null,mode:null,keepalive:!0,integrity:"",unauthorizedHandler:null}){this._options=e,this._abortController=new AbortController}get baseUrl(){return this._options.baseUrl||""}get headers(){return this._options.headers||{}}get credentials(){return this._options.credentials||"same-origin"}get redirect(){return this._options.redirect||"follow"}get cache(){return this._options.cache||"no-cache"}get referrerPolicy(){return this._options.referrerPolicy||"no-referrer"}get mode(){return this._options.mode||"cors"}get keepalive(){return this._options.keepalive||!0}get integrity(){return this._options.integrity||""}get abortController(){return this._abortController}get unauthorizedHandler(){return this._options.unauthorizedHandler||(()=>location.reload())}async requestAsync(t,n,r,i){const s={"application/json":e=>JSON.stringify(e),"application/x-www-form-urlencoded":e=>{if(e instanceof globalThis.FormData){let t=new URLSearchParams;return e.forEach((e,n)=>{t.append(n,String(e))}),t.toString()}return new URLSearchParams(e).toString()},"multipart/form-data":e=>{if(!(e instanceof globalThis.FormData))throw new d("Body must be an instance of FormData for multipart/form-data.");return e}},a=/^[a-zA-Z]/.test(n)?n:`${(this.baseUrl||"").replace(/\/$/,"")}/${n.replace(/^\//,"")}`,o=new Headers(this.headers);o.has("Content-Type")&&"multipart/form-data"===o.get("Content-Type")&&o.delete("Content-Type");const l=o.get("Content-Type")||"multipart/form-data",u=new g(await fetch(a,{method:t,headers:o,credentials:this.credentials,body:r?s[l]?s[l](r):r:void 0,signal:i??this._abortController.signal,redirect:this.redirect,cache:this.cache,referrerPolicy:this.referrerPolicy,mode:this.mode,keepalive:this.keepalive,integrity:this.integrity}));switch(u.status){case e.UNAUTHORIZED:case e.FORBIDDEN:this.unauthorizedHandler(u);break;case e.BAD_REQUEST:case e.NOT_FOUND:case e.UNPROCESSABLE_ENTITY:case e.GONE:break;default:if(u.status>=400&&u.status<600){const e=await u.textAsync().catch(()=>"No response body available"),t=u.statusText||m.getMessage(u.status)||`Unexpected error: ${u.status}`;throw new Error(`${t}\nDetails: ${e}`)}}return u}async getAsync(e,t){let n="";if(t instanceof globalThis.FormData){let e=new URLSearchParams;t.forEach((t,n)=>{e.append(n,String(t))}),n=e.toString()}else t&&(n=new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e,t])=>[e,String(t)]))).toString());const r=n?`${e}?${n}`:e;return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`GET request to: ${r}`),this.requestAsync(E.GET,r)}async postAsync(e,t){return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`POST request to: ${e}`),this.requestAsync(E.POST,e,t)}async putAsync(e,t){return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`PUT request to: ${e}`),this.requestAsync(E.PUT,e,t)}async patchAsync(e,t){return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`PATCH request to: ${e}`),this.requestAsync(E.PATCH,e,t)}async deleteAsync(e){return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`DELETE request to: ${e}`),this.requestAsync(E.DELETE,e)}async headAsync(e){return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`HEAD request to: ${e}`),this.requestAsync(E.HEAD,e)}async optionsAsync(e){return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`OPTIONS request to: ${e}`),this.requestAsync(E.OPTIONS,e)}async traceAsync(e){return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`TRACE request to: ${e}`),this.requestAsync(E.TRACE,e)}async connectAsync(e){return"true"===localStorage.getItem("cotomy:debug")&&console.debug(`CONNECT request to: ${e}`),this.requestAsync(E.CONNECT,e)}async submitAsync(e){return e.method.toUpperCase()===E.GET?this.getAsync(e.action,e.body):this.requestAsync(e.method.toUpperCase(),e.action,e.body)}}class y extends Event{constructor(e){super("cotomy:action",{bubbles:!0,cancelable:!0}),this.action=e}}class f extends l{constructor(e,t=null){super(e,t)}get formId(){return this.hasAttribute("id")||this.setAttribute("id",this.scopeId),this.attribute("id")}method(){return this.attribute("method")??"get"}actionUri(){return this.attribute("action")??location.pathname+location.search}get autoComplete(){return"on"===this.attribute("autocomplete")}set autoComplete(e){this.setAttribute("autocomplete",e?"on":"off")}reload(){location.reload()}get builded(){return this.hasAttribute("data-builded")}build(){return this.builded||(this.on("submit",async e=>{await this.submitAsync(e)}),c.instance.pageshow(e=>{e.persisted&&this.reload()}),this.find("button[type=button][data-action]").forEach(e=>{e.click(()=>{this.trigger("cotomy:action",new y(e.attribute("data-action")))})}),this.setAttribute("data-builded")),this}submit(){this.trigger("submit")}action(e){return"string"==typeof e?this.trigger("cotomy:action",new y(e)):this.element.addEventListener("cotomy:action",async t=>{await e(t)}),this}}class A extends f{constructor(e,t=null){super(e,t),this.autoComplete=!0}method(){return"get"}async submitAsync(e){e.preventDefault(),e.stopPropagation();const t=this.actionUri(),n={},r=t.split("?")[1];r&&r.split("&").forEach(e=>{const[t,r]=e.split("=");t&&r&&(n[t]=decodeURIComponent(r))}),this.find("[name]").forEach(e=>{const t=e.attribute("name");if(t){const r=e.value;r?n[t]=encodeURIComponent(r):delete n[t]}});const i=Object.entries(n).map(([e,t])=>`${e}=${t}`).join("&");location.href=`${t.split("?")[0]}?${i}`}}class _ extends f{constructor(e,t=null){super(e,t),this._apiClient=null,this._unauthorizedHandler=null}apiClient(){return this._apiClient??(this._apiClient=new T({unauthorizedHandler:e=>{this._unauthorizedHandler?this._unauthorizedHandler(e):this._apiClient?.unauthorizedHandler(e)}}))}actionUri(){return`${this.attribute("action")}/${this.autoIncrement?this.attribute("data-id")||"":this.identifierString}`}get identifier(){return this.attribute("data-id")||void 0}setIncrementedId(e){const t=e.headers.get("Location")?.split("/").pop();this.setAttribute("data-id",t)}get identifierInputs(){return this.find("[data-keyindex]").sort((e,t)=>parseInt(e.attribute("data-keyindex")??"0")-parseInt(t.attribute("data-keyindex")??"0"))}get identifierString(){return this.identifier??this.identifierInputs.map(e=>e.value).join("/")}get autoIncrement(){return!this.identifier&&0==this.identifierInputs.length}method(){return this.autoIncrement||!this.identifierInputs.every(e=>e.readonly)?"post":"put"}formData(){const e=this.element,t=new globalThis.FormData(e);return this.find("input[type=datetime-local][name]:not([disabled]):not([readonly])").forEach(e=>{const n=e.value;if(n){const r=new Date(n);isNaN(r.getTime())||t.set(e.attribute("name"),i()(r).format("YYYY-MM-DDTHH:mmZ"))}}),t}async submitAsync(e){e.preventDefault(),e.stopPropagation();const t=this.formData();await this.submitToApiAsync(t)}async submitToApiAsync(t){const n=this.apiClient(),r=await n.submitAsync({method:this.method(),action:this.actionUri(),body:t});this.autoIncrement&&r.status===e.CREATED&&this.setIncrementedId(r);const i=r.headers.get("Location");return i?(location.href=i,r):r}unauthorized(e){return this._unauthorizedHandler=e,this}}class R extends _{constructor(e,t=null){super(e,t),this._fillers={}}filler(e,t){return this._fillers[e]=t,this}build(){return this.builded||(super.build(),this.filler("datetime-local",(e,t)=>{const n=/[+-]\d{2}:\d{2}$/.test(t)?new Date(t):new Date(`${t}Z`);isNaN(n.getTime())?e.value="":e.value=i()(n).format("YYYY-MM-DDTHH:mm")}),this.filler("checkbox",(e,t)=>{e.removeAttribute("checked"),t&&e.setAttribute("checked")}),this.filler("radio",(e,t)=>{e.removeAttribute("checked"),e.value===t&&e.setAttribute("checked")}),c.instance.ready(async()=>{await this.loadAsync()})),this}async submitToApiAsync(e){const t=await super.submitToApiAsync(e);return t.ok&&this.renderer().applyAsync(t),t}reload(){this.loadAsync()}loadActionUri(){return this.actionUri()}renderer(){return new p(this).build()}async loadAsync(){if(this.autoIncrement||!this.identifierInputs.every(e=>e.value))return new g;const t=this.apiClient(),n=await t.getAsync(this.loadActionUri());if(!n.ok){if(n.status===e.NOT_FOUND)return n;throw new Error(`Failed to load data: ${n.status} ${n.statusText}`)}return await this.fillAsync(n),n}async fillAsync(e){if(e.ok&&e.available){for(const[t,n]of Object.entries(await e.objectAsync()))t.endsWith("[]")||this.find(`input[name="${t}" i]:not([data-fill="false"]):not([multiple]),\n textarea[name="${t}" i]:not([data-fill="false"]), \n select[name="${t}" i]:not([data-fill="false"]):not([multiple])`).forEach(e=>{const t=e.attribute("type")?.toLowerCase();t&&this._fillers[t]?this._fillers[t](e,n):e.value=String(n)});await this.renderer().applyAsync(e)}this.identifierInputs.forEach(e=>e.setElementStyle("background-color","#f0f0f0")),this.identifierInputs.forEach(e=>e.setAttribute("readonly")),this.find("textarea").forEach(e=>e.input())}}class S{static location(){return new S}constructor(e=null){this._url=e??this.current()}current(){const{pathname:e,search:t}=location;return`${e}${t}`}get url(){return this._url}get path(){return this._url.split("?")[0]}get segments(){return this.path.split("/").filter(e=>e.length>0).filter(e=>e.length>0)}get query(){return this._url.split("?")[1]??""}get parameters(){const e=(this._url.split("?")[1]??"").split("&").map(e=>e.split("=")),t={};return e.forEach(([e,n])=>t[e]=n),t}redirect(){window.location.href=this.url}}class D{static set(e){if(this._instance)throw new Error("PageController is already initialized.");return this._instance=new e,c.instance.load(async()=>{c.instance.initialize(),await D._instance.initializeAsync(),c.instance.trigger("cotomy:ready")}),this._instance}setForm(e){return e.build()}async initializeAsync(){this.body.convertUtcToLocal()}get body(){return c.instance.body}get uri(){return new S}}D._instance=null;const O={CotomyInvalidFormDataBodyException:d,CotomyResponseJsonParseException:h,CotomyRestApi:T,CotomyRestApiResponse:g,CotomyViewRenderer:p,CotomyActionEvent:y,CotomyApiForm:_,CotomyFillApiForm:R,CotomyFormBase:f,CotomyQueryForm:A,CotomyPageController:D,CotomyUrl:S,CotomyElement:l,CotomyMetaElement:u,CotomyWindow:c}})(),r})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cotomy=t():e.Cotomy=t()}(this,()=>(()=>{var e={48:e=>{var t,n="undefined"!=typeof window&&(window.crypto||window.msCrypto)||"undefined"!=typeof self&&self.crypto;if(n){var r=Math.pow(2,32)-1;t=function(){return Math.abs(n.getRandomValues(new Uint32Array(1))[0]/r)}}else t=Math.random;e.exports=t},146:(e,t,n)=>{var r=n(473),i="object"==typeof window?window:self,s=Object.keys(i).length,a=r(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+s.toString(36),4);e.exports=function(){return a}},353:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",s="hour",a="day",o="week",l="month",u="quarter",c="year",h="date",d="Invalid Date",E=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},p=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},T={s:p,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+p(r,2,"0")+":"+p(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),s=n-i<0,a=t.clone().add(r+(s?-1:1),l);return+(-(r+(n-i)/(s?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:c,w:o,d:a,D:h,h:s,m:i,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},f="en",y={};y[f]=g;var A="$isDayjsObject",_=function(e){return e instanceof O||!(!e||!e[A])},R=function e(t,n,r){var i;if(!t)return f;if("string"==typeof t){var s=t.toLowerCase();y[s]&&(i=s),n&&(y[s]=n,i=s);var a=t.split("-");if(!i&&a.length>1)return e(a[0])}else{var o=t.name;y[o]=t,i=o}return!r&&i&&(f=i),i||!r&&f},S=function(e,t){if(_(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},D=T;D.l=R,D.i=_,D.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function g(e){this.$L=R(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[A]=!0}var p=g.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(E);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===d)},p.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},p.isAfter=function(e,t){return S(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<S(e)},p.$g=function(e,t,n){return D.u(e)?this[t]:this.set(n,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var n=this,u=!!D.u(t)||t,d=D.p(e),E=function(e,t){var r=D.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return u?r:r.endOf(a)},m=function(e,t){return D.w(n.toDate()[e].apply(n.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,p=this.$M,T=this.$D,f="set"+(this.$u?"UTC":"");switch(d){case c:return u?E(1,0):E(31,11);case l:return u?E(1,p):E(0,p+1);case o:var y=this.$locale().weekStart||0,A=(g<y?g+7:g)-y;return E(u?T-A:T+(6-A),p);case a:case h:return m(f+"Hours",0);case s:return m(f+"Minutes",1);case i:return m(f+"Seconds",2);case r:return m(f+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var o,u=D.p(e),d="set"+(this.$u?"UTC":""),E=(o={},o[a]=d+"Date",o[h]=d+"Date",o[l]=d+"Month",o[c]=d+"FullYear",o[s]=d+"Hours",o[i]=d+"Minutes",o[r]=d+"Seconds",o[n]=d+"Milliseconds",o)[u],m=u===a?this.$D+(t-this.$W):t;if(u===l||u===c){var g=this.clone().set(h,1);g.$d[E](m),g.init(),this.$d=g.set(h,Math.min(this.$D,g.daysInMonth())).$d}else E&&this.$d[E](m);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(n,u){var h,d=this;n=Number(n);var E=D.p(u),m=function(e){var t=S(d);return D.w(t.date(t.date()+Math.round(e*n)),d)};if(E===l)return this.set(l,this.$M+n);if(E===c)return this.set(c,this.$y+n);if(E===a)return m(1);if(E===o)return m(7);var g=(h={},h[i]=e,h[s]=t,h[r]=1e3,h)[E]||1,p=this.$d.getTime()+n*g;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=D.z(this),s=this.$H,a=this.$m,o=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,h=function(e,n,i,s){return e&&(e[n]||e(t,r))||i[n].slice(0,s)},E=function(e){return D.s(s%12||12,e,"0")},g=c||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return o+1;case"MM":return D.s(o+1,2,"0");case"MMM":return h(n.monthsShort,o,u,3);case"MMMM":return h(u,o);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return h(n.weekdaysMin,t.$W,l,2);case"ddd":return h(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(s);case"HH":return D.s(s,2,"0");case"h":return E(1);case"hh":return E(2);case"a":return g(s,a,!0);case"A":return g(s,a,!1);case"m":return String(a);case"mm":return D.s(a,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(n,h,d){var E,m=this,g=D.p(h),p=S(n),T=(p.utcOffset()-this.utcOffset())*e,f=this-p,y=function(){return D.m(m,p)};switch(g){case c:E=y()/12;break;case l:E=y();break;case u:E=y()/3;break;case o:E=(f-T)/6048e5;break;case a:E=(f-T)/864e5;break;case s:E=f/t;break;case i:E=f/e;break;case r:E=f/1e3;break;default:E=f}return d?E:D.a(E)},p.daysInMonth=function(){return this.endOf(l).$D},p.$locale=function(){return y[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=R(e,t,!0);return r&&(n.$L=r),n},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},g}(),N=O.prototype;return S.prototype=N,[["$ms",n],["$s",r],["$m",i],["$H",s],["$W",a],["$M",l],["$y",c],["$D",h]].forEach(function(e){N[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),S.extend=function(e,t){return e.$i||(e(t,O,S),e.$i=!0),S},S.locale=R,S.isDayjs=_,S.unix=function(e){return S(1e3*e)},S.en=y[f],S.Ls=y,S.p={},S}()},473:e=>{e.exports=function(e,t){var n="000000000"+e;return n.substr(n.length-t)}},584:(e,t,n)=>{var r=n(146),i=n(473),s=n(48),a=0,o=Math.pow(36,4);function l(){return i((s()*o|0).toString(36),4)}function u(){return a=a<o?a:0,++a-1}function c(){return"c"+(new Date).getTime().toString(36)+i(u().toString(36),4)+r()+(l()+l())}c.slug=function(){var e=(new Date).getTime().toString(36),t=u().toString(36).slice(-4),n=r().slice(0,1)+r().slice(-1),i=l().slice(-2);return e.slice(-2)+t+n+i},c.isCuid=function(e){return"string"==typeof e&&!!e.startsWith("c")},c.isSlug=function(e){if("string"!=typeof e)return!1;var t=e.length;return t>=7&&t<=10},c.fingerprint=r,e.exports=c},831:e=>{e.exports={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AQ:"EUR",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"SVC",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",UM:"USD",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VED",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWG"}},869:(e,t,n)=>{var r=n(831);t.getCurrency=function(e){var t,n,i=(t=e,n=t.split("_"),2==n.length||2==(n=t.split("-")).length?n.pop():t).toUpperCase();return i in r?r[i]:null},t.getLocales=function(e){e=e.toUpperCase();var t=[];for(var n in r)r[n]===e&&t.push(n);return t}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{CotomyActionEvent:()=>A,CotomyApiForm:()=>S,CotomyDebugFeature:()=>s,CotomyDebugSettings:()=>o,CotomyElement:()=>c,CotomyFillApiForm:()=>D,CotomyFormBase:()=>_,CotomyInvalidFormDataBodyException:()=>m,CotomyMetaElement:()=>h,CotomyPageController:()=>N,CotomyQueryForm:()=>R,CotomyResponseJsonParseException:()=>E,CotomyRestApi:()=>y,CotomyRestApiResponse:()=>T,CotomyUrl:()=>O,CotomyViewRenderer:()=>f,CotomyWindow:()=>d});var e,t=n(353),i=n.n(t);!function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.EARLY_HINTS=103]="EARLY_HINTS",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(e||(e={}));var s,a=n(869);!function(e){e.Api="api",e.Fill="fill",e.Bind="bind",e.FormData="formdata"}(s||(s={}));class o{static isEnabled(e){const t=localStorage.getItem(this.PREFIX);return e&&"true"===localStorage.getItem(`${this.PREFIX}:${String(e)}`)||"true"===t}static enable(e){localStorage.setItem(`${this.PREFIX}:${String(e)}`,"true")}static disable(e){localStorage.setItem(`${this.PREFIX}:${String(e)}`,"false")}static enableAll(){localStorage.setItem(this.PREFIX,"true")}static disableAll(){localStorage.setItem(this.PREFIX,"false")}static clear(e){e?localStorage.removeItem(`${this.PREFIX}:${String(e)}`):localStorage.removeItem(this.PREFIX)}}o.PREFIX="cotomy:debug";var l=n(584),u=n.n(l);class c{static createHTMLElement(e){const t=(new DOMParser).parseFromString(e,"text/html");if(0===t.body.childNodes.length)throw new Error("Invalid HTML string provided.");return t.body.firstChild}static create(e,t=c){return new t(c.createHTMLElement(e))}static first(e,t=c){const n=document.querySelector(e);return n?new t(n):c.empty(t)}static find(e,t=c){const n=document.querySelectorAll(e);return Array.from(n).map(e=>new t(e))}static byId(e,t=c){return c.first(`#${e}`,t)}static contains(e){return null!==document.querySelector(e)}static empty(e=c){return new e(document.createElement("div")).setAttribute("data-empty","").setElementStyle("display","none")}constructor(e){this._parentElement=null,this._removed=!1,this._scopeId=null,e instanceof HTMLElement?this._element=e:"string"==typeof e?this._element=c.createHTMLElement(e):(this._element=c.createHTMLElement(e.html),e.css&&this.useScopedCss(e.css)),this.removed(()=>{this._element=document.createElement("div")})}get scopeId(){return this._scopeId||(this._scopeId=`_${u()()}`,this.setAttribute(this._scopeId,"")),this._scopeId}get scopedSelector(){return`[${this.scopeId}]`}get stylable(){return!["script","style","link","meta"].includes(this.tagname)}useScopedCss(e){if(e&&this.stylable){const t=`css-${this.scopeId}`;c.find(`#${t}`).forEach(e=>e.remove());const n=document.createElement("style"),r=e.replace(/\[scope\]/g,`[${this.scopeId}]`),i=document.createTextNode(r);n.appendChild(i),n.id=t,c.first("head").append(new c(n)),this.removed(()=>{c.find(`#${t}`).forEach(e=>e.remove())})}return this}listenLayoutEvents(){return this.setAttribute(c.LISTEN_LAYOUT_EVENTS_ATTRIBUTE,""),this}get id(){return this.attribute("id")}setId(e){return this.setAttribute("id",e),this}get element(){return this._element}get tagname(){return this.element.tagName.toLowerCase()}is(e){const t=e.split(/\s+(?![^\[]*\])|(?<=\>)\s+/);let n=this.element;for(let e=t.length-1;e>=0;e--){let r=t[e].trim(),i=!1;if(r.startsWith(">")&&(i=!0,r=r.slice(1).trim()),!n||!n.matches(r))return!1;if(i)n=n.parentElement;else if(e>0)for(;n&&!n.matches(t[e-1].trim());)n=n.parentElement}return!0}get empty(){return this.hasAttribute("data-empty")}get attached(){return document.contains(this.element)}get readonly(){return"readOnly"in this.element?this.element.readOnly:this.element.hasAttribute("readonly")}set readonly(e){"readOnly"in this.element?this.element.readOnly=e:e?this.setAttribute("readonly","readonly"):this.removeAttribute("readonly")}get value(){return"value"in this.element?this.element.value:this.attribute("data-value")??""}set value(e){"value"in this.element?this.element.value=e:this.setAttribute("data-value",e)}get text(){return this.element.textContent??""}set text(e){this.element.textContent=e??""}get html(){return this.element.innerHTML}set html(e){this.element.innerHTML=e}convertUtcToLocal(e="YYYY-MM-DD HH:mm",t=!0){if(this.hasClass("utc")){if(""===this.text.trim())return this;const t=/[+-]\d{2}:\d{2}$/.test(this.text),n=new Date(this.text+(t?"":"Z"));this.text=isNaN(n.getTime())?"":i()(n).format(e),this.removeClass("utc")}if("datetime-local"===this.attribute("type")){const t=/[+-]\d{2}:\d{2}$/.test(this.value),n=new Date(this.value+(t?"":"Z"));this.value=isNaN(n.getTime())?"":i()(n).format(e)}return t&&this.find(".utc").forEach(n=>{n.convertUtcToLocal(e,t)}),this}setFocus(){this.element.focus()}get visible(){if(!this.attached)return!1;if(!this.element.offsetParent&&!document.contains(this.element))return!1;const e=this.element.getBoundingClientRect();if(e.width>0&&e.height>0){const e=this.computedStyle;return"none"!==e.display&&"hidden"!==e.visibility&&"collapse"!==e.visibility}return!1}get enabled(){return!(this.element.hasAttribute("disabled")&&null!==this.element.getAttribute("disabled"))}set enabled(e){e?this.element.removeAttribute("disabled"):this.element.setAttribute("disabled","disabled")}remove(){this._removed||(this._element.remove(),this._element=document.createElement("div"))}clone(){return new c(document.createElement(this.tagname))}clean(){this.find("*").forEach(e=>e.remove())}get width(){return this.element.offsetWidth}set width(e){let t=e.toString()+"px";this.setElementStyle("width",t)}get height(){return this.element.offsetHeight}set height(e){let t=e.toString()+"px";this.setElementStyle("height",t)}get innerWidth(){return this.element.clientWidth}get innerHeight(){return this.element.clientHeight}get outerWidth(){const e=parseFloat(this.computedStyle.marginLeft)+parseFloat(this.computedStyle.marginRight);return this.element.offsetWidth+e}get outerHeight(){const e=this.computedStyle,t=parseFloat(e.marginTop)+parseFloat(e.marginBottom);return this.element.offsetHeight+t}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get scrollTop(){return this.element.scrollTop}get position(){const e=this.element.getBoundingClientRect();return{top:e.top,left:e.left}}get absolutePosition(){const e=this.element.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX}}get screenPosition(){const e=this.element.getBoundingClientRect();return{top:e.top,left:e.left}}get rect(){const e=this.element.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}}get innerRect(){const e=this.element.getBoundingClientRect(),t=this.computedStyle,n=parseFloat(t.paddingTop),r=parseFloat(t.paddingRight),i=parseFloat(t.paddingBottom),s=parseFloat(t.paddingLeft);return{top:e.top+n,left:e.left+s,width:e.width-s-r,height:e.height-n-i}}get outerRect(){const e=this.element.getBoundingClientRect(),t=this.computedStyle,n=parseFloat(t.marginTop),r=parseFloat(t.marginRight),i=parseFloat(t.marginBottom),s=parseFloat(t.marginLeft);return{top:e.top-n,left:e.left-s,width:e.width+s+r,height:e.height+n+i}}get padding(){const e=this.computedStyle;return{top:parseFloat(e.paddingTop),right:parseFloat(e.paddingRight),bottom:parseFloat(e.paddingBottom),left:parseFloat(e.paddingLeft)}}get margin(){const e=this.computedStyle;return{top:parseFloat(e.marginTop),right:parseFloat(e.marginRight),bottom:parseFloat(e.marginBottom),left:parseFloat(e.marginLeft)}}get inViewport(){const e=this.element.getBoundingClientRect();return e.top<window.innerHeight&&e.bottom>0}get isAboveViewport(){return this.element.getBoundingClientRect().bottom<0}get isBelowViewport(){return this.element.getBoundingClientRect().top>window.innerHeight}get isLeftViewport(){return this.element.getBoundingClientRect().right<0}get isRightViewport(){return this.element.getBoundingClientRect().left>window.innerWidth}hasAttribute(e){return this.element.hasAttribute(e)}attribute(e){return this.element.hasAttribute(e)?this.element.getAttribute(e):void 0}setAttribute(e,t=void 0){return this.element.setAttribute(e,t?.toString()??""),this}removeAttribute(e){this.element.removeAttribute(e)}hasClass(e){return this.element.classList.contains(e)}addClass(e){return this.element.classList.add(e),this}removeClass(e){return this.element.classList.remove(e),this}setElementStyle(e,t){return this.element.style.setProperty(e,t),this}removeElementStyle(e){return this.element.style.removeProperty(e),this}get computedStyle(){return window.getComputedStyle(this.element)}style(e){return this.computedStyle.getPropertyValue(e)}get parent(){return null==this._parentElement&&null!==this.element.parentElement&&(this._parentElement=new c(this.element.parentElement)),this._parentElement??c.empty()}get parents(){let e=[],t=this.element.parentElement;for(;null!==t;)e.push(new c(t)),t=t.parentElement;return e}hasChildren(e="*"){return null!==this.element.querySelector(e)}children(e="*",t=c){return Array.from(this.element.querySelectorAll(e)).filter(e=>e.parentElement===this.element).filter(e=>e instanceof HTMLElement).map(e=>new t(e))}firstChild(e="*",t=c){return this.children(e,t).shift()??c.empty(t)}lastChild(e="*",t=c){return this.children(e,t).pop()??c.empty(t)}closest(e,t=c){const n=this.element.closest(e);return null!==n&&n instanceof HTMLElement?new t(n):c.empty(t)}find(e,t=c){return Array.from(this.element.querySelectorAll(e)).map(e=>new t(e))}first(e="*",t=c){return this.find(e,t).shift()??c.empty(t)}prepend(e){return this._element.prepend(e.element),this}append(e){return this.element.append(e.element),this}appends(e){return e.forEach(e=>this.append(e)),this}appendTo(e){return e.element.append(this.element),this}appendBefore(e){return this.element.before(e.element),this}appendAfter(e){return this.element.after(e.element),this}trigger(e,t=null){return this.element.dispatchEvent(t??new Event(e)),this}on(e,t){return this.element.addEventListener(e,t),this}once(e,t){return this.element.addEventListener(e,t,{once:!0}),this}off(e,t){return this.element.removeEventListener(e,t),this}click(e=null){return e?this.element.addEventListener("click",async t=>await e(t)):this.trigger("click"),this}dblclick(e=null){return e?this.element.addEventListener("dblclick",async t=>await e(t)):this.trigger("dblclick"),this}mouseover(e=null){return e?this.element.addEventListener("mouseover",async t=>await e(t)):this.trigger("mouseover"),this}mouseout(e=null){return e?this.element.addEventListener("mouseout",async t=>await e(t)):this.trigger("mouseout"),this}mousedown(e=null){return e?this.element.addEventListener("mousedown",async t=>await e(t)):this.trigger("mousedown"),this}mouseup(e=null){return e?this.element.addEventListener("mouseup",async t=>await e(t)):this.trigger("mouseup"),this}mousemove(e=null){return e?this.element.addEventListener("mousemove",async t=>await e(t)):this.trigger("mousemove"),this}mouseenter(e=null){return e?this.element.addEventListener("mouseenter",async t=>await e(t)):this.trigger("mouseenter"),this}mouseleave(e=null){return e?this.element.addEventListener("mouseleave",async t=>await e(t)):this.trigger("mouseleave"),this}dragstart(e=null){return e?this.element.addEventListener("dragstart",async t=>await e(t)):this.trigger("dragstart"),this}dragend(e=null){return e?this.element.addEventListener("dragend",async t=>await e(t)):this.trigger("dragend"),this}dragover(e=null){return e?this.element.addEventListener("dragover",async t=>await e(t)):this.trigger("dragover"),this}dragenter(e=null){return e?this.element.addEventListener("dragenter",async t=>await e(t)):this.trigger("dragenter"),this}dragleave(e=null){return e?this.element.addEventListener("dragleave",async t=>await e(t)):this.trigger("dragleave"),this}drop(e=null){return e?this.element.addEventListener("drop",async t=>await e(t)):this.trigger("drop"),this}drag(e=null){return e?this.element.addEventListener("drag",async t=>await e(t)):this.trigger("drag"),this}removed(e){return this.element.addEventListener("removed",async t=>await e(t)),this}keydown(e=null){return e?this.element.addEventListener("keydown",async t=>await e(t)):this.trigger("keydown"),this}keyup(e=null){return e?this.element.addEventListener("keyup",async t=>await e(t)):this.trigger("keyup"),this}keypress(e=null){return e?this.element.addEventListener("keypress",async t=>await e(t)):this.trigger("keypress"),this}change(e=null){return e?this.element.addEventListener("change",async t=>await e(t)):this.trigger("change"),this}input(e=null){return e?this.element.addEventListener("input",async t=>await e(t)):this.trigger("input"),this}static get intersectionObserver(){return c._intersectionObserver=c._intersectionObserver??new IntersectionObserver(e=>{e.filter(e=>e.isIntersecting).forEach(e=>e.target.dispatchEvent(new Event("inview"))),e.filter(e=>!e.isIntersecting).forEach(e=>e.target.dispatchEvent(new Event("outview")))})}inview(e=null){return e?(c.intersectionObserver.observe(this.element),this.element.addEventListener("inview",async t=>await e(t))):this.trigger("inview"),this}outview(e=null){return e?(c.intersectionObserver.observe(this.element),this.element.addEventListener("outview",async t=>await e(t))):this.trigger("outview"),this}focus(e=null){return e?this.element.addEventListener("focus",async t=>await e(t)):this.trigger("focus"),this}blur(e=null){return e?this.element.addEventListener("blur",async t=>await e(t)):this.trigger("blur"),this}focusin(e=null){return e?this.element.addEventListener("focusin",async t=>await e(t)):this.trigger("focusin"),this}focusout(e=null){return e?this.element.addEventListener("focusout",async t=>await e(t)):this.trigger("focusout"),this}filedrop(e){return this.element.addEventListener("drop",async t=>{t.preventDefault();const n=t.dataTransfer;n&&n.files&&await e(Array.from(n.files))}),this}resize(e=null){return this.listenLayoutEvents(),e?this.element.addEventListener("cotomy:resize",async t=>await e(t)):this.trigger("cotomy:resize"),this}scroll(e=null){return this.listenLayoutEvents(),e?this.element.addEventListener("cotomy:scroll",async t=>await e(t)):this.trigger("cotomy:scroll"),this}changelayout(e=null){return this.listenLayoutEvents(),e?this.element.addEventListener("cotomy:changelayout",async t=>await e(t)):this.trigger("cotomy:changelayout"),this}}c.LISTEN_LAYOUT_EVENTS_ATTRIBUTE="data-layout",c._intersectionObserver=null;class h extends c{static get(e){return c.first(`meta[name="${e}" i]`,h)}get content(){return this.attribute("content")??""}}class d{constructor(){this._body=c.empty(),this._mutationObserver=null}static get instance(){return d._instance??(d._instance=new d)}initialize(){this.initialized||(this._body=c.first("body"),["resize","scroll","orientationchange","fullscreenchange","cotomy:ready"].forEach(e=>{window.addEventListener(e,()=>{const e=new CustomEvent("cotomy:changelayout");window.dispatchEvent(e)},{passive:!0})}),document.addEventListener("dragover",e=>{e.stopPropagation(),e.preventDefault()}),document.addEventListener("dragover",e=>{e.stopPropagation(),e.preventDefault()}),this.resize(()=>{document.querySelectorAll(`[${c.LISTEN_LAYOUT_EVENTS_ATTRIBUTE}]`).forEach(e=>{e.dispatchEvent(new CustomEvent("cotomy:resize"))})}),this.scroll(()=>{document.querySelectorAll(`[${c.LISTEN_LAYOUT_EVENTS_ATTRIBUTE}]`).forEach(e=>{e.dispatchEvent(new CustomEvent("cotomy:scroll"))})}),this.changeLayout(()=>{document.querySelectorAll(`[${c.LISTEN_LAYOUT_EVENTS_ATTRIBUTE}]`).forEach(e=>{e.dispatchEvent(new CustomEvent("cotomy:changelayout"))})}),this._mutationObserver=new MutationObserver(e=>{e.forEach(e=>{e.removedNodes.forEach(e=>{e instanceof HTMLElement&&new c(e).trigger("removed")})})}),this._mutationObserver.observe(this.body.element,{childList:!0,subtree:!0}))}get initialized(){return this._body.attached}get body(){return this._body}append(e){this._body.append(e)}moveNext(e,t=!1){const n=Array.from(this.body.element.querySelectorAll("input, a, select, button, textarea")).map(e=>new c(e)).filter(e=>e.width>0&&e.height>0&&e.visible&&e.enabled&&!e.hasAttribute("readonly"));let r=n.map(e=>e.element).indexOf(e.element)+(t?-1:1);r>=n.length?r=0:r<0&&(r=n.length-1),n[r]&&n[r].setFocus()}trigger(e){window.dispatchEvent(new Event(e))}load(e){window.addEventListener("load",async t=>await e(t))}ready(e){window.addEventListener("cotomy:ready",async t=>await e(t))}on(e,t){window.addEventListener(e,async e=>await t(e))}resize(e=null){e?window.addEventListener("resize",async t=>await e(t)):this.trigger("resize")}scroll(e=null){e?window.addEventListener("scroll",async t=>await e(t)):this.trigger("scroll")}changeLayout(e=null){e?window.addEventListener("cotomy:changelayout",async t=>await e(t)):this.trigger("cotomy:changelayout")}pageshow(e=null){e?window.addEventListener("pageshow",async t=>await e(t)):this.trigger("pageshow")}get scrollTop(){return window.scrollY||document.documentElement.scrollTop}get scrollLeft(){return window.scrollX||document.documentElement.scrollLeft}get width(){return window.innerWidth}get height(){return window.innerHeight}get documentWidth(){return document.documentElement.scrollWidth}get documentHeight(){return document.documentElement.scrollHeight}}d._instance=null;class E extends Error{constructor(e="Failed to parse JSON response."){super(e),this.name="ResponseJsonParseException"}}class m extends Error{constructor(e="Body must be an instance of FormData."){super(e),this.name="InvalidFormDataBodyException"}}class g{}g.GET="GET",g.POST="POST",g.PUT="PUT",g.PATCH="PATCH",g.DELETE="DELETE",g.HEAD="HEAD",g.OPTIONS="OPTIONS",g.TRACE="TRACE",g.CONNECT="CONNECT";class p{static getMessage(e){return this._responseMessages[e]||`Unexpected error: ${e}`}}p._responseMessages={[e.BAD_REQUEST]:"There is an error in the input. Please check and try again.",[e.UNAUTHORIZED]:"You are not authenticated. Please log in again.",[e.FORBIDDEN]:"You do not have permission to use this feature. If necessary, please contact the administrator.",[e.NOT_FOUND]:"The specified information could not be found. It may have been deleted. Please start over or contact the administrator.",[e.METHOD_NOT_ALLOWED]:"This operation is currently prohibited on the server.",[e.NOT_ACCEPTABLE]:"The request cannot be accepted. Processing has been stopped.",[e.PROXY_AUTHENTICATION_REQUIRED]:"Proxy authentication is required for internet access.",[e.REQUEST_TIMEOUT]:"The request timed out. Please try again.",[e.CONFLICT]:"The identifier you are trying to register already exists. Please check the content and try again.",[e.PAYMENT_REQUIRED]:"Payment is required for this operation. Please check.",[e.GONE]:"The requested resource is no longer available.",[e.LENGTH_REQUIRED]:"The Content-Length header field is required for the request.",[e.PRECONDITION_FAILED]:"The request failed because the precondition was not met.",[e.UNSUPPORTED_MEDIA_TYPE]:"The requested media type is not supported.",[e.EXPECTATION_FAILED]:"The server cannot meet the Expect header of the request.",[e.MISDIRECTED_REQUEST]:"The server cannot appropriately process this request.",[e.UNPROCESSABLE_ENTITY]:"There is an error in the request content.",[e.LOCKED]:"The requested resource is locked.",[e.FAILED_DEPENDENCY]:"The request failed due to dependency on a previous failed request.",[e.UPGRADE_REQUIRED]:"A protocol upgrade is required to perform this operation.",[e.PRECONDITION_REQUIRED]:"This request requires a precondition.",[e.TOO_MANY_REQUESTS]:"Too many requests have been sent in a short time. Please wait and try again.",[e.REQUEST_HEADER_FIELDS_TOO_LARGE]:"The request headers are too large.",[e.INTERNAL_SERVER_ERROR]:"An unexpected error occurred. Please try again later.",[e.BAD_GATEWAY]:"The server is currently overloaded. Please wait and try again later.",[e.SERVICE_UNAVAILABLE]:"The service is temporarily unavailable. Please try again later.",[e.GATEWAY_TIMEOUT]:"The communication timed out. Please try again.",[e.HTTP_VERSION_NOT_SUPPORTED]:"The current communication method is not supported.",[e.NOT_IMPLEMENTED]:"The server does not support the requested functionality.",[e.INSUFFICIENT_STORAGE]:"The server has insufficient storage.",[e.NETWORK_AUTHENTICATION_REQUIRED]:"Network authentication is required.",413:"The payload of the request is too large. Please check the size.",414:"The request URI is too long.",416:"The requested range is invalid.",508:"The server detected a loop.",510:"The request does not include the required extensions."};class T{constructor(e){this._response=e,this._json=null,this._map=null}get available(){return!!this._response}get empty(){return!this._response||0===this._response.status}get ok(){return this._response?.ok??!1}get status(){return this._response?.status??0}get statusText(){return this._response?.statusText??""}get headers(){return this._response?.headers??new Headers}async textAsync(){return await(this._response?.text())||""}async blobAsync(){return await(this._response?.blob())||new Blob}async objectAsync(e={}){if(this._response&&!this._json)try{const t=await this._response.text();if(!t)return e;this._json=JSON.parse(t)}catch(e){throw new E(`Failed to parse JSON response: ${e instanceof Error?e.message:String(e)}`)}return this._json}}class f{constructor(e){this.element=e,this._locale=null,this._currency=null,this._renderers={},this._builded=!1}get locale(){return this._locale=this._locale||navigator.language||"en-US"}get currency(){return this._currency=this._currency||a.getCurrency(this.locale)||"USD"}renderer(e,t){return this._renderers[e]=t,this}get builded(){return this._builded}build(){return this.builded||(this.renderer("mail",(e,t)=>{c.create(`<a href="mailto:${t}">${t}</a>`).appendTo(e)}),this.renderer("tel",(e,t)=>{c.create(`<a href="tel:${t}">${t}</a>`).appendTo(e)}),this.renderer("url",(e,t)=>{c.create(`<a href="${t}" target="_blank">${t}</a>`).appendTo(e)}),this.renderer("number",(e,t)=>{e.text=new Intl.NumberFormat(navigator.language||this.locale).format(t)}),this.renderer("currency",(e,t)=>{e.text=new Intl.NumberFormat(navigator.language||this.locale,{style:"currency",currency:this.currency}).format(t)}),this.renderer("utc",(e,t)=>{const n=/[+-]\d{2}:\d{2}$/.test(t)?new Date(t):new Date(`${t}Z`);if(isNaN(n.getTime()))e.text="";else{const t=e.attribute("data-format")??"YYYY/MM/DD HH:mm";e.text=i()(n).format(t)}})),this}async applyAsync(e){if(this.builded||this.build(),!e.available)throw new Error("Response is not available.");for(const[t,n]of Object.entries(await e.objectAsync()))this.element.find(`[data-bind="${t}" i]`).forEach(e=>{o.isEnabled(s.Bind)&&console.debug(`Binding data to element [data-bind="${t}"]:`,n);const r=e.attribute("data-type")?.toLowerCase();r&&this._renderers[r]?this._renderers[r](e,n):e.text=String(n)});return this}}class y{constructor(e={baseUrl:null,headers:null,credentials:null,redirect:null,cache:null,referrerPolicy:null,mode:null,keepalive:!0,integrity:"",unauthorizedHandler:null}){this._options=e,this._abortController=new AbortController}get baseUrl(){return this._options.baseUrl||""}get headers(){return this._options.headers||{}}get credentials(){return this._options.credentials||"same-origin"}get redirect(){return this._options.redirect||"follow"}get cache(){return this._options.cache||"no-cache"}get referrerPolicy(){return this._options.referrerPolicy||"no-referrer"}get mode(){return this._options.mode||"cors"}get keepalive(){return this._options.keepalive||!0}get integrity(){return this._options.integrity||""}get abortController(){return this._abortController}get unauthorizedHandler(){return this._options.unauthorizedHandler||(()=>location.reload())}async requestAsync(t,n,r,i){const s={"application/json":e=>JSON.stringify(e),"application/x-www-form-urlencoded":e=>{if(e instanceof globalThis.FormData){let t=new URLSearchParams;return e.forEach((e,n)=>{t.append(n,String(e))}),t.toString()}return new URLSearchParams(e).toString()},"multipart/form-data":e=>{if(!(e instanceof globalThis.FormData))throw new m("Body must be an instance of FormData for multipart/form-data.");return e}},a=/^[a-zA-Z]/.test(n)?n:`${(this.baseUrl||"").replace(/\/$/,"")}/${n.replace(/^\//,"")}`,o=new Headers(this.headers);o.has("Content-Type")&&"multipart/form-data"===o.get("Content-Type")&&o.delete("Content-Type");const l=o.get("Content-Type")||"multipart/form-data",u=new T(await fetch(a,{method:t,headers:o,credentials:this.credentials,body:r?s[l]?s[l](r):r:void 0,signal:i??this._abortController.signal,redirect:this.redirect,cache:this.cache,referrerPolicy:this.referrerPolicy,mode:this.mode,keepalive:this.keepalive,integrity:this.integrity}));switch(u.status){case e.UNAUTHORIZED:case e.FORBIDDEN:this.unauthorizedHandler(u);break;case e.BAD_REQUEST:case e.NOT_FOUND:case e.UNPROCESSABLE_ENTITY:case e.GONE:break;default:if(u.status>=400&&u.status<600){const e=await u.textAsync().catch(()=>"No response body available"),t=u.statusText||p.getMessage(u.status)||`Unexpected error: ${u.status}`;throw new Error(`${t}\nDetails: ${e}`)}}return u}async getAsync(e,t){let n="";if(t instanceof globalThis.FormData){let e=new URLSearchParams;t.forEach((t,n)=>{e.append(n,String(t))}),n=e.toString()}else t&&(n=new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e,t])=>[e,String(t)]))).toString());const r=n?`${e}?${n}`:e;return o.isEnabled(s.Api)&&console.debug(`GET request to: ${r}`),this.requestAsync(g.GET,r)}async postAsync(e,t){return o.isEnabled(s.Api)&&console.debug(`POST request to: ${e}`),this.requestAsync(g.POST,e,t)}async putAsync(e,t){return o.isEnabled(s.Api)&&console.debug(`PUT request to: ${e}`),this.requestAsync(g.PUT,e,t)}async patchAsync(e,t){return o.isEnabled(s.Api)&&console.debug(`PATCH request to: ${e}`),this.requestAsync(g.PATCH,e,t)}async deleteAsync(e){return o.isEnabled(s.Api)&&console.debug(`DELETE request to: ${e}`),this.requestAsync(g.DELETE,e)}async headAsync(e){return o.isEnabled(s.Api)&&console.debug(`HEAD request to: ${e}`),this.requestAsync(g.HEAD,e)}async optionsAsync(e){return o.isEnabled(s.Api)&&console.debug(`OPTIONS request to: ${e}`),this.requestAsync(g.OPTIONS,e)}async traceAsync(e){return o.isEnabled(s.Api)&&console.debug(`TRACE request to: ${e}`),this.requestAsync(g.TRACE,e)}async connectAsync(e){return o.isEnabled(s.Api)&&console.debug(`CONNECT request to: ${e}`),this.requestAsync(g.CONNECT,e)}async submitAsync(e){return e.method.toUpperCase()===g.GET?this.getAsync(e.action,e.body):this.requestAsync(e.method.toUpperCase(),e.action,e.body)}}class A extends Event{constructor(e){super("cotomy:action",{bubbles:!0,cancelable:!0}),this.action=e}}class _ extends c{constructor(e){super(e)}get formId(){return this.hasAttribute("id")||this.setAttribute("id",this.scopeId),this.attribute("id")}method(){return this.attribute("method")??"get"}actionUri(){return this.attribute("action")??location.pathname+location.search}get autoComplete(){return"on"===this.attribute("autocomplete")}set autoComplete(e){this.setAttribute("autocomplete",e?"on":"off")}reload(){location.reload()}get builded(){return this.hasAttribute("data-builded")}build(){return this.builded||(this.on("submit",async e=>{await this.submitAsync(e)}),d.instance.pageshow(e=>{e.persisted&&this.reload()}),this.find("button[type=button][data-action]").forEach(e=>{e.click(()=>{this.trigger("cotomy:action",new A(e.attribute("data-action")))})}),this.setAttribute("data-builded")),this}submit(){this.trigger("submit")}action(e){return"string"==typeof e?this.trigger("cotomy:action",new A(e)):this.element.addEventListener("cotomy:action",async t=>{await e(t)}),this}}class R extends _{constructor(e){super(e),this.autoComplete=!0}method(){return"get"}async submitAsync(e){e.preventDefault(),e.stopPropagation();const t=this.actionUri(),n={},r=t.split("?")[1];r&&r.split("&").forEach(e=>{const[t,r]=e.split("=");t&&r&&(n[t]=decodeURIComponent(r))}),this.find("[name]").forEach(e=>{const t=e.attribute("name");if(t){const r=e.value;r?n[t]=encodeURIComponent(r):delete n[t]}});const i=Object.entries(n).map(([e,t])=>`${e}=${t}`).join("&");location.href=`${t.split("?")[0]}?${i}`}}class S extends _{constructor(e){super(e),this._apiClient=null,this._unauthorizedHandler=null}apiClient(){return this._apiClient??(this._apiClient=new y({unauthorizedHandler:e=>{this._unauthorizedHandler?this._unauthorizedHandler(e):this._apiClient?.unauthorizedHandler(e)}}))}actionUri(){return`${this.attribute("action")}/${this.autoIncrement?this.attribute("data-id")||"":this.identifierString}`}get identifier(){return this.attribute("data-id")||void 0}setIncrementedId(e){const t=e.headers.get("Location")?.split("/").pop();this.setAttribute("data-id",t)}get identifierInputs(){return this.find("[data-keyindex]").sort((e,t)=>parseInt(e.attribute("data-keyindex")??"0")-parseInt(t.attribute("data-keyindex")??"0"))}get identifierString(){return this.identifier??this.identifierInputs.map(e=>e.value).join("/")}get autoIncrement(){return!this.identifier&&0==this.identifierInputs.length}method(){return this.autoIncrement||!this.identifierInputs.every(e=>e.readonly)?"post":"put"}formData(){const e=this.element,t=new globalThis.FormData(e);return this.find("input[type=datetime-local][name]:not([disabled]):not([readonly])").forEach(e=>{const n=e.value;if(n){const r=new Date(n);isNaN(r.getTime())||t.set(e.attribute("name"),i()(r).format("YYYY-MM-DDTHH:mmZ"))}}),o.isEnabled(s.FormData)&&console.debug("FormData:",Array.from(t.entries())),t}async submitAsync(e){e.preventDefault(),e.stopPropagation();const t=this.formData();await this.submitToApiAsync(t)}async submitToApiAsync(t){const n=this.apiClient(),r=await n.submitAsync({method:this.method(),action:this.actionUri(),body:t});this.autoIncrement&&r.status===e.CREATED&&this.setIncrementedId(r);const i=r.headers.get("Location");return i?(location.href=i,r):r}unauthorized(e){return this._unauthorizedHandler=e,this}}class D extends S{constructor(e){super(e),this._fillers={}}filler(e,t){return this._fillers[e]=t,this}build(){return this.builded||(super.build(),this.filler("datetime-local",(e,t)=>{const n=/[+-]\d{2}:\d{2}$/.test(t)?new Date(t):new Date(`${t}Z`);isNaN(n.getTime())?e.value="":e.value=i()(n).format("YYYY-MM-DDTHH:mm")}),this.filler("checkbox",(e,t)=>{e.removeAttribute("checked"),t&&e.setAttribute("checked")}),this.filler("radio",(e,t)=>{e.removeAttribute("checked"),e.value===t&&e.setAttribute("checked")}),d.instance.ready(async()=>{await this.loadAsync()})),this}async submitToApiAsync(e){const t=await super.submitToApiAsync(e);return t.ok&&this.renderer().applyAsync(t),t}reload(){this.loadAsync()}loadActionUri(){return this.actionUri()}renderer(){return new f(this)}async loadAsync(){if(this.autoIncrement||!this.identifierInputs.every(e=>e.value))return new T;const t=this.apiClient(),n=await t.getAsync(this.loadActionUri());if(!n.ok){if(n.status===e.NOT_FOUND)return n;throw new Error(`Failed to load data: ${n.status} ${n.statusText}`)}return await this.fillAsync(n),n}async fillAsync(e){if(e.ok&&e.available){for(const[t,n]of Object.entries(await e.objectAsync()))t.endsWith("[]")||this.find(`input[name="${t}" i]:not([data-fill="false"]):not([multiple]),\n textarea[name="${t}" i]:not([data-fill="false"]), \n select[name="${t}" i]:not([data-fill="false"]):not([multiple])`).forEach(e=>{o.isEnabled(s.Fill)&&console.debug(`Filling input[name="${t}"] with value:`,n);const r=e.attribute("type")?.toLowerCase();r&&this._fillers[r]?this._fillers[r](e,n):e.value=String(n||"")});await this.renderer().applyAsync(e)}this.identifierInputs.forEach(e=>e.setElementStyle("background-color","#f0f0f0")),this.identifierInputs.forEach(e=>e.setAttribute("readonly")),this.find("textarea").forEach(e=>e.input())}}class O{static location(){return new O}constructor(e=null){this._url=e??this.current()}current(){const{pathname:e,search:t}=location;return`${e}${t}`}get url(){return this._url}get path(){return this._url.split("?")[0]}get segments(){return this.path.split("/").filter(e=>e.length>0).filter(e=>e.length>0)}get query(){return this._url.split("?")[1]??""}get parameters(){const e=(this._url.split("?")[1]??"").split("&").map(e=>e.split("=")),t={};return e.forEach(([e,n])=>t[e]=n),t}redirect(){window.location.href=this.url}}class N{static set(e){if(this._instance)throw new Error("PageController is already initialized.");return this._instance=new e,d.instance.load(async()=>{d.instance.initialize(),await N._instance.initializeAsync(),d.instance.trigger("cotomy:ready")}),this._instance}setForm(e){return e.build()}async initializeAsync(){this.body.convertUtcToLocal()}get body(){return d.instance.body}get uri(){return new O}}N._instance=null})(),r})());
|
package/dist/view.d.ts
CHANGED
|
@@ -9,12 +9,15 @@ export declare class CotomyElement {
|
|
|
9
9
|
private _element;
|
|
10
10
|
private _parentElement;
|
|
11
11
|
private _removed;
|
|
12
|
-
constructor(element:
|
|
12
|
+
constructor(element: HTMLElement | {
|
|
13
|
+
html: string;
|
|
14
|
+
css?: string | null;
|
|
15
|
+
} | string);
|
|
13
16
|
private _scopeId;
|
|
14
17
|
get scopeId(): string;
|
|
15
18
|
get scopedSelector(): string;
|
|
16
19
|
get stylable(): boolean;
|
|
17
|
-
useScopedCss
|
|
20
|
+
private useScopedCss;
|
|
18
21
|
static readonly LISTEN_LAYOUT_EVENTS_ATTRIBUTE: string;
|
|
19
22
|
listenLayoutEvents(): this;
|
|
20
23
|
get id(): string | null | undefined;
|