@streamline-pulse/formkrafter-wc 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/fk-brick-actions_18.cjs.entry.js +258 -22476
  3. package/dist/cjs/formkrafter-wc.cjs.js +2 -2
  4. package/dist/cjs/index-Bhy1RJMV.js +3042 -0
  5. package/dist/cjs/{index-D_7eGIJ0.js → index-CImTe9BG.js} +40 -4
  6. package/dist/cjs/index-CdaT3-qx.js +5444 -0
  7. package/dist/cjs/{index-By4GGW_q.js → index-CkPPRg03.js} +237 -35
  8. package/dist/cjs/index-DHgK3reD.js +12233 -0
  9. package/dist/cjs/index-Ds0sDbXV.js +4019 -0
  10. package/dist/cjs/index-c9BL7y3N.js +1922 -0
  11. package/dist/cjs/index.cjs.js +3 -2
  12. package/dist/cjs/loader.cjs.js +2 -2
  13. package/dist/collection/components/fk-brick-render/fk-brick-render.js +31 -3
  14. package/dist/collection/components/fk-code-editor/fk-code-editor.js +17 -8
  15. package/dist/collection/components/fk-file-input/fk-file-input.css +26 -5
  16. package/dist/collection/components/fk-file-input/fk-file-input.js +96 -14
  17. package/dist/collection/components/fk-form-builder/fk-form-builder.css +30 -0
  18. package/dist/collection/components/fk-form-render/fk-form-render.js +1 -1
  19. package/dist/collection/components/fk-property-panel/fk-property-panel.js +5 -1
  20. package/dist/collection/components/fk-select-input/fk-select-input.css +9 -0
  21. package/dist/collection/components/fk-select-input/fk-select-input.js +118 -20
  22. package/dist/collection/components/fk-stepper/fk-stepper.css +14 -0
  23. package/dist/collection/components/fk-stepper/fk-stepper.js +4 -1
  24. package/dist/collection/components/fk-tabs/fk-tabs.js +15 -2
  25. package/dist/collection/i18n/i18n.js +20 -0
  26. package/dist/collection/index.js +1 -1
  27. package/dist/collection/registry/default-bricks.js +174 -34
  28. package/dist/components/fk-brick-actions.js +1 -1
  29. package/dist/components/fk-brick-list.js +1 -1
  30. package/dist/components/fk-brick-mold-item.js +1 -1
  31. package/dist/components/fk-brick-not-found.js +1 -1
  32. package/dist/components/fk-brick-render.js +1 -1
  33. package/dist/components/fk-code-editor.js +1 -1
  34. package/dist/components/fk-data-grid.js +1 -1
  35. package/dist/components/fk-drop-area.js +1 -1
  36. package/dist/components/fk-empty-form.js +1 -1
  37. package/dist/components/fk-file-input.js +1 -1
  38. package/dist/components/fk-form-builder.js +1 -1
  39. package/dist/components/fk-form-render.js +1 -1
  40. package/dist/components/fk-property-panel.js +1 -1
  41. package/dist/components/fk-rules-editor.js +1 -1
  42. package/dist/components/fk-select-input.js +1 -1
  43. package/dist/components/fk-signature-input.js +1 -1
  44. package/dist/components/fk-stepper.js +1 -1
  45. package/dist/components/fk-tabs.js +1 -1
  46. package/dist/components/index.js +1 -1
  47. package/dist/components/{p-B4vAN-UA.js → p--vL6GR31.js} +1 -1
  48. package/dist/components/p-4COASNrZ.js +1 -0
  49. package/dist/components/p-BB4Llg42.js +1 -0
  50. package/dist/components/p-BGkZP87K.js +1 -0
  51. package/dist/components/p-BOmBVgfJ.js +1 -0
  52. package/dist/components/p-BWdm2a6q.js +1 -0
  53. package/dist/components/{p-D318uFl-.js → p-B_-x-GlA.js} +1 -1
  54. package/dist/components/p-Br1s4Ujx.js +1 -0
  55. package/dist/components/p-C-wnqV3i.js +1 -0
  56. package/dist/components/{p-ZEW2q-4b.js → p-CIfjRTky.js} +1 -1
  57. package/dist/components/{p-dX7Lo8Fe.js → p-CKMHMpID.js} +1 -1
  58. package/dist/components/p-CUF31e-P.js +1 -0
  59. package/dist/components/p-CWQX0sXS.js +1 -0
  60. package/dist/components/p-D6n74M9d.js +1 -0
  61. package/dist/components/{p-DJDrDvoC.js → p-DFe3zZCI.js} +1 -1
  62. package/dist/components/p-DMCkrZqi.js +1 -0
  63. package/dist/components/p-DOInQkG6.js +1 -0
  64. package/dist/components/{p-BNREw7TY.js → p-DYchD23x.js} +1 -1
  65. package/dist/components/p-DtcM1yw5.js +1 -0
  66. package/dist/components/{p-BB3BQPr8.js → p-NDbmiiYk.js} +1 -1
  67. package/dist/components/p-PAr7WoWG.js +1 -0
  68. package/dist/components/{p-Ctt--jpe.js → p-YyGnQmX-.js} +1 -1
  69. package/dist/components/{p-DtzMNM4i.js → p-fDJP6whN.js} +1 -1
  70. package/dist/components/p-swxZqinH.js +1 -0
  71. package/dist/components/{p-BXFug2Ql.js → p-v7LxwCAc.js} +1 -1
  72. package/dist/components/p-wuC5rVU7.js +1 -0
  73. package/dist/esm/fk-brick-actions_18.entry.js +254 -22472
  74. package/dist/esm/formkrafter-wc.js +3 -3
  75. package/dist/esm/index-BAcz7b5u.js +5416 -0
  76. package/dist/esm/index-BkRMoLXK.js +3029 -0
  77. package/dist/esm/index-CGMDfZ5m.js +1808 -0
  78. package/dist/esm/{index-BTmZ8XET.js → index-D7Cta1UB.js} +236 -36
  79. package/dist/esm/index-DtcM1yw5.js +3991 -0
  80. package/dist/esm/index-DuVf3NlP.js +12222 -0
  81. package/dist/esm/{index-BQqrzKxo.js → index-qLZlXROB.js} +40 -4
  82. package/dist/esm/index.js +2 -2
  83. package/dist/esm/loader.js +3 -3
  84. package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
  85. package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
  86. package/dist/formkrafter-wc/index.esm.js +1 -1
  87. package/dist/formkrafter-wc/p-4COASNrZ.js +1 -0
  88. package/dist/formkrafter-wc/p-6d29555b.entry.js +1 -0
  89. package/dist/formkrafter-wc/p-C-wnqV3i.js +1 -0
  90. package/dist/formkrafter-wc/p-DMCkrZqi.js +1 -0
  91. package/dist/formkrafter-wc/p-DOInQkG6.js +1 -0
  92. package/dist/formkrafter-wc/{p-BXIsVlA6.js → p-Ddu6BquK.js} +4 -4
  93. package/dist/formkrafter-wc/p-DtcM1yw5.js +1 -0
  94. package/dist/formkrafter-wc/p-qLZlXROB.js +2 -0
  95. package/dist/types/components/fk-brick-render/fk-brick-render.d.ts +1 -0
  96. package/dist/types/components/fk-code-editor/fk-code-editor.d.ts +2 -1
  97. package/dist/types/components/fk-file-input/fk-file-input.d.ts +9 -2
  98. package/dist/types/components/fk-select-input/fk-select-input.d.ts +9 -0
  99. package/dist/types/components.d.ts +27 -4
  100. package/dist/types/home/runner/work/formkrafter/formkrafter/packages/wc/.stencil/stencil.config.d.ts +2 -0
  101. package/dist/types/index.d.ts +1 -1
  102. package/dist/types/registry/default-bricks.d.ts +73 -54
  103. package/package.json +11 -2
  104. package/dist/components/p-BCQ-hj6j.js +0 -1
  105. package/dist/components/p-BIEpAM4V.js +0 -1
  106. package/dist/components/p-BLKRn62s.js +0 -1
  107. package/dist/components/p-BOvjVIvo.js +0 -1
  108. package/dist/components/p-BQP1WryV.js +0 -1
  109. package/dist/components/p-DKGyje7v.js +0 -1
  110. package/dist/components/p-DKoJovNt.js +0 -1
  111. package/dist/components/p-DWgjI3TW.js +0 -1
  112. package/dist/components/p-QC41Uj05.js +0 -1
  113. package/dist/components/p-TvmRksgg.js +0 -1
  114. package/dist/formkrafter-wc/p-BQqrzKxo.js +0 -2
  115. package/dist/formkrafter-wc/p-f6bc0be0.entry.js +0 -1
  116. package/dist/types/Users/datagnikan/Desktop/WorkSpace/streamline-pulse/formkrafter-js/formkrafter/packages/wc/.stencil/stencil.config.d.ts +0 -2
@@ -0,0 +1 @@
1
+ import{StateEffect as t,Facet as e,StateField as i,countColumn as r,EditorState as n,RangeSetBuilder as s,RangeSet as l,Prec as o,combineConfig as h}from"./p-DtcM1yw5.js";import{V as u,E as a,g as f,a as c,S as d,D as g,G as p,W as m,l as w}from"./p-DMCkrZqi.js";const b=1024;let k=0;class v{constructor(t,e){this.from=t,this.to=e}}class y{constructor(t={}){this.id=k++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=N.match(t)),e=>{let i=t(e);return void 0===i?null:[this,i]}}}y.closedBy=new y({deserialize:t=>t.split(" ")}),y.openedBy=new y({deserialize:t=>t.split(" ")}),y.group=new y({deserialize:t=>t.split(" ")}),y.isolate=new y({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),y.contextHash=new y({perNode:!0}),y.lookAhead=new y({perNode:!0}),y.mounted=new y({perNode:!0});class x{constructor(t,e,i,r=!1){this.tree=t,this.overlay=e,this.parser=i,this.bracketed=r}static get(t){return t&&t.props&&t.props[y.mounted.id]}}const S=Object.create(null);class N{constructor(t,e,i,r=0){this.name=t,this.props=e,this.id=i,this.flags=r}static define(t){let e=t.props&&t.props.length?Object.create(null):S,i=new N(t.name||"",e,t.id,(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0));if(t.props)for(let r of t.props)if(Array.isArray(r)||(r=r(i)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}return i}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(y.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let r of i.split(" "))e[r]=t[i];return t=>{for(let i=t.prop(y.group),r=-1;r<(i?i.length:0);r++){let n=e[r<0?t.name:i[r]];if(n)return n}}}}N.none=new N("",Object.create(null),0,8);class M{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let i of this.types){let r=null;for(let e of t){let t=e(i);if(t){r||(r=Object.assign({},i.props));let e=t[1],n=t[0];n.combine&&n.id in r&&(e=n.combine(r[n.id],e)),r[n.id]=e}}e.push(r?new N(i.name,r,i.id,i.flags):i)}return new M(e)}}const C=new WeakMap,O=new WeakMap;var I;!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"}(I||(I={}));class A{constructor(t,e,i,r,n){if(this.type=t,this.children=e,this.positions=i,this.length=r,this.props=null,n&&n.length){this.props=Object.create(null);for(let[t,e]of n)this.props["number"==typeof t?t:t.id]=e}}toString(){let t=x.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let t of this.children){let i=t.toString();i&&(e&&(e+=","),e+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new q(this.topNode,t)}cursorAt(t,e=0,i=0){let r=C.get(this)||this.topNode,n=new q(r);return n.moveTo(t,e),C.set(this,n._tree),n}get topNode(){return new P(this,0,0,null)}resolve(t,e=0){let i=B(C.get(this)||this.topNode,t,e,!1);return C.set(this,i),i}resolveInner(t,e=0){let i=B(O.get(this)||this.topNode,t,e,!0);return O.set(this,i),i}resolveStack(t,e=0){return function(t,e,i){let r=t.resolveInner(e,i),n=null;for(let t=r instanceof P?r:r.context.parent;t;t=t.parent)if(t.index<0){let s=t.parent;(n||(n=[r])).push(s.resolve(e,i)),t=s}else{let s=x.get(t.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let l=new P(s.tree,s.overlay[0].from+t.from,-1,t);(n||(n=[r])).push(B(l,e,i,!1))}}return n?z(n):r}(this,t,e)}iterate(t){let{enter:e,leave:i,from:r=0,to:n=this.length}=t,s=t.mode||0,l=(s&I.IncludeAnonymous)>0;for(let t=this.cursor(s|I.IncludeAnonymous);;){let s=!1;if(t.from<=n&&t.to>=r&&(!l&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;s=!0}for(;s&&i&&(l||!t.type.isAnonymous)&&i(t),!t.nextSibling();){if(!t.parent())return;s=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:_(N.none,this.children,this.positions,0,this.children.length,0,this.length,((t,e,i)=>new A(this.type,t,e,i,this.propValues)),t.makeTree||((t,e,i)=>new A(N.none,t,e,i)))}static build(t){return function(t){var e;let{buffer:i,nodeSet:r,maxBufferLength:n=b,reused:s=[],minRepeatType:l=r.types.length}=t,o=Array.isArray(i)?new T(i,i.length):i,h=r.types,u=0,a=0;function f(t,e,i,m,w,b){let{id:k,start:v,end:x,size:S}=o,N=a,M=u;if(S<0){if(o.next(),-1==S)return i.push(s[k]),void m.push(v-t);if(-3==S)return void(u=k);if(-4==S)return void(a=k);throw new RangeError(`Unrecognized record size: ${S}`)}let C,O,I=h[k],T=v-t;if(x-v<=n&&(O=function(t,e){let i=o.fork(),r=0,s=0,h=0,u=i.end-n,a={size:0,start:0,skip:0};t:for(let n=i.pos-t;i.pos>n;){let t=i.size;if(i.id==e&&t>=0){a.size=r,a.start=s,a.skip=h,h+=4,r+=4,i.next();continue}let o=i.pos-t;if(t<0||o<n||i.start<u)break;let f=i.id>=l?4:0,c=i.start;for(i.next();i.pos>o;){if(i.size<0){if(-3!=i.size&&-4!=i.size)break t;f+=4}else i.id>=l&&(f+=4);i.next()}s=c,r+=t,h+=f}return(e<0||r==t)&&(a.size=r,a.start=s,a.skip=h),a.size>4?a:void 0}(o.pos-e,w))){let e=new Uint16Array(O.size-O.skip),i=o.pos-O.size,n=e.length;for(;o.pos>i;)n=p(O.start,e,n);C=new D(e,x-O.start,r),T=O.start-t}else{let t=o.pos-S;o.next();let e=[],i=[],r=k>=l?k:-1,s=0,h=x;for(;o.pos>t;)r>=0&&o.id==r&&o.size>=0?(o.end<=h-n&&(d(e,i,v,s,o.end,h,r,N,M),s=e.length,h=o.end),o.next()):b>2500?c(v,t,e,i):f(v,t,e,i,r,b+1);if(r>=0&&s>0&&s<e.length&&d(e,i,v,s,v,h,r,N,M),e.reverse(),i.reverse(),r>-1&&s>0){let t=function(t,e){return(i,r,n)=>{let s,l,o=0,h=i.length-1;if(h>=0&&(s=i[h])instanceof A){if(!h&&s.type==t&&s.length==n)return s;(l=s.prop(y.lookAhead))&&(o=r[h]+s.length+l)}return g(t,i,r,n,o,e)}}(I,M);C=_(I,e,i,0,e.length,0,x-v,t,t)}else C=g(I,e,i,x-v,N-x,M)}i.push(C),m.push(T)}function c(t,e,i,s){let l=[],h=0,u=-1;for(;o.pos>e;){let{id:t,start:e,end:i,size:r}=o;if(r>4)o.next();else{if(u>-1&&e<u)break;u<0&&(u=i-n),l.push(t,e,i),h++,o.next()}}if(h){let e=new Uint16Array(4*h),n=l[l.length-2];for(let t=l.length-3,i=0;t>=0;t-=3)e[i++]=l[t],e[i++]=l[t+1]-n,e[i++]=l[t+2]-n,e[i++]=i;i.push(new D(e,l[2]-n,r)),s.push(n-t)}}function d(t,e,i,n,s,l,o,h,u){let a=[],f=[];for(;t.length>n;)a.push(t.pop()),f.push(e.pop()+i-s);t.push(g(r.types[o],a,f,l-s,h-l,u)),e.push(s-i)}function g(t,e,i,r,n,s,l){if(s){let t=[y.contextHash,s];l=l?[t].concat(l):[t]}if(n>25){let t=[y.lookAhead,n];l=l?[t].concat(l):[t]}return new A(t,e,i,r,l)}function p(t,e,i){let{id:r,start:n,end:s,size:h}=o;if(o.next(),h>=0&&r<l){let l=i;if(h>4){let r=o.pos-(h-4);for(;o.pos>r;)i=p(t,e,i)}e[--i]=l,e[--i]=s-t,e[--i]=n-t,e[--i]=r}else-3==h?u=r:-4==h&&(a=r);return i}let m=[],w=[];for(;o.pos>0;)f(t.start||0,t.bufferStart||0,m,w,-1,0);let k=null!==(e=t.length)&&void 0!==e?e:m.length?w[0]+m[0].length:0;return new A(h[t.topID],m.reverse(),w.reverse(),k)}(t)}}A.empty=new A(N.none,[],[],0);class T{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new T(this.buffer,this.index)}}class D{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return N.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t+3],i=this.set.types[this.buffer[t]],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),e==(t+=4))return r;let n=[];for(;t<e;)n.push(this.childString(t)),t=this.buffer[t+3];return r+"("+n.join(",")+")"}findChild(t,e,i,r,n){let{buffer:s}=this,l=-1;for(let o=t;o!=e&&!(E(n,r,s[o+1],s[o+2])&&(l=o,i>0));o=s[o+3]);return l}slice(t,e,i){let r=this.buffer,n=new Uint16Array(e-t),s=0;for(let l=t,o=0;l<e;){n[o++]=r[l++],n[o++]=r[l++]-i;let e=n[o++]=r[l++]-i;n[o++]=r[l++]-t,s=Math.max(s,e)}return new D(n,s,this.set)}}function E(t,e,i,r){switch(t){case-2:return i<e;case-1:return r>=e&&i<e;case 0:return i<e&&r>e;case 1:return i<=e&&r>e;case 2:return r>e;case 4:return!0}}function B(t,e,i,r){for(var n;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){let e=!r&&t instanceof P&&t.index<0?null:t.parent;if(!e)return t;t=e}let s=r?0:I.IgnoreOverlays;if(r)for(let r=t,l=r.parent;l;r=l,l=r.parent)r instanceof P&&r.index<0&&(null===(n=l.enter(e,i,s))||void 0===n?void 0:n.from)!=r.from&&(t=l);for(;;){let r=t.enter(e,i,s);if(!r)return t;t=r}}class j{cursor(t=0){return new q(this,t)}getChild(t,e=null,i=null){let r=R(this,t,e,i);return r.length?r[0]:null}getChildren(t,e=null,i=null){return R(this,t,e,i)}resolve(t,e=0){return B(this,t,e,!1)}resolveInner(t,e=0){return B(this,t,e,!0)}matchContext(t){return L(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let t=e.lastChild;if(!t||t.to!=e.to)break;t.type.isError&&t.from==t.to?(i=e,e=t.prevSibling):e=t}return i}get node(){return this}get next(){return this.parent}}class P extends j{constructor(t,e,i,r){super(),this._tree=t,this.from=e,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,i,r,n=0){for(let s=this;;){for(let{children:l,positions:o}=s._tree,h=e>0?l.length:-1;t!=h;t+=e){let h,u=l[t],a=o[t]+s.from;if(n&I.EnterBracketed&&u instanceof A&&(h=x.get(u))&&!h.overlay&&h.bracketed&&i>=a&&i<=a+u.length||E(r,i,a,a+u.length))if(u instanceof D){if(n&I.ExcludeBuffers)continue;let l=u.findChild(0,u.buffer.length,e,i-a,r);if(l>-1)return new $(new W(s,u,t,a),null,l)}else if(n&I.IncludeAnonymous||!u.type.isAnonymous||F(u)){let l;if(!(n&I.IgnoreMounts)&&(l=x.get(u))&&!l.overlay)return new P(l.tree,a,t,s);let o=new P(u,a,t,s);return n&I.IncludeAnonymous||!o.type.isAnonymous?o:o.nextChild(e<0?u.children.length-1:0,e,i,r,n)}}if(n&I.IncludeAnonymous||!s.type.isAnonymous)return null;if(t=s.index>=0?s.index+e:e<0?-1:s._parent._tree.children.length,s=s._parent,!s)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,e,i=0){let r;if(!(i&I.IgnoreOverlays)&&(r=x.get(this._tree))&&r.overlay){let n=t-this.from,s=i&I.EnterBracketed&&r.bracketed;for(let{from:t,to:i}of r.overlay)if((e>0||s?t<=n:t<n)&&(e<0||s?i>=n:i>n))return new P(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function R(t,e,i,r){let n=t.cursor(),s=[];if(!n.firstChild())return s;if(null!=i)for(let t=!1;!t;)if(t=n.type.is(i),!n.nextSibling())return s;for(;;){if(null!=r&&n.type.is(r))return s;if(n.type.is(e)&&s.push(n.node),!n.nextSibling())return null==r?s:[]}}function L(t,e,i=e.length-1){for(let r=t;i>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[i]&&e[i]!=r.name)return!1;i--}}return!0}class W{constructor(t,e,i,r){this.parent=t,this.buffer=e,this.index=i,this.start=r}}class $ extends j{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],t,e-this.context.start,i);return n<0?null:new $(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,e,i=0){if(i&I.ExcludeBuffers)return null;let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return n<0?null:new $(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new $(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new $(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,r=this.index+4,n=i.buffer[this.index+3];return n>r&&(t.push(i.slice(r,n,i.buffer[this.index+1])),e.push(0)),new A(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function z(t){if(!t.length)return null;let e=0,i=t[0];for(let r=1;r<t.length;r++){let n=t[r];(n.from>i.from||n.to<i.to)&&(i=n,e=r)}let r=i instanceof P&&i.index<0?null:i.parent,n=t.slice();return r?n[e]=r:n.splice(e,1),new U(n,i)}class U{constructor(t,e){this.heads=t,this.node=e}get next(){return z(this.heads)}}class q{get name(){return this.type.name}constructor(t,e=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=e&~I.EnterBracketed,t instanceof P)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let e=t._parent;e;e=e._parent)this.stack.unshift(e.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}yieldBuf(t,e){this.index=t;let{start:i,buffer:r}=this.buffer;return this.type=e||r.set.types[r.buffer[t]],this.from=i+r.buffer[t+1],this.to=i+r.buffer[t+2],!0}yield(t){return!!t&&(t instanceof P?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:r}=this.buffer,n=r.findChild(this.index+4,r.buffer[this.index+3],t,e-this.buffer.start,i);return!(n<0)&&(this.stack.push(this.index),this.yieldBuf(n))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?!(i&I.ExcludeBuffers)&&this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&I.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&I.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let t=i<0?0:this.stack[i]+4;if(this.index!=t)return this.yieldBuf(e.findChild(t,this.index,-1,0,4))}else{let t=e.buffer[this.index+3];if(t<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(t)}return i<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:r}=this;if(r){if(t>0){if(this.index<r.buffer.buffer.length)return!1}else for(let t=0;t<this.index;t++)if(r.buffer.buffer[t+3]<this.index)return!1;({index:e,parent:i}=r)}else({index:e,_parent:i}=this._tree);for(;i;({index:e,_parent:i}=i))if(e>-1)for(let r=e+t,n=t<0?-1:i._tree.children.length;r!=n;r+=t){let t=i._tree.children[r];if(this.mode&I.IncludeAnonymous||t instanceof D||!t.type.isAnonymous||F(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let r=this.index,n=this.stack.length;n>=0;){for(let s=t;s;s=s._parent)if(s.index==r){if(r==this.index)return s;e=s,i=n+1;break t}r=this.stack[--n]}for(let t=i;t<this.stack.length;t++)e=new $(this.buffer,e,this.stack[t]);return this.bufferNode=new $(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let r=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&e&&e(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(t){if(!this.buffer)return L(this.node.parent,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let r=t.length-1,n=this.stack.length-1;r>=0;n--){if(n<0)return L(this._tree,t,r);let s=i[e.buffer[this.stack[n]]];if(!s.isAnonymous){if(t[r]&&t[r]!=s.name)return!1;r--}}return!0}}function F(t){return t.children.some((t=>t instanceof D||!t.type.isAnonymous||F(t)))}const H=new WeakMap;function J(t,e){if(!t.isAnonymous||e instanceof D||e.type!=t)return 1;let i=H.get(e);if(null==i){i=1;for(let r of e.children){if(r.type!=t||!(r instanceof A)){i=1;break}i+=J(t,r)}H.set(e,i)}return i}function _(t,e,i,r,n,s,l,o,h){let u=0;for(let i=r;i<n;i++)u+=J(t,e[i]);let a=Math.ceil(1.5*u/8),f=[],c=[];return function e(i,r,n,l,o){for(let u=n;u<l;){let n=u,d=r[u],g=J(t,i[u]);for(u++;u<l;u++){let e=J(t,i[u]);if(g+e>=a)break;g+=e}if(u==n+1){if(g>a){let t=i[n];e(t.children,t.positions,0,t.children.length,r[n]+o);continue}f.push(i[n])}else f.push(_(t,i,r,n,u,d,r[u-1]+i[u-1].length-d,null,h));c.push(d+o-s)}}(e,i,r,n,0),(o||h)(f,c,l)}class G{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let r=this.map.get(t);r||this.map.set(t,r=new Map),r.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof $?this.setBuffer(t.context.buffer,t.index,e):t instanceof P&&this.map.set(t.tree,e)}get(t){return t instanceof $?this.getBuffer(t.context.buffer,t.index):t instanceof P?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class K{constructor(t,e,i,r,n=!1,s=!1){this.from=t,this.to=e,this.tree=i,this.offset=r,this.open=(n?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],i=!1){let r=[new K(0,t.length,t,0,!1,i)];for(let i of e)i.to>t.length&&r.push(i);return r}static applyChanges(t,e,i=128){if(!e.length)return t;let r=[],n=1,s=t.length?t[0]:null;for(let l=0,o=0,h=0;;l++){let u=l<e.length?e[l]:null,a=u?u.fromA:1e9;if(a-o>=i)for(;s&&s.from<a;){let e=s;if(o>=e.from||a<=e.to||h){let t=Math.max(e.from,o)-h,i=Math.min(e.to,a)-h;e=t>=i?null:new K(t,i,e.tree,e.offset+h,l>0,!!u)}if(e&&r.push(e),s.to>a)break;s=n<t.length?t[n++]:null}if(!u)break;o=u.toA,h=u.toA-u.toB}return r}}class V{startParse(t,e,i){return"string"==typeof t&&(t=new Z(t)),i=i?i.length?i.map((t=>new v(t.from,t.to))):[new v(0,0)]:[new v(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let r=this.startParse(t,e,i);for(;;){let t=r.advance();if(t)return t}}}class Z{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new y({perNode:!0});let Q=0;class X{constructor(t,e,i,r){this.name=t,this.set=e,this.base=i,this.modified=r,this.id=Q++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i="string"==typeof t?t:"?";if(t instanceof X&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let r=new X(i,[],null,[]);if(r.set.push(r),e)for(let t of e.set)r.set.push(t);return r}static defineModifier(t){let e=new tt(t);return t=>t.modified.indexOf(e)>-1?t:tt.get(t.base||t,t.modified.concat(e).sort(((t,e)=>t.id-e.id)))}}let Y=0;class tt{constructor(t){this.name=t,this.instances=[],this.id=Y++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find((i=>{return i.base==t&&(r=e).length==(n=i.modified).length&&r.every(((t,e)=>t==n[e]));var r,n}));if(i)return i;let r=[],n=new X(t.name,r,t,e);for(let t of e)t.instances.push(n);let s=function(t){let e=[[]];for(let i=0;i<t.length;i++)for(let r=0,n=e.length;r<n;r++)e.push(e[r].concat(t[i]));return e.sort(((t,e)=>e.length-t.length))}(e);for(let e of t.set)if(!e.modified.length)for(let t of s)r.push(tt.get(e,t));return n}}function et(t){let e=Object.create(null);for(let i in t){let r=t[i];Array.isArray(r)||(r=[r]);for(let t of i.split(" "))if(t){let i=[],n=2,s=t;for(let e=0;;){if("..."==s&&e>0&&e+3==t.length){n=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!r)throw new RangeError("Invalid path: "+t);if(i.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),e+=r[0].length,e==t.length)break;let l=t[e++];if(e==t.length&&"!"==l){n=0;break}if("/"!=l)throw new RangeError("Invalid path: "+t);s=t.slice(e)}let l=i.length-1,o=i[l];if(!o)throw new RangeError("Invalid path: "+t);let h=new rt(r,n,l>0?i.slice(0,l):null);e[o]=h.sort(e[o])}}return it.add(e)}const it=new y({combine(t,e){let i,r,n;for(;t||e;){if(!t||e&&t.depth>=e.depth?(n=e,e=e.next):(n=t,t=t.next),i&&i.mode==n.mode&&!n.context&&!i.context)continue;let s=new rt(n.tags,n.mode,n.context);i?i.next=s:r=s,i=s}return r}});class rt{constructor(t,e,i,r){this.tags=t,this.mode=e,this.context=i,this.next=r}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}function nt(t,e){let i=Object.create(null);for(let e of t)if(Array.isArray(e.tag))for(let t of e.tag)i[t.id]=e.class;else i[e.tag.id]=e.class;let{scope:r,all:n=null}=e||{};return{style:t=>{let e=n;for(let r of t)for(let t of r.set){let r=i[t.id];if(r){e=e?e+" "+r:r;break}}return e},scope:r}}function st(t,e,i,r=0,n=t.length){let s=new lt(r,Array.isArray(e)?e:[e],i);s.highlightRange(t.cursor(),r,n,"",s.highlighters),s.flush(n)}rt.empty=new rt([],2,null);class lt{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,r,n){let{type:s,from:l,to:o}=t;if(l>=i||o<=e)return;s.isTop&&(n=this.highlighters.filter((t=>!t.scope||t.scope(s))));let h=r,u=function(t){let e=t.type.prop(it);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||rt.empty,a=function(t,e){let i=null;for(let r of t){let t=r.style(e);t&&(i=i?i+" "+t:t)}return i}(n,u.tags);if(a&&(h&&(h+=" "),h+=a,1==u.mode&&(r+=(r?" ":"")+a)),this.startSpan(Math.max(e,l),h),u.opaque)return;let f=t.tree&&t.tree.prop(y.mounted);if(f&&f.overlay){let s=t.node.enter(f.overlay[0].from+l,1),u=this.highlighters.filter((t=>!t.scope||t.scope(f.tree.type))),a=t.firstChild();for(let c=0,d=l;;c++){let g=c<f.overlay.length?f.overlay[c]:null,p=g?g.from+l:o,m=Math.max(e,d),w=Math.min(i,p);if(m<w&&a)for(;t.from<w&&(this.highlightRange(t,m,w,r,n),this.startSpan(Math.min(w,t.to),h),!(t.to>=p)&&t.nextSibling()););if(!g||p>i)break;d=g.to+l,d>e&&(this.highlightRange(s.cursor(),Math.max(e,g.from+l),Math.min(i,d),"",u),this.startSpan(Math.min(i,d),h))}a&&t.parent()}else if(t.firstChild()){f&&(r="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,r,n),this.startSpan(Math.min(i,t.to),h)}}while(t.nextSibling());t.parent()}}}const ot=X.define,ht=ot(),ut=ot(),at=ot(ut),ft=ot(ut),ct=ot(),dt=ot(ct),gt=ot(ct),pt=ot(),mt=ot(pt),wt=ot(),bt=ot(),kt=ot(),vt=ot(kt),yt=ot(),xt={comment:ht,lineComment:ot(ht),blockComment:ot(ht),docComment:ot(ht),name:ut,variableName:ot(ut),typeName:at,tagName:ot(at),propertyName:ft,attributeName:ot(ft),className:ot(ut),labelName:ot(ut),namespace:ot(ut),macroName:ot(ut),literal:ct,string:dt,docString:ot(dt),character:ot(dt),attributeValue:ot(dt),number:gt,integer:ot(gt),float:ot(gt),bool:ot(ct),regexp:ot(ct),escape:ot(ct),color:ot(ct),url:ot(ct),keyword:wt,self:ot(wt),null:ot(wt),atom:ot(wt),unit:ot(wt),modifier:ot(wt),operatorKeyword:ot(wt),controlKeyword:ot(wt),definitionKeyword:ot(wt),moduleKeyword:ot(wt),operator:bt,derefOperator:ot(bt),arithmeticOperator:ot(bt),logicOperator:ot(bt),bitwiseOperator:ot(bt),compareOperator:ot(bt),updateOperator:ot(bt),definitionOperator:ot(bt),typeOperator:ot(bt),controlOperator:ot(bt),punctuation:kt,separator:ot(kt),bracket:vt,angleBracket:ot(vt),squareBracket:ot(vt),paren:ot(vt),brace:ot(vt),content:pt,heading:mt,heading1:ot(mt),heading2:ot(mt),heading3:ot(mt),heading4:ot(mt),heading5:ot(mt),heading6:ot(mt),contentSeparator:ot(pt),list:ot(pt),quote:ot(pt),emphasis:ot(pt),strong:ot(pt),link:ot(pt),monospace:ot(pt),strikethrough:ot(pt),inserted:ot(),deleted:ot(),changed:ot(),invalid:ot(),meta:yt,documentMeta:ot(yt),annotation:ot(yt),processingInstruction:ot(yt),definition:X.defineModifier("definition"),constant:X.defineModifier("constant"),function:X.defineModifier("function"),standard:X.defineModifier("standard"),local:X.defineModifier("local"),special:X.defineModifier("special")};for(let t in xt){let e=xt[t];e instanceof X&&(e.name=t)}var St;nt([{tag:xt.link,class:"tok-link"},{tag:xt.heading,class:"tok-heading"},{tag:xt.emphasis,class:"tok-emphasis"},{tag:xt.strong,class:"tok-strong"},{tag:xt.keyword,class:"tok-keyword"},{tag:xt.atom,class:"tok-atom"},{tag:xt.bool,class:"tok-bool"},{tag:xt.url,class:"tok-url"},{tag:xt.labelName,class:"tok-labelName"},{tag:xt.inserted,class:"tok-inserted"},{tag:xt.deleted,class:"tok-deleted"},{tag:xt.literal,class:"tok-literal"},{tag:xt.string,class:"tok-string"},{tag:xt.number,class:"tok-number"},{tag:[xt.regexp,xt.escape,xt.special(xt.string)],class:"tok-string2"},{tag:xt.variableName,class:"tok-variableName"},{tag:xt.local(xt.variableName),class:"tok-variableName tok-local"},{tag:xt.definition(xt.variableName),class:"tok-variableName tok-definition"},{tag:xt.special(xt.variableName),class:"tok-variableName2"},{tag:xt.definition(xt.propertyName),class:"tok-propertyName tok-definition"},{tag:xt.typeName,class:"tok-typeName"},{tag:xt.namespace,class:"tok-namespace"},{tag:xt.className,class:"tok-className"},{tag:xt.macroName,class:"tok-macroName"},{tag:xt.propertyName,class:"tok-propertyName"},{tag:xt.operator,class:"tok-operator"},{tag:xt.comment,class:"tok-comment"},{tag:xt.meta,class:"tok-meta"},{tag:xt.invalid,class:"tok-invalid"},{tag:xt.punctuation,class:"tok-punctuation"}]);const Nt=new y;function Mt(t){return e.define({combine:t?e=>e.concat(t):void 0})}const Ct=new y;class Ot{constructor(t,e,i=[],r=""){this.data=t,this.name=r,n.prototype.hasOwnProperty("tree")||Object.defineProperty(n.prototype,"tree",{get(){return Tt(this)}}),this.parser=e,this.extension=[zt.of(this),n.languageData.of(((t,e,i)=>{let r=It(t,e,i),n=r.type.prop(Nt);if(!n)return[];let s=t.facet(n),l=r.type.prop(Ct);if(l){let n=r.resolve(e-r.from,i);for(let e of l)if(e.test(n,t)){let i=t.facet(e.facet);return"replace"==e.type?i:i.concat(s)}}return s}))].concat(i)}isActiveAt(t,e,i=-1){return It(t,e,i).type.prop(Nt)==this.data}findRegions(t){let e=t.facet(zt);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],r=(t,e)=>{if(t.prop(Nt)==this.data)return void i.push({from:e,to:e+t.length});let n=t.prop(y.mounted);if(n){if(n.tree.prop(Nt)==this.data){if(n.overlay)for(let t of n.overlay)i.push({from:t.from+e,to:t.to+e});else i.push({from:e,to:e+t.length});return}if(n.overlay){let t=i.length;if(r(n.tree,n.overlay[0].from+e),i.length>t)return}}for(let i=0;i<t.children.length;i++){let n=t.children[i];n instanceof A&&r(n,t.positions[i]+e)}};return r(Tt(t),0),i}get allowsNesting(){return!0}}function It(t,e,i){let r=t.facet(zt),n=Tt(t).topNode;if(!r||r.allowsNesting)for(let t=n;t;t=t.enter(e,i,I.ExcludeBuffers|I.EnterBracketed))t.type.isTop&&(n=t);return n}Ot.setState=t.define();class At extends Ot{constructor(t,e,i){super(t,e,[],i),this.parser=e}static define(t){let e=Mt(t.languageData);return new At(e,t.parser.configure({props:[Nt.add((t=>t.isTop?e:void 0))]}),t.name)}configure(t,e){return new At(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Tt(t){let e=t.field(Ot.state,!1);return e?e.tree:A.empty}function Dt(t,e,i=50){var r;let n=null===(r=t.field(Ot.state,!1))||void 0===r?void 0:r.context;if(!n)return null;let s=n.viewport;n.updateViewport({from:0,to:e});let l=n.isDone(e)||n.work(i,e)?n.tree:null;return n.updateViewport(s),l}class Et{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let Bt=null;class jt{constructor(t,e,i=[],r,n,s,l,o){this.parser=t,this.state=e,this.fragments=i,this.tree=r,this.treeLen=n,this.viewport=s,this.skipped=l,this.scheduleOn=o,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new jt(t,e,[],A.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Et(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=A.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var i;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(K.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(i=this.parse.stoppedAt)&&void 0!==i?i:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}}))}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(K.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=Bt;Bt=this;try{return t()}finally{Bt=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Pt(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:r,treeLen:n,viewport:s,skipped:l}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,i,r,n)=>e.push({fromA:t,toA:i,fromB:r,toB:n}))),i=K.applyChanges(i,e),r=A.empty,n=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){l=[];for(let e of this.skipped){let i=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);i<r&&l.push({from:i,to:r})}}}return new jt(this.parser,e,i,r,n,s,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:i,to:r}=this.skipped[e];i<t.to&&r>t.from&&(this.fragments=Pt(this.fragments,i,r),this.skipped.splice(e--,1))}return!(this.skipped.length>=e||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends V{createParse(e,i,r){let n=r[0].from,s=r[r.length-1].to;return{parsedPos:n,advance(){let e=Bt;if(e){for(let t of r)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=s,new A(N.none,[],[],s-n)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return Bt}}function Pt(t,e,i){return K.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class Rt{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Rt(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=jt.create(t.facet(zt).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Rt(i)}}Ot.state=i.define({create:Rt.init,update(t,e){for(let t of e.effects)if(t.is(Ot.setState))return t.value;return e.startState.facet(zt)!=e.state.facet(zt)?Rt.init(e.state):t.apply(e)}});let Lt=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(Lt=t=>{let e=-1,i=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const Wt="undefined"!=typeof navigator&&(null===(St=navigator.scheduling)||void 0===St?void 0:St.isInputPending)?()=>navigator.scheduling.isInputPending():null,$t=u.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Ot.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Ot.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=Lt(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,n=i.field(Ot.state);if(n.tree==n.context.tree&&n.context.isDone(r+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,t&&!Wt?Math.max(25,t.timeRemaining()-5):1e9),l=n.context.treeLen<r&&i.doc.length>r+1e3,o=n.context.work((()=>Wt&&Wt()||Date.now()>s),r+(l?0:1e5));this.chunkBudget-=Date.now()-e,(o||this.chunkBudget<=0)&&(n.context.takeTree(),this.view.dispatch({effects:Ot.setState.of(new Rt(n.context))})),this.chunkBudget>0&&(!o||l)&&this.scheduleWork(),this.checkAsyncSchedule(n.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>w(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),zt=e.define({combine:t=>t.length?t[0]:null,enables:t=>[Ot.state,$t,a.contentAttributes.compute([t],(e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}}))]});class Ut{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class qt{constructor(t,e,i,r,n,s){this.name=t,this.alias=e,this.extensions=i,this.filename=r,this.loadFunc=n,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{throw this.loading=null,t})))}static of(t){let{load:e,support:i}=t;if(!e){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(i)}return new qt(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,i)}static matchFilename(t,e){for(let i of t)if(i.filename&&i.filename.test(e))return i;let i=/\.([^.]+)$/.exec(e);if(i)for(let e of t)if(e.extensions.indexOf(i[1])>-1)return e;return null}static matchLanguageName(t,e,i=!0){e=e.toLowerCase();for(let i of t)if(i.alias.some((t=>t==e)))return i;if(i)for(let i of t)for(let t of i.alias){let r=e.indexOf(t);if(r>-1&&(t.length>2||!/\w/.test(e[r-1])&&!/\w/.test(e[r+t.length])))return i}return null}}const Ft=e.define(),Ht=e.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Jt(t){let e=t.facet(Ht);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function _t(t,e){let i="",r=t.tabSize,n=t.facet(Ht)[0];if("\t"==n){for(;e>=r;)i+="\t",e-=r;n=" "}for(let t=0;t<e;t++)i+=n;return i}function Gt(t,e){t instanceof n&&(t=new Kt(t));for(let i of t.state.facet(Ft)){let r=i(t,e);if(void 0!==r)return r}let i=Tt(t.state);return i.length>=e?function(t,e,i){let r=e.resolveStack(i),n=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(n!=r.node){let t=[];for(let e=n;e&&!(e.from<r.node.from||e.to>r.node.to||e.from==r.node.from&&e.type==r.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)r={node:t[e],next:r}}return Zt(r,t,i)}(t,i,e):null}class Kt{constructor(t,e={}){this.state=t,this.options=e,this.unit=Jt(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:r,simulateDoubleBreak:n}=this.options;return null!=r&&r>=i.from&&r<=i.to?n&&r==t?{text:"",from:t}:(e<0?r<t:r<=t)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(t,e);return i.slice(t-r,Math.min(i.length,t+100-r))}column(t,e=1){let{text:i,from:r}=this.lineAt(t,e),n=this.countColumn(i,t-r),s=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return s>-1&&(n+=s-this.countColumn(i,i.search(/\S|$/))),n}countColumn(t,e=t.length){return r(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:r}=this.lineAt(t,e),n=this.options.overrideIndentation;if(n){let t=n(r);if(t>-1)return t}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Vt=new y;function Zt(t,e,i){for(let r=t;r;r=r.next){let t=Qt(r.node);if(t)return t(Yt.create(e,i,r))}return 0}function Qt(t){let e=t.type.prop(Vt);if(e)return e;let i,r=t.firstChild;if(r&&(i=r.type.prop(y.closedBy))){let e=t.lastChild,r=e&&i.indexOf(e.name)>-1;return t=>ie(t,!0,1,void 0,r&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?Xt:null}function Xt(){return 0}class Yt extends Kt{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Yt(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(te(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return Zt(this.context.next,this.base,this.pos)}}function te(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function ee({closing:t,align:e=!0,units:i=1}){return r=>ie(r,e,i,t)}function ie(t,e,i,r,n){let s=t.textAfter,l=s.match(/^\s*/)[0].length,o=r&&s.slice(l,l+r.length)==r||n==t.pos+l,h=e?function(t){let e=t.node,i=e.childAfter(e.from),r=e.lastChild;if(!i)return null;let n=t.options.simulateBreak,s=t.state.doc.lineAt(i.from),l=null==n||n<=s.from?s.to:Math.min(s.to,n);for(let t=i.to;;){let n=e.childAfter(t);if(!n||n==r)return null;if(!n.type.isSkipped){if(n.from>=l)return null;let t=/^ */.exec(s.text.slice(i.to-s.from))[0].length;return{from:i.from,to:i.to+t}}t=n.to}}(t):null;return h?t.column(o?h.from:h.to):t.baseIndent+(o?0:t.unit*i)}const re=t=>t.baseIndent;function ne({except:t,units:e=1}={}){return i=>{let r=t&&t.test(i.textAfter);return i.baseIndent+(r?0:e*i.unit)}}const se=e.define(),le=new y;function oe(t){let e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null}function he(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function ue(t,e,i){for(let r of t.facet(se)){let n=r(t,e,i);if(n)return n}return function(t,e,i){let r=Tt(t);if(r.length<i)return null;let n=null;for(let s=r.resolveStack(i,1);s;s=s.next){let l=s.node;if(l.to<=i||l.from>i)continue;if(n&&l.from<e)break;let o=l.type.prop(le);if(o&&(l.to<r.length-50||r.length==t.doc.length||!he(l))){let r=o(l,t);r&&r.from<=i&&r.from>=e&&r.to>i&&(n=r)}}return n}(t,e,i)}function ae(t,e){let i=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return i>=r?void 0:{from:i,to:r}}const fe=t.define({map:ae}),ce=t.define({map:ae});function de(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some((t=>t.from<=i&&t.to>=i))||e.push(t.lineBlockAt(i));return e}const ge=i.define({create:()=>c.none,update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges(((e,i)=>t=pe(t,e,i))),t=t.map(e.changes);let i=[];for(let r of e.effects)r.is(fe)&&!we(t,r.value.from,r.value.to)?i.push(r.value):r.is(ce)&&(t=t.update({filter:(t,e)=>r.value.from!=t||r.value.to!=e,filterFrom:r.value.from,filterTo:r.value.to}));if(i.length){let{preparePlaceholder:r}=e.state.facet(Oe),n=i.map((t=>(r?c.replace({widget:new De(r(e.state,t))}):Te).range(t.from,t.to)));t=t.update({add:n})}return e.selection&&(t=pe(t,e.selection.main.head)),t},provide:t=>a.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,((t,e)=>{i.push(t,e)})),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i<t.length;){let r=t[i++],n=t[i++];if("number"!=typeof r||"number"!=typeof n)throw new RangeError("Invalid JSON for fold state");e.push(Te.range(r,n))}return c.set(e,!0)}});function pe(t,e,i=e){let r=!1;return t.between(e,i,((t,n)=>{t<i&&n>e&&(r=!0)})),r?t.update({filterFrom:e,filterTo:i,filter:(t,r)=>t>=i||r<=e}):t}function me(t,e,i){var r;let n=null;return null===(r=t.field(ge,!1))||void 0===r||r.between(e,i,((t,e)=>{(!n||n.from>t)&&(n={from:t,to:e})})),n}function we(t,e,i){let r=!1;return t.between(e,e,((t,n)=>{t==e&&n==i&&(r=!0)})),r}function be(e,i){return e.field(ge,!1)?i:i.concat(t.appendConfig.of(Ie()))}const ke=t=>{for(let e of de(t)){let i=ue(t.state,e.from,e.to);if(i)return t.dispatch({effects:be(t.state,[fe.of(i),ye(t,i)])}),!0}return!1},ve=t=>{if(!t.state.field(ge,!1))return!1;let e=[];for(let i of de(t)){let r=me(t.state,i.from,i.to);r&&e.push(ce.of(r),ye(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function ye(t,e,i=!0){let r=t.state.doc.lineAt(e.from).number,n=t.state.doc.lineAt(e.to).number;return a.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${n}.`)}const xe=t=>{let{state:e}=t,i=[];for(let r=0;r<e.doc.length;){let n=t.lineBlockAt(r),s=ue(e,n.from,n.to);s&&i.push(fe.of(s)),r=(s?t.lineBlockAt(s.to):n).to+1}return i.length&&t.dispatch({effects:be(t.state,i)}),!!i.length},Se=t=>{let e=t.state.field(ge,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,((t,e)=>{i.push(ce.of({from:t,to:e}))})),t.dispatch({effects:i}),!0};function Ne(t,e){for(let i=e;;){let r=ue(t.state,i.from,i.to);if(r&&r.to>e.from)return r;if(!i.from)return null;i=t.lineBlockAt(i.from-1)}}const Me=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ke},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ve},{key:"Ctrl-Alt-[",run:xe},{key:"Ctrl-Alt-]",run:Se}],Ce={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Oe=e.define({combine:t=>h(t,Ce)});function Ie(t){let e=[ge,je];return t&&e.push(Oe.of(t)),e}function Ae(t,e){let{state:i}=t,r=i.facet(Oe),n=e=>{let i=t.lineBlockAt(t.posAtDOM(e.target)),r=me(t.state,i.from,i.to);r&&t.dispatch({effects:ce.of(r)}),e.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,n,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",i.phrase("folded code")),s.title=i.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=n,s}const Te=c.replace({widget:new class extends m{toDOM(t){return Ae(t,null)}}});class De extends m{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Ae(t,this.value)}}const Ee={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Be extends p{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}const je=a.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Pe{constructor(t,e){let i;function r(t){let e=d.newName();return(i||(i=Object.create(null)))["."+e]=t,e}this.specs=t;const n="string"==typeof e.all?e.all:e.all?r(e.all):void 0,s=e.scope;this.scope=s instanceof Ot?t=>t.prop(Nt)==s.data:s?t=>t==s:void 0,this.style=nt(t.map((t=>({tag:t.tag,class:t.class||r(Object.assign({},t,{tag:null}))}))),{all:n}).style,this.module=i?new d(i):null,this.themeType=e.themeType}static define(t,e){return new Pe(t,e||{})}}const Re=e.define(),Le=e.define({combine:t=>t.length?[t[0]]:null});function We(t){let e=t.facet(Re);return e.length?e:t.facet(Le)}class $e{constructor(t){this.markCache=Object.create(null),this.tree=Tt(t.state),this.decorations=this.buildDeco(t,We(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=Tt(t.state),i=We(t.state),r=i!=We(t.startState),{viewport:n}=t.view,s=t.changes.mapPos(this.decoratedTo,1);e.length<n.to&&!r&&e.type==this.tree.type&&s>=n.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(e!=this.tree||t.viewportChanged||r)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=n.to)}buildDeco(t,e){if(!e||!this.tree.length)return c.none;let i=new s;for(let{from:r,to:n}of t.visibleRanges)st(this.tree,e,((t,e,r)=>{i.add(t,e,this.markCache[r]||(this.markCache[r]=c.mark({class:r})))}),r,n);return i.finish()}}const ze=o.high(u.fromClass($e,{decorations:t=>t.decorations})),Ue=Pe.define([{tag:xt.meta,color:"#404740"},{tag:xt.link,textDecoration:"underline"},{tag:xt.heading,textDecoration:"underline",fontWeight:"bold"},{tag:xt.emphasis,fontStyle:"italic"},{tag:xt.strong,fontWeight:"bold"},{tag:xt.strikethrough,textDecoration:"line-through"},{tag:xt.keyword,color:"#708"},{tag:[xt.atom,xt.bool,xt.url,xt.contentSeparator,xt.labelName],color:"#219"},{tag:[xt.literal,xt.inserted],color:"#164"},{tag:[xt.string,xt.deleted],color:"#a11"},{tag:[xt.regexp,xt.escape,xt.special(xt.string)],color:"#e40"},{tag:xt.definition(xt.variableName),color:"#00f"},{tag:xt.local(xt.variableName),color:"#30a"},{tag:[xt.typeName,xt.namespace],color:"#085"},{tag:xt.className,color:"#167"},{tag:[xt.special(xt.variableName),xt.macroName],color:"#256"},{tag:xt.definition(xt.propertyName),color:"#00c"},{tag:xt.comment,color:"#940"},{tag:xt.invalid,color:"#f00"}]),qe=a.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Fe="()[]{}",He=e.define({combine:t=>h(t,{afterCursor:!0,brackets:Fe,maxScanDistance:1e4,renderMatch:Ge})}),Je=c.mark({class:"cm-matchingBracket"}),_e=c.mark({class:"cm-nonmatchingBracket"});function Ge(t){let e=[],i=t.matched?Je:_e;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}function Ke(t){let e=[],i=t.facet(He);for(let r of t.selection.ranges){if(!r.empty)continue;let n=Ye(t,r.head,-1,i)||r.head>0&&Ye(t,r.head-1,1,i)||i.afterCursor&&(Ye(t,r.head,1,i)||r.head<t.doc.length&&Ye(t,r.head+1,-1,i));n&&(e=e.concat(i.renderMatch(n,t)))}return c.set(e,!0)}const Ve=[u.fromClass(class{constructor(t){this.paused=!1,this.decorations=Ke(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=Ke(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),qe],Ze=new y;function Qe(t,e,i){let r=t.prop(e<0?y.openedBy:y.closedBy);if(r)return r;if(1==t.name.length){let r=i.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[i[r+e]]}return null}function Xe(t){let e=t.type.prop(Ze);return e?e(t.node):t}function Ye(t,e,i,r={}){let n=r.maxScanDistance||1e4,s=r.brackets||Fe,l=Tt(t),o=l.resolveInner(e,i);for(let t=o;t;t=t.parent){let r=Qe(t.type,i,s);if(r&&t.from<t.to){let n=Xe(t);if(n&&(i>0?e>=n.from&&e<n.to:e>n.from&&e<=n.to))return ti(0,0,i,t,n,r,s)}}return function(t,e,i,r,n,s,l){if(i<0?!e:e==t.doc.length)return null;let o=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),h=l.indexOf(o);if(h<0||h%2==0!=i>0)return null;let u={from:i<0?e-1:e,to:i>0?e+1:e},a=t.doc.iterRange(e,i>0?t.doc.length:0),f=0;for(let t=0;!a.next().done&&t<=s;){let s=a.value;i<0&&(t+=s.length);let o=e+t*i;for(let t=i>0?0:s.length-1,e=i>0?s.length:-1;t!=e;t+=i){let e=l.indexOf(s[t]);if(!(e<0||r.resolveInner(o+t,1).type!=n))if(e%2==0==i>0)f++;else{if(1==f)return{start:u,end:{from:o+t,to:o+t+1},matched:e>>1==h>>1};f--}}i>0&&(t+=s.length)}return a.done?{start:u,matched:!1}:null}(t,e,i,l,o.type,n,s)}function ti(t,e,i,r,n,s,l){let o=r.parent,h={from:n.from,to:n.to},u=0,a=null==o?void 0:o.cursor();if(a&&(i<0?a.childBefore(r.from):a.childAfter(r.to)))do{if(i<0?a.to<=r.from:a.from>=r.to){if(0==u&&s.indexOf(a.type.name)>-1&&a.from<a.to){let t=Xe(a);return{start:h,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Qe(a.type,i,l))u++;else if(Qe(a.type,-i,l)){if(0==u){let t=Xe(a);return{start:h,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}u--}}}while(i<0?a.prevSibling():a.nextSibling());return{start:h,matched:!1}}function ei(t,e,i,r=0,n=0){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);let s=n;for(let n=r;n<e;n++)9==t.charCodeAt(n)?s+=i-s%i:s++;return s}class ii{constructor(t,e,i,r){this.string=t,this.tabSize=e,this.indentUnit=i,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e,i=this.string.charAt(this.pos);if(e="string"==typeof t?i==t:i&&(t instanceof RegExp?t.test(i):t(i)),e)return++this.pos,i}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ei(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return null!==(t=this.overrideIndent)&&void 0!==t?t:ei(this.string,null,this.tabSize)}match(t,e,i){if("string"==typeof t){let r=t=>i?t.toLowerCase():t;return r(this.string.substr(this.pos,t.length))==r(t)?(!1!==e&&(this.pos+=t.length),!0):null}{let i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function ri(t){if("object"!=typeof t)return t;let e={};for(let i in t){let r=t[i];e[i]=r instanceof Array?r.slice():r}return e}const ni=new WeakMap;class si extends Ot{constructor(t){let e,i=Mt(t.languageData),r={name:(n=t).name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||ri,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||ai,mergeTokens:!1!==n.mergeTokens};var n;super(i,new class extends V{createParse(t,i,r){return new hi(e,t,i,r)}},[],t.name),this.topNode=function(t,e){let i=N.define({id:fi.length,name:"Document",props:[Nt.add((()=>t)),Vt.add((()=>t=>e.getIndent(t)))],top:!0});return fi.push(i),i}(i,this),e=this,this.streamParser=r,this.stateAfter=new y({perNode:!0}),this.tokenTable=t.tokenTable?new mi(r.tokenTable):wi}static define(t){return new si(t)}getIndent(t){let e,{overrideIndentation:i}=t.options;i&&(e=ni.get(t.state),null!=e&&e<t.pos-1e4&&(e=void 0));let r,n,s=li(this,t.node.tree,t.node.from,t.node.from,null!=e?e:t.pos);if(s?(n=s.state,r=s.pos+1):(n=this.streamParser.startState(t.unit),r=t.node.from),t.pos-r>1e4)return null;for(;r<t.pos;){let e=t.state.doc.lineAt(r),s=Math.min(t.pos,e.to);if(e.length){let r=i?i(e.from):-1,l=new ii(e.text,t.state.tabSize,t.unit,r<0?void 0:r);for(;l.pos<s-e.from;)ui(this.streamParser.token,l,n)}else this.streamParser.blankLine(n,t.unit);if(s==t.pos)break;r=e.to+1}let l=t.lineAt(t.pos);return i&&null==e&&ni.set(t.state,l.from),this.streamParser.indent(n,/^\s*(.*)/.exec(l.text)[1],t)}get allowsNesting(){return!1}}function li(t,e,i,r,n){let s=i>=r&&i+e.length<=n&&e.prop(t.stateAfter);if(s)return{state:t.streamParser.copyState(s),pos:i+e.length};for(let s=e.children.length-1;s>=0;s--){let l=e.children[s],o=i+e.positions[s],h=l instanceof A&&o<n&&li(t,l,o,r,n);if(h)return h}return null}function oi(t,e,i,r,n){if(n&&i<=0&&r>=e.length)return e;n||0!=i||e.type!=t.topNode||(n=!0);for(let s=e.children.length-1;s>=0;s--){let l,o=e.positions[s],h=e.children[s];if(o<r&&h instanceof A){if(!(l=oi(t,h,i-o,r-o,n)))break;return n?new A(e.type,e.children.slice(0,s).concat(l),e.positions.slice(0,s+1),o+l.length):l}}return null}class hi{constructor(t,e,i,r){this.lang=t,this.input=e,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let n=jt.get(),s=r[0].from,{state:l,tree:o}=function(t,e,i,r,n){for(let n of e){let e,s=n.to-(n.openEnd?25:0),l=n.from+(n.openStart?25:0)<=i&&s>i&&li(t,n.tree,0-n.offset,i,s);if(l&&l.pos<=r&&(e=oi(t,n.tree,i+n.offset,l.pos+n.offset,!1)))return{state:l.state,tree:e}}return{state:t.streamParser.startState(n?Jt(n):4),tree:A.empty}}(t,i,s,this.to,null==n?void 0:n.state);this.state=l,this.parsedPos=this.chunkStart=s+o.length;for(let t=0;t<o.children.length;t++)this.chunks.push(o.children[t]),this.chunkPos.push(o.positions[t]);n&&this.parsedPos<n.viewport.from-1e5&&r.some((t=>t.from<=n.viewport.from&&t.to>=n.viewport.from))&&(this.state=this.lang.streamParser.startState(Jt(n.state)),n.skipUntilInView(this.parsedPos,n.viewport.from),this.parsedPos=n.viewport.from),this.moveRangeIndex()}advance(){let t=jt.get(),e=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(e,this.chunkStart+512);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos<i;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{let t=e.indexOf("\n");t>-1&&(e=e.slice(0,t))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let t=this.rangeIndex;;){let r=this.ranges[t].to;if(r>=i)break;if(e=e.slice(0,r-(i-e.length)),t++,t==this.ranges.length)break;let n=this.ranges[t].from,s=this.lineAfter(n);e+=s,i=n+s.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let r=this.ranges[this.rangeIndex].to,n=t+e;if(i>0?r>n:r>=n)break;e+=this.ranges[++this.rangeIndex].from-r}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,i,r){let n=4;if(this.ranges.length>1){e+=r=this.skipGapsTo(e,r,1);let t=this.chunk.length;i+=r=this.skipGapsTo(i,r,-1),n+=this.chunk.length-t}let s=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&4==n&&s>=0&&this.chunk[s]==t&&this.chunk[s+2]==e?this.chunk[s+2]=i:this.chunk.push(t,e,i,n),r}parseLine(t){let{line:e,end:i}=this.nextLine(),r=0,{streamParser:n}=this.lang,s=new ii(e,t?t.state.tabSize:4,t?Jt(t.state):2);if(s.eol())n.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let t=ui(n.token,s,this.state);if(t&&(r=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+s.start,this.parsedPos+s.pos,r)),s.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=A.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:ci,topID:0,maxBufferLength:512,reused:this.chunkReused});t=new A(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new A(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function ui(t,e,i){e.start=e.pos;for(let r=0;r<10;r++){let r=t(e,i);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const ai=Object.create(null),fi=[N.none],ci=new M(fi),di=[],gi=Object.create(null),pi=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])pi[t]=ki(ai,e);class mi{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),pi)}resolve(t){return t?this.table[t]||(this.table[t]=ki(this.extra,t)):0}}const wi=new mi(ai);function bi(t,e){di.indexOf(t)>-1||(di.push(t),console.warn(e))}function ki(t,e){let i=[];for(let r of e.split(" ")){let e=[];for(let i of r.split(".")){let r=t[i]||xt[i];r?"function"==typeof r?e.length?e=e.map(r):bi(i,`Modifier ${i} used at start of tag`):e.length?bi(i,`Tag ${i} used as modifier`):e=Array.isArray(r)?r:[r]:bi(i,`Unknown highlighting tag ${i}`)}for(let t of e)i.push(t)}if(!i.length)return 0;let r=e.replace(/ /g,"_"),n=r+" "+i.map((t=>t.id)),s=gi[n];if(s)return s.id;let l=gi[n]=N.define({id:fi.length,name:r,props:[et({[r]:i})]});return fi.push(l),l.id}function vi(t){return t.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(t)}function yi(t){for(let e=t.iter();!e.next().done;)if(vi(e.value))return!0;return!1}const xi=e.define({combine:t=>t.some((t=>t))}),Si=u.fromClass(class{constructor(t){this.always=t.state.facet(xi)||t.textDirection!=g.LTR||t.state.facet(a.perLineTextDirection),this.hasRTL=!this.always&&yi(t.state.doc),this.tree=Tt(t.state),this.decorations=this.always||this.hasRTL?Ni(t,this.tree,this.always):c.none}update(t){let e=t.state.facet(xi)||t.view.textDirection!=g.LTR||t.state.facet(a.perLineTextDirection);if(e||this.hasRTL||!function(t){let e=!1;return t.iterChanges(((t,i,r,n,s)=>{!e&&yi(s)&&(e=!0)})),e}(t.changes)||(this.hasRTL=!0),!e&&!this.hasRTL)return;let i=Tt(t.state);(e!=this.always||i!=this.tree||t.docChanged||t.viewportChanged)&&(this.tree=i,this.always=e,this.decorations=Ni(t.view,i,e))}},{provide:t=>{function e(e){var i,r;return null!==(r=null===(i=e.plugin(t))||void 0===i?void 0:i.decorations)&&void 0!==r?r:c.none}return[a.outerDecorations.of(e),o.lowest(a.bidiIsolatedRanges.of(e))]}});function Ni(t,e,i){let r=new s,n=t.visibleRanges;i||(n=function(t,e){let i=e.iter(),r=0,n=[],s=null;for(let{from:e,to:l}of t)if(!(s&&s.to>e&&(e=s.to,e>=l)))for(r+i.value.length<e&&(i.next(e-(r+i.value.length)),r=e);;){let t=r,e=r+i.value.length;if(!i.lineBreak&&vi(i.value)&&(s&&s.to>t-10?s.to=Math.min(l,e):n.push(s={from:t,to:Math.min(l,e)})),e>=l)break;r=e,i.next()}return n}(n,t.state.doc));for(let{from:t,to:i}of n)e.iterate({enter:t=>{let e=t.type.prop(y.isolate);e&&r.add(t.from,t.to,Mi[e])},from:t,to:i});return r.finish()}const Mi={rtl:c.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:g.RTL}),ltr:c.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:g.LTR}),auto:c.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Ci=Object.freeze({__proto__:null,DocInput:Et,HighlightStyle:Pe,IndentContext:Kt,LRLanguage:At,Language:Ot,LanguageDescription:qt,LanguageSupport:Ut,ParseContext:jt,StreamLanguage:si,StringStream:ii,TreeIndentContext:Yt,bidiIsolates:function(t={}){let e=[Si];return t.alwaysIsolate&&e.push(xi.of(!0)),e},bracketMatching:function(t={}){return[He.of(t),Ve]},bracketMatchingHandle:Ze,codeFolding:Ie,continuedIndent:ne,defaultHighlightStyle:Ue,defineLanguageFacet:Mt,delimitedIndent:ee,ensureSyntaxTree:Dt,flatIndent:re,foldAll:xe,foldCode:ke,foldEffect:fe,foldGutter:function(t={}){let e={...Ee,...t},i=new Be(e,!0),r=new Be(e,!1),n=u.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(zt)!=t.state.facet(zt)||t.startState.field(ge,!1)!=t.state.field(ge,!1)||Tt(t.startState)!=Tt(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new s;for(let n of t.viewportLineBlocks){let s=me(t.state,n.from,n.to)?r:ue(t.state,n.from,n.to)?i:null;s&&e.add(n.from,n.from,s)}return e.finish()}}),{domEventHandlers:o}=e;return[n,f({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(n))||void 0===e?void 0:e.markers)||l.empty},initialSpacer:()=>new Be(e,!1),domEventHandlers:{...o,click:(t,e,i)=>{if(o.click&&o.click(t,e,i))return!0;let r=me(t.state,e.from,e.to);if(r)return t.dispatch({effects:ce.of(r)}),!0;let n=ue(t.state,e.from,e.to);return!!n&&(t.dispatch({effects:fe.of(n)}),!0)}}}),Ie()]},foldInside:oe,foldKeymap:Me,foldNodeProp:le,foldService:se,foldState:ge,foldable:ue,foldedRanges:function(t){return t.field(ge,!1)||l.empty},forceParsing:function(t,e=t.viewport.to,i=100){let r=Dt(t.state,e,i);return r!=Tt(t.state)&&t.dispatch({}),!!r},getIndentUnit:Jt,getIndentation:Gt,highlightingFor:function(t,e,i){let r=We(t),n=null;if(r)for(let t of r)if(!t.scope||i&&t.scope(i)){let i=t.style(e);i&&(n=n?n+" "+i:i)}return n},indentNodeProp:Vt,indentOnInput:function(){return n.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:r}=t.newSelection.main,n=i.lineAt(r);if(r>n.from+200)return t;let s=i.sliceString(n.from,r);if(!e.some((t=>t.test(s))))return t;let{state:l}=t,o=-1,h=[];for(let{head:t}of l.selection.ranges){let e=l.doc.lineAt(t);if(e.from==o)continue;o=e.from;let i=Gt(l,e.from);if(null==i)continue;let r=/^\s*/.exec(e.text)[0],n=_t(l,i);r!=n&&h.push({from:e.from,to:e.from+r.length,insert:n})}return h.length?[t,{changes:h,sequential:!0}]:t}))},indentRange:function(t,e,i){let r=Object.create(null),n=new Kt(t,{overrideIndentation:t=>{var e;return null!==(e=r[t])&&void 0!==e?e:-1}}),s=[];for(let l=e;l<=i;){let e=t.doc.lineAt(l);l=e.to+1;let i=Gt(n,e.from);if(null==i)continue;/\S/.test(e.text)||(i=0);let o=/^\s*/.exec(e.text)[0],h=_t(t,i);o!=h&&(r[e.from]=i,s.push({from:e.from,to:e.from+o.length,insert:h}))}return t.changes(s)},indentService:Ft,indentString:_t,indentUnit:Ht,language:zt,languageDataProp:Nt,matchBrackets:Ye,sublanguageProp:Ct,syntaxHighlighting:function(t,e){let i,r=[ze];return t instanceof Pe&&(t.module&&r.push(a.styleModule.of(t.module)),i=t.themeType),r.push((null==e?void 0:e.fallback)?Le.of(t):i?Re.computeN([a.darkTheme],(e=>e.facet(a.darkTheme)==("dark"==i)?[t]:[])):Re.of(t)),r},syntaxParserRunning:function(t){var e;return(null===(e=t.plugin($t))||void 0===e?void 0:e.isWorking())||!1},syntaxTree:Tt,syntaxTreeAvailable:function(t,e=t.doc.length){var i;return(null===(i=t.field(Ot.state,!1))||void 0===i?void 0:i.context.isDone(e))||!1},toggleFold:t=>{let e=[];for(let i of de(t)){let r=me(t.state,i.from,i.to);if(r)e.push(ce.of(r),ye(t,r,!1));else{let r=Ne(t,i);r&&e.push(fe.of(r),ye(t,r))}}return e.length>0&&t.dispatch({effects:be(t.state,e)}),!!e.length},unfoldAll:Se,unfoldCode:ve,unfoldEffect:ce});export{b as D,Kt as I,At as L,y as N,V as P,A as T,Jt as a,Ht as b,M as c,N as d,I as e,et as f,Gt as g,Ut as h,_t as i,Vt as j,le as k,ne as l,Ye as m,ee as n,re as o,oe as p,Ct as q,Mt as r,Tt as s,xt as t,G as u,Ci as v}
@@ -0,0 +1 @@
1
+ function t(t,n,e){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,n);if(o&&(!e||o.get))return o;t=Object.getPrototypeOf(t)}}var n=(n,e)=>{var o;Object.entries(null!=(o=e.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=n[o],s=t(Object.getPrototypeOf(n),o,!0)||Object.getOwnPropertyDescriptor(n,o);s&&Object.defineProperty(n,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),e.l.has(o)?n[o]=e.l.get(o):void 0!==l&&(n[o]=l)}}))},e=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,n)=>n in t,l=(t,n)=>(0,console.error)(t,n),s=new Map,i="http://www.w3.org/1999/xlink",r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,o)=>t.addEventListener(n,e,o),rel:(t,n,e,o)=>t.removeEventListener(n,e,o),ce:(t,n)=>new CustomEvent(t,n)},u=(()=>{var t;let n=!1;try{null==(t=r.document)||t.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch(t){}return n})(),a=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),d=!!a&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),p=!1,h=[],v=[],b=(t,n)=>e=>{t.push(e),p||(p=!0,n&&4&f.i?$(y):f.raf(y))},m=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(t){l(t)}t.length=0},y=()=>{m(h),m(v),(p=h.length>0)&&f.raf(y)},$=t=>Promise.resolve(undefined).then(t),g=b(v,!0),w=t=>{const n=new URL(t,f.u);return n.origin!==r.location.origin?n.href:n.pathname},j=t=>f.u=t,O=t=>{const n=E(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&S(n,t.tagName).forEach((t=>{1===t.nodeType&&"SLOT-FB"===t.tagName&&(t.hidden=!!k(t,M(t),!1).length)}));let e=0;for(e=0;e<n.length;e++){const t=n[e];1===t.nodeType&&E(t,"childNodes").length&&O(t)}};function S(t,n,e){let o,l=0,s=[];for(;l<t.length;l++){if(o=t[l],o["s-sr"]&&(!n||o["s-hn"]===n)&&(void 0===e||M(o)===e)&&(s.push(o),void 0!==e))return s;s=[...s,...S(o.childNodes,n,e)]}return s}var k=(t,n,e=!0)=>{const o=[];(e&&t["s-sr"]||!t["s-sr"])&&o.push(t);let l=t;for(;l=l.nextSibling;)M(l)!==n||!e&&l["s-sr"]||o.push(l);return o},N=(t,n)=>1===t.nodeType?null===t.getAttribute("slot")&&""===n||t.getAttribute("slot")===n:t["s-sn"]===n||""===n,M=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;function E(t,n){if("__"+n in t){const e=t["__"+n];return"function"!=typeof e?e:e.bind(t)}return"function"!=typeof t[n]?t[n]:t[n].bind(t)}var _,A,C,L=new WeakMap,x=t=>"sc-"+t.p,R=t=>"object"==(t=typeof t)||"function"===t,T=(t,n,...e)=>{let o=null,l=null,s=null,i=!1,r=!1;const c=[],f=n=>{for(let e=0;e<n.length;e++)o=n[e],Array.isArray(o)?f(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!R(o))&&(o=String(o)),i&&r?c[c.length-1].h+=o:c.push(i?F(null,o):o),r=i)};if(f(e),n){n.key&&(l=n.key),n.name&&(s=n.name);{const t=n.className||n.class;t&&(n.class="object"!=typeof t?t:Object.keys(t).filter((n=>t[n])).join(" "))}}const u=F(t,null);return u.v=n,c.length>0&&(u.m=c),u.$=l,u.j=s,u},F=(t,n)=>({i:0,O:t,h:null!=n?n:null,S:null,m:null,v:null,$:null,j:null}),D={},H=t=>{if(!t)return;const n=Object.keys(t);if(0===n.length)return;let e=!1;for(const o of n){if(e)break;for(const n of t[o])if("string"==typeof n){e=!0;break}}if(!e)return t;const o={};for(const e of n)o[e]=t[e].map((t=>"string"==typeof t?{[t]:0}:t));return o},P=(t,n)=>null==t||R(t)?t:4&n?"false"!==t&&(""===t||!!t):1&n?String(t):t,W=(t,n)=>{const e=t;return{emit:t=>U(e,n,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},U=(t,n,e)=>{const o=f.ce(n,e);return t.dispatchEvent(o),o},B=(t,n,l,s,c,u)=>{if(l===s)return;let a=o(t,n),d=n.toLowerCase();if("class"===n){const n=t.classList,e=q(l);let o=q(s);n.remove(...e.filter((t=>t&&!o.includes(t)))),n.add(...o.filter((t=>t&&!e.includes(t))))}else if("style"===n){for(const n in l)s&&null!=s[n]||(n.includes("-")?t.style.removeProperty(n):t.style[n]="");for(const n in s)l&&s[n]===l[n]||(n.includes("-")?t.style.setProperty(n,s[n]):t.style[n]=s[n])}else if("key"===n);else if("ref"===n)s&&dt(s,t);else if(t.__lookupSetter__(n)||"o"!==n[0]||"n"!==n[1]){if("a"===n[0]&&n.startsWith("attr:")){const o=n.slice(5);let l;{const n=e(t);if(n&&n.o&&n.o.t){const t=n.o.t[o];t&&t[1]&&(l=t[1])}}return l||(l=o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===s?"":s))}if("p"===n[0]&&n.startsWith("prop:")){const e=n.slice(5);try{t[e]=s}catch(t){}return}{const e=R(s);if((a||e&&null!==s)&&!c)try{if(t.tagName.includes("-"))t[n]!==s&&(t[n]=s);else{const e=null==s?"":s;"list"===n?a=!1:null!=l&&t[n]===e||("function"==typeof t.__lookupSetter__(n)?t[n]=e:t.setAttribute(n,e))}}catch(t){}let o=!1;d!==(d=d.replace(/^xlink\:?/,""))&&(n=d,o=!0),null==s||!1===s?!1===s&&""!==t.getAttribute(n)||(o?t.removeAttributeNS(i,n):t.removeAttribute(n)):(!a||4&u||c)&&!e&&1===t.nodeType&&(s=!0===s?"":s,o?t.setAttributeNS(i,n,s):t.setAttribute(n,s))}}else if(n="-"===n[2]?n.slice(3):o(r,d)?d.slice(2):d[2]+n.slice(3),l||s){const e=n.endsWith(z);n=n.replace(Y,""),l&&f.rel(t,n,l,e),s&&f.ael(t,n,s,e)}},V=/\s/,q=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(V):[]),z="Capture",Y=new RegExp(z+"$"),I=(t,n,e)=>{const o=11===n.S.nodeType&&n.S.host?n.S.host:n.S,l=t&&t.v||{},s=n.v||{};for(const t of Z(Object.keys(l)))t in s||B(o,t,l[t],void 0,e,n.i);for(const t of Z(Object.keys(s)))B(o,t,l[t],s[t],e,n.i)};function Z(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var G=!1,J=!1,K=!1,Q=!1,X=[],tt=[],nt=(t,n,e)=>{var o;const l=n.m[e];let s,i,c,f=0;if(G||(K=!0,"slot"===l.O&&(l.i|=l.m?2:1)),null!=l.h)s=l.S=r.document.createTextNode(l.h);else if(1&l.i)s=l.S=r.document.createTextNode(""),I(null,l,Q);else{if(Q||(Q="svg"===l.O),!r.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(s=l.S=r.document.createElementNS(Q?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",!G&&2&l.i?"slot-fb":l.O),Q&&"foreignObject"===l.O&&(Q=!1),I(null,l,Q),null!=(u=_)&&void 0!==u&&s["s-si"]!==_&&s.classList.add(s["s-si"]=_),l.m){const n="template"===l.O?s.content:s;for(f=0;f<l.m.length;++f)i=nt(t,l,f),i&&n.appendChild(i)}"svg"===l.O?Q=!1:"foreignObject"===s.tagName&&(Q=!0)}var u;return s["s-hn"]=C,3&l.i&&(s["s-sr"]=!0,s["s-cr"]=A,s["s-sn"]=l.j||"",s["s-rf"]=null==(o=l.v)?void 0:o.ref,function(t){if(t.assignedElements||t.assignedNodes||!t["s-sr"])return;const n=n=>function(t){const e=[],o=this["s-sn"];(null==t?void 0:t.flatten)&&console.error("\n Flattening is not supported for Stencil non-shadow slots.\n You can use `.childNodes` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n ");const l=this["s-cr"].parentElement;return(l.__childNodes?l.childNodes:(t=>{const n=[];for(let e=0;e<t.length;e++){const o=t[e]["s-nr"]||void 0;o&&o.isConnected&&n.push(o)}return n})(l.childNodes)).forEach((t=>{o===M(t)&&e.push(t)})),n?e.filter((t=>1===t.nodeType)):e}.bind(t);t.assignedElements=n(!0),t.assignedNodes=n(!1)}(s),c=t&&t.m&&t.m[e],c&&c.O===l.O&&t.S&&et(t.S),ht(A,s,n.S,null==t?void 0:t.S)),s},et=t=>{f.i|=1;const n=t.closest(C.toLowerCase());if(null!=n){const e=Array.from(n.__childNodes||n.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of e?o.reverse():o)null!=t["s-sh"]&&(pt(n,t,null!=e?e:null),t["s-sh"]=void 0,K=!0)}f.i&=-2},ot=(t,n)=>{f.i|=1;const e=Array.from(t.__childNodes||t.childNodes);if(t["s-sr"]){let n=t;for(;n=n.nextSibling;)n&&n["s-sn"]===t["s-sn"]&&n["s-sh"]===C&&e.push(n)}for(let t=e.length-1;t>=0;t--){const o=e[t];o["s-hn"]!==C&&o["s-ol"]&&(pt(rt(o).parentNode,o,rt(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,K=!0),n&&ot(o,n)}f.i&=-2},lt=(t,n,e,o,l,s)=>{let i,r=t["s-cr"]&&t["s-cr"].parentNode||t;for("template"===e.O&&(r=r.content);l<=s;++l)o[l]&&(i=nt(null,e,l),i&&(o[l].S=i,pt(r,i,rt(n))))},st=(t,n,e)=>{for(let o=n;o<=e;++o){const n=t[o];if(n){const t=n.S;at(n),t&&(J=!0,t["s-ol"]?t["s-ol"].remove():ot(t,!0),t.remove())}}},it=(t,n,e=!1)=>t.O===n.O&&("slot"===t.O?t.j===n.j:e?(e&&!t.$&&n.$&&(t.$=n.$),!0):t.$===n.$),rt=t=>t&&t["s-ol"]||t,ct=(t,n,e=!1)=>{const o=n.S=t.S,l=t.m,s=n.m,i=n.O,r=n.h;let c;null==r?(Q="svg"===i||"foreignObject"!==i&&Q,"slot"!==i||G||t.j!==n.j&&(n.S["s-sn"]=n.j||"",et(n.S.parentElement)),I(t,n,Q),null!==l&&null!==s?((t,n,e,o,l=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=n.length-1,d=n[0],p=n[a],h=o.length-1,v=o[0],b=o[h];const m="template"===e.O?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=n[++r];else if(null==p)p=n[--a];else if(null==v)v=o[++c];else if(null==b)b=o[--h];else if(it(d,v,l))ct(d,v,l),d=n[++r],v=o[++c];else if(it(p,b,l))ct(p,b,l),p=n[--a],b=o[--h];else if(it(d,b,l))"slot"!==d.O&&"slot"!==b.O||ot(d.S.parentNode,!1),ct(d,b,l),pt(m,d.S,p.S.nextSibling),d=n[++r],b=o[--h];else if(it(p,v,l))"slot"!==d.O&&"slot"!==b.O||ot(p.S.parentNode,!1),ct(p,v,l),pt(m,p.S,d.S),p=n[--a],v=o[++c];else{for(f=-1,u=r;u<=a;++u)if(n[u]&&null!==n[u].$&&n[u].$===v.$){f=u;break}f>=0?(i=n[f],i.O!==v.O?s=nt(n&&n[c],e,f):(ct(i,v,l),n[f]=void 0,s=i.S),v=o[++c]):(s=nt(n&&n[c],e,c),v=o[++c]),s&&pt(rt(d.S).parentNode,s,rt(d.S))}r>a?lt(t,null==o[h+1]?null:o[h+1].S,e,o,c,h):c>h&&st(n,r,a)})(o,l,n,s,e):null!==s?(null!==t.h&&(o.textContent=""),lt(o,null,n,s,0,s.length-1)):!e&&null!==l&&st(l,0,l.length-1),Q&&"svg"===i&&(Q=!1)):(c=o["s-cr"])?c.parentNode.textContent=r:t.h!==r&&(o.data=r)},ft=[],ut=t=>{let n,e,o;const l=t.__childNodes||t.childNodes;for(const t of l){if(t["s-sr"]&&(n=t["s-cr"])&&n.parentNode){e=n.parentNode.__childNodes||n.parentNode.childNodes;const l=t["s-sn"];for(o=e.length-1;o>=0;o--)if(n=e[o],!(n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||n["s-sh"]&&n["s-sh"]===t["s-hn"]))if(N(n,l)){let e=ft.find((t=>t.k===n));J=!0,n["s-sn"]=n["s-sn"]||l,e?(e.k["s-sh"]=t["s-hn"],e.N=t):(n["s-sh"]=t["s-hn"],ft.push({N:t,k:n})),n["s-sr"]&&ft.map((t=>{N(t.k,n["s-sn"])&&(e=ft.find((t=>t.k===n)),e&&!t.N&&(t.N=e.N))}))}else ft.some((t=>t.k===n))||ft.push({k:n})}1===t.nodeType&&ut(t)}},at=t=>{t.v&&t.v.ref&&X.push((()=>t.v.ref(null))),t.m&&t.m.map(at)},dt=(t,n)=>{tt.push((()=>t(n)))},pt=(t,n,e,o)=>{if("string"==typeof n["s-sn"]&&n["s-sr"]&&n["s-cr"])ht(n["s-cr"],n,t,n.parentElement);else if("string"==typeof n["s-sn"]){t.insertBefore(n,e);const{slotNode:l}=function(t,n){var e;if(!(n=n||(null==(e=t["s-ol"])?void 0:e.parentElement)))return{slotNode:null,slotName:""};const o=t["s-sn"]=M(t)||"";return{slotNode:S(E(n,"childNodes"),n.tagName,o)[0],slotName:o}}(n);return l&&!o&&l.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1})),n}return t.__insertBefore?t.__insertBefore(n,e):null==t?void 0:t.insertBefore(n,e)};function ht(t,n,e,o){var l,s;let i;if(t&&"string"==typeof n["s-sn"]&&n["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(i=n["s-si"]||t.parentNode["s-sc"])){const t=n["s-sn"],r=n["s-hn"];if(null==(l=e.classList)||l.add(i+"-s"),o&&(null==(s=o.classList)?void 0:s.contains(i+"-s"))){let n=(o.__childNodes||o.childNodes)[0],e=!1;for(;n;){if(n["s-sn"]!==t&&n["s-hn"]===r&&n["s-sr"]){e=!0;break}n=n.nextSibling}e||o.classList.remove(i+"-s")}}}var vt=(t,n,e=!1)=>{var o,l,s,i,c;const u=t.$hostElement$,a=t.o,d=t.M||F(null,null);var p;const h=(p=n)&&p.O===D?n:T(null,null,n);if(C=u.tagName,e&&h.v)for(const t of Object.keys(h.v))u.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(h.v[t]=u[t]);if(h.O=null,h.i|=4,t.M=h,h.S=d.S=u,_=u["s-sc"],G=false,A=u["s-cr"],J=!1,ct(d,h,e),f.i|=1,K){ut(h.S);for(const t of ft){const n=t.k;if(!n["s-ol"]&&r.document){const t=r.document.createTextNode("");t["s-nr"]=n,pt(n.parentNode,n["s-ol"]=t,n,e)}}for(const t of ft){const n=t.k,c=t.N;if(1===n.nodeType&&e&&(n["s-ih"]=null!=(o=n.hidden)&&o),c){const t=c.parentNode;let o=c.nextSibling;if(o&&1===o.nodeType){let e=null==(l=n["s-ol"])?void 0:l.previousSibling;for(;e;){let l=null!=(s=e["s-nr"])?s:null;if(l&&l["s-sn"]===n["s-sn"]&&t===(l.__parentNode||l.parentNode)){for(l=l.nextSibling;l===n||(null==l?void 0:l["s-sr"]);)l=null==l?void 0:l.nextSibling;if(!l||!l["s-nr"]){o=l;break}}e=e.previousSibling}}if((!o&&t!==(n.__parentNode||n.parentNode)||(n.__nextSibling||n.nextSibling)!==o)&&n!==o){if(pt(t,n,o,e),8===n.nodeType&&n.nodeValue.startsWith("s-nt-")){const t=r.document.createTextNode(n.nodeValue.replace(/^s-nt-/,""));t["s-hn"]=n["s-hn"],t["s-sn"]=n["s-sn"],t["s-sh"]=n["s-sh"],t["s-sr"]=n["s-sr"],t["s-ol"]=n["s-ol"],t["s-ol"]["s-nr"]=t,pt(n.parentNode,t,n,e),n.parentNode.removeChild(n)}1===n.nodeType&&"SLOT-FB"!==n.tagName&&(n.hidden=null!=(i=n["s-ih"])&&i)}n&&"function"==typeof c["s-rf"]&&c["s-rf"](c)}else 1===n.nodeType&&(n.hidden=!0)}}if(J&&O(h.S),f.i&=-2,ft.length=0,!G&&!(1&a.i)&&u["s-cr"]){const t=h.S.__childNodes||h.S.childNodes;for(const n of t)if(n["s-hn"]!==C&&!n["s-sh"])if(e&&null==n["s-ih"]&&(n["s-ih"]=null!=(c=n.hidden)&&c),1===n.nodeType)n.hidden=!0;else if(3===n.nodeType&&n.nodeValue.trim()){const t=r.document.createComment("s-nt-"+n.nodeValue);t["s-sn"]=n["s-sn"],pt(n.parentNode,t,n,e),n.parentNode.removeChild(n)}}A=void 0,X.forEach((t=>t())),X.length=0,tt.forEach((t=>t())),tt.length=0},bt=(t,n)=>{if(n&&!t._&&n["s-p"]){const e=n["s-p"].push(new Promise((o=>t._=()=>{n["s-p"].splice(e-1,1),o()})))}},mt=(t,n)=>{if(t.i|=16,4&t.i)return void(t.i|=512);bt(t,t.A);const e=()=>yt(t,n);if(!n)return g(e);queueMicrotask((()=>{e()}))},yt=(t,n)=>{const e=t.$hostElement$,o=e;if(!o)throw new Error(`Can't render component <${e.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=kt(o,n?"componentWillLoad":"componentWillUpdate",void 0,e),l=$t(l,(()=>kt(o,"componentWillRender",void 0,e))),$t(l,(()=>wt(t,o,n)))},$t=(t,n)=>gt(t)?t.then(n).catch((t=>{console.error(t),n()})):n(),gt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,wt=async(t,n,e)=>{var o;const l=t.$hostElement$,i=l["s-rc"];e&&(t=>{const n=t.o,e=t.$hostElement$,o=n.i,l=((t,n)=>{var e,o,l;const i=x(n),c=s.get(i);if(!r.document)return i;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let l,s=L.get(t=t.head||t);if(s||L.set(t,s=new Set),!s.has(i)){l=r.document.createElement("style"),l.textContent=c;const u=null!=(e=f.C)?e:function(){var t,n,e;return null!=(e=null==(n=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?e:void 0}();if(null!=u&&l.setAttribute("nonce",u),!(1&n.i))if("HEAD"===t.nodeName){const n=t.querySelectorAll("link[rel=preconnect]"),e=n.length>0?n[n.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==e?void 0:e.parentNode)===t?e:null)}else if("host"in t)if(a){const n=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;n.replaceSync(c),d?t.adoptedStyleSheets.unshift(n):t.adoptedStyleSheets=[n,...t.adoptedStyleSheets]}else{const n=t.querySelector("style");n?n.textContent=c+n.textContent:t.prepend(l)}else t.append(l);1&n.i&&t.insertBefore(l,null),4&n.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(i)}}else{let n=L.get(t);if(n||L.set(t,n=new Set),!n.has(i)){const e=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(c.constructor===e.CSSStyleSheet)o=c;else{o=new e.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)o.insertRule(c.cssRules[t].cssText,t)}d?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],n.add(i)}}return i})(e.getRootNode(),n);10&o&&(e["s-sc"]=l,e.classList.add(l+"-h"))})(t);jt(t,n,l,e),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const n=null!=(o=l["s-p"])?o:[],e=()=>Ot(t);0===n.length?e():(Promise.all(n).then(e).catch(e),t.i|=4,n.length=0)}},jt=(t,n,e,o)=>{try{n=n.render(),t.i&=-17,t.i|=2,vt(t,n,o)}catch(n){l(n,t.$hostElement$)}return null},Ot=t=>{const n=t.$hostElement$,e=n,o=t.A;kt(e,"componentDidRender",void 0,n),64&t.i?kt(e,"componentDidUpdate",void 0,n):(t.i|=64,Nt(n),kt(e,"componentDidLoad",void 0,n),t.L(n),o||St()),t._&&(t._(),t._=void 0),512&t.i&&$((()=>mt(t,!1))),t.i&=-517},St=()=>{$((()=>U(r,"appload",{detail:{namespace:"formkrafter-wc"}})))},kt=(t,n,e,o)=>{if(t&&t[n])try{return t[n](e)}catch(t){l(t,o)}},Nt=t=>t.classList.add("hydrated"),Mt=(t,n,o,s)=>{const i=e(t);if(!i)return;const r=t,c=i.l.get(n),f=i.i,u=r;o=P(o,s.t[n][0]);const a=Number.isNaN(c)&&Number.isNaN(o);if(o!==c&&!a){if(i.l.set(n,o),s.R){const t=s.R[n];t&&t.map((t=>{try{const[[e,l]]=Object.entries(t);(128&f||1&l)&&(u?u[e](o,c,n):i.T.push((()=>{i.F[e](o,c,n)})))}catch(t){l(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(o,c,n)&&!(16&f))return;16&f||mt(i,!1)}}},Et=(n,o)=>{var l,s;const i=n.prototype;{n.watchers&&!o.R&&(o.R=H(n.watchers)),n.deserializers&&!o.D&&(o.D=n.deserializers),n.serializers&&!o.H&&(o.H=n.serializers);const r=Object.entries(null!=(l=o.t)?l:{});r.map((([n,[l]])=>{if(31&l||32&l){const{get:s,set:r}=t(i,n)||{};s&&(o.t[n][0]|=2048),r&&(o.t[n][0]|=4096),Object.defineProperty(i,n,{get(){return s?s.apply(this):(t=n,e(this).l.get(t));var t},configurable:!0,enumerable:!0}),Object.defineProperty(i,n,{set(t){const s=e(this);if(s){if(r)return void 0===(32&l?this[n]:s.$hostElement$[n])&&s.l.get(n)&&(t=s.l.get(n)),r.apply(this,[P(t,l)]),void Mt(this,n,t=32&l?this[n]:s.$hostElement$[n],o);Mt(this,n,t,o)}}})}}));{const t=new Map;i.attributeChangedCallback=function(n,l,s){f.jmp((()=>{var c;const f=t.get(n),u=e(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==l){const e=this,i=null==(c=o.R)?void 0:c[n];null==i||i.forEach((o=>{const[[i,r]]=Object.entries(o);null!=e[i]&&(128&t||1&r)&&e[i].call(e,s,l,n)}))}return}const a=r.find((([t])=>t===f)),d=a&&4&a[1][0],p=d&&null===s&&void 0===this[f];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);p||s==this[f]||h.get&&!h.set||(this[f]=s)}))},n.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=o.R)?s:{}),...r.filter((([t,n])=>31&n[0])).map((([n,e])=>{const o=e[1]||n;return t.set(o,n),o}))]))}}return n},_t=(t,o)=>{const i={i:o[0],p:o[1]};try{i.t=o[2],i.P=o[3],i.R=H(t.R),i.D=t.D,i.H=t.H;const c=t.prototype.connectedCallback,u=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const o={i:0,$hostElement$:t,o:e,l:new Map,W:new Map};o.U=new Promise((t=>o.L=t)),t["s-p"]=[],t["s-rc"]=[];const l=o;t.__stencil__getHostRef=()=>l,512&e.i&&n(t,o)})(this,i)},connectedCallback(){if(!this.__hasHostListenerAttached){const t=e(this);if(!t)return;At(this,t,i.P),this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const n=e(t);if(!n)return;const o=n.o,i=()=>{};if(1&n.i)At(t,n,o.P),(null==n?void 0:n.F)||(null==n?void 0:n.U)&&n.U.then((()=>{}));else{n.i|=1,12&o.i&&(t=>{if(!r.document)return;const n=t["s-cr"]=r.document.createComment("");n["s-cn"]=!0,pt(t,n,t.firstChild)})(t);{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){bt(n,n.A=e);break}}o.t&&Object.entries(o.t).map((([n,[e]])=>{if(31&e&&Object.prototype.hasOwnProperty.call(t,n)){const e=t[n];delete t[n],t[n]=e}})),(async(t,n,e)=>{let o;try{if(!(32&n.i)&&(n.i|=32,o=t.constructor,customElements.whenDefined(t.localName).then((()=>n.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const n=x(e);if(!s.has(n)){const o=()=>{};((t,n,e)=>{let o=s.get(t);a&&e?(o=o||new CSSStyleSheet,"string"==typeof o?o=n:o.replaceSync(n)):o=n,s.set(t,o)})(n,t,!!(1&e.i)),o()}}const l=n.A,i=()=>mt(n,!0);l&&l["s-rc"]?l["s-rc"].push(i):i()}catch(e){l(e,t),n._&&(n._(),n._=void 0),n.L&&n.L(t)}})(t,n,o)}i()}})(this),c&&c.call(this)},disconnectedCallback(){(async t=>{if(!(1&f.i)){const n=e(t);(null==n?void 0:n.B)&&(n.B.map((t=>t())),n.B=void 0)}L.has(t)&&L.delete(t),t.shadowRoot&&L.has(t.shadowRoot)&&L.delete(t.shadowRoot)})(this),u&&u.call(this)},__attachShadow(){this.shadowRoot=this}}),Object.defineProperty(t,"is",{value:i.p,configurable:!0}),Et(t,i)}catch(n){return l(n),t}},At=(t,n,e)=>{e&&r.document&&e.map((([e,o,l])=>{const s=Lt(r.document,t,e),i=Ct(n,l),c=xt(e);f.ael(s,o,i,c),(n.B=n.B||[]).push((()=>f.rel(s,o,i,c)))}))},Ct=(t,n)=>e=>{try{t.$hostElement$[n](e)}catch(n){l(n,t.$hostElement$)}},Lt=(t,n,e)=>4&e?t:n,xt=t=>u?{passive:!!(1&t),capture:!!(2&t)}:!!(2&t),Rt=t=>f.C=t,Tt=t=>Object.assign(f,t),Ft=new WeakMap;function Dt(t,n){let e=Ft.get(n);e||(e={i:0,o:{i:0,p:n.tagName},$hostElement$:n},Ft.set(n,e)),vt(e,t)}function Ht(t){return t}export{c as H,D as a,Rt as b,W as c,Tt as d,w as g,T as h,_t as p,Dt as r,j as s,Ht as t}
@@ -0,0 +1 @@
1
+ import{t,p as e,H as s,c as r,h as i}from"./p-BB4Llg42.js";import{b as p,v as o}from"./p-CKMHMpID.js";import{a}from"./p-BOmBVgfJ.js";const c=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.stepTouch=r(this,"stepTouch"),this.stepperSubmit=r(this,"stepperSubmit"),this.stepLabels=[],this.editable=!1,this.active=0,this.next=t=>{t.preventDefault(),!this.config("validateSteps",!1)||this.stepValid(this.active)?this.active=Math.min(this.active+1,this.stepLabels.length-1):this.stepTouch.emit({keys:this.stepKeys(this.active)})},this.back=t=>{t.preventDefault(),this.active=Math.max(this.active-1,0)},this.submit=t=>{t.preventDefault(),!this.config("validateSteps",!1)||this.stepValid(this.active)?this.stepperSubmit.emit():this.stepTouch.emit({keys:this.stepKeys(this.active)})}}clampActive(){this.active>Math.max(this.stepLabels.length-1,0)&&(this.active=0)}componentDidRender(){const t=this.host.querySelector(".fk-stepper__body");t&&Array.from(t.children).forEach(((t,e)=>{const s=t;this.editable?s.style.removeProperty("display"):s.style.display=e===this.active?"":"none"}))}config(t,e){var s,r;const i=null===(r=null===(s=this.spec)||void 0===s?void 0:s.configs)||void 0===r?void 0:r[t];return"boolean"==typeof i?i:e}stepSpec(t){var e,s,r;const i=null===(s=null===(e=this.spec)||void 0===e?void 0:e.children)||void 0===s?void 0:s[t];if(i&&this.spec)return(null===(r=this.stepCache)||void 0===r?void 0:r.source)!==this.spec&&(this.stepCache={source:this.spec,specs:[]}),this.stepCache.specs[t]||(this.stepCache.specs[t]={type:"panel",id:"step",name:"Step",configs:{key:`step_${t}`},children:[i]}),this.stepCache.specs[t]}stepKeys(t){var e,s,r;const i=null===(s=null===(e=this.spec)||void 0===e?void 0:e.children)||void 0===s?void 0:s[t];if(!i)return[];const o=[];for(const t of p(i))(null===(r=t.configs)||void 0===r?void 0:r.key)&&o.push(t.configs.key);return o}stepValid(t){var e;const s=this.stepSpec(t);if(!s)return!0;const r=Object.fromEntries(Object.entries(null!==(e=this.dataMap)&&void 0!==e?e:{}).filter((([,t])=>""!==t&&null!=t)));return o(s,r,this.locale).valid}goToStep(t){if(this.editable||t<=this.active)this.active=t;else if(this.config("allowStepClick",!0)){if(this.config("validateSteps",!1))for(let e=this.active;e<t;e++)if(!this.stepValid(e))return this.active=e,void this.stepTouch.emit({keys:this.stepKeys(e)});this.active=t}}render(){const t=Math.max(this.stepLabels.length-1,0),e=!this.editable&&this.config("showSubmit",!1)&&this.active===t;return i("div",{key:"3a5a9d1aa6e870241cf5a353359fe89a7c4a376a",class:"fk-stepper"},i("ol",{key:"8d6b154016d12cd00827b8bddbe4d476dc378fab",class:"fk-stepper__nav"},this.stepLabels.map(((t,e)=>i("li",{key:`${e}-${t}`,class:{"fk-stepper__step":!0,"fk-stepper__step--active":e===this.active,"fk-stepper__step--done":!this.editable&&e<this.active}},i("button",{type:"button",class:"fk-stepper__step-button","aria-current":e===this.active?"step":void 0,onClick:t=>{t.preventDefault(),this.goToStep(e)}},i("span",{class:"fk-stepper__index"},e+1),i("span",{class:"fk-stepper__label"},t)))))),i("div",{key:"cd902a9df2d72a4d7f452e7621287df50a89d3c4",class:"fk-stepper__body"},i("slot",{key:"ab689448817eaf7b5ddfc9146e18411fe6b5924c"})),!this.editable&&this.stepLabels.length>1?i("div",{class:"fk-stepper__actions"},i("button",{type:"button",class:"fk-stepper__button",disabled:0===this.active,onClick:this.back},a("stepper.back")),this.active<t?i("button",{type:"button",class:"fk-stepper__button fk-stepper__button--primary",onClick:this.next},a("stepper.next")):null,e?i("button",{type:"button",class:"fk-stepper__button fk-stepper__button--primary",onClick:this.submit},a("stepper.submit")):null):null)}get host(){return this}static get watchers(){return{stepLabels:[{clampActive:0}]}}static get style(){return".sc-fk-stepper-h{display:block}.fk-stepper.sc-fk-stepper{display:flex;flex-direction:column;gap:var(--fk-spacing)}.fk-stepper__nav.sc-fk-stepper{display:flex;flex-wrap:wrap;gap:calc(var(--fk-spacing) * 1.5);margin:0;padding:0 0 var(--fk-spacing);list-style:none;border-bottom:1px solid var(--fk-color-border)}.fk-stepper__step.sc-fk-stepper{display:flex;align-items:center;gap:calc(var(--fk-spacing) / 2);cursor:pointer;color:var(--fk-color-muted);font-size:0.85rem}.fk-stepper__index.sc-fk-stepper{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;border:1px solid var(--fk-color-border);font-size:0.72rem;font-weight:700}.fk-stepper__step--active.sc-fk-stepper{color:var(--fk-color-text);font-weight:600}.fk-stepper__step--active.sc-fk-stepper .fk-stepper__index.sc-fk-stepper{border-color:var(--fk-color-primary);background:var(--fk-color-primary);color:#ffffff}.fk-stepper__step--done.sc-fk-stepper .fk-stepper__index.sc-fk-stepper{border-color:var(--fk-color-primary);color:var(--fk-color-primary)}.fk-stepper__actions.sc-fk-stepper{display:flex;justify-content:space-between;padding-top:var(--fk-spacing);border-top:1px solid var(--fk-color-border)}.fk-stepper__button.sc-fk-stepper{font:inherit;font-size:0.85rem;padding:calc(var(--fk-spacing) / 1.5) calc(var(--fk-spacing) * 1.5);border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:var(--fk-color-surface);color:var(--fk-color-text);cursor:pointer}.fk-stepper__button--primary.sc-fk-stepper{border-color:var(--fk-color-primary);background:var(--fk-color-primary);color:#ffffff}.fk-stepper__button.sc-fk-stepper:disabled{opacity:0.45;cursor:not-allowed}.fk-stepper__step-button.sc-fk-stepper{all:unset;display:inline-flex;align-items:center;gap:inherit;cursor:pointer}.fk-stepper__step-button.sc-fk-stepper:focus-visible{outline:2px solid color-mix(in srgb, var(--fk-color-primary) 55%, transparent);outline-offset:2px;border-radius:calc(var(--fk-radius) / 2)}"}},[262,"fk-stepper",{stepLabels:[16],editable:[4],spec:[16],dataMap:[16],locale:[1],active:[32]},void 0,{stepLabels:[{clampActive:0}]}]);function n(){"undefined"!=typeof customElements&&["fk-stepper"].forEach((e=>{"fk-stepper"===e&&(customElements.get(t(e))||customElements.define(t(e),c))}))}n();export{c as F,n as d}
@@ -0,0 +1 @@
1
+ var e;const a={"palette.search":"Search bricks…","palette.empty":"No brick matches “{query}”","builder.undo":"Undo","builder.redo":"Redo","builder.copyJson":"Copy JSON","builder.importJson":"Import JSON","builder.importInvalid":"Invalid form JSON","builder.pasteHint":"Press Ctrl+V to paste a spec","builder.copied":"Copied!","builder.downloadJson":"Download .json","builder.hint":"Select a brick to edit its properties","drop.hint":"Drop a brick here","empty.title":"Your form is empty","empty.hint":"Drag a brick from the palette to get started","actions.move":"Move","actions.duplicate":"Duplicate","actions.delete":"Delete","stepper.back":"← Back","stepper.next":"Next →","stepper.submit":"Submit","panel.cfg.validateSteps":"Validate each step","panel.cfg.allowStepClick":"Allow clicking steps to jump","panel.cfg.showSubmit":"Submit button on last step","panel.cfg.validateTabs":"Validate tab before leaving it","signature.clear":"Clear","panel.tab.config":"Config","panel.tab.validation":"Validation","panel.tab.styles":"Styles","panel.tab.rules":"Rules","panel.key":"Key","panel.label":"Label","panel.placeholder":"Placeholder","panel.prefix":"Prefix","panel.suffix":"Suffix","panel.accept":"Accepted file types","panel.uploadUrl":"Upload URL","panel.cfg.multiple":"Allow multiple files","panel.optionsSource":"Options source","panel.options":"Options (one per line)","panel.content":"Content","panel.dataKey":"Data key","panel.url":"URL","panel.headers":"Headers ({token} reads form data)","panel.searchParam":"Server search param","panel.labelKey":"Label key","panel.valueKey":"Value key","panel.errorMessage":"Error message","panel.required":"Required","panel.minLength":"Min length","panel.maxLength":"Max length","panel.min":"Min","panel.max":"Max","panel.pattern":"Pattern (regex)","panel.minItems":"Min items","panel.maxItems":"Max items","panel.emailFormat":"Email format","panel.urlFormat":"URL format","panel.custom":"Custom (JavaScript)","panel.fallbackMessage":"Fallback message","panel.styleProperty":"property","panel.styleValue":"value","file.choose":"Choose a file…","file.uploading":"Uploading…","file.remove":"Remove file","file.addAnother":"+ Add a file","address.street":"Street","address.city":"City","address.zip":"Postal code","address.country":"Country","grid.addRow":"+ Add row","grid.removeRow":"Remove row","grid.empty":"No rows yet","grid.columns":"Row template","select.search":"Search…","select.empty":"No options","select.clear":"Clear","rules.when":"When","rules.then":"Then","rules.addRule":"+ Add rule","rules.addEffect":"+ Effect","rules.removeRule":"Remove rule","rules.removeEffect":"Remove effect","rules.mode.simple":"simple","rules.mode.json":"json","rules.mode.js":"JS","category.Inputs":"Inputs","category.Layout":"Layout","category.Data":"Data","brick.text.name":"Text","brick.email.name":"Email","brick.password.name":"Password","brick.url.name":"URL","brick.phone.name":"Phone","brick.textarea.name":"Text area","brick.number.name":"Number","brick.date.name":"Date","brick.time.name":"Time","brick.datetime.name":"Date / Time","brick.select.name":"Select","brick.multi-select.name":"Multi select","brick.radio.name":"Radio","brick.select-boxes.name":"Select boxes","brick.checkbox.name":"Checkbox","brick.tags.name":"Tags","brick.signature.name":"Signature","brick.data-grid.name":"Data grid","brick.address.name":"Address","brick.file.name":"File","brick.hidden.name":"Hidden","brick.content.name":"Content","brick.recap.name":"Recap","recap.empty":"Nothing to summarize yet.","recap.yes":"Yes","recap.no":"No","panel.cfg.showEmpty":"Show empty fields","panel.cfg.groupBySections":"Group by section","brick.group.name":"Group","brick.row.name":"Row","brick.column.name":"Column","brick.stepper.name":"Stepper","brick.tabs.name":"Tabs"},r={"palette.search":"Rechercher une brique…","palette.empty":"Aucune brique ne correspond à « {query} »","builder.undo":"Annuler","builder.redo":"Rétablir","builder.copyJson":"Copier le JSON","builder.importJson":"Importer le JSON","builder.importInvalid":"JSON de formulaire invalide","builder.pasteHint":"Collez avec Ctrl+V pour importer une spec","builder.copied":"Copié !","builder.downloadJson":"Télécharger le .json","builder.hint":"Sélectionnez une brique pour éditer ses propriétés","drop.hint":"Déposez une brique ici","empty.title":"Votre formulaire est vide","empty.hint":"Glissez une brique depuis la palette pour commencer","actions.move":"Déplacer","actions.duplicate":"Dupliquer","actions.delete":"Supprimer","stepper.back":"← Précédent","stepper.next":"Suivant →","stepper.submit":"Envoyer","panel.cfg.validateSteps":"Valider chaque étape","panel.cfg.allowStepClick":"Autoriser le saut d’étapes au clic","panel.cfg.showSubmit":"Bouton d’envoi à la dernière étape","panel.cfg.validateTabs":"Valider l’onglet avant de le quitter","signature.clear":"Effacer","panel.tab.config":"Config","panel.tab.validation":"Validation","panel.tab.styles":"Styles","panel.tab.rules":"Règles","panel.key":"Clé","panel.label":"Libellé","panel.placeholder":"Placeholder","panel.prefix":"Préfixe","panel.suffix":"Suffixe","panel.accept":"Types de fichiers acceptés","panel.uploadUrl":"URL d'upload","panel.cfg.multiple":"Autoriser plusieurs fichiers","panel.optionsSource":"Source des options","panel.options":"Options (une par ligne)","panel.content":"Contenu","panel.dataKey":"Clé de données","panel.url":"URL","panel.headers":"En-têtes ({token} lit les données du formulaire)","panel.searchParam":"Paramètre de recherche serveur","panel.labelKey":"Clé du libellé","panel.valueKey":"Clé de la valeur","panel.errorMessage":"Message d'erreur","panel.required":"Obligatoire","panel.minLength":"Longueur min","panel.maxLength":"Longueur max","panel.min":"Min","panel.max":"Max","panel.pattern":"Motif (regex)","panel.minItems":"Éléments min","panel.maxItems":"Éléments max","panel.emailFormat":"Format email","panel.urlFormat":"Format URL","panel.custom":"Personnalisé (JavaScript)","panel.fallbackMessage":"Message par défaut","panel.styleProperty":"propriété","panel.styleValue":"valeur","file.choose":"Choisir un fichier…","file.uploading":"Envoi en cours…","file.remove":"Retirer le fichier","file.addAnother":"+ Ajouter un fichier","address.street":"Rue","address.city":"Ville","address.zip":"Code postal","address.country":"Pays","grid.addRow":"+ Ajouter une ligne","grid.removeRow":"Supprimer la ligne","grid.empty":"Aucune ligne","grid.columns":"Modèle de ligne","select.search":"Rechercher…","select.empty":"Aucune option","select.clear":"Effacer","rules.when":"Quand","rules.then":"Alors","rules.addRule":"+ Ajouter une règle","rules.addEffect":"+ Effet","rules.removeRule":"Supprimer la règle","rules.removeEffect":"Supprimer l'effet","rules.mode.simple":"simple","rules.mode.json":"json","rules.mode.js":"JS","category.Inputs":"Champs","category.Layout":"Mise en page","category.Data":"Données","brick.text.name":"Texte","brick.email.name":"Email","brick.password.name":"Mot de passe","brick.url.name":"URL","brick.phone.name":"Téléphone","brick.textarea.name":"Zone de texte","brick.number.name":"Nombre","brick.date.name":"Date","brick.time.name":"Heure","brick.datetime.name":"Date / Heure","brick.select.name":"Liste déroulante","brick.multi-select.name":"Sélection multiple","brick.radio.name":"Boutons radio","brick.select-boxes.name":"Cases à cocher","brick.checkbox.name":"Case à cocher","brick.tags.name":"Étiquettes","brick.signature.name":"Signature","brick.data-grid.name":"Grille de données","brick.address.name":"Adresse","brick.file.name":"Fichier","brick.hidden.name":"Caché","brick.content.name":"Contenu","brick.recap.name":"Récapitulatif","recap.empty":"Rien à récapituler pour le moment.","recap.yes":"Oui","recap.no":"Non","panel.cfg.showEmpty":"Afficher les champs vides","panel.cfg.groupBySections":"Regrouper par section","brick.group.name":"Groupe","brick.row.name":"Ligne","brick.column.name":"Colonne","brick.stepper.name":"Étapes","brick.tabs.name":"Onglets"},l=Symbol.for("formkrafter.wc.i18n"),t=globalThis,n=null!==(e=t[l])&&void 0!==e?e:t[l]={current:Object.assign({},a)};function i(e={}){n.current=Object.assign(Object.assign({},a),e)}function o(e,a){var r;let l=null!==(r=n.current[e])&&void 0!==r?r:e;for(const[e,r]of Object.entries(null!=a?a:{}))l=l.replace(`{${e}}`,String(r));return l}function s(e,a){var r;return null!==(r=n.current[e])&&void 0!==r?r:a}export{o as a,r as b,s as f,i as s}
@@ -0,0 +1 @@
1
+ import{t as i,p as t,H as s,c as e,h as r}from"./p-BB4Llg42.js";import{g as o,r as n}from"./p-CKMHMpID.js";import{b as a}from"./p-gPc0o8Jb.js";import{d as l}from"./p-DYchD23x.js";import{d as c}from"./p-NDbmiiYk.js";import{d as h}from"./p-YyGnQmX-.js";function d(i,t){var s;if((null===(s=i.configs)||void 0===s?void 0:s.key)&&t)return i.unWrapData?t:t[i.configs.key]}const u=t(class extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.brickDataChange=e(this,"brickDataChange"),this.brickConfigsChange=e(this,"brickConfigsChange"),this.brickStylesChange=e(this,"brickStylesChange"),this.brickValidationsChange=e(this,"brickValidationsChange"),this.brickRulesChange=e(this,"brickRulesChange"),this.brickRemove=e(this,"brickRemove"),this.brickDuplicate=e(this,"brickDuplicate"),this.path="0",this.editable=!1,this.errors={}}render(){var i,t,s,e,l,c;const h=this.brickSpec;if(!h)return null;const u=a(h.type,h.id);if(!u)return r("fk-brick-not-found",null,`${h.type}:${h.id}`);const k=this.editable&&(null===(i=h.editable)||void 0===i||i),f=o(h.rules,this.dataMap);if(!k&&!0===f.hidden)return null;const p="panel"===h.type||"collection"===h.type,b=null===(t=h.configs)||void 0===t?void 0:t.uid,m=(null!==(s=h.children)&&void 0!==s?s:[]).map(((i,t)=>{var s;return r("fk-brick-render",{brickSpec:i,rootSpec:null!==(s=this.rootSpec)&&void 0!==s?s:this.brickSpec,data:this.data,dataMap:this.dataMap,errors:this.errors,locale:this.locale,path:`${this.path}.${t}`,editable:this.editable,selectedUid:this.selectedUid,utils:this.utils})}));k&&p&&m.push(r("fk-drop-area",{path:this.path}));const v={brickSpec:h,configsForm:h.configsForm,configs:n(h.configs,this.locale),locale:this.locale,styles:null!==(e=h.styles)&&void 0!==e?e:{},data:d(h,this.data),dataMap:this.dataMap,rootSpec:null!==(l=this.rootSpec)&&void 0!==l?l:this.brickSpec,error:(null===(c=h.configs)||void 0===c?void 0:c.key)?this.errors[h.configs.key]:void 0,disabled:!k&&!0===f.disabled,path:this.path,editable:k,children:m,validations:h.validations,rules:h.rules,utils:this.utils,onDataChange:i=>{const t=function(i,t){var s;if(null===(s=i.configs)||void 0===s?void 0:s.key)return i.unWrapData?t:{[i.configs.key]:t}}(h,i);void 0!==t&&this.brickDataChange.emit(t)},onConfigsChange:(i,t)=>this.brickConfigsChange.emit({configs:i,uid:null!=t?t:b}),onStylesChange:(i,t)=>this.brickStylesChange.emit({styles:i,uid:null!=t?t:b}),onValidationsChange:(i,t)=>this.brickValidationsChange.emit({validations:i,uid:null!=t?t:b}),onRulesChange:(i,t)=>this.brickRulesChange.emit({rules:i,uid:null!=t?t:b}),onDelete:i=>this.brickRemove.emit({path:i}),onDuplicate:i=>this.brickDuplicate.emit({path:i})},g=k?u.renderBuilder(v):u.render(v);return k&&"0"!==this.path?r("fk-brick-actions",{path:this.path,selected:void 0!==b&&b===this.selectedUid},g):g}},[0,"fk-brick-render",{brickSpec:[16],rootSpec:[16],data:[16],dataMap:[16],path:[1],editable:[4],selectedUid:[1,"selected-uid"],errors:[16],locale:[1],utils:[16]}]);function k(){"undefined"!=typeof customElements&&["fk-brick-render","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-drop-area"].forEach((t=>{switch(t){case"fk-brick-render":customElements.get(i(t))||customElements.define(i(t),u);break;case"fk-brick-actions":customElements.get(i(t))||l();break;case"fk-brick-not-found":customElements.get(i(t))||c();break;case"fk-brick-render":customElements.get(i(t))||k();break;case"fk-drop-area":customElements.get(i(t))||h()}}))}k();export{u as F,k as d}
@@ -1 +1 @@
1
- import{t,p as s,H as e,c as r,h as i}from"./p-QC41Uj05.js";import{i as a,g as o,v as c}from"./p-dX7Lo8Fe.js";import{d as n}from"./p-BNREw7TY.js";import{d as h}from"./p-BB3BQPr8.js";import{d}from"./p-DKoJovNt.js";import{d as l}from"./p-Ctt--jpe.js";const f=s(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.formDataChange=r(this,"formDataChange"),this.formSubmit=r(this,"formSubmit"),this.editable=!1,this.currentData={},this.touched={},this.utils={validateForm:()=>({isValid:this.runValidation().valid})}}componentWillLoad(){this.currentData=Object.assign({},this.data)}syncData(t){this.currentData=Object.assign({},t)}publicData(){return Object.fromEntries(Object.entries(this.currentData).filter((([t])=>!t.startsWith("_"))))}handleBrickDataChange(t){t.stopPropagation(),this.currentData=this.applyValueEffects(Object.assign(Object.assign({},this.currentData),t.detail));const s=Object.assign({},this.touched);for(const e of Object.keys(t.detail))s[e]=!0;this.touched=s;const{valid:e,errors:r}=this.runValidation();this.formDataChange.emit({data:this.publicData(),isValid:e,errors:r})}applyValueEffects(t){var s,e;let r=t;for(const{brick:t}of a(this.spec)){const i=null===(s=t.configs)||void 0===s?void 0:s.key;if(!i||!(null===(e=t.rules)||void 0===e?void 0:e.length))continue;const a=o(t.rules,r);void 0!==a.value&&r[i]!==a.value&&(r=Object.assign(Object.assign({},r),{[i]:a.value}))}return r}async validate(){var t;const s={};for(const{brick:e}of a(this.spec)){const r=null===(t=e.configs)||void 0===t?void 0:t.key;r&&(s[r]=!0)}this.touched=s;const e=this.runValidation(),r=Object.assign({},e.errors);let i=e.valid;const o=Array.from(this.host.querySelectorAll("fk-data-grid"));for(const t of o){const s=await t.validateRows();i=i&&s.valid,Object.assign(r,s.errors)}const c={valid:i,errors:r};return this.formDataChange.emit({data:this.publicData(),isValid:c.valid,errors:c.errors}),c}handleStepTouch(t){t.stopPropagation();const s=Object.assign({},this.touched);for(const e of t.detail.keys)s[e]=!0;this.touched=s}async handleStepperSubmit(t){t.stopPropagation();const s=await this.validate();this.formSubmit.emit({data:this.publicData(),isValid:s.valid,errors:s.errors})}runValidation(){const t=Object.fromEntries(Object.entries(this.currentData).filter((([,t])=>""!==t&&null!=t)));return c(this.spec,t,this.locale)}visibleErrors(){if(this.editable)return{};const t={};for(const[s,e]of Object.entries(this.runValidation().errors))this.touched[s]&&(t[s]=e);return t}render(){return this.spec?i("form",{class:"fk-form",onSubmit:t=>t.preventDefault()},i("fk-brick-render",{brickSpec:this.spec,data:this.currentData,dataMap:this.currentData,errors:this.visibleErrors(),locale:this.locale,path:"0",editable:this.editable,selectedUid:this.selectedUid,utils:this.utils})):null}get host(){return this}static get watchers(){return{data:[{syncData:0}]}}static get style(){return".fk-form.sc-fk-form-render{display:flex;flex-direction:column;gap:var(--fk-spacing);font-family:var(--fk-font);color:var(--fk-color-text)}"}},[2,"fk-form-render",{spec:[16],data:[16],editable:[4],selectedUid:[1,"selected-uid"],locale:[1],currentData:[32],touched:[32],validate:[64]},[[0,"brickDataChange","handleBrickDataChange"],[0,"stepTouch","handleStepTouch"],[0,"stepperSubmit","handleStepperSubmit"]],{data:[{syncData:0}]}]);function u(){"undefined"!=typeof customElements&&["fk-form-render","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-drop-area"].forEach((s=>{switch(s){case"fk-form-render":customElements.get(t(s))||customElements.define(t(s),f);break;case"fk-brick-actions":customElements.get(t(s))||n();break;case"fk-brick-not-found":customElements.get(t(s))||h();break;case"fk-brick-render":customElements.get(t(s))||d();break;case"fk-drop-area":customElements.get(t(s))||l()}}))}u();export{f as F,u as d}
1
+ import{t,p as s,H as e,c as r,h as i}from"./p-BB4Llg42.js";import{i as a,g as o,v as c}from"./p-CKMHMpID.js";import{d as n}from"./p-DYchD23x.js";import{d as h}from"./p-NDbmiiYk.js";import{d}from"./p-BWdm2a6q.js";import{d as l}from"./p-YyGnQmX-.js";const f=s(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.formDataChange=r(this,"formDataChange"),this.formSubmit=r(this,"formSubmit"),this.editable=!1,this.currentData={},this.touched={},this.utils={validateForm:()=>({isValid:this.runValidation().valid})}}componentWillLoad(){this.currentData=Object.assign({},this.data)}syncData(t){this.currentData=Object.assign({},t)}publicData(){return Object.fromEntries(Object.entries(this.currentData).filter((([t])=>!t.startsWith("_"))))}handleBrickDataChange(t){t.stopPropagation(),this.currentData=this.applyValueEffects(Object.assign(Object.assign({},this.currentData),t.detail));const s=Object.assign({},this.touched);for(const e of Object.keys(t.detail))s[e]=!0;this.touched=s;const{valid:e,errors:r}=this.runValidation();this.formDataChange.emit({data:this.publicData(),isValid:e,errors:r})}applyValueEffects(t){var s,e;let r=t;for(const{brick:t}of a(this.spec)){const i=null===(s=t.configs)||void 0===s?void 0:s.key;if(!i||!(null===(e=t.rules)||void 0===e?void 0:e.length))continue;const a=o(t.rules,r);void 0!==a.value&&r[i]!==a.value&&(r=Object.assign(Object.assign({},r),{[i]:a.value}))}return r}async validate(){var t;const s={};for(const{brick:e}of a(this.spec)){const r=null===(t=e.configs)||void 0===t?void 0:t.key;r&&(s[r]=!0)}this.touched=s;const e=this.runValidation(),r=Object.assign({},e.errors);let i=e.valid;const o=Array.from(this.host.querySelectorAll("fk-data-grid"));for(const t of o){const s=await t.validateRows();i=i&&s.valid,Object.assign(r,s.errors)}const c={valid:i,errors:r};return this.formDataChange.emit({data:this.publicData(),isValid:c.valid,errors:c.errors}),c}handleStepTouch(t){t.stopPropagation();const s=Object.assign({},this.touched);for(const e of t.detail.keys)s[e]=!0;this.touched=s}async handleStepperSubmit(t){t.stopPropagation();const s=await this.validate();this.formSubmit.emit({data:this.publicData(),isValid:s.valid,errors:s.errors})}runValidation(){const t=Object.fromEntries(Object.entries(this.currentData).filter((([,t])=>""!==t&&null!=t)));return c(this.spec,t,this.locale)}visibleErrors(){if(this.editable)return{};const t={};for(const[s,e]of Object.entries(this.runValidation().errors))this.touched[s]&&(t[s]=e);return t}render(){return this.spec?i("form",{class:"fk-form",onSubmit:t=>t.preventDefault()},i("fk-brick-render",{brickSpec:this.spec,rootSpec:this.spec,data:this.currentData,dataMap:this.currentData,errors:this.visibleErrors(),locale:this.locale,path:"0",editable:this.editable,selectedUid:this.selectedUid,utils:this.utils})):null}get host(){return this}static get watchers(){return{data:[{syncData:0}]}}static get style(){return".fk-form.sc-fk-form-render{display:flex;flex-direction:column;gap:var(--fk-spacing);font-family:var(--fk-font);color:var(--fk-color-text)}"}},[2,"fk-form-render",{spec:[16],data:[16],editable:[4],selectedUid:[1,"selected-uid"],locale:[1],currentData:[32],touched:[32],validate:[64]},[[0,"brickDataChange","handleBrickDataChange"],[0,"stepTouch","handleStepTouch"],[0,"stepperSubmit","handleStepperSubmit"]],{data:[{syncData:0}]}]);function m(){"undefined"!=typeof customElements&&["fk-form-render","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-drop-area"].forEach((s=>{switch(s){case"fk-form-render":customElements.get(t(s))||customElements.define(t(s),f);break;case"fk-brick-actions":customElements.get(t(s))||n();break;case"fk-brick-not-found":customElements.get(t(s))||h();break;case"fk-brick-render":customElements.get(t(s))||d();break;case"fk-drop-area":customElements.get(t(s))||l()}}))}m();export{f as F,m as d}
@@ -0,0 +1 @@
1
+ import{t,p as e,H as o,c as r}from"./p-BB4Llg42.js";let s;const i=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.codeChange=r(this,"codeChange"),this.value="",this.placeholder="",this.disconnected=!1}async componentDidLoad(){const[{EditorState:t},{EditorView:e,keymap:o,lineNumbers:r,placeholder:i},{defaultKeymap:c,history:n,historyKeymap:d},{defaultHighlightStyle:a,syntaxHighlighting:l},{javascript:h}]=await(null!=s?s:s=Promise.all([import("./p-DtcM1yw5.js"),import("./p-DMCkrZqi.js").then((function(t){return t.i})),import("./p-C-wnqV3i.js"),import("./p-4COASNrZ.js").then((function(t){return t.v})),import("./p-DOInQkG6.js")]));this.disconnected||(this.view=new e({parent:this.host,state:t.create({doc:this.value,extensions:[r(),n(),o.of([...c,...d]),h(),l(a),i(this.placeholder),e.domEventHandlers({blur:()=>this.emitIfChanged()})]})}))}syncValue(t){if(!this.view||this.view.hasFocus)return;const e=this.view.state.doc.toString();e!==t&&this.view.dispatch({changes:{from:0,to:e.length,insert:t}})}emitIfChanged(){if(!this.view)return;const t=this.view.state.doc.toString();t!==this.value&&this.codeChange.emit(t)}disconnectedCallback(){var t;this.disconnected=!0,null===(t=this.view)||void 0===t||t.destroy(),this.view=void 0}render(){return null}get host(){return this}static get watchers(){return{value:[{syncValue:0}]}}static get style(){return".sc-fk-code-editor-h{display:block}.sc-fk-code-editor-h .cm-editor.sc-fk-code-editor{min-height:88px;font-size:0.75rem;border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 2);background:var(--fk-color-surface)}.sc-fk-code-editor-h .cm-editor.cm-focused.sc-fk-code-editor{outline:none;border-color:var(--fk-color-primary)}.sc-fk-code-editor-h .cm-gutters.sc-fk-code-editor{border-right:1px solid var(--fk-color-border);background:color-mix(in srgb, var(--fk-color-surface) 70%, transparent);color:var(--fk-color-muted)}.sc-fk-code-editor-h .cm-content.sc-fk-code-editor{font-family:ui-monospace, SFMono-Regular, Menlo, monospace}"}},[2,"fk-code-editor",{value:[1],placeholder:[1]},void 0,{value:[{syncValue:0}]}]);function c(){"undefined"!=typeof customElements&&["fk-code-editor"].forEach((e=>{"fk-code-editor"===e&&(customElements.get(t(e))||customElements.define(t(e),i))}))}c();export{i as F,c as d}
@@ -0,0 +1 @@
1
+ import{StateField as t,Facet as e,Annotation as r,EditorSelection as n,countColumn as o,Text as l,findClusterBreak as u,Transaction as i,CharCategory as s,combineConfig as f,StateEffect as a,ChangeSet as c,ChangeDesc as h}from"./p-DtcM1yw5.js";import{E as d,D as p}from"./p-DMCkrZqi.js";import{I as m,g as k,i as y,s as w,N as v,m as M,a as g,b as A}from"./p-4COASNrZ.js";const D=t=>{let{state:e}=t,r=e.doc.lineAt(e.selection.main.from),n=R(t.state,r.from);return n.line?C(t):!!n.block&&B(t)};function E(t,e){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let o=t(e,r);return!!o&&(n(r.update(o)),!0)}}const C=E(N,0),S=E(N,1),I=E(N,2),b=E(L,0),V=E(L,1),U=E(L,2),B=E(((t,e)=>L(t,e,function(t){let e=[];for(let r of t.selection.ranges){let n=t.doc.lineAt(r.from),o=r.to<=n.to?n:t.doc.lineAt(r.to);o.from>n.from&&o.from==r.to&&(o=r.to==n.to+1?n:t.doc.lineAt(r.to-1));let l=e.length-1;l>=0&&e[l].to>n.from?e[l].to=o.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:o.to})}return e}(e))),0);function R(t,e){let r=t.languageDataAt("commentTokens",e,1);return r.length?r[0]:{}}const j=50;function L(t,e,r=e.selection.ranges){let n=r.map((t=>R(e,t.from).block));if(!n.every((t=>t)))return null;let o=r.map(((t,r)=>function(t,{open:e,close:r},n,o){let l,u,i=t.sliceDoc(n-j,n),s=t.sliceDoc(o,o+j),f=/\s*$/.exec(i)[0].length,a=/^\s*/.exec(s)[0].length,c=i.length-f;if(i.slice(c-e.length,c)==e&&s.slice(a,a+r.length)==r)return{open:{pos:n-f,margin:f&&1},close:{pos:o+a,margin:a&&1}};o-n<=2*j?l=u=t.sliceDoc(n,o):(l=t.sliceDoc(n,n+j),u=t.sliceDoc(o-j,o));let h=/^\s*/.exec(l)[0].length,d=/\s*$/.exec(u)[0].length,p=u.length-d-r.length;return l.slice(h,h+e.length)==e&&u.slice(p,p+r.length)==r?{open:{pos:n+h+e.length,margin:/\s/.test(l.charAt(h+e.length))?1:0},close:{pos:o-d-r.length,margin:/\s/.test(u.charAt(p-1))?1:0}}:null}(e,n[r],t.from,t.to)));if(2!=t&&!o.every((t=>t)))return{changes:e.changes(r.map(((t,e)=>o[e]?[]:[{from:t.from,insert:n[e].open+" "},{from:t.to,insert:" "+n[e].close}])))};if(1!=t&&o.some((t=>t))){let t=[];for(let e,r=0;r<o.length;r++)if(e=o[r]){let o=n[r],{open:l,close:u}=e;t.push({from:l.pos-o.open.length,to:l.pos+l.margin},{from:u.pos-u.margin,to:u.pos+o.close.length})}return{changes:t}}return null}function N(t,e,r=e.selection.ranges){let n=[],o=-1;t:for(let{from:t,to:l}of r){let r,u=n.length,i=1e9;for(let u=t;u<=l;){let s=e.doc.lineAt(u);if(null==r&&(r=R(e,s.from).line,!r))continue t;if(s.from>o&&(t==l||l>s.from)){o=s.from;let t=/^\s*/.exec(s.text)[0].length,e=t==s.length,l=s.text.slice(t,t+r.length)==r?t:-1;t<s.text.length&&t<i&&(i=t),n.push({line:s,comment:l,token:r,indent:t,empty:e,single:!1})}u=s.to+1}if(i<1e9)for(let t=u;t<n.length;t++)n[t].indent<n[t].line.text.length&&(n[t].indent=i);n.length==u+1&&(n[u].single=!0)}if(2!=t&&n.some((t=>t.comment<0&&(!t.empty||t.single)))){let t=[];for(let{line:e,token:r,indent:o,empty:l,single:u}of n)!u&&l||t.push({from:e.from+o,insert:r+" "});let r=e.changes(t);return{changes:r,selection:e.selection.map(r,1)}}if(1!=t&&n.some((t=>t.comment>=0))){let t=[];for(let{line:e,comment:r,token:o}of n)if(r>=0){let n=e.from+r,l=n+o.length;" "==e.text[l-e.from]&&l++,t.push({from:n,to:l})}return{changes:t}}return null}const O=r.define(),T=r.define(),$=e.define(),J=e.define({combine:t=>f(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(r,n)=>t(r,n)||e(r,n)})}),z=t.define({create:()=>it.empty,update(t,e){let r=e.state.facet(J),n=e.annotation(O);if(n){let o=Q.fromTransaction(e,n.selection),l=n.side,u=0==l?t.undone:t.done;return u=o?X(u,u.length,r.minDepth,o):rt(u,e.startState.selection),new it(0==l?n.rest:u,0==l?u:n.rest)}let o=e.annotation(T);if("full"!=o&&"before"!=o||(t=t.isolate()),!1===e.annotation(i.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let l=Q.fromTransaction(e),u=e.annotation(i.time),s=e.annotation(i.userEvent);return l?t=t.addChanges(l,u,s,r,e):e.selection&&(t=t.addSelection(e.startState.selection,u,s,r.newGroupDelay)),"full"!=o&&"after"!=o||(t=t.isolate()),t},toJSON:t=>({done:t.done.map((t=>t.toJSON())),undone:t.undone.map((t=>t.toJSON()))}),fromJSON:t=>new it(t.done.map(Q.fromJSON),t.undone.map(Q.fromJSON))});function x(t={}){return[z,J.of(t),d.domEventHandlers({beforeinput(t,e){let r="historyUndo"==t.inputType?P:"historyRedo"==t.inputType?Z:null;return!!r&&(t.preventDefault(),r(e))}})]}const G=z;function H(t,e){return function({state:r,dispatch:n}){if(!e&&r.readOnly)return!1;let o=r.field(z,!1);if(!o)return!1;let l=o.pop(t,r,e);return!!l&&(n(l),!0)}}const P=H(0,!1),Z=H(1,!1),q=H(0,!0),W=H(1,!0);function _(t){return function(e){let r=e.field(z,!1);if(!r)return 0;let n=0==t?r.done:r.undone;return n.length-(n.length&&!n[0].changes?1:0)}}const F=_(0),K=_(1);class Q{constructor(t,e,r,n,o){this.changes=t,this.effects=e,this.mapped=r,this.startSelection=n,this.selectionsAfter=o}setSelAfter(t){return new Q(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,r;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(r=this.startSelection)||void 0===r?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map((t=>t.toJSON()))}}static fromJSON(t){return new Q(t.changes&&c.fromJSON(t.changes),[],t.mapped&&h.fromJSON(t.mapped),t.startSelection&&n.fromJSON(t.startSelection),t.selectionsAfter.map(n.fromJSON))}static fromTransaction(t,e){let r=tt;for(let e of t.startState.facet($)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new Q(t.changes.invert(t.startState.doc),r,void 0,e||t.startState.selection,tt)}static selection(t){return new Q(void 0,tt,void 0,void 0,t)}}function X(t,e,r,n){let o=t.slice(e+1>r+20?e-r-1:0,e);return o.push(n),o}function Y(t,e){return t.length?e.length?t.concat(e):t:e}const tt=[],et=200;function rt(t,e){if(t.length){let r=t[t.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-et));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),X(t,t.length-1,1e9,r.setSelAfter(n)))}return[Q.selection([e])]}function nt(t){let e=t[t.length-1],r=t.slice();return r[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),r}function ot(t,e){if(!t.length)return t;let r=t.length,n=tt;for(;r;){let o=lt(t[r-1],e,n);if(o.changes&&!o.changes.empty||o.effects.length){let e=t.slice(0,r);return e[r-1]=o,e}e=o.mapped,r--,n=o.selectionsAfter}return n.length?[Q.selection(n)]:tt}function lt(t,e,r){let n=Y(t.selectionsAfter.length?t.selectionsAfter.map((t=>t.map(e))):tt,r);if(!t.changes)return Q.selection(n);let o=t.changes.map(e),l=e.mapDesc(t.changes,!0),u=t.mapped?t.mapped.composeDesc(l):l;return new Q(o,a.mapEffects(t.effects,e),u,t.startSelection.map(l),n)}const ut=/^(input\.type|delete)($|\.)/;class it{constructor(t,e,r=0,n){this.done=t,this.undone=e,this.prevTime=r,this.prevUserEvent=n}isolate(){return this.prevTime?new it(this.done,this.undone):this}addChanges(t,e,r,n,o){let l=this.done,u=l[l.length-1];return l=u&&u.changes&&!u.changes.empty&&t.changes&&(!r||ut.test(r))&&(!u.selectionsAfter.length&&e-this.prevTime<n.newGroupDelay&&n.joinToEvent(o,function(t,e){let r=[],n=!1;return t.iterChangedRanges(((t,e)=>r.push(t,e))),e.iterChangedRanges(((t,e,o,l)=>{for(let t=0;t<r.length;){let e=r[t++],u=r[t++];l>=e&&o<=u&&(n=!0)}})),n}(u.changes,t.changes))||"input.type.compose"==r)?X(l,l.length-1,n.minDepth,new Q(t.changes.compose(u.changes),Y(a.mapEffects(t.effects,u.changes),u.effects),u.mapped,u.startSelection,tt)):X(l,l.length,n.minDepth,t),new it(l,tt,e,r)}addSelection(t,e,r,n){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:tt;return o.length>0&&e-this.prevTime<n&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&(l=o[o.length-1]).ranges.length==(u=t).ranges.length&&0===l.ranges.filter(((t,e)=>t.empty!=u.ranges[e].empty)).length?this:new it(rt(this.done,t),this.undone,e,r);var l,u}addMapping(t){return new it(ot(this.done,t),ot(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,r){let n=0==t?this.done:this.undone;if(0==n.length)return null;let o=n[n.length-1],l=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):e.selection);if(r&&o.selectionsAfter.length)return e.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:O.of({side:t,rest:nt(n),selection:l}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let r=1==n.length?tt:n.slice(0,n.length-1);return o.mapped&&(r=ot(r,o.mapped)),e.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:O.of({side:t,rest:r,selection:l}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}it.empty=new it(tt,tt);const st=[{key:"Mod-z",run:P,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Z,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Z,preventDefault:!0},{key:"Mod-u",run:q,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:W,preventDefault:!0}];function ft(t,e){return n.create(t.ranges.map(e),t.mainIndex)}function at(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function ct({state:t,dispatch:e},r){let n=ft(t.selection,r);return!n.eq(t.selection,!0)&&(e(at(t,n)),!0)}function ht(t,e){return n.cursor(e?t.to:t.from)}function dt(t,e){return ct(t,(r=>r.empty?t.moveByChar(r,e):ht(r,e)))}function pt(t){return t.textDirectionAt(t.state.selection.main.head)==p.LTR}const mt=t=>dt(t,!pt(t)),kt=t=>dt(t,pt(t)),yt=t=>dt(t,!0),wt=t=>dt(t,!1);function vt(t,e,r){let o=e.head,l=t.doc.lineAt(o);return o=o==(r?l.to:l.from)?r?Math.min(t.doc.length,l.to+1):Math.max(0,l.from-1):l.from+u(l.text,o-l.from,r),n.cursor(o,r?-1:1)}function Mt(t,e){return ct(t,(r=>r.empty?vt(t.state,r,e):ht(r,e)))}const gt=t=>Mt(t,!0),At=t=>Mt(t,!1);function Dt(t,e){return ct(t,(r=>r.empty?t.moveByGroup(r,e):ht(r,e)))}const Et=t=>Dt(t,!pt(t)),Ct=t=>Dt(t,pt(t)),St=t=>Dt(t,!0),It=t=>Dt(t,!1);function bt(t,e,r){let n=t.state.charCategorizer(e),o=n(r),l=o!=s.Space;return t=>{let e=n(t);return e!=s.Space?l&&e==o:(l=!1,!0)}}const Vt=t=>ct(t,(e=>e.empty?t.moveByChar(e,!0,(r=>bt(t,e.head,r))):ht(e,!0))),Ut="undefined"!=typeof Intl&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function Bt(t,e,r){let o=t.state.charCategorizer(e.from),l=s.Space,u=e.from,i=0,f=!1,a=!1,c=!1,h=e=>{if(f)return!1;u+=r?e.length:-e.length;let n,h=o(e);if(h==s.Word&&e.charCodeAt(0)<128&&/[\W_]/.test(e)&&(h=-1),l==s.Space&&(l=h),l!=h)return!1;if(l==s.Word)if(e.toLowerCase()==e){if(!r&&a)return!1;c=!0}else if(c){if(r)return!1;f=!0}else{if(a&&r&&o(n=t.state.sliceDoc(u,u+1))==s.Word&&n.toLowerCase()==n)return!1;a=!0}return i++,!0},d=t.moveByChar(e,r,(t=>(h(t),h)));if(Ut&&l==s.Word&&d.from==e.from+i*(r?1:-1)){let o=Math.min(e.head,d.head),l=Math.max(e.head,d.head),u=t.state.sliceDoc(o,l);if(u.length>1&&/[\u4E00-\uffff]/.test(u)){let t=Array.from(Ut.segment(u));if(t.length>1)return r?n.cursor(e.head+t[1].index,-1):n.cursor(d.head+t[t.length-1].index,1)}}return d}function Rt(t,e){return ct(t,(r=>r.empty?Bt(t,r,e):ht(r,e)))}const jt=t=>Rt(t,!0),Lt=t=>Rt(t,!1);function Nt(t,e,r){if(e.type.prop(r))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Ot(t,e,r){let o,l,u=w(t).resolveInner(e.head),i=r?v.closedBy:v.openedBy;for(let n=e.head;;){let e=r?u.childAfter(n):u.childBefore(n);if(!e)break;Nt(t,e,i)?u=e:n=r?e.to:e.from}return l=u.type.prop(i)&&(o=r?M(t,u.from,1):M(t,u.to,-1))&&o.matched?r?o.end.to:o.end.from:r?u.to:u.from,n.cursor(l,r?-1:1)}const Tt=t=>ct(t,(e=>Ot(t.state,e,!pt(t)))),$t=t=>ct(t,(e=>Ot(t.state,e,pt(t))));function Jt(t,e){return ct(t,(r=>{if(!r.empty)return ht(r,e);let n=t.moveVertically(r,e);return n.head!=r.head?n:t.moveToLineBoundary(r,e)}))}const zt=t=>Jt(t,!1),xt=t=>Jt(t,!0);function Gt(t){let e,r=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,o=0;if(r){for(let e of t.state.facet(d.scrollMargins)){let r=e(t);(null==r?void 0:r.top)&&(n=Math.max(null==r?void 0:r.top,n)),(null==r?void 0:r.bottom)&&(o=Math.max(null==r?void 0:r.bottom,o))}e=t.scrollDOM.clientHeight-n-o}else e=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:o,selfScroll:r,height:Math.max(t.defaultLineHeight,e-5)}}function Ht(t,e){let r,n=Gt(t),{state:o}=t,l=ft(o.selection,(r=>r.empty?t.moveVertically(r,e,n.height):ht(r,e)));if(l.eq(o.selection))return!1;if(n.selfScroll){let e=t.coordsAtPos(o.selection.main.head),u=t.scrollDOM.getBoundingClientRect(),i=u.top+n.marginTop;e&&e.top>i&&e.bottom<u.bottom-n.marginBottom&&(r=d.scrollIntoView(l.main.head,{y:"start",yMargin:e.top-i}))}return t.dispatch(at(o,l),{effects:r}),!0}const Pt=t=>Ht(t,!1),Zt=t=>Ht(t,!0);function qt(t,e,r){let o=t.lineBlockAt(e.head),l=t.moveToLineBoundary(e,r);if(l.head==e.head&&l.head!=(r?o.to:o.from)&&(l=t.moveToLineBoundary(e,r,!1)),!r&&l.head==o.from&&o.length){let r=/^\s*/.exec(t.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;r&&e.head!=o.from+r&&(l=n.cursor(o.from+r))}return l}const Wt=t=>ct(t,(e=>qt(t,e,!0))),_t=t=>ct(t,(e=>qt(t,e,!1))),Ft=t=>ct(t,(e=>qt(t,e,!pt(t)))),Kt=t=>ct(t,(e=>qt(t,e,pt(t)))),Qt=t=>ct(t,(e=>n.cursor(t.lineBlockAt(e.head).from,1))),Xt=t=>ct(t,(e=>n.cursor(t.lineBlockAt(e.head).to,-1)));function Yt(t,e,r){let o=!1,l=ft(t.selection,(e=>{let l=M(t,e.head,-1)||M(t,e.head,1)||e.head>0&&M(t,e.head-1,1)||e.head<t.doc.length&&M(t,e.head+1,-1);if(!l||!l.end)return e;o=!0;let u=l.start.from==e.head?l.end.to:l.end.from;return r?n.range(e.anchor,u):n.cursor(u)}));return!!o&&(e(at(t,l)),!0)}const te=({state:t,dispatch:e})=>Yt(t,e,!1),ee=({state:t,dispatch:e})=>Yt(t,e,!0);function re(t,e,r){let o=ft(t.state.selection,(t=>{t.undirectional&&t.head>=t.anchor!=e&&(t=n.range(t.head,t.anchor));let o=r(t);return n.range(t.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)}));return!o.eq(t.state.selection)&&(t.dispatch(at(t.state,o)),!0)}function ne(t,e){return re(t,e,(r=>t.moveByChar(r,e)))}const oe=t=>ne(t,!pt(t)),le=t=>ne(t,pt(t)),ue=t=>ne(t,!0),ie=t=>ne(t,!1),se=t=>re(t,!0,(e=>vt(t.state,e,!0))),fe=t=>re(t,!1,(e=>vt(t.state,e,!1)));function ae(t,e){return re(t,e,(r=>t.moveByGroup(r,e)))}const ce=t=>ae(t,!pt(t)),he=t=>ae(t,pt(t)),de=t=>ae(t,!0),pe=t=>ae(t,!1),me=t=>re(t,!0,(e=>t.moveByChar(e,!0,(r=>bt(t,e.head,r)))));function ke(t,e){return re(t,e,(r=>Bt(t,r,e)))}const ye=t=>ke(t,!0),we=t=>ke(t,!1),ve=t=>{let e=!pt(t);return re(t,e,(r=>Ot(t.state,r,e)))},Me=t=>{let e=pt(t);return re(t,e,(r=>Ot(t.state,r,e)))};function ge(t,e){return re(t,e,(r=>t.moveVertically(r,e)))}const Ae=t=>ge(t,!1),De=t=>ge(t,!0);function Ee(t,e){return re(t,e,(r=>t.moveVertically(r,e,Gt(t).height)))}const Ce=t=>Ee(t,!1),Se=t=>Ee(t,!0),Ie=t=>re(t,!0,(e=>qt(t,e,!0))),be=t=>re(t,!1,(e=>qt(t,e,!1))),Ve=t=>{let e=!pt(t);return re(t,e,(r=>qt(t,r,e)))},Ue=t=>{let e=pt(t);return re(t,e,(r=>qt(t,r,e)))},Be=t=>re(t,!1,(e=>n.cursor(t.lineBlockAt(e.head).from))),Re=t=>re(t,!0,(e=>n.cursor(t.lineBlockAt(e.head).to))),je=({state:t,dispatch:e})=>(e(at(t,{anchor:0})),!0),Le=({state:t,dispatch:e})=>(e(at(t,{anchor:t.doc.length})),!0),Ne=({state:t,dispatch:e})=>(e(at(t,{anchor:t.selection.main.anchor,head:0})),!0),Oe=({state:t,dispatch:e})=>(e(at(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Te=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),$e=({state:t,dispatch:e})=>{let r=ir(t).map((({from:e,to:r})=>n.range(e,Math.min(r+1,t.doc.length))));return e(t.update({selection:n.create(r),userEvent:"select"})),!0},Je=({state:t,dispatch:e})=>{let r=ft(t.selection,(e=>{let r=w(t),o=r.resolveStack(e.from,1);if(e.empty){let t=r.resolveStack(e.from,-1);t.node.from>=o.node.from&&t.node.to<=o.node.to&&(o=t)}for(let t=o;t;t=t.next){let{node:r}=t;if((r.from<e.from&&r.to>=e.to||r.to>e.to&&r.from<=e.from)&&t.next)return n.range(r.to,r.from)}return e}));return!r.eq(t.selection)&&(e(at(t,r)),!0)};function ze(t,e){let{state:r}=t,o=r.selection,l=r.selection.ranges.slice();for(let n of r.selection.ranges){let o=r.doc.lineAt(n.head);if(e?o.to<t.state.doc.length:o.from>0)for(let r=n;;){let n=t.moveVertically(r,e);if(n.head<o.from||n.head>o.to){l.some((t=>t.head==n.head))||l.push(n);break}if(n.head==r.head)break;r=n}}return l.length!=o.ranges.length&&(t.dispatch(at(r,n.create(l,l.length-1))),!0)}const xe=t=>ze(t,!1),Ge=t=>ze(t,!0),He=({state:t,dispatch:e})=>{let r=t.selection,o=null;return r.ranges.length>1?o=n.create([r.main]):r.main.empty||(o=n.create([n.cursor(r.main.head)])),!!o&&(e(at(t,o)),!0)};function Pe(t,e){if(t.state.readOnly)return!1;let r="delete.selection",{state:o}=t,l=o.changeByRange((o=>{let{from:l,to:u}=o;if(l==u){let n=e(o);n<l?(r="delete.backward",n=Ze(t,n,!1)):n>l&&(r="delete.forward",n=Ze(t,n,!0)),l=Math.min(l,n),u=Math.max(u,n)}else l=Ze(t,l,!1),u=Ze(t,u,!0);return l==u?{range:o}:{changes:{from:l,to:u},range:n.cursor(l,l<o.head?-1:1)}}));return!l.changes.empty&&(t.dispatch(o.update(l,{scrollIntoView:!0,userEvent:r,effects:"delete.selection"==r?d.announce.of(o.phrase("Selection deleted")):void 0})),!0)}function Ze(t,e,r){if(t instanceof d)for(let n of t.state.facet(d.atomicRanges).map((e=>e(t))))n.between(e,e,((t,n)=>{t<e&&n>e&&(e=r?n:t)}));return e}const qe=(t,e,r)=>Pe(t,(n=>{let l,i,s=n.from,{state:f}=t,a=f.doc.lineAt(s);if(r&&!e&&s>a.from&&s<a.from+200&&!/[^ \t]/.test(l=a.text.slice(0,s-a.from))){if("\t"==l[l.length-1])return s-1;let t=o(l,f.tabSize)%g(f)||g(f);for(let e=0;e<t&&" "==l[l.length-1-e];e++)s--;i=s}else i=u(a.text,s-a.from,e,e)+a.from,i==s&&a.number!=(e?f.doc.lines:1)?i+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(i-a.from,s-a.from))&&(i=u(a.text,i-a.from,!1,!1)+a.from);return i})),We=t=>qe(t,!1,!0),_e=t=>qe(t,!1,!1),Fe=t=>qe(t,!0,!1),Ke=(t,e)=>Pe(t,(r=>{let n=r.head,{state:o}=t,l=o.doc.lineAt(n),i=o.charCategorizer(n);for(let t=null;;){if(n==(e?l.to:l.from)){n==r.head&&l.number!=(e?o.doc.lines:1)&&(n+=e?1:-1);break}let s=u(l.text,n-l.from,e)+l.from,f=l.text.slice(Math.min(n,s)-l.from,Math.max(n,s)-l.from),a=i(f);if(null!=t&&a!=t)break;" "==f&&n==r.head||(t=a),n=s}return n})),Qe=t=>Ke(t,!1),Xe=t=>Ke(t,!0),Ye=t=>Pe(t,(e=>t.moveByChar(e,!0,(r=>bt(t,e.head,r))).head)),tr=t=>Pe(t,(e=>{let r=t.lineBlockAt(e.head).to;return e.head<r?r:Math.min(t.state.doc.length,e.head+1)})),er=t=>Pe(t,(e=>{let r=t.lineBlockAt(e.head).from;return e.head>r?r:Math.max(0,e.head-1)})),rr=t=>Pe(t,(e=>{let r=t.moveToLineBoundary(e,!1).head;return e.head>r?r:Math.max(0,e.head-1)})),nr=t=>Pe(t,(e=>{let r=t.moveToLineBoundary(e,!0).head;return e.head<r?r:Math.min(t.state.doc.length,e.head+1)})),or=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=[];for(let e=0,n="",o=t.doc.iter();;){if(o.next(),o.lineBreak||o.done){let t=n.search(/\s+$/);if(t>-1&&r.push({from:e-(n.length-t),to:e}),o.done)break;n=""}else n=o.value;e+=o.value.length}return!!r.length&&(e(t.update({changes:r,userEvent:"delete"})),!0)},lr=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=t.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:l.of(["",""])},range:n.cursor(t.from)})));return e(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},ur=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=t.changeByRange((e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let r=e.from,o=t.doc.lineAt(r),l=r==o.from?r-1:u(o.text,r-o.from,!1)+o.from,i=r==o.to?r+1:u(o.text,r-o.from,!0)+o.from;return{changes:{from:l,to:i,insert:t.doc.slice(r,i).append(t.doc.slice(l,r))},range:n.cursor(i)}}));return!r.changes.empty&&(e(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ir(t){let e=[],r=-1;for(let n of t.selection.ranges){let o=t.doc.lineAt(n.from),l=t.doc.lineAt(n.to);if(n.empty||n.to!=l.from||(l=t.doc.lineAt(n.to-1)),r>=o.number){let t=e[e.length-1];t.to=l.to,t.ranges.push(n)}else e.push({from:o.from,to:l.to,ranges:[n]});r=l.number+1}return e}function sr(t,e,r){if(t.readOnly)return!1;let o=[],l=[];for(let e of ir(t)){if(r?e.to==t.doc.length:0==e.from)continue;let u=t.doc.lineAt(r?e.to+1:e.from-1),i=u.length+1;if(r){o.push({from:e.to,to:u.to},{from:e.from,insert:u.text+t.lineBreak});for(let r of e.ranges)l.push(n.range(Math.min(t.doc.length,r.anchor+i),Math.min(t.doc.length,r.head+i)))}else{o.push({from:u.from,to:e.from},{from:e.to,insert:t.lineBreak+u.text});for(let t of e.ranges)l.push(n.range(t.anchor-i,t.head-i))}}return!!o.length&&(e(t.update({changes:o,scrollIntoView:!0,selection:n.create(l,t.selection.mainIndex),userEvent:"move.line"})),!0)}const fr=({state:t,dispatch:e})=>sr(t,e,!1),ar=({state:t,dispatch:e})=>sr(t,e,!0);function cr(t,e,r){if(t.readOnly)return!1;let n=[];for(let e of ir(t))n.push(r?{from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}:{from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});let o=t.changes(n);return e(t.update({changes:o,selection:t.selection.map(o,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const hr=({state:t,dispatch:e})=>cr(t,e,!1),dr=({state:t,dispatch:e})=>cr(t,e,!0),pr=t=>{if(t.state.readOnly)return!1;let{state:e}=t,r=e.changes(ir(e).map((({from:t,to:r})=>(t>0?t--:r<e.doc.length&&r++,{from:t,to:r})))),n=ft(e.selection,(e=>{let r;if(t.lineWrapping){let n=t.lineBlockAt(e.head),o=t.coordsAtPos(e.head,e.assoc||1);o&&(r=n.bottom+t.documentTop-o.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,r)})).map(r);return t.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0},mr=({state:t,dispatch:e})=>(e(t.update(t.replaceSelection(t.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0),kr=({state:t,dispatch:e})=>(e(t.update(t.changeByRange((e=>{let r=/^\s*/.exec(t.doc.lineAt(e.from).text)[0];return{changes:{from:e.from,to:e.to,insert:t.lineBreak+r},range:n.cursor(e.from+r.length+1)}})),{scrollIntoView:!0,userEvent:"input"})),!0),yr=vr(!1),wr=vr(!0);function vr(t){return({state:e,dispatch:r})=>{if(e.readOnly)return!1;let u=e.changeByRange((r=>{let{from:u,to:i}=r,s=e.doc.lineAt(u),f=!t&&u==i&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let r,n=w(t).resolveInner(e),o=n.childBefore(e),l=n.childAfter(e);return o&&l&&o.to<=e&&l.from>=e&&(r=o.type.prop(v.closedBy))&&r.indexOf(l.name)>-1&&t.doc.lineAt(o.to).from==t.doc.lineAt(l.from).from&&!/\S/.test(t.sliceDoc(o.to,l.from))?{from:o.to,to:l.from}:null}(e,u);t&&(u=i=(i<=s.to?s:e.doc.lineAt(i)).to);let a=new m(e,{simulateBreak:u,simulateDoubleBreak:!!f}),c=k(a,u);for(null==c&&(c=o(/^\s*/.exec(e.doc.lineAt(u).text)[0],e.tabSize));i<s.to&&/\s/.test(s.text[i-s.from]);)i++;f?({from:u,to:i}=f):u>s.from&&u<s.from+100&&!/\S/.test(s.text.slice(0,u))&&(u=s.from);let h=["",y(e,c)];return f&&h.push(y(e,a.lineIndent(s.from,-1))),{changes:{from:u,to:i,insert:l.of(h)},range:n.cursor(u+1+h[1].length)}}));return r(e.update(u,{scrollIntoView:!0,userEvent:"input"})),!0}}function Mr(t,e){let r=-1;return t.changeByRange((o=>{let l=[];for(let n=o.from;n<=o.to;){let u=t.doc.lineAt(n);u.number>r&&(o.empty||o.to>u.from)&&(e(u,l,o),r=u.number),n=u.to+1}let u=t.changes(l);return{changes:l,range:n.range(u.mapPos(o.anchor,1),u.mapPos(o.head,1))}}))}const gr=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Object.create(null),n=new m(t,{overrideIndentation:t=>{let e=r[t];return null==e?-1:e}}),o=Mr(t,((e,o,l)=>{let u=k(n,e.from);if(null==u)return;/\S/.test(e.text)||(u=0);let i=/^\s*/.exec(e.text)[0],s=y(t,u);(i!=s||l.from<e.from+i.length)&&(r[e.from]=u,o.push({from:e.from,to:e.from+i.length,insert:s}))}));return o.changes.empty||e(t.update(o,{userEvent:"indent"})),!0},Ar=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(Mr(t,((e,r)=>{r.push({from:e.from,insert:t.facet(A)})})),{userEvent:"input.indent"})),!0),Dr=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(Mr(t,((e,r)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let l=o(n,t.tabSize),u=0,i=y(t,Math.max(0,l-g(t)));for(;u<n.length&&u<i.length&&n.charCodeAt(u)==i.charCodeAt(u);)u++;r.push({from:e.from+u,to:e.from+n.length,insert:i.slice(u)})})),{userEvent:"delete.dedent"})),!0),Er=t=>(t.setTabFocusMode(),!0),Cr=t=>(t.setTabFocusMode(2e3),!0),Sr=({state:t,dispatch:e})=>t.selection.ranges.some((t=>!t.empty))?Ar({state:t,dispatch:e}):(e(t.update(t.replaceSelection("\t"),{scrollIntoView:!0,userEvent:"input"})),!0),Ir=[{key:"Ctrl-b",run:mt,shift:oe,preventDefault:!0},{key:"Ctrl-f",run:kt,shift:le},{key:"Ctrl-p",run:zt,shift:Ae},{key:"Ctrl-n",run:xt,shift:De},{key:"Ctrl-a",run:Qt,shift:Be},{key:"Ctrl-e",run:Xt,shift:Re},{key:"Ctrl-d",run:Fe},{key:"Ctrl-h",run:We},{key:"Ctrl-k",run:tr},{key:"Ctrl-Alt-h",run:Qe},{key:"Ctrl-o",run:lr},{key:"Ctrl-t",run:ur},{key:"Ctrl-v",run:Zt}],br=[{key:"ArrowLeft",run:mt,shift:oe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Et,shift:ce,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Ft,shift:Ve,preventDefault:!0},{key:"ArrowRight",run:kt,shift:le,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Ct,shift:he,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Kt,shift:Ue,preventDefault:!0},{key:"ArrowUp",run:zt,shift:Ae,preventDefault:!0},{mac:"Cmd-ArrowUp",run:je,shift:Ne},{mac:"Ctrl-ArrowUp",run:Pt,shift:Ce},{key:"ArrowDown",run:xt,shift:De,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Le,shift:Oe},{mac:"Ctrl-ArrowDown",run:Zt,shift:Se},{key:"PageUp",run:Pt,shift:Ce},{key:"PageDown",run:Zt,shift:Se},{key:"Home",run:_t,shift:be,preventDefault:!0},{key:"Mod-Home",run:je,shift:Ne},{key:"End",run:Wt,shift:Ie,preventDefault:!0},{key:"Mod-End",run:Le,shift:Oe},{key:"Enter",run:yr,shift:yr},{key:"Mod-a",run:Te},{key:"Backspace",run:We,shift:We,preventDefault:!0},{key:"Delete",run:Fe,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Qe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Xe,preventDefault:!0},{mac:"Mod-Backspace",run:rr,preventDefault:!0},{mac:"Mod-Delete",run:nr,preventDefault:!0}].concat(Ir.map((t=>({mac:t.key,run:t.run,shift:t.shift})))),Vr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Tt,shift:ve},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:$t,shift:Me},{key:"Alt-ArrowUp",run:fr},{key:"Shift-Alt-ArrowUp",run:hr},{key:"Alt-ArrowDown",run:ar},{key:"Shift-Alt-ArrowDown",run:dr},{key:"Mod-Alt-ArrowUp",run:xe},{key:"Mod-Alt-ArrowDown",run:Ge},{key:"Escape",run:He},{key:"Mod-Enter",run:wr},{key:"Alt-l",mac:"Ctrl-l",run:$e},{key:"Mod-i",run:Je,preventDefault:!0},{key:"Mod-[",run:Dr},{key:"Mod-]",run:Ar},{key:"Mod-Alt-\\",run:gr},{key:"Shift-Mod-k",run:pr},{key:"Shift-Mod-\\",run:te},{key:"Mod-/",run:D},{key:"Alt-A",run:b},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Er}].concat(br),Ur={key:"Tab",run:Ar,shift:Dr};export{xe as addCursorAbove,Ge as addCursorBelow,V as blockComment,U as blockUncomment,dr as copyLineDown,hr as copyLineUp,wt as cursorCharBackward,At as cursorCharBackwardLogical,yt as cursorCharForward,gt as cursorCharForwardLogical,mt as cursorCharLeft,kt as cursorCharRight,Le as cursorDocEnd,je as cursorDocStart,It as cursorGroupBackward,St as cursorGroupForward,Vt as cursorGroupForwardWin,Et as cursorGroupLeft,Ct as cursorGroupRight,_t as cursorLineBoundaryBackward,Wt as cursorLineBoundaryForward,Ft as cursorLineBoundaryLeft,Kt as cursorLineBoundaryRight,xt as cursorLineDown,Xt as cursorLineEnd,Qt as cursorLineStart,zt as cursorLineUp,te as cursorMatchingBracket,Zt as cursorPageDown,Pt as cursorPageUp,Lt as cursorSubwordBackward,jt as cursorSubwordForward,Tt as cursorSyntaxLeft,$t as cursorSyntaxRight,Vr as defaultKeymap,We as deleteCharBackward,_e as deleteCharBackwardStrict,Fe as deleteCharForward,Qe as deleteGroupBackward,Xe as deleteGroupForward,Ye as deleteGroupForwardWin,pr as deleteLine,rr as deleteLineBoundaryBackward,nr as deleteLineBoundaryForward,tr as deleteToLineEnd,er as deleteToLineStart,or as deleteTrailingWhitespace,Ir as emacsStyleKeymap,x as history,G as historyField,st as historyKeymap,Dr as indentLess,Ar as indentMore,gr as indentSelection,Ur as indentWithTab,wr as insertBlankLine,mr as insertNewline,yr as insertNewlineAndIndent,kr as insertNewlineKeepIndent,Sr as insertTab,$ as invertedEffects,T as isolateHistory,S as lineComment,I as lineUncomment,ar as moveLineDown,fr as moveLineUp,Z as redo,K as redoDepth,W as redoSelection,Te as selectAll,ie as selectCharBackward,fe as selectCharBackwardLogical,ue as selectCharForward,se as selectCharForwardLogical,oe as selectCharLeft,le as selectCharRight,Oe as selectDocEnd,Ne as selectDocStart,pe as selectGroupBackward,de as selectGroupForward,me as selectGroupForwardWin,ce as selectGroupLeft,he as selectGroupRight,$e as selectLine,be as selectLineBoundaryBackward,Ie as selectLineBoundaryForward,Ve as selectLineBoundaryLeft,Ue as selectLineBoundaryRight,De as selectLineDown,Re as selectLineEnd,Be as selectLineStart,Ae as selectLineUp,ee as selectMatchingBracket,Se as selectPageDown,Ce as selectPageUp,Je as selectParentSyntax,we as selectSubwordBackward,ye as selectSubwordForward,ve as selectSyntaxLeft,Me as selectSyntaxRight,He as simplifySelection,lr as splitLine,br as standardKeymap,Cr as temporarilySetTabFocusMode,b as toggleBlockComment,B as toggleBlockCommentByLine,D as toggleComment,C as toggleLineComment,Er as toggleTabFocusMode,ur as transposeChars,P as undo,F as undoDepth,q as undoSelection}
@@ -1 +1 @@
1
- import{t,p as e,H as r,h as a,a as c}from"./p-QC41Uj05.js";import{a as s}from"./p-gPc0o8Jb.js";import{f as o,a as i}from"./p-BQP1WryV.js";import{d as l}from"./p-B4vAN-UA.js";const f=e(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.query="",this.collapsed={}}toggle(t){this.collapsed=Object.assign(Object.assign({},this.collapsed),{[t]:!this.collapsed[t]})}render(){const t=s(),e=this.query.trim().toLowerCase(),r=Object.entries(t).map((([t,r])=>({category:t,molds:e?r.filter((r=>[r.name,o(`brick.${r.id}.name`,r.name),r.id,t,o(`category.${t}`,t)].some((t=>t.toLowerCase().includes(e))))):r}))).filter((t=>t.molds.length>0));return a(c,{key:"93facfae49363bb2fe1ceeb5ab84105fc5f339fa"},a("div",{key:"dc68df2c48929c7e5d6c4037b755761f0f581898",class:"fk-palette"},a("input",{key:"6acf14db7433b4a4bfb4cca2ca0fd51465785d7f",class:"fk-palette__search",type:"search",placeholder:i("palette.search"),value:this.query,onInput:t=>this.query=t.target.value}),r.map((({category:t,molds:r})=>{const c=!e&&this.collapsed[t];return a("section",{class:"fk-palette__group",key:t},a("button",{type:"button",class:"fk-palette__category",onClick:()=>this.toggle(t)},a("span",{class:{"fk-palette__chevron":!0,"fk-palette__chevron--collapsed":c}},"▾"),o(`category.${t}`,t),a("span",{class:"fk-palette__count"},r.length)),c?null:a("div",{class:"fk-palette__items"},r.map((t=>a("fk-brick-mold-item",{brickMold:t,key:`${t.type}:${t.id}`})))))})),0===r.length?a("p",{class:"fk-palette__empty"},i("palette.empty",{query:this.query})):null))}static get style(){return".fk-palette.sc-fk-brick-list{display:flex;flex-direction:column;gap:var(--fk-spacing);font-family:var(--fk-font)}.fk-palette__search.sc-fk-brick-list{font:inherit;font-size:0.85rem;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 1.5);background:var(--fk-color-surface);color:var(--fk-color-text)}.fk-palette__search.sc-fk-brick-list:focus{outline:none;border-color:var(--fk-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--fk-color-primary) 20%, transparent)}.fk-palette__category.sc-fk-brick-list{display:flex;align-items:center;gap:calc(var(--fk-spacing) / 2);width:100%;margin:0 0 calc(var(--fk-spacing) / 2);padding:calc(var(--fk-spacing) / 2) 0;border:none;background:transparent;font:inherit;font-size:0.7rem;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;color:var(--fk-color-muted);cursor:pointer}.fk-palette__category.sc-fk-brick-list:hover{color:var(--fk-color-text)}.fk-palette__chevron.sc-fk-brick-list{display:inline-block;transition:transform 120ms ease}.fk-palette__chevron--collapsed.sc-fk-brick-list{transform:rotate(-90deg)}.fk-palette__count.sc-fk-brick-list{margin-left:auto;font-weight:600;color:var(--fk-color-muted)}.fk-palette__items.sc-fk-brick-list{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:calc(var(--fk-spacing) / 2)}.fk-palette__empty.sc-fk-brick-list{margin:0;font-size:0.8rem;color:var(--fk-color-muted)}"}},[2,"fk-brick-list",{query:[32],collapsed:[32]}]);function n(){"undefined"!=typeof customElements&&["fk-brick-list","fk-brick-mold-item"].forEach((e=>{switch(e){case"fk-brick-list":customElements.get(t(e))||customElements.define(t(e),f);break;case"fk-brick-mold-item":customElements.get(t(e))||l()}}))}n();export{f as F,n as d}
1
+ import{t,p as e,H as r,h as a,a as c}from"./p-BB4Llg42.js";import{a as s}from"./p-gPc0o8Jb.js";import{f as o,a as l}from"./p-BOmBVgfJ.js";import{d as i}from"./p--vL6GR31.js";const f=e(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.query="",this.collapsed={}}toggle(t){this.collapsed=Object.assign(Object.assign({},this.collapsed),{[t]:!this.collapsed[t]})}render(){const t=s(),e=this.query.trim().toLowerCase(),r=Object.entries(t).map((([t,r])=>({category:t,molds:e?r.filter((r=>[r.name,o(`brick.${r.id}.name`,r.name),r.id,t,o(`category.${t}`,t)].some((t=>t.toLowerCase().includes(e))))):r}))).filter((t=>t.molds.length>0));return a(c,{key:"93facfae49363bb2fe1ceeb5ab84105fc5f339fa"},a("div",{key:"dc68df2c48929c7e5d6c4037b755761f0f581898",class:"fk-palette"},a("input",{key:"6acf14db7433b4a4bfb4cca2ca0fd51465785d7f",class:"fk-palette__search",type:"search",placeholder:l("palette.search"),value:this.query,onInput:t=>this.query=t.target.value}),r.map((({category:t,molds:r})=>{const c=!e&&this.collapsed[t];return a("section",{class:"fk-palette__group",key:t},a("button",{type:"button",class:"fk-palette__category",onClick:()=>this.toggle(t)},a("span",{class:{"fk-palette__chevron":!0,"fk-palette__chevron--collapsed":c}},"▾"),o(`category.${t}`,t),a("span",{class:"fk-palette__count"},r.length)),c?null:a("div",{class:"fk-palette__items"},r.map((t=>a("fk-brick-mold-item",{brickMold:t,key:`${t.type}:${t.id}`})))))})),0===r.length?a("p",{class:"fk-palette__empty"},l("palette.empty",{query:this.query})):null))}static get style(){return".fk-palette.sc-fk-brick-list{display:flex;flex-direction:column;gap:var(--fk-spacing);font-family:var(--fk-font)}.fk-palette__search.sc-fk-brick-list{font:inherit;font-size:0.85rem;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 1.5);background:var(--fk-color-surface);color:var(--fk-color-text)}.fk-palette__search.sc-fk-brick-list:focus{outline:none;border-color:var(--fk-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--fk-color-primary) 20%, transparent)}.fk-palette__category.sc-fk-brick-list{display:flex;align-items:center;gap:calc(var(--fk-spacing) / 2);width:100%;margin:0 0 calc(var(--fk-spacing) / 2);padding:calc(var(--fk-spacing) / 2) 0;border:none;background:transparent;font:inherit;font-size:0.7rem;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;color:var(--fk-color-muted);cursor:pointer}.fk-palette__category.sc-fk-brick-list:hover{color:var(--fk-color-text)}.fk-palette__chevron.sc-fk-brick-list{display:inline-block;transition:transform 120ms ease}.fk-palette__chevron--collapsed.sc-fk-brick-list{transform:rotate(-90deg)}.fk-palette__count.sc-fk-brick-list{margin-left:auto;font-weight:600;color:var(--fk-color-muted)}.fk-palette__items.sc-fk-brick-list{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:calc(var(--fk-spacing) / 2)}.fk-palette__empty.sc-fk-brick-list{margin:0;font-size:0.8rem;color:var(--fk-color-muted)}"}},[2,"fk-brick-list",{query:[32],collapsed:[32]}]);function n(){"undefined"!=typeof customElements&&["fk-brick-list","fk-brick-mold-item"].forEach((e=>{switch(e){case"fk-brick-list":customElements.get(t(e))||customElements.define(t(e),f);break;case"fk-brick-mold-item":customElements.get(t(e))||i()}}))}n();export{f as F,n as d}
@@ -9,4 +9,4 @@ function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"de
9
9
  * https://github.com/Starcounter-Jack/JSON-Patch
10
10
  * (c) 2017-2021 Joachim Wester
11
11
  * MIT license
12
- */function gs(t,e){e.unobserve()}function bs(t,e){var i,r=function(t){return ys.get(t)}(t);if(r){var n=function(t,e){return t.observers.get(e)}(r,e);i=n&&n.observer}else r=new $s(t),ys.set(t,r);if(i)return i;if(i={},r.value=Yn(t),e){i.callback=e,i.next=null;var s=function(){_s(i)},o=function(){clearTimeout(i.next),i.next=setTimeout(s)};"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return i.patches=[],i.object=t,i.unobserve=function(){_s(i),clearTimeout(i.next),function(t,e){t.observers.delete(e.callback)}(r,i),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},r.observers.set(e,new ws(e,i)),i}function _s(t,e){void 0===e&&(e=!1);var i=ys.get(t.object);Es(i.value,t.object,t.patches,"",e),t.patches.length&&fs(i.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function Es(t,e,i,r,n){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var s=Qn(e),o=Qn(t),a=!1,h=o.length-1;h>=0;h--){var u=t[f=o[h]];if(!Xn(e,f)||void 0===e[f]&&void 0!==u&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(n&&i.push({op:"test",path:r+"/"+es(f),value:Yn(u)}),i.push({op:"remove",path:r+"/"+es(f)}),a=!0):(n&&i.push({op:"test",path:r,value:t}),i.push({op:"replace",path:r,value:e}));else{var c=e[f];"object"==typeof u&&null!=u&&"object"==typeof c&&null!=c&&Array.isArray(u)===Array.isArray(c)?Es(u,c,i,r+"/"+es(f),n):u!==c&&(n&&i.push({op:"test",path:r+"/"+es(f),value:Yn(u)}),i.push({op:"replace",path:r+"/"+es(f),value:Yn(c)}))}}if(a||s.length!=o.length)for(h=0;h<s.length;h++){var f;Xn(t,f=s[h])||void 0===e[f]||i.push({op:"add",path:r+"/"+es(f),value:Yn(e[f])})}}}function Os(t,e,i){void 0===i&&(i=!1);var r=[];return Es(t,e,r,"",i),r}var js=Object.assign({},vs,Object.freeze({__proto__:null,compare:Os,generate:_s,observe:bs,unobserve:gs}),{JsonPatchError:ss,deepClone:Yn,escapePathComponent:es,unescapePathComponent:is}),xs=Object.freeze({__proto__:null,JsonPatchError:ss,_areEquals:ms,applyOperation:cs,applyPatch:fs,applyReducer:ls,compare:Os,deepClone:Yn,default:js,escapePathComponent:es,generate:_s,getValueByPointer:us,observe:bs,unescapePathComponent:is,unobserve:gs,validate:ps,validator:ds});function Ss(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Object.keys(t).length>0&&Object.values(t).every((t=>"string"==typeof t))}function ks(t,e){return Ss(t)?e&&void 0!==t[e]?t[e]:Object.values(t)[0]:t}function Ps(t,e){if(!t)return t;const i={};for(const[r,n]of Object.entries(t))i[r]=ks(n,e);return i}var Is={en:{required:"This field is required",minLength:"Must be at least {value} characters",maxLength:"Must be at most {value} characters",min:"Must be at least {value}",max:"Must be at most {value}",pattern:"Invalid format",minItems:"Select at least {value} item(s)",maxItems:"Select at most {value} item(s)",email:"Invalid email address",url:"Invalid URL",type:"Invalid value",custom:"Invalid value"},fr:{required:"Ce champ est obligatoire",minLength:"Minimum {value} caractères",maxLength:"Maximum {value} caractères",min:"Minimum {value}",max:"Maximum {value}",pattern:"Format invalide",minItems:"Sélectionnez au moins {value} élément(s)",maxItems:"Sélectionnez au plus {value} élément(s)",email:"Adresse email invalide",url:"URL invalide",type:"Valeur invalide",custom:"Valeur invalide"}};function As(t,e,i){return((Is[e??"en"]??Is.en)[t]??Is.en[t]??"Invalid value").replace("{value}",String(i??""))}function*Cs(t,e="0"){if(t){yield{brick:t,path:e};for(const[i,r]of(t.children??[]).entries())yield*Cs(r,`${e}.${i}`)}}function*Ns(t){if(t&&(yield t,"collection"!==t.type))for(const e of t.children??[])yield*Ns(e)}class Ts{type;dataType;id;name;configsForm;category;styles;unWrapData;isPrivate;validators;defaultConfigs;constructor(t){this.type=t.type,this.dataType=t.dataType,this.id=t.id,this.name=t.name,this.configsForm=t.configsForm,this.category=t.category,this.styles=t.styles,this.unWrapData=t.unWrapData??!1,this.isPrivate=t.isPrivate??!1,this.validators=t.validators??[],this.defaultConfigs=t.defaultConfigs}getBrickEmptySpec(){return{type:this.type,dataType:this.dataType,id:this.id,name:this.name,...void 0!==this.category?{category:this.category}:{},...void 0!==this.configsForm?{configsForm:this.configsForm}:{},...void 0!==this.styles?{styles:this.styles}:{},...void 0!==this.defaultConfigs?{configs:{...this.defaultConfigs}}:{},validators:this.validators}}}var Ms=new Set(["__proto__","constructor","prototype"]);class Rs{value;constructor(t){this.value=t}}var Ds=(t,e,i)=>{t.scopes[t.scopes.length-1].set(e,i)},zs=t=>{if("number"==typeof t)return t;const e=String(t);if(Ms.has(e))throw new Error(`Access to "${e}" is not allowed`);return e},Ls=(t,e)=>({object:Us(t,e.object),prop:zs(e.computed?Us(t,e.property):e.property.name),optional:!0===e.optional}),Us=(t,e)=>{if(++t.steps>1e5)throw new Error("Sandbox execution budget exceeded");switch(e.type){case"Program":case"BlockStatement":for(const i of e.body){const e=Us(t,i);if(e instanceof Rs)return e}return;case"ReturnStatement":return new Rs(e.argument?Us(t,e.argument):void 0);case"IfStatement":return Us(t,e.test)?Us(t,e.consequent):e.alternate?Us(t,e.alternate):void 0;case"VariableDeclaration":for(const i of e.declarations){const e=i.id;if("Identifier"!==e.type)throw new Error("Only simple variable names are supported");Ds(t,e.name,i.init?Us(t,i.init):void 0)}return;case"ExpressionStatement":return void Us(t,e.expression);case"Literal":return e.value;case"TemplateLiteral":{const i=e.expressions;let r="";return e.quasis.forEach(((e,n)=>{r+=e.value.cooked??"",n<i.length&&(r+=String(Us(t,i[n])))})),r}case"Identifier":return((t,e)=>{for(let i=t.scopes.length-1;i>=0;i--)if(t.scopes[i].has(e))return t.scopes[i].get(e);throw new Error(`Unknown identifier "${e}"`)})(t,e.name);case"ThisExpression":return;case"ChainExpression":return Us(t,e.expression);case"MemberExpression":return((t,e)=>{const{object:i,prop:r,optional:n}=Ls(t,e);if(null==i){if(n)return;throw new Error(`Cannot read "${String(r)}" of ${String(i)}`)}return i[r]})(t,e);case"CallExpression":{const i=e.callee,r=[];for(const i of e.arguments)if("SpreadElement"===i.type){const e=Us(t,i.argument);Array.isArray(e)&&r.push(...e)}else r.push(Us(t,i));if("MemberExpression"===i.type){const{object:n,prop:s,optional:o}=Ls(t,i);if(null==n){if(o||!0===e.optional)return;throw new Error(`Cannot call "${String(s)}" of ${String(n)}`)}const a=n[s];if("function"!=typeof a){if(!0===e.optional&&null==a)return;throw new Error(`"${String(s)}" is not a function`)}if(a===Function||a===eval)throw new Error("This function is not allowed");return a.apply(n,r)}const n=Us(t,i);if("function"!=typeof n){if(!0===e.optional&&null==n)return;throw new Error("Value is not a function")}if(n===Function||n===eval)throw new Error("This function is not allowed");return n(...r)}case"ArrowFunctionExpression":{const i=e.params,r=e.body,n=[...t.scopes];return(...s)=>{const o=new Map;i.forEach(((t,e)=>{if("Identifier"!==t.type)throw new Error("Only simple parameters are supported");o.set(t.name,s[e])}));const a={steps:t.steps,scopes:[...n,o]},h=Us(a,r);return t.steps=a.steps,h instanceof Rs?h.value:!0===e.expression?h:void 0}}case"BinaryExpression":{const i=Us(t,e.left),r=Us(t,e.right);switch(e.operator){case"===":return i===r;case"!==":return i!==r;case"==":return i==r;case"!=":return i!=r;case"<":return i<r;case"<=":return i<=r;case">":return i>r;case">=":return i>=r;case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r;case"%":return i%r;case"**":return i**r;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"LogicalExpression":{const i=Us(t,e.left);switch(e.operator){case"&&":return i&&Us(t,e.right);case"||":return i||Us(t,e.right);case"??":return i??Us(t,e.right);default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"UnaryExpression":{const i=Us(t,e.argument);switch(e.operator){case"!":return!i;case"-":return-i;case"+":return+i;case"typeof":return typeof i;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"ConditionalExpression":return Us(t,e.test)?Us(t,e.consequent):Us(t,e.alternate);case"AssignmentExpression":{const i=e.left;if("Identifier"!==i.type||"="!==e.operator)throw new Error("Only simple assignments are supported");const r=Us(t,e.right);return((t,e,i)=>{for(let r=t.scopes.length-1;r>=0;r--)if(t.scopes[r].has(e))return void t.scopes[r].set(e,i);throw new Error(`Cannot assign to unknown identifier "${e}"`)})(t,i.name,r),r}case"ArrayExpression":{const i=[];for(const r of e.elements)if(r)if("SpreadElement"===r.type){const e=Us(t,r.argument);Array.isArray(e)&&i.push(...e)}else i.push(Us(t,r));return i}case"ObjectExpression":{const i={};for(const r of e.properties){if("SpreadElement"===r.type){const e=Us(t,r.argument);if(e&&"object"==typeof e)for(const[t,r]of Object.entries(e))i[String(zs(t))]=r;continue}const e=r.key,n=zs(r.computed?Us(t,e):"Identifier"===e.type?e.name:e.value);i[String(n)]=Us(t,r.value)}return i}default:throw new Error(`Unsupported syntax: ${e.type}`)}},qs={undefined:void 0,NaN:NaN,Infinity:1/0,Math,JSON,Number,String,Boolean,Array,Object,Date,parseInt,parseFloat,isNaN,isFinite},Bs=Symbol.for("formkrafter.core.services"),Fs=globalThis,Vs=Fs[Bs]??={jsRunnerService:new class{validateJs(t,e={ecmaVersion:"latest",allowReturnOutsideFunction:!0}){try{return Xt(t,e),{valide:!0}}catch(t){return{valide:!1,error:t instanceof Error?t:new Error(String(t))}}}eval(t,e={}){return function(t,e={}){const i=Xt(t,{ecmaVersion:"latest",allowReturnOutsideFunction:!0}),r={steps:0,scopes:[new Map(Object.entries({...qs,...e})),new Map]},n=Us(r,i);return n instanceof Rs?n.value:void 0}(t,e)}},dataSourceService:new class{defaults;cache=new Map;constructor(t={}){this.defaults=t}fetchOptions(t,e){const i={...this.defaults.headers,...e?.headers},r={};Object.keys(i).length&&(r.headers=i),this.defaults.credentials&&(r.credentials=this.defaults.credentials);const n=`${t}|${JSON.stringify(r)}`;let s=this.cache.get(n);return s||(s=fetch(t,Object.keys(r).length?r:void 0).then((e=>{if(!e.ok)throw new Error(`Data source request failed (${e.status}): ${t}`);return e.json()})).then((t=>Array.isArray(t)?t:[])).catch((t=>{throw this.cache.delete(n),t})),this.cache.set(n,s)),s}},fileUploadService:new class{async upload(t){const e=globalThis.btoa;if(!e)throw new Error("No base64 encoder available");const i=new Uint8Array(await t.arrayBuffer());let r="";for(const t of i)r+=String.fromCharCode(t);return{name:t.name,type:t.type,size:t.size,url:`data:${t.type};base64,${e(r)}`}}}},Gs=(t,e)=>{try{return Vs.jsRunnerService.eval(t,{dataMap:e??{}})}catch(t){return t instanceof Error?t:new Error(String(t))}},Hs=(t,e)=>((t,e)=>((t,e)=>t?.filter((t=>((t,e)=>"jsonLogic"===t.type?null!=t.logic&&!0===n.apply(t.logic,e):"javaScript"===t.type&&!!t.code&&!0===Gs(t.code,e))(t,e))))(t,e)?.map((t=>t.effects)).flat().filter((t=>null!=t)))(t,e)?.map((t=>{let i;return t.property?("boolean"===t.property.type?i=t.boolean:"logic"===t.property.type&&null!=t.logic?i=n.apply(t.logic,e):"code"===t.property.type&&t.code?i=Gs(t.code,e):"string"===t.property.type&&(i=t.string),{[t.property.target]:i}):{}})).flat().reduce(((t,e)=>({...t,...e})),{})??{hidden:!1},Ks=new Un.Ajv({allErrors:!0});Wn(Ks,["email","uri"]),Fn(Ks);var Ws=new WeakMap,Js=t=>{if("required"===t.keyword)return t.params.missingProperty;if("errorMessage"===t.keyword){const e=t.params.errors?.[0];return e?Js(e):void 0}return t.instancePath.split("/").filter(Boolean)[0]},Zs=(t,e,i)=>{const r={},n=((t,e)=>{let i=Ws.get(t);i||(i=new Map,Ws.set(t,i));const r=e??"";let n=i.get(r);if(!n){const s=function(t,e){if(!t)return;const i={},r=[],n={},s=t=>{const i=ks(t,e);return"string"==typeof i?i:void 0};for(const o of Ns(t)){const t=o.configs?.key,a=o.dataType;if(!t||!a||"void"===a)continue;const h=o.validations?.find((t=>"required"===t.validator)),u={type:a,nullable:!h},c={type:As("type",e)};for(const t of o.validations??[]){const{validator:i,value:r}=t,n=s(t.message)??As(i,e,r);"minLength"===i&&null!=r?(u.minLength=Number(r),c.minLength=n):"maxLength"===i&&null!=r?(u.maxLength=Number(r),c.maxLength=n):"min"===i&&null!=r?(u.minimum=Number(r),c.minimum=n):"max"===i&&null!=r?(u.maximum=Number(r),c.maximum=n):"pattern"===i&&"string"==typeof r&&r?(u.pattern=r,c.pattern=n):"minItems"===i&&null!=r?(u.minItems=Number(r),c.minItems=n):"maxItems"===i&&null!=r?(u.maxItems=Number(r),c.maxItems=n):"email"===i?(u.format="email",c.format=n):"url"===i&&(u.format="uri",c.format=n)}u.errorMessage=c,i[t]=u,h&&(r.push(t),n[t]=s(h.message)??As("required",e))}return{type:"object",properties:i,required:r,...Object.keys(n).length?{errorMessage:{required:n}}:{},additionalProperties:!1}}(t,e);if(!s)return;try{n=Ks.compile(s)}catch{return}i.set(r,n)}return n})(t,i);if(n&&!n(e))for(const t of n.errors??[]){const e=Js(t);e&&!(e in r)&&t.message&&(r[e]=t.message)}for(const[n,s]of Object.entries(((t,e,i)=>{const r={},n=e??{};for(const e of Ns(t)){const t=e.configs?.key;if(t)for(const s of e.validations??[]){if("custom"!==s.validator||!s.customValidator)continue;const e=Gs(`const value = dataMap?.[${JSON.stringify(t)}];\n${s.customValidator}`,n);if(!0!==e&&null!=e&&!(t in r))if("string"==typeof e)r[t]=e;else if(e instanceof Error)r[t]=e.message;else{const e=ks(s.message,i);r[t]="string"==typeof e?e:As("custom",i)}}}return r})(t,e,i)))n in r||(r[n]=s);return{valid:0===Object.keys(r).length,errors:r}};function Xs(t){return t.split(".").slice(1).map((t=>`/children/${t}`)).join("")}function Qs(t,e){if(t.configs?.uid===e)return"";for(const[i,r]of(t.children??[]).entries()){const t=Qs(r,e);if(void 0!==t)return`/children/${i}${t}`}}function Ys(t,e){let i=t;for(const t of e.split(".").slice(1))i=i?.children?.[Number(t)];return i}var to=(js??xs).applyPatch,eo=(t,e,i)=>({spec:to(t,e,!0,!1).newDocument,patches:e,inverse:i}),io=(t,e)=>{const i=Ys(t,e);if(!i)throw new Error(`No brick at path "${e}"`);return i},ro=(t,e)=>{const i=Qs(t,e);if(void 0===i)throw new Error(`No brick with uid "${e}"`);let r=t;for(const t of i.split("/children/").slice(1))r=r.children[Number(t)];return{pointer:i,brick:r}},no=t=>JSON.parse(JSON.stringify(t));function so(t,e,i,r){const n=io(t,i),s=Xs(i),o=no(e);if(!n.children){const e=`${s}/children`;return eo(t,[{op:"add",path:e,value:[o]}],[{op:"remove",path:e}])}const a=`${s}/children/${Math.min(r??n.children.length,n.children.length)}`;return eo(t,[{op:"add",path:a,value:o}],[{op:"remove",path:a}])}function oo(t,e){if("0"===e)throw new Error("Cannot remove the root brick");const i=io(t,e),r=Xs(e);return eo(t,[{op:"remove",path:r}],[{op:"add",path:r,value:i}])}function ao(t,e,i){if("0"===e||"0"===i)throw new Error("Cannot move the root brick");const r=io(t,e),n=e.split(".").map(Number),s=i.split(".").map(Number),o=n.length-1,a=n[o],h=s.length>o&&n.slice(0,o).every(((t,e)=>t===s[e])),u=[...s];if(h){if(u[o]===a&&u.length>n.length)throw new Error(`Cannot move a brick into its own subtree ("${e}" → "${i}")`);u[o]>a&&(u[o]-=1)}const c=Xs(e),f=Xs(u.join("."));return eo(t,[{op:"remove",path:c},{op:"add",path:f,value:r}],[{op:"remove",path:f},{op:"add",path:c,value:r}])}var ho=t=>({...t,...t.configs?{configs:{...t.configs,uid:crypto.randomUUID()}}:{},...t.children?{children:t.children.map(ho)}:{}});function uo(t,e){if("0"===e)throw new Error("Cannot duplicate the root brick");const i=io(t,e),r=e.split("."),n=Number(r[r.length-1])+1,s=Xs([...r.slice(0,-1),String(n)].join(".")),o=ho(no(i));return eo(t,[{op:"add",path:s,value:o}],[{op:"remove",path:s}])}var co=(t,e,i,r,n)=>{const s=`${e}/${i}`;return void 0===n?eo(t,[{op:"add",path:s,value:r}],[{op:"remove",path:s}]):eo(t,[{op:"replace",path:s,value:r}],[{op:"replace",path:s,value:n}])};function fo(t,e,i){const{pointer:r,brick:n}=ro(t,e),s={...n.configs,...i};return co(t,r,"configs",s,n.configs)}function lo(t,e,i){const{pointer:r,brick:n}=ro(t,e),s={...n.styles,...i};return co(t,r,"styles",s,n.styles)}function po(t,e,i){const{pointer:r,brick:n}=ro(t,e);return co(t,r,"validations",i,n.validations)}function mo(t,e,i){const{pointer:r,brick:n}=ro(t,e);return co(t,r,"rules",i,n.rules)}class vo{past=[];future=[];record(t){this.past.push({patches:t.patches,inverse:t.inverse}),this.future=[]}get canUndo(){return this.past.length>0}get canRedo(){return this.future.length>0}undo(t){const e=this.past.pop();if(e)return this.future.push(e),to(t,e.inverse,!0,!1).newDocument}redo(t){const e=this.future.pop();if(e)return this.past.push(e),to(t,e.patches,!0,!1).newDocument}clear(){this.past=[],this.future=[]}}export{Ts as B,vo as S,Ss as a,Ns as b,so as c,Ys as d,oo as e,uo as f,Hs as g,lo as h,Cs as i,po as j,mo as k,Gs as l,ao as m,ks as n,Ps as r,Vs as s,fo as u,Zs as v}
12
+ */function gs(t,e){e.unobserve()}function bs(t,e){var i,r=function(t){return ys.get(t)}(t);if(r){var n=function(t,e){return t.observers.get(e)}(r,e);i=n&&n.observer}else r=new $s(t),ys.set(t,r);if(i)return i;if(i={},r.value=Yn(t),e){i.callback=e,i.next=null;var s=function(){_s(i)},o=function(){clearTimeout(i.next),i.next=setTimeout(s)};"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return i.patches=[],i.object=t,i.unobserve=function(){_s(i),clearTimeout(i.next),function(t,e){t.observers.delete(e.callback)}(r,i),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},r.observers.set(e,new ws(e,i)),i}function _s(t,e){void 0===e&&(e=!1);var i=ys.get(t.object);Es(i.value,t.object,t.patches,"",e),t.patches.length&&fs(i.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function Es(t,e,i,r,n){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var s=Qn(e),o=Qn(t),a=!1,h=o.length-1;h>=0;h--){var u=t[f=o[h]];if(!Xn(e,f)||void 0===e[f]&&void 0!==u&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(n&&i.push({op:"test",path:r+"/"+es(f),value:Yn(u)}),i.push({op:"remove",path:r+"/"+es(f)}),a=!0):(n&&i.push({op:"test",path:r,value:t}),i.push({op:"replace",path:r,value:e}));else{var c=e[f];"object"==typeof u&&null!=u&&"object"==typeof c&&null!=c&&Array.isArray(u)===Array.isArray(c)?Es(u,c,i,r+"/"+es(f),n):u!==c&&(n&&i.push({op:"test",path:r+"/"+es(f),value:Yn(u)}),i.push({op:"replace",path:r+"/"+es(f),value:Yn(c)}))}}if(a||s.length!=o.length)for(h=0;h<s.length;h++){var f;Xn(t,f=s[h])||void 0===e[f]||i.push({op:"add",path:r+"/"+es(f),value:Yn(e[f])})}}}function Os(t,e,i){void 0===i&&(i=!1);var r=[];return Es(t,e,r,"",i),r}var js=Object.assign({},vs,Object.freeze({__proto__:null,compare:Os,generate:_s,observe:bs,unobserve:gs}),{JsonPatchError:ss,deepClone:Yn,escapePathComponent:es,unescapePathComponent:is}),xs=Object.freeze({__proto__:null,JsonPatchError:ss,_areEquals:ms,applyOperation:cs,applyPatch:fs,applyReducer:ls,compare:Os,deepClone:Yn,default:js,escapePathComponent:es,generate:_s,getValueByPointer:us,observe:bs,unescapePathComponent:is,unobserve:gs,validate:ps,validator:ds});function Ss(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Object.keys(t).length>0&&Object.values(t).every((t=>"string"==typeof t))}function ks(t,e){return Ss(t)?e&&void 0!==t[e]?t[e]:Object.values(t)[0]:t}function Ps(t,e){if(!t)return t;const i={};for(const[r,n]of Object.entries(t))i[r]=ks(n,e);return i}var Is={en:{required:"This field is required",minLength:"Must be at least {value} characters",maxLength:"Must be at most {value} characters",min:"Must be at least {value}",max:"Must be at most {value}",pattern:"Invalid format",minItems:"Select at least {value} item(s)",maxItems:"Select at most {value} item(s)",email:"Invalid email address",url:"Invalid URL",type:"Invalid value",custom:"Invalid value"},fr:{required:"Ce champ est obligatoire",minLength:"Minimum {value} caractères",maxLength:"Maximum {value} caractères",min:"Minimum {value}",max:"Maximum {value}",pattern:"Format invalide",minItems:"Sélectionnez au moins {value} élément(s)",maxItems:"Sélectionnez au plus {value} élément(s)",email:"Adresse email invalide",url:"URL invalide",type:"Valeur invalide",custom:"Valeur invalide"}};function As(t,e,i){return((Is[e??"en"]??Is.en)[t]??Is.en[t]??"Invalid value").replace("{value}",String(i??""))}function*Cs(t,e="0"){if(t){yield{brick:t,path:e};for(const[i,r]of(t.children??[]).entries())yield*Cs(r,`${e}.${i}`)}}function*Ns(t){if(t&&(yield t,"collection"!==t.type))for(const e of t.children??[])yield*Ns(e)}class Ts{type;dataType;id;name;configsForm;category;styles;unWrapData;isPrivate;validators;defaultConfigs;constructor(t){this.type=t.type,this.dataType=t.dataType,this.id=t.id,this.name=t.name,this.configsForm=t.configsForm,this.category=t.category,this.styles=t.styles,this.unWrapData=t.unWrapData??!1,this.isPrivate=t.isPrivate??!1,this.validators=t.validators??[],this.defaultConfigs=t.defaultConfigs}getBrickEmptySpec(){return{type:this.type,dataType:this.dataType,id:this.id,name:this.name,...void 0!==this.category?{category:this.category}:{},...void 0!==this.configsForm?{configsForm:this.configsForm}:{},...void 0!==this.styles?{styles:this.styles}:{},...void 0!==this.defaultConfigs?{configs:{...this.defaultConfigs}}:{},validators:this.validators}}}var Ms=new Set(["__proto__","constructor","prototype"]);class Rs{value;constructor(t){this.value=t}}var Ds=(t,e,i)=>{t.scopes[t.scopes.length-1].set(e,i)},zs=t=>{if("number"==typeof t)return t;const e=String(t);if(Ms.has(e))throw new Error(`Access to "${e}" is not allowed`);return e},Ls=(t,e)=>({object:Us(t,e.object),prop:zs(e.computed?Us(t,e.property):e.property.name),optional:!0===e.optional}),Us=(t,e)=>{if(++t.steps>1e5)throw new Error("Sandbox execution budget exceeded");switch(e.type){case"Program":case"BlockStatement":for(const i of e.body){const e=Us(t,i);if(e instanceof Rs)return e}return;case"ReturnStatement":return new Rs(e.argument?Us(t,e.argument):void 0);case"IfStatement":return Us(t,e.test)?Us(t,e.consequent):e.alternate?Us(t,e.alternate):void 0;case"VariableDeclaration":for(const i of e.declarations){const e=i.id;if("Identifier"!==e.type)throw new Error("Only simple variable names are supported");Ds(t,e.name,i.init?Us(t,i.init):void 0)}return;case"ExpressionStatement":return void Us(t,e.expression);case"Literal":return e.value;case"TemplateLiteral":{const i=e.expressions;let r="";return e.quasis.forEach(((e,n)=>{r+=e.value.cooked??"",n<i.length&&(r+=String(Us(t,i[n])))})),r}case"Identifier":return((t,e)=>{for(let i=t.scopes.length-1;i>=0;i--)if(t.scopes[i].has(e))return t.scopes[i].get(e);throw new Error(`Unknown identifier "${e}"`)})(t,e.name);case"ThisExpression":return;case"ChainExpression":return Us(t,e.expression);case"MemberExpression":return((t,e)=>{const{object:i,prop:r,optional:n}=Ls(t,e);if(null==i){if(n)return;throw new Error(`Cannot read "${String(r)}" of ${String(i)}`)}return i[r]})(t,e);case"CallExpression":{const i=e.callee,r=[];for(const i of e.arguments)if("SpreadElement"===i.type){const e=Us(t,i.argument);Array.isArray(e)&&r.push(...e)}else r.push(Us(t,i));if("MemberExpression"===i.type){const{object:n,prop:s,optional:o}=Ls(t,i);if(null==n){if(o||!0===e.optional)return;throw new Error(`Cannot call "${String(s)}" of ${String(n)}`)}const a=n[s];if("function"!=typeof a){if(!0===e.optional&&null==a)return;throw new Error(`"${String(s)}" is not a function`)}if(a===Function||a===eval)throw new Error("This function is not allowed");return a.apply(n,r)}const n=Us(t,i);if("function"!=typeof n){if(!0===e.optional&&null==n)return;throw new Error("Value is not a function")}if(n===Function||n===eval)throw new Error("This function is not allowed");return n(...r)}case"ArrowFunctionExpression":{const i=e.params,r=e.body,n=[...t.scopes];return(...s)=>{const o=new Map;i.forEach(((t,e)=>{if("Identifier"!==t.type)throw new Error("Only simple parameters are supported");o.set(t.name,s[e])}));const a={steps:t.steps,scopes:[...n,o]},h=Us(a,r);return t.steps=a.steps,h instanceof Rs?h.value:!0===e.expression?h:void 0}}case"BinaryExpression":{const i=Us(t,e.left),r=Us(t,e.right);switch(e.operator){case"===":return i===r;case"!==":return i!==r;case"==":return i==r;case"!=":return i!=r;case"<":return i<r;case"<=":return i<=r;case">":return i>r;case">=":return i>=r;case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r;case"%":return i%r;case"**":return i**r;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"LogicalExpression":{const i=Us(t,e.left);switch(e.operator){case"&&":return i&&Us(t,e.right);case"||":return i||Us(t,e.right);case"??":return i??Us(t,e.right);default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"UnaryExpression":{const i=Us(t,e.argument);switch(e.operator){case"!":return!i;case"-":return-i;case"+":return+i;case"typeof":return typeof i;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"ConditionalExpression":return Us(t,e.test)?Us(t,e.consequent):Us(t,e.alternate);case"AssignmentExpression":{const i=e.left;if("Identifier"!==i.type||"="!==e.operator)throw new Error("Only simple assignments are supported");const r=Us(t,e.right);return((t,e,i)=>{for(let r=t.scopes.length-1;r>=0;r--)if(t.scopes[r].has(e))return void t.scopes[r].set(e,i);throw new Error(`Cannot assign to unknown identifier "${e}"`)})(t,i.name,r),r}case"ArrayExpression":{const i=[];for(const r of e.elements)if(r)if("SpreadElement"===r.type){const e=Us(t,r.argument);Array.isArray(e)&&i.push(...e)}else i.push(Us(t,r));return i}case"ObjectExpression":{const i={};for(const r of e.properties){if("SpreadElement"===r.type){const e=Us(t,r.argument);if(e&&"object"==typeof e)for(const[t,r]of Object.entries(e))i[String(zs(t))]=r;continue}const e=r.key,n=zs(r.computed?Us(t,e):"Identifier"===e.type?e.name:e.value);i[String(n)]=Us(t,r.value)}return i}default:throw new Error(`Unsupported syntax: ${e.type}`)}},qs={undefined:void 0,NaN:NaN,Infinity:1/0,Math,JSON,Number,String,Boolean,Array,Object,Date,parseInt,parseFloat,isNaN,isFinite},Bs=Symbol.for("formkrafter.core.services"),Fs=globalThis,Vs=Fs[Bs]??={jsRunnerService:new class{validateJs(t,e={ecmaVersion:"latest",allowReturnOutsideFunction:!0}){try{return Xt(t,e),{valide:!0}}catch(t){return{valide:!1,error:t instanceof Error?t:new Error(String(t))}}}eval(t,e={}){return function(t,e={}){const i=Xt(t,{ecmaVersion:"latest",allowReturnOutsideFunction:!0}),r={steps:0,scopes:[new Map(Object.entries({...qs,...e})),new Map]},n=Us(r,i);return n instanceof Rs?n.value:void 0}(t,e)}},dataSourceService:new class{defaults;cache=new Map;constructor(t={}){this.defaults=t}fetchOptions(t,e){const i={...this.defaults.headers,...e?.headers},r={};Object.keys(i).length&&(r.headers=i),this.defaults.credentials&&(r.credentials=this.defaults.credentials);const n=`${t}|${JSON.stringify(r)}`;let s=this.cache.get(n);return s||(s=fetch(t,Object.keys(r).length?r:void 0).then((e=>{if(!e.ok)throw new Error(`Data source request failed (${e.status}): ${t}`);return e.json()})).then((t=>Array.isArray(t)?t:[])).catch((t=>{throw this.cache.delete(n),t})),this.cache.set(n,s)),s}},fileUploadService:new class{async upload(t){const e=globalThis.btoa;if(!e)throw new Error("No base64 encoder available");const i=new Uint8Array(await t.arrayBuffer());let r="";for(const t of i)r+=String.fromCharCode(t);return{name:t.name,type:t.type,size:t.size,url:`data:${t.type};base64,${e(r)}`}}}},Gs=(t,e)=>{try{return Vs.jsRunnerService.eval(t,{dataMap:e??{}})}catch(t){return t instanceof Error?t:new Error(String(t))}},Hs=(t,e)=>((t,e)=>((t,e)=>t?.filter((t=>((t,e)=>"jsonLogic"===t.type?null!=t.logic&&!0===n.apply(t.logic,e):"javaScript"===t.type&&!!t.code&&!0===Gs(t.code,e))(t,e))))(t,e)?.map((t=>t.effects)).flat().filter((t=>null!=t)))(t,e)?.map((t=>{let i;return t.property?("boolean"===t.property.type?i=t.boolean:"logic"===t.property.type&&null!=t.logic?i=n.apply(t.logic,e):"code"===t.property.type&&t.code?i=Gs(t.code,e):"string"===t.property.type&&(i=t.string),{[t.property.target]:i}):{}})).flat().reduce(((t,e)=>({...t,...e})),{})??{hidden:!1},Ks=new Un.Ajv({allErrors:!0});Wn(Ks,["email","uri"]),Fn(Ks);var Ws=new WeakMap,Js=t=>{if("required"===t.keyword)return t.params.missingProperty;if("errorMessage"===t.keyword){const e=t.params.errors?.[0];return e?Js(e):void 0}return t.instancePath.split("/").filter(Boolean)[0]},Zs=(t,e,i)=>{const r={},n=((t,e)=>{let i=Ws.get(t);i||(i=new Map,Ws.set(t,i));const r=e??"";let n=i.get(r);if(!n){const s=function(t,e){if(!t)return;const i={},r=[],n={},s=t=>{const i=ks(t,e);return"string"==typeof i?i:void 0};for(const o of Ns(t)){const t=o.configs?.key,a=!0===o.configs?.multiple&&"object"===o.dataType?"array":o.dataType;if(!t||!a||"void"===a)continue;const h=o.validations?.find((t=>"required"===t.validator)),u={type:a,nullable:!h},c={type:As("type",e)};for(const t of o.validations??[]){const{validator:i,value:r}=t,n=s(t.message)??As(i,e,r);"minLength"===i&&null!=r?(u.minLength=Number(r),c.minLength=n):"maxLength"===i&&null!=r?(u.maxLength=Number(r),c.maxLength=n):"min"===i&&null!=r?(u.minimum=Number(r),c.minimum=n):"max"===i&&null!=r?(u.maximum=Number(r),c.maximum=n):"pattern"===i&&"string"==typeof r&&r?(u.pattern=r,c.pattern=n):"minItems"===i&&null!=r?(u.minItems=Number(r),c.minItems=n):"maxItems"===i&&null!=r?(u.maxItems=Number(r),c.maxItems=n):"email"===i?(u.format="email",c.format=n):"url"===i&&(u.format="uri",c.format=n)}u.errorMessage=c,i[t]=u,h&&(r.push(t),n[t]=s(h.message)??As("required",e))}return{type:"object",properties:i,required:r,...Object.keys(n).length?{errorMessage:{required:n}}:{},additionalProperties:!1}}(t,e);if(!s)return;try{n=Ks.compile(s)}catch{return}i.set(r,n)}return n})(t,i);if(n&&!n(e))for(const t of n.errors??[]){const e=Js(t);e&&!(e in r)&&t.message&&(r[e]=t.message)}for(const[n,s]of Object.entries(((t,e,i)=>{const r={},n=e??{};for(const e of Ns(t)){const t=e.configs?.key;if(t)for(const s of e.validations??[]){if("custom"!==s.validator||!s.customValidator)continue;const e=Gs(`const value = dataMap?.[${JSON.stringify(t)}];\n${s.customValidator}`,n);if(!0!==e&&null!=e&&!(t in r))if("string"==typeof e)r[t]=e;else if(e instanceof Error)r[t]=e.message;else{const e=ks(s.message,i);r[t]="string"==typeof e?e:As("custom",i)}}}return r})(t,e,i)))n in r||(r[n]=s);const s="object"==typeof e&&null!==e?e:void 0;for(const e of((t,e)=>{const i=new Set,r=(t,n)=>{const s=n||!!t.rules?.length&&!0===Hs(t.rules,e).hidden,o=t.configs?.key;if(s&&o&&i.add(o),"collection"!==t.type)for(const e of t.children??[])r(e,s)};return r(t,!1),i})(t,s))delete r[e];return{valid:0===Object.keys(r).length,errors:r}};function Xs(t){return t.split(".").slice(1).map((t=>`/children/${t}`)).join("")}function Qs(t,e){if(t.configs?.uid===e)return"";for(const[i,r]of(t.children??[]).entries()){const t=Qs(r,e);if(void 0!==t)return`/children/${i}${t}`}}function Ys(t,e){let i=t;for(const t of e.split(".").slice(1))i=i?.children?.[Number(t)];return i}var to=(js??xs).applyPatch,eo=(t,e,i)=>({spec:to(t,e,!0,!1).newDocument,patches:e,inverse:i}),io=(t,e)=>{const i=Ys(t,e);if(!i)throw new Error(`No brick at path "${e}"`);return i},ro=(t,e)=>{const i=Qs(t,e);if(void 0===i)throw new Error(`No brick with uid "${e}"`);let r=t;for(const t of i.split("/children/").slice(1))r=r.children[Number(t)];return{pointer:i,brick:r}},no=t=>JSON.parse(JSON.stringify(t));function so(t,e,i,r){const n=io(t,i),s=Xs(i),o=no(e);if(!n.children){const e=`${s}/children`;return eo(t,[{op:"add",path:e,value:[o]}],[{op:"remove",path:e}])}const a=`${s}/children/${Math.min(r??n.children.length,n.children.length)}`;return eo(t,[{op:"add",path:a,value:o}],[{op:"remove",path:a}])}function oo(t,e){if("0"===e)throw new Error("Cannot remove the root brick");const i=io(t,e),r=Xs(e);return eo(t,[{op:"remove",path:r}],[{op:"add",path:r,value:i}])}function ao(t,e,i){if("0"===e||"0"===i)throw new Error("Cannot move the root brick");const r=io(t,e),n=e.split(".").map(Number),s=i.split(".").map(Number),o=n.length-1,a=n[o],h=s.length>o&&n.slice(0,o).every(((t,e)=>t===s[e])),u=[...s];if(h){if(u[o]===a&&u.length>n.length)throw new Error(`Cannot move a brick into its own subtree ("${e}" → "${i}")`);u[o]>a&&(u[o]-=1)}const c=Xs(e),f=Xs(u.join("."));return eo(t,[{op:"remove",path:c},{op:"add",path:f,value:r}],[{op:"remove",path:f},{op:"add",path:c,value:r}])}var ho=t=>({...t,...t.configs?{configs:{...t.configs,uid:crypto.randomUUID()}}:{},...t.children?{children:t.children.map(ho)}:{}});function uo(t,e){if("0"===e)throw new Error("Cannot duplicate the root brick");const i=io(t,e),r=e.split("."),n=Number(r[r.length-1])+1,s=Xs([...r.slice(0,-1),String(n)].join(".")),o=ho(no(i));return eo(t,[{op:"add",path:s,value:o}],[{op:"remove",path:s}])}var co=(t,e,i,r,n)=>{const s=`${e}/${i}`;return void 0===n?eo(t,[{op:"add",path:s,value:r}],[{op:"remove",path:s}]):eo(t,[{op:"replace",path:s,value:r}],[{op:"replace",path:s,value:n}])};function fo(t,e,i){const{pointer:r,brick:n}=ro(t,e),s={...n.configs,...i};return co(t,r,"configs",s,n.configs)}function lo(t,e,i){const{pointer:r,brick:n}=ro(t,e),s={...n.styles,...i};return co(t,r,"styles",s,n.styles)}function po(t,e,i){const{pointer:r,brick:n}=ro(t,e);return co(t,r,"validations",i,n.validations)}function mo(t,e,i){const{pointer:r,brick:n}=ro(t,e);return co(t,r,"rules",i,n.rules)}class vo{past=[];future=[];record(t){this.past.push({patches:t.patches,inverse:t.inverse}),this.future=[]}get canUndo(){return this.past.length>0}get canRedo(){return this.future.length>0}undo(t){const e=this.past.pop();if(e)return this.future.push(e),to(t,e.inverse,!0,!1).newDocument}redo(t){const e=this.future.pop();if(e)return this.past.push(e),to(t,e.patches,!0,!1).newDocument}clear(){this.past=[],this.future=[]}}export{Ts as B,vo as S,Ss as a,Ns as b,so as c,Ys as d,oo as e,uo as f,Hs as g,lo as h,Cs as i,po as j,mo as k,Gs as l,ao as m,ks as n,Ps as r,Vs as s,fo as u,Zs as v}
@@ -0,0 +1 @@
1
+ import{t as r,p as i,H as t,c as a,h as s}from"./p-BB4Llg42.js";import{v as o}from"./p-CKMHMpID.js";import{a as d}from"./p-BOmBVgfJ.js";import{d as e}from"./p-DYchD23x.js";import{d as c}from"./p-NDbmiiYk.js";import{d as n}from"./p-BWdm2a6q.js";import{d as l}from"./p-YyGnQmX-.js";const f=i(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.gridValueChange=a(this,"gridValueChange"),this.disabled=!1,this.touched={},this.addRow=r=>{r.preventDefault(),this.gridValueChange.emit([...this.rows(),{}])}}rows(){return Array.isArray(this.value)?this.value:[]}rowSpec(){var r,i;return(null===(r=this.rowSpecCache)||void 0===r?void 0:r.source)!==this.spec&&(this.rowSpecCache={source:this.spec,rowSpec:{type:"panel",id:"grid-row",name:"Row",configs:{key:"row"},children:null!==(i=this.spec.children)&&void 0!==i?i:[]}}),this.rowSpecCache.rowSpec}rowErrors(r){const i=Object.fromEntries(Object.entries(r).filter((([,r])=>""!==r&&null!=r)));return o(this.rowSpec(),i,this.locale).errors}visibleRowErrors(r){var i,t;const a=null!==(i=this.rows()[r])&&void 0!==i?i:{},s=null!==(t=this.touched[r])&&void 0!==t?t:{},o={};for(const[r,i]of Object.entries(this.rowErrors(a)))s[r]&&(o[r]=i);return o}handleRowChange(r){var i,t;r.stopPropagation();const a=r.target.closest("[data-grid-row]"),s=Number(null!==(i=null==a?void 0:a.getAttribute("data-grid-row"))&&void 0!==i?i:-1);if(s<0)return;const o=Object.assign({},null!==(t=this.touched[s])&&void 0!==t?t:{});for(const i of Object.keys(r.detail))o[i]=!0;this.touched=Object.assign(Object.assign({},this.touched),{[s]:o});const d=this.rows().map(((i,t)=>t===s?Object.assign(Object.assign({},i),r.detail):i));this.gridValueChange.emit(d)}async validateRows(){var r,i;const t=this.rows(),a=null!==(i=null===(r=this.spec.configs)||void 0===r?void 0:r.key)&&void 0!==i?i:"grid",s={},o={};return t.forEach(((r,i)=>{var t,d;const e={};for(const r of null!==(t=this.spec.children)&&void 0!==t?t:[])(null===(d=r.configs)||void 0===d?void 0:d.key)&&(e[r.configs.key]=!0);s[i]=e;for(const[t,s]of Object.entries(this.rowErrors(r)))o[`${a}[${i}].${t}`]=s})),this.touched=s,{valid:0===Object.keys(o).length,errors:o}}removeRow(r){const i=this.rows().filter(((i,t)=>t!==r)),t={};for(const[i,a]of Object.entries(this.touched)){const s=Number(i);s<r?t[s]=a:s>r&&(t[s-1]=a)}this.touched=t,this.gridValueChange.emit(i.length?i:void 0)}render(){var r;const i=null!==(r=this.spec.children)&&void 0!==r?r:[],t=this.rows();return s("div",{key:"1c77d72cd1482d673ffdb5b7d67ca200e55919d7",class:"fk-grid"},0===t.length?s("p",{class:"fk-grid__empty"},d("grid.empty")):null,t.map(((r,t)=>s("div",{class:"fk-grid__row","data-grid-row":t,key:t},s("div",{class:"fk-grid__cells"},i.map(((i,a)=>s("fk-brick-render",{brickSpec:i,data:r,dataMap:r,errors:this.visibleRowErrors(t),locale:this.locale,path:`grid.${t}.${a}`,utils:this.utils})))),s("button",{type:"button",class:"fk-grid__remove",title:d("grid.removeRow"),disabled:this.disabled,onClick:r=>{r.preventDefault(),this.removeRow(t)}},"✕")))),s("button",{key:"9bf04c364b3262c436ffb580daf802d15f29de57",type:"button",class:"fk-grid__add",disabled:this.disabled,onClick:this.addRow},d("grid.addRow")))}static get style(){return".sc-fk-data-grid-h{display:block}.fk-grid.sc-fk-data-grid{display:flex;flex-direction:column;gap:var(--fk-spacing)}.fk-grid__empty.sc-fk-data-grid{margin:0;padding:var(--fk-spacing);border:1px dashed var(--fk-color-border);border-radius:var(--fk-radius);font-size:0.85rem;color:var(--fk-color-muted);text-align:center}.fk-grid__row.sc-fk-data-grid{display:flex;align-items:flex-start;gap:var(--fk-spacing);padding:var(--fk-spacing);border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:color-mix(in srgb, var(--fk-color-surface) 60%, transparent)}.fk-grid__cells.sc-fk-data-grid{display:flex;flex:1;flex-wrap:wrap;gap:var(--fk-spacing);min-width:0}.fk-grid__cells.sc-fk-data-grid>*.sc-fk-data-grid{flex:1;min-width:160px}.fk-grid__remove.sc-fk-data-grid{border:none;background:transparent;color:var(--fk-color-muted);font-size:0.8rem;cursor:pointer;padding:4px 6px;border-radius:calc(var(--fk-radius) / 2)}.fk-grid__remove.sc-fk-data-grid:hover:not(:disabled){color:var(--fk-color-danger);background:color-mix(in srgb, var(--fk-color-danger) 10%, transparent)}.fk-grid__add.sc-fk-data-grid{align-self:flex-start;font:inherit;font-size:0.8rem;font-weight:600;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);border:1px dashed var(--fk-color-border);border-radius:var(--fk-radius);background:transparent;color:var(--fk-color-muted);cursor:pointer}.fk-grid__add.sc-fk-data-grid:hover:not(:disabled){border-color:var(--fk-color-primary);color:var(--fk-color-primary)}"}},[2,"fk-data-grid",{spec:[16],value:[16],disabled:[4],locale:[1],utils:[16],touched:[32],validateRows:[64]},[[0,"brickDataChange","handleRowChange"]]]);function k(){"undefined"!=typeof customElements&&["fk-data-grid","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-drop-area"].forEach((i=>{switch(i){case"fk-data-grid":customElements.get(r(i))||customElements.define(r(i),f);break;case"fk-brick-actions":customElements.get(r(i))||e();break;case"fk-brick-not-found":customElements.get(r(i))||c();break;case"fk-brick-render":customElements.get(r(i))||n();break;case"fk-drop-area":customElements.get(r(i))||l()}}))}k();export{f as F,k as d}
@@ -0,0 +1 @@
1
+ function l(l,n="label",e="value"){return Array.isArray(l)?l.map((l=>{var r,u;if("object"==typeof l&&null!==l){const t=null!==(r=l[n])&&void 0!==r?r:l[e],a=null!==(u=l[e])&&void 0!==u?u:l[n];return{label:String(null!=t?t:""),value:String(null!=a?a:"")}}return{label:String(l),value:String(l)}})).filter((l=>""!==l.label)):String(null!=l?l:"").split("\n").map((l=>l.trim())).filter(Boolean).map((l=>({label:l,value:l})))}export{l as n}
@@ -0,0 +1 @@
1
+ import{t as i,p as e,H as s,c as t,h as r}from"./p-BB4Llg42.js";import{s as o}from"./p-CKMHMpID.js";import{a as l,f as a}from"./p-BOmBVgfJ.js";const f=e(class extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.fileValueChange=t(this,"fileValueChange"),this.disabled=!1,this.multiple=!1,this.uploading=!1,this.handleFile=async i=>{var e;const s=i.target,t=Array.from(null!==(e=s.files)&&void 0!==e?e:[]);if(t.length){this.uploading=!0,this.uploadError=void 0;try{const i=[];for(const e of this.multiple?t:t.slice(0,1))i.push(await o.fileUploadService.upload(e,{url:this.uploadUrl}));this.emitFiles(this.multiple?[...this.files,...i]:i)}catch(i){this.uploadError=i instanceof Error?i.message:String(i)}finally{this.uploading=!1,s.value=""}}},this.handleRemove=async i=>{var e,s;this.removingUrl=i.url,this.uploadError=void 0;try{await(null===(s=(e=o.fileUploadService).remove)||void 0===s?void 0:s.call(e,i,{url:this.uploadUrl}))}catch(i){this.uploadError=i instanceof Error?i.message:String(i)}finally{this.removingUrl=void 0,this.emitFiles(this.files.filter((e=>e!==i)))}}}get files(){return Array.isArray(this.value)?this.value:this.value?[this.value]:[]}emitFiles(i){this.fileValueChange.emit(this.multiple?i.length?i:void 0:i[0])}formatSize(i){return i<1024?`${i} B`:i<1048576?`${(i/1024).toFixed(1)} KB`:`${(i/1048576).toFixed(1)} MB`}renderFile(i){const e=void 0!==this.removingUrl&&this.removingUrl===i.url;return r("div",{class:"fk-file__selected",key:`${i.url}:${i.name}`},r("span",{class:"fk-file__icon","aria-hidden":"true"},r("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r("polyline",{points:"14 2 14 8 20 8"}))),r("span",{class:"fk-file__meta"},r("span",{class:"fk-file__name",title:i.name},i.name),r("span",{class:"fk-file__size"},this.formatSize(i.size))),r("button",{type:"button",class:"fk-file__remove",title:l("file.remove"),disabled:this.disabled||e,onClick:e=>{e.preventDefault(),this.handleRemove(i)}},e?"…":"✕"))}render(){const i=this.files,e=this.multiple||0===i.length;return r("div",{key:"883cb0627b948d807f59ed5c62e44b0db421c3c6",class:"fk-file"},i.map((i=>this.renderFile(i))),e?r("button",{type:"button",class:"fk-file__choose",disabled:this.disabled||this.uploading,onClick:i=>{var e;i.preventDefault(),null===(e=this.inputEl)||void 0===e||e.click()}},this.uploading?l("file.uploading"):this.multiple&&i.length?a("file.addAnother","+ Add a file"):l("file.choose")):null,r("input",{key:"a35947614d82f94eba8453b1f43382d2754cb36f",class:"fk-file__native",type:"file",accept:this.accept,multiple:this.multiple,disabled:this.disabled,ref:i=>this.inputEl=i,onChange:this.handleFile}),this.uploadError?r("span",{class:"fk-field__error"},this.uploadError):null)}static get style(){return".sc-fk-file-input-h{display:block}.fk-file.sc-fk-file-input{display:flex;flex-direction:column;gap:calc(var(--fk-spacing) / 2);align-items:flex-start}.fk-file__native.sc-fk-file-input{display:none}.fk-file__choose.sc-fk-file-input{font:inherit;font-size:0.85rem;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);border:1px dashed var(--fk-color-border);border-radius:var(--fk-radius);background:transparent;color:var(--fk-color-muted);cursor:pointer}.fk-file__choose.sc-fk-file-input:hover:not(:disabled){border-color:var(--fk-color-primary);color:var(--fk-color-primary)}.fk-file__choose.sc-fk-file-input:disabled{opacity:0.55;cursor:not-allowed}.fk-file__selected.sc-fk-file-input{display:flex;align-items:center;gap:var(--fk-spacing);width:100%;box-sizing:border-box;padding:calc(var(--fk-spacing) * 0.75) var(--fk-spacing);border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:var(--fk-color-surface)}.fk-file__icon.sc-fk-file-input{display:inline-flex;flex-shrink:0;color:var(--fk-color-primary)}.fk-file__meta.sc-fk-file-input{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.fk-file__name.sc-fk-file-input{font-size:0.85rem;font-weight:600;color:var(--fk-color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fk-file__size.sc-fk-file-input{font-size:0.72rem;color:var(--fk-color-muted);white-space:nowrap}.fk-file__remove.sc-fk-file-input{border:none;background:transparent;color:var(--fk-color-muted);font-size:0.8rem;cursor:pointer;padding:4px 6px;border-radius:calc(var(--fk-radius) / 2);flex-shrink:0}.fk-file__remove.sc-fk-file-input:hover:not(:disabled){background:color-mix(in srgb, var(--fk-color-danger) 12%, transparent)}.fk-file__remove.sc-fk-file-input:hover:not(:disabled){color:var(--fk-color-danger)}"}},[2,"fk-file-input",{value:[16],disabled:[4],accept:[1],uploadUrl:[1,"upload-url"],multiple:[4],uploading:[32],removingUrl:[32],uploadError:[32]}]);function n(){"undefined"!=typeof customElements&&["fk-file-input"].forEach((e=>{"fk-file-input"===e&&(customElements.get(i(e))||customElements.define(i(e),f))}))}n();export{f as F,n as d}
@@ -1 +1 @@
1
- import{t as e,p as t,H as r,h as f,a as s}from"./p-QC41Uj05.js";import{a as c}from"./p-BQP1WryV.js";const a=t(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return f(s,{key:"1b0ab4cd1d988a4800deeb6e3cfd8f5074520f6b"},f("div",{key:"65b551e1cab6162514ad941b21e318c5f19b824a",class:"fk-empty"},f("p",{key:"c4eba1c6fecb4f2669f1c4dfb09cd816790a5ebf",class:"fk-empty__title"},c("empty.title")),f("p",{key:"751bb3a2fc07982c90a214bd1e71592ec03d988d",class:"fk-empty__hint"},c("empty.hint"))))}static get style(){return".fk-empty.sc-fk-empty-form{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(var(--fk-spacing) / 2);min-height:160px;border:2px dashed var(--fk-color-border);border-radius:var(--fk-radius);color:var(--fk-color-muted);text-align:center}.fk-empty__title.sc-fk-empty-form{margin:0;font-weight:600}.fk-empty__hint.sc-fk-empty-form{margin:0;font-size:0.875rem}"}},[2,"fk-empty-form"]);function m(){"undefined"!=typeof customElements&&["fk-empty-form"].forEach((t=>{"fk-empty-form"===t&&(customElements.get(e(t))||customElements.define(e(t),a))}))}m();export{a as F,m as d}
1
+ import{t as e,p as t,H as f,h as r,a as s}from"./p-BB4Llg42.js";import{a as c}from"./p-BOmBVgfJ.js";const m=t(class extends f{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return r(s,{key:"1b0ab4cd1d988a4800deeb6e3cfd8f5074520f6b"},r("div",{key:"65b551e1cab6162514ad941b21e318c5f19b824a",class:"fk-empty"},r("p",{key:"c4eba1c6fecb4f2669f1c4dfb09cd816790a5ebf",class:"fk-empty__title"},c("empty.title")),r("p",{key:"751bb3a2fc07982c90a214bd1e71592ec03d988d",class:"fk-empty__hint"},c("empty.hint"))))}static get style(){return".fk-empty.sc-fk-empty-form{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(var(--fk-spacing) / 2);min-height:160px;border:2px dashed var(--fk-color-border);border-radius:var(--fk-radius);color:var(--fk-color-muted);text-align:center}.fk-empty__title.sc-fk-empty-form{margin:0;font-weight:600}.fk-empty__hint.sc-fk-empty-form{margin:0;font-size:0.875rem}"}},[2,"fk-empty-form"]);function a(){"undefined"!=typeof customElements&&["fk-empty-form"].forEach((t=>{"fk-empty-form"===t&&(customElements.get(e(t))||customElements.define(e(t),m))}))}a();export{m as F,a as d}