cft-builder 0.1.82 → 0.1.84
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/cft-builder.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-
|
|
1
|
+
import { D as s, C as o, E as a, F as d, R as i, T as u, A as B, z as l, B as m } from "./main-BvT_Y_VB.js";
|
|
2
2
|
export {
|
|
3
3
|
s as BuilderItems,
|
|
4
4
|
o as BuilderItemsRender,
|
package/dist/cft-builder.umd.cjs
CHANGED
|
@@ -1594,7 +1594,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
1596
|
`}}),m8=y.forwardRef(function(t,e){var n=$n(),r=y.useContext(rr),i=Wm.getProps(t,r),a=y.useState(i.id),s=m_(a,2),l=s[0],c=s[1],u=y.useState(i.collapsed),d=m_(u,2),f=d[0],h=d[1],m=i.toggleable?i.onToggle?i.collapsed:f:!1,g=y.useRef(null),v=y.useRef(null),A=l+"_header",S=l+"_content",x=Wm.setMetaData({props:i,state:{id:l,collapsed:m}}),w=x.ptm,T=x.cx,C=x.isUnstyled;fi(Wm.css.styles,C,{name:"fieldset"});var _=function(R){i.toggleable&&(m?E(R):O(R),i.onToggle&&i.onToggle({originalEvent:R,value:!m})),R.preventDefault()},E=function(R){i.onToggle||h(!1),i.onExpand&&i.onExpand(R)},O=function(R){i.onToggle||h(!0),i.onCollapse&&i.onCollapse(R)};ki(function(){i.id||c(jo())});var P=function(R){(R.code==="Enter"||R.code==="NumpadEnter"||R.code==="Space")&&(_(R),R.preventDefault())},B=function(){var R=n({className:T("content")},w("content")),ae=n({ref:v,id:S,role:"region","aria-labelledby":A,className:T("toggleableContent")},w("toggleableContent")),Y=n({classNames:T("transition"),timeout:{enter:1e3,exit:450},in:!m,unmountOnExit:!0,options:i.transitionOptions},w("transition"));return y.createElement(Ho,Rm({nodeRef:v},Y),y.createElement("div",ae,y.createElement("div",R,i.children)))},M=function(){if(i.toggleable){var R=n({className:T("togglericon")},w("togglericon")),ae=m?i.expandIcon||y.createElement(Hm,R):i.collapseIcon||y.createElement(g8,R),Y=Wn.getJSXIcon(ae,R,{props:i});return Y}return null},H=function(){var R=n({className:T("legendTitle")},w("legendTitle")),ae=n({id:A,role:"button","aria-expanded":!m,"aria-controls":S,onKeyDown:P,onClick:_,"aria-label":i.legend,tabIndex:0},w("toggler"));if(i.toggleable){var Y=M();return y.createElement("a",ae,Y,y.createElement("span",R,i.legend),y.createElement(Wt,null))}return y.createElement("span",Rm({},R,{id:A}),i.legend)},k=function(){var R=n({className:T("legend")},w("legend"));if(i.legend!=null||i.toggleable){var ae=H();return y.createElement("legend",R,ae)}};y.useImperativeHandle(e,function(){return{props:i,getElement:function(){return g.current},getContent:function(){return v.current}}});var z=n({id:l,ref:g,style:i.style,className:ht(i.className,T("root")),onClick:i.onClick},Wm.getOtherProps(i),w("root")),ue=k(),fe=B();return y.createElement("fieldset",z,ue,fe)});m8.displayName="Fieldset";const QW=t=>o.jsx(rn,{target:`.${t==null?void 0:t.element}`,position:"right",children:o.jsxs("div",{style:{width:400},className:"card m-3",children:[o.jsx("div",{className:"text-900 font-medium text-2xl mb-2",children:t==null?void 0:t.label}),o.jsx("div",{children:"Dynamic Listing Component"}),o.jsx(na,{}),o.jsxs("div",{className:"p-fluid",children:[o.jsx("label",{children:t==null?void 0:t.label}),o.jsxs("div",{children:[o.jsxs(m8,{children:[o.jsx("div",{className:"pi pi-circle",children:" Option 1"}),o.jsx("br",{})]}),o.jsx("br",{}),o.jsx(m8,{children:o.jsx("div",{className:"pi pi-circle",children:" Option 2"})})]})]})]})}),JW=t=>o.jsx(rn,{target:`.${t==null?void 0:t.element}`,position:"right",children:o.jsxs("div",{style:{width:400},className:"card m-3",children:[o.jsx("div",{className:"text-900 font-medium text-2xl mb-2",children:t==null?void 0:t.label}),o.jsx("div",{children:"Documents"}),o.jsx(na,{}),o.jsxs("div",{className:"p-fluid",children:[o.jsx("label",{children:t==null?void 0:t.label}),o.jsxs("div",{children:["1.Hr Cv.docx",o.jsx("br",{}),"2.Readme.txt",o.jsx("br",{}),"3.Cover.jpg"]})]})]})}),ZW=[{label:"Free form inputs",icon:"pi pi-fw pi-file",expanded:!0,items:[{label:"Text",icon:"pi pi-fw pi-plus",element:"input",schema:jY,uuid:et(),type:Zn,toolTip:t=>vX(t)},{label:"Number",icon:"pi pi-fw pi-trash",element:"number",schema:$Y,uuid:et(),type:Zn,toolTip:t=>bX(t)},{label:"Email",icon:"pi pi-fw pi-external-link",element:"email",schema:qY,uuid:et(),type:Zn,toolTip:t=>yX(t)},{label:"Text Area",icon:"pi pi-fw pi-external-link",element:"textArea",schema:GY,uuid:et(),type:Zn,toolTip:t=>AX(t)},{label:"Text Editor",icon:"pi pi-fw pi-external-link",element:"textHtmlEditor",schema:UY,uuid:et(),type:Zn,toolTip:t=>wX(t)},{label:"Date Picker",icon:"pi pi-fw pi-user-plus",element:"date-picker",schema:FY,uuid:et(),type:Zn,toolTip:t=>SG(t)},{label:"Draw Signature",icon:"pi pi-fw pi-trash",element:"signature",schema:fT,uuid:et(),type:Zn,toolTip:t=>IG(t)},{label:"Type Signature",icon:"pi pi-fw pi-trash",element:"type-signature",schema:RY,uuid:et(),type:Zn,toolTip:t=>_G(t)},{label:"File Upload",icon:"pi pi-fw pi-trash",element:"file-upload",schema:LY,uuid:et(),type:Zn,toolTip:t=>DG(t)},{label:"Phone Number",icon:"pi pi-fw pi-trash",element:"phone",schema:zY,uuid:et(),type:Zn,PhoneNumberToolTip:bE,toolTip:t=>bE(t)},{label:"Website Url",icon:"pi pi-fw pi-trash",element:"web-url",schema:QY,uuid:et(),type:Zn,toolTip:t=>NG(t)},{label:"Hidden Field",icon:"pi pi-fw pi-trash",element:"hidden-field",schema:VY,uuid:et(),type:Zn,toolTip:t=>cR(t)},{label:"Address",icon:"pi pi-fw pi-trash",element:"address",schema:OY,uuid:et(),type:Zn,toolTip:t=>uR(t)},{label:"Grid Component",icon:"pi pi-fw pi-trash",element:"grid-component",schema:BY,uuid:et(),type:Zn,toolTip:t=>YW(t)},{label:"Matrix Dropdown",icon:"pi pi-fw pi-trash",element:"matrix-dropdown",schema:HY,uuid:et(),type:Zn,toolTip:t=>KW(t)}]},{label:"Controlled inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Countries",icon:"pi pi-fw pi-align-left",element:"country",schema:ZC,uuid:et(),type:Zn,toolTip:t=>d_(t)},{label:"Dropdown",icon:"pi pi-fw pi-align-left",element:"select",schema:dT,uuid:et(),type:Zn,toolTip:t=>f_(t)},{label:"Multi Select",icon:"pi pi-fw pi-align-right",element:"multi-select",schema:oT,uuid:et(),type:Zn,toolTip:t=>h_(t)},{label:"CheckBox",icon:"pi pi-fw pi-align-left",element:"checkbox",schema:JC,uuid:et(),type:Zn,toolTip:t=>p_(t)},{label:"Radio Button",icon:"pi pi-fw pi-align-left",element:"radio",schema:cT,uuid:et(),type:Zn,toolTip:t=>h8(t)},{label:"Hierarchal Radio",icon:"pi pi-fw pi-align-left",element:"radio-hierarchal",schema:KY,uuid:et(),type:Zn,toolTip:t=>h8(t)},{label:"Dynamic Radio",icon:"pi pi-fw pi-align-left",element:"dynamic-listing",schema:PY,uuid:et(),type:Zn,toolTip:t=>QW(t)}]},{label:"Rating Inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Likert Scale",icon:"pi pi-fw pi-trash",element:"likert-scale",schema:sT,uuid:et(),type:Zn,toolTip:t=>B6(t)},{label:"Slider",icon:"pi pi-fw pi-trash",element:"slider",schema:hT,uuid:et(),type:Zn,toolTip:t=>_E(t)},{label:"Rating",icon:"pi pi-fw pi-trash",element:"rating",schema:uT,uuid:et(),type:Zn,toolTip:t=>TE(t)},{label:"Thumbs Up and Down",icon:"pi pi-fw pi-align-left",element:"thumbs",schema:pT,uuid:et(),type:Zn,toolTip:t=>oR(t)},{label:"Likert Emoji Scale",icon:"pi pi-fw pi-align-left",element:"likert-emoji-scale",schema:aT,uuid:et(),type:Zn,toolTip:t=>lR(t)}]},{label:"Social Logins",icon:"pi pi-fw pi-pencil",items:[{label:"Facebook Login",icon:"pi pi-fw pi-trash",element:"facebook-login",schema:MY,uuid:et(),type:Zn,toolTip:t=>B6(t)}]},{label:"Media",icon:"pi pi-fw pi-user",items:[{label:"Document",icon:"pi pi-fw pi-trash",element:"document",schema:eT,uuid:et(),type:Zn,toolTip:t=>JW(t)}]}],eQ=[{label:"HTML",icon:"pi pi-fw pi-file",expanded:!0,items:[{label:"<a>",icon:"pi pi-fw pi-plus",element:"a",schema:rT,uuid:et(),type:Zn},{label:"<p>",icon:"pi pi-fw pi-trash",element:"paragraph",schema:lT,uuid:et(),type:Zn},{label:"<heading>",icon:"pi pi-fw pi-external-link",element:"h",schema:tT,uuid:et(),type:Zn},{label:"<li>",icon:"pi pi-fw pi-external-link",element:"list",schema:WY,uuid:et(),type:Zn},{label:"divider",icon:"pi pi-fw pi-external-link",element:"hr",schema:nT,uuid:et(),type:Zn},{label:"Image",icon:"pi pi-fw pi-user-plus",element:"image",schema:k9,uuid:et(),type:Zn},{label:"Image Gallery",icon:"pi pi-fw pi-user-plus",element:"image-gallery",schema:iT,uuid:et(),type:Zn},{label:"Video",icon:"pi pi-fw pi-user-minus",element:"video",schema:M9,uuid:et(),type:Zn}]}],tQ=[{label:"Controlled inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Countries",icon:"pi pi-fw pi-align-left",element:"country",schema:ZC,uuid:et(),type:Zn,toolTip:t=>d_(t)},{label:"Dropdown",icon:"pi pi-fw pi-align-left",element:"select",schema:dT,uuid:et(),type:Zn,toolTip:t=>f_(t)},{label:"Multi Select",icon:"pi pi-fw pi-align-right",element:"multi-select",schema:oT,uuid:et(),type:Zn,toolTip:t=>h_(t)},{label:"CheckBox",icon:"pi pi-fw pi-align-left",element:"checkbox",schema:JC,uuid:et(),type:Zn,toolTip:t=>p_(t)},{label:"Radio Button",icon:"pi pi-fw pi-align-left",element:"radio",schema:cT,uuid:et(),type:Zn,toolTip:t=>h8(t)}]},{label:"Rating Inputs",icon:"pi pi-fw pi-pencil",items:[{label:"Likert Scale",icon:"pi pi-fw pi-trash",element:"likert-scale",schema:sT,uuid:et(),type:Zn,toolTip:t=>B6(t)},{label:"Slider",icon:"pi pi-fw pi-trash",element:"slider",schema:hT,uuid:et(),type:Zn,toolTip:t=>_E(t)},{label:"Rating",icon:"pi pi-fw pi-trash",element:"rating",schema:uT,uuid:et(),type:Zn,toolTip:t=>TE(t)},{label:"Thumbs Up and Down",icon:"pi pi-fw pi-align-left",element:"thumbs",schema:pT,uuid:et(),type:Zn},{label:"Likert Emoji Scale",icon:"pi pi-fw pi-align-left",element:"likert-emoji-scale",schema:aT,uuid:et(),type:Zn}]}],nQ=[{label:"Media",icon:"pi pi-fw pi-user",items:[{label:"Image",icon:"pi pi-fw pi-user-plus",element:"image",schema:k9,uuid:et(),type:Zn},{label:"Video",icon:"pi pi-fw pi-user-minus",element:"video",schema:M9,uuid:et(),type:Zn},{label:"Quiz",icon:"pi pi-fw pi-trash",element:"quiz",schema:YY,uuid:et(),type:Zn},{label:"Document",icon:"pi pi-fw pi-trash",element:"document",schema:eT,uuid:et(),type:Zn}]}],rQ=[{label:"Left",icon:"pi pi-align-left",value:"left"},{label:"Right",icon:"pi pi-align-right",value:"right"}],iQ=[{key:1,language:"English",type:"english"},{key:2,language:"Urdu",type:"urdu"},{key:3,language:"Hindi",type:"hindi"},{key:4,language:"Arabic",type:"arabic"},{key:5,language:"French",type:"french"},{key:6,language:"Italian",type:"italian"},{key:7,language:"Spanish",type:"spanish"}],aQ=[{name:"Bad Script",font:"bad-script"},{name:"Bilbo Swash Caps",font:"bilbo-swash-caps"},{name:"caveat",font:"caveat"},{name:"Covered By Your Grace",font:"covered-by-your-grace"},{name:"Dancing Script",font:"dancing-script"},{name:"Gochi Hand",font:"gochi-hand"},{name:"Great Vibes",font:"great-vibes"},{name:"Handlee",font:"handlee"},{name:"Just Another Hand",font:"just-another-hand"},{name:"Kalam",font:"kalam"},{name:"La Belle Aurore",font:"la-belle-aurore"},{name:"Marck Script",font:"marck-script"},{name:"Nothing You Could Do",font:"nothing-you-could-do"},{name:"Qwigley",font:"qwigley"},{name:"Sacramento",font:"sacramento"},{name:"Shadows Into Light",font:"shadows-into-light"},{name:"Stalemate",font:"stalemate"},{name:"Yellowtail",font:"yellowtail"}],Qm={type:XC,isCoverPage:!1,margin:{left:0,right:0,top:0,bottom:0},isVisible:!0,isHidden:!1,isValid:!1,displayRules:[],title:{english:"Page 1"}},af={type:ta,showSectionHeader:!1,isVisible:!0,isHidden:!1,isValid:!1,showSectionTitle:!1,showSectionSubTitle:!1,heading:{english:"Section header"},subHeadingText:{english:""},isCollapsed:!1},tu={type:bo,isHidden:!1,isValid:!1,isRequired:!1,isCollapsed:!1,showRowTitle:!0,showRowSubTitle:!0,heading:{english:""},subHeadingText:{english:""},rowIsRepeatable:!1,repeatableFields:[],repeatableFieldsData:[],isMinimumEntries:!1,minimumEntries:5,addToListButtonLabel:{english:"Add To List"},reviewerChecklist:[]},Ac={type:ms,isCollapsed:!1},sQ=t=>{let e=t;e={...e,uuid:et()};const n=e.children.map(r=>({...r,uuid:et(),children:r.children.map(i=>({...i,uuid:et(),children:i.children.map(a=>{var s;return{...a,uuid:et(),...((s=a==null?void 0:a.children)==null?void 0:s.length)>0?{children:a.children.map(l=>{var c;return{...l,uuid:et(),...((c=l.options)==null?void 0:c.length)>0?{options:l.options.map(u=>({...u,uuid:et()}))}:{}}})}:{}}})}))}));return e={...e,children:n},e};function oQ(t){return e=>{const n={...Qm,uuid:et(),title:{english:`Page ${t+1}`},children:[{...af,uuid:et(),children:[{...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[]}]}]}]};e({type:TC,payLoad:n})}}function lQ(t){return e=>{const n=[];for(const[,i]of t.entries())for(const[,a]of i.children.entries())for(const[,s]of a.children.entries())for(const[,l]of s.children.entries())for(const[,c]of l.children.entries())s!=null&&s.rowIsRepeatable||n.push(c);e({type:zC,payLoad:{tableFields:n}})}}function cQ(t,e){return(n,r)=>{const i=t;let a=Tt.cloneDeep(i);const{layout:s}=r;a={...a,title:{english:`Page ${(s==null?void 0:s.length)+1}`}},a=sQ(a),n({type:DC,payLoad:{page:a,pageIndex:e}})}}function uQ(t,e){return n=>{n({type:HC,payLoad:{pageIndex:t,page:e}})}}function dQ(t){return e=>{e({type:bC,payLoad:{pageIndex:t}})}}const v_=t=>{let e=t;e={...e,uuid:et()};const n=e.children.map(r=>({...r,uuid:et(),children:r.children.map(i=>{var a;return{...i,uuid:et(),...((a=i==null?void 0:i.children)==null?void 0:a.length)>0?{children:i.children.map(s=>{var l;return{...s,uuid:et(),...((l=s.options)==null?void 0:l.length)>0?{options:s.options.map(c=>({...c,uuid:et()}))}:{}}})}:{}}})}));return e={...e,children:n},e};function fQ(t,e){return n=>{n({type:yC,payLoad:{pageIndex:t,sectionIndex:e}})}}function hQ(t){return e=>{const n={...af,uuid:et(),children:[{...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[]}]}]};e({type:EC,payLoad:{pageIndex:t,section:n}})}}function pQ(t,e,n){return r=>{r({type:CC,payLoad:{pageIndex:t,sectionIndex:e,section:n}})}}function gQ(t,e,n){return r=>{const i=t;let a=Tt.cloneDeep(i);a=v_(a),r({type:OC,payLoad:{section:a,pageIndex:e,sectionIndex:n}})}}function mQ(t,e){return n=>{const r=t;let i=Tt.cloneDeep(r);i=v_(i),n({type:NC,payLoad:{section:i,pageIndex:e}})}}const vQ=t=>{let e=t;e={...e,uuid:et()};const n=e.children.map(r=>{var i;return{...r,uuid:et(),...((i=r==null?void 0:r.children)==null?void 0:i.length)>0?{children:r.children.map(a=>{var s;return{...a,uuid:et(),...((s=a.options)==null?void 0:s.length)>0?{options:a.options.map(l=>({...l,uuid:et()}))}:{}}})}:{}}});return e={...e,children:n},e};function bQ(t,e,n,r){return i=>{const a=t;let s=Tt.cloneDeep(a);s=vQ(s),i({type:FC,payLoad:{row:s,pageIndex:e,sectionIndex:n,rowIndex:r}})}}function yQ(t,e,n,r){return i=>{i({type:O9,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function AQ(t,e,n){return r=>{r({type:AC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n}})}}function wQ(t,e){return n=>{const r={...tu,uuid:et(),isCollapsed:!1,children:[{...Ac,uuid:et(),children:[]}]};n({type:IC,payLoad:{pageIndex:t,sectionIndex:e,row:r}})}}function SQ(t,e,n,r){return i=>{i({type:LC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,fieldItem:r}})}}const xQ=t=>{var r;let e=t;e={...e,uuid:et()};const n=((r=e==null?void 0:e.children)==null?void 0:r.length)>0?e.children.map((i,a)=>{var s;return{...i,uuid:et(),...((s=i.options)==null?void 0:s.length)>0?{options:i.options.map((l,c)=>({...l,uuid:et()}))}:{}}}):[];return e={...e,children:n},e};function CQ(t,e,n){return r=>{const i={...Ac,uuid:et(),children:[]};r({type:_C,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,column:i}})}}function TQ(t,e,n,r,i){return a=>{const s=t;let l=Tt.cloneDeep(s);l=xQ(l),a({type:PC,payLoad:{column:l,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i}})}}function EQ(t,e,n,r){return i=>{i({type:wC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r}})}}function b_(t,e,n,r){return i=>{i({type:O9,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,row:r}})}}function IQ(t,e,n,r,i){return(a,s)=>{var m,g,v,A;const{layout:l,tableFields:c}=s;let u=(m=l[t])==null?void 0:m.children[e].children[n];const d=(A=(v=(g=l[t])==null?void 0:g.children[e])==null?void 0:v.children[n])==null?void 0:A.children[r].children[i];if((u==null?void 0:u.rowIsRepeatable)===!0){const S=[...u.repeatableFields],x=Tt.findIndex(S,function(w){return w.uuid===(d==null?void 0:d.uuid)});S.splice(x,1),u={...u,repeatableFields:S},a(b_(t,e,n,u))}const f=Tt.findIndex(c,function(S){return S.uuid===(d==null?void 0:d.uuid)});c.splice(f,1),a({type:SC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i}})}}function _Q(t,e,n,r,i,a){return(s,l)=>{var m,g,v,A;const{layout:c,tableFields:u}=l;let d=(m=c[t])==null?void 0:m.children[e].children[n];if((d==null?void 0:d.rowIsRepeatable)===!0){const S=(A=(v=(g=c[t])==null?void 0:g.children[e])==null?void 0:v.children[n])==null?void 0:A.children[r].children[i],x=[...d.repeatableFields],w=Tt.findIndex(x,function(T){return T.uuid===(S==null?void 0:S.uuid)});w===-1?x.splice(i,0,a):x[w]=a,x[w]=a,d={...d,repeatableFields:x},s(b_(t,e,n,d))}const f={type:xC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}},h=u.findIndex(S=>S.uuid===a.uuid);h>=0&&(u[h]=a),s(f)}}function DQ(t,e,n,r,i,a){return s=>{var d;const l=t;let c=Tt.cloneDeep(l);if(c={...c,uuid:et()},c!=null&&c.options&&((d=c==null?void 0:c.options)==null?void 0:d.length)>0){const f=c==null?void 0:c.options.map(h=>({...h,uuid:et()}));c={...c,options:f}}s({type:kC,payLoad:{field:c,pageIndex:e,sectionIndex:n,rowIndex:r,columnIndex:i,fieldIndex:a}})}}function OQ(t,e,n,r,i,a,s,l){return c=>{c({type:BC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,field:l}})}}function NQ(t,e,n,r,i,a,s,l){return c=>{c({type:VC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridColumnIndex:s,gridRowIndex:a,field:l}})}}function FQ(t,e,n,r,i,a,s,l,c){return u=>{u({type:$C,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l,field:c}})}}function PQ(t,e,n,r,i,a,s,l){return c=>{c({type:jC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,gridRowIndex:a,gridColumnIndex:s,fieldChildrenIndex:l}})}}function kQ(t,e,n,r,i,a,s,l,c){return u=>{u({type:UC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l,field:c}})}}function MQ(t,e,n,r,i,a,s,l){return c=>{c({type:qC,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,ruleIndex:a,conditionIndex:s,inlineFieldIndex:l}})}}function LQ(t){return e=>{e({type:$1,payLoad:{formSchema:t}})}}function BQ(t){return e=>{e({type:$1,payLoad:{layout:t}})}}function VQ(t){return(e,n)=>{const{languages:r}=n,i={type:$1,payLoad:{languages:[...r,t]}};e(i)}}function UQ(t){return(e,n)=>{const{languages:r}=n,i=Tt.findIndex(r,l=>l.key===t.key),a=[...r];a.splice(i,1),e({type:$1,payLoad:{languages:a}})}}function qQ(t){return e=>{const n={type:$1,payLoad:{userSelectedLanguage:t.value}};e(n)}}function $Q(t){return e=>{e({type:cm,payLoad:{formType:t}})}}function jQ(t){return e=>{e({type:cm,payLoad:t})}}function HQ(t){return e=>{e({type:cm,payLoad:{editing_by:t}})}}function zQ(){return t=>{t({type:MC,payLoad:null})}}const v8={loading:!1,intro:"",editing_by:0,isChangesSaved:!1,enableReviewTask:!1,enableAutoSave:!1,enableAutoSaveBuilderSetting:!1,surveyQuestionSlide:!1,enableFormFluid:!0,showConditionalFields:!0,isAdvanceView:!1,models:[],fieldMappings:[],version_name:null,showIntroTab:!1,published_status:!1,formType:null,randomiseQuestions:!1,randomiseAnswers:!1,enableNoOfAssessmentQuestions:!1,noOfAssessmentQuestions:null,tableFields:[],tableConfiguration:{stripedRows:!1,gridLines:!1,flexScroll:!1,isResponsive:!1,rowReorder:!1},builderTemplateName:"",quizConfiguration:{quizPassMark:75,quizTimeLimit:2,quizMaxAttempts:99,quizSequentialAnswer:0,isAllCorrectMandatory:!0,quizRandomiseQuestions:1,quizUniqueAnswersPerAttempt:"1"},header:[],languages:[{key:1,language:"English",type:"english"}],userSelectedLanguage:{key:1,language:"English",type:"english"},layout:[{uuid:et(),...Qm,children:[{uuid:et(),...af,children:[{uuid:et(),...tu,children:[{uuid:et(),...Ac,children:[]}]}]}]}],conditionalTabsRules:[],conditionalSectionsRules:[]},YQ=(t=v8,e)=>{var n,r;switch(e.type){case IY:return{...t,...e.payLoad};case EY:return{...t,...e.payLoad};case MC:return{...t,...v8};case $1:return{...t,...e.payLoad};case cm:return{...t,...e.payLoad};case bC:{const{pageIndex:i}=e.payLoad;return{...t,layout:t.layout.filter((a,s)=>s!==i)}}case TC:return{...t,layout:[...t.layout,e.payLoad]};case EC:{const{pageIndex:i,section:a}=e.payLoad,s=[...t.layout];return s[i].children=[...s[i].children,a],{...t,layout:s}}case LC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,fieldItem:l}=e.payLoad,c=[...t.layout],u=Array.isArray((n=c[i].children[a].children[s])==null?void 0:n.repeatableFields)?[...((r=c[i].children[a].children[s])==null?void 0:r.repeatableFields)||[],l]:l?[l]:[];return c[i].children[a].children[s]={...c[i].children[a].children[s],repeatableFields:u},{...t,layout:c}}case _Y:{const{fieldItem:i}=e.payLoad;let a=[...t.tableFields];return a=[...a,i],{...t,tableFields:a}}case zC:return{...t,...e.payLoad};case IC:{const{pageIndex:i,sectionIndex:a,row:s}=e.payLoad,l=[...t.layout];return l[i].children[a].children=[...l[i].children[a].children,s],{...t,layout:l}}case _C:{const{pageIndex:i,sectionIndex:a,rowIndex:s,column:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s].children=[...c[i].children[a].children[s].children,l],{...t,layout:c}}case BC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,field:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children=[...h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children,f],{...t,layout:h}}case VC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,field:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].children.push({[`${u}-${d}`]:f}),{...t,layout:h}}case UC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f,field:h}=e.payLoad,m=[...t.layout];return m[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children[f]=h,{...t,layout:m}}case $C:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,gridRowIndex:u,gridColumnIndex:d,fieldChildrenIndex:f,field:h}=e.payLoad,m=[...t.layout];return m[i].children[a].children[s].children[l].children[c].children[f]={[`${u}-${d}`]:h},{...t,layout:m}}case qC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,ruleIndex:u,conditionIndex:d,inlineFieldIndex:f}=e.payLoad,h=[...t.layout];return h[i].children[a].children[s].children[l].children[c].inlineConditionalRules.rules[u].conditions[d].children.splice(f,1),{...t,layout:h}}case jC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,fieldChildrenIndex:u}=e.payLoad,d=[...t.layout];return d[i].children[a].children[s].children[l].children[c].children.splice(u,1),{...t,layout:d}}case yC:{const{pageIndex:i,sectionIndex:a}=e.payLoad,s=[...t.layout];return s[i].children.splice(a,1),{...t,layout:s}}case AC:{const{pageIndex:i,sectionIndex:a,rowIndex:s}=e.payLoad,l=[...t.layout];return l[i].children[a].children.splice(s,1),{...t,layout:l}}case wC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s].children.splice(l,1),{...t,layout:c}}case SC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c}=e.payLoad,u=[...t.layout];return u[i].children[a].children[s].children[l].children.splice(c,1),{...t,layout:u}}case xC:{const{pageIndex:i,sectionIndex:a,rowIndex:s,columnIndex:l,fieldIndex:c,field:u}=e.payLoad,d=[...t.layout];return d[i].children[a].children[s].children[l].children[c]=u,{...t,layout:d}}case CC:{const{pageIndex:i,sectionIndex:a,section:s}=e.payLoad,l=[...t.layout];return l[i].children[a]=s,{...t,layout:l}}case O9:{const{pageIndex:i,sectionIndex:a,rowIndex:s,row:l}=e.payLoad,c=[...t.layout];return c[i].children[a].children[s]=l,{...t,layout:c}}case HC:{const{pageIndex:i,page:a}=e.payLoad,s=[...t.layout];return s[i]=a,{...t,layout:s}}case DC:{const{page:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s.splice(a+1,0,i),{...t,layout:s}}case OC:{const{section:i,pageIndex:a,sectionIndex:s}=e.payLoad,l=[...t.layout];return l[a].children.splice(s+1,0,i),{...t,layout:l}}case NC:{const{section:i,pageIndex:a}=e.payLoad,s=[...t.layout];return s[a].children.push(i),{...t,layout:s}}case FC:{const{row:i,pageIndex:a,sectionIndex:s,rowIndex:l}=e.payLoad,c=[...t.layout];return c[a].children[s].children.splice(l+1,0,i),{...t,layout:c}}case PC:{const{column:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c}=e.payLoad,u=[...t.layout];return u[a].children[s].children[l].children.splice(c+1,0,i),{...t,layout:u}}case kC:{const{field:i,pageIndex:a,sectionIndex:s,rowIndex:l,columnIndex:c,fieldIndex:u}=e.payLoad,d=[...t.layout];return d[a].children[s].children[l].children[c].children.splice(u+1,0,i),{...t,layout:d}}}return t},y_=N.createContext({dragDropManager:void 0});function nu(t){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nu(t)}function KQ(t,e){if(nu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(nu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function XQ(t){var e=KQ(t,"string");return nu(e)=="symbol"?e:e+""}function GQ(t,e,n){return(e=XQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function w_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?A_(Object(n),!0).forEach(function(r){GQ(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ul(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var S_=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),b8=function(){return Math.random().toString(36).substring(7).split("").join(".")},x_={INIT:"@@redux/INIT"+b8(),REPLACE:"@@redux/REPLACE"+b8(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+b8()}};function RQ(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function WQ(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(ZQ(t))return"date";if(JQ(t))return"error";var n=QQ(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function QQ(t){return typeof t.constructor=="function"?t.constructor.name:null}function JQ(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function ZQ(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function sf(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=WQ(t)),e}function C_(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ul(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Ul(1):"Expected the enhancer to be a function. Instead, received: '"+sf(n)+"'");return n(C_)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?Ul(2):"Expected the root reducer to be a function. Instead, received: '"+sf(t)+"'");var i=t,a=e,s=[],l=s,c=!1;function u(){l===s&&(l=s.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Ul(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ul(4):"Expected the listener to be a function. Instead, received: '"+sf(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Ul(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var A=!0;return u(),l.push(v),function(){if(A){if(c)throw new Error(process.env.NODE_ENV==="production"?Ul(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");A=!1,u();var x=l.indexOf(v);l.splice(x,1),s=null}}}function h(v){if(!RQ(v))throw new Error(process.env.NODE_ENV==="production"?Ul(7):"Actions must be plain objects. Instead, the actual type was: '"+sf(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ul(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Ul(9):"Reducers may not dispatch actions.");try{c=!0,a=i(a,v)}finally{c=!1}for(var A=s=l,S=0;S<A.length;S++){var x=A[S];x()}return v}function m(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ul(10):"Expected the nextReducer to be a function. Instead, received: '"+sf(v));i=v,h({type:x_.REPLACE})}function g(){var v,A=f;return v={subscribe:function(x){if(typeof x!="object"||x===null)throw new Error(process.env.NODE_ENV==="production"?Ul(11):"Expected the observer to be an object. Instead, received: '"+sf(x)+"'");function w(){x.next&&x.next(d())}w();var T=A(w);return{unsubscribe:T}}},v[S_]=function(){return this},v}return h({type:x_.INIT}),r={dispatch:h,subscribe:f,getState:d,replaceReducer:m},r[S_]=g,r}function qr(t,e,...n){if(eJ()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function eJ(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function tJ(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function nJ(t,e){return t.filter(n=>n!==e)}function T_(t){return typeof t=="object"}function rJ(t,e){const n=new Map,r=a=>{n.set(a,n.has(a)?n.get(a)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((a,s)=>{a===1&&i.push(s)}),i}function iJ(t,e){return t.filter(n=>e.indexOf(n)>-1)}const y8="dnd-core/INIT_COORDS",Jm="dnd-core/BEGIN_DRAG",A8="dnd-core/PUBLISH_DRAG_SOURCE",Zm="dnd-core/HOVER",e3="dnd-core/DROP",t3="dnd-core/END_DRAG";function E_(t,e){return{type:y8,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const aJ={type:y8,payload:{clientOffset:null,sourceClientOffset:null}};function sJ(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:a,getSourceClientOffset:s}=r,l=t.getMonitor(),c=t.getRegistry();t.dispatch(E_(a)),oJ(n,l,c);const u=uJ(n,l);if(u==null){t.dispatch(aJ);return}let d=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");lJ(s),d=s(u)}t.dispatch(E_(a,d));const h=c.getSource(u).beginDrag(l,u);if(h==null)return;cJ(h),c.pinSource(u);const m=c.getSourceType(u);return{type:Jm,payload:{itemType:m,item:h,sourceId:u,clientOffset:a||null,sourceClientOffset:d||null,isSourcePublic:!!i}}}}function oJ(t,e,n){qr(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){qr(n.getSource(r),"Expected sourceIds to be registered.")})}function lJ(t){qr(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function cJ(t){qr(T_(t),"Item must be an object.")}function uJ(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function dJ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fJ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){dJ(t,i,n[i])})}return t}function hJ(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();pJ(r),vJ(r).forEach((s,l)=>{const c=gJ(s,l,i,r),u={type:e3,payload:{dropResult:fJ({},n,c)}};t.dispatch(u)})}}function pJ(t){qr(t.isDragging(),"Cannot call drop while not dragging."),qr(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function gJ(t,e,n,r){const i=n.getTarget(t);let a=i?i.drop(r,t):void 0;return mJ(a),typeof a>"u"&&(a=e===0?{}:r.getDropResult()),a}function mJ(t){qr(typeof t>"u"||T_(t),"Drop result must either be an object or undefined.")}function vJ(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function bJ(t){return function(){const n=t.getMonitor(),r=t.getRegistry();yJ(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:t3}}}function yJ(t){qr(t.isDragging(),"Cannot call endDrag while not dragging.")}function w8(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function AJ(t){return function(n,{clientOffset:r}={}){wJ(n);const i=n.slice(0),a=t.getMonitor(),s=t.getRegistry(),l=a.getItemType();return xJ(i,s,l),SJ(i,a,s),CJ(i,a,s),{type:Zm,payload:{targetIds:i,clientOffset:r||null}}}}function wJ(t){qr(Array.isArray(t),"Expected targetIds to be an array.")}function SJ(t,e,n){qr(e.isDragging(),"Cannot call hover while not dragging."),qr(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];qr(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const a=n.getTarget(i);qr(a,"Expected targetIds to be registered.")}}function xJ(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],a=e.getTargetType(i);w8(a,n)||t.splice(r,1)}}function CJ(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function TJ(t){return function(){if(t.getMonitor().isDragging())return{type:A8}}}function EJ(t){return{beginDrag:sJ(t),publishDragSource:TJ(t),hover:AJ(t),drop:hJ(t),endDrag:bJ(t)}}class IJ{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(a){return(...s)=>{const l=a.apply(e,s);typeof l<"u"&&n(l)}}const i=EJ(this);return Object.keys(i).reduce((a,s)=>{const l=i[s];return a[s]=r(l),a},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function _J(t,e){return{x:t.x+e.x,y:t.y+e.y}}function I_(t,e){return{x:t.x-e.x,y:t.y-e.y}}function DJ(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:I_(_J(e,r),n)}function OJ(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:I_(e,n)}const Ep=[],S8=[];Ep.__IS_NONE__=!0,S8.__IS_ALL__=!0;function NJ(t,e){return t===Ep?!1:t===S8||typeof e>"u"?!0:iJ(e,t).length>0}class FJ{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;qr(typeof e=="function","listener must be a function."),qr(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const a=()=>{const s=this.store.getState(),l=s.stateId;try{l===i||l===i+1&&!NJ(s.dirtyHandlerIds,r)||e()}finally{i=l}};return this.store.subscribe(a)}subscribeToOffsetChange(e){qr(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return qr(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(qr(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return w8(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(qr(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),a=this.getItemType();if(a&&!w8(i,a))return!1;const s=this.getTargetIds();if(!s.length)return!1;const l=s.indexOf(e);return r?l===s.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return DJ(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return OJ(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const __=typeof global<"u"?global:self,D_=__.MutationObserver||__.WebKitMutationObserver;function O_(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function PJ(t){let e=1;const n=new D_(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const kJ=typeof D_=="function"?PJ:O_;class MJ{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=kJ(this.flush),this.requestErrorThrow=O_(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class LJ{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class BJ{create(e){const n=this.freeTasks,r=n.length?n.pop():new LJ(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const N_=new MJ,VJ=new BJ(N_.registerPendingError);function UJ(t){N_.enqueueTask(VJ.create(t))}const x8="dnd-core/ADD_SOURCE",C8="dnd-core/ADD_TARGET",T8="dnd-core/REMOVE_SOURCE",n3="dnd-core/REMOVE_TARGET";function qJ(t){return{type:x8,payload:{sourceId:t}}}function $J(t){return{type:C8,payload:{targetId:t}}}function jJ(t){return{type:T8,payload:{sourceId:t}}}function HJ(t){return{type:n3,payload:{targetId:t}}}function zJ(t){qr(typeof t.canDrag=="function","Expected canDrag to be a function."),qr(typeof t.beginDrag=="function","Expected beginDrag to be a function."),qr(typeof t.endDrag=="function","Expected endDrag to be a function.")}function YJ(t){qr(typeof t.canDrop=="function","Expected canDrop to be a function."),qr(typeof t.hover=="function","Expected hover to be a function."),qr(typeof t.drop=="function","Expected beginDrag to be a function.")}function E8(t,e){if(e&&Array.isArray(t)){t.forEach(n=>E8(n,!1));return}qr(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ql;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(ql||(ql={}));let KJ=0;function XJ(){return KJ++}function GJ(t){const e=XJ().toString();switch(t){case ql.SOURCE:return`S${e}`;case ql.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function F_(t){switch(t[0]){case"S":return ql.SOURCE;case"T":return ql.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function P_(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,a]}=n.next();if(a===e)return!0;r=!!i}while(!r);return!1}class RJ{addSource(e,n){E8(e),zJ(n);const r=this.addHandler(ql.SOURCE,e,n);return this.store.dispatch(qJ(r)),r}addTarget(e,n){E8(e,!0),YJ(n);const r=this.addHandler(ql.TARGET,e,n);return this.store.dispatch($J(r)),r}containsHandler(e){return P_(this.dragSources,e)||P_(this.dropTargets,e)}getSource(e,n=!1){return qr(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return qr(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return qr(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return qr(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return F_(e)===ql.SOURCE}isTargetId(e){return F_(e)===ql.TARGET}removeSource(e){qr(this.getSource(e),"Expected an existing source."),this.store.dispatch(jJ(e)),UJ(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){qr(this.getTarget(e),"Expected an existing target."),this.store.dispatch(HJ(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);qr(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){qr(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=GJ(e);return this.types.set(i,n),e===ql.SOURCE?this.dragSources.set(i,r):e===ql.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const WJ=(t,e)=>t===e;function QJ(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function JJ(t,e,n=WJ){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function ZJ(t=Ep,e){switch(e.type){case Zm:break;case x8:case C8:case n3:case T8:return Ep;case Jm:case A8:case t3:case e3:default:return S8}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=rJ(n,r);if(!(i.length>0||!JJ(n,r)))return Ep;const s=r[r.length-1],l=n[n.length-1];return s!==l&&(s&&i.push(s),l&&i.push(l)),i}function eZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tZ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){eZ(t,i,n[i])})}return t}const k_={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function nZ(t=k_,e){const{payload:n}=e;switch(e.type){case y8:case Jm:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Zm:return QJ(t.clientOffset,n.clientOffset)?t:tZ({},t,{clientOffset:n.clientOffset});case t3:case e3:return k_;default:return t}}function rZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function of(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){rZ(t,i,n[i])})}return t}const iZ={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function aZ(t=iZ,e){const{payload:n}=e;switch(e.type){case Jm:return of({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case A8:return of({},t,{isSourcePublic:!0});case Zm:return of({},t,{targetIds:n.targetIds});case n3:return t.targetIds.indexOf(n.targetId)===-1?t:of({},t,{targetIds:nJ(t.targetIds,n.targetId)});case e3:return of({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case t3:return of({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function sZ(t=0,e){switch(e.type){case x8:case C8:return t+1;case T8:case n3:return t-1;default:return t}}function oZ(t=0){return t+1}function lZ(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cZ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){lZ(t,i,n[i])})}return t}function uZ(t={},e){return{dirtyHandlerIds:ZJ(t.dirtyHandlerIds,{type:e.type,payload:cZ({},e.payload,{prevTargetIds:tJ(t,"dragOperation.targetIds",[])})}),dragOffset:nZ(t.dragOffset,e),refCount:sZ(t.refCount,e),dragOperation:aZ(t.dragOperation,e),stateId:oZ(t.stateId)}}function dZ(t,e=void 0,n={},r=!1){const i=fZ(r),a=new FJ(i,new RJ(i)),s=new IJ(i,a),l=t(s,e,n);return s.receiveBackend(l),s}function fZ(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return C_(uZ,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function hZ(t,e){if(t==null)return{};var n=pZ(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pZ(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let M_=0;const r3=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var lf=N.memo(function(e){var{children:n}=e,r=hZ(e,["children"]);const[i,a]=gZ(r);return N.useEffect(()=>{if(a){const s=L_();return++M_,()=>{--M_===0&&(s[r3]=null)}}},[]),o.jsx(y_.Provider,{value:i,children:n})});function gZ(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=mZ(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function mZ(t,e=L_(),n,r){const i=e;return i[r3]||(i[r3]={dragDropManager:dZ(t,e,n,r)}),i[r3]}function L_(){return typeof global<"u"?global:window}var B_=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var s=a[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const vZ=gs(B_),$0=typeof window<"u"?N.useLayoutEffect:N.useEffect;function bZ(t,e,n){const[r,i]=N.useState(()=>e(t)),a=N.useCallback(()=>{const s=e(t);vZ(r,s)||(i(s),n&&n())},[r,t,n]);return $0(a),[r,a]}function yZ(t,e,n){const[r,i]=bZ(t,e,n);return $0(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(i,{handlerIds:[s]})},[t,i]),r}function V_(t,e,n){return yZ(e,t||(()=>({})),()=>n.reconnect())}function U_(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),N.useMemo(()=>typeof t=="function"?t():t,n)}function AZ(t){return N.useMemo(()=>t.hooks.dragSource(),[t])}function wZ(t){return N.useMemo(()=>t.hooks.dragPreview(),[t])}let I8=!1,_8=!1;class SZ{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){qr(!I8,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return I8=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{I8=!1}}isDragging(){if(!this.sourceId)return!1;qr(!_8,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return _8=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{_8=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let D8=!1;class xZ{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;qr(!D8,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return D8=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{D8=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function CZ(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function TZ(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function O8(t,e,n,r){let i=n?n.call(r,t,e):void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const a=Object.keys(t),s=Object.keys(e);if(a.length!==s.length)return!1;const l=Object.prototype.hasOwnProperty.bind(e);for(let c=0;c<a.length;c++){const u=a[c];if(!l(u))return!1;const d=t[u],f=e[u];if(i=n?n.call(r,d,f,u):void 0,i===!1||i===void 0&&d!==f)return!1}return!0}function N8(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function EZ(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function IZ(t){return(e=null,n=null)=>{if(!N.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return EZ(r),_Z(r,n?a=>t(a,n):t)}}function q_(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=IZ(r);e[n]=()=>i}}),e}function $_(t,e){typeof t=="function"?t(e):t.current=e}function _Z(t,e){const n=t.ref;return qr(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?N.cloneElement(t,{ref:r=>{$_(n,r),$_(e,r)}}):N.cloneElement(t,{ref:e})}class DZ{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!O8(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!O8(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=q_({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,N8(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,N8(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class OZ{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!O8(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=q_({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,N8(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function cf(){const{dragDropManager:t}=N.useContext(y_);return qr(t!=null,"Expected drag drop context"),t}function NZ(t,e){const n=cf(),r=N.useMemo(()=>new DZ(n.getBackend()),[n]);return $0(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),$0(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function FZ(){const t=cf();return N.useMemo(()=>new SZ(t),[t])}class PZ{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:a}=r;return a?a(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function kZ(t,e,n){const r=N.useMemo(()=>new PZ(t,e,n),[e,n]);return N.useEffect(()=>{r.spec=t},[t]),r}function MZ(t){return N.useMemo(()=>{const e=t.type;return qr(e!=null,"spec.type must be defined"),e},[t])}function LZ(t,e,n){const r=cf(),i=kZ(t,e,n),a=MZ(t);$0(function(){if(a!=null){const[l,c]=TZ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c}},[r,e,n,i,a])}function Qi(t,e){const n=U_(t,e);qr(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=FZ(),i=NZ(n.options,n.previewOptions);return LZ(n,r,i),[V_(n.collect,r,i),AZ(i),wZ(i)]}function BZ(t){return N.useMemo(()=>t.hooks.dropTarget(),[t])}function VZ(t){const e=cf(),n=N.useMemo(()=>new OZ(e.getBackend()),[e]);return $0(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function UZ(){const t=cf();return N.useMemo(()=>new xZ(t),[t])}function qZ(t){const{accept:e}=t;return N.useMemo(()=>(qr(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class $Z{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function jZ(t,e){const n=N.useMemo(()=>new $Z(t,e),[e]);return N.useEffect(()=>{n.spec=t},[t]),n}function HZ(t,e,n){const r=cf(),i=jZ(t,e),a=qZ(t);$0(function(){const[l,c]=CZ(a,i,r);return e.receiveHandlerId(l),n.receiveHandlerId(l),c},[r,e,i,n,a.map(s=>s.toString()).join("|")])}function zZ(t,e){const n=U_(t,e),r=UZ(),i=VZ(n.options);return HZ(n,r,i),[V_(n.collect,r,i),BZ(i)]}function j_(t){let e=null;return()=>(e==null&&(e=t()),e)}function YZ(t,e){return t.filter(n=>n!==e)}function KZ(t,e){const n=new Set,r=a=>n.add(a);t.forEach(r),e.forEach(r);const i=[];return n.forEach(a=>i.push(a)),i}class XZ{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=KZ(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=YZ(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class GZ{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const H_="__NATIVE_FILE__",z_="__NATIVE_URL__",Y_="__NATIVE_TEXT__",K_="__NATIVE_HTML__",X_=Object.freeze(Object.defineProperty({__proto__:null,FILE:H_,HTML:K_,TEXT:Y_,URL:z_},Symbol.toStringTag,{value:"Module"}));function F8(t,e,n){const r=e.reduce((i,a)=>i||t.getData(a),"");return r??n}const P8={[H_]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[K_]:{exposeProperties:{html:(t,e)=>F8(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[z_]:{exposeProperties:{urls:(t,e)=>F8(t,e,"").split(`
|
|
1597
|
-
`),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Y_]:{exposeProperties:{text:(t,e)=>F8(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function RZ(t,e){const n=P8[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new GZ(n);return r.loadDataTransfer(e),r}function k8(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(P8).filter(n=>{const r=P8[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const WZ=j_(()=>/firefox/i.test(navigator.userAgent)),G_=j_(()=>!!window.safari);class R_{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,c3s:s}=this;let l=n.length-1;if(e===n[l])return r[l];let c=0,u=s.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const m=n[d];if(m<e)c=d+1;else if(m>e)u=d-1;else return r[d]}l=Math.max(0,u);const f=e-n[l],h=f*f;return r[l]+i[l]*f+a[l]*h+s[l]*f*h}constructor(e,n){const{length:r}=e,i=[];for(let m=0;m<r;m++)i.push(m);i.sort((m,g)=>e[m]<e[g]?-1:1);const a=[],s=[];let l,c;for(let m=0;m<r-1;m++)l=e[m+1]-e[m],c=n[m+1]-n[m],a.push(l),s.push(c/l);const u=[s[0]];for(let m=0;m<a.length-1;m++){const g=s[m],v=s[m+1];if(g*v<=0)u.push(0);else{l=a[m];const A=a[m+1],S=l+A;u.push(3*S/((S+A)/g+(S+l)/v))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let m=0;m<u.length-1;m++){h=s[m];const g=u[m],v=1/a[m],A=g+u[m+1]-h-h;d.push((h-g-A)*v),f.push(A*v*v)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const QZ=1;function W_(t){const e=t.nodeType===QZ?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function i3(t){return{x:t.clientX,y:t.clientY}}function JZ(t){var e;return t.nodeName==="IMG"&&(WZ()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function ZZ(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return G_()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function eee(t,e,n,r,i){const a=JZ(e),l=W_(a?t:e),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:u,offsetHeight:d}=t,{anchorX:f,anchorY:h}=r,{dragPreviewWidth:m,dragPreviewHeight:g}=ZZ(a,e,u,d),v=()=>{let _=new R_([0,.5,1],[c.y,c.y/d*g,c.y+g-d]).interpolate(h);return G_()&&a&&(_+=(window.devicePixelRatio-1)*g),_},A=()=>new R_([0,.5,1],[c.x,c.x/u*m,c.x+m-u]).interpolate(f),{offsetX:S,offsetY:x}=i,w=S===0||S,T=x===0||x;return{x:w?S:A(),y:T?x:v()}}class tee{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function nee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){nee(t,i,n[i])})}return t}class ree{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Q_({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return Q_({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(X_).some(n=>X_[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=RZ(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const a=this.sourceNodes.get(i);return a&&W_(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=i3(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=i,c=k8(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||f;if(h){const{anchorX:m,anchorY:g,offsetX:v,offsetY:A}=this.getCurrentSourcePreviewNodeOptions(),w=eee(f,h,s,{anchorX:m,anchorY:g},{offsetX:v,offsetY:A});l.setDragImage(h,w.x,w.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:l}=i,c=k8(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:i3(i)}),a.some(l=>this.monitor.canDropOnTarget(l))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=i3(i),this.scheduleHover(a),(a||[]).some(l=>this.monitor.canDropOnTarget(l))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else k8(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:i3(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new tee(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new XZ(this.isNodeInDocument)}}const uf=function(e,n,r){return new ree(e,n,r)},J_=N.createContext(void 0),Z_=({children:t,option:e,saveFormBuilderSchema:n,templateSchema:r,onChange:i})=>{const a={...v8,...r},[s,l]=N.useReducer(YQ,a);N.useEffect(()=>{n(s)},[s]);const{isPreview:c,isAdmin:u,isRenderView:d,renderType:f,isAdvanceView:h,globalAlignment:m="ltr",emitSocketData:g,media:v,reusableComponent:A,saveFormProgress:S,showSettings:x}=e;return o.jsx(J_.Provider,{value:{media:v,isPreview:c,isAdmin:u,isRenderView:d,renderType:f,isAdvanceView:h,globalAlignment:m,emitSocketData:g,reusableComponent:A,state:s,dispatch:l,onChange:i,saveFormProgress:S,showSettings:x},children:o.jsx(lf,{backend:uf,children:t})})},eD=()=>N.useContext(J_),iee=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},aee=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],see=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],tD=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return iee(t,u,c)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=n.slice(1),l=r[i];return r[i]={...l,children:tD(l.children,a,s)},r},nD=(t,e)=>{if(e.length===1){const s=Number(e[0]);return aee(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:nD(a.children,i)},n},M8=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return see(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:M8(s.children,a,n)},r},oee=(t,e,n)=>{let r=[...t],i=r[n[oa]].children[n[la]].children[n[fa]].children[n[ha]].children[n[pa]].inlineConditionalRules.rules[n[wa]].conditions[n[$o]].children[n[yo]];return r[n[oa]].children[n[la]].children[n[fa]].children[n[ha]].children[n[pa]].inlineConditionalRules.rules[n[wa]].conditions[n[$o]].children.splice([n[yo]],1),r[e[oa]].children[e[la]].children[e[fa]].children[e[ha]].children[e[pa]].inlineConditionalRules.rules[e[wa]].conditions[e[$o]].children.splice(e[yo],0,i),r},lee=(t,e,n)=>tD(t,e,n),cee=t=>{const e=[...t],n={type:ms,uuid:et(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},rD=(t,e,n,r)=>{var h,m,g,v,A,S;let i;const a={...Ac,uuid:et(),children:[r]},s={...tu,uuid:et()},l={...tu,uuid:et(),children:[a]},c={...af,uuid:et(),children:[l]},u={...Qm,uuid:et(),children:[c]};switch(e.length){case 1:{r.type===XC?i={...c,children:[r]}:i={...c,children:[s]};break}case 2:{r.type===ta?i={...u,children:[c]}:i={...u,children:[c]};break}case 3:{r.type===bo?i={...c,children:[l]}:i={...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[r]}]};break}case 4:{r.type===j1?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(S=(A=(v=(g=(m=(h=d[n[oa]])==null?void 0:h.children[n[la]])==null?void 0:m.children[n[fa]])==null?void 0:g.children[n[ha]])==null?void 0:v.children[n[pa]])==null?void 0:A.inlineConditionalRules)==null||S.rules[n[wa]].conditions[n[$o]].children.splice(n[yo],1):d=nD(d,n),d=cee(d),d=M8(d,e,i),d},uee=(t,e,n)=>{let r;switch(e.length){case 1:{r={...Qm,uuid:et(),children:[{...af,uuid:et(),children:[{...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[n]}]}]}]};break}case 2:{r={...af,uuid:et(),children:[{...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[n]}]}]};break}case 3:{r={...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[n]}]};break}case 4:{r={...Ac,uuid:et(),children:[n]};break}default:r=n}return M8(t,e,r)},on=()=>{const{state:t,dispatch:e,onChange:n,saveFormProgress:r}=eD();if(t===void 0)throw new Error("Must be wrapped in builder provider");const i=t.builderTemplateName,a=t.isChangesSaved,s=t.editing_by,l=t.version_name,c=t.loading,u=t.published_status,d=t,f=t,h=t.formType,m=t==null?void 0:t.userSelectedLanguage,g=t==null?void 0:t.languages,v=t.layout,A=N.useCallback(me=>LQ(me)(e),[e]),S=N.useCallback(me=>lQ(me)(e),[e]),x=N.useCallback(me=>BQ(me)(e),[e]),w=N.useCallback((me,pe)=>{var _t,Qt,xn,bn,wn,yn,Gn,Dn;const ke=[...v],Oe=me.path.split("-"),ve=Oe.slice(0,-1).join("-"),V={uuid:pe.uuid,type:pe.type,reviewerChecklist:[]},ee=0,X=1,oe=2,he=3,we=4,De=5,$e=6,lt=8,Ot=7,nt=5,St=6,it=8;if(pe.type===ta&&(pe==null?void 0:pe.schema)!==void 0){B(JSON.parse(pe==null?void 0:pe.schema),parseInt(Oe[ee]));return}if(((_t=pe==null?void 0:pe.schema)==null?void 0:_t.componentType)==="question"&&((yn=(wn=(bn=(xn=(Qt=ke[0])==null?void 0:Qt.children[0])==null?void 0:xn.children[0])==null?void 0:bn.children[0])==null?void 0:wn.children)!=null&&yn.some(qt=>{var at,Je,ut;return((at=qt==null?void 0:qt.questionText)==null?void 0:at[m.type])===((ut=(Je=pe==null?void 0:pe.schema)==null?void 0:Je.questionText)==null?void 0:ut[m.type])})))return;if(pe.type===Zn){let qt={type:j1,reviewerChecklist:[],...Tt.cloneDeep(pe.schema)};if(qt!=null&&qt.options&&(qt={...qt,options:[{uuid:et(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:et(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),qt.componentType==="grid-component"&&(qt={...qt,children:[],options:[{uuid:et(),custom_values:{}}]}),qt.componentType==="radio-hierarchal"&&(qt={...qt,type:"radio",children:[],options:[{uuid:et(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:et(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),qt={...qt,uuid:et()},Oe.length===lt){U(parseInt(Oe[ee]),parseInt(Oe[X]),parseInt(Oe[oe]),parseInt(Oe[he]),parseInt(Oe[we]),parseInt(Oe[De]),parseInt(Oe[$e]),qt);return}if(Oe.length===Ot){Z(parseInt(Oe[ee]),parseInt(Oe[X]),parseInt(Oe[oe]),parseInt(Oe[he]),parseInt(Oe[we]),parseInt(Oe[nt]),parseInt(Oe[St]),qt);return}if((Dn=(Gn=ke[Oe[ee]].children[Oe[X]])==null?void 0:Gn.children[Oe[oe]])!=null&&Dn.rowIsRepeatable&&(qt==null?void 0:qt.componentType)==="editor")return;x(uee(ke,Oe,qt)),Oe.length>1&&Ce(Oe[ee],Oe[X],Oe[oe],qt);return}const bt=pe.path.split("-"),Nt=bt.slice(0,-1).join("-");if(bt.length===Oe.length){if(Nt===ve){if((bt==null?void 0:bt.length)===it){x(oee(ke,Oe,bt));return}x(lee(ke,Oe,bt));return}const qt={...V,...pe};(pe==null?void 0:pe.id)===void 0&&(qt.id=et()),x(rD(ke,Oe,bt,qt));return}if((bt==null?void 0:bt.length)===8){const qt={type:j1,reviewerChecklist:[],...pe};Z(parseInt(Oe[ee]),parseInt(Oe[X]),parseInt(Oe[oe]),parseInt(Oe[he]),parseInt(Oe[we]),parseInt(Oe[nt]),parseInt(Oe[St]),qt),Ae(bt[oa],bt[la],bt[fa],bt[ha],bt[pa],bt[nt],bt[St],bt[Bl]);return}const We={...V,...pe};(pe==null?void 0:pe.id)===void 0&&(We.id=et()),x(rD(ke,Oe,bt,We))},[v,x,m.type]),T=N.useCallback(()=>zQ()(e),[e]),C=N.useCallback(me=>VQ(me)(e,t),[e]),_=N.useCallback(me=>UQ(me)(e,t),[e]),E=N.useCallback(me=>qQ(me)(e),[e]),O=N.useCallback(me=>oQ(me)(e),[e]),P=N.useCallback(me=>hQ(me)(e),[e]),B=N.useCallback((me,pe)=>mQ(me,pe)(e),[e]),M=N.useCallback((me,pe)=>wQ(me,pe)(e),[e]),H=N.useCallback((me,pe,ke)=>CQ(me,pe,ke)(e),[e]),k=N.useCallback(me=>dQ(me)(e),[e]),z=N.useCallback((me,pe)=>fQ(me,pe)(e),[e]),ue=N.useCallback((me,pe,ke)=>AQ(me,pe,ke)(e),[e]),fe=N.useCallback((me,pe,ke,Oe)=>EQ(me,pe,ke,Oe)(e),[e]),ne=N.useCallback((me,pe,ke,Oe,ve)=>IQ(me,pe,ke,Oe,ve)(e,t),[e]),R=N.useCallback((me,pe,ke,Oe,ve,V)=>_Q(me,pe,ke,Oe,ve,V)(e,t),[e]),ae=N.useCallback((me,pe,ke)=>pQ(me,pe,ke)(e),[e]),Y=N.useCallback((me,pe,ke,Oe)=>yQ(me,pe,ke,Oe)(e),[e]),ge=N.useCallback((me,pe)=>uQ(me,pe)(e),[e]),ie=N.useCallback((me,pe,ke,Oe,ve,V)=>DQ(me,pe,ke,Oe,ve,V)(e),[e]),J=N.useCallback((me,pe,ke,Oe,ve)=>TQ(me,pe,ke,Oe,ve)(e),[e]),Q=N.useCallback((me,pe,ke,Oe)=>bQ(me,pe,ke,Oe)(e),[e]),se=N.useCallback((me,pe,ke)=>gQ(me,pe,ke)(e),[e]),be=N.useCallback((me,pe)=>cQ(me,pe)(e,t),[e]),Ce=N.useCallback((me,pe,ke,Oe)=>SQ(me,pe,ke,Oe)(e),[e]),Te=N.useCallback((me,pe,ke,Oe,ve,V,ee,X,oe)=>kQ(me,pe,ke,Oe,ve,V,ee,X,oe)(e),[e]),ye=N.useCallback((me,pe,ke,Oe,ve,V,ee,X,oe)=>FQ(me,pe,ke,Oe,ve,V,ee,X,oe)(e),[e]),Ae=N.useCallback((me,pe,ke,Oe,ve,V,ee,X)=>PQ(me,pe,ke,Oe,ve,V,ee,X)(e),[e]),re=N.useCallback((me,pe,ke,Oe,ve,V,ee,X)=>MQ(me,pe,ke,Oe,ve,V,ee,X)(e),[e]),U=N.useCallback((me,pe,ke,Oe,ve,V,ee,X)=>OQ(me,pe,ke,Oe,ve,V,ee,X)(e),[e]),Z=N.useCallback((me,pe,ke,Oe,ve,V,ee,X)=>NQ(me,pe,ke,Oe,ve,V,ee,X)(e),[e]),K=N.useCallback(me=>$Q(me)(e),[e]),de=N.useCallback(me=>jQ(me)(e),[e]),Ee=N.useCallback(me=>HQ(me)(e),[e]);return{builderIsChangesSaved:a,builderTemplateName:i,formBuilderFormSchema:d,formBuilderFormLayout:v,formBuilderSchemaLanguages:g,saveFormTemplateNewVersion:f,userSelectedLanguage:m,formBuilderConfigurationType:h,formBuilderLoading:c,formBuilderPublishedStatus:u,builderEditingBy:s,builderVersionName:l,handleDrop:w,formatTableFieldsHook:S,saveFormBuilderSchema:A,removePage:k,removeSection:z,removeRow:ue,removeColumn:fe,removeField:ne,updateEditingBy:Ee,addTabs:O,addSection:P,addRow:M,addColumn:H,cloneField:ie,cloneColumn:J,cloneRow:Q,cloneSection:se,clonePage:be,sectionImport:B,setLayout:x,fieldSettingUpdate:R,selectFormBuilderLanguage:C,unselectFormBuilderLanguage:_,updateUserFormSelectedLanguage:E,updateFormType:K,schemaBuilderUpdate:de,pageSettingUpdate:ge,saveFormProgress:r,sectionSettingUpdate:ae,rowSettingUpdate:Y,clearBuilderSchema:T,addFieldToRowRepeaptable:Ce,addFieldToInlineRuleCondtionFields:U,fieldSettingUpdateInlineConditional:Te,fieldSettingDeleteInlineConditional:re,addFieldToGridComponentHook:Z,gridComponentFieldSettingUpdate:ye,gridComponentFieldDelete:Ae}},Zt=()=>{const{isPreview:t,isAdmin:e,isRenderView:n,renderType:r,isAdvanceView:i,media:a,globalAlignment:s,reusableComponent:l,showSettings:c}=eD();if(t===void 0)throw new Error("Must be wrapped in builder provider");const u=r==null?void 0:r.key,{saveComponent:d,componentList:f}=l;return{isPreview:t,isAdmin:e,isRenderView:n,renderType:u,isAdvanceView:i,globalAlignment:s,media:a,saveComponent:d,componentList:f,emitSocketData:()=>{},updateGlobalToast:g=>{console.log("showSettings",c),c!=null&&c.showToast&&(c==null||c.showToast(g))}}},dee="TASKS_LOADING",fee="TASKS_ADD",hee="TASKS_GET_PAGINATED_LIST",pee="TASKS_DELETE",gee="TASKS_PAGNIATION_UPDATE",mee="TASKS_UPDATE",vee="TASKS_SUCCESS_GET",bee="TASK_GET_TEMPLATE",yee="TASK_SET_DATA",Aee="TASKS_FORM_SUBMIT",wee="TASKS_FORM_HTTP_REQUEST",L8="TASK_SET_PROGRESS_VALUE",iD="TASK_SET_MAX_PROGRESS_VALUE",aD="TASK_SET_REGISTER_DATA",sD="TASK_SET_SCHEMA",B8="TASK_UPDATE_USER_FORM_SUBMIT_DATA",oD="CLEAR_TASK",lD="TASK_USER_SUBMIT_FORM_REPEATABLE_ADD",cD="TASK_USER_SUBMIT_FORM_REPEATABLE_REMOVE_INDEX",uD="TASK_USER_TRAINING_DATA",dD="TASK_FIELD_UPDATE",See=6,a3=1,Ip="DISPLAY_TYPE_START_DETAILS",V8="DISPLAY_TYPE_QUIZ",U8="DISPLAY_TYPE_START_TIMER";function xee(t,e,n,r,i,a){return s=>{s({type:dD,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}})}}function fD(t){return(e,n)=>{const r={type:B8,payLoad:{userTaskSubmitFormData:[...t]}};e(r)}}function Cee(t){return(e,n)=>{const{TasksReducer:r}=n(),{taskData:i}=r,a={type:B8,payLoad:{taskData:{...i,...t}}};e(a)}}function Tee(t,e){return(n,r)=>{const{TasksReducer:i}=r(),{userTaskSubmitFormData:a}=i,s=Tt.findIndex(a,function(c){return c.rowId===t});n({type:cD,payLoad:{userSubmitFormIndex:s,repeatableDataRowIndex:e}})}}function Eee(t,e){return(n,r)=>{const{TasksReducer:i}=r(),{userTaskSubmitFormData:a}=i,s=Tt.findIndex(a,function(c){return c.rowId===t});n({type:lD,payLoad:{userSubmitFormIndex:s,repeatableData:e}})}}function Iee(){return t=>{t({type:oD,payLoad:null})}}const hD=t=>e=>{e({type:L8,payLoad:{progressValue:t}})},_ee=t=>e=>{e({type:L8,payLoad:t})},Dee=t=>e=>{e({type:uD,payLoad:{userTrainingSaveData:t}})},pD=t=>e=>{e({type:aD,payLoad:{registerData:t}})},Oee=(t,e,n)=>(r,i)=>{var d;const{TasksReducer:a}=i(),{userTaskSubmitFormData:s}=a,l=[...s],c=Tt.findIndex(l,function(f){var h;return f.rowId===((h=t==null?void 0:t.row)==null?void 0:h.uuid)});let u=(d=s[c])==null?void 0:d.repeatableFields;u={...u,[e==null?void 0:e.uuid]:`<div>${n}</div>`},l[c]={...l[c],repeatableFields:u},r(fD(l))},Nee=(t,e,n)=>(r,i)=>{const{TasksReducer:a}=i(),{userTaskSubmitFormData:s,registerData:l}=a,c=s,u=Tt.cloneDeep(l);if(n&&(c==null?void 0:c.length)>0){u[e==null?void 0:e.uuid]=n;for(const f of c)f.fieldId===e.uuid&&(f.postData[0]={postValue:n})}else if((c==null?void 0:c.length)>0){for(const f of c)f.fieldId===e.uuid&&(f.postData[0]={postValue:""});delete u[e==null?void 0:e.uuid]}r(pD(u));const d=Object.keys(u).length;r(hD(d))},Fee=t=>e=>{e({type:iD,payLoad:{progressMaxValue:t}})},q8={submitting:!1,httpRequest:!1,taskData:null,taskUpdateLoading:!1,loading:!1,progressLoading:!1,list:[],filter:"",sort:"task.created_at|desc",total_records:0,page:1,per_page:10,success:!1,success_message:"",userTaskSubmitFormData:null,taskSchema:null,progressMaxValue:0,maxTabs:0,registerData:{},progressValue:0,tabNoOfFieldsData:[],noOfTotalElements:0,sortField:null,sortOrder:null,userTrainingSaveData:null,assessmentData:null,task_status:1},Pee=(t=q8,e)=>{switch(e.type){case oD:return{...t,...q8,list:[...t.list],page:t.page,per_page:t.per_page,filter:t.filter,sort:t.sort,total_records:t.total_records};case vee:return{...t,...e.payLoad};case B8:return{...t,...e.payLoad};case sD:return{...t,...e.payLoad};case L8:return{...t,...e.payLoad};case aD:return{...t,registerData:e.payLoad.registerData};case iD:return{...t,...e.payLoad};case dee:return{...t,...e.payLoad};case Aee:return{...t,...e.payLoad};case wee:return{...t,...e.payLoad};case fee:{const{record:n}=e.payLoad;return{...t,list:[...n,...t.list]}}case hee:return{...t,...e.payLoad};case yee:return{...t,taskData:e.payLoad};case gee:return{...t,...e.payLoad};case pee:{const n=t.list.filter(r=>r.task_id!==e.payLoad.task_id);return{...t,list:[...n]}}case uD:return{...t,...e.payLoad};case dD:{const{pageIndex:n,sectionIndex:r,rowIndex:i,columnIndex:a,fieldIndex:s,field:l}=e.payLoad,c=[...t.taskSchema.layout];c[n].children[r].children[i].children[a].children[s]=l;const u={...t.taskSchema,layout:c};return{...t,taskSchema:u}}case lD:{const{userSubmitFormIndex:n,repeatableData:r}=e.payLoad,i=t.userTaskSubmitFormData[n].repeatableFieldsData?t.userTaskSubmitFormData[n].repeatableFieldsData:[];return i.push(r),t.userTaskSubmitFormData[n].repeatableFieldsData=i,t}case cD:{const{userSubmitFormIndex:n,repeatableDataRowIndex:r}=e.payLoad,i=[...t.userTaskSubmitFormData],a=[...i[n].repeatableFieldsData];return a.splice(r,1),i[n]={...i[n],repeatableFieldsData:a},{...t,userTaskSubmitFormData:i}}case mee:{const{row:n,eventIndex:r}=e.payLoad,i=t.list[r];return t.list[r]={...i,...n},t}case bee:return{...t,...e.payLoad}}return t},gD=N.createContext(void 0),kee=({option:t,taskOptions:e,saveFormBuilderSchema:n,templateSchema:r,taskValue:i,children:a})=>{const[s,l]=N.useReducer(Pee,{...q8,...i});return N.useEffect(()=>{l({type:sD,payLoad:i})},[i]),o.jsx(gD.Provider,{value:{taskOptions:e,state:s,dispatch:l},children:o.jsx(Z_,{option:t,saveFormBuilderSchema:n,templateSchema:r,onChange:()=>{},children:a})})},Mee=()=>N.useContext(gD),vr=()=>{var Ae,re,U,Z,K,de,Ee,me;const{taskOptions:n,state:r,dispatch:i}=Mee();if(r===void 0)throw new Error("Must be wrapped in task render provider");const a=r.task_status,s=r.task_status,l=r.userTaskSubmitFormData,c=r.userTrainingSaveData,u=r.taskSchema,d=r.assessmentData,f=r.progressLoading,h=r.submitting,m=r.httpRequest,g=r.taskData,v=r.progressMaxValue,A=r.maxTabs,S=r.tabNoOfFieldsData,x=r.registerData,w=r.progressValue,T=r.noOfTotalElements,C=r.menuList,_=r.loading,E=r.submitting,O=r.success,P=r.success_message,B=(Ae=n==null?void 0:n.exam)!=null&&Ae.startQuiz?(re=n==null?void 0:n.exam)==null?void 0:re.startQuiz:()=>{},M=(U=n==null?void 0:n.exam)!=null&&U.AddUserAssessmentAnswer?(Z=n==null?void 0:n.exam)==null?void 0:Z.AddUserAssessmentAnswer:()=>{},H=(K=n==null?void 0:n.exam)!=null&&K.endQuiz?(de=n==null?void 0:n.exam)==null?void 0:de.endQuiz:()=>{},k=(Ee=n==null?void 0:n.exam)!=null&&Ee.examComplete?(me=n==null?void 0:n.exam)==null?void 0:me.examComplete:pe=>{},z=n!=null&&n.updateTaskFormData?n==null?void 0:n.updateTaskFormData:(pe,ke,Oe,ve,V,ee)=>{},ue=n!=null&&n.submitTaskFormData?n==null?void 0:n.submitTaskFormData:(pe,ke,Oe)=>{},fe=N.useCallback(pe=>i(Cee(pe)),[i]),ne=N.useCallback((pe,ke,Oe)=>{console.log("form",pe)},[i]),R=N.useCallback(()=>i(Iee()),[i]),ae=N.useCallback((pe,ke)=>i(Eee(pe,ke)),[i]),Y=N.useCallback((pe,ke)=>i(Tee(pe,ke)),[i]),ge=N.useCallback(pe=>i(hD(pe)),[i]),ie=N.useCallback(pe=>i(_ee(pe)),[i]),J=N.useCallback(pe=>i(pD(pe)),[i]),Q=N.useCallback(pe=>i(fD(pe)),[i]),se=N.useCallback(pe=>i(Fee(pe)),[i]),be=N.useCallback(pe=>i(Dee(pe)),[i]),Ce=N.useCallback((pe,ke,Oe)=>i(Oee(pe,ke,Oe)),[i]),Te=N.useCallback((pe,ke,Oe)=>i(Nee(pe,ke,Oe)),[i]),ye=N.useCallback((pe,ke,Oe,ve,V,ee)=>i(xee(pe,ke,Oe,ve,V,ee)),[i]);return{examComplete:k,taskOptions:n,TASK_PUBLISHED:6,TASK_PENDING:1,taskStatus:s,assessmentData:d,taskSchema:u,taskData:g,TasksList:C,TasksLoading:_,TasksSuccess:O,TasksSuccessMessage:P,taskProgressMaxValue:v,taskRegisterData:x,taskProgressValue:w,taskMaxTabs:A,noOfTotalElements:T,taskTabRequiredFieldsData:S,userTaskSubmitFormData:l,userTrainingSaveData:c,TasksSubmitLoading:E,updateTaskDataSchema:fe,submitTaskFormData:ue,updateTaskFormData:z,TasksSubmit:h,TasksHTTPRequest:m,updateTaskRegisterData:J,updateTaskProgressValue:ge,updateTaskProgressMaxValue:se,updateUserFormDataSubmit:Q,removeUserDataFormSectionRepeatableData:Y,addUserDataFormSectionRepeatableData:ae,onSetValuetoRepeatableData:Ce,onSetValuetoPostDataHook:Te,clearTaskSchema:R,taskProgressLoading:f,task_status:a,startQuiz:B,endQuiz:H,AddUserAssessmentAnswer:M,updateUserTraining:be,taskFieldUpdateHook:ye,updateProgressDataValuesHook:ie,saveProgressDataHook:ne}};function $8(){return $8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$8.apply(this,arguments)}var mD=y.memo(y.forwardRef(function(t,e){var n=ti.getPTI(t);return y.createElement("svg",$8({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),y.createElement("path",{d:"M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",fill:"currentColor"}),y.createElement("path",{d:"M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",fill:"currentColor"}),y.createElement("path",{d:"M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",fill:"currentColor"}))}));mD.displayName="ExclamationTriangleIcon";function j8(){return j8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},j8.apply(this,arguments)}var vD=y.memo(y.forwardRef(function(t,e){var n=ti.getPTI(t);return y.createElement("svg",j8({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),y.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",fill:"currentColor"}))}));vD.displayName="InfoCircleIcon";function H8(){return H8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H8.apply(this,arguments)}var z8=y.memo(y.forwardRef(function(t,e){var n=ti.getPTI(t);return y.createElement("svg",H8({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),y.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z",fill:"currentColor"}))}));z8.displayName="TimesCircleIcon";function Y8(){return Y8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Y8.apply(this,arguments)}function K8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Lee(t){if(Array.isArray(t))return K8(t)}function Bee(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bD(t,e){if(t){if(typeof t=="string")return K8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K8(t,e)}}function Vee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1597
|
+
`),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Y_]:{exposeProperties:{text:(t,e)=>F8(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function RZ(t,e){const n=P8[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new GZ(n);return r.loadDataTransfer(e),r}function k8(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(P8).filter(n=>{const r=P8[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const WZ=j_(()=>/firefox/i.test(navigator.userAgent)),G_=j_(()=>!!window.safari);class R_{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:a,c3s:s}=this;let l=n.length-1;if(e===n[l])return r[l];let c=0,u=s.length-1,d;for(;c<=u;){d=Math.floor(.5*(c+u));const m=n[d];if(m<e)c=d+1;else if(m>e)u=d-1;else return r[d]}l=Math.max(0,u);const f=e-n[l],h=f*f;return r[l]+i[l]*f+a[l]*h+s[l]*f*h}constructor(e,n){const{length:r}=e,i=[];for(let m=0;m<r;m++)i.push(m);i.sort((m,g)=>e[m]<e[g]?-1:1);const a=[],s=[];let l,c;for(let m=0;m<r-1;m++)l=e[m+1]-e[m],c=n[m+1]-n[m],a.push(l),s.push(c/l);const u=[s[0]];for(let m=0;m<a.length-1;m++){const g=s[m],v=s[m+1];if(g*v<=0)u.push(0);else{l=a[m];const A=a[m+1],S=l+A;u.push(3*S/((S+A)/g+(S+l)/v))}}u.push(s[s.length-1]);const d=[],f=[];let h;for(let m=0;m<u.length-1;m++){h=s[m];const g=u[m],v=1/a[m],A=g+u[m+1]-h-h;d.push((h-g-A)*v),f.push(A*v*v)}this.xs=e,this.ys=n,this.c1s=u,this.c2s=d,this.c3s=f}}const QZ=1;function W_(t){const e=t.nodeType===QZ?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function i3(t){return{x:t.clientX,y:t.clientY}}function JZ(t){var e;return t.nodeName==="IMG"&&(WZ()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function ZZ(t,e,n,r){let i=t?e.width:n,a=t?e.height:r;return G_()&&t&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function eee(t,e,n,r,i){const a=JZ(e),l=W_(a?t:e),c={x:n.x-l.x,y:n.y-l.y},{offsetWidth:u,offsetHeight:d}=t,{anchorX:f,anchorY:h}=r,{dragPreviewWidth:m,dragPreviewHeight:g}=ZZ(a,e,u,d),v=()=>{let _=new R_([0,.5,1],[c.y,c.y/d*g,c.y+g-d]).interpolate(h);return G_()&&a&&(_+=(window.devicePixelRatio-1)*g),_},A=()=>new R_([0,.5,1],[c.x,c.x/u*m,c.x+m-u]).interpolate(f),{offsetX:S,offsetY:x}=i,w=S===0||S,T=x===0||x;return{x:w?S:A(),y:T?x:v()}}class tee{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function nee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){nee(t,i,n[i])})}return t}class ree{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=s=>this.handleDragStart(s,e),a=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",a),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),i=s=>this.handleDragOver(s,e),a=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",a),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",a)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Q_({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return Q_({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(X_).some(n=>X_[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=RZ(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const a=this.sourceNodes.get(i);return a&&W_(a)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:a}=this;this.dragStartSourceIds=null;const s=i3(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:l}=i,c=k8(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const d=this.monitor.getSourceId(),f=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||f;if(h){const{anchorX:m,anchorY:g,offsetX:v,offsetY:A}=this.getCurrentSourcePreviewNodeOptions(),w=eee(f,h,s,{anchorX:m,anchorY:g},{offsetX:v,offsetY:A});l.setDragImage(h,w.x,w.y)}}try{l==null||l.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(l&&!l.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:l}=i,c=k8(l);c&&this.beginDragNativeItem(c,l)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:a}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,a.length>0&&this.actions.hover(a,{clientOffset:i3(i)}),a.some(l=>this.monitor.canDropOnTarget(l))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var a;(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:a}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=i3(i),this.scheduleHover(a),(a||[]).some(l=>this.monitor.canDropOnTarget(l))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var a;i.preventDefault(),(a=this.currentNativeSource)===null||a===void 0||a.loadDataTransfer(i.dataTransfer)}else k8(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:a}=this;this.dropTargetIds=[],this.actions.hover(a,{clientOffset:i3(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const a=i.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(i.preventDefault(),a.dragDrop()))},this.options=new tee(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new XZ(this.isNodeInDocument)}}const uf=function(e,n,r){return new ree(e,n,r)},J_=N.createContext(void 0),Z_=({children:t,option:e,saveFormBuilderSchema:n,templateSchema:r,onChange:i})=>{const a={...v8,...r},[s,l]=N.useReducer(YQ,a);N.useEffect(()=>{n&&n(s)},[s]);const{isPreview:c,isAdmin:u,isRenderView:d,renderType:f,isAdvanceView:h,globalAlignment:m="ltr",emitSocketData:g,media:v,reusableComponent:A,saveFormProgress:S,showSettings:x}=e;return o.jsx(J_.Provider,{value:{media:v,isPreview:c,isAdmin:u,isRenderView:d,renderType:f,isAdvanceView:h,globalAlignment:m,emitSocketData:g,reusableComponent:A,state:s,dispatch:l,onChange:i,saveFormProgress:S,showSettings:x},children:o.jsx(lf,{backend:uf,children:t})})},eD=()=>N.useContext(J_),iee=(t,e,n)=>{const r=Array.from(t),[i]=r.splice(e,1);return r.splice(n,0,i),r},aee=(t,e)=>[...t.slice(0,e),...t.slice(e+1)],see=(t,e,n)=>[...t.slice(0,e),n,...t.slice(e)],tD=(t,e,n)=>{if(e.length===1){const c=Number(e[0]),u=Number(n[0]);return iee(t,u,c)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=n.slice(1),l=r[i];return r[i]={...l,children:tD(l.children,a,s)},r},nD=(t,e)=>{if(e.length===1){const s=Number(e[0]);return aee(t,s)}const n=[...t],r=Number(e.slice(0,1)),i=e.slice(1),a=n[r];return n[r]={...a,children:nD(a.children,i)},n},M8=(t,e,n)=>{if(e.length===1){const l=Number(e[0]);return see(t,l,n)}const r=[...t],i=Number(e.slice(0,1)),a=e.slice(1),s=r[i];return r[i]={...s,children:M8(s.children,a,n)},r},oee=(t,e,n)=>{let r=[...t],i=r[n[oa]].children[n[la]].children[n[fa]].children[n[ha]].children[n[pa]].inlineConditionalRules.rules[n[wa]].conditions[n[$o]].children[n[yo]];return r[n[oa]].children[n[la]].children[n[fa]].children[n[ha]].children[n[pa]].inlineConditionalRules.rules[n[wa]].conditions[n[$o]].children.splice([n[yo]],1),r[e[oa]].children[e[la]].children[e[fa]].children[e[ha]].children[e[pa]].inlineConditionalRules.rules[e[wa]].conditions[e[$o]].children.splice(e[yo],0,i),r},lee=(t,e,n)=>tD(t,e,n),cee=t=>{const e=[...t],n={type:ms,uuid:et(),children:[]};return e.map(r=>(r.children.length||(r.children=[n]),r))},rD=(t,e,n,r)=>{var h,m,g,v,A,S;let i;const a={...Ac,uuid:et(),children:[r]},s={...tu,uuid:et()},l={...tu,uuid:et(),children:[a]},c={...af,uuid:et(),children:[l]},u={...Qm,uuid:et(),children:[c]};switch(e.length){case 1:{r.type===XC?i={...c,children:[r]}:i={...c,children:[s]};break}case 2:{r.type===ta?i={...u,children:[c]}:i={...u,children:[c]};break}case 3:{r.type===bo?i={...c,children:[l]}:i={...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[r]}]};break}case 4:{r.type===j1?i=a:i=r;break}case 5:{i=r;break}default:i=r}let d=t;return n.length>5?(S=(A=(v=(g=(m=(h=d[n[oa]])==null?void 0:h.children[n[la]])==null?void 0:m.children[n[fa]])==null?void 0:g.children[n[ha]])==null?void 0:v.children[n[pa]])==null?void 0:A.inlineConditionalRules)==null||S.rules[n[wa]].conditions[n[$o]].children.splice(n[yo],1):d=nD(d,n),d=cee(d),d=M8(d,e,i),d},uee=(t,e,n)=>{let r;switch(e.length){case 1:{r={...Qm,uuid:et(),children:[{...af,uuid:et(),children:[{...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[n]}]}]}]};break}case 2:{r={...af,uuid:et(),children:[{...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[n]}]}]};break}case 3:{r={...tu,uuid:et(),children:[{...Ac,uuid:et(),children:[n]}]};break}case 4:{r={...Ac,uuid:et(),children:[n]};break}default:r=n}return M8(t,e,r)},on=()=>{const{state:t,dispatch:e,onChange:n,saveFormProgress:r}=eD();if(t===void 0)throw new Error("Must be wrapped in builder provider");const i=t.builderTemplateName,a=t.isChangesSaved,s=t.editing_by,l=t.version_name,c=t.loading,u=t.published_status,d=t,f=t,h=t.formType,m=t==null?void 0:t.userSelectedLanguage,g=t==null?void 0:t.languages,v=t.layout,A=N.useCallback(me=>LQ(me)(e),[e]),S=N.useCallback(me=>lQ(me)(e),[e]),x=N.useCallback(me=>BQ(me)(e),[e]),w=N.useCallback((me,pe)=>{var _t,Qt,xn,bn,wn,yn,Gn,Dn;const ke=[...v],Oe=me.path.split("-"),ve=Oe.slice(0,-1).join("-"),V={uuid:pe.uuid,type:pe.type,reviewerChecklist:[]},ee=0,X=1,oe=2,he=3,we=4,De=5,$e=6,lt=8,Ot=7,nt=5,St=6,it=8;if(pe.type===ta&&(pe==null?void 0:pe.schema)!==void 0){B(JSON.parse(pe==null?void 0:pe.schema),parseInt(Oe[ee]));return}if(((_t=pe==null?void 0:pe.schema)==null?void 0:_t.componentType)==="question"&&((yn=(wn=(bn=(xn=(Qt=ke[0])==null?void 0:Qt.children[0])==null?void 0:xn.children[0])==null?void 0:bn.children[0])==null?void 0:wn.children)!=null&&yn.some(qt=>{var at,Je,ut;return((at=qt==null?void 0:qt.questionText)==null?void 0:at[m.type])===((ut=(Je=pe==null?void 0:pe.schema)==null?void 0:Je.questionText)==null?void 0:ut[m.type])})))return;if(pe.type===Zn){let qt={type:j1,reviewerChecklist:[],...Tt.cloneDeep(pe.schema)};if(qt!=null&&qt.options&&(qt={...qt,options:[{uuid:et(),optionText:{english:"Option 1"},value:"Option1",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}},{uuid:et(),optionText:{english:"Option 2"},value:"Option2",hyperlinkText:{english:""},abbreviationText:{english:"Option 1"},custom_values:{}}]}),qt.componentType==="grid-component"&&(qt={...qt,children:[],options:[{uuid:et(),custom_values:{}}]}),qt.componentType==="radio-hierarchal"&&(qt={...qt,type:"radio",children:[],options:[{uuid:et(),label:"Yes",value:null,enableConditionalField:!0,children:[]},{uuid:et(),label:"No",value:null,enableConditionalField:!0,children:[]}]}),qt={...qt,uuid:et()},Oe.length===lt){U(parseInt(Oe[ee]),parseInt(Oe[X]),parseInt(Oe[oe]),parseInt(Oe[he]),parseInt(Oe[we]),parseInt(Oe[De]),parseInt(Oe[$e]),qt);return}if(Oe.length===Ot){Z(parseInt(Oe[ee]),parseInt(Oe[X]),parseInt(Oe[oe]),parseInt(Oe[he]),parseInt(Oe[we]),parseInt(Oe[nt]),parseInt(Oe[St]),qt);return}if((Dn=(Gn=ke[Oe[ee]].children[Oe[X]])==null?void 0:Gn.children[Oe[oe]])!=null&&Dn.rowIsRepeatable&&(qt==null?void 0:qt.componentType)==="editor")return;x(uee(ke,Oe,qt)),Oe.length>1&&Ce(Oe[ee],Oe[X],Oe[oe],qt);return}const bt=pe.path.split("-"),Nt=bt.slice(0,-1).join("-");if(bt.length===Oe.length){if(Nt===ve){if((bt==null?void 0:bt.length)===it){x(oee(ke,Oe,bt));return}x(lee(ke,Oe,bt));return}const qt={...V,...pe};(pe==null?void 0:pe.id)===void 0&&(qt.id=et()),x(rD(ke,Oe,bt,qt));return}if((bt==null?void 0:bt.length)===8){const qt={type:j1,reviewerChecklist:[],...pe};Z(parseInt(Oe[ee]),parseInt(Oe[X]),parseInt(Oe[oe]),parseInt(Oe[he]),parseInt(Oe[we]),parseInt(Oe[nt]),parseInt(Oe[St]),qt),Ae(bt[oa],bt[la],bt[fa],bt[ha],bt[pa],bt[nt],bt[St],bt[Bl]);return}const We={...V,...pe};(pe==null?void 0:pe.id)===void 0&&(We.id=et()),x(rD(ke,Oe,bt,We))},[v,x,m.type]),T=N.useCallback(()=>zQ()(e),[e]),C=N.useCallback(me=>VQ(me)(e,t),[e]),_=N.useCallback(me=>UQ(me)(e,t),[e]),E=N.useCallback(me=>qQ(me)(e),[e]),O=N.useCallback(me=>oQ(me)(e),[e]),P=N.useCallback(me=>hQ(me)(e),[e]),B=N.useCallback((me,pe)=>mQ(me,pe)(e),[e]),M=N.useCallback((me,pe)=>wQ(me,pe)(e),[e]),H=N.useCallback((me,pe,ke)=>CQ(me,pe,ke)(e),[e]),k=N.useCallback(me=>dQ(me)(e),[e]),z=N.useCallback((me,pe)=>fQ(me,pe)(e),[e]),ue=N.useCallback((me,pe,ke)=>AQ(me,pe,ke)(e),[e]),fe=N.useCallback((me,pe,ke,Oe)=>EQ(me,pe,ke,Oe)(e),[e]),ne=N.useCallback((me,pe,ke,Oe,ve)=>IQ(me,pe,ke,Oe,ve)(e,t),[e]),R=N.useCallback((me,pe,ke,Oe,ve,V)=>_Q(me,pe,ke,Oe,ve,V)(e,t),[e]),ae=N.useCallback((me,pe,ke)=>pQ(me,pe,ke)(e),[e]),Y=N.useCallback((me,pe,ke,Oe)=>yQ(me,pe,ke,Oe)(e),[e]),ge=N.useCallback((me,pe)=>uQ(me,pe)(e),[e]),ie=N.useCallback((me,pe,ke,Oe,ve,V)=>DQ(me,pe,ke,Oe,ve,V)(e),[e]),J=N.useCallback((me,pe,ke,Oe,ve)=>TQ(me,pe,ke,Oe,ve)(e),[e]),Q=N.useCallback((me,pe,ke,Oe)=>bQ(me,pe,ke,Oe)(e),[e]),se=N.useCallback((me,pe,ke)=>gQ(me,pe,ke)(e),[e]),be=N.useCallback((me,pe)=>cQ(me,pe)(e,t),[e]),Ce=N.useCallback((me,pe,ke,Oe)=>SQ(me,pe,ke,Oe)(e),[e]),Te=N.useCallback((me,pe,ke,Oe,ve,V,ee,X,oe)=>kQ(me,pe,ke,Oe,ve,V,ee,X,oe)(e),[e]),ye=N.useCallback((me,pe,ke,Oe,ve,V,ee,X,oe)=>FQ(me,pe,ke,Oe,ve,V,ee,X,oe)(e),[e]),Ae=N.useCallback((me,pe,ke,Oe,ve,V,ee,X)=>PQ(me,pe,ke,Oe,ve,V,ee,X)(e),[e]),re=N.useCallback((me,pe,ke,Oe,ve,V,ee,X)=>MQ(me,pe,ke,Oe,ve,V,ee,X)(e),[e]),U=N.useCallback((me,pe,ke,Oe,ve,V,ee,X)=>OQ(me,pe,ke,Oe,ve,V,ee,X)(e),[e]),Z=N.useCallback((me,pe,ke,Oe,ve,V,ee,X)=>NQ(me,pe,ke,Oe,ve,V,ee,X)(e),[e]),K=N.useCallback(me=>$Q(me)(e),[e]),de=N.useCallback(me=>jQ(me)(e),[e]),Ee=N.useCallback(me=>HQ(me)(e),[e]);return{builderIsChangesSaved:a,builderTemplateName:i,formBuilderFormSchema:d,formBuilderFormLayout:v,formBuilderSchemaLanguages:g,saveFormTemplateNewVersion:f,userSelectedLanguage:m,formBuilderConfigurationType:h,formBuilderLoading:c,formBuilderPublishedStatus:u,builderEditingBy:s,builderVersionName:l,handleDrop:w,formatTableFieldsHook:S,saveFormBuilderSchema:A,removePage:k,removeSection:z,removeRow:ue,removeColumn:fe,removeField:ne,updateEditingBy:Ee,addTabs:O,addSection:P,addRow:M,addColumn:H,cloneField:ie,cloneColumn:J,cloneRow:Q,cloneSection:se,clonePage:be,sectionImport:B,setLayout:x,fieldSettingUpdate:R,selectFormBuilderLanguage:C,unselectFormBuilderLanguage:_,updateUserFormSelectedLanguage:E,updateFormType:K,schemaBuilderUpdate:de,pageSettingUpdate:ge,saveFormProgress:r,sectionSettingUpdate:ae,rowSettingUpdate:Y,clearBuilderSchema:T,addFieldToRowRepeaptable:Ce,addFieldToInlineRuleCondtionFields:U,fieldSettingUpdateInlineConditional:Te,fieldSettingDeleteInlineConditional:re,addFieldToGridComponentHook:Z,gridComponentFieldSettingUpdate:ye,gridComponentFieldDelete:Ae}},Zt=()=>{const{isPreview:t,isAdmin:e,isRenderView:n,renderType:r,isAdvanceView:i,media:a,globalAlignment:s,reusableComponent:l,showSettings:c}=eD();if(t===void 0)throw new Error("Must be wrapped in builder provider");const u=r==null?void 0:r.key,{saveComponent:d,componentList:f}=l;return{isPreview:t,isAdmin:e,isRenderView:n,renderType:u,isAdvanceView:i,globalAlignment:s,media:a,saveComponent:d,componentList:f,emitSocketData:()=>{},updateGlobalToast:g=>{console.log("showSettings",c),c!=null&&c.showToast&&(c==null||c.showToast(g))}}},dee="TASKS_LOADING",fee="TASKS_ADD",hee="TASKS_GET_PAGINATED_LIST",pee="TASKS_DELETE",gee="TASKS_PAGNIATION_UPDATE",mee="TASKS_UPDATE",vee="TASKS_SUCCESS_GET",bee="TASK_GET_TEMPLATE",yee="TASK_SET_DATA",Aee="TASKS_FORM_SUBMIT",wee="TASKS_FORM_HTTP_REQUEST",L8="TASK_SET_PROGRESS_VALUE",iD="TASK_SET_MAX_PROGRESS_VALUE",aD="TASK_SET_REGISTER_DATA",sD="TASK_SET_SCHEMA",B8="TASK_UPDATE_USER_FORM_SUBMIT_DATA",oD="CLEAR_TASK",lD="TASK_USER_SUBMIT_FORM_REPEATABLE_ADD",cD="TASK_USER_SUBMIT_FORM_REPEATABLE_REMOVE_INDEX",uD="TASK_USER_TRAINING_DATA",dD="TASK_FIELD_UPDATE",See=6,a3=1,Ip="DISPLAY_TYPE_START_DETAILS",V8="DISPLAY_TYPE_QUIZ",U8="DISPLAY_TYPE_START_TIMER";function xee(t,e,n,r,i,a){return s=>{s({type:dD,payLoad:{pageIndex:t,sectionIndex:e,rowIndex:n,columnIndex:r,fieldIndex:i,field:a}})}}function fD(t){return(e,n)=>{const r={type:B8,payLoad:{userTaskSubmitFormData:[...t]}};e(r)}}function Cee(t){return(e,n)=>{const{TasksReducer:r}=n(),{taskData:i}=r,a={type:B8,payLoad:{taskData:{...i,...t}}};e(a)}}function Tee(t,e){return(n,r)=>{const{TasksReducer:i}=r(),{userTaskSubmitFormData:a}=i,s=Tt.findIndex(a,function(c){return c.rowId===t});n({type:cD,payLoad:{userSubmitFormIndex:s,repeatableDataRowIndex:e}})}}function Eee(t,e){return(n,r)=>{const{TasksReducer:i}=r(),{userTaskSubmitFormData:a}=i,s=Tt.findIndex(a,function(c){return c.rowId===t});n({type:lD,payLoad:{userSubmitFormIndex:s,repeatableData:e}})}}function Iee(){return t=>{t({type:oD,payLoad:null})}}const hD=t=>e=>{e({type:L8,payLoad:{progressValue:t}})},_ee=t=>e=>{e({type:L8,payLoad:t})},Dee=t=>e=>{e({type:uD,payLoad:{userTrainingSaveData:t}})},pD=t=>e=>{e({type:aD,payLoad:{registerData:t}})},Oee=(t,e,n)=>(r,i)=>{var d;const{TasksReducer:a}=i(),{userTaskSubmitFormData:s}=a,l=[...s],c=Tt.findIndex(l,function(f){var h;return f.rowId===((h=t==null?void 0:t.row)==null?void 0:h.uuid)});let u=(d=s[c])==null?void 0:d.repeatableFields;u={...u,[e==null?void 0:e.uuid]:`<div>${n}</div>`},l[c]={...l[c],repeatableFields:u},r(fD(l))},Nee=(t,e,n)=>(r,i)=>{const{TasksReducer:a}=i(),{userTaskSubmitFormData:s,registerData:l}=a,c=s,u=Tt.cloneDeep(l);if(n&&(c==null?void 0:c.length)>0){u[e==null?void 0:e.uuid]=n;for(const f of c)f.fieldId===e.uuid&&(f.postData[0]={postValue:n})}else if((c==null?void 0:c.length)>0){for(const f of c)f.fieldId===e.uuid&&(f.postData[0]={postValue:""});delete u[e==null?void 0:e.uuid]}r(pD(u));const d=Object.keys(u).length;r(hD(d))},Fee=t=>e=>{e({type:iD,payLoad:{progressMaxValue:t}})},q8={submitting:!1,httpRequest:!1,taskData:null,taskUpdateLoading:!1,loading:!1,progressLoading:!1,list:[],filter:"",sort:"task.created_at|desc",total_records:0,page:1,per_page:10,success:!1,success_message:"",userTaskSubmitFormData:null,taskSchema:null,progressMaxValue:0,maxTabs:0,registerData:{},progressValue:0,tabNoOfFieldsData:[],noOfTotalElements:0,sortField:null,sortOrder:null,userTrainingSaveData:null,assessmentData:null,task_status:1},Pee=(t=q8,e)=>{switch(e.type){case oD:return{...t,...q8,list:[...t.list],page:t.page,per_page:t.per_page,filter:t.filter,sort:t.sort,total_records:t.total_records};case vee:return{...t,...e.payLoad};case B8:return{...t,...e.payLoad};case sD:return{...t,...e.payLoad};case L8:return{...t,...e.payLoad};case aD:return{...t,registerData:e.payLoad.registerData};case iD:return{...t,...e.payLoad};case dee:return{...t,...e.payLoad};case Aee:return{...t,...e.payLoad};case wee:return{...t,...e.payLoad};case fee:{const{record:n}=e.payLoad;return{...t,list:[...n,...t.list]}}case hee:return{...t,...e.payLoad};case yee:return{...t,taskData:e.payLoad};case gee:return{...t,...e.payLoad};case pee:{const n=t.list.filter(r=>r.task_id!==e.payLoad.task_id);return{...t,list:[...n]}}case uD:return{...t,...e.payLoad};case dD:{const{pageIndex:n,sectionIndex:r,rowIndex:i,columnIndex:a,fieldIndex:s,field:l}=e.payLoad,c=[...t.taskSchema.layout];c[n].children[r].children[i].children[a].children[s]=l;const u={...t.taskSchema,layout:c};return{...t,taskSchema:u}}case lD:{const{userSubmitFormIndex:n,repeatableData:r}=e.payLoad,i=t.userTaskSubmitFormData[n].repeatableFieldsData?t.userTaskSubmitFormData[n].repeatableFieldsData:[];return i.push(r),t.userTaskSubmitFormData[n].repeatableFieldsData=i,t}case cD:{const{userSubmitFormIndex:n,repeatableDataRowIndex:r}=e.payLoad,i=[...t.userTaskSubmitFormData],a=[...i[n].repeatableFieldsData];return a.splice(r,1),i[n]={...i[n],repeatableFieldsData:a},{...t,userTaskSubmitFormData:i}}case mee:{const{row:n,eventIndex:r}=e.payLoad,i=t.list[r];return t.list[r]={...i,...n},t}case bee:return{...t,...e.payLoad}}return t},gD=N.createContext(void 0),kee=({option:t,taskOptions:e,saveFormBuilderSchema:n,templateSchema:r,taskValue:i,children:a})=>{const[s,l]=N.useReducer(Pee,{...q8,...i});return N.useEffect(()=>{l({type:sD,payLoad:i})},[i]),o.jsx(gD.Provider,{value:{taskOptions:e,state:s,dispatch:l},children:o.jsx(Z_,{option:t,saveFormBuilderSchema:n,templateSchema:r,onChange:()=>{},children:a})})},Mee=()=>N.useContext(gD),vr=()=>{var Ae,re,U,Z,K,de,Ee,me;const{taskOptions:n,state:r,dispatch:i}=Mee();if(r===void 0)throw new Error("Must be wrapped in task render provider");const a=r.task_status,s=r.task_status,l=r.userTaskSubmitFormData,c=r.userTrainingSaveData,u=r.taskSchema,d=r.assessmentData,f=r.progressLoading,h=r.submitting,m=r.httpRequest,g=r.taskData,v=r.progressMaxValue,A=r.maxTabs,S=r.tabNoOfFieldsData,x=r.registerData,w=r.progressValue,T=r.noOfTotalElements,C=r.menuList,_=r.loading,E=r.submitting,O=r.success,P=r.success_message,B=(Ae=n==null?void 0:n.exam)!=null&&Ae.startQuiz?(re=n==null?void 0:n.exam)==null?void 0:re.startQuiz:()=>{},M=(U=n==null?void 0:n.exam)!=null&&U.AddUserAssessmentAnswer?(Z=n==null?void 0:n.exam)==null?void 0:Z.AddUserAssessmentAnswer:()=>{},H=(K=n==null?void 0:n.exam)!=null&&K.endQuiz?(de=n==null?void 0:n.exam)==null?void 0:de.endQuiz:()=>{},k=(Ee=n==null?void 0:n.exam)!=null&&Ee.examComplete?(me=n==null?void 0:n.exam)==null?void 0:me.examComplete:pe=>{},z=n!=null&&n.updateTaskFormData?n==null?void 0:n.updateTaskFormData:(pe,ke,Oe,ve,V,ee)=>{},ue=n!=null&&n.submitTaskFormData?n==null?void 0:n.submitTaskFormData:(pe,ke,Oe)=>{},fe=N.useCallback(pe=>i(Cee(pe)),[i]),ne=N.useCallback((pe,ke,Oe)=>{console.log("form",pe)},[i]),R=N.useCallback(()=>i(Iee()),[i]),ae=N.useCallback((pe,ke)=>i(Eee(pe,ke)),[i]),Y=N.useCallback((pe,ke)=>i(Tee(pe,ke)),[i]),ge=N.useCallback(pe=>i(hD(pe)),[i]),ie=N.useCallback(pe=>i(_ee(pe)),[i]),J=N.useCallback(pe=>i(pD(pe)),[i]),Q=N.useCallback(pe=>i(fD(pe)),[i]),se=N.useCallback(pe=>i(Fee(pe)),[i]),be=N.useCallback(pe=>i(Dee(pe)),[i]),Ce=N.useCallback((pe,ke,Oe)=>i(Oee(pe,ke,Oe)),[i]),Te=N.useCallback((pe,ke,Oe)=>i(Nee(pe,ke,Oe)),[i]),ye=N.useCallback((pe,ke,Oe,ve,V,ee)=>i(xee(pe,ke,Oe,ve,V,ee)),[i]);return{examComplete:k,taskOptions:n,TASK_PUBLISHED:6,TASK_PENDING:1,taskStatus:s,assessmentData:d,taskSchema:u,taskData:g,TasksList:C,TasksLoading:_,TasksSuccess:O,TasksSuccessMessage:P,taskProgressMaxValue:v,taskRegisterData:x,taskProgressValue:w,taskMaxTabs:A,noOfTotalElements:T,taskTabRequiredFieldsData:S,userTaskSubmitFormData:l,userTrainingSaveData:c,TasksSubmitLoading:E,updateTaskDataSchema:fe,submitTaskFormData:ue,updateTaskFormData:z,TasksSubmit:h,TasksHTTPRequest:m,updateTaskRegisterData:J,updateTaskProgressValue:ge,updateTaskProgressMaxValue:se,updateUserFormDataSubmit:Q,removeUserDataFormSectionRepeatableData:Y,addUserDataFormSectionRepeatableData:ae,onSetValuetoRepeatableData:Ce,onSetValuetoPostDataHook:Te,clearTaskSchema:R,taskProgressLoading:f,task_status:a,startQuiz:B,endQuiz:H,AddUserAssessmentAnswer:M,updateUserTraining:be,taskFieldUpdateHook:ye,updateProgressDataValuesHook:ie,saveProgressDataHook:ne}};function $8(){return $8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$8.apply(this,arguments)}var mD=y.memo(y.forwardRef(function(t,e){var n=ti.getPTI(t);return y.createElement("svg",$8({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),y.createElement("path",{d:"M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z",fill:"currentColor"}),y.createElement("path",{d:"M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z",fill:"currentColor"}),y.createElement("path",{d:"M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z",fill:"currentColor"}))}));mD.displayName="ExclamationTriangleIcon";function j8(){return j8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},j8.apply(this,arguments)}var vD=y.memo(y.forwardRef(function(t,e){var n=ti.getPTI(t);return y.createElement("svg",j8({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),y.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z",fill:"currentColor"}))}));vD.displayName="InfoCircleIcon";function H8(){return H8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H8.apply(this,arguments)}var z8=y.memo(y.forwardRef(function(t,e){var n=ti.getPTI(t);return y.createElement("svg",H8({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),y.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z",fill:"currentColor"}))}));z8.displayName="TimesCircleIcon";function Y8(){return Y8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Y8.apply(this,arguments)}function K8(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Lee(t){if(Array.isArray(t))return K8(t)}function Bee(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bD(t,e){if(t){if(typeof t=="string")return K8(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K8(t,e)}}function Vee(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1598
1598
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X8(t){return Lee(t)||Bee(t)||bD(t)||Vee()}function Uee(t){if(Array.isArray(t))return t}function qee(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function $ee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1599
1599
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G8(t,e){return Uee(t)||qee(t,e)||bD(t,e)||$ee()}function _p(t){"@babel/helpers - typeof";return _p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_p(t)}function jee(t,e){if(_p(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(_p(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yD(t){var e=jee(t,"string");return _p(e)==="symbol"?e:String(e)}function Co(t,e,n){return e=yD(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Hee=`
|
|
1600
1600
|
@layer primereact {
|
|
@@ -3737,7 +3737,7 @@ ${ch(e)}`),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),
|
|
|
3737
3737
|
`.split("").map(t=>t.charCodeAt(0)));class Vme extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Ume extends VA{constructor(e,n={}){super(e,n),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return lo();const e=this.subtitlesTrack_.cues,n=e[0].startTime,r=e[e.length-1].startTime;return lo([[n,r]])}initSegmentForMap(e,n=!1){if(!e)return null;const r=gv(e);let i=this.initSegments_[r];if(n&&!i&&e.bytes){const a=vB.byteLength+e.bytes.byteLength,s=new Uint8Array(a);s.set(e.bytes),s.set(vB,e.bytes.byteLength),this.initSegments_[r]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:s}}return i||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,n){og(e,n,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const n=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",n),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,n,r){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(n.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Cu.TIMEOUT&&this.handleTimeout_(),e.code===Cu.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");const a=i.segment;if(a.map&&(a.map.bytes=n.map.bytes),i.bytes=n.bytes,typeof Ge.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,n,r),()=>this.stopForError({message:"Error loading vtt.js",metadata:{errorType:Dt.Error.VttLoadError}}));return}a.requested=!0;try{this.parseVTTCues_(i)}catch(s){this.stopForError({message:s.message,metadata:{errorType:Dt.Error.VttCueParsingError}});return}if(this.updateTimeMapping_(i,this.syncController_.timelines[i.timeline],this.playlist_),i.cues.length?i.timingInfo={start:i.cues[0].startTime,end:i.cues[i.cues.length-1].endTime}:i.timingInfo={start:i.startOfSegment,end:i.startOfSegment+i.duration},i.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}i.byteLength=i.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,i.cues.forEach(s=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new Ge.VTTCue(s.startTime,s.endTime,s.text):s)}),xme(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let n,r=!1;if(typeof Ge.WebVTT!="function")throw new Vme;typeof Ge.TextDecoder=="function"?n=new Ge.TextDecoder("utf8"):(n=Ge.WebVTT.StringDecoder(),r=!0);const i=new Ge.WebVTT.Parser(Ge,Ge.vttjs,n);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=s=>{e.timestampmap=s},i.onparsingerror=s=>{Dt.log.warn("Error encountered when parsing cues: "+s.message)},e.segment.map){let s=e.segment.map.bytes;r&&(s=mB(s)),i.parse(s)}let a=e.bytes;r&&(a=mB(a)),i.parse(a),i.flush()}updateTimeMapping_(e,n,r){const i=e.segment;if(!n)return;if(!e.cues.length){i.empty=!0;return}const{MPEGTS:a,LOCAL:s}=e.timestampmap,c=a/c1.ONE_SECOND_IN_TS-s+n.mapping;if(e.cues.forEach(u=>{const d=u.endTime-u.startTime,f=a===0?u.startTime+c:this.handleRollover_(u.startTime+c,n.time);u.startTime=Math.max(f,0),u.endTime=Math.max(f+d,0)}),!r.syncInfo){const u=e.cues[0].startTime,d=e.cues[e.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:Math.min(u,d-i.duration)}}}handleRollover_(e,n){if(n===null)return e;let r=e*c1.ONE_SECOND_IN_TS;const i=n*c1.ONE_SECOND_IN_TS;let a;for(i<r?a=-8589934592:a=8589934592;Math.abs(r-i)>4294967296;)r+=a;return r/c1.ONE_SECOND_IN_TS}}const qme=function(t,e){const n=t.cues;for(let r=0;r<n.length;r++){const i=n[r];if(e>=i.adStartTime&&e<=i.adEndTime)return i}return null},$me=function(t,e,n=0){if(!t.segments)return;let r=n,i;for(let a=0;a<t.segments.length;a++){const s=t.segments[a];if(i||(i=qme(e,r+s.duration/2)),i){if("cueIn"in s){i.endTime=r,i.adEndTime=r,r+=s.duration,i=null;continue}if(r<i.endTime){r+=s.duration;continue}i.endTime+=s.duration}else if("cueOut"in s&&(i=new Ge.VTTCue(r,r+s.duration,s.cueOut),i.adStartTime=r,i.adEndTime=r+parseFloat(s.cueOut),e.addCue(i)),"cueOutCont"in s){const[l,c]=s.cueOutCont.split("/").map(parseFloat);i=new Ge.VTTCue(r,r+s.duration,""),i.adStartTime=r-l,i.adEndTime=i.adStartTime+c,e.addCue(i)}r+=s.duration}};class bB{constructor({start:e,end:n,segmentIndex:r,partIndex:i=null,appended:a=!1}){this.start_=e,this.end_=n,this.segmentIndex_=r,this.partIndex_=i,this.appended_=a}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class jme{constructor(e,n=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=n}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class qA{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,n){const{mediaSequence:r,segments:i}=e;if(this.isReliable_=this.isReliablePlaylist_(r,i),!!this.isReliable_)return this.updateStorage_(i,r,this.calculateBaseTime_(r,n))}getSyncInfoForTime(e){for(const{segmentSyncInfo:n,partsSyncInfo:r}of this.storage_.values())if(r.length){for(const i of r)if(i.isInRange(e))return i}else if(n.isInRange(e))return n;return null}updateStorage_(e,n,r){const i=new Map;let a=`
|
|
3738
3738
|
`,s=r,l=n;this.start_=s,e.forEach((c,u)=>{const d=this.storage_.get(l),f=s,h=f+c.duration,m=!!(d&&d.segmentSyncInfo&&d.segmentSyncInfo.isAppended),g=new bB({start:f,end:h,appended:m,segmentIndex:u});c.syncInfo=g;let v=s;const A=(c.parts||[]).map((S,x)=>{const w=v,T=v+S.duration,C=!!(d&&d.partsSyncInfo&&d.partsSyncInfo[x]&&d.partsSyncInfo[x].isAppended),_=new bB({start:w,end:T,appended:C,segmentIndex:u,partIndex:x});return v=T,a+=`Media Sequence: ${l}.${x} | Range: ${w} --> ${T} | Appended: ${C}
|
|
3739
3739
|
`,S.syncInfo=_,_});i.set(l,new jme(g,A)),a+=`${aB(c.resolvedUri)} | Media Sequence: ${l} | Range: ${f} --> ${h} | Appended: ${m}
|
|
3740
|
-
`,l++,s=h}),this.end_=s,this.storage_=i,this.diagnostics_=a}calculateBaseTime_(e,n){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:n:0}isReliablePlaylist_(e,n){return e!=null&&Array.isArray(n)&&n.length}}const Hme=86400,$A=[{name:"VOD",run:(t,e,n,r,i)=>n!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(t,e,n,r,i,a)=>{const s=t.getMediaSequenceSync(a);if(!s||!s.isReliable)return null;const l=s.getSyncInfoForTime(i);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(t,e,n,r,i)=>{if(!Object.keys(t.timelineToDatetimeMappings).length)return null;let a=null,s=null;const l=CA(e);i=i||0;for(let c=0;c<l.length;c++){const u=e.endList||i===0?c:l.length-(c+1),d=l[u],f=d.segment,h=t.timelineToDatetimeMappings[f.timeline];if(!h||!f.dateTimeObject)continue;let g=f.dateTimeObject.getTime()/1e3+h;if(f.parts&&typeof d.partIndex=="number")for(let A=0;A<d.partIndex;A++)g+=f.parts[A].duration;const v=Math.abs(i-g);if(s!==null&&(v===0||s<v))break;s=v,a={time:g,segmentIndex:d.segmentIndex,partIndex:d.partIndex}}return a}},{name:"Segment",run:(t,e,n,r,i)=>{let a=null,s=null;i=i||0;const l=CA(e);for(let c=0;c<l.length;c++){const u=e.endList||i===0?c:l.length-(c+1),d=l[u],f=d.segment,h=d.part&&d.part.start||f&&f.start;if(f.timeline===r&&typeof h<"u"){const m=Math.abs(i-h);if(s!==null&&s<m)break;(!a||s===null||s>=m)&&(s=m,a={time:h,segmentIndex:d.segmentIndex,partIndex:d.partIndex})}}return a}},{name:"Discontinuity",run:(t,e,n,r,i)=>{let a=null;if(i=i||0,e.discontinuityStarts&&e.discontinuityStarts.length){let s=null;for(let l=0;l<e.discontinuityStarts.length;l++){const c=e.discontinuityStarts[l],u=e.discontinuitySequence+l+1,d=t.discontinuities[u];if(d){const f=Math.abs(i-d.time);if(s!==null&&s<f)break;(!a||s===null||s>=f)&&(s=f,a={time:d.time,segmentIndex:c,partIndex:null})}}}return a}},{name:"Playlist",run:(t,e,n,r,i)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class zme extends Dt.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_={main:new qA,audio:new qA,vtt:new qA},this.logger_=Wl("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,n,r,i,a){if(n!==1/0)return $A.find(({name:c})=>c==="VOD").run(this,e,n);const s=this.runStrategies_(e,n,r,i,a);if(!s.length)return null;for(const l of s){const{syncPoint:c,strategy:u}=l,{segmentIndex:d,time:f}=c;if(d<0)continue;const h=e.segments[d],m=f,g=m+h.duration;if(this.logger_(`Strategy: ${u}. Current time: ${i}. selected segment: ${d}. Time: [${m} -> ${g}]}`),i>=m&&i<g)return this.logger_("Found sync point with exact match: ",c),c}return this.selectSyncPoint_(s,{key:"time",value:i})}getExpiredTime(e,n){if(!e||!e.segments)return null;const r=this.runStrategies_(e,n,e.discontinuitySequence,0);if(!r.length)return null;const i=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+rg({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))}runStrategies_(e,n,r,i,a){const s=[];for(let l=0;l<$A.length;l++){const c=$A[l],u=c.run(this,e,n,r,i,a);u&&(u.strategy=c.name,s.push({strategy:c.name,syncPoint:u}))}return s}selectSyncPoint_(e,n){let r=e[0].syncPoint,i=Math.abs(e[0].syncPoint[n.key]-n.value),a=e[0].strategy;for(let s=1;s<e.length;s++){const l=Math.abs(e[s].syncPoint[n.key]-n.value);l<i&&(i=l,r=e[s].syncPoint,a=e[s].strategy)}return this.logger_(`syncPoint for [${n.key}: ${n.value}] chosen with strategy [${a}]: [time:${r.time}, segmentIndex:${r.segmentIndex}`+(typeof r.partIndex=="number"?`,partIndex:${r.partIndex}`:"")+"]"),r}saveExpiredSegmentInfo(e,n){const r=n.mediaSequence-e.mediaSequence;if(r>Hme){Dt.log.warn(`Not saving expired segment info. Media sequence gap ${r} is too large.`);return}for(let i=r-1;i>=0;i--){const a=e.segments[i];if(a&&typeof a.start<"u"){n.syncInfo={mediaSequence:e.mediaSequence+i,time:a.start},this.logger_(`playlist refresh sync: [time:${n.syncInfo.time}, mediaSequence: ${n.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const n=e.segments[0],r=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-r}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:n}){const r=this.calculateSegmentTimeMapping_(e,e.timingInfo,n),i=e.segment;r&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:i.start}));const a=i.dateTimeObject;i.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[i.timeline]=-(a.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,n,r){const i=e.segment,a=e.part;let s=this.timelines[e.timeline],l,c;if(typeof e.timestampOffset=="number")s={time:e.startOfSegment,mapping:e.startOfSegment-n.start},r&&(this.timelines[e.timeline]=s,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${s.time}] [mapping: ${s.mapping}]`)),l=e.startOfSegment,c=n.end+s.mapping;else if(s)l=n.start+s.mapping,c=n.end+s.mapping;else return!1;return a&&(a.start=l,a.end=c),(!i.start||l<i.start)&&(i.start=l),i.end=c,!0}saveDiscontinuitySyncInfo_(e){const n=e.playlist,r=e.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(let i=0;i<n.discontinuityStarts.length;i++){const a=n.discontinuityStarts[i],s=n.discontinuitySequence+i+1,l=a-e.mediaIndex,c=Math.abs(l);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>c){let u;l<0?u=r.start-rg({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:e.mediaIndex,endIndex:a}):u=r.end+rg({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:e.mediaIndex+1,endIndex:a}),this.discontinuities[s]={time:u,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class Yme extends Dt.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:n,to:r}){return typeof n=="number"&&typeof r=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:n,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:n,to:r}){return typeof n=="number"&&typeof r=="number"&&(this.lastTimelineChanges_[e]={type:e,from:n,to:r},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const Kme=HL(zL(function(){var t=function(){function v(){this.listeners={}}var A=v.prototype;return A.on=function(x,w){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push(w)},A.off=function(x,w){if(!this.listeners[x])return!1;var T=this.listeners[x].indexOf(w);return this.listeners[x]=this.listeners[x].slice(0),this.listeners[x].splice(T,1),T>-1},A.trigger=function(x){var w=this.listeners[x];if(w)if(arguments.length===2)for(var T=w.length,C=0;C<T;++C)w[C].call(this,arguments[1]);else for(var _=Array.prototype.slice.call(arguments,1),E=w.length,O=0;O<E;++O)w[O].apply(this,_)},A.dispose=function(){this.listeners={}},A.pipe=function(x){this.on("data",function(w){x.push(w)})},v}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(v){return v.subarray(0,v.byteLength-v[v.byteLength-1])}/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const n=function(){const v=[[[],[],[],[],[]],[[],[],[],[],[]]],A=v[0],S=v[1],x=A[4],w=S[4];let T,C,_;const E=[],O=[];let P,B,M,H,k,z;for(T=0;T<256;T++)O[(E[T]=T<<1^(T>>7)*283)^T]=T;for(C=_=0;!x[C];C^=P||1,_=O[_]||1)for(H=_^_<<1^_<<2^_<<3^_<<4,H=H>>8^H&255^99,x[C]=H,w[H]=C,M=E[B=E[P=E[C]]],z=M*16843009^B*65537^P*257^C*16843008,k=E[H]*257^H*16843008,T=0;T<4;T++)A[T][C]=k=k<<24^k>>>8,S[T][H]=z=z<<24^z>>>8;for(T=0;T<5;T++)A[T]=A[T].slice(0),S[T]=S[T].slice(0);return v};let r=null;class i{constructor(A){r||(r=n()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let S,x,w;const T=this._tables[0][4],C=this._tables[1],_=A.length;let E=1;if(_!==4&&_!==6&&_!==8)throw new Error("Invalid aes key size");const O=A.slice(0),P=[];for(this._key=[O,P],S=_;S<4*_+28;S++)w=O[S-1],(S%_===0||_===8&&S%_===4)&&(w=T[w>>>24]<<24^T[w>>16&255]<<16^T[w>>8&255]<<8^T[w&255],S%_===0&&(w=w<<8^w>>>24^E<<24,E=E<<1^(E>>7)*283)),O[S]=O[S-_]^w;for(x=0;S;x++,S--)w=O[x&3?S:S-4],S<=4||x<4?P[x]=w:P[x]=C[0][T[w>>>24]]^C[1][T[w>>16&255]]^C[2][T[w>>8&255]]^C[3][T[w&255]]}decrypt(A,S,x,w,T,C){const _=this._key[1];let E=A^_[0],O=w^_[1],P=x^_[2],B=S^_[3],M,H,k;const z=_.length/4-2;let ue,fe=4;const ne=this._tables[1],R=ne[0],ae=ne[1],Y=ne[2],ge=ne[3],ie=ne[4];for(ue=0;ue<z;ue++)M=R[E>>>24]^ae[O>>16&255]^Y[P>>8&255]^ge[B&255]^_[fe],H=R[O>>>24]^ae[P>>16&255]^Y[B>>8&255]^ge[E&255]^_[fe+1],k=R[P>>>24]^ae[B>>16&255]^Y[E>>8&255]^ge[O&255]^_[fe+2],B=R[B>>>24]^ae[E>>16&255]^Y[O>>8&255]^ge[P&255]^_[fe+3],fe+=4,E=M,O=H,P=k;for(ue=0;ue<4;ue++)T[(3&-ue)+C]=ie[E>>>24]<<24^ie[O>>16&255]<<16^ie[P>>8&255]<<8^ie[B&255]^_[fe++],M=E,E=O,O=P,P=B,B=M}}class a extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(A){this.jobs.push(A),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const s=function(v){return v<<24|(v&65280)<<8|(v&16711680)>>8|v>>>24},l=function(v,A,S){const x=new Int32Array(v.buffer,v.byteOffset,v.byteLength>>2),w=new i(Array.prototype.slice.call(A)),T=new Uint8Array(v.byteLength),C=new Int32Array(T.buffer);let _,E,O,P,B,M,H,k,z;for(_=S[0],E=S[1],O=S[2],P=S[3],z=0;z<x.length;z+=4)B=s(x[z]),M=s(x[z+1]),H=s(x[z+2]),k=s(x[z+3]),w.decrypt(B,M,H,k,C,z),C[z]=s(C[z]^_),C[z+1]=s(C[z+1]^E),C[z+2]=s(C[z+2]^O),C[z+3]=s(C[z+3]^P),_=B,E=M,O=H,P=k;return T};class c{constructor(A,S,x,w){const T=c.STEP,C=new Int32Array(A.buffer),_=new Uint8Array(A.byteLength);let E=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(C.subarray(E,E+T),S,x,_)),E=T;E<C.length;E+=T)x=new Uint32Array([s(C[E-4]),s(C[E-3]),s(C[E-2]),s(C[E-1])]),this.asyncStream_.push(this.decryptChunk_(C.subarray(E,E+T),S,x,_));this.asyncStream_.push(function(){w(null,e(_))})}static get STEP(){return 32e3}decryptChunk_(A,S,x,w){return function(){const T=l(A,S,x);w.set(T,A.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d;typeof window<"u"?d=window:typeof u<"u"?d=u:typeof self<"u"?d=self:d={};var f=d,h=function(A){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(A):A&&A.buffer instanceof ArrayBuffer},m=f.BigInt||Number;m("0x1"),m("0x100"),m("0x10000"),m("0x1000000"),m("0x100000000"),m("0x10000000000"),m("0x1000000000000"),m("0x100000000000000"),m("0x10000000000000000"),function(){var v=new Uint16Array([65484]),A=new Uint8Array(v.buffer,v.byteOffset,v.byteLength);return A[0]===255?"big":A[0]===204?"little":"unknown"}();const g=function(v){const A={};return Object.keys(v).forEach(S=>{const x=v[S];h(x)?A[S]={bytes:x.buffer,byteOffset:x.byteOffset,byteLength:x.byteLength}:A[S]=x}),A};self.onmessage=function(v){const A=v.data,S=new Uint8Array(A.encrypted.bytes,A.encrypted.byteOffset,A.encrypted.byteLength),x=new Uint32Array(A.key.bytes,A.key.byteOffset,A.key.byteLength/4),w=new Uint32Array(A.iv.bytes,A.iv.byteOffset,A.iv.byteLength/4);new c(S,x,w,function(T,C){self.postMessage(g({source:A.source,decrypted:C}),[C.buffer])})}}));var Xme=jL(Kme);const Gme=t=>{let e=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},yB=(t,e)=>{t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},jA=(t,e)=>{e.activePlaylistLoader=t,t.load()},Rme=(t,e)=>()=>{const{segmentLoaders:{[t]:n,main:r},mediaTypes:{[t]:i}}=e,a=i.activeTrack(),s=i.getActiveGroup(),l=i.activePlaylistLoader,c=i.lastGroup_;if(!(s&&c&&s.id===c.id)&&(i.lastGroup_=s,i.lastTrack_=a,yB(n,i),!(!s||s.isMainPlaylist))){if(!s.playlistLoader){l&&r.resetEverything();return}n.resyncLoader(),jA(s.playlistLoader,i)}},Wme=(t,e)=>()=>{const{segmentLoaders:{[t]:n},mediaTypes:{[t]:r}}=e;r.lastGroup_=null,n.abort(),n.pause()},Qme=(t,e)=>()=>{const{mainPlaylistLoader:n,segmentLoaders:{[t]:r,main:i},mediaTypes:{[t]:a}}=e,s=a.activeTrack(),l=a.getActiveGroup(),c=a.activePlaylistLoader,u=a.lastTrack_;if(!(u&&s&&u.id===s.id)&&(a.lastGroup_=l,a.lastTrack_=s,yB(r,a),!!l)){if(l.isMainPlaylist){if(!s||!u||s.id===u.id)return;const d=e.vhs.playlistController_,f=d.selectPlaylist();if(d.media()===f)return;a.logger_(`track change. Switching main audio from ${u.id} to ${s.id}`),n.pause(),i.resetEverything(),d.fastQualityChange_(f);return}if(t==="AUDIO"){if(!l.playlistLoader){i.setAudio(!0),i.resetEverything();return}r.setAudio(!0),i.setAudio(!1)}if(c===l.playlistLoader){jA(l.playlistLoader,a);return}r.track&&r.track(s),r.resetEverything(),jA(l.playlistLoader,a)}},Av={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:n},excludePlaylist:r}=e,i=n.activeTrack(),a=n.activeGroup(),s=(a.filter(c=>c.default)[0]||a[0]).id,l=n.tracks[s];if(i===l){r({error:{message:"Problem encountered loading the default audio track."}});return}Dt.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in n.tracks)n.tracks[c].enabled=n.tracks[c]===l;n.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:n}}=e;Dt.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}},AB={AUDIO:(t,e,n)=>{if(!e)return;const{tech:r,requestOptions:i,segmentLoaders:{[t]:a}}=n;e.on("loadedmetadata",()=>{const s=e.media();a.playlist(s,i),(!r.paused()||s.endList&&r.preload()!=="none")&&a.load()}),e.on("loadedplaylist",()=>{a.playlist(e.media(),i),r.paused()||a.load()}),e.on("error",Av[t](t,n))},SUBTITLES:(t,e,n)=>{const{tech:r,requestOptions:i,segmentLoaders:{[t]:a},mediaTypes:{[t]:s}}=n;e.on("loadedmetadata",()=>{const l=e.media();a.playlist(l,i),a.track(s.activeTrack()),(!r.paused()||l.endList&&r.preload()!=="none")&&a.load()}),e.on("loadedplaylist",()=>{a.playlist(e.media(),i),r.paused()||a.load()}),e.on("error",Av[t](t,n))}},Jme={AUDIO:(t,e)=>{const{vhs:n,sourceType:r,segmentLoaders:{[t]:i},requestOptions:a,main:{mediaGroups:s},mediaTypes:{[t]:{groups:l,tracks:c,logger_:u}},mainPlaylistLoader:d}=e,f=ig(d.main);(!s[t]||Object.keys(s[t]).length===0)&&(s[t]={main:{default:{default:!0}}},f&&(s[t].main.default.playlists=d.main.playlists));for(const h in s[t]){l[h]||(l[h]=[]);for(const m in s[t][h]){let g=s[t][h][m],v;if(f?(u(`AUDIO group '${h}' label '${m}' is a main playlist`),g.isMainPlaylist=!0,v=null):r==="vhs-json"&&g.playlists?v=new oh(g.playlists[0],n,a):g.resolvedUri?v=new oh(g.resolvedUri,n,a):g.playlists&&r==="dash"?v=new PA(g.playlists[0],n,a,d):v=null,g=Gi({id:m,playlistLoader:v},g),AB[t](t,g.playlistLoader,e),l[h].push(g),typeof c[m]>"u"){const A=new Dt.AudioTrack({id:m,kind:Gme(g),enabled:!1,language:g.language,default:g.default,label:m});c[m]=A}}}i.on("error",Av[t](t,e))},SUBTITLES:(t,e)=>{const{tech:n,vhs:r,sourceType:i,segmentLoaders:{[t]:a},requestOptions:s,main:{mediaGroups:l},mediaTypes:{[t]:{groups:c,tracks:u}},mainPlaylistLoader:d}=e;for(const f in l[t]){c[f]||(c[f]=[]);for(const h in l[t][f]){if(!r.options_.useForcedSubtitles&&l[t][f][h].forced)continue;let m=l[t][f][h],g;if(i==="hls")g=new oh(m.resolvedUri,r,s);else if(i==="dash"){if(!m.playlists.filter(A=>A.excludeUntil!==1/0).length)return;g=new PA(m.playlists[0],r,s,d)}else i==="vhs-json"&&(g=new oh(m.playlists?m.playlists[0]:m.resolvedUri,r,s));if(m=Gi({id:h,playlistLoader:g},m),AB[t](t,m.playlistLoader,e),c[f].push(m),typeof u[h]>"u"){const v=n.addRemoteTextTrack({id:h,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:h},!1).track;u[h]=v}}}a.on("error",Av[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:n,main:{mediaGroups:r},mediaTypes:{[t]:{groups:i,tracks:a}}}=e;for(const s in r[t]){i[s]||(i[s]=[]);for(const l in r[t][s]){const c=r[t][s][l];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const u=n.options_.vhs&&n.options_.vhs.captionServices||{};let d={label:l,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(u[d.instreamId]&&(d=Gi(d,u[d.instreamId])),d.default===void 0&&delete d.default,i[s].push(Gi({id:l},c)),typeof a[l]>"u"){const f=n.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;a[l]=f}}}}},wB=(t,e)=>{for(let n=0;n<t.length;n++)if(IA(e,t[n])||t[n].playlists&&wB(t[n].playlists,e))return!0;return!1},Zme=(t,e)=>n=>{const{mainPlaylistLoader:r,mediaTypes:{[t]:{groups:i}}}=e,a=r.media();if(!a)return null;let s=null;a.attributes[t]&&(s=i[a.attributes[t]]);const l=Object.keys(i);if(!s)if(t==="AUDIO"&&l.length>1&&ig(e.main))for(let c=0;c<l.length;c++){const u=i[l[c]];if(wB(u,a)){s=u;break}}else i.main?s=i.main:l.length===1&&(s=i[l[0]]);return typeof n>"u"?s:n===null||!s?null:s.filter(c=>c.id===n.id)[0]||null},e3e={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:n}}}=e;for(const r in n)if(n[r].enabled)return n[r];return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:n}}}=e;for(const r in n)if(n[r].mode==="showing"||n[r].mode==="hidden")return n[r];return null}},t3e=(t,{mediaTypes:e})=>()=>{const n=e[t].activeTrack();return n?e[t].activeGroup(n):null},n3e=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{Jme[u](u,t)});const{mediaTypes:e,mainPlaylistLoader:n,tech:r,vhs:i,segmentLoaders:{["AUDIO"]:a,main:s}}=t;["AUDIO","SUBTITLES"].forEach(u=>{e[u].activeGroup=Zme(u,t),e[u].activeTrack=e3e[u](u,t),e[u].onGroupChanged=Rme(u,t),e[u].onGroupChanging=Wme(u,t),e[u].onTrackChanged=Qme(u,t),e[u].getActiveGroup=t3e(u,t)});const l=e.AUDIO.activeGroup();if(l){const u=(l.filter(f=>f.default)[0]||l[0]).id;e.AUDIO.tracks[u].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(s.setAudio(!1),a.setAudio(!0)):s.setAudio(!0)}n.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanged())}),n.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanging())});const c=()=>{e.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",c),r.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),i.on("dispose",()=>{r.audioTracks().removeEventListener("change",c),r.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const u in e.AUDIO.tracks)r.audioTracks().addTrack(e.AUDIO.tracks[u])},r3e=()=>{const t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:bd,activeTrack:bd,getActiveGroup:bd,onGroupChanged:bd,onTrackChanged:bd,lastTrack_:null,logger_:Wl(`MediaGroups[${e}]`)}}),t};class SB{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Qo(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(n=>[n.ID,n])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class i3e extends Dt.EventTarget{constructor(e,n){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new SB,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Wl("Content Steering"),this.xhr_=e,this.getBandwidth_=n}assignTagProperties(e,n){this.manifestType_=n.serverUri?"HLS":"DASH";const r=n.serverUri||n.serverURL;if(!r){this.logger_(`steering manifest URL is ${r}, cannot request steering manifest.`),this.trigger("error");return}if(r.startsWith("data:")){this.decodeDataUriManifest_(r.substring(r.indexOf(",")+1));return}this.steeringManifest.reloadUri=Qo(e,r),this.defaultPathway=n.pathwayId||n.defaultServiceLocation,this.queryBeforeStart=n.queryBeforeStart,this.proxyServerUrl_=n.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const n=this.steeringManifest.reloadUri;if(!n)return;const r=e?n:this.getRequestURI(n);if(!r){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}this.request_=this.xhr_({uri:r,requestType:"content-steering-manifest"},(i,a)=>{if(i){if(a.status===410){this.logger_(`manifest request 410 ${i}.`),this.logger_(`There will be no more content steering requests to ${r} this session.`),this.excludedSteeringManifestURLs.add(r);return}if(a.status===429){const l=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${i}.`),this.logger_(`content steering will retry in ${l} seconds.`),this.startTTLTimeout_(parseInt(l,10));return}this.logger_(`manifest failed to load ${i}.`),this.startTTLTimeout_();return}const s=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(s),this.startTTLTimeout_()})}setProxyServerUrl_(e){const n=new Ge.URL(e),r=new Ge.URL(this.proxyServerUrl_);return r.searchParams.set("url",encodeURI(n.toString())),this.setSteeringParams_(r.toString())}decodeDataUriManifest_(e){const n=JSON.parse(Ge.atob(e));this.assignSteeringProperties_(n)}setSteeringParams_(e){const n=new Ge.URL(e),r=this.getPathway(),i=this.getBandwidth_();if(r){const a=`_${this.manifestType_}_pathway`;n.searchParams.set(a,r)}if(i){const a=`_${this.manifestType_}_throughput`;n.searchParams.set(a,i)}return n.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const r=(i=>{for(const a of i)if(this.availablePathways_.has(a))return a;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==r&&(this.currentPathway=r,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const n=i=>this.excludedSteeringManifestURLs.has(i);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!n(i))return i}const r=this.setSteeringParams_(e);return n(r)?null:r}startTTLTimeout_(e=this.steeringManifest.ttl){const n=e*1e3;this.ttlTimeout_=Ge.setTimeout(()=>{this.requestSteeringManifest()},n)}clearTTLTimeout_(){Ge.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new SB}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,n){return!n&&this.steeringManifest.reloadUri||n&&(Qo(e,n.serverURL)!==this.steeringManifest.reloadUri||n.defaultServiceLocation!==this.defaultPathway||n.queryBeforeStart!==this.queryBeforeStart||n.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const a3e=10;let yd;const s3e=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],o3e=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},l3e=function({currentPlaylist:t,buffered:e,currentTime:n,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:s,bufferBasedABR:l,log:c}){if(!r)return Dt.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${t&&t.id||"null"} -> ${r.id}`;if(!t)return c(`${u} as current playlist is not set`),!0;if(r.id===t.id)return!1;const d=!!ih(e,n).length;if(!t.endList)return!d&&typeof t.partTargetDuration=="number"?(c(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${u} as current playlist is live`),!0);const f=SA(e,n),h=l?Fs.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Fs.MAX_BUFFER_LOW_WATER_LINE;if(s<h)return c(`${u} as duration < max low water line (${s} < ${h})`),!0;const m=r.attributes.BANDWIDTH,g=t.attributes.BANDWIDTH;if(m<g&&(!l||f<a)){let v=`${u} as next bandwidth < current bandwidth (${m} < ${g})`;return l&&(v+=` and forwardBuffer < bufferHighWaterLine (${f} < ${a})`),c(v),!0}if((!l||m>g)&&f>=i){let v=`${u} as forwardBuffer >= bufferLowWaterLine (${f} >= ${i})`;return l&&(v+=` and next bandwidth > current bandwidth (${m} > ${g})`),c(v),!0}return c(`not ${u} as no switching criteria met`),!1};class c3e extends Dt.EventTarget{constructor(e){super();const{src:n,withCredentials:r,tech:i,bandwidth:a,externVhs:s,useCueTags:l,playlistExclusionDuration:c,enableLowInitialPlaylist:u,sourceType:d,cacheEncryptionKeys:f,bufferBasedABR:h,leastPixelDiffSelector:m,captionServices:g}=e;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:v}=e;(v===null||typeof v>"u")&&(v=1/0),yd=s,this.bufferBasedABR=!!h,this.leastPixelDiffSelector=!!m,this.withCredentials=r,this.tech_=i,this.vhs_=i.vhs,this.sourceType_=d,this.useCueTags_=l,this.playlistExclusionDuration=c,this.maxPlaylistRetries=v,this.enableLowInitialPlaylist=u,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:r,maxPlaylistRetries:v,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=r3e(),this.mediaSource=new Ge.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=lo(),this.hasPlayed_=!1,this.syncController_=new zme(e),this.segmentMetadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Xme,this.sourceUpdater_=new gB(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Yme,this.keyStatusMap_=new Map;const A={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:g,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:a,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:f,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new PA(n,this.vhs_,Gi(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new oh(n,this.vhs_,Gi(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new VA(Gi(A,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new VA(Gi(A,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Ume(Gi(A,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((w,T)=>{function C(){i.off("vttjserror",_),w()}function _(){i.off("vttjsloaded",C),T()}i.one("vttjsloaded",C),i.one("vttjserror",_),i.addWebVttScript_()})}),e);const S=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new i3e(this.vhs_.xhr,S),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),s3e.forEach(w=>{this[w+"_"]=o3e.bind(this,w)}),this.logger_=Wl("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const x=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(x,()=>{const w=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-w,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return e===-1||n===-1?-1:e+n}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,e)}switchMedia_(e,n,r){const i=this.media(),a=i&&(i.id||i.uri),s=e&&(e.id||e.uri);a&&a!==s&&(this.logger_(`switch media ${a} -> ${s} from ${n}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${n}`})),this.mainPlaylistLoader_.media(e,r)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const n=this.mediaTypes_[e],r=n?n.activeGroup():null,i=this.contentSteeringController_.getPathway();if(r&&i){const s=(r.length?r[0].playlists:r.playlists).filter(l=>l.attributes.serviceLocation===i);s.length&&this.mediaTypes_[e].activePlaylistLoader.media(s[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=Ge.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Ge.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),n=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return n;const r=e.mediaGroups.AUDIO,i=Object.keys(r);let a;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)a=this.mediaTypes_.AUDIO.activeTrack();else{const l=r.main||i.length&&r[i[0]];for(const c in l)if(l[c].default){a={label:c};break}}if(!a)return n;const s=[];for(const l in r)if(r[l][a.label]){const c=r[l][a.label];if(c.playlists&&c.playlists.length)s.push.apply(s,c.playlists);else if(c.uri)s.push(c);else if(e.playlists.length)for(let u=0;u<e.playlists.length;u++){const d=e.playlists[u];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===l&&s.push(d)}}return s.length?s:n}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),n=e.targetDuration*1.5*1e3;EA(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),n3e({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let n;if(this.enableLowInitialPlaylist&&(n=this.selectInitialPlaylist()),n||(n=this.selectPlaylist()),!n||!this.shouldSwitchToMedia_(n)||(this.initialMedia_=n,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),n=e.targetDuration*1.5*1e3;EA(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,n){const r=e.mediaGroups||{};let i=!0;const a=Object.keys(r.AUDIO);for(const s in r.AUDIO)for(const l in r.AUDIO[s])r.AUDIO[s][l].uri||(i=!1);i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(r.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),yd.Playlist.isAes(n)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),a.length&&Object.keys(r.AUDIO[a[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const n=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,r=this.tech_.currentTime(),i=this.bufferLowWaterLine(),a=this.bufferHighWaterLine(),s=this.tech_.buffered();return l3e({buffered:s,currentTime:r,currentPlaylist:n,nextPlaylist:e,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const n=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:n.playlist,error:n})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",n=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:a3e}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const n=this.getCodecsOrExclude_();n&&this.sourceUpdater_.addOrChangeSourceBuffers(n)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const n=this.seekable();if(!n.length)return!1;const r=n.end(0);let i=r;if(e.start){const a=e.start.timeOffset;a<0?i=Math.max(r+a,n.start(0)):i=Math.min(r,a)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,n=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const n=this.duration();e[e.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const r=this.syncController_.getExpiredTime(e,this.duration());if(r===null)return!1;const i=yd.Playlist.playlistEnd(e,r),a=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-a<=xu;const l=s.end(s.length-1);return l-a<=xu&&i-l<=xu}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:n={},playlistExclusionDuration:r}){if(e=e||this.mainPlaylistLoader_.media(),r=r||n.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=n,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const i=this.mainPlaylistLoader_.main.playlists,a=i.filter(pv),s=a.length===1&&a[0]===e;if(i.length===1&&r!==1/0)return Dt.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(s);if(s){if(this.main().contentSteering){const g=this.pathwayAttribute_(e),v=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(g),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(g)},v);return}let m=!1;i.forEach(g=>{if(g===e)return;const v=g.excludeUntil;typeof v<"u"&&v!==1/0&&(m=!0,delete g.excludeUntil)}),m&&(Dt.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;e.playlistErrors_>this.maxPlaylistRetries?l=1/0:l=Date.now()+r*1e3,e.excludeUntil=l,n.reason&&(e.lastExcludeReason_=n.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=n.internal?this.logger_:Dt.log.warn,d=n.message?" "+n.message:"";u(`${n.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${d} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const f=c.targetDuration/2*1e3||5*1e3,h=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=f;return this.switchMedia_(c,"exclude",s||h)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,n){const r=[],i=e==="all";(i||e==="main")&&r.push(this.mainPlaylistLoader_);const a=[];(i||e==="audio")&&a.push("AUDIO"),(i||e==="subtitle")&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(s=>{const l=this.mediaTypes_[s]&&this.mediaTypes_[s].activePlaylistLoader;l&&r.push(l)}),["main","audio","subtitle"].forEach(s=>{const l=this[`${s}SegmentLoader_`];l&&(e===s||e==="all")&&r.push(l)}),r.forEach(s=>n.forEach(l=>{typeof s[l]=="function"&&s[l]()}))}setCurrentTime(e){const n=ih(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(n&&n.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:yd.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let n=this.mainPlaylistLoader_.media();if(!n)return;let r=this.syncController_.getExpiredTime(n,this.duration());if(r===null)return;const i=this.mainPlaylistLoader_.main,a=yd.Playlist.seekable(n,r,yd.Playlist.liveEdgeDelay(i,n));if(a.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),r=this.syncController_.getExpiredTime(n,this.duration()),r===null||(e=yd.Playlist.seekable(n,r,yd.Playlist.liveEdgeDelay(i,n)),e.length===0)))return;let s,l;this.seekable_&&this.seekable_.length&&(s=this.seekable_.end(0),l=this.seekable_.start(0)),e?e.start(0)>a.end(0)||a.start(0)>e.end(0)?this.seekable_=a:this.seekable_=lo([[e.start(0)>a.start(0)?e.start(0):a.start(0),e.end(0)<a.end(0)?e.end(0):a.end(0)]]):this.seekable_=a,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===s&&this.seekable_.start(0)===l)&&(this.logger_(`seekable updated [${gL(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}const n=this.tech_.buffered();let r=yd.Playlist.duration(this.mainPlaylistLoader_.media());n.length>0&&(r=Math.max(r,n.end(n.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const n=this.mediaTypes_[e].groups;for(const r in n)n[r].forEach(i=>{i.playlistLoader&&i.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),r=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!r)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},n=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const r=sg(this.main(),n),i={},a=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(i.video=r.video||e.main.videoCodec||Bfe),e.main.isMuxed&&(i.video+=`,${r.audio||e.main.audioCodec||fP}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||a)&&(i.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||fP,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!i.audio&&!i.video){this.excludePlaylist({playlistToExclude:n,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const s=(u,d)=>u?A4(d):Rb(d),l={};let c;if(["video","audio"].forEach(function(u){if(i.hasOwnProperty(u)&&!s(e[u].isFmp4,i[u])){const d=e[u].isFmp4?"browser":"muxer";l[d]=l[d]||[],l[d].push(i[u]),u==="audio"&&(c=d)}}),a&&c&&n.attributes.AUDIO){const u=n.attributes.AUDIO;this.main().playlists.forEach(d=>{(d.attributes&&d.attributes.AUDIO)===u&&d!==n&&(d.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${c} does not support codec(s): "${i.audio}"`)}if(Object.keys(l).length){const u=Object.keys(l).reduce((d,f)=>(d&&(d+=", "),d+=`${f} does not support codec(s): "${l[f].join(",")}"`,d),"")+".";this.excludePlaylist({playlistToExclude:n,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(d=>{const f=(pu(this.sourceUpdater_.codecs[d]||"")[0]||{}).type,h=(pu(i[d]||"")[0]||{}).type;f&&h&&f.toLowerCase()!==h.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[d]}" -> "${i[d]}"`)}),u.length){this.excludePlaylist({playlistToExclude:n,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return i}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const n=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}excludeUnsupportedVariants_(){const e=this.main().playlists,n=[];Object.keys(e).forEach(r=>{const i=e[r];if(n.indexOf(i.id)!==-1)return;n.push(i.id);const a=sg(this.main,i),s=[];a.audio&&!Rb(a.audio)&&!A4(a.audio)&&s.push(`audio codec ${a.audio}`),a.video&&!Rb(a.video)&&!A4(a.video)&&s.push(`video codec ${a.video}`),a.text&&a.text==="stpp.ttml.im1t"&&s.push(`text codec ${a.text}`),s.length&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: ${s.join(", ")}`))})}excludeIncompatibleVariants_(e){const n=[],r=this.main().playlists,i=mv(pu(e)),a=tB(i),s=i.video&&pu(i.video)[0]||null,l=i.audio&&pu(i.audio)[0]||null;Object.keys(r).forEach(c=>{const u=r[c];if(n.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;n.push(u.id);const d=[],f=sg(this.mainPlaylistLoader_.main,u),h=tB(f);if(!(!f.audio&&!f.video)){if(h!==a&&d.push(`codec count "${h}" !== "${a}"`),!this.sourceUpdater_.canChangeType()){const m=f.video&&pu(f.video)[0]||null,g=f.audio&&pu(f.audio)[0]||null;m&&s&&m.type.toLowerCase()!==s.type.toLowerCase()&&d.push(`video codec "${m.type}" !== "${s.type}"`),g&&l&&g.type.toLowerCase()!==l.type.toLowerCase()&&d.push(`audio codec "${g.type}" !== "${l.type}"`)}d.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${d.join(" && ")}`))}})}updateAdCues_(e){let n=0;const r=this.seekable();r.length&&(n=r.start(0)),$me(e,this.cueTagsTrack_,n)}goalBufferLength(){const e=this.tech_.currentTime(),n=Fs.GOAL_BUFFER_LENGTH,r=Fs.GOAL_BUFFER_LENGTH_RATE,i=Math.max(n,Fs.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+e*r,i)}bufferLowWaterLine(){const e=this.tech_.currentTime(),n=Fs.BUFFER_LOW_WATER_LINE,r=Fs.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(n,Fs.MAX_BUFFER_LOW_WATER_LINE),a=Math.max(n,Fs.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+e*r,this.bufferBasedABR?a:i)}bufferHighWaterLine(){return Fs.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){sB(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Sme({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,n,r){const i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();sB(this.inbandTextTracks_,e,this.tech_),yme({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:i,videoDuration:r})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const n of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(n));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const i=this.contentSteeringController_.getAvailablePathways(),a=[];for(const s of e.playlists){const l=s.attributes.serviceLocation;if(l&&(a.push(l),!i.has(l)))return!0}return!!(!a.length&&i.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const r=this.main().playlists,i=new Set;let a=!1;Object.keys(r).forEach(s=>{const l=r[s],c=this.pathwayAttribute_(l),u=c&&e!==c;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!u&&(delete l.excludeUntil,delete l.lastExcludeReason_,a=!0);const f=!l.excludeUntil&&l.excludeUntil!==1/0;!i.has(l.id)&&u&&f&&(i.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(s=>{const l=this.mediaTypes_[s];if(l.activePlaylistLoader){const c=l.activePlaylistLoader.media_;c&&c.attributes.serviceLocation!==e&&(a=!0)}}),a&&this.changeSegmentPathway_()}handlePathwayClones_(){const n=this.main().playlists,r=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(r&&r.size||i&&i.size){for(const[s,l]of r.entries())i.get(s)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(s));for(const[s,l]of i.entries()){const c=r.get(s);if(!c){n.filter(d=>d.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(d=>{this.mainPlaylistLoader_.addClonePathway(l,d)}),this.contentSteeringController_.addAvailablePathway(s);continue}this.equalPathwayClones_(c,l)||(this.mainPlaylistLoader_.updateOrDeleteClone(l,!0),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,n){if(e["BASE-ID"]!==n["BASE-ID"]||e.ID!==n.ID||e["URI-REPLACEMENT"].HOST!==n["URI-REPLACEMENT"].HOST)return!1;const r=e["URI-REPLACEMENT"].PARAMS,i=n["URI-REPLACEMENT"].PARAMS;for(const a in r)if(r[a]!==i[a])return!1;for(const a in i)if(r[a]!==i[a])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const n="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(r=>{const i=this.mainPlaylistLoader_.getKeyIdSet(r);!i||!i.size||i.forEach(a=>{const s="usable",l=this.keyStatusMap_.has(a)&&this.keyStatusMap_.get(a)===s,c=r.lastExcludeReason_===n&&r.excludeUntil===1/0;l?l&&c&&(delete r.excludeUntil,delete r.lastExcludeReason_,this.logger_(`enabling playlist ${r.id} because key ID ${a} is ${s}`)):(r.excludeUntil!==1/0&&r.lastExcludeReason_!==n&&(r.excludeUntil=1/0,r.lastExcludeReason_=n,this.logger_(`excluding playlist ${r.id} because the key ID ${a} doesn't exist in the keyStatusMap or is not ${s}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(r=>{const i=r&&r.attributes&&r.attributes.RESOLUTION&&r.attributes.RESOLUTION.height<720,a=r.excludeUntil===1/0&&r.lastExcludeReason_===n;i&&a&&(delete r.excludeUntil,Dt.log.warn(`enabling non-HD playlist ${r.id} because all playlists were excluded due to ${n} key IDs`))})}addKeyStatus_(e,n){const a=(typeof e=="string"?e:Bme(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${n}' with key ID ${a} added to the keyStatusMap`),this.keyStatusMap_.set(a,n)}updatePlaylistByKeyStatus(e,n){this.addKeyStatus_(e,n),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const u3e=(t,e,n)=>r=>{const i=t.main.playlists[e],a=TA(i),s=pv(i);return typeof r>"u"?s:(r?delete i.disabled:i.disabled=!0,r!==s&&!a&&(n(i),r?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),r)};class d3e{constructor(e,n,r){const{playlistController_:i}=e,a=i.fastQualityChange_.bind(i);if(n.attributes){const s=n.attributes.RESOLUTION;this.width=s&&s.width,this.height=s&&s.height,this.bandwidth=n.attributes.BANDWIDTH,this.frameRate=n.attributes["FRAME-RATE"]}this.codecs=sg(i.main(),n),this.playlist=n,this.id=r,this.enabled=u3e(e.playlists,n.id,a)}}const f3e=function(t){t.representations=()=>{const e=t.playlistController_.main(),n=ig(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;return n?n.filter(r=>!TA(r)).map((r,i)=>new d3e(t,r,r.id)):[]}},xB=["seeking","seeked","pause","playing","error"];class h3e{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Wl("PlaybackWatcher"),this.logger_("initialize");const n=()=>this.monitorCurrentTime_(),r=()=>this.monitorCurrentTime_(),i=()=>this.techWaiting_(),a=()=>this.resetTimeUpdate_(),s=this.playlistController_,l=["main","subtitle","audio"],c={};l.forEach(d=>{c[d]={reset:()=>this.resetSegmentDownloads_(d),updateend:()=>this.checkSegmentDownloads_(d)},s[`${d}SegmentLoader_`].on("appendsdone",c[d].updateend),s[`${d}SegmentLoader_`].on("playlistupdate",c[d].reset),this.tech_.on(["seeked","seeking"],c[d].reset)});const u=d=>{["main","audio"].forEach(f=>{s[`${f}SegmentLoader_`][d]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",i),this.tech_.on(xB,a),this.tech_.on("canplay",r),this.tech_.one("play",n),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",i),this.tech_.off(xB,a),this.tech_.off("canplay",r),this.tech_.off("play",n),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(d=>{s[`${d}SegmentLoader_`].off("appendsdone",c[d].updateend),s[`${d}SegmentLoader_`].off("playlistupdate",c[d].reset),this.tech_.off(["seeked","seeking"],c[d].reset)}),this.checkCurrentTimeTimeout_&&Ge.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Ge.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Ge.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const n=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=n.buffered_()}checkSegmentDownloads_(e){const n=this.playlistController_,r=n[`${e}SegmentLoader_`],i=r.buffered_(),a=age(this[`${e}Buffered_`],i);if(this[`${e}Buffered_`]=i,a){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:r.playlist_&&r.playlist_.id,buffered:m1(i)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&n.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),n=this.tech_.buffered();if(this.lastRecordedTime===e&&(!n.length||e+xu>=n.end(n.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const n=this.seekable(),r=this.tech_.currentTime(),i=this.afterSeekableWindow_(n,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let a;if(i&&(a=n.end(n.length-1)),this.beforeSeekableWindow_(n,r)){const g=n.start(0);a=g+(g===n.end(0)?0:xu)}if(typeof a<"u")return this.logger_(`Trying to seek outside of seekable at time ${r} with seekable range ${gL(n)}. Seeking to ${a}.`),this.tech_.setCurrentTime(a),!0;const s=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),c=s.audioBuffer?s.audioBuffered():null,u=s.videoBuffer?s.videoBuffered():null,d=this.media(),f=d.partTargetDuration?d.partTargetDuration:(d.targetDuration-Su)*2,h=[c,u];for(let g=0;g<h.length;g++){if(!h[g])continue;if(SA(h[g],r)<f)return!1}const m=hv(l,r);return m.length===0?!1:(a=m.start(0)+xu,this.logger_(`Buffered region starts (${m.start(0)}) just beyond seek point (${r}). Seeking to ${a}.`),this.tech_.setCurrentTime(a),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),n=this.tech_.buffered(),r=ih(n,e);if(r.length&&e+3<=r.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${r.start(0)} -> ${r.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),n=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,n)){const l=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${n}. Seeking to live point (seekable end) ${l}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(l),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const r=this.tech_.vhs.playlistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:n}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const s=hv(i,n);return s.length>0?(this.logger_(`Stopped at ${n} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(n),!0):!1}afterSeekableWindow_(e,n,r,i=!1){if(!e.length)return!1;let a=e.end(e.length-1)+xu;const s=!r.endList,l=typeof r.partTargetDuration=="number";return s&&(l||i)&&(a=e.end(e.length-1)+r.targetDuration*3),n>a}beforeSeekableWindow_(e,n){return!!(e.length&&e.start(0)>0&&n<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:n,currentTime:r}){if(!e)return;let i;if(e.length&&n.length){const a=ih(e,r-3),s=ih(e,r),l=ih(n,r);l.length&&!s.length&&a.length&&(i={start:a.end(0),end:l.end(0)})}else hv(e,r).length||(i=this.gapFromVideoUnderflow_(e,r));return i?(this.logger_(`Encountered a gap in video from ${i.start} to ${i.end}. Seeking to current time ${r}`),!0):!1}skipTheGap_(e){const n=this.tech_.buffered(),r=this.tech_.currentTime(),i=hv(n,r);this.resetTimeUpdate_(),!(i.length===0||r!==e)&&(this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",e,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+Su),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,n){const r=nge(e);for(let i=0;i<r.length;i++){const a=r.start(i),s=r.end(i);if(n-a<4&&n-a>2)return{start:a,end:s}}return null}}const p3e={errorInterval:30,getSource(t){const n=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return t(n)}},CB=function(t,e){let n=0,r=0;const i=Gi(p3e,e);t.ready(()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const a=function(){r&&t.currentTime(r)},s=function(d){d!=null&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",a),t.src(d),t.trigger({type:"usage",name:"vhs-error-reload"}),t.play())},l=function(){if(Date.now()-n<i.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){Dt.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return n=Date.now(),i.getSource.call(t,s)},c=function(){t.off("loadedmetadata",a),t.off("error",l),t.off("dispose",c)},u=function(d){c(),CB(t,d)};t.on("error",l),t.on("dispose",c),t.reloadSourceOnError=u},g3e=function(t){CB(this,t)};var TB="3.12.1",m3e="7.0.3",v3e="1.3.0",b3e="7.1.0",y3e="4.0.1";const Ba={PlaylistLoader:oh,Playlist:Jo,utils:Ige,STANDARD_PLAYLIST_SELECTOR:iB,INITIAL_PLAYLIST_SELECTOR:pme,lastBandwidthSelector:iB,movingAverageBandwidthSelector:fme,comparePlaylistBandwidth:BA,comparePlaylistResolution:dme,xhr:PL()};Object.keys(Fs).forEach(t=>{Object.defineProperty(Ba,t,{get(){return Dt.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),Fs[t]},set(e){if(Dt.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){Dt.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}Fs[t]=e}})});const EB="videojs-vhs",IB=function(t,e){const n=e.media();let r=-1;for(let i=0;i<t.length;i++)if(t[i].id===n.id){r=i;break}t.selectedIndex_=r,t.trigger({selectedIndex:r,type:"change"})},A3e=function(t,e){e.representations().forEach(n=>{t.addQualityLevel(n)}),IB(t,e.playlists)};Ba.canPlaySource=function(){return Dt.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const w3e=(t,e,n)=>{if(!t)return t;let r={};e&&e.attributes&&e.attributes.CODECS&&(r=mv(pu(e.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);const i=D2(r.video),a=D2(r.audio),s={};for(const l in t)s[l]={},a&&(s[l].audioContentType=a),i&&(s[l].videoContentType=i),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(s[l].pssh=e.contentProtection[l].pssh),typeof t[l]=="string"&&(s[l].url=t[l]);return Gi(t,s)},S3e=(t,e)=>t.reduce((n,r)=>{if(!r.contentProtection)return n;const i=e.reduce((a,s)=>{const l=r.contentProtection[s];return l&&l.pssh&&(a[s]={pssh:l.pssh}),a},{});return Object.keys(i).length&&n.push(i),n},[]),x3e=({player:t,sourceKeySystems:e,audioMedia:n,mainPlaylists:r})=>{if(!t.eme.initializeMediaKeys)return Promise.resolve();const i=n?r.concat([n]):r,a=S3e(i,Object.keys(e)),s=[],l=[];return a.forEach(c=>{l.push(new Promise((u,d)=>{t.tech_.one("keysessioncreated",u)})),s.push(new Promise((u,d)=>{t.eme.initializeMediaKeys({keySystems:c},f=>{if(f){d(f);return}u()})}))}),Promise.race([Promise.all(s),Promise.race(l)])},C3e=({player:t,sourceKeySystems:e,media:n,audioMedia:r})=>{const i=w3e(e,n,r);return i?(t.currentSource().keySystems=i,i&&!t.eme?(Dt.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},_B=()=>{if(!Ge.localStorage)return null;const t=Ge.localStorage.getItem(EB);if(!t)return null;try{return JSON.parse(t)}catch{return null}},T3e=t=>{if(!Ge.localStorage)return!1;let e=_B();e=e?Gi(e,t):t;try{Ge.localStorage.setItem(EB,JSON.stringify(e))}catch{return!1}return e},E3e=t=>t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t,DB=(t,e)=>{t._requestCallbackSet||(t._requestCallbackSet=new Set),t._requestCallbackSet.add(e)},OB=(t,e)=>{t._responseCallbackSet||(t._responseCallbackSet=new Set),t._responseCallbackSet.add(e)},NB=(t,e)=>{t._requestCallbackSet&&(t._requestCallbackSet.delete(e),t._requestCallbackSet.size||delete t._requestCallbackSet)},FB=(t,e)=>{t._responseCallbackSet&&(t._responseCallbackSet.delete(e),t._responseCallbackSet.size||delete t._responseCallbackSet)};Ba.supportsNativeHls=function(){if(!Sn||!Sn.createElement)return!1;const t=Sn.createElement("video");return Dt.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(n){return/maybe|probably/i.test(t.canPlayType(n))}):!1}(),Ba.supportsNativeDash=function(){return!Sn||!Sn.createElement||!Dt.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(Sn.createElement("video").canPlayType("application/dash+xml"))}(),Ba.supportsTypeNatively=t=>t==="hls"?Ba.supportsNativeHls:t==="dash"?Ba.supportsNativeDash:!1,Ba.isSupported=function(){return Dt.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Ba.xhr.onRequest=function(t){DB(Ba.xhr,t)},Ba.xhr.onResponse=function(t){OB(Ba.xhr,t)},Ba.xhr.offRequest=function(t){NB(Ba.xhr,t)},Ba.xhr.offResponse=function(t){FB(Ba.xhr,t)};const I3e=Dt.getComponent("Component");class PB extends I3e{constructor(e,n,r){if(super(n,r.vhs),typeof r.initialBandwidth=="number"&&(this.options_.bandwidth=r.initialBandwidth),this.logger_=Wl("VhsHandler"),n.options_&&n.options_.playerId){const i=Dt.getPlayer(n.options_.playerId);this.player_=i}if(this.tech_=n,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(Sn,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],i=>{const a=Sn.fullscreenElement||Sn.webkitFullscreenElement||Sn.mozFullScreenElement||Sn.msFullscreenElement;a&&a.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Gi(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const r=_B();r&&r.bandwidth&&(this.options_.bandwidth=r.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),r&&r.throughput&&(this.options_.throughput=r.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Fs.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Fs.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(r=>{typeof this.source_[r]<"u"&&(this.options_[r]=this.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const n=this.options_.customPixelRatio;typeof n=="number"&&n>=0&&(this.customPixelRatio=n)}setOptions(e={}){this.setOptions_(e)}src(e,n){if(!e)return;this.setOptions_(),this.options_.src=E3e(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Ba,this.options_.sourceType=hP(n),this.options_.seekTo=a=>{this.tech_.setCurrentTime(a)},this.playlistController_=new c3e(this.options_);const r=Gi({liveRangeSafeTimeDelta:xu},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new h3e(r),this.playlistController_.on("error",()=>{const a=Dt.players[this.tech_.options_.playerId];let s=this.playlistController_.error;typeof s=="object"&&!s.code?s.code=3:typeof s=="string"&&(s={message:s,code:3}),a.error(s)});const i=this.options_.bufferBasedABR?Ba.movingAverageBandwidthSelector(.55):Ba.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):i.bind(this),this.playlistController_.selectInitialPlaylist=Ba.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(a){this.playlistController_.selectPlaylist=a.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(a){this.playlistController_.mainSegmentLoader_.throughput.rate=a,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let a=this.playlistController_.mainSegmentLoader_.bandwidth;const s=Ge.navigator.connection||Ge.navigator.mozConnection||Ge.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&s){const c=s.downlink*1e3*1e3;c>=l&&a>=l?a=Math.max(a,c):a=c}return a},set(a){this.playlistController_.mainSegmentLoader_.bandwidth=a,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const a=1/(this.bandwidth||1);let s;return this.throughput>0?s=1/this.throughput:s=0,Math.floor(1/(a+s))},set(){Dt.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>m1(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>m1(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&T3e({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{f3e(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=Ge.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),x3e({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(n=>{this.logger_("error while creating EME key session",n),this.player_.error({message:"Failed to initialize media keys for EME",code:3,metadata:{errorType:Dt.Error.EMEKeySessionCreationError}})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,n=C3e({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",r=>{this.playlistController_.updatePlaylistByKeyStatus(r.keyId,r.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!n){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=Dt.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{A3e(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{IB(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":TB,"mux.js":m3e,"mpd-parser":v3e,"m3u8-parser":b3e,"aes-decrypter":y3e}}version(){return this.constructor.version()}canChangeType(){return gB.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&Ge.URL.revokeObjectURL&&(Ge.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,n){return kge({playlist:this.playlistController_.media(),time:e,callback:n})}seekToProgramTime(e,n,r=!0,i=2){return VL({programTime:e,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})}setupXhrHooks_(){this.xhr.onRequest=e=>{DB(this.xhr,e)},this.xhr.onResponse=e=>{OB(this.xhr,e)},this.xhr.offRequest=e=>{NB(this.xhr,e)},this.xhr.offResponse=e=>{FB(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const wv={name:"videojs-http-streaming",VERSION:TB,canHandleSource(t,e={}){const n=Gi(Dt.options,e);return wv.canPlayType(t.type,n)},handleSource(t,e,n={}){const r=Gi(Dt.options,n);return e.vhs=new PB(t,e,r),e.vhs.xhr=PL(),e.vhs.setupXhrHooks_(),e.vhs.src(t.src,t.type),e.vhs},canPlayType(t,e){const n=hP(t);if(!n)return"";const r=wv.getOverrideNative(e);return!Ba.supportsTypeNatively(n)||r?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t,n=!(Dt.browser.IS_ANY_SAFARI||Dt.browser.IS_IOS),{overrideNative:r=n}=e;return r}};A4("avc1.4d400d,mp4a.40.2")&&Dt.getTech("Html5").registerSourceHandler(wv,0),Dt.VhsHandler=PB,Dt.VhsSourceHandler=wv,Dt.Vhs=Ba,Dt.use||Dt.registerComponent("Vhs",Ba),Dt.options.vhs=Dt.options.vhs||{},(!Dt.getPlugin||!Dt.getPlugin("reloadSourceOnError"))&&Dt.registerPlugin("reloadSourceOnError",g3e);const kB=t=>{const{userTrainingSaveData:e,updateUserTraining:n}=vr(),r=N.useRef(null),i=N.useRef(null),{options:a,onReady:s,currentItem:l}=t,[c,u]=N.useState(!1),d=m=>{if(e!==null){const g=e==null?void 0:e.findIndex(v=>(v==null?void 0:v.fieldId)===(l==null?void 0:l.uuid));if(g>=0){const v=m.target;e[g].seenTime=v.currentTime}}},f=m=>{const g=[...e],v=g==null?void 0:g.findIndex(A=>(A==null?void 0:A.fieldId)===(m==null?void 0:m.uuid));v>=0&&(g[v]={...e[v],isSeen:!0},n(g),h("Ended"))};N.useEffect(()=>{if(i.current){const m=i.current;m.autoplay(a.autoplay),m.src(a.sources)}else{const m=r.current;if(!m)return;const g=i.current=Dt(m,a,()=>{Dt.log("player is ready"),s&&s(g)})}},[a,r]);const h=m=>{const g=i.current,v=e!==null?e.findIndex(A=>(A==null?void 0:A.fieldId)===(l==null?void 0:l.uuid)):-1;v>=0&&e[v].logs.push({action:m,videoTime:e[v].seenTime,totalTime:g.duration(),timeState:new Date}),n(e)};return N.useEffect(()=>{if(!c&&e!==null){const m=e.findIndex(g=>(g==null?void 0:g.fieldId)===(l==null?void 0:l.uuid));m>=0&&(u(!0),i.current.currentTime(e[m].seenTime))}},[e]),N.useEffect(()=>{const m=i.current;return()=>{m&&(m.dispose(),i.current=null)}},[i]),o.jsx("div",{"data-vjs-player":!0,children:o.jsx("video",{onPause:()=>{h("Pause")},onPlay:()=>{h("Play")},onEnded:()=>{f(l)},onTimeUpdate:d,ref:r,className:"video-js vjs-big-play-centered"})})},_3e=t=>{var w,T,C,_,E;const{field:e}=t,n=N.useRef(null),{userSelectedLanguage:r}=on(),{isPreview:i,media:a}=Zt(),s=(w=a==null?void 0:a.video)!=null&&w.MediaVideo?(T=a==null?void 0:a.video)==null?void 0:T.MediaVideo:()=>o.jsx(o.Fragment,{}),l=O=>{n.current=O,O.on("waiting",()=>{Dt.log("player is waiting")}),O.on("dispose",()=>{Dt.log("player will dispose")})},[c,u]=N.useState(!1),[d,f]=N.useState(!1),h=()=>{f(!0)},m=()=>{f(!1)},g=O=>{u(O)},v=()=>{u(!1)},A=N.useCallback(O=>o.jsx(kB,{options:{autoplay:!1,controls:!0,responsive:!0,fluid:!0,sources:[{src:O}]},currentItem:e,onReady:l,onUpdate:()=>{}}),[e==null?void 0:e.media_file_id]),S=N.useCallback(O=>o.jsx(s,{mediaId:O,alt:""}),[e==null?void 0:e.media_file_id]),x=o.jsxs("div",{onMouseOver:h,onMouseOut:m,children:[!i&&d&&o.jsx(jr,{handleFieldSettingsSidebar:g,...t}),o.jsx("div",{className:i?"py-4 px-2":"field-form-builder py-4 px-2",children:o.jsx("div",{className:"field",children:o.jsx("div",{className:"grid",children:o.jsx("div",{className:"col-12",children:o.jsxs("div",{className:"mt-3",children:[o.jsxs("label",{className:"flex font-medium mb-3 text-700 text-2xl",children:[" ",(C=e==null?void 0:e.title)==null?void 0:C[r==null?void 0:r.type]," -"," ",e==null?void 0:e.videoDuration]}),(e==null?void 0:e.isExternalSource)===!0&&o.jsx(o.Fragment,{children:(e==null?void 0:e.media_url)&&A((_=e==null?void 0:e.media_url)==null?void 0:_[r==null?void 0:r.type])}),(e==null?void 0:e.isExternalSource)===!1?(e==null?void 0:e.media_file_id)!==void 0&&(e==null?void 0:e.media_file_id)!==null?o.jsx(o.Fragment,{children:S(e==null?void 0:e.media_file_id)}):o.jsx(o.Fragment,{children:(e==null?void 0:e.media_url)&&A((E=e==null?void 0:e.media_url)==null?void 0:E[r==null?void 0:r.type])}):o.jsx(o.Fragment,{})]})})})})})]});return o.jsxs(o.Fragment,{children:[o.jsx(N1e,{visibilty:c,closeSettingFieldSidebar:v,...t}),o.jsx(wi,{...t,fieldWrap:x})]})},D3e=t=>{const{isPreview:e}=Zt(),[n,r]=N.useState(!1),i=()=>{r(!0)},a=()=>{r(!1)},s=o.jsxs("div",{onMouseOver:i,onMouseOut:a,children:[!e&&n&&o.jsx(jr,{handleFieldSettingsSidebar:()=>{},...t}),o.jsx("div",{className:e?"":"field-form-builder",children:o.jsx("div",{className:"grid",children:o.jsx("div",{className:"col-12",children:o.jsx("div",{className:"hr-divider"})})})})]});return o.jsx(o.Fragment,{children:o.jsx(wi,{...t,fieldWrap:s})})},O3e=t=>{var Y,ge,ie,J,Q,se,be,Ce,Te,ye,Ae;const{isPreview:e,isAdmin:n,isRenderView:r}=Zt(),{field:i,fieldIndex:a,row:s}=t,{task_status:l,taskRegisterData:c,updateTaskRegisterData:u,updateTaskProgressValue:d,userTaskSubmitFormData:f,updateUserFormDataSubmit:h,TASK_PUBLISHED:m}=vr(),{userSelectedLanguage:g}=on(),[v,A]=N.useState(!1),[S,x]=N.useState(""),[w,T]=N.useState(0),[C,_]=N.useState(!1),[E,O]=N.useState(!1),P=()=>{O(!0)},B=()=>{O(!1)},M=re=>new Date(re),H=()=>{var re,U,Z;if(s!=null&&s.rowIsRepeatable){if(s!=null&&s.repeatableFields){const K=[...s.repeatableFields],de=Tt.findIndex(K,function(Ee){return Ee.uuid===(i==null?void 0:i.uuid)});de>=0&&K[de].fieldData?x(K[de].fieldData):x("")}}else{const K=f;if(K!=null&&K.length){for(const de of K)if(de.fieldId===t.field.uuid&&((re=de==null?void 0:de.postData[0])==null?void 0:re.postValue)!==""&&((U=de==null?void 0:de.postData[0])!=null&&U.postValue)){x(M((Z=de==null?void 0:de.postData[0])==null?void 0:Z.postValue));break}}}_(!0)};N.useEffect(()=>{C||H();const re=Xt.addListener("clearRepeatableFields",de=>{de===(s==null?void 0:s.uuid)&&(x(""),T(0),i.isValid=0)}),U=Xt.addListener("onSubmitUserForm",()=>{var de;(de=i==null?void 0:i.attributes)!=null&&de.required?S?i.isValid=1:i.isValid=0:i.isValid=1}),Z=Xt.addListener("OnInvalidFieldCatch",de=>{i.uuid===(de==null?void 0:de.fieldId)?T(1):T(0)}),K=Xt.addListener("OnGetFieldValue",de=>{var me;const Ee=(me=de==null?void 0:de.repeatableColumn)==null?void 0:me.filter(pe=>(pe==null?void 0:pe.fieldUuid)===(i==null?void 0:i.uuid));Ee!=null&&Ee.length});return()=>{U.remove(),Z.remove(),re.remove(),K.remove()}});const k=re=>{A(re)},z=()=>{A(!1)},ue=re=>{var K,de;x(re.target.value);const U=f,Z=Tt.cloneDeep(c);if(U!==null){if((K=re==null?void 0:re.target)!=null&&K.value){if(Z[i==null?void 0:i.uuid]=(de=re==null?void 0:re.target)==null?void 0:de.value,(U==null?void 0:U.length)>0)for(const Ee of U)Ee.fieldId===t.field.uuid&&(Ee.postData[0]={postValue:re.target.value})}else if(delete Z[i==null?void 0:i.uuid],(U==null?void 0:U.length)>0)for(const Ee of U)Ee.fieldId===t.field.uuid&&(Ee.postData[0]={postValue:""})}if(!(s!=null&&s.rowIsRepeatable)){u(Z);const Ee=Object.keys(Z).length;d(Ee)}},fe=(re,U)=>{var Z;if(x(U),(f==null?void 0:f.length)>0){const K=[...f],de=Tt.findIndex(K,function(me){return me.rowId===(s==null?void 0:s.uuid)});let Ee=(Z=f[de])==null?void 0:Z.repeatableFields;Ee={...Ee,[re.uuid]:U},K[de]={...K[de],repeatableFields:Ee},h(K),U!==""?re.isValid=1:re.isValid=0}},ne=new Date(i==null?void 0:i.minDate),R=new Date(i==null?void 0:i.maxDate),ae=o.jsxs("div",{onMouseOver:P,onMouseOut:B,children:[!r&&!e&&E&&o.jsx(jr,{type:"",handleFieldSettingsSidebar:k,...t}),o.jsxs("div",{className:`field ${e?" ":" builder-element-wrapper "}${(i==null?void 0:i.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:"col-12 ",children:[(i==null?void 0:i.showHeaderText)&&o.jsx("h6",{children:(Y=i==null?void 0:i.headerText)==null?void 0:Y[g==null?void 0:g.type]}),(i==null?void 0:i.showLabel)&&o.jsxs("label",{htmlFor:a,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(ia,{update:function(){throw new Error("Function not implemented.")},value:{fieldId:void 0,uuid:void 0},...t}),((ge=i==null?void 0:i.attributes)==null?void 0:ge.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e?o.jsx(o.Fragment,{children:(ie=i==null?void 0:i.label)==null?void 0:ie[g==null?void 0:g.type]}):o.jsx(Zi,{...t}),(i==null?void 0:i.showToolTip)&&o.jsx("span",{className:"ml-3",children:(i==null?void 0:i.showToolTip)&&o.jsx(Mi,{message:(J=i==null?void 0:i.toolTip)==null?void 0:J[g==null?void 0:g.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(i==null?void 0:i.iconAlignment),children:[(i==null?void 0:i.showIcon)&&o.jsx("i",{className:"pi pi-"+((se=(Q=i==null?void 0:i.icon)==null?void 0:Q.properties)==null?void 0:se.name)}),o.jsx(J1,{readOnlyInput:!0,numberOfMonths:i==null?void 0:i.noOfMonths,selectionMode:(i==null?void 0:i.dateRange)||"single",view:(i==null?void 0:i.calenderView)||!1,showButtonBar:(i==null?void 0:i.isTodayBtn)||!1,showIcon:(i==null?void 0:i.isIcon)||!1,id:i==null?void 0:i.uuid,dateFormat:i==null?void 0:i.dateFormat,placeholder:(be=i==null?void 0:i.placeholder)==null?void 0:be[g==null?void 0:g.type],value:S,onFocus:()=>T(1),onChange:re=>{s!=null&&s.rowIsRepeatable?fe(i,re.target.value):ue(re)},minDate:ne,maxDate:R,className:w===1&&((Ce=i==null?void 0:i.attributes)!=null&&Ce.required)?S?"valid":"invalid":"valid'",disabled:l===m})]}),o.jsx("div",{children:((Te=i==null?void 0:i.attributes)==null?void 0:Te.required)&&o.jsx("small",{className:"error",children:w===1&&!S?(ye=i==null?void 0:i.validationMesssage)==null?void 0:ye.english:""})}),o.jsx("div",{children:(i==null?void 0:i.showHelperText)&&o.jsx("small",{children:(Ae=i==null?void 0:i.helperText)==null?void 0:Ae[g==null?void 0:g.type]})})]})]})}),n&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[v===!0&&o.jsx(Xi,{visibilty:v,closeSettingFieldSidebar:z,...t},i==null?void 0:i.uuid),o.jsx(wi,{...t,fieldWrap:ae})]})},N3e=t=>{var be,Ce,Te,ye,Ae,re,U,Z;const e=N.useRef(null),{task_status:n,taskRegisterData:r,updateTaskRegisterData:i,updateTaskProgressValue:a,updateUserFormDataSubmit:s,userTaskSubmitFormData:l,onSetValuetoPostDataHook:c,TASK_PUBLISHED:u}=vr(),{userSelectedLanguage:d,fieldSettingUpdate:f}=on(),{field:h,fieldIndex:m,columnIndex:g,sectionIndex:v,rowIndex:A,pageIndex:S,row:x}=t,{isAdmin:w,isPreview:T,isRenderView:C}=Zt(),[_,E]=N.useState(!1),[O,P]=N.useState(0),[B,M]=N.useState(!1),[H,k]=N.useState(null),[z,ue]=N.useState(!1),fe=()=>{ue(!0)},ne=()=>{ue(!1)},R=()=>{var K;(K=e==null?void 0:e.current)==null||K.clear(),h.isValid=0,f(S,v,A,g,m,h),k(null),c(t,h,"")},ae=()=>{var de,Ee,me;const K=l;if((K==null?void 0:K.length)>0)for(const pe of K)pe.fieldId===t.field.uuid&&((de=pe==null?void 0:pe.postData[0])!=null&&de.postValue&&((Ee=pe==null?void 0:pe.postData[0])==null?void 0:Ee.postValue)!==""&&(k((me=pe==null?void 0:pe.postData[0])==null?void 0:me.postValue),M(!0)),h.isValid=1);M(!0)},Y=()=>{var K,de,Ee,me;if(l!=null&&l.length){const pe=[...l],ke=Tt.findIndex(pe,function(ve){return ve.rowId===(x==null?void 0:x.uuid)});let Oe=(K=l[ke])==null?void 0:K.repeatableFields;Oe={...Oe,[h==null?void 0:h.uuid]:`<img src="${(de=e.current)==null?void 0:de.toDataURL()}" >`},pe[ke]={...pe[ke],repeatableFields:Oe},s(pe)}k(((Ee=e.current)==null?void 0:Ee.toDataURL())||""),((me=e.current)==null?void 0:me.toDataURL())!==""?h.isValid=1:h.isValid=0};N.useEffect(()=>{B||ae();const K=Xt.addListener("clearRepeatableFields",pe=>{pe===(x==null?void 0:x.uuid)&&(k(null),R(),P(0),h.isValid=0,f(S,v,A,g,m,h))}),de=Xt.addListener("onSubmitUserForm",()=>{var pe;(pe=h==null?void 0:h.attributes)!=null&&pe.required?(H!==null?h.isValid=1:h.isValid=0,f(S,v,A,g,m,h)):h.isValid=1}),Ee=Xt.addListener("OnInvalidFieldCatch",pe=>{h.uuid===(pe==null?void 0:pe.fieldId)?P(1):P(0)}),me=Xt.addListener("OnSignatureSettingChange",()=>{R()});return()=>{de.remove(),Ee.remove(),me.remove(),K.remove()}});const ge=K=>{E(K)},ie=()=>{E(!1)},J=()=>{var de,Ee,me,pe;const K=l;if(l!=null&&l.length){const ke=Tt.cloneDeep(r);if(ke[h==null?void 0:h.uuid]=(de=e.current)==null?void 0:de.toDataURL(),(K==null?void 0:K.length)>0){for(const Oe of K)if(Oe.fieldId===t.field.uuid){Oe.postData[0]={postValue:(Ee=e.current)==null?void 0:Ee.toDataURL()},k(((me=e.current)==null?void 0:me.toDataURL())||null);break}}if(!(x!=null&&x.rowIsRepeatable)){i(ke);const Oe=(pe=Object.keys(ke))==null?void 0:pe.length;a(Oe)}}},Q=()=>{var K,de,Ee;return`rgba(${(K=h==null?void 0:h.backgroundColor)==null?void 0:K.r}, ${(de=h==null?void 0:h.backgroundColor)==null?void 0:de.g}, ${(Ee=h==null?void 0:h.backgroundColor)==null?void 0:Ee.b}, 0.8)`},se=o.jsxs("div",{onMouseOver:fe,onMouseOut:ne,children:[!C&&!T&&z&&o.jsx(jr,{handleFieldSettingsSidebar:ge,...t}),o.jsx("div",{className:`field ${T?" ":" builder-element-wrapper "}${(h==null?void 0:h.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:T?"col-12":"col-11",children:[(h==null?void 0:h.showHeaderText)&&o.jsx("h6",{children:(be=h==null?void 0:h.headerText)==null?void 0:be[d==null?void 0:d.type]}),(h==null?void 0:h.showLabel)&&o.jsxs("label",{htmlFor:h.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(ia,{...t}),((Ce=h==null?void 0:h.attributes)==null?void 0:Ce.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",T?o.jsx(o.Fragment,{children:(Te=h==null?void 0:h.label)==null?void 0:Te[d==null?void 0:d.type]}):o.jsx(Zi,{...t}),o.jsx("span",{className:"ml-3",children:(h==null?void 0:h.showToolTip)&&o.jsx(Mi,{message:(ye=h==null?void 0:h.toolTip)==null?void 0:ye[d==null?void 0:d.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[n!==u&&H===null&&o.jsx(vE,{backgroundColor:Q(),penColor:`#${h==null?void 0:h.penColor}`,canvasProps:{width:`${h==null?void 0:h.canvasWidth}`,height:h==null?void 0:h.canvasHeight,className:"sigCanvas"},ref:e,onEnd:()=>{x!=null&&x.rowIsRepeatable?Y():J()}},h==null?void 0:h.uuid),n===u&&H!==null&&o.jsx("img",{alt:"",src:H,style:{width:350,height:200}}),n!==6&&H!==null&&o.jsx("img",{alt:"",src:H,style:{width:350,height:200}}),o.jsx("div",{children:((Ae=h==null?void 0:h.attributes)==null?void 0:Ae.required)&&o.jsx("small",{className:"error",children:O===1&&!H?(re=h==null?void 0:h.validationMesssage)==null?void 0:re.english:""})}),o.jsx("div",{className:"mt-3",children:(h==null?void 0:h.showHelperText)&&o.jsx("small",{children:(U=h==null?void 0:h.helperText)==null?void 0:U[d==null?void 0:d.type]})}),n===a3&&w===!1&&o.jsx(Pt,{text:!0,label:(Z=h==null?void 0:h.clearSignatureButtonLabel)==null?void 0:Z[d==null?void 0:d.type],onClick:()=>R(),className:"p-button-raised p-button-text mt-3"})]})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})})]});return o.jsxs(o.Fragment,{children:[_===!0&&o.jsx(Xi,{visibilty:_,closeSettingFieldSidebar:ie,...t}),o.jsx(wi,{...t,fieldWrap:se})]})};function cg(){return cg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},cg.apply(this,arguments)}function ug(t){"@babel/helpers - typeof";return ug=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ug(t)}function F3e(t,e){if(ug(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ug(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function P3e(t){var e=F3e(t,"string");return ug(e)==="symbol"?e:String(e)}function HA(t,e,n){return e=P3e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k3e(t){if(Array.isArray(t))return t}function M3e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function zA(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function MB(t,e){if(t){if(typeof t=="string")return zA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zA(t,e)}}function L3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3740
|
+
`,l++,s=h}),this.end_=s,this.storage_=i,this.diagnostics_=a}calculateBaseTime_(e,n){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:n:0}isReliablePlaylist_(e,n){return e!=null&&Array.isArray(n)&&n.length}}const Hme=86400,$A=[{name:"VOD",run:(t,e,n,r,i)=>n!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(t,e,n,r,i,a)=>{const s=t.getMediaSequenceSync(a);if(!s||!s.isReliable)return null;const l=s.getSyncInfoForTime(i);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(t,e,n,r,i)=>{if(!Object.keys(t.timelineToDatetimeMappings).length)return null;let a=null,s=null;const l=CA(e);i=i||0;for(let c=0;c<l.length;c++){const u=e.endList||i===0?c:l.length-(c+1),d=l[u],f=d.segment,h=t.timelineToDatetimeMappings[f.timeline];if(!h||!f.dateTimeObject)continue;let g=f.dateTimeObject.getTime()/1e3+h;if(f.parts&&typeof d.partIndex=="number")for(let A=0;A<d.partIndex;A++)g+=f.parts[A].duration;const v=Math.abs(i-g);if(s!==null&&(v===0||s<v))break;s=v,a={time:g,segmentIndex:d.segmentIndex,partIndex:d.partIndex}}return a}},{name:"Segment",run:(t,e,n,r,i)=>{let a=null,s=null;i=i||0;const l=CA(e);for(let c=0;c<l.length;c++){const u=e.endList||i===0?c:l.length-(c+1),d=l[u],f=d.segment,h=d.part&&d.part.start||f&&f.start;if(f.timeline===r&&typeof h<"u"){const m=Math.abs(i-h);if(s!==null&&s<m)break;(!a||s===null||s>=m)&&(s=m,a={time:h,segmentIndex:d.segmentIndex,partIndex:d.partIndex})}}return a}},{name:"Discontinuity",run:(t,e,n,r,i)=>{let a=null;if(i=i||0,e.discontinuityStarts&&e.discontinuityStarts.length){let s=null;for(let l=0;l<e.discontinuityStarts.length;l++){const c=e.discontinuityStarts[l],u=e.discontinuitySequence+l+1,d=t.discontinuities[u];if(d){const f=Math.abs(i-d.time);if(s!==null&&s<f)break;(!a||s===null||s>=f)&&(s=f,a={time:d.time,segmentIndex:c,partIndex:null})}}}return a}},{name:"Playlist",run:(t,e,n,r,i)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class zme extends Dt.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_={main:new qA,audio:new qA,vtt:new qA},this.logger_=Wl("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,n,r,i,a){if(n!==1/0)return $A.find(({name:c})=>c==="VOD").run(this,e,n);const s=this.runStrategies_(e,n,r,i,a);if(!s.length)return null;for(const l of s){const{syncPoint:c,strategy:u}=l,{segmentIndex:d,time:f}=c;if(d<0)continue;const h=e.segments[d],m=f,g=m+h.duration;if(this.logger_(`Strategy: ${u}. Current time: ${i}. selected segment: ${d}. Time: [${m} -> ${g}]}`),i>=m&&i<g)return this.logger_("Found sync point with exact match: ",c),c}return this.selectSyncPoint_(s,{key:"time",value:i})}getExpiredTime(e,n){if(!e||!e.segments)return null;const r=this.runStrategies_(e,n,e.discontinuitySequence,0);if(!r.length)return null;const i=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+rg({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))}runStrategies_(e,n,r,i,a){const s=[];for(let l=0;l<$A.length;l++){const c=$A[l],u=c.run(this,e,n,r,i,a);u&&(u.strategy=c.name,s.push({strategy:c.name,syncPoint:u}))}return s}selectSyncPoint_(e,n){let r=e[0].syncPoint,i=Math.abs(e[0].syncPoint[n.key]-n.value),a=e[0].strategy;for(let s=1;s<e.length;s++){const l=Math.abs(e[s].syncPoint[n.key]-n.value);l<i&&(i=l,r=e[s].syncPoint,a=e[s].strategy)}return this.logger_(`syncPoint for [${n.key}: ${n.value}] chosen with strategy [${a}]: [time:${r.time}, segmentIndex:${r.segmentIndex}`+(typeof r.partIndex=="number"?`,partIndex:${r.partIndex}`:"")+"]"),r}saveExpiredSegmentInfo(e,n){const r=n.mediaSequence-e.mediaSequence;if(r>Hme){Dt.log.warn(`Not saving expired segment info. Media sequence gap ${r} is too large.`);return}for(let i=r-1;i>=0;i--){const a=e.segments[i];if(a&&typeof a.start<"u"){n.syncInfo={mediaSequence:e.mediaSequence+i,time:a.start},this.logger_(`playlist refresh sync: [time:${n.syncInfo.time}, mediaSequence: ${n.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const n=e.segments[0],r=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-r}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:n}){const r=this.calculateSegmentTimeMapping_(e,e.timingInfo,n),i=e.segment;r&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:i.start}));const a=i.dateTimeObject;i.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[i.timeline]=-(a.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,n,r){const i=e.segment,a=e.part;let s=this.timelines[e.timeline],l,c;if(typeof e.timestampOffset=="number")s={time:e.startOfSegment,mapping:e.startOfSegment-n.start},r&&(this.timelines[e.timeline]=s,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${s.time}] [mapping: ${s.mapping}]`)),l=e.startOfSegment,c=n.end+s.mapping;else if(s)l=n.start+s.mapping,c=n.end+s.mapping;else return!1;return a&&(a.start=l,a.end=c),(!i.start||l<i.start)&&(i.start=l),i.end=c,!0}saveDiscontinuitySyncInfo_(e){const n=e.playlist,r=e.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(let i=0;i<n.discontinuityStarts.length;i++){const a=n.discontinuityStarts[i],s=n.discontinuitySequence+i+1,l=a-e.mediaIndex,c=Math.abs(l);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>c){let u;l<0?u=r.start-rg({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:e.mediaIndex,endIndex:a}):u=r.end+rg({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:e.mediaIndex+1,endIndex:a}),this.discontinuities[s]={time:u,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class Yme extends Dt.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:n,to:r}){return typeof n=="number"&&typeof r=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:n,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:n,to:r}){return typeof n=="number"&&typeof r=="number"&&(this.lastTimelineChanges_[e]={type:e,from:n,to:r},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const Kme=HL(zL(function(){var t=function(){function v(){this.listeners={}}var A=v.prototype;return A.on=function(x,w){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push(w)},A.off=function(x,w){if(!this.listeners[x])return!1;var T=this.listeners[x].indexOf(w);return this.listeners[x]=this.listeners[x].slice(0),this.listeners[x].splice(T,1),T>-1},A.trigger=function(x){var w=this.listeners[x];if(w)if(arguments.length===2)for(var T=w.length,C=0;C<T;++C)w[C].call(this,arguments[1]);else for(var _=Array.prototype.slice.call(arguments,1),E=w.length,O=0;O<E;++O)w[O].apply(this,_)},A.dispose=function(){this.listeners={}},A.pipe=function(x){this.on("data",function(w){x.push(w)})},v}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(v){return v.subarray(0,v.byteLength-v[v.byteLength-1])}/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const n=function(){const v=[[[],[],[],[],[]],[[],[],[],[],[]]],A=v[0],S=v[1],x=A[4],w=S[4];let T,C,_;const E=[],O=[];let P,B,M,H,k,z;for(T=0;T<256;T++)O[(E[T]=T<<1^(T>>7)*283)^T]=T;for(C=_=0;!x[C];C^=P||1,_=O[_]||1)for(H=_^_<<1^_<<2^_<<3^_<<4,H=H>>8^H&255^99,x[C]=H,w[H]=C,M=E[B=E[P=E[C]]],z=M*16843009^B*65537^P*257^C*16843008,k=E[H]*257^H*16843008,T=0;T<4;T++)A[T][C]=k=k<<24^k>>>8,S[T][H]=z=z<<24^z>>>8;for(T=0;T<5;T++)A[T]=A[T].slice(0),S[T]=S[T].slice(0);return v};let r=null;class i{constructor(A){r||(r=n()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let S,x,w;const T=this._tables[0][4],C=this._tables[1],_=A.length;let E=1;if(_!==4&&_!==6&&_!==8)throw new Error("Invalid aes key size");const O=A.slice(0),P=[];for(this._key=[O,P],S=_;S<4*_+28;S++)w=O[S-1],(S%_===0||_===8&&S%_===4)&&(w=T[w>>>24]<<24^T[w>>16&255]<<16^T[w>>8&255]<<8^T[w&255],S%_===0&&(w=w<<8^w>>>24^E<<24,E=E<<1^(E>>7)*283)),O[S]=O[S-_]^w;for(x=0;S;x++,S--)w=O[x&3?S:S-4],S<=4||x<4?P[x]=w:P[x]=C[0][T[w>>>24]]^C[1][T[w>>16&255]]^C[2][T[w>>8&255]]^C[3][T[w&255]]}decrypt(A,S,x,w,T,C){const _=this._key[1];let E=A^_[0],O=w^_[1],P=x^_[2],B=S^_[3],M,H,k;const z=_.length/4-2;let ue,fe=4;const ne=this._tables[1],R=ne[0],ae=ne[1],Y=ne[2],ge=ne[3],ie=ne[4];for(ue=0;ue<z;ue++)M=R[E>>>24]^ae[O>>16&255]^Y[P>>8&255]^ge[B&255]^_[fe],H=R[O>>>24]^ae[P>>16&255]^Y[B>>8&255]^ge[E&255]^_[fe+1],k=R[P>>>24]^ae[B>>16&255]^Y[E>>8&255]^ge[O&255]^_[fe+2],B=R[B>>>24]^ae[E>>16&255]^Y[O>>8&255]^ge[P&255]^_[fe+3],fe+=4,E=M,O=H,P=k;for(ue=0;ue<4;ue++)T[(3&-ue)+C]=ie[E>>>24]<<24^ie[O>>16&255]<<16^ie[P>>8&255]<<8^ie[B&255]^_[fe++],M=E,E=O,O=P,P=B,B=M}}class a extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(A){this.jobs.push(A),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const s=function(v){return v<<24|(v&65280)<<8|(v&16711680)>>8|v>>>24},l=function(v,A,S){const x=new Int32Array(v.buffer,v.byteOffset,v.byteLength>>2),w=new i(Array.prototype.slice.call(A)),T=new Uint8Array(v.byteLength),C=new Int32Array(T.buffer);let _,E,O,P,B,M,H,k,z;for(_=S[0],E=S[1],O=S[2],P=S[3],z=0;z<x.length;z+=4)B=s(x[z]),M=s(x[z+1]),H=s(x[z+2]),k=s(x[z+3]),w.decrypt(B,M,H,k,C,z),C[z]=s(C[z]^_),C[z+1]=s(C[z+1]^E),C[z+2]=s(C[z+2]^O),C[z+3]=s(C[z+3]^P),_=B,E=M,O=H,P=k;return T};class c{constructor(A,S,x,w){const T=c.STEP,C=new Int32Array(A.buffer),_=new Uint8Array(A.byteLength);let E=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(C.subarray(E,E+T),S,x,_)),E=T;E<C.length;E+=T)x=new Uint32Array([s(C[E-4]),s(C[E-3]),s(C[E-2]),s(C[E-1])]),this.asyncStream_.push(this.decryptChunk_(C.subarray(E,E+T),S,x,_));this.asyncStream_.push(function(){w(null,e(_))})}static get STEP(){return 32e3}decryptChunk_(A,S,x,w){return function(){const T=l(A,S,x);w.set(T,A.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d;typeof window<"u"?d=window:typeof u<"u"?d=u:typeof self<"u"?d=self:d={};var f=d,h=function(A){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(A):A&&A.buffer instanceof ArrayBuffer},m=f.BigInt||Number;m("0x1"),m("0x100"),m("0x10000"),m("0x1000000"),m("0x100000000"),m("0x10000000000"),m("0x1000000000000"),m("0x100000000000000"),m("0x10000000000000000"),function(){var v=new Uint16Array([65484]),A=new Uint8Array(v.buffer,v.byteOffset,v.byteLength);return A[0]===255?"big":A[0]===204?"little":"unknown"}();const g=function(v){const A={};return Object.keys(v).forEach(S=>{const x=v[S];h(x)?A[S]={bytes:x.buffer,byteOffset:x.byteOffset,byteLength:x.byteLength}:A[S]=x}),A};self.onmessage=function(v){const A=v.data,S=new Uint8Array(A.encrypted.bytes,A.encrypted.byteOffset,A.encrypted.byteLength),x=new Uint32Array(A.key.bytes,A.key.byteOffset,A.key.byteLength/4),w=new Uint32Array(A.iv.bytes,A.iv.byteOffset,A.iv.byteLength/4);new c(S,x,w,function(T,C){self.postMessage(g({source:A.source,decrypted:C}),[C.buffer])})}}));var Xme=jL(Kme);const Gme=t=>{let e=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},yB=(t,e)=>{t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},jA=(t,e)=>{e.activePlaylistLoader=t,t.load()},Rme=(t,e)=>()=>{const{segmentLoaders:{[t]:n,main:r},mediaTypes:{[t]:i}}=e,a=i.activeTrack(),s=i.getActiveGroup(),l=i.activePlaylistLoader,c=i.lastGroup_;if(!(s&&c&&s.id===c.id)&&(i.lastGroup_=s,i.lastTrack_=a,yB(n,i),!(!s||s.isMainPlaylist))){if(!s.playlistLoader){l&&r.resetEverything();return}n.resyncLoader(),jA(s.playlistLoader,i)}},Wme=(t,e)=>()=>{const{segmentLoaders:{[t]:n},mediaTypes:{[t]:r}}=e;r.lastGroup_=null,n.abort(),n.pause()},Qme=(t,e)=>()=>{const{mainPlaylistLoader:n,segmentLoaders:{[t]:r,main:i},mediaTypes:{[t]:a}}=e,s=a.activeTrack(),l=a.getActiveGroup(),c=a.activePlaylistLoader,u=a.lastTrack_;if(!(u&&s&&u.id===s.id)&&(a.lastGroup_=l,a.lastTrack_=s,yB(r,a),!!l)){if(l.isMainPlaylist){if(!s||!u||s.id===u.id)return;const d=e.vhs.playlistController_,f=d.selectPlaylist();if(d.media()===f)return;a.logger_(`track change. Switching main audio from ${u.id} to ${s.id}`),n.pause(),i.resetEverything(),d.fastQualityChange_(f);return}if(t==="AUDIO"){if(!l.playlistLoader){i.setAudio(!0),i.resetEverything();return}r.setAudio(!0),i.setAudio(!1)}if(c===l.playlistLoader){jA(l.playlistLoader,a);return}r.track&&r.track(s),r.resetEverything(),jA(l.playlistLoader,a)}},Av={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:n},excludePlaylist:r}=e,i=n.activeTrack(),a=n.activeGroup(),s=(a.filter(c=>c.default)[0]||a[0]).id,l=n.tracks[s];if(i===l){r({error:{message:"Problem encountered loading the default audio track."}});return}Dt.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in n.tracks)n.tracks[c].enabled=n.tracks[c]===l;n.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:n}}=e;Dt.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}},AB={AUDIO:(t,e,n)=>{if(!e)return;const{tech:r,requestOptions:i,segmentLoaders:{[t]:a}}=n;e.on("loadedmetadata",()=>{const s=e.media();a.playlist(s,i),(!r.paused()||s.endList&&r.preload()!=="none")&&a.load()}),e.on("loadedplaylist",()=>{a.playlist(e.media(),i),r.paused()||a.load()}),e.on("error",Av[t](t,n))},SUBTITLES:(t,e,n)=>{const{tech:r,requestOptions:i,segmentLoaders:{[t]:a},mediaTypes:{[t]:s}}=n;e.on("loadedmetadata",()=>{const l=e.media();a.playlist(l,i),a.track(s.activeTrack()),(!r.paused()||l.endList&&r.preload()!=="none")&&a.load()}),e.on("loadedplaylist",()=>{a.playlist(e.media(),i),r.paused()||a.load()}),e.on("error",Av[t](t,n))}},Jme={AUDIO:(t,e)=>{const{vhs:n,sourceType:r,segmentLoaders:{[t]:i},requestOptions:a,main:{mediaGroups:s},mediaTypes:{[t]:{groups:l,tracks:c,logger_:u}},mainPlaylistLoader:d}=e,f=ig(d.main);(!s[t]||Object.keys(s[t]).length===0)&&(s[t]={main:{default:{default:!0}}},f&&(s[t].main.default.playlists=d.main.playlists));for(const h in s[t]){l[h]||(l[h]=[]);for(const m in s[t][h]){let g=s[t][h][m],v;if(f?(u(`AUDIO group '${h}' label '${m}' is a main playlist`),g.isMainPlaylist=!0,v=null):r==="vhs-json"&&g.playlists?v=new oh(g.playlists[0],n,a):g.resolvedUri?v=new oh(g.resolvedUri,n,a):g.playlists&&r==="dash"?v=new PA(g.playlists[0],n,a,d):v=null,g=Gi({id:m,playlistLoader:v},g),AB[t](t,g.playlistLoader,e),l[h].push(g),typeof c[m]>"u"){const A=new Dt.AudioTrack({id:m,kind:Gme(g),enabled:!1,language:g.language,default:g.default,label:m});c[m]=A}}}i.on("error",Av[t](t,e))},SUBTITLES:(t,e)=>{const{tech:n,vhs:r,sourceType:i,segmentLoaders:{[t]:a},requestOptions:s,main:{mediaGroups:l},mediaTypes:{[t]:{groups:c,tracks:u}},mainPlaylistLoader:d}=e;for(const f in l[t]){c[f]||(c[f]=[]);for(const h in l[t][f]){if(!r.options_.useForcedSubtitles&&l[t][f][h].forced)continue;let m=l[t][f][h],g;if(i==="hls")g=new oh(m.resolvedUri,r,s);else if(i==="dash"){if(!m.playlists.filter(A=>A.excludeUntil!==1/0).length)return;g=new PA(m.playlists[0],r,s,d)}else i==="vhs-json"&&(g=new oh(m.playlists?m.playlists[0]:m.resolvedUri,r,s));if(m=Gi({id:h,playlistLoader:g},m),AB[t](t,m.playlistLoader,e),c[f].push(m),typeof u[h]>"u"){const v=n.addRemoteTextTrack({id:h,kind:"subtitles",default:m.default&&m.autoselect,language:m.language,label:h},!1).track;u[h]=v}}}a.on("error",Av[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:n,main:{mediaGroups:r},mediaTypes:{[t]:{groups:i,tracks:a}}}=e;for(const s in r[t]){i[s]||(i[s]=[]);for(const l in r[t][s]){const c=r[t][s][l];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const u=n.options_.vhs&&n.options_.vhs.captionServices||{};let d={label:l,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(u[d.instreamId]&&(d=Gi(d,u[d.instreamId])),d.default===void 0&&delete d.default,i[s].push(Gi({id:l},c)),typeof a[l]>"u"){const f=n.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;a[l]=f}}}}},wB=(t,e)=>{for(let n=0;n<t.length;n++)if(IA(e,t[n])||t[n].playlists&&wB(t[n].playlists,e))return!0;return!1},Zme=(t,e)=>n=>{const{mainPlaylistLoader:r,mediaTypes:{[t]:{groups:i}}}=e,a=r.media();if(!a)return null;let s=null;a.attributes[t]&&(s=i[a.attributes[t]]);const l=Object.keys(i);if(!s)if(t==="AUDIO"&&l.length>1&&ig(e.main))for(let c=0;c<l.length;c++){const u=i[l[c]];if(wB(u,a)){s=u;break}}else i.main?s=i.main:l.length===1&&(s=i[l[0]]);return typeof n>"u"?s:n===null||!s?null:s.filter(c=>c.id===n.id)[0]||null},e3e={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:n}}}=e;for(const r in n)if(n[r].enabled)return n[r];return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:n}}}=e;for(const r in n)if(n[r].mode==="showing"||n[r].mode==="hidden")return n[r];return null}},t3e=(t,{mediaTypes:e})=>()=>{const n=e[t].activeTrack();return n?e[t].activeGroup(n):null},n3e=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{Jme[u](u,t)});const{mediaTypes:e,mainPlaylistLoader:n,tech:r,vhs:i,segmentLoaders:{["AUDIO"]:a,main:s}}=t;["AUDIO","SUBTITLES"].forEach(u=>{e[u].activeGroup=Zme(u,t),e[u].activeTrack=e3e[u](u,t),e[u].onGroupChanged=Rme(u,t),e[u].onGroupChanging=Wme(u,t),e[u].onTrackChanged=Qme(u,t),e[u].getActiveGroup=t3e(u,t)});const l=e.AUDIO.activeGroup();if(l){const u=(l.filter(f=>f.default)[0]||l[0]).id;e.AUDIO.tracks[u].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(s.setAudio(!1),a.setAudio(!0)):s.setAudio(!0)}n.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanged())}),n.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanging())});const c=()=>{e.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",c),r.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),i.on("dispose",()=>{r.audioTracks().removeEventListener("change",c),r.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const u in e.AUDIO.tracks)r.audioTracks().addTrack(e.AUDIO.tracks[u])},r3e=()=>{const t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:bd,activeTrack:bd,getActiveGroup:bd,onGroupChanged:bd,onTrackChanged:bd,lastTrack_:null,logger_:Wl(`MediaGroups[${e}]`)}}),t};class SB{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Qo(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(n=>[n.ID,n])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class i3e extends Dt.EventTarget{constructor(e,n){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new SB,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Wl("Content Steering"),this.xhr_=e,this.getBandwidth_=n}assignTagProperties(e,n){this.manifestType_=n.serverUri?"HLS":"DASH";const r=n.serverUri||n.serverURL;if(!r){this.logger_(`steering manifest URL is ${r}, cannot request steering manifest.`),this.trigger("error");return}if(r.startsWith("data:")){this.decodeDataUriManifest_(r.substring(r.indexOf(",")+1));return}this.steeringManifest.reloadUri=Qo(e,r),this.defaultPathway=n.pathwayId||n.defaultServiceLocation,this.queryBeforeStart=n.queryBeforeStart,this.proxyServerUrl_=n.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const n=this.steeringManifest.reloadUri;if(!n)return;const r=e?n:this.getRequestURI(n);if(!r){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}this.request_=this.xhr_({uri:r,requestType:"content-steering-manifest"},(i,a)=>{if(i){if(a.status===410){this.logger_(`manifest request 410 ${i}.`),this.logger_(`There will be no more content steering requests to ${r} this session.`),this.excludedSteeringManifestURLs.add(r);return}if(a.status===429){const l=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${i}.`),this.logger_(`content steering will retry in ${l} seconds.`),this.startTTLTimeout_(parseInt(l,10));return}this.logger_(`manifest failed to load ${i}.`),this.startTTLTimeout_();return}const s=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(s),this.startTTLTimeout_()})}setProxyServerUrl_(e){const n=new Ge.URL(e),r=new Ge.URL(this.proxyServerUrl_);return r.searchParams.set("url",encodeURI(n.toString())),this.setSteeringParams_(r.toString())}decodeDataUriManifest_(e){const n=JSON.parse(Ge.atob(e));this.assignSteeringProperties_(n)}setSteeringParams_(e){const n=new Ge.URL(e),r=this.getPathway(),i=this.getBandwidth_();if(r){const a=`_${this.manifestType_}_pathway`;n.searchParams.set(a,r)}if(i){const a=`_${this.manifestType_}_throughput`;n.searchParams.set(a,i)}return n.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const r=(i=>{for(const a of i)if(this.availablePathways_.has(a))return a;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==r&&(this.currentPathway=r,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const n=i=>this.excludedSteeringManifestURLs.has(i);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!n(i))return i}const r=this.setSteeringParams_(e);return n(r)?null:r}startTTLTimeout_(e=this.steeringManifest.ttl){const n=e*1e3;this.ttlTimeout_=Ge.setTimeout(()=>{this.requestSteeringManifest()},n)}clearTTLTimeout_(){Ge.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new SB}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,n){return!n&&this.steeringManifest.reloadUri||n&&(Qo(e,n.serverURL)!==this.steeringManifest.reloadUri||n.defaultServiceLocation!==this.defaultPathway||n.queryBeforeStart!==this.queryBeforeStart||n.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const a3e=10;let yd;const s3e=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],o3e=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},l3e=function({currentPlaylist:t,buffered:e,currentTime:n,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:s,bufferBasedABR:l,log:c}){if(!r)return Dt.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${t&&t.id||"null"} -> ${r.id}`;if(!t)return c(`${u} as current playlist is not set`),!0;if(r.id===t.id)return!1;const d=!!ih(e,n).length;if(!t.endList)return!d&&typeof t.partTargetDuration=="number"?(c(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${u} as current playlist is live`),!0);const f=SA(e,n),h=l?Fs.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Fs.MAX_BUFFER_LOW_WATER_LINE;if(s<h)return c(`${u} as duration < max low water line (${s} < ${h})`),!0;const m=r.attributes.BANDWIDTH,g=t.attributes.BANDWIDTH;if(m<g&&(!l||f<a)){let v=`${u} as next bandwidth < current bandwidth (${m} < ${g})`;return l&&(v+=` and forwardBuffer < bufferHighWaterLine (${f} < ${a})`),c(v),!0}if((!l||m>g)&&f>=i){let v=`${u} as forwardBuffer >= bufferLowWaterLine (${f} >= ${i})`;return l&&(v+=` and next bandwidth > current bandwidth (${m} > ${g})`),c(v),!0}return c(`not ${u} as no switching criteria met`),!1};class c3e extends Dt.EventTarget{constructor(e){super();const{src:n,withCredentials:r,tech:i,bandwidth:a,externVhs:s,useCueTags:l,playlistExclusionDuration:c,enableLowInitialPlaylist:u,sourceType:d,cacheEncryptionKeys:f,bufferBasedABR:h,leastPixelDiffSelector:m,captionServices:g}=e;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:v}=e;(v===null||typeof v>"u")&&(v=1/0),yd=s,this.bufferBasedABR=!!h,this.leastPixelDiffSelector=!!m,this.withCredentials=r,this.tech_=i,this.vhs_=i.vhs,this.sourceType_=d,this.useCueTags_=l,this.playlistExclusionDuration=c,this.maxPlaylistRetries=v,this.enableLowInitialPlaylist=u,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:r,maxPlaylistRetries:v,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=r3e(),this.mediaSource=new Ge.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=lo(),this.hasPlayed_=!1,this.syncController_=new zme(e),this.segmentMetadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Xme,this.sourceUpdater_=new gB(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Yme,this.keyStatusMap_=new Map;const A={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:g,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:a,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:f,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new PA(n,this.vhs_,Gi(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new oh(n,this.vhs_,Gi(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new VA(Gi(A,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new VA(Gi(A,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Ume(Gi(A,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((w,T)=>{function C(){i.off("vttjserror",_),w()}function _(){i.off("vttjsloaded",C),T()}i.one("vttjsloaded",C),i.one("vttjserror",_),i.addWebVttScript_()})}),e);const S=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new i3e(this.vhs_.xhr,S),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),s3e.forEach(w=>{this[w+"_"]=o3e.bind(this,w)}),this.logger_=Wl("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const x=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(x,()=>{const w=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-w,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return e===-1||n===-1?-1:e+n}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,e)}switchMedia_(e,n,r){const i=this.media(),a=i&&(i.id||i.uri),s=e&&(e.id||e.uri);a&&a!==s&&(this.logger_(`switch media ${a} -> ${s} from ${n}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${n}`})),this.mainPlaylistLoader_.media(e,r)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const n=this.mediaTypes_[e],r=n?n.activeGroup():null,i=this.contentSteeringController_.getPathway();if(r&&i){const s=(r.length?r[0].playlists:r.playlists).filter(l=>l.attributes.serviceLocation===i);s.length&&this.mediaTypes_[e].activePlaylistLoader.media(s[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=Ge.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Ge.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),n=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return n;const r=e.mediaGroups.AUDIO,i=Object.keys(r);let a;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)a=this.mediaTypes_.AUDIO.activeTrack();else{const l=r.main||i.length&&r[i[0]];for(const c in l)if(l[c].default){a={label:c};break}}if(!a)return n;const s=[];for(const l in r)if(r[l][a.label]){const c=r[l][a.label];if(c.playlists&&c.playlists.length)s.push.apply(s,c.playlists);else if(c.uri)s.push(c);else if(e.playlists.length)for(let u=0;u<e.playlists.length;u++){const d=e.playlists[u];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===l&&s.push(d)}}return s.length?s:n}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),n=e.targetDuration*1.5*1e3;EA(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),n3e({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let n;if(this.enableLowInitialPlaylist&&(n=this.selectInitialPlaylist()),n||(n=this.selectPlaylist()),!n||!this.shouldSwitchToMedia_(n)||(this.initialMedia_=n,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),n=e.targetDuration*1.5*1e3;EA(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,n){const r=e.mediaGroups||{};let i=!0;const a=Object.keys(r.AUDIO);for(const s in r.AUDIO)for(const l in r.AUDIO[s])r.AUDIO[s][l].uri||(i=!1);i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(r.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),yd.Playlist.isAes(n)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),a.length&&Object.keys(r.AUDIO[a[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const n=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,r=this.tech_.currentTime(),i=this.bufferLowWaterLine(),a=this.bufferHighWaterLine(),s=this.tech_.buffered();return l3e({buffered:s,currentTime:r,currentPlaylist:n,nextPlaylist:e,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const n=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:n.playlist,error:n})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",n=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:a3e}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const n=this.getCodecsOrExclude_();n&&this.sourceUpdater_.addOrChangeSourceBuffers(n)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const n=this.seekable();if(!n.length)return!1;const r=n.end(0);let i=r;if(e.start){const a=e.start.timeOffset;a<0?i=Math.max(r+a,n.start(0)):i=Math.min(r,a)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,n=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const n=this.duration();e[e.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const r=this.syncController_.getExpiredTime(e,this.duration());if(r===null)return!1;const i=yd.Playlist.playlistEnd(e,r),a=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-a<=xu;const l=s.end(s.length-1);return l-a<=xu&&i-l<=xu}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:n={},playlistExclusionDuration:r}){if(e=e||this.mainPlaylistLoader_.media(),r=r||n.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=n,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const i=this.mainPlaylistLoader_.main.playlists,a=i.filter(pv),s=a.length===1&&a[0]===e;if(i.length===1&&r!==1/0)return Dt.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(s);if(s){if(this.main().contentSteering){const g=this.pathwayAttribute_(e),v=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(g),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(g)},v);return}let m=!1;i.forEach(g=>{if(g===e)return;const v=g.excludeUntil;typeof v<"u"&&v!==1/0&&(m=!0,delete g.excludeUntil)}),m&&(Dt.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;e.playlistErrors_>this.maxPlaylistRetries?l=1/0:l=Date.now()+r*1e3,e.excludeUntil=l,n.reason&&(e.lastExcludeReason_=n.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=n.internal?this.logger_:Dt.log.warn,d=n.message?" "+n.message:"";u(`${n.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${d} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const f=c.targetDuration/2*1e3||5*1e3,h=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=f;return this.switchMedia_(c,"exclude",s||h)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,n){const r=[],i=e==="all";(i||e==="main")&&r.push(this.mainPlaylistLoader_);const a=[];(i||e==="audio")&&a.push("AUDIO"),(i||e==="subtitle")&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(s=>{const l=this.mediaTypes_[s]&&this.mediaTypes_[s].activePlaylistLoader;l&&r.push(l)}),["main","audio","subtitle"].forEach(s=>{const l=this[`${s}SegmentLoader_`];l&&(e===s||e==="all")&&r.push(l)}),r.forEach(s=>n.forEach(l=>{typeof s[l]=="function"&&s[l]()}))}setCurrentTime(e){const n=ih(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(n&&n.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:yd.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let n=this.mainPlaylistLoader_.media();if(!n)return;let r=this.syncController_.getExpiredTime(n,this.duration());if(r===null)return;const i=this.mainPlaylistLoader_.main,a=yd.Playlist.seekable(n,r,yd.Playlist.liveEdgeDelay(i,n));if(a.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),r=this.syncController_.getExpiredTime(n,this.duration()),r===null||(e=yd.Playlist.seekable(n,r,yd.Playlist.liveEdgeDelay(i,n)),e.length===0)))return;let s,l;this.seekable_&&this.seekable_.length&&(s=this.seekable_.end(0),l=this.seekable_.start(0)),e?e.start(0)>a.end(0)||a.start(0)>e.end(0)?this.seekable_=a:this.seekable_=lo([[e.start(0)>a.start(0)?e.start(0):a.start(0),e.end(0)<a.end(0)?e.end(0):a.end(0)]]):this.seekable_=a,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===s&&this.seekable_.start(0)===l)&&(this.logger_(`seekable updated [${gL(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}const n=this.tech_.buffered();let r=yd.Playlist.duration(this.mainPlaylistLoader_.media());n.length>0&&(r=Math.max(r,n.end(n.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const n=this.mediaTypes_[e].groups;for(const r in n)n[r].forEach(i=>{i.playlistLoader&&i.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),r=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!r)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},n=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const r=sg(this.main(),n),i={},a=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(i.video=r.video||e.main.videoCodec||Bfe),e.main.isMuxed&&(i.video+=`,${r.audio||e.main.audioCodec||fP}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||a)&&(i.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||fP,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!i.audio&&!i.video){this.excludePlaylist({playlistToExclude:n,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const s=(u,d)=>u?A4(d):Rb(d),l={};let c;if(["video","audio"].forEach(function(u){if(i.hasOwnProperty(u)&&!s(e[u].isFmp4,i[u])){const d=e[u].isFmp4?"browser":"muxer";l[d]=l[d]||[],l[d].push(i[u]),u==="audio"&&(c=d)}}),a&&c&&n.attributes.AUDIO){const u=n.attributes.AUDIO;this.main().playlists.forEach(d=>{(d.attributes&&d.attributes.AUDIO)===u&&d!==n&&(d.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${c} does not support codec(s): "${i.audio}"`)}if(Object.keys(l).length){const u=Object.keys(l).reduce((d,f)=>(d&&(d+=", "),d+=`${f} does not support codec(s): "${l[f].join(",")}"`,d),"")+".";this.excludePlaylist({playlistToExclude:n,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(d=>{const f=(pu(this.sourceUpdater_.codecs[d]||"")[0]||{}).type,h=(pu(i[d]||"")[0]||{}).type;f&&h&&f.toLowerCase()!==h.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[d]}" -> "${i[d]}"`)}),u.length){this.excludePlaylist({playlistToExclude:n,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return i}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const n=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}excludeUnsupportedVariants_(){const e=this.main().playlists,n=[];Object.keys(e).forEach(r=>{const i=e[r];if(n.indexOf(i.id)!==-1)return;n.push(i.id);const a=sg(this.main,i),s=[];a.audio&&!Rb(a.audio)&&!A4(a.audio)&&s.push(`audio codec ${a.audio}`),a.video&&!Rb(a.video)&&!A4(a.video)&&s.push(`video codec ${a.video}`),a.text&&a.text==="stpp.ttml.im1t"&&s.push(`text codec ${a.text}`),s.length&&(i.excludeUntil=1/0,this.logger_(`excluding ${i.id} for unsupported: ${s.join(", ")}`))})}excludeIncompatibleVariants_(e){const n=[],r=this.main().playlists,i=mv(pu(e)),a=tB(i),s=i.video&&pu(i.video)[0]||null,l=i.audio&&pu(i.audio)[0]||null;Object.keys(r).forEach(c=>{const u=r[c];if(n.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;n.push(u.id);const d=[],f=sg(this.mainPlaylistLoader_.main,u),h=tB(f);if(!(!f.audio&&!f.video)){if(h!==a&&d.push(`codec count "${h}" !== "${a}"`),!this.sourceUpdater_.canChangeType()){const m=f.video&&pu(f.video)[0]||null,g=f.audio&&pu(f.audio)[0]||null;m&&s&&m.type.toLowerCase()!==s.type.toLowerCase()&&d.push(`video codec "${m.type}" !== "${s.type}"`),g&&l&&g.type.toLowerCase()!==l.type.toLowerCase()&&d.push(`audio codec "${g.type}" !== "${l.type}"`)}d.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${d.join(" && ")}`))}})}updateAdCues_(e){let n=0;const r=this.seekable();r.length&&(n=r.start(0)),$me(e,this.cueTagsTrack_,n)}goalBufferLength(){const e=this.tech_.currentTime(),n=Fs.GOAL_BUFFER_LENGTH,r=Fs.GOAL_BUFFER_LENGTH_RATE,i=Math.max(n,Fs.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+e*r,i)}bufferLowWaterLine(){const e=this.tech_.currentTime(),n=Fs.BUFFER_LOW_WATER_LINE,r=Fs.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(n,Fs.MAX_BUFFER_LOW_WATER_LINE),a=Math.max(n,Fs.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+e*r,this.bufferBasedABR?a:i)}bufferHighWaterLine(){return Fs.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){sB(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Sme({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,n,r){const i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();sB(this.inbandTextTracks_,e,this.tech_),yme({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:i,videoDuration:r})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const n of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(n));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const i=this.contentSteeringController_.getAvailablePathways(),a=[];for(const s of e.playlists){const l=s.attributes.serviceLocation;if(l&&(a.push(l),!i.has(l)))return!0}return!!(!a.length&&i.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const r=this.main().playlists,i=new Set;let a=!1;Object.keys(r).forEach(s=>{const l=r[s],c=this.pathwayAttribute_(l),u=c&&e!==c;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!u&&(delete l.excludeUntil,delete l.lastExcludeReason_,a=!0);const f=!l.excludeUntil&&l.excludeUntil!==1/0;!i.has(l.id)&&u&&f&&(i.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(s=>{const l=this.mediaTypes_[s];if(l.activePlaylistLoader){const c=l.activePlaylistLoader.media_;c&&c.attributes.serviceLocation!==e&&(a=!0)}}),a&&this.changeSegmentPathway_()}handlePathwayClones_(){const n=this.main().playlists,r=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(r&&r.size||i&&i.size){for(const[s,l]of r.entries())i.get(s)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(s));for(const[s,l]of i.entries()){const c=r.get(s);if(!c){n.filter(d=>d.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(d=>{this.mainPlaylistLoader_.addClonePathway(l,d)}),this.contentSteeringController_.addAvailablePathway(s);continue}this.equalPathwayClones_(c,l)||(this.mainPlaylistLoader_.updateOrDeleteClone(l,!0),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,n){if(e["BASE-ID"]!==n["BASE-ID"]||e.ID!==n.ID||e["URI-REPLACEMENT"].HOST!==n["URI-REPLACEMENT"].HOST)return!1;const r=e["URI-REPLACEMENT"].PARAMS,i=n["URI-REPLACEMENT"].PARAMS;for(const a in r)if(r[a]!==i[a])return!1;for(const a in i)if(r[a]!==i[a])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const n="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(r=>{const i=this.mainPlaylistLoader_.getKeyIdSet(r);!i||!i.size||i.forEach(a=>{const s="usable",l=this.keyStatusMap_.has(a)&&this.keyStatusMap_.get(a)===s,c=r.lastExcludeReason_===n&&r.excludeUntil===1/0;l?l&&c&&(delete r.excludeUntil,delete r.lastExcludeReason_,this.logger_(`enabling playlist ${r.id} because key ID ${a} is ${s}`)):(r.excludeUntil!==1/0&&r.lastExcludeReason_!==n&&(r.excludeUntil=1/0,r.lastExcludeReason_=n,this.logger_(`excluding playlist ${r.id} because the key ID ${a} doesn't exist in the keyStatusMap or is not ${s}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(r=>{const i=r&&r.attributes&&r.attributes.RESOLUTION&&r.attributes.RESOLUTION.height<720,a=r.excludeUntil===1/0&&r.lastExcludeReason_===n;i&&a&&(delete r.excludeUntil,Dt.log.warn(`enabling non-HD playlist ${r.id} because all playlists were excluded due to ${n} key IDs`))})}addKeyStatus_(e,n){const a=(typeof e=="string"?e:Bme(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${n}' with key ID ${a} added to the keyStatusMap`),this.keyStatusMap_.set(a,n)}updatePlaylistByKeyStatus(e,n){this.addKeyStatus_(e,n),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const u3e=(t,e,n)=>r=>{const i=t.main.playlists[e],a=TA(i),s=pv(i);return typeof r>"u"?s:(r?delete i.disabled:i.disabled=!0,r!==s&&!a&&(n(i),r?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),r)};class d3e{constructor(e,n,r){const{playlistController_:i}=e,a=i.fastQualityChange_.bind(i);if(n.attributes){const s=n.attributes.RESOLUTION;this.width=s&&s.width,this.height=s&&s.height,this.bandwidth=n.attributes.BANDWIDTH,this.frameRate=n.attributes["FRAME-RATE"]}this.codecs=sg(i.main(),n),this.playlist=n,this.id=r,this.enabled=u3e(e.playlists,n.id,a)}}const f3e=function(t){t.representations=()=>{const e=t.playlistController_.main(),n=ig(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;return n?n.filter(r=>!TA(r)).map((r,i)=>new d3e(t,r,r.id)):[]}},xB=["seeking","seeked","pause","playing","error"];class h3e{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Wl("PlaybackWatcher"),this.logger_("initialize");const n=()=>this.monitorCurrentTime_(),r=()=>this.monitorCurrentTime_(),i=()=>this.techWaiting_(),a=()=>this.resetTimeUpdate_(),s=this.playlistController_,l=["main","subtitle","audio"],c={};l.forEach(d=>{c[d]={reset:()=>this.resetSegmentDownloads_(d),updateend:()=>this.checkSegmentDownloads_(d)},s[`${d}SegmentLoader_`].on("appendsdone",c[d].updateend),s[`${d}SegmentLoader_`].on("playlistupdate",c[d].reset),this.tech_.on(["seeked","seeking"],c[d].reset)});const u=d=>{["main","audio"].forEach(f=>{s[`${f}SegmentLoader_`][d]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",i),this.tech_.on(xB,a),this.tech_.on("canplay",r),this.tech_.one("play",n),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",i),this.tech_.off(xB,a),this.tech_.off("canplay",r),this.tech_.off("play",n),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(d=>{s[`${d}SegmentLoader_`].off("appendsdone",c[d].updateend),s[`${d}SegmentLoader_`].off("playlistupdate",c[d].reset),this.tech_.off(["seeked","seeking"],c[d].reset)}),this.checkCurrentTimeTimeout_&&Ge.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Ge.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Ge.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const n=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=n.buffered_()}checkSegmentDownloads_(e){const n=this.playlistController_,r=n[`${e}SegmentLoader_`],i=r.buffered_(),a=age(this[`${e}Buffered_`],i);if(this[`${e}Buffered_`]=i,a){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:r.playlist_&&r.playlist_.id,buffered:m1(i)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&n.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),n=this.tech_.buffered();if(this.lastRecordedTime===e&&(!n.length||e+xu>=n.end(n.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const n=this.seekable(),r=this.tech_.currentTime(),i=this.afterSeekableWindow_(n,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let a;if(i&&(a=n.end(n.length-1)),this.beforeSeekableWindow_(n,r)){const g=n.start(0);a=g+(g===n.end(0)?0:xu)}if(typeof a<"u")return this.logger_(`Trying to seek outside of seekable at time ${r} with seekable range ${gL(n)}. Seeking to ${a}.`),this.tech_.setCurrentTime(a),!0;const s=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),c=s.audioBuffer?s.audioBuffered():null,u=s.videoBuffer?s.videoBuffered():null,d=this.media(),f=d.partTargetDuration?d.partTargetDuration:(d.targetDuration-Su)*2,h=[c,u];for(let g=0;g<h.length;g++){if(!h[g])continue;if(SA(h[g],r)<f)return!1}const m=hv(l,r);return m.length===0?!1:(a=m.start(0)+xu,this.logger_(`Buffered region starts (${m.start(0)}) just beyond seek point (${r}). Seeking to ${a}.`),this.tech_.setCurrentTime(a),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),n=this.tech_.buffered(),r=ih(n,e);if(r.length&&e+3<=r.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${r.start(0)} -> ${r.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),n=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,n)){const l=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${n}. Seeking to live point (seekable end) ${l}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(l),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const r=this.tech_.vhs.playlistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:n}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const s=hv(i,n);return s.length>0?(this.logger_(`Stopped at ${n} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(n),!0):!1}afterSeekableWindow_(e,n,r,i=!1){if(!e.length)return!1;let a=e.end(e.length-1)+xu;const s=!r.endList,l=typeof r.partTargetDuration=="number";return s&&(l||i)&&(a=e.end(e.length-1)+r.targetDuration*3),n>a}beforeSeekableWindow_(e,n){return!!(e.length&&e.start(0)>0&&n<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:n,currentTime:r}){if(!e)return;let i;if(e.length&&n.length){const a=ih(e,r-3),s=ih(e,r),l=ih(n,r);l.length&&!s.length&&a.length&&(i={start:a.end(0),end:l.end(0)})}else hv(e,r).length||(i=this.gapFromVideoUnderflow_(e,r));return i?(this.logger_(`Encountered a gap in video from ${i.start} to ${i.end}. Seeking to current time ${r}`),!0):!1}skipTheGap_(e){const n=this.tech_.buffered(),r=this.tech_.currentTime(),i=hv(n,r);this.resetTimeUpdate_(),!(i.length===0||r!==e)&&(this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",e,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+Su),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,n){const r=nge(e);for(let i=0;i<r.length;i++){const a=r.start(i),s=r.end(i);if(n-a<4&&n-a>2)return{start:a,end:s}}return null}}const p3e={errorInterval:30,getSource(t){const n=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return t(n)}},CB=function(t,e){let n=0,r=0;const i=Gi(p3e,e);t.ready(()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const a=function(){r&&t.currentTime(r)},s=function(d){d!=null&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",a),t.src(d),t.trigger({type:"usage",name:"vhs-error-reload"}),t.play())},l=function(){if(Date.now()-n<i.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){Dt.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return n=Date.now(),i.getSource.call(t,s)},c=function(){t.off("loadedmetadata",a),t.off("error",l),t.off("dispose",c)},u=function(d){c(),CB(t,d)};t.on("error",l),t.on("dispose",c),t.reloadSourceOnError=u},g3e=function(t){CB(this,t)};var TB="3.12.1",m3e="7.0.3",v3e="1.3.0",b3e="7.1.0",y3e="4.0.1";const Ba={PlaylistLoader:oh,Playlist:Jo,utils:Ige,STANDARD_PLAYLIST_SELECTOR:iB,INITIAL_PLAYLIST_SELECTOR:pme,lastBandwidthSelector:iB,movingAverageBandwidthSelector:fme,comparePlaylistBandwidth:BA,comparePlaylistResolution:dme,xhr:PL()};Object.keys(Fs).forEach(t=>{Object.defineProperty(Ba,t,{get(){return Dt.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),Fs[t]},set(e){if(Dt.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){Dt.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}Fs[t]=e}})});const EB="videojs-vhs",IB=function(t,e){const n=e.media();let r=-1;for(let i=0;i<t.length;i++)if(t[i].id===n.id){r=i;break}t.selectedIndex_=r,t.trigger({selectedIndex:r,type:"change"})},A3e=function(t,e){e.representations().forEach(n=>{t.addQualityLevel(n)}),IB(t,e.playlists)};Ba.canPlaySource=function(){return Dt.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const w3e=(t,e,n)=>{if(!t)return t;let r={};e&&e.attributes&&e.attributes.CODECS&&(r=mv(pu(e.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);const i=D2(r.video),a=D2(r.audio),s={};for(const l in t)s[l]={},a&&(s[l].audioContentType=a),i&&(s[l].videoContentType=i),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(s[l].pssh=e.contentProtection[l].pssh),typeof t[l]=="string"&&(s[l].url=t[l]);return Gi(t,s)},S3e=(t,e)=>t.reduce((n,r)=>{if(!r.contentProtection)return n;const i=e.reduce((a,s)=>{const l=r.contentProtection[s];return l&&l.pssh&&(a[s]={pssh:l.pssh}),a},{});return Object.keys(i).length&&n.push(i),n},[]),x3e=({player:t,sourceKeySystems:e,audioMedia:n,mainPlaylists:r})=>{if(!t.eme.initializeMediaKeys)return Promise.resolve();const i=n?r.concat([n]):r,a=S3e(i,Object.keys(e)),s=[],l=[];return a.forEach(c=>{l.push(new Promise((u,d)=>{t.tech_.one("keysessioncreated",u)})),s.push(new Promise((u,d)=>{t.eme.initializeMediaKeys({keySystems:c},f=>{if(f){d(f);return}u()})}))}),Promise.race([Promise.all(s),Promise.race(l)])},C3e=({player:t,sourceKeySystems:e,media:n,audioMedia:r})=>{const i=w3e(e,n,r);return i?(t.currentSource().keySystems=i,i&&!t.eme?(Dt.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},_B=()=>{if(!Ge.localStorage)return null;const t=Ge.localStorage.getItem(EB);if(!t)return null;try{return JSON.parse(t)}catch{return null}},T3e=t=>{if(!Ge.localStorage)return!1;let e=_B();e=e?Gi(e,t):t;try{Ge.localStorage.setItem(EB,JSON.stringify(e))}catch{return!1}return e},E3e=t=>t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t,DB=(t,e)=>{t._requestCallbackSet||(t._requestCallbackSet=new Set),t._requestCallbackSet.add(e)},OB=(t,e)=>{t._responseCallbackSet||(t._responseCallbackSet=new Set),t._responseCallbackSet.add(e)},NB=(t,e)=>{t._requestCallbackSet&&(t._requestCallbackSet.delete(e),t._requestCallbackSet.size||delete t._requestCallbackSet)},FB=(t,e)=>{t._responseCallbackSet&&(t._responseCallbackSet.delete(e),t._responseCallbackSet.size||delete t._responseCallbackSet)};Ba.supportsNativeHls=function(){if(!Sn||!Sn.createElement)return!1;const t=Sn.createElement("video");return Dt.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(n){return/maybe|probably/i.test(t.canPlayType(n))}):!1}(),Ba.supportsNativeDash=function(){return!Sn||!Sn.createElement||!Dt.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(Sn.createElement("video").canPlayType("application/dash+xml"))}(),Ba.supportsTypeNatively=t=>t==="hls"?Ba.supportsNativeHls:t==="dash"?Ba.supportsNativeDash:!1,Ba.isSupported=function(){return Dt.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Ba.xhr.onRequest=function(t){DB(Ba.xhr,t)},Ba.xhr.onResponse=function(t){OB(Ba.xhr,t)},Ba.xhr.offRequest=function(t){NB(Ba.xhr,t)},Ba.xhr.offResponse=function(t){FB(Ba.xhr,t)};const I3e=Dt.getComponent("Component");class PB extends I3e{constructor(e,n,r){if(super(n,r.vhs),typeof r.initialBandwidth=="number"&&(this.options_.bandwidth=r.initialBandwidth),this.logger_=Wl("VhsHandler"),n.options_&&n.options_.playerId){const i=Dt.getPlayer(n.options_.playerId);this.player_=i}if(this.tech_=n,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(Sn,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],i=>{const a=Sn.fullscreenElement||Sn.webkitFullscreenElement||Sn.mozFullScreenElement||Sn.msFullscreenElement;a&&a.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Gi(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const r=_B();r&&r.bandwidth&&(this.options_.bandwidth=r.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),r&&r.throughput&&(this.options_.throughput=r.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Fs.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Fs.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(r=>{typeof this.source_[r]<"u"&&(this.options_[r]=this.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const n=this.options_.customPixelRatio;typeof n=="number"&&n>=0&&(this.customPixelRatio=n)}setOptions(e={}){this.setOptions_(e)}src(e,n){if(!e)return;this.setOptions_(),this.options_.src=E3e(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Ba,this.options_.sourceType=hP(n),this.options_.seekTo=a=>{this.tech_.setCurrentTime(a)},this.playlistController_=new c3e(this.options_);const r=Gi({liveRangeSafeTimeDelta:xu},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new h3e(r),this.playlistController_.on("error",()=>{const a=Dt.players[this.tech_.options_.playerId];let s=this.playlistController_.error;typeof s=="object"&&!s.code?s.code=3:typeof s=="string"&&(s={message:s,code:3}),a.error(s)});const i=this.options_.bufferBasedABR?Ba.movingAverageBandwidthSelector(.55):Ba.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):i.bind(this),this.playlistController_.selectInitialPlaylist=Ba.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(a){this.playlistController_.selectPlaylist=a.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(a){this.playlistController_.mainSegmentLoader_.throughput.rate=a,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let a=this.playlistController_.mainSegmentLoader_.bandwidth;const s=Ge.navigator.connection||Ge.navigator.mozConnection||Ge.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&s){const c=s.downlink*1e3*1e3;c>=l&&a>=l?a=Math.max(a,c):a=c}return a},set(a){this.playlistController_.mainSegmentLoader_.bandwidth=a,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const a=1/(this.bandwidth||1);let s;return this.throughput>0?s=1/this.throughput:s=0,Math.floor(1/(a+s))},set(){Dt.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>m1(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>m1(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&T3e({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{f3e(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=Ge.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),x3e({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(n=>{this.logger_("error while creating EME key session",n),this.player_.error({message:"Failed to initialize media keys for EME",code:3,metadata:{errorType:Dt.Error.EMEKeySessionCreationError}})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,n=C3e({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",r=>{this.playlistController_.updatePlaylistByKeyStatus(r.keyId,r.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!n){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=Dt.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{A3e(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{IB(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":TB,"mux.js":m3e,"mpd-parser":v3e,"m3u8-parser":b3e,"aes-decrypter":y3e}}version(){return this.constructor.version()}canChangeType(){return gB.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&Ge.URL.revokeObjectURL&&(Ge.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,n){return kge({playlist:this.playlistController_.media(),time:e,callback:n})}seekToProgramTime(e,n,r=!0,i=2){return VL({programTime:e,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})}setupXhrHooks_(){this.xhr.onRequest=e=>{DB(this.xhr,e)},this.xhr.onResponse=e=>{OB(this.xhr,e)},this.xhr.offRequest=e=>{NB(this.xhr,e)},this.xhr.offResponse=e=>{FB(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const wv={name:"videojs-http-streaming",VERSION:TB,canHandleSource(t,e={}){const n=Gi(Dt.options,e);return wv.canPlayType(t.type,n)},handleSource(t,e,n={}){const r=Gi(Dt.options,n);return e.vhs=new PB(t,e,r),e.vhs.xhr=PL(),e.vhs.setupXhrHooks_(),e.vhs.src(t.src,t.type),e.vhs},canPlayType(t,e){const n=hP(t);if(!n)return"";const r=wv.getOverrideNative(e);return!Ba.supportsTypeNatively(n)||r?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t,n=!(Dt.browser.IS_ANY_SAFARI||Dt.browser.IS_IOS),{overrideNative:r=n}=e;return r}};A4("avc1.4d400d,mp4a.40.2")&&Dt.getTech("Html5").registerSourceHandler(wv,0),Dt.VhsHandler=PB,Dt.VhsSourceHandler=wv,Dt.Vhs=Ba,Dt.use||Dt.registerComponent("Vhs",Ba),Dt.options.vhs=Dt.options.vhs||{},(!Dt.getPlugin||!Dt.getPlugin("reloadSourceOnError"))&&Dt.registerPlugin("reloadSourceOnError",g3e);const kB=t=>{const{userTrainingSaveData:e,updateUserTraining:n}=vr(),r=N.useRef(null),i=N.useRef(null),{options:a,onReady:s,currentItem:l}=t,[c,u]=N.useState(!1),d=m=>{if(e!==null){const g=e==null?void 0:e.findIndex(v=>(v==null?void 0:v.fieldId)===(l==null?void 0:l.uuid));if(g>=0){const v=m.target;e[g].seenTime=v.currentTime}}},f=m=>{const g=[...e],v=g==null?void 0:g.findIndex(A=>(A==null?void 0:A.fieldId)===(m==null?void 0:m.uuid));v>=0&&(g[v]={...e[v],isSeen:!0},n(g),h("Ended"))};N.useEffect(()=>{if(i.current){const m=i.current;m.autoplay(a.autoplay),m.src(a.sources)}else{const m=r.current;if(!m)return;const g=i.current=Dt(m,a,()=>{Dt.log("player is ready"),s&&s(g)})}},[a,r]);const h=m=>{const g=i.current,v=e!==null?e.findIndex(A=>(A==null?void 0:A.fieldId)===(l==null?void 0:l.uuid)):-1;v>=0&&e[v].logs.push({action:m,videoTime:e[v].seenTime,totalTime:g.duration(),timeState:new Date}),n(e)};return N.useEffect(()=>{if(!c&&e!==null){const m=e.findIndex(g=>(g==null?void 0:g.fieldId)===(l==null?void 0:l.uuid));m>=0&&(u(!0),i.current.currentTime(e[m].seenTime))}},[e]),N.useEffect(()=>{const m=i.current;return()=>{m&&(m.dispose(),i.current=null)}},[i]),o.jsx("div",{"data-vjs-player":!0,children:o.jsx("video",{onPause:()=>{h("Pause")},onPlay:()=>{h("Play")},onEnded:()=>{f(l)},onTimeUpdate:d,ref:r,className:"video-js vjs-big-play-centered"})})},_3e=t=>{var w,T,C,_,E;const{field:e}=t,n=N.useRef(null),{userSelectedLanguage:r}=on(),{isPreview:i,media:a}=Zt(),s=(w=a==null?void 0:a.video)!=null&&w.MediaVideo?(T=a==null?void 0:a.video)==null?void 0:T.MediaVideo:()=>o.jsx(o.Fragment,{}),l=O=>{n.current=O,O.on("waiting",()=>{Dt.log("player is waiting")}),O.on("dispose",()=>{Dt.log("player will dispose")})},[c,u]=N.useState(!1),[d,f]=N.useState(!1),h=()=>{f(!0)},m=()=>{f(!1)},g=O=>{u(O)},v=()=>{u(!1)},A=N.useCallback(O=>o.jsx(kB,{options:{autoplay:!1,controls:!0,responsive:!0,fluid:!0,sources:[{src:O}]},currentItem:e,onReady:l,onUpdate:()=>{}}),[e==null?void 0:e.media_file_id]),S=N.useCallback(O=>o.jsx(s,{mediaId:O,alt:""}),[e==null?void 0:e.media_file_id]),x=o.jsxs("div",{onMouseOver:h,onMouseOut:m,children:[!i&&d&&o.jsx(jr,{handleFieldSettingsSidebar:g,...t}),o.jsx("div",{className:i?"py-4 px-2":"field-form-builder py-4 px-2",children:o.jsx("div",{className:"field",children:o.jsx("div",{className:"grid",children:o.jsx("div",{className:"col-12",children:o.jsxs("div",{className:"mt-3",children:[o.jsxs("label",{className:"flex font-medium mb-3 text-700 text-2xl",children:[" ",(C=e==null?void 0:e.title)==null?void 0:C[r==null?void 0:r.type]," -"," ",e==null?void 0:e.videoDuration]}),(e==null?void 0:e.isExternalSource)===!0&&o.jsx(o.Fragment,{children:(e==null?void 0:e.media_url)&&A((_=e==null?void 0:e.media_url)==null?void 0:_[r==null?void 0:r.type])}),(e==null?void 0:e.isExternalSource)===!1?(e==null?void 0:e.media_file_id)!==void 0&&(e==null?void 0:e.media_file_id)!==null?o.jsx(o.Fragment,{children:S(e==null?void 0:e.media_file_id)}):o.jsx(o.Fragment,{children:(e==null?void 0:e.media_url)&&A((E=e==null?void 0:e.media_url)==null?void 0:E[r==null?void 0:r.type])}):o.jsx(o.Fragment,{})]})})})})})]});return o.jsxs(o.Fragment,{children:[o.jsx(N1e,{visibilty:c,closeSettingFieldSidebar:v,...t}),o.jsx(wi,{...t,fieldWrap:x})]})},D3e=t=>{const{isPreview:e}=Zt(),[n,r]=N.useState(!1),i=()=>{r(!0)},a=()=>{r(!1)},s=o.jsxs("div",{onMouseOver:i,onMouseOut:a,children:[!e&&n&&o.jsx(jr,{handleFieldSettingsSidebar:()=>{},...t}),o.jsx("div",{className:e?"":"field-form-builder",children:o.jsx("div",{className:"grid",children:o.jsx("div",{className:"col-12",children:o.jsx("div",{className:"hr-divider"})})})})]});return o.jsx(o.Fragment,{children:o.jsx(wi,{...t,fieldWrap:s})})},O3e=t=>{var Y,ge,ie,J,Q,se,be,Ce,Te,ye,Ae;const{isPreview:e,isAdmin:n,isRenderView:r}=Zt(),{field:i,fieldIndex:a,row:s}=t,{task_status:l,taskRegisterData:c,updateTaskRegisterData:u,updateTaskProgressValue:d,userTaskSubmitFormData:f,updateUserFormDataSubmit:h,TASK_PUBLISHED:m}=vr(),{userSelectedLanguage:g}=on(),[v,A]=N.useState(!1),[S,x]=N.useState(""),[w,T]=N.useState(0),[C,_]=N.useState(!1),[E,O]=N.useState(!1),P=()=>{O(!0)},B=()=>{O(!1)},M=re=>new Date(re),H=()=>{var re,U,Z;if(s!=null&&s.rowIsRepeatable){if(s!=null&&s.repeatableFields){const K=[...s.repeatableFields],de=Tt.findIndex(K,function(Ee){return Ee.uuid===(i==null?void 0:i.uuid)});de>=0&&K[de].fieldData?x(K[de].fieldData):x("")}}else{const K=f;if(K!=null&&K.length){for(const de of K)if(de.fieldId===t.field.uuid&&((re=de==null?void 0:de.postData[0])==null?void 0:re.postValue)!==""&&((U=de==null?void 0:de.postData[0])!=null&&U.postValue)){x(M((Z=de==null?void 0:de.postData[0])==null?void 0:Z.postValue));break}}}_(!0)};N.useEffect(()=>{C||H();const re=Xt.addListener("clearRepeatableFields",de=>{de===(s==null?void 0:s.uuid)&&(x(""),T(0),i.isValid=0)}),U=Xt.addListener("onSubmitUserForm",()=>{var de;(de=i==null?void 0:i.attributes)!=null&&de.required?S?i.isValid=1:i.isValid=0:i.isValid=1}),Z=Xt.addListener("OnInvalidFieldCatch",de=>{i.uuid===(de==null?void 0:de.fieldId)?T(1):T(0)}),K=Xt.addListener("OnGetFieldValue",de=>{var me;const Ee=(me=de==null?void 0:de.repeatableColumn)==null?void 0:me.filter(pe=>(pe==null?void 0:pe.fieldUuid)===(i==null?void 0:i.uuid));Ee!=null&&Ee.length});return()=>{U.remove(),Z.remove(),re.remove(),K.remove()}});const k=re=>{A(re)},z=()=>{A(!1)},ue=re=>{var K,de;x(re.target.value);const U=f,Z=Tt.cloneDeep(c);if(U!==null){if((K=re==null?void 0:re.target)!=null&&K.value){if(Z[i==null?void 0:i.uuid]=(de=re==null?void 0:re.target)==null?void 0:de.value,(U==null?void 0:U.length)>0)for(const Ee of U)Ee.fieldId===t.field.uuid&&(Ee.postData[0]={postValue:re.target.value})}else if(delete Z[i==null?void 0:i.uuid],(U==null?void 0:U.length)>0)for(const Ee of U)Ee.fieldId===t.field.uuid&&(Ee.postData[0]={postValue:""})}if(!(s!=null&&s.rowIsRepeatable)){u(Z);const Ee=Object.keys(Z).length;d(Ee)}},fe=(re,U)=>{var Z;if(x(U),(f==null?void 0:f.length)>0){const K=[...f],de=Tt.findIndex(K,function(me){return me.rowId===(s==null?void 0:s.uuid)});let Ee=(Z=f[de])==null?void 0:Z.repeatableFields;Ee={...Ee,[re.uuid]:U},K[de]={...K[de],repeatableFields:Ee},h(K),U!==""?re.isValid=1:re.isValid=0}},ne=new Date(i==null?void 0:i.minDate),R=new Date(i==null?void 0:i.maxDate),ae=o.jsxs("div",{onMouseOver:P,onMouseOut:B,children:[!r&&!e&&E&&o.jsx(jr,{type:"",handleFieldSettingsSidebar:k,...t}),o.jsxs("div",{className:`field ${e?" ":" builder-element-wrapper "}${(i==null?void 0:i.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:[o.jsx("div",{className:"grid",children:o.jsxs("div",{className:"col-12 ",children:[(i==null?void 0:i.showHeaderText)&&o.jsx("h6",{children:(Y=i==null?void 0:i.headerText)==null?void 0:Y[g==null?void 0:g.type]}),(i==null?void 0:i.showLabel)&&o.jsxs("label",{htmlFor:a,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(ia,{update:function(){throw new Error("Function not implemented.")},value:{fieldId:void 0,uuid:void 0},...t}),((ge=i==null?void 0:i.attributes)==null?void 0:ge.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",e?o.jsx(o.Fragment,{children:(ie=i==null?void 0:i.label)==null?void 0:ie[g==null?void 0:g.type]}):o.jsx(Zi,{...t}),(i==null?void 0:i.showToolTip)&&o.jsx("span",{className:"ml-3",children:(i==null?void 0:i.showToolTip)&&o.jsx(Mi,{message:(J=i==null?void 0:i.toolTip)==null?void 0:J[g==null?void 0:g.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("span",{className:"p-input-icon-"+(i==null?void 0:i.iconAlignment),children:[(i==null?void 0:i.showIcon)&&o.jsx("i",{className:"pi pi-"+((se=(Q=i==null?void 0:i.icon)==null?void 0:Q.properties)==null?void 0:se.name)}),o.jsx(J1,{readOnlyInput:!0,numberOfMonths:i==null?void 0:i.noOfMonths,selectionMode:(i==null?void 0:i.dateRange)||"single",view:(i==null?void 0:i.calenderView)||!1,showButtonBar:(i==null?void 0:i.isTodayBtn)||!1,showIcon:(i==null?void 0:i.isIcon)||!1,id:i==null?void 0:i.uuid,dateFormat:i==null?void 0:i.dateFormat,placeholder:(be=i==null?void 0:i.placeholder)==null?void 0:be[g==null?void 0:g.type],value:S,onFocus:()=>T(1),onChange:re=>{s!=null&&s.rowIsRepeatable?fe(i,re.target.value):ue(re)},minDate:ne,maxDate:R,className:w===1&&((Ce=i==null?void 0:i.attributes)!=null&&Ce.required)?S?"valid":"invalid":"valid'",disabled:l===m})]}),o.jsx("div",{children:((Te=i==null?void 0:i.attributes)==null?void 0:Te.required)&&o.jsx("small",{className:"error",children:w===1&&!S?(ye=i==null?void 0:i.validationMesssage)==null?void 0:ye.english:""})}),o.jsx("div",{children:(i==null?void 0:i.showHelperText)&&o.jsx("small",{children:(Ae=i==null?void 0:i.helperText)==null?void 0:Ae[g==null?void 0:g.type]})})]})]})}),n&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})]});return o.jsxs(o.Fragment,{children:[v===!0&&o.jsx(Xi,{visibilty:v,closeSettingFieldSidebar:z,...t},i==null?void 0:i.uuid),o.jsx(wi,{...t,fieldWrap:ae})]})},N3e=t=>{var be,Ce,Te,ye,Ae,re,U,Z;const e=N.useRef(null),{task_status:n,taskRegisterData:r,updateTaskRegisterData:i,updateTaskProgressValue:a,updateUserFormDataSubmit:s,userTaskSubmitFormData:l,onSetValuetoPostDataHook:c,TASK_PUBLISHED:u}=vr(),{userSelectedLanguage:d,fieldSettingUpdate:f}=on(),{field:h,fieldIndex:m,columnIndex:g,sectionIndex:v,rowIndex:A,pageIndex:S,row:x}=t,{isAdmin:w,isPreview:T,isRenderView:C}=Zt(),[_,E]=N.useState(!1),[O,P]=N.useState(0),[B,M]=N.useState(!1),[H,k]=N.useState(null),[z,ue]=N.useState(!1),fe=()=>{ue(!0)},ne=()=>{ue(!1)},R=()=>{var K;(K=e==null?void 0:e.current)==null||K.clear(),h.isValid=0,f(S,v,A,g,m,h),k(null),c(t,h,"")},ae=()=>{var de,Ee,me;const K=l;if((K==null?void 0:K.length)>0)for(const pe of K)pe.fieldId===t.field.uuid&&((de=pe==null?void 0:pe.postData[0])!=null&&de.postValue&&((Ee=pe==null?void 0:pe.postData[0])==null?void 0:Ee.postValue)!==""&&(k((me=pe==null?void 0:pe.postData[0])==null?void 0:me.postValue),M(!0)),h.isValid=1);M(!0)},Y=()=>{var K,de,Ee,me;if(l!=null&&l.length){const pe=[...l],ke=Tt.findIndex(pe,function(ve){return ve.rowId===(x==null?void 0:x.uuid)});let Oe=(K=l[ke])==null?void 0:K.repeatableFields;Oe={...Oe,[h==null?void 0:h.uuid]:`<img src="${(de=e.current)==null?void 0:de.toDataURL()}" >`},pe[ke]={...pe[ke],repeatableFields:Oe},s(pe)}k(((Ee=e.current)==null?void 0:Ee.toDataURL())||""),((me=e.current)==null?void 0:me.toDataURL())!==""?h.isValid=1:h.isValid=0};N.useEffect(()=>{B||ae();const K=Xt.addListener("clearRepeatableFields",pe=>{pe===(x==null?void 0:x.uuid)&&(k(null),R(),P(0),h.isValid=0,f(S,v,A,g,m,h))}),de=Xt.addListener("onSubmitUserForm",()=>{var pe;(pe=h==null?void 0:h.attributes)!=null&&pe.required?(H!==null?h.isValid=1:h.isValid=0,f(S,v,A,g,m,h)):h.isValid=1}),Ee=Xt.addListener("OnInvalidFieldCatch",pe=>{h.uuid===(pe==null?void 0:pe.fieldId)?P(1):P(0)}),me=Xt.addListener("OnSignatureSettingChange",()=>{R()});return()=>{de.remove(),Ee.remove(),me.remove(),K.remove()}});const ge=K=>{E(K)},ie=()=>{E(!1)},J=()=>{var de,Ee,me,pe;const K=l;if(l!=null&&l.length){const ke=Tt.cloneDeep(r);if(ke[h==null?void 0:h.uuid]=(de=e.current)==null?void 0:de.toDataURL(),(K==null?void 0:K.length)>0){for(const Oe of K)if(Oe.fieldId===t.field.uuid){Oe.postData[0]={postValue:(Ee=e.current)==null?void 0:Ee.toDataURL()},k(((me=e.current)==null?void 0:me.toDataURL())||null);break}}if(!(x!=null&&x.rowIsRepeatable)){i(ke);const Oe=(pe=Object.keys(ke))==null?void 0:pe.length;a(Oe)}}},Q=()=>{var K,de,Ee;return`rgba(${(K=h==null?void 0:h.backgroundColor)==null?void 0:K.r}, ${(de=h==null?void 0:h.backgroundColor)==null?void 0:de.g}, ${(Ee=h==null?void 0:h.backgroundColor)==null?void 0:Ee.b}, 0.8)`};console.log("task_status",n),console.log("isAdmin",w),console.log("((task_status === TASK_STATUS_PENDING_ONE) && isAdmin === false)");const se=o.jsxs("div",{onMouseOver:fe,onMouseOut:ne,children:[!C&&!T&&z&&o.jsx(jr,{handleFieldSettingsSidebar:ge,...t}),o.jsx("div",{className:`field ${T?" ":" builder-element-wrapper "}${(h==null?void 0:h.isFluid)===!0?" card py-3 px-4 p-fluid":"card py-3 px-4"}`,children:o.jsxs("div",{className:"grid",children:[o.jsxs("div",{className:T?"col-12":"col-11",children:[(h==null?void 0:h.showHeaderText)&&o.jsx("h6",{children:(be=h==null?void 0:h.headerText)==null?void 0:be[d==null?void 0:d.type]}),(h==null?void 0:h.showLabel)&&o.jsxs("label",{htmlFor:h.uuid,className:"flex font-medium mb-3 text-700 text-2xl",children:[o.jsx(ia,{...t}),((Ce=h==null?void 0:h.attributes)==null?void 0:Ce.required)&&o.jsx("span",{className:"must-required mr-1",children:"*"})," ",T?o.jsx(o.Fragment,{children:(Te=h==null?void 0:h.label)==null?void 0:Te[d==null?void 0:d.type]}):o.jsx(Zi,{...t}),o.jsx("span",{className:"ml-3",children:(h==null?void 0:h.showToolTip)&&o.jsx(Mi,{message:(ye=h==null?void 0:h.toolTip)==null?void 0:ye[d==null?void 0:d.type],position:"right"})})]}),o.jsxs("div",{className:"mt-3",children:[n!==u&&H===null&&o.jsx(vE,{backgroundColor:Q(),penColor:`#${h==null?void 0:h.penColor}`,canvasProps:{width:`${h==null?void 0:h.canvasWidth}`,height:h==null?void 0:h.canvasHeight,className:"sigCanvas"},ref:e,onEnd:()=>{x!=null&&x.rowIsRepeatable?Y():J()}},h==null?void 0:h.uuid),n===u&&H!==null&&o.jsx("img",{alt:"",src:H,style:{width:350,height:200}}),n!==6&&H!==null&&o.jsx("img",{alt:"",src:H,style:{width:350,height:200}}),o.jsx("div",{children:((Ae=h==null?void 0:h.attributes)==null?void 0:Ae.required)&&o.jsx("small",{className:"error",children:O===1&&!H?(re=h==null?void 0:h.validationMesssage)==null?void 0:re.english:""})}),o.jsx("div",{className:"mt-3",children:(h==null?void 0:h.showHelperText)&&o.jsx("small",{children:(U=h==null?void 0:h.helperText)==null?void 0:U[d==null?void 0:d.type]})}),n===a3&&o.jsx(o.Fragment,{children:w===!1&&o.jsx(Pt,{text:!0,label:(Z=h==null?void 0:h.clearSignatureButtonLabel)==null?void 0:Z[d==null?void 0:d.type],onClick:()=>R(),className:"p-button-raised p-button-text mt-3"})})]})]}),w&&o.jsxs(o.Fragment,{children:[o.jsx("hr",{}),o.jsx(Ni,{...t})]})]})})]});return o.jsxs(o.Fragment,{children:[_===!0&&o.jsx(Xi,{visibilty:_,closeSettingFieldSidebar:ie,...t}),o.jsx(wi,{...t,fieldWrap:se})]})};function cg(){return cg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},cg.apply(this,arguments)}function ug(t){"@babel/helpers - typeof";return ug=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ug(t)}function F3e(t,e){if(ug(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(ug(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function P3e(t){var e=F3e(t,"string");return ug(e)==="symbol"?e:String(e)}function HA(t,e,n){return e=P3e(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k3e(t){if(Array.isArray(t))return t}function M3e(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function zA(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function MB(t,e){if(t){if(typeof t=="string")return zA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zA(t,e)}}function L3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3741
3741
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v1(t,e){return k3e(t)||M3e(t,e)||MB(t,e)||L3e()}var B3e={header:"p-galleria-header",footer:"p-galleria-footer",closeIcon:"p-galleria-close-icon",closeButton:"p-galleria-close p-link",root:function(e){var n=e.props,r=e.context,i=e.thumbnailsPosClassName,a=e.indicatorPosClassName;return ht("p-galleria p-component",{"p-galleria-fullscreen":n.fullScreen,"p-galleria-indicator-onitem":n.showIndicatorsOnItem,"p-galleria-item-nav-onhover":n.showItemNavigatorsOnHover&&!n.fullScreen,"p-input-filled":r&&r.inputStyle==="filled"||qn.inputStyle==="filled","p-ripple-disabled":r&&r.ripple===!1||qn.ripple===!1},i,a)},content:"p-galleria-content",mask:function(e){var n=e.visibleState;return ht("p-galleria-mask",{"p-galleria-visible":n})},thumbnailItem:function(e){var n=e.subProps;return ht("p-galleria-thumbnail-item",{"p-galleria-thumbnail-item-current":n.current,"p-galleria-thumbnail-item-active":n.active,"p-galleria-thumbnail-item-start":n.start,"p-galleria-thumbnail-item-end":n.end})},thumbnailItemContent:"p-galleria-thumbnail-item-content",previousThumbnailIcon:"p-galleria-thumbnail-prev-icon",previousThumbnailButton:function(e){var n=e.isDisabled;return ht("p-galleria-thumbnail-prev p-link",{"p-disabled":n})},nextThumbnailIcon:"p-galleria-thumbnail-next-icon",nextThumbnailButton:function(e){var n=e.isDisabled;return ht("p-galleria-thumbnail-next p-link",{"p-disabled":n})},thumbnailContainer:"p-galleria-thumbnail-container",thumbnailItemsContainer:"p-galleria-thumbnail-items-container",thumbnailItems:"p-galleria-thumbnail-items",thumbnailWrapper:"p-galleria-thumbnail-wrapper",previousItemIcon:"p-galleria-item-prev-icon",previousItemButton:function(e){var n=e.isDisabled;return ht("p-galleria-item-prev p-galleria-item-nav p-link",{"p-disabled":n})},nextItemIcon:"p-galleria-item-next-icon",nextItemButton:function(e){var n=e.isDisabled;return ht("p-galleria-item-next p-galleria-item-nav p-link",{"p-disabled":n})},caption:"p-galleria-caption",indicator:function(e){var n=e.isActive;return ht("p-galleria-indicator",{"p-highlight":n})},indicators:"p-galleria-indicators p-reset",itemWrapper:"p-galleria-item-wrapper",itemContainer:"p-galleria-item-container",item:"p-galleria-item",transition:"p-galleria"},V3e=`
|
|
3742
3742
|
@layer primereact {
|
|
3743
3743
|
.p-galleria-content {
|
|
@@ -32910,7 +32910,7 @@ const z0 = function(e, n, r) {
|
|
|
32910
32910
|
}, vP = Lf(void 0), Jte = ({ children: t, option: e, saveFormBuilderSchema: n, templateSchema: r, onChange: i }) => {
|
|
32911
32911
|
const a = { ...R7, ...r }, [s, o] = EO(BZ, a);
|
|
32912
32912
|
mn(() => {
|
|
32913
|
-
n(s);
|
|
32913
|
+
n && n(s);
|
|
32914
32914
|
}, [s]);
|
|
32915
32915
|
const { isPreview: l, isAdmin: u, isRenderView: d, renderType: f, isAdvanceView: p, globalAlignment: g = "ltr", emitSocketData: m, media: v, reusableComponent: A, saveFormProgress: w, showSettings: S } = e;
|
|
32916
32916
|
return /* @__PURE__ */ c(vP.Provider, { value: { media: v, isPreview: l, isAdmin: u, isRenderView: d, renderType: f, isAdvanceView: p, globalAlignment: g, emitSocketData: m, reusableComponent: A, state: s, dispatch: o, onChange: i, saveFormProgress: w, showSettings: S }, children: /* @__PURE__ */ c(q0, { backend: z0, children: t }) });
|
|
@@ -58557,7 +58557,7 @@ var Yue = function() {
|
|
|
58557
58557
|
theme: i.theme,
|
|
58558
58558
|
formats: i.formats
|
|
58559
58559
|
};
|
|
58560
|
-
Yue ? C(new Quill(d.current, M)) : import("./quill-
|
|
58560
|
+
Yue ? C(new Quill(d.current, M)) : import("./quill-D3turcM3.js").then(function(q) {
|
|
58561
58561
|
if (q && Ee.isExist(d.current)) {
|
|
58562
58562
|
var P;
|
|
58563
58563
|
q.default ? P = new q.default(d.current, M) : P = new q(d.current, M), C(P);
|
|
@@ -100649,7 +100649,9 @@ const JV = (t) => {
|
|
|
100649
100649
|
}, Q = () => {
|
|
100650
100650
|
var H, ue, _e;
|
|
100651
100651
|
return `rgba(${(H = p == null ? void 0 : p.backgroundColor) == null ? void 0 : H.r}, ${(ue = p == null ? void 0 : p.backgroundColor) == null ? void 0 : ue.g}, ${(_e = p == null ? void 0 : p.backgroundColor) == null ? void 0 : _e.b}, 0.8)`;
|
|
100652
|
-
}
|
|
100652
|
+
};
|
|
100653
|
+
console.log("task_status", n), console.log("isAdmin", x), console.log("((task_status === TASK_STATUS_PENDING_ONE) && isAdmin === false)");
|
|
100654
|
+
const ce = /* @__PURE__ */ I("div", { onMouseOver: de, onMouseOut: te, children: [
|
|
100653
100655
|
!C && !T && z && /* @__PURE__ */ c(kr, { handleFieldSettingsSidebar: pe, ...t }),
|
|
100654
100656
|
/* @__PURE__ */ c(
|
|
100655
100657
|
"div",
|
|
@@ -100714,7 +100716,7 @@ const JV = (t) => {
|
|
|
100714
100716
|
),
|
|
100715
100717
|
/* @__PURE__ */ c("div", { children: ((ye = p == null ? void 0 : p.attributes) == null ? void 0 : ye.required) && /* @__PURE__ */ c("small", { className: "error", children: N === 1 && !q ? (ne = p == null ? void 0 : p.validationMesssage) == null ? void 0 : ne.english : "" }) }),
|
|
100716
100718
|
/* @__PURE__ */ c("div", { className: "mt-3", children: (p == null ? void 0 : p.showHelperText) && /* @__PURE__ */ c("small", { children: (B = p == null ? void 0 : p.helperText) == null ? void 0 : B[d == null ? void 0 : d.type] }) }),
|
|
100717
|
-
n === Kg && x === !1 && /* @__PURE__ */ c(
|
|
100719
|
+
n === Kg && /* @__PURE__ */ c(Ce, { children: x === !1 && /* @__PURE__ */ c(
|
|
100718
100720
|
Pt,
|
|
100719
100721
|
{
|
|
100720
100722
|
text: !0,
|
|
@@ -100722,7 +100724,7 @@ const JV = (t) => {
|
|
|
100722
100724
|
onClick: () => G(),
|
|
100723
100725
|
className: "p-button-raised p-button-text mt-3"
|
|
100724
100726
|
}
|
|
100725
|
-
)
|
|
100727
|
+
) })
|
|
100726
100728
|
] })
|
|
100727
100729
|
] }),
|
|
100728
100730
|
x && /* @__PURE__ */ I(Ce, { children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ml = Object.defineProperty;
|
|
2
2
|
var Dl = (n, t, e) => t in n ? Ml(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
3
|
var T = (n, t, e) => (Dl(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import { d as ti, i as Rr, a as Hi, b as Ul, e as Br, M as Pl, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as jl, n as Hl, o as Fi, p as $l, q as Fl, r as zl, s as Kl, t as ii, u as Gl, v as Vl, w as Ft, x as zi, y as xe } from "./main-
|
|
4
|
+
import { d as ti, i as Rr, a as Hi, b as Ul, e as Br, M as Pl, S as ei, U as si, g as ni, c as ri, f as fr, h as zs, j as $i, k as Vs, l as dr, m as jl, n as Hl, o as Fi, p as $l, q as Fl, r as zl, s as Kl, t as ii, u as Gl, v as Vl, w as Ft, x as zi, y as xe } from "./main-BvT_Y_VB.js";
|
|
5
5
|
function Ki(n) {
|
|
6
6
|
return n;
|
|
7
7
|
}
|