@overmap-ai/forms 1.0.37-style-updates.2 → 1.0.37-style-updates.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/forms.js +2 -2
- package/dist/forms.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/forms.js
CHANGED
|
@@ -2148,13 +2148,13 @@ const vo = G((r) => {
|
|
|
2148
2148
|
return /* @__PURE__ */ _(
|
|
2149
2149
|
vt,
|
|
2150
2150
|
{
|
|
2151
|
-
className: wr(a, "relative flex h-
|
|
2151
|
+
className: wr(a, "relative flex h-48 w-full flex-col items-center p-0!"),
|
|
2152
2152
|
ref: e,
|
|
2153
2153
|
size: "xs",
|
|
2154
2154
|
...s,
|
|
2155
2155
|
children: [
|
|
2156
2156
|
!t && !n && /* @__PURE__ */ p("div", { className: "absolute inset-0 grow flex items-center justify-center", children: /* @__PURE__ */ p(Ba, {}) }),
|
|
2157
|
-
!!t && !n && /* @__PURE__ */ p("div", { className: "flex grow
|
|
2157
|
+
!!t && !n && /* @__PURE__ */ p("div", { className: "flex grow w-full items-center justify-center overflow-hidden bg-clip-padding p-3", children: /* @__PURE__ */ p(ui, { className: "max-w-full size-full object-cover", file: t }) }),
|
|
2158
2158
|
/* @__PURE__ */ p(nr, { size: "full" }),
|
|
2159
2159
|
(!!t || !!n) && /* @__PURE__ */ _(
|
|
2160
2160
|
"div",
|
package/dist/forms.umd.cjs
CHANGED
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
*
|
|
234
234
|
* This source code is licensed under the ISC license.
|
|
235
235
|
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const et=G("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),En=_.memo(r=>{const{ref:e,file:t,className:n,error:i,rightSlot:a,size:o,...s}=r;return f.jsxs(v.Card,{className:St.cx(n,"flex w-full items-center gap-2"),ref:e,size:"xs",...s,children:[i?f.jsx(v.LuIcon,{icon:ol,color:"var(--base-a11)"}):f.jsx(v.LuIcon,{icon:aa,color:"var(--base-a11)"}),i?f.jsx(v.Text,{accentColor:"danger",className:"truncate",size:o,children:i}):t?f.jsx(v.Text,{className:"truncate",accentColor:"base",size:o,children:t.name}):f.jsx("div",{className:"flex w-full justify-center",children:f.jsx(v.Spinner,{})}),a]})});En.displayName="FileCard";function ar(r){return Array.isArray(r)?r.every(e=>typeof e=="string"):!1}class or{constructor(){b(this,"observers",new Set)}notify(e){for(const t of this.observers)t(e)}observe(e){return this.observers.add(e),()=>{this.observers.delete(e)}}}class Sn extends or{constructor(t){const{identifier:n}=t;super();b(this,"identifier");this.identifier=n}getOptions(){return{identifier:this.identifier}}setOptions(t){this.identifier=t.identifier??this.identifier,this.notify(this)}serialize(){return{type:this.type,identifier:this.identifier}}}class Me extends Sn{constructor(t){const{label:n,description:i=null,required:a,image:o,...s}=t;super(s);b(this,"label");b(this,"description");b(this,"required");b(this,"image");b(this,"onlyValidateAfterTouched",!0);this.label=n,this.description=i,this.required=a,this.image=o}getError(t){if(this.required&&this.isValueBlank(t))return"This field is required.";for(const n of this.getFieldValidators()){const i=n(t);if(i)return i}}serialize(){return{...super.serialize(),label:this.label,description:this.description,required:this.required,image:this.image}}getOptions(){return{...super.getOptions(),label:this.label,description:this.description,required:this.required,image:this.image}}setOptions(t){const{label:n,description:i=null,required:a,image:o,...s}=t;this.label=n??this.label,this.description=i??this.description,this.required=a??this.required,this.image=o??this.image,super.setOptions(s)}isValueBlank(t){return this.areValuesEqual(t,this.blankValue())}cleanValue(t){return t}isValueClean(t){return this.areValuesEqual(t,this.cleanValue(t))}cleanSerializedValue(t){return t}isSerializedValueClean(t){return this.areSerializedValuesEqual(t,this.cleanSerializedValue(t))}isSerializedValueBlank(t){return this.areSerializedValuesEqual(t,this.blankSerializedValue())}getFieldValidators(){return[]}}b(Me,"fieldTypeName"),b(Me,"fieldTypeDescription");const ua=_.createContext(()=>{throw new Error("No ImageViewerProvider found")}),Rr=()=>_.useContext(ua),ca=r=>{const[e,t]=_.useState(null);return _.useEffect(()=>{const n=URL.createObjectURL(r);return t(n),()=>{URL.revokeObjectURL(n)}},[r]),e},Ur=_.memo(r=>{const{file:e,...t}=r,n=ca(e);return n?f.jsx("img",{src:n,alt:e.name,...t}):null});Ur.displayName="ImageFile";const In=_.memo(r=>{const{file:e,onClose:t}=r,n=_.useCallback(()=>{Yi.saveAs(e,e.name)},[e]);return f.jsx(v.Overlay.Root,{open:!0,onOpenChange:t,children:f.jsxs(v.Overlay.Content,{onOpenAutoFocus:i=>i.preventDefault(),children:[f.jsxs(v.ButtonGroup,{className:"flex gap-2 items-center top-0 absolute right-0 p-2",accentColor:"base",variant:"ghost",children:[f.jsxs(v.Tooltip.Root,{children:[f.jsx(v.Tooltip.Trigger,{asChild:!0,children:f.jsx(v.IconButton,{onClick:n,"aria-label":"download",children:f.jsx(v.LuIcon,{icon:na})})}),f.jsx(v.Tooltip.Content,{size:"sm",children:"Download"})]}),f.jsx(v.Separator,{orientation:"vertical",size:"sm"}),f.jsx(v.Overlay.Close,{asChild:!0,children:f.jsx(v.IconButton,{onClick:t,"aria-label":"close",children:f.jsx(v.LuIcon,{icon:et})})})]}),f.jsx("figure",{className:"size-full overflow-hidden p-4 flex justify-center items-center",children:f.jsx(Ur,{className:"max-w-full max-h-full",file:e})})]})})});In.displayName="ImageViewer";const da=_.memo(r=>{const{children:e}=r,[t,n]=_.useState(null),i=_.useCallback(()=>{n(null)},[]),a=_.useCallback(s=>{n(s(i))},[i]),o=_.useCallback(()=>{t&&(t.onClose&&t.onClose(),i())},[i,t]);return f.jsxs(ua.Provider,{value:a,children:[e,t&&f.jsx(In,{file:t.file,onClose:o})]})});da.displayName="FileViewerProvider";const Ie=_.memo(r=>{const{className:e,label:t,error:n,description:i,children:a,inputId:o,labelId:s,image:l,size:u}=r,[c,d]=_.useState(void 0),h=Rr();_.useEffect(()=>{l instanceof Promise?l.then(d).catch(console.error):d(l)},[l]);const p=c?URL.createObjectURL(c):void 0,g=_.useCallback(()=>{c&&h(()=>({file:c}))},[h,c]);return f.jsxs("div",{className:"flex flex-col gap-1",children:[c&&f.jsx("img",{className:"h-[100px] w-full min-w-[300px] cursor-pointer rounded-md object-cover",src:p,alt:c.name,onClick:g}),(!!t||!!i)&&f.jsxs("div",{className:"flex flex-col",children:[f.jsx("label",{className:St.cx(e,"w-max max-w-full"),htmlFor:o,children:f.jsx(v.Text,{size:u,id:s,className:"text-wrap",children:t})}),!!i&&f.jsx(v.Text,{accentColor:"base",size:u,children:i})]}),a,!!n&&f.jsx(v.Text,{accentColor:"danger",size:u,children:n})]})}),_l=St.cva(["flex","flex-col"],{variants:{size:{xs:["gap-2"],sm:["gap-4"],md:["gap-6"],lg:["gap-8"],xl:["gap-10"]}}}),sr=(r,e)=>{const{size:t}=e;return f.jsx("div",{className:_l({size:t}),children:r.map((n,i)=>f.jsx(_.Fragment,{children:n.render({index:i,...e})},n.identifier))})},Oe=r=>{const{field:e,size:t,showInputOnly:n,onValuesChange:i,...a}=r,[o,s,l]=Je.useField(e.identifier),{touched:u}=s,c=s.error??"",d=e.identifier,h=`${d}-label`,p=e.required?`${e.label} *`:e.label,g=e.description??"",x=_.useMemo(()=>({...o,onChange:y=>{l.setValue(y,!1),i==null||i(e.identifier,y),(u||!e.onlyValidateAfterTouched)&&l.setError(e.getError(y))},onBlur:y=>{l.setTouched(!0,!1),l.setError(e.getError(y))}}),[e,o,l,i,u]);return[{error:c,size:t,inputId:d,labelId:h,label:p,description:g,showInputOnly:n,fieldProps:x,helpers:l,field:e,touched:u},{...a,"aria-labelledby":h}]},On=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),d=i?"":s,{value:h,name:p,onChange:g,onBlur:x}=u,w=`${e}-droppable`,[m,y]=_.useState(""),[A,S]=_.useState(""),O=_.useCallback(z=>{g(z),x(z)},[g,x]),N=_.useCallback(z=>{h&&h.findIndex(H=>H===z.target.value.trim())>=0?S("All options must be unique"):z.target.value?S(""):S("Option cannot be empty"),y(z.target.value)},[y,h]),D=_.useCallback(()=>{if(A)return;if(!m.trim()){S("Option cannot be empty");return}const z=m.trim();O([...h,z]),y("")},[m,A,O,h]),M=_.useCallback(z=>{z.key==="Enter"&&(z.preventDefault(),D())},[D]),B=_.useCallback(z=>{const H=Array.from(h);H.splice(z,1),O(H)},[h,O]),L=_.useCallback(z=>{if(!z.destination)return;const H=z.source.index,te=z.destination.index,q=Array.from(h),[ue]=q.splice(H,1);q.splice(te,0,ue),O(q)},[O,h]),j=_.useCallback(()=>{x(h)},[x,h]);return f.jsx(Cn.DragDropContext,{onDragEnd:L,children:f.jsxs(Ie,{size:n,inputId:e,labelId:t,label:d,description:l,error:A||o,image:i?void 0:a.image,children:[(!c||h.length===0)&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx(v.Input.Root,{className:"grow",accentColor:"base",variant:"surface",size:n,children:f.jsx(v.Input.Field,{value:m,onChange:N,onKeyDown:M,id:e,placeholder:a.placeholder,onBlur:j,name:p,disabled:c})}),f.jsx(v.IconButton,{size:n,accentColor:"base",variant:"soft",type:"button","aria-label":"Add option",disabled:!!A||c,onClick:D,children:f.jsx(v.LuIcon,{icon:$e})})]}),h.length!==0&&f.jsx(Cn.Droppable,{droppableId:w,children:z=>f.jsxs("div",{className:"flex flex-col gap-1",...z.droppableProps,ref:z.innerRef,children:[h.map((H,te)=>f.jsx(Cn.Draggable,{draggableId:`${H}-draggable`,index:te,isDragDisabled:c,children:({draggableProps:q,dragHandleProps:ue,innerRef:ct})=>f.jsxs(v.Badge,{...ue,...q,ref:ct,className:"flex items-center justify-between gap-2",accentColor:"base",size:n,variant:"soft",children:[f.jsx(v.Text,{className:"truncate",highContrast:!0,children:typeof H=="object"&&"label"in H?H.label:H}),f.jsx(v.IconButton,{className:"bg-transparent!",size:n,variant:"ghost",type:"button","aria-label":"Delete option",accentColor:"base",disabled:c,onClick:()=>{B(te)},children:f.jsx(v.LuIcon,{icon:et})})]})},`${e}-${H}-${te}`)),z.placeholder]})})]})})});On.displayName="MultiStringFieldInput";const Xt=class Xt extends Me{constructor(t){const{minimum_length:n,maximum_length:i,placeholder:a,...o}=t;super(o);b(this,"type","multi-string");b(this,"minLength");b(this,"maxLength");b(this,"placeholder");b(this,"onlyValidateAfterTouched",!1);this.minLength=n??0,this.maxLength=i??1/0,this.placeholder=a??"Press enter to add a new option"}render(t){return f.jsx(On,{field:this,...t})}serialize(){return{...super.serialize(),minimum_length:this.minLength,maximum_length:this.maxLength,placeholder:this.placeholder}}getOptions(){return{...super.getOptions(),minimum_length:this.minLength,maximum_length:this.maxLength,placeholder:this.placeholder}}duplicate(t){return new Xt({...this.getOptions(),identifier:t})}setOptions(t){const{minimum_length:n,maximum_length:i,placeholder:a,...o}=t;this.minLength=n??this.minLength,this.maxLength=i??this.maxLength,this.placeholder=a??this.placeholder,super.setOptions(o)}serializeValue(t){return t}deserializeValue(t){return t}getFieldValidators(){const t=super.getFieldValidators();return t.push(n=>{if(Array.isArray(n)&&n.length<this.minLength)return`Must have at least ${this.minLength} options.`}),t.push(n=>{if(Array.isArray(n)&&n.length>this.maxLength)return`Must have at most ${this.maxLength} options.`}),t}static deserialize(t){return new Xt(t)}isSerializedValue(t){return ar(t)}isValue(t){return ar(t)}blankValue(){return[]}areValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}blankSerializedValue(){return[]}areSerializedValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}};b(Xt,"fieldTypeName","Multi-string"),b(Xt,"fieldTypeDescription","Allows the user to provide multiple unique strings.");let It=Xt;class lr extends Me{constructor(t){const{options:n,...i}=t;super(i);b(this,"options");b(this,"onlyValidateAfterTouched",!1);this.options=n.map(a=>(typeof a=="string"&&(a={label:a,value:a}),a))}serialize(){return{...super.serialize(),options:this.options}}getOptions(){return{...super.getOptions(),options:this.options}}setOptions(t){const{options:n,...i}=t;this.options=(n==null?void 0:n.map(a=>(typeof a=="string"&&(a={label:a,value:a}),a)))??this.options,super.setOptions(i)}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new It({label:"Options",description:"List possible options for the user to select from.",required:!0,identifier:`${n}options`,minimum_length:2}),showDirectly:!0}]}}const bn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{name:d,onBlur:h,onChange:p,value:g}=u,x=i?"":s,w=_.useCallback(y=>{p(!!y),h(!!y)},[h,p]),m=_.useCallback(()=>{h(g)},[h,g]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:l,error:o,image:i?void 0:a.image,children:f.jsx(v.Checkbox.Root,{id:e,name:d,checked:g??!1,onCheckedChange:w,onBlur:m,size:n,accentColor:"base",variant:"surface",disabled:c,children:f.jsx(v.Checkbox.Indicator,{children:f.jsx(v.LuIcon,{icon:Re})})})})});bn.displayName="BooleanFieldInput";const $t=class $t extends Me{constructor(t){super(t);b(this,"type","boolean");b(this,"onlyValidateAfterTouched",!1)}serialize(){return super.serialize()}getOptions(){return super.getOptions()}setOptions(t){super.setOptions(t)}duplicate(t){return new $t({...this.getOptions(),identifier:t})}static deserialize(t){return new $t(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(bn,{...t,field:this})}isSerializedValue(t){return typeof t=="boolean"}isValue(t){return typeof t=="boolean"}blankValue(){return!1}blankSerializedValue(){return!1}areSerializedValuesEqual(t,n){return t===n}areValuesEqual(t,n){return t===n}};b($t,"fieldTypeName","Checkbox"),b($t,"fieldTypeDescription","Perfect for both optional and required yes/no questions.");let Ot=$t;const Nn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u,touched:c,helpers:d},{disabled:h}]=Oe(r),{name:p,onBlur:g,onChange:x,value:w}=u,m=i?"":s,[y,A]=_.useState(null);_.useEffect(()=>{A(w)},[w]);const S=_.useCallback(D=>{const M=D.target.valueAsNumber,B=isNaN(M)?null:M;A(B),(c||!a.onlyValidateAfterTouched)&&d.setError(a.getError(B))},[a,d,c]),O=_.useCallback(D=>{D.key==="Enter"&&D.preventDefault()},[]),N=_.useCallback(()=>{x(y),g(y)},[y,g,x]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:m,description:l,error:o,image:i?void 0:a.image,children:f.jsx(v.Input.Root,{accentColor:"base",variant:"surface",size:n,children:f.jsx(v.Input.Field,{id:e,name:p,onChange:S,onBlur:N,value:y??"",type:"number",min:a.minimum,max:a.maximum,step:a.integers?1:"any",placeholder:a.placeholder??"Enter a number",disabled:h,onKeyDown:O})})})});Nn.displayName="NumberFieldInput";const ut=class ut extends Me{constructor(t){const{minimum:n=Number.MIN_SAFE_INTEGER,maximum:i=Number.MAX_SAFE_INTEGER,integers:a=!1,placeholder:o,...s}=t;super(s);b(this,"type","number");b(this,"minimum");b(this,"maximum");b(this,"integers");b(this,"placeholder");this.minimum=n,this.maximum=i,this.integers=a,this.placeholder=o}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new ut({label:"Minimum",description:"Minimum value",integers:!0,required:!1,identifier:`${n}minimum`}),showDirectly:!1},{field:new ut({label:"Maximum",description:"Maximum value",integers:!0,required:!1,identifier:`${n}maximum`}),showDirectly:!1},{field:new Ot({label:"Integers",description:"Whole numbers only",required:!1,identifier:`${n}integers`}),showDirectly:!1}]}getFieldValidators(){const t=super.getFieldValidators(),n=this.minimum,i=this.maximum;return typeof n=="number"&&t.push(a=>{if(typeof a=="number"&&a<n)return`Must be at least ${this.minimum}.`}),typeof i=="number"&&t.push(a=>{if(typeof a=="number"&&a>i)return`Must be at most ${this.maximum}.`}),this.integers&&t.push(a=>{if(typeof a=="number"&&!Number.isInteger(a))return"Must be a whole number."}),t}serialize(){return{...super.serialize(),minimum:this.minimum,maximum:this.maximum,integers:this.integers,placeholder:this.placeholder}}getOptions(){return{...super.getOptions(),minimum:this.minimum,maximum:this.maximum,integers:this.integers,placeholder:this.placeholder}}duplicate(t){return new ut({...this.getOptions(),identifier:t})}setOptions(t){const{minimum:n,maximum:i,integers:a,placeholder:o,...s}=t;this.minimum=n??this.minimum,this.maximum=i??this.maximum,this.integers=a??this.integers,this.placeholder=o??this.placeholder,super.setOptions(s)}static deserialize(t){return new ut(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Nn,{field:this,...t})}isSerializedValue(t){return this.isValue(t)}isValue(t){return typeof t=="number"&&!isNaN(t)||t===null}areValuesEqual(t,n){return t===n}blankValue(){return null}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}};b(ut,"fieldTypeName","Number"),b(ut,"fieldTypeDescription","Allows specifying a number within a given range.");let Ge=ut;const bt=1e4;class Tn extends Me{constructor(t){const{minLength:n,maxLength:i,placeholder:a="",...o}=t;super(o);b(this,"minLength");b(this,"maxLength");b(this,"placeholder");this.minLength=n?Math.max(n,0):void 0,this.maxLength=i?Math.max(i,0):bt,this.placeholder=a}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new Ge({label:"Minimum length",description:"Minimum number of characters",required:!1,identifier:`${n}minimum_length`,minimum:0,maximum:100,integers:!0}),showDirectly:!1},{field:new Ge({label:"Maximum length",description:"Maximum number of characters",required:!1,identifier:`${n}maximum_length`,minimum:1,maximum:bt,integers:!0}),showDirectly:!1}]}getFieldValidators(){const t=super.getFieldValidators();return this.minLength&&t.push(n=>{if(this.minLength&&(!n||n.length<this.minLength))return!this.required&&!n?null:`Minimum ${this.minLength} character(s).`}),this.maxLength&&t.push(n=>{if(typeof n=="string"&&this.maxLength&&n.length>this.maxLength)return`Maximum ${this.maxLength} character(s).`}),t}serialize(){return{...super.serialize(),minimum_length:this.minLength,maximum_length:this.maxLength,placeholder:this.placeholder}}getOptions(){return{...super.getOptions(),minLength:this.minLength,maxLength:this.maxLength,placeholder:this.placeholder}}setOptions(t){const{minLength:n,maxLength:i,placeholder:a,...o}=t;this.minLength=n,this.maxLength=i??this.maxLength,this.placeholder=a,super.setOptions(o)}serializeValue(t){return t}deserializeValue(t){return t}isSerializedValue(t){return typeof t=="string"}isValue(t){return typeof t=="string"}blankValue(){return""}blankSerializedValue(){return""}areSerializedValuesEqual(t,n){return t===n}areValuesEqual(t,n){return t===n}}const Dn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,field:i,showInputOnly:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{value:d,name:h,onChange:p,onBlur:g}=u,x=a?"":s,w=_.useCallback(m=>{p(m),g(m)},[g,p]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:l,error:o,image:a?void 0:i.image,children:f.jsx(v.CheckboxGroup.Root,{id:e,name:h,className:"flex flex-col gap-1",accentColor:"base",variant:"surface",size:n,values:d,onValuesChange:w,disabled:c,children:i.options.map((m,y)=>f.jsxs("label",{className:"flex gap-2 items-center min-w-0",children:[f.jsx(v.CheckboxGroup.Item,{value:m.value,children:f.jsx(v.CheckboxGroup.ItemIndicator,{children:f.jsx(v.LuIcon,{icon:Re})})}),f.jsx(v.Text,{size:n,accentColor:"base",className:"truncate",children:m.label})]},`${e}-${m.value}-${y}`))})})});Dn.displayName="CheckboxListFieldInput";const Wt=class Wt extends lr{constructor(t){super(t);b(this,"type","checkbox-list");b(this,"onlyValidateAfterTouched",!1)}serialize(){return super.serialize()}getOptions(){return super.getOptions()}duplicate(t){return new Wt({...this.getOptions(),identifier:t})}static deserialize(t){return new Wt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Dn,{field:this,...t})}isSerializedValue(t){if(!ar(t))return!1;const n=new Set(this.options.map(({value:i})=>i));return t.every(i=>n.has(i))}isValue(t){return this.isSerializedValue(t)}blankValue(){return[]}blankSerializedValue(){return[]}areSerializedValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}areValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}};b(Wt,"fieldTypeName","Checkbox list"),b(Wt,"fieldTypeDescription","Allows the user to select a multiple options from a list.");let Nt=Wt;const Mn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{value:d,name:h,onChange:p,onBlur:g}=u,[x,w]=_.useState(!1),m=i?"":s,y=_.useCallback(S=>{p(S??null),w(!1)},[p]),A=_.useCallback(S=>{w(S),S||g(d)},[g,d]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:m,description:l,error:o,image:i?void 0:a.image,children:f.jsxs(v.Popover.Root,{open:x,onOpenChange:A,children:[f.jsx(v.Popover.Trigger,{asChild:!0,children:f.jsxs(v.Button,{id:e,name:h,type:"button",className:"!justify-between",accentColor:"base",variant:"surface",size:n,disabled:c,children:[f.jsx(v.Text,{className:"truncate",highContrast:!!d,children:d?d.toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit"}):"yyyy-mm-dd"}),f.jsx(v.LuIcon,{icon:mn})]})}),f.jsx(v.Popover.Content,{align:"start",size:n,children:f.jsx(v.DayPicker,{size:n,required:!1,mode:"single",variant:"solid",selected:d??void 0,onSelect:y})})]})})});Mn.displayName="DateFieldInput";const jt=class jt extends Me{constructor(t){super(t);b(this,"type","date");b(this,"onlyValidateAfterTouched",!1)}serialize(){return super.serialize()}getOptions(){return super.getOptions()}duplicate(t){return new jt({...this.getOptions(),identifier:t})}static deserialize(t){return new jt(t)}setOptions(t){super.setOptions(t)}serializeValue(t){return t?t.toISOString():null}deserializeValue(t){return t?new Date(t):null}render(t){return f.jsx(Mn,{field:this,...t})}isSerializedValue(t){return typeof t!="string"&&t!==null?!1:this.isValue(this.deserializeValue(t))}isValue(t){return!(!(t instanceof Date)&&t!==null||t instanceof Date&&isNaN(t.getTime()))}blankValue(){return null}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}areValuesEqual(t,n){return!t&&!n?!0:!t||!n?!1:t.getTime()===n.getTime()}};b(jt,"fieldTypeName","Date"),b(jt,"fieldTypeDescription","Allows specifying a date.");let ur=jt;const Fn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{value:d,name:h,onChange:p,onBlur:g}=u,x=i?"":s,w=_.useCallback(y=>{p(y),g(y)},[g,p]),m=_.useCallback(y=>{y||g(d)},[d,g]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:l,error:o,image:i?void 0:a.image,children:f.jsxs(v.Menu.Root,{onOpenChange:m,align:"start",children:[f.jsx(v.Menu.ClickTrigger,{children:f.jsxs(v.Button,{id:e,name:h,className:"!justify-between",variant:"surface",type:"button",size:n,accentColor:"base",disabled:c,children:[f.jsx(v.Text,{className:"truncate",highContrast:d&&d.length>0,children:d&&d.length>0?d.join(", "):a.placeholder??"Select one or more..."}),f.jsx(v.LuIcon,{icon:mn})]})}),f.jsx(v.Menu.Content,{size:n,children:f.jsx(v.Menu.Scroll,{children:f.jsxs(v.Menu.MultiSelectGroup,{values:d,onValuesChange:w,children:[f.jsxs(v.Menu.SelectAllItem,{children:[f.jsx(v.Menu.CheckboxItemIndicator,{children:y=>y?f.jsx(v.LuIcon,{icon:kr}):f.jsx(v.LuIcon,{icon:Re})}),"Select all"]}),a.options.map((y,A)=>f.jsxs(v.Menu.MultiSelectItem,{value:y.value,children:[f.jsx(v.Menu.SelectedIndicator,{children:f.jsx(v.LuIcon,{icon:Re})}),y.label]},`${e}-${y.value}-${A}`))]})})})]})})});Fn.displayName="MultiSelectFieldInput";const Yt=class Yt extends lr{constructor(t){const{placeholder:n,...i}=t;super(i);b(this,"type","multi-select");b(this,"placeholder");this.placeholder=n}serialize(){return super.serialize()}getOptions(){return{...super.getOptions(),placeholder:this.placeholder}}duplicate(t){return new Yt({...this.getOptions(),identifier:t})}setOptions(t){const{placeholder:n}=t;this.placeholder=n,super.setOptions(t)}static deserialize(t){return new Yt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Fn,{field:this,...t})}isSerializedValue(t){if(!ar(t))return!1;const n=new Set(this.options.map(({value:i})=>i));return t.every(i=>n.has(i))}isValue(t){return this.isSerializedValue(t)}blankValue(){return[]}areValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}blankSerializedValue(){return[]}areSerializedValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}};b(Yt,"fieldTypeName","Multi-select"),b(Yt,"fieldTypeDescription","Allows the user to select a multiple options from a list of options.");let tt=Yt;const Pn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,label:o,description:s,error:l,fieldProps:u},{disabled:c}]=Oe(r),{name:d,onChange:h,onBlur:p,value:g}=u,x=i?"":o,w=_.useCallback(y=>{h(y??null),p(y??null)},[p,h]),m=_.useMemo(()=>a.options.find(y=>y.value===g),[a.options,g]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:s,error:l,image:i?void 0:a.image,children:f.jsxs(v.Menu.Root,{align:"start",children:[f.jsx(v.Menu.ClickTrigger,{children:f.jsxs(v.Button,{id:e,name:d,className:"!justify-between",accentColor:"base",variant:"surface",type:"button",size:n,disabled:c,children:[f.jsx(v.Text,{className:"truncate",highContrast:!!m,children:m?m.label:a.placeholder??"Select one..."}),f.jsx(v.LuIcon,{icon:mn})]})}),f.jsx(v.Menu.Content,{size:n,children:f.jsx(v.Menu.Scroll,{children:f.jsx(v.Menu.SelectGroup,{required:!1,value:g??void 0,onValueChange:w,children:a.options.map((y,A)=>f.jsxs(v.Menu.SelectItem,{value:y.value,children:[f.jsx(v.Menu.SelectedIndicator,{children:f.jsx(v.LuIcon,{icon:Re})}),y.label]},`${e}-${y.value}-${A}`))})})})]})})});Pn.displayName="SelectFieldInput";const Zt=class Zt extends lr{constructor(t){const{placeholder:n,...i}=t;super(i);b(this,"type","select");b(this,"placeholder");this.placeholder=n}serialize(){return super.serialize()}getOptions(){return{...super.getOptions(),placeholder:this.placeholder}}duplicate(t){return new Zt({...this.getOptions(),identifier:t})}setOptions(t){const{placeholder:n}=t;this.placeholder=n,super.setOptions(t)}static deserialize(t){return new Zt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Pn,{field:this,...t})}isSerializedValue(t){return typeof t!="string"&&t!==null?!1:new Set([null,...this.options.map(({value:i})=>i)]).has(t)}isValue(t){return this.isSerializedValue(t)}blankValue(){return null}areValuesEqual(t,n){return t===n}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}};b(Zt,"fieldTypeName","Dropdown"),b(Zt,"fieldTypeDescription","Allows the user to select a single option from a list of options.");let ft=Zt;const Vn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u,touched:c,helpers:d},{formId:h,disabled:p}]=Oe(r),{name:g,onBlur:x,onChange:w,value:m}=u,y=i?"":s,[A,S]=_.useState(""),O=_.useMemo(()=>Array.from({length:a.length},()=>U.v4()),[a.length]);_.useEffect(()=>{S(m)},[m]);const N=_.useCallback(M=>{S(M),(c||!a.onlyValidateAfterTouched)&&d.setError(a.getError(M))},[a,d,c]),D=_.useCallback(()=>{w(A),x(A)},[A,x,w]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:y,description:l,error:o,image:i?void 0:a.image,children:f.jsxs(v.OneTimePasswordField.Root,{id:e,name:g,value:A,onValueChange:N,validationType:a.validationType,form:h,disabled:p,orientation:"horizontal",dir:"ltr",type:"text",autoComplete:"off",autoFocus:!1,autoSubmit:!1,className:"flex gap-1 h-max w-full overflow-x-auto p-0.25",accentColor:"base",variant:"surface",size:n,onBlur:D,children:[O.map(M=>f.jsx(v.OneTimePasswordField.Input,{id:M},M)),f.jsx(v.OneTimePasswordField.HiddenInput,{})]})})});Vn.displayName="OTPFieldInput";const Kt=class Kt extends Me{constructor(t){const{length:n,validationType:i,...a}=t;super(a);b(this,"type","otp");b(this,"length");b(this,"validationType");this.length=n,this.validationType=i}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new Ge({label:"Length",integers:!0,required:!1,minimum:1,maximum:16,identifier:`${n}length`}),showDirectly:!1},{field:new ft({label:"Type",required:!1,identifier:`${n}validationType`,options:[{value:"none",label:"Any"},{value:"numeric",label:"Numeric"},{value:"alpha",label:"Alpha"},{value:"alphanumeric",label:"Alphanumeric"}]}),showDirectly:!1}]}getFieldValidators(){const t=super.getFieldValidators(),n=this.length;return t.push(i=>{if(!this.isValueBlank(i)&&i.length!=n)return`Must be ${n} characters.`}),t}serialize(){return{...super.serialize(),length:this.length,validationType:this.validationType}}getOptions(){return{...super.getOptions(),length:this.length,validationType:this.validationType}}duplicate(t){return new Kt({...this.getOptions(),identifier:t})}setOptions(t){const{length:n,validationType:i,...a}=t;this.length=n??this.length,this.validationType=i??this.validationType,super.setOptions(a)}static deserialize(t){return new Kt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Vn,{field:this,...t})}isSerializedValue(t){return typeof t=="string"}isValue(t){return typeof t=="string"}blankValue(){return""}areValuesEqual(t,n){return t===n}blankSerializedValue(){return""}areSerializedValuesEqual(t,n){return t===n}};b(Kt,"fieldTypeName","OTP"),b(Kt,"fieldTypeDescription","Allows specifying a number within a given range.");let Tt=Kt;const ht={pass:{label:"Pass",icon:el},fail:{label:"Fail",icon:nl},na:{label:"N/A",icon:rl}},Dt=Object.keys(ht);class rt extends File{constructor(t,...n){super(...n);b(this,"uuid");this.uuid=t}static from(t,n){return new rt(t,[n],n.name,{lastModified:n.lastModified,type:n.type})}}class Mt extends Promise{constructor(t,n){super(t);b(this,"_uuid");this._uuid=n}get uuid(){return this._uuid}set uuid(t){this._uuid=t}static from(t,n){return new Mt((i,a)=>{Promise.resolve(t).then(i).catch(a)},n)}then(t,n){const i=super.then(t,n);return i.uuid=this.uuid,i}catch(t){const n=super.catch(t);return n.uuid=this.uuid,n}finally(t){const n=super.finally(t);return n.uuid=this.uuid,n}}function fa(r){return Array.isArray(r)?r.every(e=>e instanceof Mt||e instanceof rt):!1}function Gr(r,e){const t=new Set(r.map(({uuid:i})=>i)),n=new Set(e.map(({uuid:i})=>i));return t.size===n.size&&t.isSubsetOf(n)}const Bn=_.memo(r=>{const{ref:e,file:t,error:n,rightSlot:i,className:a,size:o,...s}=r;return f.jsxs(v.Card,{className:St.cx(a,"relative flex h-max w-full flex-col items-center p-0!"),ref:e,size:"xs",...s,children:[!t&&!n&&f.jsx("div",{className:"absolute inset-0 grow flex items-center justify-center",children:f.jsx(v.Spinner,{})}),!!t&&!n&&f.jsx("div",{className:"flex grow h-[150px] items-center justify-center overflow-hidden bg-clip-padding m-3",children:f.jsx(Ur,{className:"max-w-full object-cover",file:t})}),f.jsx(v.Separator,{size:"full"}),(!!t||!!n)&&f.jsxs("div",{className:St.cx("flex w-full items-center gap-2 self-end p-3",{"bg-transparent":!t}),children:[n?f.jsx(v.LuIcon,{color:"var(--base-11)",icon:sl}):t&&f.jsx(v.LuIcon,{color:"var(--base-11)",icon:aa}),f.jsx(v.Text,{className:"truncate",size:o,accentColor:"base",children:n??(t==null?void 0:t.name)}),i]})]})});Bn.displayName="ImageCard";const Ln=_.memo(r=>{const{file:e,onRemove:t,disabled:n,size:i}=r,[a,o]=_.useState(null),[s,l]=_.useState(null),u=Rr();_.useEffect(()=>{e instanceof Mt?e.then(x=>{o(x)}).catch(x=>{l(x instanceof Error?x.message:"Unknown error")}):o(e)},[e]);const c=_.useCallback(()=>{if(!a)return;const x=new Blob([a]);Yi.saveAs(x,a.name)},[a]),d=_.useCallback(()=>{if(!a)return;const x=URL.createObjectURL(a);window.open(x,"_blank"),URL.revokeObjectURL(x)},[a]),h=_.useCallback(()=>{a&&u(x=>({file:a,onDelete:n?void 0:()=>{t(),x()}}))},[n,t,u,a]),p=_.useMemo(()=>f.jsx("div",{className:"flex grow justify-end",children:f.jsxs(v.Menu.Root,{modal:!0,children:[f.jsx(v.Menu.ClickTrigger,{children:f.jsx(v.IconButton,{onClick:v.stopPropagation,type:"button",variant:"ghost",accentColor:"base",size:i,children:f.jsx(v.LuIcon,{icon:ia})})}),f.jsxs(v.Menu.Content,{size:i,children:[f.jsxs(v.Menu.Item,{onSelect:c,disabled:!a,children:[f.jsx(v.LuIcon,{icon:na})," Download"]}),n?null:f.jsxs(f.Fragment,{children:[f.jsx(v.Menu.Separator,{}),f.jsxs(v.Menu.Item,{onSelect:t,children:[f.jsx(v.LuIcon,{icon:dt})," Delete"]})]})]})]})}),[n,t,c,a,i]);return!!(a!=null&&a.type.startsWith("image/"))?f.jsx(Bn,{className:"cursor-pointer",onClick:h,file:a,error:s??void 0,rightSlot:p,size:i}):f.jsx(En,{className:"cursor-pointer",file:a,error:s??void 0,onClick:d,rightSlot:p,size:i})});Ln.displayName="DisplayFile";const zn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u,touched:c,helpers:d},{disabled:h}]=Oe(r),{value:p,onChange:g,onBlur:x,name:w}=u,[m,y]=_.useState(""),A=_.useRef(null),S=i?"":s,O=p.status&&a.showNotesAndFilesOn.includes(p.status),N=_.useCallback(q=>{const ue=a.cleanValue({...p,status:q});g(ue),x(ue)},[a,x,g,p]);_.useEffect(()=>{y(p.notes)},[p]);const D=_.useCallback(q=>{const ue=q.target.value;y(ue),(c||!a.onlyValidateAfterTouched)&&d.setError(a.getError({...p,notes:m}))},[a,d,m,c,p]),M=_.useCallback(()=>{const q={...p,notes:m};g(q),x(q)},[m,x,g,p]),B=_.useCallback(q=>{const ue=[...p.files];ue.splice(q,1),g({...p,files:ue})},[g,p]),L=_.useCallback(()=>{var q;(q=A.current)==null||q.click()},[]),j=_.useCallback(q=>{const ue=Array.from(q.target.files??[]).map(zr=>rt.from(U.v4(),zr)),ct={...p,files:[...p.files,...ue]};g(ct),x(ct)},[x,g,p]);_.useEffect(()=>{if(!A.current)return;const q=new AbortController;return A.current.addEventListener("cancel",()=>{x(p)},{signal:q.signal}),()=>{q.abort()}},[x,p]);const z=`${e}-status`,H=`${e}-notes`,te=`${e}-files`;return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:S,description:l,error:o,image:i?void 0:a.image,children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(v.RadioGroup.Root,{id:z,className:"flex gap-2",name:w,value:p.status,disabled:h,accentColor:"base",variant:"surface",size:n,onValueChange:N,children:Dt.map(q=>{const{label:ue}=ht[q];return f.jsxs("label",{className:"flex gap-2 items-center min-w-0",children:[f.jsx(v.RadioGroup.Item,{value:q,children:f.jsx(v.RadioGroup.Indicator,{children:f.jsx(v.LuIcon,{icon:ea,className:"fill-current"})})}),f.jsx(v.Text,{size:n,accentColor:"base",className:"truncate",children:ue})]},`${e}-${q}`)})}),O&&f.jsxs(f.Fragment,{children:[f.jsx("div",{children:f.jsx(v.TextArea,{id:H,value:m,name:w,onChange:D,onBlur:M,className:"field-sizing-content w-full min-h-12",placeholder:"Notes",resize:"vertical",accentColor:"base",variant:"surface",size:n,disabled:h})}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs(v.Button,{className:"w-max",size:n,variant:"soft",accentColor:"base",onClick:L,type:"button",disabled:h,children:[f.jsx(v.LuIcon,{icon:An}),"Select files"]}),f.jsx("input",{id:te,name:w,type:"file",ref:A,multiple:!0,className:"hidden",onChange:j,value:""}),p.files.length>0&&f.jsx("div",{className:"flex h-max flex-wrap gap-2",children:p.files.map((q,ue)=>f.jsx(Ln,{size:n,file:q,onRemove:()=>{B(ue)},disabled:h},ue))})]})]})]})})});zn.displayName="PassFailFieldInput";const kn=r=>typeof r=="string"&&Dt.includes(r),ha=r=>!(r===null||typeof r!="object"||!("status"in r)||!kn(r.status)||!("notes"in r)||typeof r.notes!="string"||!("files"in r)||!(Array.isArray(r.files)&&r.files.length===0)),pa=r=>!(r===null||typeof r!="object"||!("status"in r)||!kn(r.status)||!("notes"in r)||typeof r.notes!="string"||!("files"in r)||!fa(r.files)),va=r=>({status:r.status,notes:r.notes,files:[]}),ga=r=>({status:r.status,notes:r.notes,files:[]}),xa=(r,e)=>!(r.status!==e.status||r.notes!==e.notes||!Gr(r.files,e.files)),ya=(r,e)=>!(r.status!==e.status||r.notes!==e.notes||r.files.length!==e.files.length),Qt=class Qt extends Me{constructor(t){const{showNotesAndFilesOn:n,...i}=t;super(i);b(this,"type","pass-fail");b(this,"onlyValidateAfterTouched",!1);b(this,"showNotesAndFilesOn");this.showNotesAndFilesOn=n}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new tt({identifier:`${n}showNotesAndFilesOn`,label:"Show notes and files on",description:"Show the notes and files on desired statuses.",options:Dt.map(i=>{const{label:a}=ht[i];return{value:i,label:a}}),required:!1}),showDirectly:!1}]}serialize(){return{...super.serialize(),showNotesAndFilesOn:this.showNotesAndFilesOn}}getOptions(){return{...super.getOptions(),showNotesAndFilesOn:this.showNotesAndFilesOn}}duplicate(t){return new Qt({...this.getOptions(),identifier:t})}setOptions(t){const{showNotesAndFilesOn:n,...i}=t;this.showNotesAndFilesOn=n??this.showNotesAndFilesOn,super.setOptions(i)}getFieldValidators(){const t=super.getFieldValidators(),n=this.showNotesAndFilesOn,i=this.blankValue();return n.length>0&&(t.push(a=>{if(!(!a.status||!n.includes(a.status))&&i.notes===a.notes)return"Notes is required."}),t.push(a=>{if(!(!a.status||!n.includes(a.status))&&Gr(i.files,a.files))return"Files is required."})),t}static deserialize(t){return new Qt({...t,showNotesAndFilesOn:t.showNotesAndFilesOn??!1})}serializeValue(t){return va(t)}deserializeValue(t){return ga(t)}render(t){return f.jsx(zn,{field:this,...t})}isSerializedValue(t){return ha(t)}isValue(t){return pa(t)}areValuesEqual(t,n){return xa(t,n)}blankValue(){return{status:null,notes:"",files:[]}}cleanValue(t){return t.status&&this.showNotesAndFilesOn.includes(t.status)?t:{status:t.status,notes:"",files:[]}}cleanSerializedValue(t){return super.cleanSerializedValue(t)}blankSerializedValue(){return{status:null,notes:"",files:[]}}areSerializedValuesEqual(t,n){return ya(t,n)}};b(Qt,"fieldTypeName","Pass - Fail"),b(Qt,"fieldTypeDescription","Track pass, fail, or N/A outcome.");let Ft=Qt;const Rn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{name:d,onChange:h,onBlur:p,value:g}=u,x=i?"":s,w=_.useCallback(y=>{h(y),p(y)},[p,h]),m=_.useCallback(()=>{h(null),p(null)},[p,h]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:l,error:o,image:i?void 0:a.image,children:f.jsxs(v.RadioGroup.Root,{id:e,name:d,className:"flex flex-col gap-1",accentColor:"base",variant:"surface",size:n,value:g??"",onValueChange:w,disabled:c,children:[a.options.map((y,A)=>f.jsxs("label",{className:"flex gap-2 items-center min-w-0",children:[f.jsx(v.RadioGroup.Item,{value:y.value,children:f.jsx(v.RadioGroup.Indicator,{children:f.jsx(v.LuIcon,{icon:ea,className:"fill-current"})})}),f.jsx(v.Text,{size:n,accentColor:"base",className:"truncate",children:y.label})]},`${e}-${y.value}-${A}`)),!!g&&f.jsxs(v.Button,{onClick:m,className:"w-max -mx-2",type:"button",variant:"ghost",accentColor:"base",size:n,children:[f.jsx(v.LuIcon,{icon:et}),"Clear"]})]})})});Rn.displayName="RadioFieldInput";const Jt=class Jt extends lr{constructor(t){super(t);b(this,"type","radio");b(this,"onlyValidateAfterTouched",!1)}serialize(){return super.serialize()}getOptions(){return super.getOptions()}duplicate(t){return new Jt({...this.getOptions(),identifier:t})}setOptions(t){super.setOptions(t)}static deserialize(t){return new Jt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Rn,{field:this,...t})}isSerializedValue(t){return typeof t!="string"&&t!==null?!1:new Set([null,...this.options.map(({value:i})=>i)]).has(t)}isValue(t){return this.isSerializedValue(t)}blankValue(){return null}areValuesEqual(t,n){return t===n}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}};b(Jt,"fieldTypeName","Option list"),b(Jt,"fieldTypeDescription","Allows the user to select a single option from a list of options.");let Pt=Jt;const Un=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,label:o,description:s,error:l,fieldProps:u},{disabled:c}]=Oe(r),{name:d,onChange:h,onBlur:p,value:g}=u,x=i?"":o,w=_.useCallback(A=>{h(A),p(A)},[p,h]),m=_.useCallback(()=>{h(null),p(null)},[p,h]),y=Array.from({length:a.maxRating},(A,S)=>S+1);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:s,error:l,image:i?void 0:a.image,children:f.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[f.jsx(v.Rating.Root,{id:e,name:d,className:"flex items-center gap-0.5",value:g,onValueChange:w,disabled:c,children:y.map(A=>f.jsx(v.Rating.Item,{value:A,className:"group size-5 flex cursor-pointer disabled:opacity-50 disabled:pointer-events-none items-center justify-center text-yellow-500 transition-colors",children:f.jsx(v.LuIcon,{icon:la,className:"group-data-[active=true]:fill-current size-full"})},`${e}-${A}`))}),!c&&g!==null&&f.jsx(v.IconButton,{onClick:m,type:"button",variant:"ghost",accentColor:"base",size:n,children:f.jsx(v.LuIcon,{icon:et})})]})})});Un.displayName="RatingFieldInput";const er=class er extends Me{constructor(t){const{maxRating:n,...i}=t;super(i);b(this,"type","rating");b(this,"maxRating");this.maxRating=n}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new Ge({label:"Max Rating",description:"Maximum rating value",integers:!0,required:!1,minimum:1,maximum:10,identifier:`${n}maxRating`}),showDirectly:!1}]}getFieldValidators(){const t=super.getFieldValidators(),n=this.maxRating;return t.push(i=>{if(typeof i=="number"&&(i<1||i>n))return`Rating must be between 1 and ${n}.`}),t}serialize(){return{...super.serialize(),maxRating:this.maxRating}}getOptions(){return{...super.getOptions(),maxRating:this.maxRating}}duplicate(t){return new er({...this.getOptions(),identifier:t})}setOptions(t){const{maxRating:n,...i}=t;this.maxRating=n??this.maxRating,super.setOptions(i)}static deserialize(t){return new er(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Un,{field:this,...t})}isSerializedValue(t){return this.isValue(t)}isValue(t){return typeof t=="number"&&!isNaN(t)||t===null}areValuesEqual(t,n){return t===n}blankValue(){return null}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}};b(er,"fieldTypeName","Rating"),b(er,"fieldTypeDescription","Allows users to select a rating value.");let Vt=er;const Ca=_.createContext(()=>{throw new Error("No ScannerProvider found")}),Al=()=>_.use(Ca);function El(r,e){var t=Object.setPrototypeOf;t?t(r,e):r.__proto__=e}function Sl(r,e){e===void 0&&(e=r.constructor);var t=Error.captureStackTrace;t&&t(r,e)}var Il=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Ol=function(r){Il(e,r);function e(t,n){var i=this.constructor,a=r.call(this,t,n)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),El(a,i.prototype),Sl(a),a}return e}(Error),bl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Le=function(r){bl(e,r);function e(t){t===void 0&&(t=void 0);var n=r.call(this,t)||this;return n.message=t,n}return e.prototype.getKind=function(){var t=this.constructor;return t.kind},e.kind="Exception",e}(Ol),Nl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),We=function(r){Nl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ArgumentException",e}(Le),Tl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),R=function(r){Tl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IllegalArgumentException",e}(Le),Dl=function(){function r(e){if(this.binarizer=e,e===null)throw new R("Binarizer must be non-null.")}return r.prototype.getWidth=function(){return this.binarizer.getWidth()},r.prototype.getHeight=function(){return this.binarizer.getHeight()},r.prototype.getBlackRow=function(e,t){return this.binarizer.getBlackRow(e,t)},r.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},r.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},r.prototype.crop=function(e,t,n,i){var a=this.binarizer.getLuminanceSource().crop(e,t,n,i);return new r(this.binarizer.createBinarizer(a))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(e))},r.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(e))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r}(),Ml=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ye=function(r){Ml(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}(Le),Fl=function(){function r(e){this.source=e}return r.prototype.getLuminanceSource=function(){return this.source},r.prototype.getWidth=function(){return this.source.getWidth()},r.prototype.getHeight=function(){return this.source.getHeight()},r}(),ae=function(){function r(){}return r.arraycopy=function(e,t,n,i,a){for(;a--;)n[i++]=e[t++]},r.currentTimeMillis=function(){return Date.now()},r}(),Pl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Gn=function(r){Pl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IndexOutOfBoundsException",e}(Le),Vl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),wa=function(r){Vl(e,r);function e(t,n){t===void 0&&(t=void 0),n===void 0&&(n=void 0);var i=r.call(this,n)||this;return i.index=t,i.message=n,i}return e.kind="ArrayIndexOutOfBoundsException",e}(Gn),Bl=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fe=function(){function r(){}return r.fill=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n]=t},r.fillWithin=function(e,t,n,i){r.rangeCheck(e.length,t,n);for(var a=t;a<n;a++)e[a]=i},r.rangeCheck=function(e,t,n){if(t>n)throw new R("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new wa(t);if(n>e)throw new wa(n)},r.asList=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},r.create=function(e,t,n){var i=Array.from({length:e});return i.map(function(a){return Array.from({length:t}).fill(n)})},r.createInt32Array=function(e,t,n){var i=Array.from({length:e});return i.map(function(a){return Int32Array.from({length:t}).fill(n)})},r.equals=function(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0},r.hashCode=function(e){var t,n;if(e===null)return 0;var i=1;try{for(var a=Bl(e),o=a.next();!o.done;o=a.next()){var s=o.value;i=31*i+s}}catch(l){t={error:l}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},r.fillUint8Array=function(e,t){for(var n=0;n!==e.length;n++)e[n]=t},r.copyOf=function(e,t){return e.slice(0,t)},r.copyOfUint8Array=function(e,t){if(e.length<=t){var n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)},r.copyOfRange=function(e,t,n){var i=n-t,a=new Int32Array(i);return ae.arraycopy(e,t,a,0,i),a},r.binarySearch=function(e,t,n){n===void 0&&(n=r.numberComparator);for(var i=0,a=e.length-1;i<=a;){var o=a+i>>1,s=n(t,e[o]);if(s>0)i=o+1;else if(s<0)a=o-1;else return o}return-i-1},r.numberComparator=function(e,t){return e-t},r}(),$=function(){function r(){}return r.numberOfTrailingZeros=function(e){var t;if(e===0)return 32;var n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)},r.numberOfLeadingZeros=function(e){if(e===0)return 32;var t=1;return e>>>16||(t+=16,e<<=16),e>>>24||(t+=8,e<<=8),e>>>28||(t+=4,e<<=4),e>>>30||(t+=2,e<<=2),t-=e>>>31,t},r.toHexString=function(e){return e.toString(16)},r.toBinaryString=function(e){return String(parseInt(String(e),2))},r.bitCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63},r.truncDivision=function(e,t){return Math.trunc(e/t)},r.parseInt=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),Ce=function(){function r(e,t){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,t==null?this.bits=r.makeArray(e):this.bits=t)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(e){if(e>this.bits.length*32){var t=r.makeArray(e);ae.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}},r.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0},r.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},r.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},r.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,i=Math.floor(e/32),a=n[i];a&=~((1<<(e&31))-1);for(var o=n.length;a===0;){if(++i===o)return t;a=n[i]}var s=i*32+$.numberOfTrailingZeros(a);return s>t?t:s},r.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,i=Math.floor(e/32),a=~n[i];a&=~((1<<(e&31))-1);for(var o=n.length;a===0;){if(++i===o)return t;a=~n[i]}var s=i*32+$.numberOfTrailingZeros(a);return s>t?t:s},r.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},r.prototype.setRange=function(e,t){if(t<e||e<0||t>this.size)throw new R;if(t!==e){t--;for(var n=Math.floor(e/32),i=Math.floor(t/32),a=this.bits,o=n;o<=i;o++){var s=o>n?0:e&31,l=o<i?31:t&31,u=(2<<l)-(1<<s);a[o]|=u}}},r.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,n=0;n<e;n++)t[n]=0},r.prototype.isRange=function(e,t,n){if(t<e||e<0||t>this.size)throw new R;if(t===e)return!0;t--;for(var i=Math.floor(e/32),a=Math.floor(t/32),o=this.bits,s=i;s<=a;s++){var l=s>i?0:e&31,u=s<a?31:t&31,c=(2<<u)-(1<<l)&4294967295;if((o[s]&c)!==(n?c:0))return!1}return!0},r.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(e,t){if(t<0||t>32)throw new R("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(var n=t;n>0;n--)this.appendBit((e>>n-1&1)===1)},r.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var n=0;n<t;n++)this.appendBit(e.get(n))},r.prototype.xor=function(e){if(this.size!==e.size)throw new R("Sizes don't match");for(var t=this.bits,n=0,i=t.length;n<i;n++)t[n]^=e.bits[n]},r.prototype.toBytes=function(e,t,n,i){for(var a=0;a<i;a++){for(var o=0,s=0;s<8;s++)this.get(e)&&(o|=1<<7-s),e++;t[n+a]=o}},r.prototype.getBitArray=function(){return this.bits},r.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,i=this.bits,a=0;a<n;a++){var o=i[a];o=o>>1&1431655765|(o&1431655765)<<1,o=o>>2&858993459|(o&858993459)<<2,o=o>>4&252645135|(o&252645135)<<4,o=o>>8&16711935|(o&16711935)<<8,o=o>>16&65535|(o&65535)<<16,e[t-a]=o}if(this.size!==n*32){for(var s=n*32-this.size,l=e[0]>>>s,a=1;a<n;a++){var u=e[a];l|=u<<32-s,e[a-1]=l,l=u>>>s}e[n-1]=l}this.bits=e},r.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.size===t.size&&fe.equals(this.bits,t.bits)},r.prototype.hashCode=function(){return 31*this.size+fe.hashCode(this.bits)},r.prototype.toString=function(){for(var e="",t=0,n=this.size;t<n;t++)(t&7)===0&&(e+=" "),e+=this.get(t)?"X":".";return e},r.prototype.clone=function(){return new r(this.size,this.bits.slice())},r.prototype.toArray=function(){for(var e=[],t=0,n=this.size;t<n;t++)e.push(this.get(t));return e},r}(),Hn;(function(r){r[r.OTHER=0]="OTHER",r[r.PURE_BARCODE=1]="PURE_BARCODE",r[r.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",r[r.TRY_HARDER=3]="TRY_HARDER",r[r.CHARACTER_SET=4]="CHARACTER_SET",r[r.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",r[r.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",r[r.ASSUME_GS1=7]="ASSUME_GS1",r[r.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",r[r.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",r[r.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(Hn||(Hn={}));const le=Hn;var Ll=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),F=function(r){Ll(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getFormatInstance=function(){return new e},e.kind="FormatException",e}(Le),zl=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},re;(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(re||(re={}));var he=function(){function r(e,t,n){for(var i,a,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];this.valueIdentifier=e,this.name=n,typeof t=="number"?this.values=Int32Array.from([t]):this.values=t,this.otherEncodingNames=o,r.VALUE_IDENTIFIER_TO_ECI.set(e,this),r.NAME_TO_ECI.set(n,this);for(var l=this.values,u=0,c=l.length;u!==c;u++){var d=l[u];r.VALUES_TO_ECI.set(d,this)}try{for(var h=zl(o),p=h.next();!p.done;p=h.next()){var g=p.value;r.NAME_TO_ECI.set(g,this)}}catch(x){i={error:x}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}}return r.prototype.getValueIdentifier=function(){return this.valueIdentifier},r.prototype.getName=function(){return this.name},r.prototype.getValue=function(){return this.values[0]},r.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new F("incorect value");var t=r.VALUES_TO_ECI.get(e);if(t===void 0)throw new F("incorect value");return t},r.getCharacterSetECIByName=function(e){var t=r.NAME_TO_ECI.get(e);if(t===void 0)throw new F("incorect value");return t},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.getName()===t.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(re.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(re.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(re.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(re.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(re.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(re.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(re.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(re.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(re.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(re.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(re.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(re.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(re.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(re.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(re.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(re.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(re.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(re.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(re.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(re.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(re.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(re.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(re.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(re.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(re.Big5,28,"Big5"),r.GB18030=new r(re.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(re.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),kl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Hr=function(r){kl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="UnsupportedOperationException",e}(Le),He=function(){function r(){}return r.decode=function(e,t){var n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)},r.shouldDecodeOnFallback=function(e){return!r.isBrowser()&&e==="ISO-8859-1"},r.encode=function(e,t){var n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(e){return typeof e=="string"?e:e.getName()},r.encodingCharacterSet=function(e){return e instanceof he?e:he.getCharacterSetECIByName(e)},r.decodeFallback=function(e,t){var n=this.encodingCharacterSet(t);if(r.isDecodeFallbackSupported(n)){for(var i="",a=0,o=e.length;a<o;a++){var s=e[a].toString(16);s.length<2&&(s="0"+s),i+="%"+s}return decodeURIComponent(i)}if(n.equals(he.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new Hr("Encoding "+this.encodingName(t)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(e){return e.equals(he.UTF8)||e.equals(he.ISO8859_1)||e.equals(he.ASCII)},r.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))),n=t.split(""),i=[],a=0;a<n.length;a++)i.push(n[a].charCodeAt(0));return new Uint8Array(i)},r}(),Y=function(){function r(){}return r.castAsNonUtf8Char=function(e,t){t===void 0&&(t=null);var n=t?t.getName():this.ISO88591;return He.decode(new Uint8Array([e]),n)},r.guessEncoding=function(e,t){if(t!=null&&t.get(le.CHARACTER_SET)!==void 0)return t.get(le.CHARACTER_SET).toString();for(var n=e.length,i=!0,a=!0,o=!0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,g=0,x=0,w=0,m=0,y=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,A=0;A<n&&(i||a||o);A++){var S=e[A]&255;o&&(s>0?(S&128)===0?o=!1:s--:(S&128)!==0&&((S&64)===0?o=!1:(s++,(S&32)===0?l++:(s++,(S&16)===0?u++:(s++,(S&8)===0?c++:o=!1))))),i&&(S>127&&S<160?i=!1:S>159&&(S<192||S===215||S===247)&&m++),a&&(d>0?S<64||S===127||S>252?a=!1:d--:S===128||S===160||S>239?a=!1:S>160&&S<224?(h++,g=0,p++,p>x&&(x=p)):S>127?(d++,p=0,g++,g>w&&(w=g)):(p=0,g=0))}return o&&s>0&&(o=!1),a&&d>0&&(a=!1),o&&(y||l+u+c>0)?r.UTF8:a&&(r.ASSUME_SHIFT_JIS||x>=3||w>=3)?r.SHIFT_JIS:i&&a?x===2&&h===2||m*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:a?r.SHIFT_JIS:o?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=-1;function a(s,l,u,c,d,h){if(s==="%%")return"%";if(t[++i]!==void 0){s=c?parseInt(c.substr(1)):void 0;var p=d?parseInt(d.substr(1)):void 0,g;switch(h){case"s":g=t[i];break;case"c":g=t[i][0];break;case"f":g=parseFloat(t[i]).toFixed(s);break;case"p":g=parseFloat(t[i]).toPrecision(s);break;case"e":g=parseFloat(t[i]).toExponential(s);break;case"x":g=parseInt(t[i]).toString(p||16);break;case"d":g=parseFloat(parseInt(t[i],p||10).toPrecision(s)).toFixed(0);break}g=typeof g=="object"?JSON.stringify(g):(+g).toString(p);for(var x=parseInt(u),w=u&&u[0]+""=="0"?"0":" ";g.length<x;)g=l!==void 0?g+w:w+g;return g}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(o,a)},r.getBytes=function(e,t){return He.encode(e,t)},r.getCharCode=function(e,t){return t===void 0&&(t=0),e.charCodeAt(t)},r.getCharAt=function(e){return String.fromCharCode(e)},r.SHIFT_JIS=he.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=he.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=he.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r}(),X=function(){function r(e){e===void 0&&(e=""),this.value=e}return r.prototype.enableDecoding=function(e){return this.encoding=e,this},r.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=Y.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},r.prototype.appendChars=function(e,t,n){for(var i=t;t<t+n;i++)this.append(e[i]);return this},r.prototype.length=function(){return this.value.length},r.prototype.charAt=function(e){return this.value.charAt(e)},r.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},r.prototype.setCharAt=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)},r.prototype.substring=function(e,t){return this.value.substring(e,t)},r.prototype.setLengthToZero=function(){this.value=""},r.prototype.toString=function(){return this.value},r.prototype.insert=function(e,t){this.value=this.value.substring(0,e)+t+this.value.substring(e)},r}(),Ke=function(){function r(e,t,n,i){if(this.width=e,this.height=t,this.rowSize=n,this.bits=i,t==null&&(t=e),this.height=t,e<1||t<1)throw new R("Both dimensions must be greater than 0");n==null&&(n=Math.floor((e+31)/32)),this.rowSize=n,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(e){for(var t=e.length,n=e[0].length,i=new r(n,t),a=0;a<t;a++)for(var o=e[a],s=0;s<n;s++)o[s]&&i.set(s,a);return i},r.parseFromString=function(e,t,n){if(e===null)throw new R("stringRepresentation cannot be null");for(var i=new Array(e.length),a=0,o=0,s=-1,l=0,u=0;u<e.length;)if(e.charAt(u)===`
|
|
236
|
+
*/const et=G("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),En=_.memo(r=>{const{ref:e,file:t,className:n,error:i,rightSlot:a,size:o,...s}=r;return f.jsxs(v.Card,{className:St.cx(n,"flex w-full items-center gap-2"),ref:e,size:"xs",...s,children:[i?f.jsx(v.LuIcon,{icon:ol,color:"var(--base-a11)"}):f.jsx(v.LuIcon,{icon:aa,color:"var(--base-a11)"}),i?f.jsx(v.Text,{accentColor:"danger",className:"truncate",size:o,children:i}):t?f.jsx(v.Text,{className:"truncate",accentColor:"base",size:o,children:t.name}):f.jsx("div",{className:"flex w-full justify-center",children:f.jsx(v.Spinner,{})}),a]})});En.displayName="FileCard";function ar(r){return Array.isArray(r)?r.every(e=>typeof e=="string"):!1}class or{constructor(){b(this,"observers",new Set)}notify(e){for(const t of this.observers)t(e)}observe(e){return this.observers.add(e),()=>{this.observers.delete(e)}}}class Sn extends or{constructor(t){const{identifier:n}=t;super();b(this,"identifier");this.identifier=n}getOptions(){return{identifier:this.identifier}}setOptions(t){this.identifier=t.identifier??this.identifier,this.notify(this)}serialize(){return{type:this.type,identifier:this.identifier}}}class Me extends Sn{constructor(t){const{label:n,description:i=null,required:a,image:o,...s}=t;super(s);b(this,"label");b(this,"description");b(this,"required");b(this,"image");b(this,"onlyValidateAfterTouched",!0);this.label=n,this.description=i,this.required=a,this.image=o}getError(t){if(this.required&&this.isValueBlank(t))return"This field is required.";for(const n of this.getFieldValidators()){const i=n(t);if(i)return i}}serialize(){return{...super.serialize(),label:this.label,description:this.description,required:this.required,image:this.image}}getOptions(){return{...super.getOptions(),label:this.label,description:this.description,required:this.required,image:this.image}}setOptions(t){const{label:n,description:i=null,required:a,image:o,...s}=t;this.label=n??this.label,this.description=i??this.description,this.required=a??this.required,this.image=o??this.image,super.setOptions(s)}isValueBlank(t){return this.areValuesEqual(t,this.blankValue())}cleanValue(t){return t}isValueClean(t){return this.areValuesEqual(t,this.cleanValue(t))}cleanSerializedValue(t){return t}isSerializedValueClean(t){return this.areSerializedValuesEqual(t,this.cleanSerializedValue(t))}isSerializedValueBlank(t){return this.areSerializedValuesEqual(t,this.blankSerializedValue())}getFieldValidators(){return[]}}b(Me,"fieldTypeName"),b(Me,"fieldTypeDescription");const ua=_.createContext(()=>{throw new Error("No ImageViewerProvider found")}),Rr=()=>_.useContext(ua),ca=r=>{const[e,t]=_.useState(null);return _.useEffect(()=>{const n=URL.createObjectURL(r);return t(n),()=>{URL.revokeObjectURL(n)}},[r]),e},Ur=_.memo(r=>{const{file:e,...t}=r,n=ca(e);return n?f.jsx("img",{src:n,alt:e.name,...t}):null});Ur.displayName="ImageFile";const In=_.memo(r=>{const{file:e,onClose:t}=r,n=_.useCallback(()=>{Yi.saveAs(e,e.name)},[e]);return f.jsx(v.Overlay.Root,{open:!0,onOpenChange:t,children:f.jsxs(v.Overlay.Content,{onOpenAutoFocus:i=>i.preventDefault(),children:[f.jsxs(v.ButtonGroup,{className:"flex gap-2 items-center top-0 absolute right-0 p-2",accentColor:"base",variant:"ghost",children:[f.jsxs(v.Tooltip.Root,{children:[f.jsx(v.Tooltip.Trigger,{asChild:!0,children:f.jsx(v.IconButton,{onClick:n,"aria-label":"download",children:f.jsx(v.LuIcon,{icon:na})})}),f.jsx(v.Tooltip.Content,{size:"sm",children:"Download"})]}),f.jsx(v.Separator,{orientation:"vertical",size:"sm"}),f.jsx(v.Overlay.Close,{asChild:!0,children:f.jsx(v.IconButton,{onClick:t,"aria-label":"close",children:f.jsx(v.LuIcon,{icon:et})})})]}),f.jsx("figure",{className:"size-full overflow-hidden p-4 flex justify-center items-center",children:f.jsx(Ur,{className:"max-w-full max-h-full",file:e})})]})})});In.displayName="ImageViewer";const da=_.memo(r=>{const{children:e}=r,[t,n]=_.useState(null),i=_.useCallback(()=>{n(null)},[]),a=_.useCallback(s=>{n(s(i))},[i]),o=_.useCallback(()=>{t&&(t.onClose&&t.onClose(),i())},[i,t]);return f.jsxs(ua.Provider,{value:a,children:[e,t&&f.jsx(In,{file:t.file,onClose:o})]})});da.displayName="FileViewerProvider";const Ie=_.memo(r=>{const{className:e,label:t,error:n,description:i,children:a,inputId:o,labelId:s,image:l,size:u}=r,[c,d]=_.useState(void 0),h=Rr();_.useEffect(()=>{l instanceof Promise?l.then(d).catch(console.error):d(l)},[l]);const p=c?URL.createObjectURL(c):void 0,g=_.useCallback(()=>{c&&h(()=>({file:c}))},[h,c]);return f.jsxs("div",{className:"flex flex-col gap-1",children:[c&&f.jsx("img",{className:"h-[100px] w-full min-w-[300px] cursor-pointer rounded-md object-cover",src:p,alt:c.name,onClick:g}),(!!t||!!i)&&f.jsxs("div",{className:"flex flex-col",children:[f.jsx("label",{className:St.cx(e,"w-max max-w-full"),htmlFor:o,children:f.jsx(v.Text,{size:u,id:s,className:"text-wrap",children:t})}),!!i&&f.jsx(v.Text,{accentColor:"base",size:u,children:i})]}),a,!!n&&f.jsx(v.Text,{accentColor:"danger",size:u,children:n})]})}),_l=St.cva(["flex","flex-col"],{variants:{size:{xs:["gap-2"],sm:["gap-4"],md:["gap-6"],lg:["gap-8"],xl:["gap-10"]}}}),sr=(r,e)=>{const{size:t}=e;return f.jsx("div",{className:_l({size:t}),children:r.map((n,i)=>f.jsx(_.Fragment,{children:n.render({index:i,...e})},n.identifier))})},Oe=r=>{const{field:e,size:t,showInputOnly:n,onValuesChange:i,...a}=r,[o,s,l]=Je.useField(e.identifier),{touched:u}=s,c=s.error??"",d=e.identifier,h=`${d}-label`,p=e.required?`${e.label} *`:e.label,g=e.description??"",x=_.useMemo(()=>({...o,onChange:y=>{l.setValue(y,!1),i==null||i(e.identifier,y),(u||!e.onlyValidateAfterTouched)&&l.setError(e.getError(y))},onBlur:y=>{l.setTouched(!0,!1),l.setError(e.getError(y))}}),[e,o,l,i,u]);return[{error:c,size:t,inputId:d,labelId:h,label:p,description:g,showInputOnly:n,fieldProps:x,helpers:l,field:e,touched:u},{...a,"aria-labelledby":h}]},On=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),d=i?"":s,{value:h,name:p,onChange:g,onBlur:x}=u,w=`${e}-droppable`,[m,y]=_.useState(""),[A,S]=_.useState(""),O=_.useCallback(z=>{g(z),x(z)},[g,x]),N=_.useCallback(z=>{h&&h.findIndex(H=>H===z.target.value.trim())>=0?S("All options must be unique"):z.target.value?S(""):S("Option cannot be empty"),y(z.target.value)},[y,h]),D=_.useCallback(()=>{if(A)return;if(!m.trim()){S("Option cannot be empty");return}const z=m.trim();O([...h,z]),y("")},[m,A,O,h]),M=_.useCallback(z=>{z.key==="Enter"&&(z.preventDefault(),D())},[D]),B=_.useCallback(z=>{const H=Array.from(h);H.splice(z,1),O(H)},[h,O]),L=_.useCallback(z=>{if(!z.destination)return;const H=z.source.index,te=z.destination.index,q=Array.from(h),[ue]=q.splice(H,1);q.splice(te,0,ue),O(q)},[O,h]),j=_.useCallback(()=>{x(h)},[x,h]);return f.jsx(Cn.DragDropContext,{onDragEnd:L,children:f.jsxs(Ie,{size:n,inputId:e,labelId:t,label:d,description:l,error:A||o,image:i?void 0:a.image,children:[(!c||h.length===0)&&f.jsxs("div",{className:"flex gap-2",children:[f.jsx(v.Input.Root,{className:"grow",accentColor:"base",variant:"surface",size:n,children:f.jsx(v.Input.Field,{value:m,onChange:N,onKeyDown:M,id:e,placeholder:a.placeholder,onBlur:j,name:p,disabled:c})}),f.jsx(v.IconButton,{size:n,accentColor:"base",variant:"soft",type:"button","aria-label":"Add option",disabled:!!A||c,onClick:D,children:f.jsx(v.LuIcon,{icon:$e})})]}),h.length!==0&&f.jsx(Cn.Droppable,{droppableId:w,children:z=>f.jsxs("div",{className:"flex flex-col gap-1",...z.droppableProps,ref:z.innerRef,children:[h.map((H,te)=>f.jsx(Cn.Draggable,{draggableId:`${H}-draggable`,index:te,isDragDisabled:c,children:({draggableProps:q,dragHandleProps:ue,innerRef:ct})=>f.jsxs(v.Badge,{...ue,...q,ref:ct,className:"flex items-center justify-between gap-2",accentColor:"base",size:n,variant:"soft",children:[f.jsx(v.Text,{className:"truncate",highContrast:!0,children:typeof H=="object"&&"label"in H?H.label:H}),f.jsx(v.IconButton,{className:"bg-transparent!",size:n,variant:"ghost",type:"button","aria-label":"Delete option",accentColor:"base",disabled:c,onClick:()=>{B(te)},children:f.jsx(v.LuIcon,{icon:et})})]})},`${e}-${H}-${te}`)),z.placeholder]})})]})})});On.displayName="MultiStringFieldInput";const Xt=class Xt extends Me{constructor(t){const{minimum_length:n,maximum_length:i,placeholder:a,...o}=t;super(o);b(this,"type","multi-string");b(this,"minLength");b(this,"maxLength");b(this,"placeholder");b(this,"onlyValidateAfterTouched",!1);this.minLength=n??0,this.maxLength=i??1/0,this.placeholder=a??"Press enter to add a new option"}render(t){return f.jsx(On,{field:this,...t})}serialize(){return{...super.serialize(),minimum_length:this.minLength,maximum_length:this.maxLength,placeholder:this.placeholder}}getOptions(){return{...super.getOptions(),minimum_length:this.minLength,maximum_length:this.maxLength,placeholder:this.placeholder}}duplicate(t){return new Xt({...this.getOptions(),identifier:t})}setOptions(t){const{minimum_length:n,maximum_length:i,placeholder:a,...o}=t;this.minLength=n??this.minLength,this.maxLength=i??this.maxLength,this.placeholder=a??this.placeholder,super.setOptions(o)}serializeValue(t){return t}deserializeValue(t){return t}getFieldValidators(){const t=super.getFieldValidators();return t.push(n=>{if(Array.isArray(n)&&n.length<this.minLength)return`Must have at least ${this.minLength} options.`}),t.push(n=>{if(Array.isArray(n)&&n.length>this.maxLength)return`Must have at most ${this.maxLength} options.`}),t}static deserialize(t){return new Xt(t)}isSerializedValue(t){return ar(t)}isValue(t){return ar(t)}blankValue(){return[]}areValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}blankSerializedValue(){return[]}areSerializedValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}};b(Xt,"fieldTypeName","Multi-string"),b(Xt,"fieldTypeDescription","Allows the user to provide multiple unique strings.");let It=Xt;class lr extends Me{constructor(t){const{options:n,...i}=t;super(i);b(this,"options");b(this,"onlyValidateAfterTouched",!1);this.options=n.map(a=>(typeof a=="string"&&(a={label:a,value:a}),a))}serialize(){return{...super.serialize(),options:this.options}}getOptions(){return{...super.getOptions(),options:this.options}}setOptions(t){const{options:n,...i}=t;this.options=(n==null?void 0:n.map(a=>(typeof a=="string"&&(a={label:a,value:a}),a)))??this.options,super.setOptions(i)}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new It({label:"Options",description:"List possible options for the user to select from.",required:!0,identifier:`${n}options`,minimum_length:2}),showDirectly:!0}]}}const bn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{name:d,onBlur:h,onChange:p,value:g}=u,x=i?"":s,w=_.useCallback(y=>{p(!!y),h(!!y)},[h,p]),m=_.useCallback(()=>{h(g)},[h,g]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:l,error:o,image:i?void 0:a.image,children:f.jsx(v.Checkbox.Root,{id:e,name:d,checked:g??!1,onCheckedChange:w,onBlur:m,size:n,accentColor:"base",variant:"surface",disabled:c,children:f.jsx(v.Checkbox.Indicator,{children:f.jsx(v.LuIcon,{icon:Re})})})})});bn.displayName="BooleanFieldInput";const $t=class $t extends Me{constructor(t){super(t);b(this,"type","boolean");b(this,"onlyValidateAfterTouched",!1)}serialize(){return super.serialize()}getOptions(){return super.getOptions()}setOptions(t){super.setOptions(t)}duplicate(t){return new $t({...this.getOptions(),identifier:t})}static deserialize(t){return new $t(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(bn,{...t,field:this})}isSerializedValue(t){return typeof t=="boolean"}isValue(t){return typeof t=="boolean"}blankValue(){return!1}blankSerializedValue(){return!1}areSerializedValuesEqual(t,n){return t===n}areValuesEqual(t,n){return t===n}};b($t,"fieldTypeName","Checkbox"),b($t,"fieldTypeDescription","Perfect for both optional and required yes/no questions.");let Ot=$t;const Nn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u,touched:c,helpers:d},{disabled:h}]=Oe(r),{name:p,onBlur:g,onChange:x,value:w}=u,m=i?"":s,[y,A]=_.useState(null);_.useEffect(()=>{A(w)},[w]);const S=_.useCallback(D=>{const M=D.target.valueAsNumber,B=isNaN(M)?null:M;A(B),(c||!a.onlyValidateAfterTouched)&&d.setError(a.getError(B))},[a,d,c]),O=_.useCallback(D=>{D.key==="Enter"&&D.preventDefault()},[]),N=_.useCallback(()=>{x(y),g(y)},[y,g,x]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:m,description:l,error:o,image:i?void 0:a.image,children:f.jsx(v.Input.Root,{accentColor:"base",variant:"surface",size:n,children:f.jsx(v.Input.Field,{id:e,name:p,onChange:S,onBlur:N,value:y??"",type:"number",min:a.minimum,max:a.maximum,step:a.integers?1:"any",placeholder:a.placeholder??"Enter a number",disabled:h,onKeyDown:O})})})});Nn.displayName="NumberFieldInput";const ut=class ut extends Me{constructor(t){const{minimum:n=Number.MIN_SAFE_INTEGER,maximum:i=Number.MAX_SAFE_INTEGER,integers:a=!1,placeholder:o,...s}=t;super(s);b(this,"type","number");b(this,"minimum");b(this,"maximum");b(this,"integers");b(this,"placeholder");this.minimum=n,this.maximum=i,this.integers=a,this.placeholder=o}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new ut({label:"Minimum",description:"Minimum value",integers:!0,required:!1,identifier:`${n}minimum`}),showDirectly:!1},{field:new ut({label:"Maximum",description:"Maximum value",integers:!0,required:!1,identifier:`${n}maximum`}),showDirectly:!1},{field:new Ot({label:"Integers",description:"Whole numbers only",required:!1,identifier:`${n}integers`}),showDirectly:!1}]}getFieldValidators(){const t=super.getFieldValidators(),n=this.minimum,i=this.maximum;return typeof n=="number"&&t.push(a=>{if(typeof a=="number"&&a<n)return`Must be at least ${this.minimum}.`}),typeof i=="number"&&t.push(a=>{if(typeof a=="number"&&a>i)return`Must be at most ${this.maximum}.`}),this.integers&&t.push(a=>{if(typeof a=="number"&&!Number.isInteger(a))return"Must be a whole number."}),t}serialize(){return{...super.serialize(),minimum:this.minimum,maximum:this.maximum,integers:this.integers,placeholder:this.placeholder}}getOptions(){return{...super.getOptions(),minimum:this.minimum,maximum:this.maximum,integers:this.integers,placeholder:this.placeholder}}duplicate(t){return new ut({...this.getOptions(),identifier:t})}setOptions(t){const{minimum:n,maximum:i,integers:a,placeholder:o,...s}=t;this.minimum=n??this.minimum,this.maximum=i??this.maximum,this.integers=a??this.integers,this.placeholder=o??this.placeholder,super.setOptions(s)}static deserialize(t){return new ut(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Nn,{field:this,...t})}isSerializedValue(t){return this.isValue(t)}isValue(t){return typeof t=="number"&&!isNaN(t)||t===null}areValuesEqual(t,n){return t===n}blankValue(){return null}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}};b(ut,"fieldTypeName","Number"),b(ut,"fieldTypeDescription","Allows specifying a number within a given range.");let Ge=ut;const bt=1e4;class Tn extends Me{constructor(t){const{minLength:n,maxLength:i,placeholder:a="",...o}=t;super(o);b(this,"minLength");b(this,"maxLength");b(this,"placeholder");this.minLength=n?Math.max(n,0):void 0,this.maxLength=i?Math.max(i,0):bt,this.placeholder=a}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new Ge({label:"Minimum length",description:"Minimum number of characters",required:!1,identifier:`${n}minimum_length`,minimum:0,maximum:100,integers:!0}),showDirectly:!1},{field:new Ge({label:"Maximum length",description:"Maximum number of characters",required:!1,identifier:`${n}maximum_length`,minimum:1,maximum:bt,integers:!0}),showDirectly:!1}]}getFieldValidators(){const t=super.getFieldValidators();return this.minLength&&t.push(n=>{if(this.minLength&&(!n||n.length<this.minLength))return!this.required&&!n?null:`Minimum ${this.minLength} character(s).`}),this.maxLength&&t.push(n=>{if(typeof n=="string"&&this.maxLength&&n.length>this.maxLength)return`Maximum ${this.maxLength} character(s).`}),t}serialize(){return{...super.serialize(),minimum_length:this.minLength,maximum_length:this.maxLength,placeholder:this.placeholder}}getOptions(){return{...super.getOptions(),minLength:this.minLength,maxLength:this.maxLength,placeholder:this.placeholder}}setOptions(t){const{minLength:n,maxLength:i,placeholder:a,...o}=t;this.minLength=n,this.maxLength=i??this.maxLength,this.placeholder=a,super.setOptions(o)}serializeValue(t){return t}deserializeValue(t){return t}isSerializedValue(t){return typeof t=="string"}isValue(t){return typeof t=="string"}blankValue(){return""}blankSerializedValue(){return""}areSerializedValuesEqual(t,n){return t===n}areValuesEqual(t,n){return t===n}}const Dn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,field:i,showInputOnly:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{value:d,name:h,onChange:p,onBlur:g}=u,x=a?"":s,w=_.useCallback(m=>{p(m),g(m)},[g,p]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:l,error:o,image:a?void 0:i.image,children:f.jsx(v.CheckboxGroup.Root,{id:e,name:h,className:"flex flex-col gap-1",accentColor:"base",variant:"surface",size:n,values:d,onValuesChange:w,disabled:c,children:i.options.map((m,y)=>f.jsxs("label",{className:"flex gap-2 items-center min-w-0",children:[f.jsx(v.CheckboxGroup.Item,{value:m.value,children:f.jsx(v.CheckboxGroup.ItemIndicator,{children:f.jsx(v.LuIcon,{icon:Re})})}),f.jsx(v.Text,{size:n,accentColor:"base",className:"truncate",children:m.label})]},`${e}-${m.value}-${y}`))})})});Dn.displayName="CheckboxListFieldInput";const Wt=class Wt extends lr{constructor(t){super(t);b(this,"type","checkbox-list");b(this,"onlyValidateAfterTouched",!1)}serialize(){return super.serialize()}getOptions(){return super.getOptions()}duplicate(t){return new Wt({...this.getOptions(),identifier:t})}static deserialize(t){return new Wt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Dn,{field:this,...t})}isSerializedValue(t){if(!ar(t))return!1;const n=new Set(this.options.map(({value:i})=>i));return t.every(i=>n.has(i))}isValue(t){return this.isSerializedValue(t)}blankValue(){return[]}blankSerializedValue(){return[]}areSerializedValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}areValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}};b(Wt,"fieldTypeName","Checkbox list"),b(Wt,"fieldTypeDescription","Allows the user to select a multiple options from a list.");let Nt=Wt;const Mn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{value:d,name:h,onChange:p,onBlur:g}=u,[x,w]=_.useState(!1),m=i?"":s,y=_.useCallback(S=>{p(S??null),w(!1)},[p]),A=_.useCallback(S=>{w(S),S||g(d)},[g,d]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:m,description:l,error:o,image:i?void 0:a.image,children:f.jsxs(v.Popover.Root,{open:x,onOpenChange:A,children:[f.jsx(v.Popover.Trigger,{asChild:!0,children:f.jsxs(v.Button,{id:e,name:h,type:"button",className:"!justify-between",accentColor:"base",variant:"surface",size:n,disabled:c,children:[f.jsx(v.Text,{className:"truncate",highContrast:!!d,children:d?d.toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit"}):"yyyy-mm-dd"}),f.jsx(v.LuIcon,{icon:mn})]})}),f.jsx(v.Popover.Content,{align:"start",size:n,children:f.jsx(v.DayPicker,{size:n,required:!1,mode:"single",variant:"solid",selected:d??void 0,onSelect:y})})]})})});Mn.displayName="DateFieldInput";const jt=class jt extends Me{constructor(t){super(t);b(this,"type","date");b(this,"onlyValidateAfterTouched",!1)}serialize(){return super.serialize()}getOptions(){return super.getOptions()}duplicate(t){return new jt({...this.getOptions(),identifier:t})}static deserialize(t){return new jt(t)}setOptions(t){super.setOptions(t)}serializeValue(t){return t?t.toISOString():null}deserializeValue(t){return t?new Date(t):null}render(t){return f.jsx(Mn,{field:this,...t})}isSerializedValue(t){return typeof t!="string"&&t!==null?!1:this.isValue(this.deserializeValue(t))}isValue(t){return!(!(t instanceof Date)&&t!==null||t instanceof Date&&isNaN(t.getTime()))}blankValue(){return null}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}areValuesEqual(t,n){return!t&&!n?!0:!t||!n?!1:t.getTime()===n.getTime()}};b(jt,"fieldTypeName","Date"),b(jt,"fieldTypeDescription","Allows specifying a date.");let ur=jt;const Fn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{value:d,name:h,onChange:p,onBlur:g}=u,x=i?"":s,w=_.useCallback(y=>{p(y),g(y)},[g,p]),m=_.useCallback(y=>{y||g(d)},[d,g]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:l,error:o,image:i?void 0:a.image,children:f.jsxs(v.Menu.Root,{onOpenChange:m,align:"start",children:[f.jsx(v.Menu.ClickTrigger,{children:f.jsxs(v.Button,{id:e,name:h,className:"!justify-between",variant:"surface",type:"button",size:n,accentColor:"base",disabled:c,children:[f.jsx(v.Text,{className:"truncate",highContrast:d&&d.length>0,children:d&&d.length>0?d.join(", "):a.placeholder??"Select one or more..."}),f.jsx(v.LuIcon,{icon:mn})]})}),f.jsx(v.Menu.Content,{size:n,children:f.jsx(v.Menu.Scroll,{children:f.jsxs(v.Menu.MultiSelectGroup,{values:d,onValuesChange:w,children:[f.jsxs(v.Menu.SelectAllItem,{children:[f.jsx(v.Menu.CheckboxItemIndicator,{children:y=>y?f.jsx(v.LuIcon,{icon:kr}):f.jsx(v.LuIcon,{icon:Re})}),"Select all"]}),a.options.map((y,A)=>f.jsxs(v.Menu.MultiSelectItem,{value:y.value,children:[f.jsx(v.Menu.SelectedIndicator,{children:f.jsx(v.LuIcon,{icon:Re})}),y.label]},`${e}-${y.value}-${A}`))]})})})]})})});Fn.displayName="MultiSelectFieldInput";const Yt=class Yt extends lr{constructor(t){const{placeholder:n,...i}=t;super(i);b(this,"type","multi-select");b(this,"placeholder");this.placeholder=n}serialize(){return super.serialize()}getOptions(){return{...super.getOptions(),placeholder:this.placeholder}}duplicate(t){return new Yt({...this.getOptions(),identifier:t})}setOptions(t){const{placeholder:n}=t;this.placeholder=n,super.setOptions(t)}static deserialize(t){return new Yt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Fn,{field:this,...t})}isSerializedValue(t){if(!ar(t))return!1;const n=new Set(this.options.map(({value:i})=>i));return t.every(i=>n.has(i))}isValue(t){return this.isSerializedValue(t)}blankValue(){return[]}areValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}blankSerializedValue(){return[]}areSerializedValuesEqual(t,n){const i=new Set(t),a=new Set(n);return i.size===a.size&&i.isSubsetOf(a)}};b(Yt,"fieldTypeName","Multi-select"),b(Yt,"fieldTypeDescription","Allows the user to select a multiple options from a list of options.");let tt=Yt;const Pn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,label:o,description:s,error:l,fieldProps:u},{disabled:c}]=Oe(r),{name:d,onChange:h,onBlur:p,value:g}=u,x=i?"":o,w=_.useCallback(y=>{h(y??null),p(y??null)},[p,h]),m=_.useMemo(()=>a.options.find(y=>y.value===g),[a.options,g]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:s,error:l,image:i?void 0:a.image,children:f.jsxs(v.Menu.Root,{align:"start",children:[f.jsx(v.Menu.ClickTrigger,{children:f.jsxs(v.Button,{id:e,name:d,className:"!justify-between",accentColor:"base",variant:"surface",type:"button",size:n,disabled:c,children:[f.jsx(v.Text,{className:"truncate",highContrast:!!m,children:m?m.label:a.placeholder??"Select one..."}),f.jsx(v.LuIcon,{icon:mn})]})}),f.jsx(v.Menu.Content,{size:n,children:f.jsx(v.Menu.Scroll,{children:f.jsx(v.Menu.SelectGroup,{required:!1,value:g??void 0,onValueChange:w,children:a.options.map((y,A)=>f.jsxs(v.Menu.SelectItem,{value:y.value,children:[f.jsx(v.Menu.SelectedIndicator,{children:f.jsx(v.LuIcon,{icon:Re})}),y.label]},`${e}-${y.value}-${A}`))})})})]})})});Pn.displayName="SelectFieldInput";const Zt=class Zt extends lr{constructor(t){const{placeholder:n,...i}=t;super(i);b(this,"type","select");b(this,"placeholder");this.placeholder=n}serialize(){return super.serialize()}getOptions(){return{...super.getOptions(),placeholder:this.placeholder}}duplicate(t){return new Zt({...this.getOptions(),identifier:t})}setOptions(t){const{placeholder:n}=t;this.placeholder=n,super.setOptions(t)}static deserialize(t){return new Zt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Pn,{field:this,...t})}isSerializedValue(t){return typeof t!="string"&&t!==null?!1:new Set([null,...this.options.map(({value:i})=>i)]).has(t)}isValue(t){return this.isSerializedValue(t)}blankValue(){return null}areValuesEqual(t,n){return t===n}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}};b(Zt,"fieldTypeName","Dropdown"),b(Zt,"fieldTypeDescription","Allows the user to select a single option from a list of options.");let ft=Zt;const Vn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u,touched:c,helpers:d},{formId:h,disabled:p}]=Oe(r),{name:g,onBlur:x,onChange:w,value:m}=u,y=i?"":s,[A,S]=_.useState(""),O=_.useMemo(()=>Array.from({length:a.length},()=>U.v4()),[a.length]);_.useEffect(()=>{S(m)},[m]);const N=_.useCallback(M=>{S(M),(c||!a.onlyValidateAfterTouched)&&d.setError(a.getError(M))},[a,d,c]),D=_.useCallback(()=>{w(A),x(A)},[A,x,w]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:y,description:l,error:o,image:i?void 0:a.image,children:f.jsxs(v.OneTimePasswordField.Root,{id:e,name:g,value:A,onValueChange:N,validationType:a.validationType,form:h,disabled:p,orientation:"horizontal",dir:"ltr",type:"text",autoComplete:"off",autoFocus:!1,autoSubmit:!1,className:"flex gap-1 h-max w-full overflow-x-auto p-0.25",accentColor:"base",variant:"surface",size:n,onBlur:D,children:[O.map(M=>f.jsx(v.OneTimePasswordField.Input,{id:M},M)),f.jsx(v.OneTimePasswordField.HiddenInput,{})]})})});Vn.displayName="OTPFieldInput";const Kt=class Kt extends Me{constructor(t){const{length:n,validationType:i,...a}=t;super(a);b(this,"type","otp");b(this,"length");b(this,"validationType");this.length=n,this.validationType=i}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new Ge({label:"Length",integers:!0,required:!1,minimum:1,maximum:16,identifier:`${n}length`}),showDirectly:!1},{field:new ft({label:"Type",required:!1,identifier:`${n}validationType`,options:[{value:"none",label:"Any"},{value:"numeric",label:"Numeric"},{value:"alpha",label:"Alpha"},{value:"alphanumeric",label:"Alphanumeric"}]}),showDirectly:!1}]}getFieldValidators(){const t=super.getFieldValidators(),n=this.length;return t.push(i=>{if(!this.isValueBlank(i)&&i.length!=n)return`Must be ${n} characters.`}),t}serialize(){return{...super.serialize(),length:this.length,validationType:this.validationType}}getOptions(){return{...super.getOptions(),length:this.length,validationType:this.validationType}}duplicate(t){return new Kt({...this.getOptions(),identifier:t})}setOptions(t){const{length:n,validationType:i,...a}=t;this.length=n??this.length,this.validationType=i??this.validationType,super.setOptions(a)}static deserialize(t){return new Kt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Vn,{field:this,...t})}isSerializedValue(t){return typeof t=="string"}isValue(t){return typeof t=="string"}blankValue(){return""}areValuesEqual(t,n){return t===n}blankSerializedValue(){return""}areSerializedValuesEqual(t,n){return t===n}};b(Kt,"fieldTypeName","OTP"),b(Kt,"fieldTypeDescription","Allows specifying a number within a given range.");let Tt=Kt;const ht={pass:{label:"Pass",icon:el},fail:{label:"Fail",icon:nl},na:{label:"N/A",icon:rl}},Dt=Object.keys(ht);class rt extends File{constructor(t,...n){super(...n);b(this,"uuid");this.uuid=t}static from(t,n){return new rt(t,[n],n.name,{lastModified:n.lastModified,type:n.type})}}class Mt extends Promise{constructor(t,n){super(t);b(this,"_uuid");this._uuid=n}get uuid(){return this._uuid}set uuid(t){this._uuid=t}static from(t,n){return new Mt((i,a)=>{Promise.resolve(t).then(i).catch(a)},n)}then(t,n){const i=super.then(t,n);return i.uuid=this.uuid,i}catch(t){const n=super.catch(t);return n.uuid=this.uuid,n}finally(t){const n=super.finally(t);return n.uuid=this.uuid,n}}function fa(r){return Array.isArray(r)?r.every(e=>e instanceof Mt||e instanceof rt):!1}function Gr(r,e){const t=new Set(r.map(({uuid:i})=>i)),n=new Set(e.map(({uuid:i})=>i));return t.size===n.size&&t.isSubsetOf(n)}const Bn=_.memo(r=>{const{ref:e,file:t,error:n,rightSlot:i,className:a,size:o,...s}=r;return f.jsxs(v.Card,{className:St.cx(a,"relative flex h-48 w-full flex-col items-center p-0!"),ref:e,size:"xs",...s,children:[!t&&!n&&f.jsx("div",{className:"absolute inset-0 grow flex items-center justify-center",children:f.jsx(v.Spinner,{})}),!!t&&!n&&f.jsx("div",{className:"flex grow w-full items-center justify-center overflow-hidden bg-clip-padding p-3",children:f.jsx(Ur,{className:"max-w-full size-full object-cover",file:t})}),f.jsx(v.Separator,{size:"full"}),(!!t||!!n)&&f.jsxs("div",{className:St.cx("flex w-full items-center gap-2 self-end p-3",{"bg-transparent":!t}),children:[n?f.jsx(v.LuIcon,{color:"var(--base-11)",icon:sl}):t&&f.jsx(v.LuIcon,{color:"var(--base-11)",icon:aa}),f.jsx(v.Text,{className:"truncate",size:o,accentColor:"base",children:n??(t==null?void 0:t.name)}),i]})]})});Bn.displayName="ImageCard";const Ln=_.memo(r=>{const{file:e,onRemove:t,disabled:n,size:i}=r,[a,o]=_.useState(null),[s,l]=_.useState(null),u=Rr();_.useEffect(()=>{e instanceof Mt?e.then(x=>{o(x)}).catch(x=>{l(x instanceof Error?x.message:"Unknown error")}):o(e)},[e]);const c=_.useCallback(()=>{if(!a)return;const x=new Blob([a]);Yi.saveAs(x,a.name)},[a]),d=_.useCallback(()=>{if(!a)return;const x=URL.createObjectURL(a);window.open(x,"_blank"),URL.revokeObjectURL(x)},[a]),h=_.useCallback(()=>{a&&u(x=>({file:a,onDelete:n?void 0:()=>{t(),x()}}))},[n,t,u,a]),p=_.useMemo(()=>f.jsx("div",{className:"flex grow justify-end",children:f.jsxs(v.Menu.Root,{modal:!0,children:[f.jsx(v.Menu.ClickTrigger,{children:f.jsx(v.IconButton,{onClick:v.stopPropagation,type:"button",variant:"ghost",accentColor:"base",size:i,children:f.jsx(v.LuIcon,{icon:ia})})}),f.jsxs(v.Menu.Content,{size:i,children:[f.jsxs(v.Menu.Item,{onSelect:c,disabled:!a,children:[f.jsx(v.LuIcon,{icon:na})," Download"]}),n?null:f.jsxs(f.Fragment,{children:[f.jsx(v.Menu.Separator,{}),f.jsxs(v.Menu.Item,{onSelect:t,children:[f.jsx(v.LuIcon,{icon:dt})," Delete"]})]})]})]})}),[n,t,c,a,i]);return!!(a!=null&&a.type.startsWith("image/"))?f.jsx(Bn,{className:"cursor-pointer",onClick:h,file:a,error:s??void 0,rightSlot:p,size:i}):f.jsx(En,{className:"cursor-pointer",file:a,error:s??void 0,onClick:d,rightSlot:p,size:i})});Ln.displayName="DisplayFile";const zn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u,touched:c,helpers:d},{disabled:h}]=Oe(r),{value:p,onChange:g,onBlur:x,name:w}=u,[m,y]=_.useState(""),A=_.useRef(null),S=i?"":s,O=p.status&&a.showNotesAndFilesOn.includes(p.status),N=_.useCallback(q=>{const ue=a.cleanValue({...p,status:q});g(ue),x(ue)},[a,x,g,p]);_.useEffect(()=>{y(p.notes)},[p]);const D=_.useCallback(q=>{const ue=q.target.value;y(ue),(c||!a.onlyValidateAfterTouched)&&d.setError(a.getError({...p,notes:m}))},[a,d,m,c,p]),M=_.useCallback(()=>{const q={...p,notes:m};g(q),x(q)},[m,x,g,p]),B=_.useCallback(q=>{const ue=[...p.files];ue.splice(q,1),g({...p,files:ue})},[g,p]),L=_.useCallback(()=>{var q;(q=A.current)==null||q.click()},[]),j=_.useCallback(q=>{const ue=Array.from(q.target.files??[]).map(zr=>rt.from(U.v4(),zr)),ct={...p,files:[...p.files,...ue]};g(ct),x(ct)},[x,g,p]);_.useEffect(()=>{if(!A.current)return;const q=new AbortController;return A.current.addEventListener("cancel",()=>{x(p)},{signal:q.signal}),()=>{q.abort()}},[x,p]);const z=`${e}-status`,H=`${e}-notes`,te=`${e}-files`;return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:S,description:l,error:o,image:i?void 0:a.image,children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(v.RadioGroup.Root,{id:z,className:"flex gap-2",name:w,value:p.status,disabled:h,accentColor:"base",variant:"surface",size:n,onValueChange:N,children:Dt.map(q=>{const{label:ue}=ht[q];return f.jsxs("label",{className:"flex gap-2 items-center min-w-0",children:[f.jsx(v.RadioGroup.Item,{value:q,children:f.jsx(v.RadioGroup.Indicator,{children:f.jsx(v.LuIcon,{icon:ea,className:"fill-current"})})}),f.jsx(v.Text,{size:n,accentColor:"base",className:"truncate",children:ue})]},`${e}-${q}`)})}),O&&f.jsxs(f.Fragment,{children:[f.jsx("div",{children:f.jsx(v.TextArea,{id:H,value:m,name:w,onChange:D,onBlur:M,className:"field-sizing-content w-full min-h-12",placeholder:"Notes",resize:"vertical",accentColor:"base",variant:"surface",size:n,disabled:h})}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs(v.Button,{className:"w-max",size:n,variant:"soft",accentColor:"base",onClick:L,type:"button",disabled:h,children:[f.jsx(v.LuIcon,{icon:An}),"Select files"]}),f.jsx("input",{id:te,name:w,type:"file",ref:A,multiple:!0,className:"hidden",onChange:j,value:""}),p.files.length>0&&f.jsx("div",{className:"flex h-max flex-wrap gap-2",children:p.files.map((q,ue)=>f.jsx(Ln,{size:n,file:q,onRemove:()=>{B(ue)},disabled:h},ue))})]})]})]})})});zn.displayName="PassFailFieldInput";const kn=r=>typeof r=="string"&&Dt.includes(r),ha=r=>!(r===null||typeof r!="object"||!("status"in r)||!kn(r.status)||!("notes"in r)||typeof r.notes!="string"||!("files"in r)||!(Array.isArray(r.files)&&r.files.length===0)),pa=r=>!(r===null||typeof r!="object"||!("status"in r)||!kn(r.status)||!("notes"in r)||typeof r.notes!="string"||!("files"in r)||!fa(r.files)),va=r=>({status:r.status,notes:r.notes,files:[]}),ga=r=>({status:r.status,notes:r.notes,files:[]}),xa=(r,e)=>!(r.status!==e.status||r.notes!==e.notes||!Gr(r.files,e.files)),ya=(r,e)=>!(r.status!==e.status||r.notes!==e.notes||r.files.length!==e.files.length),Qt=class Qt extends Me{constructor(t){const{showNotesAndFilesOn:n,...i}=t;super(i);b(this,"type","pass-fail");b(this,"onlyValidateAfterTouched",!1);b(this,"showNotesAndFilesOn");this.showNotesAndFilesOn=n}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new tt({identifier:`${n}showNotesAndFilesOn`,label:"Show notes and files on",description:"Show the notes and files on desired statuses.",options:Dt.map(i=>{const{label:a}=ht[i];return{value:i,label:a}}),required:!1}),showDirectly:!1}]}serialize(){return{...super.serialize(),showNotesAndFilesOn:this.showNotesAndFilesOn}}getOptions(){return{...super.getOptions(),showNotesAndFilesOn:this.showNotesAndFilesOn}}duplicate(t){return new Qt({...this.getOptions(),identifier:t})}setOptions(t){const{showNotesAndFilesOn:n,...i}=t;this.showNotesAndFilesOn=n??this.showNotesAndFilesOn,super.setOptions(i)}getFieldValidators(){const t=super.getFieldValidators(),n=this.showNotesAndFilesOn,i=this.blankValue();return n.length>0&&(t.push(a=>{if(!(!a.status||!n.includes(a.status))&&i.notes===a.notes)return"Notes is required."}),t.push(a=>{if(!(!a.status||!n.includes(a.status))&&Gr(i.files,a.files))return"Files is required."})),t}static deserialize(t){return new Qt({...t,showNotesAndFilesOn:t.showNotesAndFilesOn??!1})}serializeValue(t){return va(t)}deserializeValue(t){return ga(t)}render(t){return f.jsx(zn,{field:this,...t})}isSerializedValue(t){return ha(t)}isValue(t){return pa(t)}areValuesEqual(t,n){return xa(t,n)}blankValue(){return{status:null,notes:"",files:[]}}cleanValue(t){return t.status&&this.showNotesAndFilesOn.includes(t.status)?t:{status:t.status,notes:"",files:[]}}cleanSerializedValue(t){return super.cleanSerializedValue(t)}blankSerializedValue(){return{status:null,notes:"",files:[]}}areSerializedValuesEqual(t,n){return ya(t,n)}};b(Qt,"fieldTypeName","Pass - Fail"),b(Qt,"fieldTypeDescription","Track pass, fail, or N/A outcome.");let Ft=Qt;const Rn=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,error:o,label:s,description:l,fieldProps:u},{disabled:c}]=Oe(r),{name:d,onChange:h,onBlur:p,value:g}=u,x=i?"":s,w=_.useCallback(y=>{h(y),p(y)},[p,h]),m=_.useCallback(()=>{h(null),p(null)},[p,h]);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:l,error:o,image:i?void 0:a.image,children:f.jsxs(v.RadioGroup.Root,{id:e,name:d,className:"flex flex-col gap-1",accentColor:"base",variant:"surface",size:n,value:g??"",onValueChange:w,disabled:c,children:[a.options.map((y,A)=>f.jsxs("label",{className:"flex gap-2 items-center min-w-0",children:[f.jsx(v.RadioGroup.Item,{value:y.value,children:f.jsx(v.RadioGroup.Indicator,{children:f.jsx(v.LuIcon,{icon:ea,className:"fill-current"})})}),f.jsx(v.Text,{size:n,accentColor:"base",className:"truncate",children:y.label})]},`${e}-${y.value}-${A}`)),!!g&&f.jsxs(v.Button,{onClick:m,className:"w-max -mx-2",type:"button",variant:"ghost",accentColor:"base",size:n,children:[f.jsx(v.LuIcon,{icon:et}),"Clear"]})]})})});Rn.displayName="RadioFieldInput";const Jt=class Jt extends lr{constructor(t){super(t);b(this,"type","radio");b(this,"onlyValidateAfterTouched",!1)}serialize(){return super.serialize()}getOptions(){return super.getOptions()}duplicate(t){return new Jt({...this.getOptions(),identifier:t})}setOptions(t){super.setOptions(t)}static deserialize(t){return new Jt(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Rn,{field:this,...t})}isSerializedValue(t){return typeof t!="string"&&t!==null?!1:new Set([null,...this.options.map(({value:i})=>i)]).has(t)}isValue(t){return this.isSerializedValue(t)}blankValue(){return null}areValuesEqual(t,n){return t===n}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}};b(Jt,"fieldTypeName","Option list"),b(Jt,"fieldTypeDescription","Allows the user to select a single option from a list of options.");let Pt=Jt;const Un=_.memo(r=>{const[{inputId:e,labelId:t,size:n,showInputOnly:i,field:a,label:o,description:s,error:l,fieldProps:u},{disabled:c}]=Oe(r),{name:d,onChange:h,onBlur:p,value:g}=u,x=i?"":o,w=_.useCallback(A=>{h(A),p(A)},[p,h]),m=_.useCallback(()=>{h(null),p(null)},[p,h]),y=Array.from({length:a.maxRating},(A,S)=>S+1);return f.jsx(Ie,{size:n,inputId:e,labelId:t,label:x,description:s,error:l,image:i?void 0:a.image,children:f.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[f.jsx(v.Rating.Root,{id:e,name:d,className:"flex items-center gap-0.5",value:g,onValueChange:w,disabled:c,children:y.map(A=>f.jsx(v.Rating.Item,{value:A,className:"group size-5 flex cursor-pointer disabled:opacity-50 disabled:pointer-events-none items-center justify-center text-yellow-500 transition-colors",children:f.jsx(v.LuIcon,{icon:la,className:"group-data-[active=true]:fill-current size-full"})},`${e}-${A}`))}),!c&&g!==null&&f.jsx(v.IconButton,{onClick:m,type:"button",variant:"ghost",accentColor:"base",size:n,children:f.jsx(v.LuIcon,{icon:et})})]})})});Un.displayName="RatingFieldInput";const er=class er extends Me{constructor(t){const{maxRating:n,...i}=t;super(i);b(this,"type","rating");b(this,"maxRating");this.maxRating=n}static getFieldCreationSchema(t=""){const n=t&&`${t}.`;return[{field:new Ge({label:"Max Rating",description:"Maximum rating value",integers:!0,required:!1,minimum:1,maximum:10,identifier:`${n}maxRating`}),showDirectly:!1}]}getFieldValidators(){const t=super.getFieldValidators(),n=this.maxRating;return t.push(i=>{if(typeof i=="number"&&(i<1||i>n))return`Rating must be between 1 and ${n}.`}),t}serialize(){return{...super.serialize(),maxRating:this.maxRating}}getOptions(){return{...super.getOptions(),maxRating:this.maxRating}}duplicate(t){return new er({...this.getOptions(),identifier:t})}setOptions(t){const{maxRating:n,...i}=t;this.maxRating=n??this.maxRating,super.setOptions(i)}static deserialize(t){return new er(t)}serializeValue(t){return t}deserializeValue(t){return t}render(t){return f.jsx(Un,{field:this,...t})}isSerializedValue(t){return this.isValue(t)}isValue(t){return typeof t=="number"&&!isNaN(t)||t===null}areValuesEqual(t,n){return t===n}blankValue(){return null}blankSerializedValue(){return null}areSerializedValuesEqual(t,n){return t===n}};b(er,"fieldTypeName","Rating"),b(er,"fieldTypeDescription","Allows users to select a rating value.");let Vt=er;const Ca=_.createContext(()=>{throw new Error("No ScannerProvider found")}),Al=()=>_.use(Ca);function El(r,e){var t=Object.setPrototypeOf;t?t(r,e):r.__proto__=e}function Sl(r,e){e===void 0&&(e=r.constructor);var t=Error.captureStackTrace;t&&t(r,e)}var Il=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Ol=function(r){Il(e,r);function e(t,n){var i=this.constructor,a=r.call(this,t,n)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),El(a,i.prototype),Sl(a),a}return e}(Error),bl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Le=function(r){bl(e,r);function e(t){t===void 0&&(t=void 0);var n=r.call(this,t)||this;return n.message=t,n}return e.prototype.getKind=function(){var t=this.constructor;return t.kind},e.kind="Exception",e}(Ol),Nl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),We=function(r){Nl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ArgumentException",e}(Le),Tl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),R=function(r){Tl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IllegalArgumentException",e}(Le),Dl=function(){function r(e){if(this.binarizer=e,e===null)throw new R("Binarizer must be non-null.")}return r.prototype.getWidth=function(){return this.binarizer.getWidth()},r.prototype.getHeight=function(){return this.binarizer.getHeight()},r.prototype.getBlackRow=function(e,t){return this.binarizer.getBlackRow(e,t)},r.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},r.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},r.prototype.crop=function(e,t,n,i){var a=this.binarizer.getLuminanceSource().crop(e,t,n,i);return new r(this.binarizer.createBinarizer(a))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(e))},r.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(e))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r}(),Ml=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ye=function(r){Ml(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}(Le),Fl=function(){function r(e){this.source=e}return r.prototype.getLuminanceSource=function(){return this.source},r.prototype.getWidth=function(){return this.source.getWidth()},r.prototype.getHeight=function(){return this.source.getHeight()},r}(),ae=function(){function r(){}return r.arraycopy=function(e,t,n,i,a){for(;a--;)n[i++]=e[t++]},r.currentTimeMillis=function(){return Date.now()},r}(),Pl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Gn=function(r){Pl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IndexOutOfBoundsException",e}(Le),Vl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),wa=function(r){Vl(e,r);function e(t,n){t===void 0&&(t=void 0),n===void 0&&(n=void 0);var i=r.call(this,n)||this;return i.index=t,i.message=n,i}return e.kind="ArrayIndexOutOfBoundsException",e}(Gn),Bl=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fe=function(){function r(){}return r.fill=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n]=t},r.fillWithin=function(e,t,n,i){r.rangeCheck(e.length,t,n);for(var a=t;a<n;a++)e[a]=i},r.rangeCheck=function(e,t,n){if(t>n)throw new R("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new wa(t);if(n>e)throw new wa(n)},r.asList=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},r.create=function(e,t,n){var i=Array.from({length:e});return i.map(function(a){return Array.from({length:t}).fill(n)})},r.createInt32Array=function(e,t,n){var i=Array.from({length:e});return i.map(function(a){return Int32Array.from({length:t}).fill(n)})},r.equals=function(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0},r.hashCode=function(e){var t,n;if(e===null)return 0;var i=1;try{for(var a=Bl(e),o=a.next();!o.done;o=a.next()){var s=o.value;i=31*i+s}}catch(l){t={error:l}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},r.fillUint8Array=function(e,t){for(var n=0;n!==e.length;n++)e[n]=t},r.copyOf=function(e,t){return e.slice(0,t)},r.copyOfUint8Array=function(e,t){if(e.length<=t){var n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)},r.copyOfRange=function(e,t,n){var i=n-t,a=new Int32Array(i);return ae.arraycopy(e,t,a,0,i),a},r.binarySearch=function(e,t,n){n===void 0&&(n=r.numberComparator);for(var i=0,a=e.length-1;i<=a;){var o=a+i>>1,s=n(t,e[o]);if(s>0)i=o+1;else if(s<0)a=o-1;else return o}return-i-1},r.numberComparator=function(e,t){return e-t},r}(),$=function(){function r(){}return r.numberOfTrailingZeros=function(e){var t;if(e===0)return 32;var n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)},r.numberOfLeadingZeros=function(e){if(e===0)return 32;var t=1;return e>>>16||(t+=16,e<<=16),e>>>24||(t+=8,e<<=8),e>>>28||(t+=4,e<<=4),e>>>30||(t+=2,e<<=2),t-=e>>>31,t},r.toHexString=function(e){return e.toString(16)},r.toBinaryString=function(e){return String(parseInt(String(e),2))},r.bitCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63},r.truncDivision=function(e,t){return Math.trunc(e/t)},r.parseInt=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),Ce=function(){function r(e,t){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,t==null?this.bits=r.makeArray(e):this.bits=t)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(e){if(e>this.bits.length*32){var t=r.makeArray(e);ae.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}},r.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0},r.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},r.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},r.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,i=Math.floor(e/32),a=n[i];a&=~((1<<(e&31))-1);for(var o=n.length;a===0;){if(++i===o)return t;a=n[i]}var s=i*32+$.numberOfTrailingZeros(a);return s>t?t:s},r.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,i=Math.floor(e/32),a=~n[i];a&=~((1<<(e&31))-1);for(var o=n.length;a===0;){if(++i===o)return t;a=~n[i]}var s=i*32+$.numberOfTrailingZeros(a);return s>t?t:s},r.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},r.prototype.setRange=function(e,t){if(t<e||e<0||t>this.size)throw new R;if(t!==e){t--;for(var n=Math.floor(e/32),i=Math.floor(t/32),a=this.bits,o=n;o<=i;o++){var s=o>n?0:e&31,l=o<i?31:t&31,u=(2<<l)-(1<<s);a[o]|=u}}},r.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,n=0;n<e;n++)t[n]=0},r.prototype.isRange=function(e,t,n){if(t<e||e<0||t>this.size)throw new R;if(t===e)return!0;t--;for(var i=Math.floor(e/32),a=Math.floor(t/32),o=this.bits,s=i;s<=a;s++){var l=s>i?0:e&31,u=s<a?31:t&31,c=(2<<u)-(1<<l)&4294967295;if((o[s]&c)!==(n?c:0))return!1}return!0},r.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(e,t){if(t<0||t>32)throw new R("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(var n=t;n>0;n--)this.appendBit((e>>n-1&1)===1)},r.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var n=0;n<t;n++)this.appendBit(e.get(n))},r.prototype.xor=function(e){if(this.size!==e.size)throw new R("Sizes don't match");for(var t=this.bits,n=0,i=t.length;n<i;n++)t[n]^=e.bits[n]},r.prototype.toBytes=function(e,t,n,i){for(var a=0;a<i;a++){for(var o=0,s=0;s<8;s++)this.get(e)&&(o|=1<<7-s),e++;t[n+a]=o}},r.prototype.getBitArray=function(){return this.bits},r.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,i=this.bits,a=0;a<n;a++){var o=i[a];o=o>>1&1431655765|(o&1431655765)<<1,o=o>>2&858993459|(o&858993459)<<2,o=o>>4&252645135|(o&252645135)<<4,o=o>>8&16711935|(o&16711935)<<8,o=o>>16&65535|(o&65535)<<16,e[t-a]=o}if(this.size!==n*32){for(var s=n*32-this.size,l=e[0]>>>s,a=1;a<n;a++){var u=e[a];l|=u<<32-s,e[a-1]=l,l=u>>>s}e[n-1]=l}this.bits=e},r.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.size===t.size&&fe.equals(this.bits,t.bits)},r.prototype.hashCode=function(){return 31*this.size+fe.hashCode(this.bits)},r.prototype.toString=function(){for(var e="",t=0,n=this.size;t<n;t++)(t&7)===0&&(e+=" "),e+=this.get(t)?"X":".";return e},r.prototype.clone=function(){return new r(this.size,this.bits.slice())},r.prototype.toArray=function(){for(var e=[],t=0,n=this.size;t<n;t++)e.push(this.get(t));return e},r}(),Hn;(function(r){r[r.OTHER=0]="OTHER",r[r.PURE_BARCODE=1]="PURE_BARCODE",r[r.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",r[r.TRY_HARDER=3]="TRY_HARDER",r[r.CHARACTER_SET=4]="CHARACTER_SET",r[r.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",r[r.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",r[r.ASSUME_GS1=7]="ASSUME_GS1",r[r.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",r[r.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",r[r.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(Hn||(Hn={}));const le=Hn;var Ll=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),F=function(r){Ll(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getFormatInstance=function(){return new e},e.kind="FormatException",e}(Le),zl=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},re;(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(re||(re={}));var he=function(){function r(e,t,n){for(var i,a,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];this.valueIdentifier=e,this.name=n,typeof t=="number"?this.values=Int32Array.from([t]):this.values=t,this.otherEncodingNames=o,r.VALUE_IDENTIFIER_TO_ECI.set(e,this),r.NAME_TO_ECI.set(n,this);for(var l=this.values,u=0,c=l.length;u!==c;u++){var d=l[u];r.VALUES_TO_ECI.set(d,this)}try{for(var h=zl(o),p=h.next();!p.done;p=h.next()){var g=p.value;r.NAME_TO_ECI.set(g,this)}}catch(x){i={error:x}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}}return r.prototype.getValueIdentifier=function(){return this.valueIdentifier},r.prototype.getName=function(){return this.name},r.prototype.getValue=function(){return this.values[0]},r.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new F("incorect value");var t=r.VALUES_TO_ECI.get(e);if(t===void 0)throw new F("incorect value");return t},r.getCharacterSetECIByName=function(e){var t=r.NAME_TO_ECI.get(e);if(t===void 0)throw new F("incorect value");return t},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.getName()===t.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(re.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(re.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(re.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(re.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(re.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(re.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(re.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(re.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(re.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(re.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(re.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(re.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(re.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(re.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(re.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(re.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(re.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(re.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(re.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(re.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(re.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(re.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(re.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(re.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(re.Big5,28,"Big5"),r.GB18030=new r(re.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(re.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),kl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Hr=function(r){kl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="UnsupportedOperationException",e}(Le),He=function(){function r(){}return r.decode=function(e,t){var n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)},r.shouldDecodeOnFallback=function(e){return!r.isBrowser()&&e==="ISO-8859-1"},r.encode=function(e,t){var n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(e){return typeof e=="string"?e:e.getName()},r.encodingCharacterSet=function(e){return e instanceof he?e:he.getCharacterSetECIByName(e)},r.decodeFallback=function(e,t){var n=this.encodingCharacterSet(t);if(r.isDecodeFallbackSupported(n)){for(var i="",a=0,o=e.length;a<o;a++){var s=e[a].toString(16);s.length<2&&(s="0"+s),i+="%"+s}return decodeURIComponent(i)}if(n.equals(he.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new Hr("Encoding "+this.encodingName(t)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(e){return e.equals(he.UTF8)||e.equals(he.ISO8859_1)||e.equals(he.ASCII)},r.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))),n=t.split(""),i=[],a=0;a<n.length;a++)i.push(n[a].charCodeAt(0));return new Uint8Array(i)},r}(),Y=function(){function r(){}return r.castAsNonUtf8Char=function(e,t){t===void 0&&(t=null);var n=t?t.getName():this.ISO88591;return He.decode(new Uint8Array([e]),n)},r.guessEncoding=function(e,t){if(t!=null&&t.get(le.CHARACTER_SET)!==void 0)return t.get(le.CHARACTER_SET).toString();for(var n=e.length,i=!0,a=!0,o=!0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,g=0,x=0,w=0,m=0,y=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,A=0;A<n&&(i||a||o);A++){var S=e[A]&255;o&&(s>0?(S&128)===0?o=!1:s--:(S&128)!==0&&((S&64)===0?o=!1:(s++,(S&32)===0?l++:(s++,(S&16)===0?u++:(s++,(S&8)===0?c++:o=!1))))),i&&(S>127&&S<160?i=!1:S>159&&(S<192||S===215||S===247)&&m++),a&&(d>0?S<64||S===127||S>252?a=!1:d--:S===128||S===160||S>239?a=!1:S>160&&S<224?(h++,g=0,p++,p>x&&(x=p)):S>127?(d++,p=0,g++,g>w&&(w=g)):(p=0,g=0))}return o&&s>0&&(o=!1),a&&d>0&&(a=!1),o&&(y||l+u+c>0)?r.UTF8:a&&(r.ASSUME_SHIFT_JIS||x>=3||w>=3)?r.SHIFT_JIS:i&&a?x===2&&h===2||m*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:a?r.SHIFT_JIS:o?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=-1;function a(s,l,u,c,d,h){if(s==="%%")return"%";if(t[++i]!==void 0){s=c?parseInt(c.substr(1)):void 0;var p=d?parseInt(d.substr(1)):void 0,g;switch(h){case"s":g=t[i];break;case"c":g=t[i][0];break;case"f":g=parseFloat(t[i]).toFixed(s);break;case"p":g=parseFloat(t[i]).toPrecision(s);break;case"e":g=parseFloat(t[i]).toExponential(s);break;case"x":g=parseInt(t[i]).toString(p||16);break;case"d":g=parseFloat(parseInt(t[i],p||10).toPrecision(s)).toFixed(0);break}g=typeof g=="object"?JSON.stringify(g):(+g).toString(p);for(var x=parseInt(u),w=u&&u[0]+""=="0"?"0":" ";g.length<x;)g=l!==void 0?g+w:w+g;return g}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(o,a)},r.getBytes=function(e,t){return He.encode(e,t)},r.getCharCode=function(e,t){return t===void 0&&(t=0),e.charCodeAt(t)},r.getCharAt=function(e){return String.fromCharCode(e)},r.SHIFT_JIS=he.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=he.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=he.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r}(),X=function(){function r(e){e===void 0&&(e=""),this.value=e}return r.prototype.enableDecoding=function(e){return this.encoding=e,this},r.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=Y.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},r.prototype.appendChars=function(e,t,n){for(var i=t;t<t+n;i++)this.append(e[i]);return this},r.prototype.length=function(){return this.value.length},r.prototype.charAt=function(e){return this.value.charAt(e)},r.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},r.prototype.setCharAt=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)},r.prototype.substring=function(e,t){return this.value.substring(e,t)},r.prototype.setLengthToZero=function(){this.value=""},r.prototype.toString=function(){return this.value},r.prototype.insert=function(e,t){this.value=this.value.substring(0,e)+t+this.value.substring(e)},r}(),Ke=function(){function r(e,t,n,i){if(this.width=e,this.height=t,this.rowSize=n,this.bits=i,t==null&&(t=e),this.height=t,e<1||t<1)throw new R("Both dimensions must be greater than 0");n==null&&(n=Math.floor((e+31)/32)),this.rowSize=n,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(e){for(var t=e.length,n=e[0].length,i=new r(n,t),a=0;a<t;a++)for(var o=e[a],s=0;s<n;s++)o[s]&&i.set(s,a);return i},r.parseFromString=function(e,t,n){if(e===null)throw new R("stringRepresentation cannot be null");for(var i=new Array(e.length),a=0,o=0,s=-1,l=0,u=0;u<e.length;)if(e.charAt(u)===`
|
|
237
237
|
`||e.charAt(u)==="\r"){if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new R("row lengths do not match");o=a,l++}u++}else if(e.substring(u,u+t.length)===t)u+=t.length,i[a]=!0,a++;else if(e.substring(u,u+n.length)===n)u+=n.length,i[a]=!1,a++;else throw new R("illegal character encountered: "+e.substring(u));if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new R("row lengths do not match");l++}for(var c=new r(s,l),d=0;d<a;d++)i[d]&&c.set(Math.floor(d%s),Math.floor(d/s));return c},r.prototype.get=function(e,t){var n=t*this.rowSize+Math.floor(e/32);return(this.bits[n]>>>(e&31)&1)!==0},r.prototype.set=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(e&31)&4294967295},r.prototype.unset=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(e&31)&4294967295)},r.prototype.flip=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(e&31)&4294967295},r.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new R("input matrix dimensions do not match");for(var t=new Ce(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,a=0,o=this.height;a<o;a++)for(var s=a*n,l=e.getRow(a,t).getBitArray(),u=0;u<n;u++)i[s+u]^=l[u]},r.prototype.clear=function(){for(var e=this.bits,t=e.length,n=0;n<t;n++)e[n]=0},r.prototype.setRegion=function(e,t,n,i){if(t<0||e<0)throw new R("Left and top must be nonnegative");if(i<1||n<1)throw new R("Height and width must be at least 1");var a=e+n,o=t+i;if(o>this.height||a>this.width)throw new R("The region must fit inside the matrix");for(var s=this.rowSize,l=this.bits,u=t;u<o;u++)for(var c=u*s,d=e;d<a;d++)l[c+Math.floor(d/32)]|=1<<(d&31)&4294967295},r.prototype.getRow=function(e,t){t==null||t.getSize()<this.width?t=new Ce(this.width):t.clear();for(var n=this.rowSize,i=this.bits,a=e*n,o=0;o<n;o++)t.setBulk(o*32,i[a+o]);return t},r.prototype.setRow=function(e,t){ae.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},r.prototype.rotate180=function(){for(var e=this.getWidth(),t=this.getHeight(),n=new Ce(e),i=new Ce(e),a=0,o=Math.floor((t+1)/2);a<o;a++)n=this.getRow(a,n),i=this.getRow(t-1-a,i),n.reverse(),i.reverse(),this.setRow(a,i),this.setRow(t-1-a,n)},r.prototype.getEnclosingRectangle=function(){for(var e=this.width,t=this.height,n=this.rowSize,i=this.bits,a=e,o=t,s=-1,l=-1,u=0;u<t;u++)for(var c=0;c<n;c++){var d=i[u*n+c];if(d!==0){if(u<o&&(o=u),u>l&&(l=u),c*32<a){for(var h=0;(d<<31-h&4294967295)===0;)h++;c*32+h<a&&(a=c*32+h)}if(c*32+31>s){for(var h=31;!(d>>>h);)h--;c*32+h>s&&(s=c*32+h)}}}return s<a||l<o?null:Int32Array.from([a,o,s-a+1,l-o+1])},r.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,t=this.bits,n=0;n<t.length&&t[n]===0;)n++;if(n===t.length)return null;for(var i=n/e,a=n%e*32,o=t[n],s=0;(o<<31-s&4294967295)===0;)s++;return a+=s,Int32Array.from([a,i])},r.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,t=this.bits,n=t.length-1;n>=0&&t[n]===0;)n--;if(n<0)return null;for(var i=Math.floor(n/e),a=Math.floor(n%e)*32,o=t[n],s=31;!(o>>>s);)s--;return a+=s,Int32Array.from([a,i])},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRowSize=function(){return this.rowSize},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.width===t.width&&this.height===t.height&&this.rowSize===t.rowSize&&fe.equals(this.bits,t.bits)},r.prototype.hashCode=function(){var e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+fe.hashCode(this.bits),e},r.prototype.toString=function(e,t,n){return e===void 0&&(e="X "),t===void 0&&(t=" "),n===void 0&&(n=`
|
|
238
238
|
`),this.buildToString(e,t,n)},r.prototype.buildToString=function(e,t,n){for(var i=new X,a=0,o=this.height;a<o;a++){for(var s=0,l=this.width;s<l;s++)i.append(this.get(s,a)?e:t);i.append(n)}return i.toString()},r.prototype.clone=function(){return new r(this.width,this.height,this.rowSize,this.bits.slice())},r}(),Rl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),T=function(r){Rl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}(Le),Ul=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Gl=function(r){Ul(e,r);function e(t){var n=r.call(this,t)||this;return n.luminances=e.EMPTY,n.buckets=new Int32Array(e.LUMINANCE_BUCKETS),n}return e.prototype.getBlackRow=function(t,n){var i=this.getLuminanceSource(),a=i.getWidth();n==null||n.getSize()<a?n=new Ce(a):n.clear(),this.initArrays(a);for(var o=i.getRow(t,this.luminances),s=this.buckets,l=0;l<a;l++)s[(o[l]&255)>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(s);if(a<3)for(var l=0;l<a;l++)(o[l]&255)<u&&n.set(l);else for(var c=o[0]&255,d=o[1]&255,l=1;l<a-1;l++){var h=o[l+1]&255;(d*4-c-h)/2<u&&n.set(l),c=d,d=h}return n},e.prototype.getBlackMatrix=function(){var t=this.getLuminanceSource(),n=t.getWidth(),i=t.getHeight(),a=new Ke(n,i);this.initArrays(n);for(var o=this.buckets,s=1;s<5;s++)for(var l=Math.floor(i*s/5),u=t.getRow(l,this.luminances),c=Math.floor(n*4/5),d=Math.floor(n/5);d<c;d++){var h=u[d]&255;o[h>>e.LUMINANCE_SHIFT]++}for(var p=e.estimateBlackPoint(o),g=t.getMatrix(),s=0;s<i;s++)for(var x=s*n,d=0;d<n;d++){var h=g[x+d]&255;h<p&&a.set(d,s)}return a},e.prototype.createBinarizer=function(t){return new e(t)},e.prototype.initArrays=function(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));for(var n=this.buckets,i=0;i<e.LUMINANCE_BUCKETS;i++)n[i]=0},e.estimateBlackPoint=function(t){for(var n=t.length,i=0,a=0,o=0,s=0;s<n;s++)t[s]>o&&(a=s,o=t[s]),t[s]>i&&(i=t[s]);for(var l=0,u=0,s=0;s<n;s++){var c=s-a,d=t[s]*c*c;d>u&&(l=s,u=d)}if(a>l){var h=a;a=l,l=h}if(l-a<=n/16)throw new T;for(var p=l-1,g=-1,s=l-1;s>a;s--){var x=s-a,d=x*x*(l-s)*(i-t[s]);d>g&&(p=s,g=d)}return p<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(Fl),Hl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ql=function(r){Hl(e,r);function e(t){var n=r.call(this,t)||this;return n.matrix=null,n}return e.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var t=this.getLuminanceSource(),n=t.getWidth(),i=t.getHeight();if(n>=e.MINIMUM_DIMENSION&&i>=e.MINIMUM_DIMENSION){var a=t.getMatrix(),o=n>>e.BLOCK_SIZE_POWER;(n&e.BLOCK_SIZE_MASK)!==0&&o++;var s=i>>e.BLOCK_SIZE_POWER;(i&e.BLOCK_SIZE_MASK)!==0&&s++;var l=e.calculateBlackPoints(a,o,s,n,i),u=new Ke(n,i);e.calculateThresholdForBlock(a,o,s,n,i,l,u),this.matrix=u}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,n,i,a,o,s,l){for(var u=o-e.BLOCK_SIZE,c=a-e.BLOCK_SIZE,d=0;d<i;d++){var h=d<<e.BLOCK_SIZE_POWER;h>u&&(h=u);for(var p=e.cap(d,2,i-3),g=0;g<n;g++){var x=g<<e.BLOCK_SIZE_POWER;x>c&&(x=c);for(var w=e.cap(g,2,n-3),m=0,y=-2;y<=2;y++){var A=s[p+y];m+=A[w-2]+A[w-1]+A[w]+A[w+1]+A[w+2]}var S=m/25;e.thresholdBlock(t,x,h,S,a,l)}}},e.cap=function(t,n,i){return t<n?n:t>i?i:t},e.thresholdBlock=function(t,n,i,a,o,s){for(var l=0,u=i*o+n;l<e.BLOCK_SIZE;l++,u+=o)for(var c=0;c<e.BLOCK_SIZE;c++)(t[u+c]&255)<=a&&s.set(n+c,i+l)},e.calculateBlackPoints=function(t,n,i,a,o){for(var s=o-e.BLOCK_SIZE,l=a-e.BLOCK_SIZE,u=new Array(i),c=0;c<i;c++){u[c]=new Int32Array(n);var d=c<<e.BLOCK_SIZE_POWER;d>s&&(d=s);for(var h=0;h<n;h++){var p=h<<e.BLOCK_SIZE_POWER;p>l&&(p=l);for(var g=0,x=255,w=0,m=0,y=d*a+p;m<e.BLOCK_SIZE;m++,y+=a){for(var A=0;A<e.BLOCK_SIZE;A++){var S=t[y+A]&255;g+=S,S<x&&(x=S),S>w&&(w=S)}if(w-x>e.MIN_DYNAMIC_RANGE)for(m++,y+=a;m<e.BLOCK_SIZE;m++,y+=a)for(var A=0;A<e.BLOCK_SIZE;A++)g+=t[y+A]&255}var O=g>>e.BLOCK_SIZE_POWER*2;if(w-x<=e.MIN_DYNAMIC_RANGE&&(O=x/2,c>0&&h>0)){var N=(u[c-1][h]+2*u[c][h-1]+u[c-1][h-1])/4;x<N&&(O=N)}u[c][h]=O}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=e.BLOCK_SIZE*5,e.MIN_DYNAMIC_RANGE=24,e}(Gl),qr=function(){function r(e,t){this.width=e,this.height=t}return r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.isCropSupported=function(){return!1},r.prototype.crop=function(e,t,n,i){throw new Hr("This luminance source does not support cropping.")},r.prototype.isRotateSupported=function(){return!1},r.prototype.rotateCounterClockwise=function(){throw new Hr("This luminance source does not support rotation by 90 degrees.")},r.prototype.rotateCounterClockwise45=function(){throw new Hr("This luminance source does not support rotation by 45 degrees.")},r.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),t=new X,n=0;n<this.height;n++){for(var i=this.getRow(n,e),a=0;a<this.width;a++){var o=i[a]&255,s=void 0;o<64?s="#":o<128?s="+":o<192?s=".":s=" ",t.append(s)}t.append(`
|
|
239
239
|
`)}return t.toString()},r}(),Xl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),qn=function(r){Xl(e,r);function e(t){var n=r.call(this,t.getWidth(),t.getHeight())||this;return n.delegate=t,n}return e.prototype.getRow=function(t,n){for(var i=this.delegate.getRow(t,n),a=this.getWidth(),o=0;o<a;o++)i[o]=255-(i[o]&255);return i},e.prototype.getMatrix=function(){for(var t=this.delegate.getMatrix(),n=this.getWidth()*this.getHeight(),i=new Uint8ClampedArray(n),a=0;a<n;a++)i[a]=255-(t[a]&255);return i},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(t,n,i,a){return new e(this.delegate.crop(t,n,i,a))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(qr),$l=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Wl=function(r){$l(e,r);function e(t){var n=r.call(this,t.width,t.height)||this;return n.canvas=t,n.tempCanvasElement=null,n.buffer=e.makeBufferFromCanvasImageData(t),n}return e.makeBufferFromCanvasImageData=function(t){var n=t.getContext("2d").getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(n.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,n,i){var a=new Uint8ClampedArray(n*i);if(e.FRAME_INDEX=!e.FRAME_INDEX,e.FRAME_INDEX)for(var o=0,s=0,l=t.length;o<l;o+=4,s++){var u=void 0,c=t[o+3];if(c===0)u=255;else{var d=t[o],h=t[o+1],p=t[o+2];u=306*d+601*h+117*p+512>>10}a[s]=u}else for(var o=0,s=0,g=t.length;o<g;o+=4,s++){var u=void 0,c=t[o+3];if(c===0)u=255;else{var d=t[o],h=t[o+1],p=t[o+2];u=306*d+601*h+117*p+512>>10}a[s]=255-u}return a},e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new R("Requested row is outside the image: "+t);var i=this.getWidth(),a=t*i;return n===null?n=this.buffer.slice(a,a+i):(n.length<i&&(n=new Uint8ClampedArray(i)),n.set(this.buffer.slice(a,a+i))),n},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,n,i,a){return r.prototype.crop.call(this,t,n,i,a),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var n=this.getTempCanvasElement(),i=n.getContext("2d"),a=t*e.DEGREE_TO_RADIANS,o=this.canvas.width,s=this.canvas.height,l=Math.ceil(Math.abs(Math.cos(a))*o+Math.abs(Math.sin(a))*s),u=Math.ceil(Math.abs(Math.sin(a))*o+Math.abs(Math.cos(a))*s);return n.width=l,n.height=u,i.translate(l/2,u/2),i.rotate(a),i.drawImage(this.canvas,o/-2,s/-2),this.buffer=e.makeBufferFromCanvasImageData(n),this},e.prototype.invert=function(){return new qn(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e.FRAME_INDEX=!0,e}(qr),jl=function(){function r(e,t,n){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=n||void 0}return r.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},r}(),Fe=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(d){o(d)}}function l(c){try{u(n.throw(c))}catch(d){o(d)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(r,e||[])).next())})},Pe=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(c){u=[6,c],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Yl=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Bt=function(){function r(e,t,n){t===void 0&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(r.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return Fe(this,void 0,void 0,function(){var e,t,n,i,a,o,s,l,u,c,d,h;return Pe(this,function(p){switch(p.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),t=[];try{for(n=Yl(e),i=n.next();!i.done;i=n.next())a=i.value,o=a.kind==="video"?"videoinput":a.kind,o==="videoinput"&&(s=a.deviceId||a.id,l=a.label||"Video device "+(t.length+1),u=a.groupId,c={deviceId:s,label:l,kind:o,groupId:u},t.push(c))}catch(g){d={error:g}}finally{try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(d)throw d.error}}return[2,t]}})})},r.prototype.getVideoInputDevices=function(){return Fe(this,void 0,void 0,function(){var e;return Pe(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=t.sent(),[2,e.map(function(n){return new jl(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(e){return Fe(this,void 0,void 0,function(){var t;return Pe(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=n.sent(),t?[2,t.find(function(i){return i.deviceId===e})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(e,t){return Fe(this,void 0,void 0,function(){return Pe(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(e,t){return Fe(this,void 0,void 0,function(){var n,i;return Pe(this,function(a){switch(a.label){case 0:return this.reset(),e?n={deviceId:{exact:e}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,t)];case 1:return[2,a.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(e,t){return Fe(this,void 0,void 0,function(){var n;return Pe(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(e,t){return Fe(this,void 0,void 0,function(){var n,i;return Pe(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=a.sent(),[4,this.decodeOnce(n)];case 2:return i=a.sent(),[2,i]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,n){return Fe(this,void 0,void 0,function(){return Pe(this,function(i){switch(i.label){case 0:return[4,this.decodeFromVideoDevice(e,t,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromVideoDevice=function(e,t,n){return Fe(this,void 0,void 0,function(){var i,a;return Pe(this,function(o){switch(o.label){case 0:return e?i={deviceId:{exact:e}}:i={facingMode:"environment"},a={video:i},[4,this.decodeFromConstraints(a,t,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromConstraints=function(e,t,n){return Fe(this,void 0,void 0,function(){var i;return Pe(this,function(a){switch(a.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return i=a.sent(),[4,this.decodeFromStream(i,t,n)];case 2:return[2,a.sent()]}})})},r.prototype.decodeFromStream=function(e,t,n){return Fe(this,void 0,void 0,function(){var i;return Pe(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return i=a.sent(),[4,this.decodeContinuously(i,n)];case 2:return[2,a.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(e,t){return Fe(this,void 0,void 0,function(){var n;return Pe(this,function(i){switch(i.label){case 0:return n=this.prepareVideoElement(t),this.addVideoSource(n,e),this.videoElement=n,this.stream=e,[4,this.playVideoOnLoadAsync(n)];case 1:return i.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise(function(n,i){return t.playVideoOnLoad(e,function(){return n()})})},r.prototype.playVideoOnLoad=function(e,t){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)},r.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},r.prototype.tryPlayVideo=function(e){return Fe(this,void 0,void 0,function(){return Pe(this,function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new We("element with id '"+e+"' not found");if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new We("element with id '"+e+"' must be an "+t+" element");return n},r.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new We("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},r.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new We("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},r.prototype.decodeFromVideoContinuously=function(e,t,n){if(e===void 0&&t===void 0)throw new We("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)},r.prototype.decodeFromImageElement=function(e){if(!e)throw new We("An image element must be provided.");this.reset();var t=this.prepareImageElement(e);this.imageElement=t;var n;return this.isImageLoaded(t)?n=this.decodeOnce(t,!1,!0):n=this._decodeOnLoadImage(t),n},r.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},r.prototype.decodeFromVideoElementContinuously=function(e,t){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)},r.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new We("A video element must be provided.");this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},r.prototype.decodeFromImageUrl=function(e){if(!e)throw new We("An URL must be provided.");this.reset();var t=this.prepareImageElement();this.imageElement=t;var n=this._decodeOnLoadImage(t);return t.src=e,n},r.prototype.decodeFromVideoUrl=function(e){if(!e)throw new We("An URL must be provided.");this.reset();var t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n},r.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new We("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),i=this.decodeFromVideoElementContinuously(n,t);return n.src=e,i},r.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise(function(n,i){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(n,i)},e.addEventListener("load",t.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(e){return Fe(this,void 0,void 0,function(){return Pe(this,function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(e,t){return Fe(this,void 0,void 0,function(){return Pe(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),this.decodeContinuously(e,t),[2]}})})},r.prototype.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},r.prototype.prepareImageElement=function(e){var t;return typeof e>"u"&&(t=document.createElement("img"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t},r.prototype.prepareVideoElement=function(e){var t;return!e&&typeof document<"u"&&(t=document.createElement("video"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t},r.prototype.decodeOnce=function(e,t,n){var i=this;t===void 0&&(t=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var a=function(o,s){if(i._stopAsyncDecode){s(new T("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var l=i.decode(e);o(l)}catch(h){var u=t&&h instanceof T,c=h instanceof ye||h instanceof F,d=c&&n;if(u||d)return setTimeout(a,i._timeBetweenDecodingAttempts,o,s);s(h)}};return new Promise(function(o,s){return a(o,s)})},r.prototype.decodeContinuously=function(e,t){var n=this;this._stopContinuousDecode=!1;var i=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var a=n.decode(e);t(a,null),setTimeout(i,n.timeBetweenScansMillis)}catch(l){t(null,l);var o=l instanceof ye||l instanceof F,s=l instanceof T;(o||s)&&setTimeout(i,n._timeBetweenDecodingAttempts)}};i()},r.prototype.decode=function(e){var t=this.createBinaryBitmap(e);return this.decodeBitmap(t)},r.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e),e instanceof HTMLVideoElement?this.drawFrameOnCanvas(e):this.drawImageOnCanvas(e);var t=this.getCaptureCanvas(e),n=new Wl(t),i=new ql(n);return new Dl(i)},r.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),n=void 0;try{n=t.getContext("2d",{willReadFrequently:!0})}catch{n=t.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},r.prototype.drawImageOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},r.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},r.prototype.createCaptureCanvas=function(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var t=document.createElement("canvas"),n,i;return typeof e<"u"&&(e instanceof HTMLVideoElement?(n=e.videoWidth,i=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,i=e.naturalHeight||e.height)),t.style.width=n+"px",t.style.height=i+"px",t.width=n,t.height=i,t},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},r.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},r.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},r.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},r.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},r.prototype.addVideoSource=function(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}},r.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},r}(),be=function(){function r(e,t,n,i,a,o){n===void 0&&(n=t==null?0:8*t.length),o===void 0&&(o=ae.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=i,this.format=a,this.timestamp=o,this.text=e,this.rawBytes=t,n==null?this.numBits=t==null?0:8*t.length:this.numBits=n,this.resultPoints=i,this.format=a,this.resultMetadata=null,o==null?this.timestamp=ae.currentTimeMillis():this.timestamp=o}return r.prototype.getText=function(){return this.text},r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.getBarcodeFormat=function(){return this.format},r.prototype.getResultMetadata=function(){return this.resultMetadata},r.prototype.putMetadata=function(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},r.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},r.prototype.addResultPoints=function(e){var t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){var n=new Array(t.length+e.length);ae.arraycopy(t,0,n,0,t.length),ae.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r}(),Xn;(function(r){r[r.AZTEC=0]="AZTEC",r[r.CODABAR=1]="CODABAR",r[r.CODE_39=2]="CODE_39",r[r.CODE_93=3]="CODE_93",r[r.CODE_128=4]="CODE_128",r[r.DATA_MATRIX=5]="DATA_MATRIX",r[r.EAN_8=6]="EAN_8",r[r.EAN_13=7]="EAN_13",r[r.ITF=8]="ITF",r[r.MAXICODE=9]="MAXICODE",r[r.PDF_417=10]="PDF_417",r[r.QR_CODE=11]="QR_CODE",r[r.RSS_14=12]="RSS_14",r[r.RSS_EXPANDED=13]="RSS_EXPANDED",r[r.UPC_A=14]="UPC_A",r[r.UPC_E=15]="UPC_E",r[r.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Xn||(Xn={}));const P=Xn;var $n;(function(r){r[r.OTHER=0]="OTHER",r[r.ORIENTATION=1]="ORIENTATION",r[r.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",r[r.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",r[r.ISSUE_NUMBER=4]="ISSUE_NUMBER",r[r.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",r[r.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",r[r.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",r[r.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",r[r.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",r[r.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})($n||($n={}));const _e=$n;var Xr=function(){function r(e,t,n,i,a,o){a===void 0&&(a=-1),o===void 0&&(o=-1),this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=i,this.structuredAppendSequenceNumber=a,this.structuredAppendParity=o,this.numBits=e==null?0:8*e.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(e){this.numBits=e},r.prototype.getText=function(){return this.text},r.prototype.getByteSegments=function(){return this.byteSegments},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getErrorsCorrected=function(){return this.errorsCorrected},r.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(e){this.erasures=e},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(e){this.other=e},r.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},r.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},r.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},r}(),cr=function(){function r(){}return r.prototype.exp=function(e){return this.expTable[e]},r.prototype.log=function(e){if(e===0)throw new R;return this.logTable[e]},r.addOrSubtract=function(e,t){return e^t},r}(),nt=function(){function r(e,t){if(t.length===0)throw new R;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var i=1;i<n&&t[i]===0;)i++;i===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-i),ae.arraycopy(t,i,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return r.prototype.getCoefficients=function(){return this.coefficients},r.prototype.getDegree=function(){return this.coefficients.length-1},r.prototype.isZero=function(){return this.coefficients[0]===0},r.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},r.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var t=this.coefficients,n;if(e===1){n=0;for(var i=0,a=t.length;i!==a;i++){var o=t[i];n=cr.addOrSubtract(n,o)}return n}n=t[0];for(var s=t.length,l=this.field,i=1;i<s;i++)n=cr.addOrSubtract(l.multiply(e,n),t[i]);return n},r.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new R("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var t=this.coefficients,n=e.coefficients;if(t.length>n.length){var i=t;t=n,n=i}var a=new Int32Array(n.length),o=n.length-t.length;ae.arraycopy(n,0,a,0,o);for(var s=o;s<n.length;s++)a[s]=cr.addOrSubtract(t[s-o],n[s]);return new r(this.field,a)},r.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new R("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var t=this.coefficients,n=t.length,i=e.coefficients,a=i.length,o=new Int32Array(n+a-1),s=this.field,l=0;l<n;l++)for(var u=t[l],c=0;c<a;c++)o[l+c]=cr.addOrSubtract(o[l+c],s.multiply(u,i[c]));return new r(s,o)},r.prototype.multiplyScalar=function(e){if(e===0)return this.field.getZero();if(e===1)return this;for(var t=this.coefficients.length,n=this.field,i=new Int32Array(t),a=this.coefficients,o=0;o<t;o++)i[o]=n.multiply(a[o],e);return new r(n,i)},r.prototype.multiplyByMonomial=function(e,t){if(e<0)throw new R;if(t===0)return this.field.getZero();for(var n=this.coefficients,i=n.length,a=new Int32Array(i+e),o=this.field,s=0;s<i;s++)a[s]=o.multiply(n[s],t);return new r(o,a)},r.prototype.divide=function(e){if(!this.field.equals(e.field))throw new R("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new R("Divide by 0");for(var t=this.field,n=t.getZero(),i=this,a=e.getCoefficient(e.getDegree()),o=t.inverse(a);i.getDegree()>=e.getDegree()&&!i.isZero();){var s=i.getDegree()-e.getDegree(),l=t.multiply(i.getCoefficient(i.getDegree()),o),u=e.multiplyByMonomial(s,l),c=t.buildMonomial(s,l);n=n.addOrSubtract(c),i=i.addOrSubtract(u)}return[n,i]},r.prototype.toString=function(){for(var e="",t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=" - ",n=-n):e.length>0&&(e+=" + "),t===0||n!==1){var i=this.field.log(n);i===0?e+="1":i===1?e+="a":(e+="a^",e+=i)}t!==0&&(t===1?e+="x":(e+="x^",e+=t))}}return e},r}(),Zl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ma=function(r){Zl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ArithmeticException",e}(Le),Kl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ze=function(r){Kl(e,r);function e(t,n,i){var a=r.call(this)||this;a.primitive=t,a.size=n,a.generatorBase=i;for(var o=new Int32Array(n),s=1,l=0;l<n;l++)o[l]=s,s*=2,s>=n&&(s^=t,s&=n-1);a.expTable=o;for(var u=new Int32Array(n),l=0;l<n-1;l++)u[o[l]]=l;return a.logTable=u,a.zero=new nt(a,Int32Array.from([0])),a.one=new nt(a,Int32Array.from([1])),a}return e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,n){if(t<0)throw new R;if(n===0)return this.zero;var i=new Int32Array(t+1);return i[0]=n,new nt(this,i)},e.prototype.inverse=function(t){if(t===0)throw new ma;return this.expTable[this.size-this.logTable[t]-1]},e.prototype.multiply=function(t,n){return t===0||n===0?0:this.expTable[(this.logTable[t]+this.logTable[n])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+$.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(t){return t===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(cr),Ql=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),$r=function(r){Ql(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ReedSolomonException",e}(Le),Jl=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),dr=function(r){Jl(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IllegalStateException",e}(Le),Wr=function(){function r(e){this.field=e}return r.prototype.decode=function(e,t){for(var n=this.field,i=new nt(n,e),a=new Int32Array(t),o=!0,s=0;s<t;s++){var l=i.evaluateAt(n.exp(s+n.getGeneratorBase()));a[a.length-1-s]=l,l!==0&&(o=!1)}if(!o)for(var u=new nt(n,a),c=this.runEuclideanAlgorithm(n.buildMonomial(t,1),u,t),d=c[0],h=c[1],p=this.findErrorLocations(d),g=this.findErrorMagnitudes(h,p),s=0;s<p.length;s++){var x=e.length-1-n.log(p[s]);if(x<0)throw new $r("Bad error location");e[x]=ze.addOrSubtract(e[x],g[s])}},r.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var i=e;e=t,t=i}for(var a=this.field,o=e,s=t,l=a.getZero(),u=a.getOne();s.getDegree()>=(n/2|0);){var c=o,d=l;if(o=s,l=u,o.isZero())throw new $r("r_{i-1} was zero");s=c;for(var h=a.getZero(),p=o.getCoefficient(o.getDegree()),g=a.inverse(p);s.getDegree()>=o.getDegree()&&!s.isZero();){var x=s.getDegree()-o.getDegree(),w=a.multiply(s.getCoefficient(s.getDegree()),g);h=h.addOrSubtract(a.buildMonomial(x,w)),s=s.addOrSubtract(o.multiplyByMonomial(x,w))}if(u=h.multiply(l).addOrSubtract(d),s.getDegree()>=o.getDegree())throw new dr("Division algorithm failed to reduce polynomial?")}var m=u.getCoefficient(0);if(m===0)throw new $r("sigmaTilde(0) was zero");var y=a.inverse(m),A=u.multiplyScalar(y),S=s.multiplyScalar(y);return[A,S]},r.prototype.findErrorLocations=function(e){var t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);for(var n=new Int32Array(t),i=0,a=this.field,o=1;o<a.getSize()&&i<t;o++)e.evaluateAt(o)===0&&(n[i]=a.inverse(o),i++);if(i!==t)throw new $r("Error locator degree does not match number of roots");return n},r.prototype.findErrorMagnitudes=function(e,t){for(var n=t.length,i=new Int32Array(n),a=this.field,o=0;o<n;o++){for(var s=a.inverse(t[o]),l=1,u=0;u<n;u++)if(o!==u){var c=a.multiply(t[u],s),d=(c&1)===0?c|1:c&-2;l=a.multiply(l,d)}i[o]=a.multiply(e.evaluateAt(s),a.inverse(l)),a.getGeneratorBase()!==0&&(i[o]=a.multiply(i[o],s))}return i},r}(),Ae;(function(r){r[r.UPPER=0]="UPPER",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.DIGIT=3]="DIGIT",r[r.PUNCT=4]="PUNCT",r[r.BINARY=5]="BINARY"})(Ae||(Ae={}));var _a=function(){function r(){}return r.prototype.decode=function(e){this.ddata=e;var t=e.getBits(),n=this.extractBits(t),i=this.correctBits(n),a=r.convertBoolArrayToByteArray(i),o=r.getEncodedData(i),s=new Xr(a,o,null,null);return s.setNumBits(i.length),s},r.highLevelDecode=function(e){return this.getEncodedData(e)},r.getEncodedData=function(e){for(var t=e.length,n=Ae.UPPER,i=Ae.UPPER,a="",o=0;o<t;)if(i===Ae.BINARY){if(t-o<5)break;var s=r.readCode(e,o,5);if(o+=5,s===0){if(t-o<11)break;s=r.readCode(e,o,11)+31,o+=11}for(var l=0;l<s;l++){if(t-o<8){o=t;break}var u=r.readCode(e,o,8);a+=Y.castAsNonUtf8Char(u),o+=8}i=n}else{var c=i===Ae.DIGIT?4:5;if(t-o<c)break;var u=r.readCode(e,o,c);o+=c;var d=r.getCharacter(i,u);d.startsWith("CTRL_")?(n=i,i=r.getTable(d.charAt(5)),d.charAt(6)==="L"&&(n=i)):(a+=d,i=n)}return a},r.getTable=function(e){switch(e){case"L":return Ae.LOWER;case"P":return Ae.PUNCT;case"M":return Ae.MIXED;case"D":return Ae.DIGIT;case"B":return Ae.BINARY;case"U":default:return Ae.UPPER}},r.getCharacter=function(e,t){switch(e){case Ae.UPPER:return r.UPPER_TABLE[t];case Ae.LOWER:return r.LOWER_TABLE[t];case Ae.MIXED:return r.MIXED_TABLE[t];case Ae.PUNCT:return r.PUNCT_TABLE[t];case Ae.DIGIT:return r.DIGIT_TABLE[t];default:throw new dr("Bad table")}},r.prototype.correctBits=function(e){var t,n;this.ddata.getNbLayers()<=2?(n=6,t=ze.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,t=ze.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,t=ze.AZTEC_DATA_10):(n=12,t=ze.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),a=e.length/n;if(a<i)throw new F;for(var o=e.length%n,s=new Int32Array(a),l=0;l<a;l++,o+=n)s[l]=r.readCode(e,o,n);try{var u=new Wr(t);u.decode(s,a-i)}catch(w){throw new F(w)}for(var c=(1<<n)-1,d=0,l=0;l<i;l++){var h=s[l];if(h===0||h===c)throw new F;(h===1||h===c-1)&&d++}for(var p=new Array(i*n-d),g=0,l=0;l<i;l++){var h=s[l];if(h===1||h===c-1)p.fill(h>1,g,g+n-1),g+=n-1;else for(var x=n-1;x>=0;--x)p[g++]=(h&1<<x)!==0}return p},r.prototype.extractBits=function(e){var t=this.ddata.isCompact(),n=this.ddata.getNbLayers(),i=(t?11:14)+n*4,a=new Int32Array(i),o=new Array(this.totalBitsInLayer(n,t));if(t)for(var s=0;s<a.length;s++)a[s]=s;else for(var l=i+1+2*$.truncDivision($.truncDivision(i,2)-1,15),u=i/2,c=$.truncDivision(l,2),s=0;s<u;s++){var d=s+$.truncDivision(s,15);a[u-s-1]=c-d-1,a[u+s]=c+d+1}for(var s=0,h=0;s<n;s++){for(var p=(n-s)*4+(t?9:12),g=s*2,x=i-1-g,w=0;w<p;w++)for(var m=w*2,y=0;y<2;y++)o[h+m+y]=e.get(a[g+y],a[g+w]),o[h+2*p+m+y]=e.get(a[g+w],a[x-y]),o[h+4*p+m+y]=e.get(a[x-y],a[x-w]),o[h+6*p+m+y]=e.get(a[x-w],a[g+y]);h+=p*8}return o},r.readCode=function(e,t,n){for(var i=0,a=t;a<t+n;a++)i<<=1,e[a]&&(i|=1);return i},r.readByte=function(e,t){var n=e.length-t;return n>=8?r.readCode(e,t,8):r.readCode(e,t,n)<<8-n},r.convertBoolArrayToByteArray=function(e){for(var t=new Uint8Array((e.length+7)/8),n=0;n<t.length;n++)t[n]=r.readByte(e,8*n);return t},r.prototype.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},r.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],r.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],r.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
|