@choiceform/os-client-core 2.1.64 → 2.1.65
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/README.md +27 -27
- package/dist/core.js +1 -1
- package/dist/infer.js +414 -414
- package/dist/modern/core.js +1 -1
- package/dist/modern/web-core.js +2 -2
- package/dist/support/atcp.js +1 -1
- package/dist/web-core.js +2 -2
- package/enum2union.js +27 -27
- package/index.d.ts +10059 -10059
- package/package.json +1 -1
package/dist/modern/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=53)}([function(t,e,n){"use strict";n.d(e,"f",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"e",(function(){return d})),n.d(e,"b",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"g",(function(){return p})),n.d(e,"a",(function(){return O}));var r=n(8),i=n(1);let o,c=null,a=null,s=Object(i.a)(()=>r.a.trigger("SET_PROPS"),150);function u(t){a=t}function l(){if(!a)throw new Error("Env not yet initialized");return a}function d(t){c=t,c.silentSetter&&(s=null)}function f(){if(!c)throw new Error("Client not yet initialized");return c}function b(){return f().realTimePreview?"realtime_preview":f().preview?"preview":"formal"}function p(t,e){t&&e&&(o(t,e),s&&s())}function O(t){o=t}r.a.on("ERROR_ABORT",(t,e)=>{f().error(e)})},function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"t",(function(){return c})),n.d(e,"k",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"h",(function(){return u})),n.d(e,"i",(function(){return l})),n.d(e,"s",(function(){return d})),n.d(e,"l",(function(){return f})),n.d(e,"g",(function(){return b})),n.d(e,"f",(function(){return p})),n.d(e,"p",(function(){return O})),n.d(e,"m",(function(){return m})),n.d(e,"o",(function(){return g})),n.d(e,"b",(function(){return j})),n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"r",(function(){return w})),n.d(e,"n",(function(){return _})),n.d(e,"j",(function(){return x}));var r=n(7);const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");function o(t){return t.replace(/</g,"_-v-w^l-t-_").replace(/>/g,"^-v-w_g-t-^")}function c(t){return t.replace(/_-v-w\^l-t-_/g,"<").replace(/\^-v-w_g-t-\^/g,">")}function a(t,e){return e}function s(t=1,e=5){const n=b(t,e),r=i.length;let o="";for(let t=0;t<n;t++){const t=b(0,r);o+=i[t]}return o}function u(t,e){return e&&e.forEach(e=>{t+="-"+d(e.varList[e.currentIndex].uuid)}),t}function l(){const t=new Array(36);let e,n=0;for(let r=0;r<36;r++)8==r||13==r||18==r||23==r?t[r]="-":14==r?t[r]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),e=15&n,n>>=4,t[r]=i[19==r?3&e|8:e]);return t.join("").toLowerCase()}function d(t){return t.substr(t.length-8)}function f(t="",e=""){return t=t.toLowerCase(),e=e.toLowerCase(),8===t.length&&e.length>8?t===d(e):t.length>8&&8===e.length?d(t)===e:t===e}function b(t,e){return t>e&&([t,e]=[e,t]),t+p(e-t+1)}function p(t){return Math.floor(Math.random()*t)}function O(t,e){const n=[...t];if(Object(r.b)(e))return n;if(0===(e=Number(e)))return[];if(e<0||isNaN(e))return n;if(1===e)return n.splice(p(n.length),1);const i=[];for(n.length<e&&(e=n.length);i.length<e;){const t=p(n.length);i.push(n.splice(t,1)[0])}return i}function m(t,e){t&&"object"==typeof t&&Object.keys(t).forEach(n=>{const r=t[n];Array.isArray(r)&&r.forEach(t=>{m(t,e)}),"object"==typeof r&&m(r,e),e(t,n)})}function g(t,e){if(t<e)throw new Error("can not random distribute");const n=function(t,e){const n=[];for(;n.length<e;){const e=b(1,t-1);n.includes(e)||n.push(e)}return n.sort((t,e)=>t>e?1:-1),n}(t,e-1),r=n.map((t,e)=>t-(n[e-1]||0));return r.push(t-n[n.length-1]),r}function j(t){const e=new WeakMap;return function t(n){if(!n||"object"!=typeof n)return n;if(n instanceof Array)return n.map(e=>t(e));const r=e.get(n);if(r)return r;const i={};return e.set(n,i),Object.keys(n).forEach(e=>{i[e]=t(n[e])}),i}(t)}function h(t){setTimeout(()=>{throw"string"==typeof t?new Error(t):t})}function y(t,e=0){let n=-1;return function(){const r=arguments,i=this;clearTimeout(n),n=setTimeout(()=>{t.apply(i,r)},e)}}async function v(t,e,n){const r=[];t.replace(e,(t,...e)=>(r.push(n(t,...e)),t));const i=await Promise.all(r);return t.replace(e,()=>i.shift())}function w(t=0){return new Promise(e=>setTimeout(e,t))}function _(t){return Promise.resolve(t)}function x(t){return t instanceof Promise?t:_(t)}},function(t,e,n){"use strict";n.d(e,"g",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"b",(function(){return p})),n.d(e,"f",(function(){return O}));var r=n(8),i=n(3),o=n(0),c=n(9);let a=!1;const s=["zh_cn","en_us"];async function u(t){const e=i.d();let n=e[t=t.toLowerCase()];n||(n=e[t="en_us"]);if(!i.c()[t]){let e;try{e=await Object(c.b)(n,{type:"GET"})}catch(t){e=await Object(c.b)(n.replace(".com/",".io/"),{type:"GET"})}i.g(t,e)}}function l(t,e){let n=Object(o.c)().storage.get("language")||function(){const t=Object(o.c)().system.getLang();return t?t.replace(/-/g,"_").toLowerCase():"en_us"}();if(t&&e){t.some(t=>t.id===n)||(n=e)}return n}function d(t,e){t!==Object(o.c)().storage.get("language")&&(b(t,!0),e&&Object(o.c)().storage.set("lang-resume","true"),Object(o.c)().hook.beforeForceLeave(),Object(o.c)().app.reload())}function f(t){let e="en_us";s.includes(t)&&(e=t),i.h(e),Object(o.b)().setLocale(e),r.a.trigger("LANG_CHANGE"),Object(o.c)().hook.onLangChange(e)}function b(t="en_us",e=!1){return Object(o.c)().storage.set("language",t),e||f(t),a=!0,t}function p(t){return t.replace(/\{(\w+),.+?(\w+)\}\s?\}/g,(t,e,n)=>`{${e}} ${n}`)}function O(t,e){a||a||b(l());const n=i.e(t);return n?e?Object(o.c)().system.translate(n,e):n:`missing translation for ${t} ${i.b()}`}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"f",(function(){return u})),n.d(e,"d",(function(){return l})),n.d(e,"c",(function(){return d})),n.d(e,"g",(function(){return f})),n.d(e,"h",(function(){return b})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return O}));const r={en_us:"https://media.choiceform.com/os-client-core/assets/en_us-8617c82e.json",zh_cn:"https://media.choiceform.com/os-client-core/assets/zh_cn-477e771a.json"};let i=!1,o=new Proxy({},{get(){throw new Error("Cannot access LANG before initializing")}}),c="zh_cn";const a={},s=(t,e,n)=>{const r=n||{};return Object.keys(t).forEach(i=>{const o=t[i],c=e?e+"."+i:i;r[i]="string"==typeof o?c:s(t[i],c,n&&n[i])}),r};function u(t){t&&Object.keys(t).forEach(e=>{r[e.toLowerCase()]=t[e]})}function l(){return{...r}}function d(){return{...a}}function f(t,e){i||(o=s(e,"",{}),i=!0),a[t]=e}function b(t){c=t.toLowerCase()}function p(){return c}function O(t){const e=a[c];if(!e)throw new Error("cannot translate before lang loading");try{const n=t.split(".");let r=n.shift(),i=e[r];for(;"object"==typeof i;)r=n.shift(),i=i[r];return i}catch(t){console.error(t)}return""}},function(t,e,n){"use strict";n.d(e,"i",(function(){return d})),n.d(e,"u",(function(){return f})),n.d(e,"f",(function(){return b})),n.d(e,"d",(function(){return p})),n.d(e,"b",(function(){return O})),n.d(e,"c",(function(){return m})),n.d(e,"s",(function(){return g})),n.d(e,"v",(function(){return j})),n.d(e,"r",(function(){return h})),n.d(e,"p",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"m",(function(){return w})),n.d(e,"o",(function(){return _})),n.d(e,"n",(function(){return x})),n.d(e,"g",(function(){return T})),n.d(e,"e",(function(){return I})),n.d(e,"j",(function(){return N})),n.d(e,"k",(function(){return E})),n.d(e,"a",(function(){return S})),n.d(e,"y",(function(){return L})),n.d(e,"z",(function(){return P})),n.d(e,"w",(function(){return M})),n.d(e,"l",(function(){return R})),n.d(e,"h",(function(){return A})),n.d(e,"x",(function(){return D})),n.d(e,"t",(function(){return U}));var r=n(6),i=n(1),o=n(5),c=n(2),a=n(0),s=n(3);const u={valid:!0,message:""},l=["region","location","area","describe","end","logic","loop","lottery","verify"];function d(t){return!0===t.answerRequired}function f(t){return"matrix"===t.type?function(t){const{randomType:e}=t;return"col"===e||"row_col"===e||"row"===e}(t):!0===t.randomOptionY}function b(t){const e=t.loopStack,n=t.nodeUuid;return Object(i.h)(n,e)}function p(t){return t.find(t=>"start"===t.type)}function O(t,e){if(e)return t.find(t=>t.input&&Object(i.l)(t.input.uuid,e)||t.loopEnd&&Object(i.l)(t.loopEnd.uuid,e))}function m(t,e,n){const r=e.find(t=>Object(i.l)(t.selfPortId,n));if(r&&r.destInputId)return O(t,r.destInputId)}function g(t){return"matrix"===t.type?"multi"===t.matrixSelect:!0===t.multiSelect}function j(t){return"matrix"===t.type?"single"===t.matrixSelect:!0!==t.multiSelect}function h(t){return"single_row"===t.matrixSelect}function y(t){return"single_col"===t.matrixSelect}function v(t){return"single_row_col"===t.matrixSelect}function w(t){return g(t)&&"all"===t.multiType}function _(t){return g(t)&&"row"===t.multiType}function x(t){return g(t)&&"col"===t.multiType}async function T(t){const e=!0===t.limitEnabled,{parent:n}=t;let r=e?await Object(o.e)(t.maxUploadCount,{state:n}):t.options.length,i=e?await Object(o.e)(t.minUploadCount,{state:n}):1;const c=t.options.length;return i||(i=1),r||(r=c),i>c&&(i=c),i>r&&(i=r),{max:r,min:i}}async function I(t){if(!g(t))return{min:1,max:1};const e="matrix"===t.type,{multiMin:n,multiMax:i}=t,{parent:c}=t;let a=await Object(o.e)(n,{state:c}),s=await Object(o.e)(i,{state:c});const u=Object(r.c)(t).length;return e||(a=function(t,e){const n={};Object(r.c)(t).forEach(t=>{Object(r.n)(t)||(n[t.mutexNumber]?n[t.mutexNumber]+=1:n[t.mutexNumber]=1)});const i=Object.keys(n).reduce((t,e)=>("0"===e||"undefined"===e?t+=n[e]:Number(e)<10&&(t+=1),t),0);return e>i&&(e=i),e}(t,a)),a||(a=1),s||(s=u),a>u&&(a=u),a>s&&(a=s),{min:a,max:s}}const k=(t,e,n,r)=>{let i=0;i=r?t.filter(t=>t[r]===e[r]&&t.selected).length:t.filter(t=>t.selected).length;const o=i<n;let a="";return o||(a=r?"xid"===r?Object(c.f)(s.a.matrix.colLimitMax,{max:n}):Object(c.f)(s.a.matrix.rowLimitMax,{max:n}):Object(c.f)(s.a.select.limitMax,{max:n})),{valid:o,message:a}};async function N(t,e){if(!g(t)||-1===e.mutexNumber||-1===e.xMutexNumber||-1===e.yMutexNumber)return u;const n=w(t);if(!n&&!Object(r.o)(e))return u;const i=Object(r.c)(t),{max:o}=await I(t);return n?k(i,e,o):x(t)?k(i,e,o,"xid"):_(t)?k(i,e,o,"yid"):u}async function E(t,e){if(!g(t))return u;const{max:n}=await I(t),i=Object(r.c)(t).filter(t=>t.selected).length===n,{mutexNumber:o}=e,a=!i||-1===o||Object(r.m)(t,o);return{valid:a,message:a?"":Object(c.f)(s.a.select.limitMax,{max:n})}}function S(t,e){return t.find(t=>Object(i.l)(t.nodeUuid,e))}const L=["logic","random","loop"],C=[...L,"data"];function P(t){Object(a.b)().preview&&t.autoSkip&&t.parent.previewShadowNodes&&!C.includes(t.type)&&(t.shadowNodes=!0,t.readonly=!0)}function M(t){if(t.forceSkipReason)return t.forceSkipReason;if("data"===t.type)return"data_hidden";if(t.autoSkip)return function(t){return Object(a.b)().preview&&t.parent.previewShadowNodes&&!C.includes(t.type)}(t)?"":"setting";if(t.randomAbandoned)return"random_group";const e=Object(r.c)(t);return!(l.indexOf(t.type)>-1)&&e&&0===e.length?"no_options":""}function R(t,e){return!(!t.circleNode1Id&&!t.circleNode2Id)&&(Object(i.l)(t.circleNode1Id,e.circleNode1Id)&&Object(i.l)(t.circleNode2Id,e.circleNode2Id))}async function A(t){const{parent:e,options:n}=t;let r=await Object(o.e)(t.total,{state:e})||100,i=0;for(const t of n){const n=await Object(o.e)(t.maxMark,{state:e});if(void 0===n){i=-1;break}i+=n}return i>0&&i<r&&(r=i),r}const D=["end","lottery","gift"];function U(t,e){return!(!t||!e)&&(!D.includes(t.type)&&!D.includes(e.type)&&(t.groupSingle&&e.groupSingle&&function(t,e){return!(!t.groupId||!e.groupId||e.groupId!==t.groupId)&&(!e.loop&&!t.loop||!(e.loop&&!t.loop||!e.loop&&t.loop||e.loop.destInputId!==t.loop.destInputId||e.loop.currentIndex!==t.loop.currentIndex))}(t,e)))}},function(t,e,n){"use strict";n.d(e,"i",(function(){return y})),n.d(e,"d",(function(){return T})),n.d(e,"f",(function(){return k})),n.d(e,"k",(function(){return N})),n.d(e,"h",(function(){return S})),n.d(e,"c",(function(){return L})),n.d(e,"g",(function(){return C})),n.d(e,"e",(function(){return P})),n.d(e,"b",(function(){return M})),n.d(e,"j",(function(){return R})),n.d(e,"a",(function(){return A}));var r=n(65);function i(t){let e=!0;try{e=!!Object(r.a)(t,!0)}catch(e){console.info("error bool: ",t)}return e}function o(t,e,n){return function(t,e,n){return!!(e.length&&""!==n&&t&&t[t.length-1].match(/[\d)]/))}(t,e,n)&&(t+=e[e.length-1]),t+n}function c(t){return"("===t[t.length-1]&&(t+="0"),t+")"}var a=n(1),s=n(46),u=n(38),l=n(40),d=n(13),f=n(42),b=n(16),p=n(22),O=n(0),m=n(34),g=n(7),j=n(10);function h(t){return t&&("var-html"===t.type||"var-request"===t.type||"var-loop"===t.type)}function y(t="",e=!1){if(t=(t=w(t,e)).replace(/</g,"<").replace(/>/g,">"),e)for(;t.indexOf("<")>-1||t.indexOf(">")>-1;)t=t.replace(/</g,"<").replace(/>/g,">");return t}function v(t=""){return t.replace(/</g,"<").replace(/>/g,">")}function w(t="",e=!1){if(t=t.replace(/&/g,"&"),e)for(;t.indexOf("&")>-1;)t.replace(/&/g,"&");return t}function _(t="",e,n,r,i){let o='<span var-name="'+n+'" class="var-light '+e+('"'+(r?'in-edist="1">':">"))+t+"</span>";return i&&(o=Object(a.d)(o)),o}function x(t=""){t.match(/<(\w+).+?<\/\1>/)||(t=`<span>${t}</span>`);return Object(m.c)(t).children}async function T(t="",e,n=!1){t+="";const{state:r,innerJoinBy:i,varInfo:o,usage:c}=e,s=e.spaceRep||"";t=w(t.replace(/ /g,s));const u=e.joinBy||" ";if(Object(d.j)(t)){const s=Object(d.l)(t),f=Object(d.i)(t,s);for(const t of f){const e=Object(d.f)(r,t);let a="";if(e?a=await L({state:r,varInfo:e,joinBy:i||u}):Object(O.b)().realTimePreview&&(a=_(t.getInnerHtml(),"var-empty",t.getText(),!1,!0)),a=Object(g.b)(a)?"":Object(g.a)(a).trim(),c){const n=e||{mapId:Object(d.c)(Object(d.g)(t))};Object(l.d)(c,n,a)}const s=!o&&e&&a&&!n;let f=[];h(e)?(s&&(a=_(a,e.type,e.name,e.inEdist,!1)),f=a?x(a):[""]):(s&&(a=_(a,e.type,e.name,e.inEdist,!0)),t.setText(a),f=[new m.b(t.getInnerHtml())]),I(t,f)}return E(function(t,e,n=""){if(h(e))return y(t.getInnerHtml());let r="";if(n){const i=[];for(const n of t.children){let t="";if(Object(a.k)(n,"node"===n.type)){if("span"===n.name&&!n.getText()&&0===n.children.length)continue;t=n.getOuterHtml()}else t=n.getText().trim(),e||(t=v(t));t&&i.push(w(t))}r=i.join(n)}else r=w(t.getInnerHtml());return r=r.replace(/([\r\n]|^\s*|\s*$)/g,"").replace(/<br>/g,""),r=w(Object(a.t)(r)),r}(s,o,u),e)}return t+""}function I(t,e){const n=t.parent;e.forEach(e=>{if("string"==typeof e){if(""!==e){const r=new m.b(e);n.insertBefore(r,t)}}else n.insertBefore(e,t)}),n.removeChild(t)}async function k(t="",e,n="NAME"){return E(N(await T(t,e,!0),n),e)}function N(t="",e="NAME"){if(!t||"string"!=typeof t)return t;t=t.replace(/<style>.*?<\/style>/g,"");let n=Object(d.l)(t).getText();return n=Object(d.l)(n).getText(),"NAME"===e?n=Object(f.c)(n):"URL"===e&&(n=Object(f.d)(n)),n.trim()}function E(t,e){return","===e.joinBy?(t+"").trim().replace(/(?:^\s*,|\s*,\s*,\s*|\s*,$)/,""):t}async function S(t="",e){let n=await T(t,{...e,innerJoinBy:","},!0);return n=N(y(n,!0)),n=n.replace(/####/g,"|").replace(/##/g,"").replace(/\s+/g,""),n=E(n,e),n}function L(t){const{varInfo:e}=t;return e.getText?e.getText(t):e.nodePart||e.question?Object(d.e)(t):"var-string"===e.type?function(t){const{varInfo:e}=t;if(e.getText)return e.getText(t);return T(e.value,t)}(t):"var-expression"===e.type?async function(t){const e=Object(p.a)(),{varInfo:n,state:i}=t;let a="";const s=Object(d.l)(n.value).children,u=[];let l="";for(const t of s)if(Object(d.k)(t)){if(l){const t=parseFloat(l);if(isNaN(t))return t;a=o(a,u,t),l=""}const n=Object(d.f)(i,t);if(n){const t=n.split;if(n.uuid===e.EXP_OP.uuid)a+="(";else if(n.uuid===e.EXP_CP.uuid)a=c(a);else if(t)a=o(a,u,n.expOpr),u.push(t);else if(n.expOpr)u.length&&(a=c(a),u.pop()),a=o(a,u,n.expOpr);else{const t=u[u.length-1],e=await L({state:i,varInfo:n,joinBy:t||"+"})||0;a=o(a,u,e)}}else l+="0"}else l+=t.getText().replace(/\s/g,"");l&&(a=o(a,u,parseFloat(l)));for(;u.length;)a=c(a),u.pop();return function(t){let e=0;try{e=Object(r.a)(t,!0)}catch(n){e=NaN,console.info("error exp: ",t)}return e}(a)}(t):"var-media"===e.type?async function(t){const{varInfo:e,state:n}=t,{imgSize:r}=e,i=t.joinBy||" ",o=Object(d.i)(e.value),c=[];for(const t of o){const e=Object(d.f)(n,t);if(!e)continue;r&&(e.imgSize=r);const o=await L({state:n,varInfo:e,joinBy:i});Object(g.b)(o)||c.push(o)}return c.join(i)}(t):"var-bool"===e.type?async function(t){const{varInfo:e,state:n}=t;if(e.getBool)return e.getBool(t);const{nodePart:r,question:o}=e;if(r||o)return Object(d.d)(t);const c=Object(d.i)(e.value);let a="";for(const e of c){const r=Object(d.f)(n,e);if(r)if(r.blOpr)a+=r.blOpr;else if(r.getBool)a+=i(await r.getBool(t))?"1":"0";else{const t=await L({state:n,varInfo:r});a+="string"==typeof t?"0"===t?t:t?"1":"0":i(t)?"1":"0"}}return i(a)}(t):"var-request"===e.type?async function(t){const{varInfo:{request:e,paramConfig:n},state:r}=t;if(e){let t=null;if(n){t=JSON.parse(n);for(const e of Object.keys(t))t[e]=await k(t[e],{state:r,joinBy:","},"URL")}const{result:i}=await Object(s.c)(r,e,t,!1,!1);return"string"!=typeof i?i:Object(u.a)(i)}return""}(t):"var-html"===e.type?async function(t){const{varInfo:e,state:n}=t,r=e.getText?await e.getText(t):await T(e.value,t),i=Object(u.a)(y(r));return await function(t,e,n){const r=t?JSON.parse(t):{};return Object(a.q)(e,/{{{?(.+?)}}}?/g,async(t,e)=>{const i=e.indexOf("=");let o=e,c="";i>-1&&(o=e.substr(0,i),c=e.substr(i+1));const a=r[o]||"";let s="";return a&&(s=t.startsWith("{{{")?await T(a,{state:n}):await k(a,{state:n},"URL")),s||c})}(e.paramConfig,i,n)}(t):Object(a.n)("")}async function C(t="",e,n=!1){if("number"==typeof t)return t;if(Object(g.b)(t))return n?NaN:"";const r=Number(t);if(isNaN(r)){const r=await k(t,e);if(Object(g.b)(r))return n?NaN:"";const i=Number(r);return isNaN(i)?n?NaN:r:i}return r}async function P(t="",e){if("number"==typeof t)return t;const n=await C(t,e,!0);return Number(n)}async function M(t,e){if(t.match(/key(?:\d+)?/))return Object(j.c)()[t];{const n=Object(b.c)(t);if(n){return N(await L({varInfo:n,state:e,joinBy:","}))}return""}}function R(t="",e,n=!1){if(Object(g.b)(t))return Object(a.n)("");return Object(a.q)(Object(g.a)(t),/{{(.+?)}}/g,async(t,r)=>{let i=await M(r,e);return i&&n&&(i=encodeURIComponent(i)),""+(i||"")})}function A(t=""){return t.replace(/(?:^<div>|<\/div>$)/g,"")}},function(t,e,n){"use strict";n.d(e,"h",(function(){return c})),n.d(e,"a",(function(){return a})),n.d(e,"m",(function(){return s})),n.d(e,"n",(function(){return u})),n.d(e,"l",(function(){return l})),n.d(e,"f",(function(){return d})),n.d(e,"k",(function(){return f})),n.d(e,"c",(function(){return b})),n.d(e,"b",(function(){return p})),n.d(e,"d",(function(){return O})),n.d(e,"j",(function(){return m})),n.d(e,"o",(function(){return g})),n.d(e,"g",(function(){return j})),n.d(e,"i",(function(){return h})),n.d(e,"p",(function(){return y})),n.d(e,"e",(function(){return v}));var r=n(1),i=n(5),o=n(25);function c(t,e){const n=t.loopStack,i=e.uuid;return Object(r.h)(i,n)}function a(t,e){return t.find(t=>Object(r.l)(t.uuid,e))}function s(t,e){if(!e)return!1;return b(t).some(t=>t.selected&&t.mutexNumber===e)}function u(t){return"comment"===t.optionType}function l(t){return b(t).some(t=>t.selected)}function d(t){return b(t).filter(e=>Object(o.b)(e,t)).length}function f(t){return b(t).some(e=>Object(o.b)(e,t))}function b(t){let e=[];const{options:n,otherOptions:r}=t;return n&&(e=[...e,...n]),r&&(e=[...e,...r]),e}function p(t){let e=b(t);const{hiddenOptions:n}=t;return n&&(e=[...e,...n]),e}function O(t){const{renderOptionsX:e,renderOptionsY:n,otherOptions:r}=t;return e.concat(n,r)}function m(t){const{options:e}=t,n=e.find(t=>!0===t.seqTarget);return n&&n.selected?t.origin.options[n.sortNo-1]:t.output}function g(t){return!!t.yid&&!!t.xid}async function j(t,e){const{parent:n}=e;return{itemsMax:await Object(i.e)(t.itemsMax,{state:n}),itemsMin:await Object(i.e)(t.itemsMin,{state:n})}}function h(t){return t.passRef||{}}function y(t,e){const n=h(t);return t[e]||n[e]}function v(t){if(!t.assistValue)return"";return Object.keys(t.assistValue).reduce((e,n)=>(t.assistValue[n]&&(e+=t.assistValue[n])&&(e+=" "),e),"")}},function(t,e,n){"use strict";function r(t){return o(t)?"":String(t)}function i(t){if(o(t))return"";const e=Number(t);return isNaN(e)?t:e}function o(t){return t instanceof Array?0===t.length:"boolean"!=typeof t&&0!==t&&!t}n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return u}));var r=n(0),i=n(1);let o,c={};const a={on(t,e){c[t]||(c[t]=[]),c[t].push(e)},off(t,e){t||(c={}),c[t]&&(c[t]=e?c[t].filter(t=>t!==e):[])},one(t,e){const n=r=>{e(r),a.off(t,n)};a.on(t,n)},trigger(t,e={}){if(c[t])try{c[t].forEach(n=>n({type:t,...e,data:e},e))}catch(t){Object(i.c)(t)}}};function s(t){"gift"!==t.type&&(a.trigger("ANSWER_CHANGE",t),t.dynamicNodeProps())}function u(t,e=!1){a.trigger("SWITCH_NODE",t),t!==o&&(o=t,e&&Object(r.c)().hook.onSwitchPage())}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return b})),n.d(e,"r",(function(){return p})),n.d(e,"d",(function(){return O})),n.d(e,"c",(function(){return m})),n.d(e,"p",(function(){return g})),n.d(e,"q",(function(){return j})),n.d(e,"f",(function(){return h})),n.d(e,"g",(function(){return y})),n.d(e,"k",(function(){return v})),n.d(e,"l",(function(){return w})),n.d(e,"m",(function(){return _})),n.d(e,"j",(function(){return x})),n.d(e,"o",(function(){return T})),n.d(e,"h",(function(){return I})),n.d(e,"n",(function(){return k})),n.d(e,"i",(function(){return N})),n.d(e,"e",(function(){return E}));var r=n(10),i=n(2),o=n(0),c=n(3),a=n(1),s=n(69),u=n(73);let l="";const d={diagram_has_errors:"diagram_has_errors",survey_not_exist:"survey_not_exist",survey_offline:"survey_offline",oauth_error:"oauth_error",interviewee_missing_error:"interviewee_missing_error",interviewee_invalid_error:"interviewee_invalid_error",multi_responses_error:"multi_responses_error",quota_full:"quota_full",quota_not_match:"quota_not_match",red_envelope_duplicated:"red_envelope_duplicated",red_envelope_expired:"red_envelope_expired",red_envelope_received_by_yourself:"red_envelope_received_by_yourself",red_envelope_received_by_others:"red_envelope_received_by_others",red_envelope_intercepted:"red_envelope_intercepted",red_envelope_send_error:"red_envelope_send_error"},f=[400,401,402,403,404,405,422,500];async function b(t,e){try{const r=await Object(o.c)().network.request(t,e);if((n=r).status>=200&&n.status<300)return function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}(r.response);throw r}catch(t){throw t}var n}function p(t){t&&f.includes(t.status)||Object(o.b)().error(Object(i.f)(c.a.global.downloadError))}function O(t){const e=JSON.parse(t&&t.response||"{}");return e&&f.includes(e.status)?e.code+"":""}function m(t){const e=O(t);e!==l&&e&&(d[e]?Object(o.b)().error(E(e)):Object(o.b)().notify(E(e)))}async function g(t,e={type:"GET"}){try{return await b(t,e)}catch(n){throw m(n),Object(a.c)(`api error: ${e.type}:${t} ${JSON.stringify(n)}`),n}}function j(t,e={type:"GET"}){return g(t,e={...e,contentType:"application/json"})}function h(t){if(Object(o.b)().preview)return async function(t){if("00000000-0000-0000-0000-000000000000"===t)return{smaller_diagram_url:"http://localhost:12345/unit_test_payload.json"};const e=Object(r.c)(),n=e.type;let i=Object(o.b)().hostConfig.qApiHost+"/surveys/"+t+"/preview";"preview_template"===n?i=Object(o.b)().hostConfig.host+"/v1/public_templates/"+t:"edit_template"===n&&(i=Object(o.b)().hostConfig.host+"/v1/templates/"+t);const c=await j(i,{type:"GET",jwt:e.jwt}),{diagram:a}=c;return{smaller_diagram_url:c.diagram_url||a.diagram_url,langs:c.langs}}(t);const e=Object(o.c)().auth.retrieveAuthMeta();if(e)return Object(a.n)(e);return j(Object(o.b)().hostConfig.qApiHost+"/surveys/"+t,{type:"GET"}).catch(t=>{throw p(t),t})}function y(t){const e=Object(o.b)().hostConfig.qApiHost+"/responses";return l=d.multi_responses_error,j(e,{type:"POST",data:t}).then(t=>(l="",t)).catch(()=>{l=""})}function v(t,e){return j(Object(o.b)().hostConfig.qApiHost+"/responses/"+e+"/examine",{type:"PUT",data:t})}function w(t,e){return j(Object(o.b)().hostConfig.qApiHost+"/responses/"+e+"/skip",{type:"PUT",data:t})}function _(t,e){return j(Object(o.b)().hostConfig.qApiHost+"/responses/"+e,{type:"PUT",data:t})}async function x(t){if(Object(o.b)().preview)return Object(o.b)().notify(Object(i.f)(c.a.preview.noMessage)),{};const e=Object(o.b)().hostConfig.qApiHost+"/validations";t.question_id=t.question_id.toLowerCase();const n=await j(e,{type:"POST",data:t});return t.phone_num&&Object(o.b)().notify(Object(i.f)(c.a.verify.sendSuccess)),n}function T(t,e){if(Object(o.b)().preview)return Object(o.b)().notify(Object(i.f)(c.a.preview.noMessage)),Object(a.n)({});return j(Object(o.b)().hostConfig.qApiHost+"/validations/"+e,{type:"PUT",data:t})}function I(t,e){if(Object(o.b)().preview)return Object(a.n)({recipient:Object(u.a)()});const n=Object(o.c)().storage.get("gift-"+t.code);if(n)return Object(a.n)(JSON.parse(n));return g(Object(o.b)().hostConfig.qApiHost+"/rewards/"+e+"/red_envelope",{type:"POST",data:t})}async function k(t,e){if(Object(o.b)().preview)return{};const n=Object(o.b)().hostConfig.qApiHost+"/rewards/"+e+"/custom";try{const e=await g(n,{type:"PUT",data:t});return Object(o.b)().notify(Object(i.f)(c.a.verify.sendSuccess)),e}catch(t){throw Object(o.b)().notify(Object(i.f)(c.a.verify.sendFailed)),t}}function N(t){Object(s.a)(t);const{preview:e}=Object(o.b)(),{dev:{autoRun:n,infer:r}}=Object(o.c)();if(e||n||r)return Object(a.n)(null);return g(Object(o.b)().hostConfig.qApiHost+"/webhooks",{type:"POST",data:t})}function E(t){return Object(i.f)("backEnd."+t)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"f",(function(){return u})),n.d(e,"e",(function(){return l})),n.d(e,"d",(function(){return d})),n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return b}));var r=n(3),i=n(0),o=n(2),c=n(34);let a;function s(){return a||(a=Object(i.c)().app.getParams()),a}function u(){a=null}function l(t){const e=new c.a("div");e.setInnerHtml(t),t=e.getText();const n=Object.create(null);return"string"!=typeof t?n:(t=t.trim().replace(/^([?#&])/,""))?(t.split("&").forEach(t=>{const e=t.replace(/\+/g," ").split("=");let r=e.shift(),i=e.length>0?e.join("="):void 0;r=decodeURIComponent(r),i=void 0===i?null:decodeURIComponent(i),void 0===n[r]?n[r]=i:Array.isArray(n[r])?n[r].push(i):n[r]=[n[r],i]}),{...n}):n}function d(t){Object(i.b)().preview||Object(i.c)().dev.autoRun?Object(i.b)().notify(Object(o.f)(r.a.preview.noLink)):(Object(i.c)().hook.beforeForceLeave(),Object(i.c)().app.openWebLink(t),Object(i.b)().customAbort())}function f(t,e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){}const n=function(t){const e=[];return Object.keys(t).forEach(n=>{if(void 0!==t[n]){const r=`${encodeURIComponent(n)}=${encodeURIComponent(t[n])}`;e.push(r)}}),e.join("&")}(e),r=t.match(/\?/)?"&":"?";return t+r+n}function b(t,e){const n=Object.keys(e),r=["key","dev","rid","aid","cid","qid","tid","rtpl","infer_id","sid","type","jwt","ban_preview_bar","fake_port","real_port","auto_path","lite_template"];for(const i of n){const n=t.includes("?")?"&":"?";(r.includes(i)||i.match(/^key\d\d?$/))&&(t+=`${n}${i}=${e[i]}`)}return t}},function(t,e,n){"use strict";n.d(e,"A",(function(){return h})),n.d(e,"B",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"b",(function(){return w})),n.d(e,"p",(function(){return _})),n.d(e,"r",(function(){return x})),n.d(e,"k",(function(){return T})),n.d(e,"u",(function(){return I})),n.d(e,"t",(function(){return k})),n.d(e,"s",(function(){return N})),n.d(e,"n",(function(){return E})),n.d(e,"m",(function(){return S})),n.d(e,"f",(function(){return L})),n.d(e,"v",(function(){return C})),n.d(e,"g",(function(){return P})),n.d(e,"y",(function(){return M})),n.d(e,"a",(function(){return R})),n.d(e,"z",(function(){return A})),n.d(e,"i",(function(){return D})),n.d(e,"l",(function(){return U})),n.d(e,"j",(function(){return B})),n.d(e,"c",(function(){return q})),n.d(e,"d",(function(){return V})),n.d(e,"e",(function(){return F})),n.d(e,"o",(function(){return $})),n.d(e,"h",(function(){return X})),n.d(e,"x",(function(){return z})),n.d(e,"w",(function(){return K}));var r=n(33),i=n(40),o=n(1),c=n(5),a=n(20),s=n(9),u=n(6),l=n(0),d=n(10);let f=[];let b=-1;function p(){const{dev:{local:t}}=Object(l.c)(),{preview:e,realTimePreview:n,hostConfig:{recordUrl:r}}=Object(l.b)();return!(t||e||n||!r)}function O(t,e=!1){if(Object(a.b)()&&(!e||"start"===t.type))return;t.description=Object(c.k)(t.description);const n=t.description;if(p()){const r=f[f.length-1];r&&(n.indexOf(r.description)>-1||r.description.indexOf(n)>-1)&&f.pop(),f.push(t),e&&m()}}function m(){if(p()){if(clearTimeout(b),f.length>0){const t=f;f=[];const e=Object(l.b)().hostConfig.recordUrl;Object(s.q)(e,{type:"POST",data:{records:t}}).catch(()=>{Object(o.c)("failed to send record")})}b=setTimeout(m,1e4)}}function g(t,e,n,r,i){const{surveyId:o,transactionID:c,userInfo:a}=n;let s,u,f,b,p,O,m;("gift"===r||"start"===r&&a)&&(s=a.nickname,u=a.openid,s&&(b=Object(l.c)().name)),"start"===r&&(f=JSON.stringify(Object(d.c)())),e&&("matrix"===e.type?(O=t?t.yid:void 0,m=t?t.xid:void 0):p=t?t.uuid.toLowerCase():void 0);return{survey_id:o,collector_id:n.parsedPayload&&n.parsedPayload.basicConfig&&n.parsedPayload.basicConfig.collector&&n.parsedPayload.basicConfig.collector.id,response_id:c,node_id:e?e.nodeUuid.toLowerCase():void 0,option_id:p,row_option_id:O,col_option_id:m,description:i,type:r,recorded_at:new Date,provider:b,user_name:s,user_id:u,query_params:f}}function j(t){const e=t.loop?`[${t.nodeName}:${t.title||""}]`:`[${t.nodeName}]`;return Object(c.k)(e)}function h(t,e){if(Object(l.c)().dev.infer)return;O(g(null,e,t,"used_phone",`在题目:${j(e)}中检测到重复使用的手机号:${t.phoneNumber}`))}function y(t,e){if(Object(l.c)().dev.infer)return;O(g(null,e,t,"verify_fail",`在题目:${j(e)}高级验证失败`))}function v(t,e){if(Object(l.c)().dev.infer)return;const{type:n,parent:r}=e;if("upload"===n||"verify"===n||"gift"===n)return;let o,a="",s="";if("menu"===n||"cascade"===n)s=Object(u.c)(e).reduce((e,n)=>(n.selected&&(e+=`[${n.text}]`),t=n,e),""),o=s?"select":"deselect",a=s?"选中":"清除所有选中";else{const r=t.selected;o=r?"select":"deselect",a=r?"选中":"取消选中",s="select_icon"===n||"select_image"===n?`[${Object(i.b)(t)}]`:"matrix"===e.type?`[${Object(c.k)(t.xText)} ${Object(c.k)(t.yText)}]`:`[${Object(c.k)(t.text)}]`}const d=`在题目:${j(e)}中${a}选项:${s}`;O(g(t,e,r,o,d))}function w(t,e,n){if(Object(l.c)().dev.infer)return;const r=`在题目:${j(n)}的选项:[${Object(c.k)(e.text)}]中输入自动填充触发文字:${t}`;O(g(e,n,n.parent,"auto_complete",r))}function _(t,e,n){if(Object(l.c)().dev.infer)return;const r=n.parent;let i,o;"value_mark"===n.type||"icon_mark"===n.type||"slide_rate"===n.type||"weight"===n.type?(i="打分:"+e.value,o="rate"):"upload"===n.type?(i=t?"上传图片":"清除图片",o="upload"):(i="输入:"+e.value,o="input");O(g(e,n,r,o,`在题目:${j(n)}的选项:[${Object(c.k)(e.text)}]中${i}`))}function x(t,e){if(Object(l.c)().dev.infer)return;const n=e.parent,r=e.options[t];if(!r)return;O(g(r,e,n,"sort",`在题目:${j(e)}中将选项:[${Object(c.k)(r.text)}]排序到第${t+1}位`))}function T(t){if(Object(l.c)().dev.infer)return;const e=`在题目:${j(t)}中 定位失败`;O(g(null,t,t.parent,"locate_failed",e))}function I(t,e){if(Object(l.c)().dev.infer)return;const n=e.parent,r=e.type,i=e.value;let o="input",c="输入";if("region"===r)c="输入:"+i;else if("location"===r||"area"===r)o="locate",c="定位到:"+i;else if("verify"===r){const e=typeof t;if("string"===e)c="输入:"+t;else if("object"===e){const{code:e,phoneNumber:n}=t;void 0!==n?(o="input_phone",c="的手机号码中输入:"+n):(o="input_code",c="的密码/验证码中输入:"+e)}}O(g(null,e,n,o,`在题目:${j(e)}中${c}`))}function k(t){if(Object(l.c)().dev.infer)return;O(g(null,t,t.parent,"prev",`在题目:${j(t)}中点击上一题`))}function N(t,e){if(Object(l.c)().dev.infer)return;O(g(null,e,t.parent,"prev",`返回到题目: ${j(e)},由题目:${j(t)}后退而来`))}function E(t){if(Object(l.c)().dev.infer)return;O(g(null,t,t.parent,"next",`在题目:${j(t)}中点击下一题`))}function S(t,e){if(Object(l.c)().dev.infer)return;O(g(null,e,t.parent,"next","end"===e.type?`到达结束节点: ${j(e)},由题目:${j(t)}前进而来`:`进入题目: ${j(e)},由题目:${j(t)}前进而来`))}function L(t,e,n){if(Object(l.c)().dev.infer)return;O(g(null,e,n,"check_fail",`从${j(t)}走向甄别失败`),!0)}function C(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t.current,t,"quota_fail","配额失败,答案数:"+e),!0)}function P(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t.current,t,"check_submit","甄别提交,答案数:"+e))}function M(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t,e,"time_less","答题时间太少被排除"),!0)}function R(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t,e,"abandon_answer","按结束节点要求抛弃答案"),!0)}function A(t){if(Object(l.c)().dev.infer)return;O(g(null,t.current,t,"time_over","答题超时未完成"),!0)}function D(t,e,n,r){if(Object(l.c)().dev.infer)return;O(g(null,t,e,"full_submit",`正式提交,答案数:${n}个答案 \n 提交回应:${JSON.stringify(r)}`),!0)}function U(t,e,n=!1){if(Object(l.c)().dev.infer)return;O(g(null,t,e,n?"lottery_goal":"lottery_fail",n?"抽奖:中奖":"抽奖:未中奖"),!0)}function B(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t,e,"gift","领奖"),!0)}function q(t,e,n,r,i){if(Object(l.c)().dev.infer)return;O(g(e,n,t,"auto_input",`在题目:${j(n)}中自动填充选项:[${r}],期待值:[${i}]`))}function V(t,e,n,r="成功"){if(Object(l.c)().dev.infer)return;O(g(null,n,t,"auto_skip",`在题目:${j(n)}中尝试自动选中选项:[${Object(c.k)(e.text)}]${r}`))}function F(t,e,n){if(Object(l.c)().dev.infer)return;let r=`自动跳过题目:${j(e)} by ${n}`;"logic"===e.type&&(r+=" logicResult:"+e.logicResult);O(g(null,e,t,"auto_skip",r))}function $(t,e,n){if(Object(l.c)().dev.infer)return;O(g(null,n,t,"opt_display",`在题目:${j(n)}中显示选项:[${Object(c.k)(e.text)}]`))}function H(){let t=Object(l.c)().storage.get("browser_uuid");return t||(t=Object(o.i)(),Object(l.c)().storage.set("browser_uuid",t)),t}function X(){if(Object(l.c)().dev.infer)return;const t=Object(d.c)();if(t.code&&t.state)return;O({type:"enter",collector_code:Object(l.b)().sid,browser_uuid:H(),recorded_at:Object(r.c)(),description:"来自"+Object(l.c)().system.getReferer()},!0)}function z(t,e){if(Object(l.c)().dev.infer)return;let n=`开始答题,进入到题目: ${j(e)} `;const{browser:r,device:i,engine:o,os:c}=Object(l.c)().system.device;r&&(n+=`browser:${r.name||""} ${r.version||""}, `),i&&(n+=`device:${i.type||""} ${i.vendor||""} ${i.model||""}, `),o&&(n+=`engine:${o.name||""} ${o.version}, `),c&&(n+=`os:${c.name||""} ${c.version||""}`);const a=g(null,e,t,"start",n);a.browser_uuid=H(),a.collector_code=Object(l.b)().sid,O(a,!0)}function K(t,e){if(Object(l.c)().dev.infer)return;O(g(null,null,t,"resume","开始断点续答:"+e),!0)}},function(t,e,n){"use strict";n.d(e,"l",(function(){return E})),n.d(e,"e",(function(){return C})),n.d(e,"h",(function(){return P})),n.d(e,"f",(function(){return M})),n.d(e,"g",(function(){return R})),n.d(e,"n",(function(){return A})),n.d(e,"m",(function(){return D})),n.d(e,"d",(function(){return U})),n.d(e,"b",(function(){return B})),n.d(e,"k",(function(){return V})),n.d(e,"j",(function(){return F})),n.d(e,"i",(function(){return $})),n.d(e,"c",(function(){return H})),n.d(e,"a",(function(){return X}));var r=n(8),i=n(10),o=n(4),c=n(11),a=n(17),s=n(35),u=n(59),l=n(19),d=n(57),f=n(71),b=n(0),p=n(2),O=n(47),m=n(48),g=n(3),j=n(20),h=n(9),y=n(46),v=n(5),w=n(21),_=n(69);const x={},T={};async function I(t,e,n){const{actions:r}=e;if(r&&!Object(j.b)()&&!Object(b.b)().realTimePreview){if("forward_enter"===t){if(x[e.renderId])return;x[e.renderId]=!0}if("backward_leave"===t&&delete x[e.renderId],"forward_leave"===t){if(T[e.renderId])return;T[e.renderId]=!0}"backward_leave"===t&&delete T[e.renderId];for(const i of r){if(i.disabled||i.event!==t)continue;const{activeConfig:r}=i;if(!r||await Object(w.b)(n,r.options,r.logicType))if("http_request"===i.type)Object(_.a)(i),await Object(y.b)(n,i.request,null,!0,!1);else{const r={state:n},o={question_id:e.nodeUuid,response_id:n.transactionID,locale:n.language,event:t,type:i.type};if("email"===i.type){const{email:t}=i,e={...o,email:(await Object(v.f)(t.address,r)).replace(/\s/g,""),content:await Object(v.d)(t.content,r),title:(await Object(v.f)(t.title,r)).trim()};await Object(h.i)(e)}else{const{sms:t}=i,e={};for(const n of t.params)e[n.name]=(await Object(v.f)(n.value,r)).trim();const n={...o,url:(await Object(v.f)(t.url,r)).replace(/\s/g,""),content:e};await Object(h.i)(n)}}}}}var k=n(14);let N;function E(){return!!N}const S=["end","gift","lottery"];function L(t){let{prev:e}=t;const n=[];let r=e&&Object(o.w)(e);for(;r;)n.push({question:e,reason:r}),e=e.prev,r=e&&Object(o.w)(e);return{prev:e,skipList:n,current:t}}function C(t){const{parent:e}=t,{renderList:n}=e,r=n.indexOf(t);return R(e,n,r)}function P(t){if(Object(b.b)().realTimePreview)return"";const{prevEnabled:e,themeMode:n}=t,r=t.first(),{prev:i}=L(r),o=r.type;if(e&&n&&"end"!==o&&"lottery"!==o)return t.prevBtnText;if(Object(b.b)().preview&&"end"===o)return Object(p.f)(g.a.global.backTest);return e&&i&&(r.checkMode===i.checkMode||Object(b.b)().preview)&&S.indexOf(o)<0?t.inSingleGroup?t.inSingleGroup.prevText||Object(p.f)(g.a.global.previous):t.prevBtnText:""}async function M(t){const{formalResult:e}=t,n=t.current,{type:r,linkUrl:i,goal:o,qrCode:c}=n;if("end"===r){const r=n.endBtnText||Object(p.f)(g.a.global.go);if(i)return r;if(e&&e.reward||Object(b.b)().preview&&n.useReward)return c||t.fakeCommitted?"":r;{const{node:e}=await O.a.findNext(t.nodeList,n,t);return e&&"lottery"===e.type?r:""}}if("lottery"===r){const t=Object(p.f)(g.a.reward.get);return i?n.endBtnText||t:o?c?"":t:""}return t.inSingleGroup?t.inSingleGroup.nextText||Object(p.f)(g.a.global.next):t.nextBtnText}function R(t,e,n){const r=[];let i=1;const c=e[n];let a=e[n+i],s=a&&Object(o.w)(a);for(;a&&s;)r.push({question:a,reason:s}),i+=1,a=e[n+i],s=a&&Object(o.w)(a);return{next:a,skipList:r,current:c}}async function A(t){const e=await Object(s.c)(t.nodes,!0);if(e.valid){if(Object(l.c)(t)){Object(b.g)(t,{current:t.nodes[t.nodes.length-1]});for(const e of t.nodes)await I("forward_leave",e,t)}else await I("forward_leave",t.current,t);return await Object(a.f)(t,t.current,{type:"page_next",delay:200}),!0}return function(t,e){const{valid:n,message:i,dueToNode:o,dueToOption:c}=e,a={valid:n,message:i};c&&(a.optId=c.uuid,a.optText=c.text,c.label&&(a.message=c.label+":"+a.message));o&&(a.nodeId=o.nodeUuid,a.nodeName=o.nodeName,a.nodeType=o.type,a.message=o.nodeName+":"+a.message);if(r.a.trigger("NEXT_FAIL",a),"vital"===e.type)throw Object(b.b)().error(e.message),new Error("next vital error: "+e.message);"alert"===e.type?Object(b.b)().alert(e.message):(t.inSingleGroup||Object(b.b)().notify(e.message),Object(s.a)(e,t))}(t,e),!1}function D(t,e){Object(b.g)(t,{nextLoading:e}),Object(j.c)()}function U(t){D(t,!0),N={state:t}}async function B(t){D(t,!1),N&&(await F(N.state),N=void 0)}function q(t,e){if(Object(r.c)(e,!0),"red_envelope"!==e.giftType||Object(b.b)().preview)Object(b.c)().hook.beforeForceLeave(),Object(b.c)().app.openWebLink(Object(b.c)().app.getRewardUrl(Object(i.c)())),Object(b.b)().customAbort();else{const n={...Object(i.c)(),tid:t.transactionID,qid:t.surveyId,rid:t.rewardInfo.goalId};e.template&&(n.rtpl=e.template.id);const{formalResult:{authorizer:{app_id:r,component_appid:o}}}=t;Object(b.c)().auth.authorizeGift(r,o,n),Object(b.b)().customAbort()}}function V(t,e){e.linkUrl?(Object(b.c)().hook.beforeForceLeave(),Object(b.c)().app.openWebLink(e.linkUrl),Object(b.b)().customAbort()):q(t,Object(o.a)(t.nodeList,e.rewardNodeId))}async function F(t){const e=function(t){const{renderList:e}=t,n=t.nodes[t.nodes.length-1];return R(0,e,Object(a.b)(e,n))}(t),{current:n,next:s}=e;if("end"===n.type)return async function(t,e){Object(b.c)().storage.remove("reward_info");const n=e.linkUrl;if(n)return void Object(i.d)(n);const a=Object(o.c)(t.nodeList,e.destList,e.output&&e.output.uuid);if(!a)return;const s=await Object(u.b)(t,a);if("lottery"===a.type){const e=await Object(l.e)(a,s,t);Object(c.l)(a,t,s.goal),Object(b.g)(t,{current:e}),Object(r.c)(a,!0)}else q(t,a);return t.dynamicStateProps()}(t,n);return(await Object(d.b)(t,{valid:!0,message:""},n,s)).valid?async function(t,e){const{next:n,current:i}=e;Object(b.g)(t,{current:n}),n.reached=!0,Object(c.m)(i,n),Object(r.c)(n,!0),Object(m.a)(t),Object(k.k)(t),await t.dynamicStateProps(),D(t,!1),i.dynamicNodeProps(),Object(a.e)(t,t.current),r.a.trigger("NEXT_OK")}(t,e):D(t,!1)}async function $(t){const e=t.first(),{prev:n,skipList:i}=L(e);if(n){if(e.groupSingle){const e=[...t.nodes].reverse();for(const n of e)await I("backward_leave",n,t)}else await I("backward_leave",e,t);for(const e of i)await I("backward_enter",e.question,t),await I("backward_leave",e.question,t);if(Object(b.g)(t,{current:n,currentStartTime:(new Date).getTime()}),Object(r.c)(n,!0),Object(m.a)(t),Object(k.k)(t),await t.dynamicStateProps(),Object(c.s)(e,n),Object(a.e)(t,t.current),r.a.trigger("PREV_OK"),n.groupSingle){const e=[...t.nodes].reverse();for(const n of e)await I("backward_enter",n,t)}else await I("backward_enter",n,t)}}async function H(t,e){const{nodeList:n,current:r}=t,i=await Object(f.b)(n,r,t),{node:o}=i;return o?X(t,i,e):null}async function X(t,e,n){const r=t.current,{node:i,loop:a,random:s,loopStack:u}=e,d={prev:r,origin:i,...i,loop:a,random:s,loopStack:u};if(n&&n(d))return null;const f=await Object(l.f)(d,t);await I("forward_enter",f,t),Object(b.g)(t,{current:f});const p=Object(o.w)(f);return p&&(Object(c.e)(t,f,p),await I("forward_leave",f,t)),f}},function(t,e,n){"use strict";n.d(e,"l",(function(){return p})),n.d(e,"i",(function(){return O})),n.d(e,"j",(function(){return m})),n.d(e,"k",(function(){return g})),n.d(e,"g",(function(){return j})),n.d(e,"f",(function(){return h})),n.d(e,"c",(function(){return y})),n.d(e,"h",(function(){return v})),n.d(e,"b",(function(){return w})),n.d(e,"d",(function(){return _})),n.d(e,"e",(function(){return x})),n.d(e,"a",(function(){return T}));var r=n(5),i=n(49),o=n(1),c=n(31),a=n(6),s=n(39),u=n(17),l=n(16),d=n(22),f=n(34),b=n(7);function p(t){return Object(f.c)(t)}function O(t="",e){return e||(e=p(t)),e.queryByClass("var-tag")}function m(t=""){return!!(t&&t.indexOf("var-tag")>-1)}function g(t){return Object(o.k)(t,"node"===t.type)&&t.hasClass("var-tag")}function j(t){return{name:t.getText(),uuid:(e=t,e.attributes["data-id"]),limit:t.attributes["data-limit"],limitSrc:Number(t.attributes["data-limit-src"]||void 0),imgSize:t.attributes["data-img-size"],limitRnd:Number(t.attributes["data-limit-rnd"]||void 0),paramConfig:t.attributes["data-ph-cfg"],disorder:"1"===t.attributes["data-disorder"],inEdist:t.parent&&!!t.parent.attributes.edist};var e}function h(t,e){return v(t,j(e))}function y(t){const{uuid:e,limitSrc:n,limit:r,limitRnd:i,paramConfig:o}=t;let c=e;return Object(b.b)(n)||(c+="_"+n),Object(b.b)(r)||(c+="_"+r),Object(b.b)(i)||(c+="_"+i),Object(b.b)(o)||(c+="_"+o),c}function v(t,e){const n=y(e),{uuid:r,limitSrc:i,paramConfig:c,name:f,disorder:p,inEdist:O}=e;let{imgSize:m,limitRnd:g,limit:j}=e;j=j||"1:0:0",m=m||"0:0",g=Object(b.b)(g)?-1:g;const h=r.split(":");let v="";s.f(r)&&(v=r.substr(0,8));const w=h.length;if(0===w)return;if(1===w){const t=h[0],e=Object(l.e)(t);return e&&{...e,name:f,uuid:r,limit:j,limitSrc:i,limitRnd:g,imgSize:m,loopNodeId:v,mapId:n,paramConfig:c,inEdist:O}}let _;if(!v&&(_=function(t,e=""){const{loopStack:n,context:r}=t;let{renderList:i}=t;const c=Object(o.h)("",n);return r.question&&(i=[...i,r.question]),i.find(t=>{const n=t.nodeUuid+c;return Object(o.l)(t.nodeUuid,e)&&Object(u.d)(t.renderId,n)})}(t,h[0]),!_))return;const x=Object(d.b)(h[1]);if(2===w)return x&&{name:f,question:_,nodePart:x,limit:j,limitSrc:i,limitRnd:g,uuid:r,imgSize:m,loopNodeId:v,isMedia:"var-media"===x.type,type:x.type,mapId:n,paramConfig:c,inEdist:O};const T=Object(d.b)(h[2],_),I=T&&"var-media"===T.type;if(3===w&&!h[1].match(/^[a-z0-9]{8}$/))return T&&{inEdist:O,name:f,question:_,nodePart:x,optionPart:T,limit:j,limitSrc:i,limitRnd:g,disorder:p,uuid:r,imgSize:m,loopNodeId:v,isMedia:I,type:T.type,mapId:n,paramConfig:c};const k=Object(a.a)(Object(a.b)(_),h[1]);return k?T&&{inEdist:O,name:f,question:_,option:k,optionPart:T,limit:j,limitSrc:i,limitRnd:g,disorder:p,uuid:r,imgSize:m,loopNodeId:v,isMedia:I,type:T.type,mapId:n,paramConfig:c}:void 0}async function w(t,e){let n=[];const{varInfo:{nodePart:a,option:s,disorder:u}}=t,l=await Object(r.e)(t.varInfo.limitRnd,t);if(0===l&&!e)return[];const d=t.specifiedOpt||s;n=d&&await Object(i.b)(t)?[d]:a&&a.filter?await a.filter(t):[];const f=e?e(n,l):Object(o.p)(n,l);return u?Object(c.c)(f):Object(c.d)(f)}async function _(t){const{varInfo:{nodePart:e,optionPart:n,option:r}}=t,o=t.specifiedOpt||r;if(e&&e.getBool)return e.getBool(t);if(o){return await Object(i.b)(t)&&await n.getBool({...t,specifiedOpt:o})}if(n.inBunch)return n.getBool(t);{const e=await w(t),r=[];for(const i of e){const e=await n.getText({...t,specifiedOpt:i});e&&r.push(e)}return r.length>0}}async function x(t){const{varInfo:{nodePart:e,optionPart:n,option:r}}=t,o=t.specifiedOpt||r,c=t.joinBy||" ";if(e&&e.getText)return e.getText(t);if(o){return await Object(i.b)(t)?n.getText({...t,specifiedOpt:o}):""}if(n.inBunch)return n.getText(t);{const e=await w(t),r=[];for(const i of e){const e=await n.getText({...t,specifiedOpt:i});Object(b.b)(e)||r.push(e)}return r.join(c)}}async function T(t){const e={};e.text=await x(t);const n=await async function(t){const{varInfo:{nodePart:e,optionPart:n,option:r,isMedia:o}}=t;if(!o)return[];const c=t.specifiedOpt||r;if(e&&e.getImages)return e.getImages(t);if(c){return await Object(i.b)(t)&&n.getImages?n.getImages({...t,specifiedOpt:c}):[]}{const e=await w(t),r=[];if(n.getImages)for(const i of e){const e=await n.getImages({...t,specifiedOpt:i});r.push(e[0])}return r}}(t);e.image=n[0];const r=await async function(t){const{varInfo:{optionPart:e,option:n}}=t;if(!e)return[];const r=t.specifiedOpt||n;if(r){return await Object(i.b)(t)&&e.getIcon?[e.getIcon({...t,specifiedOpt:r})]:[]}{const n=await w(t);return e.getIcon?n.map(n=>e.getIcon({...t,specifiedOpt:n})):[]}}(t);return e.icon=r[0],e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E})),n.d(e,"e",(function(){return L})),n.d(e,"i",(function(){return P})),n.d(e,"c",(function(){return M})),n.d(e,"g",(function(){return R})),n.d(e,"h",(function(){return A})),n.d(e,"f",(function(){return D})),n.d(e,"b",(function(){return U})),n.d(e,"j",(function(){return B})),n.d(e,"k",(function(){return q})),n.d(e,"d",(function(){return V}));var r=n(6),i=n(4),o=n(15),c=n(8),a=n(36),s=n(0),u=n(1),l=n(3);const d={};function f(t,e){e.startTime=t.startTime,e.costTime=t.costTime,e.validateFailTimes=t.validateFailTimes,e.validateFailed=t.validateFailed,e.type=t.type}d.max_diff={cache(t,e){e.tasks=t.tasks.map(t=>({items:t.items.map(t=>({uuid:t.option.uuid,value:t.value,round:t.round})),done:t.done}))},use(t,e){t.tasks&&(e.tasks=t.tasks.map(t=>({items:t.items.map(t=>({option:Object(r.a)(e.options,t.uuid),value:t.value,round:t.round})),done:t.done})))}},d.cascade={use(t,e){!function t(e,n){n&&e&&(n.selected=e.selected,n.list&&e.list&&n.list.forEach(n=>{const r=e.list.find(t=>t.resultId===n.resultId);r&&t(r,n)}))}(t.cascade,e.cascade)},cache(t,e){e.cascade=function t(e){return e?{selected:e.selected,resultId:e.resultId,list:e.list&&e.list.map(e=>t(e))}:null}(t.cascade)}},d.verify={borrow(t,e){e.code=t.code,e.phoneNumber=t.phoneNumber}},d.region={borrow(t,e){e.indexes=t.indexes,e.position=t.position,e.value=t.value}},d.location=d.area={borrow(t,e){d.region.borrow(t,e),e.succeed=t.succeed,e.failed=t.failed,e.failedSkipActivated=t.failedSkipActivated}},d.sequence={use(t,e){e.options.sort((t,e)=>t.sortNo>e.sortNo?1:-1)}};const b=["select","select_icon","select_image","menu","hot_spot"];var p=n(56),O=n(7);const m={};function g(t,e,n){e.value=t.value,e.selected=t.selected,t.assistValue&&(e.assistValue=e.assistValue||{},Object.keys(t.assistValue).forEach(n=>{Object(O.b)(t.assistValue[n])||(e.assistValue[n]=t.assistValue[n])}),"cache"===n&&0===Object.keys(e.assistValue).length&&delete e.assistValue)}function j(t,e,n){if(g(t,e,"use"),!e.isOtherOpt){const r=m[n];r&&(r.use?r.use(t,e):r.borrow&&r.borrow(t,e))}}m.max_diff={borrow(t,e){t.records&&(e.records=t.records.map(t=>({...t})))}},m.sequence={borrow(t,e){e.sortNo=t.sortNo}},m.heat_map={borrow(t,e){t.point&&(e.point={...t.point})}},m.upload={borrow(t,e){e.fileName=t.fileName,e.fileType=t.fileType,e.name=t.name,e.isImage=t.isImage},cache(t,e){m.upload.borrow(t,e),e.value=t.miniValue||t.value},use(t,e){m.upload.borrow(t,e),e.fileName&&Object(p.c)(e,{width:64,height:64},t)}};let h=!1,y="";const v=["data","describe","logic","random","loop"];let w,_;let x,T,I={responseId:"",data:{},point:"",count:0,randomList:[],lang:""};function k(t){const{offlineTaskId:e}=Object(s.b)(),n="response_cache_"+Object(u.s)(t);return e?n+"_with_"+e:n}function N(t,e){const n={};return function(t,e,n){if(e.uuid=t.uuid,g(t,e,"cache"),!t.isOtherOpt){const r=m[n];r&&(r.cache?r.cache(t,e):r.borrow&&r.borrow(t,e))}}(t,n,e),n}function E(t){if(Object(s.c)().dev.infer||h)return;if(Object(i.w)(t)||v.includes(t.type)||t.readonly)return;const e={};!function(t,e){f(t,e);const n=d[e.type];n&&(n.cache?n.cache(t,e):n.borrow&&n.borrow(t,e))}(t,e);const n=Object(o.a)(t);if(n&&n.items){const r=n.items.map(t=>t.option_id.toLowerCase()),i=t=>!!n.items&&r.includes(t.uuid.toLowerCase()),{options:o,otherOptions:c}=t;o&&(e.options=o.filter(i).map(e=>N(e,t.type))),c&&(e.otherOptions=c.filter(i).map(e=>N(e,t.type)))}I.responseId=t.parent.transactionID,I.data[t.renderId]=e;const r=t.parent.randomList;r&&(I.randomList=r.map(t=>({nodeId:t.node.nodeUuid,destPortIds:t.destPortIds}))),S(t.parent)}function S(t){const{sid:e,renderList:n}=t,r=k(e);I.lang=Object(l.b)();const i=Object.keys(I.data);I.count=0;for(const t of n)if(i.includes(t.renderId)&&(I.count+=1),t.renderId===I.point)break;Object(s.b)().preview||Object(s.c)().storage.set(r,JSON.stringify(C(I)))}function L(t){const e=k(t),n=Object(s.c)().storage.get(e);if(n){const t=JSON.parse(n);return y||(y=t.lang),t}return null}function C(t){const e=t.data,n={};return Object.keys(e).forEach(t=>{const r={...e[t]};"upload"===r.type&&(r.options=r.options.map(t=>((t={...t}).miniValue&&(t.value=t.miniValue,delete t.miniValue),t))),n[t]=r}),{...t,data:n}}function P(t){if(Object(s.c)().dev.infer)return t;if(Object(i.w)(t)||v.includes(t.type)||t.readonly)return t;const e=I.data[t.renderId];return e?(function(t,e,n){const i=Object(r.c)(t);let o=[];e.options&&(o=[...o,...e.options]),e.otherOptions&&(o=[...o,...e.otherOptions]);for(const t of i){const e=Object(r.a)(o,t.uuid);e&&j(e,t,n)}}(t,e,t.type),function(t,e){f(t,e);const n=d[e.type];n&&(n.use?n.use(t,e):n.borrow&&n.borrow(t,e))}(e,t),function(t){if(Object(i.s)(t))return;const{options:e,otherOptions:n,type:r}=t;let o=n||[];b.includes(r)&&(o=[...o,...e]);const c=o.filter(t=>t.selected);if(c.length<=1)return;const a=[];c.forEach(t=>{t.autoSelectMarked?Object(s.g)(t,{selected:!1,autoSelectMarked:!1}):a.push(t)}),a.length>1&&a.forEach((t,e)=>{e<a.length-1&&Object(s.g)(t,{selected:!1})})}(t),w&&w(t),t):(w&&w(t),t)}function M(t=!1){return t?C(I):I}async function R(t,e,n){I=t,x=[...t.randomList||[]],T=t.point;const r=I.count;let i=0;h=!0,w=()=>{i>=r?_({failed:!1,error:""}):(n.onProgress(`${i}/${r}`),i++)},_=t=>{o(),w=null,_=null,c.a.trigger("END_MEMORY",e.current),setTimeout(()=>{n.onEnd(t)},250)};const o=()=>{c.a.off("NEXT_OK",u),c.a.off("STRETCH_OK",u),c.a.off("NEXT_OK",s),h=!1},s=(t,e)=>{"NEXT_FAIL"===t.type&&e?n.onSuspend():_({failed:!0,error:e})},u=()=>e.current.renderId===T?_({failed:!1,error:""}):e.handleEvents.handleNextClick();c.a.one("STRETCH_OK",u),c.a.on("NEXT_FAIL",s),c.a.on("NEXT_OK",u),c.a.trigger("START_MEMORY"),await Object(a.b)()}function A(t,e){if(!x)return t;const n=x.find(t=>t.nodeId===e.nodeUuid);if(!n)return t;const r=n.destPortIds,i=[],o=[];return t.forEach(t=>{r.includes(t)?i.push(t):o.push(t)}),i.sort((t,e)=>r.indexOf(t)>r.indexOf(e)?1:-1),[...i,...o]}function D(){I={responseId:"",data:{},point:"",count:0,randomList:[],lang:""}}function U(t){D();const e=k(t.sid);Object(s.c)().storage.remove(e)}function B(t){h||(I.point=t.current.renderId)}function q(t){B(t),S(t)}function V(t){return t?(y||L(t),y):""}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w})),n.d(e,"c",(function(){return _})),n.d(e,"e",(function(){return x})),n.d(e,"b",(function(){return I})),n.d(e,"d",(function(){return k}));var r=n(6),i=n(37),o=n(40),c=n(43),a=n(1),s=n(5),u=n(4),l=n(55),d=n(10),f=n(7),b=n(25);const p=["select","icon_mark","value_mark","upload","menu","slide_rate"],O=["fill","verify"];function m(t){const{type:e}=t;return"region"===e?"predef":e}function g(t,e){let n;if(e.isOtherOpt)n=e.optionType;else if(!0===e.useComment)n="option_comment";else{const{type:e}=t;n="region"===e?"predef_region":p.includes(e)?"option":O.includes(e)?"comment":e}return n}function j(t,e){const n=function(t){const{loop:e}=t;let n;return e&&(n=e.replacements.map(t=>({node_id:t.loopNodeId.toLowerCase(),index:t.index,option_id:t.uuid.toLowerCase()}))),n}(t),{nodeUuid:r}=t,i=e&&e(t);return{type:m(t),node_id:r.toLowerCase(),items:i,start_time:t.startTime,cost_time:Math.round(t.costTime||0),loop_ctxs:n}}function h(t,e){const n=e,i=Object(r.e)(n),o=Object(b.a)(n,t),c={value:Object(f.b)(o)?"":o,other:!!n.isOtherOpt,type:g(t,n)};return c.option_id=n.uuid.toLowerCase(),"matrix"===t.type&&n.yid?(c.row_option_id=n.yid.toLowerCase(),c.col_option_id=n.xid.toLowerCase(),c.row_content=Object(s.k)(n.yText),c.col_content=Object(s.k)(n.xText),c.content=c.col_content+"-"+c.row_content):c.content=i||Object(s.k)(n.text),n.visible||(c.hidden=!0),c}function y(t){return Object(r.b)(t).reduce((e,n)=>((n.selected||Object(b.b)(n,t))&&e.push(h(t,n)),e),[])}const v={};function w(t){const e=v[t.type];return e&&e(t)}function _(t){return"object"==typeof t.value?JSON.stringify(t.value):t.value}function x(t,e){return"all"===e||(t?"check"===e:"normal"===e)}function T(){return function(t){const e={};return Object.keys(t).forEach(n=>{n.match(/key\d{0,2}/)&&(e[n]=t[n])}),e}(Object(d.c)())}async function I(t,e="all",n="committed_url"){const{costTime:r,answers:c}=function(t,e,n=!1){const r=[];let i=0;return t.renderList.forEach(t=>{if(!x(t.checkMode,e))return;if("data"===t.type)return;const o=w(t);o&&(n&&(o.content=t.title,o.name=t.number),r.push(o),i+=o.cost_time)}),{answers:r,costTime:i}}(t,e),s={webhook_params:await Object(l.a)(t,n),answers:c,var_map_info:Object(o.a)(t,e),options_display_info:Object(i.a)(t,e),query_params:T(),cost_time:r,status:t.responseStatus};return Object(a.m)(s.answers,(t,e)=>{"string"==typeof t[e]&&(t[e]=t[e].replace(/,/g,",").replace(/[\r\n]/g," "))}),s}function k(t){switch(t.type){case"verify":return!!t.code;case"location":case"region":case"area":return!!t.value;case"describe":case"lottery":case"end":return!1;default:return Object(r.k)(t)||Object(r.l)(t)}}v.select=v.select_image=v.menu=v.select_icon=v.hot_spot=t=>{const e=j(t,y);if(Object(u.v)(t)&&e.items){let t=!1,n=!1;e.items.forEach(e=>{"comment"!==e.type&&(e.hidden?t=!0:n=!0),delete e.hidden}),t&&n&&(e.items=e.items.filter(t=>!t.hidden))}return e},v.cascade=v.icon_mark=v.value_mark=v.matrix=v.weight=v.slide_rate=v.sequence=v.upload=v.heat_map=v.fill=v.max_diff=t=>{const e=j(t,y);return e.items&&e.items.forEach(t=>{delete t.hidden}),e},v.location=t=>{const e=j(t,e=>{const n=Object(r.b)(t).find(t=>t.selected);if(!n)return[];return[h(e,n)]}),{position:n,indexes:i}=t;return n&&(n.indexes=i,e.location=n),e},v.region=t=>{const e=v.location(t);return e.region=Object(c.b)(t.value),e},v.area=t=>v.location(t),v.data=t=>j(t,t=>Object(r.b)(t).reduce((e,n)=>(n.selected&&e.push(h(t,n)),e),[])),v.verify=t=>{const e=j(t),{phoneNumber:n,validateType:r,code:i}=t;return"sms"===r&&(e.phone_num=n),e.code=i,e},v.end=t=>({type:m(t),node_id:t.nodeUuid.toLowerCase(),start_time:t.startTime,cost_time:0}),v.logic=t=>{const e=j(t);return e.logic_result=t.logicResult,e}},function(t,e,n){"use strict";n.d(e,"g",(function(){return l})),n.d(e,"f",(function(){return d})),n.d(e,"a",(function(){return f})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return O})),n.d(e,"e",(function(){return m})),n.d(e,"b",(function(){return g}));var r=n(5),i=n(24),o=n(1),c=n(22),a=n(0);let s=[],u=[];function l(){s=[],u=[]}function d(t){s=t.imageList,u=t.variables,function(t){const e=function(t){const{varInfo:{imgSize:e},pureText:n}=t;if(n)return Object(o.n)(this.fileName);const r=g(Object(i.a)(this.serverFileName),e,this.fileName);return Object(o.n)(r)};t.forEach(t=>{t.getText=e,t.isMedia=!0,t.type="var-media"})}(s),function(){let t="";u.forEach(e=>{e.name.indexOf("TO_GLOBAL")>-1&&"var-html"===e.type&&(t+=Object(r.i)(e.value).replace(/<style>/g,"").replace(/<\/style>/g,""))}),Object(a.c)().ui.setGlobalStyle(t)}(),function(t){if(t){const e=b(t.allJson,null)+b(t.strJson,"var-string")+b(t.expJson,"var-expression")+b(t.reqJson,"var-request")+b(t.loopJson,"var-loop");Object(a.c)().ui.setVarStyle(e,t)}}(t.varStyles)}function f(t){let e="";return t.bold&&(e+="font-weight: bold;"),t.italic&&(e+="font-style: italic;"),t.underline?e+="text-decoration: underline;":t.lineThrough&&(e+="text-decoration: line-through;"),t.color&&(e+=`color: ${t.color};`),t.backgroundColor&&(e+=`background-color: ${t.backgroundColor};`),t.fontSize&&(e+=`font-size: ${t.fontSize};`,e+="line-height: 1.4;"),e}function b(t,e){if(!t)return"";let n=e?`.var-light.${e}:not([in-edist]) {`:".var-light:not([in-edist]) {";return n+=f(t),n+="}",n}function p(t=""){return u.find(e=>e.name===t)}function O(t=""){return s.find(e=>Object(o.l)(e.id,t))}function m(t=""){return Object(c.b)(t)||u.find(e=>Object(o.l)(e.uuid,t))||O(t)}function g(t="",e="0:0",n="Image",r=!1){let i="##"+t;if(!r){const t=e.split(":");i+=`?w=${t[0]||0}&h=${t[1]||0}`,n&&(i+="#"+n)}return i+"##"}},function(t,e,n){"use strict";n.d(e,"d",(function(){return b})),n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return O})),n.d(e,"f",(function(){return g})),n.d(e,"e",(function(){return j})),n.d(e,"c",(function(){return h}));var r=n(12),i=n(4),o=n(52),c=n(1),a=n(19),s=n(0),u=n(36),l=n(48),d=n(8);let f=-1;function b(t,e){return e===t||e.indexOf(t)>-1&&e.substr(t.length).indexOf("-")>-1}function p(t,e){return e=e.toLowerCase(),t.find(t=>b(t.renderId.toLowerCase(),e))}function O(t,e){for(let i=0;i<t.length;i++){const o=t[i];if(n=o,r=e,Object(c.l)(n.renderId,r.renderId))return i}var n,r;return-1}function m(t,e){Object(s.g)(t,{refreshing:e})}function g(t,e,n){if(m(t,!0),clearTimeout(f),n.initial&&Object(d.c)(t.current,!0),n.delay){const r=Object(s.c)().dev.autoRun||Object(s.c)().dev.infer?0:n.delay;return new Promise((i,o)=>{f=setTimeout(async()=>{try{await y(t,e,n)}catch(t){o(t)}i()},r)})}return y(t,e,n)}function j(t,e){const{circleNode1Id:n}=e;n?Object(s.g)(t,{loopStack:Object(c.b)(e.loopStack)}):Object(s.g)(t,{loopStack:[]});const r=t.randomList,i=e.random;r.forEach(t=>{if(i)if(Object(c.l)(t.node.nodeUuid,i.node.nodeUuid))t.currentIndex=i.currentIndex;else{i.stack.some(e=>Object(c.l)(t.node.nodeUuid,e.node.nodeUuid))||(t.currentIndex=-1)}else t.currentIndex=-1})}function h(t,e){const n=function(t,e){let n=t;if(!e)return n;for(const t of e)n+="-"+Object(c.s)(t.option_id);return n}(e.node_id,e.loop_ctxs);return p(t.renderList,n)}async function y(t,e,n){m(t,!0);const c=t.renderList;j(t,e=e||t.current);const d=O(c,e),f=await async function(t,e,n){const c=n.type;let u=[...t.renderList];u=u.length>0?u:[e];const l=O(u,e);if(l<0)return u;u.length=l,u.push(e),Object(s.g)(t,{renderList:u}),Object(a.c)(t)&&await Object(o.a)(e);let d=null;const f=t=>!Object(i.t)(t,d);let b=null;for("page_inner"===c&&(d=e,b=f);;){const e=await Object(r.c)(t,b);if(!e)break;if(u.push(e),i.x.includes(e.type))break;if(!Object(i.w)(e)){d||(d=e,d.groupSingle&&(b=f));if(!Object(i.t)(d,e))break;await Object(o.a)(e)}}return u}(t,e,n),b=n.initial?Object(r.g)(t,f,d).next:e;Object(s.g)(t,{current:b}),m(t,!1),j(t,e),await t.dynamicStateProps(),n.initial||(await Object(r.b)(t),t.inSingleGroup&&Object(l.a)(t)),Object(u.d)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return j})),n.d(e,"d",(function(){return h})),n.d(e,"e",(function(){return y}));var r=n(6),i=n(5),o=n(1),c=n(40),a=n(31),s=n(13),u=n(42),l=n(22),d=n(0),f=n(24);function b(t,e){const{loop:n}=e,r=n&&n.node.nodeUuid;return Object(l.a)().QUES_IMAGE.getImages({state:t,varInfo:{question:e,loopNodeId:r}})}async function p(t,e){const{parent:n,loop:r}=t,i=r&&r.node.nodeUuid,{image:o,text:a}=e,s=Object(l.a)(),u=(await s.OPT_IMAGE.getImages({state:n,varInfo:{option:e,loopNodeId:i}}))[0];return!a&&u&&o&&"variable"===o.type&&Object(c.d)({question:t,option:e},{mapId:o.id},u.originName),u}function O(t){return!!Object(d.b)().realTimePreview||t&&!!(t.text||t.image||t.icon)}async function m(t,e,n){const{optionPart:i,nodePart:o}=e,{option:c}=e;if(!i||i.inBunch)return{valid:!0};if(c)return{valid:!0,option:c};{const i=await o.filter({state:t,varInfo:e}),c=Object(r.a)(i,n.refOptId);return{valid:!!c,option:c}}}function g(t,e){return t?t.find(t=>t.uuid===e):null}async function j(t,e,n){const r={...t};if(e.context.option=r,r.mapping){const t={...r.mapping};for(const n of Object.keys(t)){const r=n,o=t[r];if("string"==typeof o)t[r]=await Object(i.d)(o,{state:e});else{const e=o;t[r]=Object(f.c)(e)}}r.mapping=t,"data"===n&&(r.value=t.field_1,r.number=t.field_2,r.optComment=t.field_3,r.image=t.field_4)}return r.assistValue={field_1:"",field_2:"",field_3:"",field_4:"",field_5:"",field_6:""},e.context.option=null,r}async function h(t,e,n){const r=[];for(const i of t)r.push(await j(i,e,n));return r}async function y(t,e,n,u=!1){let l=[];const d=e;let{refOptions:f,options:b,optionRefers:p}=d;if("xid"===n?(f=d.refOptionsX,b=d.optionsX,p=d.optionXRefers):"yid"===n&&(f=d.refOptionsY,b=d.optionsY,p=d.optionYRefers),b&&f&&0!==f.length){l=[...b];const e={};for(const n of f){const o=g(p,n.referId),c=await Object(i.e)(n.limitRnd,{state:t});if(0===c)continue;let a=null;const l=Object(s.h)(t,{uuid:n.varId,limit:n.limit,limitSrc:n.limitSrc,limitRnd:n.limitRnd});if(!l)continue;const{valid:d,option:f}=await m(t,l,n);if(!d)continue;f&&(n.refIndex=f.index,n.refRealIndex=f.realIndex);const b={state:t,varInfo:l,specifiedOpt:f,pureText:!u,keepWrap:!0};if(l.question?(a=await Object(s.a)(b),f&&(a.passRef={value:f.value,optComment:f.optComment,image:Object(r.p)(f,"image"),number:f.number,text:f.text,label:f.label,mapping:f.mapping&&{...f.mapping}})):a=await v(b),O(a)){const t={...n,...a},r=n.referId+n.varId;e[r]?e[r].list.push(t):e[r]={list:[t],limitRnd:c,varInfo:l,disorder:o&&o.disorder}}}Object.keys(e).forEach(t=>{const{limitRnd:n,list:r,varInfo:i,disorder:s}=e[t];let u=Object(o.p)(r,n);u=s?Object(a.c)(u):Object(a.e)(u),Object(c.e)(d,i,u),l=l.concat(u)})}else l=b;return h(l,t,d.type)}async function v(t){return{text:await Object(i.c)(t),image:Object(u.b)(t.varInfo)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return ct})),n.d(e,"c",(function(){return at})),n.d(e,"d",(function(){return lt})),n.d(e,"f",(function(){return dt})),n.d(e,"e",(function(){return ft})),n.d(e,"a",(function(){return bt}));var r=n(31),i=n(6),o=n(4),c=n(18),a=n(37),s=n(5);var u=n(0);const l=["select","sequence","menu"];function d(t,e){return e.options?e=function(t,e){if(Object(u.b)().realTimePreview)return e;let n;return l.indexOf(t.type)>-1?n=t=>!!t.text:"select_image"===t.type?n=t=>!!t.image:"slide_rate"===t.type&&(n=t=>!!t.text||!!t.image),n&&(e.options=e.options.filter(n)),e}(t,e):e}var f=n(61),b=n(11),p=n(7);const O={done:!1,expectedValue:"",actualValue:""};function m(t){const{autoInputConfig:e}=t;if(!e)return"";const{defaultValue:n}=e;return n&&Object(p.a)(n).trim()?n:""}const g={};async function j(t,e,n,r,i){if(!m(t))return O;const{parent:o}=e,c=await Object(s.e)(m(t),{state:o});let a=c;return c>=n&&c<=r||(a=i),Object(u.g)(t,{value:a}),{done:!0,actualValue:a,expectedValue:c}}async function h(t,e){const n=g[e.type];if(n){e.parent.context.option=t;const r=await n(t,e);return!!r.done&&(Object(b.c)(e.parent,t,e,r.actualValue,r.expectedValue),!0)}return!1}g.fill=async(t,e)=>{if(!m(t))return O;const{parent:n}=e,r=await Object(s.f)(m(t),{state:n});return Object(u.g)(t,{value:r}),{done:!0,actualValue:r,expectedValue:r}},g.value_mark=(t,e)=>j(t,e,t.minValue,t.maxValue,""),g.icon_mark=(t,e)=>j(t,e,0,t.count,""),g.slide_rate=(t,e)=>{const{rateOptions:n}=e;return j(t,e,0,n.length,"")},g.weight=(t,e)=>j(t,e,0,t.maxValue||e.weightTotal,""),g.sequence=async(t,e)=>{if(!m(t))return O;const n=e.options.length,{parent:r}=e,i=await Object(s.e)(m(t),{state:r});let o=i;return i>=1&&i<=n||(o=-1),Object(u.g)(t,{sortNo:o,selected:o>=1}),{done:!0,actualValue:o,expectedValue:i}};var y=n(21),v=n(1);async function w(t,e){const n=e.parent;n.context.option=t;const r=await function(t,e){return e?Object(y.b)(t,e.options,e.logicType):Object(v.n)(!1)}(n,t.selectConfig);t.autoSelectMarked=!!r}const _=["select","select_icon","select_image","menu","hot_spot"];var x=n(42),T=n(14),I=n(8);async function k(t,e,n,r,i=!1){const o=(n.options||[]).find(n=>n.xid===t.uuid&&n.yid===e.uuid),s={...o,index:o.number,realIndex:o.number,label:o.label||"",xid:t.uuid,yid:e.uuid,xText:t.text,yText:e.text,text:i?t.text:e.text,xNumber:t.number,xMutexNumber:t.mutexNumber,yMutexNumber:e.mutexNumber,yNumber:e.number,renderId:Object(v.h)(o.uuid,n.loopStack),headLength:r,selected:!1},u=await Object(c.c)(s,n.parent,n.type),l=await Object(a.b)(n.parent,u,n);return u.disabled=!l,u}async function N(t,e,n){const{parent:r}=t;return e={...e,customData:{},isOther:!!e.isOtherOpt,_selected:!1,inputType:n||E(e),value:e.value||"",renderId:Object(i.h)(t,e)},r.context.option=e,e.text=await Object(s.d)(e.text,{state:r,usage:{question:t,option:e}}),Object.defineProperty(e,"selected",{get(){return this._selected},set(t){"select-input"===this.inputType&&(t?Object(u.g)(this,{value:this.cachedValue||this.value}):Object(u.g)(this,{cachedValue:this.value,value:""})),Object(u.g)(this,{_selected:t}),t&&-1===this.mutexNumber&&setTimeout(()=>{I.a.trigger("OPT_EXCLUDE",this)}),I.a.trigger("OPT_SELECT",this)}}),e.isOtherOpt&&(await function(t,e){return Object(u.g)(t,{inputType:E(t)}),L(t,e)}(e,t),Object(i.n)(e)||await w(e,t)),function(t){!0===t.useComment?Object(u.g)(t,{placeholder:t.optComment}):"input"===t.inputType&&Object(u.g)(t,{placeholder:t.text})}(e),e}function E(t){let e="select";return Object(i.n)(t)?e="input":!0===t.useComment&&(e="select-input"),e}const S={chars:"count",date:"date",date_range:"dateRange",email:"email",float:"float",integer:"int",phone_number:"mobile",postcode:"postCode",time:"time",time_range:"timeRange",time_duration:"timeSpan",url:"link",auto_complete:"autoComplete",list_select:"dropdown",none:"noValidation"};async function L(t,e){const n=t.fillType;if(!n)return;const{parent:r}=e;let i,o,c,a=await Object(s.e)(t.fillStart,{state:r}),l=await Object(s.e)(t.fillEnd,{state:r});if(isNaN(a)&&(a=void 0),isNaN(l)&&(l=void 0),"date"===n){const t=(new Date).getFullYear(),e=a,n=l;void 0!==a&&(a=new Date(a,0,1),t<e&&(i=a)),void 0!==l&&(l=new Date(l,11,31),t>n&&(i=l))}"auto_complete"===n&&(o=function(t,e=[]){const{autoCpltGroups:n}=t;return e.reduce((t,e)=>{const r=n.find(t=>t.id===e);return r&&(t=t.concat(r.data)),t},[])}(r,t.autoCpltIds),c=Object(T.d)(e.parent.sid));let d=[];if("list_select"===n){d=A((await Object(s.f)(t.selectText,{state:r,joinBy:","})).split(","))}Object(u.g)(t,{inputRule:S[t.fillType]||"noValidation",validateMin:a,validateMax:l,defaultValue:i,completeGroups:o,selectList:d,prevCpltLang:c})}async function C(t,e,n=!1){const{options:i,otherOptions:o,hiddenOptions:c}=t,a={options:[],otherOptions:[],hiddenOptions:[]};if(i)for(const n of Object(r.b)(t,i))a.options.push(await e(n));if(o)for(const e of o)a.otherOptions.push(await N(t,e));if(c)for(const t of c)a.hiddenOptions.push(await e(t));return n&&D([...a.options,...a.otherOptions]),a}const P={};async function M(t,e){if(!t.image||!t.image.reformed){return await Object(c.b)(e,t)}return t.image}function R(t){return t.replace("/outline/","/glyph/")}function A(t){const e={};return t.map(t=>{const n=e[t];if(n){const r=n+1;return e[t]=r,`${t}(${n})`}return e[t]=2,t})}function D(t){A(t.map(t=>t.text)).forEach((e,n)=>{t[n].text=e})}function U(t){return t?"string"==typeof t?t:t.path?Object(u.b)().hostConfig.cdnHost+t.path:"":""}function B(t){const{icon:e}=t,n=U(e);Object(u.g)(t,{icon:n,iconActive:R(n)})}async function q(t,e){const n=await async function(t,e){const n=t;if("matrix"===n.type){const t=await Object(c.e)(e,n,"xid");n.optionsX=await Object(a.c)(e,t,n);const r=await Object(c.e)(e,n,"yid");n.optionsY=await Object(a.c)(e,r,n);const i=await Object(c.d)(n.otherOptions,e,n.type),o=await Object(a.d)(e,i,n);return n.otherOptions=o.visibleList,n}if(n.options){let t=await Object(c.e)(e,n);if(n.otherOptions){const r=await Object(c.d)(n.otherOptions,e,n.type);t=t.concat(r)}const r=await Object(a.d)(e,t,n);return n.options=[],n.otherOptions=[],r.visibleList.forEach(t=>{t.isOtherOpt?n.otherOptions.push(t):n.options.push(t)}),n.hiddenOptions=r.hiddenList,n}return n}(t,e),r=P[n.type],i=r?await r(n):void 0,s=i&&d(n,i);return Object(u.g)(n,s),function(t){const{options:e,otherOptions:n,type:r,parent:i}=t;let c=n||[];_.includes(r)&&(c=[...c,...e]);const a=c.filter(t=>t.autoSelectMarked).reverse();if(Object(o.s)(t))a.forEach(e=>{Object(u.g)(e,{selected:!0}),Object(b.d)(i,e,t)});else{const[e,...n]=a;n.forEach(e=>{e.autoSelectMarked=!1,Object(b.d)(i,e,t,"因冲突被终止")}),e&&(Object(u.g)(e,{selected:!0}),Object(b.d)(i,e,t))}}(n),e.context.option=null,s}P.select=t=>C(t,(async function(e){const n=await N(t,e);return await L(n,t),await w(n,t),n})),P.fill=t=>C(t,(async function(e){const n=await N(t,e,"input");return await L(n,t),n.placeholder=Object(s.k)(n.text),await h(n,t),n})),P.value_mark=t=>C(t,(async function(e){const{parent:n}=t,r=await N(t,e,"input");r.value="";const i=await Object(s.e)(t.markMin,{state:n}),o=await Object(s.e)(t.markMax,{state:n});return Object(u.g)(r,{minValue:i,step:t.markStep,maxValue:o,minValueText:t.minText,maxValueText:t.maxText}),await h(r,t),r})),P.icon_mark=t=>C(t,(async function(e){const n=await N(t,e,"input");return n.value="",Object(u.g)(n,{count:t.markImgCount||5,icon:t.markImgName||"rating-number"}),await h(n,t),n})),P.sequence=async t=>{let e=!1;const n=await C(t,async n=>{const r=await N(t,n,"input");Object(u.g)(r,{icon:"ranking",sortNo:-1});return await h(r,t)&&(e=!0),r});return e&&n.options.sort((t,e)=>t.sortNo>e.sortNo?1:-1),n},P.matrix=async t=>{const e=Object(r.a)(t),{optionsX:n,optionsY:i}=e,{parent:c}=t,a=[];for(const e of n)a.push({...e,text:await Object(s.d)(e.text,{state:c,usage:{question:t,option:e}})});const u=[];for(const e of i)u.push({...e,text:await Object(s.d)(e.text,{state:c,usage:{question:t,option:e}})});const l=[];for(const n of e.otherOptions)l.push(await N(t,n));const d={otherOptions:l,renderOptionsX:a.filter(t=>t.visible),renderOptionsY:u.filter(t=>t.visible)},f=Object(o.r)(t)||Object(o.o)(t),b=await async function(t,e,n,r=!1){const i=[],o=[];let c=t,a=e;r&&(c=e,a=t);for(const[t,e]of c.entries())if(e.visible){const c=e.text.length,s={length:c,text:e.text,list:[]};let u=0;for(const t of a)if(t.visible){let i=e,a=t;r&&(a=e,i=t);const l=await k(i,a,n,c,r);u=Math.max(u,l.text.length),o.push(l),s.list.push(l)}0===t&&s.list.forEach(t=>{t.length=u}),i.push(s)}return{flatten:i,options:o,fullOptions:o}}(a,u,t,f),p=function(t,e,n){const r=[];return e.forEach(e=>{if(e.visible){const i=[];t.forEach(t=>{if(t.visible){const r=n.find(n=>n.xid===t.uuid&&n.yid===e.uuid);if(!r)throw new Error("matrix item not found");i.push(r)}}),r.push(i)}}),{matrix:r}}(a,u,b.options);return{...d,...b,...p}},P.select_image=t=>C(t,async e=>{const n=await N(t,e);return n.text=Object(s.k)(n.text),n.image=await M(n,t),await w(n,t),n}),P.upload=t=>C(t,async e=>{const n=await N(t,e,"input");return n.text=Object(s.k)(n.text),n.icon="camera",n.name="",n.value="",n.fileName="",n.fileType="",n.progress=0,n.isImage=!1,n.fileLimits=[...n.fileLimits||["image"]],n.accept=Object(f.a)(n.fileLimits),n}),P.menu=t=>C(t,async e=>{const n=await N(t,e);return await L(n,t),n.text=Object(s.k)(n.text).trim(),await w(n,t),n},!0),P.select_icon=t=>C(t,async e=>{const n=await N(t,e);return B(n),await w(n,t),n}),P.weight=t=>{const{parent:e}=t;return C(t,async n=>{const r=await N(t,n,"input");let i=await Object(s.e)(r.maxMark,{state:e});const c=await Object(o.h)(t);return(!i||i>c)&&(i=c),Object(u.g)(r,{percent:"0%",color:r.color,maxValue:i,value:""}),await h(r,t),r})},P.cascade=t=>C(t,e=>(e.text="",N(t,e))),P.data=async t=>{const e={state:t.parent,loop:t.loop},n=[];for(const r of t.options){const i=await N(t,r);B(i),Object(u.g)(i,{value:await Object(s.g)(i.value,e),number:await Object(s.g)(i.number,e),optComment:await Object(s.d)(i.optComment,e),image:await Object(c.b)(t,i)}),await w(i,t),n.push(i)}return{options:n}},P.hot_spot=async t=>{const e=await C(t,async e=>{const n=await N(t,e);await L(n,t),await w(n,t);const{area:r,pathD:i}=n.points.reduce((t,e,r)=>{t.pathD?t.pathD+=" L":t.pathD+="M",t.pathD+=e.x+" "+e.y;const i=n.points[r+1];return i?t.area+=e.y+i.y*(i.x-e.x)/2:t.pathD+=" Z",t},{area:0,pathD:""});return Object(u.g)(n,{area:r,pathD:i,transform:`translate(${n.x},${n.y})`}),n});return e.options.sort((t,e)=>t.area<e.area?1:-1),e},P.heat_map=t=>C(t,(async function(e){return await N(t,e,"input")})),P.max_diff=t=>C(t,(async function(e){const n=await N(t,e,"input");return n.value=0,n.image=await M(n,t),n.records=[],n})),P.slide_rate=async t=>{const{rateOptions:e}=t,n=await C(t,async e=>{const n=await N(t,e,"input");return Object(u.g)(n,{image:await M(n,t),text:Object(x.c)(n.text),value:""}),await h(n,t),n}),r=[];for(const n of e){await Object(a.b)(t.parent,n,t)&&r.push(n)}return{...n,rateOptions:r.map(t=>{const{icon:e}=t,n=U(e);return{url:U(e),urlActive:R(n),text:Object(s.a)(t.text),value:t.value,uuid:t.uuid,customData:{}}})}};var V=n(43),F=n(2),$=n(3);const H={typeName:"",typeDescription:""},X={};X.select=async t=>{const e=Object(o.s)(t);let n=Object(F.f)($.a.select.single);if(e){n=Object(F.f)($.a.select.multi);const{min:e,max:r}=await Object(o.e)(t);return{typeName:n,typeDescription:Object(F.f)($.a.select.limitBetween,{min:e,max:r})}}return{typeName:n,typeDescription:""}},X.value_mark=()=>Object(v.n)({typeName:Object(F.f)($.a.mark.value)}),X.icon_mark=()=>Object(v.n)({typeName:Object(F.f)($.a.mark.graph)}),X.weight=t=>{const e=t.weightTotal;let n=Object(F.f)($.a.weight.total,{total:e});return n+=!0===t.relax?Object(F.f)($.a.weight.relax):Object(F.f)($.a.weight.strict),Object(v.n)({typeName:Object(F.f)($.a.weight.name),typeDescription:n})},X.fill=()=>Object(v.n)({typeName:Object(F.f)($.a.fill.name)}),X.slide_rate=()=>Object(v.n)({typeName:Object(F.f)($.a.slideRate.name)}),X.sequence=t=>{const e=t.rankCount,n=Number(e)?Object(F.f)($.a.rank.limitMin,{min:e}):Object(F.f)($.a.rank.limitAll);return Object(v.n)({typeName:Object(F.f)($.a.rank.name),typeDescription:n})},X.menu=async t=>({...await X.select(t),typeName:Object(F.f)($.a.menu.name)}),X.select_icon=t=>X.select(t),X.select_image=t=>X.select(t),X.upload=async t=>{const e=Object(F.f)($.a.upload.name);if(!0===t.limitEnabled){const{min:n,max:r}=await Object(o.g)(t);return{typeName:e,typeDescription:Object(F.f)($.a.upload.amountLimit,{min:n,max:r})}}return{typeName:e,typeDescription:""}},X.location=()=>Object(v.n)({typeName:Object(F.f)($.a.locate.name)}),X.area=()=>Object(v.n)({typeName:Object(F.f)($.a.site.name)}),X.region=()=>Object(v.n)({typeName:Object(F.f)($.a.region.name)}),X.verify=()=>Object(v.n)({typeName:Object(F.f)($.a.verify.name)}),X.cascade=()=>Object(v.n)({typeName:Object(F.f)($.a.cascade.name)}),X.matrix=async t=>{if(Object(o.v)(t))return{typeName:Object(F.f)($.a.matrix.single)};if(Object(o.s)(t)){const{min:e,max:n}=await Object(o.e)(t);let r=Object(F.f)($.a.matrix.multi),i=Object(F.f)($.a.select.limitBetween,{min:e,max:n});return Object(o.n)(t)?(r=Object(F.f)($.a.matrix.multiCol),i=Object(F.f)($.a.matrix.colLimitBetween,{min:e,max:n})):Object(o.o)(t)&&(r=Object(F.f)($.a.matrix.multiRow),i=Object(F.f)($.a.matrix.rowLimitBetween,{min:e,max:n})),{typeName:r,typeDescription:i}}return Object(o.r)(t)?{typeName:Object(F.f)($.a.matrix.singleRow),typeDescription:Object(F.f)($.a.matrix.eachRowOne)}:Object(o.p)(t)?{typeName:Object(F.f)($.a.matrix.singleCol),typeDescription:Object(F.f)($.a.matrix.eachColOne)}:Object(o.q)(t)?{typeName:Object(F.f)($.a.matrix.singleRowCol),typeDescription:Object(F.f)($.a.matrix.eachRowColOne)}:{typeName:Object(F.f)($.a.matrix.single)}},X.hot_spot=()=>Object(v.n)({typeName:Object(F.f)($.a.hotSpot.name)}),X.heat_map=()=>Object(v.n)({typeName:Object(F.f)($.a.heatMap.name)}),X.max_diff=()=>Object(v.n)({typeName:Object(F.f)($.a.maxDiff.name)});var z=n(24);const K=["select","menu","select_image","select_icon","upload"];function G(t){return async function(t){if("sequence"===t.type){const e=Object(i.c)(t);if(1===e.length){const n=e[0];Object(u.g)(n,{selected:!0,sortNo:1}),Object(b.r)(0,t)}}else if(K.indexOf(t.type)>-1){if(!await Object(y.f)(t.showWithSingleRefOpt,t.parent)){const e=Object(i.c)(t)||[];if(1===e.length){const n=e[0];n.isRef&&(Object(u.g)(n,{selected:!0}),Object(b.d)(t.parent,n,t,"single_ref_select_opt"),t.forceSkipReason="single_ref_select_opt",t.autoSkip=!0)}}return t}return t}(t)}var Y=n(40),W=n(60),Z=n(15),Q=n(12),J=n(22),tt=n(10);function et(t){return 1===t?"bottom":2===t?"top":"center"}async function nt(t,e){const{destList:n,cascadeStart:r}=e,c=Object(o.c)(t.nodeList,n,r.uuid);if(!c)return;const a=await async function t(e,n,r,c,a){a?((a=await N(e,a)).text=Object(x.c)(Object(s.k)(a.text)),await L(a,e)):a={uuid:"",text:""};const{nodeList:u}=n,l=c?c+"=>"+Object(v.s)(a.uuid):Object(v.s)(a.uuid),d={option:a,groupId:c,resultId:l,text:a.text||a.optComment};if(!r)return d;d.placeholder=r.placeholder||Object(F.f)($.a.menu.clickToSelect),(r={...r,options:await rt(r,n,e)}).parent=n;const f=Object(o.s)(r),{min:b,max:p}=await Object(o.e)(r),{destList:O,output:m}=r,g=Object(o.i)(r),j=[],h=f?Object(F.f)($.a.cascade.selectBetween,{min:b||1,max:p}):Object(F.f)($.a.cascade.selectSome,{amount:1}),y={...d,list:j,multiple:f,min:b,max:p,hint:h,required:g,display:et(r.menuType),multiLine:r.lineCount},w=Object(o.c)(u,O,m.uuid),_=Object(i.c)(r);D(_);for(const r of _){const i=Object(o.c)(u,O,r.uuid)||w,c=await t(e,n,i,l,r);j.push(c)}return y}(e,t,c,"");e.cascade=a}async function rt(t,e,n){let i=n.cachedCasMenuOpts;i||(i=n.cachedCasMenuOpts={});const o=i[t.nodeUuid];if(o)return o;{const o=await Object(c.e)(e,t),s=await Object(a.d)(e,o,n),u=Object(r.b)(t,s.visibleList);return i[t.nodeUuid]=u,u}}function it(t,e,n){const r=function(t){const e=[];return t.forEach(t=>{const{pickedTimes:n}=t;e[n]?e[n].push(t):e[n]=[t]}),e}(t),i={items:[],done:!1};let o=e;for(const t of r)if(t){const e=Object(v.p)(t,o);if(e.forEach(t=>{i.items.push({option:t.option,value:0,round:n}),t.option.records.push({round:n,value:0}),t.pickedTimes+=1}),o-=e.length,0===o)break}return i}function ot(t){const{options:e,itemCountPerTask:n,taskCount:r}=t,i=e.map(t=>({option:t,pickedTimes:0})),o=[];for(let t=0;t<r;t++)o.push(it(i,n,t+1));return o}function ct(t){const{current:e,renderList:n}=t,r=[e],i=n.indexOf(e);let c=i-1,a=e;for(;;){const t=n[c--];if(!Object(o.t)(t,a))break;Object(o.w)(t)||(r.unshift(t),a=t)}let s=i+1,l=e;for(;;){const t=n[s++];if(!Object(o.t)(t,l))break;Object(o.w)(t)||(r.push(t),l=t)}return r[0].groupSingle&&(r.forEach(t=>{Object(u.g)(t,{pageEnd:!1,pageStart:!1})}),Object(u.g)(r[0],{pageStart:!0}),Object(u.g)(r[r.length-1],{pageEnd:!0})),r}function at(t){const e=t.first();return e&&e.groupSingle}function st(t){return["province","city","county","street"].indexOf(t)+1||1}const ut={};async function lt(t){const e=t,{parent:n}=e,r=await Object(s.d)(e.describe,{state:n,usage:{question:e,exclusiveId:"description"}});Object(u.g)(e,{description:r})}async function dt(t,e){const n={...t,dynamicNodeProps(){Object(u.g)(this,{hasAnswer:Object(Z.d)(this),next:Object(Q.e)(this).next})}};if(o.y.indexOf(n.type)>-1)return async function(t,e){t.parent=e,Object(u.g)(t,{autoSkip:!0,renderId:Object(o.f)(t),number:""});const n=ut[t.type];return n&&await n(t),t}(n,e);const{qNumberRequired:r}=e;n.parent=e;const i=Object(o.f)(n);Object(u.g)(n,{customData:{},template:await Object(u.c)().ui.initNodeTemplate(n.template,e,n.loop),startTime:(new Date).toISOString(),costTime:0,realtimePreview:Object(u.b)().realTimePreview,validateFailTimes:0,renderId:i,images:await Object(c.a)(e,n),asterisks:!0===n.answerRequired&&e.asterisksRequired,selectType:Object(o.s)(n)?"checkbox":"radio",value:""}),await q(n,e);const a=ut[n.type];a&&await a(n),e.context.question=n,await async function(t){const e=t,{loop:n,parent:r}=e,i=await Object(s.d)(e.questionText,{spaceRep:" ",state:r,usage:{question:e,exclusiveId:"title"}});let o=e.nodeName.split("/")[0];if(o&&e.circleNode1Id&&!e.lockLoopCount&&!Object(u.b)().realTimePreview){const t=Object(J.a)();let i=await t.C_OL_LBL.getText({state:r});if(i||(i=n.node.nodeName+"_"+await t.C_OL_IDX.getText({state:r})),o=i+"_"+o,e.circleNode2Id){let e=await t.C_IL_LBL.getText({state:r});e||(e=n.node.nodeName+"_"+await t.C_IL_IDX.getText({state:r})),o=e+"_"+o}}Object(u.g)(e,{title:i,realNodeName:o})}(n),await lt(n),r&&function(t){"end"!==t.type&&"describe"!==t.type&&Object(u.g)(t,{number:t.realNodeName})}(n),Object(u.c)().dev.infer||Object(u.g)(n,await async function(t){if(!t.parent.nodeTypeInfoRequired)return H;const e=X[t.type],n=e?await e(t):H;return n.typeDescription="",n}(n)),Object(o.z)(n);return Object(T.i)(await G(n))}async function ft(t,e,n){const r=await dt({origin:t,...t,parent:n,activityName:e.activityName,rewardName:e.rewardName,rewardTime:e.sendTime,goal:e.goal,rewardNodeId:e.rewardNodeId,rewardCount:e.lotteryCount,rewardImage:e.rewardImage,rewardTitle:e.rewardTitle,rewardDescribe:e.rewardDescribe,rewardList:t.showRewards?t.options.map(t=>({rewardName:t.rewardName,rewardNumbering:t.rewardCount})):null},n);if(!Object(u.b)().preview){const{formalResult:{reward:t}}=n;!Object(u.c)().app.canHandleReward()&&t&&"red_envelope"===t.type&&await bt(n,r)}return r}async function bt(t,e){const{formalResult:{reward:n,authorizer:r},nodeList:i}=t,{app_id:c,component_appid:a}=r,l=Object(o.a)(i,n.gift_id),d=await Object(s.h)(l.linkUrl,{state:t});e.linkUrl=d,e.endBtnText=l.endBtnText||"";const f={rid:Object(p.a)(n.id),aid:c,cid:a,qid:t.surveyId,tid:t.transactionID,sid:Object(tt.c)().sid};l.template&&(f.rtpl=l.template.id),e.qrCode=Object(u.c)().app.getRewardUrl(f)}ut.select=t=>(Object(u.g)(t,{quesType:"choice"}),Object(v.n)()),ut.region=t=>(Object(u.g)(t,{quesType:"region",indexes:"0 0 0",value:"",regions:Object(V.d)(),grade:st(t.infoRange),placeholder:Object(F.f)($.a.menu.clickToSelect)}),Object(v.n)()),ut.describe=t=>(Object(u.g)(t,{quesType:"intro-page"}),Object(v.n)()),ut.end=async t=>{const{parent:e}=t,n=await Object(s.h)(t.linkUrl,{state:e});Object(u.g)(t,{quesType:"end-page",hasReward:!1,logoText:t.parent.customText,logoImage:t.parent.customLogo,linkUrl:n})},ut.fill=t=>(Object(u.g)(t,{quesType:"short-text"}),Object(v.n)()),ut.gift=t=>(Object(u.g)(t,{quesType:"reward"}),Object(v.n)()),ut.select_icon=t=>(Object(u.g)(t,{quesType:"icon"}),Object(v.n)()),ut.location=t=>(Object(u.g)(t,{quesType:"location",regions:Object(V.d)(),grade:st(t.infoRange),value:""}),Object(v.n)()),ut.lottery=t=>(Object(u.g)(t,{quesType:"lottery"}),Object(v.n)()),ut.value_mark=t=>(Object(u.g)(t,{quesType:"range"}),Object(v.n)()),ut.icon_mark=t=>(Object(u.g)(t,{quesType:"rating"}),Object(v.n)()),ut.matrix=t=>(Object(u.g)(t,{quesType:"matrix"}),Object(v.n)()),ut.menu=t=>(Object(u.g)(t,{quesType:"dropdown",value:"",placeholder:t.placeholder||Object(F.f)($.a.menu.clickToSelect),icon:"arrows-small-down",...Object(o.e)(t),multiple:Object(o.s)(t),display:et(t.menuType),multiLine:t.lineCount}),Object(v.n)()),ut.select_image=t=>(Object(u.g)(t,{quesType:"picture-choice"}),Object(v.n)()),ut.sequence=t=>(Object(u.g)(t,{quesType:"ranking"}),Object(v.n)()),ut.area=t=>(Object(u.g)(t,{quesType:"location",grade:3,regions:Object(V.d)()}),Object(v.n)()),ut.upload=t=>(Object(u.g)(t,{quesType:"file-upload"}),Object(v.n)()),ut.verify=t=>(Object(u.g)(t,{quesType:"verification",value:"",phoneNumber:"",code:""}),Object(v.n)()),ut.weight=async t=>{const e=await Object(o.h)(t);Object(u.g)(t,{quesType:"weight",weightTotal:e})},ut.max_diff=t=>(Object(u.g)(t,{quesType:"max-diff",tasks:ot(t)}),Object(v.n)()),ut.cascade=async t=>{await nt(t.parent,t),function(t){const e=[],n=t=>{e.push(t),t.list&&t.list.forEach(t=>n(t))};n(t.cascade),t.options.forEach(t=>{if(t.useComment){const n=e.find(e=>e.resultId===t.cascadePath);t.inputType=E(n.option)}})}(t),function t(e,n,r,i,o=""){const{resultId:c,text:a}=n,s=c&&e.options.find(t=>t.cascadePath===c),u=o?o+"=>"+a:a;return s&&(s.text=u),r.nodeTypeInfoRequired||(n.hint=""),n.list&&n.list.forEach(n=>{n.text=t(e,n,r,i,u)}),n.text}(t,t.cascade,t.parent,t.loop,""),Object(u.g)(t,{quesType:"cascade"}),t.options=t.options.filter(t=>!!t.text),Object(Y.c)(t,t.options)},ut.data=t=>(Object(u.g)(t,{quesType:"intro-page"}),Object(v.n)()),ut.hot_spot=t=>(Object(u.g)(t,{quesType:"hot-spot",mapImage:t.mapImage&&Object(z.b)(t.mapImage)}),Object(v.n)()),ut.heat_map=t=>(Object(u.g)(t,{quesType:"heat-map",clickTimes:0,mapImage:t.mapImage&&Object(z.b)(t.mapImage)}),Object(v.n)()),ut.slide_rate=t=>(Object(u.g)(t,{quesType:"slide-rate"}),Object(v.n)()),ut.loop=async t=>{const{parent:e}=t;if(!Object(W.a)(t,e)){const n=await Object(W.b)(e,t);t.varList=n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return b})),n.d(e,"c",(function(){return p}));var r=n(14),i=n(11),o=n(0),c=n(2),a=n(3),s=n(1),u=n(8);class l{constructor(t,e){if(t&&t.data&&Object.keys(t.data).length>0){const{langResume:n}=e;this.holder=t,this.state=e,this.show=!0,this.title=n?Object(c.f)(a.a.langResume.title):Object(c.f)(a.a.memory.title),this.message=n?"":Object(c.f)(a.a.memory.message),this.sureText=n?"":Object(c.f)(a.a.memory.sure),this.denyText=n?"":Object(c.f)(a.a.memory.deny)}}handleSure(){if(!this.holder||b())return Object(s.n)();const t=this;return Object(o.g)(t,{sureText:"",denyText:"",show:!0,resuming:!0}),Object(i.w)(this.state,t.holder.responseId||""),Object(r.g)(this.holder,this.state,{onEnd(){t.end()},onProgress(e){Object(o.g)(t,{show:!0}),Object(o.g)(t,{message:e})},onSuspend(){t.suspend()}})}handleDeny(){b()||(Object(r.b)(this.state),this.end())}end(){Object(o.g)(this,{show:!1,holder:null,message:"",resuming:!1}),p()}suspend(){Object(o.g)(this,{show:!1})}}let d=null;function f(t){const e=Object(r.e)(t.sid);return d=new l(e,t),d}function b(){return d&&d.resuming}function p(){b()||u.a.trigger("UPDATE_UI")}},function(t,e,n){"use strict";n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return O})),n.d(e,"e",(function(){return m})),n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return j})),n.d(e,"f",(function(){return h}));var r=n(17),i=n(1),o=n(5),c=n(15),a=n(13),s=n(7);const u={1:(t,e,n)=>(e>n&&([e,n]=[n,e]),u[5](t,e,0)&&u[6](t,n,0)),2:(t,e,n)=>!u[1](t,e,n),11:(t,e)=>{const n=Object(s.a)(t).split(",").filter(t=>""!==t.trim()),r=Object(s.a)(e).split(",").filter(t=>""!==t.trim());return n.some(t=>(t=t.trim(),r.some(e=>(e=e.trim(),t.indexOf(e)>-1))))},12:(t,e)=>!u[11](t,e,0),3:(t,e)=>Object(s.a)(t)===Object(s.a)(e),4:(t,e)=>!u[3](t,e,0),5:(t,e)=>{const n=Object(s.c)(t),r=Object(s.c)(e);return"number"==typeof n&&"number"==typeof r?n>r:Object(s.a)(n)>Object(s.a)(r)},6:(t,e)=>{const n=Object(s.c)(t),r=Object(s.c)(e);return"number"==typeof n&&"number"==typeof r?n<r:Object(s.a)(n)<Object(s.a)(r)},7:(t,e)=>!u[6](t,e,0),8:(t,e)=>!u[5](t,e,0),9:(t,e)=>{const n=Object(s.a)(t).split(",").filter(t=>""!==t.trim()),r=Object(s.a)(e).split(",").filter(t=>""!==t.trim());return n.some(t=>(t=t.trim(),r.some(e=>(e=e.trim())===t)))},10:(t,e)=>!u[9](t,e,0),13:t=>Object(s.a)(t).split(",").every(t=>""===t.trim()),14:(t,e)=>!u[13](t,e),15:(t,e)=>!u[16](t,e),16:(t,e)=>Object(s.a)(t).split(",").every(t=>{const e=t.trim();return"false"===e||""===e})},l={request:t=>!!t,bool:t=>!!t,mark:(t,e)=>l.input(t,e),input:(t,e)=>{const{markId:n,markStart:r,markEnd:i}=e;return u[n](t,r,i)}};function d(t,e){"string"==typeof t&&(t=Object(o.k)(t));const n=l[e.limitType],r=n?n(t,e):!!t;return{value:r,reason:r?void 0:{type:"value_unmatch",expected:e.markStart,expectedEnd:e.markEnd,limit:e.markId,actual:t}}}async function f(t,e){const{text:n}=t.relatedEmbed,r=O(t.markId)?",":void 0;return d(await Object(o.d)(n,{state:e,joinBy:r}),t)}async function b(t,e){const{relatedVarId:n}=t,r=Object(a.h)(e,{uuid:n});if(!r)return{value:!1,reason:{type:"var_not_found"}};const i=O(t.markId)?",":void 0;return d(await Object(o.c)({state:e,varInfo:r,joinBy:i}),t)}function p(t,e){const{loopStack:n,renderList:o}=t,{relatedNodeId:a,relatedOptionId:s,limitType:u,markId:d}=e,f=Object(i.h)(a,n),b=Object(r.a)(o,f);if(!b)return-2===d?{value:!0}:{value:!1,reason:{type:"node_not_found",nodeId:a}};const p=Object(c.a)(b);if(!p||!p.items)return-2===d?{value:!0}:{value:!1,reason:{type:"answer_not_found",nodeId:a}};const O=p.items.find(t=>function(t,e){return Object(i.l)(t.option_id,e)}(t,s)),m=l[u];if(m){const t=O?Object(c.c)(O):"",n=m(t,e),r={value:n};return n||(r.reason={type:"node_unmatch",limit:d,actual:t,expected:e.markStart,expectedEnd:e.markEnd,nodeId:a,optionId:s}),r}{const t=-2===d?!O:!!O,e={value:t};return t||(e.reason={type:"node_unmatch",limit:d,nodeId:a,optionId:s,expected:-1===d,actual:2===d}),e}}function O(t){return 9===t||10===t||11===t||12===t||13===t||14===t||15===t||16===t}async function m(t,e){return{start:O(t.markId)?await Object(o.f)(t.markStart,{state:e,joinBy:","}):await Object(o.g)(t.markStart,{state:e}),end:await Object(o.g)(t.markEnd,{state:e})}}async function g(t,e,n){return(await j(t,e,n)).value}async function j(t,e,n){if(!e)return{value:!0};const r=[];for(const n of e){const e={...n},{relatedVarId:i,relatedEmbed:o,isGroup:c,groupLogicList:a,groupLogicType:s}=e,{start:u,end:l}=await m(e,t);let d;e.markEnd=l,e.markStart=u,d=c?await j(t,a,s):o?await f(e,t):i?await b(e,t):p(t,e),r.push(d)}return{value:!r["and"===n?"some":"every"](t=>!t.value),details:r}}function h(t,e){return"object"==typeof t&&null!==t?g(e,t.options,t.logicType):Object(i.n)(!!t)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return g})),n.d(e,"b",(function(){return w})),n.d(e,"a",(function(){return x}));var r=n(51),i=n(16),o=n(13),c=n(6),a=n(1),s=n(7),u=n(41);function l(t){t.OPT_INPUT.getText=t=>{const e=Object(c.p)(t.specifiedOpt,"value");return Object(a.n)(e)},t.OPT_LABEL.getText=t=>{const e=t.specifiedOpt.label||"";return Object(a.n)(e)},u.a.forEach(e=>{!function(e){const n=e.split("_")[1];t["OPT_MAP_"+n].getText=t=>{const{specifiedOpt:n}=t,{mapping:i}=n,o=Object(r.b)(i,e,t);return Object(a.n)(o)}}(e),function(e){const n=e.split("_")[1];t["OPT_ASTV_"+n].getText=t=>{const n=t.specifiedOpt.assistValue,r=n&&n[e]||"";return Object(a.n)(r)}}(e)}),t.OPT_MARK.getText=t.OPT_INPUT.getText,t.OPT_TEXT.getText=t=>{const e=t.specifiedOpt,n=Object(c.e)(e);if(n)return Object(a.n)(n);const r=e.xText?e.xText+"_"+e.yText:Object(c.p)(e,"text");return Object(a.n)(r)},t.OPT_NUMBER.getText=t=>{const e=Object(s.a)(t.specifiedOpt.number);return Object(a.n)(e)},t.OPT_RANK.getText=t=>{const e=t.specifiedOpt.sortNo;return Object(a.n)(Object(s.a)(e))},t.OPT_TEXT_X.getText=t=>{const e=t.specifiedOpt.xText;return Object(a.n)(e)},t.OPT_TEXT_Y.getText=t=>{const e=t.specifiedOpt.yText;return Object(a.n)(e)},t.OPT_NUMBER_X.getText=t=>{const e=t.specifiedOpt.xNumber;return Object(a.n)(Object(s.a)(e))},t.OPT_NUMBER_Y.getText=t=>{const e=t.specifiedOpt.yNumber;return Object(a.n)(Object(s.a)(e))},t.OPT_IMAGE.getText=t=>{const{varInfo:{imgSize:e},specifiedOpt:n,pureText:r}=t,o=Object(c.p)(n,"image");if(r)return Object(a.n)(n.text);if(o){const t=Object(i.b)(o.url,e,o.originName);return Object(a.n)(t)}return Object(a.n)("")},t.OPT_ICON.getText=t=>{const e=t.specifiedOpt.text;return Object(a.n)(e)},t.OPT_COUNT.getText=async t=>{const e=await Object(o.b)(t);return Object(s.a)(e.length)}}var d=n(49),f=n(54);function b(t,e){!function(t,e){e.forEach(e=>{const n=t[e];"function"==typeof n.getText&&(n.getBool=async function(t){const e=await this.getText(t);return!Object(s.b)(e)})}),t.OPT_COUNT.getBool=async function(t){return!!await this.getText(t)}}(t,e),t.OPT_SAME_MARK.getBool=async t=>{const e=await Object(o.b)(t);return function(t,e){if(Object(s.b)(e))return!0;(e<0||e>t.length)&&(e=t.length);const n={};for(const r of t){const t=r.value;if(n[t]?n[t]+=1:n[t]=1,n[t]>=e)return!0}return!1}(e,e.length)},t.OPT_DIFF_MARK.getBool=async t=>{const e=await Object(o.b)(t);return function(t,e){if(Object(s.b)(e))return!0;(e<0||e>t.length)&&(e=t.length);const n={};for(const r of t)if(n[r.value]=!0,Object.keys(n).length>=e)return!0;return!1}(e,e.length)},t.OPT_SAME_VALUE.getBool=t.OPT_SAME_MARK.getBool,t.OPT_SAME_VALUE.getText=t.OPT_SAME_MARK.getText,t.OPT_DIFF_VALUE.getBool=t.OPT_DIFF_MARK.getBool,t.OPT_DIFF_VALUE.getText=t.OPT_DIFF_MARK.getText,t.FAIL_SKIP.getBool=t=>{const e=t.varInfo.question;return Promise.resolve(!!e.failedSkipActivated)},t.FAILED.getBool=t=>{const e=t.varInfo.question;return Object(a.n)(!!e.failed)},t.SUCCEED.getBool=t=>{const e=t.varInfo.question;return Object(a.n)(!!e.succeed)},t.USED_PHONE.getBool=t=>Object(a.n)(!!t.state.phoneUsed),t.VALIDATE_FAILED.getBool=t=>Object(a.n)(t.varInfo.question.validateFailed),t.Q_TIME_OVER.getBool=t=>{const{maxAnswerTime:e,costTime:n}=t.varInfo.question,r=1e3*e;return Object(a.n)(!!(r&&n&&r<n))},t.Q_TIME_LESS.getBool=t=>{const{minAnswerTime:e,costTime:n}=t.varInfo.question,r=1e3*e;return Object(a.n)(!!(r&&n&&r>n))},function(t,e){function n(t){return this.getBool(t)}e.forEach(e=>{const r=t[e];"function"==typeof r.getBool&&r.getText===g&&(r.getText=n)})}(t,e)}var p=n(42),O=n(45),m=n(39);const g="waiting fo extend";let j=!1;Math.avg=(...t)=>{let e=0;const n=t.length;for(let r=0;r<n;r++)e+=Number(t[r]);return e/n};const h={YEAR:{uuid:"YEAR",type:"var-string",getText:g},MONTH:{uuid:"MONTH",type:"var-string",getText:g},DATE:{uuid:"DATE",type:"var-string",getText:g},DAY:{uuid:"DAY",type:"var-string",getText:g},URL_KEY:{uuid:"URL_KEY",type:"var-string",getText:g},QUES_ID:{uuid:"QUES_ID",type:"var-string",getText:g},WX_ID:{uuid:"WX_ID",type:"var-string",getText:g},WX_SRC:{uuid:"WX_SRC",type:"var-string",getText:g},WX_NAME:{uuid:"WX_NAME",type:"var-string",getText:g},WX_UN_ID:{uuid:"WX_UN_ID",type:"var-string",getText:g},RES_ID:{uuid:"RES_ID",type:"var-string",getText:g},CLTR_ID:{uuid:"CLTR_ID",type:"var-string",getText:g},CLTR_CODE:{uuid:"CLTR_CODE",type:"var-string",getText:g},CLTR_NAME:{uuid:"CLTR_NAME",type:"var-string",getText:g},CURR:{uuid:"CLANG",type:"var-string",getText:g},LKTP:{uuid:"LKTP",type:"var-string",getText:g},START_TIME:{uuid:"S_T",type:"var-string",getText:g},COST_TIME:{uuid:"C_T",type:"var-string",getText:g},DVC_OSN:{uuid:"DVC_OSN",type:"var-string",getText:g},DVC_OSV:{uuid:"DVC_OSV",type:"var-string",getText:g},DVC_BRSN:{uuid:"DVC_BRSN",type:"var-string",getText:g},DVC_BRSV:{uuid:"DVC_BRSV",type:"var-string",getText:g},DVC_VDR:{uuid:"DVC_VDR",type:"var-string",getText:g},DVC_MDL:{uuid:"DVC_MDL",type:"var-string",getText:g},DVC_TYPE:{uuid:"DVC_TYPE",type:"var-string",category:"DEVICE",getText:g},RESULT:{uuid:"RESULT",type:"var-string",getText:g},C_OPT_TEXT:{uuid:"COTTX",type:"var-string",getText:g},C_OPT_NUM:{uuid:"CONUM",type:"var-string",getText:g},C_OPT_VAL:{uuid:"COVAL",type:"var-string",getText:g},C_OPT_LBL:{uuid:"COLBL",type:"var-string",getText:g},C_OPT_IPT:{uuid:"COIPT",type:"var-string",category:"CTPT",getText:g},C_OPT_ASI:{uuid:"COASI",type:"var-string",category:"CTPT",getText:g},C_OL_TXT:{uuid:"COLTXT",type:"var-string",getText:g},C_OL_IDX:{uuid:"COLIDX",type:"var-string",getText:g},C_OL_VAL:{uuid:"COLVAL",type:"var-string",getText:g},C_OL_NUM:{uuid:"COLNUM",type:"var-string",getText:g},C_OL_LBL:{uuid:"COLLBL",type:"var-string",getText:g},C_IL_TXT:{uuid:"CILTXT",type:"var-string",getText:g},C_IL_IDX:{uuid:"CILIDX",type:"var-string",getText:g},C_IL_VAL:{uuid:"CILVAL",type:"var-string",getText:g},C_IL_NUM:{uuid:"CILNUM",type:"var-string",getText:g},C_IL_LBL:{uuid:"CILLBL",type:"var-string",getText:g},POSITION:{uuid:"_P_OS",type:"var-string",getText:g},FAIL_SKIP:{uuid:"L_FAIL_SKIP",type:"var-bool",getText:g,getBool:g},FAILED:{uuid:"L_FAILED",type:"var-bool",getText:g,getBool:g},SUCCEED:{uuid:"L_SUCCEED",type:"var-bool",getText:g,getBool:g},COUNTRY:{uuid:"_C_NTY",type:"var-string",getText:g},PROVINCE:{uuid:"_P_ROV",type:"var-string",getText:g},CITY:{uuid:"_C_ITY",type:"var-string",getText:g},DISTRICT:{uuid:"_D_TRT",type:"var-string",getText:g},QUES_IMAGE:{uuid:"QI",type:"var-media",getText:g,getImages:g},QUES_TEXT:{uuid:"QT",type:"var-string",getText:g},QUES_LABEL:{uuid:"QL",type:"var-string",getText:g},QUES_DESC:{uuid:"QD",type:"var-string",getText:g},QUES_NAME:{uuid:"QN",type:"var-string",getText:g},PHONE_NUMBER:{uuid:"PN",type:"var-string",getText:g},PASSWORD:{uuid:"PSW",type:"var-string",getText:g},USED_PHONE:{uuid:"UPN",type:"var-bool",getText:g,getBool:g},VALIDATE_FAILED:{uuid:"VF",type:"var-bool",getText:g,getBool:g},VALIDATE_FAIL_TIMES:{uuid:"VFT",type:"var-expression",getText:g,getBool:g},QUES_TIME:{uuid:"DRTN",type:"var-string",getText:g,getBool:g},QUES_RS:{uuid:"QRS",type:"var-string",getText:g},Q_TIME_OVER:{uuid:"QTOR",type:"var-bool",getText:g,getBool:g},Q_TIME_LESS:{uuid:"QTLS",type:"var-bool",getText:g,getBool:g},MATCHED_OPTS:{uuid:"MTO",type:"var-string",filter:g},UNMATCHED_OPTS:{uuid:"UMTO",type:"var-string",filter:g},MARKED_OPTS:{uuid:"MKO",type:"var-string",filter:g},UNMARKED_OPTS:{uuid:"UMKO",type:"var-string",filter:g},RANKED_OPTS:{uuid:"RKO",type:"var-string",filter:g},UNRANKED_OPTS:{uuid:"URKO",type:"var-string",filter:g},CHECKED_OPTS:{uuid:"CKO",type:"var-string",filter:g},UNCHECKED_OPTS:{uuid:"UCKO",type:"var-string",filter:g},INPUTTED_OPTS:{uuid:"INO",type:"var-string",filter:g},UN_INPUTTED_OPTS:{uuid:"UINO",type:"var-string",filter:g},ALL_OPTS:{uuid:"ALO",type:"var-string",filter:g},SPECIFIED_OPT:{uuid:"SPO",type:"var-string"},OPT_TEXT:{uuid:"OTXX",type:"var-string",getText:g},OPT_TEXT_X:{uuid:"OTXY",type:"var-string",getText:g},OPT_TEXT_Y:{uuid:"OTX",type:"var-string",getText:g},OPT_NUMBER:{uuid:"ONM",type:"var-string",getText:g},OPT_NUMBER_X:{uuid:"ONMX",type:"var-string",getText:g},OPT_NUMBER_Y:{uuid:"ONMY",type:"var-string",getText:g},OPT_IMAGE:{uuid:"OMG",type:"var-media",getText:g,getImages:g},OPT_ICON:{uuid:"OIC",type:"var-string",getText:g,getIcon:g},OPT_MARK:{uuid:"OMA",type:"var-string",getText:g},OPT_RANK:{uuid:"ORA",type:"var-string",getText:g},OPT_INPUT:{uuid:"OIN",type:"var-string",getText:g},OPT_LABEL:{uuid:"OLB",type:"var-string",getText:g},OPT_COUNT:{uuid:"OCT",type:"var-expression",inBunch:!0,getText:g},OPT_SAME_MARK:{uuid:"OSM",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_DIFF_MARK:{uuid:"ODM",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_SAME_VALUE:{uuid:"OSV",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_DIFF_VALUE:{uuid:"ODV",type:"var-bool",inBunch:!0,getBool:g,getText:g},EXP_PLUS:{uuid:"EP",type:"var-expression",expOpr:"+"},EXP_MINUS:{uuid:"EM",type:"var-expression",expOpr:"-"},EXP_MULTIPLY:{uuid:"EPL",type:"var-expression",expOpr:"*"},EXP_DIVIDE:{uuid:"ED",type:"var-expression",expOpr:"/"},EXP_SUM:{uuid:"ES",type:"var-expression",expOpr:"(",split:"+"},EXP_MIN:{uuid:"EMN",type:"var-expression",expOpr:"Math.min(",split:","},EXP_MAX:{uuid:"EMX",type:"var-expression",expOpr:"Math.max(",split:","},EXP_AVG:{uuid:"EAG",type:"var-expression",expOpr:"Math.avg(",split:","},EXP_RD:{uuid:"ERD",type:"var-expression",expOpr:"Math.round(",split:"+"},EXP_FLR:{uuid:"EFLR",type:"var-expression",expOpr:"Math.floor(",split:"+"},EXP_CL:{uuid:"ECL",type:"var-expression",expOpr:"Math.ceil(",split:"+"},EXP_OP:{uuid:"EOP",type:"var-expression"},EXP_CP:{uuid:"ECP",type:"var-expression"},BOOL_AND:{uuid:"BAND",type:"var-bool",blOpr:"&&"},BOOL_OR:{uuid:"BOR",type:"var-bool",blOpr:"||"},BOOL_NOT:{uuid:"BNOT",type:"var-bool",blOpr:"!"},BOOL_OP:{uuid:"BOP",type:"var-bool",blOpr:"("},BOOL_CP:{uuid:"BCP",type:"var-bool",blOpr:")"},LOOP:{uuid:"LP",type:"var-loop",getText:g,getImages:g},LOOP_IMG:{uuid:"LPIMG",type:"var-loop",getText:g,getImages:g},LOOP_INDEX:{uuid:"LPIDX",type:"var-loop",getText:g},LOOP_VAL:{uuid:"LPVAL",type:"var-loop",getText:g},LOOP_NUM:{uuid:"LPNUM",type:"var-loop",getText:g},LOOP_LBL:{uuid:"LPLBL",type:"var-loop",getText:g}};for(const t of O.a){const e="LANG_"+t.id.toUpperCase(),n=e;h[e]={uuid:n,type:"var-string",getText:()=>Object(a.n)(t.id)}}for(let t=2;t<21;t++){const e="URL_KEY_"+t;h[e]={uuid:e,type:"var-string",getText:g}}function y(t,e){const n=e.optionMappingHeads;if(n){const e=n.find(e=>e.field==="field_"+t);if(e)return{type:"image"===e.type?"var-media":"var-string"}}return null}for(let t=1;t<7;t++)h["OPT_ASTV_"+t]={uuid:"OASTV_"+t,type:"var-string",getText:g},h["OPT_MAP_"+t]={uuid:"OM_"+t,type:"var-string",getText:g,getDynamicProps:e=>y(t,e)},h["C_OPT_MAP_"+t]={uuid:"COMAP"+t,type:"var-string",getText:g},h["C_OL_MAP_"+t]={uuid:"COLMAP"+t,type:"var-string",getText:g},h["C_IL_MAP_"+t]={uuid:"CILMAP"+t,type:"var-string",getText:g},h["LOOP_MAP_"+t]={uuid:"LPMAP"+t,type:"var-loop",getText:g};const v=Object.keys(h);function w(t,e){for(const n of v)if(h[n].uuid===t){let t=h[n];if(t.getDynamicProps&&e){const n=t.getDynamicProps(e);n&&(t={...t,...n})}return t}}function _(){j||(!function(){const t=[];v.forEach(e=>{if(!(h[e]instanceof Function)){if(t.indexOf(h[e].uuid)>0)throw new Error("error duplicated uuid in implicit var config: "+h[e].uuid);t.push(h[e].uuid)}})}(),Object(r.a)(h),Object(m.c)(h),Object(m.b)(h),l(h),function(t){async function e(t,e){const{varInfo:n,needOtherOpt:r}=t,i=n.question,o=Object(c.b)(i),a=[];for(const n of o)!r&&n.isOtherOpt||e&&!e(n,i)||!await Object(d.b)({...t,specifiedOpt:n})||a.push(n);return a}t.MATCHED_OPTS.filter=t=>e(t,f.c),t.RANKED_OPTS.filter=t.MATCHED_OPTS.filter,t.CHECKED_OPTS.filter=t.MATCHED_OPTS.filter,t.UNMATCHED_OPTS.filter=t=>e(t,f.e),t.UNRANKED_OPTS.filter=t.UNMATCHED_OPTS.filter,t.UNCHECKED_OPTS.filter=t.UNMATCHED_OPTS.filter,t.MARKED_OPTS.filter=t=>e(t,f.b),t.INPUTTED_OPTS.filter=t.MARKED_OPTS.filter,t.UNMARKED_OPTS.filter=t=>e(t,f.d),t.UN_INPUTTED_OPTS.filter=t.UNMARKED_OPTS.filter,t.ALL_OPTS.filter=t=>{if(!Object(d.a)(t)){const e=t.varInfo.question.options;return Object(a.n)(e)}return e(t)}}(h),b(h,v),Object(p.a)(h),function(){let t="";if(v.forEach(e=>{const n=h[e];if(["filter","getText","getImages","getIcon","getBool"].forEach(r=>{n[r]===g&&(t+=e+"=>"+r+"\n")}),n.getText){const t=n.getText;n.getText=async function(e){const{keepWrap:n}=e,r=t.apply(this,arguments),i=await r;if("string"==typeof i&&!n){const t=/<span var-name=".+?" class="var-light var-(\w+?)">(.+?)<\/span>/g;return Object(s.a)(i).replace(t,(t,e,n)=>"media"===e?t:n)}return Object(s.b)(i)?"":i}}}),t)throw new Error("lack var implement for:\n"+t)}(),j=!0)}function x(){return j||_(),h}_()},function(t,e,n){"use strict";n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u})),n.d(e,"d",(function(){return l})),n.d(e,"f",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"c",(function(){return b}));var r=n(7),i=n(21),o=n(5);function c(t,e){if(Object(r.b)(e)||t.length<=e)return[...t];return a(t.map(t=>({...t.option,cascade:t})),e).map(t=>t.cascade)}function a(t,e){if(Object(r.b)(e)||t.length<=e)return[...t];return d(t.map(t=>{const e=t.inferList.reduce((t,e)=>(e.active&&"select"===e.type&&(t+=e.weight),t),0);return{option:t,weight:e}}),e).map(t=>t.option)}function s(t){return t.filter(t=>{const{option:e}=t;return!(!e||!e.inferList)&&e.inferList.some(t=>t.active)})}function u(t,e){return t.filter(t=>t.inferList.some(t=>t.active&&t.type===e))}async function l(t,e){if(!t)return;const n=e.parent;t.inferList=t.inferList||[];for(const e of t.inferList){const{activeConfig:r}=e;if(r){const{options:o,logicType:c}=r;n.context.option=t,e.active=await Object(i.b)(n,o,c),n.context.option=null}else e.active=!0}}function d(t,e){if(t=[...t],Object(r.b)(e)||t.length<=e)return t;const n=t.reduce((t,e)=>t+=e.weight,0);let i=0,o=0,c=t.map(t=>{const e=t.weight/n;o=i+e;const r={item:t,floor:i,ceil:o};return i=o,r});const a=[];for(;a.length<e;){const t=Math.random()*o,e=c.find(e=>e.floor<=t&&e.ceil>t);e&&(a.push(e.item),c=c.filter(t=>t!==e))}return a}async function f(t,e){const{parent:n}=e,r=[];for(const e of t)r.push(await Object(o.f)(e.candidates,{state:n,joinBy:","}));return r.join(",")}function b(t){const e={},n=[];return t.split(",").forEach(t=>{let r=t,i=1;const o=t.match(/\(([\d\.]+)\)$/);o&&(r=t.replace(/\([\d\.]+\)$/,""),i=parseFloat(o[1]));const c=e[r];if(c)c.weight+=i;else{const t={text:r,weight:i};n.push(t),e[r]=t}}),n.filter(t=>0!==t.weight)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return a}));var r=n(61),i=n(0);function o(t){return Object(i.b)().hostConfig.cdnHost+"/"+t}function c(t){const{width:e,height:n,name:i,id:c,originName:a}=t,s=o(i);return{ratio:Math.round(n/e*1e5)/1e5,url:s,natural:Object(r.b)(s,"@m720"),thumbnail:Object(r.b)(s,"@avatar"),large:Object(r.b)(s,"@m1080"),width:e,height:n,reformed:!0,id:c,originName:a,name:i}}function a(t){if(!t)return;if(t&&t.reformed)return t;const{name:e,width:n,height:r,id:i,originName:o}=t;return e?c({width:n,height:r,name:e,id:i,originName:o}):void 0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u}));var r=n(7),i=n(5);const o={};function c(t,e){let n="";const r=o[e.type];return n=t.isOtherOpt||!r?t.value:r(t),"string"==typeof n&&(n=Object(i.k)(n)),n}function a(t,e){let n=c(t,e);return"string"==typeof n&&(n=n.trim()),!Object(r.b)(n)}o.upload=t=>t.name,o.sequence=t=>t.sortNo,o.heat_map=t=>t.point,o.max_diff=t=>t.records;const s={};function u(t,e){return(s[e.type]||a)(t,e)}s.sequence=(t,e)=>-1!==t.sortNo&&a(t,e)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return u}));var r=n(0),i=n(30);function o(){return{value:"",miniValue:"",name:"",progress:0,isImage:!1,fileType:"",fileName:""}}const c={};function a(t,e,n){e.options.forEach(e=>{e!==t&&(e.mutexNumber!==t.mutexNumber&&-1!==t.mutexNumber||n(e))})}function s(t,e){if(t.isOtherOpt&&t.mutexNumber){const n=c[e.type];n?n(t,e):a(t,e,t=>{Object(r.g)(t,{value:"",selected:!1})})}}function u(t,e){e.otherOptions.filter(e=>!(!e.mutexNumber||e===t)&&(e.mutexNumber===t.mutexNumber||-1===e.mutexNumber)).forEach(t=>{Object(r.g)(t,{selected:!1})})}c.heat_map=(t,e)=>{a(t,e,t=>{Object(r.g)(t,{point:null,value:""})})},c.cascade=(t,e)=>{e.options.forEach(t=>{Object(r.g)(t,{selected:!1})}),Object(i.b)(e.cascade)},c.upload=(t,e)=>{a(t,e,t=>{const e={value:"",miniValue:"",name:"",progress:0,isImage:!1,fileType:"",fileName:""};Object(r.g)(t,{...e,image:null})}),e.fullUploaded=!1},c.weight=(t,e)=>{a(t,e,t=>{Object(r.g)(t,{value:""})}),e.options.forEach(t=>{Object(r.g)(t,{percent:""})})},c.sequence=(t,e)=>{a(t,e,t=>{Object(r.g)(t,{selected:!1,sortNo:-1})}),e.options.sort((t,e)=>t.number>e.number?1:-1)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"d",(function(){return m}));var r=n(1),i=n(5),o=n(2),c=n(6),a=n(3),s=n(7);function u(t){return/^1[0-9][0-9]\d{8}$/i.test(t)}function l(t){return/[-a-zA-Z0-9@:%_+.~#?&/=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_+.~#?&/=]*)?/gi.test(t)}async function d(t,e){const{parent:n}=e;let r=await Object(i.e)(t.fillStart,{state:n}),o=await Object(i.e)(t.fillEnd,{state:n});return Object(s.b)(r)&&(r=-1/0),Object(s.b)(o)&&(o=1/0),{start:r,end:o}}function f(t,e,n){return e<=t&&n>=t}function b(t,e,n){return f(t,e,n)?"":Object(o.f)(a.a.fill.valueLimit,{min:e,max:n})}const p={};async function O(t,e,n){const{itemsMax:r,itemsMin:i}=await Object(c.g)(e,n),s=t.split(/[,,]/).reduce((t,e)=>e.trim()?t+1:t,0);let u="";return(s<i||s>r)&&(u=Object(o.f)(a.a.fill.itemsLimit,{min:i,max:r})),{valid:!u,message:u}}async function m(t,e){const n=Object(s.a)(t.value),r=t.fillType,i=p[r];if(!i||Object(s.b)(n)&&"auto_complete"!==r)return{valid:!0,message:""};const{parent:o}=e;o.context.option=t;const c=await i(n,t,e);return o.context.option=null,c.valid||(c.dueToOption=t,c.dueToNode=e),c}p.chars=async(t,e,n)=>{const{start:r,end:i}=await d(e,n);let{tolerance:c}=e;c=c||[];const s=function(t,e=[]){if(0===e.length)return"";t=t.replace(/[\s,,]/g,"");let n="";const r=[];e.includes("number")&&(n+="0-9",r.push(Object(o.f)(a.a.fill.number))),e.includes("alphabet")&&(n+="a-zA-Z",r.push(Object(o.f)(a.a.fill.alphabet))),e.includes("chinese")&&(n+="一-龥",r.push(Object(o.f)(a.a.fill.chinese)));const i=r.join(" "),c=new RegExp("^["+n+"]+$");return t.match(c)?"":Object(o.f)(a.a.fill.onlyAllow,{text:i})}(t,c)||function(t,e,n){return f(t.length,e,n)?"":Object(o.f)(a.a.fill.charsLimit,{min:e,max:n})}(t,r,i);return{valid:!s,message:s}},p.email=t=>{const e=function(t){return/^[\w-\.]+@([\w-]+\.)+[\w-]+$/i.test(t)}(t),n=e?"":Object(o.f)(a.a.fill.needEmail);return Object(r.n)({valid:e,message:n})},p.float=async(t,e,n)=>{if(!function(t){return/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)}(t))return{valid:!1,message:Object(o.f)(a.a.fill.inputNumber)};const{start:r,end:i}=await d(e,n),c=b(1*Number(t),r,i);return{valid:!c,message:c}},p.integer=async(t,e,n)=>{if(!function(t){return/^[-]?\d+$/.test(t)}(t=t.replace(/\s/g,"")))return{valid:!1,message:Object(o.f)(a.a.fill.inputInteger)};const r=Number(t),{start:i,end:c}=await d(e,n),s=b(1*r,i,c);return{valid:!s,message:s}},p.none=()=>Object(r.n)({valid:!0,message:""}),p.phone_number=t=>{const e=u(t),n=e?"":Object(o.f)(a.a.fill.needPhoneNumber);return Object(r.n)({valid:e,message:n})},p.postcode=t=>{const e=function(t){return/^[0-9][0-9]{5}$/.test(t)}(t),n=e?"":Object(o.f)(a.a.fill.needZipCode);return Object(r.n)({valid:e,message:n})},p.url=t=>{const e=l(t),n=e?"":Object(o.f)(a.a.fill.needUrl);return Object(r.n)({valid:e,message:n})},p.auto_complete=(t,e,n)=>{if(!t&&e.atcpTrigger){const t={valid:!1,message:Object(o.f)(a.a.fill.atcpLabelOnly),dueToNode:n,dueToOption:e};return Object(r.n)(t)}return O(t,e,n)},p.list_select=(t,e,n)=>O(t,e,n)},function(t,e,n){"use strict";n.d(e,"a",(function(){return j})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return y})),n.d(e,"b",(function(){return T}));var r=n(6),i=n(27),o=n(35),c=n(4),a=n(11),s=n(5),u=n(1),l=n(0),d=n(2),f=n(30),b=n(3),p=n(9),O=n(20),m=n(26);const g={},j={refresh:!1,result:!1},h={refresh:!0,result:!0},y={refresh:!1,result:!0};function v(t,e,n){e.forEach(e=>{Object(u.l)(e.uuid,t.uuid)||e[n]!==t[n]||Object(l.g)(e,{selected:!1})})}function w(t,e){e.forEach(e=>{e.uuid!==t.uuid&&Object(l.g)(e,{selected:!1})})}function _(t,e,n="mutexNumber"){const i=t[n],o=function(t,e,n="mutexNumber"){const i=Object(r.c)(e);return"xMutexNumber"===n?i.filter(e=>e.yid===t.yid):"yMutexNumber"===n?i.filter(e=>e.xid===t.xid):i}(t,e,n);i?function(t,e,n="mutexNumber"){const r=t[n];e.forEach(e=>{r&&-1!==r&&e[n]!==r&&-1!==e[n]||e.uuid!==t.uuid&&Object(l.g)(e,{selected:!1})})}(t,o,n):function(t,e){t.forEach(t=>{-1===t[e]&&Object(l.g)(t,{selected:!1})})}(o,n)}function x(t,e,n=!1){return t.selected?Object(l.g)(t,{selected:!1}):(Object(l.g)(t,{selected:!0}),w(t,n?e.otherOptions:Object(r.c)(e)),Object(m.b)(t,e)),h}async function T(t,e){const n=g[e.type];if(n){const r=await n(t,e);return r.noValidate||Object(o.b)(e),r}return j}g.select=async(t,e)=>{if(t.selected)return Object(l.g)(t,{selected:!1}),h;const n=await Object(c.k)(e,t);return n.valid?(Object(l.g)(t,{selected:!0}),Object(c.s)(e)?_(t,e):w(t,Object(r.c)(e)),h):(Object(l.b)().notify(n.message),j)},g.select_icon=g.select,g.select_image=g.select,g.matrix=async(t,e)=>{if(t.selected)return Object(l.g)(t,{selected:!1}),h;const n=await Object(c.j)(e,t);return n.valid?(Object(l.g)(t,{selected:!0}),Object(c.v)(e)?w(t,Object(r.c)(e)):Object(c.q)(e)?(v(t,e.options,"yid"),v(t,e.options,"xid")):Object(c.r)(e)?v(t,e.options,"yid"):Object(c.p)(e)?v(t,e.options,"xid"):Object(c.s)(e)&&(_(t,e),t.isOtherOpt||(_(t,e,"xMutexNumber"),_(t,e,"yMutexNumber"))),h):(Object(l.b)().notify(n.message),j)},g.upload=async(t,e)=>{if(t.isOtherOpt)return x(t,e,!0);{const{parent:n,fullUploaded:r}=e;let i=await Object(s.e)(e.maxUploadCount,{state:n});i=i||e.options.length;const o=t.value;if(r&&!o)return Object(l.b)().notify(Object(d.f)(b.a.upload.amountLimitMax,{max:i})),j;const c={onprogress(e){Object(l.g)(t,{progress:e}),Object(O.c)()},accept:t.accept},a=await Object(l.c)().network.upload(c);return await n.handleEvents.handleOptionInput(a,t,e),y}},g.verify=async(t,e)=>{const{parent:n,nodeUuid:r,phoneNumber:o,validateType:c}=e,{transactionID:s}=n;let u=!1,f={response_id:s,question_id:r};if("sms"===c){if(Object(l.b)().preview)return Object(l.b)().notify(Object(d.f)(b.a.preview.noMessage)),{...j,noValidate:!0};if(!o||!Object(i.b)(o))return Object(l.b)().notify(Object(d.f)(b.a.fill.needPhoneNumber)),{...j,noValidate:!0};f={...f,phone_num:o},e.messageGetFailed=!1;try{const t=await Object(p.j)(f);e.serverValidations=t,n.phoneNumber=o,n.phoneUsed=t.phone_num_used,n.phoneUsed&&Object(a.A)(n,e),u=!0}catch(t){e.messageGetFailed=!0}}else if("image"===c){const t=await Object(p.j)(f);e.serverValidations=t,Object(l.g)(e,{captcha:t.image}),u=!0}return{...y,noValidate:!0,result:u}},g.gift=async(t,e)=>{if(Object(l.b)().preview)return Object(l.b)().notify(Object(d.f)(b.a.preview.noMessage)),j;const{phoneNumber:n,goalId:r}=e;if(!Object(i.b)(n))return Object(l.b)().notify(Object(d.f)(b.a.fill.needPhoneNumber)),j;e.messageGetFailed=!1;try{await Object(p.n)({phone_num:n},r)}catch(t){e.messageGetFailed=!0}return h},g.menu=g.select,g.cascade=(t,e)=>{if(t.isOtherOpt)x(t,e,!0);else{let{resultList:n}=t;const{list:r}=t;if(!r||!n)return Object(u.n)(y);n=n instanceof Array?n:n?[n]:[];const{addList:i,cancelList:o}=Object(f.d)(r,n);o.forEach(t=>{Object(f.a)(t,e)}),i.forEach(t=>{Object(f.h)(t,e)}),Object(f.c)(e);const c=i[i.length-1];c&&Object(m.c)(c.option,e)}return Object(u.n)(h)},g.hot_spot=g.select,g.icon_mark=g.value_mark=g.slide_rate=g.fill=g.weight=g.heat_map=(t,e)=>t.isOtherOpt?Object(u.n)(x(t,e,!0)):Object(u.n)(y),g.sequence=(t,e)=>{if(t.isOtherOpt)return Object(u.n)(x(t,e,!0));{const{options:n,operationType:r}=e;if(-1===t.sortNo){const e=n.map(t=>t.sortNo).filter(t=>t>0);let r=-1;for(let t=1;t<=n.length;t++)if(!e.includes(t)){r=t;break}r>0&&Object(l.g)(t,{sortNo:r,selected:!0})}else{const e=t.sortNo;Object(l.g)(t,{sortNo:-1,selected:!1}),"collapse-pick"===r&&n.forEach(t=>{t.sortNo>e&&Object(l.g)(t,{sortNo:t.sortNo-1})})}return Object(u.n)(y)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return d}));var r=n(2),i=n(0),o=n(3);let c=null;function a(){return{default:"minimal",primary:"rgba(128,128,128,1)",secondary:"rgba(255,255,255,1)",contrast:"rgba(202,32,39,1)",background:"#FFFFFF",error:"rgba(202,32,39,1)",button:"rgba(202,32,39,1)",fontSize:"24px",fontWeight:"normal",descFontSize:"16px",descFontWeight:"normal",optFontSize:"16px",optFontWeight:"normal",btnFontSize:"16px",btnFontWeight:"normal",name:"minimal",fontFamily:"SimSun",titleFontSize:"25px",titleFontWeight:"normal",boxWidth:"auto",bgOpacity:100,bgImageUrl:"",effect:"normal",dynamic:Object(i.b)().dynamic,client:Object(i.b)().clientName}}function s(t){if(!t)return a();const e="string"==typeof t?JSON.parse(t):t;let n=e.usingTheme;return n.background||(n={...a()},n.primary=e.usingTheme.primary,n.secondary=e.usingTheme.secondary,n.contrast=e.usingTheme.contrast),{...n,default:"minimal"}}function u(t=a()){t.error=t.error||t.contrast,t.button=t.button||t.contrast,c=t,Object(i.b)().setTheme(t),Object(i.c)().storage.set("theme",JSON.stringify(t))}function l(){return c||a()}function d(t="Legacy"){const e=Object(i.b)().clientName;if("ALL"!==e&&t!==e)throw Object(i.b)().error(Object(r.f)(o.a.global.clientError)),Object(i.b)().customAbort(),new Error("client not matched")}},function(t,e,n){"use strict";n.d(e,"e",(function(){return s})),n.d(e,"g",(function(){return l})),n.d(e,"f",(function(){return d})),n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return b})),n.d(e,"c",(function(){return p})),n.d(e,"h",(function(){return O})),n.d(e,"d",(function(){return m}));var r=n(6),i=n(2),o=n(0),c=n(3),a=n(7);function s(t){return"tabs"===t.layout.optMark}function u(t){return t.selected&&!Object(r.n)(t.option)}function l(t,e,n,i){const c=n.list.filter(t=>t.option.useComment)[e];Object(o.g)(c.option,{value:t});const a=i.options.find(t=>t.cascadePath===c.resultId);return Object(r.n)(c.option)&&(t?O(c,i):b(c,i),p(i)),a}function d(t,e,n){let l,d;const f=s(n),b=e.list.filter(t=>!Object(r.n)(t.option))[t];let p=e.list.filter(t=>u(t));const O=-1===p.indexOf(b),m=n.cascade;if(O&&f&&m.multiple&&!e.selected){let t=null;if(m.list.reduce((e,n)=>(u(n)&&(e+=1),n.list&&n.list.includes(b)&&(t=n),e),0)===m.max&&!Object(r.n)(t.option))return Object(o.b)().notify(Object(i.f)(c.a.menu.limitMax,{text:Object(i.f)(c.a.menu.topList),max:Object(a.a)(m.max)})),null}if(e.multiple){if(O){const{mutexNumber:t}=b.option;-1===t?p=[b]:(p=p.filter(e=>(!t||e.option.mutexNumber!==t)&&-1!==e.option.mutexNumber),p.push(b))}else p=p.filter(t=>t!==b);if(p.length>e.max)return Object(o.b)().notify(Object(i.f)(c.a.menu.limitMax,{text:e.text?Object(i.f)(c.a.menu.listItem)+e.text:Object(i.f)(c.a.menu.topList),max:Object(a.a)(e.max)})),null;l=p.map(t=>t.text)}else l=O?[b.text]:[];return d=l.map(t=>t),{resultList:l,list:e.list,group:e,result:d}}function f(t){Object(o.g)(t,{selected:!1}),Object(o.g)(t.option,{selected:!1});const e=t.list;e&&0!==e.length&&e.forEach(t=>{f(t)})}function b(t,e){f(t),e.options.forEach(e=>{e.cascadePath.includes(t.resultId)&&Object(o.g)(e,{selected:!1})})}function p(t){s(t)&&t.cascade.list.forEach(t=>{t.selected=t.list&&t.list.some(t=>t.selected)})}function O(t,e){Object(o.g)(t,{selected:!0}),Object(o.g)(t.option,{selected:!0}),e.options.forEach(e=>{t.resultId.includes(e.cascadePath)&&Object(o.g)(e,{selected:!0})})}function m(t,e){const n=[],r=[];return t.forEach(t=>{const i=e.some(e=>e.trim()===t.text.trim()),o=u(t);i&&!o?n.push(t):!i&&o&&r.push(t)}),{addList:n,cancelList:r}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"d",(function(){return b}));var r=n(1),i=n(4);function o(t){const e=[];return t.forEach((t,n)=>{const i=Object(r.f)(n+1);e.splice(i,0,t)}),e}function c(t,e){return t.forEach((t,e)=>t.realIndex=e),e&&e.forEach((e,n)=>e.realIndex=n+t.length),t}const a={};function s(t,e){let n=[];return n=t.circulation?u(e):t.followRandom||t.groupRandom||t.groupInnerRandom?function(t,e){const{followRandom:n,groupRandom:i,groupInnerRandom:o}=t,c=[],a={},s={};e.forEach((t,e)=>{if(t.refOptId){let r="";if(n?r=t.refNodeId:i&&t.refGroupNumber&&(r=t.refNodeId+"_"+t.refGroupNumber),r){t.groupName=r;const n=s[r];n?O(t,n.list,o):s[r]={headIndex:e,list:[t]}}else c.push(t)}else if(t.groupNumber){const n=t.groupNumber;t.groupName=n;const r=a[n];r?O(t,r.list,o):a[n]={headIndex:e,list:[t]}}else c.push(t)});let u=[];return c.forEach(t=>{const e=Object(r.f)(u.length+1);u.splice(e,0,t)}),[a,s].forEach((t,e)=>{Object.keys(t).forEach(o=>{const{list:c,headIndex:a}=t[o];1===e&&n&&f(c);let s=a;i&&(s=Object(r.f)(u.length+1)),u=function(t,e,n){if(0===n)return t.concat(e);{for(;n<e.length-1&&p(e[n],e[n-1]);)n++;if(n>=e.length-1)return e.concat(t);const r=e.slice(0,n),i=e.slice(n);return r.concat(t,i)}}(c,u,s)})}),u}(t,e):function(t){const e=[];return t.forEach(t=>{const n=Object(r.f)(e.length+1);e.splice(n,0,t)}),e}(e),c(n,t.otherOptions)}function u(t,e){return e=(e||Math.round(10*Math.random()))%t.length,t.slice(e).concat(t.slice(0,e))}function l(t,e){if(!Object(i.u)(t))return c(e,t.otherOptions);if(t.groupSingle){let n=a[t.nodeUuid];if(n)return e.sort((t,e)=>n[t.uuid]>n[e.uuid]?1:-1);{const r=s(t,e);return a[t.nodeUuid]=n={},r.forEach((t,e)=>{n[t.uuid]=e}),r}}return s(t,e)}function d(t){let{optionsX:e,optionsY:n}=t;const{otherOptions:r}=t,{randomType:i}=t;return"col"!==i&&"row_col"!==i||(e=l(t,e)),"row"!==i&&"row_col"!==i||(n=l(t,n)),"col_loop"===i&&(e=u(e)),"row_loop"===i&&(n=u(n)),{optionsX:c(e,null),optionsY:c(n,null),otherOptions:c(r,null)}}function f(t){return t.sort((t,e)=>t.refRealIndex>e.refRealIndex?1:-1),t}function b(t){return t.sort((t,e)=>t.realIndex>e.realIndex?1:-1),t}function p(t,e){return!(!t.groupName&&!e.groupName)&&t.groupName===e.groupName}function O(t,e,n=!1){if(n){const n=Object(r.f)(e.length+1);e.splice(n,0,t)}else e.push(t)}},function(t,e,n){"use strict";n.d(e,"f",(function(){return d})),n.d(e,"b",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"g",(function(){return O})),n.d(e,"c",(function(){return m})),n.d(e,"e",(function(){return g})),n.d(e,"a",(function(){return y}));var r=n(6),i=n(1),o=n(27),c=n(23),a=n(9);let s=null;async function u(t,e){let{start:n,end:r}=await Object(o.a)(t,e);return n===-1/0&&(n=-9999,n>r&&(n=r-9999)),r===1/0&&(r=9999,r<n&&(r=n+9999)),{start:n,end:r}}function l(t,e,n){return!!e&&e.some(e=>{if(e.startsWith("/")&&e.endsWith("/")){const n=e.substr(1,e.length-2),r=new RegExp(n);return!!t.match(r)}return n?n(t,e):t===e})}async function d(t,e,n){let r=0,i=await t();for(;l(i,e,n);)if(i=await t(),r++,r>10)throw new Error("Hard to infer, rejected 10 times");return i}async function f(t,e,n=1){if(!t.inferList)return{value:"",antis:null};const r=t.inferList.filter(t=>t.active&&"input"===t.type);if(0===r.length)return{value:"",antis:null};const i=await Object(c.e)(r,e);if(""===i.replace(/,/g,""))return{value:"__FORCE_EMPTY__",antis:null};const o=[];if(i.split(",").forEach(t=>{t.startsWith("!")?o.push(t.substr(1)):t.match(/\(0\)$/)&&o.push(t.replace(/\(0\)$/,""))}),o.length)return{value:"",antis:o};const a=Object(c.c)(i);return{value:Object(c.f)(a,n).map(t=>t.text).join(","),antis:null}}function b(){return"1"+m(1e9,9999999999)}function p(t){return s[t]||Math.random().toString().replace("0.","")}async function O(){if(s)return s;const t=await Object(a.p)("https://media.choiceform.com/infer/infer.json",{type:"GET",contentType:"application/json"});return s=t,s}function m(t=0,e=10,n=0){const r=Math.pow(10,n);t*=r,e*=r;return(Object(i.g)(t,e)/r).toString()}function g(t,e=1,n=10){let r=p(t);for(;r.length<n;)r+=p(t);const o=r.length,c=Object(i.g)(n,o),a=c-Object(i.g)(e,n),s=r.substring(a,c);return""===s.trim()?g(t,e,n):s}function j(t=0,e=5e3,n=3){t=Math.max(t,0),e=Math.min(e,5e3);let r=Object(i.g)(t,e).toString();if(n>1){r=r+" "+Object(i.g)(1,12)}if(n>2){r=r+" "+Object(i.g)(1,28)}return r}const h={};async function y(t,e){const n=h[t.fillType]||h.none,r=await n(t,e);return"__FORCE_EMPTY__"===r?"":r}h.auto_complete=async(t,e)=>{let{completeGroups:n}=t;const{itemsMax:o,itemsMin:c}=await Object(r.g)(t,e),a=Object(i.g)(c,o)||1,{value:s,antis:u}=await f(t,e,a);if(s)return s;u&&(n=n.filter(t=>!l(t.name,u)));return Object(i.p)(n,a).map(t=>t.name).join(",")},h.chars=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{tolerance:i}=t,{start:o,end:c}=await u(t,e);return d(()=>!i||0===i.length||i.includes("chinese")?g("chinese",o,c):i.includes("alphabet")?g("alphabet",o,c):g("number",o,c),r)},h.date=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{grade:i}=t,{start:o,end:c}=await u(t,e);return d(()=>j(o,c,i),r)},h.date_range=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const i=j(1960,2050,3),o=Number(i.split(" ")[0]);return d(()=>{const t=j(o,2060);return i+" - "+t},r)},h.email=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return d(()=>(Object(i.e)(1,6)+"@"+Object(i.e)(1,6)+"."+Object(i.e)(1,4)).toLowerCase(),r)},h.float=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{scale:i}=t;return d(async()=>{const{start:n,end:r}=await u(t,e);return m(n,r,i)},r)},h.integer=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{start:i,end:o}=await u(t,e);return d(()=>m(i,o),r)},h.list_select=async(t,e)=>{let{selectList:n}=t;const{itemsMax:o,itemsMin:c}=await Object(r.g)(t,e),a=Object(i.g)(c||1,o||1)||1,{value:s,antis:u}=await f(t,e,a);if(s)return s;u&&(n=n.filter(t=>!l(t,u)));return Object(i.p)(n,a).join(",")},h.none=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return d(()=>g("chinese",1,10),r)},h.phone_number=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return d(()=>b(),r)},h.postcode=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return await d(()=>m(1e5,999999),r)},h.time=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return await d(()=>m(1,25)+":"+m(1,60),r)},h.time_range=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return await d(()=>{const t=m(1,20);return t+":"+m(1,60)+" - "+(m(Number(t)+1,24)+":"+m(1,60))},r)},h.time_duration=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{grade:i}=t;return await d(()=>{if(i<=3){let t=m(1,20)+"d";return i>1&&(t+=" "+m(1,24)+"h"),i>2&&(t+=" "+m(1,60)+"m"),t}{let t=m(1,60)+"h";return i>4&&(t+=m(1,60)+"m"),i>5&&(t+=m(1,60)),t}},r)},h.url=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return await d(()=>("https://"+Object(i.e)(1,3)+"."+Object(i.e)(1,6)+"."+Object(i.e)(1,3)).toLowerCase(),r)}},function(t,e,n){"use strict";function r(t){if(!t)return"00:00";const e=t%60;return i((t-e)/60)+":"+i(e)}function i(t){let e=t+"";return 1===e.length&&(e="0"+e),e}function o(){const t=new Date;return t.getFullYear()+"-"+i(t.getMonth()+1)+"-"+i(t.getDate())+" "+i(t.getHours())+":"+i(t.getMinutes())+":"+i(t.getSeconds())}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return b}));var r=n(1);const i=String.fromCharCode(160),o=new RegExp(i,"g");function c(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g,i)}class a{constructor(t){this.type="node",this.name=t,this.children=[],this.attributes={}}hasClass(t){const{attributes:e}=this,n=e&&e.class;return n&&n.split(" ").includes(t)}insertBefore(t,e){const n=this.children.indexOf(e);t.parent=this,this.children.splice(n,0,t)}getOuterHtml(){let t=Object.keys(this.attributes).map(t=>{let e=this.attributes[t]||"";return e&&(e=e.replace(/&/g,"&").replace(o," ").replace(/"/g,""")),`${t}="${e}"`}).join(" ");t&&(t=" "+t);let e=`<${this.name}${t}>`;return l(this.name)||(e+=this.getInnerHtml(),e+=`</${this.name}>`),e}getInnerHtml(){return this.children.map(t=>Object(r.k)(t,"node"===t.type)?t.getOuterHtml():t.getText().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(o," ")).join("")}setInnerHtml(t){this.empty(),f(t,this)}setText(t){this.empty(),this.children.push(new s(t))}getText(){return this.children.map(t=>t.getText()).join("")}empty(){this.children.forEach(t=>t.parent=null),this.children=[]}removeChild(t){this.children=this.children.filter(e=>e!==t)}appendChild(t){this.children.includes(t)||(t.parent=this,this.children.push(t))}queryByClass(t){let e=[];return this.children.forEach(n=>{const{children:i,type:o}=n;if(Object(r.k)(n,"node"===o)&&(n.hasClass(t)&&e.push(n),i&&i.length>0)){const r=n.queryByClass(t);r.length>0&&(e=[...e,...r])}}),e}}class s{constructor(t){this.type="text",this.setText(t)}getText(){return this._text}setText(t){this._text=t}}const u=["area","base","br","col","command","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function l(t){return u.includes(t)}function d(t){t=Object(r.t)(t);const e={},n=/(\S+?)=(["'])(.*?)\2[\/\s>]/g;let o=n.exec(t);for(;o;)e[o[1]]=o[3].replace(/&/g,"&").replace(/ /g,i).replace(/"/g,'"'),o=n.exec(t);return e}function f(t,e){t=function(t){return t.replace(/\S+?=(["']).*?\1/g,t=>Object(r.d)(t))}(t).replace(/\n/g," ");const n=/<(\w+).*?>/g,i=[];let o=n.exec(t);const u=e||new a("div");for(;o;){const e=o[1],r=o.index+o[0].length;i.push({type:"open",name:e,value:o[0],start:o.index,end:r}),n.lastIndex=r,o=n.exec(t)}if(0===i.length)return u.appendChild(new s(c(t))),u;const f=/<\/(\w+)>/g;let b=f.exec(t);for(;b;){const e=b[1],n=b.index+b[0].length;i.push({type:"close",name:e,value:b[0],start:b.index,end:n}),b=f.exec(t)}i.sort((t,e)=>t.start>e.start?1:-1);const p=[...i];let O=u,m=0,g=p.shift();const j=[];for(;g;){const{start:e,end:n,name:r,type:i,value:o}=g;if(m<e&&O.children.push(new s(c(t.substring(m,e)))),"open"===i){const t=new a(r);t.attributes=d(o),O.appendChild(t),l(r)||(O=t,j.push(g))}else if(!l(r)){const t=j[j.length-1];t&&t.name===g.name&&(O=O.parent,j.pop())}m=n,g=p.shift()}return m<t.length&&u.appendChild(new s(c(t.substring(m)))),u}function b(t){const e=f(t),n=t=>{const e={type:t.type};return Object(r.k)(t,"node"===t.type)?(e.name=t.name,e.attrs=t.attributes,e.children=t.children.map(n)):e.text=t.getText(),e};return e.children.map(n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return I})),n.d(e,"b",(function(){return N})),n.d(e,"c",(function(){return E}));var r=n(6),i=n(27),o=n(4),c=n(52),a=n(5),s=n(1),u=n(0),l=n(2),d=n(30),f=n(3),b=n(9),p=n(25);const O={valid:!0,message:""};function m(t){if(!Object(o.i)(t))return O;const e=Object(r.l)(t)||Object(r.k)(t);return{valid:e,message:e?"":Object(l.f)(f.a.global.answerRequired),dueToNode:t}}function g(t,e){const{otherOptions:n}=t;return n.some(t=>t.selected)?0:e}async function j(t){if(!Object(o.i)(t)&&!Object(r.k)(t))return O;const{options:e}=t,{parent:n}=t;let i=await Object(a.e)(t.fillMin,{state:n});i=i||e.length,i>e.length&&(i=e.length),i=g(t,i);let c=0;for(const n of e)if(Object(p.b)(n,t))c+=1;else if(!0===n.fillRequired)return{valid:!1,message:Object(l.f)(f.a.fill.required,{text:n.text||""}),dueToNode:t};const s=i<=c;return s?O:{valid:s,message:Object(l.f)(f.a.fill.inputLimitMin,{min:i}),dueToNode:t}}function h(t,e=!1){const n=e?t.otherOptions:Object(r.c)(t),i=Object(o.i)(t);let c;const a=!n.some(e=>(c=e,function(t,e){const n=!0===t.fillRequired,i=t.selected;return n&&(i||Object(r.n)(t)&&e)}(e,i)&&!Object(p.b)(e,t)));return a?O:{valid:a,message:Object(l.f)(f.a.fill.required,{text:c.text}),dueToNode:t,dueToOption:c}}async function y(t,e=!1){const n=e?t.options:Object(r.c)(t);for(const e of n){if(!Object(p.b)(e,t))continue;const n=await Object(i.d)(e,t);if(!n.valid)return n}return O}function v(t){return Object(o.s)(t)&&Object(r.l)(t)?w(t):Object(s.n)(O)}async function w(t){if(function(t){if("matrix"===t.type)return!1;const e=Object(r.c)(t).find(t=>t.selected);return!(!e||-1!==e.mutexNumber)}(t))return O;const{min:e}=await Object(o.e)(t);return Object(r.c)(t).filter(t=>!Object(r.n)(t)).filter(t=>t.selected).length>=e?O:{valid:!1,message:Object(l.f)(f.a.select.limitMin,{min:e}),dueToNode:t}}function _(t){return Object(o.v)(t)?Object(s.n)(O):Object(o.i)(t)||Object(r.l)(t)?Object(o.m)(t)?w(t):Object(o.r)(t)||Object(o.p)(t)||Object(o.q)(t)?Object(s.n)(function(t){let e,n,r;Object(o.r)(t)?(e="yid",n=t.renderOptionsY,r=!1):Object(o.p)(t)?(e="xid",n=t.renderOptionsX,r=!0):Object(o.q)(t)&&(t.renderOptionsX.length>t.renderOptionsY.length?(e="yid",n=t.renderOptionsY,r=!1):(e="xid",n=t.renderOptionsX,r=!0));const i=t.options;for(const o of n){const n=o.uuid;if(!i.some(t=>t.selected&&Object(s.l)(t[e],n))){return{valid:!1,message:r?Object(l.f)(f.a.matrix.colLimitMin,{min:1}):Object(l.f)(f.a.matrix.rowLimitMin,{min:1}),dueToNode:t}}}return O}(t)):async function(t){const e=Object(o.n)(t);let{min:n}=await Object(o.e)(t);const r=e?"xid":"yid",i=t[e?"renderOptionsX":"renderOptionsY"],c=t[e?"renderOptionsY":"renderOptionsX"];n>c.length&&(n=c.length);const a=t.options;for(const o of i){const i=o.uuid;if(a.filter(t=>t.selected&&Object(s.l)(t[r],i)).length<n){return{valid:!1,message:e?Object(l.f)(f.a.matrix.colLimitMin,{min:n}):Object(l.f)(f.a.matrix.rowLimitMin,{min:n}),dueToNode:t}}}return O}(t):Object(s.n)(O)}const x={};function T(t,e){Object(u.g)(t,{errorMessage:e.message||""})}function I(t,e){Object(u.b)().locateError(t,e)}async function k(t,e){if(Object(o.w)(t)||t.readonly)return O;const n=function(t){const{canSkipVideo:e,video:n}=t;return e||!n||n.ended?O:{valid:!1,message:Object(l.f)(f.a.video.watchAll),dueToNode:t}}(t);if(!n.valid)return n;const r=x[t.type];let i=r?await r(t):O;return i.valid&&e&&(i=await Object(c.a)(t)),i.valid&&T(t,i),i}x.select=async t=>{const e=m(t);if(!e.valid)return e;let n=await v(t);return n.valid?(n=h(t,!1),n.valid?y(t,!1):n):n},x.select_image=t=>x.select(t),x.fill=async t=>{const e=m(t);if(!e.valid)return e;let n=await j(t);return n.valid?(n=h(t,!0),n.valid?y(t,!1):n):n},x.value_mark=async t=>{const e=m(t);if(!e.valid)return e;let n=await j(t);return n.valid?(n=h(t,!0),n.valid?y(t,!0):n):n},x.icon_mark=async t=>{const e=await x.value_mark(t);if(!e.valid)return e;if(Object(o.i)(t)){if(t.options.some(t=>0===t.value))return{valid:!1,message:Object(l.f)(f.a.global.answerRequired),dueToNode:t}}return O},x.sequence=t=>{let e=m(t);if(!e.valid)return Object(s.n)(e);const{options:n}=t;let r=Object(o.i)(t)?t.rankCount||n.length:0;const i=n.length;r>i&&(r=i),r=g(t,r);let c=0;const a=n.filter(t=>t.sortNo>0).sort((t,e)=>t.sortNo>e.sortNo?1:-1);for(let t=0;t<a.length&&a[t].sortNo===t+1;t++)c++;return r>c?Object(s.n)({valid:!1,message:Object(l.f)(f.a.rank.limitMin,{min:r}),dueToNode:t}):(e=h(t,!0),e.valid?y(t,!0):Object(s.n)(e))},x.matrix=async t=>{const e=m(t);if(!e.valid)return e;let n=await _(t);return n.valid?(n=h(t,!0),n.valid?y(t,!0):n):n},x.region=t=>{const e=!Object(o.i)(t)||t.value?O:{valid:!1,message:Object(l.f)(f.a.global.answerRequired),dueToNode:t};return Object(s.n)(e)},x.location=async t=>{const e=await x.region(t);return e.valid||(e.message=Object(l.f)(f.a.locate.required)),e},x.upload=async t=>{const e=m(t);if(!e.valid)return e;let n=!0,i="";const c=Object(r.f)(t);if(!Object(o.i)(t)&&0===c)return O;const a=await Object(o.g)(t),{max:s}=a,u=g(t,a.min);return c<u?(n=!1,i=Object(l.f)(f.a.upload.amountLimitMin,{min:u})):c>s&&(n=!1,i=Object(l.f)(f.a.upload.amountLimitMax,{max:s})),{valid:n,message:i,dueToNode:t}},x.verify=async t=>{if(Object(u.b)().preview||Object(u.c)().dev.infer){if(!t.code)return{valid:!1,message:Object(l.f)(f.a.global.answerRequired),dueToNode:t}}else{const e={valid:!1,message:Object(l.f)(f.a.verify.invalidFailed),dueToNode:t},{validateType:n}=t,{code:r,parent:i,nodeUuid:o}=t,c=()=>(t.validateFailTimes+=1,e);if("image"===n){const{serverValidations:n}=t;if(!n)return e;{const{id:t}=n;try{return await Object(b.o)({code:r},t),O}catch(t){return c()}}}else if("password"===n){const{transactionID:t}=i,e={response_id:t,question_id:o,code:r};try{return await Object(b.j)(e),O}catch(t){return c()}}else if("sms"===n){const{serverValidations:n}=t;if(!n)return e;{const{id:t}=n;try{return await Object(b.o)({code:r},t),O}catch(t){return c()}}}}return O},x.menu=x.select,x.area=t=>Object(s.n)(m(t)),x.select_icon=t=>{const e=m(t);return e.valid?v(t):Object(s.n)(e)},x.weight=t=>{if(!Object(o.i)(t)&&!Object(r.k)(t))return Object(s.n)(O);const e=m(t);if(!e.valid)return Object(s.n)(e);let{weightTotal:n}=t;n=g(t,n);const{options:i}=t;return n>i.reduce((t,e)=>t+Number(e.value),0)&&!0!==t.relax?Object(s.n)({valid:!1,message:Object(l.f)(f.a.weight.totalLimitMin,{min:n}),dueToNode:t}):Object(s.n)(O)},x.cascade=t=>{if(!Object(o.i)(t)&&!Object(r.l)(t))return Object(s.n)(O);const{cascade:e}=t,n=m(t);return n.valid?async function t(e,n,r=0){if(!n.list)return O;const o=Object(d.e)(e),{multiple:c,min:a,max:s,required:u}=n,b=n.text?Object(l.f)(f.a.menu.listItem)+n.text:Object(l.f)(f.a.menu.topList),p=n.list.filter(t=>{let e=t.selected;return o&&t.list&&(e=e&&t.list.some(t=>t.selected)),e});for(const t of p){const{option:n}=t;if(n.fillRequired&&!(n.value||"").toString().trim())return{valid:!1,dueToNode:e,message:Object(l.f)(f.a.menu.inputReq,{text:n.text})};const r=await Object(i.d)(n,e);if(!r.valid)return{...r,message:Object(l.f)(f.a.menu.inputRule,{text:n.text,rule:r.message})}}const m=p.length;if(u&&0===m&&(!o||0===r))return{valid:!1,dueToNode:e,message:Object(l.f)(f.a.menu.required,{text:b})};if(c&&m<a&&(!o||m>0))return{valid:!1,dueToNode:e,message:Object(l.f)(f.a.menu.requiredBetween,{text:b,min:a,max:s})};for(const r of n.list){if(!r.selected)continue;const n=await t(e,r,m);if(!n.valid)return n}return O}(t,e):Object(s.n)(n)},x.hot_spot=x.select,x.heat_map=t=>Object(s.n)(m(t)),x.slide_rate=x.value_mark,x.max_diff=t=>{const e=t.tasks.every(t=>t.done),n={valid:e,dueToNode:e?null:t,message:e?"":Object(l.f)(f.a.maxDiff.all)};return Object(s.n)(n)};const N=Object(s.a)(async(t,e)=>{if(e){const n=await Object(i.d)(e,t);e.errorMessage!==n.message&&T(e,n)}if(t){const e=await E([t]);e.message||T(t,e)}},250);async function E(t,e=!1){const n=[],r=t.length>1;for(const r of t){const t=await k(r,e);n.push(t)}let i=null;return n.forEach(t=>{t.valid||(r&&T(t.dueToNode,t),i||(i=t))}),i||O}},function(t,e,n){"use strict";n.d(e,"d",(function(){return R})),n.d(e,"b",(function(){return X})),n.d(e,"c",(function(){return G})),n.d(e,"a",(function(){return Y}));var r=n(4),i=n(71),o=n(12),c=n(33),a=n(56),s=n(28),u=n(74),l=n(58),d=n(19),f=n(43),b=n(11),p=n(52),O=n(17),m=n(9),g=n(44),j=n(57),h=(n(15),n(30)),y=n(8),v=n(14),w=n(20),_=n(0),x=n(2),T=n(45),I=(n(6),n(64)),k=n(1),N=n(48),E=n(3),S=n(67),L=n(72),C=n(50),P=n(10),M=n(75);const R=Object(k.a)(()=>{Object(_.b)().realTimePreview||V(null)||y.a.trigger("STRETCH_OK")});let A;function D(){return A}function U(t){const e=["region","location","area"];return t.some(t=>t.used&&e.indexOf(t.type)>-1)}function B(t){const{parsedPayload:e,userInfo:n,theme:r,hasVar:i,sid:f,langTable:p,startNode:m,surveyId:g,summary:j,language:T,images:N,langResume:E,title:S,transactionID:C,status:P,platform:R,digest:A,channel:D,customLogo:B,customText:$,useCustomLogo:H}=t,{nodeList:X,basicConfig:z,testCases:K}=e;let G=!1;Object(_.b)().offlineTaskId||z.collector&&(G=!1===z.collector.multiple_response);const{fakedServers:Y,autoCpltGroups:W,noWxShare:Z,previewShadowNodes:Q,qNumberRequired:J,asterisksRequired:tt,progressBarRequired:et,nodeTypeInfoRequired:nt,limitTime:rt,minTime:it,timeoutText:ot,timeLessText:ct,resumeEnabled:at}=m,st={previewShadowNodes:Q&&!Object(_.c)().dev.autoRun,langResume:E,langTable:p,testCases:K,progress:0,resumeEnabled:at||!!Object(_.b)().offlineTaskId,images:N,eventHub:y.a,language:T,sid:f,parsedPayload:e,digest:A,channel:D,transactionID:C,status:P,platform:R,fakedServers:Y,autoCpltGroups:W,noWxShare:Z,needRegions:U(X),theme:r,userInfo:n,responseStatus:"created",context:{question:void 0,option:void 0},completeUrl:"",quotaFullUrl:"",screenOutUrl:"",title:S,summary:j,useCustomLogo:H,customText:$,customLogo:B,bonusLimitTime:"",nodeList:X,companyID:"",oneReplyPerTerminal:G,surveyId:g,qNumberRequired:J,asterisksRequired:tt,progressBarRequired:et,nodeTypeInfoRequired:nt,preview:Object(_.b)().preview,nextBtnText:"",prevBtnText:"",prevEnabled:!1,randomList:[],loopStack:[],startTime:0,currentStartTime:0,renderList:[],current:void 0,limitTime:rt||void 0,minTime:it,timeoutText:ot||"",timeLessText:ct||"",timer:-1,restTime:Object(c.b)(rt),hasVar:i,nextLoading:!1,refreshing:!1,phoneUsed:!1,phoneNumber:"",startNode:m,nodes:[],prevButton:"",nextButton:"",inSingleGroup:null,needProgressBar:!1,first(){return Object(d.b)(this)[0]||this.current},last(){const t=Object(d.b)(this);return t[t.length-1]||this.current},async dynamicStateProps(){const t=Object(d.b)(this);Object(_.g)(this,{nodes:t});let e=null;if(Object(d.c)(this)){const t=this.first();e=t&&this.parsedPayload.nodeGroups.find(e=>e.id===t.groupId)}Object(_.g)(this,{inSingleGroup:e});const n=await Object(o.f)(this);Object(_.g)(this,{prevButton:Object(o.h)(this),nextButton:n,needProgressBar:this.progressBarRequired&&"lottery"!==this.current.type}),t.forEach((e,n)=>{e.next=t[n+1]})},handleEvents:{...I.a,handleQuickAnswer:t=>Object(L.b)(t),handleLangChange:t=>Object(k.n)(Object(x.a)(t.id,!0)),handleCascadeInput(t,e,n,r){if(V(r))return Object(k.n)();const i=Object(h.g)(t,e,n,r);return this.handleOptionInput(t,i,r).then(t=>(Object(w.c)(),t))},handleOptionAssistInput:(t,e,n,r)=>(Object(_.g)(n.assistValue,{[e]:t}),F({result:!0},r)),async handleCascadeClick(t,e,n){const r=()=>e.list.filter(t=>t.selected).map(t=>t.text);if(V(n))return r();const i=Object(h.f)(t,e,n);return i?(await this.handleOptionClick(i,n),Object(w.c)(),i.result):r()},async handleMenuClick(t,e){const n=()=>e.options.filter(t=>t.selected).map(t=>t.text);if(V(e))return n();await this.handleOptionClick(e.options[t],e);const r=n();return Object(w.c)(),r},async handleOptionClick(t,e){if(V(e))return;const n=await Object(s.b)(t,e);return n.result&&Object(b.q)(t,e),F(n,e).then(t=>(Object(w.c)(),t))},async handleOptionInput(t,e,n){if(V(n))return;const r=await Object(a.b)(t,e,n);return r.result&&Object(b.p)(t,e,n),F(r,n).then(t=>(Object(w.c)(),t))},handleAutoCpltInput:(t,e,n)=>(Object(a.a)(t,e,n),Object(k.n)(Object(b.b)(t,e,n))),handleOptionDrop(t,e,n){if(V(n))return Object(k.n)([]);const r=Object(u.a)(t,e,n);return r.result&&Object(b.r)(e,n),F(r,n).then(t=>(Object(w.c)(),t))},handleQuestionInput(t,e){if(V(e))return Object(k.n)();const n=Object(l.b)(t,e);return n.result&&Object(b.u)(t,e),F(n,e).then(t=>(Object(w.c)(),t))},handleLocateFailed(t){const e=Object(l.a)(t);return e.result&&Object(b.k)(t),F(e,t).then(t=>(Object(w.c)(),t))},handlePrevClick:()=>Object(_.b)().realTimePreview||q()||!st.prevButton||V(null)?Object(k.n)():(Object(b.t)(st.current),Object(o.i)(st).then(t=>(Object(w.c)(),t))),handleMaxDiffInput:(t,e,n,r)=>F(Object(M.a)(t,e,n,r),r).then(t=>(Object(w.c)(),t)),async handleNextClick(){if(Object(_.b)().realTimePreview||V(st.current)||q()&&Object(o.l)())return;Object(o.m)(st,!0),function(t){const{current:e,currentStartTime:n,nodes:r}=t,i=e.costTime||0,o=(new Date).getTime(),c=o-n;if(e.groupSingle&&r.length>1){const t=Math.abs(c/r.length);r.forEach(e=>{Object(_.g)(e,{costTime:t,endTime:o}),Object(v.a)(e)})}else Object(_.g)(t.current,{costTime:Math.abs(i+c),endTime:o}),Object(v.a)(t.current);Object(_.g)(t,{currentStartTime:o})}(st);const{current:t}=st;if(Object(b.n)(t),"lottery"===t.type)Object(o.k)(st,t),Object(o.m)(st,!1);else{if(await Object(o.n)(st)){if(!q())return Object(o.j)(st);Object(o.d)(st)}else Object(o.m)(st,!1)}}}};return Object.keys(st.handleEvents).forEach(t=>{const e=st.handleEvents[t];st.handleEvents[t]=async(...t)=>{Object(O.e)(st,st.current);const n=await e.apply(st.handleEvents,t);return Object(O.e)(st,st.current),n}}),st}function q(){return A.refreshing}function V(t){let e=A.nextLoading||q();return t&&(e=e&&t!==t.parent.current),e}async function F(t,e){if(await Object(d.d)(e),Object(_.b)().liteTemplate)return!1;Object(y.c)(e),Object(v.a)(e);const n=e.parent;return Object(_.b)().realTimePreview||(n.inSingleGroup?(Object(_.g)(n,{current:e}),await Object(O.f)(n,e,{type:"page_inner",delay:60})):R()),Object(y.b)(e),t.result}function $(t){const e=t;return{nodeName:e.nodeName,nodeUuid:e.nodeUuid,type:"describe",image:e.image,images:e.image?[e.image]:void 0,imgPosition:"before",imgTransTime:2e3,imgTransType:"slide",layout:e.layout}}async function H(t){if(A=t,Object(_.b)().liteTemplate)await async function(t){const{nodeList:e}=t,n=e.find(t=>"start"===t.type),r=e.find(t=>"end"===t.type),i={...$(n),questionText:n.startName,describe:n.questionText},o={...$(r),questionText:r.questionText,describe:r.describe},c=[i,...e.filter(t=>"start"!==t.type&&"end"!==t.type).sort((t,e)=>t.x>e.x?1:-1),o];let a;const s=[];for(const e of c){const n={prev:a,origin:e,...e},r=await Object(d.f)(n,t);a&&(a.next=r),a=r,s.push(r)}Object(_.g)(t,{renderList:s,nodes:s,nextButton:"",prevButton:""})}(t);else if(await z(t),function(t){let e=t.limitTime;e&&(t.timer=setInterval(()=>{e--,e||(Object(b.z)(t),clearInterval(t.timer),Object(_.b)().error(t.timeoutText||Object(x.f)(E.a.global.timeOver))),Object(_.g)(t,{restTime:Object(c.b)(e)})},1e3))}(t),t.langResume||t.resumeEnabled&&!Object(_.b)().preview){const e=Object(w.a)(t);Object(_.g)(t,{memoryTool:e,answerResumer:e}),t.langResume&&setTimeout(()=>t.answerResumer.handleSure(),1e3)}}function X(t,e={}){return t=t||D(),Object(_.g)(t,{renderList:[],current:null,loopStack:[],randomList:[],...e}),z(t)}async function z(t){Object(o.m)(t,!0);const e=t.nodeList,n=Object(r.d)(e),c=await Object(i.a)(e,t,n);!function(t,e){const n=(new Date).getTime();Object(_.g)(t,{nextBtnText:e.nextBtnText||Object(x.f)(E.a.global.next),prevBtnText:e.prevBtnText||Object(x.f)(E.a.global.previous),prevEnabled:!0===e.goBackEnabled,startTime:n,currentStartTime:n})}(t,n),await Object(o.a)(t,c,null);const{current:a}=t,s=Object(r.w)(a),u=Object(d.c)(t);if(s||u){const e=u?"page_inner":"page_next";await Object(O.f)(t,a,{type:e,initial:!0})}else Object(_.g)(t,{renderList:[a]}),await t.dynamicStateProps(),R();Object(N.a)(t);const l=t.current;return l.reached=!0,Object(b.x)(t,l),Object(v.j)(t),a!==l&&await Object(j.b)(t,{valid:!0,message:""},a,l),Object(y.c)(t.current,!0),Object(o.m)(t,!1),t}async function K(){const t=Object(_.b)().sid,e=Object(_.b)().startState;if(e||(Object(_.c)().app.gotoStartPage(Object(P.c)()),Object(_.b)().customAbort()),Object(_.b)().preview)return e;const{parsedPayload:{basicConfig:n}}=e,{payload_digest:r,channel:i,interviewee:o}=n;!function(t,e){if(!Object(_.c)().dev.autoRun&&Object(_.c)().storage.get(t)&&e&&!Object(_.b)().preview)throw Object(_.b)().error(Object(x.f)(E.a.global.antiAgain)),new Error(" _custom_abort_ _multi_reply")}(t,!1===n.collector.multiple_response);const c={code:t,payload_digest:r,platform:i.type,interviewee_id:o&&o.id};try{const t=await Object(m.g)(c);return e.transactionID=t.id,e.status=t.status,e.platform=t.platform,e.digest=r,e.channel=i,Object(_.c)().network.connectSocket(t.id,n.collector.id),e}catch(t){throw Object(m.c)(t),t}}function G(){A=null}async function Y(){const t=Object(_.c)();if(A)return A;const e=await K();await async function(t){if(Object(_.b)().preview)return;const{parsedPayload:e}=t,{basicConfig:{diagram_url:n}}=e;let r;try{r=await Object(m.p)(n)}catch(t){throw Object(_.b)().error(Object(x.f)(E.a.global.downloadError)),t}const i=await Object(S.a)(r);e.nodeList=Object(g.b)(i.nodes,e.nodeGroups);const{nodeList:o,langStore:c}=e;c&&Object(T.c)({nodes:o},c)}(e);const n=B(e);Object(_.b)().surveyState=n,await t.network.initUploader(n),await Object(C.b)(n),await async function(t){t.needRegions&&await Object(f.a)()}(n);const{startNode:{templates:r},theme:i}=n;return await t.ui.loadUiTemplates(i,r),await async function(t){const{startNode:e}=t,n=await Object(p.a)({...e,parent:t},!0);n.valid?e.passed=!0:(Object(_.b)().error(n.message||Object(x.f)(E.a.verify.failed)),Object(_.b)().customAbort())}(n),await H(n),await t.hook.afterFetchSurvey(n),n}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return l}));var r=n(21),i=n(6),o=n(11),c=n(15);async function a(t,e,n){const i=e.displayConfig;if(i){n.hasOptShowHide=!0,t.context.option=e;const c=await Object(r.b)(t,i.options,i.logicType);return c&&Object(o.o)(t,e,n),t.context.option=null,c}return!0}async function s(t,e,n){const r=[],i=[];for(const o of e){await a(t,o,n)?(o.visible=!0,r.push(o)):(o.visible=!1,i.push(o))}return{visibleList:r,hiddenList:i}}async function u(t,e,n){for(const r of e)r.visible=await a(t,r,n);return e}function l(t,e){const{renderList:n}=t,r=[];return n.forEach(t=>{if(!Object(c.e)(t.checkMode,e))return;const{hasOptShowHide:n,nodeUuid:o,loop:a}=t;if(n){const e="matrix"===t.type?Object(i.d)(t):Object(i.c)(t);let n;a&&(n=a.replacements.map(t=>t.index)),r.push({node_id:o.toLowerCase(),loop_idxs:n,option_ids:e.map(t=>t.uuid.toLowerCase())})}}),r}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(34);const i=["beforecopy","beforepaste","beforecut","copy","paste","cut","animationstart","animationend","animationiteration","transitionend","scroll","wheel","blur","click","dblclick","focus","focusin","focusout","input","keypress","keyup","keydown","select","change","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup","touchcancel","touchend","touchmove","touchstart","unload","cancel","close","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","loadedmetadata","loadeddata","durationchange","timeupdate","play","pause","ratechange","volumechange","suspend","emptied","stalled","invalid","reset","submit","invalid","reset","submit","show","contextmenu","drag","dragend","dragenter","dragexit","dragleave","dragover","dragstart","drop","webglcontextcreationerror","webglcontextlost","webglcontextrestored","error","load","loadend","loadstart","progress"];function o(t){if(!t||t.includes("data-safe-html="))return t;const e=new r.a("div");return e.setInnerHtml(t),function t(e){if("script"===e.name)e.parent&&e.parent.removeChild(e);else{i.forEach(t=>{delete e.attributes["on"+t]});for(let n=e.children.length-1;n>=0;n--){const r=e.children[n];"node"===r.type&&t(r)}}}(e),e.getInnerHtml()}},function(t,e,n){"use strict";n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"g",(function(){return f})),n.d(e,"f",(function(){return b})),n.d(e,"e",(function(){return p})),n.d(e,"b",(function(){return v})),n.d(e,"c",(function(){return w}));var r=n(1),i=n(16),o=n(22),c=n(51),a=n(7),s=n(41);let u;function l(t){const{loopStack:e}=t;return e?e[e.length-1]:null}function d(t,e,n){const{state:{loopStack:i}}=t,o=i[e];if(o){const t=o.replacements[e];if(t)return Object(r.j)(n(t))}return Object(r.j)(n())}function f(t,e){const{varInfo:{loopNodeId:n,imgSize:i},state:o}=t,c=l(o);if(!c)return Object(r.n)("");const a=p(n,c.replacements);return Object(r.j)(e(a,i))}function b(t){const e=t.split(":")[1];return function(){if(!u){const t=Object(o.a)();u=[],Object.keys(t).forEach(e=>{const{uuid:n,type:r}=t[e];"var-loop"===r&&u.push(n)})}return u}().indexOf(e)>-1}function p(t,e){return e.find(e=>Object(r.l)(e.loopNodeId,t))}function O(t,e="0:0"){if(t){let n=void 0===t.refText?t.text:t.refText;if(n.match(/^##.+##$/)&&"0:0"!==e){const t=e.split(":");n=n.replace(/\?w=0&h=0/,`?w=${t[0]||0}&h=${t[1]||0}`)}return n}return""}function m(t,e="0:0"){if(t&&t.image){const{image:n}=t;return Object(i.b)(n.url,e)}return""}function g(t){return t&&Object(a.a)(t.index+1)}function j(t){return t&&t.value}function h(t){return t&&Object(a.a)(t.number)}function y(t){return t&&t.label}function v(t){t.C_OL_TXT.getText=t=>d(t,0,O),t.C_OL_IDX.getText=t=>d(t,0,g),t.C_OL_NUM.getText=t=>d(t,0,h),t.C_OL_VAL.getText=t=>d(t,0,j),t.C_OL_LBL.getText=t=>d(t,0,y),t.C_IL_TXT.getText=t=>d(t,1,O),t.C_IL_IDX.getText=t=>d(t,1,g),t.C_IL_NUM.getText=t=>d(t,1,h),t.C_IL_VAL.getText=t=>d(t,1,j),t.C_IL_LBL.getText=t=>d(t,1,y),s.a.forEach(e=>{!function(e){const n=e.split("_")[1],r="C_IL_MAP_"+n,i=(t,n)=>d(t,n,n=>{if(!n)return"";const{mapping:r}=n;return Object(c.b)(r,e,t)});t["C_OL_MAP_"+n].getText=t=>i(t,0),t[r].getText=t=>i(t,1)}(e)})}function w(t){t.LOOP.getText=t=>f(t,O),t.LOOP_IMG.getText=t=>f(t,m),t.LOOP_INDEX.getText=t=>f(t,g),t.LOOP_NUM.getText=t=>f(t,h),t.LOOP_VAL.getText=t=>f(t,j),t.LOOP_LBL.getText=t=>f(t,y),s.a.forEach(e=>{!function(e){const n=e.split("_")[1];t["LOOP_MAP_"+n].getText=t=>f(t,n=>Object(c.b)(n.mapping,e,t))}(e)})}},function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return c})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return l}));var r=n(5),i=n(15);function o(t,e,n){const{question:r,option:i,exclusiveId:o}=t;let c=r.embedVarMaps;if(c||(c=r.embedVarMaps=[]),o){const t=c.find(t=>t.exclusiveId===o&&t.var_id===e.mapId);if(t)return void(t.value=n)}c.push({type:"embed",var_id:e.mapId,value:n,option_id:i&&i.uuid.toLowerCase(),exclusiveId:o})}function c(t){const{text:e,image:n,icon:r}=t;if(e)return e;if(n)return n.originName;if(r){const t=r.match(/#[^#]+$/);return t&&t[0]||""}return""}function a(t,e,n){t.referVarMaps||(t.referVarMaps=[]);const r=n.map(t=>({option_id:t.uuid.toLowerCase(),value:c(t),type:"ref",var_id:e.uuid}));t.referVarMaps=t.referVarMaps.concat(r)}function s(t,e){const n=t.casVarMaps=[];e.forEach(t=>{t.text&&n.push({type:"cascade",option_id:t.uuid.toLowerCase(),value:t.text})})}function u(t){if(t){let e=[];const n=[];return t.forEach(t=>{delete t.exclusiveId,t.option_id?e.push(t):n.push(t)}),e=function(t){let e=[];const n={};return t.forEach(t=>{const{var_id:e,value:r}=t;let i=n[e];i?(i.values.indexOf(r)<0&&i.values.push(r),i.maps.push(t)):i=n[e]={values:[r],maps:[t]}}),Object.keys(n).forEach(t=>{const r=n[t],{values:i,maps:o}=r;if(i.length>1)e=e.concat(o);else{const t=o[0];o.length>1&&(t.option_id="all"),e.push(t)}}),e}(e),n.concat(e)}return[]}function l(t,e){const{renderList:n}=t,o=[];return n.forEach(t=>{if(!Object(i.e)(t.checkMode,e))return;const{nodeUuid:n,loop:c}=t;let{embedVarMaps:a,referVarMaps:s,casVarMaps:l}=t;a=u(a),s=s||[],l=l||[];const d=a.concat(s,l);if(d.length>0){let t;d.forEach(t=>{t.value=Object(r.k)(t.value)}),c&&(t=c.replacements.map(t=>t.index)),o.push({node_id:n.toLowerCase(),loop_idxs:t,var_maps:d})}}),o}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=Object.keys({field_1:"",field_2:"",field_3:"",field_4:"",field_5:"",field_6:""})},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return b})),n.d(e,"d",(function(){return p})),n.d(e,"a",(function(){return O}));var r=n(39),i=n(13),o=n(16),c=n(24),a=n(6),s=n(1),u=n(41);function l(t){if(!t)return[];const e=[];return t.forEach(t=>{const n=t.reformed?t:Object(o.d)(t.id);n&&e.push(n)}),e}function d(t){const e=Object(o.d)(t.uuid);if(e)return Object(c.b)({width:e.originWidth,height:e.originHeight,name:e.serverFileName,id:e.id,originName:e.fileName})}async function f(t,e){let n=[];if(!e)return n;const r=Object(o.d)(e.uuid);if(r)return[r];if(!e)return n;if(e.value){const r=Object(i.i)(e.value);for(const e of r){const r=await f(t,Object(i.f)(t,e));n=n.concat(r)}}else{const{question:r,option:o,optionPart:c}=e;if(!r)return[];if(c){const r=(await Object(i.b)({state:t,varInfo:e,specifiedOpt:o})).map(t=>Object(a.p)(t,"image"));n=n.concat(l(r))}else n=n.concat(l(r.images))}return n}function b(t=""){return t&&"string"==typeof t?t.replace(/##(?:http|data:image).+?#(.*?)##/g,"$1"):t}function p(t=""){return t&&"string"==typeof t?t.replace(/##((?:http|data:image).+?)##/g,"$1"):t}function O(t){async function e(e,n,o){if(!e||!e.id)return[Object(c.c)(e)];if(e.reformed)return[e];if(n&&r.f(e.id))return t.LOOP_IMG.getImages(o);if("media"===e.type)return[Object(c.c)(e)];const a=o.state,s=(await f(a,Object(i.h)(a,{uuid:e.id})))[0];if(!s)return[];if(s.reformed)return[s];const{serverFileName:u,originWidth:l,originHeight:d,id:b,fileName:p}=s;return e={name:u,width:l,height:d,id:b,originName:p},[Object(c.c)(e)]}function n(t,n,r){const{varInfo:{loopNodeId:i}}=r,o=t&&t[n]||"";return"string"==typeof o?Object(s.n)([]):e(o,i,r)}t.QUES_IMAGE.getImages=async e=>{const{varInfo:{question:n,loopNodeId:o},state:a}=e,{images:s}=n;if(!s)return[];let u=[];for(const n of s)if(n.reformed)u.push(n);else if(o&&r.f(n.id)){const n=await t.LOOP_IMG.getImages(e);u=[...u,...n]}else if("media"===n.type)u.push(n);else{const t=await f(a,Object(i.h)(a,{uuid:n.id}));u=u.concat(t)}return u.map(t=>t.reformed?t:Object(c.b)({width:t.originWidth||t.width,height:t.originHeight||t.height,name:t.serverFileName||t.name,id:t.id,originName:t.originName||t.fileName}))},t.OPT_IMAGE.getImages=t=>{const{varInfo:{option:n,loopNodeId:r},specifiedOpt:i}=t,o=i||n;return e(Object(a.p)(o,"image"),r,t)},t.LOOP.getImages=t.LOOP_IMG.getImages=t=>{const{state:e,varInfo:{loopNodeId:n}}=t,i=r.d(e);if(!i)return Object(s.n)([]);const o=r.e(n,i.replacements);return o&&o.image?Object(s.n)([o.image]):Object(s.n)([])},t.OPT_ICON.getIcon=t=>t.specifiedOpt.icon,u.a.forEach(e=>{!function(e){const r=e.split("_")[1];t["OPT_MAP_"+r].getImages=t=>{const{specifiedOpt:r}=t,{mapping:i}=r;return n(i,e,t)}}(e),function(e){const r=e.split("_")[1];t["C_OPT_MAP_"+r].getImages=t=>{const{state:{context:{option:r}}}=t;if(!r)return Object(s.n)([]);const{mapping:i}=r;return n(i,e,t)}}(e),function(e){const i=e.split("_")[1],o="C_IL_MAP_"+i;function c(t,i){return r.a(t,i,r=>{if(!r)return[];const{mapping:i}=r;return n(i,e,t)})}t["C_OL_MAP_"+i].getImages=t=>c(t,0),t[o].getImages=t=>c(t,1)}(e),function(e){const i=e.split("_")[1];t["LOOP_MAP_"+i].getImages=t=>r.g(t,r=>n(r.mapping,e,t))}(e)})}},function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(9);let i;function o(t){if(i)return i;t.sort((t,e)=>t.Value-e.Value>0?1:-1);const e=[];let n,r;return t.forEach(t=>{const i=t.Value;i%1e4==0?(n={...t,id:i/1e4,cities:[]},e.push(n)):i%100==0?(r={...t,id:i/100,counties:[]},n.cities.push(r)):r.counties.push({...t,id:i})}),i=e,e}async function c(){if(i)return i;return o((await Object(r.p)("https://media.choiceform.com/dict/region.json")).provinces)}function a(t){if(!t)return"";const e=t.split("-"),n=e[0],r=i.find(t=>n.indexOf(t.Meaning)>-1);if(!r)return"";const o=r?r.Value+"":"",c=e[1];if(!c)return o;const a=r.cities.find(t=>c.indexOf(t.Meaning)>-1);if(!a)return o;const s=a?a.Value+"":"",u=e[2];if(!u)return s;const l=a.counties.find(t=>u.indexOf(t.Meaning)>-1);return(l?l.Value+"":"")||s||o||""}function s(t){const e=t.split(" ").map(t=>Number(t)),n=e.length,r=i[e[0]];let o,c,a=r.Meaning;return n>1&&(o=r.cities[e[1]],a+="-"+o.Meaning,n>2&&(c=o.counties[e[2]],a+="-"+c.Meaning)),a}},function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return l})),n.d(e,"b",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"a",(function(){return p}));var r=n(3),i=n(0),o=n(2),c=n(38),a=n(22);function s(t){const e=":"+Object(a.a)().LOOP_IMG.uuid;return t.indexOf("-0000-0000-0000-000000000000")&&(t=t.replace("-0000-0000-0000-000000000000",e)),t}function u(t){l(t),d(t)}function l(t){const{image:e,options:n}=t;e&&(e.id=s(e.id),t.images=[t.image],n&&n.forEach(t=>{t.image&&(t.image.id=s(t.image.id))}))}function d(t){const e=t;e.layout&&("cascade"===e.type?e.layout.optMarkOld="normal "+e.layout.optMark:e.layout.optMarkOld=e.layout.optMark)}function f(t,e){return t.filter(t=>t.used).map(t=>(l(t),t.destList=t.destList.filter(t=>!t.designOnly),function(t){const e=t;e.questionText=Object(c.a)(e.questionText),e.describe=Object(c.a)(e.describe);let n=[];e.options&&(n=n.concat(e.options)),e.otherOptions&&(n=n.concat(e.otherOptions)),e.optionsX&&(n=n.concat(e.optionsX)),e.optionsY&&(n=n.concat(e.optionsY)),n.forEach(t=>{t.text=Object(c.a)(t.text)})}(t),function(t,e){if(t.groupId){const n=e.find(e=>e.id===t.groupId);t.groupSingle=n&&n.singlePage}}(t,e),d(t),function(t){const e=(t,e,n)=>(n=n||t.length,t.forEach((t,r)=>{t.index=r+e,t.realIndex=t.index-n}),e+t.length),n=t;if("matrix"===n.type){const t=n.optionsX.length+n.refOptionsX.length,r=e(n.optionsX,0,t);e(n.refOptionsX,r,t);const i=n.optionsY.length+n.refOptionsY.length,o=e(n.optionsY,0,i);e(n.refOptionsY,o,i),e(n.otherOptions,0)}else if(n.options){let t=n.options.length;n.refOptions&&(t+=n.refOptions.length);const r=e(n.options,0,t);n.refOptions&&e(n.refOptions,r,t)}}(t),t))}function b(t){return t.forEach(t=>{t.value=Object(c.a)(t.value)}),t}function p(t){t.version||(Object(i.b)().error(Object(o.f)(r.a.global.upgrade)),Object(i.b)().customAbort()),t.version<2&&t.nodes.forEach(t=>{let e=[];t.options&&(e=e.concat(t.options)),t.otherOptions&&(e=e.concat(t.otherOptions)),e.forEach(t=>{10===t.mutexNumber&&(t.mutexNumber=-1)})})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return f})),n.d(e,"b",(function(){return b}));var r=n(1),i=n(41);const o=[{id:"ar_sa",value:"العربية"},{id:"bg_bg",value:"български"},{id:"cs_cz",value:"Česky"},{id:"da_dk",value:"Dansk"},{id:"de_de",value:"Deutsch"},{id:"el_gr",value:"Ελληνικά"},{id:"en_us",value:"English"},{id:"es_es",value:"Espanol"},{id:"et_ee",value:"Eesti"},{id:"fi_fi",value:"Suomi"},{id:"fr_fr",value:"français"},{id:"hu_hu",value:"Magyar"},{id:"it_it",value:"Italiano"},{id:"ja_jp",value:"日本語"},{id:"ko_kr",value:"한국어"},{id:"nl_nl",value:"Nederlands"},{id:"pl_pl",value:"Polski"},{id:"pt_pt",value:"Português"},{id:"ro_ro",value:"Română"},{id:"ru_ru",value:"Pусский"},{id:"sl_sl",value:"Slovenščina"},{id:"sv_se",value:"Svenska"},{id:"th_th",value:"ไทย"},{id:"zh_cn",value:"简体中文"},{id:"zh_tw",value:"繁體中文"},{id:"vi_vn",value:"Tiếng Việt Nam"}];function c(t,e){t.questionText=e.questionText||"",t.describe=e.describe||""}function a(t,e){t.mapping&&e.mapping&&i.a.forEach(n=>{const r=t.mapping[n];r&&"object"==typeof r||(t.mapping[n]=e.mapping[n]||"")})}function s(t,e){let n=[];t.options&&(n=[...n,...t.options]),t.refOptions&&(n=[...n,...t.refOptions]),t.otherOptions&&(n=[...n,...t.otherOptions]),e.options&&Object.keys(e.options).forEach(i=>{const o=n.find(t=>Object(r.s)(t.uuid)===i);o&&function(t,e,n){(function(t,e){return!t.isRef&&(!!t.isOtherOpt||!["cascade","region","area","location"].includes(e.type))})(t,n)&&(t.text=e.text||""),t.optComment=e.optComment||"",a(t,e),t.selectText=e.selectText,t.autoInputConfig&&e.autoInputConfig&&(t.autoInputConfig.defaultValue=e.autoInputConfig.defaultValue||"")}(o,e.options[i],t)})}function u(t,e){t&&e&&t.logic&&e.logic&&(t.logic.message=e.logic.message||"")}function l(t,e){c(t,e),s(t,e),u(t.validation,e.validation)}const d={};function f(t,e={}){const{nodes:n,variables:i,groups:o}=e,{nodes:c,variables:a,groups:s}=t;c&&n&&Object.keys(n).forEach(t=>{const e=n[t],i=c.find(e=>e.nodeUuid&&Object(r.s)(e.nodeUuid)===t);i&&function(t,e){const n=d[t.type];n?n(t,e):l(t,e)}(i,e)}),a&&i&&Object.keys(i).forEach(t=>{const e=i[t],n=a.find(e=>Object(r.s)(e.uuid)===t);n&&function(t,e){t.value=e.value||""}(n,e)}),s&&o&&Object.keys(o).forEach(t=>{const e=o[t],n=s.find(e=>Object(r.s)(e.id)===t);n&&function(t,e){t.prevText=e.prevText||"",t.nextText=e.nextText||""}(n,e)})}function b(t,e){t&&t.forEach(t=>{t.data.forEach(t=>{const n=t[e];n&&(t.name=n)})})}d.end=(t,e)=>{c(t,e),t.endBtnText=e.endBtnText||""},d.gift=(t,e)=>{c(t,e),t.activityName=e.activityName||"",t.endBtnText=e.endBtnText||"",t.blessings=e.questionText||""},d.loop=(t,e)=>{(e.options||t.options)&&Object.keys(e.options).forEach(n=>{const i=t.options.find(t=>Object(r.s)(t.uuid)===n);i&&(i.text=e.options[n].text)})},d.lottery=(t,e)=>{(e.options||t.options)&&Object.keys(e.options).forEach(n=>{const i=t.options.find(t=>Object(r.s)(t.uuid)===n);i&&(i.rewardName=e.options[n].rewardName)}),e.success&&(t.success.title=e.success.title||"",t.success.summary=e.success.summary||""),e.fail&&(t.fail.title=e.fail.title||"",t.fail.summary=e.fail.summary||"")},d.value_mark=(t,e)=>{l(t,e),t.minText&&(t.minText=e.minText||"",t.maxText=e.maxText||"")},d.menu=(t,e)=>{l(t,e),t.placeholder=e.placeholder||""},d.start=(t,e)=>{t.questionText=e.questionText||"",t.startName=e.startName||"",t.logoText=e.logoText||"",t.startBtnText=e.startBtnText||"",t.nextBtnText=e.nextBtnText||"",t.prevBtnText=e.prevBtnText||"",t.timeoutText=e.timeoutText||"",t.timeLessText=e.timeLessText||"",u(t.validation,e.validation)},d.slide_rate=(t,e)=>{l(t,e),(e.options||t.rateOptions)&&Object.keys(e.options).forEach(n=>{const i=t.rateOptions.find(t=>Object(r.s)(t.uuid)===n);i&&(i.text=e.options[n].text)})},d.matrix=(t,e)=>{if(c(t,e),u(t.validation,e.validation),e.options){let n=[];t.optionsX&&(n=[...n,...t.optionsX]),t.optionsY&&(n=[...n,...t.optionsY]),t.otherOptions&&(n=[...n,...t.otherOptions]);const i=t.options||[];Object.keys(e.options).forEach(t=>{const o=e.options[t],c=i.find(e=>Object(r.s)(e.uuid)===t);if(c)a(c,o);else{const e=n.find(e=>Object(r.s)(e.uuid)===t);e&&(e.text=o.text||"")}})}},d.data=(t,e)=>{s(t,e),t.options&&t.options.forEach(t=>{delete t.optComment,delete t.value})}},function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return O})),n.d(e,"a",(function(){return m}));var r=n(68),i=n(5),o=n(8),c=n(0),a=n(63),s=n(50),u=n(9),l=n(1);let d={},f=!1;const b={valid:!0,message:"",result:""};async function p(t,e,n,o,l){const{method:p,embedId:O}=e,m="embed"===p,g="fake"===p;if(Object(c.b)().realTimePreview&&!m&&!g||!function(t){const e=t.params instanceof Array;return"embed"===t.method?!(!e||!t.embedId):!(!e||!t.url)}(e))return{...b};const j=await Object(i.h)(e.url,{state:t}),h=await Object(r.b)(t,e);n&&Object.keys(n).forEach(t=>{n[t]&&(h[t]=n[t])});let y=null;if(m)y=await Object(a.a)(O,h,t);else if("fake"===p)y=await Object(s.a)(j,h,t,o,l);else{let t="GET";"post"===p&&(t="POST");const e=j+t+JSON.stringify(h);let n=l?d[e]:null;if(!n){try{const r=await Object(u.b)(Object(c.c)().dev.parseRealUrl(j),{type:t,data:h,contentType:"application/json"});n=d[e]=r}catch(e){const n=`REAL ERROR:${t} ${j} ${JSON.stringify(e)}`;throw o||Object(c.b)().error(n),n}f&&console.info({...h,url:j},n)}y=n}return y}async function O(t,e,n,r,i){const o=await p(t,e,n,r,i);return void 0===o.valid&&(o.valid=!!o.result),o.valid||o.message||(o.message="^_^"),o}async function m(t,e){try{const{request:n}=e;n&&(await p(t,n,null,!0,!1),t.endRequested=!0,o.a.trigger("END_REQ"))}catch(t){Object(l.c)(t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(4),i=n(1);const o={findNext(t,e){const{destList:n,output:o}=e;return Object(i.n)({node:Object(r.c)(t,n,o&&o.uuid)})}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return f}));var r=n(4),i=n(6),o=n(17),c=n(0);const a=["logic","loop","random","break_point","check","data","lottery","gift"];function s(t){return t&&"end"!==t.type}function u(t,e){let n;e=function t(e,n){if(!e)return e;const i=e.parentRandomId||e.circleNode1Id;return i&&(e=t(e=Object(r.a)(n,i),n)),e}(e,t);const{output:o,destList:c}=e,{outputN:a}=e,u=Object(i.c)(e);if(o&&(n=Object(r.c)(t,c,o.uuid)),!s(n))if(a)n=Object(r.c)(t,c,a.uuid);else if(u)for(const e of u)if(n=Object(r.c)(t,c,e.uuid),s(n))break;return n}function l(t){return!a.includes(t.type)&&!t.autoSkip}function d(t){const e=function(t){const e=t.renderList.filter(t=>l(t));return Object(o.b)(e,t.current)}(t),n=function(t,e){const{nodeList:n,current:r}=e;let i=t,o=u(n,r);for(;o;)l(o)&&(i+=1),o=u(n,o);return"end"!==r.type&&(i+=1),i}(e,t);if(-1===e)return{index:-1,fullLength:n,percent:0};return{percent:Math.round(e/n*100),fullLength:n,index:e}}function f(t){if(Object(c.c)().dev.infer)return;const{percent:e,index:n}=d(t);n>-1&&Object(c.g)(t,{progress:e})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}));var r=n(54),i=n(21),o=n(5),c=n(7);const a={"-1":6,"-2":8,"-3":5,"-4":7};function s(t){const{varInfo:{limit:e,limitSrc:n}}=t;return!(0===n||!e||"1:0:0"===e)}async function u(t){if(!s(t))return!0;const{varInfo:{limitSrc:e,option:n}}=t,u=t.varInfo.question,l=t.specifiedOpt||n,d=function(t,e){if(0!==e.indexOf("-"))return e;const n=e.split(":"),r=a[n[0]];n[0]=Object(c.a)(r);const i=t.options.filter(t=>t.selected).map(t=>t.number).sort();n[1]=5===r||7===r?Object(c.a)(i[i.length-1]||0):Object(c.a)(i[0]||0);return n.join(":")}(u,t.varInfo.limit),f=Object(r.a)(l,e,t),b=d.split(":"),p=Number(b[0]),O=Object(i.a)(p)?await Object(o.f)(b[1],{...t,joinBy:","}):await Object(o.g)(b[1],t),m=await Object(o.g)(b[2],t);return i.d.input(f,{markId:p,markStart:O,markEnd:m})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return d}));var r=n(0),i=n(1);let o,c={},a=!1;async function s(t,e,n,i,s){const u=t+JSON.stringify(e);if(s){const t=c[u];if(t)return t}const l=o[t];if(!l){const e="FAKE NOT FOUND:"+t;throw Object(r.b)().error(e),e}let d=null;try{if(d=await l(e,Object(r.b)()),d.exception)throw d.exception}catch(t){if(!Object(r.b)().realTimePreview){const e=`FAKE ERROR:${u} ${t.stack&&t.stack.split("\n")[0]}`;throw i||Object(r.b)().error(e),e}d={result:""}}return a&&console.info(e,d),c[u]=d,a&&console.info(JSON.stringify(e),JSON.stringify(d)),d}const u=[/^https:\/\/[^.]+\.choiceform\.com\//,/^http:\/\/localhost/];const l=[];function d(t){let e=t.fakedServers.concat(function(t){if(Object(r.b)().preview)return[];const{parsedPayload:{basicConfig:{collector:{sampler_config:e}}}}=t;return e?["committed_url","examine_failed_url","examine_skipped_url","invalid_url"].reduce((t,n)=>{const r=e[n];if(r&&0===r.indexOf("FAKE:")){const e=r.substring("FAKE:".length,r.lastIndexOf("/"));-1===t.indexOf(e)&&t.push(e)}return t},[]):[]}(t));return e=e.filter(t=>!l.includes(t)),e&&0!==e.length?new Promise((t,n)=>{const i=Object(r.c)().network.getFakeHost(),c=async a=>{i.currentSpace="",function(t){return u.some(e=>!!t.match(e))}(a)||n(new Error("can not load plugin files from untrusted site: "+a)),i.currentSpace=a;try{await Object(r.c)().network.loadFakeFile(a+".js",{crossorigin:"anonymous"})}catch(t){n(t)}return l.push(a),e.length?c(e.pop()):(o=i.fakedServers,i.currentSpace="",void t())};return c(e.pop())}):Object(i.n)()}},function(t,e,n){"use strict";n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return p}));var r=n(15),i=n(16),o=n(2),c=n(0),a=n(6),s=n(1),u=n(7),l=n(10),d=n(41),f=n(33);function b(t,e,n){const r=t&&t[e]||"";if("string"==typeof r)return r;{const{pureText:t,varInfo:{imgSize:e},specifiedOpt:o}=n;return t?o?o.text:"":Object(i.b)(r.url,e,r.originName)}}function p(t){function e(e){t["URL_KEY_"+e].getText=()=>{const t="key"+e,n=Object(l.c)()[t];return Object(s.n)(n)}}t.URL_KEY.getText=()=>{const t=Object(l.c)(),e=t.key1||t.key;return Object(s.n)(e)};for(let t=2;t<=20;t++)e(t);function n(t){const{varInfo:e,state:n}=t;let r;const i=e.question;return i&&(r=i.position&&i.position.address),r||(r=n.address),r}t.YEAR.getText=()=>Object(s.n)((new Date).getFullYear().toString()),t.MONTH.getText=()=>{const t=(new Date).getMonth()+1;return Object(s.n)(Object(f.a)(t))},t.DATE.getText=()=>{const t=(new Date).getDate();return Object(s.n)(Object(f.a)(t))},t.DAY.getText=t=>{const e=(new Date).getDay(),n="zh_cn"===t.state.language?["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][e]:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e];return Object(s.n)(n)},t.QUES_ID.getText=t=>Object(s.n)(t.state.surveyId),t.WX_ID.getText=t=>{const{state:{userInfo:e}}=t,n=e&&e.openid;return Object(s.n)(n)},t.WX_SRC.getText=()=>Object(s.n)(Object(c.c)().name),t.WX_NAME.getText=t=>{const{state:{userInfo:e}}=t,n=e&&e.nickname;return Object(s.n)(n)},t.WX_UN_ID.getText=t=>{const{state:{userInfo:e}}=t,n=e&&e.unionid;return Object(s.n)(n)},t.RES_ID.getText=t=>{const{state:e}=t;return Object(s.n)(e.transactionID)},t.CLTR_ID.getText=()=>Object(s.n)(""),t.CLTR_CODE.getText=()=>Object(c.b)().preview?Object(s.n)(""):Object(s.n)(Object(c.b)().sid),t.CLTR_NAME.getText=t=>{if(Object(c.b)().preview)return Object(s.n)("");const{state:{parsedPayload:e}}=t;if(e){const{basicConfig:{collector:{name:t}}}=e;return Object(s.n)(t)}return Object(s.n)("")},t.START_TIME.getText=t=>{const e=t.state.startTime;return Object(s.n)(Object(u.a)(e))},t.COST_TIME.getText=t=>{const e=(new Date).getTime()-t.state.startTime;return Object(s.n)(Object(u.a)(e))},t.RESULT.getText=async t=>{const{state:e}=t,n=await Object(r.b)(e,"all");return JSON.stringify(n)},t.CURR.getText=t=>{const{state:e}=t;return Object(c.b)().realTimePreview?Object(s.n)(e.language):Object(s.n)(Object(o.c)())},t.LKTP.getText=()=>{const t=Object(c.d)();return Object(s.n)(t)},t.C_OPT_TEXT.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=Object(a.p)(e,"text");return Object(s.n)(n)},t.C_OPT_NUM.getText=t=>{const{state:{context:{option:e}}}=t,n=e&&e.number;return Object(s.n)(Object(u.a)(n))},t.C_OPT_VAL.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=Object(a.p)(e,"value");return Object(s.n)(n)},t.C_OPT_LBL.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=e.label||"";return Object(s.n)(n)},t.C_OPT_IPT.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=`<input data-iptc-holder='${e.renderId}' hidden='true' />`;return Object(s.n)(n)},t.C_OPT_ASI.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=`<input data-asic-holder='${e.renderId}' hidden='true' />`;return Object(s.n)(n)},d.a.forEach(e=>{!function(e){const n=e.split("_")[1];t["C_OPT_MAP_"+n].getText=t=>{const{state:{context:{option:n}}}=t;if(!n)return Object(s.n)("");const{mapping:r}=n,i=b(r,e,t);return Object(s.n)(i)}}(e)}),t.POSITION.getText=t=>{const{state:{point:e}}=t,n=e?e.lat+","+e.lng:"";return Object(s.n)(n)},t.COUNTRY.getText=t=>{const e=n(t),r=e&&e.country;return Object(s.n)(r)},t.PROVINCE.getText=t=>{const e=n(t),r=e&&e.province;return Object(s.n)(r)},t.CITY.getText=t=>{const e=n(t);return Object(s.n)(e&&e.city)},t.DISTRICT.getText=t=>{const e=n(t);return Object(s.n)(e&&e.district)},t.QUES_IMAGE.getText=t=>{const{varInfo:e,pureText:n}=t,r=e.question,o=e.imgSize;if(n){const t=r.images.reduce((t,e)=>t+" "+e.originName,"");return Object(s.n)(t)}{const t=r.images.reduce((t,e)=>t+Object(i.b)(e.url,o,e.originName),"");return Object(s.n)(t)}},t.QUES_DESC.getText=t=>Object(s.n)(t.varInfo.question.description),t.QUES_LABEL.getText=t=>Object(s.n)(t.varInfo.question.label||""),t.QUES_TEXT.getText=t=>Object(s.n)(t.varInfo.question.title),t.QUES_NAME.getText=t=>Object(s.n)(t.varInfo.question.nodeName),t.PHONE_NUMBER.getText=t=>{const e=t.varInfo.question;return Object(s.n)(e.phoneNumber)},t.PASSWORD.getText=t=>{const e=t.varInfo.question;return Object(s.n)(e.code)},t.QUES_TIME.getText=t=>Object(s.n)(Object(u.a)(t.varInfo.question.costTime)),t.QUES_RS.getText=t=>{const e=JSON.stringify(Object(r.a)(t.varInfo.question));return Object(s.n)(e)},t.VALIDATE_FAIL_TIMES.getText=t=>{const e=t.varInfo.question.validateFailTimes+"";return Object(s.n)(e)},t.DVC_BRSN.getText=()=>{const t=Object(c.c)().system.device.browser.name||"unknown";return Object(s.n)(t)},t.DVC_BRSV.getText=()=>{const t=Object(c.c)().system.device.browser.version||"unknown";return Object(s.n)(t)},t.DVC_OSN.getText=()=>{const t=Object(c.c)().system.device.os.name||"unknown";return Object(s.n)(t)},t.DVC_OSV.getText=()=>{const t=Object(c.c)().system.device.os.version||"unknown";return Object(s.n)(t)},t.DVC_VDR.getText=()=>{const t=Object(c.c)().system.device.device.vendor||"unknown";return Object(s.n)(t)},t.DVC_MDL.getText=()=>{const t=Object(c.c)().system.device.device.model||"unknown";return Object(s.n)(t)},t.DVC_TYPE.getText=()=>{const t=Object(c.c)().system.device.device.type||"unknown";return Object(s.n)(t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var r=n(46),i=n(21),o=n(27),c=n(11),a=n(5),s=n(2),u=n(0),l=n(3),d=n(1);const f={valid:!0,message:""};async function b(t,e=!1){if(!t.parent.nextLoading&&!e)return f;t.validateFailed=!1;const{validation:n,parent:b}=t;if(!n)return f;const{request:p,logic:O,noPreventNext:m}=n;let g=await function(t,e){if(t){const{parent:n}=e;return Object(r.c)(n,t,null,!1,!1)}return Object(d.n)(f)}(p,t);return g.valid&&(g=await async function(t,e){if(t){const{logicType:n,message:r,options:o}=t;return await Object(i.b)(e,o,n)?f:{valid:!1,message:r||Object(s.f)(l.a.verify.invalidFailed)}}return f}(O,b)),g.valid||(t.validateFailed=!0,m&&(g=f,Object(c.B)(b,t)),g.dueToNode=t,await async function(t,e){if("string"!=typeof t.message)return t;const n=await Object(a.h)(t.message,{state:e});return t.message=n,Object(o.c)(t.message)||(t.message=await Object(a.d)(t.message,{state:e})),t.message.startsWith("vital:")?(t.type="vital",t.message=t.message.substr("vital:".length)):t.message.startsWith("alert:")&&(t.type="alert",t.message=t.message.substr("alert:".length)),t}(g,b),t.validateFailTimes+=1,Object(o.c)(g.message)&&(Object(u.c)().hook.beforeForceLeave(),Object(u.c)().app.openWebLink(g.message),Object(u.b)().customAbort())),g}},function(t,e,n){"use strict";n.r(e),n.d(e,"I18n",(function(){return $})),n.d(e,"EventHub",(function(){return u.a})),n.d(e,"Core",(function(){return F}));var r=n(0),i=n(5),o=n(38),c=n(44),a=n(4),s=n(18),u=n(8),l=n(2),d=n(11),f=n(45),b=n(3),p=n(29),O=n(67),m=n(9),g=n(63),j=n(1),h=n(10),y=n(16),v=n(12);let w,_;async function x(t){const e=function(t){const{mediaLibrary:e,surveyId:n,disabledLangs:r,testCases:i}=t,o=Object(c.b)(t.nodes,t.nodeGroups),s=Object(a.d)(o),u=t.langs.filter(t=>t.locale!==s.currentLang);return{imageList:e.imageList,videoList:e.videoList,nodeList:Object(c.b)(t.nodes,t.nodeGroups),theme:t.theme||{usingTheme:Object(p.b)()},nodeGroups:t.nodeGroups||[],variables:Object(c.d)(t.variables),basicConfig:_,embedApis:t.embedApis||[],varStyles:t.varStyles,surveyId:n,langs:u,language:"",langStore:null,langTable:null,langResume:!1,testCases:i,disabledLangs:r||[]}}(t),{nodeList:n,variables:i,nodeGroups:o}=e,s=e.disabledLangs,u=Object(a.d)(n),d=u.currentLang||"en_us",b=[d,...e.langs.map(t=>t.locale)],g=f.a.filter(t=>b.includes(t.id)&&!s.includes(t.id)),j=Object(l.c)(g,d),h=!!Object(r.c)().storage.get("lang-resume");if(h&&Object(r.c)().storage.remove("lang-resume"),await Object(l.g)(j),Object(l.d)(j),e.langTable=g,e.language=j,e.langResume=h,Object(f.b)(u.autoCpltGroups,j),j===d)return e;{const t=e.langs.find(t=>t.locale===j),r=await Object(m.p)(t.url),c=await Object(O.a)(r);return e.langStore=c,Object(f.c)({nodes:n,variables:i,groups:o},c),e}}async function T(){if(w)return w;const t=await async function(){const t=await Object(r.c)().dev.getCustomSummary();if(t)return t;{const t=Object(r.b)().sid;return Object(d.h)(),_||Object(m.f)(t)}}();!function(t){if(Object(r.b)().preview)return void(_=t);if(_)return;_=t;const{collector:{channel_configs:e}}=t,n=Object(r.c)().name,i=e.find(t=>t.type===n);if(i){if(!i.allow_response)throw Object(r.b)().error(Object(m.e)(m.a.interviewee_invalid_error)),new Error(m.a.interviewee_invalid_error);_.channel=i,Object(r.c)().auth.authorize(_)}else _.channel={type:n}}(t),await Object(r.c)().auth.init(t);const e=await async function(t){const e=await Object(r.c)().dev.getCustomSmallPayload();if(e)return e;{let e;try{e=await Object(m.p)(t.smaller_diagram_url)}catch(t){throw Object(r.b)().error(Object(l.f)(b.a.global.downloadError)),t}const n=await Object(O.a)(e);return Object(c.a)(n),n.langs=t.langs||[],n}}(t),n=await x(e),f=await async function(t){if(w)return w;const{imageList:e,nodeList:n,theme:i,variables:c,varStyles:d,surveyId:f,langResume:O}=t;Object(p.a)(i.usingTheme.client);const m=Object(a.d)(n),{imgScale:x,imgTransType:T,imgTransTime:I,imgPosition:k,welcomeUrl:N,startAuto:E,noWxShare:S,startName:L,qsnrName:C,questionText:P,describe:M,logoImage:R,useCustomLogo:A,logoText:D,startBtnText:U,hasVar:B,layout:q,template:V}=m;Object(y.f)({imageList:e,variables:c,varStyles:d}),Object(g.b)(t.embedApis),V&&await Object(r.c)().ui.loadUiTemplates(i.usingTheme,[V.id]);const F=await Object(s.a)({},m);let $="";if(R){const t=R.name;$=Object(r.b)().hostConfig.cdnHost+"/"+t}const{interviewee:H}=_,X=H?H.raw_data:Object(r.c)().auth.userInfo||{},z={template:V,langResume:O,langTable:t.langTable,eventHub:u.a,language:t.language||"en_us",layout:q,startNode:m,sid:Object(r.b)().sid,noWxShare:S,preview:Object(r.b)().preview,title:Object(o.a)(L||C),summary:Object(o.a)(P),description:Object(o.a)(M),images:F,surveyId:f,useCustomLogo:A,customLogo:$,customText:D||"",nextButton:U||Object(l.f)(b.a.global.start),theme:Object(p.e)(i),imgScale:x,imgPosition:k,imgTransType:T,imgTransTime:I,welcomeUrl:N,userInfo:X,hasVar:B,parsedPayload:t,startAuto:E||O,handleEvents:{handleLangChange:t=>Object(j.n)(Object(l.a)(t.id,!1)),async handleNextClick(){Object(v.m)(z,!0),await Object(r.b)().fetchSurveyState(),Object(r.c)().app.gotoSurveyPage(Object(h.c)()),Object(v.m)(z,!1)}}};return z}(n);return await async function(t){const e=t,n={state:e};t.title=await Object(i.d)(t.title,n),t.summary=await Object(i.d)(t.summary,n),t.description=await Object(i.d)(t.description,n),t.template=await Object(r.c)().ui.initNodeTemplate(t.template,e,null),Object(p.d)(t.theme),w=t,Object(u.c)({})}(f),await Object(r.c)().hook.afterFetchStart(f),(f.startAuto||Object(r.c)().dev.autoRun||Object(r.b)().liteTemplate)&&(f.hidden=!0,setTimeout(()=>{f.handleEvents.handleNextClick()})),f}var I=n(36),k=n(59),N=n(7),E=n(70),S=n.n(E);const L=()=>Object(j.n)(null),C={name:"other",dev:{parseRealUrl:t=>t,getCustomSmallPayload:L,getCustomSummary:L,local:!1,debug:!1,autoRun:!1,realtime:!1,infer:!1},app:{reload(){},openWebLink(){},canHandleReward:()=>!1,getRewardUrl:t=>Object(h.a)("https:/q.choiceform.com/reward",t)},network:{initUploader:L,connectSocket(){},closeSocket(){}},storage:null,auth:{userInfo:{},init:L,authorize(){},authorizeGift(){},retrieveAuthMeta:()=>null},hook:{afterFetchReward:L,afterFetchStart:L,afterFetchSurvey:L,afterSetup:L,beforeSetupEnd:L,beforeForceLeave(){},onLangChange(){},onSwitchPage(){},onTitleChange(){}},system:{device:{browser:{name:"",version:""},device:{type:"",vendor:"",model:""},engine:{name:"",version:""},os:{name:"",version:""}},inflate:(t,e)=>Object(j.n)(S.a.inflate(t,e)),getReferer:()=>"",getLang:()=>"en_us",functionConstructor:Function,translate(t,e){if(e){let n=e?Object(l.b)(t):t;return e&&Object.keys(e).forEach(t=>{n=n.replace(new RegExp(`{${t}}`,"g"),Object(N.a)(e[t]))}),n}return t}},ui:{setGlobalStyle(){},setVarStyle(){},initNodeTemplate:L,loadUiTemplates:L,getImageSize:()=>Object(j.n)({width:100,height:100})}};function P(t){return function t(e,n){Object.keys(n).forEach(r=>{const i=n[r];"object"==typeof i?e[r]?null!==i&&t(e[r],i):e[r]=i:void 0!==i&&(e[r]=i)})}(C,t),C}var M=n(34),R=n(57);const A={clientName:"ALL",key:"",dynamic:!1,treeUrl:"",templatePath:"",useWxSdk:!1,hostConfig:{qStaticHost:"https://media.choiceform.com/q-static-assets",sentryKey:"https://c2a21df7b3794fc6a8854f0a51e0e790@sentry.choiceform.io/8",recordUrl:"https://tracking.choiceform.com/api/records",host:"https://osapi.choiceform.com",wsHost:"wss://osapi.choiceform.com",cdnHost:"https://media.choiceform.com",publicHost:"https://public.choiceform.com",dictUrl:"https://media.choiceform.io/os-editor/assets/UploadFiles/Dictionary/Dictionary.js"},setTheme(){},locateError(){},langSrcMap:null,setLocale(){},customAbort(){},switchRoute:null,setter(t,e){Object.keys(e).forEach(n=>{t[n]=e[n]})}};var D=n(17),U=n(15);function B(t,e){const n=Object(r.b)().startState,o=[{title:Object(i.k)(n.title),description:Object(i.k)(n.description)}];return e.forEach(e=>{const n=Object(D.c)(t,e);if(!Object(a.w)(n)){const t={title:Object(i.k)(n.title),description:Object(i.k)(n.description),value:e.region||"",options:e.items?e.items.map(t=>({text:t.row_content||t.col_content?t.row_content+"-"+t.col_content:t.content,value:Object(U.c)(t).toString()})):[]};o.push(t)}}),o}var q=n(14);function V(){if(!F.initialized)throw new Error("CFCore not yet initialized")}const F={eventHub:u.a,notifySuspended:!1,util:{inflate:(t,e)=>S.a.inflate(t,e),convertVarStyle:y.a,richTextToNodes:M.d,getTaskInfo:async function(){const{surveyState:t,offlineTaskId:e}=Object(r.b)();if(!e||!t)return null;const n=await Object(U.b)(t,"all");return{result:n,progress:t.progress,nodes:B(t,n.answers)}}},registerEnv(t){const e=P(t);Object(r.f)(e),F.env=e},getTheme:()=>Object(p.c)(),async setup(t){if(F.initialized)return F;if(t.dynamic&&(!t.templatePath||!t.treeUrl))throw new Error("setup error, you configed your client as dynanmic, so must provide tempaltePath and treeUrl");Object.assign(F,function(t){const e={...A.hostConfig,...t.hostConfig};return Object.assign(A,{...t,hostConfig:e}),A}(t)),Object(r.a)(F.setter);const e=Object(h.c)(),n=e.sid;if(!n&&!Object(r.c)().dev.realtime)throw new Error("setup error, must provide sid");F.sid=n,F.realTimePreview=Object(r.c)().dev.realtime,F.liteTemplate=!!e.lite_template;const i=e.type;F.preview=F.realTimePreview||F.sid.length>30||"edit_template"===i||"preview_template"===i,F.preview&&(F.needPreviewFlag="1"!==e.ban_preview_bar),Object(b.f)(F.langSrcMap);const o=F.customAbort;F.customAbort=t=>{if(o&&o(),F.notifySuspended=!0,!t)throw new Error(" _custom_abort_ over")};const c=F.error;F.error=t=>{F.startState||F.rewardState||F.setTheme(Object(p.b)()),c(t),F.crashed=!0};const a=F.notify;return F.notify=t=>{F.notifySuspended||(F.startState||F.rewardState||F.setTheme(Object(p.b)()),a(t))},Object(r.c)().dev.debug&&(F.hostConfig.host="https://osapi.choiceform.com",F.hostConfig.cdnHost="https://media.choiceform.com"),F.hostConfig.qApiHost=F.hostConfig.host+"/q/v1",await Object(r.c)().hook.beforeSetupEnd(F),Object(r.e)(F),F.initialized=!0,await Object(l.g)(Object(l.c)()),await Object(r.c)().hook.afterSetup(F),await Object(r.c)().hook.beforeSetupEnd(F),F},async fetchStartState(t=""){V(),F.offlineTaskId=F.preview?"":t;const e=await T();return e.core=F,F.startState=e,Object(r.c)().hook.onTitleChange(e.title),e},async fetchSurveyState(){V(),F.startState&&Object(v.m)(F.startState,!0);const t=await Object(I.a)();return t.core=F,F.surveyState=t,Object(v.m)(F.startState,!1),Object(r.c)().hook.onTitleChange(t.title),t},async fetchRewardState(){V();const t=await Object(k.a)();return t.core=F,F.rewardState=t,Object(r.c)().hook.onTitleChange(t.quesTitle),t},reset(){F.offlineTaskId="",F.initialized=!1,w=null,_=null,F.startState=null,Object(I.c)(),F.surveyState=null,Object(k.c)(),F.rewardState=null,Object(h.f)(),Object(y.g)(),Object(R.a)(),Object(q.f)()}},$={mergeLangSrcMap:b.f,getLangSrcMap:b.d}},function(t,e,n){"use strict";n.d(e,"c",(function(){return c})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"a",(function(){return f}));var r=n(22),i=n(7),o=n(25);function c(t){return t.selected}function a(t){return!t.selected}function s(t,e){return Object(o.b)(t,e)}function u(t,e){return!Object(o.b)(t,e)}const l=(t,e,n,r=!1)=>{if(Object(i.b)(e[n]))return NaN;const o={};t.forEach(t=>{let e=(t[n]+"").replace(/(\s| )/g,"");const r=parseFloat(e);isNaN(r)||(e=r),Object(i.b)(e)||(o[e]?o[e].push(t):o[e]=[t])});const c=Object.keys(o).sort((t,e)=>{const n=Number(t),i=Number(e);return isNaN(n)||isNaN(i)?r?t>e?1:-1:t<e?1:-1:r?n>i?1:-1:n<i?1:-1});for(let t=0;t<c.length;t++){if(o[c[t]].indexOf(e)>-1)return t+1}return NaN},d={};function f(t,e,n){const i=d[e];return i?i(function(t){let e=null;const{varInfo:n}=t,i=n.question,o=n.nodePart,{selectIds:l,unselectIds:d,inputIds:f,uninputIds:b}=function(){const t=Object(r.a)(),e=[t.CHECKED_OPTS.uuid,t.RANKED_OPTS.uuid,t.MATCHED_OPTS.uuid],n=[t.UNCHECKED_OPTS.uuid,t.UNRANKED_OPTS.uuid,t.UNMATCHED_OPTS.uuid],i=[t.INPUTTED_OPTS.uuid,t.MARKED_OPTS.uuid],o=[t.UN_INPUTTED_OPTS.uuid,t.UNMARKED_OPTS.uuid];return{selectIds:e,unselectIds:n,inputIds:i,uninputIds:o}}();o&&(l.indexOf(o.uuid)>-1?e=c:d.indexOf(o.uuid)>-1?e=a:f.indexOf(o.uuid)>-1?e=s:b.indexOf(o.uuid)>-1&&(e=u));return e?i.options.filter(t=>e(t,i)):i.options}(n),t):NaN}d[1]=(t,e)=>e.number,d[14]=(t,e)=>l(t,e,"number",!0),d[15]=(t,e)=>l(t,e,"number",!1),d[2]=(t,e)=>e.text,d[12]=(t,e)=>l(t,e,"text",!0),d[13]=(t,e)=>l(t,e,"text",!1),d[3]=(t,e)=>e.value,d[4]=(t,e)=>l(t,e,"value",!0),d[5]=(t,e)=>l(t,e,"value",!1),d[6]=(t,e)=>e.sortNo,d[7]=(t,e)=>l(t,e,"sortNo",!0),d[8]=(t,e)=>l(t,e,"sortNo",!1),d[9]=(t,e)=>e.value,d[10]=(t,e)=>l(t,e,"value",!0),d[11]=(t,e)=>l(t,e,"value",!1)},function(t,e,n){"use strict";n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return p}));var r=n(5),i=n(10),o=n(8),c=n(27),a=n(9),s=n(50),u=n(1),l=n(7),d=n(68);function f(t){const e=Object(l.a)(t.result);t&&Object(c.c)(e)&&setTimeout(()=>{Object(i.d)(e)})}async function b(t,e){let n="";const{parsedPayload:{basicConfig:{collector:i}}}=t;if(!i)return;const{sampler_config:o}=i;o&&(n=o[e]||"");if(!n||0!==n.indexOf("BACKEND:"))return;const c=n.replace("BACKEND:",""),a={};for(const e of c){const[n,i]=e.split("=");a[n]=await Object(r.j)(i,t)}return a}function p(t,e){const{parsedPayload:{basicConfig:{collector:{sampler_config:n}}}}=e;if(!n||!n[t])return o.a.trigger("SAMPLER_TRANSFER",{method:"ABORT"}),Object(u.n)();const c=n[t];return 0===c.indexOf("BACKEND")?Object(u.n)():0===c.trim().indexOf("http")?async function(t,e,n){const c=await Object(r.j)(n,t,!0);Object(i.d)(c),o.a.trigger("SAMPLER_TRANSFER",{method:"LINK",url:c,type:e})}(e,t,c):async function(t,e,n){const c=n.indexOf(":"),l=n.substr(0,c).toUpperCase(),b=n.substr(c+1),p=b.indexOf("?");let O=-1===p?b:b.substr(0,p);O=await Object(r.j)(O,t,!0);let m={};if(-1!==p){const e=-1===p?"":b.substr(p);if(e){m=e?Object(i.e)(e):{};const n=Object.keys(m);for(const e of n){const n=m[e].match(/^{{(.+?)}}$/);n&&(m[e]=await Object(r.b)(n[1],t))}}}if("FAKE"===l){f(await Object(s.a)(O,Object(d.a)(m,t),t,!1,!1))}else if("GET"===l||"POST"===l){const t="GET"===l?"GET":"POST";try{f(await Object(a.q)(O,{type:t,data:m}))}catch(t){Object(u.c)("数据转移接口出错"+JSON.stringify(t))}}o.a.trigger("SAMPLER_TRANSFER",{url:O,data:m,method:l,type:e})}(e,t,c)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return b})),n.d(e,"b",(function(){return m})),n.d(e,"a",(function(){return g}));var r=n(35),i=n(4),o=n(1),c=n(0),a=n(7),s=n(26),u=n(25);const l={refresh:!1,result:!0},d={refresh:!0,result:!0},f={};function b(t,e,n){const{width:r,height:i}=e,o=n.value||"data:image/gif;base64,R0lGODlhAQABAAAAACw=";o&&Object(c.g)(t,{image:{name:void 0,ratio:Math.round(i/r*1e5)/1e5,url:o,natural:o,thumbnail:o,large:o,width:r,height:i,reformed:!0,id:"faked-id-for-upload-image",originName:"uploaded image"}})}function p(t,e){return Object(a.a)(t)!==Object(a.a)(e.value)}function O(t,e,n){return p(t,e)?(Object(c.g)(e,{value:t}),Object(s.c)(e,n),d):l}async function m(t,e,n){if(e.isOtherOpt)return O(t,e,n);{const i=f[n.type],o=i?await i(t,e,n):O(t,e,n);return o.noValidate||Object(r.b)(n,e),o}}function g(t,e,n){e.atcpTrigger=t,Object(r.b)(n,e)}f.icon_mark=(t,e,n)=>(t=t===e.value?t-1:t,Object(c.g)(e,{value:t}),Object(s.c)(e,n),Object(o.n)(d)),f.weight=(t,e,n)=>{if(!p(t,e))return Object(o.n)(l);const{options:r}=n,i=n.weightTotal,a=r.reduce((t,n)=>n!==e?t+Number(n.value):t,0),u=i-a;return t>u&&(t=u),Object(c.g)(e,{value:t}),r.forEach(t=>{const e=Number(t.value);Object(c.g)(t,{percent:e/i*100+"%"})}),Object(s.c)(e,n),Object(o.n)(d)},f.upload=async(t,e,n)=>{t||(t=Object(s.a)()),Object(c.g)(e,t),await async function(t){const{max:e}=await Object(i.g)(t),n=e===t.options.filter(e=>Object(u.b)(e,t)).length;Object(c.g)(t,{fullUploaded:n})}(n);return b(e,await Object(c.c)().ui.getImageSize(t.value),t),Object(s.c)(e,n),{refresh:!0,result:!0}},f.slide_rate=(t,e,n)=>{const r=O(t,e,n);return Object(s.c)(e,n),Object(o.n)(r)},f.fill=(t,e,n)=>{const r=O(t,e,n);return Object(o.n)(r)},f.sequence=(t,e,n)=>(Object(c.g)(e,{sortNo:t,selected:-1!==t}),Object(s.c)(e,n),Object(o.n)(d))},function(t,e,n){"use strict";n.d(e,"a",(function(){return w})),n.d(e,"b",(function(){return _}));var r=n(8),i=n(9),o=n(15),c=n(11),a=n(46),s=n(12),u=n(19),l=n(1),d=n(55),f=n(14),b=n(0),p=n(2),O=n(3),m=n(7);const g={valid:!0,message:""},j={valid:!1,message:""};let h=!1,y=!1,v=!1;function w(){h=!1,y=!1,v=!1}function _(t,e,n,w){const _=[];let I=w.prev;for(;I!==n;)_.push({prev:I,next:w}),I=(w=I).prev;return _.push({prev:I,next:w}),async function t(e,n,w){const _=w.pop(),I=await function(t,e,n,w){const _=n.checkMode,I=w.checkMode,k=w.type;"end"===k&&(clearInterval(t.timer),Object(b.g)(t,{limitTime:void 0}));if(Object(b.b)().preview)return Object(l.n)(e);if(_){if("end"===k)return async function(t,e,n){if(v)return j;Object(b.c)().network.closeSocket(),v=!0;const u=x(t,n);Object(s.m)(t,!0);try{const e=await Object(o.b)(t,"all","examine_skipped_url"),n=await Object(i.l)(e,t.transactionID);t.responseStatus=n.status}catch(e){const n=Object(m.a)(e&&e.message)||"";return n.includes(" _custom_abort_ ")?g:(Object(l.c)("skip提交失败 "+n),Object(b.b)().notify(Object(p.f)(O.a.global.tryAgain)),v=!1,Object(s.m)(t,!1),j)}r.a.trigger("CHECK_FAIL"),Object(b.c)().network.closeSocket();try{Object(f.b)(t),u||Object(c.f)(e,n,t),await Object(a.a)(t,n),Object(s.m)(t,!1),T(t),await Object(d.b)("examine_skipped_url",t)}catch(t){Object(l.c)("skip提交后续处理失败"+JSON.stringify(t))}return g}(t,n,w);if(!I)return async function(t){if(y)return j;y=!0,Object(s.m)(t,!0);const e=await Object(o.b)(t,"check","examine_skipped_url"),n=e.answers.length;try{const o=await Object(i.k)(e,t.transactionID);return Object(c.g)(t,n),Object(s.m)(t,!1),t.responseStatus=o.status,r.a.trigger("CHECK_SUBMIT"),g}catch(e){Object(f.b)(t),Object(s.m)(t,!1);const o=Object(i.d)(e);return o===i.a.quota_not_match||o===i.a.quota_full?(Object(c.v)(t,n),T(t),await Object(d.b)("examine_failed_url",t),t.responseStatus="examine_failed",r.a.trigger("QUOTA_FAIL"),Object(b.c)().network.closeSocket()):(y=!1,Object(l.c)(e.message),Object(b.b)().notify(Object(p.f)(O.a.global.tryAgain))),j}}(t)}if("end"===k)return async function(t,e,n){if(h)return j;Object(b.c)().network.closeSocket(),h=!0;const y=x(t,n)||function(t,e){const{renderList:n,startTime:r}=t,i=Math.ceil((Date.now()-r)/1e3),o=function(t,e){const n=Object(p.f)(O.a.global.notTarget),{minTime:r,timeLessText:i}=t;if(r&&r>e)return i||n;return""}(t,i);if(o){t.fakeCommitted=!0;const r=n[n.length-1];return Object(b.g)(r,{hasReward:!1,title:o}),Object(c.y)(e,t),!0}return!1}(t,n);Object(s.m)(t,!0);const v=await Object(o.b)(t,"normal","committed_url");let w;try{w=await Object(i.m)(v,t.transactionID);const e=w.response||w;t.responseStatus=e.status}catch(e){const n=Object(m.a)(e&&e.message)||"";return n.includes(" _custom_abort_ ")?g:(Object(l.c)("正式提交失败 "+n),Object(b.b)().notify(Object(p.f)(O.a.global.tryAgain)),Object(s.m)(t,!1),h=!1,j)}t.formalResult=w;try{await Object(a.a)(t,n),y?await Object(d.b)("invalid_url",t):(Object(c.i)(n,t,v.answers.length,w),w.reward&&Object(b.g)(n,{hasReward:!0}),await function(t,e){const{formalResult:{reward:n}}=e;if(!n||"red_envelope"!==n.type||n.lottery_id||Object(b.c)().app.canHandleReward())return Object(l.n)();return Object(u.a)(e,t)}(n,t),await Object(d.b)("committed_url",t))}catch(t){Object(l.c)("正式提交后续处理错误"+JSON.stringify(t))}return Object(f.b)(t),Object(s.m)(t,!1),T(t),r.a.trigger("FULL_SUBMIT"),await t.dynamicStateProps(),g}(t,0,w);return Object(l.n)(e)}(e,n,_.prev,_.next);return 0===w.length||"vital"===I.type?I:t(e,I,w)}(t,e,_)}function x(t,e){const{oneReplyPerTerminal:n,sid:r}=t;return!!e.abandonAnswer&&(t.fakeCommitted=!0,Object(c.a)(e,t),n&&Object(b.c)().storage.set(r,"1"),!0)}function T(t){const{oneReplyPerTerminal:e,sid:n}=t;e&&Object(b.c)().storage.set(n,"1")}},function(t,e,n){"use strict";n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return p}));var r=n(43),i=n(6),o=n(62),c=n(66),a=n(35),s=n(28),u=n(0),l=n(26);function d(t,e,n,r){t&&(Object(u.g)(t,{selected:!0}),e.forEach(e=>{e!==t&&Object(u.g)(e,{selected:!1})})),Object(u.g)(r,{value:n})}const f={};function b(t,e){const n=f[e.type],r=n?n(t,e):s.a;return r.noValidate||Object(a.b)(e),r}function p(t){return t.failed=!0,t.succeed=!1,t.failedSkip&&(t.failedSkipActivated=!0,t.autoSkip=!0),s.c}f.region=(t,e)=>{e.indexes=t;const n=Object(i.c)(e),c=Object(r.c)(t);d(Object(o.b)(n,c),n,c,e);const a=c.split("-"),u={country:"",province:a[0]||"",city:a[1]||"",district:a[2]||""};return e.parent.address=u,e.position={address:u},s.c},f.location=(t,e)=>{e.succeed=!0,e.failed=!1,e.failedSkipActivated=!1;const n=Object(c.b)(t.address,"-",e.infoRange),r=Object(i.c)(e);return d(Object(o.b)(r,n),r,n,e),Object(u.g)(e.parent,{point:t.point,address:t.address}),e.position=t,s.c},f.area=(t,e)=>{e.succeed=!0,e.failed=!1,e.failedSkipActivated=!1;const n=Object(c.b)(t.address,"-","street"),r=Object(i.c)(e);return d(Object(o.a)(r,t.point),r,n,e),Object(u.g)(e.parent,{point:t.point,address:t.address}),e.position=t,s.c},f.verify=(t,e)=>(Object(u.g)(e,t),{...s.c,noValidate:!0}),f.gift=(t,e)=>(Object(u.g)(e,t),s.d),f.heat_map=(t,e)=>{const n={x:Math.round(t.x),y:Math.round(t.y)},{options:r}=e,i=r[e.clickTimes%r.length];return Object(u.g)(i,{point:n,value:JSON.stringify(n)}),e.clickTimes+=1,Object(l.c)(i,e),s.d}},function(t,e,n){"use strict";n.d(e,"b",(function(){return w})),n.d(e,"c",(function(){return _})),n.d(e,"a",(function(){return x}));var r=n(4),i=n(24),o=n(33),c=n(18),a=n(5),s=n(10),u=n(1),l=n(0),d=n(2),f=n(28),b=n(58),p=n(8),O=n(11),m=n(3),g=n(29),j=n(9),h=n(64);let y=null;function v(){return JSON.parse(Object(l.c)().storage.get("theme")||"null")||Object(g.b)()}async function w(t,e,n=!1){let s;s=Object(l.b)().preview||!t.formalResult.reward?{}:t.formalResult.reward;const f=!!s.id||Object(l.b)().preview;let b,p,O={},g="",j={},h=1e3;if("gift"===e.type)b=e;else{const o=s.gift_id&&s.gift_id.toUpperCase();if(p=e,o)b=Object(r.a)(t.nodeList,o),g=((t,e,n)=>{if(!e)return"";const i=e.destList,o=e.options.find(e=>{const o=Object(r.c)(t,i,e.uuid);return Object(u.l)(o.nodeUuid,n)});return o?o.rewardName:""})(t.nodeList,p,b.nodeUuid);else{if(n)b={};else{const n=e.destList[0].destInputId;b=Object(r.b)(t.nodeList,n)}g=e.options[0].rewardName}j=((t,e,n=!1)=>{if(!e)return{};const r=Object(l.b)().realTimePreview?"":n?Object(d.f)(m.a.lottery.congratulation):Object(d.f)(m.a.lottery.pity),o=Object(l.b)().realTimePreview?"":n?Object(d.f)(m.a.lottery.goal):Object(d.f)(m.a.lottery.fail),c=n?e.success.imageWidth:e.fail.imageWidth,a=n?e.success.imageHeight:e.fail.imageHeight,s=n?e.success.imageName:e.fail.imageName,u={rewardTitle:(n?e.success.title:e.fail.title)||r,rewardDescribe:(n?e.success.summary:e.fail.summary)||o};return s&&(u.rewardImage=Object(i.b)({width:c,height:a,name:s,id:"",originName:""})),u})(0,p,f),h=((t,e,n,i=!1)=>{if(!e)return 1e3;const o=e.options,c=i?o[0]:o.find(i=>{const o=Object(r.c)(t.nodeList,e.destList,i.uuid);return Object(u.l)(o.nodeUuid,n.nodeUuid)});return c?c.rewardCount:1e3})(t,p,b,n)}if(f){const e=await Object(a.d)(b.activityName,{state:t}),n=await Object(a.d)(b.blessings,{state:t}),r=await Object(a.d)(b.describe,{state:t}),i=await Object(a.h)(b.linkUrl,{state:t});let u=s.code;u||!0!==b.needVerification||(u="1234567890"),O={goal:!0,goalId:s.id,origin:b,...b,...O,noWxShare:t.noWxShare,wxShareInfo:t.wxShareInfo,quesTitle:t.title,quesType:"reward",images:await Object(c.a)(t,b),rewardName:g,activityName:e,blessings:n,describe:r,linkUrl:i,endBtnText:b.endBtnText,rewardCount:b.giftCount,lotteryCount:h,sendTime:Object(o.c)(),verifyCode:u,rewardNodeId:b.nodeUuid,logoUrl:"",transactionID:t.transactionID,surveyId:t.surveyId,title:t.title,companyID:t.companyID,useCustomLogo:t.useCustomLogo,customText:t.customText,customLogo:t.customLogo,...j}}else O={goal:!1,...j};return Object(l.g)(t,{rewardInfo:O}),n||Object(l.c)().storage.set("reward_info",JSON.stringify(O)),O}function _(){y=null}async function x(){if(y)return y;let t;const e=v();Object(g.a)(e.client);const n=Object(s.c)();let r=function(t){const{rid:e,rtpl:n}=t;let r={};if(e)r={quesTitle:"",rewardType:"red_envelope",goalId:t.rid,images:[]};else{const t=Object(l.c)().storage.get("reward_info")||"null";r=JSON.parse(t),r.rewardType=r.giftType}n&&(r.template={id:n,name:"",component:null});return r}(n);const{rewardType:i,goalId:c}=r,a=n.code;if("red_envelope"===i){!n.rid||n.code||Object(l.b)().preview||(Object(l.c)().auth.authorizeGift(n.aid,n.cid,n),Object(l.b)().customAbort());const e=await Object(j.h)({code:a},c),{recipient:i}=e;n.rid&&(r=function(t,e,n){const{gift:r,amount:i,type:c}=e,{config:{gift_name:a}}=r;return{...t,surveyId:n.qid,transactionID:n.tid,nodeUuid:r.id,origin:{giftType:c},rewardCount:i/100,activityName:a,blessings:r.title,title:r.title,summary:r.description,describe:r.description,sendTime:Object(o.c)()}}(r,e,n));const s=i;a&&Object(l.c)().storage.set("gift-"+a,JSON.stringify(e)),Object(O.j)(r,{...r,userInfo:s});t={...await T(r),wechatImage:s.headimgurl,wechatID:s.nickname}}else t=await T(r);return y=t,await Object(l.c)().hook.afterFetchReward(t),t}async function T(t){const e=t.origin.giftType;let n=!1,r="",i="";"custom"===e?(n=!0===t.origin.needSendNote,r=t.verifyCode):i=t.rewardCount+" 元";const o=Object(l.c)().storage.get("language")||"en_us",c=v();t.template&&await Object(l.c)().ui.loadUiTemplates(c,[t.template.id]),await Object(d.g)(o),Object(d.d)(o),Object(g.d)(c);const a={...t,wechatID:"",wechatImage:"",eventHub:p.a,language:o,theme:c,rewardName:t.activityName,title:t.blessings,description:t.describe,summary:t.describe,nodeType:"reward",quesType:"reward",icon:"present-gift",rewardType:e,rewardTime:t.sendTime,rewardValue:i,rewardToMessage:n,qrCode:r,prevButton:Object(l.b)().preview&&!Object(l.b)().realTimePreview?Object(d.f)(m.a.global.backTest):"",nextButton:t.linkUrl&&(t.endBtnText||Object(d.f)(m.a.global.go)),handleEvents:{...h.a,handlePrevClick:()=>(Object(l.c)().app.gotoStartPage(Object(s.c)()),Object(u.n)()),handleOptionClick:async(t,e)=>(await Object(f.b)(t,e)).result,handleQuestionInput(t,e){const n=Object(b.b)(t,e);return Object(u.n)(n.result)},handleNextClick:()=>(t.linkUrl&&Object(s.d)(t.linkUrl),Object(u.n)())}};return a.template=await Object(l.c)().ui.initNodeTemplate(t.template,a,null),a}},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"c",(function(){return b}));var r=n(4),i=n(1),o=n(47),c=n(18),a=n(31),s=n(5),u=n(6);async function l(t,e){const n=await Object(c.e)(t,e,null,!0);return Object(a.b)(e,n)}function d(t,e,n=!1){const{loopStack:r}=e;return r.find((e,o)=>(!n||o===r.length-1)&&Object(i.l)(e.node.nodeUuid,t.nodeUuid))}async function f(t,e,n,r,i,o){const c=Object(u.i)(i),a={state:t,usage:{question:e,option:i}},l=await Object(s.f)(c.text,a,"WRAPPED_URL"),d=await Object(s.f)(i.text,a,"WRAPPED_URL"),f=await Object(s.f)(c.value+"",a,"WRAPPED_URL");return{loopNodeId:n,outerIndex:o&&o.currentIndex,outerLoopId:o&&o.node.nodeUuid,index:r,uuid:i.uuid,refOptId:i.refOptId,refText:l||void 0,text:d||"",value:f,number:c.number,image:c.image,label:i.label,mapping:i.isRef?c.mapping:i.mapping}}const b={_skip:(t,e,n)=>o.a.findNext(t,e,n),async _init(t,e,n){const{varList:o,loopStart:c,destList:a}=e;if(0===o.length)return b._skip(t,e,n);const{loopStack:s}=n,u=a.find(t=>Object(i.l)(t.selfPortId,c.uuid)).destInputId,l=Object(r.b)(t,u),d=o[0],{origin:p}=e,O=s[s.length-1],m=await f(n,e,p.nodeUuid,0,d,O),g={destInputId:u,node:p,varList:o,replacements:O?[...O.replacements,m]:[m],currentIndex:0};return s.push(g),{node:l,loop:Object(i.b)(g),loopStack:Object(i.b)(s)}},async _increase(t,e,n){const{nodeUuid:o}=e,{loopStack:c}=n,a=c[c.length-1],{varList:s,replacements:u,destInputId:l}=a,d=a.currentIndex+=1,b=s[d],p=c[c.length-2],O=await f(n,e,o,d,b,p),m=Object(r.b)(t,l);return u[u.length-1]=O,{node:m,loop:Object(i.b)(a),loopStack:Object(i.b)(c)}},async _end(t,e,n){const{loopStack:r}=n;r.pop();const c=await o.a.findNext(t,e,n);if(r.length>0){const t=Object(i.b)(r);c.loop=t[t.length-1],c.loopStack=t}return c},findNext(t,e,n){const r=d(e,n,!0);if(r){const{currentIndex:i,varList:o}=r;return i===o.length-1?b._end(t,e,n):b._increase(t,e,n)}return b._init(t,e,n)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));function r(t,e){return t.endsWith(".svg")?t:t+e}function i(t=[]){const e=[];return t.includes("video")&&e.push("video/*"),t.includes("audio")&&e.push("audio/*"),t.includes("image")&&e.push("image/*"),t.includes("doc")&&e.push("text/plain","application/json","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv",".docx",".pdf",".log"),e.join()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return c}));var r=n(66);function i(t,e){return t.find(t=>t.radius>=Object(r.a)(e,{lng:t.longitude,lat:t.latitude}))||t[t.length-1]}function o(t,e){if(0===t.length)return;const n=e.split("-");return t.find(t=>t.text.split("-").every((t,e)=>{const r=n[e];return!!(r&&r.indexOf(t)>-1)}))||t[t.length-1]}function c(t,e){const n=e.map(t=>t.Meaning).indexOf(t[0]);let r=String(n);const i=e[n];if(t[1]&&i){const e=i.cities.map(t=>t.Meaning).indexOf(t[1]);r+=" "+e;const n=i.cities[e];if(t[2]&&n){r+=""+n.counties.map(t=>t.Meaning).indexOf(t[1])}}return r}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(0),i=n(65);let o=[];function c(t){let e,n=t.code.replace(/<br>/g,"");n=`(function(){ /* embedApi.${t.name} */ ${n}})()`;try{return e=Object(i.a)(n,!0),e}catch(t){return()=>({result:"",message:""})}}function a(t){t&&(t.forEach(t=>{t.fn=c(t)}),o=t)}async function s(t,e,n){const i=function(t){const e=o.find(e=>e.id===t);return e?(e.fn||(e.fn=c(e)),e.fn):null}(t);let a;try{a=await i(e,Object(r.b)())}catch(e){const n=`EMBED ERROR:${function(t){const e=o.find(e=>e.id===t);return e?e.name:t}(t)} ${e.stack&&e.stack.split("\n")[0]}`;Object(r.b)().error(n)}return a}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r={handleInputPhone(t,e){return this.handleQuestionInput({phoneNumber:t},e)},handleInputCode(t,e){return this.handleQuestionInput({code:t},e)},handleAutoLocate(t,e){return this.handleQuestionInput(t,e)},handleManualLocate(t,e){return this.handleQuestionInput(t,e)},handleGetCodeClick(t){return this.handleOptionClick(null,t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0);function i(t,e){return new(0,Object(r.c)().system.functionConstructor)(`${e?"return":""} ${t}`)()}},function(t,e,n){"use strict";function r(t,e="-",n="street"){let r=t.province;return"province"!==n&&t.city&&(r+=e+t.city,"city"!==n&&t.district&&(r+=e+t.district,"county"!==n&&(t.street&&(r+=e+t.street),t.street_number&&(r+=t.street_number)))),r}function i(t){return t*(Math.PI/180)}function o(t,e){const n=i(e.lat-t.lat),r=i(e.lng-t.lng),o=Math.sin(n/2)*Math.sin(n/2)+Math.cos(i(t.lat))*Math.cos(i(e.lat))*Math.sin(r/2)*Math.sin(r/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))*1e3}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0);async function i(t){if("string"==typeof t){const e=Object(r.c)().system.decodeBase64(t),n=await Object(r.c)().system.inflate(e,{to:"string"});return JSON.parse(n)}return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c}));var r=n(5),i=n(0);function o(t,e){return{_LANG_:e.language,_LINK_TYPE_:Object(i.d)(),_IS_INFER_:Object(i.c)().dev.infer?"Y":"",...t}}async function c(t,e){const{params:n}=e,i={};for(const e of n){const{name:n,value:o}=e;n.startsWith("_url_")?i[n]=await Object(r.h)(o,{state:t}):n.startsWith("_html_")?i[n]=await Object(r.d)(o,{state:t},!0):i[n]=await Object(r.f)(o,{state:t,joinBy:","},"URL")}return o(i,t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const r={actions:[]};function i(t){r.actions.push(t)}},function(t,e,n){t.exports=function t(e,n,r){function i(c,a){if(!n[c]){if(!e[c]){if(o)return o(c,!0);var s=new Error("Cannot find module '"+c+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[c]={exports:{}};e[c][0].call(u.exports,(function(t){return i(e[c][1][t]||t)}),u,u.exports,t,e,n,r)}return n[c].exports}for(var o=!1,c=0;c<r.length;c++)i(r[c]);return i}({1:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(t[r]=n[r])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,c;for(r=0,e=0,n=t.length;e<n;e++)r+=t[e].length;for(c=new Uint8Array(r),i=0,e=0,n=t.length;e<n;e++)o=t[e],c.set(o,i),i+=o.length;return c}},c={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,o)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,c))},n.setTyped(r)},{}],2:[function(t,e,n){"use strict";var r=t("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var c=new r.Buf8(256),a=0;a<256;a++)c[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function s(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",c=0;c<e;c++)n+=String.fromCharCode(t[c]);return n}c[254]=c[254]=1,n.string2buf=function(t){var e,n,i,o,c,a=t.length,s=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new r.Buf8(s),c=0,o=0;c<s;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?e[c++]=n:n<2048?(e[c++]=192|n>>>6,e[c++]=128|63&n):n<65536?(e[c++]=224|n>>>12,e[c++]=128|n>>>6&63,e[c++]=128|63&n):(e[c++]=240|n>>>18,e[c++]=128|n>>>12&63,e[c++]=128|n>>>6&63,e[c++]=128|63&n);return e},n.buf2binstring=function(t){return s(t,t.length)},n.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,r,i,o,a=e||t.length,u=new Array(2*a);for(r=0,n=0;n<a;)if((i=t[n++])<128)u[r++]=i;else if((o=c[i])>4)u[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<a;)i=i<<6|63&t[n++],o--;o>1?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return s(u,r)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+c[t[n]]>e?n:e}},{"./common":1}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,c=0;0!==n;){n-=c=n>2e3?2e3:n;do{o=o+(i=i+e[r++]|0)|0}while(--c);i%=65521,o%=65521}return i|o<<16|0}},{}],4:[function(t,e,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(t,e,n){"use strict";var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var o=r,c=i+n;t^=-1;for(var a=i;a<c;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}},{}],6:[function(t,e,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(t,e,n){"use strict";e.exports=function(t,e){var n,r,i,o,c,a,s,u,l,d,f,b,p,O,m,g,j,h,y,v,w,_,x,T,I;n=t.state,r=t.next_in,T=t.input,i=r+(t.avail_in-5),o=t.next_out,I=t.output,c=o-(e-t.avail_out),a=o+(t.avail_out-257),s=n.dmax,u=n.wsize,l=n.whave,d=n.wnext,f=n.window,b=n.hold,p=n.bits,O=n.lencode,m=n.distcode,g=(1<<n.lenbits)-1,j=(1<<n.distbits)-1;t:do{p<15&&(b+=T[r++]<<p,p+=8,b+=T[r++]<<p,p+=8),h=O[b&g];e:for(;;){if(b>>>=y=h>>>24,p-=y,0==(y=h>>>16&255))I[o++]=65535&h;else{if(!(16&y)){if(0==(64&y)){h=O[(65535&h)+(b&(1<<y)-1)];continue e}if(32&y){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}v=65535&h,(y&=15)&&(p<y&&(b+=T[r++]<<p,p+=8),v+=b&(1<<y)-1,b>>>=y,p-=y),p<15&&(b+=T[r++]<<p,p+=8,b+=T[r++]<<p,p+=8),h=m[b&j];n:for(;;){if(b>>>=y=h>>>24,p-=y,!(16&(y=h>>>16&255))){if(0==(64&y)){h=m[(65535&h)+(b&(1<<y)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(w=65535&h,p<(y&=15)&&(b+=T[r++]<<p,(p+=8)<y&&(b+=T[r++]<<p,p+=8)),(w+=b&(1<<y)-1)>s){t.msg="invalid distance too far back",n.mode=30;break t}if(b>>>=y,p-=y,w>(y=o-c)){if((y=w-y)>l&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(_=0,x=f,0===d){if(_+=u-y,y<v){v-=y;do{I[o++]=f[_++]}while(--y);_=o-w,x=I}}else if(d<y){if(_+=u+d-y,(y-=d)<v){v-=y;do{I[o++]=f[_++]}while(--y);if(_=0,d<v){v-=y=d;do{I[o++]=f[_++]}while(--y);_=o-w,x=I}}}else if(_+=d-y,y<v){v-=y;do{I[o++]=f[_++]}while(--y);_=o-w,x=I}for(;v>2;)I[o++]=x[_++],I[o++]=x[_++],I[o++]=x[_++],v-=3;v&&(I[o++]=x[_++],v>1&&(I[o++]=x[_++]))}else{_=o-w;do{I[o++]=I[_++],I[o++]=I[_++],I[o++]=I[_++],v-=3}while(v>2);v&&(I[o++]=I[_++],v>1&&(I[o++]=I[_++]))}break}}break}}while(r<i&&o<a);r-=v=p>>3,b&=(1<<(p-=v<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=o<a?a-o+257:257-(o-a),n.hold=b,n.bits=p}},{}],8:[function(t,e,n){"use strict";var r=t("../utils/common"),i=t("./adler32"),o=t("./crc32"),c=t("./inffast"),a=t("./inftrees");function s(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):-2}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):-2}function f(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,d(t))):-2}function b(t,e){var n,r;return t?(r=new u,t.state=r,r.window=null,0!==(n=f(t,e))&&(t.state=null),n):-2}var p,O,m=!0;function g(t){if(m){var e;for(p=new r.Buf32(512),O=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,O,0,t.work,{bits:5}),m=!1}t.lencode=p,t.lenbits=9,t.distcode=O,t.distbits=5}function j(t,e,n,i){var o,c=t.state;return null===c.window&&(c.wsize=1<<c.wbits,c.wnext=0,c.whave=0,c.window=new r.Buf8(c.wsize)),i>=c.wsize?(r.arraySet(c.window,e,n-c.wsize,c.wsize,0),c.wnext=0,c.whave=c.wsize):((o=c.wsize-c.wnext)>i&&(o=i),r.arraySet(c.window,e,n-i,o,c.wnext),(i-=o)?(r.arraySet(c.window,e,n-i,i,0),c.wnext=i,c.whave=c.wsize):(c.wnext+=o,c.wnext===c.wsize&&(c.wnext=0),c.whave<c.wsize&&(c.whave+=o))),0}n.inflateReset=d,n.inflateReset2=f,n.inflateResetKeep=l,n.inflateInit=function(t){return b(t,15)},n.inflateInit2=b,n.inflate=function(t,e){var n,u,l,d,f,b,p,O,m,h,y,v,w,_,x,T,I,k,N,E,S,L,C,P,M=0,R=new r.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(n=t.state).mode&&(n.mode=13),f=t.next_out,l=t.output,p=t.avail_out,d=t.next_in,u=t.input,b=t.avail_in,O=n.hold,m=n.bits,h=b,y=p,L=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(2&n.wrap&&35615===O){n.check=0,R[0]=255&O,R[1]=O>>>8&255,n.check=o(n.check,R,2,0),O=0,m=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&O)<<8)+(O>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&O)){t.msg="unknown compression method",n.mode=30;break}if(m-=4,S=8+(15&(O>>>=4)),0===n.wbits)n.wbits=S;else if(S>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<S,t.adler=n.check=1,n.mode=512&O?10:12,O=0,m=0;break;case 2:for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(n.flags=O,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=O>>8&1),512&n.flags&&(R[0]=255&O,R[1]=O>>>8&255,n.check=o(n.check,R,2,0)),O=0,m=0,n.mode=3;case 3:for(;m<32;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.head&&(n.head.time=O),512&n.flags&&(R[0]=255&O,R[1]=O>>>8&255,R[2]=O>>>16&255,R[3]=O>>>24&255,n.check=o(n.check,R,4,0)),O=0,m=0,n.mode=4;case 4:for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.head&&(n.head.xflags=255&O,n.head.os=O>>8),512&n.flags&&(R[0]=255&O,R[1]=O>>>8&255,n.check=o(n.check,R,2,0)),O=0,m=0,n.mode=5;case 5:if(1024&n.flags){for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.length=O,n.head&&(n.head.extra_len=O),512&n.flags&&(R[0]=255&O,R[1]=O>>>8&255,n.check=o(n.check,R,2,0)),O=0,m=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((v=n.length)>b&&(v=b),v&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,u,d,v,S)),512&n.flags&&(n.check=o(n.check,u,v,d)),b-=v,d+=v,n.length-=v),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===b)break t;v=0;do{S=u[d+v++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&v<b);if(512&n.flags&&(n.check=o(n.check,u,v,d)),b-=v,d+=v,S)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===b)break t;v=0;do{S=u[d+v++],n.head&&S&&n.length<65536&&(n.head.comment+=String.fromCharCode(S))}while(S&&v<b);if(512&n.flags&&(n.check=o(n.check,u,v,d)),b-=v,d+=v,S)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(O!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}O=0,m=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;m<32;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}t.adler=n.check=s(O),O=0,m=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=b,n.hold=O,n.bits=m,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){O>>>=7&m,m-=7&m,n.mode=27;break}for(;m<3;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}switch(n.last=1&O,m-=1,3&(O>>>=1)){case 0:n.mode=14;break;case 1:if(g(n),n.mode=20,6===e){O>>>=2,m-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}O>>>=2,m-=2;break;case 14:for(O>>>=7&m,m-=7&m;m<32;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if((65535&O)!=(O>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&O,O=0,m=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(v=n.length){if(v>b&&(v=b),v>p&&(v=p),0===v)break t;r.arraySet(l,u,d,v,f),b-=v,d+=v,p-=v,f+=v,n.length-=v;break}n.mode=12;break;case 17:for(;m<14;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(n.nlen=257+(31&O),O>>>=5,m-=5,n.ndist=1+(31&O),O>>>=5,m-=5,n.ncode=4+(15&O),O>>>=4,m-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;m<3;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.lens[A[n.have++]]=7&O,O>>>=3,m-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},L=a(0,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,L){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;T=(M=n.lencode[O&(1<<n.lenbits)-1])>>>16&255,I=65535&M,!((x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(I<16)O>>>=x,m-=x,n.lens[n.have++]=I;else{if(16===I){for(P=x+2;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(O>>>=x,m-=x,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}S=n.lens[n.have-1],v=3+(3&O),O>>>=2,m-=2}else if(17===I){for(P=x+3;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}m-=x,S=0,v=3+(7&(O>>>=x)),O>>>=3,m-=3}else{for(P=x+7;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}m-=x,S=0,v=11+(127&(O>>>=x)),O>>>=7,m-=7}if(n.have+v>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;v--;)n.lens[n.have++]=S}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,C={bits:n.lenbits},L=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,L){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},L=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,L){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(b>=6&&p>=258){t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=b,n.hold=O,n.bits=m,c(t,y),f=t.next_out,l=t.output,p=t.avail_out,d=t.next_in,u=t.input,b=t.avail_in,O=n.hold,m=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;T=(M=n.lencode[O&(1<<n.lenbits)-1])>>>16&255,I=65535&M,!((x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(T&&0==(240&T)){for(k=x,N=T,E=I;T=(M=n.lencode[E+((O&(1<<k+N)-1)>>k)])>>>16&255,I=65535&M,!(k+(x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}O>>>=k,m-=k,n.back+=k}if(O>>>=x,m-=x,n.back+=x,n.length=I,0===T){n.mode=26;break}if(32&T){n.back=-1,n.mode=12;break}if(64&T){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&T,n.mode=22;case 22:if(n.extra){for(P=n.extra;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.length+=O&(1<<n.extra)-1,O>>>=n.extra,m-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;T=(M=n.distcode[O&(1<<n.distbits)-1])>>>16&255,I=65535&M,!((x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(0==(240&T)){for(k=x,N=T,E=I;T=(M=n.distcode[E+((O&(1<<k+N)-1)>>k)])>>>16&255,I=65535&M,!(k+(x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}O>>>=k,m-=k,n.back+=k}if(O>>>=x,m-=x,n.back+=x,64&T){t.msg="invalid distance code",n.mode=30;break}n.offset=I,n.extra=15&T,n.mode=24;case 24:if(n.extra){for(P=n.extra;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.offset+=O&(1<<n.extra)-1,O>>>=n.extra,m-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===p)break t;if(v=y-p,n.offset>v){if((v=n.offset-v)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}v>n.wnext?(v-=n.wnext,w=n.wsize-v):w=n.wnext-v,v>n.length&&(v=n.length),_=n.window}else _=l,w=f-n.offset,v=n.length;v>p&&(v=p),p-=v,n.length-=v;do{l[f++]=_[w++]}while(--v);0===n.length&&(n.mode=21);break;case 26:if(0===p)break t;l[f++]=n.length,p--,n.mode=21;break;case 27:if(n.wrap){for(;m<32;){if(0===b)break t;b--,O|=u[d++]<<m,m+=8}if(y-=p,t.total_out+=y,n.total+=y,y&&(t.adler=n.check=n.flags?o(n.check,l,y,f-y):i(n.check,l,y,f-y)),y=p,(n.flags?O:s(O))!==n.check){t.msg="incorrect data check",n.mode=30;break}O=0,m=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;m<32;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(O!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}O=0,m=0}n.mode=29;case 29:L=1;break t;case 30:L=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=b,n.hold=O,n.bits=m,(n.wsize||y!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&j(t,t.output,t.next_out,y-t.avail_out)?(n.mode=31,-4):(h-=t.avail_in,y-=t.avail_out,t.total_in+=h,t.total_out+=y,n.total+=y,n.wrap&&y&&(t.adler=n.check=n.flags?o(n.check,l,y,t.next_out-y):i(n.check,l,y,t.next_out-y)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===h&&0===y||4===e)&&0===L&&(L=-5),L)},n.inflateEnd=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},n.inflateGetHeader=function(t,e){var n;return t&&t.state?0==(2&(n=t.state).wrap)?-2:(n.head=e,e.done=!1,0):-2},n.inflateSetDictionary=function(t,e){var n,r=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?-2:11===n.mode&&i(1,e,r,0)!==n.check?-3:j(t,e,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(t,e,n){"use strict";var r=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,n,s,u,l,d,f){var b,p,O,m,g,j,h,y,v,w=f.bits,_=0,x=0,T=0,I=0,k=0,N=0,E=0,S=0,L=0,C=0,P=null,M=0,R=new r.Buf16(16),A=new r.Buf16(16),D=null,U=0;for(_=0;_<=15;_++)R[_]=0;for(x=0;x<s;x++)R[e[n+x]]++;for(k=w,I=15;I>=1&&0===R[I];I--);if(k>I&&(k=I),0===I)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(T=1;T<I&&0===R[T];T++);for(k<T&&(k=T),S=1,_=1;_<=15;_++)if(S<<=1,(S-=R[_])<0)return-1;if(S>0&&(0===t||1!==I))return-1;for(A[1]=0,_=1;_<15;_++)A[_+1]=A[_]+R[_];for(x=0;x<s;x++)0!==e[n+x]&&(d[A[e[n+x]]++]=x);if(0===t?(P=D=d,j=19):1===t?(P=i,M-=257,D=o,U-=257,j=256):(P=c,D=a,j=-1),C=0,x=0,_=T,g=l,N=k,E=0,O=-1,m=(L=1<<k)-1,1===t&&L>852||2===t&&L>592)return 1;for(;;){h=_-E,d[x]<j?(y=0,v=d[x]):d[x]>j?(y=D[U+d[x]],v=P[M+d[x]]):(y=96,v=0),b=1<<_-E,T=p=1<<N;do{u[g+(C>>E)+(p-=b)]=h<<24|y<<16|v|0}while(0!==p);for(b=1<<_-1;C&b;)b>>=1;if(0!==b?(C&=b-1,C+=b):C=0,x++,0==--R[_]){if(_===I)break;_=e[n+d[x]]}if(_>k&&(C&m)!==O){for(0===E&&(E=k),g+=T,S=1<<(N=_-E);N+E<I&&!((S-=R[N+E])<=0);)N++,S<<=1;if(L+=1<<N,1===t&&L>852||2===t&&L>592)return 1;u[O=C&m]=k<<24|N<<16|g-l|0}}return 0!==C&&(u[g+C]=_-E<<24|64<<16|0),f.bits=k,0}},{"../utils/common":1}],10:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(t,e,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(t,e,n){"use strict";var r=t("./zlib/inflate"),i=t("./utils/common"),o=t("./utils/strings"),c=t("./zlib/constants"),a=t("./zlib/messages"),s=t("./zlib/zstream"),u=t("./zlib/gzheader"),l=Object.prototype.toString;function d(t){if(!(this instanceof d))return new d(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,e.windowBits);if(n!==c.Z_OK)throw new Error(a[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==c.Z_OK))throw new Error(a[n])}function f(t,e){var n=new d(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}d.prototype.push=function(t,e){var n,a,s,u,d,f=this.strm,b=this.options.chunkSize,p=this.options.dictionary,O=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?c.Z_FINISH:c.Z_NO_FLUSH,"string"==typeof t?f.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(b),f.next_out=0,f.avail_out=b),(n=r.inflate(f,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&p&&(n=r.inflateSetDictionary(this.strm,p)),n===c.Z_BUF_ERROR&&!0===O&&(n=c.Z_OK,O=!1),n!==c.Z_STREAM_END&&n!==c.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&n!==c.Z_STREAM_END&&(0!==f.avail_in||a!==c.Z_FINISH&&a!==c.Z_SYNC_FLUSH)||("string"===this.options.to?(s=o.utf8border(f.output,f.next_out),u=f.next_out-s,d=o.buf2string(f.output,s),f.next_out=u,f.avail_out=b-u,u&&i.arraySet(f.output,f.output,s,u,0),this.onData(d)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(O=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==c.Z_STREAM_END);return n===c.Z_STREAM_END&&(a=c.Z_FINISH),a===c.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c.Z_OK):a!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),f.avail_out=0,!0)},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===c.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=d,n.inflate=f,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},n.ungzip=f},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")},function(t,e,n){"use strict";n.d(e,"a",(function(){return _})),n.d(e,"b",(function(){return T}));var r=n(4);function i(t,e,n,i,o){return o||(o=Object(r.c)(t,e,n.uuid)),o||i.parentRandomId||e.length&&(o=Object(r.b)(t,e[e.length-1].destInputId)),o}var o=n(6),c=n(1);const a=["weight","slide_rate","upload","value_mark","icon_mark","fill","sequence"],s={findNext(t,e){const{destList:n,output:s}=e,u=a.indexOf(e.type)>-1?e.otherOptions:Object(o.c)(e),l=u&&u.find(t=>t.selected),d=l&&Object(r.c)(t,n,l.uuid);return Object(c.n)({node:i(t,n,s,e,d)})}},u={async findNext(t,e,n){const{destList:i}=e,c=Object(o.j)(e);let a=c&&Object(r.c)(t,i,c.uuid);return a||(a=(await s.findNext(t,e,n)).node),a||!i.length||e.parentRandomId||(a=Object(r.b)(t,i[0].destInputId)),{node:a}}};var l=n(47),d=n(21);const f={async findNext(t,e){const{options:n,logicType:i,output:o,outputN:c,destList:a,parent:s}=e,u=await Object(d.b)(s,n,i);e.logicResult=u;const l=u?o:c;return{node:Object(r.c)(t,a,l.uuid)}}};var b=n(14);function p(t,e){const{destList:n,randomStart:i}=e,o={};n.forEach((e,n)=>{if(Object(c.l)(e.selfPortId,i.uuid)){const i=Object(r.b)(t,e.destInputId).groupNumber||"N/A_"+n,a=o[i];if(a){const t=Object(c.f)(a.length+1);a.splice(t,0,e.destInputId)}else o[i]=[e.destInputId]}});const a=function(t,e){const{customDestCount:n}=e;if(!n||n>=t.length)return t;for(;t.length>n;)t.splice(Object(c.f)(t.length),1);return t}(Object.keys(o),e);let s=[];for(;a.length>0;){const t=Object(c.f)(a.length);s=s.concat(o[a[t]]),a.splice(t,1)}return s}const O={_init(t,e,n){const{origin:i}=e;let o=p(t,e);!function(t,e){const{customNodeCount:n,parent:{nodeList:i},origin:o}=e;o.csNcDone||n&&(t.forEach(t=>{const e=[];let o=Object(r.b)(i,t);for(;o;)e.push(o),o=Object(r.c)(i,o.destList,o.output.uuid);for(;e.length>n;){const t=Object(c.f)(e.length);e[t].randomAbandoned=!0,e.splice(t,1)}}),o.csNcDone=!0)}(o,e),o=Object(b.h)(o,e);let a=[];e.random&&(a=e.random.stack.concat(e.random));const s={stack:a,node:i,destPortIds:o,currentIndex:0};return n.push(s),Object(c.n)({node:Object(r.b)(t,o[0]),random:{...s}})},_increase(t,e){e.currentIndex+=1;const{currentIndex:n,destPortIds:i}=e;return Object(c.n)({node:Object(r.b)(t,i[n]),random:{...e}})},_end:(t,e,n)=>l.a.findNext(t,e,n),findNext(t,e,n){const{randomList:r}=n,{nodeUuid:i}=e,o=r.find(t=>Object(c.l)(t.node.nodeUuid,i));if(o){const{currentIndex:r,destPortIds:i}=o;return r===i.length-1?O._end(t,e,n):O._increase(t,o)}return O._init(t,e,r)}};var m=n(60);const g={findNext(t,e){const{destList:n,output:o,options:a,otherOptions:s}=e,u=[...a.filter(t=>t.selected).sort((t,e)=>t.cascadePath.length<e.cascadePath.length?1:-1),...s.filter(t=>t.selected)];let l;for(const e of u)if(l=Object(r.c)(t,n,e.uuid),l)break;return Object(c.n)({node:i(t,n,o,e,l)})}};var j=n(17);const h={cascade:g,logic:f,loop:m.c,sequence:u,random:O};["describe","check","end","start","verify","data","max_diff"].forEach(t=>{h[t]=l.a});function y(t){const e=h[t.type];if(!e)throw new Error("lack next rules for this type of node...");return e}["weight","slide_rate","upload","value_mark","icon_mark","fill","select_image","select","region","location","lottery","matrix","menu","area","select_icon","hot_spot","heat_map"].forEach(t=>{h[t]=s});const v=["check","break_point"];function w(t,e){return"loop"===t.type?!Object(m.a)(t,e):v.indexOf(t.type)<0}function _(t,e,n){return T(t,{origin:n,...n},e)}function x(t,e,n,i){const{node:o,loop:a,random:s}=i,u=e.random;if(o){const t=e.loop,{loopStack:n}=e;!a&&t&&Object(r.l)(o,e)&&(i.loopStack=n,i.loop=t),o.parentRandomId&&u&&!s&&(i.random=u)}else if(u){const e=Object(c.h)(u.node.nodeUuid,n.loopStack);return T(t,Object(j.a)(n.renderList,e),n)}return Object(c.n)(i)}async function T(t,e,n){let r,i,o=y(e),c=!0;for(;c&&(i=await x(t,e,n,await o.findNext(t,e,n)),r=i.node,r);)w(r,n)?c=!1:(e={origin:r,parent:n,...r,...i},o=y(r));return i}},function(t,e,n){"use strict";n.d(e,"b",(function(){return R})),n.d(e,"a",(function(){return A}));var r=n(4),i=n(1),o=n(6),c=n(32),a=n(5),s=n(0),u=n(36),l=n(23),d=n(7),f=n(62);async function b(t,e){const n={};t.sortNo&&(n.sortNo=-1),t.selected&&(n.selected=!1),t.value&&(n.value=""),await Object(l.d)(t,e),Object(s.g)(t,n)}async function p(t){const{video:e,options:n,otherOptions:r}=t;e&&Object(s.g)(e,{ended:!0});let i=[];n&&(i=[...i,...n]),r&&(i=[...i,...r]);for(const e of i)await b(e,t);const{cascade:o}=t;o&&await async function t(e,n){Object(s.g)(e,{selected:!1}),await Object(l.d)(e.option,n),e.list&&e.list.forEach(e=>t(e,n))}(o,t)}const O={doc:"os/client/o_1dn9kbm3u1f4d1tsudcg1fuh17678.txt",image:"os/client/o_1dn9kbq468tj1kq2dt3qeo1pumd.png",video:"os/client/o_1dn9kpohua8v1jv51oobq981dvv8.mp4",audio:"os/client/o_1dn9l7gbs1maj1e3nn941e6p125gj.mp3"},m={};function g(t){const{regions:e}=t,n=t.infoRange||"county",r=function(t){const e=x(Object(o.c)(t),1)[0];return!e||e.isOtherOpt?null:e.inferList.some(t=>t.active)?e:null}(t);if(r){const t=r.text.split("-");return{address:t,indexes:Object(f.c)(t,e),point:{lat:r.latitude,lng:r.longitude}}}{const t=Object(i.f)(e.length);let r=Object(d.a)(t);const o=e[t],c=[o.Meaning,"",""];if("province"!==n){const t=Object(i.f)(o.cities.length),e=o.cities[t];if(c[1]=e.Meaning,r=r+" "+t,"city"!==n){const t=Object(i.f)(e.counties.length),n=e.counties[t];n&&(c[2]=n.Meaning,r=r+" "+t)}}return{address:c,indexes:r,point:{lng:0,lat:0}}}}async function j(t,e){const{value:n}=await Object(c.b)(t,e);if(n)return"__FORCE_EMPTY__"===n?"":n;const{fileLimits:r}=t,o=Object(i.p)(r,1)[0];return O[o]}async function h(t,e){const n=[],r=[];t.forEach(t=>{Object(o.n)(t)?n.push(t):r.push(t)}),await T(r,e,1);const c=Object(i.g)(1,n.length);w(n,e,c)}async function y(t,e){const{parent:n,inputInferLimit:r}=e;let o=await Object(a.e)(e.fillMin,{state:n});o=o||0;let c=t.length;o&&r>o&&r<c&&(c=r);const s=o?Object(i.g)(o,c):c;return Object(i.p)(t,s)}async function v(t,e){t.parent.context.option=e;const n=await Object(c.a)(e,t);return t.parent.context.option=null,await t.parent.handleEvents.handleOptionInput(n,e,t)}function w(t,e,n){Object(i.p)(t,n).forEach(t=>v(e,t))}async function _(t,e){if(await t.parent.handleEvents.handleOptionClick(e,t),e.useComment)return v(t,e)}function x(t,e){const n=Object(l.b)(t,"select"),r=[],o=[];if(n.forEach(t=>{t.inferList.every(t=>0===Number(t.weight))||t.disabled?r.push(t):o.push(t)}),o.length>0)return Object(l.h)(o,e);{let n=t.filter(t=>!t.disabled);return r.length>0&&(n=t.filter(t=>!r.includes(t))),Object(i.p)(n,e)}}async function T(t,e,n){const r=x(t,n).sort((t,e)=>-1===t.mutexNumber||(t.mutexNumber||0)>(e.mutexNumber||0)?1:-1);for(const t of r)await _(e,t)}async function I(t,e){const{multiple:n,min:r,max:o,list:c}=t;if(!c)return;const a=function(t,e){const n=Object(l.a)(t);return n.length>0?Object(l.g)(n,e):Object(i.p)(t,e)}(c,n?Object(i.g)(r||1,o||1):1);for(const n of a){const r=c.indexOf(n);await e.parent.handleEvents.handleCascadeClick(r,t,e),await I(n,e)}}async function k(t){const e=Object(o.c)(t);let n=1;if(Object(r.s)(t)){const e=await Object(r.e)(t),{min:o}=e;let{max:c}=e;const{selectInferLimit:a}=t;a>o&&a<c&&(c=a),n=Object(i.g)(o||1,c)}const c=[],a=[];e.forEach(t=>{Object(o.n)(t)?a.push(t):c.push(t)}),await T(c,t,n);const s=Object(i.g)(1,a.length);w(a,t,s)}function N(t,e){const n=[];for(let r=t;r<=e;r++)n.push(r);return n}async function E(t,e,n){const r=[...n].sort(),{value:o,antis:a}=await Object(c.b)(t,e,1);if(o){if("__FORCE_EMPTY__"===o)return"0";{const t=r[0],e=r[r.length-1];return o<t?t:o>e?e:o}}{const t=()=>Object(i.p)(n,1)[0];return Object(c.f)(t,a)}}function S(t){let[e,n]=t.split("~").map(t=>Number(t));return e>n&&([n,e]=[e,n]),[e,n]}function L(t,e,n){const[r,o]=t.split("_");let c,a;if(r.includes("~")){const[t,e]=S(r);c=Object(i.g)(t,e)}else c=Math.min(Math.max(Number(r),0),e);if(o.includes("~")){const[t,e]=S(o);a=Object(i.g)(t,e)}else a=Math.min(Math.max(Number(o),0),n);return{x:c,y:a}}function C(t,e){const[n,r]=t.split("_").map(t=>Number(t)),[i,o]=e.split("_");let c=!1,a=!1;if(i.includes("~")){const[t,e]=S(i);c=t<=n&&n<=e}else c=Number(i)===n;if(o.includes("~")){const[t,e]=S(o);a=t<=r&&r<=e}else a=Number(o)===r;return c&&a}async function P(t,e){const{value:n,antis:r}=await Object(c.b)(t,e,1),{mapImgHeight:o,mapImgWidth:a}=e;if(n)return"__FORCE_EMPTY__"===n?null:L(n,a,o);{const t=()=>Object(i.f)(a)+"_"+Object(i.f)(o);return L(await Object(c.f)(t,r,C),a,o)}}function M(t,e){let n=e.filter(e=>!(-1!==e.sortNo||!e.inferList)&&e.inferList.some(e=>{if(!e.active)return!1;const n=Object(l.c)(e.candidates),r=Object(l.f)(n,1);return r.length>0&&Number(r[0].text)<=t}));0===n.length&&(n=e.filter(t=>-1===t.sortNo));const r=Object(i.p)(n,1)[0];r&&Object(s.g)(r,{sortNo:t,selected:!0})}async function R(t){return await Object(c.g)(),A(t)}async function A(t,e){const{type:n,readonly:r}=t;if(r)return Object(u.d)();await p(t),e&&e.beforeInfer&&await e.beforeInfer(t);const i=m[n]||k;await i(t),e&&e.afterInfer&&await e.afterInfer(t)}m.select=k,m.value_mark=async t=>{const{options:e,otherOptions:n}=t,r=await y(e,t);for(const e of r){const n=e.minValue||1,r=e.maxValue||5,i=await E(e,t,N(n,r).map(t=>Object(d.a)(t)));await t.parent.handleEvents.handleOptionInput(i,e,t)}await h(n,t)},m.heat_map=async t=>{const{options:e,otherOptions:n}=t;for(const n of e){const e=await P(n,t);e&&await t.parent.handleEvents.handleQuestionInput(e,t)}await h(n,t)},m.icon_mark=async t=>{const{options:e,otherOptions:n}=t,r=await y(e,t);for(const e of r){const n=1,r=e.count||5,i=await E(e,t,N(n,r).map(t=>Object(d.a)(t)));await t.parent.handleEvents.handleOptionInput(i,e,t)}await h(n,t)},m.slide_rate=async t=>{const{options:e,rateOptions:n,otherOptions:r}=t,i=await y(e,t),o=n.map(t=>t.value);for(const e of i){const n=await E(e,t,o);await t.parent.handleEvents.handleOptionInput(n,e,t)}await h(r,t)},m.weight=async t=>{let{weightTotal:e}=t;const{options:n,otherOptions:r}=t;e<=0&&(e=100);const o=[],c=[];n.forEach(t=>{const{inferList:e}=t;if(e){e.some(t=>t.active)?o.push(t):c.push(t)}else c.push(t)});const a=[];for(const n of o){const r=n.inferList.filter(t=>t.active),i=await Object(l.e)(r,t),o=Object(l.c)(i),c=Object(l.f)(o,1),s=Number(c[0].text);a.push(s),e-=s}const s=Object(i.o)(e,c.length),u=a.concat(s),d=o.concat(c);for(const[e,n]of d.entries()){const r=u[e];await t.parent.handleEvents.handleOptionInput(r.toString(),n,t)}await h(r,t)},m.fill=async t=>{const{options:e,otherOptions:n}=t,r=await y(e,t);for(const e of r)await v(t,e);await h(n,t)},m.sequence=async t=>{const{options:e,otherOptions:n}=t,r=e.length;let i=1;for(;i<=r;)M(i,e),i+=1;e.sort((t,e)=>t.sortNo>e.sortNo?1:-1),await h(n,t),Object(u.d)()},m.cascade=async t=>{const{cascade:e,otherOptions:n}=t;return await I(e,t),h(n,t)},m.describe=()=>(Object(u.d)(),Object(i.n)()),m.max_diff=async t=>{const e=function(t){const e=[],{options:n,itemCountPerTask:r,taskCount:i}=t,o=Math.ceil(i*r/n.length);return t.options.forEach(t=>{if(!t.inferList)return;let n=t.inferList.reduce((t,e)=>{if(e.active){t+=e.candidates.split(",").map(t=>Number(t)||0).reduce((t,e)=>t+e,0)}return t},0);n>o?n=o:n<-o&&(n=-o),n&&e.push({needValue:n,option:t})}),e}(t),{tasks:n,parent:{handleEvents:r}}=t;for(const o of n){let n=o.items.find(t=>e.find(e=>{const n=e.option===t.option&&e.needValue>0;return n&&(e.needValue-=1),n})),c=o.items.find(t=>e.find(e=>{const n=e.option===t.option&&e.needValue<0;return n&&(e.needValue+=1),n}));if(!n){const t=o.items.filter(t=>e.every(e=>e.option!==t.option));n=Object(i.p)(t,1)[0]}if(!c||c===n){const t=o.items.filter(t=>e.every(e=>e.option!==t.option)&&t!==n);c=Object(i.p)(t,1)[0]}await r.handleMaxDiffInput(1,n,o,t),await r.handleMaxDiffInput(-1,c,o,t)}},m.upload=async t=>{const{options:e,otherOptions:n}=t,{min:o,max:c}=await Object(r.g)(t),a=Object(i.g)(o||1,c),s=Object(i.p)(e,a);for(const e of s)await t.parent.handleEvents.handleOptionInput({name:await j(e,t)},e,t);await h(n,t)},m.region=t=>{const{indexes:e}=g(t);return t.parent.handleEvents.handleQuestionInput(e,t)},m.location=t=>{const{address:e,point:n}=g(t),r={address:{province:e[0],city:e[1],district:e[2],country:""},point:{lat:n.lat||Number(Object(c.c)(0,90)),lng:n.lng||Number(Object(c.c)(0,180))}};return t.parent.handleEvents.handleQuestionInput(r,t)},m.area=m.location,m.matrix=async t=>{const{options:e,flatten:n,otherOptions:o}=t,{min:c,max:a}=await Object(r.e)(t);if(Object(r.v)(t))await T(e,t,1);else if(Object(r.q)(t)){const e=[];for(const r of n){if(r.list.filter((t,n)=>!e.includes(n)).length>0){const n=x(r.list,1)[0];n&&(await _(t,n),e.push(r.list.indexOf(n)))}}}else if(Object(r.r)(t)||Object(r.p)(t))for(const e of n)await T(e.list,t,1);else if(Object(r.o)(t)||Object(r.n)(t))for(const e of n){const n=Object(i.g)(c||1,a);await T(e.list,t,n)}else if(Object(r.m)(t)){const n=Object(i.g)(c||1,a);await T(e,t,n)}await h(o,t)},m.end=()=>Object(i.n)(),m.verify=t=>t.parent.handleEvents.handleQuestionInput({phoneNumber:Object(c.d)(),code:Object(c.e)("number")},t)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(2);function o(){return{headimgurl:"https://media.choiceform.com/fresh_little_girl.jpg",nickname:Object(i.f)(r.a.reward.weChatName)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(35),i=n(0),o=n(26);function c(t,e,n){if(void 0===t||void 0===e)return{refresh:!1,result:[]};const{options:c}=n,a=c.length;e>a&&(e=a);const s=c.splice(t,1)[0];s&&(Object(i.g)(s,{selected:!0}),c.splice(e,0,s));const u=n.options.filter(t=>!t.selected);1===u.length&&Object(i.g)(u[0],{selected:!0});const l=[];return c.forEach((t,e)=>{t.selected&&(Object(i.g)(t,{sortNo:e+1}),l.push(e+1))}),Object(r.b)(n),Object(o.c)(s,n),{refresh:!0,result:l}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0);function i(t,e){Object(r.g)(t,{value:e});const{option:n}=t;n.records.find(e=>e.round===t.round).value=e,Object(r.g)(n,{value:n.records.reduce((t,e)=>t+e.value,0)})}function o(t,e,n,o){if(e.value===t)return{result:!0};i(e,t),n.items.forEach(t=>{t!==e&&t.value===e.value&&i(t,0)});const c=n.items.some(t=>1===t.value),a=n.items.some(t=>-1===t.value);return Object(r.g)(n,{done:c&&a}),{result:!0}}}]));
|
|
1
|
+
!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=53)}([function(t,e,n){"use strict";n.d(e,"f",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"e",(function(){return d})),n.d(e,"b",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"g",(function(){return p})),n.d(e,"a",(function(){return O}));var r=n(8),i=n(1);let o,c=null,a=null,s=Object(i.a)(()=>r.a.trigger("SET_PROPS"),150);function u(t){a=t}function l(){if(!a)throw new Error("Env not yet initialized");return a}function d(t){c=t,c.silentSetter&&(s=null)}function f(){if(!c)throw new Error("Client not yet initialized");return c}function b(){return f().realTimePreview?"realtime_preview":f().preview?"preview":"formal"}function p(t,e){t&&e&&(o(t,e),s&&s())}function O(t){o=t}r.a.on("ERROR_ABORT",(t,e)=>{f().error(e)})},function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"t",(function(){return c})),n.d(e,"k",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"h",(function(){return u})),n.d(e,"i",(function(){return l})),n.d(e,"s",(function(){return d})),n.d(e,"l",(function(){return f})),n.d(e,"g",(function(){return b})),n.d(e,"f",(function(){return p})),n.d(e,"p",(function(){return O})),n.d(e,"m",(function(){return m})),n.d(e,"o",(function(){return g})),n.d(e,"b",(function(){return j})),n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"r",(function(){return w})),n.d(e,"n",(function(){return _})),n.d(e,"j",(function(){return x}));var r=n(7);const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");function o(t){return t.replace(/</g,"_-v-w^l-t-_").replace(/>/g,"^-v-w_g-t-^")}function c(t){return t.replace(/_-v-w\^l-t-_/g,"<").replace(/\^-v-w_g-t-\^/g,">")}function a(t,e){return e}function s(t=1,e=5){const n=b(t,e),r=i.length;let o="";for(let t=0;t<n;t++){const t=b(0,r);o+=i[t]}return o}function u(t,e){return e&&e.forEach(e=>{t+="-"+d(e.varList[e.currentIndex].uuid)}),t}function l(){const t=new Array(36);let e,n=0;for(let r=0;r<36;r++)8==r||13==r||18==r||23==r?t[r]="-":14==r?t[r]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),e=15&n,n>>=4,t[r]=i[19==r?3&e|8:e]);return t.join("").toLowerCase()}function d(t){return t.substr(t.length-8)}function f(t="",e=""){return t=t.toLowerCase(),e=e.toLowerCase(),8===t.length&&e.length>8?t===d(e):t.length>8&&8===e.length?d(t)===e:t===e}function b(t,e){return t>e&&([t,e]=[e,t]),t+p(e-t+1)}function p(t){return Math.floor(Math.random()*t)}function O(t,e){const n=[...t];if(Object(r.b)(e))return n;if(0===(e=Number(e)))return[];if(e<0||isNaN(e))return n;if(1===e)return n.splice(p(n.length),1);const i=[];for(n.length<e&&(e=n.length);i.length<e;){const t=p(n.length);i.push(n.splice(t,1)[0])}return i}function m(t,e){t&&"object"==typeof t&&Object.keys(t).forEach(n=>{const r=t[n];Array.isArray(r)&&r.forEach(t=>{m(t,e)}),"object"==typeof r&&m(r,e),e(t,n)})}function g(t,e){if(t<e)throw new Error("can not random distribute");const n=function(t,e){const n=[];for(;n.length<e;){const e=b(1,t-1);n.includes(e)||n.push(e)}return n.sort((t,e)=>t>e?1:-1),n}(t,e-1),r=n.map((t,e)=>t-(n[e-1]||0));return r.push(t-n[n.length-1]),r}function j(t){const e=new WeakMap;return function t(n){if(!n||"object"!=typeof n)return n;if(n instanceof Array)return n.map(e=>t(e));const r=e.get(n);if(r)return r;const i={};return e.set(n,i),Object.keys(n).forEach(e=>{i[e]=t(n[e])}),i}(t)}function h(t){setTimeout(()=>{throw"string"==typeof t?new Error(t):t})}function y(t,e=0){let n=-1;return function(){const r=arguments,i=this;clearTimeout(n),n=setTimeout(()=>{t.apply(i,r)},e)}}async function v(t,e,n){const r=[];t.replace(e,(t,...e)=>(r.push(n(t,...e)),t));const i=await Promise.all(r);return t.replace(e,()=>i.shift())}function w(t=0){return new Promise(e=>setTimeout(e,t))}function _(t){return Promise.resolve(t)}function x(t){return t instanceof Promise?t:_(t)}},function(t,e,n){"use strict";n.d(e,"g",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"b",(function(){return p})),n.d(e,"f",(function(){return O}));var r=n(8),i=n(3),o=n(0),c=n(9);let a=!1;const s=["zh_cn","en_us"];async function u(t){const e=i.d();let n=e[t=t.toLowerCase()];n||(n=e[t="zh_cn"]);if(!i.c()[t]){let e;try{e=await Object(c.b)(n,{type:"GET"})}catch(t){e=await Object(c.b)(n.replace(".com/",".io/"),{type:"GET"})}i.g(t,e)}}function l(t,e){let n=Object(o.c)().storage.get("language")||function(){const t=Object(o.c)().system.getLang();return t?t.replace(/-/g,"_").toLowerCase():"zh_cn"}();if(t&&e){t.some(t=>t.id===n)||(n=e)}return n}function d(t,e){t!==Object(o.c)().storage.get("language")&&(b(t,!0),e&&Object(o.c)().storage.set("lang-resume","true"),Object(o.c)().hook.beforeForceLeave(),Object(o.c)().app.reload())}function f(t){let e="zh_cn";s.includes(t)&&(e=t),i.h(e),Object(o.b)().setLocale(e),r.a.trigger("LANG_CHANGE"),Object(o.c)().hook.onLangChange(e)}function b(t="zh_cn",e=!1){return Object(o.c)().storage.set("language",t),e||f(t),a=!0,t}function p(t){return t.replace(/\{(\w+),.+?(\w+)\}\s?\}/g,(t,e,n)=>`{${e}} ${n}`)}function O(t,e){a||a||b(l());const n=i.e(t);return n?e?Object(o.c)().system.translate(n,e):n:`missing translation for ${t} ${i.b()}`}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"f",(function(){return u})),n.d(e,"d",(function(){return l})),n.d(e,"c",(function(){return d})),n.d(e,"g",(function(){return f})),n.d(e,"h",(function(){return b})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return O}));const r={en_us:"https://media.choiceform.com/os-client-core/assets/en_us-8617c82e.json",zh_cn:"https://media.choiceform.com/os-client-core/assets/zh_cn-477e771a.json"};let i=!1,o=new Proxy({},{get(){throw new Error("Cannot access LANG before initializing")}}),c="zh_cn";const a={},s=(t,e,n)=>{const r=n||{};return Object.keys(t).forEach(i=>{const o=t[i],c=e?e+"."+i:i;r[i]="string"==typeof o?c:s(t[i],c,n&&n[i])}),r};function u(t){t&&Object.keys(t).forEach(e=>{r[e.toLowerCase()]=t[e]})}function l(){return{...r}}function d(){return{...a}}function f(t,e){i||(o=s(e,"",{}),i=!0),a[t]=e}function b(t){c=t.toLowerCase()}function p(){return c}function O(t){const e=a[c];if(!e)throw new Error("cannot translate before lang loading");try{const n=t.split(".");let r=n.shift(),i=e[r];for(;"object"==typeof i;)r=n.shift(),i=i[r];return i}catch(t){console.error(t)}return""}},function(t,e,n){"use strict";n.d(e,"i",(function(){return d})),n.d(e,"u",(function(){return f})),n.d(e,"f",(function(){return b})),n.d(e,"d",(function(){return p})),n.d(e,"b",(function(){return O})),n.d(e,"c",(function(){return m})),n.d(e,"s",(function(){return g})),n.d(e,"v",(function(){return j})),n.d(e,"r",(function(){return h})),n.d(e,"p",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"m",(function(){return w})),n.d(e,"o",(function(){return _})),n.d(e,"n",(function(){return x})),n.d(e,"g",(function(){return T})),n.d(e,"e",(function(){return I})),n.d(e,"j",(function(){return N})),n.d(e,"k",(function(){return E})),n.d(e,"a",(function(){return S})),n.d(e,"y",(function(){return L})),n.d(e,"z",(function(){return P})),n.d(e,"w",(function(){return M})),n.d(e,"l",(function(){return R})),n.d(e,"h",(function(){return A})),n.d(e,"x",(function(){return D})),n.d(e,"t",(function(){return U}));var r=n(6),i=n(1),o=n(5),c=n(2),a=n(0),s=n(3);const u={valid:!0,message:""},l=["region","location","area","describe","end","logic","loop","lottery","verify"];function d(t){return!0===t.answerRequired}function f(t){return"matrix"===t.type?function(t){const{randomType:e}=t;return"col"===e||"row_col"===e||"row"===e}(t):!0===t.randomOptionY}function b(t){const e=t.loopStack,n=t.nodeUuid;return Object(i.h)(n,e)}function p(t){return t.find(t=>"start"===t.type)}function O(t,e){if(e)return t.find(t=>t.input&&Object(i.l)(t.input.uuid,e)||t.loopEnd&&Object(i.l)(t.loopEnd.uuid,e))}function m(t,e,n){const r=e.find(t=>Object(i.l)(t.selfPortId,n));if(r&&r.destInputId)return O(t,r.destInputId)}function g(t){return"matrix"===t.type?"multi"===t.matrixSelect:!0===t.multiSelect}function j(t){return"matrix"===t.type?"single"===t.matrixSelect:!0!==t.multiSelect}function h(t){return"single_row"===t.matrixSelect}function y(t){return"single_col"===t.matrixSelect}function v(t){return"single_row_col"===t.matrixSelect}function w(t){return g(t)&&"all"===t.multiType}function _(t){return g(t)&&"row"===t.multiType}function x(t){return g(t)&&"col"===t.multiType}async function T(t){const e=!0===t.limitEnabled,{parent:n}=t;let r=e?await Object(o.e)(t.maxUploadCount,{state:n}):t.options.length,i=e?await Object(o.e)(t.minUploadCount,{state:n}):1;const c=t.options.length;return i||(i=1),r||(r=c),i>c&&(i=c),i>r&&(i=r),{max:r,min:i}}async function I(t){if(!g(t))return{min:1,max:1};const e="matrix"===t.type,{multiMin:n,multiMax:i}=t,{parent:c}=t;let a=await Object(o.e)(n,{state:c}),s=await Object(o.e)(i,{state:c});const u=Object(r.c)(t).length;return e||(a=function(t,e){const n={};Object(r.c)(t).forEach(t=>{Object(r.n)(t)||(n[t.mutexNumber]?n[t.mutexNumber]+=1:n[t.mutexNumber]=1)});const i=Object.keys(n).reduce((t,e)=>("0"===e||"undefined"===e?t+=n[e]:Number(e)<10&&(t+=1),t),0);return e>i&&(e=i),e}(t,a)),a||(a=1),s||(s=u),a>u&&(a=u),a>s&&(a=s),{min:a,max:s}}const k=(t,e,n,r)=>{let i=0;i=r?t.filter(t=>t[r]===e[r]&&t.selected).length:t.filter(t=>t.selected).length;const o=i<n;let a="";return o||(a=r?"xid"===r?Object(c.f)(s.a.matrix.colLimitMax,{max:n}):Object(c.f)(s.a.matrix.rowLimitMax,{max:n}):Object(c.f)(s.a.select.limitMax,{max:n})),{valid:o,message:a}};async function N(t,e){if(!g(t)||-1===e.mutexNumber||-1===e.xMutexNumber||-1===e.yMutexNumber)return u;const n=w(t);if(!n&&!Object(r.o)(e))return u;const i=Object(r.c)(t),{max:o}=await I(t);return n?k(i,e,o):x(t)?k(i,e,o,"xid"):_(t)?k(i,e,o,"yid"):u}async function E(t,e){if(!g(t))return u;const{max:n}=await I(t),i=Object(r.c)(t).filter(t=>t.selected).length===n,{mutexNumber:o}=e,a=!i||-1===o||Object(r.m)(t,o);return{valid:a,message:a?"":Object(c.f)(s.a.select.limitMax,{max:n})}}function S(t,e){return t.find(t=>Object(i.l)(t.nodeUuid,e))}const L=["logic","random","loop"],C=[...L,"data"];function P(t){Object(a.b)().preview&&t.autoSkip&&t.parent.previewShadowNodes&&!C.includes(t.type)&&(t.shadowNodes=!0,t.readonly=!0)}function M(t){if(t.forceSkipReason)return t.forceSkipReason;if("data"===t.type)return"data_hidden";if(t.autoSkip)return function(t){return Object(a.b)().preview&&t.parent.previewShadowNodes&&!C.includes(t.type)}(t)?"":"setting";if(t.randomAbandoned)return"random_group";const e=Object(r.c)(t);return!(l.indexOf(t.type)>-1)&&e&&0===e.length?"no_options":""}function R(t,e){return!(!t.circleNode1Id&&!t.circleNode2Id)&&(Object(i.l)(t.circleNode1Id,e.circleNode1Id)&&Object(i.l)(t.circleNode2Id,e.circleNode2Id))}async function A(t){const{parent:e,options:n}=t;let r=await Object(o.e)(t.total,{state:e})||100,i=0;for(const t of n){const n=await Object(o.e)(t.maxMark,{state:e});if(void 0===n){i=-1;break}i+=n}return i>0&&i<r&&(r=i),r}const D=["end","lottery","gift"];function U(t,e){return!(!t||!e)&&(!D.includes(t.type)&&!D.includes(e.type)&&(t.groupSingle&&e.groupSingle&&function(t,e){return!(!t.groupId||!e.groupId||e.groupId!==t.groupId)&&(!e.loop&&!t.loop||!(e.loop&&!t.loop||!e.loop&&t.loop||e.loop.destInputId!==t.loop.destInputId||e.loop.currentIndex!==t.loop.currentIndex))}(t,e)))}},function(t,e,n){"use strict";n.d(e,"i",(function(){return y})),n.d(e,"d",(function(){return T})),n.d(e,"f",(function(){return k})),n.d(e,"k",(function(){return N})),n.d(e,"h",(function(){return S})),n.d(e,"c",(function(){return L})),n.d(e,"g",(function(){return C})),n.d(e,"e",(function(){return P})),n.d(e,"b",(function(){return M})),n.d(e,"j",(function(){return R})),n.d(e,"a",(function(){return A}));var r=n(65);function i(t){let e=!0;try{e=!!Object(r.a)(t,!0)}catch(e){console.info("error bool: ",t)}return e}function o(t,e,n){return function(t,e,n){return!!(e.length&&""!==n&&t&&t[t.length-1].match(/[\d)]/))}(t,e,n)&&(t+=e[e.length-1]),t+n}function c(t){return"("===t[t.length-1]&&(t+="0"),t+")"}var a=n(1),s=n(46),u=n(38),l=n(40),d=n(13),f=n(42),b=n(16),p=n(22),O=n(0),m=n(34),g=n(7),j=n(10);function h(t){return t&&("var-html"===t.type||"var-request"===t.type||"var-loop"===t.type)}function y(t="",e=!1){if(t=(t=w(t,e)).replace(/</g,"<").replace(/>/g,">"),e)for(;t.indexOf("<")>-1||t.indexOf(">")>-1;)t=t.replace(/</g,"<").replace(/>/g,">");return t}function v(t=""){return t.replace(/</g,"<").replace(/>/g,">")}function w(t="",e=!1){if(t=t.replace(/&/g,"&"),e)for(;t.indexOf("&")>-1;)t.replace(/&/g,"&");return t}function _(t="",e,n,r,i){let o='<span var-name="'+n+'" class="var-light '+e+('"'+(r?'in-edist="1">':">"))+t+"</span>";return i&&(o=Object(a.d)(o)),o}function x(t=""){t.match(/<(\w+).+?<\/\1>/)||(t=`<span>${t}</span>`);return Object(m.c)(t).children}async function T(t="",e,n=!1){t+="";const{state:r,innerJoinBy:i,varInfo:o,usage:c}=e,s=e.spaceRep||"";t=w(t.replace(/ /g,s));const u=e.joinBy||" ";if(Object(d.j)(t)){const s=Object(d.l)(t),f=Object(d.i)(t,s);for(const t of f){const e=Object(d.f)(r,t);let a="";if(e?a=await L({state:r,varInfo:e,joinBy:i||u}):Object(O.b)().realTimePreview&&(a=_(t.getInnerHtml(),"var-empty",t.getText(),!1,!0)),a=Object(g.b)(a)?"":Object(g.a)(a).trim(),c){const n=e||{mapId:Object(d.c)(Object(d.g)(t))};Object(l.d)(c,n,a)}const s=!o&&e&&a&&!n;let f=[];h(e)?(s&&(a=_(a,e.type,e.name,e.inEdist,!1)),f=a?x(a):[""]):(s&&(a=_(a,e.type,e.name,e.inEdist,!0)),t.setText(a),f=[new m.b(t.getInnerHtml())]),I(t,f)}return E(function(t,e,n=""){if(h(e))return y(t.getInnerHtml());let r="";if(n){const i=[];for(const n of t.children){let t="";if(Object(a.k)(n,"node"===n.type)){if("span"===n.name&&!n.getText()&&0===n.children.length)continue;t=n.getOuterHtml()}else t=n.getText().trim(),e||(t=v(t));t&&i.push(w(t))}r=i.join(n)}else r=w(t.getInnerHtml());return r=r.replace(/([\r\n]|^\s*|\s*$)/g,"").replace(/<br>/g,""),r=w(Object(a.t)(r)),r}(s,o,u),e)}return t+""}function I(t,e){const n=t.parent;e.forEach(e=>{if("string"==typeof e){if(""!==e){const r=new m.b(e);n.insertBefore(r,t)}}else n.insertBefore(e,t)}),n.removeChild(t)}async function k(t="",e,n="NAME"){return E(N(await T(t,e,!0),n),e)}function N(t="",e="NAME"){if(!t||"string"!=typeof t)return t;t=t.replace(/<style>.*?<\/style>/g,"");let n=Object(d.l)(t).getText();return n=Object(d.l)(n).getText(),"NAME"===e?n=Object(f.c)(n):"URL"===e&&(n=Object(f.d)(n)),n.trim()}function E(t,e){return","===e.joinBy?(t+"").trim().replace(/(?:^\s*,|\s*,\s*,\s*|\s*,$)/,""):t}async function S(t="",e){let n=await T(t,{...e,innerJoinBy:","},!0);return n=N(y(n,!0)),n=n.replace(/####/g,"|").replace(/##/g,"").replace(/\s+/g,""),n=E(n,e),n}function L(t){const{varInfo:e}=t;return e.getText?e.getText(t):e.nodePart||e.question?Object(d.e)(t):"var-string"===e.type?function(t){const{varInfo:e}=t;if(e.getText)return e.getText(t);return T(e.value,t)}(t):"var-expression"===e.type?async function(t){const e=Object(p.a)(),{varInfo:n,state:i}=t;let a="";const s=Object(d.l)(n.value).children,u=[];let l="";for(const t of s)if(Object(d.k)(t)){if(l){const t=parseFloat(l);if(isNaN(t))return t;a=o(a,u,t),l=""}const n=Object(d.f)(i,t);if(n){const t=n.split;if(n.uuid===e.EXP_OP.uuid)a+="(";else if(n.uuid===e.EXP_CP.uuid)a=c(a);else if(t)a=o(a,u,n.expOpr),u.push(t);else if(n.expOpr)u.length&&(a=c(a),u.pop()),a=o(a,u,n.expOpr);else{const t=u[u.length-1],e=await L({state:i,varInfo:n,joinBy:t||"+"})||0;a=o(a,u,e)}}else l+="0"}else l+=t.getText().replace(/\s/g,"");l&&(a=o(a,u,parseFloat(l)));for(;u.length;)a=c(a),u.pop();return function(t){let e=0;try{e=Object(r.a)(t,!0)}catch(n){e=NaN,console.info("error exp: ",t)}return e}(a)}(t):"var-media"===e.type?async function(t){const{varInfo:e,state:n}=t,{imgSize:r}=e,i=t.joinBy||" ",o=Object(d.i)(e.value),c=[];for(const t of o){const e=Object(d.f)(n,t);if(!e)continue;r&&(e.imgSize=r);const o=await L({state:n,varInfo:e,joinBy:i});Object(g.b)(o)||c.push(o)}return c.join(i)}(t):"var-bool"===e.type?async function(t){const{varInfo:e,state:n}=t;if(e.getBool)return e.getBool(t);const{nodePart:r,question:o}=e;if(r||o)return Object(d.d)(t);const c=Object(d.i)(e.value);let a="";for(const e of c){const r=Object(d.f)(n,e);if(r)if(r.blOpr)a+=r.blOpr;else if(r.getBool)a+=i(await r.getBool(t))?"1":"0";else{const t=await L({state:n,varInfo:r});a+="string"==typeof t?"0"===t?t:t?"1":"0":i(t)?"1":"0"}}return i(a)}(t):"var-request"===e.type?async function(t){const{varInfo:{request:e,paramConfig:n},state:r}=t;if(e){let t=null;if(n){t=JSON.parse(n);for(const e of Object.keys(t))t[e]=await k(t[e],{state:r,joinBy:","},"URL")}const{result:i}=await Object(s.c)(r,e,t,!1,!1);return"string"!=typeof i?i:Object(u.a)(i)}return""}(t):"var-html"===e.type?async function(t){const{varInfo:e,state:n}=t,r=e.getText?await e.getText(t):await T(e.value,t),i=Object(u.a)(y(r));return await function(t,e,n){const r=t?JSON.parse(t):{};return Object(a.q)(e,/{{{?(.+?)}}}?/g,async(t,e)=>{const i=e.indexOf("=");let o=e,c="";i>-1&&(o=e.substr(0,i),c=e.substr(i+1));const a=r[o]||"";let s="";return a&&(s=t.startsWith("{{{")?await T(a,{state:n}):await k(a,{state:n},"URL")),s||c})}(e.paramConfig,i,n)}(t):Object(a.n)("")}async function C(t="",e,n=!1){if("number"==typeof t)return t;if(Object(g.b)(t))return n?NaN:"";const r=Number(t);if(isNaN(r)){const r=await k(t,e);if(Object(g.b)(r))return n?NaN:"";const i=Number(r);return isNaN(i)?n?NaN:r:i}return r}async function P(t="",e){if("number"==typeof t)return t;const n=await C(t,e,!0);return Number(n)}async function M(t,e){if(t.match(/key(?:\d+)?/))return Object(j.c)()[t];{const n=Object(b.c)(t);if(n){return N(await L({varInfo:n,state:e,joinBy:","}))}return""}}function R(t="",e,n=!1){if(Object(g.b)(t))return Object(a.n)("");return Object(a.q)(Object(g.a)(t),/{{(.+?)}}/g,async(t,r)=>{let i=await M(r,e);return i&&n&&(i=encodeURIComponent(i)),""+(i||"")})}function A(t=""){return t.replace(/(?:^<div>|<\/div>$)/g,"")}},function(t,e,n){"use strict";n.d(e,"h",(function(){return c})),n.d(e,"a",(function(){return a})),n.d(e,"m",(function(){return s})),n.d(e,"n",(function(){return u})),n.d(e,"l",(function(){return l})),n.d(e,"f",(function(){return d})),n.d(e,"k",(function(){return f})),n.d(e,"c",(function(){return b})),n.d(e,"b",(function(){return p})),n.d(e,"d",(function(){return O})),n.d(e,"j",(function(){return m})),n.d(e,"o",(function(){return g})),n.d(e,"g",(function(){return j})),n.d(e,"i",(function(){return h})),n.d(e,"p",(function(){return y})),n.d(e,"e",(function(){return v}));var r=n(1),i=n(5),o=n(25);function c(t,e){const n=t.loopStack,i=e.uuid;return Object(r.h)(i,n)}function a(t,e){return t.find(t=>Object(r.l)(t.uuid,e))}function s(t,e){if(!e)return!1;return b(t).some(t=>t.selected&&t.mutexNumber===e)}function u(t){return"comment"===t.optionType}function l(t){return b(t).some(t=>t.selected)}function d(t){return b(t).filter(e=>Object(o.b)(e,t)).length}function f(t){return b(t).some(e=>Object(o.b)(e,t))}function b(t){let e=[];const{options:n,otherOptions:r}=t;return n&&(e=[...e,...n]),r&&(e=[...e,...r]),e}function p(t){let e=b(t);const{hiddenOptions:n}=t;return n&&(e=[...e,...n]),e}function O(t){const{renderOptionsX:e,renderOptionsY:n,otherOptions:r}=t;return e.concat(n,r)}function m(t){const{options:e}=t,n=e.find(t=>!0===t.seqTarget);return n&&n.selected?t.origin.options[n.sortNo-1]:t.output}function g(t){return!!t.yid&&!!t.xid}async function j(t,e){const{parent:n}=e;return{itemsMax:await Object(i.e)(t.itemsMax,{state:n}),itemsMin:await Object(i.e)(t.itemsMin,{state:n})}}function h(t){return t.passRef||{}}function y(t,e){const n=h(t);return t[e]||n[e]}function v(t){if(!t.assistValue)return"";return Object.keys(t.assistValue).reduce((e,n)=>(t.assistValue[n]&&(e+=t.assistValue[n])&&(e+=" "),e),"")}},function(t,e,n){"use strict";function r(t){return o(t)?"":String(t)}function i(t){if(o(t))return"";const e=Number(t);return isNaN(e)?t:e}function o(t){return t instanceof Array?0===t.length:"boolean"!=typeof t&&0!==t&&!t}n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return u}));var r=n(0),i=n(1);let o,c={};const a={on(t,e){c[t]||(c[t]=[]),c[t].push(e)},off(t,e){t||(c={}),c[t]&&(c[t]=e?c[t].filter(t=>t!==e):[])},one(t,e){const n=r=>{e(r),a.off(t,n)};a.on(t,n)},trigger(t,e={}){if(c[t])try{c[t].forEach(n=>n({type:t,...e,data:e},e))}catch(t){Object(i.c)(t)}}};function s(t){"gift"!==t.type&&(a.trigger("ANSWER_CHANGE",t),t.dynamicNodeProps())}function u(t,e=!1){a.trigger("SWITCH_NODE",t),t!==o&&(o=t,e&&Object(r.c)().hook.onSwitchPage())}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return b})),n.d(e,"r",(function(){return p})),n.d(e,"d",(function(){return O})),n.d(e,"c",(function(){return m})),n.d(e,"p",(function(){return g})),n.d(e,"q",(function(){return j})),n.d(e,"f",(function(){return h})),n.d(e,"g",(function(){return y})),n.d(e,"k",(function(){return v})),n.d(e,"l",(function(){return w})),n.d(e,"m",(function(){return _})),n.d(e,"j",(function(){return x})),n.d(e,"o",(function(){return T})),n.d(e,"h",(function(){return I})),n.d(e,"n",(function(){return k})),n.d(e,"i",(function(){return N})),n.d(e,"e",(function(){return E}));var r=n(10),i=n(2),o=n(0),c=n(3),a=n(1),s=n(69),u=n(73);let l="";const d={diagram_has_errors:"diagram_has_errors",survey_not_exist:"survey_not_exist",survey_offline:"survey_offline",oauth_error:"oauth_error",interviewee_missing_error:"interviewee_missing_error",interviewee_invalid_error:"interviewee_invalid_error",multi_responses_error:"multi_responses_error",quota_full:"quota_full",quota_not_match:"quota_not_match",red_envelope_duplicated:"red_envelope_duplicated",red_envelope_expired:"red_envelope_expired",red_envelope_received_by_yourself:"red_envelope_received_by_yourself",red_envelope_received_by_others:"red_envelope_received_by_others",red_envelope_intercepted:"red_envelope_intercepted",red_envelope_send_error:"red_envelope_send_error"},f=[400,401,402,403,404,405,422,500];async function b(t,e){try{const r=await Object(o.c)().network.request(t,e);if((n=r).status>=200&&n.status<300)return function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}(r.response);throw r}catch(t){throw t}var n}function p(t){t&&f.includes(t.status)||Object(o.b)().error(Object(i.f)(c.a.global.downloadError))}function O(t){const e=JSON.parse(t&&t.response||"{}");return e&&f.includes(e.status)?e.code+"":""}function m(t){const e=O(t);e!==l&&e&&(d[e]?Object(o.b)().error(E(e)):Object(o.b)().notify(E(e)))}async function g(t,e={type:"GET"}){try{return await b(t,e)}catch(n){throw m(n),Object(a.c)(`api error: ${e.type}:${t} ${JSON.stringify(n)}`),n}}function j(t,e={type:"GET"}){return g(t,e={...e,contentType:"application/json"})}function h(t){if(Object(o.b)().preview)return async function(t){if("00000000-0000-0000-0000-000000000000"===t)return{smaller_diagram_url:"http://localhost:12345/unit_test_payload.json"};const e=Object(r.c)(),n=e.type;let i=Object(o.b)().hostConfig.qApiHost+"/surveys/"+t+"/preview";"preview_template"===n?i=Object(o.b)().hostConfig.host+"/v1/public_templates/"+t:"edit_template"===n&&(i=Object(o.b)().hostConfig.host+"/v1/templates/"+t);const c=await j(i,{type:"GET",jwt:e.jwt}),{diagram:a}=c;return{smaller_diagram_url:c.diagram_url||a.diagram_url,langs:c.langs}}(t);const e=Object(o.c)().auth.retrieveAuthMeta();if(e)return Object(a.n)(e);return j(Object(o.b)().hostConfig.qApiHost+"/surveys/"+t,{type:"GET"}).catch(t=>{throw p(t),t})}function y(t){const e=Object(o.b)().hostConfig.qApiHost+"/responses";return l=d.multi_responses_error,j(e,{type:"POST",data:t}).then(t=>(l="",t)).catch(()=>{l=""})}function v(t,e){return j(Object(o.b)().hostConfig.qApiHost+"/responses/"+e+"/examine",{type:"PUT",data:t})}function w(t,e){return j(Object(o.b)().hostConfig.qApiHost+"/responses/"+e+"/skip",{type:"PUT",data:t})}function _(t,e){return j(Object(o.b)().hostConfig.qApiHost+"/responses/"+e,{type:"PUT",data:t})}async function x(t){if(Object(o.b)().preview)return Object(o.b)().notify(Object(i.f)(c.a.preview.noMessage)),{};const e=Object(o.b)().hostConfig.qApiHost+"/validations";t.question_id=t.question_id.toLowerCase();const n=await j(e,{type:"POST",data:t});return t.phone_num&&Object(o.b)().notify(Object(i.f)(c.a.verify.sendSuccess)),n}function T(t,e){if(Object(o.b)().preview)return Object(o.b)().notify(Object(i.f)(c.a.preview.noMessage)),Object(a.n)({});return j(Object(o.b)().hostConfig.qApiHost+"/validations/"+e,{type:"PUT",data:t})}function I(t,e){if(Object(o.b)().preview)return Object(a.n)({recipient:Object(u.a)()});const n=Object(o.c)().storage.get("gift-"+t.code);if(n)return Object(a.n)(JSON.parse(n));return g(Object(o.b)().hostConfig.qApiHost+"/rewards/"+e+"/red_envelope",{type:"POST",data:t})}async function k(t,e){if(Object(o.b)().preview)return{};const n=Object(o.b)().hostConfig.qApiHost+"/rewards/"+e+"/custom";try{const e=await g(n,{type:"PUT",data:t});return Object(o.b)().notify(Object(i.f)(c.a.verify.sendSuccess)),e}catch(t){throw Object(o.b)().notify(Object(i.f)(c.a.verify.sendFailed)),t}}function N(t){Object(s.a)(t);const{preview:e}=Object(o.b)(),{dev:{autoRun:n,infer:r}}=Object(o.c)();if(e||n||r)return Object(a.n)(null);return g(Object(o.b)().hostConfig.qApiHost+"/webhooks",{type:"POST",data:t})}function E(t){return Object(i.f)("backEnd."+t)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"f",(function(){return u})),n.d(e,"e",(function(){return l})),n.d(e,"d",(function(){return d})),n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return b}));var r=n(3),i=n(0),o=n(2),c=n(34);let a;function s(){return a||(a=Object(i.c)().app.getParams()),a}function u(){a=null}function l(t){const e=new c.a("div");e.setInnerHtml(t),t=e.getText();const n=Object.create(null);return"string"!=typeof t?n:(t=t.trim().replace(/^([?#&])/,""))?(t.split("&").forEach(t=>{const e=t.replace(/\+/g," ").split("=");let r=e.shift(),i=e.length>0?e.join("="):void 0;r=decodeURIComponent(r),i=void 0===i?null:decodeURIComponent(i),void 0===n[r]?n[r]=i:Array.isArray(n[r])?n[r].push(i):n[r]=[n[r],i]}),{...n}):n}function d(t){Object(i.b)().preview||Object(i.c)().dev.autoRun?Object(i.b)().notify(Object(o.f)(r.a.preview.noLink)):(Object(i.c)().hook.beforeForceLeave(),Object(i.c)().app.openWebLink(t),Object(i.b)().customAbort())}function f(t,e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){}const n=function(t){const e=[];return Object.keys(t).forEach(n=>{if(void 0!==t[n]){const r=`${encodeURIComponent(n)}=${encodeURIComponent(t[n])}`;e.push(r)}}),e.join("&")}(e),r=t.match(/\?/)?"&":"?";return t+r+n}function b(t,e){const n=Object.keys(e),r=["key","dev","rid","aid","cid","qid","tid","rtpl","infer_id","sid","type","jwt","ban_preview_bar","fake_port","real_port","auto_path","lite_template"];for(const i of n){const n=t.includes("?")?"&":"?";(r.includes(i)||i.match(/^key\d\d?$/))&&(t+=`${n}${i}=${e[i]}`)}return t}},function(t,e,n){"use strict";n.d(e,"A",(function(){return h})),n.d(e,"B",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"b",(function(){return w})),n.d(e,"p",(function(){return _})),n.d(e,"r",(function(){return x})),n.d(e,"k",(function(){return T})),n.d(e,"u",(function(){return I})),n.d(e,"t",(function(){return k})),n.d(e,"s",(function(){return N})),n.d(e,"n",(function(){return E})),n.d(e,"m",(function(){return S})),n.d(e,"f",(function(){return L})),n.d(e,"v",(function(){return C})),n.d(e,"g",(function(){return P})),n.d(e,"y",(function(){return M})),n.d(e,"a",(function(){return R})),n.d(e,"z",(function(){return A})),n.d(e,"i",(function(){return D})),n.d(e,"l",(function(){return U})),n.d(e,"j",(function(){return B})),n.d(e,"c",(function(){return q})),n.d(e,"d",(function(){return V})),n.d(e,"e",(function(){return F})),n.d(e,"o",(function(){return $})),n.d(e,"h",(function(){return X})),n.d(e,"x",(function(){return z})),n.d(e,"w",(function(){return K}));var r=n(33),i=n(40),o=n(1),c=n(5),a=n(20),s=n(9),u=n(6),l=n(0),d=n(10);let f=[];let b=-1;function p(){const{dev:{local:t}}=Object(l.c)(),{preview:e,realTimePreview:n,hostConfig:{recordUrl:r}}=Object(l.b)();return!(t||e||n||!r)}function O(t,e=!1){if(Object(a.b)()&&(!e||"start"===t.type))return;t.description=Object(c.k)(t.description);const n=t.description;if(p()){const r=f[f.length-1];r&&(n.indexOf(r.description)>-1||r.description.indexOf(n)>-1)&&f.pop(),f.push(t),e&&m()}}function m(){if(p()){if(clearTimeout(b),f.length>0){const t=f;f=[];const e=Object(l.b)().hostConfig.recordUrl;Object(s.q)(e,{type:"POST",data:{records:t}}).catch(()=>{Object(o.c)("failed to send record")})}b=setTimeout(m,1e4)}}function g(t,e,n,r,i){const{surveyId:o,transactionID:c,userInfo:a}=n;let s,u,f,b,p,O,m;("gift"===r||"start"===r&&a)&&(s=a.nickname,u=a.openid,s&&(b=Object(l.c)().name)),"start"===r&&(f=JSON.stringify(Object(d.c)())),e&&("matrix"===e.type?(O=t?t.yid:void 0,m=t?t.xid:void 0):p=t?t.uuid.toLowerCase():void 0);return{survey_id:o,collector_id:n.parsedPayload&&n.parsedPayload.basicConfig&&n.parsedPayload.basicConfig.collector&&n.parsedPayload.basicConfig.collector.id,response_id:c,node_id:e?e.nodeUuid.toLowerCase():void 0,option_id:p,row_option_id:O,col_option_id:m,description:i,type:r,recorded_at:new Date,provider:b,user_name:s,user_id:u,query_params:f}}function j(t){const e=t.loop?`[${t.nodeName}:${t.title||""}]`:`[${t.nodeName}]`;return Object(c.k)(e)}function h(t,e){if(Object(l.c)().dev.infer)return;O(g(null,e,t,"used_phone",`在题目:${j(e)}中检测到重复使用的手机号:${t.phoneNumber}`))}function y(t,e){if(Object(l.c)().dev.infer)return;O(g(null,e,t,"verify_fail",`在题目:${j(e)}高级验证失败`))}function v(t,e){if(Object(l.c)().dev.infer)return;const{type:n,parent:r}=e;if("upload"===n||"verify"===n||"gift"===n)return;let o,a="",s="";if("menu"===n||"cascade"===n)s=Object(u.c)(e).reduce((e,n)=>(n.selected&&(e+=`[${n.text}]`),t=n,e),""),o=s?"select":"deselect",a=s?"选中":"清除所有选中";else{const r=t.selected;o=r?"select":"deselect",a=r?"选中":"取消选中",s="select_icon"===n||"select_image"===n?`[${Object(i.b)(t)}]`:"matrix"===e.type?`[${Object(c.k)(t.xText)} ${Object(c.k)(t.yText)}]`:`[${Object(c.k)(t.text)}]`}const d=`在题目:${j(e)}中${a}选项:${s}`;O(g(t,e,r,o,d))}function w(t,e,n){if(Object(l.c)().dev.infer)return;const r=`在题目:${j(n)}的选项:[${Object(c.k)(e.text)}]中输入自动填充触发文字:${t}`;O(g(e,n,n.parent,"auto_complete",r))}function _(t,e,n){if(Object(l.c)().dev.infer)return;const r=n.parent;let i,o;"value_mark"===n.type||"icon_mark"===n.type||"slide_rate"===n.type||"weight"===n.type?(i="打分:"+e.value,o="rate"):"upload"===n.type?(i=t?"上传图片":"清除图片",o="upload"):(i="输入:"+e.value,o="input");O(g(e,n,r,o,`在题目:${j(n)}的选项:[${Object(c.k)(e.text)}]中${i}`))}function x(t,e){if(Object(l.c)().dev.infer)return;const n=e.parent,r=e.options[t];if(!r)return;O(g(r,e,n,"sort",`在题目:${j(e)}中将选项:[${Object(c.k)(r.text)}]排序到第${t+1}位`))}function T(t){if(Object(l.c)().dev.infer)return;const e=`在题目:${j(t)}中 定位失败`;O(g(null,t,t.parent,"locate_failed",e))}function I(t,e){if(Object(l.c)().dev.infer)return;const n=e.parent,r=e.type,i=e.value;let o="input",c="输入";if("region"===r)c="输入:"+i;else if("location"===r||"area"===r)o="locate",c="定位到:"+i;else if("verify"===r){const e=typeof t;if("string"===e)c="输入:"+t;else if("object"===e){const{code:e,phoneNumber:n}=t;void 0!==n?(o="input_phone",c="的手机号码中输入:"+n):(o="input_code",c="的密码/验证码中输入:"+e)}}O(g(null,e,n,o,`在题目:${j(e)}中${c}`))}function k(t){if(Object(l.c)().dev.infer)return;O(g(null,t,t.parent,"prev",`在题目:${j(t)}中点击上一题`))}function N(t,e){if(Object(l.c)().dev.infer)return;O(g(null,e,t.parent,"prev",`返回到题目: ${j(e)},由题目:${j(t)}后退而来`))}function E(t){if(Object(l.c)().dev.infer)return;O(g(null,t,t.parent,"next",`在题目:${j(t)}中点击下一题`))}function S(t,e){if(Object(l.c)().dev.infer)return;O(g(null,e,t.parent,"next","end"===e.type?`到达结束节点: ${j(e)},由题目:${j(t)}前进而来`:`进入题目: ${j(e)},由题目:${j(t)}前进而来`))}function L(t,e,n){if(Object(l.c)().dev.infer)return;O(g(null,e,n,"check_fail",`从${j(t)}走向甄别失败`),!0)}function C(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t.current,t,"quota_fail","配额失败,答案数:"+e),!0)}function P(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t.current,t,"check_submit","甄别提交,答案数:"+e))}function M(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t,e,"time_less","答题时间太少被排除"),!0)}function R(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t,e,"abandon_answer","按结束节点要求抛弃答案"),!0)}function A(t){if(Object(l.c)().dev.infer)return;O(g(null,t.current,t,"time_over","答题超时未完成"),!0)}function D(t,e,n,r){if(Object(l.c)().dev.infer)return;O(g(null,t,e,"full_submit",`正式提交,答案数:${n}个答案 \n 提交回应:${JSON.stringify(r)}`),!0)}function U(t,e,n=!1){if(Object(l.c)().dev.infer)return;O(g(null,t,e,n?"lottery_goal":"lottery_fail",n?"抽奖:中奖":"抽奖:未中奖"),!0)}function B(t,e){if(Object(l.c)().dev.infer)return;O(g(null,t,e,"gift","领奖"),!0)}function q(t,e,n,r,i){if(Object(l.c)().dev.infer)return;O(g(e,n,t,"auto_input",`在题目:${j(n)}中自动填充选项:[${r}],期待值:[${i}]`))}function V(t,e,n,r="成功"){if(Object(l.c)().dev.infer)return;O(g(null,n,t,"auto_skip",`在题目:${j(n)}中尝试自动选中选项:[${Object(c.k)(e.text)}]${r}`))}function F(t,e,n){if(Object(l.c)().dev.infer)return;let r=`自动跳过题目:${j(e)} by ${n}`;"logic"===e.type&&(r+=" logicResult:"+e.logicResult);O(g(null,e,t,"auto_skip",r))}function $(t,e,n){if(Object(l.c)().dev.infer)return;O(g(null,n,t,"opt_display",`在题目:${j(n)}中显示选项:[${Object(c.k)(e.text)}]`))}function H(){let t=Object(l.c)().storage.get("browser_uuid");return t||(t=Object(o.i)(),Object(l.c)().storage.set("browser_uuid",t)),t}function X(){if(Object(l.c)().dev.infer)return;const t=Object(d.c)();if(t.code&&t.state)return;O({type:"enter",collector_code:Object(l.b)().sid,browser_uuid:H(),recorded_at:Object(r.c)(),description:"来自"+Object(l.c)().system.getReferer()},!0)}function z(t,e){if(Object(l.c)().dev.infer)return;let n=`开始答题,进入到题目: ${j(e)} `;const{browser:r,device:i,engine:o,os:c}=Object(l.c)().system.device;r&&(n+=`browser:${r.name||""} ${r.version||""}, `),i&&(n+=`device:${i.type||""} ${i.vendor||""} ${i.model||""}, `),o&&(n+=`engine:${o.name||""} ${o.version}, `),c&&(n+=`os:${c.name||""} ${c.version||""}`);const a=g(null,e,t,"start",n);a.browser_uuid=H(),a.collector_code=Object(l.b)().sid,O(a,!0)}function K(t,e){if(Object(l.c)().dev.infer)return;O(g(null,null,t,"resume","开始断点续答:"+e),!0)}},function(t,e,n){"use strict";n.d(e,"l",(function(){return E})),n.d(e,"e",(function(){return C})),n.d(e,"h",(function(){return P})),n.d(e,"f",(function(){return M})),n.d(e,"g",(function(){return R})),n.d(e,"n",(function(){return A})),n.d(e,"m",(function(){return D})),n.d(e,"d",(function(){return U})),n.d(e,"b",(function(){return B})),n.d(e,"k",(function(){return V})),n.d(e,"j",(function(){return F})),n.d(e,"i",(function(){return $})),n.d(e,"c",(function(){return H})),n.d(e,"a",(function(){return X}));var r=n(8),i=n(10),o=n(4),c=n(11),a=n(17),s=n(35),u=n(59),l=n(19),d=n(57),f=n(71),b=n(0),p=n(2),O=n(47),m=n(48),g=n(3),j=n(20),h=n(9),y=n(46),v=n(5),w=n(21),_=n(69);const x={},T={};async function I(t,e,n){const{actions:r}=e;if(r&&!Object(j.b)()&&!Object(b.b)().realTimePreview){if("forward_enter"===t){if(x[e.renderId])return;x[e.renderId]=!0}if("backward_leave"===t&&delete x[e.renderId],"forward_leave"===t){if(T[e.renderId])return;T[e.renderId]=!0}"backward_leave"===t&&delete T[e.renderId];for(const i of r){if(i.disabled||i.event!==t)continue;const{activeConfig:r}=i;if(!r||await Object(w.b)(n,r.options,r.logicType))if("http_request"===i.type)Object(_.a)(i),await Object(y.b)(n,i.request,null,!0,!1);else{const r={state:n},o={question_id:e.nodeUuid,response_id:n.transactionID,locale:n.language,event:t,type:i.type};if("email"===i.type){const{email:t}=i,e={...o,email:(await Object(v.f)(t.address,r)).replace(/\s/g,""),content:await Object(v.d)(t.content,r),title:(await Object(v.f)(t.title,r)).trim()};await Object(h.i)(e)}else{const{sms:t}=i,e={};for(const n of t.params)e[n.name]=(await Object(v.f)(n.value,r)).trim();const n={...o,url:(await Object(v.f)(t.url,r)).replace(/\s/g,""),content:e};await Object(h.i)(n)}}}}}var k=n(14);let N;function E(){return!!N}const S=["end","gift","lottery"];function L(t){let{prev:e}=t;const n=[];let r=e&&Object(o.w)(e);for(;r;)n.push({question:e,reason:r}),e=e.prev,r=e&&Object(o.w)(e);return{prev:e,skipList:n,current:t}}function C(t){const{parent:e}=t,{renderList:n}=e,r=n.indexOf(t);return R(e,n,r)}function P(t){if(Object(b.b)().realTimePreview)return"";const{prevEnabled:e,themeMode:n}=t,r=t.first(),{prev:i}=L(r),o=r.type;if(e&&n&&"end"!==o&&"lottery"!==o)return t.prevBtnText;if(Object(b.b)().preview&&"end"===o)return Object(p.f)(g.a.global.backTest);return e&&i&&(r.checkMode===i.checkMode||Object(b.b)().preview)&&S.indexOf(o)<0?t.inSingleGroup?t.inSingleGroup.prevText||Object(p.f)(g.a.global.previous):t.prevBtnText:""}async function M(t){const{formalResult:e}=t,n=t.current,{type:r,linkUrl:i,goal:o,qrCode:c}=n;if("end"===r){const r=n.endBtnText||Object(p.f)(g.a.global.go);if(i)return r;if(e&&e.reward||Object(b.b)().preview&&n.useReward)return c||t.fakeCommitted?"":r;{const{node:e}=await O.a.findNext(t.nodeList,n,t);return e&&"lottery"===e.type?r:""}}if("lottery"===r){const t=Object(p.f)(g.a.reward.get);return i?n.endBtnText||t:o?c?"":t:""}return t.inSingleGroup?t.inSingleGroup.nextText||Object(p.f)(g.a.global.next):t.nextBtnText}function R(t,e,n){const r=[];let i=1;const c=e[n];let a=e[n+i],s=a&&Object(o.w)(a);for(;a&&s;)r.push({question:a,reason:s}),i+=1,a=e[n+i],s=a&&Object(o.w)(a);return{next:a,skipList:r,current:c}}async function A(t){const e=await Object(s.c)(t.nodes,!0);if(e.valid){if(Object(l.c)(t)){Object(b.g)(t,{current:t.nodes[t.nodes.length-1]});for(const e of t.nodes)await I("forward_leave",e,t)}else await I("forward_leave",t.current,t);return await Object(a.f)(t,t.current,{type:"page_next",delay:200}),!0}return function(t,e){const{valid:n,message:i,dueToNode:o,dueToOption:c}=e,a={valid:n,message:i};c&&(a.optId=c.uuid,a.optText=c.text,c.label&&(a.message=c.label+":"+a.message));o&&(a.nodeId=o.nodeUuid,a.nodeName=o.nodeName,a.nodeType=o.type,a.message=o.nodeName+":"+a.message);if(r.a.trigger("NEXT_FAIL",a),"vital"===e.type)throw Object(b.b)().error(e.message),new Error("next vital error: "+e.message);"alert"===e.type?Object(b.b)().alert(e.message):(t.inSingleGroup||Object(b.b)().notify(e.message),Object(s.a)(e,t))}(t,e),!1}function D(t,e){Object(b.g)(t,{nextLoading:e}),Object(j.c)()}function U(t){D(t,!0),N={state:t}}async function B(t){D(t,!1),N&&(await F(N.state),N=void 0)}function q(t,e){if(Object(r.c)(e,!0),"red_envelope"!==e.giftType||Object(b.b)().preview)Object(b.c)().hook.beforeForceLeave(),Object(b.c)().app.openWebLink(Object(b.c)().app.getRewardUrl(Object(i.c)())),Object(b.b)().customAbort();else{const n={...Object(i.c)(),tid:t.transactionID,qid:t.surveyId,rid:t.rewardInfo.goalId};e.template&&(n.rtpl=e.template.id);const{formalResult:{authorizer:{app_id:r,component_appid:o}}}=t;Object(b.c)().auth.authorizeGift(r,o,n),Object(b.b)().customAbort()}}function V(t,e){e.linkUrl?(Object(b.c)().hook.beforeForceLeave(),Object(b.c)().app.openWebLink(e.linkUrl),Object(b.b)().customAbort()):q(t,Object(o.a)(t.nodeList,e.rewardNodeId))}async function F(t){const e=function(t){const{renderList:e}=t,n=t.nodes[t.nodes.length-1];return R(0,e,Object(a.b)(e,n))}(t),{current:n,next:s}=e;if("end"===n.type)return async function(t,e){Object(b.c)().storage.remove("reward_info");const n=e.linkUrl;if(n)return void Object(i.d)(n);const a=Object(o.c)(t.nodeList,e.destList,e.output&&e.output.uuid);if(!a)return;const s=await Object(u.b)(t,a);if("lottery"===a.type){const e=await Object(l.e)(a,s,t);Object(c.l)(a,t,s.goal),Object(b.g)(t,{current:e}),Object(r.c)(a,!0)}else q(t,a);return t.dynamicStateProps()}(t,n);return(await Object(d.b)(t,{valid:!0,message:""},n,s)).valid?async function(t,e){const{next:n,current:i}=e;Object(b.g)(t,{current:n}),n.reached=!0,Object(c.m)(i,n),Object(r.c)(n,!0),Object(m.a)(t),Object(k.k)(t),await t.dynamicStateProps(),D(t,!1),i.dynamicNodeProps(),Object(a.e)(t,t.current),r.a.trigger("NEXT_OK")}(t,e):D(t,!1)}async function $(t){const e=t.first(),{prev:n,skipList:i}=L(e);if(n){if(e.groupSingle){const e=[...t.nodes].reverse();for(const n of e)await I("backward_leave",n,t)}else await I("backward_leave",e,t);for(const e of i)await I("backward_enter",e.question,t),await I("backward_leave",e.question,t);if(Object(b.g)(t,{current:n,currentStartTime:(new Date).getTime()}),Object(r.c)(n,!0),Object(m.a)(t),Object(k.k)(t),await t.dynamicStateProps(),Object(c.s)(e,n),Object(a.e)(t,t.current),r.a.trigger("PREV_OK"),n.groupSingle){const e=[...t.nodes].reverse();for(const n of e)await I("backward_enter",n,t)}else await I("backward_enter",n,t)}}async function H(t,e){const{nodeList:n,current:r}=t,i=await Object(f.b)(n,r,t),{node:o}=i;return o?X(t,i,e):null}async function X(t,e,n){const r=t.current,{node:i,loop:a,random:s,loopStack:u}=e,d={prev:r,origin:i,...i,loop:a,random:s,loopStack:u};if(n&&n(d))return null;const f=await Object(l.f)(d,t);await I("forward_enter",f,t),Object(b.g)(t,{current:f});const p=Object(o.w)(f);return p&&(Object(c.e)(t,f,p),await I("forward_leave",f,t)),f}},function(t,e,n){"use strict";n.d(e,"l",(function(){return p})),n.d(e,"i",(function(){return O})),n.d(e,"j",(function(){return m})),n.d(e,"k",(function(){return g})),n.d(e,"g",(function(){return j})),n.d(e,"f",(function(){return h})),n.d(e,"c",(function(){return y})),n.d(e,"h",(function(){return v})),n.d(e,"b",(function(){return w})),n.d(e,"d",(function(){return _})),n.d(e,"e",(function(){return x})),n.d(e,"a",(function(){return T}));var r=n(5),i=n(49),o=n(1),c=n(31),a=n(6),s=n(39),u=n(17),l=n(16),d=n(22),f=n(34),b=n(7);function p(t){return Object(f.c)(t)}function O(t="",e){return e||(e=p(t)),e.queryByClass("var-tag")}function m(t=""){return!!(t&&t.indexOf("var-tag")>-1)}function g(t){return Object(o.k)(t,"node"===t.type)&&t.hasClass("var-tag")}function j(t){return{name:t.getText(),uuid:(e=t,e.attributes["data-id"]),limit:t.attributes["data-limit"],limitSrc:Number(t.attributes["data-limit-src"]||void 0),imgSize:t.attributes["data-img-size"],limitRnd:Number(t.attributes["data-limit-rnd"]||void 0),paramConfig:t.attributes["data-ph-cfg"],disorder:"1"===t.attributes["data-disorder"],inEdist:t.parent&&!!t.parent.attributes.edist};var e}function h(t,e){return v(t,j(e))}function y(t){const{uuid:e,limitSrc:n,limit:r,limitRnd:i,paramConfig:o}=t;let c=e;return Object(b.b)(n)||(c+="_"+n),Object(b.b)(r)||(c+="_"+r),Object(b.b)(i)||(c+="_"+i),Object(b.b)(o)||(c+="_"+o),c}function v(t,e){const n=y(e),{uuid:r,limitSrc:i,paramConfig:c,name:f,disorder:p,inEdist:O}=e;let{imgSize:m,limitRnd:g,limit:j}=e;j=j||"1:0:0",m=m||"0:0",g=Object(b.b)(g)?-1:g;const h=r.split(":");let v="";s.f(r)&&(v=r.substr(0,8));const w=h.length;if(0===w)return;if(1===w){const t=h[0],e=Object(l.e)(t);return e&&{...e,name:f,uuid:r,limit:j,limitSrc:i,limitRnd:g,imgSize:m,loopNodeId:v,mapId:n,paramConfig:c,inEdist:O}}let _;if(!v&&(_=function(t,e=""){const{loopStack:n,context:r}=t;let{renderList:i}=t;const c=Object(o.h)("",n);return r.question&&(i=[...i,r.question]),i.find(t=>{const n=t.nodeUuid+c;return Object(o.l)(t.nodeUuid,e)&&Object(u.d)(t.renderId,n)})}(t,h[0]),!_))return;const x=Object(d.b)(h[1]);if(2===w)return x&&{name:f,question:_,nodePart:x,limit:j,limitSrc:i,limitRnd:g,uuid:r,imgSize:m,loopNodeId:v,isMedia:"var-media"===x.type,type:x.type,mapId:n,paramConfig:c,inEdist:O};const T=Object(d.b)(h[2],_),I=T&&"var-media"===T.type;if(3===w&&!h[1].match(/^[a-z0-9]{8}$/))return T&&{inEdist:O,name:f,question:_,nodePart:x,optionPart:T,limit:j,limitSrc:i,limitRnd:g,disorder:p,uuid:r,imgSize:m,loopNodeId:v,isMedia:I,type:T.type,mapId:n,paramConfig:c};const k=Object(a.a)(Object(a.b)(_),h[1]);return k?T&&{inEdist:O,name:f,question:_,option:k,optionPart:T,limit:j,limitSrc:i,limitRnd:g,disorder:p,uuid:r,imgSize:m,loopNodeId:v,isMedia:I,type:T.type,mapId:n,paramConfig:c}:void 0}async function w(t,e){let n=[];const{varInfo:{nodePart:a,option:s,disorder:u}}=t,l=await Object(r.e)(t.varInfo.limitRnd,t);if(0===l&&!e)return[];const d=t.specifiedOpt||s;n=d&&await Object(i.b)(t)?[d]:a&&a.filter?await a.filter(t):[];const f=e?e(n,l):Object(o.p)(n,l);return u?Object(c.c)(f):Object(c.d)(f)}async function _(t){const{varInfo:{nodePart:e,optionPart:n,option:r}}=t,o=t.specifiedOpt||r;if(e&&e.getBool)return e.getBool(t);if(o){return await Object(i.b)(t)&&await n.getBool({...t,specifiedOpt:o})}if(n.inBunch)return n.getBool(t);{const e=await w(t),r=[];for(const i of e){const e=await n.getText({...t,specifiedOpt:i});e&&r.push(e)}return r.length>0}}async function x(t){const{varInfo:{nodePart:e,optionPart:n,option:r}}=t,o=t.specifiedOpt||r,c=t.joinBy||" ";if(e&&e.getText)return e.getText(t);if(o){return await Object(i.b)(t)?n.getText({...t,specifiedOpt:o}):""}if(n.inBunch)return n.getText(t);{const e=await w(t),r=[];for(const i of e){const e=await n.getText({...t,specifiedOpt:i});Object(b.b)(e)||r.push(e)}return r.join(c)}}async function T(t){const e={};e.text=await x(t);const n=await async function(t){const{varInfo:{nodePart:e,optionPart:n,option:r,isMedia:o}}=t;if(!o)return[];const c=t.specifiedOpt||r;if(e&&e.getImages)return e.getImages(t);if(c){return await Object(i.b)(t)&&n.getImages?n.getImages({...t,specifiedOpt:c}):[]}{const e=await w(t),r=[];if(n.getImages)for(const i of e){const e=await n.getImages({...t,specifiedOpt:i});r.push(e[0])}return r}}(t);e.image=n[0];const r=await async function(t){const{varInfo:{optionPart:e,option:n}}=t;if(!e)return[];const r=t.specifiedOpt||n;if(r){return await Object(i.b)(t)&&e.getIcon?[e.getIcon({...t,specifiedOpt:r})]:[]}{const n=await w(t);return e.getIcon?n.map(n=>e.getIcon({...t,specifiedOpt:n})):[]}}(t);return e.icon=r[0],e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E})),n.d(e,"e",(function(){return L})),n.d(e,"i",(function(){return P})),n.d(e,"c",(function(){return M})),n.d(e,"g",(function(){return R})),n.d(e,"h",(function(){return A})),n.d(e,"f",(function(){return D})),n.d(e,"b",(function(){return U})),n.d(e,"j",(function(){return B})),n.d(e,"k",(function(){return q})),n.d(e,"d",(function(){return V}));var r=n(6),i=n(4),o=n(15),c=n(8),a=n(36),s=n(0),u=n(1),l=n(3);const d={};function f(t,e){e.startTime=t.startTime,e.costTime=t.costTime,e.validateFailTimes=t.validateFailTimes,e.validateFailed=t.validateFailed,e.type=t.type}d.max_diff={cache(t,e){e.tasks=t.tasks.map(t=>({items:t.items.map(t=>({uuid:t.option.uuid,value:t.value,round:t.round})),done:t.done}))},use(t,e){t.tasks&&(e.tasks=t.tasks.map(t=>({items:t.items.map(t=>({option:Object(r.a)(e.options,t.uuid),value:t.value,round:t.round})),done:t.done})))}},d.cascade={use(t,e){!function t(e,n){n&&e&&(n.selected=e.selected,n.list&&e.list&&n.list.forEach(n=>{const r=e.list.find(t=>t.resultId===n.resultId);r&&t(r,n)}))}(t.cascade,e.cascade)},cache(t,e){e.cascade=function t(e){return e?{selected:e.selected,resultId:e.resultId,list:e.list&&e.list.map(e=>t(e))}:null}(t.cascade)}},d.verify={borrow(t,e){e.code=t.code,e.phoneNumber=t.phoneNumber}},d.region={borrow(t,e){e.indexes=t.indexes,e.position=t.position,e.value=t.value}},d.location=d.area={borrow(t,e){d.region.borrow(t,e),e.succeed=t.succeed,e.failed=t.failed,e.failedSkipActivated=t.failedSkipActivated}},d.sequence={use(t,e){e.options.sort((t,e)=>t.sortNo>e.sortNo?1:-1)}};const b=["select","select_icon","select_image","menu","hot_spot"];var p=n(56),O=n(7);const m={};function g(t,e,n){e.value=t.value,e.selected=t.selected,t.assistValue&&(e.assistValue=e.assistValue||{},Object.keys(t.assistValue).forEach(n=>{Object(O.b)(t.assistValue[n])||(e.assistValue[n]=t.assistValue[n])}),"cache"===n&&0===Object.keys(e.assistValue).length&&delete e.assistValue)}function j(t,e,n){if(g(t,e,"use"),!e.isOtherOpt){const r=m[n];r&&(r.use?r.use(t,e):r.borrow&&r.borrow(t,e))}}m.max_diff={borrow(t,e){t.records&&(e.records=t.records.map(t=>({...t})))}},m.sequence={borrow(t,e){e.sortNo=t.sortNo}},m.heat_map={borrow(t,e){t.point&&(e.point={...t.point})}},m.upload={borrow(t,e){e.fileName=t.fileName,e.fileType=t.fileType,e.name=t.name,e.isImage=t.isImage},cache(t,e){m.upload.borrow(t,e),e.value=t.miniValue||t.value},use(t,e){m.upload.borrow(t,e),e.fileName&&Object(p.c)(e,{width:64,height:64},t)}};let h=!1,y="";const v=["data","describe","logic","random","loop"];let w,_;let x,T,I={responseId:"",data:{},point:"",count:0,randomList:[],lang:""};function k(t){const{offlineTaskId:e}=Object(s.b)(),n="response_cache_"+Object(u.s)(t);return e?n+"_with_"+e:n}function N(t,e){const n={};return function(t,e,n){if(e.uuid=t.uuid,g(t,e,"cache"),!t.isOtherOpt){const r=m[n];r&&(r.cache?r.cache(t,e):r.borrow&&r.borrow(t,e))}}(t,n,e),n}function E(t){if(Object(s.c)().dev.infer||h)return;if(Object(i.w)(t)||v.includes(t.type)||t.readonly)return;const e={};!function(t,e){f(t,e);const n=d[e.type];n&&(n.cache?n.cache(t,e):n.borrow&&n.borrow(t,e))}(t,e);const n=Object(o.a)(t);if(n&&n.items){const r=n.items.map(t=>t.option_id.toLowerCase()),i=t=>!!n.items&&r.includes(t.uuid.toLowerCase()),{options:o,otherOptions:c}=t;o&&(e.options=o.filter(i).map(e=>N(e,t.type))),c&&(e.otherOptions=c.filter(i).map(e=>N(e,t.type)))}I.responseId=t.parent.transactionID,I.data[t.renderId]=e;const r=t.parent.randomList;r&&(I.randomList=r.map(t=>({nodeId:t.node.nodeUuid,destPortIds:t.destPortIds}))),S(t.parent)}function S(t){const{sid:e,renderList:n}=t,r=k(e);I.lang=Object(l.b)();const i=Object.keys(I.data);I.count=0;for(const t of n)if(i.includes(t.renderId)&&(I.count+=1),t.renderId===I.point)break;Object(s.b)().preview||Object(s.c)().storage.set(r,JSON.stringify(C(I)))}function L(t){const e=k(t),n=Object(s.c)().storage.get(e);if(n){const t=JSON.parse(n);return y||(y=t.lang),t}return null}function C(t){const e=t.data,n={};return Object.keys(e).forEach(t=>{const r={...e[t]};"upload"===r.type&&(r.options=r.options.map(t=>((t={...t}).miniValue&&(t.value=t.miniValue,delete t.miniValue),t))),n[t]=r}),{...t,data:n}}function P(t){if(Object(s.c)().dev.infer)return t;if(Object(i.w)(t)||v.includes(t.type)||t.readonly)return t;const e=I.data[t.renderId];return e?(function(t,e,n){const i=Object(r.c)(t);let o=[];e.options&&(o=[...o,...e.options]),e.otherOptions&&(o=[...o,...e.otherOptions]);for(const t of i){const e=Object(r.a)(o,t.uuid);e&&j(e,t,n)}}(t,e,t.type),function(t,e){f(t,e);const n=d[e.type];n&&(n.use?n.use(t,e):n.borrow&&n.borrow(t,e))}(e,t),function(t){if(Object(i.s)(t))return;const{options:e,otherOptions:n,type:r}=t;let o=n||[];b.includes(r)&&(o=[...o,...e]);const c=o.filter(t=>t.selected);if(c.length<=1)return;const a=[];c.forEach(t=>{t.autoSelectMarked?Object(s.g)(t,{selected:!1,autoSelectMarked:!1}):a.push(t)}),a.length>1&&a.forEach((t,e)=>{e<a.length-1&&Object(s.g)(t,{selected:!1})})}(t),w&&w(t),t):(w&&w(t),t)}function M(t=!1){return t?C(I):I}async function R(t,e,n){I=t,x=[...t.randomList||[]],T=t.point;const r=I.count;let i=0;h=!0,w=()=>{i>=r?_({failed:!1,error:""}):(n.onProgress(`${i}/${r}`),i++)},_=t=>{o(),w=null,_=null,c.a.trigger("END_MEMORY",e.current),setTimeout(()=>{n.onEnd(t)},250)};const o=()=>{c.a.off("NEXT_OK",u),c.a.off("STRETCH_OK",u),c.a.off("NEXT_OK",s),h=!1},s=(t,e)=>{"NEXT_FAIL"===t.type&&e?n.onSuspend():_({failed:!0,error:e})},u=()=>e.current.renderId===T?_({failed:!1,error:""}):e.handleEvents.handleNextClick();c.a.one("STRETCH_OK",u),c.a.on("NEXT_FAIL",s),c.a.on("NEXT_OK",u),c.a.trigger("START_MEMORY"),await Object(a.b)()}function A(t,e){if(!x)return t;const n=x.find(t=>t.nodeId===e.nodeUuid);if(!n)return t;const r=n.destPortIds,i=[],o=[];return t.forEach(t=>{r.includes(t)?i.push(t):o.push(t)}),i.sort((t,e)=>r.indexOf(t)>r.indexOf(e)?1:-1),[...i,...o]}function D(){I={responseId:"",data:{},point:"",count:0,randomList:[],lang:""}}function U(t){D();const e=k(t.sid);Object(s.c)().storage.remove(e)}function B(t){h||(I.point=t.current.renderId)}function q(t){B(t),S(t)}function V(t){return t?(y||L(t),y):""}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w})),n.d(e,"c",(function(){return _})),n.d(e,"e",(function(){return x})),n.d(e,"b",(function(){return I})),n.d(e,"d",(function(){return k}));var r=n(6),i=n(37),o=n(40),c=n(43),a=n(1),s=n(5),u=n(4),l=n(55),d=n(10),f=n(7),b=n(25);const p=["select","icon_mark","value_mark","upload","menu","slide_rate"],O=["fill","verify"];function m(t){const{type:e}=t;return"region"===e?"predef":e}function g(t,e){let n;if(e.isOtherOpt)n=e.optionType;else if(!0===e.useComment)n="option_comment";else{const{type:e}=t;n="region"===e?"predef_region":p.includes(e)?"option":O.includes(e)?"comment":e}return n}function j(t,e){const n=function(t){const{loop:e}=t;let n;return e&&(n=e.replacements.map(t=>({node_id:t.loopNodeId.toLowerCase(),index:t.index,option_id:t.uuid.toLowerCase()}))),n}(t),{nodeUuid:r}=t,i=e&&e(t);return{type:m(t),node_id:r.toLowerCase(),items:i,start_time:t.startTime,cost_time:Math.round(t.costTime||0),loop_ctxs:n}}function h(t,e){const n=e,i=Object(r.e)(n),o=Object(b.a)(n,t),c={value:Object(f.b)(o)?"":o,other:!!n.isOtherOpt,type:g(t,n)};return c.option_id=n.uuid.toLowerCase(),"matrix"===t.type&&n.yid?(c.row_option_id=n.yid.toLowerCase(),c.col_option_id=n.xid.toLowerCase(),c.row_content=Object(s.k)(n.yText),c.col_content=Object(s.k)(n.xText),c.content=c.col_content+"-"+c.row_content):c.content=i||Object(s.k)(n.text),n.visible||(c.hidden=!0),c}function y(t){return Object(r.b)(t).reduce((e,n)=>((n.selected||Object(b.b)(n,t))&&e.push(h(t,n)),e),[])}const v={};function w(t){const e=v[t.type];return e&&e(t)}function _(t){return"object"==typeof t.value?JSON.stringify(t.value):t.value}function x(t,e){return"all"===e||(t?"check"===e:"normal"===e)}function T(){return function(t){const e={};return Object.keys(t).forEach(n=>{n.match(/key\d{0,2}/)&&(e[n]=t[n])}),e}(Object(d.c)())}async function I(t,e="all",n="committed_url"){const{costTime:r,answers:c}=function(t,e,n=!1){const r=[];let i=0;return t.renderList.forEach(t=>{if(!x(t.checkMode,e))return;if("data"===t.type)return;const o=w(t);o&&(n&&(o.content=t.title,o.name=t.number),r.push(o),i+=o.cost_time)}),{answers:r,costTime:i}}(t,e),s={webhook_params:await Object(l.a)(t,n),answers:c,var_map_info:Object(o.a)(t,e),options_display_info:Object(i.a)(t,e),query_params:T(),cost_time:r,status:t.responseStatus};return Object(a.m)(s.answers,(t,e)=>{"string"==typeof t[e]&&(t[e]=t[e].replace(/,/g,",").replace(/[\r\n]/g," "))}),s}function k(t){switch(t.type){case"verify":return!!t.code;case"location":case"region":case"area":return!!t.value;case"describe":case"lottery":case"end":return!1;default:return Object(r.k)(t)||Object(r.l)(t)}}v.select=v.select_image=v.menu=v.select_icon=v.hot_spot=t=>{const e=j(t,y);if(Object(u.v)(t)&&e.items){let t=!1,n=!1;e.items.forEach(e=>{"comment"!==e.type&&(e.hidden?t=!0:n=!0),delete e.hidden}),t&&n&&(e.items=e.items.filter(t=>!t.hidden))}return e},v.cascade=v.icon_mark=v.value_mark=v.matrix=v.weight=v.slide_rate=v.sequence=v.upload=v.heat_map=v.fill=v.max_diff=t=>{const e=j(t,y);return e.items&&e.items.forEach(t=>{delete t.hidden}),e},v.location=t=>{const e=j(t,e=>{const n=Object(r.b)(t).find(t=>t.selected);if(!n)return[];return[h(e,n)]}),{position:n,indexes:i}=t;return n&&(n.indexes=i,e.location=n),e},v.region=t=>{const e=v.location(t);return e.region=Object(c.b)(t.value),e},v.area=t=>v.location(t),v.data=t=>j(t,t=>Object(r.b)(t).reduce((e,n)=>(n.selected&&e.push(h(t,n)),e),[])),v.verify=t=>{const e=j(t),{phoneNumber:n,validateType:r,code:i}=t;return"sms"===r&&(e.phone_num=n),e.code=i,e},v.end=t=>({type:m(t),node_id:t.nodeUuid.toLowerCase(),start_time:t.startTime,cost_time:0}),v.logic=t=>{const e=j(t);return e.logic_result=t.logicResult,e}},function(t,e,n){"use strict";n.d(e,"g",(function(){return l})),n.d(e,"f",(function(){return d})),n.d(e,"a",(function(){return f})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return O})),n.d(e,"e",(function(){return m})),n.d(e,"b",(function(){return g}));var r=n(5),i=n(24),o=n(1),c=n(22),a=n(0);let s=[],u=[];function l(){s=[],u=[]}function d(t){s=t.imageList,u=t.variables,function(t){const e=function(t){const{varInfo:{imgSize:e},pureText:n}=t;if(n)return Object(o.n)(this.fileName);const r=g(Object(i.a)(this.serverFileName),e,this.fileName);return Object(o.n)(r)};t.forEach(t=>{t.getText=e,t.isMedia=!0,t.type="var-media"})}(s),function(){let t="";u.forEach(e=>{e.name.indexOf("TO_GLOBAL")>-1&&"var-html"===e.type&&(t+=Object(r.i)(e.value).replace(/<style>/g,"").replace(/<\/style>/g,""))}),Object(a.c)().ui.setGlobalStyle(t)}(),function(t){if(t){const e=b(t.allJson,null)+b(t.strJson,"var-string")+b(t.expJson,"var-expression")+b(t.reqJson,"var-request")+b(t.loopJson,"var-loop");Object(a.c)().ui.setVarStyle(e,t)}}(t.varStyles)}function f(t){let e="";return t.bold&&(e+="font-weight: bold;"),t.italic&&(e+="font-style: italic;"),t.underline?e+="text-decoration: underline;":t.lineThrough&&(e+="text-decoration: line-through;"),t.color&&(e+=`color: ${t.color};`),t.backgroundColor&&(e+=`background-color: ${t.backgroundColor};`),t.fontSize&&(e+=`font-size: ${t.fontSize};`,e+="line-height: 1.4;"),e}function b(t,e){if(!t)return"";let n=e?`.var-light.${e}:not([in-edist]) {`:".var-light:not([in-edist]) {";return n+=f(t),n+="}",n}function p(t=""){return u.find(e=>e.name===t)}function O(t=""){return s.find(e=>Object(o.l)(e.id,t))}function m(t=""){return Object(c.b)(t)||u.find(e=>Object(o.l)(e.uuid,t))||O(t)}function g(t="",e="0:0",n="Image",r=!1){let i="##"+t;if(!r){const t=e.split(":");i+=`?w=${t[0]||0}&h=${t[1]||0}`,n&&(i+="#"+n)}return i+"##"}},function(t,e,n){"use strict";n.d(e,"d",(function(){return b})),n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return O})),n.d(e,"f",(function(){return g})),n.d(e,"e",(function(){return j})),n.d(e,"c",(function(){return h}));var r=n(12),i=n(4),o=n(52),c=n(1),a=n(19),s=n(0),u=n(36),l=n(48),d=n(8);let f=-1;function b(t,e){return e===t||e.indexOf(t)>-1&&e.substr(t.length).indexOf("-")>-1}function p(t,e){return e=e.toLowerCase(),t.find(t=>b(t.renderId.toLowerCase(),e))}function O(t,e){for(let i=0;i<t.length;i++){const o=t[i];if(n=o,r=e,Object(c.l)(n.renderId,r.renderId))return i}var n,r;return-1}function m(t,e){Object(s.g)(t,{refreshing:e})}function g(t,e,n){if(m(t,!0),clearTimeout(f),n.initial&&Object(d.c)(t.current,!0),n.delay){const r=Object(s.c)().dev.autoRun||Object(s.c)().dev.infer?0:n.delay;return new Promise((i,o)=>{f=setTimeout(async()=>{try{await y(t,e,n)}catch(t){o(t)}i()},r)})}return y(t,e,n)}function j(t,e){const{circleNode1Id:n}=e;n?Object(s.g)(t,{loopStack:Object(c.b)(e.loopStack)}):Object(s.g)(t,{loopStack:[]});const r=t.randomList,i=e.random;r.forEach(t=>{if(i)if(Object(c.l)(t.node.nodeUuid,i.node.nodeUuid))t.currentIndex=i.currentIndex;else{i.stack.some(e=>Object(c.l)(t.node.nodeUuid,e.node.nodeUuid))||(t.currentIndex=-1)}else t.currentIndex=-1})}function h(t,e){const n=function(t,e){let n=t;if(!e)return n;for(const t of e)n+="-"+Object(c.s)(t.option_id);return n}(e.node_id,e.loop_ctxs);return p(t.renderList,n)}async function y(t,e,n){m(t,!0);const c=t.renderList;j(t,e=e||t.current);const d=O(c,e),f=await async function(t,e,n){const c=n.type;let u=[...t.renderList];u=u.length>0?u:[e];const l=O(u,e);if(l<0)return u;u.length=l,u.push(e),Object(s.g)(t,{renderList:u}),Object(a.c)(t)&&await Object(o.a)(e);let d=null;const f=t=>!Object(i.t)(t,d);let b=null;for("page_inner"===c&&(d=e,b=f);;){const e=await Object(r.c)(t,b);if(!e)break;if(u.push(e),i.x.includes(e.type))break;if(!Object(i.w)(e)){d||(d=e,d.groupSingle&&(b=f));if(!Object(i.t)(d,e))break;await Object(o.a)(e)}}return u}(t,e,n),b=n.initial?Object(r.g)(t,f,d).next:e;Object(s.g)(t,{current:b}),m(t,!1),j(t,e),await t.dynamicStateProps(),n.initial||(await Object(r.b)(t),t.inSingleGroup&&Object(l.a)(t)),Object(u.d)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return j})),n.d(e,"d",(function(){return h})),n.d(e,"e",(function(){return y}));var r=n(6),i=n(5),o=n(1),c=n(40),a=n(31),s=n(13),u=n(42),l=n(22),d=n(0),f=n(24);function b(t,e){const{loop:n}=e,r=n&&n.node.nodeUuid;return Object(l.a)().QUES_IMAGE.getImages({state:t,varInfo:{question:e,loopNodeId:r}})}async function p(t,e){const{parent:n,loop:r}=t,i=r&&r.node.nodeUuid,{image:o,text:a}=e,s=Object(l.a)(),u=(await s.OPT_IMAGE.getImages({state:n,varInfo:{option:e,loopNodeId:i}}))[0];return!a&&u&&o&&"variable"===o.type&&Object(c.d)({question:t,option:e},{mapId:o.id},u.originName),u}function O(t){return!!Object(d.b)().realTimePreview||t&&!!(t.text||t.image||t.icon)}async function m(t,e,n){const{optionPart:i,nodePart:o}=e,{option:c}=e;if(!i||i.inBunch)return{valid:!0};if(c)return{valid:!0,option:c};{const i=await o.filter({state:t,varInfo:e}),c=Object(r.a)(i,n.refOptId);return{valid:!!c,option:c}}}function g(t,e){return t?t.find(t=>t.uuid===e):null}async function j(t,e,n){const r={...t};if(e.context.option=r,r.mapping){const t={...r.mapping};for(const n of Object.keys(t)){const r=n,o=t[r];if("string"==typeof o)t[r]=await Object(i.d)(o,{state:e});else{const e=o;t[r]=Object(f.c)(e)}}r.mapping=t,"data"===n&&(r.value=t.field_1,r.number=t.field_2,r.optComment=t.field_3,r.image=t.field_4)}return r.assistValue={field_1:"",field_2:"",field_3:"",field_4:"",field_5:"",field_6:""},e.context.option=null,r}async function h(t,e,n){const r=[];for(const i of t)r.push(await j(i,e,n));return r}async function y(t,e,n,u=!1){let l=[];const d=e;let{refOptions:f,options:b,optionRefers:p}=d;if("xid"===n?(f=d.refOptionsX,b=d.optionsX,p=d.optionXRefers):"yid"===n&&(f=d.refOptionsY,b=d.optionsY,p=d.optionYRefers),b&&f&&0!==f.length){l=[...b];const e={};for(const n of f){const o=g(p,n.referId),c=await Object(i.e)(n.limitRnd,{state:t});if(0===c)continue;let a=null;const l=Object(s.h)(t,{uuid:n.varId,limit:n.limit,limitSrc:n.limitSrc,limitRnd:n.limitRnd});if(!l)continue;const{valid:d,option:f}=await m(t,l,n);if(!d)continue;f&&(n.refIndex=f.index,n.refRealIndex=f.realIndex);const b={state:t,varInfo:l,specifiedOpt:f,pureText:!u,keepWrap:!0};if(l.question?(a=await Object(s.a)(b),f&&(a.passRef={value:f.value,optComment:f.optComment,image:Object(r.p)(f,"image"),number:f.number,text:f.text,label:f.label,mapping:f.mapping&&{...f.mapping}})):a=await v(b),O(a)){const t={...n,...a},r=n.referId+n.varId;e[r]?e[r].list.push(t):e[r]={list:[t],limitRnd:c,varInfo:l,disorder:o&&o.disorder}}}Object.keys(e).forEach(t=>{const{limitRnd:n,list:r,varInfo:i,disorder:s}=e[t];let u=Object(o.p)(r,n);u=s?Object(a.c)(u):Object(a.e)(u),Object(c.e)(d,i,u),l=l.concat(u)})}else l=b;return h(l,t,d.type)}async function v(t){return{text:await Object(i.c)(t),image:Object(u.b)(t.varInfo)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return ct})),n.d(e,"c",(function(){return at})),n.d(e,"d",(function(){return lt})),n.d(e,"f",(function(){return dt})),n.d(e,"e",(function(){return ft})),n.d(e,"a",(function(){return bt}));var r=n(31),i=n(6),o=n(4),c=n(18),a=n(37),s=n(5);var u=n(0);const l=["select","sequence","menu"];function d(t,e){return e.options?e=function(t,e){if(Object(u.b)().realTimePreview)return e;let n;return l.indexOf(t.type)>-1?n=t=>!!t.text:"select_image"===t.type?n=t=>!!t.image:"slide_rate"===t.type&&(n=t=>!!t.text||!!t.image),n&&(e.options=e.options.filter(n)),e}(t,e):e}var f=n(61),b=n(11),p=n(7);const O={done:!1,expectedValue:"",actualValue:""};function m(t){const{autoInputConfig:e}=t;if(!e)return"";const{defaultValue:n}=e;return n&&Object(p.a)(n).trim()?n:""}const g={};async function j(t,e,n,r,i){if(!m(t))return O;const{parent:o}=e,c=await Object(s.e)(m(t),{state:o});let a=c;return c>=n&&c<=r||(a=i),Object(u.g)(t,{value:a}),{done:!0,actualValue:a,expectedValue:c}}async function h(t,e){const n=g[e.type];if(n){e.parent.context.option=t;const r=await n(t,e);return!!r.done&&(Object(b.c)(e.parent,t,e,r.actualValue,r.expectedValue),!0)}return!1}g.fill=async(t,e)=>{if(!m(t))return O;const{parent:n}=e,r=await Object(s.f)(m(t),{state:n});return Object(u.g)(t,{value:r}),{done:!0,actualValue:r,expectedValue:r}},g.value_mark=(t,e)=>j(t,e,t.minValue,t.maxValue,""),g.icon_mark=(t,e)=>j(t,e,0,t.count,""),g.slide_rate=(t,e)=>{const{rateOptions:n}=e;return j(t,e,0,n.length,"")},g.weight=(t,e)=>j(t,e,0,t.maxValue||e.weightTotal,""),g.sequence=async(t,e)=>{if(!m(t))return O;const n=e.options.length,{parent:r}=e,i=await Object(s.e)(m(t),{state:r});let o=i;return i>=1&&i<=n||(o=-1),Object(u.g)(t,{sortNo:o,selected:o>=1}),{done:!0,actualValue:o,expectedValue:i}};var y=n(21),v=n(1);async function w(t,e){const n=e.parent;n.context.option=t;const r=await function(t,e){return e?Object(y.b)(t,e.options,e.logicType):Object(v.n)(!1)}(n,t.selectConfig);t.autoSelectMarked=!!r}const _=["select","select_icon","select_image","menu","hot_spot"];var x=n(42),T=n(14),I=n(8);async function k(t,e,n,r,i=!1){const o=(n.options||[]).find(n=>n.xid===t.uuid&&n.yid===e.uuid),s={...o,index:o.number,realIndex:o.number,label:o.label||"",xid:t.uuid,yid:e.uuid,xText:t.text,yText:e.text,text:i?t.text:e.text,xNumber:t.number,xMutexNumber:t.mutexNumber,yMutexNumber:e.mutexNumber,yNumber:e.number,renderId:Object(v.h)(o.uuid,n.loopStack),headLength:r,selected:!1},u=await Object(c.c)(s,n.parent,n.type),l=await Object(a.b)(n.parent,u,n);return u.disabled=!l,u}async function N(t,e,n){const{parent:r}=t;return e={...e,customData:{},isOther:!!e.isOtherOpt,_selected:!1,inputType:n||E(e),value:e.value||"",renderId:Object(i.h)(t,e)},r.context.option=e,e.text=await Object(s.d)(e.text,{state:r,usage:{question:t,option:e}}),Object.defineProperty(e,"selected",{get(){return this._selected},set(t){"select-input"===this.inputType&&(t?Object(u.g)(this,{value:this.cachedValue||this.value}):Object(u.g)(this,{cachedValue:this.value,value:""})),Object(u.g)(this,{_selected:t}),t&&-1===this.mutexNumber&&setTimeout(()=>{I.a.trigger("OPT_EXCLUDE",this)}),I.a.trigger("OPT_SELECT",this)}}),e.isOtherOpt&&(await function(t,e){return Object(u.g)(t,{inputType:E(t)}),L(t,e)}(e,t),Object(i.n)(e)||await w(e,t)),function(t){!0===t.useComment?Object(u.g)(t,{placeholder:t.optComment}):"input"===t.inputType&&Object(u.g)(t,{placeholder:t.text})}(e),e}function E(t){let e="select";return Object(i.n)(t)?e="input":!0===t.useComment&&(e="select-input"),e}const S={chars:"count",date:"date",date_range:"dateRange",email:"email",float:"float",integer:"int",phone_number:"mobile",postcode:"postCode",time:"time",time_range:"timeRange",time_duration:"timeSpan",url:"link",auto_complete:"autoComplete",list_select:"dropdown",none:"noValidation"};async function L(t,e){const n=t.fillType;if(!n)return;const{parent:r}=e;let i,o,c,a=await Object(s.e)(t.fillStart,{state:r}),l=await Object(s.e)(t.fillEnd,{state:r});if(isNaN(a)&&(a=void 0),isNaN(l)&&(l=void 0),"date"===n){const t=(new Date).getFullYear(),e=a,n=l;void 0!==a&&(a=new Date(a,0,1),t<e&&(i=a)),void 0!==l&&(l=new Date(l,11,31),t>n&&(i=l))}"auto_complete"===n&&(o=function(t,e=[]){const{autoCpltGroups:n}=t;return e.reduce((t,e)=>{const r=n.find(t=>t.id===e);return r&&(t=t.concat(r.data)),t},[])}(r,t.autoCpltIds),c=Object(T.d)(e.parent.sid));let d=[];if("list_select"===n){d=A((await Object(s.f)(t.selectText,{state:r,joinBy:","})).split(","))}Object(u.g)(t,{inputRule:S[t.fillType]||"noValidation",validateMin:a,validateMax:l,defaultValue:i,completeGroups:o,selectList:d,prevCpltLang:c})}async function C(t,e,n=!1){const{options:i,otherOptions:o,hiddenOptions:c}=t,a={options:[],otherOptions:[],hiddenOptions:[]};if(i)for(const n of Object(r.b)(t,i))a.options.push(await e(n));if(o)for(const e of o)a.otherOptions.push(await N(t,e));if(c)for(const t of c)a.hiddenOptions.push(await e(t));return n&&D([...a.options,...a.otherOptions]),a}const P={};async function M(t,e){if(!t.image||!t.image.reformed){return await Object(c.b)(e,t)}return t.image}function R(t){return t.replace("/outline/","/glyph/")}function A(t){const e={};return t.map(t=>{const n=e[t];if(n){const r=n+1;return e[t]=r,`${t}(${n})`}return e[t]=2,t})}function D(t){A(t.map(t=>t.text)).forEach((e,n)=>{t[n].text=e})}function U(t){return t?"string"==typeof t?t:t.path?Object(u.b)().hostConfig.cdnHost+t.path:"":""}function B(t){const{icon:e}=t,n=U(e);Object(u.g)(t,{icon:n,iconActive:R(n)})}async function q(t,e){const n=await async function(t,e){const n=t;if("matrix"===n.type){const t=await Object(c.e)(e,n,"xid");n.optionsX=await Object(a.c)(e,t,n);const r=await Object(c.e)(e,n,"yid");n.optionsY=await Object(a.c)(e,r,n);const i=await Object(c.d)(n.otherOptions,e,n.type),o=await Object(a.d)(e,i,n);return n.otherOptions=o.visibleList,n}if(n.options){let t=await Object(c.e)(e,n);if(n.otherOptions){const r=await Object(c.d)(n.otherOptions,e,n.type);t=t.concat(r)}const r=await Object(a.d)(e,t,n);return n.options=[],n.otherOptions=[],r.visibleList.forEach(t=>{t.isOtherOpt?n.otherOptions.push(t):n.options.push(t)}),n.hiddenOptions=r.hiddenList,n}return n}(t,e),r=P[n.type],i=r?await r(n):void 0,s=i&&d(n,i);return Object(u.g)(n,s),function(t){const{options:e,otherOptions:n,type:r,parent:i}=t;let c=n||[];_.includes(r)&&(c=[...c,...e]);const a=c.filter(t=>t.autoSelectMarked).reverse();if(Object(o.s)(t))a.forEach(e=>{Object(u.g)(e,{selected:!0}),Object(b.d)(i,e,t)});else{const[e,...n]=a;n.forEach(e=>{e.autoSelectMarked=!1,Object(b.d)(i,e,t,"因冲突被终止")}),e&&(Object(u.g)(e,{selected:!0}),Object(b.d)(i,e,t))}}(n),e.context.option=null,s}P.select=t=>C(t,(async function(e){const n=await N(t,e);return await L(n,t),await w(n,t),n})),P.fill=t=>C(t,(async function(e){const n=await N(t,e,"input");return await L(n,t),n.placeholder=Object(s.k)(n.text),await h(n,t),n})),P.value_mark=t=>C(t,(async function(e){const{parent:n}=t,r=await N(t,e,"input");r.value="";const i=await Object(s.e)(t.markMin,{state:n}),o=await Object(s.e)(t.markMax,{state:n});return Object(u.g)(r,{minValue:i,step:t.markStep,maxValue:o,minValueText:t.minText,maxValueText:t.maxText}),await h(r,t),r})),P.icon_mark=t=>C(t,(async function(e){const n=await N(t,e,"input");return n.value="",Object(u.g)(n,{count:t.markImgCount||5,icon:t.markImgName||"rating-number"}),await h(n,t),n})),P.sequence=async t=>{let e=!1;const n=await C(t,async n=>{const r=await N(t,n,"input");Object(u.g)(r,{icon:"ranking",sortNo:-1});return await h(r,t)&&(e=!0),r});return e&&n.options.sort((t,e)=>t.sortNo>e.sortNo?1:-1),n},P.matrix=async t=>{const e=Object(r.a)(t),{optionsX:n,optionsY:i}=e,{parent:c}=t,a=[];for(const e of n)a.push({...e,text:await Object(s.d)(e.text,{state:c,usage:{question:t,option:e}})});const u=[];for(const e of i)u.push({...e,text:await Object(s.d)(e.text,{state:c,usage:{question:t,option:e}})});const l=[];for(const n of e.otherOptions)l.push(await N(t,n));const d={otherOptions:l,renderOptionsX:a.filter(t=>t.visible),renderOptionsY:u.filter(t=>t.visible)},f=Object(o.r)(t)||Object(o.o)(t),b=await async function(t,e,n,r=!1){const i=[],o=[];let c=t,a=e;r&&(c=e,a=t);for(const[t,e]of c.entries())if(e.visible){const c=e.text.length,s={length:c,text:e.text,list:[]};let u=0;for(const t of a)if(t.visible){let i=e,a=t;r&&(a=e,i=t);const l=await k(i,a,n,c,r);u=Math.max(u,l.text.length),o.push(l),s.list.push(l)}0===t&&s.list.forEach(t=>{t.length=u}),i.push(s)}return{flatten:i,options:o,fullOptions:o}}(a,u,t,f),p=function(t,e,n){const r=[];return e.forEach(e=>{if(e.visible){const i=[];t.forEach(t=>{if(t.visible){const r=n.find(n=>n.xid===t.uuid&&n.yid===e.uuid);if(!r)throw new Error("matrix item not found");i.push(r)}}),r.push(i)}}),{matrix:r}}(a,u,b.options);return{...d,...b,...p}},P.select_image=t=>C(t,async e=>{const n=await N(t,e);return n.text=Object(s.k)(n.text),n.image=await M(n,t),await w(n,t),n}),P.upload=t=>C(t,async e=>{const n=await N(t,e,"input");return n.text=Object(s.k)(n.text),n.icon="camera",n.name="",n.value="",n.fileName="",n.fileType="",n.progress=0,n.isImage=!1,n.fileLimits=[...n.fileLimits||["image"]],n.accept=Object(f.a)(n.fileLimits),n}),P.menu=t=>C(t,async e=>{const n=await N(t,e);return await L(n,t),n.text=Object(s.k)(n.text).trim(),await w(n,t),n},!0),P.select_icon=t=>C(t,async e=>{const n=await N(t,e);return B(n),await w(n,t),n}),P.weight=t=>{const{parent:e}=t;return C(t,async n=>{const r=await N(t,n,"input");let i=await Object(s.e)(r.maxMark,{state:e});const c=await Object(o.h)(t);return(!i||i>c)&&(i=c),Object(u.g)(r,{percent:"0%",color:r.color,maxValue:i,value:""}),await h(r,t),r})},P.cascade=t=>C(t,e=>(e.text="",N(t,e))),P.data=async t=>{const e={state:t.parent,loop:t.loop},n=[];for(const r of t.options){const i=await N(t,r);B(i),Object(u.g)(i,{value:await Object(s.g)(i.value,e),number:await Object(s.g)(i.number,e),optComment:await Object(s.d)(i.optComment,e),image:await Object(c.b)(t,i)}),await w(i,t),n.push(i)}return{options:n}},P.hot_spot=async t=>{const e=await C(t,async e=>{const n=await N(t,e);await L(n,t),await w(n,t);const{area:r,pathD:i}=n.points.reduce((t,e,r)=>{t.pathD?t.pathD+=" L":t.pathD+="M",t.pathD+=e.x+" "+e.y;const i=n.points[r+1];return i?t.area+=e.y+i.y*(i.x-e.x)/2:t.pathD+=" Z",t},{area:0,pathD:""});return Object(u.g)(n,{area:r,pathD:i,transform:`translate(${n.x},${n.y})`}),n});return e.options.sort((t,e)=>t.area<e.area?1:-1),e},P.heat_map=t=>C(t,(async function(e){return await N(t,e,"input")})),P.max_diff=t=>C(t,(async function(e){const n=await N(t,e,"input");return n.value=0,n.image=await M(n,t),n.records=[],n})),P.slide_rate=async t=>{const{rateOptions:e}=t,n=await C(t,async e=>{const n=await N(t,e,"input");return Object(u.g)(n,{image:await M(n,t),text:Object(x.c)(n.text),value:""}),await h(n,t),n}),r=[];for(const n of e){await Object(a.b)(t.parent,n,t)&&r.push(n)}return{...n,rateOptions:r.map(t=>{const{icon:e}=t,n=U(e);return{url:U(e),urlActive:R(n),text:Object(s.a)(t.text),value:t.value,uuid:t.uuid,customData:{}}})}};var V=n(43),F=n(2),$=n(3);const H={typeName:"",typeDescription:""},X={};X.select=async t=>{const e=Object(o.s)(t);let n=Object(F.f)($.a.select.single);if(e){n=Object(F.f)($.a.select.multi);const{min:e,max:r}=await Object(o.e)(t);return{typeName:n,typeDescription:Object(F.f)($.a.select.limitBetween,{min:e,max:r})}}return{typeName:n,typeDescription:""}},X.value_mark=()=>Object(v.n)({typeName:Object(F.f)($.a.mark.value)}),X.icon_mark=()=>Object(v.n)({typeName:Object(F.f)($.a.mark.graph)}),X.weight=t=>{const e=t.weightTotal;let n=Object(F.f)($.a.weight.total,{total:e});return n+=!0===t.relax?Object(F.f)($.a.weight.relax):Object(F.f)($.a.weight.strict),Object(v.n)({typeName:Object(F.f)($.a.weight.name),typeDescription:n})},X.fill=()=>Object(v.n)({typeName:Object(F.f)($.a.fill.name)}),X.slide_rate=()=>Object(v.n)({typeName:Object(F.f)($.a.slideRate.name)}),X.sequence=t=>{const e=t.rankCount,n=Number(e)?Object(F.f)($.a.rank.limitMin,{min:e}):Object(F.f)($.a.rank.limitAll);return Object(v.n)({typeName:Object(F.f)($.a.rank.name),typeDescription:n})},X.menu=async t=>({...await X.select(t),typeName:Object(F.f)($.a.menu.name)}),X.select_icon=t=>X.select(t),X.select_image=t=>X.select(t),X.upload=async t=>{const e=Object(F.f)($.a.upload.name);if(!0===t.limitEnabled){const{min:n,max:r}=await Object(o.g)(t);return{typeName:e,typeDescription:Object(F.f)($.a.upload.amountLimit,{min:n,max:r})}}return{typeName:e,typeDescription:""}},X.location=()=>Object(v.n)({typeName:Object(F.f)($.a.locate.name)}),X.area=()=>Object(v.n)({typeName:Object(F.f)($.a.site.name)}),X.region=()=>Object(v.n)({typeName:Object(F.f)($.a.region.name)}),X.verify=()=>Object(v.n)({typeName:Object(F.f)($.a.verify.name)}),X.cascade=()=>Object(v.n)({typeName:Object(F.f)($.a.cascade.name)}),X.matrix=async t=>{if(Object(o.v)(t))return{typeName:Object(F.f)($.a.matrix.single)};if(Object(o.s)(t)){const{min:e,max:n}=await Object(o.e)(t);let r=Object(F.f)($.a.matrix.multi),i=Object(F.f)($.a.select.limitBetween,{min:e,max:n});return Object(o.n)(t)?(r=Object(F.f)($.a.matrix.multiCol),i=Object(F.f)($.a.matrix.colLimitBetween,{min:e,max:n})):Object(o.o)(t)&&(r=Object(F.f)($.a.matrix.multiRow),i=Object(F.f)($.a.matrix.rowLimitBetween,{min:e,max:n})),{typeName:r,typeDescription:i}}return Object(o.r)(t)?{typeName:Object(F.f)($.a.matrix.singleRow),typeDescription:Object(F.f)($.a.matrix.eachRowOne)}:Object(o.p)(t)?{typeName:Object(F.f)($.a.matrix.singleCol),typeDescription:Object(F.f)($.a.matrix.eachColOne)}:Object(o.q)(t)?{typeName:Object(F.f)($.a.matrix.singleRowCol),typeDescription:Object(F.f)($.a.matrix.eachRowColOne)}:{typeName:Object(F.f)($.a.matrix.single)}},X.hot_spot=()=>Object(v.n)({typeName:Object(F.f)($.a.hotSpot.name)}),X.heat_map=()=>Object(v.n)({typeName:Object(F.f)($.a.heatMap.name)}),X.max_diff=()=>Object(v.n)({typeName:Object(F.f)($.a.maxDiff.name)});var z=n(24);const K=["select","menu","select_image","select_icon","upload"];function G(t){return async function(t){if("sequence"===t.type){const e=Object(i.c)(t);if(1===e.length){const n=e[0];Object(u.g)(n,{selected:!0,sortNo:1}),Object(b.r)(0,t)}}else if(K.indexOf(t.type)>-1){if(!await Object(y.f)(t.showWithSingleRefOpt,t.parent)){const e=Object(i.c)(t)||[];if(1===e.length){const n=e[0];n.isRef&&(Object(u.g)(n,{selected:!0}),Object(b.d)(t.parent,n,t,"single_ref_select_opt"),t.forceSkipReason="single_ref_select_opt",t.autoSkip=!0)}}return t}return t}(t)}var Y=n(40),W=n(60),Z=n(15),Q=n(12),J=n(22),tt=n(10);function et(t){return 1===t?"bottom":2===t?"top":"center"}async function nt(t,e){const{destList:n,cascadeStart:r}=e,c=Object(o.c)(t.nodeList,n,r.uuid);if(!c)return;const a=await async function t(e,n,r,c,a){a?((a=await N(e,a)).text=Object(x.c)(Object(s.k)(a.text)),await L(a,e)):a={uuid:"",text:""};const{nodeList:u}=n,l=c?c+"=>"+Object(v.s)(a.uuid):Object(v.s)(a.uuid),d={option:a,groupId:c,resultId:l,text:a.text||a.optComment};if(!r)return d;d.placeholder=r.placeholder||Object(F.f)($.a.menu.clickToSelect),(r={...r,options:await rt(r,n,e)}).parent=n;const f=Object(o.s)(r),{min:b,max:p}=await Object(o.e)(r),{destList:O,output:m}=r,g=Object(o.i)(r),j=[],h=f?Object(F.f)($.a.cascade.selectBetween,{min:b||1,max:p}):Object(F.f)($.a.cascade.selectSome,{amount:1}),y={...d,list:j,multiple:f,min:b,max:p,hint:h,required:g,display:et(r.menuType),multiLine:r.lineCount},w=Object(o.c)(u,O,m.uuid),_=Object(i.c)(r);D(_);for(const r of _){const i=Object(o.c)(u,O,r.uuid)||w,c=await t(e,n,i,l,r);j.push(c)}return y}(e,t,c,"");e.cascade=a}async function rt(t,e,n){let i=n.cachedCasMenuOpts;i||(i=n.cachedCasMenuOpts={});const o=i[t.nodeUuid];if(o)return o;{const o=await Object(c.e)(e,t),s=await Object(a.d)(e,o,n),u=Object(r.b)(t,s.visibleList);return i[t.nodeUuid]=u,u}}function it(t,e,n){const r=function(t){const e=[];return t.forEach(t=>{const{pickedTimes:n}=t;e[n]?e[n].push(t):e[n]=[t]}),e}(t),i={items:[],done:!1};let o=e;for(const t of r)if(t){const e=Object(v.p)(t,o);if(e.forEach(t=>{i.items.push({option:t.option,value:0,round:n}),t.option.records.push({round:n,value:0}),t.pickedTimes+=1}),o-=e.length,0===o)break}return i}function ot(t){const{options:e,itemCountPerTask:n,taskCount:r}=t,i=e.map(t=>({option:t,pickedTimes:0})),o=[];for(let t=0;t<r;t++)o.push(it(i,n,t+1));return o}function ct(t){const{current:e,renderList:n}=t,r=[e],i=n.indexOf(e);let c=i-1,a=e;for(;;){const t=n[c--];if(!Object(o.t)(t,a))break;Object(o.w)(t)||(r.unshift(t),a=t)}let s=i+1,l=e;for(;;){const t=n[s++];if(!Object(o.t)(t,l))break;Object(o.w)(t)||(r.push(t),l=t)}return r[0].groupSingle&&(r.forEach(t=>{Object(u.g)(t,{pageEnd:!1,pageStart:!1})}),Object(u.g)(r[0],{pageStart:!0}),Object(u.g)(r[r.length-1],{pageEnd:!0})),r}function at(t){const e=t.first();return e&&e.groupSingle}function st(t){return["province","city","county","street"].indexOf(t)+1||1}const ut={};async function lt(t){const e=t,{parent:n}=e,r=await Object(s.d)(e.describe,{state:n,usage:{question:e,exclusiveId:"description"}});Object(u.g)(e,{description:r})}async function dt(t,e){const n={...t,dynamicNodeProps(){Object(u.g)(this,{hasAnswer:Object(Z.d)(this),next:Object(Q.e)(this).next})}};if(o.y.indexOf(n.type)>-1)return async function(t,e){t.parent=e,Object(u.g)(t,{autoSkip:!0,renderId:Object(o.f)(t),number:""});const n=ut[t.type];return n&&await n(t),t}(n,e);const{qNumberRequired:r}=e;n.parent=e;const i=Object(o.f)(n);Object(u.g)(n,{customData:{},template:await Object(u.c)().ui.initNodeTemplate(n.template,e,n.loop),startTime:(new Date).toISOString(),costTime:0,realtimePreview:Object(u.b)().realTimePreview,validateFailTimes:0,renderId:i,images:await Object(c.a)(e,n),asterisks:!0===n.answerRequired&&e.asterisksRequired,selectType:Object(o.s)(n)?"checkbox":"radio",value:""}),await q(n,e);const a=ut[n.type];a&&await a(n),e.context.question=n,await async function(t){const e=t,{loop:n,parent:r}=e,i=await Object(s.d)(e.questionText,{spaceRep:" ",state:r,usage:{question:e,exclusiveId:"title"}});let o=e.nodeName.split("/")[0];if(o&&e.circleNode1Id&&!e.lockLoopCount&&!Object(u.b)().realTimePreview){const t=Object(J.a)();let i=await t.C_OL_LBL.getText({state:r});if(i||(i=n.node.nodeName+"_"+await t.C_OL_IDX.getText({state:r})),o=i+"_"+o,e.circleNode2Id){let e=await t.C_IL_LBL.getText({state:r});e||(e=n.node.nodeName+"_"+await t.C_IL_IDX.getText({state:r})),o=e+"_"+o}}Object(u.g)(e,{title:i,realNodeName:o})}(n),await lt(n),r&&function(t){"end"!==t.type&&"describe"!==t.type&&Object(u.g)(t,{number:t.realNodeName})}(n),Object(u.c)().dev.infer||Object(u.g)(n,await async function(t){if(!t.parent.nodeTypeInfoRequired)return H;const e=X[t.type],n=e?await e(t):H;return n.typeDescription="",n}(n)),Object(o.z)(n);return Object(T.i)(await G(n))}async function ft(t,e,n){const r=await dt({origin:t,...t,parent:n,activityName:e.activityName,rewardName:e.rewardName,rewardTime:e.sendTime,goal:e.goal,rewardNodeId:e.rewardNodeId,rewardCount:e.lotteryCount,rewardImage:e.rewardImage,rewardTitle:e.rewardTitle,rewardDescribe:e.rewardDescribe,rewardList:t.showRewards?t.options.map(t=>({rewardName:t.rewardName,rewardNumbering:t.rewardCount})):null},n);if(!Object(u.b)().preview){const{formalResult:{reward:t}}=n;!Object(u.c)().app.canHandleReward()&&t&&"red_envelope"===t.type&&await bt(n,r)}return r}async function bt(t,e){const{formalResult:{reward:n,authorizer:r},nodeList:i}=t,{app_id:c,component_appid:a}=r,l=Object(o.a)(i,n.gift_id),d=await Object(s.h)(l.linkUrl,{state:t});e.linkUrl=d,e.endBtnText=l.endBtnText||"";const f={rid:Object(p.a)(n.id),aid:c,cid:a,qid:t.surveyId,tid:t.transactionID,sid:Object(tt.c)().sid};l.template&&(f.rtpl=l.template.id),e.qrCode=Object(u.c)().app.getRewardUrl(f)}ut.select=t=>(Object(u.g)(t,{quesType:"choice"}),Object(v.n)()),ut.region=t=>(Object(u.g)(t,{quesType:"region",indexes:"0 0 0",value:"",regions:Object(V.d)(),grade:st(t.infoRange),placeholder:Object(F.f)($.a.menu.clickToSelect)}),Object(v.n)()),ut.describe=t=>(Object(u.g)(t,{quesType:"intro-page"}),Object(v.n)()),ut.end=async t=>{const{parent:e}=t,n=await Object(s.h)(t.linkUrl,{state:e});Object(u.g)(t,{quesType:"end-page",hasReward:!1,logoText:t.parent.customText,logoImage:t.parent.customLogo,linkUrl:n})},ut.fill=t=>(Object(u.g)(t,{quesType:"short-text"}),Object(v.n)()),ut.gift=t=>(Object(u.g)(t,{quesType:"reward"}),Object(v.n)()),ut.select_icon=t=>(Object(u.g)(t,{quesType:"icon"}),Object(v.n)()),ut.location=t=>(Object(u.g)(t,{quesType:"location",regions:Object(V.d)(),grade:st(t.infoRange),value:""}),Object(v.n)()),ut.lottery=t=>(Object(u.g)(t,{quesType:"lottery"}),Object(v.n)()),ut.value_mark=t=>(Object(u.g)(t,{quesType:"range"}),Object(v.n)()),ut.icon_mark=t=>(Object(u.g)(t,{quesType:"rating"}),Object(v.n)()),ut.matrix=t=>(Object(u.g)(t,{quesType:"matrix"}),Object(v.n)()),ut.menu=t=>(Object(u.g)(t,{quesType:"dropdown",value:"",placeholder:t.placeholder||Object(F.f)($.a.menu.clickToSelect),icon:"arrows-small-down",...Object(o.e)(t),multiple:Object(o.s)(t),display:et(t.menuType),multiLine:t.lineCount}),Object(v.n)()),ut.select_image=t=>(Object(u.g)(t,{quesType:"picture-choice"}),Object(v.n)()),ut.sequence=t=>(Object(u.g)(t,{quesType:"ranking"}),Object(v.n)()),ut.area=t=>(Object(u.g)(t,{quesType:"location",grade:3,regions:Object(V.d)()}),Object(v.n)()),ut.upload=t=>(Object(u.g)(t,{quesType:"file-upload"}),Object(v.n)()),ut.verify=t=>(Object(u.g)(t,{quesType:"verification",value:"",phoneNumber:"",code:""}),Object(v.n)()),ut.weight=async t=>{const e=await Object(o.h)(t);Object(u.g)(t,{quesType:"weight",weightTotal:e})},ut.max_diff=t=>(Object(u.g)(t,{quesType:"max-diff",tasks:ot(t)}),Object(v.n)()),ut.cascade=async t=>{await nt(t.parent,t),function(t){const e=[],n=t=>{e.push(t),t.list&&t.list.forEach(t=>n(t))};n(t.cascade),t.options.forEach(t=>{if(t.useComment){const n=e.find(e=>e.resultId===t.cascadePath);t.inputType=E(n.option)}})}(t),function t(e,n,r,i,o=""){const{resultId:c,text:a}=n,s=c&&e.options.find(t=>t.cascadePath===c),u=o?o+"=>"+a:a;return s&&(s.text=u),r.nodeTypeInfoRequired||(n.hint=""),n.list&&n.list.forEach(n=>{n.text=t(e,n,r,i,u)}),n.text}(t,t.cascade,t.parent,t.loop,""),Object(u.g)(t,{quesType:"cascade"}),t.options=t.options.filter(t=>!!t.text),Object(Y.c)(t,t.options)},ut.data=t=>(Object(u.g)(t,{quesType:"intro-page"}),Object(v.n)()),ut.hot_spot=t=>(Object(u.g)(t,{quesType:"hot-spot",mapImage:t.mapImage&&Object(z.b)(t.mapImage)}),Object(v.n)()),ut.heat_map=t=>(Object(u.g)(t,{quesType:"heat-map",clickTimes:0,mapImage:t.mapImage&&Object(z.b)(t.mapImage)}),Object(v.n)()),ut.slide_rate=t=>(Object(u.g)(t,{quesType:"slide-rate"}),Object(v.n)()),ut.loop=async t=>{const{parent:e}=t;if(!Object(W.a)(t,e)){const n=await Object(W.b)(e,t);t.varList=n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return b})),n.d(e,"c",(function(){return p}));var r=n(14),i=n(11),o=n(0),c=n(2),a=n(3),s=n(1),u=n(8);class l{constructor(t,e){if(t&&t.data&&Object.keys(t.data).length>0){const{langResume:n}=e;this.holder=t,this.state=e,this.show=!0,this.title=n?Object(c.f)(a.a.langResume.title):Object(c.f)(a.a.memory.title),this.message=n?"":Object(c.f)(a.a.memory.message),this.sureText=n?"":Object(c.f)(a.a.memory.sure),this.denyText=n?"":Object(c.f)(a.a.memory.deny)}}handleSure(){if(!this.holder||b())return Object(s.n)();const t=this;return Object(o.g)(t,{sureText:"",denyText:"",show:!0,resuming:!0}),Object(i.w)(this.state,t.holder.responseId||""),Object(r.g)(this.holder,this.state,{onEnd(){t.end()},onProgress(e){Object(o.g)(t,{show:!0}),Object(o.g)(t,{message:e})},onSuspend(){t.suspend()}})}handleDeny(){b()||(Object(r.b)(this.state),this.end())}end(){Object(o.g)(this,{show:!1,holder:null,message:"",resuming:!1}),p()}suspend(){Object(o.g)(this,{show:!1})}}let d=null;function f(t){const e=Object(r.e)(t.sid);return d=new l(e,t),d}function b(){return d&&d.resuming}function p(){b()||u.a.trigger("UPDATE_UI")}},function(t,e,n){"use strict";n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return O})),n.d(e,"e",(function(){return m})),n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return j})),n.d(e,"f",(function(){return h}));var r=n(17),i=n(1),o=n(5),c=n(15),a=n(13),s=n(7);const u={1:(t,e,n)=>(e>n&&([e,n]=[n,e]),u[5](t,e,0)&&u[6](t,n,0)),2:(t,e,n)=>!u[1](t,e,n),11:(t,e)=>{const n=Object(s.a)(t).split(",").filter(t=>""!==t.trim()),r=Object(s.a)(e).split(",").filter(t=>""!==t.trim());return n.some(t=>(t=t.trim(),r.some(e=>(e=e.trim(),t.indexOf(e)>-1))))},12:(t,e)=>!u[11](t,e,0),3:(t,e)=>Object(s.a)(t)===Object(s.a)(e),4:(t,e)=>!u[3](t,e,0),5:(t,e)=>{const n=Object(s.c)(t),r=Object(s.c)(e);return"number"==typeof n&&"number"==typeof r?n>r:Object(s.a)(n)>Object(s.a)(r)},6:(t,e)=>{const n=Object(s.c)(t),r=Object(s.c)(e);return"number"==typeof n&&"number"==typeof r?n<r:Object(s.a)(n)<Object(s.a)(r)},7:(t,e)=>!u[6](t,e,0),8:(t,e)=>!u[5](t,e,0),9:(t,e)=>{const n=Object(s.a)(t).split(",").filter(t=>""!==t.trim()),r=Object(s.a)(e).split(",").filter(t=>""!==t.trim());return n.some(t=>(t=t.trim(),r.some(e=>(e=e.trim())===t)))},10:(t,e)=>!u[9](t,e,0),13:t=>Object(s.a)(t).split(",").every(t=>""===t.trim()),14:(t,e)=>!u[13](t,e),15:(t,e)=>!u[16](t,e),16:(t,e)=>Object(s.a)(t).split(",").every(t=>{const e=t.trim();return"false"===e||""===e})},l={request:t=>!!t,bool:t=>!!t,mark:(t,e)=>l.input(t,e),input:(t,e)=>{const{markId:n,markStart:r,markEnd:i}=e;return u[n](t,r,i)}};function d(t,e){"string"==typeof t&&(t=Object(o.k)(t));const n=l[e.limitType],r=n?n(t,e):!!t;return{value:r,reason:r?void 0:{type:"value_unmatch",expected:e.markStart,expectedEnd:e.markEnd,limit:e.markId,actual:t}}}async function f(t,e){const{text:n}=t.relatedEmbed,r=O(t.markId)?",":void 0;return d(await Object(o.d)(n,{state:e,joinBy:r}),t)}async function b(t,e){const{relatedVarId:n}=t,r=Object(a.h)(e,{uuid:n});if(!r)return{value:!1,reason:{type:"var_not_found"}};const i=O(t.markId)?",":void 0;return d(await Object(o.c)({state:e,varInfo:r,joinBy:i}),t)}function p(t,e){const{loopStack:n,renderList:o}=t,{relatedNodeId:a,relatedOptionId:s,limitType:u,markId:d}=e,f=Object(i.h)(a,n),b=Object(r.a)(o,f);if(!b)return-2===d?{value:!0}:{value:!1,reason:{type:"node_not_found",nodeId:a}};const p=Object(c.a)(b);if(!p||!p.items)return-2===d?{value:!0}:{value:!1,reason:{type:"answer_not_found",nodeId:a}};const O=p.items.find(t=>function(t,e){return Object(i.l)(t.option_id,e)}(t,s)),m=l[u];if(m){const t=O?Object(c.c)(O):"",n=m(t,e),r={value:n};return n||(r.reason={type:"node_unmatch",limit:d,actual:t,expected:e.markStart,expectedEnd:e.markEnd,nodeId:a,optionId:s}),r}{const t=-2===d?!O:!!O,e={value:t};return t||(e.reason={type:"node_unmatch",limit:d,nodeId:a,optionId:s,expected:-1===d,actual:2===d}),e}}function O(t){return 9===t||10===t||11===t||12===t||13===t||14===t||15===t||16===t}async function m(t,e){return{start:O(t.markId)?await Object(o.f)(t.markStart,{state:e,joinBy:","}):await Object(o.g)(t.markStart,{state:e}),end:await Object(o.g)(t.markEnd,{state:e})}}async function g(t,e,n){return(await j(t,e,n)).value}async function j(t,e,n){if(!e)return{value:!0};const r=[];for(const n of e){const e={...n},{relatedVarId:i,relatedEmbed:o,isGroup:c,groupLogicList:a,groupLogicType:s}=e,{start:u,end:l}=await m(e,t);let d;e.markEnd=l,e.markStart=u,d=c?await j(t,a,s):o?await f(e,t):i?await b(e,t):p(t,e),r.push(d)}return{value:!r["and"===n?"some":"every"](t=>!t.value),details:r}}function h(t,e){return"object"==typeof t&&null!==t?g(e,t.options,t.logicType):Object(i.n)(!!t)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return g})),n.d(e,"b",(function(){return w})),n.d(e,"a",(function(){return x}));var r=n(51),i=n(16),o=n(13),c=n(6),a=n(1),s=n(7),u=n(41);function l(t){t.OPT_INPUT.getText=t=>{const e=Object(c.p)(t.specifiedOpt,"value");return Object(a.n)(e)},t.OPT_LABEL.getText=t=>{const e=t.specifiedOpt.label||"";return Object(a.n)(e)},u.a.forEach(e=>{!function(e){const n=e.split("_")[1];t["OPT_MAP_"+n].getText=t=>{const{specifiedOpt:n}=t,{mapping:i}=n,o=Object(r.b)(i,e,t);return Object(a.n)(o)}}(e),function(e){const n=e.split("_")[1];t["OPT_ASTV_"+n].getText=t=>{const n=t.specifiedOpt.assistValue,r=n&&n[e]||"";return Object(a.n)(r)}}(e)}),t.OPT_MARK.getText=t.OPT_INPUT.getText,t.OPT_TEXT.getText=t=>{const e=t.specifiedOpt,n=Object(c.e)(e);if(n)return Object(a.n)(n);const r=e.xText?e.xText+"_"+e.yText:Object(c.p)(e,"text");return Object(a.n)(r)},t.OPT_NUMBER.getText=t=>{const e=Object(s.a)(t.specifiedOpt.number);return Object(a.n)(e)},t.OPT_RANK.getText=t=>{const e=t.specifiedOpt.sortNo;return Object(a.n)(Object(s.a)(e))},t.OPT_TEXT_X.getText=t=>{const e=t.specifiedOpt.xText;return Object(a.n)(e)},t.OPT_TEXT_Y.getText=t=>{const e=t.specifiedOpt.yText;return Object(a.n)(e)},t.OPT_NUMBER_X.getText=t=>{const e=t.specifiedOpt.xNumber;return Object(a.n)(Object(s.a)(e))},t.OPT_NUMBER_Y.getText=t=>{const e=t.specifiedOpt.yNumber;return Object(a.n)(Object(s.a)(e))},t.OPT_IMAGE.getText=t=>{const{varInfo:{imgSize:e},specifiedOpt:n,pureText:r}=t,o=Object(c.p)(n,"image");if(r)return Object(a.n)(n.text);if(o){const t=Object(i.b)(o.url,e,o.originName);return Object(a.n)(t)}return Object(a.n)("")},t.OPT_ICON.getText=t=>{const e=t.specifiedOpt.text;return Object(a.n)(e)},t.OPT_COUNT.getText=async t=>{const e=await Object(o.b)(t);return Object(s.a)(e.length)}}var d=n(49),f=n(54);function b(t,e){!function(t,e){e.forEach(e=>{const n=t[e];"function"==typeof n.getText&&(n.getBool=async function(t){const e=await this.getText(t);return!Object(s.b)(e)})}),t.OPT_COUNT.getBool=async function(t){return!!await this.getText(t)}}(t,e),t.OPT_SAME_MARK.getBool=async t=>{const e=await Object(o.b)(t);return function(t,e){if(Object(s.b)(e))return!0;(e<0||e>t.length)&&(e=t.length);const n={};for(const r of t){const t=r.value;if(n[t]?n[t]+=1:n[t]=1,n[t]>=e)return!0}return!1}(e,e.length)},t.OPT_DIFF_MARK.getBool=async t=>{const e=await Object(o.b)(t);return function(t,e){if(Object(s.b)(e))return!0;(e<0||e>t.length)&&(e=t.length);const n={};for(const r of t)if(n[r.value]=!0,Object.keys(n).length>=e)return!0;return!1}(e,e.length)},t.OPT_SAME_VALUE.getBool=t.OPT_SAME_MARK.getBool,t.OPT_SAME_VALUE.getText=t.OPT_SAME_MARK.getText,t.OPT_DIFF_VALUE.getBool=t.OPT_DIFF_MARK.getBool,t.OPT_DIFF_VALUE.getText=t.OPT_DIFF_MARK.getText,t.FAIL_SKIP.getBool=t=>{const e=t.varInfo.question;return Promise.resolve(!!e.failedSkipActivated)},t.FAILED.getBool=t=>{const e=t.varInfo.question;return Object(a.n)(!!e.failed)},t.SUCCEED.getBool=t=>{const e=t.varInfo.question;return Object(a.n)(!!e.succeed)},t.USED_PHONE.getBool=t=>Object(a.n)(!!t.state.phoneUsed),t.VALIDATE_FAILED.getBool=t=>Object(a.n)(t.varInfo.question.validateFailed),t.Q_TIME_OVER.getBool=t=>{const{maxAnswerTime:e,costTime:n}=t.varInfo.question,r=1e3*e;return Object(a.n)(!!(r&&n&&r<n))},t.Q_TIME_LESS.getBool=t=>{const{minAnswerTime:e,costTime:n}=t.varInfo.question,r=1e3*e;return Object(a.n)(!!(r&&n&&r>n))},function(t,e){function n(t){return this.getBool(t)}e.forEach(e=>{const r=t[e];"function"==typeof r.getBool&&r.getText===g&&(r.getText=n)})}(t,e)}var p=n(42),O=n(45),m=n(39);const g="waiting fo extend";let j=!1;Math.avg=(...t)=>{let e=0;const n=t.length;for(let r=0;r<n;r++)e+=Number(t[r]);return e/n};const h={YEAR:{uuid:"YEAR",type:"var-string",getText:g},MONTH:{uuid:"MONTH",type:"var-string",getText:g},DATE:{uuid:"DATE",type:"var-string",getText:g},DAY:{uuid:"DAY",type:"var-string",getText:g},URL_KEY:{uuid:"URL_KEY",type:"var-string",getText:g},QUES_ID:{uuid:"QUES_ID",type:"var-string",getText:g},WX_ID:{uuid:"WX_ID",type:"var-string",getText:g},WX_SRC:{uuid:"WX_SRC",type:"var-string",getText:g},WX_NAME:{uuid:"WX_NAME",type:"var-string",getText:g},WX_UN_ID:{uuid:"WX_UN_ID",type:"var-string",getText:g},RES_ID:{uuid:"RES_ID",type:"var-string",getText:g},CLTR_ID:{uuid:"CLTR_ID",type:"var-string",getText:g},CLTR_CODE:{uuid:"CLTR_CODE",type:"var-string",getText:g},CLTR_NAME:{uuid:"CLTR_NAME",type:"var-string",getText:g},CURR:{uuid:"CLANG",type:"var-string",getText:g},LKTP:{uuid:"LKTP",type:"var-string",getText:g},START_TIME:{uuid:"S_T",type:"var-string",getText:g},COST_TIME:{uuid:"C_T",type:"var-string",getText:g},DVC_OSN:{uuid:"DVC_OSN",type:"var-string",getText:g},DVC_OSV:{uuid:"DVC_OSV",type:"var-string",getText:g},DVC_BRSN:{uuid:"DVC_BRSN",type:"var-string",getText:g},DVC_BRSV:{uuid:"DVC_BRSV",type:"var-string",getText:g},DVC_VDR:{uuid:"DVC_VDR",type:"var-string",getText:g},DVC_MDL:{uuid:"DVC_MDL",type:"var-string",getText:g},DVC_TYPE:{uuid:"DVC_TYPE",type:"var-string",category:"DEVICE",getText:g},RESULT:{uuid:"RESULT",type:"var-string",getText:g},C_OPT_TEXT:{uuid:"COTTX",type:"var-string",getText:g},C_OPT_NUM:{uuid:"CONUM",type:"var-string",getText:g},C_OPT_VAL:{uuid:"COVAL",type:"var-string",getText:g},C_OPT_LBL:{uuid:"COLBL",type:"var-string",getText:g},C_OPT_IPT:{uuid:"COIPT",type:"var-string",category:"CTPT",getText:g},C_OPT_ASI:{uuid:"COASI",type:"var-string",category:"CTPT",getText:g},C_OL_TXT:{uuid:"COLTXT",type:"var-string",getText:g},C_OL_IDX:{uuid:"COLIDX",type:"var-string",getText:g},C_OL_VAL:{uuid:"COLVAL",type:"var-string",getText:g},C_OL_NUM:{uuid:"COLNUM",type:"var-string",getText:g},C_OL_LBL:{uuid:"COLLBL",type:"var-string",getText:g},C_IL_TXT:{uuid:"CILTXT",type:"var-string",getText:g},C_IL_IDX:{uuid:"CILIDX",type:"var-string",getText:g},C_IL_VAL:{uuid:"CILVAL",type:"var-string",getText:g},C_IL_NUM:{uuid:"CILNUM",type:"var-string",getText:g},C_IL_LBL:{uuid:"CILLBL",type:"var-string",getText:g},POSITION:{uuid:"_P_OS",type:"var-string",getText:g},FAIL_SKIP:{uuid:"L_FAIL_SKIP",type:"var-bool",getText:g,getBool:g},FAILED:{uuid:"L_FAILED",type:"var-bool",getText:g,getBool:g},SUCCEED:{uuid:"L_SUCCEED",type:"var-bool",getText:g,getBool:g},COUNTRY:{uuid:"_C_NTY",type:"var-string",getText:g},PROVINCE:{uuid:"_P_ROV",type:"var-string",getText:g},CITY:{uuid:"_C_ITY",type:"var-string",getText:g},DISTRICT:{uuid:"_D_TRT",type:"var-string",getText:g},QUES_IMAGE:{uuid:"QI",type:"var-media",getText:g,getImages:g},QUES_TEXT:{uuid:"QT",type:"var-string",getText:g},QUES_LABEL:{uuid:"QL",type:"var-string",getText:g},QUES_DESC:{uuid:"QD",type:"var-string",getText:g},QUES_NAME:{uuid:"QN",type:"var-string",getText:g},PHONE_NUMBER:{uuid:"PN",type:"var-string",getText:g},PASSWORD:{uuid:"PSW",type:"var-string",getText:g},USED_PHONE:{uuid:"UPN",type:"var-bool",getText:g,getBool:g},VALIDATE_FAILED:{uuid:"VF",type:"var-bool",getText:g,getBool:g},VALIDATE_FAIL_TIMES:{uuid:"VFT",type:"var-expression",getText:g,getBool:g},QUES_TIME:{uuid:"DRTN",type:"var-string",getText:g,getBool:g},QUES_RS:{uuid:"QRS",type:"var-string",getText:g},Q_TIME_OVER:{uuid:"QTOR",type:"var-bool",getText:g,getBool:g},Q_TIME_LESS:{uuid:"QTLS",type:"var-bool",getText:g,getBool:g},MATCHED_OPTS:{uuid:"MTO",type:"var-string",filter:g},UNMATCHED_OPTS:{uuid:"UMTO",type:"var-string",filter:g},MARKED_OPTS:{uuid:"MKO",type:"var-string",filter:g},UNMARKED_OPTS:{uuid:"UMKO",type:"var-string",filter:g},RANKED_OPTS:{uuid:"RKO",type:"var-string",filter:g},UNRANKED_OPTS:{uuid:"URKO",type:"var-string",filter:g},CHECKED_OPTS:{uuid:"CKO",type:"var-string",filter:g},UNCHECKED_OPTS:{uuid:"UCKO",type:"var-string",filter:g},INPUTTED_OPTS:{uuid:"INO",type:"var-string",filter:g},UN_INPUTTED_OPTS:{uuid:"UINO",type:"var-string",filter:g},ALL_OPTS:{uuid:"ALO",type:"var-string",filter:g},SPECIFIED_OPT:{uuid:"SPO",type:"var-string"},OPT_TEXT:{uuid:"OTXX",type:"var-string",getText:g},OPT_TEXT_X:{uuid:"OTXY",type:"var-string",getText:g},OPT_TEXT_Y:{uuid:"OTX",type:"var-string",getText:g},OPT_NUMBER:{uuid:"ONM",type:"var-string",getText:g},OPT_NUMBER_X:{uuid:"ONMX",type:"var-string",getText:g},OPT_NUMBER_Y:{uuid:"ONMY",type:"var-string",getText:g},OPT_IMAGE:{uuid:"OMG",type:"var-media",getText:g,getImages:g},OPT_ICON:{uuid:"OIC",type:"var-string",getText:g,getIcon:g},OPT_MARK:{uuid:"OMA",type:"var-string",getText:g},OPT_RANK:{uuid:"ORA",type:"var-string",getText:g},OPT_INPUT:{uuid:"OIN",type:"var-string",getText:g},OPT_LABEL:{uuid:"OLB",type:"var-string",getText:g},OPT_COUNT:{uuid:"OCT",type:"var-expression",inBunch:!0,getText:g},OPT_SAME_MARK:{uuid:"OSM",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_DIFF_MARK:{uuid:"ODM",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_SAME_VALUE:{uuid:"OSV",type:"var-bool",inBunch:!0,getBool:g,getText:g},OPT_DIFF_VALUE:{uuid:"ODV",type:"var-bool",inBunch:!0,getBool:g,getText:g},EXP_PLUS:{uuid:"EP",type:"var-expression",expOpr:"+"},EXP_MINUS:{uuid:"EM",type:"var-expression",expOpr:"-"},EXP_MULTIPLY:{uuid:"EPL",type:"var-expression",expOpr:"*"},EXP_DIVIDE:{uuid:"ED",type:"var-expression",expOpr:"/"},EXP_SUM:{uuid:"ES",type:"var-expression",expOpr:"(",split:"+"},EXP_MIN:{uuid:"EMN",type:"var-expression",expOpr:"Math.min(",split:","},EXP_MAX:{uuid:"EMX",type:"var-expression",expOpr:"Math.max(",split:","},EXP_AVG:{uuid:"EAG",type:"var-expression",expOpr:"Math.avg(",split:","},EXP_RD:{uuid:"ERD",type:"var-expression",expOpr:"Math.round(",split:"+"},EXP_FLR:{uuid:"EFLR",type:"var-expression",expOpr:"Math.floor(",split:"+"},EXP_CL:{uuid:"ECL",type:"var-expression",expOpr:"Math.ceil(",split:"+"},EXP_OP:{uuid:"EOP",type:"var-expression"},EXP_CP:{uuid:"ECP",type:"var-expression"},BOOL_AND:{uuid:"BAND",type:"var-bool",blOpr:"&&"},BOOL_OR:{uuid:"BOR",type:"var-bool",blOpr:"||"},BOOL_NOT:{uuid:"BNOT",type:"var-bool",blOpr:"!"},BOOL_OP:{uuid:"BOP",type:"var-bool",blOpr:"("},BOOL_CP:{uuid:"BCP",type:"var-bool",blOpr:")"},LOOP:{uuid:"LP",type:"var-loop",getText:g,getImages:g},LOOP_IMG:{uuid:"LPIMG",type:"var-loop",getText:g,getImages:g},LOOP_INDEX:{uuid:"LPIDX",type:"var-loop",getText:g},LOOP_VAL:{uuid:"LPVAL",type:"var-loop",getText:g},LOOP_NUM:{uuid:"LPNUM",type:"var-loop",getText:g},LOOP_LBL:{uuid:"LPLBL",type:"var-loop",getText:g}};for(const t of O.a){const e="LANG_"+t.id.toUpperCase(),n=e;h[e]={uuid:n,type:"var-string",getText:()=>Object(a.n)(t.id)}}for(let t=2;t<21;t++){const e="URL_KEY_"+t;h[e]={uuid:e,type:"var-string",getText:g}}function y(t,e){const n=e.optionMappingHeads;if(n){const e=n.find(e=>e.field==="field_"+t);if(e)return{type:"image"===e.type?"var-media":"var-string"}}return null}for(let t=1;t<7;t++)h["OPT_ASTV_"+t]={uuid:"OASTV_"+t,type:"var-string",getText:g},h["OPT_MAP_"+t]={uuid:"OM_"+t,type:"var-string",getText:g,getDynamicProps:e=>y(t,e)},h["C_OPT_MAP_"+t]={uuid:"COMAP"+t,type:"var-string",getText:g},h["C_OL_MAP_"+t]={uuid:"COLMAP"+t,type:"var-string",getText:g},h["C_IL_MAP_"+t]={uuid:"CILMAP"+t,type:"var-string",getText:g},h["LOOP_MAP_"+t]={uuid:"LPMAP"+t,type:"var-loop",getText:g};const v=Object.keys(h);function w(t,e){for(const n of v)if(h[n].uuid===t){let t=h[n];if(t.getDynamicProps&&e){const n=t.getDynamicProps(e);n&&(t={...t,...n})}return t}}function _(){j||(!function(){const t=[];v.forEach(e=>{if(!(h[e]instanceof Function)){if(t.indexOf(h[e].uuid)>0)throw new Error("error duplicated uuid in implicit var config: "+h[e].uuid);t.push(h[e].uuid)}})}(),Object(r.a)(h),Object(m.c)(h),Object(m.b)(h),l(h),function(t){async function e(t,e){const{varInfo:n,needOtherOpt:r}=t,i=n.question,o=Object(c.b)(i),a=[];for(const n of o)!r&&n.isOtherOpt||e&&!e(n,i)||!await Object(d.b)({...t,specifiedOpt:n})||a.push(n);return a}t.MATCHED_OPTS.filter=t=>e(t,f.c),t.RANKED_OPTS.filter=t.MATCHED_OPTS.filter,t.CHECKED_OPTS.filter=t.MATCHED_OPTS.filter,t.UNMATCHED_OPTS.filter=t=>e(t,f.e),t.UNRANKED_OPTS.filter=t.UNMATCHED_OPTS.filter,t.UNCHECKED_OPTS.filter=t.UNMATCHED_OPTS.filter,t.MARKED_OPTS.filter=t=>e(t,f.b),t.INPUTTED_OPTS.filter=t.MARKED_OPTS.filter,t.UNMARKED_OPTS.filter=t=>e(t,f.d),t.UN_INPUTTED_OPTS.filter=t.UNMARKED_OPTS.filter,t.ALL_OPTS.filter=t=>{if(!Object(d.a)(t)){const e=t.varInfo.question.options;return Object(a.n)(e)}return e(t)}}(h),b(h,v),Object(p.a)(h),function(){let t="";if(v.forEach(e=>{const n=h[e];if(["filter","getText","getImages","getIcon","getBool"].forEach(r=>{n[r]===g&&(t+=e+"=>"+r+"\n")}),n.getText){const t=n.getText;n.getText=async function(e){const{keepWrap:n}=e,r=t.apply(this,arguments),i=await r;if("string"==typeof i&&!n){const t=/<span var-name=".+?" class="var-light var-(\w+?)">(.+?)<\/span>/g;return Object(s.a)(i).replace(t,(t,e,n)=>"media"===e?t:n)}return Object(s.b)(i)?"":i}}}),t)throw new Error("lack var implement for:\n"+t)}(),j=!0)}function x(){return j||_(),h}_()},function(t,e,n){"use strict";n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u})),n.d(e,"d",(function(){return l})),n.d(e,"f",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"c",(function(){return b}));var r=n(7),i=n(21),o=n(5);function c(t,e){if(Object(r.b)(e)||t.length<=e)return[...t];return a(t.map(t=>({...t.option,cascade:t})),e).map(t=>t.cascade)}function a(t,e){if(Object(r.b)(e)||t.length<=e)return[...t];return d(t.map(t=>{const e=t.inferList.reduce((t,e)=>(e.active&&"select"===e.type&&(t+=e.weight),t),0);return{option:t,weight:e}}),e).map(t=>t.option)}function s(t){return t.filter(t=>{const{option:e}=t;return!(!e||!e.inferList)&&e.inferList.some(t=>t.active)})}function u(t,e){return t.filter(t=>t.inferList.some(t=>t.active&&t.type===e))}async function l(t,e){if(!t)return;const n=e.parent;t.inferList=t.inferList||[];for(const e of t.inferList){const{activeConfig:r}=e;if(r){const{options:o,logicType:c}=r;n.context.option=t,e.active=await Object(i.b)(n,o,c),n.context.option=null}else e.active=!0}}function d(t,e){if(t=[...t],Object(r.b)(e)||t.length<=e)return t;const n=t.reduce((t,e)=>t+=e.weight,0);let i=0,o=0,c=t.map(t=>{const e=t.weight/n;o=i+e;const r={item:t,floor:i,ceil:o};return i=o,r});const a=[];for(;a.length<e;){const t=Math.random()*o,e=c.find(e=>e.floor<=t&&e.ceil>t);e&&(a.push(e.item),c=c.filter(t=>t!==e))}return a}async function f(t,e){const{parent:n}=e,r=[];for(const e of t)r.push(await Object(o.f)(e.candidates,{state:n,joinBy:","}));return r.join(",")}function b(t){const e={},n=[];return t.split(",").forEach(t=>{let r=t,i=1;const o=t.match(/\(([\d\.]+)\)$/);o&&(r=t.replace(/\([\d\.]+\)$/,""),i=parseFloat(o[1]));const c=e[r];if(c)c.weight+=i;else{const t={text:r,weight:i};n.push(t),e[r]=t}}),n.filter(t=>0!==t.weight)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return a}));var r=n(61),i=n(0);function o(t){return Object(i.b)().hostConfig.cdnHost+"/"+t}function c(t){const{width:e,height:n,name:i,id:c,originName:a}=t,s=o(i);return{ratio:Math.round(n/e*1e5)/1e5,url:s,natural:Object(r.b)(s,"@m720"),thumbnail:Object(r.b)(s,"@avatar"),large:Object(r.b)(s,"@m1080"),width:e,height:n,reformed:!0,id:c,originName:a,name:i}}function a(t){if(!t)return;if(t&&t.reformed)return t;const{name:e,width:n,height:r,id:i,originName:o}=t;return e?c({width:n,height:r,name:e,id:i,originName:o}):void 0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u}));var r=n(7),i=n(5);const o={};function c(t,e){let n="";const r=o[e.type];return n=t.isOtherOpt||!r?t.value:r(t),"string"==typeof n&&(n=Object(i.k)(n)),n}function a(t,e){let n=c(t,e);return"string"==typeof n&&(n=n.trim()),!Object(r.b)(n)}o.upload=t=>t.name,o.sequence=t=>t.sortNo,o.heat_map=t=>t.point,o.max_diff=t=>t.records;const s={};function u(t,e){return(s[e.type]||a)(t,e)}s.sequence=(t,e)=>-1!==t.sortNo&&a(t,e)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return u}));var r=n(0),i=n(30);function o(){return{value:"",miniValue:"",name:"",progress:0,isImage:!1,fileType:"",fileName:""}}const c={};function a(t,e,n){e.options.forEach(e=>{e!==t&&(e.mutexNumber!==t.mutexNumber&&-1!==t.mutexNumber||n(e))})}function s(t,e){if(t.isOtherOpt&&t.mutexNumber){const n=c[e.type];n?n(t,e):a(t,e,t=>{Object(r.g)(t,{value:"",selected:!1})})}}function u(t,e){e.otherOptions.filter(e=>!(!e.mutexNumber||e===t)&&(e.mutexNumber===t.mutexNumber||-1===e.mutexNumber)).forEach(t=>{Object(r.g)(t,{selected:!1})})}c.heat_map=(t,e)=>{a(t,e,t=>{Object(r.g)(t,{point:null,value:""})})},c.cascade=(t,e)=>{e.options.forEach(t=>{Object(r.g)(t,{selected:!1})}),Object(i.b)(e.cascade)},c.upload=(t,e)=>{a(t,e,t=>{const e={value:"",miniValue:"",name:"",progress:0,isImage:!1,fileType:"",fileName:""};Object(r.g)(t,{...e,image:null})}),e.fullUploaded=!1},c.weight=(t,e)=>{a(t,e,t=>{Object(r.g)(t,{value:""})}),e.options.forEach(t=>{Object(r.g)(t,{percent:""})})},c.sequence=(t,e)=>{a(t,e,t=>{Object(r.g)(t,{selected:!1,sortNo:-1})}),e.options.sort((t,e)=>t.number>e.number?1:-1)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"d",(function(){return m}));var r=n(1),i=n(5),o=n(2),c=n(6),a=n(3),s=n(7);function u(t){return/^1[0-9][0-9]\d{8}$/i.test(t)}function l(t){return/[-a-zA-Z0-9@:%_+.~#?&/=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_+.~#?&/=]*)?/gi.test(t)}async function d(t,e){const{parent:n}=e;let r=await Object(i.e)(t.fillStart,{state:n}),o=await Object(i.e)(t.fillEnd,{state:n});return Object(s.b)(r)&&(r=-1/0),Object(s.b)(o)&&(o=1/0),{start:r,end:o}}function f(t,e,n){return e<=t&&n>=t}function b(t,e,n){return f(t,e,n)?"":Object(o.f)(a.a.fill.valueLimit,{min:e,max:n})}const p={};async function O(t,e,n){const{itemsMax:r,itemsMin:i}=await Object(c.g)(e,n),s=t.split(/[,,]/).reduce((t,e)=>e.trim()?t+1:t,0);let u="";return(s<i||s>r)&&(u=Object(o.f)(a.a.fill.itemsLimit,{min:i,max:r})),{valid:!u,message:u}}async function m(t,e){const n=Object(s.a)(t.value),r=t.fillType,i=p[r];if(!i||Object(s.b)(n)&&"auto_complete"!==r)return{valid:!0,message:""};const{parent:o}=e;o.context.option=t;const c=await i(n,t,e);return o.context.option=null,c.valid||(c.dueToOption=t,c.dueToNode=e),c}p.chars=async(t,e,n)=>{const{start:r,end:i}=await d(e,n);let{tolerance:c}=e;c=c||[];const s=function(t,e=[]){if(0===e.length)return"";t=t.replace(/[\s,,]/g,"");let n="";const r=[];e.includes("number")&&(n+="0-9",r.push(Object(o.f)(a.a.fill.number))),e.includes("alphabet")&&(n+="a-zA-Z",r.push(Object(o.f)(a.a.fill.alphabet))),e.includes("chinese")&&(n+="一-龥",r.push(Object(o.f)(a.a.fill.chinese)));const i=r.join(" "),c=new RegExp("^["+n+"]+$");return t.match(c)?"":Object(o.f)(a.a.fill.onlyAllow,{text:i})}(t,c)||function(t,e,n){return f(t.length,e,n)?"":Object(o.f)(a.a.fill.charsLimit,{min:e,max:n})}(t,r,i);return{valid:!s,message:s}},p.email=t=>{const e=function(t){return/^[\w-\.]+@([\w-]+\.)+[\w-]+$/i.test(t)}(t),n=e?"":Object(o.f)(a.a.fill.needEmail);return Object(r.n)({valid:e,message:n})},p.float=async(t,e,n)=>{if(!function(t){return/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)}(t))return{valid:!1,message:Object(o.f)(a.a.fill.inputNumber)};const{start:r,end:i}=await d(e,n),c=b(1*Number(t),r,i);return{valid:!c,message:c}},p.integer=async(t,e,n)=>{if(!function(t){return/^[-]?\d+$/.test(t)}(t=t.replace(/\s/g,"")))return{valid:!1,message:Object(o.f)(a.a.fill.inputInteger)};const r=Number(t),{start:i,end:c}=await d(e,n),s=b(1*r,i,c);return{valid:!s,message:s}},p.none=()=>Object(r.n)({valid:!0,message:""}),p.phone_number=t=>{const e=u(t),n=e?"":Object(o.f)(a.a.fill.needPhoneNumber);return Object(r.n)({valid:e,message:n})},p.postcode=t=>{const e=function(t){return/^[0-9][0-9]{5}$/.test(t)}(t),n=e?"":Object(o.f)(a.a.fill.needZipCode);return Object(r.n)({valid:e,message:n})},p.url=t=>{const e=l(t),n=e?"":Object(o.f)(a.a.fill.needUrl);return Object(r.n)({valid:e,message:n})},p.auto_complete=(t,e,n)=>{if(!t&&e.atcpTrigger){const t={valid:!1,message:Object(o.f)(a.a.fill.atcpLabelOnly),dueToNode:n,dueToOption:e};return Object(r.n)(t)}return O(t,e,n)},p.list_select=(t,e,n)=>O(t,e,n)},function(t,e,n){"use strict";n.d(e,"a",(function(){return j})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return y})),n.d(e,"b",(function(){return T}));var r=n(6),i=n(27),o=n(35),c=n(4),a=n(11),s=n(5),u=n(1),l=n(0),d=n(2),f=n(30),b=n(3),p=n(9),O=n(20),m=n(26);const g={},j={refresh:!1,result:!1},h={refresh:!0,result:!0},y={refresh:!1,result:!0};function v(t,e,n){e.forEach(e=>{Object(u.l)(e.uuid,t.uuid)||e[n]!==t[n]||Object(l.g)(e,{selected:!1})})}function w(t,e){e.forEach(e=>{e.uuid!==t.uuid&&Object(l.g)(e,{selected:!1})})}function _(t,e,n="mutexNumber"){const i=t[n],o=function(t,e,n="mutexNumber"){const i=Object(r.c)(e);return"xMutexNumber"===n?i.filter(e=>e.yid===t.yid):"yMutexNumber"===n?i.filter(e=>e.xid===t.xid):i}(t,e,n);i?function(t,e,n="mutexNumber"){const r=t[n];e.forEach(e=>{r&&-1!==r&&e[n]!==r&&-1!==e[n]||e.uuid!==t.uuid&&Object(l.g)(e,{selected:!1})})}(t,o,n):function(t,e){t.forEach(t=>{-1===t[e]&&Object(l.g)(t,{selected:!1})})}(o,n)}function x(t,e,n=!1){return t.selected?Object(l.g)(t,{selected:!1}):(Object(l.g)(t,{selected:!0}),w(t,n?e.otherOptions:Object(r.c)(e)),Object(m.b)(t,e)),h}async function T(t,e){const n=g[e.type];if(n){const r=await n(t,e);return r.noValidate||Object(o.b)(e),r}return j}g.select=async(t,e)=>{if(t.selected)return Object(l.g)(t,{selected:!1}),h;const n=await Object(c.k)(e,t);return n.valid?(Object(l.g)(t,{selected:!0}),Object(c.s)(e)?_(t,e):w(t,Object(r.c)(e)),h):(Object(l.b)().notify(n.message),j)},g.select_icon=g.select,g.select_image=g.select,g.matrix=async(t,e)=>{if(t.selected)return Object(l.g)(t,{selected:!1}),h;const n=await Object(c.j)(e,t);return n.valid?(Object(l.g)(t,{selected:!0}),Object(c.v)(e)?w(t,Object(r.c)(e)):Object(c.q)(e)?(v(t,e.options,"yid"),v(t,e.options,"xid")):Object(c.r)(e)?v(t,e.options,"yid"):Object(c.p)(e)?v(t,e.options,"xid"):Object(c.s)(e)&&(_(t,e),t.isOtherOpt||(_(t,e,"xMutexNumber"),_(t,e,"yMutexNumber"))),h):(Object(l.b)().notify(n.message),j)},g.upload=async(t,e)=>{if(t.isOtherOpt)return x(t,e,!0);{const{parent:n,fullUploaded:r}=e;let i=await Object(s.e)(e.maxUploadCount,{state:n});i=i||e.options.length;const o=t.value;if(r&&!o)return Object(l.b)().notify(Object(d.f)(b.a.upload.amountLimitMax,{max:i})),j;const c={onprogress(e){Object(l.g)(t,{progress:e}),Object(O.c)()},accept:t.accept},a=await Object(l.c)().network.upload(c);return await n.handleEvents.handleOptionInput(a,t,e),y}},g.verify=async(t,e)=>{const{parent:n,nodeUuid:r,phoneNumber:o,validateType:c}=e,{transactionID:s}=n;let u=!1,f={response_id:s,question_id:r};if("sms"===c){if(Object(l.b)().preview)return Object(l.b)().notify(Object(d.f)(b.a.preview.noMessage)),{...j,noValidate:!0};if(!o||!Object(i.b)(o))return Object(l.b)().notify(Object(d.f)(b.a.fill.needPhoneNumber)),{...j,noValidate:!0};f={...f,phone_num:o},e.messageGetFailed=!1;try{const t=await Object(p.j)(f);e.serverValidations=t,n.phoneNumber=o,n.phoneUsed=t.phone_num_used,n.phoneUsed&&Object(a.A)(n,e),u=!0}catch(t){e.messageGetFailed=!0}}else if("image"===c){const t=await Object(p.j)(f);e.serverValidations=t,Object(l.g)(e,{captcha:t.image}),u=!0}return{...y,noValidate:!0,result:u}},g.gift=async(t,e)=>{if(Object(l.b)().preview)return Object(l.b)().notify(Object(d.f)(b.a.preview.noMessage)),j;const{phoneNumber:n,goalId:r}=e;if(!Object(i.b)(n))return Object(l.b)().notify(Object(d.f)(b.a.fill.needPhoneNumber)),j;e.messageGetFailed=!1;try{await Object(p.n)({phone_num:n},r)}catch(t){e.messageGetFailed=!0}return h},g.menu=g.select,g.cascade=(t,e)=>{if(t.isOtherOpt)x(t,e,!0);else{let{resultList:n}=t;const{list:r}=t;if(!r||!n)return Object(u.n)(y);n=n instanceof Array?n:n?[n]:[];const{addList:i,cancelList:o}=Object(f.d)(r,n);o.forEach(t=>{Object(f.a)(t,e)}),i.forEach(t=>{Object(f.h)(t,e)}),Object(f.c)(e);const c=i[i.length-1];c&&Object(m.c)(c.option,e)}return Object(u.n)(h)},g.hot_spot=g.select,g.icon_mark=g.value_mark=g.slide_rate=g.fill=g.weight=g.heat_map=(t,e)=>t.isOtherOpt?Object(u.n)(x(t,e,!0)):Object(u.n)(y),g.sequence=(t,e)=>{if(t.isOtherOpt)return Object(u.n)(x(t,e,!0));{const{options:n,operationType:r}=e;if(-1===t.sortNo){const e=n.map(t=>t.sortNo).filter(t=>t>0);let r=-1;for(let t=1;t<=n.length;t++)if(!e.includes(t)){r=t;break}r>0&&Object(l.g)(t,{sortNo:r,selected:!0})}else{const e=t.sortNo;Object(l.g)(t,{sortNo:-1,selected:!1}),"collapse-pick"===r&&n.forEach(t=>{t.sortNo>e&&Object(l.g)(t,{sortNo:t.sortNo-1})})}return Object(u.n)(y)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return d}));var r=n(2),i=n(0),o=n(3);let c=null;function a(){return{default:"minimal",primary:"rgba(128,128,128,1)",secondary:"rgba(255,255,255,1)",contrast:"rgba(202,32,39,1)",background:"#FFFFFF",error:"rgba(202,32,39,1)",button:"rgba(202,32,39,1)",fontSize:"24px",fontWeight:"normal",descFontSize:"16px",descFontWeight:"normal",optFontSize:"16px",optFontWeight:"normal",btnFontSize:"16px",btnFontWeight:"normal",name:"minimal",fontFamily:"SimSun",titleFontSize:"25px",titleFontWeight:"normal",boxWidth:"auto",bgOpacity:100,bgImageUrl:"",effect:"normal",dynamic:Object(i.b)().dynamic,client:Object(i.b)().clientName}}function s(t){if(!t)return a();const e="string"==typeof t?JSON.parse(t):t;let n=e.usingTheme;return n.background||(n={...a()},n.primary=e.usingTheme.primary,n.secondary=e.usingTheme.secondary,n.contrast=e.usingTheme.contrast),{...n,default:"minimal"}}function u(t=a()){t.error=t.error||t.contrast,t.button=t.button||t.contrast,c=t,Object(i.b)().setTheme(t),Object(i.c)().storage.set("theme",JSON.stringify(t))}function l(){return c||a()}function d(t="Legacy"){const e=Object(i.b)().clientName;if("ALL"!==e&&t!==e)throw Object(i.b)().error(Object(r.f)(o.a.global.clientError)),Object(i.b)().customAbort(),new Error("client not matched")}},function(t,e,n){"use strict";n.d(e,"e",(function(){return s})),n.d(e,"g",(function(){return l})),n.d(e,"f",(function(){return d})),n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return b})),n.d(e,"c",(function(){return p})),n.d(e,"h",(function(){return O})),n.d(e,"d",(function(){return m}));var r=n(6),i=n(2),o=n(0),c=n(3),a=n(7);function s(t){return"tabs"===t.layout.optMark}function u(t){return t.selected&&!Object(r.n)(t.option)}function l(t,e,n,i){const c=n.list.filter(t=>t.option.useComment)[e];Object(o.g)(c.option,{value:t});const a=i.options.find(t=>t.cascadePath===c.resultId);return Object(r.n)(c.option)&&(t?O(c,i):b(c,i),p(i)),a}function d(t,e,n){let l,d;const f=s(n),b=e.list.filter(t=>!Object(r.n)(t.option))[t];let p=e.list.filter(t=>u(t));const O=-1===p.indexOf(b),m=n.cascade;if(O&&f&&m.multiple&&!e.selected){let t=null;if(m.list.reduce((e,n)=>(u(n)&&(e+=1),n.list&&n.list.includes(b)&&(t=n),e),0)===m.max&&!Object(r.n)(t.option))return Object(o.b)().notify(Object(i.f)(c.a.menu.limitMax,{text:Object(i.f)(c.a.menu.topList),max:Object(a.a)(m.max)})),null}if(e.multiple){if(O){const{mutexNumber:t}=b.option;-1===t?p=[b]:(p=p.filter(e=>(!t||e.option.mutexNumber!==t)&&-1!==e.option.mutexNumber),p.push(b))}else p=p.filter(t=>t!==b);if(p.length>e.max)return Object(o.b)().notify(Object(i.f)(c.a.menu.limitMax,{text:e.text?Object(i.f)(c.a.menu.listItem)+e.text:Object(i.f)(c.a.menu.topList),max:Object(a.a)(e.max)})),null;l=p.map(t=>t.text)}else l=O?[b.text]:[];return d=l.map(t=>t),{resultList:l,list:e.list,group:e,result:d}}function f(t){Object(o.g)(t,{selected:!1}),Object(o.g)(t.option,{selected:!1});const e=t.list;e&&0!==e.length&&e.forEach(t=>{f(t)})}function b(t,e){f(t),e.options.forEach(e=>{e.cascadePath.includes(t.resultId)&&Object(o.g)(e,{selected:!1})})}function p(t){s(t)&&t.cascade.list.forEach(t=>{t.selected=t.list&&t.list.some(t=>t.selected)})}function O(t,e){Object(o.g)(t,{selected:!0}),Object(o.g)(t.option,{selected:!0}),e.options.forEach(e=>{t.resultId.includes(e.cascadePath)&&Object(o.g)(e,{selected:!0})})}function m(t,e){const n=[],r=[];return t.forEach(t=>{const i=e.some(e=>e.trim()===t.text.trim()),o=u(t);i&&!o?n.push(t):!i&&o&&r.push(t)}),{addList:n,cancelList:r}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"d",(function(){return b}));var r=n(1),i=n(4);function o(t){const e=[];return t.forEach((t,n)=>{const i=Object(r.f)(n+1);e.splice(i,0,t)}),e}function c(t,e){return t.forEach((t,e)=>t.realIndex=e),e&&e.forEach((e,n)=>e.realIndex=n+t.length),t}const a={};function s(t,e){let n=[];return n=t.circulation?u(e):t.followRandom||t.groupRandom||t.groupInnerRandom?function(t,e){const{followRandom:n,groupRandom:i,groupInnerRandom:o}=t,c=[],a={},s={};e.forEach((t,e)=>{if(t.refOptId){let r="";if(n?r=t.refNodeId:i&&t.refGroupNumber&&(r=t.refNodeId+"_"+t.refGroupNumber),r){t.groupName=r;const n=s[r];n?O(t,n.list,o):s[r]={headIndex:e,list:[t]}}else c.push(t)}else if(t.groupNumber){const n=t.groupNumber;t.groupName=n;const r=a[n];r?O(t,r.list,o):a[n]={headIndex:e,list:[t]}}else c.push(t)});let u=[];return c.forEach(t=>{const e=Object(r.f)(u.length+1);u.splice(e,0,t)}),[a,s].forEach((t,e)=>{Object.keys(t).forEach(o=>{const{list:c,headIndex:a}=t[o];1===e&&n&&f(c);let s=a;i&&(s=Object(r.f)(u.length+1)),u=function(t,e,n){if(0===n)return t.concat(e);{for(;n<e.length-1&&p(e[n],e[n-1]);)n++;if(n>=e.length-1)return e.concat(t);const r=e.slice(0,n),i=e.slice(n);return r.concat(t,i)}}(c,u,s)})}),u}(t,e):function(t){const e=[];return t.forEach(t=>{const n=Object(r.f)(e.length+1);e.splice(n,0,t)}),e}(e),c(n,t.otherOptions)}function u(t,e){return e=(e||Math.round(10*Math.random()))%t.length,t.slice(e).concat(t.slice(0,e))}function l(t,e){if(!Object(i.u)(t))return c(e,t.otherOptions);if(t.groupSingle){let n=a[t.nodeUuid];if(n)return e.sort((t,e)=>n[t.uuid]>n[e.uuid]?1:-1);{const r=s(t,e);return a[t.nodeUuid]=n={},r.forEach((t,e)=>{n[t.uuid]=e}),r}}return s(t,e)}function d(t){let{optionsX:e,optionsY:n}=t;const{otherOptions:r}=t,{randomType:i}=t;return"col"!==i&&"row_col"!==i||(e=l(t,e)),"row"!==i&&"row_col"!==i||(n=l(t,n)),"col_loop"===i&&(e=u(e)),"row_loop"===i&&(n=u(n)),{optionsX:c(e,null),optionsY:c(n,null),otherOptions:c(r,null)}}function f(t){return t.sort((t,e)=>t.refRealIndex>e.refRealIndex?1:-1),t}function b(t){return t.sort((t,e)=>t.realIndex>e.realIndex?1:-1),t}function p(t,e){return!(!t.groupName&&!e.groupName)&&t.groupName===e.groupName}function O(t,e,n=!1){if(n){const n=Object(r.f)(e.length+1);e.splice(n,0,t)}else e.push(t)}},function(t,e,n){"use strict";n.d(e,"f",(function(){return d})),n.d(e,"b",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"g",(function(){return O})),n.d(e,"c",(function(){return m})),n.d(e,"e",(function(){return g})),n.d(e,"a",(function(){return y}));var r=n(6),i=n(1),o=n(27),c=n(23),a=n(9);let s=null;async function u(t,e){let{start:n,end:r}=await Object(o.a)(t,e);return n===-1/0&&(n=-9999,n>r&&(n=r-9999)),r===1/0&&(r=9999,r<n&&(r=n+9999)),{start:n,end:r}}function l(t,e,n){return!!e&&e.some(e=>{if(e.startsWith("/")&&e.endsWith("/")){const n=e.substr(1,e.length-2),r=new RegExp(n);return!!t.match(r)}return n?n(t,e):t===e})}async function d(t,e,n){let r=0,i=await t();for(;l(i,e,n);)if(i=await t(),r++,r>10)throw new Error("Hard to infer, rejected 10 times");return i}async function f(t,e,n=1){if(!t.inferList)return{value:"",antis:null};const r=t.inferList.filter(t=>t.active&&"input"===t.type);if(0===r.length)return{value:"",antis:null};const i=await Object(c.e)(r,e);if(""===i.replace(/,/g,""))return{value:"__FORCE_EMPTY__",antis:null};const o=[];if(i.split(",").forEach(t=>{t.startsWith("!")?o.push(t.substr(1)):t.match(/\(0\)$/)&&o.push(t.replace(/\(0\)$/,""))}),o.length)return{value:"",antis:o};const a=Object(c.c)(i);return{value:Object(c.f)(a,n).map(t=>t.text).join(","),antis:null}}function b(){return"1"+m(1e9,9999999999)}function p(t){return s[t]||Math.random().toString().replace("0.","")}async function O(){if(s)return s;const t=await Object(a.p)("https://media.choiceform.com/infer/infer.json",{type:"GET",contentType:"application/json"});return s=t,s}function m(t=0,e=10,n=0){const r=Math.pow(10,n);t*=r,e*=r;return(Object(i.g)(t,e)/r).toString()}function g(t,e=1,n=10){let r=p(t);for(;r.length<n;)r+=p(t);const o=r.length,c=Object(i.g)(n,o),a=c-Object(i.g)(e,n),s=r.substring(a,c);return""===s.trim()?g(t,e,n):s}function j(t=0,e=5e3,n=3){t=Math.max(t,0),e=Math.min(e,5e3);let r=Object(i.g)(t,e).toString();if(n>1){r=r+" "+Object(i.g)(1,12)}if(n>2){r=r+" "+Object(i.g)(1,28)}return r}const h={};async function y(t,e){const n=h[t.fillType]||h.none,r=await n(t,e);return"__FORCE_EMPTY__"===r?"":r}h.auto_complete=async(t,e)=>{let{completeGroups:n}=t;const{itemsMax:o,itemsMin:c}=await Object(r.g)(t,e),a=Object(i.g)(c,o)||1,{value:s,antis:u}=await f(t,e,a);if(s)return s;u&&(n=n.filter(t=>!l(t.name,u)));return Object(i.p)(n,a).map(t=>t.name).join(",")},h.chars=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{tolerance:i}=t,{start:o,end:c}=await u(t,e);return d(()=>!i||0===i.length||i.includes("chinese")?g("chinese",o,c):i.includes("alphabet")?g("alphabet",o,c):g("number",o,c),r)},h.date=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{grade:i}=t,{start:o,end:c}=await u(t,e);return d(()=>j(o,c,i),r)},h.date_range=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const i=j(1960,2050,3),o=Number(i.split(" ")[0]);return d(()=>{const t=j(o,2060);return i+" - "+t},r)},h.email=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return d(()=>(Object(i.e)(1,6)+"@"+Object(i.e)(1,6)+"."+Object(i.e)(1,4)).toLowerCase(),r)},h.float=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{scale:i}=t;return d(async()=>{const{start:n,end:r}=await u(t,e);return m(n,r,i)},r)},h.integer=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{start:i,end:o}=await u(t,e);return d(()=>m(i,o),r)},h.list_select=async(t,e)=>{let{selectList:n}=t;const{itemsMax:o,itemsMin:c}=await Object(r.g)(t,e),a=Object(i.g)(c||1,o||1)||1,{value:s,antis:u}=await f(t,e,a);if(s)return s;u&&(n=n.filter(t=>!l(t,u)));return Object(i.p)(n,a).join(",")},h.none=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return d(()=>g("chinese",1,10),r)},h.phone_number=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return d(()=>b(),r)},h.postcode=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return await d(()=>m(1e5,999999),r)},h.time=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return await d(()=>m(1,25)+":"+m(1,60),r)},h.time_range=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return await d(()=>{const t=m(1,20);return t+":"+m(1,60)+" - "+(m(Number(t)+1,24)+":"+m(1,60))},r)},h.time_duration=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;const{grade:i}=t;return await d(()=>{if(i<=3){let t=m(1,20)+"d";return i>1&&(t+=" "+m(1,24)+"h"),i>2&&(t+=" "+m(1,60)+"m"),t}{let t=m(1,60)+"h";return i>4&&(t+=m(1,60)+"m"),i>5&&(t+=m(1,60)),t}},r)},h.url=async(t,e)=>{const{value:n,antis:r}=await f(t,e);if(n)return n;return await d(()=>("https://"+Object(i.e)(1,3)+"."+Object(i.e)(1,6)+"."+Object(i.e)(1,3)).toLowerCase(),r)}},function(t,e,n){"use strict";function r(t){if(!t)return"00:00";const e=t%60;return i((t-e)/60)+":"+i(e)}function i(t){let e=t+"";return 1===e.length&&(e="0"+e),e}function o(){const t=new Date;return t.getFullYear()+"-"+i(t.getMonth()+1)+"-"+i(t.getDate())+" "+i(t.getHours())+":"+i(t.getMinutes())+":"+i(t.getSeconds())}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return b}));var r=n(1);const i=String.fromCharCode(160),o=new RegExp(i,"g");function c(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g,i)}class a{constructor(t){this.type="node",this.name=t,this.children=[],this.attributes={}}hasClass(t){const{attributes:e}=this,n=e&&e.class;return n&&n.split(" ").includes(t)}insertBefore(t,e){const n=this.children.indexOf(e);t.parent=this,this.children.splice(n,0,t)}getOuterHtml(){let t=Object.keys(this.attributes).map(t=>{let e=this.attributes[t]||"";return e&&(e=e.replace(/&/g,"&").replace(o," ").replace(/"/g,""")),`${t}="${e}"`}).join(" ");t&&(t=" "+t);let e=`<${this.name}${t}>`;return l(this.name)||(e+=this.getInnerHtml(),e+=`</${this.name}>`),e}getInnerHtml(){return this.children.map(t=>Object(r.k)(t,"node"===t.type)?t.getOuterHtml():t.getText().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(o," ")).join("")}setInnerHtml(t){this.empty(),f(t,this)}setText(t){this.empty(),this.children.push(new s(t))}getText(){return this.children.map(t=>t.getText()).join("")}empty(){this.children.forEach(t=>t.parent=null),this.children=[]}removeChild(t){this.children=this.children.filter(e=>e!==t)}appendChild(t){this.children.includes(t)||(t.parent=this,this.children.push(t))}queryByClass(t){let e=[];return this.children.forEach(n=>{const{children:i,type:o}=n;if(Object(r.k)(n,"node"===o)&&(n.hasClass(t)&&e.push(n),i&&i.length>0)){const r=n.queryByClass(t);r.length>0&&(e=[...e,...r])}}),e}}class s{constructor(t){this.type="text",this.setText(t)}getText(){return this._text}setText(t){this._text=t}}const u=["area","base","br","col","command","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function l(t){return u.includes(t)}function d(t){t=Object(r.t)(t);const e={},n=/(\S+?)=(["'])(.*?)\2[\/\s>]/g;let o=n.exec(t);for(;o;)e[o[1]]=o[3].replace(/&/g,"&").replace(/ /g,i).replace(/"/g,'"'),o=n.exec(t);return e}function f(t,e){t=function(t){return t.replace(/\S+?=(["']).*?\1/g,t=>Object(r.d)(t))}(t).replace(/\n/g," ");const n=/<(\w+).*?>/g,i=[];let o=n.exec(t);const u=e||new a("div");for(;o;){const e=o[1],r=o.index+o[0].length;i.push({type:"open",name:e,value:o[0],start:o.index,end:r}),n.lastIndex=r,o=n.exec(t)}if(0===i.length)return u.appendChild(new s(c(t))),u;const f=/<\/(\w+)>/g;let b=f.exec(t);for(;b;){const e=b[1],n=b.index+b[0].length;i.push({type:"close",name:e,value:b[0],start:b.index,end:n}),b=f.exec(t)}i.sort((t,e)=>t.start>e.start?1:-1);const p=[...i];let O=u,m=0,g=p.shift();const j=[];for(;g;){const{start:e,end:n,name:r,type:i,value:o}=g;if(m<e&&O.children.push(new s(c(t.substring(m,e)))),"open"===i){const t=new a(r);t.attributes=d(o),O.appendChild(t),l(r)||(O=t,j.push(g))}else if(!l(r)){const t=j[j.length-1];t&&t.name===g.name&&(O=O.parent,j.pop())}m=n,g=p.shift()}return m<t.length&&u.appendChild(new s(c(t.substring(m)))),u}function b(t){const e=f(t),n=t=>{const e={type:t.type};return Object(r.k)(t,"node"===t.type)?(e.name=t.name,e.attrs=t.attributes,e.children=t.children.map(n)):e.text=t.getText(),e};return e.children.map(n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return I})),n.d(e,"b",(function(){return N})),n.d(e,"c",(function(){return E}));var r=n(6),i=n(27),o=n(4),c=n(52),a=n(5),s=n(1),u=n(0),l=n(2),d=n(30),f=n(3),b=n(9),p=n(25);const O={valid:!0,message:""};function m(t){if(!Object(o.i)(t))return O;const e=Object(r.l)(t)||Object(r.k)(t);return{valid:e,message:e?"":Object(l.f)(f.a.global.answerRequired),dueToNode:t}}function g(t,e){const{otherOptions:n}=t;return n.some(t=>t.selected)?0:e}async function j(t){if(!Object(o.i)(t)&&!Object(r.k)(t))return O;const{options:e}=t,{parent:n}=t;let i=await Object(a.e)(t.fillMin,{state:n});i=i||e.length,i>e.length&&(i=e.length),i=g(t,i);let c=0;for(const n of e)if(Object(p.b)(n,t))c+=1;else if(!0===n.fillRequired)return{valid:!1,message:Object(l.f)(f.a.fill.required,{text:n.text||""}),dueToNode:t};const s=i<=c;return s?O:{valid:s,message:Object(l.f)(f.a.fill.inputLimitMin,{min:i}),dueToNode:t}}function h(t,e=!1){const n=e?t.otherOptions:Object(r.c)(t),i=Object(o.i)(t);let c;const a=!n.some(e=>(c=e,function(t,e){const n=!0===t.fillRequired,i=t.selected;return n&&(i||Object(r.n)(t)&&e)}(e,i)&&!Object(p.b)(e,t)));return a?O:{valid:a,message:Object(l.f)(f.a.fill.required,{text:c.text}),dueToNode:t,dueToOption:c}}async function y(t,e=!1){const n=e?t.options:Object(r.c)(t);for(const e of n){if(!Object(p.b)(e,t))continue;const n=await Object(i.d)(e,t);if(!n.valid)return n}return O}function v(t){return Object(o.s)(t)&&Object(r.l)(t)?w(t):Object(s.n)(O)}async function w(t){if(function(t){if("matrix"===t.type)return!1;const e=Object(r.c)(t).find(t=>t.selected);return!(!e||-1!==e.mutexNumber)}(t))return O;const{min:e}=await Object(o.e)(t);return Object(r.c)(t).filter(t=>!Object(r.n)(t)).filter(t=>t.selected).length>=e?O:{valid:!1,message:Object(l.f)(f.a.select.limitMin,{min:e}),dueToNode:t}}function _(t){return Object(o.v)(t)?Object(s.n)(O):Object(o.i)(t)||Object(r.l)(t)?Object(o.m)(t)?w(t):Object(o.r)(t)||Object(o.p)(t)||Object(o.q)(t)?Object(s.n)(function(t){let e,n,r;Object(o.r)(t)?(e="yid",n=t.renderOptionsY,r=!1):Object(o.p)(t)?(e="xid",n=t.renderOptionsX,r=!0):Object(o.q)(t)&&(t.renderOptionsX.length>t.renderOptionsY.length?(e="yid",n=t.renderOptionsY,r=!1):(e="xid",n=t.renderOptionsX,r=!0));const i=t.options;for(const o of n){const n=o.uuid;if(!i.some(t=>t.selected&&Object(s.l)(t[e],n))){return{valid:!1,message:r?Object(l.f)(f.a.matrix.colLimitMin,{min:1}):Object(l.f)(f.a.matrix.rowLimitMin,{min:1}),dueToNode:t}}}return O}(t)):async function(t){const e=Object(o.n)(t);let{min:n}=await Object(o.e)(t);const r=e?"xid":"yid",i=t[e?"renderOptionsX":"renderOptionsY"],c=t[e?"renderOptionsY":"renderOptionsX"];n>c.length&&(n=c.length);const a=t.options;for(const o of i){const i=o.uuid;if(a.filter(t=>t.selected&&Object(s.l)(t[r],i)).length<n){return{valid:!1,message:e?Object(l.f)(f.a.matrix.colLimitMin,{min:n}):Object(l.f)(f.a.matrix.rowLimitMin,{min:n}),dueToNode:t}}}return O}(t):Object(s.n)(O)}const x={};function T(t,e){Object(u.g)(t,{errorMessage:e.message||""})}function I(t,e){Object(u.b)().locateError(t,e)}async function k(t,e){if(Object(o.w)(t)||t.readonly)return O;const n=function(t){const{canSkipVideo:e,video:n}=t;return e||!n||n.ended?O:{valid:!1,message:Object(l.f)(f.a.video.watchAll),dueToNode:t}}(t);if(!n.valid)return n;const r=x[t.type];let i=r?await r(t):O;return i.valid&&e&&(i=await Object(c.a)(t)),i.valid&&T(t,i),i}x.select=async t=>{const e=m(t);if(!e.valid)return e;let n=await v(t);return n.valid?(n=h(t,!1),n.valid?y(t,!1):n):n},x.select_image=t=>x.select(t),x.fill=async t=>{const e=m(t);if(!e.valid)return e;let n=await j(t);return n.valid?(n=h(t,!0),n.valid?y(t,!1):n):n},x.value_mark=async t=>{const e=m(t);if(!e.valid)return e;let n=await j(t);return n.valid?(n=h(t,!0),n.valid?y(t,!0):n):n},x.icon_mark=async t=>{const e=await x.value_mark(t);if(!e.valid)return e;if(Object(o.i)(t)){if(t.options.some(t=>0===t.value))return{valid:!1,message:Object(l.f)(f.a.global.answerRequired),dueToNode:t}}return O},x.sequence=t=>{let e=m(t);if(!e.valid)return Object(s.n)(e);const{options:n}=t;let r=Object(o.i)(t)?t.rankCount||n.length:0;const i=n.length;r>i&&(r=i),r=g(t,r);let c=0;const a=n.filter(t=>t.sortNo>0).sort((t,e)=>t.sortNo>e.sortNo?1:-1);for(let t=0;t<a.length&&a[t].sortNo===t+1;t++)c++;return r>c?Object(s.n)({valid:!1,message:Object(l.f)(f.a.rank.limitMin,{min:r}),dueToNode:t}):(e=h(t,!0),e.valid?y(t,!0):Object(s.n)(e))},x.matrix=async t=>{const e=m(t);if(!e.valid)return e;let n=await _(t);return n.valid?(n=h(t,!0),n.valid?y(t,!0):n):n},x.region=t=>{const e=!Object(o.i)(t)||t.value?O:{valid:!1,message:Object(l.f)(f.a.global.answerRequired),dueToNode:t};return Object(s.n)(e)},x.location=async t=>{const e=await x.region(t);return e.valid||(e.message=Object(l.f)(f.a.locate.required)),e},x.upload=async t=>{const e=m(t);if(!e.valid)return e;let n=!0,i="";const c=Object(r.f)(t);if(!Object(o.i)(t)&&0===c)return O;const a=await Object(o.g)(t),{max:s}=a,u=g(t,a.min);return c<u?(n=!1,i=Object(l.f)(f.a.upload.amountLimitMin,{min:u})):c>s&&(n=!1,i=Object(l.f)(f.a.upload.amountLimitMax,{max:s})),{valid:n,message:i,dueToNode:t}},x.verify=async t=>{if(Object(u.b)().preview||Object(u.c)().dev.infer){if(!t.code)return{valid:!1,message:Object(l.f)(f.a.global.answerRequired),dueToNode:t}}else{const e={valid:!1,message:Object(l.f)(f.a.verify.invalidFailed),dueToNode:t},{validateType:n}=t,{code:r,parent:i,nodeUuid:o}=t,c=()=>(t.validateFailTimes+=1,e);if("image"===n){const{serverValidations:n}=t;if(!n)return e;{const{id:t}=n;try{return await Object(b.o)({code:r},t),O}catch(t){return c()}}}else if("password"===n){const{transactionID:t}=i,e={response_id:t,question_id:o,code:r};try{return await Object(b.j)(e),O}catch(t){return c()}}else if("sms"===n){const{serverValidations:n}=t;if(!n)return e;{const{id:t}=n;try{return await Object(b.o)({code:r},t),O}catch(t){return c()}}}}return O},x.menu=x.select,x.area=t=>Object(s.n)(m(t)),x.select_icon=t=>{const e=m(t);return e.valid?v(t):Object(s.n)(e)},x.weight=t=>{if(!Object(o.i)(t)&&!Object(r.k)(t))return Object(s.n)(O);const e=m(t);if(!e.valid)return Object(s.n)(e);let{weightTotal:n}=t;n=g(t,n);const{options:i}=t;return n>i.reduce((t,e)=>t+Number(e.value),0)&&!0!==t.relax?Object(s.n)({valid:!1,message:Object(l.f)(f.a.weight.totalLimitMin,{min:n}),dueToNode:t}):Object(s.n)(O)},x.cascade=t=>{if(!Object(o.i)(t)&&!Object(r.l)(t))return Object(s.n)(O);const{cascade:e}=t,n=m(t);return n.valid?async function t(e,n,r=0){if(!n.list)return O;const o=Object(d.e)(e),{multiple:c,min:a,max:s,required:u}=n,b=n.text?Object(l.f)(f.a.menu.listItem)+n.text:Object(l.f)(f.a.menu.topList),p=n.list.filter(t=>{let e=t.selected;return o&&t.list&&(e=e&&t.list.some(t=>t.selected)),e});for(const t of p){const{option:n}=t;if(n.fillRequired&&!(n.value||"").toString().trim())return{valid:!1,dueToNode:e,message:Object(l.f)(f.a.menu.inputReq,{text:n.text})};const r=await Object(i.d)(n,e);if(!r.valid)return{...r,message:Object(l.f)(f.a.menu.inputRule,{text:n.text,rule:r.message})}}const m=p.length;if(u&&0===m&&(!o||0===r))return{valid:!1,dueToNode:e,message:Object(l.f)(f.a.menu.required,{text:b})};if(c&&m<a&&(!o||m>0))return{valid:!1,dueToNode:e,message:Object(l.f)(f.a.menu.requiredBetween,{text:b,min:a,max:s})};for(const r of n.list){if(!r.selected)continue;const n=await t(e,r,m);if(!n.valid)return n}return O}(t,e):Object(s.n)(n)},x.hot_spot=x.select,x.heat_map=t=>Object(s.n)(m(t)),x.slide_rate=x.value_mark,x.max_diff=t=>{const e=t.tasks.every(t=>t.done),n={valid:e,dueToNode:e?null:t,message:e?"":Object(l.f)(f.a.maxDiff.all)};return Object(s.n)(n)};const N=Object(s.a)(async(t,e)=>{if(e){const n=await Object(i.d)(e,t);e.errorMessage!==n.message&&T(e,n)}if(t){const e=await E([t]);e.message||T(t,e)}},250);async function E(t,e=!1){const n=[],r=t.length>1;for(const r of t){const t=await k(r,e);n.push(t)}let i=null;return n.forEach(t=>{t.valid||(r&&T(t.dueToNode,t),i||(i=t))}),i||O}},function(t,e,n){"use strict";n.d(e,"d",(function(){return R})),n.d(e,"b",(function(){return X})),n.d(e,"c",(function(){return G})),n.d(e,"a",(function(){return Y}));var r=n(4),i=n(71),o=n(12),c=n(33),a=n(56),s=n(28),u=n(74),l=n(58),d=n(19),f=n(43),b=n(11),p=n(52),O=n(17),m=n(9),g=n(44),j=n(57),h=(n(15),n(30)),y=n(8),v=n(14),w=n(20),_=n(0),x=n(2),T=n(45),I=(n(6),n(64)),k=n(1),N=n(48),E=n(3),S=n(67),L=n(72),C=n(50),P=n(10),M=n(75);const R=Object(k.a)(()=>{Object(_.b)().realTimePreview||V(null)||y.a.trigger("STRETCH_OK")});let A;function D(){return A}function U(t){const e=["region","location","area"];return t.some(t=>t.used&&e.indexOf(t.type)>-1)}function B(t){const{parsedPayload:e,userInfo:n,theme:r,hasVar:i,sid:f,langTable:p,startNode:m,surveyId:g,summary:j,language:T,images:N,langResume:E,title:S,transactionID:C,status:P,platform:R,digest:A,channel:D,customLogo:B,customText:$,useCustomLogo:H}=t,{nodeList:X,basicConfig:z,testCases:K}=e;let G=!1;Object(_.b)().offlineTaskId||z.collector&&(G=!1===z.collector.multiple_response);const{fakedServers:Y,autoCpltGroups:W,noWxShare:Z,previewShadowNodes:Q,qNumberRequired:J,asterisksRequired:tt,progressBarRequired:et,nodeTypeInfoRequired:nt,limitTime:rt,minTime:it,timeoutText:ot,timeLessText:ct,resumeEnabled:at}=m,st={previewShadowNodes:Q&&!Object(_.c)().dev.autoRun,langResume:E,langTable:p,testCases:K,progress:0,resumeEnabled:at||!!Object(_.b)().offlineTaskId,images:N,eventHub:y.a,language:T,sid:f,parsedPayload:e,digest:A,channel:D,transactionID:C,status:P,platform:R,fakedServers:Y,autoCpltGroups:W,noWxShare:Z,needRegions:U(X),theme:r,userInfo:n,responseStatus:"created",context:{question:void 0,option:void 0},completeUrl:"",quotaFullUrl:"",screenOutUrl:"",title:S,summary:j,useCustomLogo:H,customText:$,customLogo:B,bonusLimitTime:"",nodeList:X,companyID:"",oneReplyPerTerminal:G,surveyId:g,qNumberRequired:J,asterisksRequired:tt,progressBarRequired:et,nodeTypeInfoRequired:nt,preview:Object(_.b)().preview,nextBtnText:"",prevBtnText:"",prevEnabled:!1,randomList:[],loopStack:[],startTime:0,currentStartTime:0,renderList:[],current:void 0,limitTime:rt||void 0,minTime:it,timeoutText:ot||"",timeLessText:ct||"",timer:-1,restTime:Object(c.b)(rt),hasVar:i,nextLoading:!1,refreshing:!1,phoneUsed:!1,phoneNumber:"",startNode:m,nodes:[],prevButton:"",nextButton:"",inSingleGroup:null,needProgressBar:!1,first(){return Object(d.b)(this)[0]||this.current},last(){const t=Object(d.b)(this);return t[t.length-1]||this.current},async dynamicStateProps(){const t=Object(d.b)(this);Object(_.g)(this,{nodes:t});let e=null;if(Object(d.c)(this)){const t=this.first();e=t&&this.parsedPayload.nodeGroups.find(e=>e.id===t.groupId)}Object(_.g)(this,{inSingleGroup:e});const n=await Object(o.f)(this);Object(_.g)(this,{prevButton:Object(o.h)(this),nextButton:n,needProgressBar:this.progressBarRequired&&"lottery"!==this.current.type}),t.forEach((e,n)=>{e.next=t[n+1]})},handleEvents:{...I.a,handleQuickAnswer:t=>Object(L.b)(t),handleLangChange:t=>Object(k.n)(Object(x.a)(t.id,!0)),handleCascadeInput(t,e,n,r){if(V(r))return Object(k.n)();const i=Object(h.g)(t,e,n,r);return this.handleOptionInput(t,i,r).then(t=>(Object(w.c)(),t))},handleOptionAssistInput:(t,e,n,r)=>(Object(_.g)(n.assistValue,{[e]:t}),F({result:!0},r)),async handleCascadeClick(t,e,n){const r=()=>e.list.filter(t=>t.selected).map(t=>t.text);if(V(n))return r();const i=Object(h.f)(t,e,n);return i?(await this.handleOptionClick(i,n),Object(w.c)(),i.result):r()},async handleMenuClick(t,e){const n=()=>e.options.filter(t=>t.selected).map(t=>t.text);if(V(e))return n();await this.handleOptionClick(e.options[t],e);const r=n();return Object(w.c)(),r},async handleOptionClick(t,e){if(V(e))return;const n=await Object(s.b)(t,e);return n.result&&Object(b.q)(t,e),F(n,e).then(t=>(Object(w.c)(),t))},async handleOptionInput(t,e,n){if(V(n))return;const r=await Object(a.b)(t,e,n);return r.result&&Object(b.p)(t,e,n),F(r,n).then(t=>(Object(w.c)(),t))},handleAutoCpltInput:(t,e,n)=>(Object(a.a)(t,e,n),Object(k.n)(Object(b.b)(t,e,n))),handleOptionDrop(t,e,n){if(V(n))return Object(k.n)([]);const r=Object(u.a)(t,e,n);return r.result&&Object(b.r)(e,n),F(r,n).then(t=>(Object(w.c)(),t))},handleQuestionInput(t,e){if(V(e))return Object(k.n)();const n=Object(l.b)(t,e);return n.result&&Object(b.u)(t,e),F(n,e).then(t=>(Object(w.c)(),t))},handleLocateFailed(t){const e=Object(l.a)(t);return e.result&&Object(b.k)(t),F(e,t).then(t=>(Object(w.c)(),t))},handlePrevClick:()=>Object(_.b)().realTimePreview||q()||!st.prevButton||V(null)?Object(k.n)():(Object(b.t)(st.current),Object(o.i)(st).then(t=>(Object(w.c)(),t))),handleMaxDiffInput:(t,e,n,r)=>F(Object(M.a)(t,e,n,r),r).then(t=>(Object(w.c)(),t)),async handleNextClick(){if(Object(_.b)().realTimePreview||V(st.current)||q()&&Object(o.l)())return;Object(o.m)(st,!0),function(t){const{current:e,currentStartTime:n,nodes:r}=t,i=e.costTime||0,o=(new Date).getTime(),c=o-n;if(e.groupSingle&&r.length>1){const t=Math.abs(c/r.length);r.forEach(e=>{Object(_.g)(e,{costTime:t,endTime:o}),Object(v.a)(e)})}else Object(_.g)(t.current,{costTime:Math.abs(i+c),endTime:o}),Object(v.a)(t.current);Object(_.g)(t,{currentStartTime:o})}(st);const{current:t}=st;if(Object(b.n)(t),"lottery"===t.type)Object(o.k)(st,t),Object(o.m)(st,!1);else{if(await Object(o.n)(st)){if(!q())return Object(o.j)(st);Object(o.d)(st)}else Object(o.m)(st,!1)}}}};return Object.keys(st.handleEvents).forEach(t=>{const e=st.handleEvents[t];st.handleEvents[t]=async(...t)=>{Object(O.e)(st,st.current);const n=await e.apply(st.handleEvents,t);return Object(O.e)(st,st.current),n}}),st}function q(){return A.refreshing}function V(t){let e=A.nextLoading||q();return t&&(e=e&&t!==t.parent.current),e}async function F(t,e){if(await Object(d.d)(e),Object(_.b)().liteTemplate)return!1;Object(y.c)(e),Object(v.a)(e);const n=e.parent;return Object(_.b)().realTimePreview||(n.inSingleGroup?(Object(_.g)(n,{current:e}),await Object(O.f)(n,e,{type:"page_inner",delay:60})):R()),Object(y.b)(e),t.result}function $(t){const e=t;return{nodeName:e.nodeName,nodeUuid:e.nodeUuid,type:"describe",image:e.image,images:e.image?[e.image]:void 0,imgPosition:"before",imgTransTime:2e3,imgTransType:"slide",layout:e.layout}}async function H(t){if(A=t,Object(_.b)().liteTemplate)await async function(t){const{nodeList:e}=t,n=e.find(t=>"start"===t.type),r=e.find(t=>"end"===t.type),i={...$(n),questionText:n.startName,describe:n.questionText},o={...$(r),questionText:r.questionText,describe:r.describe},c=[i,...e.filter(t=>"start"!==t.type&&"end"!==t.type).sort((t,e)=>t.x>e.x?1:-1),o];let a;const s=[];for(const e of c){const n={prev:a,origin:e,...e},r=await Object(d.f)(n,t);a&&(a.next=r),a=r,s.push(r)}Object(_.g)(t,{renderList:s,nodes:s,nextButton:"",prevButton:""})}(t);else if(await z(t),function(t){let e=t.limitTime;e&&(t.timer=setInterval(()=>{e--,e||(Object(b.z)(t),clearInterval(t.timer),Object(_.b)().error(t.timeoutText||Object(x.f)(E.a.global.timeOver))),Object(_.g)(t,{restTime:Object(c.b)(e)})},1e3))}(t),t.langResume||t.resumeEnabled&&!Object(_.b)().preview){const e=Object(w.a)(t);Object(_.g)(t,{memoryTool:e,answerResumer:e}),t.langResume&&setTimeout(()=>t.answerResumer.handleSure(),1e3)}}function X(t,e={}){return t=t||D(),Object(_.g)(t,{renderList:[],current:null,loopStack:[],randomList:[],...e}),z(t)}async function z(t){Object(o.m)(t,!0);const e=t.nodeList,n=Object(r.d)(e),c=await Object(i.a)(e,t,n);!function(t,e){const n=(new Date).getTime();Object(_.g)(t,{nextBtnText:e.nextBtnText||Object(x.f)(E.a.global.next),prevBtnText:e.prevBtnText||Object(x.f)(E.a.global.previous),prevEnabled:!0===e.goBackEnabled,startTime:n,currentStartTime:n})}(t,n),await Object(o.a)(t,c,null);const{current:a}=t,s=Object(r.w)(a),u=Object(d.c)(t);if(s||u){const e=u?"page_inner":"page_next";await Object(O.f)(t,a,{type:e,initial:!0})}else Object(_.g)(t,{renderList:[a]}),await t.dynamicStateProps(),R();Object(N.a)(t);const l=t.current;return l.reached=!0,Object(b.x)(t,l),Object(v.j)(t),a!==l&&await Object(j.b)(t,{valid:!0,message:""},a,l),Object(y.c)(t.current,!0),Object(o.m)(t,!1),t}async function K(){const t=Object(_.b)().sid,e=Object(_.b)().startState;if(e||(Object(_.c)().app.gotoStartPage(Object(P.c)()),Object(_.b)().customAbort()),Object(_.b)().preview)return e;const{parsedPayload:{basicConfig:n}}=e,{payload_digest:r,channel:i,interviewee:o}=n;!function(t,e){if(!Object(_.c)().dev.autoRun&&Object(_.c)().storage.get(t)&&e&&!Object(_.b)().preview)throw Object(_.b)().error(Object(x.f)(E.a.global.antiAgain)),new Error(" _custom_abort_ _multi_reply")}(t,!1===n.collector.multiple_response);const c={code:t,payload_digest:r,platform:i.type,interviewee_id:o&&o.id};try{const t=await Object(m.g)(c);return e.transactionID=t.id,e.status=t.status,e.platform=t.platform,e.digest=r,e.channel=i,Object(_.c)().network.connectSocket(t.id,n.collector.id),e}catch(t){throw Object(m.c)(t),t}}function G(){A=null}async function Y(){const t=Object(_.c)();if(A)return A;const e=await K();await async function(t){if(Object(_.b)().preview)return;const{parsedPayload:e}=t,{basicConfig:{diagram_url:n}}=e;let r;try{r=await Object(m.p)(n)}catch(t){throw Object(_.b)().error(Object(x.f)(E.a.global.downloadError)),t}const i=await Object(S.a)(r);e.nodeList=Object(g.b)(i.nodes,e.nodeGroups);const{nodeList:o,langStore:c}=e;c&&Object(T.c)({nodes:o},c)}(e);const n=B(e);Object(_.b)().surveyState=n,await t.network.initUploader(n),await Object(C.b)(n),await async function(t){t.needRegions&&await Object(f.a)()}(n);const{startNode:{templates:r},theme:i}=n;return await t.ui.loadUiTemplates(i,r),await async function(t){const{startNode:e}=t,n=await Object(p.a)({...e,parent:t},!0);n.valid?e.passed=!0:(Object(_.b)().error(n.message||Object(x.f)(E.a.verify.failed)),Object(_.b)().customAbort())}(n),await H(n),await t.hook.afterFetchSurvey(n),n}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return l}));var r=n(21),i=n(6),o=n(11),c=n(15);async function a(t,e,n){const i=e.displayConfig;if(i){n.hasOptShowHide=!0,t.context.option=e;const c=await Object(r.b)(t,i.options,i.logicType);return c&&Object(o.o)(t,e,n),t.context.option=null,c}return!0}async function s(t,e,n){const r=[],i=[];for(const o of e){await a(t,o,n)?(o.visible=!0,r.push(o)):(o.visible=!1,i.push(o))}return{visibleList:r,hiddenList:i}}async function u(t,e,n){for(const r of e)r.visible=await a(t,r,n);return e}function l(t,e){const{renderList:n}=t,r=[];return n.forEach(t=>{if(!Object(c.e)(t.checkMode,e))return;const{hasOptShowHide:n,nodeUuid:o,loop:a}=t;if(n){const e="matrix"===t.type?Object(i.d)(t):Object(i.c)(t);let n;a&&(n=a.replacements.map(t=>t.index)),r.push({node_id:o.toLowerCase(),loop_idxs:n,option_ids:e.map(t=>t.uuid.toLowerCase())})}}),r}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(34);const i=["beforecopy","beforepaste","beforecut","copy","paste","cut","animationstart","animationend","animationiteration","transitionend","scroll","wheel","blur","click","dblclick","focus","focusin","focusout","input","keypress","keyup","keydown","select","change","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup","touchcancel","touchend","touchmove","touchstart","unload","cancel","close","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","loadedmetadata","loadeddata","durationchange","timeupdate","play","pause","ratechange","volumechange","suspend","emptied","stalled","invalid","reset","submit","invalid","reset","submit","show","contextmenu","drag","dragend","dragenter","dragexit","dragleave","dragover","dragstart","drop","webglcontextcreationerror","webglcontextlost","webglcontextrestored","error","load","loadend","loadstart","progress"];function o(t){if(!t||t.includes("data-safe-html="))return t;const e=new r.a("div");return e.setInnerHtml(t),function t(e){if("script"===e.name)e.parent&&e.parent.removeChild(e);else{i.forEach(t=>{delete e.attributes["on"+t]});for(let n=e.children.length-1;n>=0;n--){const r=e.children[n];"node"===r.type&&t(r)}}}(e),e.getInnerHtml()}},function(t,e,n){"use strict";n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"g",(function(){return f})),n.d(e,"f",(function(){return b})),n.d(e,"e",(function(){return p})),n.d(e,"b",(function(){return v})),n.d(e,"c",(function(){return w}));var r=n(1),i=n(16),o=n(22),c=n(51),a=n(7),s=n(41);let u;function l(t){const{loopStack:e}=t;return e?e[e.length-1]:null}function d(t,e,n){const{state:{loopStack:i}}=t,o=i[e];if(o){const t=o.replacements[e];if(t)return Object(r.j)(n(t))}return Object(r.j)(n())}function f(t,e){const{varInfo:{loopNodeId:n,imgSize:i},state:o}=t,c=l(o);if(!c)return Object(r.n)("");const a=p(n,c.replacements);return Object(r.j)(e(a,i))}function b(t){const e=t.split(":")[1];return function(){if(!u){const t=Object(o.a)();u=[],Object.keys(t).forEach(e=>{const{uuid:n,type:r}=t[e];"var-loop"===r&&u.push(n)})}return u}().indexOf(e)>-1}function p(t,e){return e.find(e=>Object(r.l)(e.loopNodeId,t))}function O(t,e="0:0"){if(t){let n=void 0===t.refText?t.text:t.refText;if(n.match(/^##.+##$/)&&"0:0"!==e){const t=e.split(":");n=n.replace(/\?w=0&h=0/,`?w=${t[0]||0}&h=${t[1]||0}`)}return n}return""}function m(t,e="0:0"){if(t&&t.image){const{image:n}=t;return Object(i.b)(n.url,e)}return""}function g(t){return t&&Object(a.a)(t.index+1)}function j(t){return t&&t.value}function h(t){return t&&Object(a.a)(t.number)}function y(t){return t&&t.label}function v(t){t.C_OL_TXT.getText=t=>d(t,0,O),t.C_OL_IDX.getText=t=>d(t,0,g),t.C_OL_NUM.getText=t=>d(t,0,h),t.C_OL_VAL.getText=t=>d(t,0,j),t.C_OL_LBL.getText=t=>d(t,0,y),t.C_IL_TXT.getText=t=>d(t,1,O),t.C_IL_IDX.getText=t=>d(t,1,g),t.C_IL_NUM.getText=t=>d(t,1,h),t.C_IL_VAL.getText=t=>d(t,1,j),t.C_IL_LBL.getText=t=>d(t,1,y),s.a.forEach(e=>{!function(e){const n=e.split("_")[1],r="C_IL_MAP_"+n,i=(t,n)=>d(t,n,n=>{if(!n)return"";const{mapping:r}=n;return Object(c.b)(r,e,t)});t["C_OL_MAP_"+n].getText=t=>i(t,0),t[r].getText=t=>i(t,1)}(e)})}function w(t){t.LOOP.getText=t=>f(t,O),t.LOOP_IMG.getText=t=>f(t,m),t.LOOP_INDEX.getText=t=>f(t,g),t.LOOP_NUM.getText=t=>f(t,h),t.LOOP_VAL.getText=t=>f(t,j),t.LOOP_LBL.getText=t=>f(t,y),s.a.forEach(e=>{!function(e){const n=e.split("_")[1];t["LOOP_MAP_"+n].getText=t=>f(t,n=>Object(c.b)(n.mapping,e,t))}(e)})}},function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return c})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return l}));var r=n(5),i=n(15);function o(t,e,n){const{question:r,option:i,exclusiveId:o}=t;let c=r.embedVarMaps;if(c||(c=r.embedVarMaps=[]),o){const t=c.find(t=>t.exclusiveId===o&&t.var_id===e.mapId);if(t)return void(t.value=n)}c.push({type:"embed",var_id:e.mapId,value:n,option_id:i&&i.uuid.toLowerCase(),exclusiveId:o})}function c(t){const{text:e,image:n,icon:r}=t;if(e)return e;if(n)return n.originName;if(r){const t=r.match(/#[^#]+$/);return t&&t[0]||""}return""}function a(t,e,n){t.referVarMaps||(t.referVarMaps=[]);const r=n.map(t=>({option_id:t.uuid.toLowerCase(),value:c(t),type:"ref",var_id:e.uuid}));t.referVarMaps=t.referVarMaps.concat(r)}function s(t,e){const n=t.casVarMaps=[];e.forEach(t=>{t.text&&n.push({type:"cascade",option_id:t.uuid.toLowerCase(),value:t.text})})}function u(t){if(t){let e=[];const n=[];return t.forEach(t=>{delete t.exclusiveId,t.option_id?e.push(t):n.push(t)}),e=function(t){let e=[];const n={};return t.forEach(t=>{const{var_id:e,value:r}=t;let i=n[e];i?(i.values.indexOf(r)<0&&i.values.push(r),i.maps.push(t)):i=n[e]={values:[r],maps:[t]}}),Object.keys(n).forEach(t=>{const r=n[t],{values:i,maps:o}=r;if(i.length>1)e=e.concat(o);else{const t=o[0];o.length>1&&(t.option_id="all"),e.push(t)}}),e}(e),n.concat(e)}return[]}function l(t,e){const{renderList:n}=t,o=[];return n.forEach(t=>{if(!Object(i.e)(t.checkMode,e))return;const{nodeUuid:n,loop:c}=t;let{embedVarMaps:a,referVarMaps:s,casVarMaps:l}=t;a=u(a),s=s||[],l=l||[];const d=a.concat(s,l);if(d.length>0){let t;d.forEach(t=>{t.value=Object(r.k)(t.value)}),c&&(t=c.replacements.map(t=>t.index)),o.push({node_id:n.toLowerCase(),loop_idxs:t,var_maps:d})}}),o}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=Object.keys({field_1:"",field_2:"",field_3:"",field_4:"",field_5:"",field_6:""})},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return b})),n.d(e,"d",(function(){return p})),n.d(e,"a",(function(){return O}));var r=n(39),i=n(13),o=n(16),c=n(24),a=n(6),s=n(1),u=n(41);function l(t){if(!t)return[];const e=[];return t.forEach(t=>{const n=t.reformed?t:Object(o.d)(t.id);n&&e.push(n)}),e}function d(t){const e=Object(o.d)(t.uuid);if(e)return Object(c.b)({width:e.originWidth,height:e.originHeight,name:e.serverFileName,id:e.id,originName:e.fileName})}async function f(t,e){let n=[];if(!e)return n;const r=Object(o.d)(e.uuid);if(r)return[r];if(!e)return n;if(e.value){const r=Object(i.i)(e.value);for(const e of r){const r=await f(t,Object(i.f)(t,e));n=n.concat(r)}}else{const{question:r,option:o,optionPart:c}=e;if(!r)return[];if(c){const r=(await Object(i.b)({state:t,varInfo:e,specifiedOpt:o})).map(t=>Object(a.p)(t,"image"));n=n.concat(l(r))}else n=n.concat(l(r.images))}return n}function b(t=""){return t&&"string"==typeof t?t.replace(/##(?:http|data:image).+?#(.*?)##/g,"$1"):t}function p(t=""){return t&&"string"==typeof t?t.replace(/##((?:http|data:image).+?)##/g,"$1"):t}function O(t){async function e(e,n,o){if(!e||!e.id)return[Object(c.c)(e)];if(e.reformed)return[e];if(n&&r.f(e.id))return t.LOOP_IMG.getImages(o);if("media"===e.type)return[Object(c.c)(e)];const a=o.state,s=(await f(a,Object(i.h)(a,{uuid:e.id})))[0];if(!s)return[];if(s.reformed)return[s];const{serverFileName:u,originWidth:l,originHeight:d,id:b,fileName:p}=s;return e={name:u,width:l,height:d,id:b,originName:p},[Object(c.c)(e)]}function n(t,n,r){const{varInfo:{loopNodeId:i}}=r,o=t&&t[n]||"";return"string"==typeof o?Object(s.n)([]):e(o,i,r)}t.QUES_IMAGE.getImages=async e=>{const{varInfo:{question:n,loopNodeId:o},state:a}=e,{images:s}=n;if(!s)return[];let u=[];for(const n of s)if(n.reformed)u.push(n);else if(o&&r.f(n.id)){const n=await t.LOOP_IMG.getImages(e);u=[...u,...n]}else if("media"===n.type)u.push(n);else{const t=await f(a,Object(i.h)(a,{uuid:n.id}));u=u.concat(t)}return u.map(t=>t.reformed?t:Object(c.b)({width:t.originWidth||t.width,height:t.originHeight||t.height,name:t.serverFileName||t.name,id:t.id,originName:t.originName||t.fileName}))},t.OPT_IMAGE.getImages=t=>{const{varInfo:{option:n,loopNodeId:r},specifiedOpt:i}=t,o=i||n;return e(Object(a.p)(o,"image"),r,t)},t.LOOP.getImages=t.LOOP_IMG.getImages=t=>{const{state:e,varInfo:{loopNodeId:n}}=t,i=r.d(e);if(!i)return Object(s.n)([]);const o=r.e(n,i.replacements);return o&&o.image?Object(s.n)([o.image]):Object(s.n)([])},t.OPT_ICON.getIcon=t=>t.specifiedOpt.icon,u.a.forEach(e=>{!function(e){const r=e.split("_")[1];t["OPT_MAP_"+r].getImages=t=>{const{specifiedOpt:r}=t,{mapping:i}=r;return n(i,e,t)}}(e),function(e){const r=e.split("_")[1];t["C_OPT_MAP_"+r].getImages=t=>{const{state:{context:{option:r}}}=t;if(!r)return Object(s.n)([]);const{mapping:i}=r;return n(i,e,t)}}(e),function(e){const i=e.split("_")[1],o="C_IL_MAP_"+i;function c(t,i){return r.a(t,i,r=>{if(!r)return[];const{mapping:i}=r;return n(i,e,t)})}t["C_OL_MAP_"+i].getImages=t=>c(t,0),t[o].getImages=t=>c(t,1)}(e),function(e){const i=e.split("_")[1];t["LOOP_MAP_"+i].getImages=t=>r.g(t,r=>n(r.mapping,e,t))}(e)})}},function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(9);let i;function o(t){if(i)return i;t.sort((t,e)=>t.Value-e.Value>0?1:-1);const e=[];let n,r;return t.forEach(t=>{const i=t.Value;i%1e4==0?(n={...t,id:i/1e4,cities:[]},e.push(n)):i%100==0?(r={...t,id:i/100,counties:[]},n.cities.push(r)):r.counties.push({...t,id:i})}),i=e,e}async function c(){if(i)return i;return o((await Object(r.p)("https://media.choiceform.com/dict/region.json")).provinces)}function a(t){if(!t)return"";const e=t.split("-"),n=e[0],r=i.find(t=>n.indexOf(t.Meaning)>-1);if(!r)return"";const o=r?r.Value+"":"",c=e[1];if(!c)return o;const a=r.cities.find(t=>c.indexOf(t.Meaning)>-1);if(!a)return o;const s=a?a.Value+"":"",u=e[2];if(!u)return s;const l=a.counties.find(t=>u.indexOf(t.Meaning)>-1);return(l?l.Value+"":"")||s||o||""}function s(t){const e=t.split(" ").map(t=>Number(t)),n=e.length,r=i[e[0]];let o,c,a=r.Meaning;return n>1&&(o=r.cities[e[1]],a+="-"+o.Meaning,n>2&&(c=o.counties[e[2]],a+="-"+c.Meaning)),a}},function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return l})),n.d(e,"b",(function(){return f})),n.d(e,"d",(function(){return b})),n.d(e,"a",(function(){return p}));var r=n(3),i=n(0),o=n(2),c=n(38),a=n(22);function s(t){const e=":"+Object(a.a)().LOOP_IMG.uuid;return t.indexOf("-0000-0000-0000-000000000000")&&(t=t.replace("-0000-0000-0000-000000000000",e)),t}function u(t){l(t),d(t)}function l(t){const{image:e,options:n}=t;e&&(e.id=s(e.id),t.images=[t.image],n&&n.forEach(t=>{t.image&&(t.image.id=s(t.image.id))}))}function d(t){const e=t;e.layout&&("cascade"===e.type?e.layout.optMarkOld="normal "+e.layout.optMark:e.layout.optMarkOld=e.layout.optMark)}function f(t,e){return t.filter(t=>t.used).map(t=>(l(t),t.destList=t.destList.filter(t=>!t.designOnly),function(t){const e=t;e.questionText=Object(c.a)(e.questionText),e.describe=Object(c.a)(e.describe);let n=[];e.options&&(n=n.concat(e.options)),e.otherOptions&&(n=n.concat(e.otherOptions)),e.optionsX&&(n=n.concat(e.optionsX)),e.optionsY&&(n=n.concat(e.optionsY)),n.forEach(t=>{t.text=Object(c.a)(t.text)})}(t),function(t,e){if(t.groupId){const n=e.find(e=>e.id===t.groupId);t.groupSingle=n&&n.singlePage}}(t,e),d(t),function(t){const e=(t,e,n)=>(n=n||t.length,t.forEach((t,r)=>{t.index=r+e,t.realIndex=t.index-n}),e+t.length),n=t;if("matrix"===n.type){const t=n.optionsX.length+n.refOptionsX.length,r=e(n.optionsX,0,t);e(n.refOptionsX,r,t);const i=n.optionsY.length+n.refOptionsY.length,o=e(n.optionsY,0,i);e(n.refOptionsY,o,i),e(n.otherOptions,0)}else if(n.options){let t=n.options.length;n.refOptions&&(t+=n.refOptions.length);const r=e(n.options,0,t);n.refOptions&&e(n.refOptions,r,t)}}(t),t))}function b(t){return t.forEach(t=>{t.value=Object(c.a)(t.value)}),t}function p(t){t.version||(Object(i.b)().error(Object(o.f)(r.a.global.upgrade)),Object(i.b)().customAbort()),t.version<2&&t.nodes.forEach(t=>{let e=[];t.options&&(e=e.concat(t.options)),t.otherOptions&&(e=e.concat(t.otherOptions)),e.forEach(t=>{10===t.mutexNumber&&(t.mutexNumber=-1)})})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return f})),n.d(e,"b",(function(){return b}));var r=n(1),i=n(41);const o=[{id:"ar_sa",value:"العربية"},{id:"bg_bg",value:"български"},{id:"cs_cz",value:"Česky"},{id:"da_dk",value:"Dansk"},{id:"de_de",value:"Deutsch"},{id:"el_gr",value:"Ελληνικά"},{id:"en_us",value:"English"},{id:"es_es",value:"Espanol"},{id:"et_ee",value:"Eesti"},{id:"fi_fi",value:"Suomi"},{id:"fr_fr",value:"français"},{id:"hu_hu",value:"Magyar"},{id:"it_it",value:"Italiano"},{id:"ja_jp",value:"日本語"},{id:"ko_kr",value:"한국어"},{id:"nl_nl",value:"Nederlands"},{id:"pl_pl",value:"Polski"},{id:"pt_pt",value:"Português"},{id:"ro_ro",value:"Română"},{id:"ru_ru",value:"Pусский"},{id:"sl_sl",value:"Slovenščina"},{id:"sv_se",value:"Svenska"},{id:"th_th",value:"ไทย"},{id:"zh_cn",value:"简体中文"},{id:"zh_tw",value:"繁體中文"},{id:"vi_vn",value:"Tiếng Việt Nam"}];function c(t,e){t.questionText=e.questionText||"",t.describe=e.describe||""}function a(t,e){t.mapping&&e.mapping&&i.a.forEach(n=>{const r=t.mapping[n];r&&"object"==typeof r||(t.mapping[n]=e.mapping[n]||"")})}function s(t,e){let n=[];t.options&&(n=[...n,...t.options]),t.refOptions&&(n=[...n,...t.refOptions]),t.otherOptions&&(n=[...n,...t.otherOptions]),e.options&&Object.keys(e.options).forEach(i=>{const o=n.find(t=>Object(r.s)(t.uuid)===i);o&&function(t,e,n){(function(t,e){return!t.isRef&&(!!t.isOtherOpt||!["cascade","region","area","location"].includes(e.type))})(t,n)&&(t.text=e.text||""),t.optComment=e.optComment||"",a(t,e),t.selectText=e.selectText,t.autoInputConfig&&e.autoInputConfig&&(t.autoInputConfig.defaultValue=e.autoInputConfig.defaultValue||"")}(o,e.options[i],t)})}function u(t,e){t&&e&&t.logic&&e.logic&&(t.logic.message=e.logic.message||"")}function l(t,e){c(t,e),s(t,e),u(t.validation,e.validation)}const d={};function f(t,e={}){const{nodes:n,variables:i,groups:o}=e,{nodes:c,variables:a,groups:s}=t;c&&n&&Object.keys(n).forEach(t=>{const e=n[t],i=c.find(e=>e.nodeUuid&&Object(r.s)(e.nodeUuid)===t);i&&function(t,e){const n=d[t.type];n?n(t,e):l(t,e)}(i,e)}),a&&i&&Object.keys(i).forEach(t=>{const e=i[t],n=a.find(e=>Object(r.s)(e.uuid)===t);n&&function(t,e){t.value=e.value||""}(n,e)}),s&&o&&Object.keys(o).forEach(t=>{const e=o[t],n=s.find(e=>Object(r.s)(e.id)===t);n&&function(t,e){t.prevText=e.prevText||"",t.nextText=e.nextText||""}(n,e)})}function b(t,e){t&&t.forEach(t=>{t.data.forEach(t=>{const n=t[e];n&&(t.name=n)})})}d.end=(t,e)=>{c(t,e),t.endBtnText=e.endBtnText||""},d.gift=(t,e)=>{c(t,e),t.activityName=e.activityName||"",t.endBtnText=e.endBtnText||"",t.blessings=e.questionText||""},d.loop=(t,e)=>{(e.options||t.options)&&Object.keys(e.options).forEach(n=>{const i=t.options.find(t=>Object(r.s)(t.uuid)===n);i&&(i.text=e.options[n].text)})},d.lottery=(t,e)=>{(e.options||t.options)&&Object.keys(e.options).forEach(n=>{const i=t.options.find(t=>Object(r.s)(t.uuid)===n);i&&(i.rewardName=e.options[n].rewardName)}),e.success&&(t.success.title=e.success.title||"",t.success.summary=e.success.summary||""),e.fail&&(t.fail.title=e.fail.title||"",t.fail.summary=e.fail.summary||"")},d.value_mark=(t,e)=>{l(t,e),t.minText&&(t.minText=e.minText||"",t.maxText=e.maxText||"")},d.menu=(t,e)=>{l(t,e),t.placeholder=e.placeholder||""},d.start=(t,e)=>{t.questionText=e.questionText||"",t.startName=e.startName||"",t.logoText=e.logoText||"",t.startBtnText=e.startBtnText||"",t.nextBtnText=e.nextBtnText||"",t.prevBtnText=e.prevBtnText||"",t.timeoutText=e.timeoutText||"",t.timeLessText=e.timeLessText||"",u(t.validation,e.validation)},d.slide_rate=(t,e)=>{l(t,e),(e.options||t.rateOptions)&&Object.keys(e.options).forEach(n=>{const i=t.rateOptions.find(t=>Object(r.s)(t.uuid)===n);i&&(i.text=e.options[n].text)})},d.matrix=(t,e)=>{if(c(t,e),u(t.validation,e.validation),e.options){let n=[];t.optionsX&&(n=[...n,...t.optionsX]),t.optionsY&&(n=[...n,...t.optionsY]),t.otherOptions&&(n=[...n,...t.otherOptions]);const i=t.options||[];Object.keys(e.options).forEach(t=>{const o=e.options[t],c=i.find(e=>Object(r.s)(e.uuid)===t);if(c)a(c,o);else{const e=n.find(e=>Object(r.s)(e.uuid)===t);e&&(e.text=o.text||"")}})}},d.data=(t,e)=>{s(t,e),t.options&&t.options.forEach(t=>{delete t.optComment,delete t.value})}},function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return O})),n.d(e,"a",(function(){return m}));var r=n(68),i=n(5),o=n(8),c=n(0),a=n(63),s=n(50),u=n(9),l=n(1);let d={},f=!1;const b={valid:!0,message:"",result:""};async function p(t,e,n,o,l){const{method:p,embedId:O}=e,m="embed"===p,g="fake"===p;if(Object(c.b)().realTimePreview&&!m&&!g||!function(t){const e=t.params instanceof Array;return"embed"===t.method?!(!e||!t.embedId):!(!e||!t.url)}(e))return{...b};const j=await Object(i.h)(e.url,{state:t}),h=await Object(r.b)(t,e);n&&Object.keys(n).forEach(t=>{n[t]&&(h[t]=n[t])});let y=null;if(m)y=await Object(a.a)(O,h,t);else if("fake"===p)y=await Object(s.a)(j,h,t,o,l);else{let t="GET";"post"===p&&(t="POST");const e=j+t+JSON.stringify(h);let n=l?d[e]:null;if(!n){try{const r=await Object(u.b)(Object(c.c)().dev.parseRealUrl(j),{type:t,data:h,contentType:"application/json"});n=d[e]=r}catch(e){const n=`REAL ERROR:${t} ${j} ${JSON.stringify(e)}`;throw o||Object(c.b)().error(n),n}f&&console.info({...h,url:j},n)}y=n}return y}async function O(t,e,n,r,i){const o=await p(t,e,n,r,i);return void 0===o.valid&&(o.valid=!!o.result),o.valid||o.message||(o.message="^_^"),o}async function m(t,e){try{const{request:n}=e;n&&(await p(t,n,null,!0,!1),t.endRequested=!0,o.a.trigger("END_REQ"))}catch(t){Object(l.c)(t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(4),i=n(1);const o={findNext(t,e){const{destList:n,output:o}=e;return Object(i.n)({node:Object(r.c)(t,n,o&&o.uuid)})}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return f}));var r=n(4),i=n(6),o=n(17),c=n(0);const a=["logic","loop","random","break_point","check","data","lottery","gift"];function s(t){return t&&"end"!==t.type}function u(t,e){let n;e=function t(e,n){if(!e)return e;const i=e.parentRandomId||e.circleNode1Id;return i&&(e=t(e=Object(r.a)(n,i),n)),e}(e,t);const{output:o,destList:c}=e,{outputN:a}=e,u=Object(i.c)(e);if(o&&(n=Object(r.c)(t,c,o.uuid)),!s(n))if(a)n=Object(r.c)(t,c,a.uuid);else if(u)for(const e of u)if(n=Object(r.c)(t,c,e.uuid),s(n))break;return n}function l(t){return!a.includes(t.type)&&!t.autoSkip}function d(t){const e=function(t){const e=t.renderList.filter(t=>l(t));return Object(o.b)(e,t.current)}(t),n=function(t,e){const{nodeList:n,current:r}=e;let i=t,o=u(n,r);for(;o;)l(o)&&(i+=1),o=u(n,o);return"end"!==r.type&&(i+=1),i}(e,t);if(-1===e)return{index:-1,fullLength:n,percent:0};return{percent:Math.round(e/n*100),fullLength:n,index:e}}function f(t){if(Object(c.c)().dev.infer)return;const{percent:e,index:n}=d(t);n>-1&&Object(c.g)(t,{progress:e})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}));var r=n(54),i=n(21),o=n(5),c=n(7);const a={"-1":6,"-2":8,"-3":5,"-4":7};function s(t){const{varInfo:{limit:e,limitSrc:n}}=t;return!(0===n||!e||"1:0:0"===e)}async function u(t){if(!s(t))return!0;const{varInfo:{limitSrc:e,option:n}}=t,u=t.varInfo.question,l=t.specifiedOpt||n,d=function(t,e){if(0!==e.indexOf("-"))return e;const n=e.split(":"),r=a[n[0]];n[0]=Object(c.a)(r);const i=t.options.filter(t=>t.selected).map(t=>t.number).sort();n[1]=5===r||7===r?Object(c.a)(i[i.length-1]||0):Object(c.a)(i[0]||0);return n.join(":")}(u,t.varInfo.limit),f=Object(r.a)(l,e,t),b=d.split(":"),p=Number(b[0]),O=Object(i.a)(p)?await Object(o.f)(b[1],{...t,joinBy:","}):await Object(o.g)(b[1],t),m=await Object(o.g)(b[2],t);return i.d.input(f,{markId:p,markStart:O,markEnd:m})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return d}));var r=n(0),i=n(1);let o,c={},a=!1;async function s(t,e,n,i,s){const u=t+JSON.stringify(e);if(s){const t=c[u];if(t)return t}const l=o[t];if(!l){const e="FAKE NOT FOUND:"+t;throw Object(r.b)().error(e),e}let d=null;try{if(d=await l(e,Object(r.b)()),d.exception)throw d.exception}catch(t){if(!Object(r.b)().realTimePreview){const e=`FAKE ERROR:${u} ${t.stack&&t.stack.split("\n")[0]}`;throw i||Object(r.b)().error(e),e}d={result:""}}return a&&console.info(e,d),c[u]=d,a&&console.info(JSON.stringify(e),JSON.stringify(d)),d}const u=[/^https:\/\/[^.]+\.choiceform\.com\//,/^http:\/\/localhost/];const l=[];function d(t){let e=t.fakedServers.concat(function(t){if(Object(r.b)().preview)return[];const{parsedPayload:{basicConfig:{collector:{sampler_config:e}}}}=t;return e?["committed_url","examine_failed_url","examine_skipped_url","invalid_url"].reduce((t,n)=>{const r=e[n];if(r&&0===r.indexOf("FAKE:")){const e=r.substring("FAKE:".length,r.lastIndexOf("/"));-1===t.indexOf(e)&&t.push(e)}return t},[]):[]}(t));return e=e.filter(t=>!l.includes(t)),e&&0!==e.length?new Promise((t,n)=>{const i=Object(r.c)().network.getFakeHost(),c=async a=>{i.currentSpace="",function(t){return u.some(e=>!!t.match(e))}(a)||n(new Error("can not load plugin files from untrusted site: "+a)),i.currentSpace=a;try{await Object(r.c)().network.loadFakeFile(a+".js",{crossorigin:"anonymous"})}catch(t){n(t)}return l.push(a),e.length?c(e.pop()):(o=i.fakedServers,i.currentSpace="",void t())};return c(e.pop())}):Object(i.n)()}},function(t,e,n){"use strict";n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return p}));var r=n(15),i=n(16),o=n(2),c=n(0),a=n(6),s=n(1),u=n(7),l=n(10),d=n(41),f=n(33);function b(t,e,n){const r=t&&t[e]||"";if("string"==typeof r)return r;{const{pureText:t,varInfo:{imgSize:e},specifiedOpt:o}=n;return t?o?o.text:"":Object(i.b)(r.url,e,r.originName)}}function p(t){function e(e){t["URL_KEY_"+e].getText=()=>{const t="key"+e,n=Object(l.c)()[t];return Object(s.n)(n)}}t.URL_KEY.getText=()=>{const t=Object(l.c)(),e=t.key1||t.key;return Object(s.n)(e)};for(let t=2;t<=20;t++)e(t);function n(t){const{varInfo:e,state:n}=t;let r;const i=e.question;return i&&(r=i.position&&i.position.address),r||(r=n.address),r}t.YEAR.getText=()=>Object(s.n)((new Date).getFullYear().toString()),t.MONTH.getText=()=>{const t=(new Date).getMonth()+1;return Object(s.n)(Object(f.a)(t))},t.DATE.getText=()=>{const t=(new Date).getDate();return Object(s.n)(Object(f.a)(t))},t.DAY.getText=t=>{const e=(new Date).getDay(),n="zh_cn"===t.state.language?["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][e]:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e];return Object(s.n)(n)},t.QUES_ID.getText=t=>Object(s.n)(t.state.surveyId),t.WX_ID.getText=t=>{const{state:{userInfo:e}}=t,n=e&&e.openid;return Object(s.n)(n)},t.WX_SRC.getText=()=>Object(s.n)(Object(c.c)().name),t.WX_NAME.getText=t=>{const{state:{userInfo:e}}=t,n=e&&e.nickname;return Object(s.n)(n)},t.WX_UN_ID.getText=t=>{const{state:{userInfo:e}}=t,n=e&&e.unionid;return Object(s.n)(n)},t.RES_ID.getText=t=>{const{state:e}=t;return Object(s.n)(e.transactionID)},t.CLTR_ID.getText=()=>Object(s.n)(""),t.CLTR_CODE.getText=()=>Object(c.b)().preview?Object(s.n)(""):Object(s.n)(Object(c.b)().sid),t.CLTR_NAME.getText=t=>{if(Object(c.b)().preview)return Object(s.n)("");const{state:{parsedPayload:e}}=t;if(e){const{basicConfig:{collector:{name:t}}}=e;return Object(s.n)(t)}return Object(s.n)("")},t.START_TIME.getText=t=>{const e=t.state.startTime;return Object(s.n)(Object(u.a)(e))},t.COST_TIME.getText=t=>{const e=(new Date).getTime()-t.state.startTime;return Object(s.n)(Object(u.a)(e))},t.RESULT.getText=async t=>{const{state:e}=t,n=await Object(r.b)(e,"all");return JSON.stringify(n)},t.CURR.getText=t=>{const{state:e}=t;return Object(c.b)().realTimePreview?Object(s.n)(e.language):Object(s.n)(Object(o.c)())},t.LKTP.getText=()=>{const t=Object(c.d)();return Object(s.n)(t)},t.C_OPT_TEXT.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=Object(a.p)(e,"text");return Object(s.n)(n)},t.C_OPT_NUM.getText=t=>{const{state:{context:{option:e}}}=t,n=e&&e.number;return Object(s.n)(Object(u.a)(n))},t.C_OPT_VAL.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=Object(a.p)(e,"value");return Object(s.n)(n)},t.C_OPT_LBL.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=e.label||"";return Object(s.n)(n)},t.C_OPT_IPT.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=`<input data-iptc-holder='${e.renderId}' hidden='true' />`;return Object(s.n)(n)},t.C_OPT_ASI.getText=t=>{const{state:{context:{option:e}}}=t;if(!e)return Object(s.n)("");const n=`<input data-asic-holder='${e.renderId}' hidden='true' />`;return Object(s.n)(n)},d.a.forEach(e=>{!function(e){const n=e.split("_")[1];t["C_OPT_MAP_"+n].getText=t=>{const{state:{context:{option:n}}}=t;if(!n)return Object(s.n)("");const{mapping:r}=n,i=b(r,e,t);return Object(s.n)(i)}}(e)}),t.POSITION.getText=t=>{const{state:{point:e}}=t,n=e?e.lat+","+e.lng:"";return Object(s.n)(n)},t.COUNTRY.getText=t=>{const e=n(t),r=e&&e.country;return Object(s.n)(r)},t.PROVINCE.getText=t=>{const e=n(t),r=e&&e.province;return Object(s.n)(r)},t.CITY.getText=t=>{const e=n(t);return Object(s.n)(e&&e.city)},t.DISTRICT.getText=t=>{const e=n(t);return Object(s.n)(e&&e.district)},t.QUES_IMAGE.getText=t=>{const{varInfo:e,pureText:n}=t,r=e.question,o=e.imgSize;if(n){const t=r.images.reduce((t,e)=>t+" "+e.originName,"");return Object(s.n)(t)}{const t=r.images.reduce((t,e)=>t+Object(i.b)(e.url,o,e.originName),"");return Object(s.n)(t)}},t.QUES_DESC.getText=t=>Object(s.n)(t.varInfo.question.description),t.QUES_LABEL.getText=t=>Object(s.n)(t.varInfo.question.label||""),t.QUES_TEXT.getText=t=>Object(s.n)(t.varInfo.question.title),t.QUES_NAME.getText=t=>Object(s.n)(t.varInfo.question.nodeName),t.PHONE_NUMBER.getText=t=>{const e=t.varInfo.question;return Object(s.n)(e.phoneNumber)},t.PASSWORD.getText=t=>{const e=t.varInfo.question;return Object(s.n)(e.code)},t.QUES_TIME.getText=t=>Object(s.n)(Object(u.a)(t.varInfo.question.costTime)),t.QUES_RS.getText=t=>{const e=JSON.stringify(Object(r.a)(t.varInfo.question));return Object(s.n)(e)},t.VALIDATE_FAIL_TIMES.getText=t=>{const e=t.varInfo.question.validateFailTimes+"";return Object(s.n)(e)},t.DVC_BRSN.getText=()=>{const t=Object(c.c)().system.device.browser.name||"unknown";return Object(s.n)(t)},t.DVC_BRSV.getText=()=>{const t=Object(c.c)().system.device.browser.version||"unknown";return Object(s.n)(t)},t.DVC_OSN.getText=()=>{const t=Object(c.c)().system.device.os.name||"unknown";return Object(s.n)(t)},t.DVC_OSV.getText=()=>{const t=Object(c.c)().system.device.os.version||"unknown";return Object(s.n)(t)},t.DVC_VDR.getText=()=>{const t=Object(c.c)().system.device.device.vendor||"unknown";return Object(s.n)(t)},t.DVC_MDL.getText=()=>{const t=Object(c.c)().system.device.device.model||"unknown";return Object(s.n)(t)},t.DVC_TYPE.getText=()=>{const t=Object(c.c)().system.device.device.type||"unknown";return Object(s.n)(t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var r=n(46),i=n(21),o=n(27),c=n(11),a=n(5),s=n(2),u=n(0),l=n(3),d=n(1);const f={valid:!0,message:""};async function b(t,e=!1){if(!t.parent.nextLoading&&!e)return f;t.validateFailed=!1;const{validation:n,parent:b}=t;if(!n)return f;const{request:p,logic:O,noPreventNext:m}=n;let g=await function(t,e){if(t){const{parent:n}=e;return Object(r.c)(n,t,null,!1,!1)}return Object(d.n)(f)}(p,t);return g.valid&&(g=await async function(t,e){if(t){const{logicType:n,message:r,options:o}=t;return await Object(i.b)(e,o,n)?f:{valid:!1,message:r||Object(s.f)(l.a.verify.invalidFailed)}}return f}(O,b)),g.valid||(t.validateFailed=!0,m&&(g=f,Object(c.B)(b,t)),g.dueToNode=t,await async function(t,e){if("string"!=typeof t.message)return t;const n=await Object(a.h)(t.message,{state:e});return t.message=n,Object(o.c)(t.message)||(t.message=await Object(a.d)(t.message,{state:e})),t.message.startsWith("vital:")?(t.type="vital",t.message=t.message.substr("vital:".length)):t.message.startsWith("alert:")&&(t.type="alert",t.message=t.message.substr("alert:".length)),t}(g,b),t.validateFailTimes+=1,Object(o.c)(g.message)&&(Object(u.c)().hook.beforeForceLeave(),Object(u.c)().app.openWebLink(g.message),Object(u.b)().customAbort())),g}},function(t,e,n){"use strict";n.r(e),n.d(e,"I18n",(function(){return $})),n.d(e,"EventHub",(function(){return u.a})),n.d(e,"Core",(function(){return F}));var r=n(0),i=n(5),o=n(38),c=n(44),a=n(4),s=n(18),u=n(8),l=n(2),d=n(11),f=n(45),b=n(3),p=n(29),O=n(67),m=n(9),g=n(63),j=n(1),h=n(10),y=n(16),v=n(12);let w,_;async function x(t){const e=function(t){const{mediaLibrary:e,surveyId:n,disabledLangs:r,testCases:i}=t,o=Object(c.b)(t.nodes,t.nodeGroups),s=Object(a.d)(o),u=t.langs.filter(t=>t.locale!==s.currentLang);return{imageList:e.imageList,videoList:e.videoList,nodeList:Object(c.b)(t.nodes,t.nodeGroups),theme:t.theme||{usingTheme:Object(p.b)()},nodeGroups:t.nodeGroups||[],variables:Object(c.d)(t.variables),basicConfig:_,embedApis:t.embedApis||[],varStyles:t.varStyles,surveyId:n,langs:u,language:"",langStore:null,langTable:null,langResume:!1,testCases:i,disabledLangs:r||[]}}(t),{nodeList:n,variables:i,nodeGroups:o}=e,s=e.disabledLangs,u=Object(a.d)(n),d=u.currentLang||"zh_cn",b=[d,...e.langs.map(t=>t.locale)],g=f.a.filter(t=>b.includes(t.id)&&!s.includes(t.id)),j=Object(l.c)(g,d),h=!!Object(r.c)().storage.get("lang-resume");if(h&&Object(r.c)().storage.remove("lang-resume"),await Object(l.g)(j),Object(l.d)(j),e.langTable=g,e.language=j,e.langResume=h,Object(f.b)(u.autoCpltGroups,j),j===d)return e;{const t=e.langs.find(t=>t.locale===j),r=await Object(m.p)(t.url),c=await Object(O.a)(r);return e.langStore=c,Object(f.c)({nodes:n,variables:i,groups:o},c),e}}async function T(){if(w)return w;const t=await async function(){const t=await Object(r.c)().dev.getCustomSummary();if(t)return t;{const t=Object(r.b)().sid;return Object(d.h)(),_||Object(m.f)(t)}}();!function(t){if(Object(r.b)().preview)return void(_=t);if(_)return;_=t;const{collector:{channel_configs:e}}=t,n=Object(r.c)().name,i=e.find(t=>t.type===n);if(i){if(!i.allow_response)throw Object(r.b)().error(Object(m.e)(m.a.interviewee_invalid_error)),new Error(m.a.interviewee_invalid_error);_.channel=i,Object(r.c)().auth.authorize(_)}else _.channel={type:n}}(t),await Object(r.c)().auth.init(t);const e=await async function(t){const e=await Object(r.c)().dev.getCustomSmallPayload();if(e)return e;{let e;try{e=await Object(m.p)(t.smaller_diagram_url)}catch(t){throw Object(r.b)().error(Object(l.f)(b.a.global.downloadError)),t}const n=await Object(O.a)(e);return Object(c.a)(n),n.langs=t.langs||[],n}}(t),n=await x(e),f=await async function(t){if(w)return w;const{imageList:e,nodeList:n,theme:i,variables:c,varStyles:d,surveyId:f,langResume:O}=t;Object(p.a)(i.usingTheme.client);const m=Object(a.d)(n),{imgScale:x,imgTransType:T,imgTransTime:I,imgPosition:k,welcomeUrl:N,startAuto:E,noWxShare:S,startName:L,qsnrName:C,questionText:P,describe:M,logoImage:R,useCustomLogo:A,logoText:D,startBtnText:U,hasVar:B,layout:q,template:V}=m;Object(y.f)({imageList:e,variables:c,varStyles:d}),Object(g.b)(t.embedApis),V&&await Object(r.c)().ui.loadUiTemplates(i.usingTheme,[V.id]);const F=await Object(s.a)({},m);let $="";if(R){const t=R.name;$=Object(r.b)().hostConfig.cdnHost+"/"+t}const{interviewee:H}=_,X=H?H.raw_data:Object(r.c)().auth.userInfo||{},z={template:V,langResume:O,langTable:t.langTable,eventHub:u.a,language:t.language||"zh_cn",layout:q,startNode:m,sid:Object(r.b)().sid,noWxShare:S,preview:Object(r.b)().preview,title:Object(o.a)(L||C),summary:Object(o.a)(P),description:Object(o.a)(M),images:F,surveyId:f,useCustomLogo:A,customLogo:$,customText:D||"",nextButton:U||Object(l.f)(b.a.global.start),theme:Object(p.e)(i),imgScale:x,imgPosition:k,imgTransType:T,imgTransTime:I,welcomeUrl:N,userInfo:X,hasVar:B,parsedPayload:t,startAuto:E||O,handleEvents:{handleLangChange:t=>Object(j.n)(Object(l.a)(t.id,!1)),async handleNextClick(){Object(v.m)(z,!0),await Object(r.b)().fetchSurveyState(),Object(r.c)().app.gotoSurveyPage(Object(h.c)()),Object(v.m)(z,!1)}}};return z}(n);return await async function(t){const e=t,n={state:e};t.title=await Object(i.d)(t.title,n),t.summary=await Object(i.d)(t.summary,n),t.description=await Object(i.d)(t.description,n),t.template=await Object(r.c)().ui.initNodeTemplate(t.template,e,null),Object(p.d)(t.theme),w=t,Object(u.c)({})}(f),await Object(r.c)().hook.afterFetchStart(f),(f.startAuto||Object(r.c)().dev.autoRun||Object(r.b)().liteTemplate)&&(f.hidden=!0,setTimeout(()=>{f.handleEvents.handleNextClick()})),f}var I=n(36),k=n(59),N=n(7),E=n(70),S=n.n(E);const L=()=>Object(j.n)(null),C={name:"other",dev:{parseRealUrl:t=>t,getCustomSmallPayload:L,getCustomSummary:L,local:!1,debug:!1,autoRun:!1,realtime:!1,infer:!1},app:{reload(){},openWebLink(){},canHandleReward:()=>!1,getRewardUrl:t=>Object(h.a)("https:/q.choiceform.com/reward",t)},network:{initUploader:L,connectSocket(){},closeSocket(){}},storage:null,auth:{userInfo:{},init:L,authorize(){},authorizeGift(){},retrieveAuthMeta:()=>null},hook:{afterFetchReward:L,afterFetchStart:L,afterFetchSurvey:L,afterSetup:L,beforeSetupEnd:L,beforeForceLeave(){},onLangChange(){},onSwitchPage(){},onTitleChange(){}},system:{device:{browser:{name:"",version:""},device:{type:"",vendor:"",model:""},engine:{name:"",version:""},os:{name:"",version:""}},inflate:(t,e)=>Object(j.n)(S.a.inflate(t,e)),getReferer:()=>"",getLang:()=>"zh_cn",functionConstructor:Function,translate(t,e){if(e){let n=e?Object(l.b)(t):t;return e&&Object.keys(e).forEach(t=>{n=n.replace(new RegExp(`{${t}}`,"g"),Object(N.a)(e[t]))}),n}return t}},ui:{setGlobalStyle(){},setVarStyle(){},initNodeTemplate:L,loadUiTemplates:L,getImageSize:()=>Object(j.n)({width:100,height:100})}};function P(t){return function t(e,n){Object.keys(n).forEach(r=>{const i=n[r];"object"==typeof i?e[r]?null!==i&&t(e[r],i):e[r]=i:void 0!==i&&(e[r]=i)})}(C,t),C}var M=n(34),R=n(57);const A={clientName:"ALL",key:"",dynamic:!1,treeUrl:"",templatePath:"",useWxSdk:!1,hostConfig:{qStaticHost:"https://media.choiceform.com/q-static-assets",sentryKey:"https://c2a21df7b3794fc6a8854f0a51e0e790@sentry.choiceform.io/8",recordUrl:"https://tracking.choiceform.com/api/records",host:"https://osapi.choiceform.com",wsHost:"wss://osapi.choiceform.com",cdnHost:"https://media.choiceform.com",publicHost:"https://public.choiceform.com",dictUrl:"https://media.choiceform.io/os-editor/assets/UploadFiles/Dictionary/Dictionary.js"},setTheme(){},locateError(){},langSrcMap:null,setLocale(){},customAbort(){},switchRoute:null,setter(t,e){Object.keys(e).forEach(n=>{t[n]=e[n]})}};var D=n(17),U=n(15);function B(t,e){const n=Object(r.b)().startState,o=[{title:Object(i.k)(n.title),description:Object(i.k)(n.description)}];return e.forEach(e=>{const n=Object(D.c)(t,e);if(!Object(a.w)(n)){const t={title:Object(i.k)(n.title),description:Object(i.k)(n.description),value:e.region||"",options:e.items?e.items.map(t=>({text:t.row_content||t.col_content?t.row_content+"-"+t.col_content:t.content,value:Object(U.c)(t).toString()})):[]};o.push(t)}}),o}var q=n(14);function V(){if(!F.initialized)throw new Error("CFCore not yet initialized")}const F={eventHub:u.a,notifySuspended:!1,util:{inflate:(t,e)=>S.a.inflate(t,e),convertVarStyle:y.a,richTextToNodes:M.d,getTaskInfo:async function(){const{surveyState:t,offlineTaskId:e}=Object(r.b)();if(!e||!t)return null;const n=await Object(U.b)(t,"all");return{result:n,progress:t.progress,nodes:B(t,n.answers)}}},registerEnv(t){const e=P(t);Object(r.f)(e),F.env=e},getTheme:()=>Object(p.c)(),async setup(t){if(F.initialized)return F;if(t.dynamic&&(!t.templatePath||!t.treeUrl))throw new Error("setup error, you configed your client as dynanmic, so must provide tempaltePath and treeUrl");Object.assign(F,function(t){const e={...A.hostConfig,...t.hostConfig};return Object.assign(A,{...t,hostConfig:e}),A}(t)),Object(r.a)(F.setter);const e=Object(h.c)(),n=e.sid;if(!n&&!Object(r.c)().dev.realtime)throw new Error("setup error, must provide sid");F.sid=n,F.realTimePreview=Object(r.c)().dev.realtime,F.liteTemplate=!!e.lite_template;const i=e.type;F.preview=F.realTimePreview||F.sid.length>30||"edit_template"===i||"preview_template"===i,F.preview&&(F.needPreviewFlag="1"!==e.ban_preview_bar),Object(b.f)(F.langSrcMap);const o=F.customAbort;F.customAbort=t=>{if(o&&o(),F.notifySuspended=!0,!t)throw new Error(" _custom_abort_ over")};const c=F.error;F.error=t=>{F.startState||F.rewardState||F.setTheme(Object(p.b)()),c(t),F.crashed=!0};const a=F.notify;return F.notify=t=>{F.notifySuspended||(F.startState||F.rewardState||F.setTheme(Object(p.b)()),a(t))},Object(r.c)().dev.debug&&(F.hostConfig.host="https://osapi.choiceform.com",F.hostConfig.cdnHost="https://media.choiceform.com"),F.hostConfig.qApiHost=F.hostConfig.host+"/q/v1",await Object(r.c)().hook.beforeSetupEnd(F),Object(r.e)(F),F.initialized=!0,await Object(l.g)(Object(l.c)()),await Object(r.c)().hook.afterSetup(F),await Object(r.c)().hook.beforeSetupEnd(F),F},async fetchStartState(t=""){V(),F.offlineTaskId=F.preview?"":t;const e=await T();return e.core=F,F.startState=e,Object(r.c)().hook.onTitleChange(e.title),e},async fetchSurveyState(){V(),F.startState&&Object(v.m)(F.startState,!0);const t=await Object(I.a)();return t.core=F,F.surveyState=t,Object(v.m)(F.startState,!1),Object(r.c)().hook.onTitleChange(t.title),t},async fetchRewardState(){V();const t=await Object(k.a)();return t.core=F,F.rewardState=t,Object(r.c)().hook.onTitleChange(t.quesTitle),t},reset(){F.offlineTaskId="",F.initialized=!1,w=null,_=null,F.startState=null,Object(I.c)(),F.surveyState=null,Object(k.c)(),F.rewardState=null,Object(h.f)(),Object(y.g)(),Object(R.a)(),Object(q.f)()}},$={mergeLangSrcMap:b.f,getLangSrcMap:b.d}},function(t,e,n){"use strict";n.d(e,"c",(function(){return c})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"a",(function(){return f}));var r=n(22),i=n(7),o=n(25);function c(t){return t.selected}function a(t){return!t.selected}function s(t,e){return Object(o.b)(t,e)}function u(t,e){return!Object(o.b)(t,e)}const l=(t,e,n,r=!1)=>{if(Object(i.b)(e[n]))return NaN;const o={};t.forEach(t=>{let e=(t[n]+"").replace(/(\s| )/g,"");const r=parseFloat(e);isNaN(r)||(e=r),Object(i.b)(e)||(o[e]?o[e].push(t):o[e]=[t])});const c=Object.keys(o).sort((t,e)=>{const n=Number(t),i=Number(e);return isNaN(n)||isNaN(i)?r?t>e?1:-1:t<e?1:-1:r?n>i?1:-1:n<i?1:-1});for(let t=0;t<c.length;t++){if(o[c[t]].indexOf(e)>-1)return t+1}return NaN},d={};function f(t,e,n){const i=d[e];return i?i(function(t){let e=null;const{varInfo:n}=t,i=n.question,o=n.nodePart,{selectIds:l,unselectIds:d,inputIds:f,uninputIds:b}=function(){const t=Object(r.a)(),e=[t.CHECKED_OPTS.uuid,t.RANKED_OPTS.uuid,t.MATCHED_OPTS.uuid],n=[t.UNCHECKED_OPTS.uuid,t.UNRANKED_OPTS.uuid,t.UNMATCHED_OPTS.uuid],i=[t.INPUTTED_OPTS.uuid,t.MARKED_OPTS.uuid],o=[t.UN_INPUTTED_OPTS.uuid,t.UNMARKED_OPTS.uuid];return{selectIds:e,unselectIds:n,inputIds:i,uninputIds:o}}();o&&(l.indexOf(o.uuid)>-1?e=c:d.indexOf(o.uuid)>-1?e=a:f.indexOf(o.uuid)>-1?e=s:b.indexOf(o.uuid)>-1&&(e=u));return e?i.options.filter(t=>e(t,i)):i.options}(n),t):NaN}d[1]=(t,e)=>e.number,d[14]=(t,e)=>l(t,e,"number",!0),d[15]=(t,e)=>l(t,e,"number",!1),d[2]=(t,e)=>e.text,d[12]=(t,e)=>l(t,e,"text",!0),d[13]=(t,e)=>l(t,e,"text",!1),d[3]=(t,e)=>e.value,d[4]=(t,e)=>l(t,e,"value",!0),d[5]=(t,e)=>l(t,e,"value",!1),d[6]=(t,e)=>e.sortNo,d[7]=(t,e)=>l(t,e,"sortNo",!0),d[8]=(t,e)=>l(t,e,"sortNo",!1),d[9]=(t,e)=>e.value,d[10]=(t,e)=>l(t,e,"value",!0),d[11]=(t,e)=>l(t,e,"value",!1)},function(t,e,n){"use strict";n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return p}));var r=n(5),i=n(10),o=n(8),c=n(27),a=n(9),s=n(50),u=n(1),l=n(7),d=n(68);function f(t){const e=Object(l.a)(t.result);t&&Object(c.c)(e)&&setTimeout(()=>{Object(i.d)(e)})}async function b(t,e){let n="";const{parsedPayload:{basicConfig:{collector:i}}}=t;if(!i)return;const{sampler_config:o}=i;o&&(n=o[e]||"");if(!n||0!==n.indexOf("BACKEND:"))return;const c=n.replace("BACKEND:",""),a={};for(const e of c){const[n,i]=e.split("=");a[n]=await Object(r.j)(i,t)}return a}function p(t,e){const{parsedPayload:{basicConfig:{collector:{sampler_config:n}}}}=e;if(!n||!n[t])return o.a.trigger("SAMPLER_TRANSFER",{method:"ABORT"}),Object(u.n)();const c=n[t];return 0===c.indexOf("BACKEND")?Object(u.n)():0===c.trim().indexOf("http")?async function(t,e,n){const c=await Object(r.j)(n,t,!0);Object(i.d)(c),o.a.trigger("SAMPLER_TRANSFER",{method:"LINK",url:c,type:e})}(e,t,c):async function(t,e,n){const c=n.indexOf(":"),l=n.substr(0,c).toUpperCase(),b=n.substr(c+1),p=b.indexOf("?");let O=-1===p?b:b.substr(0,p);O=await Object(r.j)(O,t,!0);let m={};if(-1!==p){const e=-1===p?"":b.substr(p);if(e){m=e?Object(i.e)(e):{};const n=Object.keys(m);for(const e of n){const n=m[e].match(/^{{(.+?)}}$/);n&&(m[e]=await Object(r.b)(n[1],t))}}}if("FAKE"===l){f(await Object(s.a)(O,Object(d.a)(m,t),t,!1,!1))}else if("GET"===l||"POST"===l){const t="GET"===l?"GET":"POST";try{f(await Object(a.q)(O,{type:t,data:m}))}catch(t){Object(u.c)("数据转移接口出错"+JSON.stringify(t))}}o.a.trigger("SAMPLER_TRANSFER",{url:O,data:m,method:l,type:e})}(e,t,c)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return b})),n.d(e,"b",(function(){return m})),n.d(e,"a",(function(){return g}));var r=n(35),i=n(4),o=n(1),c=n(0),a=n(7),s=n(26),u=n(25);const l={refresh:!1,result:!0},d={refresh:!0,result:!0},f={};function b(t,e,n){const{width:r,height:i}=e,o=n.value||"data:image/gif;base64,R0lGODlhAQABAAAAACw=";o&&Object(c.g)(t,{image:{name:void 0,ratio:Math.round(i/r*1e5)/1e5,url:o,natural:o,thumbnail:o,large:o,width:r,height:i,reformed:!0,id:"faked-id-for-upload-image",originName:"uploaded image"}})}function p(t,e){return Object(a.a)(t)!==Object(a.a)(e.value)}function O(t,e,n){return p(t,e)?(Object(c.g)(e,{value:t}),Object(s.c)(e,n),d):l}async function m(t,e,n){if(e.isOtherOpt)return O(t,e,n);{const i=f[n.type],o=i?await i(t,e,n):O(t,e,n);return o.noValidate||Object(r.b)(n,e),o}}function g(t,e,n){e.atcpTrigger=t,Object(r.b)(n,e)}f.icon_mark=(t,e,n)=>(t=t===e.value?t-1:t,Object(c.g)(e,{value:t}),Object(s.c)(e,n),Object(o.n)(d)),f.weight=(t,e,n)=>{if(!p(t,e))return Object(o.n)(l);const{options:r}=n,i=n.weightTotal,a=r.reduce((t,n)=>n!==e?t+Number(n.value):t,0),u=i-a;return t>u&&(t=u),Object(c.g)(e,{value:t}),r.forEach(t=>{const e=Number(t.value);Object(c.g)(t,{percent:e/i*100+"%"})}),Object(s.c)(e,n),Object(o.n)(d)},f.upload=async(t,e,n)=>{t||(t=Object(s.a)()),Object(c.g)(e,t),await async function(t){const{max:e}=await Object(i.g)(t),n=e===t.options.filter(e=>Object(u.b)(e,t)).length;Object(c.g)(t,{fullUploaded:n})}(n);return b(e,await Object(c.c)().ui.getImageSize(t.value),t),Object(s.c)(e,n),{refresh:!0,result:!0}},f.slide_rate=(t,e,n)=>{const r=O(t,e,n);return Object(s.c)(e,n),Object(o.n)(r)},f.fill=(t,e,n)=>{const r=O(t,e,n);return Object(o.n)(r)},f.sequence=(t,e,n)=>(Object(c.g)(e,{sortNo:t,selected:-1!==t}),Object(s.c)(e,n),Object(o.n)(d))},function(t,e,n){"use strict";n.d(e,"a",(function(){return w})),n.d(e,"b",(function(){return _}));var r=n(8),i=n(9),o=n(15),c=n(11),a=n(46),s=n(12),u=n(19),l=n(1),d=n(55),f=n(14),b=n(0),p=n(2),O=n(3),m=n(7);const g={valid:!0,message:""},j={valid:!1,message:""};let h=!1,y=!1,v=!1;function w(){h=!1,y=!1,v=!1}function _(t,e,n,w){const _=[];let I=w.prev;for(;I!==n;)_.push({prev:I,next:w}),I=(w=I).prev;return _.push({prev:I,next:w}),async function t(e,n,w){const _=w.pop(),I=await function(t,e,n,w){const _=n.checkMode,I=w.checkMode,k=w.type;"end"===k&&(clearInterval(t.timer),Object(b.g)(t,{limitTime:void 0}));if(Object(b.b)().preview)return Object(l.n)(e);if(_){if("end"===k)return async function(t,e,n){if(v)return j;Object(b.c)().network.closeSocket(),v=!0;const u=x(t,n);Object(s.m)(t,!0);try{const e=await Object(o.b)(t,"all","examine_skipped_url"),n=await Object(i.l)(e,t.transactionID);t.responseStatus=n.status}catch(e){const n=Object(m.a)(e&&e.message)||"";return n.includes(" _custom_abort_ ")?g:(Object(l.c)("skip提交失败 "+n),Object(b.b)().notify(Object(p.f)(O.a.global.tryAgain)),v=!1,Object(s.m)(t,!1),j)}r.a.trigger("CHECK_FAIL"),Object(b.c)().network.closeSocket();try{Object(f.b)(t),u||Object(c.f)(e,n,t),await Object(a.a)(t,n),Object(s.m)(t,!1),T(t),await Object(d.b)("examine_skipped_url",t)}catch(t){Object(l.c)("skip提交后续处理失败"+JSON.stringify(t))}return g}(t,n,w);if(!I)return async function(t){if(y)return j;y=!0,Object(s.m)(t,!0);const e=await Object(o.b)(t,"check","examine_skipped_url"),n=e.answers.length;try{const o=await Object(i.k)(e,t.transactionID);return Object(c.g)(t,n),Object(s.m)(t,!1),t.responseStatus=o.status,r.a.trigger("CHECK_SUBMIT"),g}catch(e){Object(f.b)(t),Object(s.m)(t,!1);const o=Object(i.d)(e);return o===i.a.quota_not_match||o===i.a.quota_full?(Object(c.v)(t,n),T(t),await Object(d.b)("examine_failed_url",t),t.responseStatus="examine_failed",r.a.trigger("QUOTA_FAIL"),Object(b.c)().network.closeSocket()):(y=!1,Object(l.c)(e.message),Object(b.b)().notify(Object(p.f)(O.a.global.tryAgain))),j}}(t)}if("end"===k)return async function(t,e,n){if(h)return j;Object(b.c)().network.closeSocket(),h=!0;const y=x(t,n)||function(t,e){const{renderList:n,startTime:r}=t,i=Math.ceil((Date.now()-r)/1e3),o=function(t,e){const n=Object(p.f)(O.a.global.notTarget),{minTime:r,timeLessText:i}=t;if(r&&r>e)return i||n;return""}(t,i);if(o){t.fakeCommitted=!0;const r=n[n.length-1];return Object(b.g)(r,{hasReward:!1,title:o}),Object(c.y)(e,t),!0}return!1}(t,n);Object(s.m)(t,!0);const v=await Object(o.b)(t,"normal","committed_url");let w;try{w=await Object(i.m)(v,t.transactionID);const e=w.response||w;t.responseStatus=e.status}catch(e){const n=Object(m.a)(e&&e.message)||"";return n.includes(" _custom_abort_ ")?g:(Object(l.c)("正式提交失败 "+n),Object(b.b)().notify(Object(p.f)(O.a.global.tryAgain)),Object(s.m)(t,!1),h=!1,j)}t.formalResult=w;try{await Object(a.a)(t,n),y?await Object(d.b)("invalid_url",t):(Object(c.i)(n,t,v.answers.length,w),w.reward&&Object(b.g)(n,{hasReward:!0}),await function(t,e){const{formalResult:{reward:n}}=e;if(!n||"red_envelope"!==n.type||n.lottery_id||Object(b.c)().app.canHandleReward())return Object(l.n)();return Object(u.a)(e,t)}(n,t),await Object(d.b)("committed_url",t))}catch(t){Object(l.c)("正式提交后续处理错误"+JSON.stringify(t))}return Object(f.b)(t),Object(s.m)(t,!1),T(t),r.a.trigger("FULL_SUBMIT"),await t.dynamicStateProps(),g}(t,0,w);return Object(l.n)(e)}(e,n,_.prev,_.next);return 0===w.length||"vital"===I.type?I:t(e,I,w)}(t,e,_)}function x(t,e){const{oneReplyPerTerminal:n,sid:r}=t;return!!e.abandonAnswer&&(t.fakeCommitted=!0,Object(c.a)(e,t),n&&Object(b.c)().storage.set(r,"1"),!0)}function T(t){const{oneReplyPerTerminal:e,sid:n}=t;e&&Object(b.c)().storage.set(n,"1")}},function(t,e,n){"use strict";n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return p}));var r=n(43),i=n(6),o=n(62),c=n(66),a=n(35),s=n(28),u=n(0),l=n(26);function d(t,e,n,r){t&&(Object(u.g)(t,{selected:!0}),e.forEach(e=>{e!==t&&Object(u.g)(e,{selected:!1})})),Object(u.g)(r,{value:n})}const f={};function b(t,e){const n=f[e.type],r=n?n(t,e):s.a;return r.noValidate||Object(a.b)(e),r}function p(t){return t.failed=!0,t.succeed=!1,t.failedSkip&&(t.failedSkipActivated=!0,t.autoSkip=!0),s.c}f.region=(t,e)=>{e.indexes=t;const n=Object(i.c)(e),c=Object(r.c)(t);d(Object(o.b)(n,c),n,c,e);const a=c.split("-"),u={country:"",province:a[0]||"",city:a[1]||"",district:a[2]||""};return e.parent.address=u,e.position={address:u},s.c},f.location=(t,e)=>{e.succeed=!0,e.failed=!1,e.failedSkipActivated=!1;const n=Object(c.b)(t.address,"-",e.infoRange),r=Object(i.c)(e);return d(Object(o.b)(r,n),r,n,e),Object(u.g)(e.parent,{point:t.point,address:t.address}),e.position=t,s.c},f.area=(t,e)=>{e.succeed=!0,e.failed=!1,e.failedSkipActivated=!1;const n=Object(c.b)(t.address,"-","street"),r=Object(i.c)(e);return d(Object(o.a)(r,t.point),r,n,e),Object(u.g)(e.parent,{point:t.point,address:t.address}),e.position=t,s.c},f.verify=(t,e)=>(Object(u.g)(e,t),{...s.c,noValidate:!0}),f.gift=(t,e)=>(Object(u.g)(e,t),s.d),f.heat_map=(t,e)=>{const n={x:Math.round(t.x),y:Math.round(t.y)},{options:r}=e,i=r[e.clickTimes%r.length];return Object(u.g)(i,{point:n,value:JSON.stringify(n)}),e.clickTimes+=1,Object(l.c)(i,e),s.d}},function(t,e,n){"use strict";n.d(e,"b",(function(){return w})),n.d(e,"c",(function(){return _})),n.d(e,"a",(function(){return x}));var r=n(4),i=n(24),o=n(33),c=n(18),a=n(5),s=n(10),u=n(1),l=n(0),d=n(2),f=n(28),b=n(58),p=n(8),O=n(11),m=n(3),g=n(29),j=n(9),h=n(64);let y=null;function v(){return JSON.parse(Object(l.c)().storage.get("theme")||"null")||Object(g.b)()}async function w(t,e,n=!1){let s;s=Object(l.b)().preview||!t.formalResult.reward?{}:t.formalResult.reward;const f=!!s.id||Object(l.b)().preview;let b,p,O={},g="",j={},h=1e3;if("gift"===e.type)b=e;else{const o=s.gift_id&&s.gift_id.toUpperCase();if(p=e,o)b=Object(r.a)(t.nodeList,o),g=((t,e,n)=>{if(!e)return"";const i=e.destList,o=e.options.find(e=>{const o=Object(r.c)(t,i,e.uuid);return Object(u.l)(o.nodeUuid,n)});return o?o.rewardName:""})(t.nodeList,p,b.nodeUuid);else{if(n)b={};else{const n=e.destList[0].destInputId;b=Object(r.b)(t.nodeList,n)}g=e.options[0].rewardName}j=((t,e,n=!1)=>{if(!e)return{};const r=Object(l.b)().realTimePreview?"":n?Object(d.f)(m.a.lottery.congratulation):Object(d.f)(m.a.lottery.pity),o=Object(l.b)().realTimePreview?"":n?Object(d.f)(m.a.lottery.goal):Object(d.f)(m.a.lottery.fail),c=n?e.success.imageWidth:e.fail.imageWidth,a=n?e.success.imageHeight:e.fail.imageHeight,s=n?e.success.imageName:e.fail.imageName,u={rewardTitle:(n?e.success.title:e.fail.title)||r,rewardDescribe:(n?e.success.summary:e.fail.summary)||o};return s&&(u.rewardImage=Object(i.b)({width:c,height:a,name:s,id:"",originName:""})),u})(0,p,f),h=((t,e,n,i=!1)=>{if(!e)return 1e3;const o=e.options,c=i?o[0]:o.find(i=>{const o=Object(r.c)(t.nodeList,e.destList,i.uuid);return Object(u.l)(o.nodeUuid,n.nodeUuid)});return c?c.rewardCount:1e3})(t,p,b,n)}if(f){const e=await Object(a.d)(b.activityName,{state:t}),n=await Object(a.d)(b.blessings,{state:t}),r=await Object(a.d)(b.describe,{state:t}),i=await Object(a.h)(b.linkUrl,{state:t});let u=s.code;u||!0!==b.needVerification||(u="1234567890"),O={goal:!0,goalId:s.id,origin:b,...b,...O,noWxShare:t.noWxShare,wxShareInfo:t.wxShareInfo,quesTitle:t.title,quesType:"reward",images:await Object(c.a)(t,b),rewardName:g,activityName:e,blessings:n,describe:r,linkUrl:i,endBtnText:b.endBtnText,rewardCount:b.giftCount,lotteryCount:h,sendTime:Object(o.c)(),verifyCode:u,rewardNodeId:b.nodeUuid,logoUrl:"",transactionID:t.transactionID,surveyId:t.surveyId,title:t.title,companyID:t.companyID,useCustomLogo:t.useCustomLogo,customText:t.customText,customLogo:t.customLogo,...j}}else O={goal:!1,...j};return Object(l.g)(t,{rewardInfo:O}),n||Object(l.c)().storage.set("reward_info",JSON.stringify(O)),O}function _(){y=null}async function x(){if(y)return y;let t;const e=v();Object(g.a)(e.client);const n=Object(s.c)();let r=function(t){const{rid:e,rtpl:n}=t;let r={};if(e)r={quesTitle:"",rewardType:"red_envelope",goalId:t.rid,images:[]};else{const t=Object(l.c)().storage.get("reward_info")||"null";r=JSON.parse(t),r.rewardType=r.giftType}n&&(r.template={id:n,name:"",component:null});return r}(n);const{rewardType:i,goalId:c}=r,a=n.code;if("red_envelope"===i){!n.rid||n.code||Object(l.b)().preview||(Object(l.c)().auth.authorizeGift(n.aid,n.cid,n),Object(l.b)().customAbort());const e=await Object(j.h)({code:a},c),{recipient:i}=e;n.rid&&(r=function(t,e,n){const{gift:r,amount:i,type:c}=e,{config:{gift_name:a}}=r;return{...t,surveyId:n.qid,transactionID:n.tid,nodeUuid:r.id,origin:{giftType:c},rewardCount:i/100,activityName:a,blessings:r.title,title:r.title,summary:r.description,describe:r.description,sendTime:Object(o.c)()}}(r,e,n));const s=i;a&&Object(l.c)().storage.set("gift-"+a,JSON.stringify(e)),Object(O.j)(r,{...r,userInfo:s});t={...await T(r),wechatImage:s.headimgurl,wechatID:s.nickname}}else t=await T(r);return y=t,await Object(l.c)().hook.afterFetchReward(t),t}async function T(t){const e=t.origin.giftType;let n=!1,r="",i="";"custom"===e?(n=!0===t.origin.needSendNote,r=t.verifyCode):i=t.rewardCount+" 元";const o=Object(l.c)().storage.get("language")||"zh_cn",c=v();t.template&&await Object(l.c)().ui.loadUiTemplates(c,[t.template.id]),await Object(d.g)(o),Object(d.d)(o),Object(g.d)(c);const a={...t,wechatID:"",wechatImage:"",eventHub:p.a,language:o,theme:c,rewardName:t.activityName,title:t.blessings,description:t.describe,summary:t.describe,nodeType:"reward",quesType:"reward",icon:"present-gift",rewardType:e,rewardTime:t.sendTime,rewardValue:i,rewardToMessage:n,qrCode:r,prevButton:Object(l.b)().preview&&!Object(l.b)().realTimePreview?Object(d.f)(m.a.global.backTest):"",nextButton:t.linkUrl&&(t.endBtnText||Object(d.f)(m.a.global.go)),handleEvents:{...h.a,handlePrevClick:()=>(Object(l.c)().app.gotoStartPage(Object(s.c)()),Object(u.n)()),handleOptionClick:async(t,e)=>(await Object(f.b)(t,e)).result,handleQuestionInput(t,e){const n=Object(b.b)(t,e);return Object(u.n)(n.result)},handleNextClick:()=>(t.linkUrl&&Object(s.d)(t.linkUrl),Object(u.n)())}};return a.template=await Object(l.c)().ui.initNodeTemplate(t.template,a,null),a}},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return d})),n.d(e,"c",(function(){return b}));var r=n(4),i=n(1),o=n(47),c=n(18),a=n(31),s=n(5),u=n(6);async function l(t,e){const n=await Object(c.e)(t,e,null,!0);return Object(a.b)(e,n)}function d(t,e,n=!1){const{loopStack:r}=e;return r.find((e,o)=>(!n||o===r.length-1)&&Object(i.l)(e.node.nodeUuid,t.nodeUuid))}async function f(t,e,n,r,i,o){const c=Object(u.i)(i),a={state:t,usage:{question:e,option:i}},l=await Object(s.f)(c.text,a,"WRAPPED_URL"),d=await Object(s.f)(i.text,a,"WRAPPED_URL"),f=await Object(s.f)(c.value+"",a,"WRAPPED_URL");return{loopNodeId:n,outerIndex:o&&o.currentIndex,outerLoopId:o&&o.node.nodeUuid,index:r,uuid:i.uuid,refOptId:i.refOptId,refText:l||void 0,text:d||"",value:f,number:c.number,image:c.image,label:i.label,mapping:i.isRef?c.mapping:i.mapping}}const b={_skip:(t,e,n)=>o.a.findNext(t,e,n),async _init(t,e,n){const{varList:o,loopStart:c,destList:a}=e;if(0===o.length)return b._skip(t,e,n);const{loopStack:s}=n,u=a.find(t=>Object(i.l)(t.selfPortId,c.uuid)).destInputId,l=Object(r.b)(t,u),d=o[0],{origin:p}=e,O=s[s.length-1],m=await f(n,e,p.nodeUuid,0,d,O),g={destInputId:u,node:p,varList:o,replacements:O?[...O.replacements,m]:[m],currentIndex:0};return s.push(g),{node:l,loop:Object(i.b)(g),loopStack:Object(i.b)(s)}},async _increase(t,e,n){const{nodeUuid:o}=e,{loopStack:c}=n,a=c[c.length-1],{varList:s,replacements:u,destInputId:l}=a,d=a.currentIndex+=1,b=s[d],p=c[c.length-2],O=await f(n,e,o,d,b,p),m=Object(r.b)(t,l);return u[u.length-1]=O,{node:m,loop:Object(i.b)(a),loopStack:Object(i.b)(c)}},async _end(t,e,n){const{loopStack:r}=n;r.pop();const c=await o.a.findNext(t,e,n);if(r.length>0){const t=Object(i.b)(r);c.loop=t[t.length-1],c.loopStack=t}return c},findNext(t,e,n){const r=d(e,n,!0);if(r){const{currentIndex:i,varList:o}=r;return i===o.length-1?b._end(t,e,n):b._increase(t,e,n)}return b._init(t,e,n)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));function r(t,e){return t.endsWith(".svg")?t:t+e}function i(t=[]){const e=[];return t.includes("video")&&e.push("video/*"),t.includes("audio")&&e.push("audio/*"),t.includes("image")&&e.push("image/*"),t.includes("doc")&&e.push("text/plain","application/json","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv",".docx",".pdf",".log"),e.join()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return c}));var r=n(66);function i(t,e){return t.find(t=>t.radius>=Object(r.a)(e,{lng:t.longitude,lat:t.latitude}))||t[t.length-1]}function o(t,e){if(0===t.length)return;const n=e.split("-");return t.find(t=>t.text.split("-").every((t,e)=>{const r=n[e];return!!(r&&r.indexOf(t)>-1)}))||t[t.length-1]}function c(t,e){const n=e.map(t=>t.Meaning).indexOf(t[0]);let r=String(n);const i=e[n];if(t[1]&&i){const e=i.cities.map(t=>t.Meaning).indexOf(t[1]);r+=" "+e;const n=i.cities[e];if(t[2]&&n){r+=""+n.counties.map(t=>t.Meaning).indexOf(t[1])}}return r}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(0),i=n(65);let o=[];function c(t){let e,n=t.code.replace(/<br>/g,"");n=`(function(){ /* embedApi.${t.name} */ ${n}})()`;try{return e=Object(i.a)(n,!0),e}catch(t){return()=>({result:"",message:""})}}function a(t){t&&(t.forEach(t=>{t.fn=c(t)}),o=t)}async function s(t,e,n){const i=function(t){const e=o.find(e=>e.id===t);return e?(e.fn||(e.fn=c(e)),e.fn):null}(t);let a;try{a=await i(e,Object(r.b)())}catch(e){const n=`EMBED ERROR:${function(t){const e=o.find(e=>e.id===t);return e?e.name:t}(t)} ${e.stack&&e.stack.split("\n")[0]}`;Object(r.b)().error(n)}return a}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r={handleInputPhone(t,e){return this.handleQuestionInput({phoneNumber:t},e)},handleInputCode(t,e){return this.handleQuestionInput({code:t},e)},handleAutoLocate(t,e){return this.handleQuestionInput(t,e)},handleManualLocate(t,e){return this.handleQuestionInput(t,e)},handleGetCodeClick(t){return this.handleOptionClick(null,t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0);function i(t,e){return new(0,Object(r.c)().system.functionConstructor)(`${e?"return":""} ${t}`)()}},function(t,e,n){"use strict";function r(t,e="-",n="street"){let r=t.province;return"province"!==n&&t.city&&(r+=e+t.city,"city"!==n&&t.district&&(r+=e+t.district,"county"!==n&&(t.street&&(r+=e+t.street),t.street_number&&(r+=t.street_number)))),r}function i(t){return t*(Math.PI/180)}function o(t,e){const n=i(e.lat-t.lat),r=i(e.lng-t.lng),o=Math.sin(n/2)*Math.sin(n/2)+Math.cos(i(t.lat))*Math.cos(i(e.lat))*Math.sin(r/2)*Math.sin(r/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))*1e3}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0);async function i(t){if("string"==typeof t){const e=Object(r.c)().system.decodeBase64(t),n=await Object(r.c)().system.inflate(e,{to:"string"});return JSON.parse(n)}return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return c}));var r=n(5),i=n(0);function o(t,e){return{_LANG_:e.language,_LINK_TYPE_:Object(i.d)(),_IS_INFER_:Object(i.c)().dev.infer?"Y":"",...t}}async function c(t,e){const{params:n}=e,i={};for(const e of n){const{name:n,value:o}=e;n.startsWith("_url_")?i[n]=await Object(r.h)(o,{state:t}):n.startsWith("_html_")?i[n]=await Object(r.d)(o,{state:t},!0):i[n]=await Object(r.f)(o,{state:t,joinBy:","},"URL")}return o(i,t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const r={actions:[]};function i(t){r.actions.push(t)}},function(t,e,n){t.exports=function t(e,n,r){function i(c,a){if(!n[c]){if(!e[c]){if(o)return o(c,!0);var s=new Error("Cannot find module '"+c+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[c]={exports:{}};e[c][0].call(u.exports,(function(t){return i(e[c][1][t]||t)}),u,u.exports,t,e,n,r)}return n[c].exports}for(var o=!1,c=0;c<r.length;c++)i(r[c]);return i}({1:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(t[r]=n[r])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),i);else for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,c;for(r=0,e=0,n=t.length;e<n;e++)r+=t[e].length;for(c=new Uint8Array(r),i=0,e=0,n=t.length;e<n;e++)o=t[e],c.set(o,i),i+=o.length;return c}},c={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,o)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,c))},n.setTyped(r)},{}],2:[function(t,e,n){"use strict";var r=t("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var c=new r.Buf8(256),a=0;a<256;a++)c[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function s(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",c=0;c<e;c++)n+=String.fromCharCode(t[c]);return n}c[254]=c[254]=1,n.string2buf=function(t){var e,n,i,o,c,a=t.length,s=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new r.Buf8(s),c=0,o=0;c<s;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?e[c++]=n:n<2048?(e[c++]=192|n>>>6,e[c++]=128|63&n):n<65536?(e[c++]=224|n>>>12,e[c++]=128|n>>>6&63,e[c++]=128|63&n):(e[c++]=240|n>>>18,e[c++]=128|n>>>12&63,e[c++]=128|n>>>6&63,e[c++]=128|63&n);return e},n.buf2binstring=function(t){return s(t,t.length)},n.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,r,i,o,a=e||t.length,u=new Array(2*a);for(r=0,n=0;n<a;)if((i=t[n++])<128)u[r++]=i;else if((o=c[i])>4)u[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<a;)i=i<<6|63&t[n++],o--;o>1?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return s(u,r)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+c[t[n]]>e?n:e}},{"./common":1}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,c=0;0!==n;){n-=c=n>2e3?2e3:n;do{o=o+(i=i+e[r++]|0)|0}while(--c);i%=65521,o%=65521}return i|o<<16|0}},{}],4:[function(t,e,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(t,e,n){"use strict";var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var o=r,c=i+n;t^=-1;for(var a=i;a<c;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}},{}],6:[function(t,e,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(t,e,n){"use strict";e.exports=function(t,e){var n,r,i,o,c,a,s,u,l,d,f,b,p,O,m,g,j,h,y,v,w,_,x,T,I;n=t.state,r=t.next_in,T=t.input,i=r+(t.avail_in-5),o=t.next_out,I=t.output,c=o-(e-t.avail_out),a=o+(t.avail_out-257),s=n.dmax,u=n.wsize,l=n.whave,d=n.wnext,f=n.window,b=n.hold,p=n.bits,O=n.lencode,m=n.distcode,g=(1<<n.lenbits)-1,j=(1<<n.distbits)-1;t:do{p<15&&(b+=T[r++]<<p,p+=8,b+=T[r++]<<p,p+=8),h=O[b&g];e:for(;;){if(b>>>=y=h>>>24,p-=y,0==(y=h>>>16&255))I[o++]=65535&h;else{if(!(16&y)){if(0==(64&y)){h=O[(65535&h)+(b&(1<<y)-1)];continue e}if(32&y){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}v=65535&h,(y&=15)&&(p<y&&(b+=T[r++]<<p,p+=8),v+=b&(1<<y)-1,b>>>=y,p-=y),p<15&&(b+=T[r++]<<p,p+=8,b+=T[r++]<<p,p+=8),h=m[b&j];n:for(;;){if(b>>>=y=h>>>24,p-=y,!(16&(y=h>>>16&255))){if(0==(64&y)){h=m[(65535&h)+(b&(1<<y)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(w=65535&h,p<(y&=15)&&(b+=T[r++]<<p,(p+=8)<y&&(b+=T[r++]<<p,p+=8)),(w+=b&(1<<y)-1)>s){t.msg="invalid distance too far back",n.mode=30;break t}if(b>>>=y,p-=y,w>(y=o-c)){if((y=w-y)>l&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(_=0,x=f,0===d){if(_+=u-y,y<v){v-=y;do{I[o++]=f[_++]}while(--y);_=o-w,x=I}}else if(d<y){if(_+=u+d-y,(y-=d)<v){v-=y;do{I[o++]=f[_++]}while(--y);if(_=0,d<v){v-=y=d;do{I[o++]=f[_++]}while(--y);_=o-w,x=I}}}else if(_+=d-y,y<v){v-=y;do{I[o++]=f[_++]}while(--y);_=o-w,x=I}for(;v>2;)I[o++]=x[_++],I[o++]=x[_++],I[o++]=x[_++],v-=3;v&&(I[o++]=x[_++],v>1&&(I[o++]=x[_++]))}else{_=o-w;do{I[o++]=I[_++],I[o++]=I[_++],I[o++]=I[_++],v-=3}while(v>2);v&&(I[o++]=I[_++],v>1&&(I[o++]=I[_++]))}break}}break}}while(r<i&&o<a);r-=v=p>>3,b&=(1<<(p-=v<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=o<a?a-o+257:257-(o-a),n.hold=b,n.bits=p}},{}],8:[function(t,e,n){"use strict";var r=t("../utils/common"),i=t("./adler32"),o=t("./crc32"),c=t("./inffast"),a=t("./inftrees");function s(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):-2}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):-2}function f(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,d(t))):-2}function b(t,e){var n,r;return t?(r=new u,t.state=r,r.window=null,0!==(n=f(t,e))&&(t.state=null),n):-2}var p,O,m=!0;function g(t){if(m){var e;for(p=new r.Buf32(512),O=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,O,0,t.work,{bits:5}),m=!1}t.lencode=p,t.lenbits=9,t.distcode=O,t.distbits=5}function j(t,e,n,i){var o,c=t.state;return null===c.window&&(c.wsize=1<<c.wbits,c.wnext=0,c.whave=0,c.window=new r.Buf8(c.wsize)),i>=c.wsize?(r.arraySet(c.window,e,n-c.wsize,c.wsize,0),c.wnext=0,c.whave=c.wsize):((o=c.wsize-c.wnext)>i&&(o=i),r.arraySet(c.window,e,n-i,o,c.wnext),(i-=o)?(r.arraySet(c.window,e,n-i,i,0),c.wnext=i,c.whave=c.wsize):(c.wnext+=o,c.wnext===c.wsize&&(c.wnext=0),c.whave<c.wsize&&(c.whave+=o))),0}n.inflateReset=d,n.inflateReset2=f,n.inflateResetKeep=l,n.inflateInit=function(t){return b(t,15)},n.inflateInit2=b,n.inflate=function(t,e){var n,u,l,d,f,b,p,O,m,h,y,v,w,_,x,T,I,k,N,E,S,L,C,P,M=0,R=new r.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(n=t.state).mode&&(n.mode=13),f=t.next_out,l=t.output,p=t.avail_out,d=t.next_in,u=t.input,b=t.avail_in,O=n.hold,m=n.bits,h=b,y=p,L=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(2&n.wrap&&35615===O){n.check=0,R[0]=255&O,R[1]=O>>>8&255,n.check=o(n.check,R,2,0),O=0,m=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&O)<<8)+(O>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&O)){t.msg="unknown compression method",n.mode=30;break}if(m-=4,S=8+(15&(O>>>=4)),0===n.wbits)n.wbits=S;else if(S>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<S,t.adler=n.check=1,n.mode=512&O?10:12,O=0,m=0;break;case 2:for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(n.flags=O,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=O>>8&1),512&n.flags&&(R[0]=255&O,R[1]=O>>>8&255,n.check=o(n.check,R,2,0)),O=0,m=0,n.mode=3;case 3:for(;m<32;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.head&&(n.head.time=O),512&n.flags&&(R[0]=255&O,R[1]=O>>>8&255,R[2]=O>>>16&255,R[3]=O>>>24&255,n.check=o(n.check,R,4,0)),O=0,m=0,n.mode=4;case 4:for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.head&&(n.head.xflags=255&O,n.head.os=O>>8),512&n.flags&&(R[0]=255&O,R[1]=O>>>8&255,n.check=o(n.check,R,2,0)),O=0,m=0,n.mode=5;case 5:if(1024&n.flags){for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.length=O,n.head&&(n.head.extra_len=O),512&n.flags&&(R[0]=255&O,R[1]=O>>>8&255,n.check=o(n.check,R,2,0)),O=0,m=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((v=n.length)>b&&(v=b),v&&(n.head&&(S=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,u,d,v,S)),512&n.flags&&(n.check=o(n.check,u,v,d)),b-=v,d+=v,n.length-=v),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===b)break t;v=0;do{S=u[d+v++],n.head&&S&&n.length<65536&&(n.head.name+=String.fromCharCode(S))}while(S&&v<b);if(512&n.flags&&(n.check=o(n.check,u,v,d)),b-=v,d+=v,S)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===b)break t;v=0;do{S=u[d+v++],n.head&&S&&n.length<65536&&(n.head.comment+=String.fromCharCode(S))}while(S&&v<b);if(512&n.flags&&(n.check=o(n.check,u,v,d)),b-=v,d+=v,S)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;m<16;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(O!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}O=0,m=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;m<32;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}t.adler=n.check=s(O),O=0,m=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=b,n.hold=O,n.bits=m,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){O>>>=7&m,m-=7&m,n.mode=27;break}for(;m<3;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}switch(n.last=1&O,m-=1,3&(O>>>=1)){case 0:n.mode=14;break;case 1:if(g(n),n.mode=20,6===e){O>>>=2,m-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}O>>>=2,m-=2;break;case 14:for(O>>>=7&m,m-=7&m;m<32;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if((65535&O)!=(O>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&O,O=0,m=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(v=n.length){if(v>b&&(v=b),v>p&&(v=p),0===v)break t;r.arraySet(l,u,d,v,f),b-=v,d+=v,p-=v,f+=v,n.length-=v;break}n.mode=12;break;case 17:for(;m<14;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(n.nlen=257+(31&O),O>>>=5,m-=5,n.ndist=1+(31&O),O>>>=5,m-=5,n.ncode=4+(15&O),O>>>=4,m-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;m<3;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.lens[A[n.have++]]=7&O,O>>>=3,m-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},L=a(0,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,L){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;T=(M=n.lencode[O&(1<<n.lenbits)-1])>>>16&255,I=65535&M,!((x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(I<16)O>>>=x,m-=x,n.lens[n.have++]=I;else{if(16===I){for(P=x+2;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(O>>>=x,m-=x,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}S=n.lens[n.have-1],v=3+(3&O),O>>>=2,m-=2}else if(17===I){for(P=x+3;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}m-=x,S=0,v=3+(7&(O>>>=x)),O>>>=3,m-=3}else{for(P=x+7;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}m-=x,S=0,v=11+(127&(O>>>=x)),O>>>=7,m-=7}if(n.have+v>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;v--;)n.lens[n.have++]=S}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,C={bits:n.lenbits},L=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,L){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},L=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,L){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(b>=6&&p>=258){t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=b,n.hold=O,n.bits=m,c(t,y),f=t.next_out,l=t.output,p=t.avail_out,d=t.next_in,u=t.input,b=t.avail_in,O=n.hold,m=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;T=(M=n.lencode[O&(1<<n.lenbits)-1])>>>16&255,I=65535&M,!((x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(T&&0==(240&T)){for(k=x,N=T,E=I;T=(M=n.lencode[E+((O&(1<<k+N)-1)>>k)])>>>16&255,I=65535&M,!(k+(x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}O>>>=k,m-=k,n.back+=k}if(O>>>=x,m-=x,n.back+=x,n.length=I,0===T){n.mode=26;break}if(32&T){n.back=-1,n.mode=12;break}if(64&T){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&T,n.mode=22;case 22:if(n.extra){for(P=n.extra;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.length+=O&(1<<n.extra)-1,O>>>=n.extra,m-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;T=(M=n.distcode[O&(1<<n.distbits)-1])>>>16&255,I=65535&M,!((x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(0==(240&T)){for(k=x,N=T,E=I;T=(M=n.distcode[E+((O&(1<<k+N)-1)>>k)])>>>16&255,I=65535&M,!(k+(x=M>>>24)<=m);){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}O>>>=k,m-=k,n.back+=k}if(O>>>=x,m-=x,n.back+=x,64&T){t.msg="invalid distance code",n.mode=30;break}n.offset=I,n.extra=15&T,n.mode=24;case 24:if(n.extra){for(P=n.extra;m<P;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}n.offset+=O&(1<<n.extra)-1,O>>>=n.extra,m-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===p)break t;if(v=y-p,n.offset>v){if((v=n.offset-v)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}v>n.wnext?(v-=n.wnext,w=n.wsize-v):w=n.wnext-v,v>n.length&&(v=n.length),_=n.window}else _=l,w=f-n.offset,v=n.length;v>p&&(v=p),p-=v,n.length-=v;do{l[f++]=_[w++]}while(--v);0===n.length&&(n.mode=21);break;case 26:if(0===p)break t;l[f++]=n.length,p--,n.mode=21;break;case 27:if(n.wrap){for(;m<32;){if(0===b)break t;b--,O|=u[d++]<<m,m+=8}if(y-=p,t.total_out+=y,n.total+=y,y&&(t.adler=n.check=n.flags?o(n.check,l,y,f-y):i(n.check,l,y,f-y)),y=p,(n.flags?O:s(O))!==n.check){t.msg="incorrect data check",n.mode=30;break}O=0,m=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;m<32;){if(0===b)break t;b--,O+=u[d++]<<m,m+=8}if(O!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}O=0,m=0}n.mode=29;case 29:L=1;break t;case 30:L=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=f,t.avail_out=p,t.next_in=d,t.avail_in=b,n.hold=O,n.bits=m,(n.wsize||y!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&j(t,t.output,t.next_out,y-t.avail_out)?(n.mode=31,-4):(h-=t.avail_in,y-=t.avail_out,t.total_in+=h,t.total_out+=y,n.total+=y,n.wrap&&y&&(t.adler=n.check=n.flags?o(n.check,l,y,t.next_out-y):i(n.check,l,y,t.next_out-y)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===h&&0===y||4===e)&&0===L&&(L=-5),L)},n.inflateEnd=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},n.inflateGetHeader=function(t,e){var n;return t&&t.state?0==(2&(n=t.state).wrap)?-2:(n.head=e,e.done=!1,0):-2},n.inflateSetDictionary=function(t,e){var n,r=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?-2:11===n.mode&&i(1,e,r,0)!==n.check?-3:j(t,e,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(t,e,n){"use strict";var r=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,n,s,u,l,d,f){var b,p,O,m,g,j,h,y,v,w=f.bits,_=0,x=0,T=0,I=0,k=0,N=0,E=0,S=0,L=0,C=0,P=null,M=0,R=new r.Buf16(16),A=new r.Buf16(16),D=null,U=0;for(_=0;_<=15;_++)R[_]=0;for(x=0;x<s;x++)R[e[n+x]]++;for(k=w,I=15;I>=1&&0===R[I];I--);if(k>I&&(k=I),0===I)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(T=1;T<I&&0===R[T];T++);for(k<T&&(k=T),S=1,_=1;_<=15;_++)if(S<<=1,(S-=R[_])<0)return-1;if(S>0&&(0===t||1!==I))return-1;for(A[1]=0,_=1;_<15;_++)A[_+1]=A[_]+R[_];for(x=0;x<s;x++)0!==e[n+x]&&(d[A[e[n+x]]++]=x);if(0===t?(P=D=d,j=19):1===t?(P=i,M-=257,D=o,U-=257,j=256):(P=c,D=a,j=-1),C=0,x=0,_=T,g=l,N=k,E=0,O=-1,m=(L=1<<k)-1,1===t&&L>852||2===t&&L>592)return 1;for(;;){h=_-E,d[x]<j?(y=0,v=d[x]):d[x]>j?(y=D[U+d[x]],v=P[M+d[x]]):(y=96,v=0),b=1<<_-E,T=p=1<<N;do{u[g+(C>>E)+(p-=b)]=h<<24|y<<16|v|0}while(0!==p);for(b=1<<_-1;C&b;)b>>=1;if(0!==b?(C&=b-1,C+=b):C=0,x++,0==--R[_]){if(_===I)break;_=e[n+d[x]]}if(_>k&&(C&m)!==O){for(0===E&&(E=k),g+=T,S=1<<(N=_-E);N+E<I&&!((S-=R[N+E])<=0);)N++,S<<=1;if(L+=1<<N,1===t&&L>852||2===t&&L>592)return 1;u[O=C&m]=k<<24|N<<16|g-l|0}}return 0!==C&&(u[g+C]=_-E<<24|64<<16|0),f.bits=k,0}},{"../utils/common":1}],10:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(t,e,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(t,e,n){"use strict";var r=t("./zlib/inflate"),i=t("./utils/common"),o=t("./utils/strings"),c=t("./zlib/constants"),a=t("./zlib/messages"),s=t("./zlib/zstream"),u=t("./zlib/gzheader"),l=Object.prototype.toString;function d(t){if(!(this instanceof d))return new d(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,e.windowBits);if(n!==c.Z_OK)throw new Error(a[n]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==c.Z_OK))throw new Error(a[n])}function f(t,e){var n=new d(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}d.prototype.push=function(t,e){var n,a,s,u,d,f=this.strm,b=this.options.chunkSize,p=this.options.dictionary,O=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?c.Z_FINISH:c.Z_NO_FLUSH,"string"==typeof t?f.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(b),f.next_out=0,f.avail_out=b),(n=r.inflate(f,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&p&&(n=r.inflateSetDictionary(this.strm,p)),n===c.Z_BUF_ERROR&&!0===O&&(n=c.Z_OK,O=!1),n!==c.Z_STREAM_END&&n!==c.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&n!==c.Z_STREAM_END&&(0!==f.avail_in||a!==c.Z_FINISH&&a!==c.Z_SYNC_FLUSH)||("string"===this.options.to?(s=o.utf8border(f.output,f.next_out),u=f.next_out-s,d=o.buf2string(f.output,s),f.next_out=u,f.avail_out=b-u,u&&i.arraySet(f.output,f.output,s,u,0),this.onData(d)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(O=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==c.Z_STREAM_END);return n===c.Z_STREAM_END&&(a=c.Z_FINISH),a===c.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c.Z_OK):a!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),f.avail_out=0,!0)},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===c.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=d,n.inflate=f,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},n.ungzip=f},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")},function(t,e,n){"use strict";n.d(e,"a",(function(){return _})),n.d(e,"b",(function(){return T}));var r=n(4);function i(t,e,n,i,o){return o||(o=Object(r.c)(t,e,n.uuid)),o||i.parentRandomId||e.length&&(o=Object(r.b)(t,e[e.length-1].destInputId)),o}var o=n(6),c=n(1);const a=["weight","slide_rate","upload","value_mark","icon_mark","fill","sequence"],s={findNext(t,e){const{destList:n,output:s}=e,u=a.indexOf(e.type)>-1?e.otherOptions:Object(o.c)(e),l=u&&u.find(t=>t.selected),d=l&&Object(r.c)(t,n,l.uuid);return Object(c.n)({node:i(t,n,s,e,d)})}},u={async findNext(t,e,n){const{destList:i}=e,c=Object(o.j)(e);let a=c&&Object(r.c)(t,i,c.uuid);return a||(a=(await s.findNext(t,e,n)).node),a||!i.length||e.parentRandomId||(a=Object(r.b)(t,i[0].destInputId)),{node:a}}};var l=n(47),d=n(21);const f={async findNext(t,e){const{options:n,logicType:i,output:o,outputN:c,destList:a,parent:s}=e,u=await Object(d.b)(s,n,i);e.logicResult=u;const l=u?o:c;return{node:Object(r.c)(t,a,l.uuid)}}};var b=n(14);function p(t,e){const{destList:n,randomStart:i}=e,o={};n.forEach((e,n)=>{if(Object(c.l)(e.selfPortId,i.uuid)){const i=Object(r.b)(t,e.destInputId).groupNumber||"N/A_"+n,a=o[i];if(a){const t=Object(c.f)(a.length+1);a.splice(t,0,e.destInputId)}else o[i]=[e.destInputId]}});const a=function(t,e){const{customDestCount:n}=e;if(!n||n>=t.length)return t;for(;t.length>n;)t.splice(Object(c.f)(t.length),1);return t}(Object.keys(o),e);let s=[];for(;a.length>0;){const t=Object(c.f)(a.length);s=s.concat(o[a[t]]),a.splice(t,1)}return s}const O={_init(t,e,n){const{origin:i}=e;let o=p(t,e);!function(t,e){const{customNodeCount:n,parent:{nodeList:i},origin:o}=e;o.csNcDone||n&&(t.forEach(t=>{const e=[];let o=Object(r.b)(i,t);for(;o;)e.push(o),o=Object(r.c)(i,o.destList,o.output.uuid);for(;e.length>n;){const t=Object(c.f)(e.length);e[t].randomAbandoned=!0,e.splice(t,1)}}),o.csNcDone=!0)}(o,e),o=Object(b.h)(o,e);let a=[];e.random&&(a=e.random.stack.concat(e.random));const s={stack:a,node:i,destPortIds:o,currentIndex:0};return n.push(s),Object(c.n)({node:Object(r.b)(t,o[0]),random:{...s}})},_increase(t,e){e.currentIndex+=1;const{currentIndex:n,destPortIds:i}=e;return Object(c.n)({node:Object(r.b)(t,i[n]),random:{...e}})},_end:(t,e,n)=>l.a.findNext(t,e,n),findNext(t,e,n){const{randomList:r}=n,{nodeUuid:i}=e,o=r.find(t=>Object(c.l)(t.node.nodeUuid,i));if(o){const{currentIndex:r,destPortIds:i}=o;return r===i.length-1?O._end(t,e,n):O._increase(t,o)}return O._init(t,e,r)}};var m=n(60);const g={findNext(t,e){const{destList:n,output:o,options:a,otherOptions:s}=e,u=[...a.filter(t=>t.selected).sort((t,e)=>t.cascadePath.length<e.cascadePath.length?1:-1),...s.filter(t=>t.selected)];let l;for(const e of u)if(l=Object(r.c)(t,n,e.uuid),l)break;return Object(c.n)({node:i(t,n,o,e,l)})}};var j=n(17);const h={cascade:g,logic:f,loop:m.c,sequence:u,random:O};["describe","check","end","start","verify","data","max_diff"].forEach(t=>{h[t]=l.a});function y(t){const e=h[t.type];if(!e)throw new Error("lack next rules for this type of node...");return e}["weight","slide_rate","upload","value_mark","icon_mark","fill","select_image","select","region","location","lottery","matrix","menu","area","select_icon","hot_spot","heat_map"].forEach(t=>{h[t]=s});const v=["check","break_point"];function w(t,e){return"loop"===t.type?!Object(m.a)(t,e):v.indexOf(t.type)<0}function _(t,e,n){return T(t,{origin:n,...n},e)}function x(t,e,n,i){const{node:o,loop:a,random:s}=i,u=e.random;if(o){const t=e.loop,{loopStack:n}=e;!a&&t&&Object(r.l)(o,e)&&(i.loopStack=n,i.loop=t),o.parentRandomId&&u&&!s&&(i.random=u)}else if(u){const e=Object(c.h)(u.node.nodeUuid,n.loopStack);return T(t,Object(j.a)(n.renderList,e),n)}return Object(c.n)(i)}async function T(t,e,n){let r,i,o=y(e),c=!0;for(;c&&(i=await x(t,e,n,await o.findNext(t,e,n)),r=i.node,r);)w(r,n)?c=!1:(e={origin:r,parent:n,...r,...i},o=y(r));return i}},function(t,e,n){"use strict";n.d(e,"b",(function(){return R})),n.d(e,"a",(function(){return A}));var r=n(4),i=n(1),o=n(6),c=n(32),a=n(5),s=n(0),u=n(36),l=n(23),d=n(7),f=n(62);async function b(t,e){const n={};t.sortNo&&(n.sortNo=-1),t.selected&&(n.selected=!1),t.value&&(n.value=""),await Object(l.d)(t,e),Object(s.g)(t,n)}async function p(t){const{video:e,options:n,otherOptions:r}=t;e&&Object(s.g)(e,{ended:!0});let i=[];n&&(i=[...i,...n]),r&&(i=[...i,...r]);for(const e of i)await b(e,t);const{cascade:o}=t;o&&await async function t(e,n){Object(s.g)(e,{selected:!1}),await Object(l.d)(e.option,n),e.list&&e.list.forEach(e=>t(e,n))}(o,t)}const O={doc:"os/client/o_1dn9kbm3u1f4d1tsudcg1fuh17678.txt",image:"os/client/o_1dn9kbq468tj1kq2dt3qeo1pumd.png",video:"os/client/o_1dn9kpohua8v1jv51oobq981dvv8.mp4",audio:"os/client/o_1dn9l7gbs1maj1e3nn941e6p125gj.mp3"},m={};function g(t){const{regions:e}=t,n=t.infoRange||"county",r=function(t){const e=x(Object(o.c)(t),1)[0];return!e||e.isOtherOpt?null:e.inferList.some(t=>t.active)?e:null}(t);if(r){const t=r.text.split("-");return{address:t,indexes:Object(f.c)(t,e),point:{lat:r.latitude,lng:r.longitude}}}{const t=Object(i.f)(e.length);let r=Object(d.a)(t);const o=e[t],c=[o.Meaning,"",""];if("province"!==n){const t=Object(i.f)(o.cities.length),e=o.cities[t];if(c[1]=e.Meaning,r=r+" "+t,"city"!==n){const t=Object(i.f)(e.counties.length),n=e.counties[t];n&&(c[2]=n.Meaning,r=r+" "+t)}}return{address:c,indexes:r,point:{lng:0,lat:0}}}}async function j(t,e){const{value:n}=await Object(c.b)(t,e);if(n)return"__FORCE_EMPTY__"===n?"":n;const{fileLimits:r}=t,o=Object(i.p)(r,1)[0];return O[o]}async function h(t,e){const n=[],r=[];t.forEach(t=>{Object(o.n)(t)?n.push(t):r.push(t)}),await T(r,e,1);const c=Object(i.g)(1,n.length);w(n,e,c)}async function y(t,e){const{parent:n,inputInferLimit:r}=e;let o=await Object(a.e)(e.fillMin,{state:n});o=o||0;let c=t.length;o&&r>o&&r<c&&(c=r);const s=o?Object(i.g)(o,c):c;return Object(i.p)(t,s)}async function v(t,e){t.parent.context.option=e;const n=await Object(c.a)(e,t);return t.parent.context.option=null,await t.parent.handleEvents.handleOptionInput(n,e,t)}function w(t,e,n){Object(i.p)(t,n).forEach(t=>v(e,t))}async function _(t,e){if(await t.parent.handleEvents.handleOptionClick(e,t),e.useComment)return v(t,e)}function x(t,e){const n=Object(l.b)(t,"select"),r=[],o=[];if(n.forEach(t=>{t.inferList.every(t=>0===Number(t.weight))||t.disabled?r.push(t):o.push(t)}),o.length>0)return Object(l.h)(o,e);{let n=t.filter(t=>!t.disabled);return r.length>0&&(n=t.filter(t=>!r.includes(t))),Object(i.p)(n,e)}}async function T(t,e,n){const r=x(t,n).sort((t,e)=>-1===t.mutexNumber||(t.mutexNumber||0)>(e.mutexNumber||0)?1:-1);for(const t of r)await _(e,t)}async function I(t,e){const{multiple:n,min:r,max:o,list:c}=t;if(!c)return;const a=function(t,e){const n=Object(l.a)(t);return n.length>0?Object(l.g)(n,e):Object(i.p)(t,e)}(c,n?Object(i.g)(r||1,o||1):1);for(const n of a){const r=c.indexOf(n);await e.parent.handleEvents.handleCascadeClick(r,t,e),await I(n,e)}}async function k(t){const e=Object(o.c)(t);let n=1;if(Object(r.s)(t)){const e=await Object(r.e)(t),{min:o}=e;let{max:c}=e;const{selectInferLimit:a}=t;a>o&&a<c&&(c=a),n=Object(i.g)(o||1,c)}const c=[],a=[];e.forEach(t=>{Object(o.n)(t)?a.push(t):c.push(t)}),await T(c,t,n);const s=Object(i.g)(1,a.length);w(a,t,s)}function N(t,e){const n=[];for(let r=t;r<=e;r++)n.push(r);return n}async function E(t,e,n){const r=[...n].sort(),{value:o,antis:a}=await Object(c.b)(t,e,1);if(o){if("__FORCE_EMPTY__"===o)return"0";{const t=r[0],e=r[r.length-1];return o<t?t:o>e?e:o}}{const t=()=>Object(i.p)(n,1)[0];return Object(c.f)(t,a)}}function S(t){let[e,n]=t.split("~").map(t=>Number(t));return e>n&&([n,e]=[e,n]),[e,n]}function L(t,e,n){const[r,o]=t.split("_");let c,a;if(r.includes("~")){const[t,e]=S(r);c=Object(i.g)(t,e)}else c=Math.min(Math.max(Number(r),0),e);if(o.includes("~")){const[t,e]=S(o);a=Object(i.g)(t,e)}else a=Math.min(Math.max(Number(o),0),n);return{x:c,y:a}}function C(t,e){const[n,r]=t.split("_").map(t=>Number(t)),[i,o]=e.split("_");let c=!1,a=!1;if(i.includes("~")){const[t,e]=S(i);c=t<=n&&n<=e}else c=Number(i)===n;if(o.includes("~")){const[t,e]=S(o);a=t<=r&&r<=e}else a=Number(o)===r;return c&&a}async function P(t,e){const{value:n,antis:r}=await Object(c.b)(t,e,1),{mapImgHeight:o,mapImgWidth:a}=e;if(n)return"__FORCE_EMPTY__"===n?null:L(n,a,o);{const t=()=>Object(i.f)(a)+"_"+Object(i.f)(o);return L(await Object(c.f)(t,r,C),a,o)}}function M(t,e){let n=e.filter(e=>!(-1!==e.sortNo||!e.inferList)&&e.inferList.some(e=>{if(!e.active)return!1;const n=Object(l.c)(e.candidates),r=Object(l.f)(n,1);return r.length>0&&Number(r[0].text)<=t}));0===n.length&&(n=e.filter(t=>-1===t.sortNo));const r=Object(i.p)(n,1)[0];r&&Object(s.g)(r,{sortNo:t,selected:!0})}async function R(t){return await Object(c.g)(),A(t)}async function A(t,e){const{type:n,readonly:r}=t;if(r)return Object(u.d)();await p(t),e&&e.beforeInfer&&await e.beforeInfer(t);const i=m[n]||k;await i(t),e&&e.afterInfer&&await e.afterInfer(t)}m.select=k,m.value_mark=async t=>{const{options:e,otherOptions:n}=t,r=await y(e,t);for(const e of r){const n=e.minValue||1,r=e.maxValue||5,i=await E(e,t,N(n,r).map(t=>Object(d.a)(t)));await t.parent.handleEvents.handleOptionInput(i,e,t)}await h(n,t)},m.heat_map=async t=>{const{options:e,otherOptions:n}=t;for(const n of e){const e=await P(n,t);e&&await t.parent.handleEvents.handleQuestionInput(e,t)}await h(n,t)},m.icon_mark=async t=>{const{options:e,otherOptions:n}=t,r=await y(e,t);for(const e of r){const n=1,r=e.count||5,i=await E(e,t,N(n,r).map(t=>Object(d.a)(t)));await t.parent.handleEvents.handleOptionInput(i,e,t)}await h(n,t)},m.slide_rate=async t=>{const{options:e,rateOptions:n,otherOptions:r}=t,i=await y(e,t),o=n.map(t=>t.value);for(const e of i){const n=await E(e,t,o);await t.parent.handleEvents.handleOptionInput(n,e,t)}await h(r,t)},m.weight=async t=>{let{weightTotal:e}=t;const{options:n,otherOptions:r}=t;e<=0&&(e=100);const o=[],c=[];n.forEach(t=>{const{inferList:e}=t;if(e){e.some(t=>t.active)?o.push(t):c.push(t)}else c.push(t)});const a=[];for(const n of o){const r=n.inferList.filter(t=>t.active),i=await Object(l.e)(r,t),o=Object(l.c)(i),c=Object(l.f)(o,1),s=Number(c[0].text);a.push(s),e-=s}const s=Object(i.o)(e,c.length),u=a.concat(s),d=o.concat(c);for(const[e,n]of d.entries()){const r=u[e];await t.parent.handleEvents.handleOptionInput(r.toString(),n,t)}await h(r,t)},m.fill=async t=>{const{options:e,otherOptions:n}=t,r=await y(e,t);for(const e of r)await v(t,e);await h(n,t)},m.sequence=async t=>{const{options:e,otherOptions:n}=t,r=e.length;let i=1;for(;i<=r;)M(i,e),i+=1;e.sort((t,e)=>t.sortNo>e.sortNo?1:-1),await h(n,t),Object(u.d)()},m.cascade=async t=>{const{cascade:e,otherOptions:n}=t;return await I(e,t),h(n,t)},m.describe=()=>(Object(u.d)(),Object(i.n)()),m.max_diff=async t=>{const e=function(t){const e=[],{options:n,itemCountPerTask:r,taskCount:i}=t,o=Math.ceil(i*r/n.length);return t.options.forEach(t=>{if(!t.inferList)return;let n=t.inferList.reduce((t,e)=>{if(e.active){t+=e.candidates.split(",").map(t=>Number(t)||0).reduce((t,e)=>t+e,0)}return t},0);n>o?n=o:n<-o&&(n=-o),n&&e.push({needValue:n,option:t})}),e}(t),{tasks:n,parent:{handleEvents:r}}=t;for(const o of n){let n=o.items.find(t=>e.find(e=>{const n=e.option===t.option&&e.needValue>0;return n&&(e.needValue-=1),n})),c=o.items.find(t=>e.find(e=>{const n=e.option===t.option&&e.needValue<0;return n&&(e.needValue+=1),n}));if(!n){const t=o.items.filter(t=>e.every(e=>e.option!==t.option));n=Object(i.p)(t,1)[0]}if(!c||c===n){const t=o.items.filter(t=>e.every(e=>e.option!==t.option)&&t!==n);c=Object(i.p)(t,1)[0]}await r.handleMaxDiffInput(1,n,o,t),await r.handleMaxDiffInput(-1,c,o,t)}},m.upload=async t=>{const{options:e,otherOptions:n}=t,{min:o,max:c}=await Object(r.g)(t),a=Object(i.g)(o||1,c),s=Object(i.p)(e,a);for(const e of s)await t.parent.handleEvents.handleOptionInput({name:await j(e,t)},e,t);await h(n,t)},m.region=t=>{const{indexes:e}=g(t);return t.parent.handleEvents.handleQuestionInput(e,t)},m.location=t=>{const{address:e,point:n}=g(t),r={address:{province:e[0],city:e[1],district:e[2],country:""},point:{lat:n.lat||Number(Object(c.c)(0,90)),lng:n.lng||Number(Object(c.c)(0,180))}};return t.parent.handleEvents.handleQuestionInput(r,t)},m.area=m.location,m.matrix=async t=>{const{options:e,flatten:n,otherOptions:o}=t,{min:c,max:a}=await Object(r.e)(t);if(Object(r.v)(t))await T(e,t,1);else if(Object(r.q)(t)){const e=[];for(const r of n){if(r.list.filter((t,n)=>!e.includes(n)).length>0){const n=x(r.list,1)[0];n&&(await _(t,n),e.push(r.list.indexOf(n)))}}}else if(Object(r.r)(t)||Object(r.p)(t))for(const e of n)await T(e.list,t,1);else if(Object(r.o)(t)||Object(r.n)(t))for(const e of n){const n=Object(i.g)(c||1,a);await T(e.list,t,n)}else if(Object(r.m)(t)){const n=Object(i.g)(c||1,a);await T(e,t,n)}await h(o,t)},m.end=()=>Object(i.n)(),m.verify=t=>t.parent.handleEvents.handleQuestionInput({phoneNumber:Object(c.d)(),code:Object(c.e)("number")},t)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(3),i=n(2);function o(){return{headimgurl:"https://media.choiceform.com/fresh_little_girl.jpg",nickname:Object(i.f)(r.a.reward.weChatName)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(35),i=n(0),o=n(26);function c(t,e,n){if(void 0===t||void 0===e)return{refresh:!1,result:[]};const{options:c}=n,a=c.length;e>a&&(e=a);const s=c.splice(t,1)[0];s&&(Object(i.g)(s,{selected:!0}),c.splice(e,0,s));const u=n.options.filter(t=>!t.selected);1===u.length&&Object(i.g)(u[0],{selected:!0});const l=[];return c.forEach((t,e)=>{t.selected&&(Object(i.g)(t,{sortNo:e+1}),l.push(e+1))}),Object(r.b)(n),Object(o.c)(s,n),{refresh:!0,result:l}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(0);function i(t,e){Object(r.g)(t,{value:e});const{option:n}=t;n.records.find(e=>e.round===t.round).value=e,Object(r.g)(n,{value:n.records.reduce((t,e)=>t+e.value,0)})}function o(t,e,n,o){if(e.value===t)return{result:!0};i(e,t),n.items.forEach(t=>{t!==e&&t.value===e.value&&i(t,0)});const c=n.items.some(t=>1===t.value),a=n.items.some(t=>-1===t.value);return Object(r.g)(n,{done:c&&a}),{result:!0}}}]));
|