@integry/sdk 4.5.10 → 4.5.12
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/esm/index.csm.d.ts +2 -5
- package/dist/esm/index.csm.js +60 -56
- package/dist/umd/index.umd.d.ts +1 -0
- package/dist/umd/index.umd.js +60 -56
- package/package.json +1 -1
- package/src/components/MultipurposeField/TagMenu/index.ts +57 -52
- package/src/components/MultipurposeField/index.tsx +2 -0
- package/src/components/TestComponent/index.ts +54 -4
- package/src/features/common/ActionForm/index.ts +28 -6
- package/src/index.ts +3 -0
- package/src/types/index.ts +1 -0
package/dist/esm/index.csm.d.ts
CHANGED
|
@@ -55,11 +55,7 @@ type IntegrySDKEventPayloads = {
|
|
|
55
55
|
authorizations: {
|
|
56
56
|
authorizationId: number;
|
|
57
57
|
userIdentity: string;
|
|
58
|
-
isBrandingAppAuth:
|
|
59
|
-
/**
|
|
60
|
-
* Integry JS SDK
|
|
61
|
-
*/
|
|
62
|
-
boolean;
|
|
58
|
+
isBrandingAppAuth: boolean;
|
|
63
59
|
}[];
|
|
64
60
|
event: "EDIT" | "CREATE";
|
|
65
61
|
};
|
|
@@ -234,6 +230,7 @@ type RenderFlowStepOptions = {
|
|
|
234
230
|
connectedAccountId: string;
|
|
235
231
|
tagsComponent?: any;
|
|
236
232
|
onFieldChangeCallback: (fieldId: string, value: any) => void;
|
|
233
|
+
tagsTree: any;
|
|
237
234
|
};
|
|
238
235
|
type TemplateType = Template;
|
|
239
236
|
type FlowCardProps = {
|
package/dist/esm/index.csm.js
CHANGED
|
@@ -2233,30 +2233,30 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
2233
2233
|
keyValue="${`${l}.${e}`}"
|
|
2234
2234
|
/>`))}
|
|
2235
2235
|
</div>
|
|
2236
|
-
`};var Uo,Zo={tagMenu:"styles-module_tagMenu__1zL3Y",tagMenuHeader:"styles-module_tagMenuHeader__1xLOJ",tagMenuHeaderItem:"styles-module_tagMenuHeaderItem__118kJ",active:"styles-module_active__q-t6i",tagMenuBody:"styles-module_tagMenuBody__2VhdZ",tagMenuBodyItem:"styles-module_tagMenuBodyItem__36ub0",value:"styles-module_value__Nbjas",selected:"styles-module_selected__3w5uy",noOptions:"styles-module_noOptions__1Dcpu",noOptionsRetry:"styles-module_noOptionsRetry__RVn-i",optionsRefreshProminent:"styles-module_optionsRefreshProminent__lc2Mq",optionsRefresh:"styles-module_optionsRefresh__3w_oH",tagMenuSearch:"styles-module_tagMenuSearch__3r3dc",tagMenuWithSearch:"styles-module_tagMenuWithSearch__C33C2",tagMenuBodyWithSearch:"styles-module_tagMenuBodyWithSearch__1zO00"};ue(".styles-module_tagMenu__1zL3Y {\n width: 100%;\n max-width: 342px;\n max-height: 210px;\n background: #ffffff;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 10px 30px 0px;\n border: 1px solid #e2e0db;\n border-radius: 4px;\n padding: 12px;\n overflow-y: auto;\n margin-top: 0px;\n position: fixed;\n z-index: 999;\n height: max-content;\n /* Track */\n /* Handle */\n /* Handle on hover */\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar {\n width: 7px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-track {\n background: transparent;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb {\n background: #bdbdbd;\n border: 1px solid #bdbdbd;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb:hover {\n background: rgb(116, 116, 116);\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ {\n display: flex;\n justify-content: start;\n align-items: center;\n margin-bottom: 16px;\n gap: 8px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ {\n padding: 6px 12px;\n background: #f2f2f2;\n border-radius: 100px;\n font-weight: 400;\n font-size: 10px;\n line-height: 12px;\n color: #333333;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ.styles-module_active__q-t6i {\n background: #4250f0;\n color: #ffffff;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ {\n min-height: 15px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas {\n box-sizing: border-box;\n height: 31px;\n padding: 8px 0px 8px 12px;\n width: 100%;\n font-size: 12px;\n line-height: 15px;\n color: #333333;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin-bottom: 5px;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas:hover {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_selected__3w5uy {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu {\n font-weight: 400;\n font-size: 12px;\n line-height: 15px;\n margin-left: 16px;\n color: #999;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu span.styles-module_noOptionsRetry__RVn-i [class^=styles-module_loader_] {\n position: relative;\n top: 5px;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefreshProminent__lc2Mq {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 8px;\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefresh__3w_oH {\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n\n.styles-module_tagMenuSearch__3r3dc {\n position: relative;\n margin-bottom: 5px;\n}\n.styles-module_tagMenuSearch__3r3dc fieldset {\n margin-bottom: 5px;\n}\n\n.styles-module_tagMenuWithSearch__C33C2 {\n padding-top: 0px;\n}\n\n.styles-module_tagMenuBodyWithSearch__1zO00 {\n max-height: 142px;\n overflow-y: auto;\n}\n.styles-module_tagMenuBodyWithSearch__1zO00 span {\n padding-left: 3px !important;\n}"),function(e){e.Values="values",e.AppFields="AppFields"}(Uo||(Uo={}));const jo=e=>{const{appName:t="",tags:n={},options:i=[],hideTabs:o=!1,defaultTab:s=Uo.AppFields,onTagClick:a=(()=>null),onOptionClick:l=(()=>null),fieldId:r="",value:d,onTabSelect:p,isEditable:c=!1,enableSearch:u=!1,refreshRootStepData:_,handleRefreshClick:m,isErrorOnLoadingOptions:h=!1,isMultiSelect:g=!1,loadingOptions:y=!1,nextPage:f=""}=e,[
|
|
2236
|
+
`};var Uo,Zo={tagMenu:"styles-module_tagMenu__1zL3Y",tagMenuHeader:"styles-module_tagMenuHeader__1xLOJ",tagMenuHeaderItem:"styles-module_tagMenuHeaderItem__118kJ",active:"styles-module_active__q-t6i",tagMenuBody:"styles-module_tagMenuBody__2VhdZ",tagMenuBodyItem:"styles-module_tagMenuBodyItem__36ub0",value:"styles-module_value__Nbjas",selected:"styles-module_selected__3w5uy",noOptions:"styles-module_noOptions__1Dcpu",noOptionsRetry:"styles-module_noOptionsRetry__RVn-i",optionsRefreshProminent:"styles-module_optionsRefreshProminent__lc2Mq",optionsRefresh:"styles-module_optionsRefresh__3w_oH",tagMenuSearch:"styles-module_tagMenuSearch__3r3dc",tagMenuWithSearch:"styles-module_tagMenuWithSearch__C33C2",tagMenuBodyWithSearch:"styles-module_tagMenuBodyWithSearch__1zO00"};ue(".styles-module_tagMenu__1zL3Y {\n width: 100%;\n max-width: 342px;\n max-height: 210px;\n background: #ffffff;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 10px 30px 0px;\n border: 1px solid #e2e0db;\n border-radius: 4px;\n padding: 12px;\n overflow-y: auto;\n margin-top: 0px;\n position: fixed;\n z-index: 999;\n height: max-content;\n /* Track */\n /* Handle */\n /* Handle on hover */\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar {\n width: 7px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-track {\n background: transparent;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb {\n background: #bdbdbd;\n border: 1px solid #bdbdbd;\n border-radius: 8px;\n}\n.styles-module_tagMenu__1zL3Y::-webkit-scrollbar-thumb:hover {\n background: rgb(116, 116, 116);\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ {\n display: flex;\n justify-content: start;\n align-items: center;\n margin-bottom: 16px;\n gap: 8px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ {\n padding: 6px 12px;\n background: #f2f2f2;\n border-radius: 100px;\n font-weight: 400;\n font-size: 10px;\n line-height: 12px;\n color: #333333;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuHeader__1xLOJ .styles-module_tagMenuHeaderItem__118kJ.styles-module_active__q-t6i {\n background: #4250f0;\n color: #ffffff;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ {\n min-height: 15px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas {\n box-sizing: border-box;\n height: 31px;\n padding: 8px 0px 8px 12px;\n width: 100%;\n font-size: 12px;\n line-height: 15px;\n color: #333333;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin-bottom: 5px;\n cursor: pointer;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_value__Nbjas:hover {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_tagMenuBody__2VhdZ .styles-module_tagMenuBodyItem__36ub0 .styles-module_selected__3w5uy {\n background: rgba(66, 80, 240, 0.1);\n border-radius: 100px;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu {\n font-weight: 400;\n font-size: 12px;\n line-height: 15px;\n margin-left: 16px;\n color: #999;\n}\n.styles-module_tagMenu__1zL3Y .styles-module_noOptions__1Dcpu span.styles-module_noOptionsRetry__RVn-i [class^=styles-module_loader_] {\n position: relative;\n top: 5px;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefreshProminent__lc2Mq {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 8px;\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n.styles-module_tagMenu__1zL3Y a.styles-module_optionsRefresh__3w_oH {\n font-size: 12px;\n line-height: 15px;\n color: #4250f0;\n cursor: pointer;\n text-decoration: none;\n}\n\n.styles-module_tagMenuSearch__3r3dc {\n position: relative;\n margin-bottom: 5px;\n}\n.styles-module_tagMenuSearch__3r3dc fieldset {\n margin-bottom: 5px;\n}\n\n.styles-module_tagMenuWithSearch__C33C2 {\n padding-top: 0px;\n}\n\n.styles-module_tagMenuBodyWithSearch__1zO00 {\n max-height: 142px;\n overflow-y: auto;\n}\n.styles-module_tagMenuBodyWithSearch__1zO00 span {\n padding-left: 3px !important;\n}"),function(e){e.Values="values",e.AppFields="AppFields"}(Uo||(Uo={}));const jo=e=>{const{appName:t="",tags:n={},options:i=[],hideTabs:o=!1,defaultTab:s=Uo.AppFields,onTagClick:a=(()=>null),onOptionClick:l=(()=>null),fieldId:r="",value:d,onTabSelect:p,isEditable:c=!1,enableSearch:u=!1,refreshRootStepData:_,handleRefreshClick:m,isErrorOnLoadingOptions:h=!1,isMultiSelect:g=!1,loadingOptions:y=!1,nextPage:f="",tagsComponent:v=null}=e,[x,w]=Ce(s),b=Le([]),$=Le(null),[C,I]=Ce(!1),[L,S]=Ce(""),[k,M]=Ce(!1),[A,D]=Ce(!1),[T,F]=Ce(y),[E,O]=Ce(!1);Ie((()=>{let e=i;Array.isArray(i)||(e=[]),b.current=(e||[]).map(((e,t)=>b.current[t]??{}))}),[i]);const N=document.getElementById(r),W=()=>{const e=N?N.getBoundingClientRect().bottom:"";let t={top:N?`${e}px`:"",left:N?`${N.getBoundingClientRect().left}px`:"",display:N&&!Ho(N,"steps-body-container")?"none":"block",maxWidth:N?`${N.getBoundingClientRect().width}px`:"342px"};return N&&N.getBoundingClientRect().bottom+210>window.innerHeight-8&&(t={bottom:window.innerHeight-N.getBoundingClientRect().top+"px",left:N?`${N.getBoundingClientRect().left}px`:"",display:N&&!Ho(N,"steps-body-container")?"none":"block",maxWidth:N?`${N.getBoundingClientRect().width}px`:"342px"}),t};$.current=W();const z=()=>{$.current=W(),I((e=>!e))},H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===t.trim().length?e:e.filter((e=>e.value.toLowerCase().includes(t.trim().toLowerCase())))},P=e=>{w(e),p&&p(e)};Ie((()=>(d&&!o&&d.startsWith("{")&&d.endsWith("}")&&P(Uo.AppFields),window.addEventListener("scroll",z,!0),()=>window.removeEventListener("scroll",z))),[]);const B=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];M(!1),D(e)},V=()=>{_&&(M(!0),_(B))};let U=[];return d&&(U=g?JSON.parse(d):[d]),R` <div
|
|
2237
2237
|
class=${`${Zo.tagMenu} ${u?Zo.tagMenuWithSearch:""}`}
|
|
2238
|
-
style=${
|
|
2238
|
+
style=${N&&$?.current?$.current:""}
|
|
2239
2239
|
>
|
|
2240
2240
|
${u&&R`
|
|
2241
2241
|
<div class=${Zo.tagMenuSearch}>
|
|
2242
2242
|
<${ko}
|
|
2243
2243
|
id="search_${r}"
|
|
2244
2244
|
placeholder="Search for a field"
|
|
2245
|
-
value="${
|
|
2246
|
-
onChange="${e=>{
|
|
2245
|
+
value="${L}"
|
|
2246
|
+
onChange="${e=>{S(e)}}"
|
|
2247
2247
|
/>
|
|
2248
2248
|
</div>
|
|
2249
2249
|
`}
|
|
2250
2250
|
${!o&&R`<div class=${Zo.tagMenuHeader}>
|
|
2251
2251
|
<div
|
|
2252
|
-
class=${`${Zo.tagMenuHeaderItem} ${
|
|
2253
|
-
onClick=${()=>
|
|
2252
|
+
class=${`${Zo.tagMenuHeaderItem} ${x===Uo.Values?Zo.active:""}`}
|
|
2253
|
+
onClick=${()=>P(Uo.Values)}
|
|
2254
2254
|
>
|
|
2255
2255
|
Values
|
|
2256
2256
|
</div>
|
|
2257
2257
|
<div
|
|
2258
|
-
class=${`${Zo.tagMenuHeaderItem} ${
|
|
2259
|
-
onClick=${()=>
|
|
2258
|
+
class=${`${Zo.tagMenuHeaderItem} ${x===Uo.AppFields?Zo.active:""}`}
|
|
2259
|
+
onClick=${()=>P(Uo.AppFields)}
|
|
2260
2260
|
>
|
|
2261
2261
|
${t?`${t} fields`:"Fields"}
|
|
2262
2262
|
</div>
|
|
@@ -2264,22 +2264,22 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
2264
2264
|
<div
|
|
2265
2265
|
class=${`${Zo.tagMenuBody} ${u?Zo.tagMenuBodyWithSearch:""}`}
|
|
2266
2266
|
>
|
|
2267
|
-
${
|
|
2268
|
-
${i.length>0?
|
|
2267
|
+
${x===Uo.Values?R`<div className=${Zo.tagMenuBodyItem} id="tag-menu-body-item">
|
|
2268
|
+
${i.length>0?H(i,L).length>0?H(i,L).map(((e,t,n)=>{return t===n.length-1&&F(!1),R`
|
|
2269
2269
|
<div
|
|
2270
|
-
class=${`${Zo.value} ${
|
|
2270
|
+
class=${`${Zo.value} ${U.includes(e.id)?Zo.selected:""}`}
|
|
2271
2271
|
onClick=${t=>{t.stopPropagation(),l(e)}}
|
|
2272
|
-
ref=${
|
|
2273
|
-
data-hint=${`${i=
|
|
2272
|
+
ref=${b.current[t]}
|
|
2273
|
+
data-hint=${`${i=b.current[t],i&&i.current&&i.current.clientWidth<i.current.scrollWidth?e.value:""}`}
|
|
2274
2274
|
>
|
|
2275
2275
|
${e.value}
|
|
2276
2276
|
</div>
|
|
2277
2277
|
|
|
2278
2278
|
${t!==n.length-1?"":R`<span>
|
|
2279
|
-
${
|
|
2279
|
+
${T||E?R`<${Ue} color="#999" />`:R` <a
|
|
2280
2280
|
className=${Zo.optionsRefreshProminent}
|
|
2281
2281
|
href="#"
|
|
2282
|
-
onclick=${()=>{m&&(
|
|
2282
|
+
onclick=${()=>{m&&(O(!0),m((()=>O(!1)),f))}}
|
|
2283
2283
|
>${f?"Load more options":"Reload options?"}</a
|
|
2284
2284
|
>`}
|
|
2285
2285
|
</span>`}
|
|
@@ -2287,47 +2287,47 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
2287
2287
|
Your search did not match any values
|
|
2288
2288
|
</div>`:R`<div className=${Zo.noOptions}>
|
|
2289
2289
|
<span className=${Zo.noOptionsRetry}>
|
|
2290
|
-
${
|
|
2290
|
+
${T?R`<${Ue} color="#999" />`:R`${h?"Could not load options.":"No options found."}
|
|
2291
2291
|
<a
|
|
2292
2292
|
className=${Zo.optionsRefresh}
|
|
2293
2293
|
href="#"
|
|
2294
|
-
onclick=${()=>{m&&(
|
|
2294
|
+
onclick=${()=>{m&&(F(!0),m((()=>F(!1))))}}
|
|
2295
2295
|
>
|
|
2296
2296
|
${" "}Try again?</a
|
|
2297
2297
|
>`}
|
|
2298
2298
|
</span>
|
|
2299
2299
|
</div>`}
|
|
2300
2300
|
</div>`:R` <div className="${Zo.mappedFieldMenu}">
|
|
2301
|
-
${Object.keys(c?n:Po(n,
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2301
|
+
${v?R`${v}`:R`${Object.keys(c?n:Po(n,L)).length>0?Object.keys(c?n:Po(n,L)).map(((e,t,i)=>R`
|
|
2302
|
+
<${Vo}
|
|
2303
|
+
objectKey="${e}"
|
|
2304
|
+
keyValue="${e}"
|
|
2305
|
+
objectData="${c?n[e]:Po(n,L)[e]}"
|
|
2306
|
+
onSelect=${a}
|
|
2307
|
+
isRoot="${!0}"
|
|
2308
|
+
/>
|
|
2309
|
+
${t!==i.length-1?"":R`<span>
|
|
2310
|
+
${k?R`<${Ue} color="#999" />`:R` <a
|
|
2311
|
+
className=${Zo.optionsRefreshProminent}
|
|
2312
|
+
href="#"
|
|
2313
|
+
onclick=${V}
|
|
2314
|
+
>Reload fields?</a
|
|
2315
|
+
>`}
|
|
2316
|
+
</span>`}
|
|
2317
|
+
`)):R`<div className=${Zo.noOptions}>
|
|
2318
|
+
${c||""===L?R`
|
|
2319
|
+
<span className=${Zo.noOptionsRetry}>
|
|
2320
|
+
${k?R`<${Ue} color="#999" />`:R`${A?"Could not load fields.":"No fields found."}
|
|
2321
|
+
<a
|
|
2322
|
+
className=${Zo.optionsRefresh}
|
|
2323
|
+
href="#"
|
|
2324
|
+
onclick=${e=>{e.preventDefault(),e.stopPropagation(),V()}}
|
|
2325
|
+
>
|
|
2326
|
+
${" "}Try again?</a
|
|
2327
|
+
>`}
|
|
2328
|
+
</span>
|
|
2329
|
+
`:"Your search did not match any fields"}
|
|
2330
|
+
</div>`}`}
|
|
2331
2331
|
</div>`}
|
|
2332
2332
|
</div>
|
|
2333
2333
|
</div>`};var Ko=H((function(e,t){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(t){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};i%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=(e,t,n,i)=>(e=""+e,t=""+t,i&&(e=e.trim(),t=t.trim()),n?e==t:e.toLowerCase()==t.toLowerCase()),o=(e,t)=>e&&Array.isArray(e)&&e.map((e=>s(e,t)));function s(e,t){var n,i={};for(n in e)t.indexOf(n)<0&&(i[n]=e[n]);return i}function a(e){var t=document.createElement("div");return e.replace(/\&#?[0-9a-z]+;/gi,(function(e){return t.innerHTML=e,t.innerText}))}function l(e){return(new DOMParser).parseFromString(e.trim(),"text/html").body.firstElementChild}function r(e,t){for(t=t||"previous";e=e[t+"Sibling"];)if(3==e.nodeType)return e}function d(e){return"string"==typeof e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/`|'/g,"'"):e}function p(e){var t=Object.prototype.toString.call(e).split(" ")[1].slice(0,-1);return e===Object(e)&&"Array"!=t&&"Function"!=t&&"RegExp"!=t&&"HTMLUnknownElement"!=t}function c(e,t,n){function i(e,t){for(var n in t)if(t.hasOwnProperty(n)){if(p(t[n])){p(e[n])?i(e[n],t[n]):e[n]=Object.assign({},t[n]);continue}if(Array.isArray(t[n])){e[n]=Object.assign([],t[n]);continue}e[n]=t[n]}}return e instanceof Object||(e={}),i(e,t),n&&i(e,n),e}function u(){const e=[],t={};for(let n of arguments)for(let i of n)p(i)?t[i.value]||(e.push(i),t[i.value]=1):e.includes(i)||e.push(i);return e}function _(e){return String.prototype.normalize?"string"==typeof e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:e}var m=()=>/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent);function h(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))}function g(e){return e&&e.classList&&e.classList.contains(this.settings.classNames.tag)}function y(e,t){var n=window.getSelection();return t=t||n.getRangeAt(0),"string"==typeof e&&(e=document.createTextNode(e)),t&&(t.deleteContents(),t.insertNode(e)),e}function f(e,t,n){return e?(t&&(e.__tagifyTagData=n?t:c({},e.__tagifyTagData||{},t)),e.__tagifyTagData):(console.warn("tag element doesn't exist",e,t),t)}function v(e){if(e&&e.parentNode){var t=e,n=window.getSelection(),i=n.getRangeAt(0);n.rangeCount&&(i.setStartAfter(t),i.collapse(!0),n.removeAllRanges(),n.addRange(i))}}function x(e,t){e.forEach((e=>{if(f(e.previousSibling)||!e.previousSibling){var n=document.createTextNode("");e.before(n),t&&v(n)}}))}var w={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:()=>{},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:" "},autoComplete:{enabled:!0,rightKey:!1,tabKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:()=>Promise.resolve(),beforePaste:()=>Promise.resolve(),suggestionClick:()=>Promise.resolve(),beforeKeyDown:()=>Promise.resolve()}},b={events:{binding(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var t=this.dropdown.events.callbacks,n=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:t.onKeyDown.bind(this),onMouseOver:t.onMouseOver.bind(this),onMouseLeave:t.onMouseLeave.bind(this),onClick:t.onClick.bind(this),onScroll:t.onScroll.bind(this)},i=e?"addEventListener":"removeEventListener";"manual"!=this.settings.dropdown.position&&(document[i]("scroll",n.position,!0),window[i]("resize",n.position),window[i]("keydown",n.onKeyDown)),this.DOM.dropdown[i]("mouseover",n.onMouseOver),this.DOM.dropdown[i]("mouseleave",n.onMouseLeave),this.DOM.dropdown[i]("mousedown",n.onClick),this.DOM.dropdown.content[i]("scroll",n.onScroll)},callbacks:{onKeyDown(e){if(this.state.hasFocus&&!this.state.composing){var t=this.settings,n=this.DOM.dropdown.querySelector(t.classNames.dropdownItemActiveSelector),i=this.dropdown.getSuggestionDataByNode(n),o="mix"==t.mode;t.hooks.beforeKeyDown(e,{tagify:this}).then((s=>{switch(e.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":e.preventDefault();var a=this.dropdown.getAllSuggestionsRefs(),l="ArrowUp"==e.key||"Up"==e.key;n&&(n=this.dropdown.getNextOrPrevOption(n,!l)),n&&n.matches(t.classNames.dropdownItemSelector)||(n=a[l?a.length-1:0]),this.dropdown.highlightOption(n,!0);break;case"Escape":case"Esc":this.dropdown.hide();break;case"ArrowRight":if(this.state.actions.ArrowLeft)return;case"Tab":{let s=!t.autoComplete.rightKey||!t.autoComplete.tabKey;if(!o&&n&&s&&!this.state.editing){e.preventDefault();var r=this.dropdown.getMappedValue(i);return this.input.autocomplete.set.call(this,r),!1}return!0}case"Enter":e.preventDefault(),t.hooks.suggestionClick(e,{tagify:this,tagData:i,suggestionElm:n}).then((()=>{if(n)return this.dropdown.selectOption(n),n=this.dropdown.getNextOrPrevOption(n,!l),void this.dropdown.highlightOption(n);this.dropdown.hide(),o||this.addTags(this.state.inputText.trim(),!0)})).catch((e=>console.warn(e)));break;case"Backspace":{if(o||this.state.editing.scope)return;const e=this.input.raw.call(this);""!=e&&8203!=e.charCodeAt(0)||(!0===t.backspace?this.removeTags():"edit"==t.backspace&&setTimeout(this.editTag.bind(this),0))}}}))}},onMouseOver(e){var t=e.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(t)},onMouseLeave(e){this.dropdown.highlightOption()},onClick(e){if(0==e.button&&e.target!=this.DOM.dropdown&&e.target!=this.DOM.dropdown.content){var t=e.target.closest(this.settings.classNames.dropdownItemSelector),n=this.dropdown.getSuggestionDataByNode(t);this.state.actions.selectOption=!0,setTimeout((()=>this.state.actions.selectOption=!1),50),this.settings.hooks.suggestionClick(e,{tagify:this,tagData:n,suggestionElm:t}).then((()=>{t?this.dropdown.selectOption(t,e):this.dropdown.hide()})).catch((e=>console.warn(e)))}},onScroll(e){var t=e.target,n=t.scrollTop/(t.scrollHeight-t.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(n)})}}},refilter(e){e=e||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(e),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode(e){var t=e&&e.getAttribute("value");return this.suggestedListItems.find((e=>e.value==t))||null},getNextOrPrevOption(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var n=this.dropdown.getAllSuggestionsRefs(),i=n.findIndex((t=>t===e));return t?n[i+1]:n[i-1]},highlightOption(e,t){var n,i=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(i),this.state.ddItemElm.removeAttribute("aria-selected")),!e)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);n=this.dropdown.getSuggestionDataByNode(e),this.state.ddItemData=n,this.state.ddItemElm=e,e.classList.add(i),e.setAttribute("aria-selected",!0),t&&(e.parentNode.scrollTop=e.clientHeight+e.offsetTop-e.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,n),this.dropdown.position())},selectOption(e,t){var n=this.settings,i=n.dropdown,o=i.clearOnSelect,s=i.closeOnSelect;if(!e)return this.addTags(this.state.inputText,!0),void(s&&this.dropdown.hide());t=t||{};var a=e.getAttribute("value"),l="noMatch"==a,r="mix"==n.mode,d=this.suggestedListItems.find((e=>(e.value??e)==a));if(this.trigger("dropdown:select",{data:d,elm:e,event:t}),a&&(d||l)){if(this.state.editing){let e=this.normalizeTags([d])[0];d=n.transformTag.call(this,e)||e,this.onEditTagDone(null,c({__isValid:!0},d))}else this[r?"addMixTags":"addTags"]([d||this.input.raw.call(this)],o);(r||this.DOM.input.parentNode)&&(setTimeout((()=>{this.DOM.input.focus(),this.toggleFocusClass(!0)})),s&&setTimeout(this.dropdown.hide.bind(this)),e.addEventListener("transitionend",(()=>{this.dropdown.fillHeaderFooter(),setTimeout((()=>e.remove()),100)}),{once:!0}),e.classList.add(this.settings.classNames.dropdownItemHidden))}else s&&setTimeout(this.dropdown.hide.bind(this))},selectAll(e){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var t=this.dropdown.filterListItems("");return e||(t=this.state.dropdown.suggestions),this.addTags(t,!0),this},filterListItems(e,t){var n,i,o,s,a,l=this.settings,r=l.dropdown,d=(t=t||{},[]),c=[],u=l.whitelist,m=r.maxItems>=0?r.maxItems:1/0,h=r.searchKeys,g=0;if(!(e="select"==l.mode&&this.value.length&&this.value[0][l.tagTextProp]==e?"":e)||!h.length)return d=r.includeSelectedTags?u:u.filter((e=>!this.isTagDuplicate(p(e)?e.value:e))),this.state.dropdown.suggestions=d,d.slice(0,m);function y(e,t){return t.toLowerCase().split(" ").every((t=>e.includes(t.toLowerCase())))}for(a=r.caseSensitive?""+e:(""+e).toLowerCase();g<u.length;g++){let e,l;n=u[g]instanceof Object?u[g]:{value:u[g]};let m=Object.keys(n).some((e=>h.includes(e)))?h:["value"];r.fuzzySearch&&!t.exact?(o=m.reduce(((e,t)=>e+" "+(n[t]||"")),"").toLowerCase().trim(),r.accentedSearch&&(o=_(o),a=_(a)),e=0==o.indexOf(a),l=o===a,i=y(o,a)):(e=!0,i=m.some((e=>{var i=""+(n[e]||"");return r.accentedSearch&&(i=_(i),a=_(a)),r.caseSensitive||(i=i.toLowerCase()),l=i===a,t.exact?i===a:0==i.indexOf(a)}))),s=!r.includeSelectedTags&&this.isTagDuplicate(p(n)?n.value:n),i&&!s&&(l&&e?c.push(n):"startsWith"==r.sortby&&e?d.unshift(n):d.push(n))}return this.state.dropdown.suggestions=c.concat(d),"function"==typeof r.sortby?r.sortby(c.concat(d),a):c.concat(d).slice(0,m)},getMappedValue(e){var t=this.settings.dropdown.mapValueTo;return t?"function"==typeof t?t(e):e[t]||e.value:e.value},createListHTML(e){return c([],e).map(((e,n)=>{"string"!=typeof e&&"number"!=typeof e||(e={value:e});var i=this.dropdown.getMappedValue(e);return i="string"==typeof i&&this.settings.dropdown.escapeHTML?d(i):i,this.settings.templates.dropdownItem.apply(this,[t(t({},e),{},{mappedValue:i}),this])})).join("")}};function $(){this.dropdown={};for(let e in this._dropdown)this.dropdown[e]="function"==typeof this._dropdown[e]?this._dropdown[e].bind(this):this._dropdown[e];this.dropdown.refs()}var C=t(t({},b),{},{refs(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs(){return[...this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector)]},show(e){var t,n,o,s=this.settings,a="mix"==s.mode&&!s.enforceWhitelist,l=!s.whitelist||!s.whitelist.length,r="manual"==s.dropdown.position;if(e=void 0===e?this.state.inputText:e,!(l&&!a&&!s.templates.dropdownItemNoMatch||!1===s.dropdown.enable||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(e),e&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",e),s.templates.dropdownItemNoMatch&&(o=s.templates.dropdownItemNoMatch.call(this,{value:e}))),!o){if(this.suggestedListItems.length)e&&a&&!this.state.editing.scope&&!i(this.suggestedListItems[0].value,e)&&this.suggestedListItems.unshift({value:e});else{if(!e||!a||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:e}]}n=""+(p(t=this.suggestedListItems[0])?t.value:t),s.autoComplete&&n&&0==n.indexOf(e)&&this.input.autocomplete.suggest.call(this,t)}this.dropdown.fill(o),s.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(s.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=e||!0,this.state.dropdown.query=e,this.setStateSelection(),r||setTimeout((()=>{this.dropdown.position(),this.dropdown.render()})),setTimeout((()=>{this.trigger("dropdown:show",this.DOM.dropdown)}))}},hide(e){var t=this.DOM,n=t.scope,i=t.dropdown,o="manual"==this.settings.dropdown.position&&!e;if(i&&document.body.contains(i)&&!o)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),n.setAttribute("aria-expanded",!1),i.parentNode.removeChild(i),setTimeout((()=>{this.state.dropdown.visible=!1}),100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",i),this},toggle(e){this.dropdown[this.state.dropdown.visible&&!e?"hide":"show"]()},getAppendTarget(){var e=this.settings.dropdown;return"function"==typeof e.appendTarget?e.appendTarget():e.appendTarget},render(){var e,t,n=((t=this.DOM.dropdown.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(t),e=t.clientHeight,t.parentNode.removeChild(t),e),i=this.settings,o="number"==typeof i.dropdown.enabled&&i.dropdown.enabled>=0,s=this.dropdown.getAppendTarget();return o?(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(i.classNames.dropdownInital),this.dropdown.position(n),s.appendChild(this.DOM.dropdown),setTimeout((()=>this.DOM.dropdown.classList.remove(i.classNames.dropdownInital)))),this):this},fill(e){e="string"==typeof e?e:this.dropdown.createListHTML(e||this.suggestedListItems);var t,n=this.settings.templates.dropdownContent.call(this,e);this.DOM.dropdown.content.innerHTML=(t=n)?t.replace(/\>[\r\n ]+\</g,"><").split(/>\s+</).join("><").trim():""},fillHeaderFooter(){var e=this.dropdown.filterListItems(this.state.dropdown.query),t=this.parseTemplate("dropdownHeader",[e]),n=this.parseTemplate("dropdownFooter",[e]),i=this.dropdown.getHeaderRef(),o=this.dropdown.getFooterRef();t&&i?.parentNode.replaceChild(t,i),n&&o?.parentNode.replaceChild(n,o)},position(e){var t=this.settings.dropdown,n=this.dropdown.getAppendTarget();if("manual"!=t.position&&n){var i,o,s,a,l,r,d,p,c,u=this.DOM.dropdown,_=t.RTL,m=n===document.body,h=n===this.DOM.scope,g=m?window.pageYOffset:n.scrollTop,y=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,f=y.clientHeight,v=Math.max(y.clientWidth||0,window.innerWidth||0)>480?t.position:"all",x=this.DOM["input"==v?"input":"scope"];if(e=e||u.clientHeight,this.state.dropdown.visible){if("text"==v?(s=(i=function(){const e=document.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),n=t.startContainer,i=t.startOffset;let o,s;if(i>0)return s=document.createRange(),s.setStart(n,i-1),s.setEnd(n,i),o=s.getBoundingClientRect(),{left:o.right,top:o.top,bottom:o.bottom};if(n.getBoundingClientRect)return n.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,o=i.top,a=i.left,l="auto"):(r=function(e){var t=0,n=0;for(e=e.parentNode;e&&e!=y;)t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.parentNode;return{top:t,left:n}}(n),i=x.getBoundingClientRect(),o=h?-1:i.top-r.top,s=(h?i.height:i.bottom-r.top)-1,a=h?-1:i.left-r.left,l=i.width+"px"),!m){let e=function(){for(var e=0,n=t.appendTarget.parentNode;n;)e+=n.scrollTop||0,n=n.parentNode;return e}();o+=e,s+=e}o=Math.floor(o),s=Math.ceil(s),p=((d=t.placeAbove??f-i.bottom<e)?o:s)+g,c=`left: ${a+(_&&i.width||0)+window.pageXOffset}px;`,u.style.cssText=`${c}; top: ${p}px; min-width: ${l}; max-width: ${l}`,u.setAttribute("placement",d?"top":"bottom"),u.setAttribute("position",v)}}}});const I="@yaireo/tagify/";var L,S={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},k={wrapper:(e,t)=>`<tags class="${t.classNames.namespace} ${t.mode?`${t.classNames[t.mode+"Mode"]}`:""} ${e.className}"\n ${t.readonly?"readonly":""}\n ${t.disabled?"disabled":""}\n ${t.required?"required":""}\n ${"select"===t.mode?"spellcheck='false'":""}\n tabIndex="-1">\n <span ${!t.readonly&&t.userInput?"contenteditable":""} tabIndex="0" data-placeholder="${t.placeholder||"​"}" aria-placeholder="${t.placeholder||""}"\n class="${t.classNames.input}"\n role="textbox"\n aria-autocomplete="both"\n aria-multiline="${"mix"==t.mode}"></span>\n ​\n </tags>`,tag(e,t){let n=t.settings;return`<tag title="${e.title||e.value}"\n contenteditable='false'\n spellcheck='false'\n tabIndex="${n.a11y.focusableTags?0:-1}"\n class="${n.classNames.tag} ${e.class||""}"\n ${this.getAttributes(e)}>\n <x title='' class="${n.classNames.tagX}" role='button' aria-label='remove tag'></x>\n <div>\n <span class="${n.classNames.tagText}">${e[n.tagTextProp]||e.value}</span>\n </div>\n </tag>`},dropdown(e){var t=e.dropdown;return`<div class="${"manual"==t.position?"":e.classNames.dropdown} ${t.classname}" role="listbox" aria-labelledby="dropdown" dir="${t.RTL?"rtl":""}">\n <div data-selector='tagify-suggestions-wrapper' class="${e.classNames.dropdownWrapper}"></div>\n </div>`},dropdownContent(e){var t=this.settings.templates,n=this.state.dropdown.suggestions;return`\n ${t.dropdownHeader.call(this,n)}\n ${e}\n ${t.dropdownFooter.call(this,n)}\n `},dropdownItem(e){return`<div ${this.getAttributes(e)}\n class='${this.settings.classNames.dropdownItem} ${e.class||""}'\n tabindex="0"\n role="option">${e.mappedValue||e.value}</div>`},dropdownHeader(e){return`<header data-selector='tagify-suggestions-header' class="${this.settings.classNames.dropdownHeader}"></header>`},dropdownFooter(e){var t=e.length-this.settings.dropdown.maxItems;return t>0?`<footer data-selector='tagify-suggestions-footer' class="${this.settings.classNames.dropdownFooter}">\n ${t} more items. Refine your search.\n </footer>`:""},dropdownItemNoMatch:null},M={customBinding(){this.customEventsList.forEach((e=>{this.on(e,this.settings.callbacks[e])}))},binding(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var t,n=this.settings,i=this.events.callbacks,o=e?"addEventListener":"removeEventListener";if(!this.state.mainEvents||!e){for(var s in this.state.mainEvents=e,e&&!this.listeners.main&&(this.events.bindGlobal.call(this),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),t=this.listeners.main=this.listeners.main||{focus:["input",i.onFocusBlur.bind(this)],keydown:["input",i.onKeydown.bind(this)],click:["scope",i.onClickScope.bind(this)],dblclick:"select"!=n.mode&&["scope",i.onDoubleClickScope.bind(this)],paste:["input",i.onPaste.bind(this)],drop:["input",i.onDrop.bind(this)],compositionstart:["input",i.onCompositionStart.bind(this)],compositionend:["input",i.onCompositionEnd.bind(this)]})t[s]&&this.DOM[t[s][0]][o](s,t[s][1]);clearInterval(this.listeners.main.originalInputValueObserverInterval),this.listeners.main.originalInputValueObserverInterval=setInterval(i.observeOriginalInputValue.bind(this),500);var a=this.listeners.main.inputMutationObserver||new MutationObserver(i.onInputDOMChange.bind(this));a.disconnect(),"mix"==n.mode&&a.observe(this.DOM.input,{childList:!0})}},bindGlobal(e){var t,n=this.events.callbacks,i=e?"removeEventListener":"addEventListener";if(this.listeners&&(e||!this.listeners.global))for(t of(this.listeners.global=this.listeners.global||[{type:this.isIE?"keydown":"input",target:this.DOM.input,cb:n[this.isIE?"onInputIE":"onInput"].bind(this)},{type:"keydown",target:window,cb:n.onWindowKeyDown.bind(this)},{type:"blur",target:this.DOM.input,cb:n.onFocusBlur.bind(this)},{type:"click",target:document,cb:n.onClickAnywhere.bind(this),useCapture:!0}],this.listeners.global))t.target[i](t.type,t.cb,!!t.useCapture)},unbindGlobal(){this.events.bindGlobal.call(this,!0)},callbacks:{onFocusBlur(e){var t=this.settings,n=e.target?this.trim(e.target.textContent):"",i=this.value?.[0]?.[t.tagTextProp],o=e.type,s=t.dropdown.enabled>=0,a={relatedTarget:e.relatedTarget},l=this.state.actions.selectOption&&(s||!t.dropdown.closeOnSelect),r=this.state.actions.addNew&&s;if("blur"==o){if(e.relatedTarget===this.DOM.scope)return this.dropdown.hide(),void this.DOM.input.focus();this.postUpdate(),t.onChangeAfterBlur&&this.triggerChangeEvent()}if(!l&&!r)if(this.state.hasFocus="focus"==o&&+new Date,this.toggleFocusClass(this.state.hasFocus),"mix"!=t.mode){if("focus"==o)return this.trigger("focus",a),void(0!==t.dropdown.enabled&&t.userInput||this.state.dropdown.visible||this.dropdown.show(this.value.length?"":void 0));"blur"==o&&(this.trigger("blur",a),this.loading(!1),"select"==t.mode&&i===n&&(n=""),n&&!this.state.actions.selectOption&&t.addTagOnBlur&&t.addTagOn.includes("blur")&&this.addTags(n,!0)),this.DOM.input.removeAttribute("style"),this.dropdown.hide()}else"focus"==o?this.trigger("focus",a):"blur"==e.type&&(this.trigger("blur",a),this.loading(!1),this.dropdown.hide(),this.state.dropdown.visible=void 0,this.setStateSelection())},onCompositionStart(e){this.state.composing=!0},onCompositionEnd(e){this.state.composing=!1},onWindowKeyDown(e){var t,n=document.activeElement,i=g.call(this,n)&&this.DOM.scope.contains(document.activeElement),o=i&&n.hasAttribute("readonly");if(i&&!o)switch(t=n.nextElementSibling,e.key){case"Backspace":this.settings.readonly||(this.removeTags(n),(t||this.DOM.input).focus());break;case"Enter":setTimeout(this.editTag.bind(this),0,n)}},onKeydown(e){var t=this.settings;if(!this.state.composing&&t.userInput){"select"==t.mode&&t.enforceWhitelist&&this.value.length&&"Tab"!=e.key&&e.preventDefault();var n=this.trim(e.target.textContent);this.trigger("keydown",{event:e}),t.hooks.beforeKeyDown(e,{tagify:this}).then((i=>{if("mix"==t.mode){switch(e.key){case"Left":case"ArrowLeft":this.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(this.state.editing)return;var o=document.getSelection(),s="Delete"==e.key&&o.anchorOffset==(o.anchorNode.length||0),l=o.anchorNode.previousSibling,d=1==o.anchorNode.nodeType||!o.anchorOffset&&l&&1==l.nodeType&&o.anchorNode.previousSibling;a(this.DOM.input.innerHTML);var p,c,u,_=this.getTagElms(),h=1===o.anchorNode.length&&o.anchorNode.nodeValue==String.fromCharCode(8203);if("edit"==t.backspace&&d)return p=1==o.anchorNode.nodeType?null:o.anchorNode.previousElementSibling,setTimeout(this.editTag.bind(this),0,p),void e.preventDefault();if(m()&&d instanceof Element)return u=r(d),d.hasAttribute("readonly")||d.remove(),this.DOM.input.focus(),void setTimeout((()=>{v(u),this.DOM.input.click()}));if("BR"==o.anchorNode.nodeName)return;if((s||d)&&1==o.anchorNode.nodeType?c=0==o.anchorOffset?s?_[0]:null:_[Math.min(_.length,o.anchorOffset)-1]:s?c=o.anchorNode.nextElementSibling:d instanceof Element&&(c=d),3==o.anchorNode.nodeType&&!o.anchorNode.nodeValue&&o.anchorNode.previousElementSibling&&e.preventDefault(),(d||s)&&!t.backspace)return void e.preventDefault();if("Range"!=o.type&&!o.anchorOffset&&o.anchorNode==this.DOM.input&&"Delete"!=e.key)return void e.preventDefault();if("Range"!=o.type&&c&&c.hasAttribute("readonly"))return void v(r(c));"Delete"==e.key&&h&&f(o.anchorNode.nextSibling)&&this.removeTags(o.anchorNode.nextSibling),clearTimeout(L),L=setTimeout((()=>{var e=document.getSelection();a(this.DOM.input.innerHTML),!s&&e.anchorNode.previousSibling,this.value=[].map.call(_,((e,t)=>{var n=f(e);if(e.parentNode||n.readonly)return n;this.trigger("remove",{tag:e,index:t,data:n})})).filter((e=>e))}),20)}return!0}var g="manual"==t.dropdown.position;switch(e.key){case"Backspace":"select"==t.mode&&t.enforceWhitelist&&this.value.length?this.removeTags():this.state.dropdown.visible&&"manual"!=t.dropdown.position||""!=e.target.textContent&&8203!=n.charCodeAt(0)||(!0===t.backspace?this.removeTags():"edit"==t.backspace&&setTimeout(this.editTag.bind(this),0));break;case"Esc":case"Escape":if(this.state.dropdown.visible)return;e.target.blur();break;case"Down":case"ArrowDown":this.state.dropdown.visible||this.dropdown.show();break;case"ArrowRight":{let e=this.state.inputSuggestion||this.state.ddItemData;if(e&&t.autoComplete.rightKey)return void this.addTags([e],!0);break}case"Tab":{let i="select"==t.mode;if(!n||i)return!0;e.preventDefault()}case"Enter":if(this.state.dropdown.visible&&!g)return;e.preventDefault(),setTimeout((()=>{this.state.dropdown.visible&&!g||this.state.actions.selectOption||!t.addTagOn.includes(e.key.toLowerCase())||this.addTags(n,!0)}))}})).catch((e=>e))}},onInput(e){this.postUpdate();var t=this.settings;if("mix"==t.mode)return this.events.callbacks.onMixTagsInput.call(this,e);var n=this.input.normalize.call(this,void 0,{trim:!1}),i=n.length>=t.dropdown.enabled,o={value:n,inputElm:this.DOM.input},s=this.validateTag({value:n});"select"==t.mode&&this.toggleScopeValidation(s),o.isValid=s,this.state.inputText!=n&&(this.input.set.call(this,n,!1),-1!=n.search(t.delimiters)?this.addTags(n)&&this.input.set.call(this):t.dropdown.enabled>=0&&this.dropdown[i?"show":"hide"](n),this.trigger("input",o))},onMixTagsInput(e){var t,n,i,o,s,a,l,r,d=this.settings,p=this.value.length,u=this.getTagElms(),_=document.createDocumentFragment(),h=window.getSelection().getRangeAt(0),g=[].map.call(u,(e=>f(e).value));if("deleteContentBackward"==e.inputType&&m()&&this.events.callbacks.onKeydown.call(this,{target:e.target,key:"Backspace"}),x(this.getTagElms()),this.value.slice().forEach((e=>{e.readonly&&!g.includes(e.value)&&_.appendChild(this.createTagElem(e))})),_.childNodes.length&&(h.insertNode(_),this.setRangeAtStartEnd(!1,_.lastChild)),u.length!=p)return this.value=[].map.call(this.getTagElms(),(e=>f(e))),void this.update({withoutChangeEvent:!0});if(this.hasMaxTags())return!0;if(window.getSelection&&(a=window.getSelection()).rangeCount>0&&3==a.anchorNode.nodeType){if((h=a.getRangeAt(0).cloneRange()).collapse(!0),h.setStart(a.focusNode,0),i=(t=h.toString().slice(0,h.endOffset)).split(d.pattern).length-1,(n=t.match(d.pattern))&&(o=t.slice(t.lastIndexOf(n[n.length-1]))),o){if(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:o.match(d.pattern)[0],value:o.replace(d.pattern,"")},this.state.tag.baseOffset=a.baseOffset-this.state.tag.value.length,r=this.state.tag.value.match(d.delimiters))return this.state.tag.value=this.state.tag.value.replace(d.delimiters,""),this.state.tag.delimiters=r[0],this.addTags(this.state.tag.value,d.dropdown.clearOnSelect),void this.dropdown.hide();s=this.state.tag.value.length>=d.dropdown.enabled;try{l=(l=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&l.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch(e){}(l||i<this.state.mixMode.matchedPatternCount)&&(s=!1)}else this.state.flaggedTags={};this.state.mixMode.matchedPatternCount=i}setTimeout((()=>{this.update({withoutChangeEvent:!0}),this.trigger("input",c({},this.state.tag,{textContent:this.DOM.input.textContent})),this.state.tag&&this.dropdown[s?"show":"hide"](this.state.tag.value)}),10)},onInputIE(e){var t=this;setTimeout((function(){t.events.callbacks.onInput.call(t,e)}))},observeOriginalInputValue(){this.DOM.originalInput.parentNode||this.destroy(),this.DOM.originalInput.value!=this.DOM.originalInput.tagifyValue&&this.loadOriginalValues()},onClickAnywhere(e){e.target==this.DOM.scope||this.DOM.scope.contains(e.target)||(this.toggleFocusClass(!1),this.state.hasFocus=!1,!this.settings.userInput&&this.dropdown.hide())},onClickScope(e){var n=this.settings,i=e.target.closest("."+n.classNames.tag),o=e.target===this.DOM.scope,s=+new Date-this.state.hasFocus;if(o&&"select"!=n.mode)this.DOM.input.focus();else{if(!e.target.classList.contains(n.classNames.tagX))return i&&!this.state.editing?(this.trigger("click",{tag:i,index:this.getNodeIndex(i),data:f(i),event:e}),void(1!==n.editTags&&1!==n.editTags.clicks&&"select"!=n.mode||this.events.callbacks.onDoubleClickScope.call(this,e))):void(e.target==this.DOM.input&&("mix"==n.mode&&this.fixFirefoxLastTagNoCaret(),s>500)?this.state.dropdown.visible?this.dropdown.hide():0===n.dropdown.enabled&&"mix"!=n.mode&&this.dropdown.show(this.value.length?"":void 0):"select"!=n.mode||0!==n.dropdown.enabled||this.state.dropdown.visible||(this.events.callbacks.onDoubleClickScope.call(this,t(t({},e),{},{target:this.getTagElms()[0]})),!n.userInput&&this.dropdown.show()));this.removeTags(e.target.parentNode)}},onPaste(e){e.preventDefault();var t,n,i,o=this.settings;if("select"==o.mode&&o.enforceWhitelist||!o.userInput)return!1;o.readonly||(n=e.clipboardData||window.clipboardData,i=n.getData("Text"),o.hooks.beforePaste(e,{tagify:this,pastedText:i,clipboardData:n}).then((o=>{void 0===o&&(o=i),o&&(this.injectAtCaret(o,window.getSelection().getRangeAt(0)),"mix"==this.settings.mode?this.events.callbacks.onMixTagsInput.call(this,e):this.settings.pasteAsTags?t=this.addTags(this.state.inputText+o,!0):(this.state.inputText=o,this.dropdown.show(o))),this.trigger("paste",{event:e,pastedText:i,clipboardData:n,tagsElems:t})})).catch((e=>e)))},onDrop(e){e.preventDefault()},onEditTagInput(e,t){var n=e.closest("."+this.settings.classNames.tag),i=this.getNodeIndex(n),o=f(n),s=this.input.normalize.call(this,e),a={[this.settings.tagTextProp]:s,__tagId:o.__tagId},l=this.validateTag(a);this.editTagChangeDetected(c(o,a))||!0!==e.originalIsValid||(l=!0),n.classList.toggle(this.settings.classNames.tagInvalid,!0!==l),o.__isValid=l,n.title=!0===l?o.title||o.value:l,s.length>=this.settings.dropdown.enabled&&(this.state.editing&&(this.state.editing.value=s),this.dropdown.show(s)),this.trigger("edit:input",{tag:n,index:i,data:c({},this.value[i],{newValue:s}),event:t})},onEditTagPaste(e,t){var n=(t.clipboardData||window.clipboardData).getData("Text");t.preventDefault();var i=y(n);this.setRangeAtStartEnd(!1,i)},onEditTagClick(e,t){this.events.callbacks.onClickScope.call(this,t)},onEditTagFocus(e){this.state.editing={scope:e,input:e.querySelector("[contenteditable]")}},onEditTagBlur(e,t){if(g.call(this,t.relatedTarget)&&t.relatedTarget.contains(t.target))this.dropdown.hide();else if(this.state.editing&&(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(e))){var n,i,o=this.settings,s=e.closest("."+o.classNames.tag),a=f(s),l=this.input.normalize.call(this,e),r={[o.tagTextProp]:l,__tagId:a.__tagId},d=a.__originalData,p=this.editTagChangeDetected(c(a,r)),u=this.validateTag(r);if(l)if(p){if(n=this.hasMaxTags(),i=c({},d,{[o.tagTextProp]:this.trim(l),__isValid:u}),o.transformTag.call(this,i,d),!0!==(u=(!n||!0===d.__isValid)&&this.validateTag(i))){if(this.trigger("invalid",{data:i,tag:s,message:u}),o.editTags.keepInvalid)return;o.keepInvalidTags?i.__isValid=u:i=d}else o.keepInvalidTags&&(delete i.title,delete i["aria-invalid"],delete i.class);this.onEditTagDone(s,i)}else this.onEditTagDone(s,d);else this.onEditTagDone(s)}},onEditTagkeydown(e,t){if(!this.state.composing)switch(this.trigger("edit:keydown",{event:e}),e.key){case"Esc":case"Escape":this.state.editing=!1,t.__tagifyTagData.__originalData.value?t.parentNode.replaceChild(t.__tagifyTagData.__originalHTML,t):t.remove();break;case"Enter":case"Tab":e.preventDefault(),setTimeout((()=>e.target.blur()),0)}},onDoubleClickScope(e){var t,n,i=e.target.closest("."+this.settings.classNames.tag),o=f(i),s=this.settings;i&&!1!==o.editable&&(t=i.classList.contains(this.settings.classNames.tagEditing),n=i.hasAttribute("readonly"),s.readonly||t||n||!this.settings.editTags||!s.userInput||this.editTag(i),this.toggleFocusClass(!0),"select"!=s.mode&&this.trigger("dblclick",{tag:i,index:this.getNodeIndex(i),data:f(i)}))},onInputDOMChange(e){e.forEach((e=>{e.addedNodes.forEach((e=>{if("<div><br></div>"==e.outerHTML)e.replaceWith(document.createElement("br"));else if(1==e.nodeType&&e.querySelector(this.settings.classNames.tagSelector)){let t=document.createTextNode("");3==e.childNodes[0].nodeType&&"BR"!=e.previousSibling.nodeName&&(t=document.createTextNode("\n")),e.replaceWith(t,...[...e.childNodes].slice(0,-1)),v(t)}else if(g.call(this,e))if(3!=e.previousSibling?.nodeType||e.previousSibling.textContent||e.previousSibling.remove(),e.previousSibling&&"BR"==e.previousSibling.nodeName){e.previousSibling.replaceWith("\n");let t=e.nextSibling,n="";for(;t;)n+=t.textContent,t=t.nextSibling;n.trim()&&v(e.previousSibling)}else e.previousSibling&&!f(e.previousSibling)||e.before("")})),e.removedNodes.forEach((e=>{e&&"BR"==e.nodeName&&g.call(this,t)&&(this.removeTags(t),this.fixFirefoxLastTagNoCaret())}))}));var t=this.DOM.input.lastChild;t&&""==t.nodeValue&&t.remove(),t&&"BR"==t.nodeName||this.DOM.input.appendChild(document.createElement("br"))}}};function A(e,t){if(!e){console.warn("Tagify:","input element not found",e);const t=new Proxy(this,{get:()=>()=>t});return t}if(e.__tagify)return console.warn("Tagify: ","input element is already Tagified - Same instance is returned.",e),e.__tagify;var n;c(this,function(e){var t=document.createTextNode("");function n(e,n,i){i&&n.split(/\s+/g).forEach((n=>t[e+"EventListener"].call(t,n,i)))}return{off(e,t){return n("remove",e,t),this},on(e,t){return t&&"function"==typeof t&&n("add",e,t),this},trigger(n,i,o){var s;if(o=o||{cloneData:!0},n)if(e.settings.isJQueryPlugin)"remove"==n&&(n="removeTag"),jQuery(e.DOM.originalInput).triggerHandler(n,[i]);else{try{var a="object"==typeof i?i:{value:i};if((a=o.cloneData?c({},a):a).tagify=this,i.event&&(a.event=this.cloneEvent(i.event)),i instanceof Object)for(var l in i)i[l]instanceof HTMLElement&&(a[l]=i[l]);s=new CustomEvent(n,{detail:a})}catch(e){console.warn(e)}t.dispatchEvent(s)}}}}(this)),this.isFirefox=/firefox|fxios/i.test(navigator.userAgent)&&!/seamonkey/i.test(navigator.userAgent),this.isIE=window.document.documentMode,t=t||{},this.getPersistedData=(n=t.id,e=>{let t,i="/"+e;if(1==localStorage.getItem(I+n+"/v",1))try{t=JSON.parse(localStorage[I+n+i])}catch(e){}return t}),this.setPersistedData=(e=>e?(localStorage.setItem(I+e+"/v",1),(t,n)=>{let i="/"+n,o=JSON.stringify(t);t&&n&&(localStorage.setItem(I+e+i,o),dispatchEvent(new Event("storage")))}):()=>{})(t.id),this.clearPersistedData=(e=>t=>{const n=I+"/"+e+"/";if(t)localStorage.removeItem(n+t);else for(let e in localStorage)e.includes(n)&&localStorage.removeItem(e)})(t.id),this.applySettings(e,t),this.state={inputText:"",editing:!1,composing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},this.build(e),$.call(this),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),e.autofocus&&this.DOM.input.focus(),e.__tagify=this}return A.prototype={_dropdown:C,placeCaretAfterNode:v,getSetTagData:f,helpers:{sameStr:i,removeCollectionProp:o,omit:s,isObject:p,parseHTML:l,escapeHTML:d,extend:c,concatWithoutDups:u,getUID:h,isNodeTag:g},customEventsList:["change","add","remove","invalid","input","paste","click","keydown","focus","blur","edit:input","edit:beforeUpdate","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select","dropdown:updated","dropdown:noMatch","dropdown:scroll"],dataProps:["__isValid","__removed","__originalData","__originalHTML","__tagId"],trim(e){return this.settings.trim&&e&&"string"==typeof e?e.trim():e},parseHTML:l,templates:k,parseTemplate(e,t){return l((e=this.settings.templates[e]||e).apply(this,t))},set whitelist(e){const t=e&&Array.isArray(e);this.settings.whitelist=t?e:[],this.setPersistedData(t?e:[],"whitelist")},get whitelist(){return this.settings.whitelist},generateClassSelectors(e){for(let t in e){let n=t;Object.defineProperty(e,n+"Selector",{get(){return"."+this[n].split(" ")[0]}})}},applySettings(e,n){w.templates=this.templates;var i=c({},w,"mix"==n.mode?{dropdown:{position:"text"}}:{}),o=this.settings=c({},i,n);if(o.disabled=e.hasAttribute("disabled"),o.readonly=o.readonly||e.hasAttribute("readonly"),o.placeholder=d(e.getAttribute("placeholder")||o.placeholder||""),o.required=e.hasAttribute("required"),this.generateClassSelectors(o.classNames),void 0===o.dropdown.includeSelectedTags&&(o.dropdown.includeSelectedTags=o.duplicates),this.isIE&&(o.autoComplete=!1),["whitelist","blacklist"].forEach((t=>{var n=e.getAttribute("data-"+t);n&&(n=n.split(o.delimiters))instanceof Array&&(o[t]=n)})),"autoComplete"in n&&!p(n.autoComplete)&&(o.autoComplete=w.autoComplete,o.autoComplete.enabled=n.autoComplete),"mix"==o.mode&&(o.pattern=o.pattern||/@/,o.autoComplete.rightKey=!0,o.delimiters=n.delimiters||null,o.tagTextProp&&!o.dropdown.searchKeys.includes(o.tagTextProp)&&o.dropdown.searchKeys.push(o.tagTextProp)),e.pattern)try{o.pattern=new RegExp(e.pattern)}catch(e){}if(o.delimiters){o._delimiters=o.delimiters;try{o.delimiters=new RegExp(this.settings.delimiters,"g")}catch(e){}}o.disabled&&(o.userInput=!1),this.TEXTS=t(t({},S),o.texts||{}),("select"!=o.mode||n.dropdown?.enabled)&&o.userInput||(o.dropdown.enabled=0),o.dropdown.appendTarget=n.dropdown?.appendTarget||document.body;let s=this.getPersistedData("whitelist");Array.isArray(s)&&(this.whitelist=Array.isArray(o.whitelist)?u(o.whitelist,s):s)},getAttributes(e){var t,n=this.getCustomAttributes(e),i="";for(t in n)i+=" "+t+(void 0!==e[t]?`="${n[t]}"`:"");return i},getCustomAttributes(e){if(!p(e))return"";var t,n={};for(t in e)"__"!=t.slice(0,2)&&"class"!=t&&e.hasOwnProperty(t)&&void 0!==e[t]&&(n[t]=d(e[t]));return n},setStateSelection(){var e=window.getSelection(),t={anchorOffset:e.anchorOffset,anchorNode:e.anchorNode,range:e.getRangeAt&&e.rangeCount&&e.getRangeAt(0)};return this.state.selection=t,t},getCSSVars(){var e,t=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(e=>{let t=e.value;return"s"==e.unit?1e3*t:t})(function(e){if(!e)return{};var t=(e=e.trim().split(" ")[0]).split(/\d+/g).filter((e=>e)).pop().trim();return{value:+e.split(t).filter((e=>e))[0].trim(),unit:t}}((e="tag-hide-transition",t.getPropertyValue("--"+e))))}},build(e){var t=this.DOM,n=e.closest("label");this.settings.mixMode.integrated?(t.originalInput=null,t.scope=e,t.input=e):(t.originalInput=e,t.originalInput_tabIndex=e.tabIndex,t.scope=this.parseTemplate("wrapper",[e,this.settings]),t.input=t.scope.querySelector(this.settings.classNames.inputSelector),e.parentNode.insertBefore(t.scope,e),e.tabIndex=-1),n&&n.setAttribute("for","")},destroy(){this.events.unbindGlobal.call(this),this.DOM.scope.parentNode.removeChild(this.DOM.scope),this.DOM.originalInput.tabIndex=this.DOM.originalInput_tabIndex,delete this.DOM.originalInput.__tagify,this.dropdown.hide(!0),clearTimeout(this.dropdownHide__bindEventsTimeout),clearInterval(this.listeners.main.originalInputValueObserverInterval)},loadOriginalValues(e){var t,n=this.settings;if(this.state.blockChangeEvent=!0,void 0===e){const t=this.getPersistedData("value");e=t&&!this.DOM.originalInput.value?t:n.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value}if(this.removeAllTags(),e)if("mix"==n.mode)this.parseMixTags(e),(t=this.DOM.input.lastChild)&&"BR"==t.tagName||this.DOM.input.insertAdjacentHTML("beforeend","<br>");else{try{JSON.parse(e)instanceof Array&&(e=JSON.parse(e))}catch(e){}this.addTags(e,!0).forEach((e=>e&&e.classList.add(n.classNames.tagNoAnimation)))}else this.postUpdate();this.state.lastOriginalValueReported=n.mixMode.integrated?"":this.DOM.originalInput.value},cloneEvent(e){var t={};for(var n in e)"path"!=n&&(t[n]=e[n]);return t},loading(e){return this.state.isLoading=e,this.DOM.scope.classList[e?"add":"remove"](this.settings.classNames.scopeLoading),this},tagLoading(e,t){return e&&e.classList[t?"add":"remove"](this.settings.classNames.tagLoading),this},toggleClass(e,t){"string"==typeof e&&this.DOM.scope.classList.toggle(e,t)},toggleScopeValidation(e){var t=!0===e||void 0===e;!this.settings.required&&e&&e===this.TEXTS.empty&&(t=!0),this.toggleClass(this.settings.classNames.tagInvalid,!t),this.DOM.scope.title=t?"":e},toggleFocusClass(e){this.toggleClass(this.settings.classNames.focus,!!e)},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var e=this.DOM.originalInput,t=this.state.lastOriginalValueReported!==e.value,n=new CustomEvent("change",{bubbles:!0});t&&(this.state.lastOriginalValueReported=e.value,n.simulated=!0,e._valueTracker&&e._valueTracker.setValue(Math.random()),e.dispatchEvent(n),this.trigger("change",this.state.lastOriginalValueReported),e.value=this.state.lastOriginalValueReported)}},events:M,fixFirefoxLastTagNoCaret(){},setRangeAtStartEnd(e,t){if(t){e="number"==typeof e?e:!!e,t=t.lastChild||t;var n=document.getSelection();if(n.focusNode instanceof Element&&!this.DOM.input.contains(n.focusNode))return!0;try{n.rangeCount>=1&&["Start","End"].forEach((i=>n.getRangeAt(0)["set"+i](t,e||t.length)))}catch(e){console.warn("Tagify: ",e)}}},insertAfterTag(e,t){if(t=t||this.settings.mixMode.insertAfterTag,e&&e.parentNode&&t)return t="string"==typeof t?document.createTextNode(t):t,e.parentNode.insertBefore(t,e.nextSibling),t},editTagChangeDetected(e){var t=e.__originalData;for(var n in t)if(!this.dataProps.includes(n)&&e[n]!=t[n])return!0;return!1},getTagTextNode(e){return e.querySelector(this.settings.classNames.tagTextSelector)},setTagTextNode(e,t){this.getTagTextNode(e).innerHTML=d(t)},editTag(e,t){e=e||this.getLastTag(),t=t||{},this.dropdown.hide();var n=this.settings,i=this.getTagTextNode(e),o=this.getNodeIndex(e),s=f(e),a=this.events.callbacks,l=!0;if(i){if(!(s instanceof Object&&"editable"in s)||s.editable)return s=f(e,{__originalData:c({},s),__originalHTML:e.cloneNode(!0)}),f(s.__originalHTML,s.__originalData),i.setAttribute("contenteditable",!0),e.classList.add(n.classNames.tagEditing),i.addEventListener("click",a.onEditTagClick.bind(this,e)),i.addEventListener("focus",a.onEditTagFocus.bind(this,e)),i.addEventListener("blur",a.onEditTagBlur.bind(this,this.getTagTextNode(e))),i.addEventListener("input",a.onEditTagInput.bind(this,i)),i.addEventListener("paste",a.onEditTagPaste.bind(this,i)),i.addEventListener("keydown",(t=>a.onEditTagkeydown.call(this,t,e))),i.addEventListener("compositionstart",a.onCompositionStart.bind(this)),i.addEventListener("compositionend",a.onCompositionEnd.bind(this)),t.skipValidation||(l=this.editTagToggleValidity(e)),i.originalIsValid=l,this.trigger("edit:start",{tag:e,index:o,data:s,isValid:l}),i.focus(),this.setRangeAtStartEnd(!1,i),0===n.dropdown.enabled&&this.dropdown.show(),this.state.hasFocus=!0,this}else console.warn("Cannot find element in Tag template: .",n.classNames.tagTextSelector)},editTagToggleValidity(e,t){var n;if(t=t||f(e))return(n=!("__isValid"in t)||!0===t.__isValid)||this.removeTagsFromValue(e),this.update(),e.classList.toggle(this.settings.classNames.tagNotAllowed,!n),t.__isValid=n,t.__isValid;console.warn("tag has no data: ",e,t)},onEditTagDone(e,t){t=t||{};var n,i={tag:e=e||this.state.editing.scope,index:this.getNodeIndex(e),previousData:f(e),data:t},o=this.settings;this.trigger("edit:beforeUpdate",i,{cloneData:!1}),this.state.editing=!1,delete t.__originalData,delete t.__originalHTML,e&&((n=t[o.tagTextProp])?n.trim?.():o.tagTextProp in t?void 0:t.value)?(e=this.replaceTag(e,t),this.editTagToggleValidity(e,t),o.a11y.focusableTags?e.focus():v(e)):e&&this.removeTags(e),this.trigger("edit:updated",i),this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag(e,t){t&&""!==t.value&&void 0!==t.value||(t=e.__tagifyTagData),t.__isValid&&1!=t.__isValid&&c(t,this.getInvalidTagAttrs(t,t.__isValid));var n=this.createTagElem(t);return e.parentNode.replaceChild(n,e),this.updateValueByDOMTags(),n},updateValueByDOMTags(){this.value.length=0,[].forEach.call(this.getTagElms(),(e=>{e.classList.contains(this.settings.classNames.tagNotAllowed.split(" ")[0])||this.value.push(f(e))})),this.update()},injectAtCaret(e,t){if(!(t=t||this.state.selection?.range)&&e)return this.appendMixTags(e),this;let n=y(e,t);return this.setRangeAtStartEnd(!1,n),this.updateValueByDOMTags(),this.update(),this},input:{set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var n=this.settings.dropdown.closeOnSelect;this.state.inputText=e,t&&(this.DOM.input.innerHTML=d(""+e)),!e&&n&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw(){return this.DOM.input.textContent},validate(){var e=!this.state.inputText||!0===this.validateTag({value:this.state.inputText});return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!e),e},normalize(e,t){var n=e||this.DOM.input,i=[];n.childNodes.forEach((e=>3==e.nodeType&&i.push(e.nodeValue))),i=i.join("\n");try{i=i.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch(e){}return i=i.replace(/\s/g," "),t?.trim?this.trim(i):i},autocomplete:{suggest(e){if(this.settings.autoComplete.enabled){"object"!=typeof(e=e||{value:""})&&(e={value:e});var t=this.dropdown.getMappedValue(e);if("number"!=typeof t){var n=this.state.inputText.toLowerCase(),i=t.substr(0,this.state.inputText.length).toLowerCase(),o=t.substring(this.state.inputText.length);t&&this.state.inputText&&i==n?(this.DOM.input.setAttribute("data-suggest",o),this.state.inputSuggestion=e):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}}},set(e){var t=this.DOM.input.getAttribute("data-suggest"),n=e||(t?this.state.inputText+t:null);return!!n&&("mix"==this.settings.mode?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+n)):(this.input.set.call(this,n),this.setRangeAtStartEnd(!1,this.DOM.input)),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx(e){return this.value.findIndex((t=>t.__tagId==(e||{}).__tagId))},getNodeIndex(e){var t=0;if(e)for(;e=e.previousElementSibling;)t++;return t},getTagElms(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i="."+[...this.settings.classNames.tag.split(" "),...t].join(".");return[].slice.call(this.DOM.scope.querySelectorAll(i))},getLastTag(){var e=this.DOM.scope.querySelectorAll(`${this.settings.classNames.tagSelector}:not(.${this.settings.classNames.tagHide}):not([readonly])`);return e[e.length-1]},isTagDuplicate(e,t,n){var o=0;if("select"==this.settings.mode)return!1;for(let s of this.value)i(this.trim(""+e),s.value,t)&&n!=s.__tagId&&o++;return o},getTagIndexByValue(e){var t=[],n=this.settings.dropdown.caseSensitive;return this.getTagElms().forEach(((o,s)=>{o.__tagifyTagData&&i(this.trim(o.__tagifyTagData.value),e,n)&&t.push(s)})),t},getTagElmByValue(e){var t=this.getTagIndexByValue(e)[0];return this.getTagElms()[t]},flashTag(e){e&&(e.classList.add(this.settings.classNames.tagFlash),setTimeout((()=>{e.classList.remove(this.settings.classNames.tagFlash)}),100))},isTagBlacklisted(e){return e=this.trim(e.toLowerCase()),this.settings.blacklist.filter((t=>(""+t).toLowerCase()==e)).length},isTagWhitelisted(e){return!!this.getWhitelistItem(e)},getWhitelistItem(e,t,n){t=t||"value";var o,s=this.settings;return(n=n||s.whitelist).some((n=>{var a="string"==typeof n?n:n[t]||n.value;if(i(a,e,s.dropdown.caseSensitive,s.trim))return o="string"==typeof n?{value:n}:n,!0})),o||"value"!=t||"value"==s.tagTextProp||(o=this.getWhitelistItem(e,s.tagTextProp,n)),o},validateTag(e){var t=this.settings,n="value"in e?"value":t.tagTextProp,i=this.trim(e[n]+"");return(e[n]+"").trim()?"mix"!=t.mode&&t.pattern&&t.pattern instanceof RegExp&&!t.pattern.test(i)?this.TEXTS.pattern:!t.duplicates&&this.isTagDuplicate(i,t.dropdown.caseSensitive,e.__tagId)?this.TEXTS.duplicate:this.isTagBlacklisted(i)||t.enforceWhitelist&&!this.isTagWhitelisted(i)?this.TEXTS.notAllowed:!t.validate||t.validate(e):this.TEXTS.empty},getInvalidTagAttrs(e,t){return{"aria-invalid":!0,class:`${e.class||""} ${this.settings.classNames.tagNotAllowed}`.trim(),title:t}},hasMaxTags(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},setReadonly(e,t){var n=this.settings;document.activeElement.blur(),n[t||"readonly"]=e,this.DOM.scope[(e?"set":"remove")+"Attribute"](t||"readonly",!0),this.settings.userInput=!0,this.setContentEditable(!e)},setContentEditable(e){this.settings.userInput&&(this.DOM.input.contentEditable=e,this.DOM.input.tabIndex=e?0:-1)},setDisabled(e){this.setReadonly(e,"disabled")},normalizeTags(e){var t=this.settings,n=t.whitelist,i=t.delimiters,o=t.mode,s=t.tagTextProp,a=[],l=!!n&&n[0]instanceof Object,r=Array.isArray(e),d=r&&e[0].value,p=e=>(e+"").split(i).filter((e=>e)).map((e=>({[s]:this.trim(e),value:this.trim(e)})));if("number"==typeof e&&(e=e.toString()),"string"==typeof e){if(!e.trim())return[];e=p(e)}else r&&(e=[].concat(...e.map((e=>null!=e.value?e:p(e)))));return l&&!d&&(e.forEach((e=>{var t=a.map((e=>e.value)),n=this.dropdown.filterListItems.call(this,e[s],{exact:!0});this.settings.duplicates||(n=n.filter((e=>!t.includes(e.value))));var i=n.length>1?this.getWhitelistItem(e[s],s,n):n[0];i&&i instanceof Object?a.push(i):"mix"!=o&&(null==e.value&&(e.value=e[s]),a.push(e))})),a.length&&(e=a)),e},parseMixTags(e){var t=this.settings,n=t.mixTagsInterpolator,i=t.duplicates,o=t.transformTag,s=t.enforceWhitelist,a=t.maxTags,l=t.tagTextProp,r=[];e=e.split(n[0]).map(((e,t)=>{var d,p,c,u=e.split(n[1]),_=u[0],m=r.length==a;try{if(_==+_)throw Error;p=JSON.parse(_)}catch(e){p=this.normalizeTags(_)[0]||{value:_}}if(o.call(this,p),m||!(u.length>1)||s&&!this.isTagWhitelisted(p.value)||!i&&this.isTagDuplicate(p.value)){if(e)return t?n[0]+e:e}else p[d=p[l]?l:"value"]=this.trim(p[d]),c=this.createTagElem(p),r.push(p),c.classList.add(this.settings.classNames.tagNoAnimation),u[0]=c.outerHTML,this.value.push(p);return u.join("")})).join(""),this.DOM.input.innerHTML=e,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize();var d=this.getTagElms();return d.forEach(((e,t)=>f(e,r[t]))),this.update({withoutChangeEvent:!0}),x(d,this.state.hasFocus),e},replaceTextWithNode(e,t){if(this.state.tag||t){t=t||this.state.tag.prefix+this.state.tag.value;var n,i,o=this.state.selection||window.getSelection(),s=o.anchorNode,a=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return s.splitText(o.anchorOffset-a),-1==(n=s.nodeValue.lastIndexOf(t))||(i=s.splitText(n),e&&s.parentNode.replaceChild(e,i)),!0}},prepareNewTagNode(e,t){t=t||{};var n=this.settings,i=[],o={},s=Object.assign({},e,{value:e.value+""});if(e=Object.assign({},s),n.transformTag.call(this,e),e.__isValid=this.hasMaxTags()||this.validateTag(e),!0!==e.__isValid){if(t.skipInvalid)return;if(c(o,this.getInvalidTagAttrs(e,e.__isValid),{__preInvalidData:s}),e.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(e.value)),!n.createInvalidTags)return void i.push(e.value)}return"readonly"in e&&(e.readonly?o["aria-readonly"]=!0:delete e.readonly),{tagElm:this.createTagElem(e,o),tagData:e,aggregatedInvalidInput:i}},postProcessNewTagNode(e,t){var n=this.settings,i=t.__isValid;i&&!0===i?(this.value.push(t),this.trigger("add",{tag:e,index:this.value.length-1,data:t})):(this.trigger("invalid",{data:t,index:this.value.length,tag:e,message:i}),n.keepInvalidTags||setTimeout((()=>this.removeTags(e,!0)),1e3)),this.dropdown.position()},selectTag(e,t){if(!this.settings.enforceWhitelist||this.isTagWhitelisted(t.value)){this.state.actions.selectOption&&setTimeout((()=>this.setRangeAtStartEnd(!1,this.DOM.input)));var n=this.getLastTag();return n?this.replaceTag(n,t):this.appendTag(e),this.value[0]=t,this.update(),this.trigger("add",{tag:e,data:t}),[e]}},addEmptyTag(e){var t=c({value:""},e||{}),n=this.createTagElem(t);f(n,t),this.appendTag(n),this.editTag(n,{skipValidation:!0}),this.toggleFocusClass(!0)},addTags(e,t,n){var i=[],o=this.settings,s=[],a=document.createDocumentFragment();if(!e||0==e.length)return i;switch(e=this.normalizeTags(e),o.mode){case"mix":return this.addMixTags(e);case"select":t=!1,this.removeAllTags()}return this.DOM.input.removeAttribute("style"),e.forEach((e=>{const t=this.prepareNewTagNode(e,{skipInvalid:n||o.skipInvalid}),l=t.tagElm;if(e=t.tagData,s=t.aggregatedInvalidInput,i.push(l),"select"==o.mode)return this.selectTag(l,e);a.appendChild(l),this.postProcessNewTagNode(l,e)})),this.appendTag(a),this.update(),e.length&&t&&(this.input.set.call(this,o.createInvalidTags?"":s.join(o._delimiters)),this.setRangeAtStartEnd(!1,this.DOM.input)),o.dropdown.enabled&&this.dropdown.refilter(),i},addMixTags(e){if((e=this.normalizeTags(e))[0].prefix||this.state.tag)return this.prefixedTextToTag(e[0]);var t=document.createDocumentFragment();return e.forEach((e=>{const n=this.prepareNewTagNode(e);t.appendChild(n.tagElm),this.postProcessNewTagNode(tagElm,n.tagData)})),this.appendMixTags(t),t},appendMixTags(e){var t=!!this.state.selection;t?this.injectAtCaret(e):(this.DOM.input.focus(),(t=this.setStateSelection()).range.setStart(this.DOM.input,t.range.endOffset),t.range.setEnd(this.DOM.input,t.range.endOffset),this.DOM.input.appendChild(e),this.updateValueByDOMTags(),this.update())},prefixedTextToTag(e){var t,n,i=this.settings,o=this.state.tag?.delimiters;if(e.prefix=e.prefix||this.state.tag?this.state.tag.prefix:(i.pattern.source||i.pattern)[0],n=this.prepareNewTagNode(e),t=n.tagElm,this.replaceTextWithNode(t)||this.DOM.input.appendChild(t),setTimeout((()=>t.classList.add(this.settings.classNames.tagNoAnimation)),300),this.value.push(n.tagData),this.update(),!o){var s=this.insertAfterTag(t)||t;setTimeout(v,0,s)}return this.state.tag=null,this.postProcessNewTagNode(t,n.tagData),t},appendTag(e){var t=this.DOM,n=t.input;t.scope.insertBefore(e,n)},createTagElem(e,n){e.__tagId=h();var i,o=c({},e,t({value:d(e.value+"")},n));return function(e){for(var t,n=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,null,!1);t=n.nextNode();)t.textContent.trim()||t.parentNode.removeChild(t)}(i=this.parseTemplate("tag",[o,this])),f(i,e),i},reCheckInvalidTags(){var e=this.settings;this.getTagElms(e.classNames.tagNotAllowed).forEach(((t,n)=>{var i=f(t),o=this.hasMaxTags(),s=this.validateTag(i),a=!0===s&&!o;if("select"==e.mode&&this.toggleScopeValidation(s),a)return i=i.__preInvalidData?i.__preInvalidData:{value:i.value},this.replaceTag(t,i);t.title=o||s}))},removeTags(e,t,n){var i,o=this.settings;if(e=e&&e instanceof HTMLElement?[e]:e instanceof Array?e:e?[e]:[this.getLastTag()],i=e.reduce(((e,t)=>{t&&"string"==typeof t&&(t=this.getTagElmByValue(t));var n=f(t);return t&&n&&!n.readonly&&e.push({node:t,idx:this.getTagIdx(n),data:f(t,{__removed:!0})}),e}),[]),n="number"==typeof n?n:this.CSSVars.tagHideTransition,"select"==o.mode&&(n=0,this.input.set.call(this)),1==i.length&&"select"!=o.mode&&i[0].node.classList.contains(o.classNames.tagNotAllowed)&&(t=!0),i.length)return o.hooks.beforeRemoveTag(i,{tagify:this}).then((()=>{function e(e){e.node.parentNode&&(e.node.parentNode.removeChild(e.node),t?o.keepInvalidTags&&this.trigger("remove",{tag:e.node,index:e.idx}):(this.trigger("remove",{tag:e.node,index:e.idx,data:e.data}),this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),o.keepInvalidTags&&this.reCheckInvalidTags()))}n&&n>10&&1==i.length?function(t){t.node.style.width=parseFloat(window.getComputedStyle(t.node).width)+"px",document.body.clientTop,t.node.classList.add(o.classNames.tagHide),setTimeout(e.bind(this),n,t)}.call(this,i[0]):i.forEach(e.bind(this)),t||(this.removeTagsFromValue(i.map((e=>e.node))),this.update(),"select"==o.mode&&this.setContentEditable(!0))})).catch((e=>{}))},removeTagsFromDOM(){[].slice.call(this.getTagElms()).forEach((e=>e.parentNode.removeChild(e)))},removeTagsFromValue(e){(e=Array.isArray(e)?e:[e]).forEach((e=>{var t=f(e),n=this.getTagIdx(t);n>-1&&this.value.splice(n,1)}))},removeAllTags(e){e=e||{},this.value=[],"mix"==this.settings.mode?this.DOM.input.innerHTML="":this.removeTagsFromDOM(),this.dropdown.refilter(),this.dropdown.position(),this.state.dropdown.visible&&setTimeout((()=>{this.DOM.input.focus()})),"select"==this.settings.mode&&(this.input.set.call(this),this.setContentEditable(!0)),this.update(e)},postUpdate(){this.state.blockChangeEvent=!1;var e=this.settings,t=e.classNames,n="mix"==e.mode?e.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(t.hasMaxTags,this.value.length>=e.maxTags),this.toggleClass(t.hasNoTags,!this.value.length),this.toggleClass(t.empty,!n),"select"==e.mode&&this.toggleScopeValidation(this.value?.[0]?.__isValid)},setOriginalInputValue(e){var t=this.DOM.originalInput;this.settings.mixMode.integrated||(t.value=e,t.tagifyValue=t.value,this.setPersistedData(e,"value"))},update(e){clearTimeout(this.debouncedUpdateTimeout),this.debouncedUpdateTimeout=setTimeout(function(){var t=this.getInputValue();this.setOriginalInputValue(t),this.settings.onChangeAfterBlur&&(e||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent(),this.postUpdate()}.bind(this),100)},getInputValue(){var e=this.getCleanValue();return"mix"==this.settings.mode?this.getMixedTagsAsString(e):e.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(e):JSON.stringify(e):""},getCleanValue(e){return o(e||this.value,this.dataProps)},getMixedTagsAsString(){var e="",t=this,n=this.settings,i=n.originalInputValueFormat||JSON.stringify,o=n.mixTagsInterpolator;return function n(a){a.childNodes.forEach((a=>{if(1==a.nodeType){const l=f(a);if("BR"==a.tagName&&(e+="\r\n"),l&&g.call(t,a)){if(l.__removed)return;e+=o[0]+i(s(l,t.dataProps))+o[1]}else a.getAttribute("style")||["B","I","U"].includes(a.tagName)?e+=a.textContent:"DIV"!=a.tagName&&"P"!=a.tagName||(e+="\r\n",n(a))}else e+=a.textContent}))}(this.DOM.input),e}},A.prototype.removeTag=A.prototype.removeTags,A}()}));ue('@charset "UTF-8";:root{--tagify-dd-color-primary:rgb(53,149,246);--tagify-dd-bg-color:white;--tagify-dd-item-pad:.3em .5em;--tagify-dd-max-height:300px}.tagify{--tags-disabled-bg:#F1F1F1;--tags-border-color:#DDD;--tags-hover-border-color:#CCC;--tags-focus-border-color:#3595f6;--tag-border-radius:3px;--tag-bg:#E5E5E5;--tag-hover:#D3E2E2;--tag-text-color:black;--tag-text-color--edit:black;--tag-pad:0.3em 0.5em;--tag-inset-shadow-size:1.1em;--tag-invalid-color:#D39494;--tag-invalid-bg:rgba(211, 148, 148, 0.5);--tag--min-width:1ch;--tag--max-width:100%;--tag-hide-transition:0.3s;--tag-remove-bg:rgba(211, 148, 148, 0.3);--tag-remove-btn-color:black;--tag-remove-btn-bg:none;--tag-remove-btn-bg--hover:#c77777;--input-color:inherit;--placeholder-color:rgba(0, 0, 0, 0.4);--placeholder-color-focus:rgba(0, 0, 0, 0.25);--loader-size:.8em;--readonly-striped:1;display:inline-flex;align-items:flex-start;flex-wrap:wrap;border:1px solid var(--tags-border-color);padding:0;line-height:0;cursor:text;outline:0;position:relative;box-sizing:border-box;transition:.1s}@keyframes tags--bump{30%{transform:scale(1.2)}}@keyframes rotateLoader{to{transform:rotate(1turn)}}.tagify:hover:not(.tagify--focus):not(.tagify--invalid){--tags-border-color:var(--tags-hover-border-color)}.tagify[disabled]{background:var(--tags-disabled-bg);filter:saturate(0);opacity:.5;pointer-events:none}.tagify[disabled].tagify--select,.tagify[readonly].tagify--select{pointer-events:none}.tagify[disabled]:not(.tagify--mix):not(.tagify--select),.tagify[readonly]:not(.tagify--mix):not(.tagify--select){cursor:default}.tagify[disabled]:not(.tagify--mix):not(.tagify--select)>.tagify__input,.tagify[readonly]:not(.tagify--mix):not(.tagify--select)>.tagify__input{visibility:hidden;width:0;margin:5px 0}.tagify[disabled]:not(.tagify--mix):not(.tagify--select) .tagify__tag>div,.tagify[readonly]:not(.tagify--mix):not(.tagify--select) .tagify__tag>div{padding:var(--tag-pad)}.tagify[disabled]:not(.tagify--mix):not(.tagify--select) .tagify__tag>div::before,.tagify[readonly]:not(.tagify--mix):not(.tagify--select) .tagify__tag>div::before{animation:readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused}@keyframes readonlyStyles{0%{background:linear-gradient(45deg,var(--tag-bg) 25%,transparent 25%,transparent 50%,var(--tag-bg) 50%,var(--tag-bg) 75%,transparent 75%,transparent) 0/5px 5px;box-shadow:none;filter:brightness(.95)}}.tagify[disabled] .tagify__tag__removeBtn,.tagify[readonly] .tagify__tag__removeBtn{display:none}.tagify--loading .tagify__input>br:last-child{display:none}.tagify--loading .tagify__input::before{content:none}.tagify--loading .tagify__input::after{content:"";vertical-align:middle;opacity:1;width:.7em;height:.7em;width:var(--loader-size);height:var(--loader-size);min-width:0;border:3px solid;border-color:#eee #bbb #888 transparent;border-radius:50%;animation:rotateLoader .4s infinite linear;content:""!important;margin:-2px 0 -2px .5em}.tagify--loading .tagify__input:empty::after{margin-left:0}.tagify+input,.tagify+textarea{position:absolute!important;left:-9999em!important;transform:scale(0)!important}.tagify__tag{display:inline-flex;align-items:center;max-width:calc(var(--tag--max-width) - 10px);margin-inline:5px 0;margin-block:5px;position:relative;z-index:1;outline:0;line-height:normal;cursor:default;transition:.13s ease-out}.tagify__tag>div{flex:1;vertical-align:top;box-sizing:border-box;max-width:100%;padding:var(--tag-pad);color:var(--tag-text-color);line-height:inherit;border-radius:var(--tag-border-radius);white-space:nowrap;transition:.13s ease-out}.tagify__tag>div>*{white-space:pre-wrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;vertical-align:top;min-width:var(--tag--min-width);max-width:var(--tag--max-width);transition:.8s ease,.1s color}.tagify__tag>div>[contenteditable]{outline:0;-webkit-user-select:text;user-select:text;cursor:text;margin:-2px;padding:2px;max-width:350px}.tagify__tag>div>:only-child{width:100%}.tagify__tag>div::before{content:"";position:absolute;border-radius:inherit;inset:var(--tag-bg-inset,0);z-index:-1;pointer-events:none;transition:120ms ease;animation:tags--bump .3s ease-out 1;box-shadow:0 0 0 var(--tag-inset-shadow-size) var(--tag-bg) inset}.tagify__tag:focus div::before,.tagify__tag:hover:not([readonly]) div::before{--tag-bg-inset:-2.5px;--tag-bg:var(--tag-hover)}.tagify__tag--loading{pointer-events:none}.tagify__tag--loading .tagify__tag__removeBtn{display:none}.tagify__tag--loading::after{--loader-size:.4em;content:"";vertical-align:middle;opacity:1;width:.7em;height:.7em;width:var(--loader-size);height:var(--loader-size);min-width:0;border:3px solid;border-color:#eee #bbb #888 transparent;border-radius:50%;animation:rotateLoader .4s infinite linear;margin:0 .5em 0 -.1em}.tagify__tag--flash div::before{animation:none}.tagify__tag--hide{width:0!important;padding-left:0;padding-right:0;margin-left:0;margin-right:0;opacity:0;transform:scale(0);transition:var(--tag-hide-transition);pointer-events:none}.tagify__tag--hide>div>*{white-space:nowrap}.tagify__tag.tagify--noAnim>div::before{animation:none}.tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div>span{opacity:.5}.tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div::before{--tag-bg:var(--tag-invalid-bg);transition:.2s}.tagify__tag[readonly] .tagify__tag__removeBtn{display:none}.tagify__tag[readonly]>div::before{animation:readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused}@keyframes readonlyStyles{0%{background:linear-gradient(45deg,var(--tag-bg) 25%,transparent 25%,transparent 50%,var(--tag-bg) 50%,var(--tag-bg) 75%,transparent 75%,transparent) 0/5px 5px;box-shadow:none;filter:brightness(.95)}}.tagify__tag--editable>div{color:var(--tag-text-color--edit)}.tagify__tag--editable>div::before{box-shadow:0 0 0 2px var(--tag-hover) inset!important}.tagify__tag--editable>.tagify__tag__removeBtn{pointer-events:none}.tagify__tag--editable>.tagify__tag__removeBtn::after{opacity:0;transform:translateX(100%) translateX(5px)}.tagify__tag--editable.tagify--invalid>div::before{box-shadow:0 0 0 2px var(--tag-invalid-color) inset!important}.tagify__tag__removeBtn{order:5;display:inline-flex;align-items:center;justify-content:center;border-radius:50px;cursor:pointer;font:14px/1 Arial;background:var(--tag-remove-btn-bg);color:var(--tag-remove-btn-color);width:14px;height:14px;margin-inline:auto 4.6666666667px;overflow:hidden;transition:.2s ease-out}.tagify__tag__removeBtn::after{content:"×";transition:.3s,color 0s}.tagify__tag__removeBtn:hover{color:#fff;background:var(--tag-remove-btn-bg--hover)}.tagify__tag__removeBtn:hover+div>span{opacity:.5}.tagify__tag__removeBtn:hover+div::before{box-shadow:0 0 0 var(--tag-inset-shadow-size) var(--tag-remove-bg,rgba(211,148,148,.3)) inset!important;transition:box-shadow .2s}.tagify:not(.tagify--mix) .tagify__input br{display:none}.tagify:not(.tagify--mix) .tagify__input *{display:inline;white-space:nowrap}.tagify__input{flex-grow:1;display:inline-block;min-width:110px;margin:5px;padding:var(--tag-pad);line-height:normal;position:relative;white-space:pre-wrap;color:var(--input-color);box-sizing:inherit}.tagify__input:empty::before{position:static}.tagify__input:focus{outline:0}.tagify__input:focus::before{transition:.2s ease-out;opacity:0;transform:translatex(6px)}@supports (-ms-ime-align:auto){.tagify__input:focus::before{display:none}}.tagify__input:focus:empty::before{transition:.2s ease-out;opacity:1;transform:none;color:rgba(0,0,0,.25);color:var(--placeholder-color-focus)}@-moz-document url-prefix(){.tagify__input:focus:empty::after{display:none}}.tagify__input::before{content:attr(data-placeholder);height:1em;line-height:1em;margin:auto 0;z-index:1;color:var(--placeholder-color);white-space:nowrap;pointer-events:none;opacity:0;position:absolute}.tagify__input::after{content:attr(data-suggest);display:inline-block;vertical-align:middle;position:absolute;min-width:calc(100% - 1.5em);text-overflow:ellipsis;overflow:hidden;white-space:pre;color:var(--tag-text-color);opacity:.3;pointer-events:none;max-width:100px}.tagify__input .tagify__tag{margin:0 1px}.tagify--mix{display:block}.tagify--mix .tagify__input{padding:5px;margin:0;width:100%;height:100%;line-height:1.5;display:block}.tagify--mix .tagify__input::before{height:auto;display:none;line-height:inherit}.tagify--mix .tagify__input::after{content:none}.tagify--select{cursor:default}.tagify--select::after{content:">";opacity:.5;position:absolute;top:50%;right:0;bottom:0;font:16px monospace;line-height:8px;height:8px;pointer-events:none;transform:translate(-150%,-50%) scaleX(1.2) rotate(90deg);transition:.2s ease-in-out}.tagify--select[aria-expanded=true]::after{transform:translate(-150%,-50%) rotate(270deg) scaleY(1.2)}.tagify--select .tagify__tag{flex:1;max-width:none;margin-inline-end:2em;margin-block:0;padding-block:5px;cursor:text}.tagify--select .tagify__tag div::before{display:none}.tagify--select .tagify__tag+.tagify__input{display:none}.tagify--empty .tagify__input::before{transition:.2s ease-out;opacity:1;transform:none;display:inline-block;width:auto}.tagify--mix .tagify--empty .tagify__input::before{display:inline-block}.tagify--focus{--tags-border-color:var(--tags-focus-border-color);transition:0s}.tagify--invalid{--tags-border-color:#D39494}.tagify__dropdown{position:absolute;z-index:9999;transform:translateY(-1px);border-top:1px solid var(--tagify-dd-color-primary);overflow:hidden}.tagify__dropdown[dir=rtl]{transform:translate(-100%,-1px)}.tagify__dropdown[placement=top]{margin-top:0;transform:translateY(-100%)}.tagify__dropdown[placement=top] .tagify__dropdown__wrapper{border-top-width:1.1px;border-bottom-width:0}.tagify__dropdown[position=text]{box-shadow:0 0 0 3px rgba(var(--tagify-dd-color-primary),.1);font-size:.9em}.tagify__dropdown[position=text] .tagify__dropdown__wrapper{border-width:1px}.tagify__dropdown__wrapper{max-height:var(--tagify-dd-max-height);overflow:hidden;overflow-x:hidden;background:var(--tagify-dd-bg-color);border:1px solid;border-color:var(--tagify-dd-color-primary);border-bottom-width:1.5px;border-top-width:0;box-shadow:0 2px 4px -2px rgba(0,0,0,.2);transition:.3s cubic-bezier(.5,0,.3,1),transform .15s;animation:dd-wrapper-show 0s .3s forwards}@keyframes dd-wrapper-show{to{overflow-y:auto}}.tagify__dropdown__header:empty{display:none}.tagify__dropdown__footer{display:inline-block;margin-top:.5em;padding:var(--tagify-dd-item-pad);font-size:.7em;font-style:italic;opacity:.5}.tagify__dropdown__footer:empty{display:none}.tagify__dropdown--initial .tagify__dropdown__wrapper{max-height:20px;transform:translateY(-1em)}.tagify__dropdown--initial[placement=top] .tagify__dropdown__wrapper{transform:translateY(2em)}.tagify__dropdown__item{box-sizing:border-box;padding:var(--tagify-dd-item-pad);margin:1px;white-space:pre-wrap;cursor:pointer;border-radius:2px;position:relative;outline:0;max-height:60px;max-width:100%;line-height:normal}.tagify__dropdown__item--active{background:var(--tagify-dd-color-primary);color:#fff}.tagify__dropdown__item:active{filter:brightness(105%)}.tagify__dropdown__item--hidden{padding-top:0;padding-bottom:0;margin:0 1px;pointer-events:none;overflow:hidden;max-height:0;transition:var(--tagify-dd-item--hidden-duration,.3s)!important}.tagify__dropdown__item--hidden>*{transform:translateY(-100%);opacity:0;transition:inherit}');var qo="styles-module_multipurposeFieldContainer__a_bjy",Go="styles-module_multipurposeField___d1hk";ue('.styles-module_multipurposeFieldContainer__a_bjy {\n position: relative;\n}\n.styles-module_multipurposeFieldContainer__a_bjy .styles-module_multipurposeField___d1hk textarea {\n height: 112px;\n font-size: 12px;\n line-height: 20px;\n border-radius: 4px;\n padding: 12px;\n font-family: Inter;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px; /* 166.667% */\n}\n.styles-module_multipurposeFieldContainer__a_bjy .styles-module_multipurposeField___d1hk textarea:focus {\n outline: none;\n}\n.styles-module_multipurposeFieldContainer__a_bjy .styles-module_multipurposeField___d1hk textarea::placeholder {\n color: var(--black-and-grey-draft-and-tooltip-desc, #999);\n font-family: Inter;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px; /* 166.667% */\n}\n.styles-module_multipurposeFieldContainer__a_bjy .styles-module_multipurposeField___d1hk fieldset {\n margin-bottom: 16px !important;\n}\n.styles-module_multipurposeFieldContainer__a_bjy .styles-module_multipurposeField___d1hk tags {\n width: 100%;\n max-width: 682px;\n font-family: "Inter";\n height: 40px;\n padding-top: 5px;\n overflow: auto;\n --tag-bg: #bfdaff;\n --tag-hover: #bfdaff;\n --tag-remove-bg: #8cbdff;\n --tag-inset-shadow-size: 1.2em;\n}\n.styles-module_multipurposeFieldContainer__a_bjy .styles-module_multipurposeField___d1hk tags span {\n font-size: 12px;\n}\n.styles-module_multipurposeFieldContainer__a_bjy .styles-module_multipurposeField___d1hk tags [class^=tagify__input] {\n padding: 5px 10px;\n white-space: nowrap;\n}\n.styles-module_multipurposeFieldContainer__a_bjy .styles-module_multipurposeField___d1hk tags [class^=tagify__tag] {\n z-index: 0;\n}');const Jo=e=>{const{activityOutputData:t={},title:n,description:i,placeholder:o,value:s,regex:a,regexErrorMessage:l,isRequired:r,showStepValidation:d,onChange:p,isChanged:c,className:u,type:_,isMappable:m,isEditable:h,allowTagsInText:g,isHidden:y,isConfigMode:f=!1,fieldId:v="dropdown-field",labelTags:x=[],activityOutputDataRaw:w=[],enableTagify:b=!0,refreshRootStepData:$,isArray:C=!1,isButtonEnabled:I=!1,buttonText:L="Add",onButtonClickScript:S="",buttonScriptRequiresAuthToken:k=!1,tagsComponent:M=null}=e,[A,D]=Ce(!1),[T,F]=Ce(s),[E,O]=Ce(s),[N,W]=Ce(""),[z,H]=Ce(""),[P,B]=Ce(null);Ce("");const V=Le(),U=Le(),Z=e=>{"Tab"===e.key&&D(!1)};Ie((()=>{const e=e=>{"Backspace"!==e.key||""!==z||h||(F(""),O(""),p&&p("",!0))};return U.current?.addEventListener("keydown",e),()=>{U.current?.removeEventListener("keydown",e)}}),[U.current,z]),Ie((()=>(F(s),O(((e,t)=>{const n=Array.isArray(t)?t[t.length-1]:t,i=n.toString().match(/{([^}]+)}/g);let o=n;return(i||[]).forEach((t=>{const n=t.replace(/{|}/g,"");(e||[]).forEach((e=>{e.value===n&&(o=o.replace(t,`{${e.text}}`))}))})),o})(w,s)),document.addEventListener("keydown",Z),()=>{document.removeEventListener("keydown",Z)})),[s,n]),Ie((()=>{const e=U.current;if(e&&w.length){const e=document.getElementById(`tagify_${v}`);if(e&&e.dataset.tagifyFieldId!==v&&(e.value=G(s||""),e.dataset.tagifyFieldId=v),e&&!e.__tagify){var t=new Ko(e,{mode:"mix",duplicates:!0,editTags:!1,trim:!1,tagTextProp:"text",templates:{tag:q},userInput:!(!g&&m)});t.on("focus",X).on("remove",j).on("change",j),B(t)}}else if(e&&!w.length&&!s?.startsWith("{")&&!s?.endsWith("}")){const e=document.getElementById(`tagify_${v}`);e&&e.dataset.tagifyFieldId!==v&&(e.value=G(s||""),e.dataset.tagifyFieldId=v)}}),[w]);const j=e=>{const t=document.getElementById(`tagify_${v}`);let n=t.__tagify.DOM.input.innerText;t.__tagify.value.forEach((e=>{n=n.replace(e.text,`{${e.value}}`)})),n=n.trim(),0===K(n).length&&(t.value="",n=""),n=n.replace(/<br>/g,"\n"),n=n.replace(/\n{/g,"{").replace(/}\n/g,"}"),F(n),p&&p(n,!0)},K=e=>e.replace(/\s/g,"").replace(/\u200b/g,"").replace(/\u00A0/g,""),q=e=>`\n <tag\n contenteditable='false'\n spellcheck='false'\n tabIndex="-1"\n class="tagify__tag ${e.class?e.class:""}"\n >\n <x title='' class='tagify__tag__removeBtn' role='button' aria-label='remove tag'></x>\n <div>\n <span data-hint="${"string"==typeof e.title?e.title:""}" class='tagify__tag-text'>${e.text}</span>\n </div>\n </tag>`;Ie((()=>{s&&ee(s,!0)}),[v]);const G=e=>{const t=(e||"").match(/\{([^{}]+)}/g);if(t&&t.length>0){let n=e;return"TEXTAREA"===_&&(n=n.replace(/\n/g,"<br>")),t.forEach((e=>{const t=e.replace(/{|}/g,""),i=(w||[]).find((e=>e.value===t||((e,t)=>{if(t.includes("out.")){const n=t.split("out.")[1];return e.endsWith(n)}return!1})(e.value,t)))||{value:t,text:t,title:t};i&&(n=n?.replace(e,`[[{"value":"${i.value}","text":"${i.text}","title":"${J(i.text)}"}]]`))})),n}return e};Qe(V,(e=>{const t=e.target;("INPUT"===t.tagName||"TEXTAREA"===t.tagName)&&U.current&&U.current.contains(e.target)||(W(""),H(""),D(!1))}));const J=e=>{if(e.includes(".")){const n=e.split(".");let i=t;return n.forEach((e=>{i[e]&&(i=i[e])})),i}return t[e]},X=e=>{m&&D(!0);const t=Array.isArray(T)?T[0]:T,n=t?.startsWith("{")&&t?.endsWith("}");h&&!g&&m&&n&&W(t||"")},Y=e=>{const t=e.match(/\{([^{}]+)$/);if(t&&t.length>1){return t[0]}return""},Q=e=>{W("");const t=A&&!h?e.trim():Y(e);H(""!==e?t:"")},ee=(e,t,n)=>{W(""),F(e),p&&p(e,t);let i=void 0!==n?e[n]:e;void 0===n&&Array.isArray(i)&&(i=i[i.length-1]);const o=Y(i);H(""!==i?o:"")};return R`
|
|
@@ -2485,12 +2485,13 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
2485
2485
|
>
|
|
2486
2486
|
<${jo}
|
|
2487
2487
|
tags=${t}
|
|
2488
|
-
onTagClick=${b&&m?e=>{if(P){g||P.removeAllTags(),(e=>{const t=w.find((t=>t.text===e));if(P){var n=P.createTagElem({value:t.value,text:t.text,title:J(e),editable:!1});if(P.injectAtCaret(n),g){var i=P.insertAfterTag(n,"");P.placeCaretAfterNode(i)}}})(e);let t=P.DOM.input.textContent;P.value.forEach((e=>{t=(t||"").replace(e.text,`{${e.value}}`)})),t=(t||"").trim()}F(E),p&&p(E||"",!0)}:e=>{const t=U.current;let n=`{${e}}`;if(W(""),t&&g){const{selectionStart:i=0,selectionEnd:o=0}=t,s=""!==z?((e,t)=>{let n=e;return n.endsWith(t)&&(n=n.slice(0,-t.length)),n})(t.value||"",z):t.value,a=`{${e}}`;n=s.substring(0,i||0)+a+s.substring(o||0),t.selectionStart=(i||0)+a.length,t.selectionEnd=t.selectionStart,t.focus()}F(n),A&&!h&&D(!1),H(""),p&&p(n,!0)}}
|
|
2488
|
+
onTagClick=${b&&m?e=>{if(console.log("tag",e),P){g||P.removeAllTags(),(e=>{const t=w.find((t=>t.text===e));if(P){var n=P.createTagElem({value:t.value,text:t.text,title:J(e),editable:!1});if(P.injectAtCaret(n),g){var i=P.insertAfterTag(n,"");P.placeCaretAfterNode(i)}}})(e);let t=P.DOM.input.textContent;P.value.forEach((e=>{t=(t||"").replace(e.text,`{${e.value}}`)})),t=(t||"").trim()}F(E),p&&p(E||"",!0)}:e=>{const t=U.current;let n=`{${e}}`;if(W(""),t&&g){const{selectionStart:i=0,selectionEnd:o=0}=t,s=""!==z?((e,t)=>{let n=e;return n.endsWith(t)&&(n=n.slice(0,-t.length)),n})(t.value||"",z):t.value,a=`{${e}}`;n=s.substring(0,i||0)+a+s.substring(o||0),t.selectionStart=(i||0)+a.length,t.selectionEnd=t.selectionStart,t.focus()}F(n),A&&!h&&D(!1),H(""),p&&p(n,!0)}}
|
|
2489
2489
|
hideTabs=${!0}
|
|
2490
2490
|
fieldId=${v}
|
|
2491
2491
|
value=${T}
|
|
2492
2492
|
enableSearch=${Object.keys(t).length>0}
|
|
2493
2493
|
refreshRootStepData=${$}
|
|
2494
|
+
tagsComponent=${M}
|
|
2494
2495
|
/>
|
|
2495
2496
|
</div>`}
|
|
2496
2497
|
</div>
|
|
@@ -3455,8 +3456,8 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
3455
3456
|
<${Jo}
|
|
3456
3457
|
id=${t.activity_field?.id}
|
|
3457
3458
|
title=${t.title||t.activity_field?.title}
|
|
3458
|
-
activityOutputData=${this.arrayToNestedJSONWithFirstValue(this.props.activityOutputData,this.props.dynamicFieldData||this.state.dynamicFieldDataState||{})}
|
|
3459
|
-
activityOutputDataRaw=${this.props.activityOutputData}
|
|
3459
|
+
activityOutputData=${this.arrayToNestedJSONWithFirstValue(this.props.activityOutputData||Yo(this.props.tagsTree||{}),this.props.dynamicFieldData||this.state.dynamicFieldDataState||{})}
|
|
3460
|
+
activityOutputDataRaw=${this.props.activityOutputData||Yo(this.props.tagsTree||{})}
|
|
3460
3461
|
description=${p}
|
|
3461
3462
|
value=${r&&r[t.id]&&r[t.id].value&&"x-integry-skipped-field"!==r[t.id].value&&r[t.id].value||t.default_value||""}
|
|
3462
3463
|
placeholder=${this.getPlaceholder(t)}
|
|
@@ -3481,6 +3482,7 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
3481
3482
|
buttonScriptRequiresAuthToken=${t.button_script_requires_auth_token}
|
|
3482
3483
|
apiHandler=${this.props.apiHandler}
|
|
3483
3484
|
isArray=${!("STRING[]"!==t.data_type&&"NUMBER[]"!==t.data_type)}
|
|
3485
|
+
tagsComponent=${this.props.tagsComponent}
|
|
3484
3486
|
><//>
|
|
3485
3487
|
</${Us}>
|
|
3486
3488
|
</div>
|
|
@@ -3529,8 +3531,8 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
3529
3531
|
stepId=${l.id}
|
|
3530
3532
|
dynamicField=${t}
|
|
3531
3533
|
endpointData=${JSON.stringify({authorization_id:this.props.stepMapping&&this.props.stepMapping[this.props.step.id]?.selectedAuthId||this.props.selectedAuthId,...this.fieldDynamicData(t),...this.state.dynamicFieldsData})}
|
|
3532
|
-
activityOutputData=${this.arrayToNestedJSONWithFirstValue(this.props.activityOutputData,this.props.dynamicFieldData||this.state.dynamicFieldDataState||{})}
|
|
3533
|
-
activityOutputDataRaw=${this.props.activityOutputData}
|
|
3534
|
+
activityOutputData=${this.arrayToNestedJSONWithFirstValue(this.props.activityOutputData||Yo(this.props.tagsTree||{}),this.props.dynamicFieldData||this.state.dynamicFieldDataState||{})}
|
|
3535
|
+
activityOutputDataRaw=${this.props.activityOutputData||Yo(this.props.tagsTree||{})}
|
|
3534
3536
|
placeHolder=${this.getPlaceholder(t)}
|
|
3535
3537
|
appName=${this.props.step.activity.app.name}
|
|
3536
3538
|
selectedAuthId=${`${this.props.stepMapping[this.props.step.id]?.selectedAuthId||this.props.selectedAuthId||""}`}
|
|
@@ -3618,13 +3620,14 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
3618
3620
|
isChanged=${n&&n.isChanged}
|
|
3619
3621
|
type=${t.activity_field?.type}
|
|
3620
3622
|
labelTags=${le(t,!1)}
|
|
3621
|
-
activityOutputData=${this.arrayToNestedJSONWithFirstValue(this.props.activityOutputData,this.props.dynamicFieldData||this.state.dynamicFieldDataState||{})}
|
|
3622
|
-
activityOutputDataRaw=${this.props.activityOutputData}
|
|
3623
|
+
activityOutputData=${this.arrayToNestedJSONWithFirstValue(this.props.activityOutputData||Yo(this.props.tagsTree||{}),this.props.dynamicFieldData||this.state.dynamicFieldDataState||{})}
|
|
3624
|
+
activityOutputDataRaw=${this.props.activityOutputData||Yo(this.props.tagsTree||{})}
|
|
3623
3625
|
isMappable=${t.is_mappable}
|
|
3624
3626
|
isEditable=${t.is_editable}
|
|
3625
3627
|
allowTagsInText=${t.allow_tags_in_text}
|
|
3626
3628
|
fieldId=${t.activity_field?.id||t.id}
|
|
3627
3629
|
refreshRootStepData=${this.refreshRootStepData}
|
|
3630
|
+
tagsComponent=${this.props.tagsComponent}
|
|
3628
3631
|
/>
|
|
3629
3632
|
|
|
3630
3633
|
</${Us}>
|
|
@@ -7001,7 +7004,7 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
7001
7004
|
</div>
|
|
7002
7005
|
</div>
|
|
7003
7006
|
`}
|
|
7004
|
-
`}});const Rd={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}};class Wd{static SDK_VERSION="4.5.
|
|
7007
|
+
`}});const Rd={getAuthHash:async function(e,t){const n=e=>new Uint8Array([...unescape(encodeURIComponent(e))].map((e=>e.charCodeAt(0)))),i=n(t),o=n(e),s=await crypto.subtle.importKey("raw",i,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),a=await crypto.subtle.sign("HMAC",s,o);return[...new Uint8Array(a)].map((e=>e.toString(16).padStart(2,"0"))).join("")}};class Wd{static SDK_VERSION="4.5.12";config;apiHandler;initConfig;eventEmitter=(()=>new G)();static html=(()=>R)();static RenderModes=(()=>ee)();static TemplateFormRenderModes=(()=>Y)();static Layouts=(()=>X)();static ViewStyles=(()=>J)();static MarketplaceRenderModes=(()=>Q)();static Helpers;authModalId="";forceRerender=!1;constructor(e){let t;const n=e.baseUrl||"https://app.integry.io",i=e;if(i.user){const{userId:e,apiKey:t,...n}=i.user;"userId"in i||(i.userId=""),"userId"in i&&(i.userId=e.toString()),i.xIntegryConfig||(i.xIntegryConfig={}),i.xIntegryConfig.appAuth||(i.xIntegryConfig.appAuth={}),i.xIntegryConfig.appAuth.extras||(i.xIntegryConfig.appAuth.extras={}),i.xIntegryConfig.appAuth.apiKey=(t||"").toString(),i.xIntegryConfig.appAuth.extras=n}const o={oauthVerifyPath:"auth/verify",endpointsUrl:"https://integry-app.appspot.com",baseUrl:n,baseUrlv2:`${n}/v2`,baseAPIUrl:"https://api.integry.io",apiKey:i.xIntegryConfig?.appAuth?.apiKey,authId:i.xIntegryConfig?.appAuth?.authId,extras:i.xIntegryConfig?.appAuth?.extras},s=i.options||i.userConfig||{};if(i.options&&i.payloads&&(i.options.objects=e.payloads),"appKey"in i)t={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId},this.config={...i,...o,appKey:i.appKey,hash:i.hash,userId:i.userId,deploymentId:i.deploymentId,userConfig:i.deploymentId?{...s,tags:s?.tags?[...s?.tags,`${i.deploymentId}`]:[`${i.deploymentId}`]}:s};else{const e=this.getAuthParamsFromUrl()||{};t={...o,...e},this.config={...o,...e,userConfig:i.userConfig}}this.authModalId=this.getRandomFlowId(6),this.apiHandler=new j(t),this.verifyAuthConfig().then((e=>{e?.config_verified?this.eventEmitter.emit("ready",{isReady:!0}):console.error("IntegrySDK: Auth config verification failed, are your auth parameters correct?")})).catch((e=>console.error(e))),this.initConfig={containerId:"",renderMode:Y.INLINE}}SDKFailedHandler=(e,t)=>{const n=e.options||e.userConfig||{},i=document.getElementById(t);throw i&&T(R`
|
|
7005
7008
|
<${nl}
|
|
7006
7009
|
message="SDK failed to load"
|
|
7007
7010
|
debug=${n.debug}
|
|
@@ -7278,7 +7281,7 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
7278
7281
|
fieldId=${n.fieldId}
|
|
7279
7282
|
enableTagify=${n.enableTagify}
|
|
7280
7283
|
/>`}
|
|
7281
|
-
</div>`,i):console.warn(`Integry SDK render target with id ${t} was not found`)};renderFlowStep=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{containerId:"integry-marketplace",step:{},connectedAccountId:"",tagsComponent:null,onFieldChangeCallback:()=>{}};const n=document.getElementById(t.containerId);if(n){const i=de();T(R`<div>
|
|
7284
|
+
</div>`,i):console.warn(`Integry SDK render target with id ${t} was not found`)};renderFlowStep=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{containerId:"integry-marketplace",step:{},connectedAccountId:"",tagsComponent:null,tagsTree:{},onFieldChangeCallback:()=>{}};const n=document.getElementById(t.containerId);if(n){const i=de();T(R`<div>
|
|
7282
7285
|
<${ne.Provider}
|
|
7283
7286
|
value=${{apiHandler:e.apiHandler,eventEmitter:e.eventEmitter,isPreviewMode:!1}}
|
|
7284
7287
|
>
|
|
@@ -7294,6 +7297,7 @@ var e,t,n,i,o,s,a,l={},r=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]
|
|
|
7294
7297
|
accountConnected=${!0}
|
|
7295
7298
|
tagsComponent=${t.tagsComponent}
|
|
7296
7299
|
onFieldChangeCallback=${t.onFieldChangeCallback}
|
|
7300
|
+
tagsTree=${t.tagsTree}
|
|
7297
7301
|
/>
|
|
7298
7302
|
<//>
|
|
7299
7303
|
<//>
|
package/dist/umd/index.umd.d.ts
CHANGED