@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1 lines • 1.86 MB
JavaScript
(function(re,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("lodash-es"),require("bignumber.js"),require("vue-i18n"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","bignumber.js","vue-i18n","@vueuse/core"],t):(re=typeof globalThis<"u"?globalThis:re||self,t(re.FarrisVue={},re.vue,re.lodashEs,re.BigNumber,re.vueI18n,re.core))})(this,function(re,t,ce,ct,ut,si){"use strict";var q2=Object.defineProperty;var z2=(re,t,ce)=>t in re?q2(re,t,{enumerable:!0,configurable:!0,writable:!0,value:ce}):re[t]=ce;var G=(re,t,ce)=>z2(re,typeof t!="symbol"?t+"":t,ce);function bf(e,n){let o;function a(f){const{properties:u,title:m,ignore:h}=f,g=h&&Array.isArray(h),y=Object.keys(u).reduce((v,b)=>((!g||!h.find(w=>w===b))&&(v[b]=u[b].type==="object"&&u[b].properties?a(u[b]):ce.cloneDeep(u[b].default)),v),{});if(m&&(!g||!h.find(v=>v==="id"))){const v=m.toLowerCase().replace(/-/g,"_");y.id=`${v}_${Math.random().toString().slice(2,6)}`}return y}function i(f){const{properties:u,title:m,required:h}=f;if(h&&Array.isArray(h)){const g=h.reduce((y,v)=>(y[v]=u[v].type==="object"&&u[v].properties?a(u[v]):ce.cloneDeep(u[v].default),y),{});if(m&&h.find(y=>y==="id")){const y=m.toLowerCase().replace(/-/g,"_");g.id=`${y}_${Math.random().toString().slice(2,6)}`}return g}return{type:m}}function r(f,u={},m){const h=e[f];if(h){let g=i(h);const y=n[f];return g=y?y({getSchemaByType:r},g,u,m):g,o!=null&&o.appendIdentifyForNewControl&&o.appendIdentifyForNewControl(g),g}return null}function l(f,u){const m=a(u);return Object.keys(m).reduce((h,g)=>(Object.prototype.hasOwnProperty.call(f,g)&&(h[g]&&ce.isPlainObject(h[g])&&ce.isPlainObject(f[g]||!f[g])?Object.assign(h[g],f[g]||{}):h[g]=f[g]),h),m),m}function s(f,u){return Object.keys(f).filter(h=>f[h]!=null).reduce((h,g)=>{if(u.has(g)){const y=u.get(g);if(typeof y=="string")h[y]=f[g];else{const v=y(g,f[g],f);Object.assign(h,v)}}else h[g]=f[g];return h},{})}function c(f,u,m=new Map){const h=l(f,u);return s(h,m)}function d(f){var m;const u=f.type;if(u){const h=e[u];if(!h)return f;const g=l(f,h),y=((m=f.editor)==null?void 0:m.type)||"";if(y){const v=e[y],b=l(f.editor,v);g.editor=b}return g}return f}function p(f){o=f}return{getSchemaByType:r,resolveSchemaWithDefaultValue:d,resolveSchemaToProps:c,mappingSchemaToProps:s,setDesignerContext:p}}const Xo={},ks={},{getSchemaByType:Mn,resolveSchemaWithDefaultValue:vf,resolveSchemaToProps:Cf,mappingSchemaToProps:wf,setDesignerContext:Sf}=bf(Xo,ks);function fw(e={}){function n(d,p,f,u){if(typeof f=="number")return u[d].length===f;if(typeof f=="object"){const m=Object.keys(f)[0],h=f[m];if(m==="not")return Number(u[d].length)!==Number(h);if(m==="moreThan")return Number(u[d].length)>=Number(h);if(m==="lessThan")return Number(u[d].length)<=Number(h)}return!1}function o(d,p,f,u){return u[d]&&u[d].propertyValue&&String(u[d].propertyValue.value)===String(f)}const a=new Map([["length",n],["getProperty",o]]);Object.keys(e).reduce((d,p)=>(d.set(p,e[p]),d),a);function i(d,p){const f=d;return typeof p=="number"?[{target:f,operator:"length",param:null,value:Number(p)}]:typeof p=="boolean"?[{target:f,operator:"getProperty",param:d,value:!!p}]:typeof p=="object"?Object.keys(p).map(u=>{if(u==="length")return{target:f,operator:"length",param:null,value:p[u]};const m=u,h=p[u];return{target:f,operator:"getProperty",param:m,value:h}}):[]}function r(d){return Object.keys(d).reduce((f,u)=>{const m=i(u,d[u]);return f.push(...m),f},[])}function l(d,p){if(a.has(d.operator)){const f=a.get(d.operator);return f&&f(d.target,d.param,d.value,p)||!1}return!1}function s(d,p){return r(d).reduce((m,h)=>m&&l(h,p),!0)}function c(d,p){const f=Object.keys(d),u=f.includes("allOf"),m=f.includes("anyOf"),h=u||m,v=(h?d[h?u?"allOf":"anyOf":"allOf"]:[d]).map(w=>s(w,p));return u?!v.includes(!1):v.includes(!0)}return{parseValueSchema:c}}const pw={convertTo:(e,n,o,a)=>{e.appearance||(e.appearance={}),e.appearance[n]=o},convertFrom:(e,n,o)=>e.appearance?e.appearance[n]:e[n]},mw={convertFrom:(e,n,o)=>e.buttons&&e.buttons.length?`共 ${e.buttons.length} 项`:"无"},hw={convertTo:(e,n,o,a)=>{e.editor&&(e.editor[n]=o)},convertFrom:(e,n,o)=>e.editor&&Object.prototype.hasOwnProperty.call(e.editor,n)?e.editor[n]:e[n]},pe={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"list-view":{type:"list-view",name:"列表"},"filter-bar":{type:"filter-bar",name:"筛选条"},"language-textbox":{type:"language-textbox",name:"多语输入框"}},gw={convertFrom:(e,n,o)=>{var i;const a=e.editor&&e.editor[n]?e.editor[n]:e[n];return((i=pe[a])==null?void 0:i.name)||a}},yw={convertTo:(e,n,o,a)=>{e[n]=e[n]},convertFrom:(e,n,o)=>e.editor?o.getRealEditorType(e.editor.type):""},bw={convertTo:(e,n,o,a)=>{(e.type==="data-grid-column"||e.type==="tree-grid-column")&&(e.formatter?e.formatter[n]=o:e.formatter={[n]:o})},convertFrom:(e,n,o)=>{if(e.formatter){if(n==="trueText")return e.formatter.trueText;if(n==="falseText")return e.formatter.falseText;if(n==="prefix")return e.formatter.prefix;if(n==="suffix")return e.formatter.suffix;if(n==="precision")return e.formatter.precision;if(n==="decimal")return e.formatter.decimal;if(n==="thousand")return e.formatter.thousand;if(n==="tempDateFormat")return e.formatter.dateFormat==="yyyy年MM月dd日"?"yearMonthDay":e.formatter.dateFormat==="yyyy-MM-dd HH:mm:ss"?"yyyy-MM-ddTHH:mm:ss":e.formatter.dateFormat==="yyyy/MM/dd HH:mm:ss"?"yyyy/MM/ddTHH:mm:ss":e.formatter.dateFormat==="yyyy年MM月dd日 HH时mm分ss秒"?"yearMonthDayHourMinuteSecond":e.formatter.tempDateFormat||e.formatter.dateFormat||"yyyy-MM-dd";if(n==="customFormat")return e.formatter.customFormat;if(n==="type")return e.formatter.type||"none"}return"none"}},vw={convertTo:(e,n,o,a)=>{e.command?e.command[n]=o:e.command={[n]:o},n==="enable"&&o&&(e.command.commands||(e.command.commands=[{text:"编辑",type:"primary",command:"edit"},{text:"删除",type:"danger",command:"remove"}]))},convertFrom:(e,n,o)=>e.command&&n==="enable"?e.command.enable:""},Cw={convertTo:(e,n,o,a)=>{e.column?e.column[n]=o:e.column={[n]:o},n==="fitColumns"&&o&&(e.column.fitMode||(e.column.fitMode="average"))},convertFrom:(e,n,o)=>{if(e.column){if(n==="fitColumns")return e.column.fitColumns;if(n==="fitMode")return e.column.fitMode}return""}},ww={convertTo:(e,n,o,a)=>{e.summary?e.summary[n]=o:e.summary={[n]:o},n==="enable"&&o&&(e.summary?e.summary.groupFields||(e.summary.groupFields=[]):e.summary={enable:o,groupFields:[]})},convertFrom:(e,n,o)=>e.summary&&n==="enable"?e.summary.enable:e.type==="data-grid-column"?e.enableSummary===void 0?!1:e.enableSummary:""},Sw={convertTo:(e,n,o,a)=>{e.group?e.group[n]=o:e.group={[n]:o},n==="enable"&&o&&(e.group?e.group.groupFields||(e.group.groupFields=[]):e.group={enable:o,groupFields:[],showSummary:!1})},convertFrom:(e,n,o)=>{if(e.group){if(n==="enable")return e.group.enable;if(n==="showSummary")return e.group.showSummary}}},Vw={convertFrom:(e,n)=>e.binding?e.binding.path:"",convertTo:(e,n,o)=>{if(o&&o.length>0){const a=o[0];e.binding||(e.binding={}),e.binding.type="Form",e.binding.path=a.bindingField,e.binding.field=a.id,e.binding.fullPath=a.path,e.path=a.bindingPath}}},Nw={convertTo:(e,n,o,a)=>{e.pagination||(e.pagination={}),e.pagination[n]=o},convertFrom:(e,n,o)=>e.pagination?e.pagination[n]:e[n]},Tw={convertTo:(e,n,o,a)=>{e.rowNumber||(e.rowNumber={}),e.rowNumber[n]=o},convertFrom:(e,n,o)=>e.rowNumber?e.rowNumber[n]:e[n]},xw={convertTo:(e,n,o,a)=>{e.selection||(e.selection={}),e.selection[n]=o},convertFrom:(e,n,o)=>e.selection?e.selection[n]:e[n]},kw={convertFrom:(e,n,o)=>e[n]&&e[n].length?`共 ${e[n].length} 项`:""},Fw={convertFrom:(e,n)=>e[n]||"",convertTo:(e,n,o)=>{e[n]=o}},Mw={convertTo:(e,n,o,a)=>{e.size||(e.size={}),e.size[n]=o},convertFrom:(e,n,o)=>e.size?e.size[n]:e[n]},Iw={convertFrom:(e,n,o)=>{var a,i;return(a=e.formatter)!=null&&a.data&&n==="formatterEnumData"&&!e.formatterEnumData?(i=e.formatter)==null?void 0:i.data:e.formatterEnumData}},Pw={convertTo:(e,n,o,a)=>{e.sort||(e.sort={}),e.sort[n]=o},convertFrom:(e,n,o)=>{var a,i;if(n==="mode")return((a=e.sort)==null?void 0:a.mode)||"client";if(n==="multiSort")return!!((i=e.sort)!=null&&i.multiSort)}},$w={convertTo:(e,n,o,a)=>{e.filter||(e.filter={}),e.filter[n]=o},convertFrom:(e,n,o)=>{var a;if(n==="mode")return((a=e.filter)==null?void 0:a.mode)||"client"}},Dw={convertTo:(e,n,o,a)=>{e.rowOption?e.rowOption[n]=o:e.rowOption={[n]:o}},convertFrom:(e,n,o)=>{if(e.rowOption){if(n==="customRowStyle")return e.rowOption.customRowStyle;if(n==="customCellStyle")return e.rowOption.customCellStyle}return""}};function Vf(e,n,o){const a=new Map([["/converter/appearance.converter",pw],["/converter/buttons.converter",mw],["/converter/property-editor.converter",hw],["/converter/items-count.converter",kw],["/converter/type.converter",gw],["/converter/change-editor.converter",yw],["/converter/change-formatter.converter",bw],["/converter/column-command.converter",vw],["/converter/column-option.converter",Cw],["/converter/summary.converter",ww],["/converter/group.converter",Sw],["/converter/form-group-label.converter",Fw],["/converter/field-selector.converter",Vw],["/converter/pagination.converter",Nw],["/converter/row-number.converter",Tw],["/converter/grid-selection.converter",xw],["/converter/size.converter",Mw],["/converter/change-formatter-enum.converter",Iw],["/converter/grid-sort.converter",Pw],["/converter/grid-filter.converter",$w],["/converter/row-option.converter",Dw]]),i=new Map([["string",{type:"input-group",enableClear:!1}],["boolean",{type:"combo-list",textField:"name",valueField:"value",idField:"value",enableClear:!1,editable:!1,data:[{value:!0,name:"是"},{value:!1,name:"否"}]}],["enum",{type:"combo-list",maxHeight:128,enableClear:!1,editable:!1}],["array",{type:"button-edit"}],["number",{type:"number-spinner",placeholder:""}],["events-editor",{type:"events-editor",hide:!0}]]),r=fw();function l(h,g){return()=>r.parseValueSchema(h,g)}function s(h,g,y){return h.includes("visible")&&g.visible!==void 0?typeof g.visible=="boolean"?()=>!!g.visible:g.visible===void 0?!0:l(g.visible,y):()=>!0}function c(h,g,y){return h.includes("readonly")&&g.readonly!==void 0?typeof g.readonly=="boolean"?()=>!!g.readonly:l(g.readonly,y):()=>!1}function d(h,g){const y=h.$converter||g;return typeof y=="string"&&y&&a.has(y)?a.get(y)||null:y||null}function p(h,g,y,v,b,w="",C=""){return Object.keys(h).map(V=>{const N=t.ref(1),S=V,x=h[V],k=Object.keys(x),M=x.title,D=x.type,P=i.get(D)||{type:"input-group",enableClear:!1},F=x.editor?Object.assign({},P,x.editor):Object.assign({},P),$=s(k,x,g),I=c(k,x,g);F.readonly=F.readonly===void 0?I():F.readonly;const E=x.type==="cascade"?p(x.properties,g,y,v,b,w,C):[],B=!0;let O=d(x,C);const R=t.computed({get(){if(N.value){if(["class","style"].find(z=>z===S)&&!O&&(O=a.get("/converter/appearance.converter")||null),O&&O.convertFrom)return O.convertFrom(y,V,b,w);const Q=y[V];return Object.prototype.hasOwnProperty.call(x,"defaultValue")&&(Q===void 0||typeof Q=="string"&&Q==="")?x.type==="boolean"?x.defaultValue:x.defaultValue||"":Q}return null},set(Q){N.value+=1,O&&O.convertTo?(O.convertTo(v,V,Q,b,w),O.convertTo(y,V,Q,b,w)):(v[V]=Q,y[V]=Q)}}),{refreshPanelAfterChanged:A,description:L,isExpand:j,parentPropertyID:W}=x,q={propertyID:S,propertyName:M,propertyType:D,propertyValue:R,editor:F,visible:$,readonly:I,cascadeConfig:E,hideCascadeTitle:B,refreshPanelAfterChanged:A,description:L,isExpand:j,parentPropertyID:W};return g[S]=q,q})}function f(h,g,y={}){const v={},b=e[h];return b&&b.categories?Object.keys(b.categories).map(C=>{const T=b.categories[C],V=T==null?void 0:T.title,N=p(T.properties||{},v,{},y,g);return{categoryId:C,categoryName:V,properties:N}}):[]}function u(h,g,y,v,b=""){const w=g.$ref.schema,C=g.$ref.converter,T=y[w],V=T.type,N=o(T),S={},x=e[V];if(x&&x.categories){const k=x.categories[h],M=k==null?void 0:k.title;C&&Object.keys(k.properties).forEach(F=>{k.properties[F].$converter=C});const D=(k==null?void 0:k.properties)||{},P=p(D,S,N,T,v,b);return{categoryId:h,categoryName:M,properties:P}}return{categoryId:h,categoryName:"",properties:[]}}function m(h,g,y,v,b){const w=h.type,C=o(h),T={};let V=b||e[w];if(V&&Object.keys(V).length===0&&y&&y.getPropConfig&&(V=y.getPropConfig(v)),V&&V.categories){const N=[];return Object.keys(V.categories).map(S=>{const x=V.categories[S];if(x.$ref){N.push(u(S,x,h,g,v));return}const k=x==null?void 0:x.title,M=x==null?void 0:x.tabId,D=x==null?void 0:x.tabName,P=x==null?void 0:x.hide,F=x==null?void 0:x.hideTitle,$=p(x.properties||{},T,C,h,g,v,x.$converter),{setPropertyRelates:I}=x,E=x==null?void 0:x.parentPropertyID;N.push({categoryId:S,categoryName:k,tabId:M,tabName:D,hide:P,properties:$,hideTitle:F,setPropertyRelates:I,parentPropertyID:E})}),N}return[]}return{getPropertyConfigBySchema:m,getPropertyConfigByType:f,propertyConverterMap:a}}const Fs={},Ms={};Vf(Fs,Ms,vf);const Nr={},Tr={},{getSchemaByType:Ia,resolveSchemaWithDefaultValue:Nf,resolveSchemaToProps:Ew,mappingSchemaToProps:Bw,setDesignerContext:Tf}=bf(Nr,Tr),ci={},xr={},{getPropertyConfigBySchema:Is,getPropertyConfigByType:U2,propertyConverterMap:G2}=Vf(ci,xr,Nf);function $e(e,n,o=new Map,a=(l,s,c,d)=>s,i={},r=l=>l){return Xo[n.title]=n,ks[n.title]=a,Fs[n.title]=i,Ms[n.title]=r,Nr[n.title]=n,Tr[n.title]=a,ci[n.title]=i,xr[n.title]=r,(l={},s=!0)=>{if(!s)return wf(l,o);const c=Cf(l,n,o),d=Object.keys(e).reduce((p,f)=>(p[f]=e[f].default,p),{});return Object.assign(d,c)}}function Ge(e,n){return{customClass:n.class,customStyle:n.style}}function xf(e,n){var a,i;const o={};if(n!=null&&n.buttons){const r=[];(a=n==null?void 0:n.buttons)==null||a.map(l=>{const s={};Object.keys(l).map(c=>{var d;c==="appearance"?s.class=((d=l[c])==null?void 0:d.class)||"":s[c]=l[c]}),r.push(s)}),o.buttons=r}return(i=n==null?void 0:n.appearance)!=null&&i.class&&(o.buttonClass=n.appearance.class||"col-6"),n!=null&&n.id&&(o.toolbarId=n.id),n&&Object.prototype.hasOwnProperty.call(n,"visible")&&(o.buttonsVisible=n.visible),o}function kf(){function e(n,o){const{id:a}=n||{};if(n.binding===void 0)return{};if(n.binding&&Object.keys(n.binding).length<1)return{};const{field:i}=n.binding||{};return{modelValue:o.getValue(a),"onUpdate:modelValue":r=>{o.setValue(a,i,r)}}}return{resolve:e}}function Ps(){function e(n,o){const{id:a}=n||{},{dataSource:i}=n||{};return i===void 0?{}:{data:o.getValue(a),"onUpdate:data":(...r)=>{}}}return{resolve:e}}function Ff(){function e(n,o){const{dataSource:a}=n||{};return a===void 0?{}:{}}return{resolve:e}}function Ow(){function e(n,o){const{path:a}=n.binding||{};return a?{"onUpdate:dataMapping":(...i)=>{}}:{}}return{resolve:e}}function Mf(){return(e,n,o)=>{const a=n.id,{type:i}=n,r=e.emits;return r?r.filter(l=>l!=="update:modelValue").reduce((l,s)=>{const c=`on${s.charAt(0).toUpperCase()}${s.slice(1)}`;return l[c]=(...d)=>{o.dispatch(a,s,i,d)},l},{}):{}}}function If(){function e(n,o){return n.selectItemById(o)}return{selectItemById:e}}function Pf(){function e(n,o){return n.selectItemById(o)}return{selectItemById:e}}function $f(){function e(n){return n.editor}return{resolve:e}}function Aw(){function e(n){return Object.prototype.hasOwnProperty.call(n,"visible")?n.visible:null}return{resolve:e}}function kr(e,n){if(!e||e.length<1)return null;for(const o of e){if(o.id===n)return o;if(o.children){const a=o.children.find(i=>i.id===n);if(a)return a}}return null}function Rw(){function e(n,o){const{name:a}=o;return n[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`]||n[a]}return{resolve:e}}function Df(){function e(n,o){var s;const a=(s=n.toolbar)==null?void 0:s.buttons;if(!a||a.length<1)return null;const[i,r]=o.payloads,l=kr(a,r);return l?l.onClick||l.click:null}return{resolve:e}}function Ef(){function e(n,o){const{name:a}=o,[i,r]=o.payloads;if(a==="tabChange"||a==="tabRemove")return n[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`];const l=n.contents;if(!l||l.length<1)return null;const s=l.reduce((d,p)=>{const f=p.toolbar&&p.toolbar.buttons||[];return d.push(...f),d},[]);if(!s||s.length<1)return;const c=kr(s,r);return c?c.onClick||c.click:null}return{resolve:e}}function Bf(){function e(n,o){const a=n.buttons;if(!a||a.length<1)return null;const[i,r]=o.payloads,l=kr(a,r);return l?l.onClick||l.click:null}return{resolve:e}}function Of(){function e(n,o){var s;const a=(s=n.toolbar)==null?void 0:s.buttons;if(!a||a.length<1)return null;const[i,r]=o.payloads,l=kr(a,r);return l?l.onClick||l.click:null}return{resolve:e}}function $s(){function e(n,o){const{columns:a}=o;return n.updateColumns(a)}return{updateColumns:e}}const Af=new Map([["appearance",Ge],["size",(e,n)=>{const o={};return n.width&&(o.width=Number(n.width)),n.height&&(o.height=Number(n.height)),o}]]),jw={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/accordion.schema.json",title:"accordion",description:"A Farris Container Component",type:"object",properties:{id:{description:"The unique identifier for a Accordion",type:"string"},type:{description:"The type string of Accordion component",type:"string",default:"accordion"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},customClass:{description:"",type:"string",default:""},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},enableFold:{description:"",type:"boolean",default:!0},expanded:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]};function Lw(e,n,o){return n}const _w={title:"accordion",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},Ds={customClass:{type:String,default:""},enableFold:{type:Boolean,default:!0},expanded:{type:Boolean,default:!1},height:{type:Number},width:{type:Number}},Rf=$e(Ds,jw,Af,Lw,_w);function jf(e){const n=e.nativeElement?e.nativeElement:e;return n.classList!==void 0&&n.classList!==null?n:null}function Lf(e,n){if(n===void 0)return;const o=jf(e);o&&o.classList.remove(n)}function Es(e,n){if(n===void 0)return;const o=jf(e);o&&o.classList.add(n)}const Hw=[{size:"sm",width:576,pattern:/\b(col-|col-sm-)\d+\b/},{size:"md",width:768,pattern:/\bcol-md-\d+\b/},{size:"lg",width:888,pattern:/\bcol-lg-\d+\b/},{size:"xl",width:1200,pattern:/\bcol-xl-\d+\b/},{size:"el",width:1690,pattern:/\bcol-el-\d+\b/}];function _f(e){e.resizeObserver&&(e.resizeObserver.disconnect(),e.sharedObject=null)}function Hf(e,n,o=0){const a=[];if(!n)return;const i=o||n.getBoundingClientRect().width,r=parseFloat(i),l=e.breakPoints;for(let s=0;s<l.length;s++)l[s].width<=r&&a.push(l[s].size);if(e.className.join(",")!==a.join(",")){if(e.className.length-a.length>0)for(let c=a.length;c<e.className.length;c++)Lf(n,"f-area-response--"+e.className[c]);else for(let c=e.className.length;c<a.length;c++)Es(n,"f-area-response--"+a[c]);e.className=[...a]}}function Ww(e,n){e.enable&&e.autoWidth?e.resizeObserver||(e.resizeObserver=new ResizeObserver(o=>{if(!o||o.length<1||!o[0].contentRect)return;const a=o[0].contentRect;Math.abs(parseInt(a.width+"")-e.width)>e.threshold&&(Hf(e,n,a.width),e.width=parseInt(a.width+""))}),e.resizeObserver.observe(n)):_f(e)}function Wf(e,n){if(e.enable)Es(n,"f-area-response"),Hf(e,n);else{Lf(n,"f-area-response");for(let o=e.className.length;o>0;o--)Es(n,"f-area-response--"+e.className[o]);e.className=[]}Ww(e,n)}function qw(e){const n=[];return Hw.map(o=>{const a="col-"+o.size+"-";if(e.querySelectorAll('[class*="'+a+'"]').length>0)n.push({size:o.size,width:o.width});else if(o.size==="sm"){const r=e.querySelectorAll('[class*="col-"]');Array.from(r).some(s=>s.className.match(o.pattern))&&n.push({size:o.size,width:o.width})}}),n}function qf(e,n,o){n.value&&Object.prototype.hasOwnProperty.call(n.value,"enable")&&(e.enable=n.value.enable),n.value&&Object.prototype.hasOwnProperty.call(n.value,"autoWidth")&&(e.autoWidth=n.value.autoWidth),e.breakPoints=qw(o)}const di={mounted:(e,n,o)=>{o.sharedObject={className:[],resizeObserver:null,enable:!0,autoWidth:!0,threshold:10,width:0,breakPoints:[]},qf(o.sharedObject,n,e),Wf(o.sharedObject,e)},updated:function(e,n,o,a){o.sharedObject=a.sharedObject,qf(o.sharedObject,n,e),Wf(o.sharedObject,e)},beforeUnmount(e,n,o){_f(o.sharedObject)}};function zf(e,n,o,a,i){const r=t.ref(e.disabled),l=t.ref(!1),s=t.ref("text"),c=t.ref(e.showBorder),d=t.ref(e.textAlign),p=t.ref(e.updateOn),f=t.ref(!1),u=t.computed(()=>e.editable||!e.readonly&&!e.disabled),m=t.computed(()=>e.editable&&!e.disabled&&!e.readonly),h=t.computed(()=>!e.disabled&&!e.readonly&&l.value),g=t.computed(()=>o.value===""||o.value===null||o.value===void 0),y=t.computed(()=>(e.disabled||e.readonly)&&!e.forcePlaceholder?"":e.placeholder),v=t.computed(()=>e.readonly||!e.editable),b=t.computed(()=>e.enableTitle?o.value:""),w=t.computed(()=>({"form-control":!0,"f-utils-fill":!0,"text-left":d.value==="left","text-center":d.value==="center","text-right":d.value==="right"})),C=t.computed(()=>{const I={"f-cmp-inputgroup":!0,"input-group":!0,"f-state-disabled":r.value,"f-state-editable":m.value,"f-state-readonly":v.value,"f-state-focus":h.value,"input-group--has-clear":e.enableClear&&f.value};return(e.customClass||"").split(" ").reduce((B,O)=>(B[O]=!0,B),I),I}),T=t.computed(()=>c.value?"":"border-width : 0 ");function V(I,E=!0){o.value=I,a.value!==I&&(a.value=I),E&&n.emit("change",I),n.emit("update:modelValue",I),n.emit("update:value",I)}t.watch(()=>e.modelValue,(I,E)=>{I!==E&&(o.value=I,a.value=I)}),t.watch(()=>e.disabled,(I,E)=>{I!==E&&(r.value=I)});function N(I){return I.stopPropagation(),l.value=!1,n.emit("blur",I),I.target.tagName==="TEXTAREA"&&(n.emit("update:modelValue",I.target.value),n.emit("update:value",I.target.value),n.emit("change",I.target.value)),!1}function S(I){n.emit("click",I)}function x(I){r.value||v.value||(c.value&&(l.value=!0),u.value&&n.emit("focus",I))}function k(I){n.emit("input",I.target.value,I);const E=I.target.value;a.value=E,p.value==="change"&&(n.emit("update:modelValue",E),n.emit("update:value",E),n.emit("change",E))}function M(I){n.emit("keydown",I)}function D(I){n.emit("keyup",I)}function P(I){const E=I.target;E.tagName!=="INPUT"&&E.tagName!=="TEXTAREA"&&I.preventDefault(),I.stopPropagation(),n.emit("mousedownEvent",I)}function F(I){n.emit("mouseupEvent",I)}function $(I){if(p.value==="blur"){const E=I.target.value;I.stopPropagation(),V(E)}}return{changeTextBoxValue:V,disabled:r,displayText:a,editable:m,hasFocused:h,inputGroupClass:C,inputType:s,isEmpty:g,modelValue:o,readonly:v,onBlur:N,hasClearClass:f,onClick:S,onFocus:x,onInput:k,onKeydown:M,onKeyup:D,onMousedown:P,onMouseup:F,onTextBoxValueChange:$,placeholder:y,textBoxClass:w,textBoxTitle:b,inputGroupStyle:T}}function zw(e,n,o,a){const i=t.ref(e.disabled),r=t.ref(!1),l=t.ref("text"),s=t.ref(e.showBorder),c=t.ref(e.textAlign);t.computed(()=>e.editable||!e.readonly);const d=t.computed(()=>e.editable&&!e.disabled&&!e.readonly),p=t.computed(()=>!e.disabled&&r.value),f=t.computed(()=>o.value===""||o.value===null||o.value===void 0),u=t.computed(()=>e.placeholder),m=t.computed(()=>e.readonly||!e.editable),h=t.computed(()=>e.enableTitle?o.value:""),g=t.computed(()=>({"form-control":!0,"text-left":c.value==="left","text-center":c.value==="center","text-right":c.value==="right"})),y=t.computed(()=>({"f-cmp-inputgroup":!0,"input-group":!0,"f-state-disabled":!0,"f-state-editable":!1,"f-state-readonly":!0})),v=t.computed(()=>s.value?"":"border-width : 0 ");function b(w,C=!0){}return{changeTextBoxValue:b,disabled:i,displayText:a,editable:d,hasFocused:p,inputGroupClass:y,inputType:l,isEmpty:f,modelValue:o,readonly:m,placeholder:u,textBoxClass:g,textBoxTitle:h,inputGroupStyle:v}}function Bs(e,n,o){const a=t.ref(!1),i=t.computed(()=>e.enableClear&&!e.readonly&&!e.disabled),{changeTextBoxValue:r,displayText:l,hasFocused:s,modelValue:c,isEmpty:d,hasClearClass:p}=o;function f(v){a.value=v,p&&(p.value=a.value)}t.watch(l,()=>{s!=null&&s.value?f(!!(l!=null&&l.value)):f(!1)});const u=t.computed(()=>({"input-group-text":!0,"input-group-clear":!0})),m=t.computed(()=>({width:"24px",display:a.value?"flex":"none"}));function h(v){v.stopPropagation(),i.value&&(r("",!0),f(!a.value),n.emit("clear"))}function g(v){var T,V;const b=((T=v.target.querySelector("input"))==null?void 0:T.value)||"",w=((V=v.target.querySelector("textarea"))==null?void 0:V.value)||"",C=b||w;C!==c.value&&(c.value=C),i.value&&f(!!C)}function y(v){i.value&&f(!1)}return{clearButtonClass:u,clearButtonStyle:m,hasShownClearButton:a,onClearValue:h,onMouseEnter:g,onMouseLeave:y,shouldShowClearButton:i}}const Uw={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},Gw={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};class Uf{constructor(){G(this,"regexes",{YEAR:"[1-9]\\d{3}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",MONTHNAME:"jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|september|oct|october|nov|november|dec|december",DAYNAME:"mon|monday|tue|tuesday|wed|wednesday|thu|thursday|fri|friday|sat|saturday|sun|sunday",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",TIMEZONE:"[+-][01]\\d\\:?[0-5]\\d",H24:"[01]\\d|2[0-3]",MIN:"[0-5]\\d",SEC:"[0-5]\\d",MS:"\\d{3,}",H12:"0?[1-9]|1[012]",AMPM:"am|pm",UNIT:"year|month|week|day|hour|minute|second|millisecond"});G(this,"patterns",[["iso_8601",this.makePattern("^(_YEAR_)-(_MONTH_)-(_DAY_)$"),"$2/$3/$1"],["us",this.makePattern("^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$"),"$1/$3/$4"],["world",this.makePattern("^(_DAY_)([\\/\\.])(_MONTH_)\\2(_YEAR_)$"),"$3/$1/$4"],["chicago",this.makePattern("^(?:(?:_DAYNAME_),? )?(_DAY_)([ -])(_MONTHNAME_)\\2(_YEAR_)$"),"$3 $1, $4"],["conversational",this.makePattern("^(?:(?:_DAYNAME_),? )?(_MONTHNAME_) (_DAY_),? (_YEAR_)$"),"$1 $2, $3"],["month_day_time_year",this.makePattern("^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) ((?:_H24_)\\:(?:_MIN_)(?:\\:_SEC_)?) (_TIMEZONE_) (_YEAR_)$"),n=>{const o=(""+this.getMonthByName(n[1])).padStart(2,"0"),a=(""+n[2]).padStart(2,"0"),i=n[5],r=n[3],l=n[4],s=i+"-"+o+"-"+a+"T"+r+l;return isNaN(s)?!1:s}],["unix",/^@(-?\d+)$/,n=>this.create(parseInt(n[1],10)*1e3)],["24_hour",this.makePattern("^(?:(.+?)(?: |T))?(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:\\.(_MS_))?)? ?(?:GMT)?(_TIMEZONE_)?(?: \\([A-Z]+\\))?$"),n=>{let o;const a=n[1];if(a){if(o=this.create(a),isNaN(o))return!1}else o=new Date,o.setMilliseconds(0);const i=n[2],r=n[3],l=n[4],s=n[5];return o.setHours(parseFloat(i),parseFloat(r),parseFloat(l||0)),s&&o.setMilliseconds(+String(s).slice(0,3)),o}],["12_hour",this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"),n=>{let o;const a=n[1];if(a){if(o=this.create(a),isNaN(o))return!1}else o=new Date,o.setMilliseconds(0);let i=parseFloat(n[2]);i=n[5].toLowerCase()==="am"?i===12?0:i:i===12?12:i+12;const r=n[3],l=n[4];return o.setHours(i,parseFloat(r||0),parseFloat(l||0)),o}]])}makePattern(n){return n=n.replace(/_([A-Z][A-Z0-9]+)_/g,(o,a)=>this.regexes[a]),new RegExp(n,"i")}getMonthByName(n){return Uw[String(n).slice(0,3).toLowerCase()]}getWeekdayByName(n){return Gw[String(n).slice(0,3).toLowerCase()]}parse(n){if(!isNaN(Number(n)))return new Date(n);if(n=String(n).replace(/^\s*(.*)\s*$/,"$1"),n=n.replace(/\s{2,}/g," "),n==="")return Date.now();let o=0;for(;o<this.patterns.length;){const a=this.patterns[o];let i,r;typeof a[0]=="string"?(r=a[1],i=a[2]):(r=a[0],i=a[1]);const l=n.match(r);if(!l){o++;continue}if(typeof i=="function"){const s=i(l);if(s instanceof Date)return s}else{const s=Date.parse(n.replace(r,i));if(!isNaN(s))return new Date(s)}o++}return NaN}create(n){return n==null?Date.now():n instanceof Date?n:this.parse(n)}}function Tt(e){const n=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&n==="[object Date]"?new e.constructor(+e):typeof e=="number"||n==="[object Number]"||typeof e=="string"||n==="[object String]"?new Date(e):new Date(NaN)}function Pt(e,n){return e instanceof Date?new e.constructor(n):new Date(n)}function Pa(e,n){const o=Tt(e);return isNaN(n)?Pt(e,NaN):(n&&o.setDate(o.getDate()+n),o)}function Os(e,n){const o=Tt(e);if(isNaN(n))return Pt(e,NaN);if(!n)return o;const a=o.getDate(),i=Pt(e,o.getTime());i.setMonth(o.getMonth()+n+1,0);const r=i.getDate();return a>=r?i:(o.setFullYear(i.getFullYear(),i.getMonth(),a),o)}const Gf=6048e5,Yw=864e5,As=6e4,Rs=36e5,Qw=1e3;let Xw={};function Ko(){return Xw}function In(e,n){var s,c,d,p;const o=Ko(),a=(n==null?void 0:n.weekStartsOn)??((c=(s=n==null?void 0:n.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((p=(d=o.locale)==null?void 0:d.options)==null?void 0:p.weekStartsOn)??0,i=Tt(e),r=i.getDay(),l=(r<a?7:0)+r-a;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function $a(e){return In(e,{weekStartsOn:1})}function Yf(e){const n=Tt(e),o=n.getFullYear(),a=Pt(e,0);a.setFullYear(o+1,0,4),a.setHours(0,0,0,0);const i=$a(a),r=Pt(e,0);r.setFullYear(o,0,4),r.setHours(0,0,0,0);const l=$a(r);return n.getTime()>=i.getTime()?o+1:n.getTime()>=l.getTime()?o:o-1}function js(e){const n=Tt(e);return n.setHours(0,0,0,0),n}function Fr(e){const n=Tt(e),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+e-+o}function Kw(e,n){const o=js(e),a=js(n),i=+o-Fr(o),r=+a-Fr(a);return Math.round((i-r)/Yw)}function Jw(e){const n=Yf(e),o=Pt(e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),$a(o)}function Zw(e,n){const o=n*3;return Os(e,o)}function e0(e,n){const o=n*7;return Pa(e,o)}function t0(e,n){return Os(e,n*12)}function n0(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Mr(e){if(!n0(e)&&typeof e!="number")return!1;const n=Tt(e);return!isNaN(Number(n))}function Ls(e){const n=Tt(e),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}function _s(e){const n=Tt(e),o=n.getMonth(),a=o-o%3;return n.setMonth(a,1),n.setHours(0,0,0,0),n}function Ir(e){const n=Tt(e);return n.setDate(1),n.setHours(0,0,0,0),n}function Hs(e){const n=Tt(e),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}function Pr(e){const n=Tt(e),o=Pt(e,0);return o.setFullYear(n.getFullYear(),0,1),o.setHours(0,0,0,0),o}function Qf(e,n){var s,c,d,p;const o=Ko(),a=(n==null?void 0:n.weekStartsOn)??((c=(s=n==null?void 0:n.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((p=(d=o.locale)==null?void 0:d.options)==null?void 0:p.weekStartsOn)??0,i=Tt(e),r=i.getDay(),l=(r<a?-7:0)+6-(r-a);return i.setDate(i.getDate()+l),i.setHours(23,59,59,999),i}function Ws(e){const n=Tt(e),o=n.getMonth(),a=o-o%3+3;return n.setMonth(a,0),n.setHours(23,59,59,999),n}const o0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},a0=(e,n,o)=>{let a;const i=o0[e];return typeof i=="string"?a=i:n===1?a=i.one:a=i.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+a:a+" ago":a};function qs(e){return(n={})=>{const o=n.width?String(n.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}const i0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},r0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},l0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},s0={date:qs({formats:i0,defaultWidth:"full"}),time:qs({formats:r0,defaultWidth:"full"}),dateTime:qs({formats:l0,defaultWidth:"full"})},c0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},d0=(e,n,o,a)=>c0[e];function ui(e){return(n,o)=>{const a=o!=null&&o.context?String(o.context):"standalone";let i;if(a==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,s=o!=null&&o.width?String(o.width):l;i=e.formattingValues[s]||e.formattingValues[l]}else{const l=e.defaultWidth,s=o!=null&&o.width?String(o.width):e.defaultWidth;i=e.values[s]||e.values[l]}const r=e.argumentCallback?e.argumentCallback(n):n;return i[r]}}const u0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},f0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},p0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},m0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},h0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},g0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},y0={ordinalNumber:(e,n)=>{const o=Number(e),a=o%100;if(a>20||a<10)switch(a%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:ui({values:u0,defaultWidth:"wide"}),quarter:ui({values:f0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ui({values:p0,defaultWidth:"wide"}),day:ui({values:m0,defaultWidth:"wide"}),dayPeriod:ui({values:h0,defaultWidth:"wide",formattingValues:g0,defaultFormattingWidth:"wide"})};function fi(e){return(n,o={})=>{const a=o.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],r=n.match(i);if(!r)return null;const l=r[0],s=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?v0(s,f=>f.test(l)):b0(s,f=>f.test(l));let d;d=e.valueCallback?e.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const p=n.slice(l.length);return{value:d,rest:p}}}function b0(e,n){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&n(e[o]))return o}function v0(e,n){for(let o=0;o<e.length;o++)if(n(e[o]))return o}function C0(e){return(n,o={})=>{const a=n.match(e.matchPattern);if(!a)return null;const i=a[0],r=n.match(e.parsePattern);if(!r)return null;let l=e.valueCallback?e.valueCallback(r[0]):r[0];l=o.valueCallback?o.valueCallback(l):l;const s=n.slice(i.length);return{value:l,rest:s}}}const w0=/^(\d+)(th|st|nd|rd)?/i,S0=/\d+/i,V0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},N0={any:[/^b/i,/^(a|c)/i]},T0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},x0={any:[/1/i,/2/i,/3/i,/4/i]},k0={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},F0={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},M0={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},I0={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},P0={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$0={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},D0={ordinalNumber:C0({matchPattern:w0,parsePattern:S0,valueCallback:e=>parseInt(e,10)}),era:fi({matchPatterns:V0,defaultMatchWidth:"wide",parsePatterns:N0,defaultParseWidth:"any"}),quarter:fi({matchPatterns:T0,defaultMatchWidth:"wide",parsePatterns:x0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:fi({matchPatterns:k0,defaultMatchWidth:"wide",parsePatterns:F0,defaultParseWidth:"any"}),day:fi({matchPatterns:M0,defaultMatchWidth:"wide",parsePatterns:I0,defaultParseWidth:"any"}),dayPeriod:fi({matchPatterns:P0,defaultMatchWidth:"any",parsePatterns:$0,defaultParseWidth:"any"})},Xf={code:"en-US",formatDistance:a0,formatLong:s0,formatRelative:d0,localize:y0,match:D0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function E0(e){const n=Tt(e);return Kw(n,Pr(n))+1}function Kf(e){const n=Tt(e),o=+$a(n)-+Jw(n);return Math.round(o/Gf)+1}function zs(e,n){var p,f,u,m;const o=Tt(e),a=o.getFullYear(),i=Ko(),r=(n==null?void 0:n.firstWeekContainsDate)??((f=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(u=i.locale)==null?void 0:u.options)==null?void 0:m.firstWeekContainsDate)??1,l=Pt(e,0);l.setFullYear(a+1,0,r),l.setHours(0,0,0,0);const s=In(l,n),c=Pt(e,0);c.setFullYear(a,0,r),c.setHours(0,0,0,0);const d=In(c,n);return o.getTime()>=s.getTime()?a+1:o.getTime()>=d.getTime()?a:a-1}function B0(e,n){var s,c,d,p;const o=Ko(),a=(n==null?void 0:n.firstWeekContainsDate)??((c=(s=n==null?void 0:n.locale)==null?void 0:s.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(d=o.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??1,i=zs(e,n),r=Pt(e,0);return r.setFullYear(i,0,a),r.setHours(0,0,0,0),In(r,n)}function Jf(e,n){const o=Tt(e),a=+In(o,n)-+B0(o,n);return Math.round(a/Gf)+1}function St(e,n){const o=e<0?"-":"",a=Math.abs(e).toString().padStart(n,"0");return o+a}const Ro={y(e,n){const o=e.getFullYear(),a=o>0?o:1-o;return St(n==="yy"?a%100:a,n.length)},M(e,n){const o=e.getMonth();return n==="M"?String(o+1):St(o+1,2)},d(e,n){return St(e.getDate(),n.length)},a(e,n){const o=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(e,n){return St(e.getHours()%12||12,n.length)},H(e,n){return St(e.getHours(),n.length)},m(e,n){return St(e.getMinutes(),n.length)},s(e,n){return St(e.getSeconds(),n.length)},S(e,n){const o=n.length,a=e.getMilliseconds(),i=Math.trunc(a*Math.pow(10,o-3));return St(i,n.length)}},Da={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zf={G:function(e,n,o){const a=e.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(a,{width:"abbreviated"});case"GGGGG":return o.era(a,{width:"narrow"});case"GGGG":default:return o.era(a,{width:"wide"})}},y:function(e,n,o){if(n==="yo"){const a=e.getFullYear(),i=a>0?a:1-a;return o.ordinalNumber(i,{unit:"year"})}return Ro.y(e,n)},Y:function(e,n,o,a){const i=zs(e,a),r=i>0?i:1-i;if(n==="YY"){const l=r%100;return St(l,2)}return n==="Yo"?o.ordinalNumber(r,{unit:"year"}):St(r,n.length)},R:function(e,n){const o=Yf(e);return St(o,n.length)},u:function(e,n){const o=e.getFullYear();return St(o,n.length)},Q:function(e,n,o){const a=Math.ceil((e.getMonth()+1)/3);switch(n){case"Q":return String(a);case"QQ":return St(a,2);case"Qo":return o.ordinalNumber(a,{unit:"quarter"});case"QQQ":return o.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,n,o){const a=Math.ceil((e.getMonth()+1)/3);switch(n){case"q":return String(a);case"qq":return St(a,2);case"qo":return o.ordinalNumber(a,{unit:"quarter"});case"qqq":return o.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,n,o){const a=e.getMonth();switch(n){case"M":case"MM":return Ro.M(e,n);case"Mo":return o.ordinalNumber(a+1,{unit:"month"});case"MMM":return o.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(a,{width:"wide",context:"formatting"})}},L:function(e,n,o){const a=e.getMonth();switch(n){case"L":return String(a+1);case"LL":return St(a+1,2);case"Lo":return o.ordinalNumber(a+1,{unit:"month"});case"LLL":return o.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(a,{width:"wide",context:"standalone"})}},w:function(e,n,o,a){const i=Jf(e,a);return n==="wo"?o.ordinalNumber(i,{unit:"week"}):St(i,n.length)},I:function(e,n,o){const a=Kf(e);return n==="Io"?o.ordinalNumber(a,{unit:"week"}):St(a,n.length)},d:function(e,n,o){return n==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):Ro.d(e,n)},D:function(e,n,o){const a=E0(e);return n==="Do"?o.ordinalNumber(a,{unit:"dayOfYear"}):St(a,n.length)},E:function(e,n,o){const a=e.getDay();switch(n){case"E":case"EE":case"EEE":return o.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(a,{width:"short",context:"formatting"});case"EEEE":default:return o.day(a,{width:"wide",context:"formatting"})}},e:function(e,n,o,a){const i=e.getDay(),r=(i-a.weekStartsOn+8)%7||7;switch(n){case"e":return String(r);case"ee":return St(r,2);case"eo":return o.ordinalNumber(r,{unit:"day"});case"eee":return o.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(i,{width:"short",context:"formatting"});case"eeee":default:return o.day(i,{width:"wide",context:"formatting"})}},c:function(e,n,o,a){const i=e.getDay(),r=(i-a.weekStartsOn+8)%7||7;switch(n){case"c":return String(r);case"cc":return St(r,n.length);case"co":return o.ordinalNumber(r,{unit:"day"});case"ccc":return o.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(i,{width:"narrow",context:"standalone"});case"cccccc":return o.day(i,{width:"short",context:"standalone"});case"cccc":default:return o.day(i,{width:"wide",context:"standalone"})}},i:function(e,n,o){const a=e.getDay(),i=a===0?7:a;switch(n){case"i":return String(i);case"ii":return St(i,n.length);case"io":return o.ordinalNumber(i,{unit:"day"});case"iii":return o.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(a,{width:"short",context:"formatting"});case"iiii":default:return o.day(a,{width:"wide",context:"formatting"})}},a:function(e,n,o){const i=e.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,n,o){const a=e.getHours();let i;switch(a===12?i=Da.noon:a===0?i=Da.midnight:i=a/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,n,o){const a=e.getHours();let i;switch(a>=17?i=Da.evening:a>=12?i=Da.afternoon:a>=4?i=Da.morning:i=Da.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,n,o){if(n==="ho"){let a=e.getHours()%12;return a===0&&(a=12),o.ordinalNumber(a,{unit:"hour"})}return Ro.h(e,n)},H:function(e,n,o){return n==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):Ro.H(e,n)},K:function(e,n,o){const a=e.getHours()%12;return n==="Ko"?o.ordinalNumber(a,{unit:"hour"}):St(a,n.length)},k:function(e,n,o){let a=e.getHours();return a===0&&(a=24),n==="ko"?o.ordinalNumber(a,{unit:"hour"}):St(a,n.length)},m:function(e,n,o){return n==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ro.m(e,n)},s:function(e,n,o){return n==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):Ro.s(e,n)},S:function(e,n){return Ro.S(e,n)},X:function(e,n,o){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return tp(a);case"XXXX":case"XX":return Jo(a);case"XXXXX":case"XXX":default:return Jo(a,":")}},x:function(e,n,o){const a=e.getTimezoneOffset();switch(n){case"x":return tp(a);case"xxxx":case"xx":return Jo(a);case"xxxxx":case"xxx":default:return Jo(a,":")}},O:function(e,n,o){const a=e.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+ep(a,":");case"OOOO":default:return"GMT"+Jo(a,":")}},z:function(e,n,o){const a=e.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+ep(a,":");case"zzzz":default:return"GMT"+Jo(a,":")}},t:function(e,n,o){const a=Math.trunc(e.getTime()/1e3);return St(a,n.length)},T:function(e,n,o){const a=e.getTime();return St(a,n.length)}};function ep(e,n=""){const o=e>0?"-":"+",a=Math.abs(e),i=Math.trunc(a/60),r=a%60;return r===0?o+String(i):o+String(i)+n+St(r,2)}function tp(e,n){return e%60===0?(e>0?"-":"+")+St(Math.abs(e)/60,2):Jo(e,n)}function Jo(e,n=""){const o=e>0?"-":"+",a=Math.abs(e),i=St(Math.trunc(a/60),2),r=St(a%60,2);return o+i+n+r}const np=(e,n)=>{switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},op=(e,n)=>{switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Us={p:op,P:(e,n)=>{const o=e.match(/(P+)(p+)?/)||[],a=o[1],i=o[2];if(!i)return np(e,n);let r;switch(a){case"P":r=n.dateTime({width:"short"});break;case"PP":r=n.dateTime({width:"medium"});break;case"PPP":r=n.dateTime({width:"long"});break;case"PPPP":default:r=n.dateTime({width:"full"});break}return r.replace("{{date}}",np(a,n)).replace("{{time}}",op(i,n))}},O0=/^D+$/,A0=/^Y+$/,R0=["D","DD","YY","YYYY"];function ap(e){return O0.test(e)}function ip(e){return A0.test(e)}function Gs(e,n,o){const a=j0(e,n,o);if(console.warn(a),R0.includes(e))throw new Rang